/* Layout: glass dashboard on deep navy (from the reference), top pill nav on desktop, bottom tabs on phones.
   Three looks: Night (dark), Dusk (blue-grey with navy feature cards), Day (light). */
:root {
  color-scheme: dark;
  --bg: #07111f;
  --bg-glow: radial-gradient(1200px 600px at 15% -10%, rgba(34, 211, 230, .10), transparent 60%),
             radial-gradient(900px 500px at 100% 0%, rgba(59, 130, 246, .12), transparent 60%);
  --panel: rgba(17, 34, 60, .78);
  --panel-solid: #11223c;
  --panel-2: rgba(255, 255, 255, .04);
  --line: rgba(130, 190, 255, .14);
  --line-strong: rgba(130, 190, 255, .28);
  --ink: #e9f2ff;
  --ink-2: #b2c3dc;
  --muted: #7489a8;
  --accent: #22d3e6;
  --accent-ink: #032029;
  --blue: #3b82f6;
  --bar: #2b4672;
  --feature: linear-gradient(155deg, #1a3766 0%, #0f2242 55%, #0b1a33 100%);
  --feature-ink: #eef5ff;
  --feature-muted: #9fb3d1;
  --feature-line: rgba(160, 205, 255, .18);
  --header: rgba(9, 20, 38, .82);
  --header-ink: #e9f2ff;
  --good: #34d399;
  --warn: #fbbf24;
  --bad: #f87171;
  --good-bg: rgba(52, 211, 153, .14);
  --warn-bg: rgba(251, 191, 36, .14);
  --bad-bg: rgba(248, 113, 113, .14);
  --info-bg: rgba(34, 211, 230, .13);
  --c1: #22d3e6; --c2: #3b82f6; --c3: #7dd3fc; --c4: #1d4ed8; --c5: #64748b; --c6: #0e7490; --c7: #a5b4fc;
  --shadow: 0 14px 34px rgba(0, 0, 0, .35);
  --inset: inset 0 1px 0 rgba(255, 255, 255, .06);
  --radius: 18px;
  --radius-sm: 11px;
  --font-display: "Sora", "Segoe UI", system-ui, sans-serif;
  --font-body: "Manrope", "Segoe UI", system-ui, -apple-system, sans-serif;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --bg: #e6edf6;
    --bg-glow: radial-gradient(1200px 600px at 10% -10%, rgba(10, 165, 191, .10), transparent 60%),
               radial-gradient(900px 500px at 100% 0%, rgba(37, 99, 235, .08), transparent 60%);
    --panel: rgba(255, 255, 255, .86);
    --panel-solid: #ffffff;
    --panel-2: rgba(15, 35, 70, .035);
    --line: rgba(20, 45, 90, .10);
    --line-strong: rgba(20, 45, 90, .20);
    --ink: #0f1d35;
    --ink-2: #3c4e6b;
    --muted: #6a7b96;
    --accent: #0aa5bf;
    --accent-ink: #ffffff;
    --blue: #2563eb;
    --bar: #1b2f52;
    --header: rgba(255, 255, 255, .80);
    --header-ink: #0f1d35;
    --good: #059669; --warn: #b45309; --bad: #dc2626;
    --good-bg: rgba(5, 150, 105, .11); --warn-bg: rgba(217, 119, 6, .12); --bad-bg: rgba(220, 38, 38, .10); --info-bg: rgba(10, 165, 191, .11);
    --c1: #0aa5bf; --c2: #2563eb; --c3: #1b2f52; --c4: #7dd3fc; --c5: #94a3b8; --c6: #155e75; --c7: #6366f1;
    --shadow: 0 12px 30px rgba(30, 55, 100, .12);
    --inset: inset 0 1px 0 rgba(255, 255, 255, .9);
  }
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #e6edf6;
  --bg-glow: radial-gradient(1200px 600px at 10% -10%, rgba(10, 165, 191, .10), transparent 60%),
             radial-gradient(900px 500px at 100% 0%, rgba(37, 99, 235, .08), transparent 60%);
  --panel: rgba(255, 255, 255, .86);
  --panel-solid: #ffffff;
  --panel-2: rgba(15, 35, 70, .035);
  --line: rgba(20, 45, 90, .10);
  --line-strong: rgba(20, 45, 90, .20);
  --ink: #0f1d35;
  --ink-2: #3c4e6b;
  --muted: #6a7b96;
  --accent: #0aa5bf;
  --accent-ink: #ffffff;
  --blue: #2563eb;
  --bar: #1b2f52;
  --header: rgba(255, 255, 255, .80);
  --header-ink: #0f1d35;
  --good: #059669; --warn: #b45309; --bad: #dc2626;
  --good-bg: rgba(5, 150, 105, .11); --warn-bg: rgba(217, 119, 6, .12); --bad-bg: rgba(220, 38, 38, .10); --info-bg: rgba(10, 165, 191, .11);
  --c1: #0aa5bf; --c2: #2563eb; --c3: #1b2f52; --c4: #7dd3fc; --c5: #94a3b8; --c6: #155e75; --c7: #6366f1;
  --shadow: 0 12px 30px rgba(30, 55, 100, .12);
  --inset: inset 0 1px 0 rgba(255, 255, 255, .9);
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #07111f;
  --bg-glow: radial-gradient(1200px 600px at 15% -10%, rgba(34, 211, 230, .10), transparent 60%),
             radial-gradient(900px 500px at 100% 0%, rgba(59, 130, 246, .12), transparent 60%);
  --panel: rgba(17, 34, 60, .78);
  --panel-solid: #11223c;
  --panel-2: rgba(255, 255, 255, .04);
  --line: rgba(130, 190, 255, .14);
  --line-strong: rgba(130, 190, 255, .28);
  --ink: #e9f2ff;
  --ink-2: #b2c3dc;
  --muted: #7489a8;
  --accent: #22d3e6;
  --accent-ink: #032029;
  --blue: #3b82f6;
  --bar: #2b4672;
  --header: rgba(9, 20, 38, .82);
  --header-ink: #e9f2ff;
  --good: #34d399; --warn: #fbbf24; --bad: #f87171;
  --good-bg: rgba(52, 211, 153, .14); --warn-bg: rgba(251, 191, 36, .14); --bad-bg: rgba(248, 113, 113, .14); --info-bg: rgba(34, 211, 230, .13);
  --c1: #22d3e6; --c2: #3b82f6; --c3: #7dd3fc; --c4: #1d4ed8; --c5: #64748b; --c6: #0e7490; --c7: #a5b4fc;
  --shadow: 0 14px 34px rgba(0, 0, 0, .35);
  --inset: inset 0 1px 0 rgba(255, 255, 255, .06);
}
/* Dusk: the middle look from the reference — blue-grey ground, light cards, navy header */
:root[data-skin="dusk"] {
  --bg: #bcc8da;
  --bg-glow: radial-gradient(1000px 500px at 20% -10%, rgba(255, 255, 255, .35), transparent 60%);
  --panel: rgba(244, 247, 251, .92);
  --header: #13284a;
  --header-ink: #eef5ff;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg-glow), var(--bg);
  background-attachment: fixed;
  color: var(--ink);
  font: 15px/1.5 var(--font-body);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 30; background: var(--header); }
