/* Dark theme (Tocchetta). Loaded last by the app layouts (layout / pos / kds / login). Receipts and invoices (print-*.css pages) never load it.
   Mechanism: html[data-theme="dark"] (set before first paint by js/boot.js; Light is the default). The kit's dark tokens (tokens.css) flip every
   --tq-* value, and app.css aliases follow them, so almost nothing needs an override. What is left: three tints the kit does not define for dark
   (orange soft / tint / hover, derived as #DF8537 at 16% / 9% / 24% over the dark surface, text on them is --tq-accent #F0A767, >= 7:1),
   shadows, scrims and the few places that cannot follow a variable. Brand rule: label on an orange fill is charcoal (on-primary), never white. */
html[data-theme="dark"]:not(.kds-light) {
  color-scheme: dark;
  --primary-soft: #3D2E1E; --primary-tint: #2E2519; --primary-soft-hover: #4D3925; --on-soft: var(--tq-accent);
  --sh-1: 0 8px 24px rgba(0, 0, 0, .45); --sh-2: 0 16px 40px rgba(0, 0, 0, .55);
  --focus: 0 0 0 3px rgba(240, 167, 103, .6);
}
html[data-theme="dark"]:not(.kds-light) body { background: var(--bg); color: var(--ink); }
html[data-theme="dark"] .topbar { box-shadow: 0 8px 28px rgba(0, 0, 0, .5); }
.theme-btn { padding: 0 10px; min-width: 40px; }
html[data-theme="dark"] .input::placeholder { color: var(--muted); }
html[data-theme="dark"] .input option { background: var(--surface); color: var(--ink); }
html[data-theme="dark"] .seg button[aria-pressed=true] { box-shadow: 0 4px 14px rgba(0, 0, 0, .4); }
html[data-theme="dark"] .chip-btn { box-shadow: none; }
html[data-theme="dark"] .cat-head h2:focus, html[data-theme="dark"] .cat-head h2.editing { background: var(--surface-2); }
html[data-theme="dark"] .mod-card.is-locked, html[data-theme="dark"] .sub-mod.is-locked { outline-color: var(--line); }
html[data-theme="dark"] .check-mark { background: var(--surface-2); }
html[data-theme="dark"] .nida-track { background: rgba(21, 20, 15, .92); }
/* QR codes must stay white-backed to scan */
html[data-theme="dark"] .nida-qr img, html[data-theme="dark"] .nida-track-qr, html[data-theme="dark"] img.qr, html[data-theme="dark"] [data-testid$="-qr"] { background: #fff; }
html[data-theme="dark"] .kst-card { background: var(--surface); color: var(--ink); }
/* sheets / modals / overlays */
html[data-theme="dark"] .sheet, html[data-theme="dark"] .detail-sheet { box-shadow: 0 -8px 32px rgba(0, 0, 0, .6); }
html[data-theme="dark"] .sheet-back, html[data-theme="dark"] .detail-back, html[data-theme="dark"] .nav-scrim, html[data-theme="dark"] .card-pending { background: rgba(10, 9, 6, .7); }
/* Kitchen display + customer status: they carry their own --k-* palette (dark by default). Nothing else to override. */
html[data-theme="dark"] .user-login .user-prefix { background: var(--surface-2); color: var(--on-soft); border-inline-end-color: var(--line); }
html[data-theme="dark"] .user-login .input,
html[data-theme="dark"] .user-login .input:focus { background: transparent; }
