/* Clean Enterprise Glass Design System for ALM Attendance Analyzer.
   Crisp white light mode + sleek obsidian dark mode with subtle indigo & cyan accents.
   4px spacing grid, text weights 400/500/600, tabular numerals everywhere. */
:root {
  --bg: #f4f6fb;
  --bg-glow: radial-gradient(900px 420px at 14% -8%, rgb(79 70 229 / .07), transparent 62%),
             radial-gradient(760px 380px at 88% -10%, rgb(6 182 212 / .06), transparent 60%);
  --card: #ffffff;
  --glass: rgb(255 255 255 / .82);
  --glass-strong: rgb(255 255 255 / .92);
  --soft: #eaeff7;
  --softer: #f7f9fc;
  --ink: #0f172a;
  --muted: #475569;
  --faint: #64748b;
  --line: rgb(15 23 42 / .09);
  --line-strong: rgb(15 23 42 / .16);
  --brand: #0f1e36;
  --accent: #4f46e5;
  --accent-hover: #4338ca;
  --accent-soft: rgb(79 70 229 / .10);
  --accent-ink: #4338ca;
  --cyan: #0891b2;
  --cyan-bright: #06b6d4;
  --cyan-soft: rgb(6 182 212 / .12);
  --ok: #059669;
  --ok-soft: #e6f7f0;
  --warn: #b45309;
  --warn-soft: #fef3c7;
  --bad: #dc2626;
  --bad-soft: #fee2e2;
  --info: #0284c7;
  --info-soft: #e0f2fe;
  --radius: 9px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 2px rgb(15 23 42 / .04), 0 1px 3px rgb(15 23 42 / .03);
  --shadow-md: 0 6px 20px -4px rgb(15 23 42 / .08), 0 2px 6px -2px rgb(15 23 42 / .04);
  --shadow-lg: 0 18px 42px -8px rgb(15 23 42 / .16), 0 4px 12px -2px rgb(15 23 42 / .06);
  --ring: 0 0 0 3px rgb(79 70 229 / .16);
  --ease: cubic-bezier(.22, 1, .36, 1);
  --scrollbar-track: #edf1f7;
  --scrollbar-thumb: #94a3b8;
  color-scheme: light;
  accent-color: var(--accent);
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}
html.dark {
  --bg: #090d16;
  --bg-glow: radial-gradient(920px 440px at 14% -8%, rgb(99 102 241 / .16), transparent 62%),
             radial-gradient(780px 400px at 88% -10%, rgb(34 211 238 / .11), transparent 60%);
  --card: #111726;
  --glass: rgb(15 21 36 / .78);
  --glass-strong: rgb(17 23 38 / .92);
  --soft: #1d263b;
  --softer: #151d2e;
  --ink: #f1f5f9;
  --muted: #94a3b8;
  --faint: #7b8ba5;
  --line: rgb(148 163 184 / .13);
  --line-strong: rgb(148 163 184 / .24);
  --brand: #f1f5f9;
  --accent: #6366f1;
  --accent-hover: #7578f7;
  --accent-soft: rgb(99 102 241 / .20);
  --accent-ink: #a5b4fc;
  --cyan: #22d3ee;
  --cyan-bright: #38bdf8;
  --cyan-soft: rgb(34 211 238 / .15);
  --ok: #34d399;
  --ok-soft: rgb(16 185 129 / .16);
  --warn: #fbbf24;
  --warn-soft: rgb(245 158 11 / .16);
  --bad: #f87171;
  --bad-soft: rgb(239 68 68 / .16);
  --info: #38bdf8;
  --info-soft: rgb(56 189 248 / .16);
  --shadow-sm: 0 1px 0 rgb(255 255 255 / .03) inset, 0 2px 6px rgb(0 0 0 / .24);
  --shadow-md: 0 1px 0 rgb(255 255 255 / .04) inset, 0 10px 28px -6px rgb(0 0 0 / .48);
  --shadow-lg: 0 1px 0 rgb(255 255 255 / .06) inset, 0 22px 48px -8px rgb(0 0 0 / .68);
  --ring: 0 0 0 3px rgb(99 102 241 / .30);
  --scrollbar-track: #0f1524;
  --scrollbar-thumb: #475569;
  color-scheme: dark;
}

@supports not (scrollbar-color: auto) {
  ::-webkit-scrollbar { width: 10px; height: 10px; }
  ::-webkit-scrollbar-track { background: var(--scrollbar-track); }
  ::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb); border-radius: 5px; }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  background-color: var(--bg); background-image: var(--bg-glow); background-attachment: fixed;
  color: var(--ink);
  font: 14px/20px Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 24px; line-height: 32px; font-weight: 600; letter-spacing: -0.02em; margin: 0; }
