/* ==========================================================================
   dark.css - dark theme for the design prototype, switched on by theme.js (data-theme="dark").
   Light mode is untouched. Values are the owner-approved dark palette (decision D9).
   Checked: shell, Requests, Request history, the dialogs. Other screens use a few fixed colours
   (some chart parts, small yellow demo notes) and have not all been checked in dark.
   ========================================================================== */

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f1626; --surface: #162036; --line: #28365a; --text: #e8eefc; --muted: #a6b4d0;
  --brand: #6ea0ff; --brand-dark: #b5ceff; --brand-tint: #1b2c52; --on-brand: #0b1220;
  --panel: #1b2640; --head-bg: #1c2a47; --section-bg: #1c2a47;
  --ink: #e8eefc; --on-ink: #0f1626; --focus: #fbbf24;
  --btn-line: #3a4a73; --field-line: #7d8bab; --fill: #6ea0ff; --track: #28365a; --bar-off: #2f4a85;
  --ok: #7fd69c; --ok-bg: #16341f; --warn: #f0b35c; --warn-bg: #3a2c10; --bad: #ff9a9a; --bad-bg: #3d1a1a;
  --draft: #c4b0f0; --draft-bg: #2d2547;
  --kitchen-bg: #3b3210; --kitchen-line: #d9a40f; --kitchen-text: #f6dd8a;
  --floor-bg: #16304f; --floor-line: #5b9be8; --floor-text: #cfe3ff;
  --bar-bg: #153a2a; --bar-line: #3fb583; --bar-text: #c3efd9;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4);
}

/* Fixed-colour pieces that need a dark version */
:root[data-theme="dark"] .chip.draft { background: #3a3110; color: #f6dd8a; }
:root[data-theme="dark"] .chip.notbuilt,
:root[data-theme="dark"] .chip.neutral { background: #222f4f; color: #d3dbeb; }
:root[data-theme="dark"] .banner.draft { background: #3a3110; color: #f6dd8a; border-color: #d9a40f; }
:root[data-theme="dark"] .banner.approved,
:root[data-theme="dark"] .alert.ok { background: var(--ok-bg); color: #b7ecc8; }
:root[data-theme="dark"] .banner.notbuilt { background: #222f4f; color: #d3dbeb; border-color: #4a5b86; }
:root[data-theme="dark"] .alert.info { background: #16304f; color: #cfe3ff; border-color: #5b9be8; }
:root[data-theme="dark"] .note { background: #3a3110; color: #f6dd8a; }
:root[data-theme="dark"] .roster .head.today { background: #4a3f12; color: #fbe9a6; }
:root[data-theme="dark"] .unavail { color: #cdd5e6; border-color: #3a4663; background: repeating-linear-gradient(45deg, #1c2a47, #1c2a47 6px, #222f4f 6px, #222f4f 12px); }
:root[data-theme="dark"] .btn.danger { color: var(--bad); border-color: var(--bad); }

/* Small yellow "demo" panels keep their pale yellow in dark, so their text stays dark */
:root[data-theme="dark"] .demo-ctl, :root[data-theme="dark"] .demo-ctl *,
:root[data-theme="dark"] .demo-accounts, :root[data-theme="dark"] .demo-accounts *,
:root[data-theme="dark"] .email-preview, :root[data-theme="dark"] .email-preview * { color: #3d2f00; }
:root[data-theme="dark"] .tools summary { color: #3d2f00; }
:root[data-theme="dark"] .lv-4 { background: color-mix(in srgb, var(--brand) 82%, var(--surface)); }

/* Section colours that are not already tokens */
:root[data-theme="dark"] .sec-violet { --sc-bg: #2d2547; --sc-line: #9a7be8; --sc-text: #dccffa; }
:root[data-theme="dark"] .sec-rose { --sc-bg: #43202e; --sc-line: #e5679b; --sc-text: #fbcfe0; }
:root[data-theme="dark"] .sec-teal { --sc-bg: #123a3a; --sc-line: #36b8b3; --sc-text: #c3efed; }
:root[data-theme="dark"] .sec-slate { --sc-bg: #2b3038; --sc-line: #8892a4; --sc-text: #dfe4ec; }
:root[data-theme="dark"] .lv-3 { color: var(--text); }

/* 2 Dec 2026 refresh: dark values matching frontierflow.com.au v2 */
:root[data-theme="dark"] {
  --bg: #030b18; --surface: #0b1e33; --line: #17375a; --text: #f2f7ff; --muted: #c0d1e5;
  --brand: #7fe3ff; --brand-dark: #a6edff; --brand-tint: #0c2a44; --on-brand: #071c32;
  --panel: #0c243b; --head-bg: #0c243b; --section-bg: #0c243b; --ink: #f2f7ff; --on-ink: #071c32;
  --btn-line: #3c5670; --field-line: #7f98b3; --fill: #7fe3ff; --track: #17375a; --bar-off: #2c5a7a;
}
:root[data-theme="dark"] .sidebar { background: #051222; }
:root[data-theme="dark"] .av-lunch, :root[data-theme="dark"] .av-dinner { color: #a6edff; }