h1, h2, h3, h4 { font-family: var(--font-display); margin: 0; line-height: 1.2; text-wrap: balance; letter-spacing: -.01em; }
h1 { font-size: 1.5rem; font-weight: 700; }
h2 { font-size: 1.05rem; font-weight: 650; }
h3 { font-size: .95rem; font-weight: 600; }
p { margin: 0; }
a { color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.num, .tabular { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.ink2 { color: var(--ink-2); }
.small { font-size: .82rem; }
.tiny { font-size: .72rem; }
.eyebrow { font-size: .7rem; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack.tight { gap: 6px; }
.grow { flex: 1; min-width: 0; }
.right { text-align: right; }

/* ---------- shell ---------- */
.app { min-height: 100%; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;
  background: var(--header); color: var(--header-ink);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar-in {
  max-width: 1320px; margin: 0 auto; display: flex; align-items: center; gap: 18px;
  padding-block: 12px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; text-decoration: none; color: inherit; }
.brand-mark { width: 34px; height: 34px; flex: none; }
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; font-style: italic; letter-spacing: -.01em; white-space: nowrap; }
.brand-store { font-size: .74rem; color: inherit; opacity: .65; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }
.nav { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; flex: 1; min-width: 0; padding: 2px; }
.nav::-webkit-scrollbar { display: none; }
.nav a {
  flex: none; text-decoration: none; color: inherit; font-size: .82rem; font-weight: 600;
  padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line-strong); opacity: .85; white-space: nowrap;
}
.nav a:hover { opacity: 1; border-color: var(--accent); }
.nav a.on { background: var(--info-bg); border-color: var(--accent); color: var(--accent); opacity: 1; box-shadow: 0 0 0 3px rgba(34, 211, 230, .10); }
.top-actions { display: flex; align-items: center; gap: 6px; flex: none; margin-left: auto; }
.icon-btn {
  position: relative; width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center;
  border: 1px solid transparent; background: transparent; cursor: pointer; color: inherit;
}
.icon-btn:hover { border-color: var(--line-strong); }
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn .dot { position: absolute; top: 6px; right: 6px; min-width: 16px; height: 16px; border-radius: 8px; background: var(--accent); color: var(--accent-ink); font-size: .62rem; font-weight: 800; display: grid; place-items: center; padding: 0 4px; }
.theme-pick { display: flex; gap: 2px; padding: 3px; border-radius: 12px; border: 1px solid var(--line-strong); }
.theme-pick button { width: 30px; height: 28px; border: 0; border-radius: 9px; background: transparent; cursor: pointer; display: grid; place-items: center; color: inherit; opacity: .6; }
.theme-pick button.on { background: var(--info-bg); color: var(--accent); opacity: 1; }
.theme-pick svg { width: 16px; height: 16px; }

main.content {
  flex: 1; width: 100%; max-width: 1320px; margin: 0 auto;
  padding-block: 22px 120px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head .sub { color: var(--muted); font-size: .88rem; margin-top: 4px; }

.demo-band {
  background: var(--warn-bg); color: var(--ink); border-bottom: 1px solid var(--line);
  font-size: .78rem; text-align: center;
  padding-block: 6px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.demo-band b { color: var(--warn); }

.tabbar { display: none; }

/* ---------- grid + cards ---------- */
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; }
.s3 { grid-column: span 3; } .s4 { grid-column: span 4; } .s5 { grid-column: span 5; } .s6 { grid-column: span 6; }
.s7 { grid-column: span 7; } .s8 { grid-column: span 8; } .s12 { grid-column: span 12; }
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow), var(--inset); padding: 18px; min-width: 0;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head .meta { font-family: var(--font-display); font-weight: 650; font-size: 1.05rem; }
.feature {
  background: var(--feature); color: var(--feature-ink); border-color: var(--feature-line);
  --muted: var(--feature-muted); --line: var(--feature-line);
}
.feature .muted { color: var(--feature-muted); }
.big { font-family: var(--font-display); font-size: 2rem; font-weight: 700; letter-spacing: -.02em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.mid { font-family: var(--font-display); font-size: 1.3rem; font-weight: 650; font-variant-numeric: tabular-nums; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.kpi { padding: 12px 14px; border-radius: var(--radius-sm); background: var(--panel-2); border: 1px solid var(--line); }
.kpi .label { font-size: .74rem; color: var(--muted); font-weight: 600; }
.kpi .value { font-family: var(--font-display); font-size: 1.25rem; font-weight: 650; font-variant-numeric: tabular-nums; margin-top: 2px; }

/* ---------- controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer;
  border-radius: 12px; border: 1px solid var(--line-strong); background: var(--panel-2);
  padding: 9px 15px; font-weight: 650; font-size: .87rem; color: var(--ink); text-decoration: none; white-space: nowrap;
}
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; box-shadow: 0 6px 18px rgba(34, 211, 230, .25); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 45%, transparent); }
.btn.danger.armed { background: var(--bad); color: #fff; }
.btn.sm { padding: 6px 11px; font-size: .78rem; border-radius: 10px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn svg { width: 16px; height: 16px; }
.seg { display: inline-flex; padding: 3px; gap: 3px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line); }
.seg button { border: 0; background: transparent; padding: 6px 12px; border-radius: 9px; font-size: .8rem; font-weight: 650; color: var(--muted); cursor: pointer; }
.seg button.on { background: var(--accent); color: var(--accent-ink); }
.weeknav { display: inline-flex; align-items: center; gap: 4px; padding: 3px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); }
.weeknav button { border: 0; background: transparent; width: 32px; height: 32px; border-radius: 9px; cursor: pointer; display: grid; place-items: center; color: var(--ink); }
.weeknav button:hover { background: var(--panel-2); }
.weeknav span { font-weight: 650; font-size: .86rem; padding: 0 8px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.weeknav svg { width: 16px; height: 16px; }

label.field { display: flex; flex-direction: column; gap: 5px; font-size: .78rem; font-weight: 650; color: var(--ink-2); min-width: 0; }
.input, select.input, textarea.input {
  width: 100%; border-radius: 11px; border: 1px solid var(--line-strong); background: var(--panel-solid);
  padding: 10px 12px; font-size: .92rem; color: var(--ink); min-width: 0;
}
textarea.input { resize: vertical; min-height: 70px; }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(34, 211, 230, .15); }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.money-in { position: relative; }
.money-in::before { content: "$"; position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: .85rem; }
.money-in .input { padding-left: 22px; text-align: right; font-variant-numeric: tabular-nums; }
.daypick { display: flex; gap: 5px; flex-wrap: wrap; }
.daypick label { cursor: pointer; }
.daypick input { position: absolute; opacity: 0; pointer-events: none; }
.daypick span { display: grid; place-items: center; width: 40px; height: 36px; border-radius: 10px; border: 1px solid var(--line-strong); font-weight: 700; font-size: .78rem; }
.daypick input:checked + span { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.daypick input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- chips / pills ---------- */
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: .72rem; font-weight: 700; white-space: nowrap; background: var(--panel-2); color: var(--ink-2); border: 1px solid var(--line); }
.chip.good { background: var(--good-bg); color: var(--good); border-color: transparent; }
.chip.warn { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.chip.bad { background: var(--bad-bg); color: var(--bad); border-color: transparent; }
.chip.info { background: var(--info-bg); color: var(--accent); border-color: transparent; }
.chip .pip { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: .74rem; color: #fff; flex: none; }
.avatar.sm { width: 26px; height: 26px; font-size: .66rem; }

/* ---------- lists / tables ---------- */
.list { display: flex; flex-direction: column; }
.list > .item { display: flex; align-items: center; gap: 12px; padding: 11px 2px; border-top: 1px solid var(--line); }
.list > .item:first-child { border-top: 0; }
.item.clickable { cursor: pointer; border-radius: 10px; }
.item.clickable:hover { background: var(--panel-2); }
.table-wrap { overflow-x: auto; margin: 0 -4px; }
table.t { width: 100%; border-collapse: collapse; font-size: .86rem; }
table.t th { text-align: left; font-size: .7rem; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); font-weight: 700; padding: 8px 8px; border-bottom: 1px solid var(--line-strong); white-space: nowrap; }
table.t td { padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; font-variant-numeric: tabular-nums; }
table.t tr.click { cursor: pointer; }
table.t tr.click:hover td { background: var(--panel-2); }
table.t td.r, table.t th.r { text-align: right; }
table.t tfoot td { font-weight: 800; border-bottom: 0; border-top: 1px solid var(--line-strong); }
.empty { padding: 26px 10px; text-align: center; color: var(--muted); font-size: .88rem; }

/* P&L sheet (mirrors the Excel layout) */
.pl { display: grid; grid-template-columns: 1fr minmax(110px, 150px) 64px; gap: 0; font-variant-numeric: tabular-nums; }
.pl > div { padding: 7px 4px; border-bottom: 1px solid var(--line); display: flex; align-items: center; min-width: 0; }
.pl .lab { font-weight: 600; font-size: .86rem; justify-content: flex-start; }
.pl .lab .src { margin-left: 6px; }
.pl .amt { justify-content: flex-end; }
.pl .pct { justify-content: flex-end; font-size: .8rem; color: var(--muted); }
.pl .sum { font-weight: 800; font-family: var(--font-display); }
.pl .total-exp { background: var(--bad-bg); }
.pl .total-pro { background: var(--good-bg); }
.pl .total-pro.neg { background: var(--bad-bg); }
.pl .head { font-size: .7rem; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); font-weight: 700; border-bottom-color: var(--line-strong); }
.pl .amt .money-in { width: 100%; }
.pl .amt .input { padding-block: 6px; }

/* ---------- schedule grid ---------- */
.sched-wrap { overflow-x: auto; margin: 0 -2px; }
.sched { display: grid; grid-template-columns: 170px repeat(7, minmax(118px, 1fr)); min-width: 1000px; }
.sched > div { border-bottom: 1px solid var(--line); border-left: 1px solid var(--line); padding: 7px; min-height: 64px; min-width: 0; }
.sched .hd { min-height: 0; background: var(--panel-2); position: sticky; top: 0; }
.sched .hd.today { box-shadow: inset 0 3px 0 var(--accent); }
.sched .who { border-left: 0; display: flex; align-items: center; gap: 9px; }
.sched .cell { cursor: pointer; display: flex; flex-direction: column; gap: 5px; }
.sched .cell:hover { background: var(--panel-2); }
.sched .cell .add { opacity: 0; font-size: .74rem; color: var(--muted); margin-top: auto; }
.sched .cell:hover .add { opacity: 1; }
.sched .foot { min-height: 0; font-size: .74rem; background: var(--panel-2); }
.shift {
  border-radius: 9px; padding: 5px 7px; font-size: .74rem; line-height: 1.3; border: 1px solid transparent;
  background: var(--info-bg); color: var(--ink); font-variant-numeric: tabular-nums; cursor: pointer;
}
.shift b { font-weight: 800; display: block; }
.shift.draft { border-style: dashed; border-color: var(--accent); background: transparent; }
.shift.sick, .shift.no_show, .shift.called_off { background: var(--bad-bg); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--bad) 60%, transparent); }
.shift.covered { background: var(--warn-bg); }
.shift.leave { background: var(--warn-bg); color: var(--warn); font-weight: 700; cursor: default; }
.ev-chip { display: block; font-size: .68rem; font-weight: 700; padding: 2px 6px; border-radius: 6px; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev-high { background: var(--bad-bg); color: var(--bad); }
.ev-medium { background: var(--warn-bg); color: var(--warn); }
.ev-low { background: var(--info-bg); color: var(--accent); }

/* employee day list */
.days { display: flex; flex-direction: column; gap: 10px; }
.day { display: grid; grid-template-columns: 62px 1fr; gap: 12px; align-items: start; padding: 12px; border-radius: 14px; background: var(--panel-2); border: 1px solid var(--line); }
.day.today { border-color: var(--accent); }
.day .d { text-align: center; }
.day .d .dow { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; }
.day .d .dn { font-family: var(--font-display); font-size: 1.45rem; font-weight: 700; }

/* calendar */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.cal > div { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); min-height: 92px; padding: 6px; min-width: 0; }
.cal .dow { min-height: 0; text-align: center; font-size: .7rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); background: var(--panel-2); }
.cal .out { opacity: .38; }
.cal .dnum { font-weight: 800; font-size: .8rem; font-variant-numeric: tabular-nums; }
.cal .today .dnum { background: var(--accent); color: var(--accent-ink); border-radius: 6px; padding: 0 5px; }
.cal .task-chip { display: block; font-size: .66rem; padding: 2px 5px; border-radius: 6px; margin-top: 3px; background: var(--panel-2); border: 1px dashed var(--line-strong); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal .cday { cursor: pointer; }
.cal .cday:hover { background: var(--panel-2); }
.cal .cday.sel { box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--accent) 55%, transparent); }
.cal-dots, .cal-legend.phone, .cal-hint, .cal-agenda { display: none; }
.cal-dots i, .cal-legend i, .agenda-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; flex: none; background: var(--muted); }
.cal-dots .high, .cal-legend .high, .agenda-dot.high { background: var(--bad); }
.cal-dots .medium, .cal-legend .medium, .agenda-dot.medium { background: var(--warn); }
.cal-dots .low, .cal-legend .low, .agenda-dot.low { background: var(--accent); }
.cal-dots .stat, .cal-legend .stat { background: var(--c7); }
.cal-dots .task, .cal-legend .task { background: transparent; box-shadow: inset 0 0 0 1.5px var(--muted); }
.agenda-dot { width: 8px; height: 8px; }
.agenda-sec + .agenda-sec { margin-top: 14px; }
.agenda-sec .eyebrow { margin-bottom: 4px; }
@media (max-width: 640px) {
  .cal-card { padding: 10px 6px 12px !important; }
  .cal { border: 0; border-radius: 0; row-gap: 2px; }
  .cal > div { border: 0; min-height: 0; padding: 3px 0 5px; display: flex; flex-direction: column; align-items: center; gap: 3px; }
  .cal .dow { background: none; font-size: .64rem; letter-spacing: .06em; padding: 2px 0 8px; }
  .cal .cday:hover { background: none; }
  .cal .cday.sel { box-shadow: none; }
  .cal .cal-chips, .cal .cday .stat-tag { display: none; }
  .cal .dnum { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; font-size: .92rem; font-weight: 650; padding: 0; transition: background .15s; }
  .cal .is-stat .dnum { color: var(--c7); font-weight: 800; }
  .cal .sel .dnum { background: var(--info-bg); color: var(--accent); box-shadow: inset 0 0 0 1.5px var(--accent); font-weight: 800; }
  .cal .today .dnum { background: var(--accent); color: var(--accent-ink); border-radius: 50%; padding: 0; font-weight: 800; }
  .cal .today.sel .dnum { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent); }
  .cal .out { opacity: .32; }
  .cal-dots { display: flex; justify-content: center; gap: 3px; height: 6px; }
  .cal-legend.wide { display: none !important; }
  .cal-legend.phone { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 14px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); font-size: .74rem; color: var(--muted); }
  .cal-legend.phone span { display: inline-flex; align-items: center; gap: 5px; }
  .cal-hint { display: block; text-align: center; margin-top: 6px; }
  .cal-agenda { display: block; scroll-margin-top: 80px; }
}