h2 { font-size: 16px; line-height: 24px; font-weight: 600; letter-spacing: -0.01em; margin: 24px 0 12px; }
h3 { font-size: 14px; line-height: 20px; font-weight: 600; margin: 16px 0 8px; }
p { margin: 4px 0; }
b { font-weight: 500; }
kbd {
  display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 5px;
  font: 500 11px/1 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  color: var(--muted); background: var(--softer); border: 1px solid var(--line-strong); border-radius: 5px;
}
.muted { color: var(--muted); }
.small, small { font-size: 12px; line-height: 16px; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.strong { font-weight: 500; color: var(--ink); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-variant-numeric: tabular-nums; }
.zero { opacity: .34; }
svg.icon { width: 16px; height: 16px; flex: none; vertical-align: -3px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---- Traditional Collapsible Left Sidebar + App Shell ---- */
:root { --side-w: 256px; }
html.side-collapsed { --side-w: 72px; }

.shell { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; width: 100%; transition: grid-template-columns .2s var(--ease); }
.stage { display: flex; flex-direction: column; min-width: 0; min-height: 100vh; }

.sidebar {
  position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; overflow: hidden;
  background: var(--glass);
  backdrop-filter: blur(16px) saturate(160%); -webkit-backdrop-filter: blur(16px) saturate(160%);
  border-right: 1px solid var(--line); z-index: 35;
}
.sidebar::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--cyan-bright)); opacity: .9;
}
body[data-company="automotive"] .sidebar::before {
  background: linear-gradient(90deg, var(--cyan), #14b8a6);
}

.side-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  height: 60px; padding: 0 12px 0 16px; border-bottom: 1px solid var(--line); flex: none;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 15px; letter-spacing: -0.015em; color: var(--brand); white-space: nowrap; min-width: 0; }
.brand:hover { text-decoration: none; }
.brand-mark {
  display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 9px; flex: none;
  background: linear-gradient(135deg, var(--accent), var(--cyan)); color: #fff;
  box-shadow: 0 4px 12px -2px rgb(79 70 229 / .38);
}
.brand-mark svg.icon { width: 17px; height: 17px; stroke-width: 2.1; }
.side-close-btn { display: none; }

.side-tools { display: grid; gap: 8px; padding: 12px 12px 8px; flex: none; }
.side-company {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 7px 10px;
  border-radius: var(--radius); border: 1px solid var(--line-strong); background: var(--card); color: var(--ink);
  text-align: left; cursor: pointer; box-shadow: var(--shadow-sm);
  transition: border-color .15s var(--ease), background-color .15s var(--ease), box-shadow .15s var(--ease);
}
.side-company.static { cursor: default; }
button.side-company:hover { border-color: var(--accent); background: var(--softer); box-shadow: var(--shadow-sm); }
.side-company-text { flex: 1; min-width: 0; line-height: 15px; }
.side-company-text small { display: block; font-size: 10px; font-weight: 500; text-transform: uppercase; letter-spacing: .05em; color: var(--faint); }
.side-company-text b { display: block; font-size: 13px; font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 1px; }
.side-company-swap { color: var(--faint); display: inline-flex; flex: none; }
.co-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.co-dot.automotive { background: var(--cyan); box-shadow: 0 0 0 3px var(--cyan-soft); }

.side-jump {
  display: flex; align-items: center; gap: 8px; width: 100%; height: 34px; min-height: 0; padding: 0 10px;
  border-radius: var(--radius); border: 1px solid var(--line); background: var(--softer); color: var(--muted);
  font-size: 13px; font-weight: 400; justify-content: flex-start; cursor: pointer; box-shadow: none;
}
.side-jump:hover { background: var(--card); color: var(--ink); border-color: var(--accent); box-shadow: none; }
.side-jump kbd { margin-left: auto; }

