/* =====================================================================
   MotorWorld Workshop OS · Demo design system
   White canvas · brand red #B40000 · brand grey #555555 · Inter
   Shell: ≥1100 full sidebar · 768–1099 icon rail · <768 mobile + bottom nav
   ===================================================================== */
:root {
  --brand: #B40000; --brand-600: #9E0000; --brand-700: #820000;
  --brand-50: #FFF2F2; --brand-100: #FBDCDC; --brand-200: #F4B5B5;
  --grey: #555555; --grey-700: #3C3C3C;
  --ink: #141518; --ink-2: #33353A; --muted: #66686F; --faint: #9A9CA3;
  --line: #E4E4E9; --line-2: #EFEFF3; --bg: #FFFFFF; --soft: #F6F6F8; --soft-2: #FAFAFB;
  --ok: #0ca30c; --ok-ink: #0A6B0A; --ok-bg: #E8F6E8;
  --warn: #fab219; --warn-ink: #855400; --warn-bg: #FFF4D9;
  --serious: #ec835a; --serious-ink: #9E3C14; --serious-bg: #FDEDE5;
  --crit: #d03b3b; --crit-ink: #AA1D1D; --crit-bg: #FCE9E9;
  --info: #2a78d6; --info-ink: #1B58A5; --info-bg: #EAF2FC;
  --c-pm: #2a78d6; --c-cm: #eb6834; --c-pmcm: #1baf7a; --c-major: #eda100; --c-body: #e87ba4;
  --r-xs: 6px; --r-sm: 8px; --r: 12px; --r-lg: 16px; --r-xl: 22px;
  --sh-1: 0 1px 2px rgba(15,16,20,.05);
  --sh-2: 0 4px 14px rgba(15,16,20,.07), 0 1px 2px rgba(15,16,20,.04);
  --sh-3: 0 18px 48px rgba(15,16,20,.18);
  --sidebar: 248px; --rail: 84px; --topbar: 64px; --bottomnav: 66px;
  --gap: 16px; --pad: 22px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 500 15px/1.45 var(--font); font-feature-settings: 'cv11', 'ss01';
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4, p { margin: 0; }
.num, .tnum { font-variant-numeric: tabular-nums; }
::selection { background: var(--brand-100); }
:focus-visible { outline: 3px solid rgba(180,0,0,.35); outline-offset: 2px; border-radius: 6px; }
.ic { width: 20px; height: 20px; flex: none; stroke-width: 2.1; }
.ic-sm { width: 16px; height: 16px; } .ic-lg { width: 24px; height: 24px; } .ic-xl { width: 32px; height: 32px; }

/* ---------- Shell ---------- */
.app { min-height: 100vh; min-height: 100dvh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar); z-index: 40;
  background: #fff; border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
}
.sb-brand { height: var(--topbar); display: flex; align-items: center; padding: 0 18px; border-bottom: 1px solid var(--line-2); flex: none; }
.sb-brand img.wide { height: 40px; width: auto; }
.sb-brand img.mark { display: none; height: 34px; width: auto; }
.sb-branch { margin: 14px 14px 4px; flex: none; }
.branch-btn {
  width: 100%; display: flex; align-items: center; gap: 10px; text-align: left;
  border: 1px solid var(--line); background: var(--soft-2); border-radius: var(--r);
  padding: 9px 12px; transition: border-color .15s;
}
.branch-btn:hover { border-color: #cfcfd6; }
.branch-btn .b-dot { width: 32px; height: 32px; border-radius: 9px; background: var(--brand-50); color: var(--brand); display: grid; place-items: center; flex: none; }
.branch-btn .b-txt { min-width: 0; flex: 1; }
.branch-btn .b-txt b { display: block; font-size: 13.5px; font-weight: 750; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.branch-btn .b-txt span { font-size: 12px; color: var(--muted); font-weight: 600; }
.sb-nav { flex: 1; overflow-y: auto; padding: 6px 12px 12px; scrollbar-width: thin; }
.sb-group { margin-top: 14px; }
.sb-group-t { font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); padding: 0 10px 6px; }
.sb-link {
  display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 10px;
  font-weight: 650; font-size: 14.5px; color: var(--ink-2); position: relative; margin: 1px 0;
  transition: background .12s, color .12s;
}
.sb-link .ic { color: var(--muted); }
.sb-link:hover { background: var(--soft); color: var(--ink); }
.sb-link.active { background: var(--brand-50); color: var(--brand); font-weight: 750; }
.sb-link.active .ic { color: var(--brand); }
.sb-link.active::before { content: ''; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 4px; border-radius: 0 4px 4px 0; background: var(--brand); }
.sb-link .sb-count { margin-left: auto; font-size: 12px; font-weight: 800; background: var(--brand); color: #fff; border-radius: 999px; padding: 1px 8px; min-width: 24px; text-align: center; }
.sb-link .sb-count.grey { background: var(--soft); color: var(--ink-2); border: 1px solid var(--line); }
.sb-foot { border-top: 1px solid var(--line-2); padding: 12px 14px; display: flex; align-items: center; gap: 10px; flex: none; }
.sb-foot .who { min-width: 0; flex: 1; }
.sb-foot .who b { display: block; font-size: 13.5px; font-weight: 750; }
.sb-foot .who span { font-size: 12px; color: var(--muted); font-weight: 600; }

.main { margin-left: var(--sidebar); min-width: 0; }
.topbar {
  position: sticky; top: 0; z-index: 30; height: var(--topbar);
  background: rgba(255,255,255,.94); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 14px; padding: 0 var(--pad);
}
.topbar .tb-menu { display: none; }
.tb-logo { display: none; height: 30px; width: auto; }
.tb-title { min-width: 0; flex: 1; }
.tb-title h1 { font-size: 20px; font-weight: 800; letter-spacing: -.015em; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-title p { font-size: 12.5px; color: var(--muted); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-search { position: relative; width: clamp(200px, 22vw, 300px); }
.tb-search input { width: 100%; height: 40px; border: 1px solid var(--line); border-radius: 10px; background: var(--soft-2); padding: 0 12px 0 38px; font-weight: 600; font-size: 14px; }
.tb-search input:focus { outline: none; border-color: var(--brand-200); background: #fff; box-shadow: 0 0 0 4px var(--brand-50); }
.tb-search .ic { position: absolute; left: 12px; top: 10px; color: var(--faint); }
.tb-clock { font-weight: 750; font-size: 14px; color: var(--ink-2); display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 rgba(12,163,12,.5); animation: pulse 2s infinite; flex: none; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(12,163,12,.45); } 70% { box-shadow: 0 0 0 8px rgba(12,163,12,0); } 100% { box-shadow: 0 0 0 0 rgba(12,163,12,0); } }
.icon-btn { width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line); background: #fff; display: grid; place-items: center; color: var(--ink-2); position: relative; flex: none; }
.icon-btn:hover { background: var(--soft); }
.icon-btn .dot-n { position: absolute; top: -5px; right: -5px; min-width: 19px; height: 19px; border-radius: 10px; background: var(--brand); color: #fff; font-size: 11px; font-weight: 800; display: grid; place-items: center; padding: 0 5px; border: 2px solid #fff; }

.content { padding: var(--pad); max-width: 1720px; margin: 0 auto; container-type: inline-size; container-name: content; }
.content.flush { padding: 0; max-width: none; }

/* bottom nav (mobile) */
.bottomnav { display: none; }
.scrim { position: fixed; inset: 0; background: rgba(20,21,24,.42); z-index: 60; opacity: 0; pointer-events: none; transition: opacity .2s; }
.scrim.show { opacity: 1; pointer-events: auto; }

/* ----- Rail (tablet portrait / small landscape) ----- */
@media (max-width: 1099px) and (min-width: 768px) {
  .sidebar { width: var(--rail); }
  .sb-brand { justify-content: center; padding: 0; }
  .sb-brand img.wide { display: none; } .sb-brand img.mark { display: block; height: 30px; }
  .sb-branch { margin: 10px 10px 0; }
  .branch-btn { padding: 8px; justify-content: center; }
  .branch-btn .b-txt, .branch-btn .chev { display: none; }
  .sb-nav { padding: 4px 8px 10px; }
  .sb-group { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line-2); }
  .sb-group:first-child { border-top: 0; }
  .sb-group-t { display: none; }
  .sb-link { flex-direction: column; gap: 4px; padding: 9px 2px 8px; font-size: 10.5px; font-weight: 700; text-align: center; line-height: 1.15; }
  .sb-link .ic { width: 22px; height: 22px; }
  .sb-link.active::before { left: -8px; }
  .sb-link .sb-count { position: absolute; top: 3px; right: 8px; font-size: 10px; padding: 0 5px; min-width: 18px; }
  .sb-foot { justify-content: center; padding: 10px 6px; }
  .sb-foot .who, .sb-foot .reset-txt { display: none; }
  .main { margin-left: var(--rail); }
  .tb-search { width: 190px; }
  .tb-clock { display: none; }
}
/* ----- Mobile ----- */
@media (max-width: 767px) {
  :root { --pad: 14px; --gap: 12px; --topbar: 58px; }
  body { padding-bottom: calc(var(--bottomnav) + env(safe-area-inset-bottom)); font-size: 15px; }
  .sidebar { transform: translateX(-104%); transition: transform .24s ease; width: min(86vw, 320px); z-index: 70; box-shadow: var(--sh-3); }
  .sidebar.open { transform: none; }
  .main { margin-left: 0; }
  .topbar { gap: 10px; padding: 0 12px; }
  .topbar .tb-menu { display: grid; }
  .tb-title h1 { font-size: 17px; }
  .tb-title p { display: none; }
  .tb-search, .tb-clock, .tb-cta { display: none !important; }
  .bottomnav {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
    height: calc(var(--bottomnav) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
    background: rgba(255,255,255,.97); border-top: 1px solid var(--line); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  }
  .bn-item { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11px; font-weight: 700; color: var(--muted); border: 0; background: none; }
  .bn-item.active { color: var(--brand); }
  .bn-item .ic { width: 23px; height: 23px; }
  .bn-item.primary .bn-fab { width: 50px; height: 50px; border-radius: 16px; background: var(--brand); color: #fff; display: grid; place-items: center; margin-top: -22px; box-shadow: 0 6px 16px rgba(180,0,0,.35); border: 3px solid #fff; }
  .bn-item.primary { color: var(--ink-2); }
}

/* ---------- Page header ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: var(--gap); flex-wrap: wrap; }
.page-head h2 { font-size: 24px; font-weight: 850; letter-spacing: -.02em; line-height: 1.15; }
.page-head p { color: var(--muted); font-weight: 600; font-size: 14px; margin-top: 3px; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }
@container content (max-width: 600px) { .page-head h2 { font-size: 20px; } .page-head .actions { width: 100%; } .page-head .actions > * { flex: 1; } }

/* ---------- Cards ---------- */
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh-1); min-width: 0; display: flex; flex-direction: column; }
.card-h { display: flex; align-items: center; gap: 10px; padding: 14px 16px 10px; min-height: 52px; flex-wrap: wrap; }
.card-h h3 { font-size: 15.5px; font-weight: 800; letter-spacing: -.005em; display: flex; align-items: center; gap: 8px; }
.card-h h3 .ic { color: var(--brand); }
.card-h .sub { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.card-h .right { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.card-b { padding: 4px 16px 16px; flex: 1; min-width: 0; }
.card-b.flush { padding: 0; }
.card-f { border-top: 1px solid var(--line-2); padding: 10px 16px; display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); font-weight: 600; }
.card.soft { background: var(--soft-2); }
.card.pad { padding: 16px; }
.divider { height: 1px; background: var(--line-2); margin: 12px 0; }

/* ---------- Grids (container queries keep balance whatever the sidebar does) ---------- */
.stack { display: flex; flex-direction: column; gap: var(--gap); min-width: 0; }
.grid { display: grid; gap: var(--gap); min-width: 0; }
.g-kpi { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-kpi.five { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-21 { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); }
.g-12 { grid-template-columns: minmax(0, 1fr) minmax(0, 1.7fr); }
.g-side { grid-template-columns: minmax(0, 1fr) 380px; }
@container content (max-width: 1180px) { .g-side { grid-template-columns: minmax(0, 1fr) 340px; } }
@container content (max-width: 1000px) { .g-kpi.five { grid-template-columns: repeat(6, minmax(0, 1fr)); } .g-kpi.five > * { grid-column: span 2; } .g-kpi.five > *:nth-child(n+4) { grid-column: span 3; } }
@container content (max-width: 1080px) { .g-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g-3 > .span-all-md { grid-column: 1 / -1; } }
@container content (max-width: 940px) { .g-21, .g-12, .g-side { grid-template-columns: minmax(0, 1fr); } }
@container content (max-width: 700px) { .g-kpi, .g-kpi.five { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g-kpi.five > * { grid-column: auto; } .g-kpi.five > *:nth-child(5) { grid-column: 1 / -1; } .g-2 { grid-template-columns: minmax(0, 1fr); } }
@container content (max-width: 640px) { .g-3 { grid-template-columns: minmax(0, 1fr); } }
.span-2 { grid-column: span 2; }

/* ---------- KPI tiles ---------- */
.kpi { padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r-lg); background: #fff; box-shadow: var(--sh-1); min-width: 0; display: flex; flex-direction: column; gap: 4px; position: relative; overflow: hidden; }
.kpi .k-top { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 750; color: var(--muted); }
.kpi .k-top .ic { width: 17px; height: 17px; color: var(--grey); }
.kpi .k-val { font-size: 30px; font-weight: 850; letter-spacing: -.025em; line-height: 1.1; font-variant-numeric: tabular-nums; color: var(--ink); }
.kpi .k-val small { font-size: 16px; font-weight: 750; color: var(--muted); letter-spacing: 0; margin-left: 2px; }
.kpi .k-sub { font-size: 12.5px; font-weight: 650; color: var(--muted); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.kpi.accent { border-color: var(--brand-100); background: linear-gradient(180deg, #fff, var(--brand-50)); }
.kpi.accent .k-top .ic { color: var(--brand); }
.kpi.is-warn .k-val { color: var(--warn-ink); }
.kpi.is-crit .k-val { color: var(--crit-ink); }
.kpi.is-ok .k-val { color: var(--ok-ink); }
.kpi.link { cursor: pointer; transition: box-shadow .15s, border-color .15s; }
.kpi.link:hover { box-shadow: var(--sh-2); border-color: #d6d6dc; }
@container content (max-width: 700px) { .kpi { padding: 12px 13px; } .kpi .k-val { font-size: 25px; } .kpi .k-top { font-size: 12px; } }
.trend-up { color: var(--ok-ink); font-weight: 750; } .trend-down { color: var(--crit-ink); font-weight: 750; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; padding: 0 16px;
  border-radius: 11px; border: 1px solid var(--line); background: #fff; color: var(--ink);
  font-weight: 750; font-size: 14.5px; white-space: nowrap; transition: background .12s, border-color .12s, box-shadow .12s, transform .06s; user-select: none;
}
.btn:hover { background: var(--soft); border-color: #d3d3da; }
.btn:active { transform: translateY(1px); }
.btn .ic { width: 18px; height: 18px; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 2px 8px rgba(180,0,0,.22); }
.btn.primary:hover { background: var(--brand-600); border-color: var(--brand-600); }
.btn.dark { background: var(--grey-700); border-color: var(--grey-700); color: #fff; }
.btn.dark:hover { background: #2a2a2a; }
.btn.ok { background: var(--ok-ink); border-color: var(--ok-ink); color: #fff; }
.btn.ok:hover { background: #075a07; }
.btn.danger-o { color: var(--crit-ink); border-color: #f0c4c4; background: #fff; }
.btn.danger-o:hover { background: var(--crit-bg); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--soft); }
.btn.sm { height: 34px; padding: 0 12px; font-size: 13.5px; border-radius: 9px; gap: 6px; }
.btn.sm .ic { width: 16px; height: 16px; }
.btn.lg { height: 54px; padding: 0 22px; font-size: 16.5px; border-radius: 14px; }
.btn.xl { height: 62px; padding: 0 24px; font-size: 18px; border-radius: 16px; font-weight: 800; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .45; pointer-events: none; box-shadow: none; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Chips, badges, status ---------- */
.chip { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 999px; font-size: 12.5px; font-weight: 750; background: var(--soft); color: var(--ink-2); border: 1px solid var(--line); white-space: nowrap; }
.chip .ic { width: 14px; height: 14px; }
.chip.ok { background: var(--ok-bg); color: var(--ok-ink); border-color: #cbe9cb; }
.chip.warn { background: var(--warn-bg); color: var(--warn-ink); border-color: #f6dd9f; }
.chip.serious { background: var(--serious-bg); color: var(--serious-ink); border-color: #f5cdbb; }
.chip.crit { background: var(--crit-bg); color: var(--crit-ink); border-color: #f1c2c2; }
.chip.info { background: var(--info-bg); color: var(--info-ink); border-color: #c8dcf5; }
.chip.brand { background: var(--brand-50); color: var(--brand); border-color: var(--brand-100); }
.chip.dark { background: var(--grey-700); color: #fff; border-color: var(--grey-700); }
.chip.lg { height: 32px; font-size: 13.5px; padding: 0 12px; }
.cat { display: inline-flex; align-items: center; gap: 6px; font-weight: 750; font-size: 12.5px; color: var(--ink-2); white-space: nowrap; }
.cat::before { content: ''; width: 10px; height: 10px; border-radius: 3px; background: var(--c, var(--grey)); flex: none; }
.cat[data-cat="PM"] { --c: var(--c-pm); } .cat[data-cat="CM"] { --c: var(--c-cm); } .cat[data-cat="PMCM"] { --c: var(--c-pmcm); }
.cat[data-cat="MAJOR"] { --c: var(--c-major); } .cat[data-cat="BODY"] { --c: var(--c-body); }
.tag { display: inline-flex; align-items: center; height: 22px; padding: 0 7px; border-radius: 6px; font-size: 11.5px; font-weight: 800; background: var(--soft); border: 1px solid var(--line); color: var(--ink-2); letter-spacing: .01em; white-space: nowrap; }
.fleet-no { font-weight: 850; font-size: 16px; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.plate { display: inline-flex; align-items: stretch; border: 1.5px solid #2b2b2b; border-radius: 6px; overflow: hidden; font-weight: 800; font-size: 12.5px; height: 24px; background: #fff; white-space: nowrap; }
.plate span:first-child { background: var(--brand); color: #fff; padding: 0 5px; display: flex; align-items: center; font-size: 9.5px; letter-spacing: .04em; }
.plate span:last-child { padding: 0 7px; display: flex; align-items: center; font-variant-numeric: tabular-nums; letter-spacing: .06em; }

/* SLA timer */
.sla { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; border-radius: 8px; padding: 3px 8px; }
.sla .ic { width: 15px; height: 15px; }
.sla.ok { color: var(--ok-ink); background: var(--ok-bg); }
.sla.warn { color: var(--warn-ink); background: var(--warn-bg); }
.sla.crit { color: var(--crit-ink); background: var(--crit-bg); }
.sla.idle { color: var(--muted); background: var(--soft); }
.slabar { height: 6px; border-radius: 6px; background: var(--line-2); overflow: hidden; }
.slabar > i { display: block; height: 100%; border-radius: 6px; background: var(--ok); transition: width .6s; }
.slabar.warn > i { background: var(--warn); } .slabar.crit > i { background: var(--crit); }

/* progress */
.prog { height: 8px; border-radius: 8px; background: var(--line-2); overflow: hidden; }
.prog > i { display: block; height: 100%; background: var(--brand); border-radius: 8px; }
.prog.grey > i { background: var(--grey); } .prog.ok > i { background: var(--ok); } .prog.warn > i { background: var(--warn); } .prog.crit > i { background: var(--crit); } .prog.info > i { background: var(--info); }

/* avatar */
.av { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 800; color: #fff; background: var(--grey); flex: none; letter-spacing: .02em; }
.av.sm { width: 26px; height: 26px; font-size: 10.5px; } .av.lg { width: 44px; height: 44px; font-size: 15px; }
.person { display: flex; align-items: center; gap: 9px; min-width: 0; }
.person > div > b { font-weight: 750; font-size: 14px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.person > div > span { font-size: 12px; color: var(--muted); font-weight: 600; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.person > div { min-width: 0; }

/* ---------- Lists & tables ---------- */
.list { display: flex; flex-direction: column; }
.li { display: flex; align-items: center; gap: 12px; padding: 11px 16px; border-top: 1px solid var(--line-2); min-width: 0; }
.li:first-child { border-top: 0; }
.li.click { cursor: pointer; } .li.click:hover { background: var(--soft-2); }
.li .grow { flex: 1; min-width: 0; }
.li .t1 { font-weight: 750; font-size: 14.5px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.li .t2 { font-size: 12.5px; color: var(--muted); font-weight: 600; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.li .end { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-size: 11.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--soft-2); white-space: nowrap; }
.tbl td { padding: 11px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; font-weight: 600; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover td { background: var(--soft-2); }
.tbl tr.click { cursor: pointer; }
.tbl .r { text-align: right; } .tbl .c { text-align: center; }
.tbl td.strong { font-weight: 800; }
/* table → cards on narrow containers */
@container content (max-width: 640px) {
  table.tbl.cards thead { display: none; }
  table.tbl.cards, .tbl.cards tbody, .tbl.cards tr, .tbl.cards td { display: block; width: 100%; }
  .tbl.cards tr { border-bottom: 1px solid var(--line-2); padding: 10px 14px; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; }
  .tbl.cards td { border: 0; padding: 0; }
  .tbl.cards td[data-l]::before { content: attr(data-l); display: block; font-size: 10.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); margin-bottom: 1px; }
  .tbl.cards td.full { grid-column: 1 / -1; }
  .tbl.cards .r { text-align: left; }
}

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .lbl { font-size: 12.5px; font-weight: 800; color: var(--ink-2); letter-spacing: .01em; }
.input, .select, .textarea { width: 100%; height: 44px; border: 1px solid var(--line); border-radius: 11px; padding: 0 13px; background: #fff; font-weight: 650; font-size: 15px; transition: border-color .12s, box-shadow .12s; }
.textarea { height: auto; min-height: 84px; padding: 10px 13px; resize: vertical; line-height: 1.45; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--brand-200); box-shadow: 0 0 0 4px var(--brand-50); }
.select { appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2366686F' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }
.input.sm, .select.sm { height: 36px; font-size: 14px; border-radius: 9px; }
.input-ic { position: relative; } .input-ic .ic { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--faint); pointer-events: none; } .input-ic .input { padding-left: 40px; }
.switch { position: relative; width: 44px; height: 26px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; background: #d6d6dc; border-radius: 26px; transition: background .15s; cursor: pointer; }
.switch span::after { content: ''; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .15s; }
.switch input:checked + span { background: var(--brand); }
.switch input:checked + span::after { transform: translateX(18px); }
.switch input:focus-visible + span { outline: 3px solid rgba(180,0,0,.35); outline-offset: 2px; }

/* segmented & tabs */
.seg { display: inline-flex; background: var(--soft); border: 1px solid var(--line); border-radius: 11px; padding: 3px; gap: 2px; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button { border: 0; background: transparent; height: 34px; padding: 0 13px; border-radius: 8px; font-weight: 750; font-size: 13.5px; color: var(--muted); white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.seg button .n { font-size: 11.5px; font-weight: 800; background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 0 6px; color: var(--ink-2); }
.seg button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.1); }
.seg button.on .n { background: var(--brand); color: #fff; border-color: var(--brand); }
.seg.full { display: flex; width: 100%; } .seg.full button { flex: 1; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; margin-bottom: var(--gap); }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { border: 0; background: none; padding: 11px 14px; font-weight: 750; font-size: 14.5px; color: var(--muted); border-bottom: 3px solid transparent; margin-bottom: -1px; white-space: nowrap; display: inline-flex; align-items: center; gap: 8px; }
.tabs button .ic { width: 18px; height: 18px; }
.tabs button.on { color: var(--brand); border-bottom-color: var(--brand); }
.pick-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.pchip { border: 1.5px solid var(--line); background: #fff; border-radius: 12px; padding: 9px 12px; font-weight: 750; font-size: 14px; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; text-align: left; transition: border-color .12s, background .12s; }
.pchip:hover { border-color: #cdcdd4; }
.pchip .pc-sla { font-size: 12px; font-weight: 800; color: var(--muted); background: var(--soft); border-radius: 6px; padding: 1px 6px; }
.pchip.on { border-color: var(--brand); background: var(--brand-50); color: var(--brand-700); }
.pchip.on .pc-sla { background: #fff; color: var(--brand); }
.pchip .ck { width: 20px; height: 20px; border-radius: 6px; border: 2px solid #c9c9d0; display: grid; place-items: center; flex: none; }
.pchip.on .ck { background: var(--brand); border-color: var(--brand); color: #fff; }
.pchip .ck .ic { width: 14px; height: 14px; stroke-width: 3; opacity: 0; } .pchip.on .ck .ic { opacity: 1; }

/* ---------- Overlays ---------- */
.modal-wrap { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 16px; background: rgba(20,21,24,.45); opacity: 0; pointer-events: none; transition: opacity .18s; }
.modal-wrap.show { opacity: 1; pointer-events: auto; }
.modal { background: #fff; border-radius: var(--r-xl); box-shadow: var(--sh-3); width: min(560px, 100%); max-height: calc(100dvh - 32px); display: flex; flex-direction: column; transform: translateY(10px) scale(.98); transition: transform .18s; overflow: hidden; }
.modal.wide { width: min(820px, 100%); }
.modal-wrap.show .modal { transform: none; }
.modal-h { display: flex; align-items: center; gap: 12px; padding: 18px 20px 12px; }
.modal-h h3 { font-size: 18px; font-weight: 850; flex: 1; letter-spacing: -.01em; }
.modal-b { padding: 4px 20px 18px; overflow-y: auto; }
.modal-f { padding: 14px 20px; border-top: 1px solid var(--line-2); display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
@media (max-width: 767px) {
  .modal-wrap { place-items: end center; padding: 0; }
  .modal, .modal.wide { width: 100%; border-radius: 22px 22px 0 0; max-height: 92dvh; transform: translateY(30px); }
  .modal-f .btn { flex: 1; }
}
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(520px, 100%); background: #fff; z-index: 80; box-shadow: var(--sh-3); transform: translateX(104%); transition: transform .24s ease; display: flex; flex-direction: column; }
.drawer.open { transform: none; }
.drawer-h { display: flex; align-items: center; gap: 12px; padding: 0 18px; height: 64px; border-bottom: 1px solid var(--line); flex: none; }
.drawer-h h3 { font-size: 17px; font-weight: 850; flex: 1; min-width: 0; }
.drawer-b { flex: 1; overflow-y: auto; padding: 16px 18px 24px; }
.drawer-f { border-top: 1px solid var(--line); padding: 12px 18px calc(12px + env(safe-area-inset-bottom)); display: flex; gap: 10px; flex-wrap: wrap; }
.drawer-f .btn { flex: 1; }
.toasts { position: fixed; z-index: 120; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 10px; align-items: flex-end; pointer-events: none; }
.toast { pointer-events: auto; background: #1d1e21; color: #fff; border-radius: 14px; padding: 12px 16px; font-weight: 650; font-size: 14px; display: flex; align-items: center; gap: 10px; box-shadow: var(--sh-3); max-width: min(420px, calc(100vw - 32px)); animation: tin .22s ease; }
.toast .ic { color: #6ee36e; } .toast.warn .ic { color: #ffc94d; } .toast.err .ic { color: #ff8a8a; }
@keyframes tin { from { transform: translateY(12px); opacity: 0; } }
@media (max-width: 767px) { .toasts { left: 12px; right: 12px; bottom: calc(var(--bottomnav) + 12px + env(safe-area-inset-bottom)); align-items: stretch; } .toast { max-width: none; } }
.pop { position: absolute; z-index: 85; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--sh-3); min-width: 280px; padding: 6px; }
.pop .pop-i { display: flex; gap: 10px; align-items: flex-start; padding: 10px; border-radius: 10px; cursor: pointer; }
.pop .pop-i:hover { background: var(--soft); }
.pop .pop-i b { font-weight: 750; font-size: 14px; display: block; } .pop .pop-i span { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.pop .pop-i.on { background: var(--brand-50); }

/* ---------- Misc ---------- */
.muted { color: var(--muted); } .faint { color: var(--faint); } .brand { color: var(--brand); }
.b { font-weight: 800; } .fs-12 { font-size: 12.5px; } .fs-13 { font-size: 13.5px; } .fs-18 { font-size: 18px; }
.row { display: flex; align-items: center; gap: 10px; min-width: 0; } .row.wrap { flex-wrap: wrap; } .row.between { justify-content: space-between; } .row.top { align-items: flex-start; }
.ml-auto { margin-left: auto; } .mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; } .mb-8 { margin-bottom: 8px; } .mb-12 { margin-bottom: 12px; }
.grow { flex: 1; min-width: 0; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hidden { display: none !important; }
.empty { padding: 26px 16px; text-align: center; color: var(--muted); font-weight: 650; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.empty .ic { width: 30px; height: 30px; color: var(--faint); }
.note { display: flex; gap: 10px; align-items: flex-start; padding: 11px 13px; border-radius: 12px; background: var(--soft-2); border: 1px solid var(--line); font-size: 13.5px; font-weight: 600; color: var(--ink-2); }
.note .ic { color: var(--grey); margin-top: 1px; width: 18px; height: 18px; }
.note.info { background: var(--info-bg); border-color: #cfe0f6; } .note.info .ic { color: var(--info-ink); }
.note.warn { background: var(--warn-bg); border-color: #f4dc9c; } .note.warn .ic { color: var(--warn-ink); }
.note.crit { background: var(--crit-bg); border-color: #f0c4c4; } .note.crit .ic { color: var(--crit-ink); }
.note.ok { background: var(--ok-bg); border-color: #c8e7c8; } .note.ok .ic { color: var(--ok-ink); }
.note.brand { background: var(--brand-50); border-color: var(--brand-100); } .note.brand .ic { color: var(--brand); }
.kv { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 16px; }
.kv > div { min-width: 0; }
.kv dt, .kv .k { font-size: 11.5px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--faint); }
.kv dd, .kv .v { margin: 2px 0 0; font-weight: 750; font-size: 14.5px; }
.kv.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@container content (max-width: 520px) { .kv.three { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.legend { display: flex; flex-wrap: wrap; gap: 8px 14px; font-size: 12.5px; font-weight: 700; color: var(--ink-2); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.skeleton-pulse { animation: sk 1.2s infinite; } @keyframes sk { 50% { opacity: .5; } }
.spin { animation: spin 1s linear infinite; } @keyframes spin { to { transform: rotate(360deg); } }

/* Pipeline steps */
.pipeline { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.pipe { border: 1px solid var(--line); border-radius: 14px; padding: 12px; position: relative; background: #fff; cursor: pointer; min-width: 0; transition: border-color .12s, box-shadow .12s; }
.pipe:hover { border-color: #d0d0d7; box-shadow: var(--sh-2); }
.pipe .p-n { font-size: 26px; font-weight: 850; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.pipe .p-l { font-size: 12.5px; font-weight: 750; color: var(--muted); display: flex; align-items: center; gap: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pipe .p-l .ic { width: 15px; height: 15px; color: var(--grey); flex: none; }
.pipe .p-s { margin-top: 6px; display: flex; gap: 4px; flex-wrap: wrap; }
.pipe.hot { border-color: var(--brand-100); background: var(--brand-50); }
@container content (max-width: 760px) { .pipeline { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* Board (kanban) */
.board { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; align-items: start; }
.col { background: var(--soft-2); border: 1px solid var(--line); border-radius: var(--r-lg); min-width: 0; display: flex; flex-direction: column; max-height: calc(100dvh - var(--topbar) - 250px); min-height: 360px; }
.col-h { display: flex; align-items: center; gap: 8px; padding: 12px 12px 10px; font-weight: 800; font-size: 14px; border-bottom: 1px solid var(--line); flex: none; }
.col-h .n { margin-left: auto; font-size: 12.5px; font-weight: 800; background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 1px 9px; }
.col-h .ic { width: 17px; height: 17px; color: var(--grey); }
.col-b { padding: 10px; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; flex: 1; scrollbar-width: thin; }
.jc { background: #fff; border: 1px solid var(--line); border-radius: 13px; padding: 11px 12px; display: flex; flex-direction: column; gap: 8px; cursor: pointer; box-shadow: var(--sh-1); transition: border-color .12s, box-shadow .12s; position: relative; }
.jc:hover { border-color: #cfd0d7; box-shadow: var(--sh-2); }
.jc.warn { border-left: 4px solid var(--warn); } .jc.crit { border-left: 4px solid var(--crit); }
.jc .jc-top { display: flex; align-items: center; gap: 8px; }
.jc .jc-tasks { font-size: 13px; font-weight: 650; color: var(--ink-2); line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.jc .jc-foot { display: flex; align-items: center; gap: 8px; justify-content: space-between; font-size: 12.5px; color: var(--muted); font-weight: 700; }
.jc.new-flash { animation: flash 1.6s ease 2; }
@keyframes flash { 50% { box-shadow: 0 0 0 4px var(--brand-100); border-color: var(--brand); } }
.seg.board-tabs { display: none; margin-bottom: 12px; }
.jc .jc-btns { display: flex; gap: 6px; min-width: 0; }
.jc .jc-btns .btn.primary { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; justify-content: flex-start; }
.jc .jc-btns .btn:not(.primary) { flex: none; width: 34px; padding: 0; }
/* check-in: vehicle left, jobs right on tablets */
.ci-grid { display: grid; gap: var(--gap); grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.25fr); align-items: start; }
.ci-grid .ci-sub { display: grid; gap: var(--gap); grid-template-columns: repeat(2, minmax(0, 1fr)); }
@container content (max-width: 1240px) { .ci-grid .ci-sub { grid-template-columns: minmax(0, 1fr); } .ci-grid .veh-hero .vh-ic { display: none; } }
@container content (max-width: 820px) { .ci-grid { grid-template-columns: minmax(0, 1fr); } .ci-grid .ci-sub { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@container content (max-width: 600px) { .ci-grid .ci-sub { grid-template-columns: minmax(0, 1fr); } }
@container content (max-width: 1180px) {
  .board { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .board .col { max-height: 44dvh; min-height: 230px; }
  .board .col[data-s="waiting"] { grid-column: 1; grid-row: 1; } .board .col[data-s="qc"] { grid-column: 1; grid-row: 2; }
  .board .col[data-s="progress"] { grid-column: 2; grid-row: 1 / span 2; max-height: calc(88dvh + 12px); }
  .board .col[data-s="parts"] { grid-column: 3; grid-row: 1; } .board .col[data-s="ready"] { grid-column: 3; grid-row: 2; }
}
@container content (max-width: 720px) {
  .board { grid-template-columns: minmax(0, 1fr); }
  .board .col { display: none; max-height: none !important; min-height: 0; grid-column: 1 !important; grid-row: auto !important; }
  .board .col.show { display: flex; } .seg.board-tabs { display: flex; }
}

/* Bays */
.bay-group { margin-bottom: 16px; }
.bay-group h4 { font-size: 13px; font-weight: 800; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; margin: 0 0 8px; display: flex; gap: 8px; align-items: center; }
.bays { display: grid; grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: 8px; }
.bay { border: 1px solid var(--line); border-radius: 12px; padding: 9px 10px; min-height: 84px; display: flex; flex-direction: column; gap: 3px; background: #fff; cursor: pointer; }
.bay .bay-id { font-size: 11.5px; font-weight: 850; color: var(--faint); letter-spacing: .04em; display: flex; justify-content: space-between; }
.bay .bay-v { font-weight: 850; font-size: 16px; font-variant-numeric: tabular-nums; }
.bay .bay-t { font-size: 12px; font-weight: 650; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bay.free { background: var(--soft-2); border-style: dashed; cursor: default; }
.bay.free .bay-v { color: var(--ok-ink); font-size: 14px; }
.bay.warn { border-color: #f3d58c; background: #FFFBEF; } .bay.crit { border-color: #efb9b9; background: #FFF6F6; }

/* Timeline */
.tl { position: relative; padding-left: 26px; }
.tl::before { content: ''; position: absolute; left: 9px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.tl-i { position: relative; padding: 0 0 16px; }
.tl-i:last-child { padding-bottom: 0; }
.tl-i::before { content: ''; position: absolute; left: -22px; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 3px solid var(--grey); }
.tl-i.done::before { border-color: var(--ok); background: var(--ok); }
.tl-i.now::before { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-100); }
.tl-i.cat-PM::before { border-color: var(--c-pm); } .tl-i.cat-CM::before { border-color: var(--c-cm); } .tl-i.cat-PMCM::before { border-color: var(--c-pmcm); } .tl-i.cat-MAJOR::before { border-color: var(--c-major); } .tl-i.cat-BODY::before { border-color: var(--c-body); }
.tl-i .tl-t { font-weight: 750; font-size: 14px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.tl-i .tl-s { font-size: 12.5px; color: var(--muted); font-weight: 600; margin-top: 2px; }

/* Charts */
.chart { position: relative; width: 100%; }
.chart svg { width: 100%; height: auto; overflow: visible; }
.chart .axis text, .chart text.axis { font-size: 11px; font-weight: 650; fill: var(--muted); font-family: var(--font); }
.chart .grid-l { stroke: var(--line-2); stroke-width: 1; }
.chart .hit { fill: transparent; cursor: crosshair; }
.chart-tip { position: absolute; pointer-events: none; z-index: 5; background: #1d1e21; color: #fff; border-radius: 10px; padding: 8px 10px; font-size: 12.5px; font-weight: 650; box-shadow: var(--sh-2); white-space: nowrap; opacity: 0; transition: opacity .1s; transform: translate(-50%, calc(-100% - 10px)); }
.chart-tip.show { opacity: 1; }
.chart-tip b { font-weight: 800; }
.chart-tip .tip-row { display: flex; align-items: center; gap: 6px; } .chart-tip .tip-row i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }
.donut-wrap { display: flex; align-items: center; gap: 18px; }
.donut-wrap .donut { width: 150px; flex: none; position: relative; }
.donut-wrap .donut .d-c { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; pointer-events: none; }
.donut-wrap .donut .d-c b { display: block; font-size: 26px; font-weight: 850; letter-spacing: -.02em; line-height: 1; }
.donut-wrap .donut .d-c span { font-size: 11.5px; font-weight: 700; color: var(--muted); }
.donut-legend { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 7px; }
.donut-legend .dl { display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 700; }
.donut-legend .dl i { width: 11px; height: 11px; border-radius: 3px; flex: none; }
.donut-legend .dl .v { margin-left: auto; font-variant-numeric: tabular-nums; font-weight: 800; }
.donut-legend .dl .p { color: var(--muted); font-weight: 700; width: 44px; text-align: right; font-variant-numeric: tabular-nums; }
@container content (max-width: 420px) { .donut-wrap { flex-direction: column; align-items: stretch; } .donut-wrap .donut { margin: 0 auto; } }
.hbars { display: flex; flex-direction: column; gap: 10px; }
.hb { display: grid; grid-template-columns: minmax(90px, 38%) 1fr auto; align-items: center; gap: 10px; font-size: 13.5px; font-weight: 700; }
.hb .hb-l { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink-2); }
.hb .hb-t { height: 10px; background: var(--line-2); border-radius: 6px; overflow: hidden; position: relative; }
.hb .hb-t i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 6px; background: var(--grey); }
.hb .hb-t .mark { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--ink); border-radius: 2px; }
.hb .hb-v { font-variant-numeric: tabular-nums; font-weight: 800; min-width: 44px; text-align: right; }

/* Car diagram */
.car-dia { width: 100%; max-width: 230px; margin: 0 auto; }
.car-dia .zone { fill: #F3F3F6; stroke: #C9CAD1; stroke-width: 1.5; cursor: pointer; transition: fill .12s; }
.car-dia .zone:hover { fill: #E9E9EE; }
.car-dia .zone.mark { fill: #FDE3E3; stroke: var(--crit); }
.car-dia .zone.ok { fill: #E6F5E6; stroke: #9fd39f; }
.car-dia .glass { fill: #DDE7F3; stroke: #b3c4da; stroke-width: 1.2; pointer-events: none; }
.car-dia text { font-size: 9px; font-weight: 800; fill: #7d7e86; pointer-events: none; font-family: var(--font); }

/* Keypad */
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.keypad button { height: 54px; border-radius: 13px; border: 1px solid var(--line); background: #fff; font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; }
.keypad button:hover { background: var(--soft); }
.keypad button.k-alt { font-size: 14px; color: var(--muted); }

/* Phone mockup */
.phone { width: 340px; max-width: 100%; margin: 0 auto; border-radius: 44px; background: #111; padding: 12px; box-shadow: var(--sh-3); }
.phone-scr { border-radius: 34px; background: #fff; height: 660px; overflow: hidden; display: flex; flex-direction: column; position: relative; }
.phone-notch { height: 30px; display: flex; align-items: center; justify-content: space-between; padding: 0 22px; font-size: 12px; font-weight: 800; flex: none; }
.phone-notch .pill { width: 92px; height: 24px; border-radius: 14px; background: #111; }
.phone-app { flex: 1; overflow-y: auto; padding: 4px 16px 16px; display: flex; flex-direction: column; gap: 12px; scrollbar-width: none; }
.phone-app::-webkit-scrollbar { display: none; }
.ph-head { display: flex; align-items: center; gap: 10px; padding: 6px 0 4px; }
.ph-head img { height: 22px; width: auto; }
.ph-card { border: 1px solid var(--line); border-radius: 16px; padding: 12px; }
.ph-issue { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.ph-issue button { border: 1.5px solid var(--line); background: #fff; border-radius: 14px; padding: 12px 8px; display: flex; flex-direction: column; align-items: center; gap: 6px; font-weight: 750; font-size: 13px; }
.ph-issue button .ic { width: 24px; height: 24px; color: var(--grey); }
.ph-issue button.on { border-color: var(--brand); background: var(--brand-50); color: var(--brand-700); }
.ph-issue button.on .ic { color: var(--brand); }
.ph-steps { display: flex; gap: 5px; }
.ph-steps i { flex: 1; height: 4px; border-radius: 4px; background: var(--line); }
.ph-steps i.on { background: var(--brand); }
.mic-btn { width: 84px; height: 84px; border-radius: 50%; border: 0; background: var(--brand); color: #fff; display: grid; place-items: center; margin: 4px auto; box-shadow: 0 8px 22px rgba(180,0,0,.35); position: relative; }
.mic-btn .ic { width: 34px; height: 34px; }
.mic-btn.rec::after { content: ''; position: absolute; inset: -8px; border-radius: 50%; border: 3px solid var(--brand); animation: ring 1.2s infinite; }
@keyframes ring { from { transform: scale(.9); opacity: 1; } to { transform: scale(1.25); opacity: 0; } }
.slot { border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 12px; display: flex; align-items: center; gap: 10px; background: #fff; width: 100%; text-align: left; }
.slot.on { border-color: var(--brand); background: var(--brand-50); }
.slot b { font-weight: 800; font-size: 14px; } .slot span { font-size: 12px; color: var(--muted); font-weight: 650; }
@media (max-width: 420px) { .phone { border-radius: 36px; padding: 9px; } .phone-scr { height: 600px; border-radius: 28px; } }

/* Map page */
.map-shell { position: relative; height: calc(100dvh - var(--topbar)); min-height: 480px; }
#fleetmap { position: absolute; inset: 0; background: #eef0f3; }
.map-panel { position: absolute; top: 14px; left: 14px; bottom: 14px; width: 340px; z-index: 5; display: flex; flex-direction: column; gap: 10px; pointer-events: none; }
.map-panel > * { pointer-events: auto; }
.mp-card { background: rgba(255,255,255,.97); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--sh-2); }
.mp-list { flex: 1; min-height: 0; overflow: hidden; display: flex; flex-direction: column; }
.mp-list .list { overflow-y: auto; flex: 1; }
.mp-filters { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 10px; }
.mpf { display: flex; align-items: center; gap: 8px; border: 1.5px solid var(--line); background: #fff; border-radius: 11px; padding: 7px 9px; font-weight: 750; font-size: 12.5px; text-align: left; }
.mpf i { width: 11px; height: 11px; border-radius: 50%; flex: none; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.15); }
.mpf .n { margin-left: auto; font-weight: 850; font-variant-numeric: tabular-nums; }
.mpf.off { opacity: .45; }
.map-tools { position: absolute; top: 14px; right: 14px; z-index: 5; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.map-tools .seg { background: rgba(255,255,255,.97); box-shadow: var(--sh-2); }
.map-legend { position: absolute; right: 14px; bottom: 30px; z-index: 5; padding: 10px 12px; font-size: 12px; }
.map-sheet-handle { display: none; }
.branch-pin { display: flex; align-items: center; gap: 8px; background: #fff; border: 2px solid var(--brand); border-radius: 14px; padding: 5px 10px 5px 5px; box-shadow: 0 6px 18px rgba(0,0,0,.22); cursor: pointer; white-space: nowrap; }
.branch-pin img { width: 30px; height: 28px; object-fit: contain; }
.branch-pin b { font-size: 12.5px; font-weight: 850; display: block; line-height: 1.1; }
.branch-pin span { font-size: 11px; font-weight: 700; color: var(--muted); }
.branch-pin.body { border-color: var(--grey); }
.branch-pin .cnt { background: var(--brand); color: #fff; font-weight: 850; font-size: 12px; border-radius: 8px; padding: 2px 7px; margin-left: 4px; }
.maplibregl-popup-content { border-radius: 14px !important; padding: 12px 14px !important; box-shadow: var(--sh-3) !important; font-family: var(--font); min-width: 230px; }
.maplibregl-popup-close-button { font-size: 18px; width: 28px; height: 28px; right: 4px; top: 4px; border-radius: 8px; }
.mpop h4 { font-size: 16px; font-weight: 850; display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.mpop .kv { gap: 6px 12px; margin: 8px 0 10px; }
.mpop .kv .v { font-size: 13.5px; }
.map-fallback { position: absolute; inset: 0; display: none; place-items: center; text-align: center; padding: 24px; z-index: 3; }
@media (max-width: 767px) {
  .map-shell { height: calc(100dvh - var(--topbar) - var(--bottomnav) - env(safe-area-inset-bottom)); }
  .map-panel { top: auto; left: 0; right: 0; bottom: 0; width: auto; gap: 0; }
  .map-panel .mp-search { display: none; }
  .mp-list { border-radius: 18px 18px 0 0; max-height: 46px; transition: max-height .25s ease; border-bottom: 0; }
  .map-panel.open .mp-list { max-height: 62dvh; }
  .map-sheet-handle { display: flex; align-items: center; gap: 8px; padding: 0 14px; height: 46px; font-weight: 800; font-size: 14px; flex: none; border: 0; background: none; width: 100%; text-align: left; }
  .map-sheet-handle .bar { width: 36px; height: 4px; border-radius: 4px; background: #cfcfd6; margin: 0 auto; position: absolute; left: 50%; top: 6px; transform: translateX(-50%); }
  .map-tools { top: 10px; right: 10px; }
  .map-legend { display: none; }
  .map-kpis { position: absolute; top: 10px; left: 10px; right: 140px; z-index: 5; }
}
@media (min-width: 768px) and (max-width: 1099px) { .map-panel { width: 300px; } }

/* Check-in */
.ci-steps { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.ci-step { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 750; color: var(--faint); }
.ci-step .n { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; font-size: 12px; font-weight: 850; }
.ci-step.done { color: var(--ok-ink); } .ci-step.done .n { background: var(--ok); border-color: var(--ok); color: #fff; }
.ci-step.now { color: var(--ink); } .ci-step.now .n { border-color: var(--brand); color: var(--brand); }
.ci-step + .ci-step::before { content: ''; width: 18px; height: 2px; background: var(--line); border-radius: 2px; }
.timer-big { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 14px; border: 1px solid var(--line); background: #fff; }
.timer-big .t { font-size: 28px; font-weight: 850; font-variant-numeric: tabular-nums; letter-spacing: -.02em; line-height: 1; }
.timer-big .l { font-size: 11.5px; font-weight: 800; color: var(--muted); letter-spacing: .05em; text-transform: uppercase; }
.timer-big.run .t { color: var(--brand); }
.scan-box { border: 2px dashed #d6d6dd; border-radius: 18px; padding: 18px; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; background: var(--soft-2); position: relative; overflow: hidden; }
.scan-box .scan-ic { width: 64px; height: 64px; border-radius: 18px; background: var(--brand-50); color: var(--brand); display: grid; place-items: center; }
.scan-box .scan-ic .ic { width: 32px; height: 32px; }
.scan-box.scanning::after { content: ''; position: absolute; left: 0; right: 0; height: 3px; background: var(--brand); box-shadow: 0 0 18px var(--brand); animation: scanline 1.1s ease-in-out infinite; }
@keyframes scanline { 0% { top: 8%; } 50% { top: 88%; } 100% { top: 8%; } }
.veh-hero { display: flex; gap: 14px; align-items: center; }
.veh-hero .vh-ic { width: 58px; height: 58px; border-radius: 16px; background: var(--soft); display: grid; place-items: center; flex: none; color: var(--grey); }
.veh-hero .vh-no { font-size: 30px; font-weight: 900; letter-spacing: -.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.flag-list { display: flex; flex-direction: column; gap: 8px; }
.voice-box { display: flex; gap: 12px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--soft-2); }
.voice-btn { width: 56px; height: 56px; border-radius: 50%; background: var(--brand); color: #fff; border: 0; display: grid; place-items: center; flex: none; position: relative; box-shadow: 0 6px 16px rgba(180,0,0,.3); }
.voice-btn .ic { width: 26px; height: 26px; }
.voice-btn.rec::after { content: ''; position: absolute; inset: -6px; border-radius: 50%; border: 3px solid var(--brand); animation: ring 1.2s infinite; }
.wave { display: flex; align-items: center; gap: 3px; height: 26px; }
.wave i { width: 3px; border-radius: 3px; background: var(--brand); animation: wv .9s ease-in-out infinite; }
@keyframes wv { 0%, 100% { height: 6px; } 50% { height: 24px; } }
.transcript { border-left: 3px solid var(--brand); padding: 6px 0 6px 12px; }
.transcript .orig { font-size: 13px; color: var(--muted); font-weight: 600; font-style: italic; }
.transcript .en { font-size: 15px; font-weight: 750; margin-top: 3px; }
.sticky-cta { position: sticky; bottom: 12px; z-index: 6; }
@media (max-width: 767px) { .sticky-cta { bottom: calc(var(--bottomnav) + 10px + env(safe-area-inset-bottom)); } }
.summary-bar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 12px 12px 12px 16px; box-shadow: var(--sh-2); }
.summary-bar .sb-i { display: flex; flex-direction: column; min-width: 0; }
.summary-bar .sb-i .l { font-size: 11px; font-weight: 800; color: var(--faint); letter-spacing: .05em; text-transform: uppercase; }
.summary-bar .sb-i .v { font-size: 16px; font-weight: 850; white-space: nowrap; }
.summary-bar .btn { margin-left: auto; }
@container content (max-width: 600px) { .summary-bar .btn { width: 100%; margin-left: 0; } .summary-bar { gap: 10px 16px; } }
.qr { width: 120px; height: 120px; image-rendering: pixelated; border: 6px solid #fff; outline: 1px solid var(--line); border-radius: 8px; }
.success-ic { width: 64px; height: 64px; border-radius: 50%; background: var(--ok-bg); color: var(--ok-ink); display: grid; place-items: center; margin: 0 auto 8px; }
.success-ic .ic { width: 34px; height: 34px; stroke-width: 2.6; }

/* Technician */
.tech-hero { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.task { border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; display: flex; gap: 12px; align-items: center; background: #fff; }
.task.done { background: var(--ok-bg); border-color: #c5e6c5; }
.task.run { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-50); }
.task .t-ic { width: 40px; height: 40px; border-radius: 12px; background: var(--soft); display: grid; place-items: center; flex: none; color: var(--grey); }
.task.done .t-ic { background: var(--ok); color: #fff; }
.task.run .t-ic { background: var(--brand); color: #fff; }
.task .t-b { flex: 1; min-width: 0; }
.task .t-n { font-weight: 800; font-size: 15px; }
.task .t-s { font-size: 12.5px; color: var(--muted); font-weight: 650; margin-top: 1px; }
.task .t-steps { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12.5px; color: var(--ink-2); font-weight: 600; }
.task .t-steps span::before { content: '•'; color: var(--faint); margin-right: 5px; }
@container content (max-width: 560px) { .task { flex-wrap: wrap; } .task .t-b { flex: 1 1 calc(100% - 60px); } .task > .btn, .task > .chip { width: 100%; justify-content: center; } }
/* phone refinements */
@container content (max-width: 600px) {
  #jobchips { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  #jobchips .pchip { flex-direction: column; align-items: flex-start; gap: 6px; padding: 10px 34px 10px 11px; font-size: 13.5px; position: relative; line-height: 1.25; }
  #jobchips .pchip .ck { position: absolute; top: 10px; right: 10px; }
  #jobchips #morejobs { grid-column: 1 / -1; flex-direction: row; justify-content: center; padding: 10px; }
  .summary-bar { padding: 10px 12px; gap: 6px 18px; }
  .summary-bar .sb-i.opt { display: none; }
  .summary-bar .btn.xl { height: 54px; font-size: 16.5px; }
  .veh-hero .vh-ic { display: none; }
  .veh-hero .vh-no { font-size: 26px; }
  .ci-step .st-l { display: none; } .ci-step.now .st-l { display: inline; }
  .ci-step + .ci-step::before { width: 12px; }
  .floor-tools { width: 100%; } .floor-tools .input-ic { flex: 1; width: auto !important; }
  #chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
  #chips::-webkit-scrollbar { display: none; } #chips > * { flex: none; }
}

/* QC */
.qc-sec { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.qc-sec h4 { font-size: 13.5px; font-weight: 850; padding: 10px 14px; background: var(--soft-2); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 8px; }
.qc-i { display: flex; align-items: center; gap: 10px; padding: 9px 14px; border-top: 1px solid var(--line-2); }
.qc-i:first-of-type { border-top: 0; }
.qc-i .q-l { flex: 1; font-weight: 650; font-size: 14px; min-width: 0; }
.pf { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; flex: none; }
.pf button { border: 0; background: #fff; height: 34px; padding: 0 12px; font-weight: 800; font-size: 13px; color: var(--muted); display: inline-flex; align-items: center; gap: 4px; }
.pf button + button { border-left: 1px solid var(--line); }
.pf button.p.on { background: var(--ok); color: #fff; } .pf button.f.on { background: var(--crit); color: #fff; }

.qc-grid { display: grid; gap: var(--gap); grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
.qc-body { display: grid; gap: var(--gap); grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.2fr); align-items: start; }
.qc-car-wrap { display: flex; flex-direction: column; gap: 12px; }
.qc-car-wrap #qcar { max-width: 210px; margin: 0 auto; width: 100%; }
@container content (max-width: 1240px) { .qc-body { grid-template-columns: minmax(0, 1fr); } .qc-car-wrap { flex-direction: row; align-items: flex-start; } .qc-car-wrap #qcar { width: 170px; flex: none; margin: 0; } .qc-car-wrap > div:last-child { flex: 1; min-width: 0; } }
@container content (max-width: 980px) { .qc-grid { grid-template-columns: minmax(0, 1fr); } .qc-side { order: -1; } }
@container content (max-width: 520px) { .qc-car-wrap { flex-direction: column; } .qc-car-wrap #qcar { margin: 0 auto; } }
.sticky-side { position: sticky; top: calc(var(--topbar) + 16px); }
@container content (max-width: 940px) { .sticky-side { position: static; } }

/* Settings */
.set-row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--line-2); }
.set-row:first-child { border-top: 0; }
.int-card { display: flex; gap: 12px; align-items: flex-start; }
.int-card .i-ic { width: 44px; height: 44px; border-radius: 12px; background: var(--soft); display: grid; place-items: center; color: var(--grey); flex: none; }
.perm-y { color: var(--ok-ink); } .perm-n { color: var(--faint); }

/* AI */
.ai-box { border: 1px solid var(--line); border-radius: 16px; background: linear-gradient(180deg, #fff, var(--soft-2)); }
.ai-msg { display: flex; gap: 10px; align-items: flex-start; padding: 12px 0; }
.ai-msg .a-ic { width: 34px; height: 34px; border-radius: 10px; background: var(--brand); color: #fff; display: grid; place-items: center; flex: none; }
.ai-msg .a-ic.u { background: var(--grey); }
.ai-msg .a-b { flex: 1; min-width: 0; font-size: 14.5px; font-weight: 600; line-height: 1.5; }
.ai-msg .a-b b { font-weight: 800; }
.ai-msg .a-b ul { margin: 6px 0 0; padding-left: 18px; }
.caret::after { content: '▍'; color: var(--brand); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* Guided flow strip */
.flow { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.flow a { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 13px; background: #fff; min-width: 0; transition: border-color .12s, background .12s; }
.flow a:hover { border-color: var(--brand-200); background: var(--brand-50); }
.flow .f-n { width: 28px; height: 28px; border-radius: 9px; background: var(--brand); color: #fff; font-weight: 850; display: grid; place-items: center; font-size: 13px; flex: none; }
.flow b { font-size: 13.5px; font-weight: 800; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.flow span { font-size: 12px; color: var(--muted); font-weight: 650; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.flow a > div { min-width: 0; }
@container content (max-width: 1100px) { .flow { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@container content (max-width: 560px) { .flow { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

@media print { .sidebar, .topbar, .bottomnav { display: none; } .main { margin: 0; } }
@container content (max-width: 900px) { #bpipe { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; } }
