/* ==========================================================================
   RoadCover stop-gap — "Route" design system
   Identity: night-road navy, safety amber, lane markings. Display type for
   headings and numbers (Bricolage Grotesque), Instrument Sans for text.
   Templates use these class names; page-specific tweaks live in pages-*.css.
   ========================================================================== */

:root {
  --ink: #001a73;
  --ink-2: #00239B;
  --brand: #00239B;
  --brand-600: #1238b8;
  --brand-700: #00186b;
  --brand-50: #e9edfb;
  --brand-100: #d2dbf7;
  --accent: #F5BE02;
  --accent-600: #d9a500;
  --accent-50: #fff8db;
  --accent-100: #ffeba3;

  --bg: #eef1f8;
  --surface: #ffffff;
  --surface-2: #f6f8fd;
  --surface-3: #edf0f8;
  --line: #e2e8f0;
  --line-strong: #cbd5e1;
  --text: #0c1638;
  --text-2: #475569;
  --text-3: #7b8799;

  --ok: #0f7a4a;   --ok-50: #e6f6ee;   --ok-200: #a9dcc2;
  --info: #00789a; --info-50: #e2f6fb; --info-200: #9fdcef;
  --warn: #8a5a00; --warn-50: #fff4d6; --warn-200: #f3d27c;
  --bad: #b3261e;  --bad-50: #fdecea;  --bad-200: #f2b8b2;
  --muted-50: #eef1f8;
  --sky: #00ADD7;
  --sky-50: #e2f6fb;

  --r-xs: 6px; --r-sm: 9px; --radius: 14px; --r-lg: 20px;
  --radius-sm: var(--r-sm);
  --shadow-1: 0 1px 0 rgba(15, 27, 43, .04), 0 1px 2px rgba(15, 27, 43, .06);
  --shadow-2: 0 1px 2px rgba(15, 27, 43, .05), 0 8px 24px -12px rgba(15, 27, 43, .18);
  --shadow-3: 0 2px 4px rgba(15, 27, 43, .06), 0 22px 48px -20px rgba(15, 27, 43, .32);
  --ring: 0 0 0 3px rgba(245, 190, 2, .45);

  --sidebar: 248px;
  --font: "Instrument Sans", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --display: "Bricolage Grotesque", "Instrument Sans", "Segoe UI", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --lane: repeating-linear-gradient(to bottom, var(--accent) 0 10px, transparent 10px 20px);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.55 var(--font); color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
a { color: var(--brand-600); text-underline-offset: 2px; }
h1, h2, h3 { margin: 0; line-height: 1.2; font-family: var(--display); letter-spacing: -.015em; color: var(--text); }
h1 { font-size: 30px; font-weight: 700; }
h2 { font-size: 18px; font-weight: 650; }
h3 { font-size: 15px; font-weight: 650; }
p { margin: 0 0 10px; }
.num, td.num, .value { font-variant-numeric: tabular-nums; }
.muted { color: var(--text-2); } .subtle { color: var(--text-3); } .small { font-size: 13px; }
.nowrap { white-space: nowrap; } .right { text-align: right; } .center { text-align: center; }
.mono, code { font-family: var(--mono); font-size: 12.5px; letter-spacing: -.01em; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
::selection { background: var(--accent-100); }

/* ========================= Shell ========================= */
.shell { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: 100vh;
  background: linear-gradient(to right, var(--ink) var(--sidebar), transparent var(--sidebar)); }
.sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; color: #d3dcf7;
  background: radial-gradient(120% 55% at 0% 0%, rgba(0,173,215,.18), transparent 60%), linear-gradient(180deg, var(--ink-2), var(--ink) 60%); }
.brand { display: flex; align-items: center; gap: 12px; padding: 22px 20px 18px; color: #fff; text-decoration: none; }
.brand-mark { width: 38px; height: 38px; border-radius: 11px; flex: none; position: relative; overflow: hidden; background: var(--accent); color: var(--ink);
  display: grid; place-items: center; font: 800 14px/1 var(--display); letter-spacing: -.02em; box-shadow: inset 0 -3px 0 rgba(0,0,0,.12); }
.brand-mark::after { content: ""; position: absolute; left: 50%; bottom: 4px; width: 2px; height: 7px; margin-left: -1px; background: rgba(10,31,54,.45); border-radius: 1px; }
.brand-text b { display: block; font: 700 17px/1.1 var(--display); letter-spacing: -.01em; }
.brand-text span { display: block; font-size: 12px; color: var(--accent); font-weight: 600; margin-top: 3px; letter-spacing: .01em; }

.nav { padding: 4px 12px 18px; flex: 1; }
.nav-section { font-size: 10.5px; text-transform: uppercase; letter-spacing: .14em; color: #8fa2e0; padding: 18px 10px 8px; font-weight: 700; }
.nav a { position: relative; display: flex; align-items: center; gap: 12px; padding: 9px 10px; margin: 1px 0; border-radius: 10px; color: #d3dcf7;
  text-decoration: none; font-weight: 550; font-size: 14.5px; transition: background .15s, color .15s; }
.nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav a.active { background: rgba(255,255,255,.10); color: #fff; box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); }
.nav .route { position: relative; }
.nav .route::before { content: ""; position: absolute; left: 22px; top: 22px; bottom: 22px; width: 2px; background: var(--lane); opacity: .5; }
.nav .step { position: relative; z-index: 1; width: 26px; height: 26px; border-radius: 50%; flex: none; display: grid; place-items: center;
  font: 700 12px/1 var(--display); background: var(--ink); color: #b7c7d8; border: 2px solid #3d55b8; }
.nav a:hover .step { border-color: #5d7a99; color: #fff; }
.nav a.active .step { background: var(--accent); color: var(--ink); border-color: var(--accent); box-shadow: 0 0 0 4px rgba(245,190,2,.18); }
.nav .count { margin-left: auto; background: var(--accent); color: var(--ink); font: 700 11.5px/1 var(--font); border-radius: 999px; padding: 4px 7px; min-width: 22px; text-align: center; }
.nav .ico { width: 26px; display: grid; place-items: center; flex: none; color: var(--sky); }
.nav a.active .ico, .nav a:hover .ico { color: var(--accent); }
.nav .ico svg { width: 18px; height: 18px; }

.sidebar-foot { padding: 14px 16px 18px; border-top: 1px solid rgba(255,255,255,.08); display: flex; align-items: center; gap: 10px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; flex: none; display: grid; place-items: center; background: linear-gradient(135deg, #1238b8, #001a73);
  color: #fff; font: 700 13px/1 var(--display); box-shadow: inset 0 0 0 1px rgba(255,255,255,.12); }
.sidebar-foot .who { flex: 1; min-width: 0; font-size: 13px; line-height: 1.3; }
.sidebar-foot .who b { color: #fff; display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-foot .who span { color: #8ea4bd; font-size: 12px; }
.sidebar-foot button { min-height: 0; background: transparent; border: 1px solid rgba(255,255,255,.18); color: #dbe6f1; border-radius: 8px; padding: 6px 10px;
  cursor: pointer; font: 600 12.5px/1 var(--font); box-shadow: none; }
.sidebar-foot button:hover { background: rgba(255,255,255,.08); color: #fff; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px; min-height: 60px; padding: 10px 36px;
  background: rgba(237, 241, 245, .85); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid rgba(203, 213, 225, .6); }
.crumbs { display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--text-3); font-weight: 550; min-width: 0; }
.crumbs b { color: var(--text); font-weight: 650; }
.crumbs .stepno { font: 700 11px/1 var(--display); color: var(--ink); background: var(--accent); border-radius: 6px; padding: 4px 7px; letter-spacing: .02em; }
.crumbs .dash { width: 18px; height: 2px; background: repeating-linear-gradient(to right, var(--line-strong) 0 4px, transparent 4px 7px); }
.topbar .spacer { flex: 1; }
.clock { font-size: 12.5px; color: var(--text-3); font-weight: 550; white-space: nowrap; }
.hazard { display: inline-flex; align-items: center; gap: 10px; min-height: 32px; padding: 0 12px 0 0; border-radius: 9px; overflow: hidden; background: var(--ink); color: #fff;
  font-size: 12.5px; font-weight: 600; white-space: nowrap; box-shadow: var(--shadow-1); }
.hazard .tape { align-self: stretch; width: 30px; background: repeating-linear-gradient(-45deg, var(--accent) 0 6px, var(--ink) 6px 12px); }
.hazard b { color: var(--accent); letter-spacing: .08em; font-size: 11px; text-transform: uppercase; }
.hazard span { color: #c8d5e3; font-weight: 500; }
.content { padding: 30px 36px 72px; flex: 1; }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; background: none; }
  .sidebar { position: static; height: auto; }
  .brand { padding: 14px 16px 10px; }
  .nav { display: flex; gap: 6px; overflow-x: auto; padding: 0 12px 12px; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  .nav .route { display: contents; }
  .nav .route::before, .nav-section { display: none; }
  .nav a { white-space: nowrap; padding: 7px 12px 7px 8px; background: rgba(255,255,255,.05); }
  .sidebar-foot { padding: 10px 16px; }
  .topbar { padding: 10px 16px; position: static; flex-wrap: wrap; }
  .hazard span, .clock { display: none; }
  .content { padding: 22px 16px 56px; }
}

/* ========================= Page header ========================= */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px 24px; margin-bottom: 26px; }
.page-head .lede { color: var(--text-2); margin: 8px 0 0; max-width: 760px; font-size: 15.5px; }
.page-head .actions { display: flex; flex-wrap: wrap; gap: 10px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 34px 0 14px; }
.section-head h2 { font-size: 19px; }
.section-head p { margin: 0; }
@media (max-width: 640px) { h1 { font-size: 25px; } }

/* ========================= Panels ========================= */
.card { background: var(--surface); border: 1px solid rgba(203, 213, 225, .7); border-radius: var(--radius); box-shadow: var(--shadow-2); margin-bottom: 20px; }
.card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding: 18px 22px 16px; border-bottom: 1px solid var(--line); }
.card-head h2 { font-size: 17px; }
.card-head p { margin: 3px 0 0; color: var(--text-3); font-size: 13.5px; }
.card-body { padding: 20px 22px; }
.card-foot { padding: 14px 22px; border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius);
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.card.flush .card-body { padding: 0; }
.card.accent { position: relative; overflow: hidden; }
.card.accent::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--accent); }
.grid { display: grid; gap: 20px; margin-bottom: 20px; }
.grid > .card, .grid > div > .card:last-child, .grid > div > .stats:last-child { margin-bottom: 0; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1000px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

/* ========================= Metric strips ========================= */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0; margin-bottom: 20px; background: var(--surface);
  border: 1px solid rgba(203, 213, 225, .7); border-radius: var(--radius); box-shadow: var(--shadow-2); overflow: hidden; }
.stat { position: relative; display: block; padding: 18px 22px; margin: 0 -1px -1px 0; box-shadow: inset -1px 0 0 var(--line), inset 0 -1px 0 var(--line);
  text-decoration: none; color: inherit; min-width: 0; background: transparent; border: 0; border-radius: 0; }
a.stat { transition: background .15s; }
a.stat:hover { background: var(--surface-2); }
a.stat::after { content: "→"; position: absolute; right: 16px; top: 16px; color: var(--text-3); opacity: 0; transition: opacity .15s, transform .15s; }
a.stat:hover::after { opacity: 1; transform: translateX(2px); }
.stat .label { display: flex; align-items: center; gap: 8px; font-size: 11.5px; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: .08em; }
.stat .label::before { content: ""; width: 7px; height: 7px; border-radius: 2px; background: var(--line-strong); flex: none; }
.stat .value { font: 700 32px/1.1 var(--display); letter-spacing: -.03em; margin-top: 8px; color: var(--text); overflow-wrap: anywhere; }
.stat .sub { font-size: 13px; color: var(--text-3); margin-top: 4px; }
.stat.ok .label::before { background: var(--ok); } .stat.ok .value { color: var(--ok); }
.stat.warn .label::before { background: var(--accent); }
.stat.bad .label::before { background: var(--bad); } .stat.bad .value { color: var(--bad); }
.stat.info .label::before { background: var(--info); }
.stats.compact .stat { padding: 13px 16px; }
.stats.compact .stat .value { font-size: 23px; margin-top: 5px; }
.card .stats { box-shadow: none; border-color: var(--line); margin-bottom: 0; }

/* ========================= Meters ========================= */
.meter { position: relative; height: 10px; background: var(--surface-3); border-radius: 999px; overflow: hidden; margin-top: 8px; }
.meter::after { content: ""; position: absolute; left: 6px; right: 6px; top: 50%; height: 2px; margin-top: -1px;
  background: repeating-linear-gradient(to right, rgba(15,27,43,.12) 0 8px, transparent 8px 16px); }
.meter > span { position: relative; z-index: 1; display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--brand), var(--brand-600)); }
.meter.ok > span { background: linear-gradient(90deg, #0d6b41, #18a465); }
.meter.warn > span { background: linear-gradient(90deg, var(--accent-600), var(--accent)); }
.funnel { display: grid; gap: 15px; }
.funnel-row { display: grid; grid-template-columns: minmax(150px, 220px) 1fr 70px; gap: 16px; align-items: center; }
.funnel-row .meter { margin: 0; height: 12px; }
.funnel-row .label { color: var(--text-2); font-weight: 500; }
.funnel-row .value { text-align: right; font: 700 17px/1 var(--display); }
@media (max-width: 640px) { .funnel-row { grid-template-columns: 1fr 60px; gap: 6px 12px; } .funnel-row .meter { grid-column: 1 / -1; order: 3; } }

/* ========================= Attention list ========================= */
.todo { list-style: none; margin: 0; padding: 4px 0; }
.todo li { display: flex; align-items: center; gap: 16px; padding: 14px 22px; }
.todo li + li { border-top: 1px solid var(--line); }
.todo .dot { width: 34px; height: 34px; border-radius: 10px; flex: none; display: grid; place-items: center; background: var(--surface-3); }
.todo .dot::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--line-strong); }
.todo .dot.warn { background: var(--accent-50); } .todo .dot.warn::before { background: var(--accent); box-shadow: 0 0 0 4px rgba(245,190,2,.2); }
.todo .dot.bad { background: var(--bad-50); } .todo .dot.bad::before { background: var(--bad); box-shadow: 0 0 0 4px rgba(179,38,30,.15); }
.todo .dot.ok { background: var(--ok-50); } .todo .dot.ok::before { background: var(--ok); }
.todo .what { flex: 1; min-width: 0; } .todo .what b { font-weight: 650; font-size: 15px; }
.todo .what span { display: block; color: var(--text-3); font-size: 13px; margin-top: 1px; }

/* ========================= Badges ========================= */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 7px; font-size: 12px; font-weight: 650; line-height: 1.45; white-space: nowrap;
  background: var(--muted-50); color: var(--text-2); box-shadow: inset 0 0 0 1px rgba(15,27,43,.06); }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.ok { background: var(--ok-50); color: var(--ok); box-shadow: inset 0 0 0 1px rgba(15,122,74,.18); }
.badge.info { background: var(--info-50); color: var(--info); box-shadow: inset 0 0 0 1px rgba(30,95,174,.16); }
.badge.warn { background: var(--warn-50); color: var(--warn); box-shadow: inset 0 0 0 1px rgba(138,90,0,.18); }
.badge.bad { background: var(--bad-50); color: var(--bad); box-shadow: inset 0 0 0 1px rgba(179,38,30,.16); }
.badge.plain::before { display: none; }
.pill { display: inline-block; padding: 2px 8px; border-radius: 6px; background: var(--surface-3); font: 600 12px/1.5 var(--mono); color: var(--text-2); letter-spacing: -.01em; }

/* ========================= Alerts & flash ========================= */
.alert { position: relative; display: flex; gap: 14px; align-items: flex-start; padding: 14px 18px 14px 20px; border-radius: 12px; background: var(--surface);
  border: 1px solid var(--line); box-shadow: var(--shadow-1); margin-bottom: 20px; overflow: hidden; }
.alert::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; }
.alert .icon { width: 26px; height: 26px; border-radius: 8px; flex: none; display: grid; place-items: center; font: 800 13px/1 var(--display); color: #fff; }
.alert .body { flex: 1; min-width: 0; } .alert .body > b { display: block; margin-bottom: 2px; font-weight: 650; }
.alert .body p { margin: 0 0 4px; color: var(--text-2); }
.alert.info::before, .alert.info .icon { background: var(--info); }
.alert.ok::before, .alert.ok .icon { background: var(--ok); }
.alert.warn::before { background: var(--accent); } .alert.warn .icon { background: var(--accent); color: var(--ink); }
.alert.bad { background: #fff9f8; border-color: var(--bad-200); } .alert.bad::before, .alert.bad .icon { background: var(--bad); }
.flash { display: flex; align-items: center; gap: 12px; background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px; margin-bottom: 22px;
  font-weight: 550; box-shadow: var(--shadow-2); animation: flash-in .35s ease-out; }
.flash::before { content: "✓"; width: 24px; height: 24px; border-radius: 7px; flex: none; display: grid; place-items: center; background: var(--accent); color: var(--ink); font-weight: 800; }
@keyframes flash-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* ========================= Buttons ========================= */
button, .btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; background: linear-gradient(180deg, var(--brand-600), var(--brand));
  color: #fff; border: 1px solid var(--brand-700); border-radius: 10px; padding: 8px 16px; font: 650 14px/1.2 var(--font); cursor: pointer; text-decoration: none;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.14), 0 1px 2px rgba(0,24,107,.28); transition: transform .06s, box-shadow .15s, background .15s; }
button:hover, .btn:hover { background: linear-gradient(180deg, #1f47c9, var(--brand-600)); }
button:active, .btn:active { transform: translateY(1px); }
button:focus-visible, .btn:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: none; box-shadow: var(--ring); }
.btn.secondary, button.secondary { background: var(--surface); color: var(--text); border-color: var(--line-strong); box-shadow: var(--shadow-1); }
.btn.secondary:hover, button.secondary:hover { background: var(--surface-2); border-color: #b6c2d1; }
.btn.ghost, button.ghost { background: transparent; color: var(--brand-600); border-color: transparent; box-shadow: none; padding-left: 10px; padding-right: 10px; }
.btn.ghost:hover, button.ghost:hover { background: var(--brand-50); }
.btn.danger, button.danger { background: linear-gradient(180deg, #c7362d, var(--bad)); border-color: #8f1c15; }
.btn.danger:hover, button.danger:hover { background: #9b2019; }
.btn.accent, button.accent { background: linear-gradient(180deg, #ffd02e, var(--accent)); border-color: var(--accent-600); color: var(--ink);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.4), 0 1px 2px rgba(138,90,0,.3); }
.btn.accent:hover, button.accent:hover { background: linear-gradient(180deg, #ffd640, #e9b000); }
.btn.lg, button.lg { min-height: 50px; padding: 12px 26px; font-size: 16px; border-radius: 12px; }
.btn.sm, button.sm { min-height: 32px; padding: 5px 12px; font-size: 13px; border-radius: 8px; }
button:disabled, .btn.disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.link { background: none; border: 0; color: var(--brand-600); padding: 0; min-height: 0; font-weight: 650; cursor: pointer; text-decoration: underline; box-shadow: none; }
.link:hover { background: none; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
form.inline { display: inline; }

/* ========================= Forms ========================= */
label { display: block; font-weight: 600; font-size: 13.5px; margin-bottom: 16px; color: var(--text); }
label .hint, .hint { display: block; font-weight: 400; color: var(--text-3); font-size: 12.5px; margin-top: 2px; }
input, select, textarea { display: block; width: 100%; margin-top: 6px; padding: 9px 12px; min-height: 40px; border: 1px solid var(--line-strong); border-radius: 10px;
  font: 400 14.5px/1.4 var(--font); background: #fff; color: var(--text); box-shadow: inset 0 1px 1px rgba(15,27,43,.04); transition: border-color .15s, box-shadow .15s; }
textarea { min-height: 84px; resize: vertical; }
select { appearance: none; padding-right: 34px; cursor: pointer;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5l5-5' fill='none' stroke='%23475569' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 12px center; }
input:hover, select:hover, textarea:hover { border-color: #aebacb; }
input:focus, select:focus, textarea:focus { border-color: var(--brand-600); outline: none; box-shadow: 0 0 0 3px rgba(0,35,155,.16); }
input::placeholder, textarea::placeholder { color: #9aa6b6; }
input[type=file] { padding: 6px; background: var(--surface-2); border-style: dashed; cursor: pointer; }
input[type=file]::file-selector-button { margin-right: 12px; border: 0; border-radius: 8px; padding: 7px 12px; background: var(--ink); color: #fff; font: 600 13px var(--font); cursor: pointer; }
input[type=checkbox], input[type=radio] { display: inline-block; width: 17px; height: 17px; min-height: 0; margin: 0; padding: 0; box-shadow: none; accent-color: var(--brand); flex: none; cursor: pointer; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0 18px; }
.form-grid .full { grid-column: 1 / -1; }
.check { display: flex; align-items: center; gap: 10px; font-weight: 550; margin-bottom: 12px; cursor: pointer; }
.check.boxed { border: 1px solid var(--line-strong); border-radius: 10px; padding: 11px 14px; background: var(--surface-2); }
.check.boxed.important { border-color: var(--accent); background: var(--accent-50); font-weight: 650; box-shadow: inset 4px 0 0 var(--accent); }
.field-error, .error { color: var(--bad); font-size: 13px; font-weight: 600; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.chip { display: inline-flex; align-items: center; gap: 8px; margin: 0; padding: 7px 14px 7px 11px; border: 1px solid var(--line-strong); border-radius: 999px; background: #fff;
  font-weight: 550; font-size: 14px; cursor: pointer; transition: all .15s; }
.chip:hover { border-color: #9fb0c4; }
.chip:has(input:checked) { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip:has(input:checked) input { accent-color: var(--accent); }
.fieldset-label { font-weight: 650; font-size: 13.5px; display: block; }

.options { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px; margin: 8px 0 18px; }
.option { position: relative; display: flex; gap: 12px; align-items: flex-start; margin: 0; padding: 14px 16px; border: 1px solid var(--line-strong); border-radius: 12px;
  background: #fff; cursor: pointer; font-weight: 650; transition: border-color .15s, box-shadow .15s, background .15s; }
.option:hover { border-color: #9fb0c4; box-shadow: var(--shadow-1); }
.option input { margin-top: 2px; }
.option span { display: block; font-weight: 400; color: var(--text-3); font-size: 13px; margin-top: 2px; }
.option:has(input:checked) { border-color: var(--brand); background: linear-gradient(180deg, #f4f8fc, #fff); box-shadow: 0 0 0 2px var(--brand), var(--shadow-2); }

.steps { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 0; margin: 0 0 24px; padding: 0; list-style: none; counter-reset: step; }
.steps li { counter-increment: step; display: flex; align-items: center; gap: 10px; color: var(--text-3); font-weight: 600; font-size: 14px; }
.steps li::before { content: counter(step); width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font: 700 12.5px/1 var(--display);
  background: var(--surface); border: 2px solid var(--line-strong); color: var(--text-3); flex: none; }
.steps li + li { padding-left: 64px; position: relative; }
.steps li + li::after { content: ""; position: absolute; left: 12px; top: 50%; width: 40px; height: 2px; background: repeating-linear-gradient(to right, var(--line-strong) 0 6px, transparent 6px 11px); }
.steps li.done { color: var(--text-2); } .steps li.done::before { content: "✓"; background: var(--ok); border-color: var(--ok); color: #fff; }
.steps li.current { color: var(--text); } .steps li.current::before { background: var(--accent); border-color: var(--accent); color: var(--ink); box-shadow: 0 0 0 4px rgba(245,190,2,.2); }

/* ========================= Tables ========================= */
.table-wrap { overflow-x: auto; }
.card .table-wrap:last-child { border-radius: 0 0 var(--radius) var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 12px 16px; vertical-align: middle; }
td { border-top: 1px solid var(--line); }
th { font: 700 11px/1.3 var(--font); text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); white-space: nowrap; padding-top: 11px; padding-bottom: 11px; }
thead th { border-bottom: 1px solid var(--line); background: var(--surface-2); }
thead + tbody tr:first-child td { border-top: 0; }
th:first-child, td:first-child { padding-left: 22px; }
th:last-child, td:last-child { padding-right: 22px; }
tbody tr { transition: background .12s; }
tbody tr:hover { background: #f8fafd; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td .sub { display: block; color: var(--text-3); font-size: 12.5px; }
.card-head + .table-wrap table tbody:first-child tr:first-child td { border-top: 0; }
table.kv td { padding-top: 10px; padding-bottom: 10px; }
table.kv td:first-child { color: var(--text-2); }
table.kv td.num { font-weight: 650; color: var(--text); }

/* ========================= Empty state ========================= */
.empty { text-align: center; padding: 38px 22px 42px; color: var(--text-3); }
.empty::before { content: ""; display: block; width: 54px; height: 54px; margin: 0 auto 14px; border-radius: 16px;
  background: var(--surface-3) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='26' height='26' viewBox='0 0 24 24' fill='none' stroke='%237b8799' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 20 9 4M20 20 15 4M12 6v2M12 11v2M12 16v2'/%3E%3C/svg%3E") no-repeat center; }
.empty b { display: block; color: var(--text); font: 650 16px/1.3 var(--display); margin-bottom: 4px; }

/* ========================= Facts, bubbles, script ========================= */
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 16px 24px; margin: 0; }
.facts div { min-width: 0; }
.facts dt { font-size: 11px; color: var(--text-3); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.facts dd { margin: 4px 0 0; font-weight: 600; overflow-wrap: anywhere; }
.facts dd.big { font: 700 26px/1.15 var(--display); letter-spacing: .005em; white-space: nowrap; font-variant-numeric: tabular-nums; overflow-wrap: normal; }
.facts div:has(> dd.big) { min-width: max-content; }
.thread { display: grid; gap: 12px; }
.bubble { max-width: 640px; padding: 12px 16px; border-radius: 16px; font-size: 14.5px; line-height: 1.5; }
.bubble .meta { display: block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 4px; opacity: .7; }
.bubble.out { background: #e6f6fb; border: 1px solid #b9e6f3; border-bottom-left-radius: 5px; color: #062b4a; }
.bubble.in { background: #fff; border: 1px solid var(--line-strong); border-bottom-right-radius: 5px; justify-self: end; box-shadow: var(--shadow-1); }
.script { position: relative; background: var(--accent-50); border: 1px solid var(--warn-200); border-radius: 12px; padding: 14px 18px 14px 20px; overflow: hidden; }
.script::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--accent); }
.script b { display: block; margin-bottom: 4px; font-family: var(--display); }

/* ========================= Login ========================= */
.login-page { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(380px, .9fr); background: var(--bg); }
.login-art { position: relative; overflow: hidden; color: #fff; padding: 48px 56px; display: flex; flex-direction: column; justify-content: space-between; gap: 40px;
  background: radial-gradient(80% 60% at 50% 100%, rgba(245,190,2,.22), transparent 70%), linear-gradient(170deg, #12355a 0%, var(--ink) 55%, #06141f 100%); }
.login-art .road { position: absolute; left: 50%; bottom: 0; width: 100%; min-width: 700px; height: 58%; transform: translateX(-50%); pointer-events: none; }
.login-art .brand { padding: 0; position: relative; z-index: 1; }
.login-copy { position: relative; z-index: 1; max-width: 480px; }
.login-copy h2 { color: #fff; font-size: 42px; line-height: 1.06; letter-spacing: -.035em; font-weight: 750; }
.login-copy h2 em { font-style: normal; color: var(--accent); }
.login-copy p { color: #b9c9db; font-size: 16px; margin-top: 14px; }
.login-side { display: grid; place-items: center; padding: 32px 24px; }
.login-card { width: 100%; max-width: 380px; }
.login-card h1 { font-size: 30px; margin-bottom: 6px; }
.login-card .muted { margin-bottom: 26px; }
.login-card button { width: 100%; margin-top: 8px; min-height: 50px; font-size: 15.5px; }
.login-card .foot { margin-top: 22px; font-size: 12.5px; color: var(--text-3); }
@media (max-width: 860px) {
  .login-page { grid-template-columns: 1fr; }
  .login-art { padding: 26px 24px 150px; }
  .login-copy h2 { font-size: 30px; }
}

/* Utilities */
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; } .mt { margin-top: 20px; } .mb { margin-bottom: 20px; }
.stack > * + * { margin-top: 12px; }
.divider { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }

/* Refinements after first visual pass */
.pill.num { font-family: var(--font); font-weight: 600; letter-spacing: 0; }
.grid { align-items: start; }
.login-art { justify-content: flex-start; }
.login-copy { margin-top: 9vh; }
.login-art .road { height: 46%; }
/* Strips: flex so a wrapped last row stretches to fill (no orphan gaps) */
.stats { display: flex; flex-wrap: wrap; }
.stats > .stat { flex: 1 1 170px; }
.stats.compact > .stat { flex-basis: 130px; }
.stats.compact .stat .label { text-transform: none; letter-spacing: 0; font-size: 12.5px; font-weight: 600; }
.page-head .actions { align-items: flex-end; } .page-head .actions > .btn, .page-head .actions > form > button, .page-head .actions > form > .btn { align-self: flex-end; }

/* ========================= RoadCover brand ========================= */
.brand-shield { width: 36px; height: auto; flex: none; filter: drop-shadow(0 2px 6px rgba(0,0,0,.25)); }
.brand-text span { color: var(--accent); }
.login-art { justify-content: center; align-items: flex-start; gap: 34px; padding: 56px 64px;
  background: radial-gradient(70% 55% at 85% 100%, rgba(0,173,215,.28), transparent 70%),
              radial-gradient(60% 50% at 0% 0%, rgba(245,190,2,.10), transparent 70%),
              linear-gradient(160deg, #0a33c4 0%, #00239B 45%, #001660 100%); }
.login-logo { width: min(340px, 70%); height: auto; filter: drop-shadow(0 10px 30px rgba(0,0,0,.25)); }
.login-copy { margin-top: 0; }
.login-copy h2 { font-size: 34px; color: #fff; }
.login-copy p { color: #c9d4f5; }
.login-mobile-logo { display: none; width: 44px; height: auto; margin-bottom: 14px; }
@media (max-width: 860px) {
  .login-art { padding: 28px 24px 32px; gap: 18px; }
  .login-logo { width: 200px; }
  .login-copy h2 { font-size: 24px; }
}

/* Loading spinner inside a button (login) */
.spinner { display: none; width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid rgba(255,255,255,.35); border-top-color: #fff; animation: spin .7s linear infinite; }
button.is-loading .spinner { display: inline-block; }
button.is-loading:disabled { opacity: .85; cursor: progress; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 1.6s; } }
