/* ZATCA receipt and admin tab */
.receipt-overlay {
  position: fixed; inset: 0; background: rgba(0, 0, 0, 0.6);
  display: flex; align-items: center; justify-content: center; z-index: 1000; padding: 16px;
}
.receipt-overlay.hidden { display: none; }
.receipt-box { background: var(--card-bg, #1d2333); border-radius: 16px; padding: 20px; max-height: 95vh; overflow: auto; }
.receipt {
  width: 300px; background: #fff; color: #111; padding: 18px 16px;
  font-family: "Courier New", monospace; font-size: 13px; line-height: 1.45; border-radius: 6px;
}
.rc-center { text-align: center; }
.rc-title { font-size: 16px; font-weight: 700; }
.rc-small { font-size: 11px; color: #444; }
.rc-doc { margin: 10px 0 8px; font-weight: 700; border-top: 1px dashed #999; border-bottom: 1px dashed #999; padding: 4px 0; }
.rc-row, .rc-line { display: flex; justify-content: space-between; gap: 8px; }
.rc-line span:first-child { flex: 1; min-width: 0; }
.rc-row span:last-child, .rc-line span:last-child { white-space: nowrap; }
.rc-total { font-weight: 700; font-size: 15px; margin-top: 4px; }
.rc-sep { border-top: 1px dashed #999; margin: 8px 0; }
.rc-qr { width: 170px; height: 170px; margin: 12px auto 6px; display: block; image-rendering: pixelated; }
.rc-status { margin-top: 14px; text-align: center; }
.rc-actions { display: flex; gap: 10px; justify-content: center; margin-top: 14px; }

.zatca-chip { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.zs-ok { background: rgba(46, 204, 113, 0.18); color: #2ecc71; }
.zs-warn { background: rgba(241, 196, 15, 0.18); color: #f1c40f; }
.zs-bad { background: rgba(231, 76, 60, 0.18); color: #e74c3c; }
.zs-pending { background: rgba(149, 165, 166, 0.2); color: #b0b8bf; }
.zatca-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }

@media print {
  body * { visibility: hidden; }
  #receiptPrintArea, #receiptPrintArea * { visibility: visible; }
  #receiptPrintArea { position: absolute; left: 0; top: 0; width: 72mm; border-radius: 0; padding: 0; }
  .no-print { display: none !important; }
}

.rc-doc { font-family: 'IBM Plex Sans Arabic', 'Courier New', monospace; }

@media (max-height: 820px) {
  .receipt { padding: 12px 14px; font-size: 12px; line-height: 1.35; }
  .rc-qr { width: 130px; height: 130px; margin: 8px auto 4px; }
  .rc-doc { margin: 6px 0; }
  .rc-actions, .rc-status { margin-top: 10px; }
}

/* Phones: invoice rows stack so the number, amount and buttons stay readable */
@media (max-width: 600px) {
  .zdoc-row { flex-wrap: wrap; gap: 10px; }
  .zdoc-row > div:first-child { flex: 1 1 100%; min-width: 0; }
  .zdoc-actions { flex-wrap: wrap; width: 100%; }
  .zdoc-actions .btn { min-height: 40px; }
  .zdoc-actions > span:first-child { margin-inline-end: auto; }
}
