/* WorkshopOne — Enterprise Fleet & Workshop Management Suite.
   Modern clean SaaS aesthetic: Executive navy shell, crisp slate canvas,
   electric blue accents, vibrant status indicators, and rounded cards. */

/* System-ui & local font stack (avoids external CDN font blocked by strict self CSP). */

:root {
  --graphite: #0b1424; --graphite-2: #131f37;
  --bg: #f8fafc; --surface: #ffffff; --surface-2: #f1f5f9;
  --border: #e2e8f0; --border-subtle: #edf2f7; --text: #0f172a; --muted: #64748b; --row-hover: #f8fafc;
  --primary: #0066ff; --primary-dark: #0052cc;
  --accent: #f59e0b;
  --amber: #d97706; --green: #10b981; --red: #ef4444; --violet: #6366f1; --sky: #0284c7;
  --cost-amber: #b45309; --cost-diesel: #4f46e5; --cost-driver: #be185d; --cost-pos: #047857; --cost-neg: #dc2626;
  --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05), 0 1px 2px -1px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
  --radius: 8px; --radius-lg: 12px; --radius-pill: 9999px;
  --disp: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --body: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --graphite: #070c17; --graphite-2: #0f172a;
    --bg: #0b1120; --surface: #111827; --surface-2: #1e293b;
    --border: #1f293d; --border-subtle: #172133; --text: #f1f5f9; --muted: #94a3b8; --row-hover: rgba(255,255,255,0.04);
    --primary: #3b82f6; --primary-dark: #2563eb;
    --accent: #f59e0b; --amber: #f59e0b; --green: #34d399; --red: #f87171; --violet: #818cf8; --sky: #38bdf8;
    --cost-amber: #fbbf24; --cost-diesel: #818cf8; --cost-driver: #f472b6; --cost-pos: #34d399; --cost-neg: #f87171;
    --shadow: 0 1px 3px rgba(0,0,0,.3);
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--body);
  background: var(--bg); color: var(--text); font-size: 13.5px; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; cursor: pointer; transition: color .15s; }
a:hover { color: var(--primary-dark); text-decoration: underline; }
code, .mono { font-family: var(--mono); }
h1 { font-family: var(--disp); font-weight: 700; font-size: 24px; letter-spacing: -0.01em; margin: 0 0 6px; }
h2 { font-family: var(--disp); font-weight: 700; font-size: 18px; letter-spacing: -0.01em; margin: 18px 0 8px; }
h3 { font-size: 11.5px; margin: 14px 0 6px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }

/* ---- layout ---- */
#app { min-height: 100%; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: 14px; padding: 0 20px; height: 56px;
  background: var(--graphite); border-bottom: 1px solid rgba(255,255,255,.07);
  position: sticky; top: 0; z-index: 50;
}
.topbar .brand {
  display: flex; align-items: center; gap: 8px; font-family: var(--disp);
  font-weight: 700; font-size: 19px; letter-spacing: -0.01em; color: #fff;
  white-space: nowrap; text-decoration: none;
}
.topbar .brand span { color: var(--primary); }
.topbar-site-badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1);
  border-radius: var(--radius-pill); color: #cbd5e1; font-size: 12px; font-weight: 500;
  cursor: pointer; margin-left: 6px;
}
.topbar-site-badge:hover { background: rgba(255,255,255,.1); }
.topbar-search-wrap {
  position: relative; max-width: 380px; width: 100%; margin: 0 16px;
}
.topbar-search-input {
  width: 100%; height: 34px; padding: 0 38px 0 32px;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12);
  border-radius: 8px; color: #f8fafc; font-size: 12.5px; outline: none;
  transition: all .15s ease;
}
.topbar-search-input::placeholder { color: #64748b; }
.topbar-search-input:focus {
  background: rgba(255,255,255,.12); border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(0,102,255,.25);
}
.topbar-search-icon {
  position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  color: #64748b; font-size: 12px; pointer-events: none;
}
.topbar-search-kbd {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  background: rgba(255,255,255,.12); color: #94a3b8; font-size: 10px;
  padding: 1px 5px; border-radius: 4px; font-family: var(--mono); pointer-events: none;
}
.topbar .spacer { flex: 1; }
.topbar-icon-btn {
  background: none; border: none; color: #94a3b8; width: 34px; height: 34px;
  border-radius: 8px; display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; position: relative; font-size: 16px; transition: background .15s;
}
.topbar-icon-btn:hover { background: rgba(255,255,255,.08); color: #fff; }
.topbar-badge-count {
  position: absolute; top: 4px; right: 4px; background: #ef4444; color: #fff;
  font-size: 10px; font-weight: 700; height: 16px; min-width: 16px; padding: 0 4px;
  border-radius: 9999px; display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--graphite);
}
.topbar-user-pill {
  display: flex; align-items: center; gap: 9px; padding: 3px 10px 3px 4px;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1);
  border-radius: 9999px; cursor: pointer; color: #f8fafc; transition: all .15s;
  user-select: none; position: relative;
}
.topbar-user-pill:hover { background: rgba(255,255,255,.12); }
.topbar-user-avatar {
  width: 28px; height: 28px; border-radius: 9999px; background: #2563eb;
  color: #fff; font-size: 11px; font-weight: 700; display: flex;
  align-items: center; justify-content: center; text-transform: uppercase;
}
.topbar-user-meta { display: flex; flex-direction: column; line-height: 1.15; text-align: left; }
.topbar-user-name { font-size: 12px; font-weight: 600; color: #fff; }
.topbar-user-role { font-size: 10px; color: #94a3b8; text-transform: capitalize; }

.topbar-mobile-search { display: none; }

.layout { display: flex; flex: 1; min-height: 0; position: relative; }
.nav-backdrop { display: none; }
.nav {
  width: 242px; height: calc(100vh - 56px); position: sticky; top: 56px;
  background: var(--graphite); border-right: 1px solid rgba(255,255,255,.07);
  padding: 10px 8px 10px; flex-shrink: 0; display: flex; flex-direction: column;
  overflow: hidden; transition: width .18s ease;
}
.nav-header {
  display: flex; align-items: center; gap: 6px; padding: 2px 2px 8px;
  border-bottom: 1px solid rgba(255,255,255,.07); margin-bottom: 6px; flex-shrink: 0;
}
.nav-filter-wrap { position: relative; flex: 1; min-width: 0; }
.nav-filter-ico {
  position: absolute; left: 8px; top: 50%; transform: translateY(-50%);
  font-size: 11px; color: #64748b; pointer-events: none;
}
.nav-quick-filter {
  width: 100%; height: 30px; padding: 0 22px 0 26px; font-size: 12px;
  background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.11);
  border-radius: 6px; color: #f8fafc; outline: none;
}
.nav-quick-filter::placeholder { color: #64748b; }
.nav-quick-filter:focus { background: rgba(255,255,255,.11); border-color: var(--primary); }
.nav-filter-clear {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  background: none; border: none; color: #94a3b8; font-size: 15px; line-height: 1;
  width: 20px; height: 20px; align-items: center; justify-content: center; cursor: pointer; padding: 0;
}
.nav-filter-clear:hover { color: #fff; }
.nav-collapse-btn {
  width: 30px; height: 30px; flex-shrink: 0; border-radius: 6px; cursor: pointer;
  background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.1);
  color: #cbd5e1; font-size: 14px; font-weight: 700; display: inline-flex;
  align-items: center; justify-content: center; padding: 0; transition: background .15s;
}
.nav-collapse-btn:hover { background: rgba(255,255,255,.14); color: #fff; }
.nav-mobile-ctx { display: none; margin-bottom: 8px; flex-shrink: 0; }
.nav-mobile-ctx-btn {
  width: 100%; display: flex; align-items: center; gap: 6px; padding: 8px 10px;
  background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.12);
  border-radius: 8px; color: #e2e8f0; font-size: 12px; font-weight: 600; cursor: pointer; text-align: left;
}
.nav-scroll {
  flex: 1; overflow-y: auto; overflow-x: hidden; position: relative; padding: 2px 2px 12px;
  scrollbar-width: thin; scrollbar-color: rgba(148,163,184,.25) transparent;
}
.nav-scroll::-webkit-scrollbar { width: 5px; }
.nav-scroll::-webkit-scrollbar-thumb { background: rgba(148,163,184,.25); border-radius: 99px; }
.nav-pinned-block {
  margin-bottom: 8px; padding-bottom: 8px; border-bottom: 1px solid rgba(255,255,255,.08);
}
.nav-group-static {
  display: flex; align-items: center; gap: 6px; padding: 4px 10px;
  font-size: 10px; font-weight: 700; color: #f59e0b; text-transform: uppercase; letter-spacing: .08em;
}
.nav-section { margin-bottom: 4px; }
.nav-group-btn {
  display: flex; align-items: center; gap: 7px; width: 100%; padding: 7px 10px 5px;
  font-size: 10.5px; font-weight: 700; color: #64748b; text-transform: uppercase;
  letter-spacing: .07em; background: none; border: none; border-radius: 6px;
  cursor: pointer; text-align: left; transition: color .15s, background .15s;
}
.nav-group-btn:hover { color: #cbd5e1; background: rgba(255,255,255,.04); }
.nav-group-ico { font-size: 12px; opacity: .85; flex-shrink: 0; }
.nav-group-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-group-dot {
  display: none; width: 7px; height: 7px; border-radius: 999px; background: #ef4444; flex-shrink: 0;
}
.nav-section.is-collapsed .nav-group-dot.has-badge { display: inline-block; }
.nav-chev { font-size: 11px; transition: transform .16s ease; opacity: .75; flex-shrink: 0; }
.nav-section.is-collapsed .nav-chev { transform: rotate(-90deg); }
.nav-section.is-collapsed .nav-group-items { display: none; }
.nav-item-row { display: flex; align-items: center; gap: 2px; margin-bottom: 1px; }
.nav a, .nav .nav-link {
  display: flex; align-items: center; gap: 9px; padding: 7px 10px; border-radius: 6px;
  color: #94a3b8; font-weight: 500; font-size: 13px; position: relative; flex: 1; min-width: 0;
  transition: background .14s, color .14s; text-decoration: none;
}
.nav a:hover, .nav .nav-link:hover { background: rgba(255,255,255,.07); color: #f8fafc; text-decoration: none; }
.nav a.active, .nav .nav-link.active { background: #2563eb; color: #fff; font-weight: 600; }
.nav a.active::before { display: none; }
.nav .ix { display: none; }
.nav .ico { width: 18px; text-align: center; font-size: 14px; opacity: .92; flex-shrink: 0; }
.nav-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 17px; padding: 0 5px; border-radius: 999px;
  font-size: 10px; font-weight: 700; line-height: 1; flex-shrink: 0;
}
.nav-badge.tone-red { background: #dc2626; color: #fff; }
.nav-badge.tone-amber { background: #d97706; color: #fff; }
.nav-pin-btn {
  opacity: 0; background: none; border: none; color: #64748b; font-size: 12px;
  width: 22px; height: 26px; padding: 0; cursor: pointer; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center; border-radius: 4px;
  transition: opacity .14s, color .14s;
}
.nav-item-row:hover .nav-pin-btn, .nav-pin-btn.is-pinned { opacity: 1; }
.nav-pin-btn.is-pinned { color: #f59e0b; }
.nav-pin-btn:hover { background: rgba(255,255,255,.08); color: #fbbf24; }
.nav-filter-empty { color: #64748b; font-size: 12px; text-align: center; padding: 18px 8px; }
.nav-footer {
  padding: 8px 2px 0; border-top: 1px solid rgba(255,255,255,.07); margin-top: 4px;
  display: flex; flex-direction: column; gap: 4px; flex-shrink: 0;
}
.nav-footer-btn {
  display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%;
  padding: 6px 8px; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.09);
  border-radius: 6px; color: #94a3b8; font-size: 11.5px; font-weight: 600; cursor: pointer;
}
.nav-footer-btn:hover { background: rgba(255,255,255,.11); color: #fff; }

/* Desktop compact icon-rail mode */
.layout .nav.is-compact { width: 62px; padding: 10px 6px; }
.layout .nav.is-compact .nav-header { justify-content: center; }
.layout .nav.is-compact .nav-filter-wrap,
.layout .nav.is-compact .nav-text,
.layout .nav.is-compact .nav-pin-btn,
.layout .nav.is-compact .nav-group-label,
.layout .nav.is-compact .nav-chev,
.layout .nav.is-compact .nav-footer-hint,
.layout .nav.is-compact .nav-group-static-label,
.layout .nav.is-compact .nav-badge { display: none !important; }
.layout .nav.is-compact .nav-group-btn { justify-content: center; padding: 7px 0; border-top: 1px solid rgba(255,255,255,.06); margin-top: 4px; border-radius: 4px; }
.layout .nav.is-compact .nav-group-static { justify-content: center; padding: 4px 0; }
.layout .nav.is-compact .nav-link { justify-content: center; padding: 9px 0; }
.layout .nav.is-compact .nav-link.has-live-badge::after {
  content: ''; position: absolute; top: 6px; right: 10px; width: 7px; height: 7px;
  border-radius: 999px; background: #ef4444;
}

.main-col { flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.nav-breadcrumb {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 6px 28px; background: var(--surface, #fff); border-bottom: 1px solid var(--border);
  font-size: 12px; color: var(--muted); min-height: 34px; flex-shrink: 0;
}
.bc-trail { display: flex; align-items: center; gap: 6px; min-width: 0; flex-wrap: wrap; }
.bc-group { font-weight: 600; color: var(--muted); }
.bc-sep { opacity: .55; }
.bc-page { font-weight: 600; color: var(--text); text-decoration: none; }
.bc-page:hover { color: var(--primary); text-decoration: underline; }
.bc-tab { font-weight: 600; color: var(--primary); }
.bc-detail { font-family: var(--mono); color: var(--text); font-weight: 600; }
.bc-back { font-size: 11px; padding: 2px 9px; white-space: nowrap; }
.content { flex: 1; padding: 20px 28px; min-width: 0; }

/* Command Palette (Ctrl+K) */
.cmd-palette-overlay {
  position: fixed; inset: 0; background: rgba(15,23,42,.55); z-index: 1100;
  display: flex; align-items: flex-start; justify-content: center; padding-top: 10vh;
  backdrop-filter: blur(2px);
}
.cmd-palette {
  width: min(600px, calc(100vw - 24px)); max-height: 76vh; background: var(--surface, #fff);
  border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 24px 60px rgba(15,23,42,.28);
  display: flex; flex-direction: column; overflow: hidden;
}
.cmd-input-row {
  display: flex; align-items: center; gap: 8px; padding: 10px 14px;
  border-bottom: 1px solid var(--border); background: var(--surface, #fff);
}
.cmd-search-ico { font-size: 15px; opacity: .7; }
.cmd-input {
  flex: 1; border: none; outline: none; font-size: 14px; background: transparent;
  color: var(--text); padding: 4px 0; min-width: 0;
}
.cmd-esc-btn {
  background: var(--subtle, #f1f5f9); border: 1px solid var(--border); color: var(--muted);
  font-size: 10px; font-weight: 700; padding: 3px 7px; border-radius: 5px; cursor: pointer;
}
.cmd-list { flex: 1; overflow-y: auto; padding: 6px; max-height: 420px; }
.cmd-cat {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em;
  color: var(--muted); padding: 8px 10px 4px;
}
.cmd-item {
  width: 100%; display: flex; align-items: center; gap: 10px; padding: 8px 10px;
  border: none; border-radius: 8px; background: transparent; cursor: pointer;
  text-align: left; color: var(--text); transition: background .1s;
}
.cmd-item.is-selected, .cmd-item:hover { background: rgba(37,99,235,.09); }
.cmd-item.is-selected { box-shadow: inset 3px 0 0 #2563eb; }
.cmd-ico { width: 22px; text-align: center; font-size: 15px; flex-shrink: 0; }
.cmd-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cmd-title { font-size: 13px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmd-sub { font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmd-jump { font-size: 11px; color: var(--muted); opacity: .7; }
.cmd-empty { padding: 28px 16px; text-align: center; font-size: 13px; color: var(--muted); }
.cmd-foot {
  display: flex; align-items: center; gap: 14px; padding: 7px 14px;
  border-top: 1px solid var(--border); background: var(--surface-2, #f8fafc);
  font-size: 11px; color: var(--muted);
}
.cmd-foot kbd {
  background: var(--surface, #fff); border: 1px solid var(--border); border-radius: 4px;
  padding: 1px 5px; font-family: var(--mono); font-size: 10px; margin-right: 2px;
}

/* mobile & tablet drawer */
.hamburger { display: none; background: none; border: none; color: #fff; font-size: 22px; cursor: pointer; padding: 4px 6px; }
@media (max-width: 780px) {
  .topbar-search-wrap, .topbar-site-badge, #topbar_sl_clock { display: none !important; }
  .topbar-mobile-search { display: inline-flex; }
  .topbar-user-meta { display: none; }
  .nav {
    position: fixed; top: 56px; bottom: 0; left: 0; height: auto; width: 276px; max-width: 85vw;
    z-index: 120; transform: translateX(-100%); transition: transform .2s ease; box-shadow: var(--shadow-lg);
  }
  .nav.open { transform: translateX(0); }
  .nav-backdrop.open {
    display: block; position: fixed; inset: 56px 0 0 0; background: rgba(15,23,42,.52);
    z-index: 110; backdrop-filter: blur(1px);
  }
  .nav-collapse-btn { display: none; }
  .nav-mobile-ctx { display: block; }
  .layout .nav.is-compact { width: 276px; padding: 10px 8px 14px; }
  .layout .nav.is-compact .nav-filter-wrap,
  .layout .nav.is-compact .nav-text,
  .layout .nav.is-compact .nav-pin-btn,
  .layout .nav.is-compact .nav-group-label,
  .layout .nav.is-compact .nav-chev,
  .layout .nav.is-compact .nav-footer-hint,
  .layout .nav.is-compact .nav-group-static-label { display: flex !important; }
  .layout .nav.is-compact .nav-text,
  .layout .nav.is-compact .nav-group-label,
  .layout .nav.is-compact .nav-footer-hint,
  .layout .nav.is-compact .nav-group-static-label { display: block !important; }
  .layout .nav.is-compact .nav-badge { display: inline-flex !important; }
  .layout .nav.is-compact .nav-link { justify-content: flex-start; padding: 8px 10px; }
  .layout .nav.is-compact .nav-group-btn { justify-content: flex-start; padding: 7px 10px 5px; border-top: none; margin-top: 0; }
  .hamburger { display: block; }
  .content { padding: 14px; }
  .nav-breadcrumb { padding: 6px 14px; }
}

/* ---- cards & grid ---- */
/* ---- cards & grid ---- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: 16px 18px; box-shadow: var(--shadow); position: relative;
  transition: box-shadow .15s;
}
.card:hover { box-shadow: var(--shadow-md); }

/* modern KPI stat cards */
.kpi-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: 16px 18px; box-shadow: var(--shadow); display: flex; flex-direction: column;
  gap: 3px; position: relative; transition: all .15s; cursor: pointer;
}
.kpi-card:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); border-color: #93c5fd; }
.kpi-card .kpi-label { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.kpi-card .kpi-num { font-size: 26px; font-weight: 700; color: var(--text); line-height: 1.1; margin: 3px 0; }
.kpi-card .kpi-trend { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 600; margin-top: 2px; }
.kpi-trend.up { color: #10b981; }
.kpi-trend.down { color: #ef4444; }
.kpi-trend.neutral { color: var(--muted); }

.stat { display: flex; flex-direction: column; gap: 2px; }
.stat .n { font-family: var(--disp); font-size: 32px; font-weight: 700; line-height: 1.05; letter-spacing: -0.01em; color: var(--text); }
.stat .l { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }

/* ---- tables (spec sheet) ---- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { background: var(--surface-2); color: var(--muted); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; position: sticky; top: 0; border-bottom: 1px solid var(--border); }
tbody tr:hover { background: var(--row-hover); }
td.num, th.num { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.table-wrap.scroll { max-height: 62vh; overflow-y: scroll; }
.table-wrap.no-hscroll { overflow-x: auto; }
table.fit-table { width: 100%; }
table.fit-table td, table.fit-table th { padding: 8px 12px; }
table.fit-table td.desc-col, table.fit-table th.desc-col { white-space: normal !important; overflow-wrap: break-word; line-height: 1.35; }

/* ---- badges (modern SaaS pill) ---- */
.badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 9999px;
  font-size: 11.5px; font-weight: 600; letter-spacing: .01em;
  background: var(--surface-2); color: var(--muted); border: 1px solid transparent;
}
.badge.green { background: #ecfdf5; color: #047857; border-color: #a7f3d0; }
.badge.amber { background: #fffbeb; color: #b45309; border-color: #fde68a; }
.badge.red { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }
.badge.blue { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }
.badge.violet { background: #f5f3ff; color: #6d28d9; border-color: #ddd6fe; }

/* ---- data-plate stamp (fleet codes / item numbers) ---- */
.stamp {
  display: inline-block; font-family: var(--mono); font-weight: 600; font-size: 12px; letter-spacing: .02em;
  padding: 2px 8px; border: 1px solid var(--border); border-radius: 4px;
  background: var(--surface-2); color: var(--text);
}

/* ---- forms & buttons ---- */
button, .btn {
  font: inherit; font-weight: 600; padding: 7px 14px; border-radius: 6px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer;
  transition: all .15s ease; display: inline-flex; align-items: center; gap: 6px; justify-content: center;
}
button:hover, .btn:hover { background: var(--surface-2); border-color: #cbd5e1; }
button.primary, .btn.primary { background: #0066ff; border-color: #0066ff; color: #fff; box-shadow: 0 1px 2px rgba(0,102,255,.2); }
button.primary:hover { background: #0052cc; border-color: #0052cc; box-shadow: 0 2px 4px rgba(0,102,255,.3); }
button.sm, .btn.sm { padding: 4px 10px; font-size: 12px; border-radius: 5px; }

/* ---- Modern KPI Metric Cards (Images 1, 3, 5) ---- */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.kpi-card {
  background: var(--surface, #ffffff);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 10px;
  padding: 14px 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-decoration: none;
  transition: all .15s ease;
  position: relative;
  overflow: hidden;
}
.kpi-card:hover {
  border-color: #93c5fd;
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.06), 0 2px 4px -1px rgba(0,0,0,0.04);
  transform: translateY(-1px);
}
.kpi-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.kpi-card-title {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted, #64748b);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.kpi-card-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--surface-2, #f1f5f9);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}
.kpi-card-val {
  font-size: 26px;
  font-weight: 700;
  color: var(--text, #0f172a);
  line-height: 1.1;
  margin-bottom: 4px;
}
.kpi-card-trend {
  font-size: 11.5px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 600;
}
.kpi-trend-up { color: #10b981; }
.kpi-trend-down { color: #ef4444; }
.kpi-trend-neutral { color: var(--muted, #64748b); }

/* ---- Quick Action Bar (Images 1, 3, 5) ---- */
.quick-actions-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px 14px;
  background: var(--surface, #ffffff);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 10px;
  margin-bottom: 16px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}
.quick-action-label {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--muted, #64748b);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-right: 4px;
}
.quick-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid var(--border, #e2e8f0);
  background: var(--surface-2, #f8fafc);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text, #1e293b);
  text-decoration: none;
  cursor: pointer;
  transition: all .15s ease;
}
.quick-action-btn:hover {
  background: #eff6ff;
  border-color: #93c5fd;
  color: #1d4ed8;
  text-decoration: none;
}
.quick-action-btn.primary {
  background: #0066ff;
  border-color: #0066ff;
  color: #ffffff;
}
.quick-action-btn.primary:hover {
  background: #0052cc;
  border-color: #0052cc;
  color: #ffffff;
}

/* ---- Modern Cockpit Subtabs ---- */
.cockpit-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  border-bottom: 1px solid var(--border, #e2e8f0);
  margin-bottom: 14px;
  overflow-x: auto;
}
.cockpit-tab {
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted, #64748b);
  border-bottom: 2px solid transparent;
  text-decoration: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  transition: all .15s;
}
.cockpit-tab:hover {
  color: var(--text, #0f172a);
  text-decoration: none;
}
.cockpit-tab.active {
  color: #0066ff;
  border-bottom-color: #0066ff;
}

/* ---- Equipment Hero Banner (Images 2, 3) ---- */
.equipment-hero {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: var(--surface, #ffffff);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 12px;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.equipment-hero-photo {
  width: 90px;
  height: 90px;
  border-radius: 10px;
  object-fit: cover;
  background: #e2e8f0;
  border: 1px solid var(--border, #cbd5e1);
  flex-shrink: 0;
}
.equipment-hero-info {
  flex: 1;
  min-width: 0;
}
.equipment-hero-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text, #0f172a);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.equipment-hero-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12.5px;
  color: var(--muted, #64748b);
  flex-wrap: wrap;
}

/* ---- Process Workflow Stepper (Images 1, 3, 5) ---- */
.pipeline-stepper {
  display: flex; align-items: stretch; gap: 6px; overflow-x: auto; padding: 2px 0 10px;
  margin-bottom: 14px;
}
.pipeline-step {
  flex: 1; min-width: 105px; padding: 10px 12px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 8px; text-align: center;
  position: relative; transition: all .15s; user-select: none;
}
.pipeline-step:hover { border-color: #93c5fd; }
.pipeline-step.active {
  background: #eff6ff; border-color: #3b82f6; box-shadow: 0 0 0 1px #3b82f6;
}
.pipeline-step .step-count { font-size: 18px; font-weight: 700; color: var(--text); }
.pipeline-step.active .step-count { color: #1d4ed8; }
.pipeline-step .step-title {
  font-size: 10.5px; font-weight: 600; color: var(--muted); text-transform: uppercase;
  margin-top: 2px; letter-spacing: .03em;
}

/* ---- Multi-Category Image Gallery & Lightbox Viewer (Images 2, 4) ---- */
.gallery-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px; margin-top: 14px;
}
.gallery-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  overflow: hidden; cursor: pointer; transition: all .15s; position: relative;
}
.gallery-card:hover {
  transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: #93c5fd;
}
.gallery-card img {
  width: 100%; height: 130px; object-fit: cover; display: block; background: #e2e8f0;
}
.gallery-card-meta {
  padding: 8px 10px; font-size: 11.5px; display: flex; flex-direction: column; gap: 2px;
}
.lightbox-backdrop {
  position: fixed; inset: 0; background: rgba(11, 20, 36, 0.92); z-index: 1000;
  display: flex; align-items: center; justify-content: center; backdrop-filter: blur(4px);
}
.lightbox-modal {
  background: #0f172a; border: 1px solid rgba(255,255,255,0.12); border-radius: 14px;
  width: 90vw; max-width: 1100px; height: 85vh; display: flex; overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0,0,0,0.5); color: #fff;
}
.lightbox-main {
  flex: 1; display: flex; flex-direction: column; min-width: 0; background: #070c17;
}
.lightbox-side {
  width: 320px; background: #111827; border-left: 1px solid rgba(255,255,255,0.08);
  padding: 20px; overflow-y: auto; flex-shrink: 0;
}
.lightbox-header {
  display: flex; align-items: center; justify-content: space-between; padding: 12px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.08); background: rgba(15, 23, 42, 0.7);
}
.lightbox-title { font-weight: 600; font-size: 14px; color: #f8fafc; }
.lightbox-tools { display: flex; align-items: center; gap: 8px; }
.lightbox-tool-btn {
  background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.12); color: #e2e8f0;
  border-radius: 6px; padding: 6px 10px; font-size: 13px; cursor: pointer; display: inline-flex;
  align-items: center; gap: 4px; transition: all .15s;
}
.lightbox-tool-btn:hover { background: rgba(255,255,255,0.18); color: #fff; }
.lightbox-body {
  flex: 1; display: flex; align-items: center; justify-content: center; position: relative;
  overflow: hidden; user-select: none; background: #020617;
}
.lightbox-img-wrap {
  display: flex; align-items: center; justify-content: center; width: 100%; height: 100%;
}
.lightbox-img {
  max-width: 90%; max-height: 85%; object-fit: contain; transition: transform 0.2s ease-out;
  border-radius: 4px; box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
}
.lightbox-nav-btn {
  position: absolute; top: 50%; transform: translateY(-50%); background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(255,255,255,0.15); color: #fff; width: 44px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 20px; cursor: pointer;
  transition: all .15s; z-index: 10;
}
.lightbox-nav-btn:hover { background: rgba(0, 102, 255, 0.8); border-color: #3b82f6; }
.lightbox-prev { left: 16px; }
.lightbox-next { right: 16px; }
button.sm { padding: 5px 10px; font-size: 12.5px; }
button:disabled { opacity: .5; cursor: not-allowed; }
button.danger { color: var(--red); }
/* A consequential confirm (reopen a closed card): solid, but red rather than the usual primary
   blue, so it does not read as the routine "save" button. */
button.primary.danger, .btn.primary.danger { background: var(--red); border-color: var(--red); color: #fff; }
button.primary.danger:hover { filter: brightness(.92); }
/* An inline consequence note — softer than .err, more prominent than .muted. */
.note { color: var(--muted); background: var(--surface-2); border-left: 3px solid var(--accent);
  padding: 7px 10px; border-radius: 0 4px 4px 0; margin: 8px 0; }
/* topbar chrome buttons */
.topbar button.sm { background: var(--graphite-2); border-color: #333b42; color: #c4cbd0; }
.topbar button.sm:hover { background: #2a323a; color: #fff; }
input, select, textarea {
  font: inherit; padding: 8px 10px; border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--surface); color: var(--text); width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--primary); outline-offset: -1px; border-color: var(--primary); }
label { display: block; font-size: 11.5px; color: var(--muted); margin: 8px 0 3px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.row > * { flex: 1; min-width: 120px; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.toolbar .spacer { flex: 1; }
.muted { color: var(--muted); }
.err { color: var(--red); font-weight: 600; }
.ok { color: var(--green); font-weight: 600; }

/* ---- modal ---- */
.modal-bg, .modal-backdrop { position: fixed; inset: 0; background: rgba(12,15,18,.55); display: flex; align-items: center; justify-content: center; z-index: 1000; padding: 16px; }
.modal { background: var(--surface); border-radius: var(--radius); padding: 20px; width: 100%; max-width: 520px; max-height: 90vh; overflow-y: auto; box-shadow: 0 10px 40px rgba(0,0,0,.3); border-top: 3px solid var(--accent); }
.modal h2 { margin-top: 0; }
.modal.wide { max-width: 900px; }

/* ---- New Issue dialog ----
   Numbered steps down the page instead of nested popups, then a line table so one
   trip to the store is one record. */
.istep { font-weight: 600; font-size: 13px; margin: 0 0 6px; display: flex; align-items: center; gap: 7px; }
.istep-n { display: inline-flex; align-items: center; justify-content: center; width: 19px; height: 19px;
  border-radius: 50%; background: var(--accent); color: #fff; font-size: 11px; flex-shrink: 0; }
.istep .spacer { flex: 1; }
.ni-res { max-height: 210px; overflow-y: auto; margin-top: 6px; }
.ni-res:not(:empty) { border: 1px solid var(--border); border-radius: 6px; }
.ni-hit { padding: 7px 10px; cursor: pointer; border-bottom: 1px solid var(--border); display: flex; align-items: baseline; gap: 5px; }
.ni-hit:last-child { border-bottom: 0; }
.ni-hit:hover { background: var(--surface-2); }
.ni-bal { margin-left: auto; font-family: var(--mono); font-size: 12px; color: var(--muted); flex-shrink: 0; padding-left: 10px; }
.ni-bal.ok { color: var(--success, #2a7d4f); }
/* "In store for this vehicle" — the parts already bought for it, waiting to be handed over. */
.ni-recv { max-height: 230px; overflow-y: auto; border: 1px solid var(--border); border-radius: 6px; }
.ni-recv:empty { display: none; }
.ni-mrn { font-family: var(--mono); font-size: 11.5px; background: var(--surface-2); color: var(--muted);
  border-radius: 3px; padding: 1px 5px; flex-shrink: 0; }
.ni-hit.done { opacity: .5; cursor: default; }
.ni-hit.done:hover { background: none; }
/* group heading inside the search results */
.ni-grp { font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted);
  background: var(--surface-2); padding: 4px 10px; border-bottom: 1px solid var(--border); font-weight: 600; }
.ni-tab { width: 100%; border-collapse: collapse; font-size: 13px; }
.ni-tab th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .03em;
  color: var(--muted); border-bottom: 1px solid var(--border); padding: 4px 6px; font-weight: 600; }
.ni-tab td { padding: 5px 6px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.ni-tab .r { text-align: right; }
.ni-tab .r.warn { color: var(--danger, #c4392c); font-weight: 600; }
.ni-tab input { padding: 4px 6px; font-size: 13px; }
.ni-warn td { background: #fdf3f2; color: var(--danger, #c4392c); font-size: 12px; border-bottom: 1px solid var(--border); }

/* ---- form layout inside dialogs ----
   field() emits a <label> and its control as siblings, so putting two fields straight into a
   flex/grid row splits the pairs apart. .fld keeps each pair together as one cell. */
.fld { min-width: 0; }
.fld > label { display: block; }
.fld > input, .fld > select, .fld > textarea { width: 100%; }
.fgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px 14px; align-items: end; }
.mrnsec { border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 12px; }
.mrnsec-h { font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted); border-bottom: 1px solid var(--border); padding-bottom: 6px; margin-bottom: 10px; }
.mrnline { border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: 6px;
  padding: 10px 12px; margin-bottom: 10px; background: var(--surface-2); }
.mrnline-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.mrnline-n { font-weight: 700; font-size: 12px; color: var(--muted); }

/* ---- login ---- */
.login-wrap { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 20px; }
.login-card { width: 100%; max-width: 360px; border-top: 3px solid var(--accent); }
.login-card .brand { font-family: var(--disp); font-size: 30px; font-weight: 700; text-align: center; margin-bottom: 4px; text-transform: uppercase; letter-spacing: .05em; }
.login-card .sub { text-align: center; color: var(--muted); margin-bottom: 18px; font-size: 13px; }

/* ---- misc ---- */
.pill-row { display: flex; gap: 6px; flex-wrap: wrap; }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.timeline .date { color: var(--muted); font-size: 12px; width: 92px; flex-shrink: 0; font-family: var(--mono); }
.bar { height: 8px; border-radius: 2px; background: var(--primary); }
.bar-track { background: var(--surface-2); border-radius: 2px; overflow: hidden; }
.cost-line { display: flex; justify-content: space-between; padding: 4px 0; }
.cost-line span:last-child { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.cost-line.total { border-top: 2px solid var(--graphite); font-weight: 700; font-size: 15px; margin-top: 4px; padding-top: 8px; }
.cost-line.total span { font-family: var(--disp); }
.section { margin-bottom: 20px; }
.crumb { color: var(--muted); font-size: 13px; margin-bottom: 8px; font-family: var(--mono); }

/* Sidebar group headings (SPA nav) */
.nav-group { font-size: 10px; text-transform: uppercase; letter-spacing: .1em; color: #5c666d; font-weight: 700; padding: 14px 11px 4px; }
.nav-group:first-child { padding-top: 4px; }

/* Live-update indicator (green when the realtime socket is connected) */
.live-dot { color: var(--muted); font-size: 11px; transition: color .3s; margin-right: 4px; }
body.live-connected .live-dot { color: var(--green); }

/* ---- Mobile Bottom Navigation & Touch Utilities ---- */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: 56px;
  background: var(--graphite);
  border-top: 1px solid var(--border);
  z-index: 100;
  justify-content: space-around;
  align-items: center;
  padding-bottom: env(safe-area-inset-bottom);
}
.mobile-nav-item {
  background: transparent;
  border: none;
  color: #8a949b;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  flex: 1;
  height: 100%;
  padding: 4px 0;
  cursor: pointer;
  touch-action: manipulation;
}
.mobile-nav-item .nav-icon { font-size: 18px; line-height: 1; }
.mobile-nav-item .nav-label { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.mobile-nav-item.active { color: var(--accent); }

@media (max-width: 768px) {
  .topbar { flex-wrap: nowrap; height: 56px; min-height: 56px; padding: 0 10px; gap: 6px; }
  .topbar .who { font-size: 11.5px; flex: 0 1 auto; min-width: 0; max-width: 40%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .topbar button.sm { min-height: 32px; padding: 4px 9px; font-size: 11.5px; }
  .layout { flex-direction: column; padding-bottom: 62px; }
  .mobile-bottom-nav.has-session { display: flex; }
  .main { padding: 12px; }
  .nav-breadcrumb { padding: 6px 12px; }
  button, input, select { min-height: 44px; } /* Minimum touch target size */
  .nav .nav-group-btn, .nav .nav-footer-btn { min-height: 38px; }
  .nav .nav-pin-btn, .nav .nav-filter-clear, .nav .nav-quick-filter { min-height: 28px; }
  .grid { grid-template-columns: 1fr !important; }
  .table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }
}

/* ---- fitting the screen the workshop actually has -------------------------

   The roomy layout needs about 1455px before a wide table starts running off the side of its box.
   Measured on the live job list (500 rows, 11 columns), how much was cut off and unreachable
   except by scrolling the table sideways — with nothing on screen saying it was there:

       screen   1920    1440    1366    1280    1024
       before      0     88px   162px   350px   606px

   These tiers give the width back. Above 1500px nothing changes: the roomy layout is still the
   roomy layout, because it was never the problem.

   THE LEVER IS LETTING CELLS WRAP. That takes the job list's minimum from 1313px to 1082px and the
   stores list's from 1342px to 896px — far more than shaving padding ever could. It sounds like
   the mistake the note above warns about, and it is not: that disaster was `table-layout: fixed`,
   which gives every column an equal share and then crushes the long ones. Columns still size to
   their contents here; they are simply allowed to take a second line when the content is long.

   Measured, not assumed — 500 job rows at 1024px, base vs wrapped:
       tallest row   190px -> 171px          (better)
       rows > 100px     34 -> 23             (better)
       rows > 200px      0 -> 0
       clipped cells     0 -> 0
   Wrapping makes rows SHORTER here, because the smaller type buys back more than the extra lines
   cost. Re-measure the same way before touching these numbers.

   Floored at 781px so the phone rules keep the last word. These blocks are at the END of the file
   (they must be, to override the base table rules) — which also means that without a floor they
   would match a 375px screen and beat the phone layout that appears earlier.

   1024x768 still scrolls, by choice. Eleven columns in 1009px is not a readable table at any type
   size — the honest answer there is a scrollbar, which .table-wrap gives (auto, never hidden). */

@media (min-width: 781px) and (max-width: 1500px) {
  /* Fits 1440 and 1366 exactly — at 1366 the job list needs 1126px and gets 1126px. */
  .nav { width: 176px; padding: 10px 7px; }
  .nav a { padding: 8px 9px; font-size: 13px; gap: 8px; }
  .content { padding: 14px 16px; }
  table { font-size: 12px; }
  table.fit-table td, table.fit-table th {
    padding: 4px 6px;
    /* overflow-wrap, NEVER word-break — see the note on .desc-col above for what word-break did to
       a "200 Breaker" plate. */
    white-space: normal; overflow-wrap: break-word;
  }
}

@media (min-width: 781px) and (max-width: 1300px) {
  /* 1280 needs another 42px to clear. The rail keeps its labels: an icon-only strip would save
     another 120px and cost anyone who does not already know the menu by heart. */
  .nav { width: 160px; padding: 8px 6px; }
  .nav a { padding: 7px 8px; font-size: 12.5px; }
  .nav .ix { display: none; }
  .content { padding: 10px 12px; }
  table.fit-table td, table.fit-table th { padding: 3px 5px; }
}

/* ---- Material Pipeline Cockpit Styles ---- */
.pipe-card-active {
  border-color: var(--accent) !important;
  background: var(--surface-2) !important;
  box-shadow: 0 0 0 1px var(--accent), var(--shadow) !important;
}
.pipe-card-active::before {
  background: var(--accent) !important;
  height: 4px !important;
}
.pipe-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 7px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.pipe-badge.avail {
  background: rgba(60, 125, 90, .14);
  color: var(--green);
  border: 1px solid rgba(60, 125, 90, .3);
}
.pipe-badge.order {
  background: rgba(29, 90, 115, .14);
  color: var(--primary);
  border: 1px solid rgba(29, 90, 115, .3);
}
.pipe-badge.pend {
  background: rgba(154, 110, 0, .14);
  color: var(--amber);
  border: 1px solid rgba(154, 110, 0, .3);
}


/* Stores: how far a requested item has come (stores plan, Part 1). */
.road { display: flex; gap: 2px; margin-bottom: 2px; }
.road .rd { font-size: 10px; line-height: 1; padding: 3px 5px; border-radius: 3px; border: 1px solid var(--border); color: var(--text-muted, #6a7379); background: transparent; white-space: nowrap; }
.road .rd-done { background: rgba(60,125,90,.15); color: var(--green); border-color: transparent; }
.road .rd-part { background: rgba(242,169,0,.18); color: var(--amber); border-color: transparent; }
.road .rd-now { border-color: var(--blue, #1d5a73); color: var(--blue, #1d5a73); font-weight: 700; }
.road .rd-stop { background: rgba(196,57,44,.12); color: var(--red); border-color: transparent; }

/* ---- SAP Fiori Horizon Enterprise Design System (sapui5 & sap-fiori-tools) ---- */
:root {
  --sapBrandColor: #0070f2;
  --sapHighlightColor: #0070f2;
  --sapNeutralColor: #6a7379;
  --sapPositiveColor: #2b7c2b;
  --sapCriticalColor: #e9730c;
  --sapNegativeColor: #bb0000;
  --sapInformationColor: #0070f2;
  --sapTableRowHeightCompact: 32px;
}

.sap-object-header {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}
.sap-object-header-title {
  font-size: 20px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}
.sap-kpi-badge {
  display: inline-flex;
  flex-direction: column;
  padding: 8px 12px;
  background: var(--surface-2);
  border-radius: var(--radius);
  min-width: 90px;
}
.sap-kpi-badge .kpi-label {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  font-weight: 600;
}
.sap-kpi-badge .kpi-val {
  font-size: 18px;
  font-weight: 700;
  margin-top: 2px;
}
.sap-table-compact table td, .sap-table-compact table th {
  padding: 6px 10px;
  font-size: 12.5px;
}
.sap-status-positive { color: var(--sapPositiveColor); font-weight: 600; }
.sap-status-critical { color: var(--sapCriticalColor); font-weight: 600; }
.sap-status-negative { color: var(--sapNegativeColor); font-weight: 600; }
.sap-status-info { color: var(--sapInformationColor); font-weight: 600; }