/* clock */
.clock-btn {
  width: 168px; height: 168px; border-radius: 50%; border: 0; cursor: pointer; display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; color: var(--accent-ink);
  background: radial-gradient(circle at 35% 30%, #6ff0fb, var(--accent) 55%, #0b8fa3);
  box-shadow: 0 0 0 10px rgba(34, 211, 230, .12), 0 0 0 22px rgba(34, 211, 230, .06), 0 18px 40px rgba(0, 0, 0, .35);
  transition: transform .15s ease;
}
.clock-btn:active { transform: scale(.97); }
.clock-btn.out { background: radial-gradient(circle at 35% 30%, #ffb4b4, #f87171 55%, #c2410c); color: #2a0606; box-shadow: 0 0 0 10px rgba(248, 113, 113, .14), 0 0 0 22px rgba(248, 113, 113, .06), 0 18px 40px rgba(0, 0, 0, .35); }
.clock-btn[disabled] { filter: grayscale(.6); opacity: .7; cursor: progress; }
.clock-btn small { display: block; font-size: .72rem; font-weight: 600; opacity: .8; font-family: var(--font-body); }
.geo { font-size: .82rem; display: flex; align-items: center; gap: 8px; justify-content: center; text-align: center; }

/* charts */
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart text { fill: var(--muted); font-family: var(--font-body); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart .val { fill: var(--ink); font-weight: 700; }
.feature .chart .val { fill: var(--feature-ink); }
.legend { display: flex; flex-direction: column; gap: 7px; font-size: .82rem; }
.legend .li { display: grid; grid-template-columns: 12px 1fr auto auto; gap: 10px; align-items: center; font-variant-numeric: tabular-nums; }
.legend .sw { width: 10px; height: 10px; border-radius: 50%; }
.donut-row { display: grid; grid-template-columns: minmax(150px, 190px) 1fr; gap: 18px; align-items: center; }

/* modal */
.modal-back { position: fixed; inset: 0; background: rgba(3, 10, 22, .55); z-index: 50; display: grid; place-items: center; padding: 16px; backdrop-filter: blur(3px); }
.modal {
  width: min(560px, 100%); max-height: calc(100% - 32px); overflow: auto; background: var(--panel-solid);
  border: 1px solid var(--line-strong); border-radius: 20px; box-shadow: var(--shadow); padding: 20px;
}
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; gap: 10px; }
.modal-foot { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; flex-wrap: wrap; }
.modal-foot .spacer { flex: 1; }

/* toasts */
.toasts { position: fixed; z-index: 60; right: max(16px, env(safe-area-inset-right, 0px)); top: calc(70px + env(safe-area-inset-top, 0px)); display: flex; flex-direction: column; gap: 8px; width: min(360px, calc(100% - 32px)); }
.toast { background: var(--panel-solid); border: 1px solid var(--line-strong); border-left: 4px solid var(--accent); border-radius: 12px; padding: 11px 14px; box-shadow: var(--shadow); font-size: .86rem; animation: slidein .25s ease; }
.toast.bad { border-left-color: var(--bad); }
.toast.good { border-left-color: var(--good); }
.toast b { display: block; }
@keyframes slidein { from { transform: translateY(-6px); opacity: .4; } to { transform: none; opacity: 1; } }

/* notifications panel */
.panel-drop { position: fixed; z-index: 45; top: calc(64px + env(safe-area-inset-top, 0px)); right: max(16px, env(safe-area-inset-right, 0px)); width: min(400px, calc(100% - 32px)); max-height: 70vh; overflow: auto; }
.notif { display: grid; grid-template-columns: 10px 1fr; gap: 10px; padding: 10px 4px; border-top: 1px solid var(--line); }
.notif:first-child { border-top: 0; }
.notif .u { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-top: 6px; }
.notif .u.read { background: transparent; }

/* auth */
.auth { min-height: 100%; display: grid; place-items: center; padding-block: 40px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.auth-card { width: min(980px, 100%); display: grid; grid-template-columns: 1.05fr 1fr; gap: 18px; }
.auth-card .feature { padding: 30px; display: flex; flex-direction: column; gap: 18px; justify-content: space-between; min-height: 420px; }
.auth h1 { font-size: 2rem; }
.role-pick { display: grid; gap: 10px; }
.role-pick button { text-align: left; cursor: pointer; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line-strong); background: var(--panel-2); color: var(--ink); display: flex; gap: 12px; align-items: center; }
.role-pick button:hover { border-color: var(--accent); }
.err { color: var(--bad); font-size: .84rem; }
.note { padding: 11px 13px; border-radius: 12px; background: var(--info-bg); font-size: .84rem; color: var(--ink); }
.note.warn { background: var(--warn-bg); }
.copybox { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; border: 1px dashed var(--line-strong); font-family: ui-monospace, Menlo, monospace; font-size: 1.05rem; letter-spacing: .12em; font-weight: 700; }

/* ---------- phone layout ---------- */
@media (max-width: 860px) {
  .nav { display: none; }
  .brand-store { max-width: 150px; }
  .theme-pick { display: none; }
  .grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .grid > * { grid-column: 1 / -1; }
  main.content { padding-block: 16px calc(96px + env(safe-area-inset-bottom, 0px)); }
  .card { padding: 15px; border-radius: 16px; }
  .big { font-size: 1.7rem; }
  .tabbar {
    display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: fixed; z-index: 25; left: 0; right: 0; bottom: 0;
    background: var(--header); color: var(--header-ink); border-top: 1px solid var(--line);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    padding-top: 6px; padding-bottom: max(8px, env(safe-area-inset-bottom, 0px));
    padding-left: max(8px, env(safe-area-inset-left, 0px)); padding-right: max(8px, env(safe-area-inset-right, 0px));
  }
  .tabbar a, .tabbar button { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: .66rem; font-weight: 700; text-decoration: none; color: inherit; opacity: .6; padding: 4px 0; border: 0; background: none; cursor: pointer; }
  .tabbar a.on { opacity: 1; color: var(--accent); }
  .tabbar svg { width: 22px; height: 22px; }
  .auth-card { grid-template-columns: 1fr; }
  .auth-card .feature { min-height: 0; }
  .donut-row { grid-template-columns: 1fr; justify-items: center; }
  .donut-row .legend { width: 100%; }
  .modal-back { place-items: end center; padding: 0; }
  .modal { width: 100%; border-radius: 22px 22px 0 0; max-height: 92%; padding-bottom: max(20px, env(safe-area-inset-bottom, 0px)); }
  .page-head h1 { font-size: 1.3rem; }
  .pl { grid-template-columns: 1fr minmax(100px, 130px) 52px; }
}
.more-sheet a { text-decoration: none; color: var(--ink); }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
:root[data-skin="dusk"] .topbar, :root[data-skin="dusk"] .tabbar { --line-strong: rgba(200, 225, 255, .26); --line: rgba(200, 225, 255, .14); --panel-2: rgba(255, 255, 255, .06); }
.colorpick label { cursor: pointer; position: relative; }
.colorpick input { position: absolute; opacity: 0; pointer-events: none; }
.colorpick input:checked + .avatar { outline: 2px solid var(--ink); outline-offset: 2px; }
.colorpick input:focus-visible + .avatar { outline: 2px dashed var(--accent); outline-offset: 2px; }

/* Ontario rules + stat holidays */
.stat-tag { display: inline-flex; align-items: center; gap: 4px; font-size: .64rem; font-weight: 800; letter-spacing: .06em; padding: 2px 7px; border-radius: 6px; background: var(--c7); color: #0b1020; white-space: nowrap; vertical-align: middle; }
.ev-chip.stat-chip { background: var(--c7); color: #0b1020; }
.stat-card { border-color: color-mix(in srgb, var(--c7) 55%, transparent); }
.rule-flag { display: inline-block; font-size: .64rem; font-weight: 800; padding: 2px 6px; border-radius: 6px; white-space: nowrap; }
.rule-flag.bad { background: var(--bad-bg); color: var(--bad); }
.rule-flag.warn { background: var(--warn-bg); color: var(--warn); }
.chip.bad .pip, .chip.warn .pip { background: currentColor; }
.note ul li.err { color: var(--bad); }

/* Time clock widget — a timer-style object that stays dark in every theme */
.clockw-wrap { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.clockw {
  display: flex; flex-direction: column; gap: 14px;
  background: #0b0d10; color: #f3f6f8; border-radius: 30px; padding: 14px 14px 16px 26px;
  box-shadow: 0 18px 40px rgba(4, 10, 20, .35);
}
.clockw-top { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 44%); gap: 14px; align-items: center; }
.clockw-left { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.clockw-label { font-size: .86rem; color: #cbd5dc; }
.clockw-time {
  font-family: var(--font-display); font-weight: 300; font-size: clamp(2.6rem, 7.5vw, 4.2rem);
  line-height: 1.05; letter-spacing: -.02em; font-variant-numeric: tabular-nums; white-space: nowrap;
}
.clockw-time small { font-size: .36em; font-weight: 400; color: #7f8d98; margin-left: 2px; letter-spacing: 0; }
.clockw-sub { font-size: .78rem; color: #8b98a4; }
.clockw-tile {
  position: relative; width: 100%; max-width: 230px; aspect-ratio: 1; justify-self: end;
  background: #4c7b87; border-radius: 24px; display: grid; place-items: center;
}
.clockw-ring { width: 88%; height: 88%; transform: rotate(-90deg); }
.clockw-ring circle { fill: none; }
.clockw-ring .bg { stroke: #2d5862; }
.clockw-ring .fg { stroke: #8fe0f5; stroke-linecap: round; transition: stroke-dashoffset .9s linear; }
.clockw.off .clockw-ring .fg { stroke: #b9d9e1; }
.clockw-center {
  position: absolute; width: 46%; aspect-ratio: 1; border-radius: 50%; border: 0; cursor: pointer;
  background: #0b0d10; color: #f3f6f8; display: grid; place-items: center; transition: transform .12s ease;
}
.clockw-center:active { transform: scale(.95); }
.clockw-center svg { width: 34%; height: 34%; }
.clockw-left-in {
  position: absolute; width: 50%; aspect-ratio: 1; border-radius: 50%; background: #0b0d10;
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
}
.clockw-left-in b { font-family: var(--font-display); font-weight: 400; font-size: clamp(.95rem, 3.6vw, 1.3rem); font-variant-numeric: tabular-nums; }
.clockw-left-in span { font-size: .58rem; color: #8b98a4; text-transform: uppercase; letter-spacing: .06em; }
.clockw-actions { display: flex; gap: 10px; }
.clockw-pill {
  flex: 1; border: 0; border-radius: 14px; padding: 13px 16px; cursor: pointer;
  background: #2b2e33; color: #f1f4f7; font: 600 .98rem var(--font-body);
}
.clockw-pill:hover { background: #363a40; }
.clockw-pill.go { background: #8fe0f5; color: #05242d; }
.clockw-pill.go:hover { background: #a6e8f8; }
.clockw-pill.out { background: #f3f6f8; color: #0b0d10; }
.clockw-pill.out:hover { background: #ffffff; }
.clockw:not(.break) .clockw-actions:has(.go) .clockw-pill { flex: 0 1 auto; min-width: 140px; }

/* Break: a red ring that grows into the middle and counts down */
.clockw.break { align-items: center; text-align: center; padding: 22px 18px 20px; gap: 10px; }
.clockw-bigring { position: relative; width: min(78%, 300px); aspect-ratio: 1; display: grid; place-items: center; }
.clockw-bigring .clockw-ring { width: 100%; height: 100%; }
.clockw-ring.red .bg { stroke: #3a1d21; }
.clockw-ring.red .fg { stroke: #ff5d5d; }
.clockw-bigring.enter { animation: ringIn .7s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes ringIn { from { transform: translate(34%, -18%) scale(.4); opacity: .5; } to { transform: none; opacity: 1; } }
.clockw-count { position: absolute; inset: 0; display: grid; place-items: center; }
.clockw.break .clockw-time { font-size: clamp(3rem, 13vw, 4.6rem); }
.clockw.break .clockw-time small { display: block; font-size: .24em; text-transform: uppercase; letter-spacing: .12em; margin: 4px 0 0; }
.clockw.over .clockw-time, .clockw.over .clockw-label { color: #ff8a8a; }
.clockw.over .clockw-bigring { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.03); } }
.clockw-back {
  margin-top: 6px; width: min(100%, 320px); border: 0; border-radius: 16px; padding: 15px 18px; cursor: pointer;
  background: #f3f6f8; color: #0b0d10; font: 700 1.05rem var(--font-body);
}
.clockw-back:hover { background: #fff; }
.clockw button:focus-visible { outline: 2px solid #8fe0f5; outline-offset: 3px; }
.clockw button[disabled] { opacity: .55; cursor: progress; }
@media (max-width: 420px) {
  .clockw { padding: 12px 12px 14px 18px; border-radius: 26px; gap: 12px; }
  .clockw-top { gap: 10px; }
  .clockw-pill { padding: 12px 10px; }
}
@media (prefers-reduced-motion: reduce) { .clockw-bigring.enter, .clockw.over .clockw-bigring { animation: none; } }

/* Time log flags */
.flag { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 999px; font-size: .7rem; font-weight: 700; white-space: nowrap; background: var(--warn-bg); color: var(--warn); }
.flag.bad { background: var(--bad-bg); color: var(--bad); }
.flag.ok { background: var(--good-bg); color: var(--good); }
.nowrap { white-space: nowrap; }
.inv-log td.r { white-space: nowrap; }
@media (max-width: 560px) { .inv-log .sup { display: none; } }
.clockw-incl { color: #8b98a4; font-size: .92em; white-space: nowrap; }
.clockw-pill[disabled] { opacity: .45; cursor: default; }

/* ---------- time cards: a table on big screens, a list that fits on phones ---------- */
.tc-list { display: none; }
.tc-row { display: flex; align-items: center; gap: 12px; padding: 11px 2px; border-bottom: 1px solid var(--line); }
.tc-row.click { cursor: pointer; }
.tc-list > .tc-row:last-child { border-bottom: 0; }
.tc-row .grow { min-width: 0; }
.tc-row .tc-when { font-weight: 700; font-size: .92rem; }
.tc-row .tc-times { font-size: .84rem; color: var(--ink-2, var(--muted)); font-variant-numeric: tabular-nums; margin-top: 1px; }
.tc-row .tc-extra { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 5px; }
.tc-row .tc-extra:empty { display: none; }
.tc-h { text-align: right; flex: none; font-variant-numeric: tabular-nums; }
.tc-h b { font-family: var(--font-display); font-size: 1.15rem; font-weight: 700; }
.tc-h span { display: block; font-size: .68rem; color: var(--muted); font-weight: 700; letter-spacing: .04em; }
.tc-total { display: flex; justify-content: space-between; align-items: baseline; padding: 12px 2px 2px; font-weight: 800; }
.tc-total b { font-family: var(--font-display); font-size: 1.2rem; }
@media (max-width: 640px) {
  .tc-table { display: none; }
  .tc-list { display: block; }
}

/* ---------- swipe back / forward ---------- */
.swipe-ind {
  position: fixed; top: 50%; z-index: 60; width: 44px; height: 44px; margin-top: -22px; border-radius: 50%;
  display: grid; place-items: center; pointer-events: none; opacity: 0;
  background: var(--panel); color: var(--ink); border: 1px solid var(--line-strong); box-shadow: 0 8px 24px rgba(0, 0, 0, .25);
  transition: background .12s, color .12s;
}
.swipe-ind svg { width: 22px; height: 22px; }
.swipe-ind.l { left: -48px; }
.swipe-ind.r { right: -48px; }
.swipe-ind.ready { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.swipe-ind.done { transition: transform .18s ease, opacity .18s ease; }
main.content.nav-back { animation: navBack .22s ease; }
main.content.nav-fwd { animation: navFwd .22s ease; }
@keyframes navBack { from { opacity: .4; transform: translateX(-28px); } to { opacity: 1; transform: none; } }
@keyframes navFwd { from { opacity: .4; transform: translateX(28px); } to { opacity: 1; transform: none; } }
.modal.dragging { transition: none; }
.modal.snap { transition: transform .2s ease; }
@media (max-width: 860px) {
  .modal-head { position: relative; padding-top: 10px; }
  .modal-head::before { content: ''; position: absolute; left: 50%; top: -6px; width: 38px; height: 4px; margin-left: -19px; border-radius: 2px; background: var(--line-strong); }
}
@media (prefers-reduced-motion: reduce) { main.content.nav-back, main.content.nav-fwd { animation: none; } }

/* ---------- wide tables become stacked rows on phones (no sideways scrolling) ---------- */
@media (max-width: 640px) {
  table.t.stack, table.t.stack tbody, table.t.stack tfoot { display: block; width: 100%; }
  table.t.stack thead { display: none; }
  table.t.stack tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 12px; padding: 12px 2px; border-bottom: 1px solid var(--line); }
  table.t.stack.c4 tr { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  table.t.stack td { display: block; padding: 0; border: 0; min-width: 0 !important; text-align: left !important; }
  table.t.stack td.full { grid-column: 1 / -1; }
  table.t.stack td.half { grid-column: span 2; }
  table.t.stack td.day-cell { align-self: center; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
  table.t.stack td[data-label]::before { content: attr(data-label); display: block; margin-bottom: 2px; font-size: .64rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
  table.t.stack tfoot tr { border-bottom: 0; border-top: 1px solid var(--line-strong); }
  table.t.stack tfoot td { border-top: 0; }
  table.t.stack tr.foot-row { display: flex; justify-content: space-between; align-items: baseline; }
  table.t.stack tr.click:hover td { background: none; }
  table.t.stack .phone-b { font-size: .92rem; }
  table.t.stack .money-in .input { width: 100%; }
  table.t.stack .ph-hide { display: none; }
  table.t.stack td.pay-name { grid-column: 1; grid-row: 1; align-self: center; }
  table.t.stack td.pay-total { grid-column: 2; grid-row: 1; text-align: right !important; }
}
.ph-only { display: none; }
@media (max-width: 640px) { table.t.stack .ph-only { display: block; } }

/* ---------- Toast daily email card ---------- */
ol.steps { margin: 0; padding-left: 20px; display: grid; gap: 8px; color: var(--ink-2); }
ol.steps b { color: var(--ink); }
textarea.mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .74rem; line-height: 1.4; white-space: pre; }
details.feed-more summary { cursor: pointer; color: var(--accent); font-weight: 600; padding: 4px 0; }
details.feed-more[open] summary { margin-bottom: 10px; }
