/* Dark theme overrides. Each page keeps its light colours inline; these win when <html data-theme="dark">. */
html[data-theme="dark"] { color-scheme: dark; }
html[data-theme="dark"] body { background: #0b1120; color: #e2e8f0; }

/* shared nav — the bar is already dark; only the toggles need a style */
.topnav .theme-btn { background: transparent; border: 1px solid #334155; border-radius: 7px; color: #cbd5e1; font-size: 13px; line-height: 1; padding: 5px 8px; cursor: pointer; font-family: inherit; }
.topnav .theme-btn:hover { color: #fff; border-color: #64748b; }
.topnav .logo { width: 30px; height: 30px; object-fit: contain; display: block; }
html[data-theme="dark"] .topnav { background: #020617; border-bottom: 1px solid #1e293b; }

/* review queue */
html[data-theme="dark"] .tab { background: #111827; border-color: #1f2937; color: #94a3b8; }
html[data-theme="dark"] .tab .n { background: #1f2937; color: #cbd5e1; }
html[data-theme="dark"] .tab.active { background: #e2e8f0; border-color: #e2e8f0; color: #0f172a; }
html[data-theme="dark"] .tab.active .n { background: rgba(15,23,42,0.15); color: #0f172a; }
html[data-theme="dark"] .search,
html[data-theme="dark"] .modal textarea { background: #0f172a; border-color: #334155; color: #e2e8f0; }
html[data-theme="dark"] .btn { background: #111827; border-color: #334155; color: #e2e8f0; }
html[data-theme="dark"] .btn:hover { background: #1f2937; }
html[data-theme="dark"] .btn.primary { background: #16a34a; border-color: #16a34a; color: #fff; }
html[data-theme="dark"] .btn.primary:hover { background: #15803d; }
html[data-theme="dark"] .btn.blue { background: #2563eb; border-color: #2563eb; color: #fff; }
html[data-theme="dark"] .btn.danger { background: transparent; border-color: #7f1d1d; color: #fca5a5; }
html[data-theme="dark"] .btn.danger:hover { background: #450a0a; }
html[data-theme="dark"] .notice.warn { background: #422006; border-color: #78350f; color: #fde68a; }
html[data-theme="dark"] .notice.info { background: #172554; border-color: #1e3a8a; color: #bfdbfe; }
html[data-theme="dark"] .notice.err { background: #450a0a; border-color: #7f1d1d; color: #fecaca; }
html[data-theme="dark"] .list,
html[data-theme="dark"] .card,
html[data-theme="dark"] .modal { background: #111827; border-color: #1f2937; }
html[data-theme="dark"] .row { border-bottom-color: #1f2937; }
html[data-theme="dark"] .row:hover { background: #1a2332; }
html[data-theme="dark"] .row.sel { background: #172554; box-shadow: inset 3px 0 0 #3b82f6; }
html[data-theme="dark"] .row .m,
html[data-theme="dark"] .empty,
html[data-theme="dark"] .head .sub,
html[data-theme="dark"] .meta,
html[data-theme="dark"] .actions .why,
html[data-theme="dark"] .modal p,
html[data-theme="dark"] .timeline { color: #94a3b8; }
html[data-theme="dark"] .card h3 { color: #94a3b8; }
html[data-theme="dark"] .head a,
html[data-theme="dark"] .card h3 a,
html[data-theme="dark"] .doc .cap a { color: #60a5fa; }
html[data-theme="dark"] .lane-AES { background: #2e1065; border-color: #5b21b6; color: #c4b5fd; }
html[data-theme="dark"] .lane-VALENCE { background: #083344; border-color: #155e75; color: #67e8f9; }
html[data-theme="dark"] .lane-SABER, html[data-theme="dark"] .lane-SADLER, html[data-theme="dark"] .lane-SUNWEST { background: #431407; border-color: #9a3412; color: #fdba74; }
html[data-theme="dark"] .lane-none { background: #1f2937; border-color: #334155; color: #cbd5e1; }
html[data-theme="dark"] .f-fail { background: #450a0a; border-color: #7f1d1d; color: #fca5a5; }
html[data-theme="dark"] .f-warn { background: #422006; border-color: #78350f; color: #fcd34d; }
html[data-theme="dark"] .f-ok { background: #052e16; border-color: #166534; color: #86efac; }
html[data-theme="dark"] .f-dup { background: #4a0419; border-color: #9f1239; color: #fda4af; }
html[data-theme="dark"] .st-pending { background: #422006; color: #fcd34d; }
html[data-theme="dark"] .st-accepted { background: #172554; color: #93c5fd; }
html[data-theme="dark"] .st-processing { background: #1e1b4b; color: #a5b4fc; }
html[data-theme="dark"] .st-done { background: #052e16; color: #86efac; }
html[data-theme="dark"] .st-rejected { background: #1f2937; color: #cbd5e1; }
html[data-theme="dark"] .st-failed { background: #450a0a; color: #fca5a5; }
html[data-theme="dark"] table.inv th { color: #94a3b8; border-bottom-color: #1f2937; }
html[data-theme="dark"] table.inv td { border-bottom-color: #1f2937; }
html[data-theme="dark"] table.inv tr.tot td { border-top-color: #334155; }
html[data-theme="dark"] .kv b { color: #64748b; }
html[data-theme="dark"] .kv .blank { color: #475569; }
html[data-theme="dark"] .meta code { background: #1f2937; color: #cbd5e1; }
html[data-theme="dark"] .checks li.pass { background: #0f172a; color: #cbd5e1; }
html[data-theme="dark"] .checks li.warn { background: #2a1a05; color: #fde68a; }
html[data-theme="dark"] .checks li.fail { background: #2a0a0a; color: #fecaca; }
html[data-theme="dark"] .doc { background: #0f172a; border-color: #1f2937; }
html[data-theme="dark"] .doc .img { background: #1f2937; }
html[data-theme="dark"] .doc .img.pdf { color: #cbd5e1; }
html[data-theme="dark"] .doc .cap { color: #cbd5e1; }
html[data-theme="dark"] .doc.missing .img { background: repeating-linear-gradient(45deg,#2a0a0a,#2a0a0a 8px,#3b0d0d 8px,#3b0d0d 16px); color: #fca5a5; }
html[data-theme="dark"] .pkg { background: #0f172a; border-color: #1f2937; }
html[data-theme="dark"] .actions { background: rgba(17,24,39,0.96); border-color: #1f2937; }
html[data-theme="dark"] .timeline .when { color: #64748b; }
html[data-theme="dark"] .modal ul { color: #fde68a; }
html[data-theme="dark"] .modal .err { color: #fca5a5; }
html[data-theme="dark"] .spinner { border-color: #1f2937; border-top-color: #3b82f6; }
html[data-theme="dark"] .toast { background: #e2e8f0; color: #0f172a; }

/* sign-in page */
html[data-theme="dark"] .login-card { background: #111827; border-color: #1f2937; box-shadow: none; }
html[data-theme="dark"] .login-card h1 { color: #f1f5f9; }
html[data-theme="dark"] .login-card label { color: #cbd5e1; }
html[data-theme="dark"] .login-card label span[data-i18n] { color: #cbd5e1 !important; }
html[data-theme="dark"] .login-card input { background: #0f172a; border-color: #334155; color: #e2e8f0; }
html[data-theme="dark"] .login-card .error { background: #450a0a; border-color: #7f1d1d; color: #fecaca; }
html[data-theme="dark"] .login-tools .lang,
html[data-theme="dark"] .login-tools .theme-btn { background: #111827; border-color: #334155; color: #cbd5e1; }
html[data-theme="dark"] .login-tools .lang span.on { background: #e2e8f0; color: #0f172a; }

/* operations dashboard (index.html) */
html[data-theme="dark"] header { background: #0f172a; border-bottom-color: #1e293b; }
html[data-theme="dark"] header h1 { color: #f1f5f9; }
html[data-theme="dark"] header .subtitle,
html[data-theme="dark"] .status-label,
html[data-theme="dark"] .date-filter label { color: #94a3b8; }
html[data-theme="dark"] .date-filter { background: #111827; border-color: #1f2937; }
html[data-theme="dark"] .date-filter input[type="date"] { color: #e2e8f0; color-scheme: dark; }
html[data-theme="dark"] .banner.live { background: #052e16; border-color: #166534; color: #86efac; }
html[data-theme="dark"] .banner.error { background: #450a0a; border-color: #7f1d1d; color: #fecaca; }
html[data-theme="dark"] .scorecard,
html[data-theme="dark"] .kpi-card,
html[data-theme="dark"] .chart-card,
html[data-theme="dark"] .table-card,
html[data-theme="dark"] .outstanding-banner,
html[data-theme="dark"] .rq { background: #111827; border-color: #1f2937; }
html[data-theme="dark"] .rq { border-left-color: #3b82f6; }
html[data-theme="dark"] .rq.hot { border-left-color: #f59e0b; }
html[data-theme="dark"] .scorecard-title,
html[data-theme="dark"] .sc-value,
html[data-theme="dark"] .kpi-card .value,
html[data-theme="dark"] .chart-card h2,
html[data-theme="dark"] .table-card h2,
html[data-theme="dark"] .outstanding-banner .ob-title,
html[data-theme="dark"] .rq .rq-t { color: #f1f5f9; }
html[data-theme="dark"] .scorecard-date { background: #1f2937; color: #cbd5e1; }
html[data-theme="dark"] .sc-cell { background: #0f172a; border-color: #1f2937; }
html[data-theme="dark"] .sc-cell.blue { background: #0c1a3a; border-color: #1e3a8a; }
html[data-theme="dark"] .sc-cell.green { background: #062016; border-color: #14532d; }
html[data-theme="dark"] .sc-cell.amber { background: #221505; border-color: #713f12; }
html[data-theme="dark"] .sc-label,
html[data-theme="dark"] .sc-sub,
html[data-theme="dark"] .sc-value small,
html[data-theme="dark"] .kpi-card .label,
html[data-theme="dark"] .rq .rq-s,
html[data-theme="dark"] .neutral,
html[data-theme="dark"] .mono,
html[data-theme="dark"] .loading-overlay { color: #94a3b8; }
html[data-theme="dark"] .kpi-card .sub,
html[data-theme="dark"] .note,
html[data-theme="dark"] .last-updated,
html[data-theme="dark"] footer { color: #64748b; }
html[data-theme="dark"] .up, html[data-theme="dark"] .green { color: #4ade80; }
html[data-theme="dark"] .down { color: #f87171; }
html[data-theme="dark"] .sc-divider { background: #1f2937; }
html[data-theme="dark"] .bol-toggle-btn { color: #60a5fa; border-color: #1e3a8a; }
html[data-theme="dark"] .bol-toggle-btn:hover { background: #172554; }
html[data-theme="dark"] .trend-btn,
html[data-theme="dark"] .preset-btn { background: #111827; border-color: #1f2937; color: #94a3b8; }
html[data-theme="dark"] .trend-btn:hover:not(.active),
html[data-theme="dark"] .preset-btn:hover:not(.active) { background: #1f2937; border-color: #334155; color: #e2e8f0; }
html[data-theme="dark"] .trend-btn.active,
html[data-theme="dark"] .preset-btn.active { background: #e2e8f0; border-color: #e2e8f0; color: #0f172a; }
html[data-theme="dark"] th { color: #94a3b8; border-bottom-color: #1f2937; }
html[data-theme="dark"] td { border-bottom-color: #1f2937; }
html[data-theme="dark"] tr:hover td { background: #1a2332; }
html[data-theme="dark"] tr.total td { background: #0f172a; border-top-color: #334155; }
html[data-theme="dark"] .sc-tip { background: #334155; color: #e2e8f0; }
html[data-theme="dark"] .loading-overlay .spinner { border-color: #1f2937; border-top-color: #3b82f6; }
html[data-theme="dark"] .ob-pill.ready { background: #422006; border-color: #78350f; color: #fcd34d; }
html[data-theme="dark"] .ob-pill.aes { background: #2e1065; border-color: #5b21b6; color: #c4b5fd; }
html[data-theme="dark"] .ob-pill.weight { background: #172554; border-color: #1e3a8a; color: #93c5fd; }
html[data-theme="dark"] .ob-pill.docs { background: #042f2e; border-color: #115e59; color: #5eead4; }
html[data-theme="dark"] .ob-pill.open { background: #1f2937; border-color: #334155; color: #cbd5e1; }
html[data-theme="dark"] .ob-pill.pulloff { background: #450a0a; border-color: #7f1d1d; color: #fca5a5; }
html[data-theme="dark"] .ob-pill.allclear { background: #052e16; border-color: #166534; color: #86efac; }
html[data-theme="dark"] .outstanding-card { background: #221505 !important; border-color: #b45309 !important; }
html[data-theme="dark"] .outstanding-title,
html[data-theme="dark"] .outstanding-sub,
html[data-theme="dark"] .outstanding-card th,
html[data-theme="dark"] .outstanding-toggle { color: #fcd34d !important; }
html[data-theme="dark"] .outstanding-card td { border-bottom-color: #713f12; }
/* dashboard HTML built in JS with inline colours */
html[data-theme="dark"] [style*="color:#0f172a"] { color: #f1f5f9 !important; }
html[data-theme="dark"] [style*="color:#475569"] { color: #cbd5e1 !important; }
html[data-theme="dark"] [style*="color:#166534"] { color: #86efac !important; }
html[data-theme="dark"] [style*="background:#f1f5f9"] { background: #1f2937 !important; }
html[data-theme="dark"] [style*="background:#e2e8f0"] { background: #1f2937 !important; }
html[data-theme="dark"] [style*="#e2e8f0;"][style*="border"] { border-color: #1f2937 !important; }
html[data-theme="dark"] [style*="solid #dbeafe"] { border-color: #1e3a8a !important; }
html[data-theme="dark"] [style*="solid #f1f5f9"] { border-color: #1f2937 !important; }
html[data-theme="dark"] .v-match { background: #052e16; border-color: #166534; color: #86efac; }
html[data-theme="dark"] .v-fsc { background: #172554; border-color: #1e3a8a; color: #93c5fd; }
html[data-theme="dark"] .v-diff { background: #450a0a; border-color: #7f1d1d; color: #fca5a5; }
html[data-theme="dark"] .v-noqbo { background: #1f2937; border-color: #334155; color: #cbd5e1; }
