/* Anytime Diesel brand (reference/brand/README.md): Sun Yellow #fcd30a,
   Fresh Orange #ee3427, Brick Red #d33b27. Bounded for display, Manrope
   for body.

   Layout language after 2026-09-08 feedback: the user wants the data
   density of a real telematics dashboard (reference: a live Grafana
   fleet dashboard, gradient stat tiles with sparklines, gauges, a real
   map, area charts) rendered with the whitespace, type discipline and
   restraint of an Apple product page, not a cluttered engineering panel
   grid. So: real functional widgets, generous negative space, one
   confident accent color per element, no visual noise. */

:root {
  --bg: #fbfbfa;
  --panel: #ffffff;
  --panel-2: #f5f5f7;
  --border: #eceae4;
  --text: #1d1d1f;
  --muted: #626970;

  --sun-yellow: #fcd30a;
  --fresh-orange: #ee3427;
  --brick-red: #d33b27;

  --accent: var(--brick-red);

  --critical: #d33b27;
  --critical-bg: #fdeae6;
  --warning: #a8720a;
  --warning-bg: #fdf1cf;
  --info: #4a5a72;
  --info-bg: #eaeef3;
  --ok: #2f7a4a;
  --ok-bg: #e8f5ec;
  /* Between warning and critical (Needs attention "high"). */
  --high: #c2410c;
  --high-bg: #ffedd5;
  /* The one status palette (owner, 16 Nov: seven palettes became one). Every page colours
     states with these tokens only: --critical (red: act now), --high (orange), --warning (amber:
     watch), --ok (green: fine), --info (blue-grey: neutral), each with a -bg for chips. ui.css's
     --g / --a / --r are aliases of --ok / --warning / --critical. Dark values are set below. */

  --font-display: "Bounded", "Manrope", -apple-system, sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Manrope", "Segoe UI", Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

/* ---------- Chrome: minimal sticky nav, not a decorative banner ---------- */

.topbar {
  position: sticky;
  top: 0;
  /* Above map chrome (.fm-* at ~1001) so the app switcher menu is never covered. */
  z-index: 5000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 32px;
  background: rgba(251, 251, 250, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.brand { display: flex; align-items: center; gap: 9px; text-decoration: none; color: var(--text); }
.brand-mark {
  width: 26px; height: 26px; border-radius: 8px;
  background: linear-gradient(135deg, var(--brick-red), var(--fresh-orange));
  color: #fff;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.brand-text { font-family: var(--font-display); font-weight: 700; font-size: 14px; letter-spacing: -0.01em; }

/* ---------- Left navigation rail ---------- */
/* Matches the reference the team chose: a light rail standing on the page canvas, the
   work in a white rounded panel beside it, the current page as a raised white pill.
   232px wide, 72px narrow (icons + tooltips); a phone gets a drawer. */
:root {
  --rail-wide: 232px; --rail-narrow: 72px; --rail: var(--rail-wide);
  --canvas: #f1f1ef; --rail-ink: #55595f; --rail-ink-strong: #111113; --rail-line: #e4e4e0;
  --rail-hover: #e9e9e5; --rail-pill: #ffffff; --panel-radius: 20px;
}
:root[data-sidebar="narrow"] { --rail: var(--rail-narrow); }
:root[data-theme="dark"] {
  --canvas: #0c0d0e; --rail-ink: #a1a1a8; --rail-ink-strong: #f3f4f6; --rail-line: #24272b;
  --rail-hover: #1b1e21; --rail-pill: #1f2327;
}

body.has-rail { background: var(--canvas); padding-left: var(--rail); transition: padding-left 180ms ease; }
/* The work sits in one white rounded panel; nothing inside it had to change. */
body.has-rail > .topbar,
body.has-rail > main,
body.has-rail > footer { background: var(--bg); margin-right: 8px; }
body.has-rail > .topbar { margin-top: 8px; border-radius: var(--panel-radius) var(--panel-radius) 0 0; border-bottom: 0; padding: 10px 24px; min-height: 0; position: static; backdrop-filter: none; -webkit-backdrop-filter: none; }
body.has-rail > main { border-radius: 0 0 var(--panel-radius) var(--panel-radius); margin-bottom: 8px; min-height: calc(100vh - 70px); }

.sidenav {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: var(--rail);
  z-index: 4900;
  display: flex; flex-direction: column;
  padding: 14px 12px 12px;
  background: var(--canvas);
  color: var(--rail-ink);
  transition: width 180ms ease;
}
.sidenav-head { display: flex; align-items: center; height: 44px; padding: 0 6px; margin-bottom: 10px; }
.sidenav-brand { display: flex; align-items: center; min-width: 0; text-decoration: none; }
.sidenav-brand .brand-mark { width: 36px; height: 36px; border-radius: 10px; object-fit: contain; }
.sidenav-brand .brand-full { height: 30px; width: auto; max-width: 180px; object-fit: contain; object-position: left center; }
.sidenav-brand .brand-mark { display: none; }
:root[data-sidebar="narrow"] .sidenav-brand .brand-mark { display: block; }
:root[data-sidebar="narrow"] .sidenav-brand .brand-full { display: none; }
:root[data-sidebar="narrow"] .sidenav-head { justify-content: center; padding: 0; }

/* The collapse control sits on the rail's edge, as in the reference. */
.rail-toggle {
  position: absolute; top: 26px; right: -12px;
  width: 24px; height: 24px; padding: 0;
  display: grid; place-items: center;
  border-radius: 999px; border: 1px solid var(--rail-line);
  background: var(--rail-pill); color: var(--rail-ink); cursor: pointer;
  box-shadow: 0 1px 2px rgba(17, 17, 19, 0.08);
  z-index: 2;
}
.rail-toggle svg { width: 14px; height: 14px; transition: transform 180ms ease; }
:root[data-sidebar="narrow"] .rail-toggle svg { transform: rotate(180deg); }
.rail-toggle:hover { color: var(--rail-ink-strong); }
.rail-toggle:focus-visible { outline: 2px solid var(--brick-red); outline-offset: 2px; }

.sidenav-scroll { flex: 1 1 auto; overflow-y: auto; overflow-x: hidden; margin: 0 -4px; padding: 0 4px; scrollbar-width: thin; }
.sidenav-group + .sidenav-group { margin-top: 14px; }
.sidenav-label { margin: 0 0 6px 12px; color: #8a8f96; font: 600 10.5px var(--font-body); letter-spacing: 0.07em; text-transform: uppercase; white-space: nowrap; }
.sidenav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }

.sidenav a, .rail-item {
  position: relative;
  display: flex; align-items: center; gap: 12px;
  width: 100%; min-height: 40px; padding: 8px 12px;
  border: 1px solid transparent; border-radius: 14px;
  background: transparent; color: inherit;
  font: 500 14px var(--font-body); text-align: left; text-decoration: none; white-space: nowrap;
  cursor: pointer;
  transition: background 140ms ease, color 140ms ease;
}
.sidenav a:hover, .rail-item:hover { background: var(--rail-hover); color: var(--rail-ink-strong); }
.sidenav a:focus-visible, .rail-item:focus-visible { outline: 2px solid var(--brick-red); outline-offset: 1px; }
/* Where you are: a raised white pill, the way the reference marks it. */
.sidenav a[aria-current="page"] {
  background: var(--rail-pill); color: var(--rail-ink-strong); font-weight: 600;
  border-color: var(--rail-line); box-shadow: 0 1px 2px rgba(17, 17, 19, 0.06), 0 1px 1px rgba(17, 17, 19, 0.04);
}
.sidenav a[aria-current="page"] .nav-ico { color: var(--brick-red); }

.nav-ico { flex: 0 0 20px; width: 20px; height: 20px; }
.nav-text { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.sidenav .nav-badge {
  flex: 0 0 auto; min-width: 22px; height: 20px; padding: 0 7px;
  display: inline-grid; place-items: center;
  border-radius: 999px; background: #e5484d; color: #fff; font: 700 11px var(--font-body);
}

/* Foot: appearance, then the signed-in person, as in the reference. */
.sidenav-foot { display: flex; flex-direction: column; gap: 6px; padding-top: 10px; margin-top: 8px; border-top: 1px solid var(--rail-line); }
.rail-person { display: flex; align-items: center; gap: 4px; }
.rail-person-link { flex: 1 1 auto; min-width: 0; padding: 6px 8px !important; }
.rail-avatar {
  flex: 0 0 34px; width: 34px; height: 34px; border-radius: 999px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--brick-red), var(--fresh-orange)); color: #fff;
  font: 700 14px var(--font-body);
}
.rail-person-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.rail-person-text b { color: var(--rail-ink-strong); font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.rail-person-text small { color: #8a8f96; font-size: 12px; overflow: hidden; text-overflow: ellipsis; }
.rail-signout { margin: 0; }
.rail-signout button {
  width: 34px; height: 34px; display: grid; place-items: center;
  border: 0; border-radius: 10px; background: transparent; color: var(--rail-ink); cursor: pointer;
}
.rail-signout button svg { width: 18px; height: 18px; }
.rail-signout button:hover { background: var(--rail-hover); color: var(--brick-red); }
.rail-signout button:focus-visible { outline: 2px solid var(--brick-red); outline-offset: 1px; }

/* ----- Narrow rail: icons centred, a divider for each group, a dark tooltip on hover ----- */
:root[data-sidebar="narrow"] .sidenav { padding-left: 10px; padding-right: 10px; }
:root[data-sidebar="narrow"] .sidenav-label { height: 1px; margin: 0 14px 10px; overflow: hidden; color: transparent; background: var(--rail-line); }
:root[data-sidebar="narrow"] .sidenav a,
:root[data-sidebar="narrow"] .rail-item { justify-content: center; padding: 8px 0; }
:root[data-sidebar="narrow"] .nav-text,
:root[data-sidebar="narrow"] .rail-person-text { display: none; }
:root[data-sidebar="narrow"] .rail-person { flex-direction: column; }
:root[data-sidebar="narrow"] .rail-person-link { justify-content: center; padding: 4px 0 !important; }
:root[data-sidebar="narrow"] .sidenav .nav-badge {
  position: absolute; top: 2px; right: 6px; min-width: 18px; height: 16px; padding: 0 4px; font-size: 10px;
}
/* The tooltip is drawn by CSS from data-tip, so no label is ever guesswork. The visible
   text stays in the DOM, so screen readers still announce each destination. */
:root[data-sidebar="narrow"] [data-tip]::after {
  content: attr(data-tip);
  position: absolute; left: calc(100% + 12px); top: 50%;
  padding: 6px 10px; border-radius: 8px;
  background: #111113; color: #fff; font: 500 12.5px var(--font-body); white-space: nowrap;
  opacity: 0; transform: translate(-4px, -50%); pointer-events: none;
  transition: opacity 120ms ease, transform 120ms ease;
  z-index: 10;
}
:root[data-sidebar="narrow"] [data-tip]:hover::after,
:root[data-sidebar="narrow"] [data-tip]:focus-visible::after { opacity: 1; transform: translate(0, -50%); }
/* The scroll box would clip a tooltip, so on the narrow rail the list does not scroll
   sideways and tooltips escape it. */
:root[data-sidebar="narrow"] .sidenav-scroll { overflow: visible; }

/* The phone's menu button and brand live in the panel header; hidden on wider screens. */
.rail-open, .rail-open-brand { display: none; }
.rail-scrim { display: none; }

/* ----- Phone: the rail becomes a drawer over a scrim ----- */
@media (max-width: 767px) {
  body.has-rail { padding-left: 0; }
  body.has-rail > .topbar, body.has-rail > main, body.has-rail > footer { margin-left: 6px; margin-right: 6px; }
  body.has-rail > .topbar { display: flex; align-items: center; gap: 10px; padding: 8px 12px; }
  .rail-open {
    display: grid; place-items: center; width: 40px; height: 40px; padding: 0;
    border: 1px solid var(--rail-line); border-radius: 12px; background: var(--rail-pill); color: var(--rail-ink-strong); cursor: pointer;
  }
  .rail-open svg { width: 20px; height: 20px; }
  .rail-open:focus-visible { outline: 2px solid var(--brick-red); outline-offset: 2px; }
  .rail-open-brand { display: block; height: 26px; width: auto; margin-right: auto; }
  .sidenav {
    width: min(86vw, 280px);
    transform: translateX(-100%);
    transition: transform 200ms ease;
    box-shadow: 0 20px 50px -20px rgba(17, 17, 19, 0.45);
    background: var(--canvas);
  }
  /* The script switches a phone to the wide layout, so the drawer reuses it unchanged. */
  .rail-toggle { display: none; }
  body.rail-drawer-open .sidenav { transform: none; }
  .rail-scrim { position: fixed; inset: 0; z-index: 4800; background: rgba(17, 17, 19, 0.38); }
  body.rail-drawer-open .rail-scrim { display: block; }
  body.rail-drawer-open { overflow: hidden; }
}

@media (prefers-reduced-motion: reduce) {
  .sidenav, .sidenav a, .rail-item, body.has-rail, .rail-toggle svg, [data-tip]::after { transition: none !important; }
}

/* ---------- Layout primitives ---------- */

/* One page width everywhere: wide screens are used, with 32 px gutters
   (owner's feedback 2026-10-16: no empty bands at the sides or top). */
:root { --page-max: 1600px; }
.hero {
  padding: 24px 32px 14px;
  max-width: var(--page-max);
  margin: 0 auto;
}
.section { max-width: var(--page-max); margin: 0 auto; padding: 0 32px 20px; }
.section:last-child { padding-bottom: 48px; }

.eyebrow {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin: 0 0 10px;
}
h1 {
  font-family: var(--font-display);
  margin: 0 0 8px;
  font-size: 38px;
  letter-spacing: -0.02em;
  font-weight: 700;
  line-height: 1.08;
}
h2 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  margin: 0 0 16px;
  font-weight: 700;
}
.subtitle { color: var(--muted); margin: 0 0 4px; font-size: 15px; line-height: 1.45; max-width: 860px; }

.page-header { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }

.badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 4px 10px;
  border-radius: 999px;
}
.badge-live { background: var(--ok-bg); color: var(--ok); }
.badge-stub { background: var(--panel-2); color: var(--muted); }
.badge-mock { background: var(--warning-bg); color: var(--warning); }
.badge-alert { background: var(--critical-bg); color: var(--critical); }

/* ---------- Home: section cards ---------- */

.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; }
.section-card {
  display: block;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 26px;
  text-decoration: none;
  color: var(--text);
  box-shadow: 0 1px 3px rgba(29, 29, 31, 0.04);
  transition: box-shadow 0.2s, transform 0.2s;
}
.section-card:hover { box-shadow: 0 14px 32px rgba(29, 29, 31, 0.09); transform: translateY(-2px); }
.section-card h2 { font-family: var(--font-display); text-transform: none; letter-spacing: -0.01em; font-size: 19px; color: var(--text); margin: 0 0 8px; font-weight: 700; }
.section-card p { color: var(--muted); font-size: 14px; margin: 0 0 14px; line-height: 1.5; }
.section-card.stub { opacity: 0.68; }
.section-card.live { border-color: #f3c8bf; }

/* ---------- Stat tiles: gradient fill, big number, embedded sparkline ---------- */

.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; }

.stat-tile {
  position: relative;
  overflow: hidden;
  border-radius: 20px;
  padding: 20px 22px;
  min-height: 118px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: #fff;
  background: var(--tile-grad, linear-gradient(135deg, #3d3d3f, #232325));
}
.stat-tile.tone-red { --tile-grad: linear-gradient(135deg, #eb4a3a, #b82c1c); }
.stat-tile.tone-orange { --tile-grad: linear-gradient(135deg, #f5a53a, #ee7a27); }
.stat-tile.tone-green { --tile-grad: linear-gradient(135deg, #3fae6c, #1f7a45); }
.stat-tile.tone-dark { --tile-grad: linear-gradient(135deg, #3d3d3f, #1d1d1f); }
.stat-tile.tone-yellow { --tile-grad: linear-gradient(135deg, #ffde3d, #f0b90a); color: #201a00; }

.stat-tile-label { font-size: 12px; font-weight: 600; opacity: 0.85; letter-spacing: 0.01em; }
.stat-tile-value { font-family: var(--font-display); font-size: 30px; font-weight: 700; letter-spacing: -0.02em; margin-top: 8px; }
.stat-tile-value .unit { font-size: 15px; font-weight: 600; opacity: 0.85; margin-left: 3px; }
.stat-tile-spark { position: absolute; right: 0; bottom: 0; left: 0; height: 34px; opacity: 0.55; }
.stat-tile-spark polyline, .stat-tile-spark path { fill: none; stroke: #fff; stroke-width: 2; }

/* ---------- Fleet health donut ---------- */

.health-panel {
  display: flex;
  align-items: center;
  gap: 28px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 24px 28px;
  box-shadow: 0 1px 3px rgba(29, 29, 31, 0.04);
  flex-wrap: wrap;
}
.health-ring {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: conic-gradient(
    var(--critical) 0 var(--critical-deg, 0deg),
    var(--warning) var(--critical-deg, 0deg) var(--warning-deg, 0deg),
    var(--ok) var(--warning-deg, 0deg) 360deg
  );
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.health-ring-inner {
  width: 64px; height: 64px; border-radius: 50%;
  background: var(--panel);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.health-ring-inner .num { font-family: var(--font-display); font-size: 18px; font-weight: 700; line-height: 1; }
.health-ring-inner .label { font-size: 9px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.health-legend { display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.health-legend-item { display: flex; align-items: center; gap: 8px; }
.health-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.health-dot.ok { background: var(--ok); }
.health-dot.warning { background: var(--warning); }
.health-dot.critical { background: var(--critical); }

/* ---------- Panels (map, charts) ---------- */

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 22px 24px;
  box-shadow: 0 1px 3px rgba(29, 29, 31, 0.04);
}
.panel-title { font-size: 13px; font-weight: 700; color: var(--text); margin: 0 0 2px; }
.panel-subtitle { font-size: 12px; color: var(--muted); margin: 0 0 14px; }

.map-container { height: 320px; border-radius: 14px; overflow: hidden; background: var(--panel-2); }
.map-container.small { height: 220px; }
.leaflet-container { font-family: var(--font-body); }

.area-chart { width: 100%; height: auto; display: block; }
.area-chart .fill { opacity: 0.14; }
.area-chart .line { fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.chart-empty { color: var(--muted); font-size: 13px; padding: 40px 0; text-align: center; }

/* ---------- Alerts ---------- */

.alerts-panel { background: var(--panel); border: 1px solid var(--border); border-radius: 20px; padding: 22px 26px; box-shadow: 0 1px 3px rgba(29, 29, 31, 0.04); }
.alert-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.alert {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  border-radius: 12px;
  font-size: 14px;
  border-left: 3px solid transparent;
}
.alert-critical { background: var(--critical-bg); border-left-color: var(--critical); }
.alert-warning { background: var(--warning-bg); border-left-color: var(--warning); }
.alert-info { background: var(--info-bg); border-left-color: var(--info); }
.alert-icon { flex-shrink: 0; display: flex; }
.alert-critical .alert-icon { color: var(--critical); }
.alert-warning .alert-icon { color: var(--warning); }
.alert-info .alert-icon { color: var(--info); }
.alert-severity {
  font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.03em;
  padding: 2px 8px; border-radius: 999px; color: #fff; flex-shrink: 0;
}
.alert-critical .alert-severity { background: var(--critical); }
.alert-warning .alert-severity { background: var(--warning); }
.alert-info .alert-severity { background: var(--info); }
.alert-vehicle a { color: var(--accent); text-decoration: none; font-weight: 700; }
.alert-message { flex: 1; }
.alert-time { color: var(--muted); font-size: 12px; flex-shrink: 0; }

/* ---------- Fleet grid ---------- */

.fleet-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.vehicle-card {
  display: block;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 22px;
  text-decoration: none;
  color: var(--text);
  box-shadow: 0 1px 3px rgba(29, 29, 31, 0.04);
  transition: box-shadow 0.2s, transform 0.2s;
}
.vehicle-card:hover { box-shadow: 0 14px 32px rgba(29, 29, 31, 0.09); transform: translateY(-2px); }
.vehicle-card-top { display: flex; justify-content: space-between; align-items: flex-start; }
.vehicle-card h3 { margin: 0; font-size: 16px; font-weight: 700; letter-spacing: -0.005em; }
.vehicle-model { color: var(--muted); font-size: 13px; margin: 4px 0 18px; }

.gauge-row { display: flex; gap: 22px; align-items: center; }
.gauge {
  width: 64px; height: 64px; border-radius: 50%; flex-shrink: 0;
  background: conic-gradient(var(--gauge-color, var(--ok)) var(--gauge-deg, 0deg), var(--panel-2) 0deg);
  display: flex; align-items: center; justify-content: center;
}
.gauge-inner {
  width: 48px; height: 48px; border-radius: 50%; background: var(--panel);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700;
}
.gauge-group { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.gauge-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.03em; }

.engine-pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 700; padding: 5px 10px; border-radius: 999px;
}
.engine-pill.on { background: var(--ok-bg); color: var(--ok); }
.engine-pill.off { background: var(--panel-2); color: var(--muted); }
.engine-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.muted { color: var(--muted); }
.small { font-size: 12px; }
.count { font-weight: 400; color: var(--muted); }

/* ---------- Data tables (secondary, below the visual panels) ---------- */

.data-table { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.data-table th, .data-table td { padding: 10px 14px; text-align: left; font-size: 13px; border-bottom: 1px solid var(--border); }
.data-table th { color: var(--muted); font-weight: 700; text-transform: uppercase; font-size: 11px; letter-spacing: 0.03em; background: var(--panel-2); }
.data-table td.on { color: var(--ok); font-weight: 700; }
.data-table td.off { color: var(--muted); }
.data-table tr.row-alert td { background: var(--critical-bg); }
.data-table td.where-away { color: var(--critical); font-weight: 700; }
.data-table td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table-caption { font-size: 14px; font-weight: 700; margin: 22px 0 8px; }
.data-table tr.row-total td { background: var(--panel-2); font-weight: 700; border-top: 2px solid var(--border); }
.park-ok { color: var(--ok); font-weight: 700; }
.park-out { color: var(--critical); font-weight: 700; }
.park-unknown { color: var(--warning); font-weight: 700; }
.badge-alert-soft { background: var(--critical-bg); color: var(--critical); }
.health-chips { display: flex; gap: 12px; flex-wrap: wrap; margin: 0 0 16px; }
.health-chip { display: flex; flex-direction: column; gap: 2px; padding: 10px 16px; border-radius: 12px; border: 1px solid var(--border); background: var(--panel); min-width: 170px; }
.health-chip-name { font-size: 12px; color: var(--muted); font-weight: 600; }
.health-chip-state { font-size: 14px; font-weight: 700; }
.health-chip.chip-ok .health-chip-state { color: var(--ok); }
.health-chip.chip-fault { background: var(--critical-bg); border-color: #f3c8bf; }
.health-chip.chip-fault .health-chip-state { color: var(--critical); }

.stub-page { background: var(--panel); border: 1px solid var(--border); border-radius: 20px; padding: 32px; box-shadow: 0 1px 3px rgba(29, 29, 31, 0.04); }
.back { margin-bottom: 4px; }
.back a { color: var(--muted); text-decoration: none; font-size: 13px; }

.grid-2 { display: grid; grid-template-columns: 1.3fr 1fr; gap: 18px; align-items: start; }
@media (max-width: 860px) { .grid-2 { grid-template-columns: 1fr; } }

/* ---------- Alert history (2026-10-06) ---------- */

/* Chart-only fill for warning segments. The text-weight --warning amber is
   too close to --critical red for colour-blind readers when the two stack
   in one bar; this lighter amber passed the dataviz palette validator
   against brick red (CVD dE 17). It sits below 3:1 on white, so the chart
   always carries a legend, bar totals, hover titles and the events table. */
:root { --warning-mark: #e0a106; }

.filter-bar {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px;
  background: var(--panel); border: 1px solid var(--border); border-radius: 16px;
  padding: 14px 16px; box-shadow: 0 1px 3px rgba(29, 29, 31, 0.04);
}
.filter { display: flex; flex-direction: column; gap: 5px; font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.03em; }
.filter select, .filter input {
  font: inherit; font-size: 13px; font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--text);
  background: var(--panel-2); border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; min-width: 130px;
}
.filter-actions { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.btn {
  font: inherit; font-size: 13px; font-weight: 700; color: #fff; background: var(--text);
  border: 0; border-radius: 999px; padding: 9px 18px; cursor: pointer;
}
.btn:hover { background: #000; }
.btn-link { font-size: 13px; color: var(--muted); text-decoration: none; }
.btn-link:hover { color: var(--text); }

.panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.chart-legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); }
.legend-item { display: inline-flex; align-items: center; gap: 6px; }
.legend-swatch { width: 10px; height: 10px; border-radius: 3px; background: var(--muted); }

.bar-chart { width: 100%; height: auto; display: block; overflow: visible; }
.bar-chart .baseline { stroke: var(--border); stroke-width: 1; }
.bar-chart .hit { fill: transparent; }
.bar-chart .bar-group:hover .hit { fill: var(--panel-2); }
.bar-chart .bar-total { font-size: 12px; font-weight: 700; fill: var(--text); }
.bar-chart .bar-label { font-size: 11px; fill: var(--muted); }
.sev-critical { fill: var(--critical); background: var(--critical); }
.sev-warning { fill: var(--warning-mark); background: var(--warning-mark); }
.sev-info { fill: var(--info); background: var(--info); }

.breakdown-heading { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.03em; margin: 6px 0 8px; }
.breakdown-heading + .hbar { margin-top: 0; }
.hbar { display: grid; grid-template-columns: 120px 1fr 24px; align-items: center; gap: 10px; font-size: 13px; margin: 0 0 8px; }
.hbar + .breakdown-heading { margin-top: 18px; }
.hbar-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hbar-track { height: 8px; background: var(--panel-2); border-radius: 999px; overflow: hidden; }
.hbar-fill { display: block; height: 100%; background: #3d3d3f; border-radius: 999px; }
.hbar-count { text-align: right; font-weight: 700; }

.table-wrap { overflow-x: auto; border-radius: 14px; }
.history-table td { vertical-align: top; }
.nowrap { white-space: nowrap; }
.table-link { color: var(--accent); font-weight: 700; text-decoration: none; }
.sev-pill {
  display: inline-block; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.03em;
  padding: 2px 8px; border-radius: 999px; color: #fff;
}
.sev-pill-critical { background: var(--critical); }
.sev-pill-warning { background: var(--warning); }
.sev-pill-info { background: var(--info); }
.status-pill { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 9px; border-radius: 999px; }
.status-pill.open { background: var(--critical-bg); color: var(--critical); }
.status-pill.resolved { background: var(--ok-bg); color: var(--ok); }

.panel-link { font-size: 13px; font-weight: 600; color: var(--accent); text-decoration: none; }
.panel-link:hover { text-decoration: underline; }
.alerts-panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.alerts-panel-head h2 { margin: 0; }
.alert.is-resolved { opacity: 0.6; }

/* The events table scrolls sideways on small screens rather than
   crushing the details column into a tall sliver. */
.history-table { min-width: 1060px; }
.history-table td.details { min-width: 280px; }

@media (max-width: 640px) {
  /* SVG text scales with the chart; bump it so labels survive a phone. */
  .bar-chart .bar-label { font-size: 22px; }
  .bar-chart .bar-total { font-size: 24px; }
  .filter-actions { margin-left: 0; }
  .filter select, .filter input { min-width: 0; width: 100%; }
  .filter { flex: 1 1 140px; }
  .hbar { grid-template-columns: 96px 1fr 24px; }
}

/* ---------- Vehicle parameters and hardware capabilities (2026-10-15) ---------- */
.ts-grid-2 { gap: 18px; }
.ts-panel { padding-bottom: 14px; }
.ts-head { display: flex; justify-content: space-between; align-items: baseline; }
.ts-now { font-family: var(--font-display); font-size: 22px; font-weight: 700; }
.ts-now small { font-size: 12px; color: var(--muted); font-weight: 600; }
.ts-chart { display: block; height: auto; }
.ts-band { fill: var(--ok-bg); }
.ts-grid { stroke: var(--border); stroke-width: 1; }
.ts-label { font-size: 11px; fill: var(--muted); font-family: var(--font-body); }
.ts-line { fill: none; stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }
.fuel-raw { stroke: #b9b6ae; stroke-width: 1.2; }
.fuel-level, .cargo-level { stroke: var(--fresh-orange); }
.speed-speed { stroke: #3b5b8c; }
.volts-volts { stroke: var(--warning-mark, #e0a106); }
.sats-sats { stroke: var(--ok); }
.ts-mark line { stroke-width: 1.5; stroke-dasharray: 3 3; }
.mark-refuel line, .mark-tanking line { stroke: var(--ok); }
.mark-refuel circle, .mark-tanking circle { fill: var(--ok); }
.mark-drain line { stroke: var(--critical); }
.mark-drain circle { fill: var(--critical); }
.mark-dispensing line { stroke: #b9b6ae; }
.mark-dispensing circle { fill: #b9b6ae; }
.ts-legend { font-size: 12px; color: var(--muted); margin: 6px 0 0; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.key { display: inline-block; width: 14px; height: 3px; border-radius: 2px; margin-left: 8px; }
.key-level { background: var(--fresh-orange); }
.key-raw { background: #b9b6ae; }
.key-refuel { background: var(--ok); }
.key-drain { background: var(--critical); }

.cap-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; margin-top: 12px; }
.cap-card { background: var(--panel); border: 1px solid var(--border); border-radius: 16px; padding: 16px 18px; }
.cap-card.cap-available, .cap-card.cap-hardware, .cap-card.cap-not_used { background: var(--panel-2); }
.cap-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.cap-name { font-weight: 700; font-size: 14px; }
.cap-pill { font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 999px; white-space: nowrap; }
.pill-live { background: var(--ok-bg); color: var(--ok); }
.pill-available { background: var(--warning-bg); color: var(--warning); }
.pill-hardware { background: var(--info-bg); color: var(--info); }
.pill-not_used { background: var(--panel); color: var(--muted); border: 1px solid var(--border); }
.cap-unit { font-size: 12px; color: var(--muted); margin: 4px 0 0; }
.cap-value { font-family: var(--font-display); font-size: 15px; font-weight: 700; color: #b9b6ae; margin: 8px 0 2px; }
.cap-unlocks { font-size: 13px; margin: 8px 0 0; line-height: 1.45; }
.cap-enable { font-size: 12px; color: var(--muted); margin: 6px 0 0; line-height: 1.45; }
.cap-id { font-size: 11px; color: var(--muted); margin: 8px 0 0; }
.mark-span rect { opacity: 0.18; }
.mark-refuel.mark-span rect, .mark-tanking.mark-span rect { fill: var(--ok); }
.mark-drain.mark-span rect { fill: var(--critical); }
.mark-dispensing.mark-span rect { fill: #b9b6ae; }

/* Which data a page shows (app/__init__.py): real, imported trucks or the
   mock's practice fleet. On every page, so the two are never confused. */
.dataset-bar { border-bottom: 1px solid var(--border); font-size: 13px; }
.dataset-bar.dataset-real { background: var(--ok-bg); color: var(--ok); }
.dataset-bar.dataset-mock { background: var(--warning-bg); color: var(--warning); }
.dataset-bar-inner { max-width: var(--page-max); margin: 0 auto; padding: 8px 32px; display: flex; flex-wrap: wrap; gap: 6px 16px; justify-content: space-between; align-items: center; }
.dataset-switch { display: flex; gap: 4px; }
.dataset-switch a, .dataset-switch .current { padding: 3px 10px; border-radius: 999px; text-decoration: none; }
.dataset-switch a, .dataset-switch .switch-button { color: inherit; border: 1px solid currentColor; }
.dataset-switch .switch-button { background: none; font: inherit; padding: 3px 10px; border-radius: 999px; cursor: pointer; }
.dataset-switch .current { background: var(--panel); color: var(--text); font-weight: 600; }
@media (max-width: 640px) { .dataset-bar-inner { padding: 8px 16px; } }

/* ---------- Alert review (2026-10-16) ---------- */
.review-pill { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 9px; border-radius: 999px; white-space: nowrap; }
.review-new { background: var(--critical-bg); color: var(--critical); }
.review-checking { background: var(--warning-bg); color: var(--warning); }
.review-confirmed { background: var(--text); color: var(--panel); }
.review-false_alarm { background: var(--ok-bg); color: var(--ok); }
.badge-sev-critical { background: var(--critical-bg); color: var(--critical); }
.badge-sev-warning { background: var(--warning-bg); color: var(--warning); }
.badge-sev-info { background: var(--info-bg); color: var(--info); }
.alert-status-line { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 12px 0 0; }
.notice { padding: 10px 14px; border-radius: 10px; font-size: 14px; margin: 0 0 12px; }
.notice-ok { background: var(--ok-bg); color: var(--ok); }
.notice-warn { background: var(--warning-bg); color: var(--warning); }
.notice-error { background: var(--critical-bg); color: var(--critical); }
.alert-map { height: 360px; border-radius: 14px; overflow: hidden; border: 1px solid var(--border); }
.review-form { display: grid; gap: 14px; max-width: 640px; margin-bottom: 24px; }
.review-choices { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.review-choices legend { font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.review-choice { display: inline-flex; gap: 6px; align-items: center; padding: 8px 12px; border: 1px solid var(--border); border-radius: 999px; background: var(--panel); font-size: 14px; cursor: pointer; }
.review-field { display: grid; gap: 4px; font-size: 13px; font-weight: 600; }
.review-field textarea, .review-field input, .review-field select { font: inherit; font-weight: 400; font-size: 15px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--panel); width: 100%; }
.review-name { max-width: 320px; }
.alert-link { color: inherit; }
.tile-link { text-decoration: none; }
.eyebrow a { color: inherit; text-decoration: none; }

/* ---------- Sign-in (2026-10-16) ---------- */
.auth-box { max-width: 460px; }
.user-menu { display: flex; gap: 14px; align-items: center; font-size: 13px; margin-left: 18px; }
.user-menu a { color: var(--text); text-decoration: none; font-weight: 600; }
.inline-form { display: inline-flex; gap: 6px; align-items: center; margin: 2px 0; }
.inline-form select, .inline-form input { font: inherit; font-size: 13px; padding: 4px 8px; border: 1px solid var(--border); border-radius: 8px; background: var(--panel); }
.inline-form .btn-link { background: none; border: 0; padding: 0; cursor: pointer; font: inherit; font-size: 13px; }
.btn-small { font: inherit; font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--border); background: var(--panel); cursor: pointer; }
.btn-small:hover { border-color: var(--text); }
.auth-box .subtitle { margin-bottom: 20px; }

/* ---------- Sites map (2026-10-16) ---------- */
.sites-map { height: 460px; border-radius: 14px; overflow: hidden; border: 1px solid var(--border); }
.field-row { display: flex; gap: 12px; align-items: end; flex-wrap: wrap; }
.field-row .review-field { flex: 1 1 140px; }
.btn-small { text-decoration: none; color: var(--text); display: inline-block; }
[hidden] { display: none !important; }

/* ---------- Dark theme, page transitions, theme switch (2026-10-16) ----------
   Same tokens, darker values. Flat surfaces with hairline borders: no
   glows, no heavy shadows (owner's request). */
:root[data-theme="dark"] {
  --bg: #0f1113;
  --panel: #171a1d;
  --panel-2: #1e2125;
  --border: #2a2e33;
  --text: #eef0f2;
  --muted: #9aa0a8;
  --critical-bg: rgba(211, 59, 39, 0.16);
  --warning: #e0a63a;
  --warning-bg: rgba(224, 166, 58, 0.14);
  --info: #9fb0c8;
  --info-bg: rgba(159, 176, 200, 0.12);
  --ok: #4cbb7f;
  --ok-bg: rgba(76, 187, 127, 0.14);
  --high: #f0883e;
  --high-bg: rgba(240, 136, 62, 0.16);
  color-scheme: dark;
}
:root[data-theme="dark"] body { background: var(--bg); color: var(--text); }
:root[data-theme="dark"] .topbar { background: rgba(15, 17, 19, 0.9); border-color: var(--border); }

@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 180ms; animation-timing-function: ease-out; }
@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
  *, *::before, *::after { transition-duration: 0ms !important; animation-duration: 0ms !important; }
}


/* Phones: the menu becomes one row you can swipe sideways. */
@media (max-width: 760px) {
  .topbar { flex-wrap: wrap; row-gap: 8px; padding-top: 10px; padding-bottom: 8px; }
  .user-menu { margin-left: auto; gap: 10px; }
}
.alert-map-links { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.tk-tiles-dark { filter: invert(1) hue-rotate(180deg) brightness(0.85) contrast(0.9); }
/* One type system everywhere (22 Oct 2026): form controls and map labels use the app font,
   not the browser's Arial / MapLibre's Helvetica. */
button, input, select, textarea { font-family: inherit; }
.maplibregl-map, .leaflet-container { font-family: var(--font-body); }
small { font-size: max(11px, 0.85em); }

/* App switcher (Workforce / Inside Sales / Fleet) */
.app-switcher{position:relative;display:inline-flex}
.app-switcher[hidden]{display:none}
.app-switcher-btn{display:inline-grid;place-items:center;width:36px;height:36px;border-radius:10px;border:1px solid transparent;background:transparent;color:var(--text);opacity:.75;cursor:pointer}
.app-switcher-btn:hover,.app-switcher-btn[aria-expanded=true]{opacity:1;background:rgba(148,163,184,.16)}
.app-switcher-menu{position:absolute;right:0;top:calc(100% + 8px);z-index:5001;width:280px;max-width:calc(100vw - 24px);padding:8px;border-radius:18px;background:var(--panel,#fff);color:var(--text,#0f172a);border:1px solid rgba(148,163,184,.3);box-shadow:0 18px 40px -12px rgba(15,23,42,.28)}
.app-switcher-menu[hidden]{display:none}
.app-switcher-title{padding:6px 8px 8px;font-size:11px;font-weight:700;letter-spacing:.08em;text-transform:uppercase;opacity:.6}
.app-switcher-item{display:flex;align-items:center;gap:12px;padding:8px;border-radius:12px;color:inherit !important;text-decoration:none}
.app-switcher-item:hover{background:rgba(148,163,184,.14)}
.app-switcher-ico{display:grid;place-items:center;width:40px;height:40px;border-radius:12px;flex:none}
.app-switcher-text{display:flex;flex-direction:column;min-width:0;flex:1;line-height:1.25;font-weight:400}
.app-switcher-text strong{font-size:14px;font-weight:700}
.app-switcher-text small{font-size:12px;opacity:.65;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.app-switcher-here{color:#059669;font-weight:700}
.app-switcher-home{margin-top:6px;border-top:1px solid rgba(148,163,184,.3);border-radius:0 0 12px 12px;padding-top:12px}
@media (max-width:720px){.app-switcher-menu{position:fixed;left:12px;right:12px;top:60px;width:auto;max-width:none}}

/* ---------- Overview ---------- */
/* Follows the reference screenshot: a quiet date line, a greeting, then the whole
   operation as six plain figures divided by hairlines -- no cards, so the numbers lead. */
.ov { padding: 28px 32px 40px; max-width: 1600px; }
.ov-head { margin-bottom: 26px; }
.ov-date { margin: 0 0 6px; color: var(--muted); font: 600 11px var(--font-body); letter-spacing: 0.08em; text-transform: uppercase; }
.ov-head h1 { margin: 0; font-family: var(--font-display, var(--font-body)); font-size: clamp(28px, 3.2vw, 40px); font-weight: 500; letter-spacing: -0.02em; line-height: 1.1; color: var(--text); }
.ov-lede { margin: 8px 0 0; color: var(--muted); font-size: 14px; }

/* Six figure tiles (part 3, 16 Nov): one card each, neutral unless the value is a problem
   (is-warning / is-critical, from shared/figure.ts tileTone); the whole tile opens its source. */
.ov-stats { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin: 0 0 30px; padding: 0; list-style: none; }
.ov-stats > li { min-width: 0; }
.ov-stat { display: flex; flex-direction: column; height: 100%; box-sizing: border-box; min-width: 0; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius, 14px);
  background: var(--panel); color: inherit; text-decoration: none; }
.ov-stat:hover { border-color: color-mix(in srgb, var(--text) 25%, var(--border)); }
.ov-stat:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.ov-stat.is-warning { background: var(--warning-bg); border-color: color-mix(in srgb, var(--warning) 35%, var(--border)); }
.ov-stat.is-critical { background: var(--critical-bg); border-color: color-mix(in srgb, var(--critical) 35%, var(--border)); }
.ov-stat.is-critical .ov-value { color: var(--critical); }
.ov-stat.is-warning .ov-value { color: var(--warning); }
.ov-label { margin: 0 0 8px; color: var(--muted); font: 600 11px var(--font-body); letter-spacing: 0.07em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ov-figure { margin: 0; display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 6px; }
.ov-value { color: var(--text); font-size: clamp(24px, 2.4vw, 32px); font-weight: 700; letter-spacing: -0.02em; line-height: 1; font-variant-numeric: tabular-nums; }
.ov-unit { color: var(--muted); font-size: 13px; font-weight: 600; }
.ov-chip { align-self: center; padding: 3px 8px; border-radius: 999px; font: 700 11px var(--font-body); white-space: nowrap; }
.ov-chip-good  { background: var(--ok-bg); color: var(--ok); }
.ov-chip-watch { background: var(--warning-bg); color: var(--warning); }
.ov-chip-bad   { background: var(--critical-bg); color: var(--critical); }
.ov-chip-quiet { background: var(--panel-2); color: var(--muted); }
.ov-sub { margin: 8px 0 0; color: var(--muted); font-size: 12.5px; line-height: 1.35; }

.ov-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; align-items: start; }
.ov-panel { min-width: 0; }
.ov-stock-total { margin: 0 0 10px; color: var(--text); font-size: 24px; font-weight: 500; letter-spacing: -0.01em; }
.ov-stock-total span { color: var(--muted); font-size: 13px; font-weight: 500; letter-spacing: 0; }

@media (max-width: 1279px) {
  .ov-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ov-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 767px) {
  .ov { padding: 20px 16px 32px; }
  .ov-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .ov-stat { padding: 12px; min-height: 44px; }
  .ov-grid { grid-template-columns: minmax(0, 1fr); }
}

/* Overview: today's deliveries, worst-first attention, one colour scale for fuel and stock. */
.ov-deliveries { margin: 0 0 18px; }
.ov-del-row { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 8px 20px; margin: 2px 0 12px; }
.ov-del-total { margin: 0; color: var(--text); font-size: 15px; }
.ov-del-total b { font-size: 28px; font-weight: 500; letter-spacing: -0.02em; }
.ov-del-total span { color: var(--muted); }
.ov-del-status { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; }
.ov-del-status li { padding: 4px 10px; border-radius: 999px; background: var(--rail-hover, #ebebe8); color: var(--muted); font-size: 12.5px; }
.ov-del-status li b { color: var(--text); font-weight: 700; }
.ov-del-status .ov-del-delivered { background: var(--ok-bg); color: var(--ok); }
.ov-del-status .ov-del-delivered b { color: var(--ok); }
.ov-del-bar { height: 8px; border-radius: 999px; background: var(--rail-hover, #ebebe8); overflow: hidden; }
.ov-del-bar span { display: block; height: 100%; border-radius: inherit; background: var(--ok); min-width: 2px; }
.ov-del-sub { margin: 8px 0 0; color: var(--muted); font-size: 12.5px; }
.ov-del-owed { margin: 12px 0 0; padding: 8px 12px; border-radius: var(--radius-sm, 10px); background: var(--warning-bg); color: var(--warning); font-size: 13px; font-weight: 600; }

.ov-attn { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
/* Compact rows like the old list (owner, 16 Nov): a severity dot, a short bold title, one short
   line (two at most), so the three Overview columns keep the same row rhythm. */
.ov-attn-row { display: grid; grid-template-columns: 10px minmax(0, 1fr); gap: 10px; align-items: start; padding: 8px; min-height: 44px; box-sizing: border-box; border-radius: var(--radius-sm, 10px); color: inherit; text-decoration: none; }
.ov-attn-row:hover { background: var(--panel-2, rgba(148, 163, 184, 0.12)); }
.ov-attn-row:focus-visible { outline: 2px solid var(--text); outline-offset: 1px; }
.ov-sev { font-weight: 700; color: var(--muted); }
.ov-sev-critical .ov-sev { color: var(--critical); } .ov-sev-critical .ov-dot { background: var(--critical); }
.ov-sev-high .ov-sev { color: var(--high); } .ov-sev-high .ov-dot { background: var(--high); }
.ov-sev-medium .ov-sev { color: var(--warning); } .ov-sev-medium .ov-dot { background: var(--warning); }
.ov-sev-low .ov-dot { background: var(--info); }
.ov-attn-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ov-attn-text b { color: var(--text); font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ov-attn-text small { color: var(--muted); font-size: 12.5px; line-height: 1.35; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
.ov-more { margin: 8px 0 0 8px; font-size: 12.5px; }
.ov-more a { color: var(--muted); }

.ov-dot { width: 9px; height: 9px; margin-top: 5px; border-radius: 50%; background: #9aa0a8; flex: 0 0 9px; }
.fl-row > .ov-dot { margin-top: 0; }
/* Trucks now: the state pill (fleet-cards.ts statePill) replaces the dot, so no dot column. */
.fl-row.ov-truck-row { grid-template-columns: minmax(0, 1fr) minmax(96px, auto); }
.ov-panel .fl-row-main .fl-pill { justify-self: start; max-width: 100%; margin-top: 3px; padding-top: 2px; padding-bottom: 2px; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ov-tone-bad .ov-dot, .ov-dot.ov-tone-bad { background: var(--critical); }
.ov-tone-watch .ov-dot, .ov-dot.ov-tone-watch { background: var(--warning); }
.ov-dot.ov-tone-good { background: var(--ok); }

/* Fuel tone: one rule everywhere (shared/fuel-tone.ts; templates: `pct|fuel_tone`; browser:
   web/fuel-tone.ts). Low below 20 % (critical), watch below 35 % (warning), else ok. */
.fuel-ok { --fuel-c: var(--ok); } .fuel-watch { --fuel-c: var(--warning); } .fuel-bad { --fuel-c: var(--critical); } .fuel-none { --fuel-c: var(--muted); }
.fuel-ok .fl-fuel-bar > span, .fuel-watch .fl-fuel-bar > span, .fuel-bad .fl-fuel-bar > span, .fuel-none .fl-fuel-bar > span { background: var(--fuel-c); }
.fl-fuel.fuel-bad .fl-fuel-num, .fl-fuel.fuel-watch .fl-fuel-num { color: var(--fuel-c); }

/* Overview: today's open orders by ETA (5 Nov 2026). */
.ov-del-eta { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 0; padding: 0; list-style: none; }
.ov-del-eta a { display: inline-flex; gap: 4px; align-items: baseline; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--border); color: var(--muted); font-size: 12.5px; text-decoration: none; }
.ov-del-eta a:hover { color: var(--text); border-color: color-mix(in srgb, var(--text) 25%, var(--border)); }
.ov-del-eta b { color: var(--text); font-variant-numeric: tabular-nums; }
.ov-del-eta .is-late a { color: var(--critical); border-color: color-mix(in srgb, var(--critical) 40%, transparent); background: var(--critical-bg); } .ov-del-eta .is-late b { color: var(--critical); }
.ov-del-eta .is-risk a { color: var(--warning); border-color: color-mix(in srgb, var(--warning) 40%, transparent); background: var(--warning-bg); } .ov-del-eta .is-risk b { color: var(--warning); }
.ov-del-eta .is-ok a { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 40%, transparent); background: var(--ok-bg); } .ov-del-eta .is-ok b { color: var(--ok); }
.fl-card-today.is-none { color: var(--muted); font-style: italic; }

/* Alerts centre: fitter tickets grouped by truck (owner, 7 Nov). */
.tk-truck { border: 1px solid var(--line, #e7e3dc); border-radius: 14px; padding: 12px 14px; margin: 0 0 14px; }
.tk-truck-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-bottom: 10px; }
.tk-truck-head .vm-no { font-size: 17px; }
.tk-truck-what { color: var(--muted, #6b6b6b); flex: 1 1 260px; }
.tk-truck .tk-list { margin: 0; }
