/* Print: invoices, statements and reports */
@page { margin: 14mm; }
/* Paper is always white: in dark mode (system or data-theme) force the LIGHT palette so nothing prints as a dark
   frame or light-grey text. Same values as the light theme in tokens.css (slightly darker greys for ink). */
:root, :root[data-theme='dark'], :root:not([data-theme='light']) {
  color-scheme: light !important;
  --brand: #0F766E; --brand-strong: #0B5E57; --brand-hover: #0D6A63; --brand-soft: #D2EBE6; --brand-softer: #E7F3F0;
  --brand-ink: #FFFFFF; --brand-glow: transparent;
  --accent: #D97706; --accent-strong: #B45309; --accent-soft: #FBEFD5; --accent-ink: #78350F;
  --bg: #FFFFFF; --bg-deep: #FFFFFF; --bg-elevated: #FFFFFF;
  --surface: #FFFFFF; --surface-2: #F3F5F4; --surface-3: #E8ECEA; --overlay: transparent;
  --text: #000000; --text-2: #333333; --text-3: #555555; --text-inverse: #FFFFFF;
  --border: #D6DCDA; --border-strong: #B5C4BF; --focus: #0F766E;
  --danger: #B42318; --danger-soft: #FBE4E1; --danger-ink: #8C1B12;
  --warn: #B45309; --warn-soft: #FBEFD5; --warn-ink: #78350F;
  --ok: #0F766E; --ok-soft: #D2EBE6; --ok-ink: #0B5E57;
  --info: #0F766E; --info-soft: #E2F1ED; --info-ink: #0B5E57;
  --debt: #B42318; --debt-soft: #FBE4E1; --debt-solid: #B42318; --payment: #0F766E; --payment-soft: #D2EBE6;
  --shadow-sm: none; --shadow-md: none; --shadow-lg: none; --card-shadow: none;
  --gold: #F59E0B; --gold-2: #FBBF24; --gold-ink: #78350F;
  --line-color: transparent; --glow: transparent;
}
html, body, .shell, .main, .screen, .doc-page, .doc { background: #fff !important; color: #000 !important; box-shadow: none !important; }
.topbar, .no-print, .bottom-nav, .sidebar, .banners, .toasts, .sheet-overlay { display: none !important; }
.main { background: none !important; padding: 0 !important; }
.doc-page { background: #fff !important; }
.doc { max-width: none; margin: 0 !important; padding: 0 !important; border: 0 !important; border-radius: 0 !important; box-shadow: none !important; outline: 0 !important; }
.doc-table th, .doc-table td { border-color: #ddd !important; }
.doc-foot { color: #444 !important; }
.debt-color { color: #B42318 !important; }
.payment-color { color: #0F766E !important; }
.doc-customer { background: #f5f5f5 !important; }
.doc-qr { background: #fff !important; border: 1px solid #ddd; break-inside: avoid; }
.card, .acc, .kpi { box-shadow: none !important; }
a { color: inherit; text-decoration: none; }

/* V5: rows never split across pages; the quiet tools never print. */
.doc-table tr { break-inside: avoid; }
.doc-tools { display: none !important; }
.doc-mark.late { color: #B42318 !important; }
/* 80 mm receipt printers (and any page narrower than 100 mm): small margins, one column of meta, tighter table,
   optional columns (e.g. the original amount on «فاتورة بالمستحق») dropped. */
@media print and (max-width: 100mm) {
  @page { margin: 3mm; }
  .doc { font-size: 11px; }
  .doc-logo, .doc-logo-ph { width: 34px !important; height: 34px !important; border-radius: 8px; }
  .doc-head { padding-bottom: 8px; }
  .doc-shop { font-size: 15px; }
  .doc-title { font-size: 16px; }
  .doc-meta { flex-direction: column; gap: 4px; margin: 8px 0; }
  .doc-meta .end { text-align: start; }
  .doc-customer { padding: 6px 8px; margin-bottom: 8px; }
  .doc-table th, .doc-table td { padding: 4px 2px; font-size: 10.5px; }
  .doc-table td.money { white-space: normal; }
  .doc-table .col-opt { display: none; }
  .doc-sub, .doc-mark, .doc .small, .doc .xs { font-size: 9.5px; }
  .doc-totals, [dir='rtl'] .doc-totals { max-width: none; margin: 10px 0 0; }
  .doc-total { font-size: 13px; }
  .doc-words { margin-top: 8px; padding: 6px 8px; }
  .doc-qr { margin-top: 10px; padding: 6px; gap: 8px; }
  .doc-qr .qr { width: 70px; }
  .doc-foot { margin-top: 12px; padding-top: 8px; }
}