.side-nav { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 8px 10px 14px; display: flex; flex-direction: column; gap: 14px; }
.side-group { display: grid; gap: 2px; }
.side-group-label { padding: 4px 10px 4px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); white-space: nowrap; }
.side-link {
  position: relative; display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 10px;
  border-radius: var(--radius); color: var(--muted); font-weight: 500; font-size: 13.5px; white-space: nowrap;
  transition: background-color .14s var(--ease), color .14s var(--ease);
}
.side-link svg.icon { color: var(--faint); transition: color .14s var(--ease); }
.side-link span { overflow: hidden; text-overflow: ellipsis; }
.side-link:hover { background: var(--softer); color: var(--ink); text-decoration: none; }
.side-link:hover svg.icon { color: var(--ink); }
.side-link.on {
  background: var(--accent-soft); color: var(--accent-ink); font-weight: 600;
}
.side-link.on::before {
  content: ""; position: absolute; left: 0; top: 7px; bottom: 7px; width: 3px; border-radius: 0 3px 3px 0;
  background: linear-gradient(180deg, var(--accent), var(--cyan-bright));
}
.side-link.on svg.icon { color: var(--accent-ink); }
html.dark .side-link.on { background: linear-gradient(90deg, rgb(99 102 241 / .24), rgb(34 211 238 / .10)); color: #fff; }
html.dark .side-link.on svg.icon { color: var(--cyan); }

.side-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 12px; border-top: 1px solid var(--line); background: var(--softer); flex: none;
}
.side-user { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }
.avatar {
  display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 9px; flex: none;
  background: var(--accent-soft); color: var(--accent-ink); border: 1px solid color-mix(in srgb, var(--accent) 24%, transparent);
  font-size: 12px; font-weight: 600;
}
.side-user .who { min-width: 0; line-height: 16px; }
.side-user .who b { display: block; font-weight: 500; font-size: 13px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-user .who span { display: block; font-size: 11px; color: var(--faint); text-transform: capitalize; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-foot-actions { display: flex; align-items: center; gap: 2px; flex: none; }
.side-foot-actions form { margin: 0; }

/* Desktop collapsed icon-rail state */
@media (min-width: 960px) {
  html.side-collapsed .side-text,
  html.side-collapsed .side-group-label,
  html.side-collapsed .side-company-text,
  html.side-collapsed .side-company-swap { display: none; }
  html.side-collapsed .side-head { padding: 0 8px; justify-content: center; flex-direction: column; height: auto; padding-block: 12px 10px; gap: 8px; }
  html.side-collapsed .side-tools { padding: 10px 10px 6px; }
  html.side-collapsed .side-company { justify-content: center; padding: 0; min-height: 38px; }
  html.side-collapsed .side-jump { justify-content: center; padding: 0; }
  html.side-collapsed .side-nav { padding: 8px 10px; gap: 8px; }
  html.side-collapsed .side-group { padding-top: 6px; border-top: 1px solid var(--line); }
  html.side-collapsed .side-group:first-child { padding-top: 0; border-top: 0; }
  html.side-collapsed .side-link { justify-content: center; padding: 0; }
  html.side-collapsed .side-foot { flex-direction: column; padding: 10px 8px; gap: 6px; }
  html.side-collapsed .side-user { justify-content: center; }
  html.side-collapsed .side-foot-actions { flex-direction: column; }
}

.mobile-bar { display: none; }
.side-backdrop { position: fixed; inset: 0; z-index: 50; background: rgb(9 13 22 / .48); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; min-height: 0; padding: 0;
  border-radius: var(--radius); border: 1px solid transparent; background: none; color: var(--muted); cursor: pointer; box-shadow: none;
}
.icon-btn:hover { background: var(--soft); color: var(--ink); border-color: transparent; box-shadow: none; }
.icon-btn.outline { border-color: var(--line-strong); background: var(--card); }
html:not(.dark) .when-dark, html.dark .when-light { display: none; }

main { width: 100%; max-width: 1320px; margin: 0 auto; padding: 28px 28px 48px; flex: 1; }
main.wide { max-width: none; }
footer.foot { border-top: 1px solid var(--line); padding: 16px; text-align: center; font-size: 12px; color: var(--faint); }

/* ---- Page header ---- */
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.head p { margin: 4px 0 0; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.actions form, td form { margin: 0; display: inline; }
.crumbs { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--faint); margin-bottom: 12px; }
.crumbs a { color: var(--faint); }
.crumbs a:hover { color: var(--ink); }
.crumbs svg.icon { width: 12px; height: 12px; }

/* ---- Cards (Glass-edged Crisp Enterprise) ---- */
.card, .panel {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm); padding: 20px; margin-bottom: 16px;
}
.card > h2:first-child, .panel > h2:first-child, .card > h3:first-child, .panel > h3:first-child { margin-top: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.card-title { display: flex; align-items: center; gap: 10px; font-size: 15px; line-height: 22px; font-weight: 600; margin: 0; }
.chip {
  display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 8px;
  background: var(--softer); color: var(--muted); border: 1px solid var(--line); flex: none;
}
.chip.amber { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.chip.green { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.chip.cyan { background: var(--cyan-soft); color: var(--cyan); border-color: transparent; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(172px, 1fr)); gap: 16px; margin-bottom: 16px; }
.cols-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.cols-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.cols-2, .cols-3 { margin-bottom: 16px; align-items: start; }
.cols-2 > .card, .cols-3 > .card { margin-bottom: 0; }
@media (max-width: 900px) { .cols-2, .cols-3 { grid-template-columns: 1fr; } }

/* Stat cards */
.stat {
  display: block; position: relative; overflow: hidden;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 16px 20px; box-shadow: var(--shadow-sm); color: var(--ink);
  transition: border-color .16s var(--ease), box-shadow .16s var(--ease);
}
a.stat:hover { text-decoration: none; border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); box-shadow: var(--shadow-md); }
.stat b { display: block; font-size: 28px; line-height: 34px; font-weight: 600; letter-spacing: -0.02em; margin-top: 4px; font-variant-numeric: tabular-nums; }
.stat div > span { display: block; color: var(--muted); font-size: 12px; font-weight: 500; text-transform: uppercase; letter-spacing: .04em; }
.stat small { display: block; color: var(--faint); margin-top: 4px; }
.stat.amber { border-color: color-mix(in srgb, var(--warn) 30%, var(--line)); }
.stat.amber b { color: var(--warn); }
.stat.indigo { border-color: color-mix(in srgb, var(--accent) 32%, var(--line)); }
.stat.indigo::after { content: ""; position: absolute; inset: 0 0 auto 0; height: 2px; background: linear-gradient(90deg, var(--accent), var(--cyan-bright)); }
.stat.indigo b { color: var(--accent-ink); }
.stat.cyan b { color: var(--cyan); }

/* Lists & quick tiles */
.list { display: grid; gap: 6px; }
.list > a, .list > div {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 14px; border-radius: var(--radius); background: var(--softer); border: 1px solid transparent; color: var(--ink);
  transition: background-color .15s var(--ease), border-color .15s var(--ease);
}
.list > a:hover { background: var(--card); border-color: var(--line-strong); text-decoration: none; box-shadow: var(--shadow-sm); }
.list b { display: block; }
.list small { color: var(--faint); }
.list .act-arrow { color: var(--faint); transition: transform .15s var(--ease), color .15s var(--ease); }
.list > a:hover .act-arrow { color: var(--accent-ink); transform: translateX(2px); }

.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.tiles a {
  display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 8px 14px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--softer); color: var(--ink); font-weight: 500;
  transition: background-color .15s var(--ease), border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.tiles a:hover { background: var(--card); border-color: color-mix(in srgb, var(--accent) 42%, var(--line)); box-shadow: var(--shadow-sm); text-decoration: none; }
.tiles svg.icon { color: var(--accent-ink); }
.tiles a .small.muted { margin-left: auto; font-weight: 400; text-align: right; }

/* Project cards: semantic status top accent (Closed = calm emerald/slate, never red) */
.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(332px, 1fr)); gap: 16px; }
.project {
  display: flex; flex-direction: column; position: relative;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-sm);
  transition: border-color .16s var(--ease), box-shadow .16s var(--ease);
}
.project::before { content: ""; display: block; height: 3px; background: var(--accent); }
.project[data-status="analyzed"]::before { background: linear-gradient(90deg, var(--accent), var(--cyan-bright)); }
.project[data-status="locked"]::before { background: var(--warn); }
.project[data-status="closed"]::before { background: color-mix(in srgb, var(--ok) 55%, var(--line-strong)); }
.project:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); box-shadow: var(--shadow-md); }
.project > a { display: block; padding: 18px 20px 16px; color: var(--ink); flex: 1; }
.project > a:hover { text-decoration: none; }
.project h3 { margin: 0; font-size: 16px; line-height: 24px; font-weight: 600; }
.project .top-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.project .period { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: var(--radius); background: var(--softer); border: 1px solid var(--line); margin-bottom: 10px; }
.project .period svg.icon { color: var(--accent-ink); }
.kv { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.kv > div { padding: 8px 12px; border-radius: var(--radius); background: var(--softer); min-width: 0; }
.kv small, .project .period small { display: block; color: var(--faint); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.kv b, .project .period b { display: block; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; margin-top: 2px; }
.project .stepper { display: flex; align-items: center; gap: 6px; margin-top: 12px; font-size: 11px; color: var(--faint); }
.project .stepper span { display: inline-flex; align-items: center; gap: 4px; padding: 2px 7px; border-radius: 99px; background: var(--softer); border: 1px solid var(--line); }
.project .stepper span.done { color: var(--ok); background: var(--ok-soft); border-color: transparent; }
.project .foot { display: flex; gap: 8px; padding: 10px 20px; border-top: 1px solid var(--line); background: var(--softer); }
.project .foot form { margin: 0; display: flex; }
.project .foot form:first-child { flex: 1; }
.project .foot form:first-child button { flex: 1; }
.section-title { display: flex; align-items: center; gap: 8px; margin: 24px 0 12px; }
.section-title h2 { margin: 0; }
.section-title svg.icon { color: var(--accent-ink); }
.section-title span { margin-left: auto; color: var(--faint); font-size: 13px; }

/* Project & Report header card */
.phead {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  position: relative; overflow: hidden;
  background: var(--glass); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
  padding: 14px 20px; margin-bottom: 16px;
}
.phead[data-status]::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--accent); }
.phead[data-status="analyzed"]::before { background: linear-gradient(180deg, var(--accent), var(--cyan-bright)); }
.phead[data-status="locked"]::before { background: var(--warn); }
.phead[data-status="closed"]::before { background: var(--ok); }
.phead .left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.phead h1 { font-size: 20px; line-height: 28px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.phead p { margin: 2px 0 0; font-size: 13px; color: var(--muted); }

/* ---- Tabs ---- */
.pills {
  display: inline-flex; gap: 4px; padding: 4px; border-radius: 11px;
  background: var(--soft); border: 1px solid var(--line); margin-bottom: 16px; max-width: 100%; overflow-x: auto;
}
.pills a {
  display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 16px; border-radius: 8px;
  color: var(--muted); font-weight: 500; white-space: nowrap; transition: color .15s var(--ease), background-color .15s var(--ease);
}
.pills a:hover { color: var(--ink); text-decoration: none; }
.pills a.on { background: var(--card); color: var(--ink); box-shadow: var(--shadow-sm); }
html.dark .pills a.on { background: color-mix(in srgb, var(--accent) 26%, var(--card)); color: #fff; box-shadow: inset 0 0 0 1px rgb(129 140 248 / .35); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs a { padding: 9px 14px; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; font-weight: 500; transition: color .15s var(--ease), border-color .15s var(--ease); }
.tabs a:hover { color: var(--ink); text-decoration: none; }
.tabs a.on { color: var(--accent-ink); border-bottom-color: var(--accent); }
.pills .count, .tabs .count {
  display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 18px; padding: 0 6px;
  border-radius: 99px; background: var(--softer); font-size: 11px; font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums;
}
.tabs a.on .count { background: var(--accent-soft); color: var(--accent-ink); }
.clip { display: inline-block; max-width: 256px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }

/* ---- Tables (Modern sticky headers + frozen columns support) ---- */
.table-wrap {
  overflow: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm); max-height: 76vh;
}
table { border-collapse: separate; border-spacing: 0; width: 100%; font-variant-numeric: tabular-nums; }
th, td { padding: 9px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th {
  background: var(--softer); font-weight: 600; font-size: 11px; line-height: 16px; text-transform: uppercase; letter-spacing: .04em;
  color: var(--faint); position: sticky; top: 0; z-index: 2; white-space: nowrap;
  box-shadow: inset 0 -1px var(--line);
}
tbody tr:last-child td { border-bottom: 0; }
tbody td { background: var(--card); transition: background-color .12s var(--ease); }
tbody tr:hover td { background: var(--softer); }
tbody a { color: var(--ink); }
tbody a:hover { color: var(--accent-ink); }
td.num, th.num { text-align: right; }
tr.flagged td { background: color-mix(in srgb, var(--warn-soft) 52%, var(--card)); }
tr.flagged:hover td { background: color-mix(in srgb, var(--warn-soft) 74%, var(--card)); }
tr.flagged td:first-child { box-shadow: inset 3px 0 var(--warn); }
tr.group td { border-top: 1px solid var(--line-strong); }
tr.off td { color: var(--faint); opacity: .72; }
tr.done .desc { text-decoration: line-through; color: var(--faint); }
tfoot th { position: sticky; bottom: 0; z-index: 2; box-shadow: inset 0 1px var(--line-strong); text-transform: none; letter-spacing: 0; font-size: 13px; color: var(--ink); }
table.facts { width: auto; }
table.facts th { position: static; background: none; box-shadow: none; width: 196px; border: none; padding-left: 0; font-size: 13px; line-height: 20px; text-transform: none; letter-spacing: 0; color: var(--muted); font-weight: 400; vertical-align: top; }
table.facts td { border: none; background: none; }

/* Frozen left (Verified, ID, Name) & right (Deductible) columns on Report Detail */
table.report-table th.stick-l1, table.report-table td.stick-l1 { position: sticky; left: 0; width: 42px; min-width: 42px; z-index: 3; }
table.report-table th.stick-l2, table.report-table td.stick-l2 { position: sticky; left: 42px; width: 64px; min-width: 64px; z-index: 3; }
table.report-table th.stick-l3, table.report-table td.stick-l3 { position: sticky; left: 106px; z-index: 3; box-shadow: 4px 0 8px -4px rgb(15 23 42 / .12), inset -1px 0 var(--line); }
table.report-table th.stick-r, table.report-table td.stick-r { position: sticky; right: 0; z-index: 3; box-shadow: -4px 0 8px -4px rgb(15 23 42 / .12), inset 1px 0 var(--line); }
table.report-table th.stick-l1, table.report-table th.stick-l2, table.report-table th.stick-l3, table.report-table th.stick-r { z-index: 5; background: var(--softer); }
table.report-table td.stick-r { font-weight: 600; color: var(--accent-ink); }
table.report-table.compact th, table.report-table.compact td { padding: 5px 9px; font-size: 13px; }
html.dark table.report-table th.stick-l3, html.dark table.report-table td.stick-l3 { box-shadow: 6px 0 12px -4px rgb(0 0 0 / .45), inset -1px 0 var(--line-strong); }
html.dark table.report-table th.stick-r, html.dark table.report-table td.stick-r { box-shadow: -6px 0 12px -4px rgb(0 0 0 / .45), inset 1px 0 var(--line-strong); }

/* ---- Shift Day Pills (S M T W T F S) ---- */
.day-pills { display: inline-flex; gap: 3px; align-items: center; }
.dp {
  display: inline-flex; align-items: center; justify-content: center; width: 21px; height: 21px; border-radius: 50%;
  font-size: 10px; font-weight: 600; color: var(--faint); background: var(--softer); border: 1px solid var(--line);
}
.dp.on { background: var(--accent-soft); color: var(--accent-ink); border-color: color-mix(in srgb, var(--accent) 30%, transparent); }
.dp.on.fri { background: var(--cyan-soft); color: var(--cyan); border-color: color-mix(in srgb, var(--cyan) 32%, transparent); }

/* ---- Allowance & Grace Progress Meters ---- */
.meter-cell { display: flex; align-items: center; gap: 8px; justify-content: flex-end; }
.meter { display: inline-block; width: 64px; height: 6px; border-radius: 99px; background: var(--soft); overflow: hidden; flex: none; }
.meter > span { display: block; height: 100%; border-radius: 99px; background: var(--ok); }
.meter > span.warn { background: var(--warn); }
.meter > span.bad { background: var(--bad); }
.meter > span.cyan { background: linear-gradient(90deg, var(--accent), var(--cyan-bright)); }

/* ---- Match Review 24h Punch Timeline ---- */
.timeline { position: relative; height: 24px; min-width: 176px; display: flex; align-items: center; }
.timeline-track { position: relative; width: 100%; height: 6px; border-radius: 99px; background: var(--soft); }
.timeline-shift { position: absolute; top: -2px; height: 10px; border-radius: 4px; background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); }
.timeline-dot {
  position: absolute; top: 50%; width: 9px; height: 9px; border-radius: 50%; transform: translate(-50%, -50%);
  background: var(--cyan); border: 2px solid var(--card); box-shadow: 0 0 0 1px color-mix(in srgb, var(--cyan) 50%, transparent);
}
.timeline-dot.warn { background: var(--warn); box-shadow: 0 0 0 1px var(--warn); }
.timeline-dot.bad { background: var(--bad); box-shadow: 0 0 0 1px var(--bad); }
.timeline-labels { display: flex; justify-content: space-between; font-size: 10px; color: var(--faint); margin-top: 2px; font-variant-numeric: tabular-nums; }

/* ---- Badges ---- */
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px; border-radius: 99px;
  font-size: 12px; line-height: 16px; font-weight: 500;
  background: var(--softer); color: var(--muted); border: 1px solid var(--line);
  white-space: nowrap; vertical-align: middle; font-variant-numeric: tabular-nums;
}
.badge.ok::before, .badge.warn::before, .badge.bad::before, .badge.info::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.badge.ok { color: var(--ok); background: var(--ok-soft); border-color: transparent; }
.badge.warn { color: var(--warn); background: var(--warn-soft); border-color: transparent; }
.badge.bad { color: var(--bad); background: var(--bad-soft); border-color: transparent; }
.badge.info { color: var(--info); background: var(--info-soft); border-color: transparent; }
.badge.final { background: linear-gradient(135deg, var(--accent), var(--cyan)); color: #fff; border-color: transparent; }
.saved { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ok); font-weight: 500; }

