/* Dark theme (html[data-theme=dark], set by /js/theme.js): deep navy page, cream text,
   vintage red kept for actions. Loaded last on the website, owner and waiter screens. */

/* the moon / sun button */
.theme-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; flex: none; border: 0; border-radius: 50%; background: rgba(239, 225, 204, .14); color: inherit; cursor: pointer; padding: 0; }
.theme-btn:hover { background: rgba(239, 225, 204, .24); }
[data-theme-toggle] .sun, html[data-theme=dark] [data-theme-toggle] .moon, .theme-lbl .to-light, html[data-theme=dark] .theme-lbl .to-dark { display: none; }
html[data-theme=dark] [data-theme-toggle] .sun, html[data-theme=dark] .theme-lbl .to-light { display: inline; }
.theme-fixed { position: fixed; top: 16px; right: 16px; z-index: 50; color: var(--cream, #efe1cc); background: rgba(27, 39, 66, .55); }

html[data-theme=dark] {
  color-scheme: dark;
  --bg: #0f1527;
  --surface: #18203a;
  --surface-2: #222c4b;
  --text: #efe1cc;
  --muted: #a8afc3;
  --line: #2d3a60;
  --ok: #6fd08e; --ok-bg: #173a27;
  --warn: #f5c45b; --warn-bg: #3d3216;
  --bad: #ff8a83; --bad-bg: #4a1b22;
  --info: #efe1cc; --info-bg: #2d3a60;
}
html[data-theme=dark] body { background: var(--bg); color: var(--text); }
html[data-theme=dark] body::after { mix-blend-mode: overlay; opacity: .18; }
html[data-theme=dark] .muted { color: var(--muted); }
html[data-theme=dark] a:not(.btn):not(.logo):not(.nav):not(.sub-link) { color: #ff9a92; }
html[data-theme=dark] .input, html[data-theme=dark] select.input, html[data-theme=dark] textarea.input { background: #121a30; color: var(--text); border-color: var(--line); }
html[data-theme=dark] .btn { background: var(--surface-2); color: var(--text); }
html[data-theme=dark] .btn:hover { background: #2b3760; }
html[data-theme=dark] .btn-primary { background: var(--red, #b21423); color: #efe1cc; }
html[data-theme=dark] .btn-primary:hover { background: #c8212f; }
html[data-theme=dark] .btn-ok { background: #1d6b38; color: #fff; }
html[data-theme=dark] .btn-bad { background: transparent; color: var(--bad); border-color: color-mix(in srgb, var(--bad) 45%, transparent); }
html[data-theme=dark] .modal, html[data-theme=dark] .overlay .modal { background: var(--surface); color: var(--text); }
html[data-theme=dark] .toast { background: #efe1cc; color: #1b2742; }
html[data-theme=dark] .chip { background: var(--surface-2); color: var(--text); border-color: transparent; }
/* selected things turn cream, so they stand out on navy */
html[data-theme=dark] .chip.on, html[data-theme=dark] .presets .btn.on, html[data-theme=dark] .tr-tabs button.on,
html[data-theme=dark] .day.on, html[data-theme=dark] .stable.on, html[data-theme=dark] .sides-btn.on { background: #efe1cc; color: #1b2742; }

/* ---------- owner ---------- */
html[data-theme=dark] .side, html[data-theme=dark] .mob-bar { background: #0a1020; }
html[data-theme=dark] .card, html[data-theme=dark] .tile, html[data-theme=dark] .stat, html[data-theme=dark] .table-card { background: var(--surface); }
html[data-theme=dark] .item-card, html[data-theme=dark] .shift, html[data-theme=dark] .staff-qr > div { background: var(--surface-2); }
html[data-theme=dark] .ai-card { background: #0a1020; }
html[data-theme=dark] .savebar { background: var(--bg); border-color: var(--line); }
html[data-theme=dark] .viz-root { --series-1: #efe1cc; --series-2: #ff6b62; --grid: #2d3a60; --axis: #46557f; --ink-muted: #a8afc3; --ink-2: #c9cfdd; }
html[data-theme=dark] .viz-tip { background: #efe1cc; color: #1b2742; }
html[data-theme=dark] .page-head p { color: var(--muted); }
html[data-theme=dark] .tr-tabs, html[data-theme=dark] .on-duty .pill { background: var(--surface-2); }
html[data-theme=dark] .tr-tabs button { color: var(--text); }

/* ---------- waiter ---------- */
html[data-theme=dark] .topbar { background: #0a1020; }
html[data-theme=dark] .ticket, html[data-theme=dark] .history { background: var(--surface); }
html[data-theme=dark] .sub { background: var(--bg); }
html[data-theme=dark] .sub.is-new { background: color-mix(in srgb, #b21423 18%, var(--bg)); }
html[data-theme=dark] .call-box, html[data-theme=dark] .gate { background: #0a1020; }
html[data-theme=dark] .mo-item, html[data-theme=dark] .mo-pick { background: var(--surface); }

/* ---------- log in / sign up ---------- */
html[data-theme=dark] .box { background: var(--surface); }
html[data-theme=dark] .logo.mobile-brand { color: var(--text); }

/* ---------- website ---------- */
html[data-theme=dark] .journey .card { background: #18203a; }
html[data-theme=dark] .live, html[data-theme=dark] .cta { background: #0a1020; }
html[data-theme=dark] .f.navy { background: #1d2848; }
html[data-theme=dark] .f.line { background: #141c33; color: #efe1cc; box-shadow: inset 0 0 0 1px #2d3a60; }
html[data-theme=dark] footer { background: #0f1527; color: #efe1cc; }
html[data-theme=dark] footer .big .logo { color: #efe1cc; }
html[data-theme=dark] .features, html[data-theme=dark] .journey { color: #efe1cc; }
