/* ============================================================
   Henro Bulk TMS — design system
   Brand: electric blue #2872fa on deep navy, logo red reserved
   for the mark + critical states. Inter (UI) + Space Grotesk (display).
   ============================================================ */

:root {
  --brand: #2872fa;
  --brand-deep: #1559ed;
  --brand-soft: #e8f0fe;
  --red: #d92632;
  --red-soft: #fdecec;
  --navy-950: #0b1220;
  --navy-900: #0f1826;
  --navy-800: #14202f;
  --navy-700: #192a3d;
  --slate: #3a4f66;
  --ink: #17222e;
  --muted: #64748c;
  --faint: #94a3b8;
  --bg: #f2f5f8;
  --card: #ffffff;
  --line: #e2e8f0;
  --line-soft: #edf2f7;
  --ok: #119a58;
  --ok-soft: #e5f7ee;
  --warn: #d97d06;
  --warn-soft: #fdf3e2;
  --teal: #0e9fb5;
  --teal-soft: #e3f6f9;
  --purple: #7c5cd6;
  --purple-soft: #f0ebfc;
  --shadow-sm: 0 1px 2px rgba(15, 30, 50, .05), 0 1px 6px rgba(15, 30, 50, .04);
  --shadow-md: 0 4px 14px rgba(15, 30, 50, .08), 0 1px 4px rgba(15, 30, 50, .05);
  --shadow-lg: 0 18px 50px rgba(10, 22, 40, .18);
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --sidebar-w: 254px;
  --topbar-h: 62px;
  --font: 'Inter', -apple-system, 'Segoe UI', Roboto, sans-serif;
  --display: 'Space Grotesk', 'Inter', sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  font-size: 14px;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
h1, h2, h3, h4 { font-family: var(--display); letter-spacing: -0.01em; color: var(--navy-700); }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: inherit; }
::selection { background: var(--brand); color: #fff; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #c6d0dc; border-radius: 6px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #a8b6c6; border: 2px solid transparent; background-clip: content-box; }

/* ---------- app shell ---------- */
#app { min-height: 100vh; }
.shell { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }

.sidebar {
  background: linear-gradient(180deg, var(--navy-800) 0%, var(--navy-950) 100%);
  color: #cdd8e4;
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
  z-index: 40;
}
.sidebar-brand {
  display: flex; align-items: center; gap: 12px;
  padding: 18px 18px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, .07);
}
.sidebar-brand .logo-chip {
  width: 42px; height: 42px; border-radius: 11px;
  background: #fff;
  display: grid; place-items: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .35);
  flex-shrink: 0;
}
.sidebar-brand .logo-chip img { width: 32px; height: auto; }
.sidebar-brand .brand-name { font-family: var(--display); font-weight: 700; font-size: 16px; color: #fff; line-height: 1.15; }
.sidebar-brand .brand-sub { font-size: 10.5px; color: #7e93aa; letter-spacing: .12em; text-transform: uppercase; font-weight: 600; }

.nav { flex: 1; overflow-y: auto; padding: 14px 12px; }
.nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.14); border: 2px solid transparent; background-clip: content-box; }
.nav-section { font-size: 10px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: #61758c; padding: 14px 10px 6px; }
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 8.5px 10px; margin: 1px 0;
  border-radius: 9px;
  color: #b3c2d1; font-size: 13.5px; font-weight: 500;
  cursor: pointer; user-select: none;
  transition: background .15s, color .15s, transform .12s;
  position: relative;
}
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; opacity: .8; }
.nav-item:hover { background: rgba(255, 255, 255, .06); color: #fff; text-decoration: none; }
.nav-item.active {
  background: linear-gradient(90deg, rgba(40, 114, 250, .28), rgba(40, 114, 250, .10));
  color: #fff;
}
.nav-item.active::before {
  content: ''; position: absolute; left: -12px; top: 6px; bottom: 6px; width: 3px;
  background: var(--brand); border-radius: 0 3px 3px 0;
}
.nav-item.active svg { opacity: 1; color: #6ea2ff; }
.nav-item .nav-badge {
  margin-left: auto; background: var(--red); color: #fff;
  font-size: 10.5px; font-weight: 700; min-width: 18px; height: 18px;
  display: grid; place-items: center; border-radius: 9px; padding: 0 5px;
}
.sidebar-foot { padding: 12px 16px; border-top: 1px solid rgba(255,255,255,.07); font-size: 11px; color: #61758c; }
.sidebar-foot b { color: #8ba1b8; }

/* ---------- topbar ---------- */
.main { display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: var(--topbar-h);
  background: rgba(255, 255, 255, .88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 14px;
  padding: 0 22px;
  position: sticky; top: 0; z-index: 30;
}
.topbar .page-title { font-size: 17px; font-weight: 700; }
.topbar .crumb { color: var(--faint); font-size: 12.5px; }
.top-search {
  margin-left: auto;
  display: flex; align-items: center; gap: 8px;
  background: var(--bg); border: 1px solid var(--line);
  border-radius: 9px; padding: 7px 12px; width: 280px;
  color: var(--muted); font-size: 13px; cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
}
.top-search svg { width: 16px; height: 16px; flex-shrink: 0; }
.top-search span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-icon svg { width: 19px; height: 19px; }
.top-search:hover { border-color: #c3d2e2; }
.top-search kbd {
  margin-left: auto; background: #fff; border: 1px solid var(--line);
  border-radius: 5px; padding: 1px 6px; font-size: 10.5px; color: var(--faint);
  font-family: inherit;
}
.top-icon {
  position: relative;
  width: 38px; height: 38px; border-radius: 10px;
  display: grid; place-items: center;
  border: 1px solid var(--line); background: #fff; color: var(--slate);
  cursor: pointer; transition: all .15s;
}
.top-icon:hover { border-color: var(--brand); color: var(--brand); }
.top-icon .dot {
  position: absolute; top: 7px; right: 8px; width: 8px; height: 8px;
  background: var(--red); border-radius: 50%; border: 2px solid #fff;
}
.user-pill { display: flex; align-items: center; gap: 10px; cursor: pointer; padding: 5px 6px 5px 5px; border-radius: 11px; transition: background .15s; }
.user-pill:hover { background: var(--line-soft); }
.avatar {
  width: 34px; height: 34px; border-radius: 9px;
  background: linear-gradient(135deg, var(--brand), var(--brand-deep));
  color: #fff; display: grid; place-items: center;
  font-weight: 700; font-size: 13px;
}
.user-pill .u-name { font-size: 13px; font-weight: 600; line-height: 1.1; }
.user-pill .u-role { font-size: 11px; color: var(--faint); text-transform: capitalize; }

/* ---------- content ---------- */
.content { flex: 1; padding: 22px 24px 40px; max-width: 1560px; width: 100%; margin: 0 auto; }
.view { animation: viewIn .34s cubic-bezier(.21, .8, .35, 1); }
@keyframes viewIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.page-head { display: flex; align-items: flex-end; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h1 { font-size: 22px; }
.page-head .sub { color: var(--muted); font-size: 13px; margin-top: 3px; }
.page-head .actions { margin-left: auto; display: flex; gap: 9px; align-items: center; flex-wrap: wrap; }

/* ---------- cards ---------- */
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--shadow-sm);
  transition: box-shadow .2s;
}
.card.pad { padding: 18px; }
.card-h {
  display: flex; align-items: center; gap: 10px;
  padding: 15px 18px; border-bottom: 1px solid var(--line-soft);
}
.card-h h3 { font-size: 14.5px; font-weight: 700; }
.card-h .spacer { margin-left: auto; }
.card-h .hint { color: var(--faint); font-size: 12px; }
.card-b { padding: 16px 18px; }

/* ---------- KPI tiles ---------- */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(178px, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 15px 16px 13px; box-shadow: var(--shadow-sm);
  position: relative; overflow: hidden;
  transition: transform .18s, box-shadow .18s;
}
.kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.kpi::after {
  content: ''; position: absolute; inset: 0 0 auto 0; height: 3px;
  background: var(--kpi-accent, var(--brand));
  opacity: .9;
}
.kpi .k-label { font-size: 11.5px; font-weight: 600; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; display: flex; align-items: center; gap: 6px; }
.kpi .k-value { font-family: var(--display); font-size: 25px; font-weight: 700; color: var(--navy-700); margin-top: 5px; font-variant-numeric: tabular-nums; line-height: 1.15; }
.kpi .k-value small { font-size: 14px; color: var(--faint); font-weight: 600; }
.kpi .k-sub { font-size: 11.5px; color: var(--faint); margin-top: 3px; display: flex; align-items: center; gap: 6px; }
.delta { font-weight: 700; font-size: 11px; padding: 1px 7px; border-radius: 20px; }
.delta.up { color: var(--ok); background: var(--ok-soft); }
.delta.down { color: var(--red); background: var(--red-soft); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: 1px solid transparent; border-radius: 9px;
  font-size: 13px; font-weight: 600; cursor: pointer;
  padding: 8.5px 15px; line-height: 1.2;
  transition: all .16s; user-select: none; white-space: nowrap;
}
.btn svg { width: 15px; height: 15px; }
.btn-primary {
  background: linear-gradient(135deg, var(--brand), var(--brand-deep));
  color: #fff; box-shadow: 0 2px 8px rgba(40, 114, 250, .35);
}
.btn-primary:hover { filter: brightness(1.07); box-shadow: 0 4px 14px rgba(40, 114, 250, .42); transform: translateY(-1px); }
.btn-ghost { background: #fff; border-color: var(--line); color: var(--slate); }
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { filter: brightness(1.08); }
.btn-soft { background: var(--brand-soft); color: var(--brand-deep); }
.btn-soft:hover { background: #d9e7fd; }
.btn-sm { padding: 5.5px 11px; font-size: 12px; border-radius: 7px; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none !important; }
.btn.block { width: 100%; }

/* ---------- forms ---------- */
.field { margin-bottom: 13px; }
.field label { display: block; font-size: 12px; font-weight: 600; color: var(--slate); margin-bottom: 5px; }
.field .req { color: var(--red); }
.input, select.input, textarea.input {
  width: 100%; border: 1px solid var(--line); border-radius: 9px;
  padding: 8.5px 12px; font-size: 13.5px; font-family: inherit;
  background: #fff; color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
.input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(40, 114, 250, .13); }
.input::placeholder { color: var(--faint); }
textarea.input { resize: vertical; min-height: 74px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.form-grid .full { grid-column: 1 / -1; }
.checkbox-row { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--slate); margin: 4px 0 12px; cursor: pointer; }
.checkbox-row input { width: 16px; height: 16px; accent-color: var(--brand); }
.input-note { font-size: 11.5px; color: var(--faint); margin-top: 4px; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; border-radius: 0 0 var(--r-lg) var(--r-lg); }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th {
  text-align: left; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted); padding: 10px 14px; border-bottom: 1px solid var(--line);
  background: #f8fafc; position: sticky; top: 0; white-space: nowrap; cursor: pointer; user-select: none;
}
.tbl th.sorted { color: var(--brand); }
.tbl th .arr { font-size: 9px; margin-left: 3px; }
.tbl td { padding: 10.5px 14px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; white-space: nowrap; }
.tbl tbody tr { transition: background .12s; }
.tbl tbody tr:hover { background: #f6f9fe; }
.tbl tbody tr.clickable { cursor: pointer; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl .main-cell { font-weight: 600; color: var(--navy-700); }
.tbl .sub-cell { font-size: 11.5px; color: var(--faint); }
.tbl-foot { display: flex; align-items: center; gap: 10px; padding: 10px 16px; font-size: 12px; color: var(--muted); }

/* ---------- chips / status ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 700; letter-spacing: .02em;
  border-radius: 20px; padding: 3px 9px; white-space: nowrap;
}
.chip::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip.plain::before { display: none; }
.c-blue { background: var(--brand-soft); color: var(--brand-deep); }
.c-navy { background: #e5eaf2; color: var(--navy-700); }
.c-green { background: var(--ok-soft); color: var(--ok); }
.c-amber { background: var(--warn-soft); color: var(--warn); }
.c-red { background: var(--red-soft); color: var(--red); }
.c-grey { background: #eef1f5; color: var(--muted); }
.c-teal { background: var(--teal-soft); color: var(--teal); }
.c-purple { background: var(--purple-soft); color: var(--purple); }
.chip.live::before { animation: pulse 1.6s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .45; transform: scale(.8); } }

.hazchem-tag {
  display: inline-flex; align-items: center; gap: 4px;
  background: #fff7e6; border: 1px solid #f3ce7f; color: #9a6a00;
  font-size: 10px; font-weight: 800; border-radius: 5px; padding: 1px 6px; letter-spacing: .04em;
}
.xborder-tag {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--teal-soft); border: 1px solid #a8dde6; color: var(--teal);
  font-size: 10px; font-weight: 800; border-radius: 5px; padding: 1px 6px; letter-spacing: .04em;
}

/* ---------- modal / drawer ---------- */
.overlay {
  position: fixed; inset: 0; background: rgba(11, 18, 32, .5);
  backdrop-filter: blur(3px); z-index: 90;
  display: grid; place-items: center;
  animation: fadeIn .18s;
}
@keyframes fadeIn { from { opacity: 0; } }
.modal {
  background: #fff; border-radius: var(--r-lg); box-shadow: var(--shadow-lg);
  width: min(620px, calc(100vw - 40px)); max-height: calc(100vh - 70px);
  display: flex; flex-direction: column;
  animation: modalIn .26s cubic-bezier(.2, .9, .3, 1.05);
}
.modal.wide { width: min(860px, calc(100vw - 40px)); }
@keyframes modalIn { from { opacity: 0; transform: translateY(16px) scale(.98); } }
.modal-h { display: flex; align-items: center; gap: 10px; padding: 17px 20px 13px; border-bottom: 1px solid var(--line-soft); }
.modal-h h3 { font-size: 16px; }
.modal-h .x { margin-left: auto; }
.modal-b { padding: 17px 20px; overflow-y: auto; }
.modal-f { display: flex; gap: 10px; justify-content: flex-end; padding: 13px 20px; border-top: 1px solid var(--line-soft); }
.x-btn {
  width: 30px; height: 30px; border-radius: 8px; border: none; background: transparent;
  color: var(--faint); cursor: pointer; display: grid; place-items: center; font-size: 17px;
}
.x-btn:hover { background: var(--line-soft); color: var(--ink); }

.drawer-wrap { position: fixed; inset: 0; z-index: 85; }
/* The overlay is a SIBLING of the drawer here (unlike modals, where it is the
   parent), so it must sit below it — otherwise the drawer renders behind the
   dim + blur and every click inside it lands on the close handler. */
.drawer-wrap .overlay { animation: fadeIn .2s; place-items: unset; z-index: 1; }
.drawer {
  position: absolute; top: 0; right: 0; bottom: 0;
  z-index: 2;
  width: min(560px, 94vw); background: #fff;
  box-shadow: -18px 0 50px rgba(10, 22, 40, .22);
  display: flex; flex-direction: column;
  animation: drawerIn .3s cubic-bezier(.2, .85, .3, 1);
}
@keyframes drawerIn { from { transform: translateX(60px); opacity: 0; } }
.drawer-h { padding: 18px 22px 14px; border-bottom: 1px solid var(--line-soft); display: flex; align-items: flex-start; gap: 10px; }
.drawer-b { flex: 1; overflow-y: auto; padding: 18px 22px; }

/* ---------- toasts ---------- */
.toasts { position: fixed; bottom: 22px; right: 22px; z-index: 120; display: flex; flex-direction: column; gap: 9px; }
.toast {
  background: var(--navy-800); color: #fff; border-radius: 11px;
  padding: 12px 16px; font-size: 13px; min-width: 250px; max-width: 380px;
  box-shadow: var(--shadow-lg); display: flex; gap: 10px; align-items: flex-start;
  animation: toastIn .3s cubic-bezier(.2, .9, .3, 1.1);
  border-left: 3px solid var(--brand);
}
.toast.ok { border-left-color: var(--ok); }
.toast.err { border-left-color: var(--red); }
.toast.warn { border-left-color: var(--warn); }
.toast b { font-weight: 700; }
.toast .t-sub { color: #a8b8c9; font-size: 12px; margin-top: 2px; }
@keyframes toastIn { from { opacity: 0; transform: translateX(30px); } }
.toast.out { animation: toastOut .25s forwards; }
@keyframes toastOut { to { opacity: 0; transform: translateX(30px); } }

/* ---------- login ---------- */
.login-page { min-height: 100vh; display: grid; grid-template-columns: 1.15fr 1fr; }
.login-hero {
  background:
    radial-gradient(900px 500px at 8% -10%, rgba(40, 114, 250, .32), transparent 55%),
    radial-gradient(700px 500px at 95% 108%, rgba(14, 159, 181, .17), transparent 55%),
    linear-gradient(160deg, var(--navy-800), var(--navy-950) 70%);
  color: #fff; position: relative; overflow: hidden;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 44px 52px;
}
.login-hero .grid-dots {
  position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, .07) 1px, transparent 1.4px);
  background-size: 26px 26px;
  mask-image: radial-gradient(700px 500px at 40% 40%, #000 30%, transparent 75%);
}
.login-brand { display: flex; align-items: center; gap: 14px; position: relative; }
.login-brand .logo-chip { width: 52px; height: 52px; border-radius: 13px; background: #fff; display: grid; place-items: center; box-shadow: 0 6px 24px rgba(0,0,0,.4); }
.login-brand .logo-chip img { width: 40px; }
.login-brand .n { font-family: var(--display); font-weight: 700; font-size: 21px; }
.login-brand .s { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: #8ba1b8; font-weight: 600; }
.login-hero-mid { position: relative; }
.login-hero-mid h1 { color: #fff; font-size: clamp(26px, 3.2vw, 40px); line-height: 1.14; letter-spacing: -0.02em; max-width: 520px; }
.login-hero-mid h1 .hl { color: #6ea2ff; }
.login-hero-mid p { color: #a8b8c9; margin-top: 14px; max-width: 460px; font-size: 14.5px; }
.login-stats { display: flex; gap: 34px; margin-top: 30px; }
.login-stats .st b { font-family: var(--display); font-size: 22px; display: block; color: #fff; }
.login-stats .st span { font-size: 12px; color: #8ba1b8; }
.login-foot { font-size: 12px; color: #61758c; position: relative; }
#login-map { position: absolute; right: -40px; bottom: -30px; width: 520px; opacity: .8; pointer-events: none; }

.login-panel { display: grid; place-items: center; padding: 40px 24px; background: var(--bg); }
.login-card { width: min(400px, 100%); }
.login-card h2 { font-size: 22px; margin-bottom: 4px; }
.login-card .sub { color: var(--muted); font-size: 13.5px; margin-bottom: 24px; }
.login-card .card { padding: 26px 26px 22px; }
.login-err {
  background: var(--red-soft); color: var(--red); border: 1px solid #f5c2c2;
  font-size: 12.5px; padding: 9px 12px; border-radius: 8px; margin-bottom: 12px; display: none;
}
.demo-creds { margin-top: 16px; }
.demo-creds summary { font-size: 12px; color: var(--muted); cursor: pointer; user-select: none; }
.demo-creds .dc-row {
  display: flex; justify-content: space-between; gap: 8px;
  font-size: 12px; padding: 5px 8px; border-radius: 6px; cursor: pointer; color: var(--slate);
}
.demo-creds .dc-row:hover { background: var(--brand-soft); color: var(--brand-deep); }
.demo-creds .dc-row b { font-weight: 600; }
.demo-creds .dc-row span { color: var(--faint); text-transform: capitalize; }

/* ---------- dashboard specifics ---------- */
.dash-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 16px; }
.dash-grid > .card { min-width: 0; }
.dash-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

.ops-map-card {
  background: linear-gradient(165deg, var(--navy-800), var(--navy-950));
  border: 1px solid #223349; border-radius: var(--r-lg);
  color: #cdd8e4; overflow: hidden; position: relative;
}
.ops-map-card .card-h { border-bottom-color: rgba(255, 255, 255, .07); }
.ops-map-card .card-h h3 { color: #fff; }
.ops-map-card .legend { display: flex; gap: 14px; font-size: 11px; color: #8ba1b8; }
.ops-map-card .legend i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 5px; }
#ops-map svg { display: block; width: 100%; height: auto; }
.map-tip {
  position: absolute; pointer-events: none; z-index: 5;
  background: rgba(9, 16, 28, .94); border: 1px solid #2d4258;
  color: #e6eef7; font-size: 11.5px; border-radius: 8px; padding: 7px 10px;
  opacity: 0; transition: opacity .12s; max-width: 240px;
}
.map-tip b { color: #6ea2ff; }

.live-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.live-row:last-child { border-bottom: none; }
.live-row .lr-icon { width: 34px; height: 34px; border-radius: 9px; background: var(--brand-soft); color: var(--brand-deep); display: grid; place-items: center; flex-shrink: 0; }
.live-row .lr-main { min-width: 0; flex: 1; }
.live-row .lr-title { font-weight: 600; font-size: 13px; color: var(--navy-700); }
.live-row .lr-sub { font-size: 11.5px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.progress {
  height: 6px; background: var(--line-soft); border-radius: 4px; overflow: hidden; min-width: 70px;
}
.progress i {
  display: block; height: 100%; border-radius: 4px;
  background: linear-gradient(90deg, var(--brand), #6ea2ff);
  transition: width .8s cubic-bezier(.2, .8, .3, 1);
}
.alert-row { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line-soft); align-items: flex-start; }
.alert-row:last-child { border-bottom: none; }
.alert-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 5px; flex-shrink: 0; }
.alert-dot.critical { background: var(--red); box-shadow: 0 0 0 3px var(--red-soft); }
.alert-dot.warning { background: var(--warn); box-shadow: 0 0 0 3px var(--warn-soft); }
.alert-dot.info { background: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.alert-row .a-title { font-size: 12.5px; font-weight: 600; color: var(--navy-700); line-height: 1.3; }
.alert-row .a-sub { font-size: 11.5px; color: var(--faint); }

.activity-row { display: flex; gap: 10px; padding: 8px 0; font-size: 12.5px; border-bottom: 1px solid var(--line-soft); }
.activity-row:last-child { border: none; }
.activity-row .when { color: var(--faint); font-size: 11px; margin-left: auto; white-space: nowrap; }

/* ---------- planner board ---------- */
.planner-grid { display: grid; grid-template-columns: 1.25fr 1fr 1fr; gap: 14px; align-items: start; }
.plan-col .card-h { position: sticky; top: var(--topbar-h); background: #fff; z-index: 5; border-radius: var(--r-lg) var(--r-lg) 0 0; }
.plan-card {
  border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 11px 13px; margin: 9px 12px; background: #fff;
  cursor: grab; transition: all .15s; position: relative;
}
.plan-card:hover { border-color: var(--brand); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.plan-card.selected { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 3px rgba(40,114,250,.12); }
.plan-card .pc-top { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 13px; color: var(--navy-700); }
.plan-card .pc-route { font-size: 12px; color: var(--slate); margin-top: 3px; }
.plan-card .pc-meta { display: flex; gap: 8px; margin-top: 7px; flex-wrap: wrap; align-items: center; font-size: 11px; color: var(--faint); }
.res-row {
  display: flex; align-items: center; gap: 10px; padding: 8px 14px;
  border-bottom: 1px solid var(--line-soft); font-size: 12.5px; cursor: pointer;
  transition: background .12s;
}
.res-row:hover { background: #f6f9fe; }
.res-row.selected { background: var(--brand-soft); }
.res-row .rr-ic { width: 30px; height: 30px; border-radius: 8px; background: var(--line-soft); display: grid; place-items: center; color: var(--slate); flex-shrink: 0; }
.res-row.selected .rr-ic { background: var(--brand); color: #fff; }
.res-row b { font-size: 13px; }
.res-row .rr-sub { color: var(--faint); font-size: 11.5px; }
.assemble-bar {
  position: sticky; bottom: 14px; z-index: 20;
  background: var(--navy-800); color: #fff;
  border-radius: 14px; box-shadow: var(--shadow-lg);
  padding: 13px 18px; display: flex; align-items: center; gap: 14px;
  margin-top: 16px; animation: toastIn .25s;
}
.assemble-bar .ab-slot { font-size: 12.5px; color: #a8b8c9; }
.assemble-bar .ab-slot b { color: #fff; display: block; font-size: 13px; }
.assemble-bar .ab-go { margin-left: auto; }

/* ---------- trip timeline ---------- */
.timeline { position: relative; padding-left: 24px; }
.timeline::before { content: ''; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.tl-item { position: relative; padding: 0 0 16px; }
.tl-item::before {
  content: ''; position: absolute; left: -24px; top: 4px;
  width: 12px; height: 12px; border-radius: 50%;
  background: #fff; border: 3px solid var(--brand);
}
.tl-item.dim::before { border-color: var(--line); }
.tl-item.warn::before { border-color: var(--warn); }
.tl-item.ok::before { border-color: var(--ok); }
.tl-item .tl-title { font-weight: 600; font-size: 13px; color: var(--navy-700); }
.tl-item .tl-sub { font-size: 12px; color: var(--muted); }
.tl-item .tl-when { font-size: 11px; color: var(--faint); }

/* ---------- invoice print ---------- */
.invoice-sheet { background: #fff; border-radius: var(--r-lg); border: 1px solid var(--line); padding: 40px 44px; max-width: 860px; margin: 0 auto; }
.inv-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 30px; }
.inv-head .inv-title { font-family: var(--display); font-size: 30px; font-weight: 700; color: var(--navy-700); letter-spacing: -.02em; }
.inv-meta { font-size: 12.5px; color: var(--slate); line-height: 1.65; }
.inv-tbl { width: 100%; border-collapse: collapse; margin: 18px 0; font-size: 13px; }
.inv-tbl th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); border-bottom: 2px solid var(--navy-700); padding: 8px 10px; }
.inv-tbl td { padding: 9px 10px; border-bottom: 1px solid var(--line-soft); }
.inv-totals { margin-left: auto; width: 260px; font-size: 13.5px; }
.inv-totals .row { display: flex; justify-content: space-between; padding: 6px 0; }
.inv-totals .grand { border-top: 2px solid var(--navy-700); font-family: var(--display); font-weight: 700; font-size: 17px; padding-top: 9px; }
.inv-foot { margin-top: 34px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 11.5px; color: var(--muted); line-height: 1.7; }

@media print {
  body { background: #fff; }
  .sidebar, .topbar, .no-print, .toasts { display: none !important; }
  .shell { display: block; }
  .content { padding: 0; max-width: none; }
  .invoice-sheet { border: none; padding: 10mm 6mm; }
  .view { animation: none; }
}

/* ---------- misc ---------- */
.empty {
  text-align: center; padding: 44px 20px; color: var(--faint);
}
.empty .e-ic { width: 52px; height: 52px; margin: 0 auto 12px; border-radius: 14px; background: var(--line-soft); display: grid; place-items: center; color: var(--faint); }
.empty b { color: var(--slate); display: block; margin-bottom: 3px; font-size: 14px; }
.empty span { font-size: 12.5px; }

.skeleton { position: relative; overflow: hidden; background: var(--line-soft); border-radius: 8px; min-height: 14px; }
.skeleton::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .65), transparent);
  animation: shimmer 1.3s infinite;
}
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.mt { margin-top: 16px; }
.mb { margin-bottom: 16px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.right { text-align: right; }
.mono { font-variant-numeric: tabular-nums; }
.flex { display: flex; align-items: center; gap: 10px; }
.wrap { flex-wrap: wrap; }
.spacer { margin-left: auto; }
.big-num { font-family: var(--display); font-weight: 700; font-size: 20px; color: var(--navy-700); font-variant-numeric: tabular-nums; }

.seg { display: inline-flex; background: var(--line-soft); border-radius: 9px; padding: 3px; gap: 2px; }
.seg button {
  border: none; background: transparent; border-radius: 7px;
  font-size: 12.5px; font-weight: 600; color: var(--muted);
  padding: 6px 13px; cursor: pointer; transition: all .15s;
}
.seg button.active { background: #fff; color: var(--navy-700); box-shadow: var(--shadow-sm); }

.searchbar {
  display: flex; align-items: center; gap: 8px;
  background: #fff; border: 1px solid var(--line); border-radius: 9px;
  padding: 7.5px 12px; font-size: 13px; min-width: 210px;
}
.searchbar input { border: none; outline: none; flex: 1; font-size: 13px; font-family: inherit; background: transparent; }
.searchbar svg { color: var(--faint); width: 15px; height: 15px; }

/* command palette */
.palette { position: fixed; inset: 0; z-index: 110; background: rgba(11, 18, 32, .45); backdrop-filter: blur(3px); display: flex; justify-content: center; padding-top: 12vh; animation: fadeIn .15s; }
.palette-box {
  width: min(560px, calc(100vw - 40px)); background: #fff; border-radius: 14px;
  box-shadow: var(--shadow-lg); height: fit-content; max-height: 60vh; overflow: hidden;
  display: flex; flex-direction: column; animation: modalIn .2s;
}
.palette-box input {
  border: none; outline: none; padding: 16px 18px; font-size: 15px; font-family: inherit;
  border-bottom: 1px solid var(--line-soft);
}
.palette-list { overflow-y: auto; padding: 8px; }
.pal-item { display: flex; align-items: center; gap: 11px; padding: 9px 11px; border-radius: 9px; cursor: pointer; font-size: 13.5px; }
.pal-item:hover, .pal-item.hot { background: var(--brand-soft); }
.pal-item .pi-type { font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; background: var(--line-soft); color: var(--muted); border-radius: 5px; padding: 2px 6px; min-width: 54px; text-align: center; }
.pal-item .pi-sub { color: var(--faint); font-size: 12px; margin-left: auto; }

/* automation */
.rule-card { display: flex; gap: 14px; padding: 16px 18px; border-bottom: 1px solid var(--line-soft); align-items: flex-start; }
.rule-card:last-child { border: none; }
.rule-ic { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; flex-shrink: 0; background: var(--brand-soft); color: var(--brand-deep); }
.rule-ic svg { width: 20px; height: 20px; }
.lr-icon svg { width: 17px; height: 17px; }
.rr-ic svg { width: 16px; height: 16px; }
.e-ic svg { width: 24px; height: 24px; }
.rule-card.off .rule-ic { background: var(--line-soft); color: var(--faint); }
.rule-card h4 { font-size: 13.5px; margin-bottom: 2px; }
.rule-card p { font-size: 12.5px; color: var(--muted); max-width: 640px; }
.rule-stats { font-size: 11px; color: var(--faint); margin-top: 6px; display: flex; gap: 14px; }
.switch { position: relative; width: 40px; height: 22px; flex-shrink: 0; cursor: pointer; margin-left: auto; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .sl { position: absolute; inset: 0; background: #cfd8e3; border-radius: 20px; transition: .2s; }
.switch .sl::before { content: ''; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px; border-radius: 50%; background: #fff; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.switch input:checked + .sl { background: var(--ok); }
.switch input:checked + .sl::before { transform: translateX(18px); }

/* ---------- bowser cards ----------
   Their own layout rather than the KPI tile, because the footer carries a
   button: the columns are wide enough for it, and the footer wraps instead of
   being clipped when a long depot name or the "Reorder now" chip is present. */
.bowser-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(272px, 1fr)); gap: 14px; margin-bottom: 18px; }
.bowser-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 15px 16px 14px; box-shadow: var(--shadow-sm);
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; min-width: 0;
  transition: transform .18s, box-shadow .18s;
}
.bowser-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.bowser-card::after {
  content: ''; position: absolute; inset: 0 0 auto 0; height: 3px;
  background: var(--kpi-accent, var(--brand)); opacity: .9;
}
.bowser-name {
  font-size: 11.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bowser-depot { font-size: 11.5px; color: var(--faint); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bowser-litres {
  font-family: var(--display); font-size: 24px; font-weight: 700; color: var(--navy-700);
  font-variant-numeric: tabular-nums; line-height: 1.15; margin-top: 7px;
}
.bowser-litres small { font-size: 14px; color: var(--faint); font-weight: 600; }
.bowser-card .gauge { margin-top: 9px; }
.bowser-foot {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-top: 11px; min-height: 30px;
}
.bowser-foot .btn { margin-left: auto; }
.bowser-pct { font-size: 11.5px; color: var(--faint); }
@media (max-width: 420px) {
  .bowser-foot .btn { margin-left: 0; width: 100%; }
}

/* fuel gauge */
.gauge { height: 10px; border-radius: 6px; background: var(--line-soft); overflow: hidden; }
.gauge i { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--ok), #35c07f); }
.gauge.low i { background: linear-gradient(90deg, var(--red), #f06a6a); }
.gauge.mid i { background: linear-gradient(90deg, var(--warn), #f0ac4e); }

/* ---------- help & training centre ---------- */
.help-grid { display: grid; grid-template-columns: 258px 1fr; gap: 16px; align-items: start; }
.help-nav { padding: 10px; position: sticky; top: calc(var(--topbar-h) + 16px); max-height: calc(100vh - var(--topbar-h) - 40px); overflow-y: auto; }
.help-nav-group { font-size: 10px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); padding: 13px 10px 5px; }
.help-nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 8px; font-size: 13px; font-weight: 500;
  color: var(--slate); cursor: pointer; transition: background .14s, color .14s;
}
.help-nav-item:hover { background: var(--line-soft); text-decoration: none; }
.help-nav-item.active { background: var(--brand-soft); color: var(--brand-deep); font-weight: 600; }
.help-nav-item svg { width: 16px; height: 16px; opacity: .75; flex-shrink: 0; }
.help-body { padding: 26px 30px 34px; min-width: 0; }

.help-hero { display: flex; gap: 15px; align-items: center; padding-bottom: 16px; border-bottom: 1px solid var(--line-soft); margin-bottom: 18px; }
.help-hero-ic {
  width: 50px; height: 50px; border-radius: 14px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--brand), var(--brand-deep));
  color: #fff; display: grid; place-items: center;
  box-shadow: 0 4px 14px rgba(40, 114, 250, .35);
}
.help-hero-ic svg { width: 24px; height: 24px; }
.help-hero h2 { font-size: 22px; }
.help-hero p { color: var(--muted); font-size: 13.5px; margin-top: 2px; }

.help-objective { background: linear-gradient(135deg, #f6f9ff, #f2f6fc); border: 1px solid #dbe7fa; border-radius: var(--r-md); padding: 15px 17px; margin-bottom: 22px; }
.help-label { font-size: 10px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--brand-deep); margin-bottom: 5px; }
.help-objective p { font-size: 13.5px; color: var(--slate); line-height: 1.65; }
.help-audience { margin-top: 10px; font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.help-audience svg { width: 14px; height: 14px; }

.help-section { margin-bottom: 22px; }
.help-section h3 { font-size: 14.5px; margin-bottom: 9px; display: flex; align-items: center; gap: 7px; }
.help-section h3 svg { width: 16px; height: 16px; color: var(--brand); }
.help-list { list-style: none; }
.help-list li {
  position: relative; padding: 5px 0 5px 18px; font-size: 13.2px; color: var(--slate); line-height: 1.6;
}
.help-list li::before { content: ''; position: absolute; left: 3px; top: 13px; width: 5px; height: 5px; border-radius: 50%; background: var(--brand); opacity: .55; }
.help-list li b { color: var(--navy-700); font-weight: 600; }
.help-steps { list-style: none; counter-reset: hs; }
.help-steps li {
  counter-increment: hs; position: relative; padding: 9px 0 9px 38px;
  border-bottom: 1px solid var(--line-soft); font-size: 13.2px;
}
.help-steps li:last-child { border-bottom: none; }
.help-steps li::before {
  content: counter(hs); position: absolute; left: 0; top: 9px;
  width: 24px; height: 24px; border-radius: 8px; background: var(--brand-soft); color: var(--brand-deep);
  display: grid; place-items: center; font-size: 12px; font-weight: 700;
}
.help-steps li b { display: block; color: var(--navy-700); margin-bottom: 2px; }
.help-steps li span { color: var(--muted); }
.help-data { background: #fbfcfe; border: 1px solid var(--line); border-radius: var(--r-md); padding: 15px 17px; }
.help-auto { background: linear-gradient(135deg, #f7f3ff, #f4f0fe); border: 1px solid #e3d9fb; border-radius: var(--r-md); padding: 15px 17px; }
.help-auto h3 svg { color: var(--purple); }
.help-auto .help-list li::before { background: var(--purple); }
.help-tips { background: #fffdf5; border: 1px solid #f3e6c5; border-radius: var(--r-md); padding: 15px 17px; }
.help-tips h3 svg { color: var(--warn); }
.help-tips .help-list li::before { background: var(--warn); }
.help-drawer .help-hero { padding-bottom: 0; border: none; margin-bottom: 14px; }
.help-drawer .help-hero-ic { display: none; }
.help-drawer .help-hero h2 { display: none; }
.help-drawer .help-hero p { display: none; }

/* welcome tour */
.welcome-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.welcome-step { display: flex; gap: 12px; padding: 13px 14px; border: 1px solid var(--line); border-radius: var(--r-md); background: #fbfcfe; }
.welcome-step .ws-n {
  width: 27px; height: 27px; border-radius: 9px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--brand), var(--brand-deep)); color: #fff;
  display: grid; place-items: center; font-weight: 700; font-size: 13px;
}
.welcome-step b { font-size: 13.5px; color: var(--navy-700); }
.welcome-step p { font-size: 12.5px; color: var(--muted); margin-top: 3px; line-height: 1.55; }
.welcome-foot { margin-top: 14px; padding: 14px 16px; border-radius: var(--r-md); background: linear-gradient(135deg, #f7f3ff, #f2f6fc); border: 1px solid #e3ddfb; }
.welcome-foot b { font-size: 13px; color: var(--navy-700); display: flex; align-items: center; gap: 7px; }
.welcome-foot b svg { width: 16px; height: 16px; color: var(--purple); }
.welcome-foot p { font-size: 12.5px; color: var(--muted); margin-top: 5px; line-height: 1.6; }

@media (max-width: 900px) {
  .help-grid { grid-template-columns: 1fr; }
  .help-nav { position: static; max-height: none; }
  .welcome-grid { grid-template-columns: 1fr; }
}

/* responsive */
.burger { display: none; }
@media (max-width: 1220px) {
  .dash-grid, .grid-3 { grid-template-columns: 1fr 1fr; }
  .planner-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 1080px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: var(--sidebar-w); transform: translateX(-102%); transition: transform .25s; box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: none; }
  .burger { display: grid; }
  .login-page { grid-template-columns: 1fr; }
  .login-hero { display: none; }
}
@media (max-width: 780px) {
  .dash-grid, .grid-2, .grid-3, .form-grid, .planner-grid { grid-template-columns: 1fr; }
  .content { padding: 14px 12px 30px; }
  .top-search { display: none; }
}

/* ---------- Wins & Verlies (the monthly P&L pack) ---------- */
.pnl-banner {
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--warn-soft); border: 1px solid #f3d9a4; border-radius: var(--r-md);
  padding: 12px 14px; margin-bottom: 16px; color: #7a4a05;
}
.pnl-banner .pb-ic { width: 32px; height: 32px; border-radius: 9px; background: #fff; color: var(--warn); display: grid; place-items: center; flex-shrink: 0; }
.pnl-banner .pb-ic svg { width: 18px; height: 18px; }
.pnl-banner .pb-body { flex: 1; font-size: 12.5px; }
.pnl-banner .pb-body b { display: block; color: #6b3f03; margin-bottom: 3px; }
.pnl-banner ul { margin: 0; padding-left: 16px; line-height: 1.55; }
.pnl-banner .x-btn { color: #9a6a00; }

/* grouped summary: a header row per make, a Totaal per make, the Eind Totaal */
.tbl tr.grp-row td {
  background: #f8fafc; color: var(--navy-700); font-weight: 700;
  font-size: 11px; letter-spacing: .06em; text-transform: uppercase;
  padding: 9px 14px; border-top: 1px solid var(--line);
}
.tbl tr.tot-row td { font-weight: 700; background: #fbfcfe; border-top: 1px solid var(--line); color: var(--navy-700); }
.tbl tr.avg-row td { font-weight: 500; color: var(--muted); border-top: none; }
.tbl tr.end-row td { background: #e5eaf2; border-top: 2px solid var(--navy-700); }
.tbl tr.pct-row td { color: var(--muted); font-size: 12px; background: #fbfcfe; }
.tbl tbody tr.grp-row:hover, .tbl tbody tr.tot-row:hover, .tbl tbody tr.pct-row:hover { background: inherit; }
.pnl-sum .chip { font-size: 10px; padding: 2px 7px; }

/* wide grids (one column per Datatim code, one per month): first column stays put */
.pnl-wide { max-height: calc(100vh - 220px); overflow: auto; }
.pnl-wide th:first-child, .pnl-wide td:first-child {
  position: sticky; left: 0; z-index: 2; background: #fff;
  box-shadow: 1px 0 0 var(--line);
}
.pnl-wide th:first-child { z-index: 3; background: #f8fafc; }
.pnl-wide tbody tr:hover td:first-child { background: #f6f9fe; }
.pnl-wide tr.grp-row td:first-child { background: #f8fafc; }
.pnl-wide tr.tot-row td:first-child, .pnl-wide tr.pct-row td:first-child { background: #fbfcfe; }
.pnl-wide tr.end-row td:first-child { background: #e5eaf2; }

/* the diverging profit chart */
.pnl-chart { padding: 12px 18px 6px; }
.dvg { position: relative; overflow-y: auto; padding: 2px 0; }
.dvg-row { display: grid; grid-template-columns: 78px 1fr 100px; align-items: center; gap: 10px; height: 17px; font-size: 11.5px; padding: 0 4px; border-radius: 4px; }
.dvg-row:hover { background: #f6f9fe; }
.dvg-l { font-weight: 600; color: var(--navy-700); text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dvg-t { position: relative; height: 11px; }
.dvg-axis { position: absolute; top: -3px; bottom: -3px; width: 1px; background: #c6d0dc; }
.dvg-b { position: absolute; top: 0; height: 100%; border-radius: 3px; transition: width .7s cubic-bezier(.2, .8, .3, 1); }
.dvg-b.pos { background: var(--ok); }
.dvg-b.neg { background: var(--red); }
.dvg-v { text-align: right; font-size: 11px; font-weight: 600; }

/* income bands (Minder as R100 000 / R100–150 000 / Meer as R150 000) */
.pnl-bands { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.pnl-band { border: 1px solid var(--line); border-radius: var(--r-md); padding: 11px 14px 10px; background: #fbfcfe; position: relative; overflow: hidden; }
.pnl-band::after { content: ''; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--kpi-accent, var(--brand)); opacity: .9; }
.pnl-band .k-label { font-size: 11px; font-weight: 600; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; }
.pnl-band .k-value { font-family: var(--display); font-size: 21px; font-weight: 700; color: var(--navy-700); margin-top: 3px; font-variant-numeric: tabular-nums; }
.pnl-band .k-value small { font-size: 12px; color: var(--faint); font-weight: 600; }
.pnl-band .k-sub { font-size: 11.5px; color: var(--faint); margin-top: 2px; }

/* truck drawer */
.pnl-mini { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 6px; }
.pnl-mini > div { background: #fbfcfe; border: 1px solid var(--line); border-radius: var(--r-md); padding: 9px 11px; min-width: 0; }
.pnl-mini .l { font-size: 10.5px; font-weight: 600; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; }
.pnl-mini .v { font-family: var(--display); font-size: 17px; font-weight: 700; color: var(--navy-700); margin-top: 2px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pnl-mini .s { font-size: 11px; color: var(--faint); margin-top: 1px; }
.pnl-h { font-size: 13.5px; margin: 18px 0 8px; }
.pnl-h .muted { font-weight: 400; font-size: 12px; }
.pnl-codes td { padding: 7px 12px; font-size: 12.5px; }
.pnl-kv > div { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line-soft); font-size: 12.5px; }
.pnl-kv > div:last-child { border-bottom: none; }
.pnl-kv > div > span:first-child { color: var(--muted); min-width: 150px; }
.pnl-kv > div > b { color: var(--navy-700); font-weight: 600; flex: 1; min-width: 0; }
.pnl-kv > div > span:last-child { margin-left: auto; font-variant-numeric: tabular-nums; font-weight: 600; }

/* year view tiles: per make, Totale Vlote / Wins / % / Verlies / % */
.pnl-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin-bottom: 16px; }
.pnl-tile { border: 1px solid var(--line); border-radius: var(--r-md); padding: 11px 14px 10px; background: #fbfcfe; min-width: 0; }
.pnl-tile .pt-name { font-size: 11px; font-weight: 700; color: var(--muted); letter-spacing: .05em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pnl-tile .pt-n { font-family: var(--display); font-size: 22px; font-weight: 700; color: var(--navy-700); margin-top: 2px; }
.pnl-tile .pt-n small { font-size: 11.5px; color: var(--faint); font-weight: 600; }
.pnl-tile .pt-row { display: flex; gap: 14px; font-size: 12px; color: var(--slate); margin-top: 5px; }
.pnl-tile .pt-row i { font-style: normal; color: var(--faint); margin-left: 3px; }
.pnl-matrix td, .pnl-matrix th { padding-left: 10px; padding-right: 10px; }

/* capture grids (income, pairings, fleet setup): compact inputs in table cells */
.pnl-cap td { padding: 5px 10px; }
.pnl-cap .input { padding: 5px 8px; font-size: 12.5px; border-radius: 7px; }
.pnl-cap td.num .input { text-align: right; width: 120px; }
@media (max-width: 780px) {
  .pnl-mini { grid-template-columns: 1fr 1fr; }
  .dvg-row { grid-template-columns: 64px 1fr 84px; }
}

/* unit type chips (fleet register): light vehicles (klein vloot) stand apart from horses */
.c-sand { background: #fbf1dc; color: #7a5410; }