/* ---- Forms ---- */
form.stack, .stack { display: grid; gap: 16px; }
form.stack { max-width: 640px; }
dialog form.stack, .card form.stack.full { max-width: none; }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; }
label { display: grid; gap: 5px; font-size: 13px; font-weight: 500; color: var(--ink); }
label.check { display: flex; align-items: center; gap: 8px; font-weight: 400; cursor: pointer; }
input, select, textarea {
  font: inherit; font-size: 14px; font-weight: 400; min-height: 38px; padding: 6px 12px;
  border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--card); color: var(--ink); min-width: 0;
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
input[type=checkbox], input[type=radio] { width: 16px; height: 16px; min-height: 0; padding: 0; accent-color: var(--accent); cursor: pointer; }
input:focus, select:focus, textarea:focus { outline: none; box-shadow: var(--ring); border-color: var(--accent); }
input::placeholder, textarea::placeholder { color: var(--faint); }
textarea { min-height: 76px; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 14px 16px 16px; display: grid; gap: 12px; margin: 0; background: var(--softer); }
legend { font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 0 6px; }
.hint { font-size: 13px; color: var(--muted); font-weight: 400; margin: 0; }
.filters { display: flex; gap: 12px; flex-wrap: wrap; align-items: end; margin-bottom: 16px; }
.filters label { font-weight: 400; color: var(--muted); font-size: 12px; }
.search { position: relative; flex: 1; min-width: 220px; }
.search svg.icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.search input { width: 100%; padding-left: 36px; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }

