/* Colour-only layer: preserve the existing light layout and AMFN accent.
   Theme follows Bydgoszcz sunset/sunrise, not the visitor's OS preference. */
html[data-theme="dark"] {
  color-scheme: dark;
  --page: #111820; --surface: #1b2732; --ink: #e7edf2;
  --muted: #acbcc8; --line: #3b4e5e; --accent: #ffb303;
  --white: #1b2732; --black: #e7edf2; --black-62: #acbcc8;
  --ink-900: #e7edf2; --ink-700: #d5e0e9; --ink-500: #b9c7d2;
  --ink-300: #657d90; --ink-100: #2a3a48;
  --ok: #80dca4; --warn: #f9d075; --danger: #ffaaa0;
  --amfn-yellow-dim: #ffcc57; --shadow: 0 2px 8px #0003;
}
html[data-theme="dark"] body { background: var(--page); color: var(--ink); }
html[data-theme="dark"] :is(header, .topbar, .ops-nav, section, .card, .box, .login-box, .stat, .day) {
  background: var(--surface); color: var(--ink); border-color: var(--line);
}
html[data-theme="dark"] :is(h1, h2, h3, label, header strong, .stat strong) { color: var(--ink); }
html[data-theme="dark"] :is(a, .box a, .topbar .portal-nav) { color: #a9d5f2; }
html[data-theme="dark"] :is(a:hover, .ops-nav a:hover, .ops-nav a[aria-current="page"]) { color: #ffce5c; }
html[data-theme="dark"] :is(.brandmark, .ops-nav a) { color: var(--ink); }
html[data-theme="dark"] :is(small, .muted, .hint, .empty, .record-meta, .brandtext small, .topbar nav .who,
 .stat span, .box p, p.sub, .asset small, .health-grid small, .eyebrow, footer, th) { color: var(--muted); }
html[data-theme="dark"] :is(input, select, textarea) { background: #15212b; color: var(--ink); border-color: #657d90; }
html[data-theme="dark"] input::placeholder, html[data-theme="dark"] textarea::placeholder { color: #9aafbf; opacity: 1; }
html[data-theme="dark"] :is(button, .button, .btn.ghost) { background: #263744; color: var(--ink); border-color: #657d90; }
html[data-theme="dark"] :is(button:hover, .button:hover, .btn.ghost:hover) { background: #344b5d; color: #fff; }
html[data-theme="dark"] :is(button.primary, .button.primary, .box button, .btn:not(.ghost)) {
  background: var(--accent); border-color: var(--accent); color: #18212b;
}
html[data-theme="dark"] :is(button.primary:hover, .box button:hover, .btn:not(.ghost):hover) { background: #ffcc57; color: #18212b; }
html[data-theme="dark"] :is(button.danger, .button.danger) { background: #432a2b; color: #ffb8b0; border-color: #b27772; }
html[data-theme="dark"] :is(td, th, footer, .product-card) { border-color: var(--line); }
html[data-theme="dark"] :is(.info, .note, .notice, .wynik, #connection) { background: #403922; color: #f6e3af; }
html[data-theme="dark"] :is(.warn, .err, .error, .overdue) { background: #42282b !important; color: #ffb8b0 !important; }
html[data-theme="dark"] :is(.ok, .tag.ok, .event, #message:not(:empty)) { background: #203d32; color: #a1e5bd; border-color: #438761; }
html[data-theme="dark"] :is(.tag.wait, .event.pending_approval) { background: #403922; color: #f6d782; border-color: #867749; }
html[data-theme="dark"] .tag.bad { background: #42282b; color: #ffb8b0; border-color: #b27772; }
html[data-theme="dark"] .tag.live { background: #334e65; color: #e7edf2; border-color: #7593ad; }
html[data-theme="dark"] :is(.badge, .event.returned, #mail-save-state) { background: #2a3a48; color: #d1e2ee; }
html[data-theme="dark"] .status-ready { color: #80dca4; }
html[data-theme="dark"] .status-wait { color: #f9d075; }
html[data-theme="dark"] .danger-zone h2 { color: #ffb8b0; }
html[data-theme="dark"] .wynik code { color: #f9d075; }
html[data-theme="dark"] .canvas-panel { background: #1d2b37; }
html[data-theme="dark"] .equipment-card.active { background: #403922; border-color: #e7a700; }
html[data-theme="dark"] .equipment-card img { background: #dfe5e9; }
html[data-theme="dark"] .cart li button { background: transparent; color: #a9d5f2; }
/* Do not recolour configured locker doors, their state, or QR codes. */
html[data-theme="dark"] .cell { background: transparent; border-color: #ffffff38; }
html[data-theme="dark"] .cell:hover { background: #ffffff33; }
html[data-theme="dark"] .cell.marked { background: #ffbf0055; border-color: #ffd54a; }
html[data-theme="dark"] img[src*="logo-amfn-"][src$="-black.png"] { filter: invert(1); }
html[data-theme="dark"] .qr-labels article { background: white; color: #182b3a; }
html[data-theme="dark"] .qr-labels article :is(p, small, h2, h3) { color: #182b3a; }
@media print {
  html[data-theme="dark"] { color-scheme: light; --ink: #182b3a; --muted: #536879; --line: #dce4eb; --ink-900: #182b3a; }
  html[data-theme="dark"] :is(body, main, section, .card, .qr-labels article) { background: white !important; color: #182b3a !important; }
  html[data-theme="dark"] img[src*="logo-amfn-"][src$="-black.png"] { filter: none; }
}
