:root[data-theme="calm-green"]{color-scheme:light;--bg:#f3f6f4;--paper:#fff;--ink:#172824;--muted:#596b63;--line:#d8e2dc;--deep:#10251f;--deep2:#18362d;--green:#13764e;--green-pale:#e7f5ee;--blue:#245f9c;--blue-pale:#eaf1fb;--violet:#5c4ca5;--violet-pale:#f0edfb;--amber:#80520b;--amber-pale:#fbf2e4;--red:#9c3431;--shadow:0 8px 22px rgba(20,54,41,.05)}
:root[data-theme="warm-paper"]{color-scheme:light;--bg:#f3eee5;--paper:#fffaf2;--ink:#28251f;--muted:#625b51;--line:#d8cfc1;--deep:#263a35;--deep2:#344d45;--green:#146844;--green-pale:#e5f0e7;--blue:#315d87;--blue-pale:#e8eff5;--violet:#685692;--violet-pale:#f0ebf5;--amber:#81510c;--amber-pale:#f6ead3;--red:#983a36;--shadow:0 7px 20px rgba(52,42,27,.045)}
:root[data-theme="cool-slate"]{color-scheme:light;--bg:#edf2f7;--paper:#fff;--ink:#17263a;--muted:#52667c;--line:#cdd8e4;--deep:#142438;--deep2:#203952;--green:#126b50;--green-pale:#e5f3ed;--blue:#245f9c;--blue-pale:#e7eff9;--violet:#5d509b;--violet-pale:#efedf8;--amber:#80520b;--amber-pale:#f8f0e0;--red:#9c3431;--shadow:0 8px 22px rgba(25,47,70,.055)}
:root[data-theme="light-high-contrast"]{color-scheme:light;--bg:#f0f0f0;--paper:#fff;--ink:#101010;--muted:#292929;--line:#505050;--deep:#050505;--deep2:#181818;--green:#005b36;--green-pale:#d9f4e5;--blue:#004c92;--blue-pale:#dceeff;--violet:#4a2b83;--violet-pale:#eee5ff;--amber:#714500;--amber-pale:#ffefc7;--red:#a00000;--shadow:none}
:root[data-theme="dark-high-contrast"]{color-scheme:dark;--bg:#090d12;--paper:#111923;--ink:#f7f9fc;--muted:#d5dfeb;--line:#718297;--deep:#000;--deep2:#121d29;--green:#64f0ab;--green-pale:#113c2a;--blue:#8dccff;--blue-pale:#122f49;--violet:#c3a6ff;--violet-pale:#2c2144;--amber:#ffd36d;--amber-pale:#40320d;--red:#ff8984;--shadow:none}

html[data-theme] body{background:var(--bg);color:var(--ink)}
.theme-select{max-width:154px;height:36px;border:1px solid var(--line);border-radius:8px;padding:0 9px;background:var(--paper);color:var(--ink);font:inherit;font-size:11px}
html[data-theme] :focus-visible{outline:3px solid var(--blue);outline-offset:2px}
html[data-theme="warm-paper"] .main,html[data-theme="cool-slate"] .main{background:var(--bg)}
html[data-theme="warm-paper"] .auth-submit,html[data-theme="cool-slate"] .auth-submit{background:var(--green)}
html[data-theme="light-high-contrast"] .panel,html[data-theme="light-high-contrast"] .kpi,html[data-theme="light-high-contrast"] .flow-card{border-width:2px}
html[data-theme="light-high-contrast"] .notice{background:#fff;border:2px solid #333;color:#111}
html[data-theme="light-high-contrast"] .notice b,html[data-theme="light-high-contrast"] .form-grid label,html[data-theme="light-high-contrast"] .po-line label,html[data-theme="light-high-contrast"] .mini-form label{color:#111}
html[data-theme="light-high-contrast"] input,html[data-theme="light-high-contrast"] select,html[data-theme="light-high-contrast"] textarea{border:2px solid #333!important;color:#111!important;background:#fff!important}
html[data-theme="light-high-contrast"] .nav{color:#e5e5e5}
html[data-theme="light-high-contrast"] .nav:hover,html[data-theme="light-high-contrast"] .nav.active{background:#292929;color:#fff}
html[data-theme="light-high-contrast"] .auth-submit{background:#005b36;color:#fff;border:2px solid #002c1a}
html[data-theme="dark-high-contrast"] .notice{background:#102219;border:2px solid #64f0ab;color:#f7f9fc}
html[data-theme="dark-high-contrast"] .notice b,html[data-theme="dark-high-contrast"] .form-grid label,html[data-theme="dark-high-contrast"] .po-line label,html[data-theme="dark-high-contrast"] .approval-box label,html[data-theme="dark-high-contrast"] .mini-form label{color:#fff}
html[data-theme="dark-high-contrast"] input,html[data-theme="dark-high-contrast"] select,html[data-theme="dark-high-contrast"] textarea{border:2px solid #9aabc0!important;color:#fff!important;background:#090d12!important;color-scheme:dark}
html[data-theme="dark-high-contrast"] .table-wrap th{color:#fff;background:#1b2836}
html[data-theme="dark-high-contrast"] .table-wrap td,html[data-theme="dark-high-contrast"] .td-main,html[data-theme="dark-high-contrast"] .td-sub{color:#f2f6fb}
html[data-theme="dark-high-contrast"] .notice b,html[data-theme="dark-high-contrast"] .nav-group{color:#b9f8d7}
html[data-theme="dark-high-contrast"] .pill,html[data-theme="dark-high-contrast"] .badge{border:1px solid #8fa2b8}
html[data-theme="dark-high-contrast"] .badge-pending,html[data-theme="dark-high-contrast"] .pill.warn{background:#40320d;color:#ffe08a;border-color:#ffe08a}
html[data-theme="dark-high-contrast"] .pill.success,html[data-theme="dark-high-contrast"] .live-tag{background:#123b2b;color:#8dffc2;border-color:#64f0ab}
html[data-theme="dark-high-contrast"] .error,html[data-theme="dark-high-contrast"] .warn-text{background:#3b1111;color:#ffd0cc;border-color:#ff8984}
html[data-theme="dark-high-contrast"] .auth-card{background:#111923;color:#f7f9fc;border:1px solid #718297}
html[data-theme="dark-high-contrast"] .auth-copy,html[data-theme="dark-high-contrast"] .auth-field{color:#d5dfeb}
html[data-theme="dark-high-contrast"] .auth-submit{background:#176c4c;color:#fff;border:2px solid #64f0ab}
html[data-theme="dark-high-contrast"] .auth-link{color:#8dccff}
@media(max-width:1050px){.theme-select{max-width:130px}}
@media(max-width:760px){.theme-select{max-width:100%;min-width:135px}}

@media print{body.printing-report *{visibility:hidden}body.printing-report .print-area,body.printing-report .print-area *{visibility:visible}body.printing-report .print-area{position:absolute;left:0;top:0;width:100%}.print-area .text-link{display:none}}

/* D3 / answer 39: receipts. The sheet is built in JS (fn-hardware.js) and is invisible on screen. THERMAL_80 = 80 mm roll with a 72 mm printable width; A4 = full sheet. */
.receipt-sheet{display:none}
@page thermal80{size:80mm auto;margin:0}
@page a4sheet{size:A4;margin:15mm}
@media print{
 body.printing-receipt>*:not(#receiptSheet){display:none!important}
 body.printing-receipt #receiptSheet{display:block;color:#000;background:#fff}
 #receiptSheet.paper-thermal80{page:thermal80;width:72mm;margin:0 4mm;padding:2mm 0;font:12px/1.3 "Courier New",monospace}
 #receiptSheet.paper-a4{page:a4sheet;width:auto;font:13px/1.4 Arial,sans-serif}
 #receiptSheet .rcpt-head,#receiptSheet .rcpt-foot,#receiptSheet .rcpt-fbr{text-align:center;margin:2mm 0}
 #receiptSheet .rcpt-sub,#receiptSheet .rcpt-total{display:flex;justify-content:space-between}
 #receiptSheet .rcpt-total{border-top:1px dashed #000;border-bottom:1px dashed #000;font-weight:700;margin:2mm 0;padding:1mm 0}
 #receiptSheet .rcpt-item{margin-top:1mm}
 #receiptSheet .rcpt-table{width:100%;border-collapse:collapse}#receiptSheet .rcpt-table th,#receiptSheet .rcpt-table td{border-bottom:1px solid #999;padding:2px 4px;text-align:left}#receiptSheet .n{text-align:right!important}
 #receiptSheet .rcpt-qr{width:1in;height:1in}
 #receiptSheet .rcpt-fbr-logo{max-height:12mm;max-width:30mm;vertical-align:middle}#receiptSheet .rcpt-fbr-logo-ph{display:inline-block;border:1px solid #000;padding:0 2mm;font-weight:700}#receiptSheet .rcpt-fbr-ids{font-size:.85em;margin-top:1mm}
}