/* Smart Dropzone for Punch Upload */
.dropzone {
  position: relative; display: grid; place-items: center; gap: 6px; padding: 24px 20px; text-align: center;
  border: 1.5px dashed var(--line-strong); border-radius: var(--radius-lg); background: var(--softer);
  transition: border-color .16s var(--ease), background-color .16s var(--ease); cursor: pointer;
}
.dropzone:hover, .dropzone.drag { border-color: var(--accent); background: var(--accent-soft); }
.dropzone input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.dropzone svg.icon { width: 24px; height: 24px; color: var(--accent-ink); }
.dropzone b { font-size: 14px; color: var(--ink); }
.dropzone .dz-file { font-size: 12px; color: var(--cyan); font-weight: 500; }

/* Live working-hours readout in Shift form */
.hours-pill {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 14px; border-radius: var(--radius); background: var(--softer); border: 1px solid var(--line);
  font-size: 13px; color: var(--muted);
}
.hours-pill b { font-size: 14px; color: var(--accent-ink); font-variant-numeric: tabular-nums; }

/* Formula display on Rules Settings */
.formula-card {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  padding: 12px 14px; border-radius: var(--radius); background: var(--softer); border: 1px solid var(--line);
  font: 500 13px/20px ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; color: var(--ink);
}
.formula-card .op { color: var(--cyan); font-weight: 600; }
.rules-nav { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.rules-nav a { padding: 5px 12px; border-radius: 99px; background: var(--card); border: 1px solid var(--line); color: var(--muted); font-size: 13px; font-weight: 500; }
.rules-nav a:hover { border-color: var(--accent); color: var(--accent-ink); text-decoration: none; }
.dirty-bar {
  position: sticky; bottom: 16px; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 16px; padding: 12px 18px; border-radius: var(--radius-lg);
  background: var(--glass-strong); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line)); box-shadow: var(--shadow-lg);
}

button, .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: inherit; font-weight: 500;
  min-height: 36px; padding: 6px 16px; border-radius: var(--radius);
  border: 1px solid var(--accent); background: var(--accent); color: #fff; cursor: pointer; white-space: nowrap;
  transition: background-color .15s var(--ease), border-color .15s var(--ease), color .15s var(--ease), box-shadow .15s var(--ease), transform .12s var(--ease);
}
button:hover, .btn:hover { background: var(--accent-hover); border-color: var(--accent-hover); text-decoration: none; box-shadow: 0 4px 14px -4px rgb(79 70 229 / .5); }
button:active, .btn:active { transform: scale(.98); }
button.secondary, .btn.secondary { background: var(--card); color: var(--ink); border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
button.secondary:hover, .btn.secondary:hover { background: var(--softer); border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
button.ghost, .btn.ghost { background: none; color: var(--muted); border-color: transparent; box-shadow: none; }
button.ghost:hover, .btn.ghost:hover { background: var(--soft); color: var(--ink); border-color: transparent; box-shadow: none; }
button.danger, .btn.danger { background: var(--card); border-color: var(--line-strong); color: var(--bad); }
button.danger:hover, .btn.danger:hover { background: var(--bad-soft); border-color: color-mix(in srgb, var(--bad) 35%, var(--line)); box-shadow: none; }
button.danger.solid { background: var(--bad); border-color: var(--bad); color: #fff; }
button.link { background: none; border: none; color: var(--accent-ink); min-height: 0; padding: 0; box-shadow: none; }
button.link:hover { background: none; text-decoration: underline; box-shadow: none; }
button.small, .btn.small { min-height: 28px; padding: 2px 10px; font-size: 13px; }
button:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }

/* Messages & Toasts */
.flash { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: var(--radius); margin-bottom: 16px; background: var(--info-soft); color: var(--info); border: 1px solid color-mix(in srgb, var(--info) 22%, transparent); }
.flash.ok { background: var(--ok-soft); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 22%, transparent); }
.flash.bad { background: var(--bad-soft); color: var(--bad); border-color: color-mix(in srgb, var(--bad) 22%, transparent); }
.flash.warn { background: var(--warn-soft); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 22%, transparent); }
.toast {
  position: fixed; top: 20px; right: 24px; z-index: 60; max-width: 420px;
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow-lg); animation: toast-in .28s var(--ease);
}
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } }
.empty { padding: 40px 24px; text-align: center; color: var(--muted); background: var(--card); border: 1px dashed var(--line-strong); border-radius: var(--radius-lg); }
.empty svg.icon { display: block; width: 26px; height: 26px; margin: 0 auto 12px; color: var(--faint); }
.empty b { display: block; color: var(--ink); font-size: 16px; line-height: 24px; margin-bottom: 4px; }

/* ---- Dialogs, Side Drawer & Command Palette (Top-layer animated per Modern Web Guidance) ---- */
dialog {
  border: 1px solid var(--line-strong); border-radius: 16px; padding: 0; max-width: 640px; width: 94vw;
  background: var(--glass-strong); backdrop-filter: blur(20px) saturate(160%); -webkit-backdrop-filter: blur(20px) saturate(160%);
  color: var(--ink); box-shadow: var(--shadow-lg);
  opacity: 0;
  transition-property: opacity, transform, display, overlay;
  transition-duration: .22s;
  transition-timing-function: var(--ease);
  transition-behavior: allow-discrete;
}
@media (prefers-reduced-motion: no-preference) {
  dialog { transform: translateY(8px) scale(.98); }
  dialog.side { transform: translateX(24px); }
}
dialog:modal { overscroll-behavior: contain; }
dialog[open] { opacity: 1; }
@media (prefers-reduced-motion: no-preference) {
  dialog[open] { transform: translateY(0) scale(1); }
  dialog.side[open] { transform: translateX(0); }
}
@starting-style {
  dialog[open] { opacity: 0; }
}
@media (prefers-reduced-motion: no-preference) {
  @starting-style {
    dialog[open] { transform: translateY(8px) scale(.98); }
    dialog.side[open] { transform: translateX(24px); }
  }
}
dialog.wide { max-width: 940px; }
dialog::backdrop {
  background: rgb(9 13 22 / 0);
  backdrop-filter: blur(0px); -webkit-backdrop-filter: blur(0px);
  overflow: hidden; overscroll-behavior: contain;
  transition-property: background-color, backdrop-filter, display, overlay;
  transition-duration: .22s;
  transition-timing-function: var(--ease);
  transition-behavior: allow-discrete;
}
dialog[open]::backdrop {
  background: rgb(9 13 22 / .48);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}
@starting-style {
  dialog[open]::backdrop { background: rgb(9 13 22 / 0); backdrop-filter: blur(0px); }
}
dialog > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 20px 24px 12px; border-bottom: 1px solid var(--line); }
dialog > header h2 { margin: 0; font-size: 18px; line-height: 26px; }
dialog > header p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
dialog > .body { padding: 18px 24px 24px; }
dialog .actions.end, .actions.end { justify-content: flex-end; margin-top: 8px; }
dialog.side { margin: 0 0 0 auto; height: 100vh; max-height: 100vh; width: min(496px, 100vw); max-width: none; border-radius: 16px 0 0 16px; border-width: 0 0 0 1px; }

/* Command Palette (#cmdk) */
dialog.cmdk { max-width: 560px; margin-top: 12vh; border-radius: 16px; overflow: hidden; }
.cmdk-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.cmdk-head svg.icon { color: var(--accent-ink); width: 18px; height: 18px; }
.cmdk-head input { flex: 1; border: 0; background: none; box-shadow: none; padding: 4px 0; min-height: 30px; font-size: 15px; }
.cmdk-head input:focus { box-shadow: none; }
.cmdk-list { max-height: 52vh; overflow: auto; padding: 6px; display: grid; gap: 2px; }
.cmdk-item {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; min-height: 38px;
  border: 0; border-radius: 9px; background: none; color: var(--ink); font-weight: 500; text-align: left; cursor: pointer;
  justify-content: flex-start; box-shadow: none;
}
.cmdk-item svg.icon { color: var(--faint); }
.cmdk-item small { margin-left: auto; color: var(--faint); font-weight: 400; font-size: 12px; }
.cmdk-item:hover, .cmdk-item.active { background: var(--accent-soft); color: var(--accent-ink); text-decoration: none; box-shadow: none; }
.cmdk-item:hover svg.icon, .cmdk-item.active svg.icon { color: var(--accent-ink); }
.cmdk-foot { display: flex; gap: 16px; padding: 8px 16px; border-top: 1px solid var(--line); background: var(--softer); font-size: 11px; color: var(--faint); }
.cmdk-foot span { display: inline-flex; align-items: center; gap: 4px; }

/* Menus */
details.menu { position: relative; display: inline-block; }
details.menu > summary { list-style: none; cursor: pointer; }
details.menu > summary::-webkit-details-marker { display: none; }
details.menu > div {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 40; min-width: 228px;
  background: var(--glass-strong); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--line-strong); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; display: grid; gap: 2px;
}
details.menu > div small { padding: 8px 12px 4px; color: var(--faint); }
details.menu > div a, details.menu > div button {
  display: flex; align-items: center; justify-content: flex-start; gap: 10px; width: 100%; min-height: 34px; padding: 4px 12px;
  border: 0; border-radius: 7px; background: none; color: var(--ink); font-weight: 400; text-align: left; box-shadow: none;
}
details.menu > div a:hover, details.menu > div button:hover { background: var(--softer); text-decoration: none; box-shadow: none; }
details.menu > div svg.icon { color: var(--faint); }
details.menu > div .danger, details.menu > div .danger svg.icon { color: var(--bad); }
details.menu form { margin: 0; }

#confirm { max-width: 420px; }
#confirm > .body { padding: 24px; }
#confirm p { margin: 0 0 20px; font-size: 15px; line-height: 22px; }
#pop .aside { display: grid; gap: 16px; align-content: start; padding: 16px; border-radius: var(--radius-lg); background: var(--softer); border: 1px solid var(--line); }
#pop .aside h3 { margin: 0 0 4px; }
#pop form .actions { justify-content: flex-end; }
#pop .table-wrap { max-height: 48vh; }
#pop .aside .list > div { background: var(--card); }

/* Readiness checks & Progress */
.checks { display: grid; gap: 8px; }
.checks > div { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius); background: var(--softer); border: 1px solid var(--line); }
.checks > div svg.icon { margin-top: 2px; color: var(--faint); }
.checks > div.pass svg.icon { color: var(--ok); }
.checks > div.warning { border-color: color-mix(in srgb, var(--warn) 30%, var(--line)); }
.checks > div.warning svg.icon { color: var(--warn); }
.checks > div.fail { background: var(--bad-soft); border-color: color-mix(in srgb, var(--bad) 28%, transparent); }
.checks > div.fail svg.icon { color: var(--bad); }
.checks b { display: block; }
.checks a { color: var(--ink); }
.checks a:hover { color: var(--accent-ink); }
.checks small { color: var(--faint); }
.checks details { font-size: 13px; margin-top: 4px; }
.progress { height: 6px; border-radius: 99px; background: var(--soft); overflow: hidden; }
.progress > span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--cyan-bright)); border-radius: 99px; transition: width .3s var(--ease); }

/* Verification bar inside report header */
.verify-bar { display: flex; align-items: center; gap: 10px; min-width: 170px; }
.verify-bar .progress { flex: 1; height: 6px; }
.verify-bar small { white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--muted); font-weight: 500; }

/* Company choice cards */
.choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; }
.choices button {
  flex-direction: column; align-items: flex-start; gap: 5px; padding: 18px;
  background: var(--card); color: var(--ink); border: 1px solid var(--line-strong); border-radius: var(--radius-lg);
  text-align: left; white-space: normal; box-shadow: var(--shadow-sm);
}
.choices button:hover { background: var(--softer); border-color: var(--accent); box-shadow: var(--shadow-md); }
.choices button.on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent), var(--shadow-sm); background: color-mix(in srgb, var(--accent-soft) 45%, var(--card)); }
.choices button[data-co="automotive"].on { border-color: var(--cyan); box-shadow: inset 0 0 0 1px var(--cyan), var(--shadow-sm); background: color-mix(in srgb, var(--cyan-soft) 45%, var(--card)); }
.choices button small { color: var(--muted); font-weight: 400; }
.choices button .co-state { color: var(--accent-ink); font-weight: 500; margin-top: 4px; }
.choices button[data-co="automotive"] .co-state { color: var(--cyan); }

/* Login (Enterprise Glass hero) */
.login-page { flex: 1; display: grid; place-items: center; padding: 32px 16px; }
.login-page > div { width: 100%; max-width: 416px; }
.login {
  width: 100%; max-width: 416px; position: relative; overflow: hidden;
  background: var(--glass-strong); backdrop-filter: blur(20px) saturate(160%); -webkit-backdrop-filter: blur(20px) saturate(160%);
  border: 1px solid var(--line-strong); border-radius: 18px; box-shadow: var(--shadow-lg); padding: 32px;
}
.login::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: linear-gradient(90deg, var(--accent), var(--cyan-bright)); }
.login .brand { margin: 0 0 24px; }
.login h1 { font-size: 21px; line-height: 28px; margin-bottom: 4px; }
.login button { width: 100%; min-height: 42px; }

/* HTMX busy state */
.htmx-request button[type=submit], button.htmx-request { opacity: .6; pointer-events: none; }
.htmx-indicator { display: none; }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { display: inline; }

@media print {
  .sidebar, .mobile-bar, .side-backdrop, .actions, .filters, .toolbar, .tabs, .pills, .dirty-bar, footer.foot, .crumbs { display: none; }
  .shell { display: block; }
  .table-wrap { max-height: none; border: none; box-shadow: none; }
  body { background: #fff; }
}
@media (max-width: 959px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .mobile-bar {
    display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 56px; padding: 0 14px;
    background: var(--glass); backdrop-filter: blur(14px) saturate(160%); -webkit-backdrop-filter: blur(14px) saturate(160%);
    border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30;
  }
  .mobile-bar::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 2px; background: linear-gradient(90deg, var(--accent), var(--cyan-bright)); }
  body[data-company="automotive"] .mobile-bar::before { background: linear-gradient(90deg, var(--cyan), #14b8a6); }
  .sidebar {
    position: fixed; inset: 0 auto 0 0; width: min(284px, 84vw); height: 100svh; z-index: 60;
    background: var(--glass-strong); box-shadow: var(--shadow-lg);
    transform: translateX(-100%); transition: transform .22s var(--ease);
  }
  .sidebar.open { transform: translateX(0); }
  .side-collapse-btn { display: none; }
  .side-close-btn { display: inline-flex; }
  .toast { top: 68px; right: 16px; left: 16px; max-width: none; }
  main { padding: 18px 16px 40px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* ---- Page details ---- */
.days { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 4px 16px; max-height: 256px; overflow: auto; }
td input[type=time] { min-height: 30px; padding: 2px 8px; }
/* Typed-over report cells */
input.cell {
  width: 66px; min-height: 30px; padding: 2px 8px; text-align: right;
  border-color: transparent; background: transparent; border-radius: 6px; font-variant-numeric: tabular-nums;
}
input.cell:hover { border-color: var(--line-strong); background: var(--card); }
input.cell:focus { background: var(--card); }
input.cell.typed { color: var(--accent-ink); font-weight: 600; background: var(--accent-soft); box-shadow: inset 0 -2px var(--accent); border-radius: 6px 6px 2px 2px; }
td b input.cell { font-weight: 600; }
.notes { white-space: pre-wrap; margin-top: 4px; }
td details { display: inline-block; vertical-align: top; }
td details > summary { list-style: none; }
td details > summary::-webkit-details-marker { display: none; }
td details[open] > form { display: grid; gap: 8px; min-width: 288px; margin-top: 8px; white-space: normal; }
td input[type=number] { width: 92px; min-height: 30px; padding: 2px 8px; }
input[type=number]::-webkit-outer-spin-button, input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input[type=number] { -moz-appearance: textfield; appearance: textfield; }

/* Fold-out cards */
details.panel > summary, details.card > summary { cursor: pointer; font-weight: 500; color: var(--ink); }
details.card[open] > summary { margin-bottom: 12px; }
.card > .hint + .table-wrap, .card > .muted + .table-wrap { margin-top: 12px; }
