:root {
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;

  --bg: #f5f1ea;
  --surface: #ffffff;
  --surface-alt: #faf7f2;
  --text: #2b2d31;
  --text-dim: #6e6a63;
  --border: #e9e2d6;

  /* Brand (copper): chrome, menus, primary actions, borders, pop-ups - never a status signal.
     Palette: copper accent, soft warm white for big surfaces, charcoal text. */
  --brand: #b26e2c;
  --brand-ink: #8a5320;
  --brand-soft: #f7ede0;
  --brand-on: #ffffff;
  --brand-grad: linear-gradient(135deg, #c98440, #e0a95c);
  --brand-glow: rgba(201, 132, 64, 0.35);

  /* Status/alert severity (reserved meaning - don't reuse for plain chrome):
     olive green = ok/online/live, amber = needs attention, red = critical/error. */
  --status-good: #5c8a3e;
  --status-good-ink: #43692b;
  --status-good-soft: #ebf2e3;

  --status-warn: #d49a1f;
  --status-warn-ink: #8a6410;
  --status-warn-soft: #fbf0d3;

  --danger: #cf3a2e;
  --danger-soft: #fbe4e1;

  --chip-bg: #2b2d31;
  --chip-text: #f6f2eb;
  --chip-text-dim: #aaa59c;
  --chip-border: rgba(255, 255, 255, 0.08);

  --shadow-float: 0 20px 45px -14px rgba(43, 33, 20, 0.2), 0 4px 14px rgba(43, 33, 20, 0.07);
  --shadow-soft: 0 2px 10px rgba(43, 33, 20, 0.06);

  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 11px;
  --radius-pill: 999px;
}

:root[data-theme="dark"] {
  --bg: #16171a;
  --surface: #202225;
  --surface-alt: #292b2f;
  --text: #f3efe8;
  --text-dim: #9d978d;
  --border: #34363b;

  --brand: #d9954f;
  --brand-ink: #e9b57c;
  --brand-soft: rgba(217, 149, 79, 0.15);
  --brand-on: #2a1806;
  --brand-glow: rgba(217, 149, 79, 0.3);

  --status-good: #8fb86a;
  --status-good-ink: #a9cf86;
  --status-good-soft: rgba(143, 184, 106, 0.15);

  --status-warn: #e6b341;
  --status-warn-ink: #f0c96a;
  --status-warn-soft: rgba(230, 179, 65, 0.16);

  --danger: #ef6a5e;
  --danger-soft: rgba(239, 106, 94, 0.16);

  --shadow-float: 0 24px 60px -14px rgba(0, 0, 0, 0.6), 0 4px 18px rgba(0, 0, 0, 0.35);
  --shadow-soft: 0 2px 10px rgba(0, 0, 0, 0.25);
}

* { box-sizing: border-box; }

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

.hidden { display: none !important; }

.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 20px; height: 20px; flex-shrink: 0; }
.icon-sm { width: 15px; height: 15px; }
.icon-lg { width: 26px; height: 26px; }

button { font-family: inherit; cursor: pointer; }

/* ---------- Login (photo backdrop, glass card, slide-to-login) ---------- */

#login-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  overflow-y: auto;
  color: #fff;
  background: #14110e;
}
.lg-backdrop {
  /* plain haze colour of the 3D scene (login-scene.js), so nothing flashes before it fades in */
  position: fixed;
  inset: 0;
  background: #dfe5ea;
}
.lg-brand {
  position: fixed;
  top: 28px;
  left: clamp(24px, 4vw, 48px);
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 12px;
}
.lg-logo {
  width: 40px; height: 40px;
  border-radius: 13px;
  background: linear-gradient(135deg, #b26e2c, #e0a95c);
  color: #2a1806;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 24px rgba(224, 169, 92, 0.35);
}
.lg-brand-name { font-weight: 700; font-size: 16px; letter-spacing: 0.01em; }

.lg-stage {
  position: relative;
  z-index: 1;
  min-height: 100%;
  display: flex;
  align-items: center;
  padding: 96px clamp(24px, 7vw, 120px) 48px;
}
.lg-card {
  width: min(448px, 100%);
  padding: 40px 36px 30px;
  border-radius: 28px;
  background: rgba(24, 20, 17, 0.6);
  -webkit-backdrop-filter: blur(22px) saturate(1.3);
  backdrop-filter: blur(22px) saturate(1.3);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 40px 80px -20px rgba(0, 0, 0, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  animation: lg-rise 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.lg-view.shake { animation: lg-shake 0.42s ease; }
.lg-view { display: block; }
.lg-view h1 { margin: 0 0 8px; font-size: 30px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; }
.lg-sub { margin: 0 0 26px; font-size: 14px; line-height: 1.55; color: rgba(255, 255, 255, 0.72); }

.lg-field { position: relative; margin-bottom: 14px; }
.lg-field input {
  width: 100%;
  height: 58px;
  padding: 22px 50px 6px 50px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 15px;
  transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
}
.lg-field input:focus {
  outline: none;
  border-color: #d9954f;
  background: rgba(255, 255, 255, 0.12);
  box-shadow: 0 0 0 4px rgba(224, 169, 92, 0.18);
}
.lg-field input:disabled { opacity: 0.55; cursor: not-allowed; }
.lg-field input:-webkit-autofill {
  -webkit-text-fill-color: #fff;
  caret-color: #fff;
  box-shadow: 0 0 0 100px #2b241e inset;
}
.lg-field label {
  position: absolute;
  left: 50px;
  top: 19px;
  margin: 0;
  font-size: 15px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.62);
  pointer-events: none;
  transition: top 0.18s, font-size 0.18s, color 0.18s, letter-spacing 0.18s;
}
.lg-field input:focus + label,
.lg-field input:not(:placeholder-shown) + label {
  top: 9px;
  font-size: 11px;
  letter-spacing: 0.03em;
  color: #e9b57c;
}
.lg-field-icon { position: absolute; left: 17px; top: 19px; width: 20px; height: 20px; color: rgba(255, 255, 255, 0.6); }
.lg-field input:focus ~ .lg-field-icon { color: #e9b57c; }
.lg-eye {
  position: absolute;
  right: 9px; top: 9px;
  width: 40px; height: 40px;
  padding: 0;
  border-radius: 12px;
  background: transparent;
  color: rgba(255, 255, 255, 0.65);
  display: flex; align-items: center; justify-content: center;
}
.lg-eye:hover { background: rgba(255, 255, 255, 0.1); color: #fff; opacity: 1; }

.lg-row { display: flex; justify-content: flex-end; margin: 2px 0 8px; font-size: 13px; }
.lg-link { color: #e9b57c; font-weight: 600; text-decoration: none; }
.lg-link:hover { text-decoration: underline; }
.lg-error { min-height: 20px; margin: 6px 0 10px; font-size: 13px; line-height: 1.4; color: #ffb4b4; }
.lg-notice {
  margin: 0 0 18px;
  padding: 12px 14px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.5;
  background: rgba(224, 169, 92, 0.12);
  border: 1px solid rgba(224, 169, 92, 0.35);
  color: #f5deba;
}
.lg-notice.warn { background: rgba(251, 191, 36, 0.12); border-color: rgba(251, 191, 36, 0.4); color: #fde68a; }
.lg-foot { margin: 22px 0 0; text-align: center; font-size: 13px; color: rgba(255, 255, 255, 0.66); }

.lg-back {
  display: inline-flex; align-items: center; gap: 6px;
  margin: 0 0 18px; padding: 0;
  background: none; border: none;
  color: rgba(255, 255, 255, 0.75);
  font-size: 13px; font-weight: 600;
}
.lg-back:hover { color: #fff; opacity: 1; }
.lg-btn {
  width: 100%; height: 54px;
  border: none; border-radius: 999px;
  background: var(--brand-grad);
  color: #2a1806;
  font-size: 15px; font-weight: 700;
  box-shadow: 0 10px 28px rgba(201, 132, 64, 0.35);
  transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
}
.lg-btn:hover { opacity: 1; transform: translateY(-1px); box-shadow: 0 14px 32px rgba(201, 132, 64, 0.45); }
.lg-btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; box-shadow: none; }
.lg-badge {
  display: inline-block;
  margin-bottom: 12px; padding: 4px 12px;
  border-radius: 999px;
  background: rgba(251, 191, 36, 0.16);
  color: #fcd34d;
  font-size: 12px; font-weight: 700;
}

/* Slide to login */
.lg-slide {
  --h: 56px;
  --pad: 5px;
  position: relative;
  height: calc(var(--h) + var(--pad) * 2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.16);
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  transition: opacity 0.2s;
}
.lg-slide.is-locked { opacity: 0.6; }
.lg-slide-fill {
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(201, 132, 64, 0.3), rgba(224, 169, 92, 0.7));
  transition: width 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.lg-slide-label {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  padding-left: 52px;
  font-size: 14px; font-weight: 600; letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.85);
  pointer-events: none;
}
.lg-slide:not(.is-locked):not(.is-busy) .lg-slide-label {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.5) 0%, #fff 50%, rgba(255, 255, 255, 0.5) 100%);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: lg-shimmer 2.6s linear infinite;
}
.lg-slide-handle {
  position: absolute;
  left: var(--pad); top: var(--pad);
  width: var(--h); height: var(--h);
  padding: 0;
  border: none; border-radius: 50%;
  background: var(--brand-grad);
  color: #2a1806;
  display: flex; align-items: center; justify-content: center;
  cursor: grab;
  box-shadow: 0 6px 18px rgba(201, 132, 64, 0.45);
  touch-action: none;
  transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.lg-slide-handle:hover { opacity: 1; }
.lg-slide-handle:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.lg-slide.dragging .lg-slide-handle,
.lg-slide.dragging .lg-slide-fill { transition: none; cursor: grabbing; }
.lg-slide.is-locked .lg-slide-handle { cursor: not-allowed; filter: grayscale(0.7); }
.lg-slide.is-busy .lg-slide-handle svg { display: none; }
.lg-slide.is-busy .lg-slide-handle::after {
  content: '';
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 3px solid rgba(42, 24, 6, 0.3);
  border-top-color: #2a1806;
  animation: lg-spin 0.8s linear infinite;
}

@keyframes lg-rise { from { opacity: 0; transform: translateY(18px) scale(0.985); } to { opacity: 1; transform: none; } }
@keyframes lg-shake { 0%, 100% { transform: none; } 20% { transform: translateX(-9px); } 40% { transform: translateX(8px); } 60% { transform: translateX(-5px); } 80% { transform: translateX(3px); } }
@keyframes lg-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@keyframes lg-spin { to { transform: rotate(360deg); } }

@media (max-width: 760px) {
  .lg-stage { justify-content: center; padding: 88px 16px 28px; }
  .lg-card { padding: 32px 22px 24px; border-radius: 24px; }
  .lg-view h1 { font-size: 26px; }
}
@media (prefers-reduced-motion: reduce) {
  .lg-card, .lg-slide-label { animation: none !important; }
  .lg-slide-handle, .lg-slide-fill { transition: none; }
}

.hint { color: var(--text-dim); font-size: 13px; margin: 0 0 8px; }
.error { color: var(--danger); font-size: 13px; min-height: 16px; margin: 4px 0 0; }

input, select {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 11px 14px;
  font-size: 14px;
  font-family: inherit;
  width: 100%;
}
input::placeholder { color: var(--text-dim); }
input:focus, select:focus { outline: 2px solid var(--brand); outline-offset: 1px; }

button {
  background: var(--text);
  border: none;
  border-radius: var(--radius-sm);
  color: var(--bg);
  padding: 11px 16px;
  font-size: 14px;
  font-weight: 600;
  transition: opacity 0.15s;
}
button:hover { opacity: 0.85; }
.btn-secondary {
  background: var(--surface-alt);
  color: var(--text);
  border: 1px solid var(--border);
}

/* ---------- App shell ---------- */

#app { height: 100%; display: flex; }

#rail {
  width: 200px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 18px 14px;
  gap: 28px;
  flex-shrink: 0;
}
.rail-logo {
  display: block; width: 100%; height: 52px; padding: 0 2px; margin: 0;
  background: transparent; border: 0; cursor: pointer; border-radius: var(--radius-sm);
}
.rail-logo svg { width: 100%; height: 100%; }
.rail-logo:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.fl-d { display: none; }
:root[data-theme="dark"] .fl-l { display: none; }
:root[data-theme="dark"] .fl-d { display: block; }
.tb-mark { display: none; flex-shrink: 0; width: 30px; height: 30px; }
.tb-mark svg { width: 100%; height: 100%; }
.rail-nav { display: flex; flex-direction: column; gap: 8px; flex: 1; }
.rail-bottom { display: flex; flex-direction: column; gap: 8px; }

/* Capsule nav buttons: icon + label, solid brand fill when active. */
.nav-pill {
  width: 100%;
  display: flex; align-items: center; gap: 10px;
  padding: 11px 16px;
  border-radius: var(--radius-pill);
  background: var(--surface-alt);
  color: var(--text-dim);
  border: none;
  font-size: 14px;
  font-weight: 600;
  transition: background 0.15s, color 0.15s;
}
.nav-pill span { white-space: nowrap; }
.nav-pill:hover { background: var(--border); opacity: 1; color: var(--text); }
.nav-pill.active { background: var(--brand); color: var(--brand-on); }

.rail-btn {
  width: 44px; height: 44px;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text-dim);
  border: none;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s, color 0.15s;
  align-self: flex-start;
}
.rail-btn:hover { background: var(--surface-alt); opacity: 1; color: var(--text); }
.icon-moon { display: none; }
:root[data-theme="dark"] .icon-sun { display: none; }
:root[data-theme="dark"] .icon-moon { display: block; }

#main { flex: 1; display: flex; flex-direction: column; min-width: 0; }

/* ---------- Topbar ---------- */

#topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  z-index: 20;
}
.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 9px 16px;
  width: 280px;
  color: var(--text-dim);
}
.search-box input {
  background: transparent;
  border: none;
  padding: 0;
  width: 100%;
  color: var(--text);
}
.search-box input:focus { outline: none; }
.topbar-spacer { flex: 1; }

.icon-btn {
  position: relative;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  color: var(--text-dim);
  display: flex; align-items: center; justify-content: center;
}
.icon-btn:hover { color: var(--text); opacity: 1; }
.badge {
  position: absolute;
  top: -4px; right: -4px;
  min-width: 17px; height: 17px;
  border-radius: 50%;
  background: var(--danger);
  color: white;
  font-size: 10px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  padding: 0 3px;
}

.notif-wrap, .profile-wrap { position: relative; }
.profile-btn {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 5px 12px 5px 5px;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
}
.avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--brand);
  color: var(--brand-on);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800;
  font-size: 13px;
}

.dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-float);
  min-width: 220px;
  padding: 8px;
  z-index: 50;
}
.dropdown-title { font-size: 12px; font-weight: 700; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.04em; padding: 6px 8px; }
.dropdown-item {
  width: 100%;
  background: transparent;
  color: var(--text);
  border: none;
  text-align: left;
  padding: 9px 8px;
  border-radius: var(--radius-sm);
  font-weight: 500;
}
.dropdown-item:hover { background: var(--surface-alt); opacity: 1; }

#notif-list { list-style: none; margin: 0; padding: 0; max-height: 280px; overflow-y: auto; }
.notif-item { padding: 8px; border-radius: var(--radius-sm); font-size: 13px; border-left: 3px solid var(--border); }
.notif-item:hover { background: var(--surface-alt); }
.notif-item .notif-type { font-weight: 600; }
.notif-item .notif-time { color: var(--text-dim); font-size: 11px; }
.notif-item.sev-danger { border-left-color: var(--danger); }
.notif-item.sev-warn { border-left-color: var(--status-warn); }
.notif-item.sev-good { border-left-color: var(--status-good); }

/* ---------- Content / map ---------- */

#content { flex: 1; position: relative; min-height: 0; }
#map { position: absolute; inset: 0; background: var(--bg); z-index: 0; isolation: isolate; }
#map.dark-tiles .leaflet-tile-pane,
#map.dark-tiles .map-pane-dark {
  filter: invert(1) hue-rotate(180deg) brightness(0.92) contrast(0.9) saturate(0.8);
}

.map-context-grey { filter: grayscale(1) contrast(0.92) brightness(1.04); }
#map.dark-tiles .map-context-grey { filter: invert(1) hue-rotate(180deg) brightness(0.92) contrast(0.9) saturate(0.8) grayscale(1); }

/* ---------- Floating panel ---------- */

.panel { display: none; }
.panel.active { display: block; }

.panel-card {
  position: absolute;
  top: 20px;
  left: 20px;
  bottom: 20px;
  width: 340px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-float);
  padding: 22px;
  overflow-y: auto;
  z-index: 10;
}

.panel-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.panel-card h2 { font-size: 15px; font-weight: 700; margin: 0 0 14px; }
.panel-header h2 { margin: 0; }

.icon-btn-square {
  width: 34px; height: 34px;
  border-radius: var(--radius-sm);
  background: var(--text);
  color: var(--bg);
  display: flex; align-items: center; justify-content: center;
}

label { font-size: 12px; color: var(--text-dim); font-weight: 600; margin: 10px 0 4px; display: block; }
#history-load-btn { width: 100%; margin-top: 14px; }

/* Device list */
#device-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.device-item {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: border-color 0.15s;
}
.device-item:hover { border-color: var(--brand); }
.device-name { font-weight: 700; font-size: 14px; display: flex; align-items: center; gap: 8px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-dim); display: inline-block; flex-shrink: 0; }
.status-dot.online { background: var(--status-good); box-shadow: 0 0 0 3px var(--status-good-soft); }
.device-meta { font-size: 12px; color: var(--text-dim); padding-left: 16px; }

/* Detail card */
.detail-close {
  position: absolute;
  top: 18px; right: 18px;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--surface-alt);
  color: var(--text-dim);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  padding: 0;
}
.pill {
  display: inline-block;
  padding: 5px 14px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 14px;
}
.pill-green { background: var(--status-good-soft); color: var(--status-good-ink); }
.pill-gray { background: var(--surface-alt); color: var(--text-dim); }
.pill-amber { background: var(--status-warn-soft); color: var(--status-warn-ink); }
.detail-title { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.detail-title .icon { color: var(--brand-ink); }
.detail-title h2 { font-size: 22px; font-weight: 800; letter-spacing: -0.01em; }
.detail-subtitle { display: flex; align-items: center; justify-content: space-between; color: var(--text-dim); font-size: 13px; margin-bottom: 12px; }
.detail-driver { display: flex; align-items: center; gap: 5px; }

.checkout-row {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  margin-bottom: 16px;
}
.checkout-status { font-size: 12px; font-weight: 700; color: var(--text-dim); }
.checkout-row.is-checked-out .checkout-status { color: var(--status-warn-ink); }
.checkout-row .btn-small { flex-shrink: 0; }

.maintenance-badge {
  display: flex; align-items: center; gap: 8px;
  background: var(--status-warn-soft);
  color: var(--status-warn-ink);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 18px;
}
.maintenance-badge.overdue { background: var(--danger-soft); color: var(--danger); }

.stat-row { display: flex; gap: 10px; margin-bottom: 20px; }
.stat-tile {
  flex: 1;
  background: var(--brand-soft);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.stat-tile .icon { color: var(--brand-ink); }
.stat-tile div { display: flex; flex-direction: column; }
.stat-value { font-size: 19px; font-weight: 800; color: var(--text); line-height: 1.1; }
.stat-label { font-size: 11px; color: var(--text-dim); font-weight: 600; }

.timeline-title { font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-dim); margin: 4px 0 10px; font-weight: 700; }

.detail-status-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.detail-status-row .pill { margin-bottom: 0; }
.detail-last-update { font-size: 11px; color: var(--text-dim); font-weight: 600; }

/* Battery trend sparkline */
.battery-trend { margin-bottom: 18px; }
.battery-trend-header { display: flex; align-items: baseline; justify-content: space-between; }
.sparkline { width: 100%; height: 44px; display: block; }
.sparkline-fill { fill: var(--brand-soft); }
.sparkline-line { fill: none; stroke: var(--brand); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sparkline-dot { fill: var(--brand); }
.sparkline-threshold { stroke: var(--danger); stroke-width: 1; stroke-dasharray: 3 3; }

/* BLE sensors */
.ble-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.ble-tile {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 12px;
}
.ble-tile .icon { color: var(--brand-ink); flex-shrink: 0; }
.ble-tile-name { font-size: 12px; color: var(--text-dim); font-weight: 600; }
.ble-tile-value { font-size: 15px; font-weight: 800; }

/* Advanced panel */
.advanced-toggle {
  width: 100%;
  display: flex; align-items: center; gap: 8px;
  background: var(--surface-alt);
  color: var(--text);
  border: 1px solid var(--border);
  font-weight: 600;
  font-size: 13px;
  margin-top: 6px;
}
.advanced-toggle span { flex: 1; text-align: left; }
.advanced-chevron { transition: transform 0.15s; }
.advanced-toggle.open .advanced-chevron { transform: rotate(180deg); }

.advanced-panel {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed var(--border);
}

.signal-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; font-size: 13px; }
.signal-item {
  background: var(--surface-alt);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
}
.signal-item .signal-label { font-size: 10px; color: var(--text-dim); font-weight: 700; text-transform: uppercase; display: block; }
.signal-item .signal-value { font-size: 14px; font-weight: 800; }
.signal-good { color: var(--status-good-ink); }
.signal-ok { color: var(--status-warn-ink); }
.signal-poor { color: var(--danger); }

.inline-field { display: flex; align-items: center; gap: 8px; }
.inline-field input { width: 90px; }
.btn-small { padding: 8px 12px; font-size: 13px; flex-shrink: 0; }

#tracking-mode-select { margin-bottom: 4px; }

.io-badge { display: inline-block; padding: 2px 8px; border-radius: var(--radius-pill); font-size: 11px; font-weight: 700; background: var(--surface-alt); }
.io-rename { margin-left: 8px; color: var(--brand-ink); font-weight: 700; cursor: pointer; font-size: 11px; }
.io-rename:hover { text-decoration: underline; }
.io-label-row { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.io-label-row input { flex: 1; padding: 7px 10px; font-size: 12px; }
.io-label-row span { font-size: 11px; color: var(--text-dim); width: 60px; flex-shrink: 0; }

.command-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 4px; }
.command-row {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 8px 10px;
}
.command-row .command-name { flex: 1; font-size: 13px; font-weight: 600; }
.command-row input { width: 70px; padding: 7px 8px; font-size: 12px; }
.command-row input.command-extra-wide { width: 120px; }
.command-row button { padding: 7px 12px; font-size: 12px; flex-shrink: 0; }
.command-status { font-size: 11px; margin-top: 2px; }
.command-status.ok { color: var(--status-good-ink); }
.command-status.error { color: var(--danger); }

.info-btn {
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 800;
  font-style: italic;
  padding: 0;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.info-btn:hover { color: var(--brand-ink); border-color: var(--brand); }

.installer-toggle {
  width: 100%;
  display: flex; align-items: center; gap: 8px;
  background: var(--surface-alt);
  color: var(--text-dim);
  border: 1px dashed var(--border);
  font-weight: 600;
  font-size: 12px;
  margin-top: 10px;
}
.installer-toggle span { flex: 1; text-align: left; }
.installer-toggle .advanced-chevron { transition: transform 0.15s; }
.installer-toggle.open .advanced-chevron { transform: rotate(180deg); }
.installer-panel { margin-top: 8px; display: flex; flex-direction: column; gap: 8px; }

/* Timeline */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline-item {
  position: relative;
  padding: 0 0 20px 22px;
  border-left: 2px solid var(--border);
  margin-left: 5px;
}
.timeline-item:last-child { border-color: transparent; padding-bottom: 0; }
.timeline-item::before {
  content: '';
  position: absolute;
  left: -6px; top: 2px;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--text-dim);
  border: 2px solid var(--surface);
}
.timeline-item.is-current::before { background: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.timeline-row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.timeline-address { font-size: 13px; font-weight: 700; line-height: 1.3; }
.timeline-meta { font-size: 11px; color: var(--text-dim); font-weight: 600; white-space: nowrap; }
.timeline-type { font-size: 12px; color: var(--text-dim); margin-top: 1px; }
.timeline-loc { color: inherit; text-decoration: none; cursor: pointer; }
.timeline-loc:hover, .timeline-loc:focus-visible { color: var(--brand); text-decoration: underline; }
.timeline.collapsed .timeline-item:first-child { border-color: transparent; padding-bottom: 0; }
.timeline-more { margin: 12px 0 4px 27px; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer; }
.timeline-more:hover { color: var(--brand); border-color: var(--brand); }
.loc-peek-back { display: none; }
body.loc-peek .loc-peek-back { display: block; position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 1100; padding: 11px 20px; border-radius: 999px; border: 0; background: var(--brand); color: var(--brand-on, #fff); font: inherit; font-size: 14px; font-weight: 700; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3); cursor: pointer; }
body.loc-peek #content > .panel { display: none !important; }

/* Playback */
.playback-controls { display: flex; align-items: center; gap: 10px; margin-top: 14px; }
#playback-slider { flex: 1; accent-color: var(--brand); }

/* Geofence list */
#geofence-list { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.geofence-item {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 10px 10px 14px;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.geofence-item button {
  width: 30px; height: 30px;
  padding: 0;
  background: var(--danger-soft);
  color: var(--danger);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
}

/* Check-in/out list */
.checkout-settings {
  display: flex; flex-direction: column; gap: 8px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  margin-top: 4px;
}
.toggle-row { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-dim); cursor: pointer; }
.toggle-row input { width: auto; accent-color: var(--brand); }

#checkout-list { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.checkout-item {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.checkout-item-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.checkout-item-name { font-size: 13px; font-weight: 700; }
.checkout-item-status { font-size: 11px; color: var(--text-dim); font-weight: 600; }
.checkout-item.is-checked-out .checkout-item-status { color: var(--status-warn-ink); }
.checkout-item button { align-self: flex-start; }

/* Reports list */
.reports-list { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.report-device-block {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 12px;
}
.report-device-name { font-size: 13px; font-weight: 700; margin-bottom: 8px; }

/* Settings panel */
.settings-section {
  padding-bottom: 18px;
  margin-bottom: 18px;
  border-bottom: 1px dashed var(--border);
}
.settings-section:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.settings-section .timeline-title { display: flex; align-items: center; gap: 6px; }

.user-item-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.user-item-name { font-size: 13px; font-weight: 700; }
.user-item-email { font-size: 11px; color: var(--text-dim); }
.role-badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: var(--radius-pill);
  font-size: 10px;
  font-weight: 700;
  background: var(--brand-soft);
  color: var(--brand-ink);
  white-space: nowrap;
}
.role-badge.role-admin { background: var(--status-good-soft); color: var(--status-good-ink); }

.icon-picker { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.icon-picker-btn {
  aspect-ratio: 1;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-dim);
}
.icon-picker-btn.selected { background: var(--brand-soft); border-color: var(--brand); color: var(--brand-ink); }

/* Map marker badge */
.marker-badge {
  width: 34px; height: 34px;
  border-radius: var(--radius-sm);
  background: var(--text-dim);
  color: white;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-float);
  border: 2px solid var(--surface);
}
.marker-badge.online { background: var(--status-good); }
.marker-badge.selected { outline: 3px solid var(--brand-soft); }

/* ---------- Leaflet overrides (dark map chip popups, floating zoom) ---------- */

.leaflet-control-zoom {
  border: none !important;
  box-shadow: var(--shadow-float) !important;
  border-radius: var(--radius-pill) !important;
  overflow: hidden;
}
.leaflet-control-zoom a {
  background: var(--surface) !important;
  color: var(--text) !important;
  border: none !important;
  width: 38px !important;
  height: 38px !important;
  line-height: 38px !important;
}
.leaflet-control-zoom a:hover { background: var(--surface-alt) !important; }
.leaflet-bottom.leaflet-right .leaflet-control { margin: 0 20px 20px 0; }
.leaflet-top.leaflet-left .leaflet-control { margin: 20px 0 0 20px; }
.leaflet-top.leaflet-right .leaflet-control { margin: 20px 20px 0 0; }

.leaflet-draw-toolbar a {
  background-color: var(--surface) !important;
  border-color: var(--border) !important;
}
.leaflet-draw.leaflet-control { box-shadow: var(--shadow-float); border-radius: var(--radius-sm); overflow: hidden; }
:root[data-theme="dark"] .leaflet-draw-toolbar a { filter: invert(1) hue-rotate(180deg); }

.device-popup .leaflet-popup-content-wrapper {
  background: var(--chip-bg);
  color: var(--chip-text);
  border-radius: var(--radius-md);
  border: 1px solid var(--chip-border);
  box-shadow: var(--shadow-float);
  padding: 2px;
}
.device-popup .leaflet-popup-tip { background: var(--chip-bg); }
.device-popup .leaflet-popup-close-button { color: var(--chip-text-dim) !important; }
.chip-popup { display: flex; gap: 10px; align-items: flex-start; padding: 6px 4px; min-width: 150px; }
.chip-popup .icon { color: var(--brand); margin-top: 2px; }
.chip-popup-name { font-weight: 800; font-size: 14px; }
.chip-popup-model { font-size: 11px; color: var(--chip-text-dim); margin-bottom: 4px; }
.chip-popup-battery { font-size: 12px; font-weight: 700; color: var(--brand); }
.chip-popup-time { font-size: 11px; color: var(--chip-text-dim); margin-top: 2px; }

/* Modal */
.modal {
  position: fixed; inset: 0;
  background: rgba(22, 23, 26, 0.5);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(2px);
}
.modal-content {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-float);
  padding: 26px;
  width: 340px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.modal-content h2 { margin: 0 0 6px; font-size: 17px; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 14px; }

/* ---------- Responsive ---------- */

@media (max-width: 720px) {
  .panel-card { left: 12px; right: 12px; top: 12px; bottom: 12px; width: auto; }
  .search-box { width: 160px; }
}

/* ---------- Menu pillars, asset sub-nav, placeholder pages ---------- */

.rail-nav { min-height: 0; overflow-y: auto; scrollbar-width: none; }
.rail-nav::-webkit-scrollbar { display: none; }
#rail { gap: 22px; }

.subnav {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  overflow-x: auto;
  scrollbar-width: none;
}
.subnav-tab {
  background: transparent;
  color: var(--text-dim);
  padding: 7px 14px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}
.subnav-tab:hover { color: var(--text); background: var(--border); opacity: 1; }
.subnav-tab.active { background: var(--brand); color: var(--brand-on); }

/* Environment: the page lives in environment.html and fills the whole content area */
.pillar-page.env-page.active { display: block; padding: 0; overflow: hidden; }
.env-frame { display: block; width: 100%; height: 100%; border: 0; background: var(--bg); }

.pillar-page.active {
  position: absolute;
  inset: 0;
  z-index: 12;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--bg);
  overflow-y: auto;
}
.pp-inner {
  max-width: 440px;
  text-align: center;
  display: flex; flex-direction: column; align-items: center;
}
.pp-icon {
  width: 72px; height: 72px;
  border-radius: 22px;
  background: var(--brand-soft);
  color: var(--brand);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 18px;
}
.pp-icon .icon { width: 32px; height: 32px; }
.pp-badge {
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  background: var(--brand-soft);
  color: var(--brand-ink);
  font-size: 12px; font-weight: 700;
  margin-bottom: 12px;
}
.pp-inner h1 { margin: 0 0 8px; font-size: 28px; font-weight: 700; letter-spacing: -0.02em; }
.pp-inner p { margin: 0; font-size: 14px; line-height: 1.6; color: var(--text-dim); }

/* ---------- Login: notice block ---------- */

.lg-news {
  position: fixed;
  top: 28px;
  right: clamp(24px, 4vw, 48px);
  z-index: 2;
  width: min(340px, calc(100vw - 48px));
  max-height: calc(100vh - 56px);
  overflow-y: auto;
  padding: 16px 16px 8px;
  border-radius: 22px;
  background: rgba(24, 20, 17, 0.6);
  -webkit-backdrop-filter: blur(22px) saturate(1.3);
  backdrop-filter: blur(22px) saturate(1.3);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  animation: lg-rise 0.7s 0.15s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.lg-news-head {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 10px;
  font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  color: #e9b57c;
}
.lg-news-list { list-style: none; margin: 0; padding: 0; }
.lg-news-item {
  position: relative;
  margin-bottom: 10px;
  padding: 11px 12px 11px 16px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  font-size: 13px; line-height: 1.5;
  color: rgba(255, 255, 255, 0.78);
}
.lg-news-item::before {
  content: '';
  position: absolute; left: 0; top: 10px; bottom: 10px;
  width: 3px; border-radius: 3px;
  background: #d9954f;
}
.lg-news-item.warn::before { background: #e6b341; }
.lg-news-item.alert::before { background: #ef6a5e; }
.lg-news-item strong { display: block; margin-bottom: 2px; font-size: 13px; color: #fff; }
.lg-news-date { display: block; margin-top: 4px; font-size: 11px; color: rgba(255, 255, 255, 0.45); }
.lg-news-empty { margin: 0 0 10px; font-size: 13px; color: rgba(255, 255, 255, 0.55); }

@media (max-width: 1000px) {
  .lg-news { position: static; width: min(448px, 100%); margin-top: 16px; max-height: none; }
  .lg-stage { flex-direction: column; align-items: center; justify-content: center; }
}

.notice-admin-item { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; font-size: 12px; }
.notice-admin-item strong { display: block; font-size: 13px; }
.notice-admin-type { font-size: 10px; font-weight: 700; text-transform: uppercase; color: var(--brand-ink); }
.notice-admin-item.warn .notice-admin-type { color: var(--status-warn-ink); }
.notice-admin-item.alert .notice-admin-type { color: var(--danger); }

/* Narrow screens: the search box gives way so the asset sub-nav stays reachable. */
.search-box { flex-shrink: 1; min-width: 110px; }
.subnav { min-width: 0; flex: 0 1 auto; }
.subnav-tab { flex-shrink: 0; }
@media (max-width: 1100px) {
  #topbar:has(.subnav:not(.hidden)) .search-box { display: none; }
}

/* ---------- Fleet page ---------- */

.fleet-page.active {
  position: absolute;
  inset: 0;
  z-index: 12;
  display: block;
  background: var(--bg);
  overflow-y: auto;
}
.fleet-inner { max-width: 1320px; margin: 0 auto; padding: 26px clamp(16px, 3vw, 36px) 40px; }
.fleet-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.fleet-head h1 { margin: 0 0 4px; font-size: 26px; font-weight: 700; letter-spacing: -0.02em; }
.fleet-sub { margin: 0; font-size: 13px; color: var(--text-dim); }
.fleet-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.fleet-actions button { display: inline-flex; align-items: center; gap: 6px; padding: 10px 16px; font-size: 13px; }
#fleet-add-btn { background: var(--brand); color: var(--brand-on); }
.fleet-actions .toggle-row { margin: 0 6px 0 0; }

.fleet-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.fleet-filters { display: flex; gap: 8px; flex-wrap: wrap; }
.fleet-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 13px; font-weight: 600;
}
.fleet-chip:hover { color: var(--text); opacity: 1; border-color: var(--brand); }
.fleet-chip.active { background: var(--brand); border-color: var(--brand); color: var(--brand-on); }
.fleet-chip-n { font-size: 11px; padding: 1px 7px; border-radius: 999px; background: var(--surface-alt); color: var(--text-dim); }
.fleet-chip.active .fleet-chip-n { background: rgba(255, 255, 255, 0.22); color: inherit; }
.fleet-search { width: 320px; max-width: 100%; background: var(--surface); }

.fleet-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}
.fleet-bulk {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 18px;
  background: var(--brand-soft);
  color: var(--brand-ink);
  font-size: 13px; font-weight: 600;
}
.fleet-table-wrap { overflow-x: auto; }
.fleet-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.fleet-table th {
  text-align: left;
  padding: 14px 14px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--text-dim);
  background: var(--surface-alt);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  user-select: none;
}
.fleet-table th[data-sort] { cursor: pointer; }
.fleet-table th[data-sort]:hover, .fleet-table th.sorted { color: var(--brand-ink); }
.fleet-table th.sorted[data-dir="asc"]::after { content: ' \2191'; }
.fleet-table th.sorted[data-dir="desc"]::after { content: ' \2193'; }
.fleet-table td { padding: 13px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.fleet-table tbody tr { cursor: pointer; transition: background 0.12s; }
.fleet-table tbody tr:hover, .fleet-table tbody tr:focus-visible { background: var(--surface-alt); outline: none; }
.fleet-table tbody tr:last-child td { border-bottom: none; }
.fleet-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.fleet-table .muted { color: var(--text-dim); }
.fleet-table input[type="checkbox"] { width: 17px; height: 17px; padding: 0; accent-color: var(--brand); cursor: pointer; }
.col-check { width: 44px; padding-right: 0 !important; }
.col-rdw { width: 52px; }

.fleet-name-wrap { display: flex; align-items: center; gap: 12px; min-width: 240px; }
.fleet-locate {
  width: 38px; height: 38px; padding: 0;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s, transform 0.15s;
}
.fleet-locate:hover { background: var(--brand); color: var(--brand-on); opacity: 1; transform: scale(1.06); }
.fleet-locate .icon { width: 18px; height: 18px; }
.fleet-name { font-weight: 700; color: var(--brand-ink); display: flex; align-items: center; gap: 8px; }
.fleet-sub-line { font-size: 12px; color: var(--text-dim); margin-top: 2px; max-width: 330px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fleet-live-tag { font-size: 10px; font-weight: 700; padding: 1px 7px; border-radius: 999px; background: var(--status-good-soft); color: var(--status-good-ink); }

.fleet-plate {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 6px;
  background: #f6c945;
  color: #2b2d31;
  border: 1px solid rgba(0, 0, 0, 0.18);
  font-size: 12px; font-weight: 700; letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
}
.fleet-bar { display: inline-block; width: 54px; height: 6px; border-radius: 6px; background: var(--border); overflow: hidden; vertical-align: middle; margin-right: 8px; }
.fleet-bar-fill { display: block; height: 100%; border-radius: 6px; background: var(--status-good); }
.fleet-bar.mid .fleet-bar-fill { background: var(--status-warn); }
.fleet-bar.low .fleet-bar-fill { background: var(--danger); }
.fleet-energy { font-size: 13px; font-variant-numeric: tabular-nums; }

.fleet-rdw-btn {
  width: 34px; height: 34px; padding: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-dim);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
}
.fleet-rdw-btn:hover { color: var(--brand); border-color: var(--brand); background: var(--brand-soft); opacity: 1; }

.pill-brand { background: var(--brand-soft); color: var(--brand-ink); }
.pill-red { background: var(--danger-soft); color: var(--danger); }

.fleet-toast {
  position: fixed;
  left: 50%; bottom: 28px;
  transform: translateX(-50%);
  z-index: 1100;
  padding: 12px 18px;
  border-radius: var(--radius-pill);
  background: var(--chip-bg);
  color: var(--chip-text);
  font-size: 13px; font-weight: 600;
  box-shadow: var(--shadow-float);
  max-width: calc(100vw - 32px);
}

@media (max-width: 1250px) { .col-seen { display: none; } }
@media (max-width: 1050px) { .col-maint, .col-energy { display: none; } }
@media (max-width: 800px) { .col-apk { display: none; } .fleet-search { width: 100%; } }

/* ---------- Modals: add vehicle + RDW ---------- */

.modal-wide { width: min(640px, calc(100vw - 32px)); max-height: calc(100vh - 40px); overflow-y: auto; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 14px; }
.form-col.form-span { grid-column: 1 / -1; }
.form-col input, .form-col select { margin-bottom: 2px; }
.input-with-btn { display: flex; gap: 8px; }
.input-with-btn input { flex: 1; min-width: 0; }
.input-with-btn button { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; flex-shrink: 0; }
.rdw-status { margin: 6px 0 0; font-size: 12px; color: var(--text-dim); }
.rdw-status.ok { color: var(--status-good-ink); }
.rdw-status.warn { color: var(--status-warn-ink); }

.rdw-result { margin-top: 14px; padding: 16px; border-radius: var(--radius-md); background: var(--surface-alt); border: 1px solid var(--border); }
.rdw-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; font-size: 16px; }
.rdw-list { display: grid; grid-template-columns: auto 1fr; gap: 8px 18px; margin: 0; font-size: 13px; }
.rdw-list dt { color: var(--text-dim); }
.rdw-list dd { margin: 0; font-weight: 600; text-align: right; }

@media (max-width: 560px) { .form-grid { grid-template-columns: 1fr; } }
.fleet-table td { white-space: nowrap; }

/* ---------- Home: compact tracker list + hover card ---------- */

#live-list-view { width: 290px; bottom: auto; max-height: calc(100% - 40px); padding: 18px 16px; }
#live-list-view .panel-header { margin-bottom: 10px; }
#device-list { gap: 4px; }
.device-item {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: transparent;
  border-color: transparent;
}
.device-item:hover, .device-item:focus-visible { background: var(--brand-soft); border-color: transparent; outline: none; }
.device-name { font-size: 13px; min-width: 0; }
.device-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fleet-plate-sm { font-size: 10px; padding: 1px 7px; flex-shrink: 0; }

.device-hover {
  position: fixed;
  z-index: 900;
  width: 270px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-float);
  pointer-events: none;
  animation: dh-in 0.14s ease-out;
}
@keyframes dh-in { from { opacity: 0; } to { opacity: 1; } }
.dh-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; font-size: 14px; }
.dh-head .pill { margin-bottom: 0; padding: 3px 10px; font-size: 11px; }
.dh-row { display: flex; justify-content: space-between; align-items: baseline; gap: 14px; padding: 6px 0; border-top: 1px solid var(--border); font-size: 12px; }
.dh-label { color: var(--text-dim); flex-shrink: 0; }
.dh-value { font-weight: 600; text-align: right; }
.dh-foot { margin-top: 6px; font-size: 11px; color: var(--text-dim); }

.fleet-row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.col-rdw { width: 96px; }

/* Installateur commands: name + plain-language explanation */
.command-row .command-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.command-row .command-name { flex: none; }
.command-desc { font-size: 11px; line-height: 1.45; color: var(--text-dim); font-weight: 400; }
.command-group-title { margin: 10px 0 2px; font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-dim); }
.installer-panel > .hint { margin: 0; }

/* ---------- Delete asset + logs ---------- */

.delete-asset-row { margin-top: 18px; padding-top: 16px; border-top: 1px dashed var(--border); }
.btn-danger-outline {
  display: inline-flex; align-items: center; gap: 6px;
  background: transparent;
  color: var(--danger);
  border: 1px solid var(--danger);
  padding: 9px 14px; font-size: 13px;
}
.btn-danger-outline:hover { background: var(--danger-soft); opacity: 1; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:disabled { opacity: 0.4; cursor: not-allowed; }
.warn-banner {
  display: flex; gap: 12px; align-items: flex-start;
  margin: 8px 0 14px; padding: 12px 14px;
  border-radius: var(--radius-md);
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 13px; line-height: 1.5;
}
.warn-banner .icon { margin-top: 2px; }
.modal-content textarea {
  width: 100%;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 11px 14px;
  font-size: 14px; font-family: inherit;
  resize: vertical;
}
.modal-content textarea:focus { outline: 2px solid var(--brand); outline-offset: 1px; }
.modal-content input:disabled { opacity: 0.8; cursor: not-allowed; }

.log-item { display: flex; flex-direction: column; gap: 3px; font-size: 12px; }
.log-top { display: flex; justify-content: space-between; gap: 8px; }
.log-top span, .log-meta { color: var(--text-dim); font-size: 11px; }
.log-reason { font-size: 12px; margin-top: 2px; }

/* ---------- History: day navigation + GPS pins ---------- */

.day-nav { display: flex; gap: 8px; align-items: center; }
.day-nav input { flex: 1; min-width: 0; }
.day-btn {
  width: 40px; height: 40px; padding: 0; flex-shrink: 0;
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
  color: var(--text);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
}
.day-btn:hover:not(:disabled) { border-color: var(--brand); color: var(--brand); opacity: 1; }
.day-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.day-next { transform: rotate(180deg); }
.day-quick { display: flex; gap: 8px; align-items: center; margin: 10px 0 4px; }
.history-summary { margin-top: 10px; font-weight: 600; }
#history-custom { margin-top: 6px; }

.hist-pin { position: relative; width: 100%; height: 100%; }
.hist-pin span {
  position: absolute; left: 50%; top: 0;
  width: 70%; height: 70%;
  margin-left: -35%;
  background: var(--brand);
  border: 2px solid #fff;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  transform-origin: 50% 100%;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}
.hist-pin span::after { content: ''; position: absolute; inset: 28%; border-radius: 50%; background: #fff; }
.hist-pin.start span { background: #5c8a3e; }
.hist-pin.end span { background: #8a5320; }
.hist-pin.point span { width: 62%; height: 62%; margin-left: -31%; opacity: 0.92; }
.hist-popup { font-size: 12px; line-height: 1.5; min-width: 130px; }
.hist-popup strong { display: block; font-size: 13px; }
.hist-coords { color: #6e6a63; font-variant-numeric: tabular-nums; }

/* ---------- Geofence menu: draw tools, place search ---------- */

.gf-tools { display: flex; gap: 8px; margin-bottom: 6px; }
.gf-tool {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 10px;
  background: var(--surface-alt); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius-md);
  font-size: 13px;
}
.gf-tool .icon { color: var(--brand); }
.gf-tool:hover { border-color: var(--brand); opacity: 1; }
.gf-tool.active { background: var(--brand); color: var(--brand-on); border-color: var(--brand); }
.gf-tool.active .icon { color: var(--brand-on); }
#panel-geofences .timeline-title { margin-top: 18px; }
#panel-geofences .timeline-title:first-of-type { margin-top: 4px; }
.gf-source-row { margin-top: 8px; }
.gf-ext-links { display: flex; gap: 14px; margin: 8px 0 4px; font-size: 12px; }
.gf-ext-links a, .gf-result-links a { color: var(--brand-ink); font-weight: 600; text-decoration: none; }
.gf-ext-links a:hover, .gf-result-links a:hover { text-decoration: underline; }
.gf-results { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.gf-result {
  display: grid; grid-template-columns: 1fr auto; gap: 2px 10px;
  padding: 10px 12px;
  background: var(--surface-alt); border: 1px solid var(--border); border-radius: var(--radius-md);
  cursor: pointer;
}
.gf-result:hover, .gf-result:focus-visible { border-color: var(--brand); outline: none; }
.gf-result-main { display: flex; flex-direction: column; min-width: 0; }
.gf-result-main strong { font-size: 13px; }
.gf-result-main span { font-size: 11px; color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gf-result-dist { font-size: 11px; font-weight: 700; color: var(--brand-ink); align-self: start; }
.gf-result-links { grid-column: 1 / -1; display: flex; gap: 12px; font-size: 11px; margin-top: 4px; }

.gf-place { margin-top: 14px; padding: 14px; border-radius: var(--radius-md); background: var(--brand-soft); border: 1px solid var(--border); }
.gf-place-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.gf-place-head strong { font-size: 14px; }
.detail-close-mini { width: 26px; height: 26px; padding: 0; border-radius: 50%; background: var(--surface); color: var(--text-dim); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; }
.gf-radius-row { display: flex; flex-direction: column; gap: 8px; }
.gf-chips { display: flex; gap: 6px; }
.gf-chips button { flex: 1; padding: 6px 0; font-size: 12px; background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.gf-chips button:hover { border-color: var(--brand); opacity: 1; }
.gf-place-actions { display: flex; gap: 8px; margin-top: 8px; }
.gf-place-actions .btn-small { flex: 1; font-size: 12px; padding: 8px 6px; }

/* ---------- Asset-profiel page (admin-only editing) ---------- */

.profile-fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.profile-fieldset:disabled input, .profile-fieldset:disabled select, .profile-fieldset:disabled button { cursor: not-allowed; }
.profile-fieldset:disabled .settings-section { opacity: 0.75; }
.lock-note {
  margin: 0 0 14px; padding: 10px 12px;
  border-radius: var(--radius-md);
  background: var(--brand-soft); color: var(--brand-ink);
  font-size: 12px; font-weight: 600; line-height: 1.5;
}
.btn-danger-outline:disabled { opacity: 0.45; cursor: not-allowed; background: transparent; }
.fleet-rdw-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.fleet-rdw-btn:disabled:hover { color: var(--text-dim); border-color: var(--border); background: transparent; }

/* ---------- Rapportage ---------- */

.reports-page.active { position: absolute; inset: 0; z-index: 12; display: block; background: var(--bg); overflow-y: auto; }
.rep-inner { max-width: 1180px; margin: 0 auto; padding: 26px clamp(16px, 3vw, 36px) 48px; }
.rep-inner > .fleet-head h1 { margin: 0 0 4px; font-size: 26px; font-weight: 700; letter-spacing: -0.02em; }
#rep-content { display: flex; flex-direction: column; gap: 18px; }

.rep-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-soft); padding: 22px 24px; }
.rep-card h3 { margin: 0; font-size: 15px; font-weight: 700; }
.rep-card-sub { margin: 4px 0 0; font-size: 12px; color: var(--text-dim); }
.rep-card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.rep-card-head .rep-card-sub { margin: 0; }

.rep-hero { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 18px; }
.rep-donut-row { display: flex; align-items: center; gap: 28px; margin-top: 14px; flex-wrap: wrap; }
.rep-donut-wrap { position: relative; width: 168px; height: 168px; flex-shrink: 0; }
.rep-donut { width: 100%; height: 100%; }
.rep-donut-track { stroke: var(--surface-alt); }
.rep-donut-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.rep-donut-center strong { font-size: 32px; font-weight: 800; letter-spacing: -0.02em; line-height: 1; }
.rep-donut-center span { font-size: 11px; color: var(--text-dim); margin-top: 4px; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; }
.rep-legend { list-style: none; margin: 0; padding: 0; flex: 1; min-width: 190px; display: flex; flex-direction: column; gap: 9px; }
.rep-legend li { display: flex; align-items: center; gap: 10px; font-size: 12px; }
.rep-legend .rep-legend-label { flex: 1; color: var(--text-dim); }
.rep-legend strong { font-size: 14px; font-variant-numeric: tabular-nums; }
.rep-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }

.rep-kpis { display: grid; grid-template-rows: repeat(3, 1fr); gap: 12px; }
.rep-kpi {
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 2px 12px;
  padding: 14px 20px;
  background: var(--surface); border: 1px solid var(--border); border-left: 5px solid var(--status-good);
  border-radius: var(--radius-md); box-shadow: var(--shadow-soft);
}
.rep-kpi.warn { border-left-color: var(--status-warn); }
.rep-kpi.bad { border-left-color: var(--danger); }
.rep-kpi-q { grid-column: 1; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-dim); }
.rep-kpi-big { grid-column: 2; grid-row: 1 / span 2; font-size: 30px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.rep-kpi.good .rep-kpi-big { color: var(--status-good-ink); }
.rep-kpi.warn .rep-kpi-big { color: var(--status-warn-ink); }
.rep-kpi.bad .rep-kpi-big { color: var(--danger); }
.rep-kpi-sub { grid-column: 1; font-size: 13px; font-weight: 600; }

.rep-attn { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.rep-attn-item { display: flex; align-items: center; gap: 14px; padding: 11px 14px 11px 0; background: var(--surface-alt); border-radius: var(--radius-md); overflow: hidden; }
.rep-attn-bar { align-self: stretch; width: 5px; background: var(--status-warn); flex-shrink: 0; }
.rep-attn-item.sev2 .rep-attn-bar { background: var(--danger); }
.rep-attn-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.rep-attn-body strong { font-size: 13px; display: flex; align-items: center; gap: 8px; }
.rep-attn-body span:not(.rep-kind) { color: var(--text-dim); }
.rep-kind { font-size: 10px; font-weight: 700; padding: 1px 8px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-ink); }

.rep-more { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-soft); }
.rep-more > summary, .rep-sec > summary { cursor: pointer; list-style: none; font-weight: 700; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.rep-more > summary::-webkit-details-marker, .rep-sec > summary::-webkit-details-marker { display: none; }
.rep-more > summary { padding: 18px 24px; font-size: 15px; }
.rep-more > summary::after, .rep-sec > summary::after { content: ''; width: 8px; height: 8px; border-right: 2px solid var(--text-dim); border-bottom: 2px solid var(--text-dim); transform: rotate(45deg); transition: transform 0.15s; margin-right: 4px; }
.rep-more[open] > summary::after, .rep-sec[open] > summary::after { transform: rotate(-135deg); }
.rep-more > #rep-sections, .rep-more > .rep-sec { margin: 0 24px; }
.rep-sec { border-top: 1px solid var(--border); padding: 16px 0; }
.rep-more > .rep-sec:last-child { margin-bottom: 8px; }
.rep-sec > summary { font-size: 14px; }
.rep-sec > .hint { margin: 10px 0; }
.rep-sub { margin: 18px 0 8px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-dim); }
.rep-table-wrap { overflow-x: auto; margin-top: 10px; }
.rep-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.rep-table th { text-align: left; padding: 9px 12px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-dim); background: var(--surface-alt); white-space: nowrap; }
.rep-table td { padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.rep-table tr:last-child td { border-bottom: none; }
.rep-bar-cell { display: inline-flex; align-items: center; white-space: nowrap; }
.rep-more #reports-list { padding-bottom: 6px; }

@media (max-width: 1000px) { .rep-hero { grid-template-columns: 1fr; } .rep-kpis { grid-template-rows: none; } }

/* ---------- Driver module ---------- */

.driver-page.active { position: absolute; inset: 0; z-index: 12; display: block; background: var(--bg); overflow-y: auto; }
.drv-inner { max-width: 1280px; margin: 0 auto; padding: 26px clamp(16px, 3vw, 36px) 48px; }
.drv-inner > .fleet-head h1 { margin: 0 0 4px; font-size: 26px; font-weight: 700; letter-spacing: -0.02em; }
.drv-tabs { display: flex; gap: 6px; padding: 4px; width: fit-content; max-width: 100%; margin-bottom: 18px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-pill); overflow-x: auto; }
.drv-tab { background: transparent; color: var(--text-dim); padding: 9px 18px; border-radius: var(--radius-pill); font-size: 13px; white-space: nowrap; }
.drv-tab:hover { color: var(--text); opacity: 1; }
.drv-tab.active { background: var(--brand); color: var(--brand-on); }
.drv-tab-sub { font-weight: 500; opacity: 0.8; margin-left: 6px; font-size: 11px; }
.drv-lead { margin: 0 0 16px; max-width: 760px; font-size: 13px; line-height: 1.55; }

.drv-board { display: grid; grid-template-columns: minmax(280px, 340px) minmax(0, 1fr); gap: 18px; margin-bottom: 18px; align-items: start; }
.drv-col { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-soft); padding: 18px; }
.drv-col h3 { margin: 0 0 12px; font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-dim); }
.drv-people { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.drv-person { display: flex; align-items: center; gap: 12px; padding: 10px 12px; background: var(--surface-alt); border: 1px solid var(--border); border-radius: var(--radius-md); cursor: pointer; transition: border-color 0.15s, box-shadow 0.15s, opacity 0.15s; }
.drv-person[draggable="true"] { cursor: grab; }
.drv-person:hover { border-color: var(--brand); }
.drv-person.selected { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.drv-person.dragging { opacity: 0.45; }
.drv-avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-ink); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; flex-shrink: 0; }
.drv-avatar.sm { width: 30px; height: 30px; font-size: 11px; }
.drv-person-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.drv-person-body strong { font-size: 14px; }
.drv-sub { font-size: 11px; color: var(--text-dim); }
.drv-person-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.drv-chip { font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-ink); white-space: nowrap; }
.drv-chip.linked { background: var(--status-good-soft); color: var(--status-good-ink); }
.drv-chip.muted { background: var(--surface); color: var(--text-dim); border: 1px solid var(--border); }

.drv-vehicles { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.drv-vehicle { display: flex; flex-direction: column; gap: 10px; padding: 14px; background: var(--surface-alt); border: 1px solid var(--border); border-radius: var(--radius-md); transition: border-color 0.15s, background 0.15s, transform 0.15s; }
.drv-vehicle.can-drop { border-style: dashed; border-color: var(--brand); }
.drv-vehicle.drag-over { background: var(--brand-soft); border-style: solid; transform: scale(1.015); }
.drv-vehicle-head { display: flex; align-items: center; gap: 10px; }
.drv-vehicle-icon { width: 36px; height: 36px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); color: var(--brand); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.drv-vehicle-title { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.drv-vehicle-title strong { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drv-slot { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 8px 12px; border-radius: var(--radius-md); font-size: 12px; }
.drv-slot.empty { border: 2px dashed var(--border); color: var(--text-dim); justify-content: center; text-align: center; }
.drv-slot.filled { background: var(--surface); border: 1px solid var(--status-good); }
.drv-slot.login { background: var(--surface); border: 1px solid var(--border); color: var(--text-dim); }
.drv-slot-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.drv-slot-text strong { font-size: 13px; }
.drv-unlink { width: 26px; height: 26px; padding: 0; border-radius: 50%; background: transparent; color: var(--text-dim); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; }
.drv-unlink:hover:not(:disabled) { color: var(--danger); border-color: var(--danger); opacity: 1; }
.drv-unlink:disabled { opacity: 0.4; cursor: not-allowed; }
.drv-pick { font-size: 12px; padding: 8px 10px; }

.drv-trips { margin-top: 0; }
.drv-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.drv-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
.drv-kpi { padding: 14px 16px; background: var(--surface-alt); border-radius: var(--radius-md); display: flex; flex-direction: column; gap: 2px; }
.drv-kpi strong { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; }
.drv-kpi span { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-dim); }

.drv-methods { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; margin-bottom: 18px; }
.drv-method { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.drv-method-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; }
.drv-method .pp-badge { margin: 0; }
#drv-login > .rep-card { margin-bottom: 18px; }
#drv-login select { min-width: 190px; }
.drv-sample-label { margin: 16px 0 0; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-dim); }
.rep-table.sample { opacity: 0.5; }

@media (max-width: 900px) { .drv-board { grid-template-columns: 1fr; } }

/* ---------- Sign-in / unsigned driver messages ---------- */

.danger-text { color: var(--danger); font-weight: 700; }
.signin-alert { margin: 0 0 12px; padding: 11px 13px; border-radius: var(--radius-md); background: var(--danger-soft); color: var(--danger); font-size: 13px; line-height: 1.45; }
.detail-signin { margin: 4px 0 14px; }
.signin-list { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.signin-item { display: flex; flex-direction: column; gap: 1px; padding: 8px 10px; border-radius: var(--radius-sm); background: var(--surface-alt); border-left: 4px solid var(--status-good); font-size: 12px; }
.signin-item.bad { border-left-color: var(--danger); }
.signin-item strong { font-size: 12px; }
.signin-item span { color: var(--text-dim); font-size: 11px; }
.drv-alert-card { border-color: var(--danger); }
.drv-live-alert { margin: 0 0 10px; padding: 10px 12px; border-radius: var(--radius-md); background: var(--danger-soft); color: var(--danger); font-size: 13px; font-weight: 700; }
.drv-group { display: flex; align-items: center; gap: 8px; margin: 18px 0 6px; }
.drv-group .drv-sample-label { margin: 0 6px 0 0; }

/* ---------- Fleet filter chips: one palette colour per status ---------- */

.fleet-chip[data-kind] {
  --chip-c: var(--text);
  --chip-soft: var(--surface-alt);
  --chip-ink: var(--text);
  --chip-on: var(--bg);
}
.fleet-chip[data-kind="moving"]  { --chip-c: var(--status-good); --chip-soft: var(--status-good-soft); --chip-ink: var(--status-good-ink); --chip-on: #ffffff; }
.fleet-chip[data-kind="idle"]    { --chip-c: var(--brand);       --chip-soft: var(--brand-soft);       --chip-ink: var(--brand-ink);       --chip-on: var(--brand-on); }
.fleet-chip[data-kind="offline"] { --chip-c: #8d867b;            --chip-soft: var(--surface-alt);      --chip-ink: var(--text-dim);        --chip-on: #ffffff; }
.fleet-chip[data-kind="maint"]   { --chip-c: var(--status-warn); --chip-soft: var(--status-warn-soft); --chip-ink: var(--status-warn-ink); --chip-on: #2a1806; }
:root[data-theme="dark"] .fleet-chip[data-kind="moving"] { --chip-on: #17210f; }
:root[data-theme="dark"] .fleet-chip[data-kind="offline"] { --chip-c: #8a857c; --chip-on: #16171a; }

.fleet-chip[data-kind] { padding-left: 12px; }
.fleet-chip[data-kind]:not([data-kind="all"])::before {
  content: ''; width: 9px; height: 9px; border-radius: 50%; background: var(--chip-c); flex-shrink: 0;
}
.fleet-chip[data-kind] .fleet-chip-n { background: var(--chip-soft); color: var(--chip-ink); font-weight: 700; }
.fleet-chip[data-kind]:hover { border-color: var(--chip-c); }
.fleet-chip[data-kind].active { background: var(--chip-c); border-color: var(--chip-c); color: var(--chip-on); box-shadow: 0 6px 16px -8px var(--chip-c); }
.fleet-chip[data-kind].active::before { background: var(--chip-on); opacity: 0.85; }
.fleet-chip[data-kind].active .fleet-chip-n { background: rgba(255, 255, 255, 0.24); color: inherit; }
.fleet-chip[data-kind="maint"].active .fleet-chip-n { background: rgba(42, 24, 6, 0.14); }

/* ---------- Map layers (NDW live traffic + Open Charge Map) ---------- */

.ml-control { position: relative; border: none; background: none; box-shadow: none; margin-bottom: 10px; }
.ml-toggle {
  position: relative; width: 44px; height: 44px; padding: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-md); border: 1px solid var(--border);
  background: var(--surface); color: var(--text); box-shadow: var(--shadow-float);
}
.ml-toggle:hover { color: var(--brand); opacity: 1; }
.ml-count {
  position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 999px; background: var(--brand); color: var(--brand-on);
  font-size: 11px; font-weight: 700; line-height: 18px; text-align: center;
}
.ml-menu {
  position: absolute; right: 0; bottom: 54px; width: 300px; max-height: min(560px, calc(100vh - 200px)); overflow-y: auto;
  padding: 14px 14px 10px; border-radius: var(--radius-lg);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-float);
  color: var(--text); text-align: left;
}
.ml-title { font-size: 15px; font-weight: 700; margin-bottom: 6px; }
.ml-head { display: flex; align-items: center; gap: 8px; margin: 12px 0 4px; font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-dim); }
.ml-live { padding: 1px 7px; border-radius: 999px; background: var(--danger); color: #fff; font-size: 10px; letter-spacing: 0.08em; }
.ml-row { display: flex; align-items: flex-start; gap: 10px; padding: 8px 6px; margin: 0; border-radius: var(--radius-sm); cursor: pointer; color: var(--text); font-size: 13px; }
.ml-row:hover { background: var(--surface-alt); }
.ml-row input { width: auto; margin-top: 2px; accent-color: var(--brand); flex-shrink: 0; }
.ml-swatch { width: 12px; height: 12px; border-radius: 4px; margin-top: 3px; flex-shrink: 0; }
.ml-row-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.ml-row-text strong { font-size: 13px; font-weight: 600; }
.ml-row-text small { font-size: 11px; color: var(--text-dim); font-weight: 400; }
.ml-foot { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--border); font-size: 11px; color: var(--text-dim); }
.ml-foot a, .ml-popup a { color: var(--brand-ink); font-weight: 600; }

.ml-popup { font-size: 12px; line-height: 1.5; min-width: 170px; }
.ml-popup strong { display: block; font-size: 13px; margin-bottom: 2px; }
.ml-warn { color: var(--c); width: 26px; height: 26px; display: flex; align-items: center; justify-content: center; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.35)); }
.ml-warn svg { width: 24px; height: 24px; }
.ml-ev { width: 26px; height: 26px; border-radius: 50%; border: 2px solid #fff; display: flex; align-items: center; justify-content: center; color: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4); }
.ml-ev.fast { background: var(--brand); }
.ml-ev.slow { background: var(--status-good); }
.ml-ev.off { background: #8d867b; }
.ml-fuel { width: 26px; height: 26px; border-radius: 8px; border: 2px solid #fff; background: #2b2d31; color: #e9b57c; display: flex; align-items: center; justify-content: center; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4); }
.ml-styles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 2px 0 4px; }
.ml-style { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 4px 5px; border-radius: var(--radius-sm); border: 1.5px solid var(--border); background: var(--surface); color: var(--text); font-size: 11.5px; font-weight: 600; cursor: pointer; }
.ml-style:hover { background: var(--surface-alt); }
.ml-style.on { border-color: var(--brand); background: var(--surface-alt); }
.ml-style:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.ml-thumb { width: 100%; height: 30px; border-radius: 6px; border: 1px solid rgba(0, 0, 0, 0.12); background: #e8eedf; }
.ml-style[data-style="rustig"] .ml-thumb { background: linear-gradient(135deg, #e6e6e4 0 55%, #d3d6d8 55% 70%, #efefed 70%); }
.ml-style[data-style="kaart"] .ml-thumb { background: linear-gradient(135deg, #e5ecd8 0 50%, #f4d98f 50% 62%, #b9d4ea 62% 78%, #e5ecd8 78%); }
.ml-style[data-style="lucht"] .ml-thumb { background: linear-gradient(135deg, #5f7a46 0 40%, #8f8a6a 40% 62%, #3f5a3a 62%); }
.ml-style[data-style="detail"] .ml-thumb { background: repeating-linear-gradient(90deg, #cdd0d4 0 6px, #f1ebd9 6px 7px), #f1ebd9; }
.ml-style[data-style="wereld"] .ml-thumb { background: linear-gradient(135deg, #aad3df 0 35%, #f2efe9 35% 70%, #c8e6a1 70%); }
.ml-style-note { margin: 2px 2px 4px; font-size: 11.5px; color: var(--text-dim); }
.ml-select { width: 100%; margin: 2px 0 6px 28px; max-width: calc(100% - 28px); font-size: 12px; padding: 7px 10px; }
.ml-cluster { width: 34px; height: 34px; border-radius: 50%; background: #2b2d31; color: #e9b57c; border: 3px solid #fff; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; box-shadow: 0 1px 5px rgba(0, 0, 0, 0.4); }
.ml-open { display: flex; align-items: center; gap: 4px; margin: 0 0 6px 28px; font-size: 12px; color: var(--text-dim); font-weight: 500; cursor: pointer; }
.ml-open input { width: auto; accent-color: var(--brand); }

/* ======================================================================
   SAFETY: its own fresh green look (palette 50-900, Plus Jakarta Sans)
   ====================================================================== */

.safety-page {
  --g900: #003318; --g800: #04592c; --g700: #0a8242; --g600: #14a357; --g500: #27c472; --g400: #4ddb90;
  --g300: #75ebac; --g200: #a2facb; --g100: #cbfee3; --g50: #ebfff4;
  --sf-bg: #f3f6f4; --sf-card: #ffffff; --sf-ink: #14201a; --sf-dim: #6a7871; --sf-line: #e4ebe6;
  --sf-green: #22b866; --sf-orange: #f08a24; --sf-yellow: #f2b632; --sf-red: #e5484d; --sf-grey: #9aa6a0;
  font-family: 'Plus Jakarta Sans', var(--font);
}
:root[data-theme="dark"] .safety-page {
  --sf-bg: #0b1812; --sf-card: #11251b; --sf-ink: #ecf6f0; --sf-dim: #8fa89b; --sf-line: #1d3a2b; --sf-grey: #5d7468;
}
.safety-page.active { position: absolute; inset: 0; z-index: 12; display: block; background: var(--sf-bg); overflow-y: auto; color: var(--sf-ink); }
.sf-inner { max-width: 1240px; margin: 0 auto; padding: 28px clamp(16px, 3vw, 40px) 56px; }
.sf-inner h1 { margin: 0; font-size: 34px; font-weight: 800; letter-spacing: -0.03em; }
.sf-inner h3 { margin: 0; font-size: 17px; font-weight: 700; letter-spacing: -0.01em; }
.sf-h2 { margin: 34px 0 14px; font-size: 22px; font-weight: 800; letter-spacing: -0.02em; }
.sf-sub { margin: 3px 0 0; font-size: 12.5px; color: var(--sf-dim); }
.sf-empty { color: var(--sf-dim); font-size: 13px; }
.sf-foot { margin-top: 26px; font-size: 12px; color: var(--sf-dim); text-align: center; }

.sf-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.sf-head p { margin: 4px 0 0; color: var(--sf-dim); font-size: 14px; }
.sf-controls { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.sf-select {
  width: auto; min-width: 230px; padding: 11px 38px 11px 16px; font-family: inherit; font-size: 14px; font-weight: 600;
  border-radius: 14px; border: 1px solid var(--sf-line); background: var(--sf-card); color: var(--sf-ink);
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2314a357' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
}
.sf-select:focus { outline: 2px solid var(--g500); outline-offset: 1px; }
.sf-tabs { display: flex; padding: 4px; border-radius: 14px; background: var(--sf-card); border: 1px solid var(--sf-line); }
.sf-tab { background: transparent; color: var(--sf-dim); padding: 8px 16px; border-radius: 10px; font-family: inherit; font-size: 13px; font-weight: 600; }
.sf-tab:hover { color: var(--sf-ink); opacity: 1; }
.sf-tab.active { background: var(--g600); color: #fff; }

.sf-card { background: var(--sf-card); border-radius: 24px; padding: 22px 24px; box-shadow: 0 14px 34px -22px rgba(4, 89, 44, 0.28); border: 1px solid var(--sf-line); }
.sf-note { margin-bottom: 18px; padding: 14px 18px; border-radius: 16px; background: #fff4e5; color: #8a4b00; font-size: 13.5px; line-height: 1.55; }
:root[data-theme="dark"] .sf-note { background: #3a2a10; color: #f6c88a; }

/* KPI bar */
.sf-kpibar { display: grid; grid-template-columns: minmax(250px, 0.9fr) minmax(300px, 1.3fr) minmax(280px, 1.1fr); gap: 16px; margin-bottom: 16px; align-items: stretch; }
.sf-hero {
  position: relative; display: flex; flex-direction: column; gap: 6px; padding: 24px 26px; border-radius: 28px; color: #fff; overflow: hidden;
  background: linear-gradient(145deg, var(--g400), var(--g600) 70%); box-shadow: 0 22px 40px -22px rgba(10, 130, 66, 0.7);
}
.sf-hero.mid { background: linear-gradient(145deg, #f7c14a, #e8962a 75%); box-shadow: 0 22px 40px -22px rgba(232, 150, 42, 0.7); }
.sf-hero.bad { background: linear-gradient(145deg, #f27a7d, #d6393f 75%); box-shadow: 0 22px 40px -22px rgba(214, 57, 63, 0.7); }
.sf-hero::after { content: ''; position: absolute; right: -50px; top: -60px; width: 190px; height: 190px; border-radius: 50%; background: rgba(255, 255, 255, 0.14); }
.sf-hero-l { font-size: 15px; font-weight: 600; opacity: 0.95; }
.sf-hero-num { display: flex; align-items: baseline; gap: 6px; line-height: 1; margin: 6px 0 4px; }
.sf-hero-num strong { font-size: 92px; font-weight: 800; letter-spacing: -0.05em; }
.sf-hero-num span { font-size: 26px; font-weight: 600; opacity: 0.8; }
.sf-hero-meta { display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 600; flex-wrap: wrap; }
.sf-chip { padding: 4px 12px; border-radius: 999px; background: rgba(255, 255, 255, 0.24); }
.sf-hero-link { margin-top: auto; align-self: flex-start; padding: 8px 0 0; background: none; color: #fff; font-family: inherit; font-size: 13.5px; font-weight: 700; }

.sf-today { display: flex; flex-direction: column; gap: 10px; }
.sf-today-head { display: flex; justify-content: space-between; }
.sf-today-num { display: flex; align-items: baseline; gap: 10px; }
.sf-today-num strong { font-size: 64px; font-weight: 800; letter-spacing: -0.04em; line-height: 1; }
.sf-today-num span { font-size: 14px; color: var(--sf-dim); font-weight: 600; }
.sf-segbar { display: flex; gap: 3px; height: 10px; border-radius: 999px; overflow: hidden; }
.sf-segbar i { display: block; border-radius: 999px; min-width: 6px; }
.sf-segtiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 4px; }
.sf-segtiles div { position: relative; padding: 12px 14px; border-radius: 16px; background: var(--sf-bg); display: flex; flex-direction: column; gap: 2px; }
.sf-segtiles span { font-size: 12px; color: var(--sf-dim); font-weight: 600; }
.sf-segtiles strong { font-size: 18px; font-weight: 800; letter-spacing: -0.02em; }
.sf-segtiles em { position: absolute; right: 12px; bottom: 16px; width: 9px; height: 9px; border-radius: 50%; }

.sf-issues { display: flex; flex-direction: column; gap: 10px; }
.sf-issues-head { display: flex; justify-content: space-between; align-items: center; }
.sf-link { background: none; color: var(--g700); font-family: inherit; font-size: 13.5px; font-weight: 700; padding: 0; }
:root[data-theme="dark"] .sf-link { color: var(--g400); }
.sf-issue { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 18px; background: var(--sf-bg); }
.sf-issue-ic { flex: 0 0 38px; height: 38px; border-radius: 50%; background: var(--sf-orange); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; }
.sf-issue div { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.sf-issue strong { font-size: 14px; }
.sf-issue span:not(.sf-issue-ic) { font-size: 12px; color: var(--sf-dim); }

/* metric tiles */
.sf-tiles { display: grid; grid-template-columns: repeat(6, minmax(150px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 4px; }
.sf-tile { background: var(--sf-card); border: 1px solid var(--sf-line); border-radius: 22px; padding: 16px 18px; box-shadow: 0 14px 34px -24px rgba(4, 89, 44, 0.3); min-width: 150px; }
.sf-tile h4 { margin: 0 0 2px; font-size: 14.5px; font-weight: 700; }
.sf-delta { font-size: 11.5px; font-weight: 700; }
.sf-delta.up { color: var(--sf-green); }
.sf-delta.down { color: var(--sf-red); }
.sf-tile-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 6px; margin-top: 10px; }
.sf-tile-row strong { font-size: 36px; font-weight: 800; letter-spacing: -0.04em; line-height: 1; }
.sf-tile-row strong.good { color: var(--sf-ink); }
.sf-tile-row strong.mid { color: #c98a14; }
.sf-tile-row strong.bad { color: var(--sf-red); }
.sf-spark { width: 62%; max-width: 110px; height: 40px; flex-shrink: 0; }

/* detail grid */
.sf-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.sf-grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.sf-span2 { grid-column: span 2; }
.sf-span3 { grid-column: 1 / -1; }
.sf-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 8px; flex-wrap: wrap; }
.sf-legend { display: flex; gap: 16px; font-size: 12.5px; font-weight: 600; }
.sf-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; }
.sf-legend i.g { background: var(--sf-green); }
.sf-legend i.o { background: var(--sf-orange); }
.sf-chart { width: 100%; height: auto; display: block; }
.sf-grid line.sf-grid, .sf-chart .sf-grid { stroke: var(--sf-line); stroke-width: 1; }
.sf-axis { fill: var(--sf-dim); font-size: 11px; font-family: inherit; }
.sf-line-a { stroke: var(--sf-green); stroke-width: 3; stroke-linecap: round; }
.sf-line-b { stroke: var(--sf-orange); stroke-width: 3; stroke-linecap: round; }
.sf-dot { fill: var(--sf-card); stroke: var(--sf-green); stroke-width: 3; }

.sf-event { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 14px 0; border-top: 1px solid var(--sf-line); }
.sf-card > .sf-sub + .sf-event { margin-top: 10px; }
.sf-event div { display: flex; flex-direction: column; gap: 1px; }
.sf-event strong { font-size: 15px; }
.sf-event div span { font-size: 12px; color: var(--sf-dim); }
.sf-event b { font-size: 34px; font-weight: 800; letter-spacing: -0.04em; }
.sf-event b small { font-size: 14px; font-weight: 600; margin-left: 2px; }
.sf-event b.hot { color: var(--sf-orange); }
.sf-event b.ok { color: var(--g600); }

.sf-bands { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.sf-band { display: grid; grid-template-columns: 104px 1fr 52px; gap: 10px; align-items: center; font-size: 12.5px; }
.sf-band-l { color: var(--sf-dim); font-weight: 600; }
.sf-band-bar { height: 10px; border-radius: 999px; background: var(--sf-bg); overflow: hidden; }
.sf-band-bar i { display: block; height: 100%; border-radius: 999px; background: var(--g500); }
.sf-band-bar i.hot { background: var(--sf-orange); }
.sf-band strong { text-align: right; font-weight: 700; }

.sf-cons { display: flex; align-items: baseline; gap: 8px; margin: 14px 0 4px; }
.sf-cons strong { font-size: 52px; font-weight: 800; letter-spacing: -0.04em; line-height: 1; }
.sf-cons span { font-size: 14px; color: var(--sf-dim); font-weight: 600; }
.sf-cons ~ .sf-spark { width: 100%; max-width: none; height: 54px; margin-top: 12px; }

.sf-na { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; margin-top: 10px; }
.sf-na > span { font-size: 38px; font-weight: 800; color: var(--sf-grey); }

/* score history + fleet comparison */
.sf-table { display: flex; flex-direction: column; }
.sf-row { display: grid; grid-template-columns: 150px repeat(6, minmax(70px, 1fr)) minmax(210px, 1.6fr); gap: 12px; align-items: center; padding: 16px 4px; border-top: 1px solid var(--sf-line); background: none; color: var(--sf-ink); text-align: left; font-family: inherit; border-radius: 0; }
.sf-row:first-child { border-top: none; }
.sf-date { font-size: 13.5px; font-weight: 600; display: flex; flex-direction: column; gap: 2px; }
.sf-date small { color: var(--sf-dim); font-weight: 500; font-size: 11.5px; }
.sf-cell, .sf-overall { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.sf-cell small, .sf-overall small { font-size: 11.5px; color: var(--sf-dim); font-weight: 500; }
.sf-cell b { font-size: 14px; font-weight: 700; display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.sf-cell i, .sf-overall i.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.sf-cell i.good { background: var(--sf-green); } .sf-cell i.mid { background: var(--sf-yellow); } .sf-cell i.bad { background: var(--sf-red); }
.sf-overall { display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto; column-gap: 12px; align-items: center; }
.sf-overall small { grid-column: 1 / -1; }
.sf-overall b { font-size: 14px; font-weight: 800; }
.sf-pbar { height: 8px; border-radius: 999px; background: var(--sf-bg); overflow: hidden; }
.sf-pbar i { display: block; height: 100%; border-radius: 999px; }
.sf-pbar i.good { background: var(--sf-green); } .sf-pbar i.mid { background: var(--sf-yellow); } .sf-pbar i.bad { background: var(--sf-red); }
.sf-row-btn { cursor: pointer; grid-template-columns: 190px minmax(120px, 0.7fr) minmax(220px, 2fr); }
.sf-row-btn:hover { background: var(--sf-bg); opacity: 1; }
.sf-row-btn.current { background: var(--g50); }
:root[data-theme="dark"] .sf-row-btn.current { background: #16301f; }
.sf-wide { grid-column: auto; }

@media (max-width: 1100px) {
  .sf-kpibar { grid-template-columns: 1fr 1fr; }
  .sf-issues { grid-column: 1 / -1; }
  .sf-tiles { grid-template-columns: repeat(3, minmax(160px, 1fr)); }
  .sf-grid { grid-template-columns: 1fr 1fr; }
  .sf-span2 { grid-column: 1 / -1; }
  .sf-row { grid-template-columns: 110px repeat(3, minmax(70px, 1fr)) minmax(170px, 1.4fr); }
  .sf-row .sf-cell:nth-of-type(n+5) { display: none; }
}
@media (max-width: 700px) {
  .sf-kpibar, .sf-grid, .sf-grid2 { grid-template-columns: 1fr; }
  .sf-hero-num strong { font-size: 76px; }
  .sf-tiles { grid-template-columns: repeat(2, minmax(150px, 1fr)); }
}
.sf-use { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; }
.sf-use div { padding: 14px 16px; border-radius: 16px; background: var(--sf-bg); display: flex; flex-direction: column; gap: 2px; }
.sf-use strong { font-size: 26px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; }
.sf-use span { font-size: 12px; color: var(--sf-dim); font-weight: 600; }

/* ======================================================================
   PHONE LAYOUT (<= 760px): bottom tab bar, menu drawer, bottom sheets
   ====================================================================== */

#tabbar, #rail-backdrop { display: none; }

@media (max-width: 760px) {
  html, body { overscroll-behavior: none; }
  #app { height: 100dvh; flex-direction: column; }
  #main { flex: 1; min-height: 0; }

  /* menu -> drawer */
  #rail {
    position: fixed; z-index: 2000; left: 0; top: 0; bottom: 0; width: min(280px, 82vw);
    transform: translateX(-102%); transition: transform 0.25s ease; overflow-y: auto;
    padding: 20px 14px 90px; box-shadow: none;
  }
  #rail.open { transform: none; box-shadow: 18px 0 50px -10px rgba(0, 0, 0, 0.4); }
  #rail-backdrop { display: block; position: fixed; inset: 0; z-index: 1900; background: rgba(20, 16, 12, 0.45); opacity: 0; pointer-events: none; transition: opacity 0.25s; }
  #rail-backdrop.show { opacity: 1; pointer-events: auto; }

  /* bottom tab bar */
  #tabbar {
    display: flex; flex-shrink: 0; z-index: 1800;
    background: var(--surface); border-top: 1px solid var(--border);
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
  }
  .tab-btn {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 7px 2px;
    background: transparent; color: var(--text-dim); border-radius: 14px; font-size: 10.5px; font-weight: 600;
  }
  .tab-btn .icon { width: 22px; height: 22px; }
  .tab-btn:hover { opacity: 1; color: var(--text); }
  .tab-btn.active { color: var(--brand); background: var(--brand-soft); }

  /* top bar */
  #topbar { padding: 10px 12px; gap: 8px; }
  .tb-mark { display: block; }
  .search-box { flex: 1; width: auto; min-width: 0; padding: 8px 12px; }
  .profile-name, .profile-btn .icon-sm { display: none; }
  .profile-btn { padding: 4px; }
  .subnav { max-width: calc(100vw - 150px); flex: 1 1 auto; }
  #topbar:has(.subnav:not(.hidden)) .search-box { display: none; }

  /* floating panels become bottom sheets */
  .panel-card, #live-list-view {
    left: 8px; right: 8px; top: auto; bottom: 8px; width: auto;
    max-height: 42%; border-radius: 22px; padding: 16px;
  }
  #live-detail-view { max-height: calc(100% - 16px); }
  #panel-checkout .panel-card, #panel-profile .panel-card, #panel-settings .panel-card { top: 8px; max-height: none; }
  #panel-history .panel-card, #panel-geofences .panel-card { max-height: 62%; }

  /* map controls */
  .leaflet-control-zoom { display: none; }
  .leaflet-bottom.leaflet-right { bottom: auto; top: 8px; }
  .ml-control { margin: 0 8px 0 0; }
  .ml-toggle { width: 40px; height: 40px; }
  .ml-menu { bottom: auto; top: 48px; width: min(300px, calc(100vw - 32px)); max-height: 60vh; }

  /* full-page views */
  .fleet-inner, .rep-inner, .drv-inner { padding: 16px 12px 24px; }
  .sf-inner { padding: 18px 12px 28px; }
  .sf-inner h1, .fleet-head h1, .rep-inner h1, .drv-inner h1 { font-size: 26px; }
  .fleet-actions { width: 100%; }
  .fleet-actions button { flex: 1 1 auto; justify-content: center; }
  .fleet-search { width: 100%; }
  .fleet-table th:nth-child(4), .fleet-table td:nth-child(4),
  .fleet-table th:nth-child(6), .fleet-table td:nth-child(6),
  .fleet-table th:nth-child(7), .fleet-table td:nth-child(7),
  .fleet-table th:nth-child(8), .fleet-table td:nth-child(8),
  .fleet-table th:nth-child(9), .fleet-table td:nth-child(9),
  .fleet-table th:nth-child(10), .fleet-table td:nth-child(10) { display: none; }
  .fleet-name-wrap { min-width: 0; }
  .fleet-sub-line { max-width: 150px; }
  .pillar-page.active { padding: 16px; }
  .rep-donut-row { gap: 16px; }
  .rep-hero { grid-template-columns: 1fr; }
  .drv-board { grid-template-columns: 1fr; }
  .drv-tab-sub { display: none; }

  /* modals */
  .modal-content { max-height: calc(100dvh - 24px); overflow-y: auto; }
  .modal-wide { width: calc(100vw - 20px); }
  .form-grid { grid-template-columns: 1fr; }
  .fleet-toast { bottom: 80px; }
}

/* ======================================================================
   CHAT
   ====================================================================== */

.nav-badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 700; line-height: 20px; text-align: center; }
.nav-pill.active .nav-badge { background: #fff; color: var(--brand-ink); }
.tab-btn.has-dot { position: relative; }
.tab-btn.has-dot::after { content: ''; position: absolute; top: 6px; right: calc(50% - 16px); width: 9px; height: 9px; border-radius: 50%; background: var(--danger); border: 2px solid var(--surface); }

.chat-page.active { position: absolute; inset: 0; z-index: 12; display: block; background: var(--bg); }
.ch-shell { display: grid; grid-template-columns: minmax(300px, 360px) 1fr; gap: 16px; height: 100%; padding: 16px; position: relative; }
.ch-side, .ch-main { background: var(--surface); border: 1px solid var(--border); border-radius: 24px; box-shadow: var(--shadow-soft); min-height: 0; display: flex; flex-direction: column; overflow: hidden; position: relative; }
.ch-side-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 18px 18px 10px; }
.ch-side-head h2 { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: -0.02em; }
.ch-tools { display: flex; align-items: center; gap: 6px; }
.ch-status { width: auto; padding: 7px 28px 7px 12px; font-size: 12px; font-weight: 600; border-radius: 999px; }
.ch-icon-btn { width: 36px; height: 36px; padding: 0; border-radius: 50%; background: var(--surface-alt); color: var(--text-dim); border: 1px solid var(--border); display: inline-flex; align-items: center; justify-content: center; font-size: 16px; flex-shrink: 0; }
.ch-icon-btn:hover { color: var(--brand); border-color: var(--brand); opacity: 1; }
.ch-icon-btn.on { color: var(--brand); background: var(--brand-soft); }
.ch-icon-btn.gif { width: auto; padding: 0 10px; border-radius: 999px; font-size: 11px; font-weight: 800; letter-spacing: 0.04em; }
.ch-search { position: relative; margin: 4px 18px 10px; }
.ch-search .icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-dim); width: 17px; height: 17px; }
.ch-search input { padding-left: 40px; border-radius: 999px; }
.ch-tabs { display: flex; gap: 6px; padding: 0 18px 10px; }
.ch-tab { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 10px; border-radius: 999px; background: var(--surface-alt); color: var(--text-dim); font-size: 13px; font-weight: 600; }
.ch-tab.active { background: var(--brand); color: var(--brand-on); }
.ch-list { flex: 1; overflow-y: auto; padding: 0 10px 12px; }
.ch-item { width: 100%; display: flex; align-items: center; gap: 12px; padding: 11px 10px; margin: 2px 0; border-radius: 16px; background: transparent; color: var(--text); text-align: left; }
.ch-item:hover { background: var(--surface-alt); opacity: 1; }
.ch-item.active { background: var(--brand-soft); }
.ch-item-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.ch-item-top, .ch-item-bottom { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ch-item-body strong { font-size: 14px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-time { font-size: 11px; color: var(--text-dim); flex-shrink: 0; }
.ch-preview { font-size: 12.5px; color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 400; }
.ch-unread { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--brand); color: var(--brand-on); font-size: 11px; font-weight: 700; line-height: 20px; text-align: center; flex-shrink: 0; }
.ch-unread.sm { min-width: 18px; height: 18px; line-height: 18px; font-size: 10px; background: var(--danger); color: #fff; }
.ch-empty { padding: 24px 14px; font-size: 13px; color: var(--text-dim); text-align: center; }

.ch-avatar { position: relative; width: 44px; height: 44px; border-radius: 50%; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-size: 14px; font-weight: 700; background: var(--brand); }
.ch-avatar .icon { color: #fff; }
.ch-avatar.tg { background: #2a9bd8; }
.ch-avatar.tm { background: #5b5fc7; font-size: 18px; }
.ch-avatar-gap { width: 44px; flex-shrink: 0; }
.ch-dot { position: absolute; right: -1px; bottom: -1px; width: 13px; height: 13px; border-radius: 50%; border: 2px solid var(--surface); background: #9aa09b; }
.ch-dot.online { background: var(--status-good); }
.ch-dot.busy { background: var(--danger); }

.ch-head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.ch-head.hidden { display: none; }
.ch-head-t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ch-head-t strong { font-size: 16px; font-weight: 700; }
.ch-sub { font-size: 12px; color: var(--text-dim); }
.ch-sub.online { color: var(--status-good-ink); }
.ch-sub.busy { color: var(--danger); }
.ch-head-acts { display: flex; gap: 8px; }
.ch-back { display: none; }

.ch-placeholder { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 30px; text-align: center; color: var(--text-dim); }
.ch-placeholder h3 { margin: 6px 0 0; color: var(--text); font-size: 20px; }
.ch-placeholder p { margin: 0; max-width: 360px; font-size: 13.5px; line-height: 1.6; }
.ch-ph-ic { width: 76px; height: 76px; border-radius: 24px; background: var(--brand-soft); color: var(--brand); display: flex; align-items: center; justify-content: center; }
.ch-ph-ic .icon { width: 34px; height: 34px; }
.ch-placeholder.hidden, .ch-msgs.hidden, .ch-compose.hidden { display: none; }

.ch-msgs { flex: 1; overflow-y: auto; padding: 18px 20px 8px; display: flex; flex-direction: column; gap: 4px; background: linear-gradient(180deg, var(--surface), var(--surface-alt)); }
.ch-day { align-self: center; margin: 12px 0 6px; padding: 4px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); font-size: 11.5px; font-weight: 600; color: var(--text-dim); }
.ch-system { align-self: center; margin: 6px 0; font-size: 12px; color: var(--text-dim); }
.ch-empty-conv { margin: auto; color: var(--text-dim); font-size: 14px; }
.ch-row { display: flex; align-items: flex-end; gap: 8px; max-width: 100%; margin-top: 8px; }
.ch-row.grouped { margin-top: 0; }
.ch-row .ch-avatar { width: 32px; height: 32px; font-size: 11px; }
.ch-row .ch-avatar-gap { width: 32px; }
.ch-row.mine { flex-direction: row-reverse; }
.ch-bubble { position: relative; max-width: min(72%, 560px); padding: 9px 13px 7px; border-radius: 20px 20px 20px 6px; background: var(--surface); border: 1px solid var(--border); box-shadow: 0 1px 2px rgba(43, 33, 20, 0.05); font-size: 14px; line-height: 1.45; word-break: break-word; }
.ch-row.mine .ch-bubble { background: var(--brand); border-color: var(--brand); color: var(--brand-on); border-radius: 20px 20px 6px 20px; }
.ch-row.grouped .ch-bubble { border-top-left-radius: 8px; }
.ch-row.mine.grouped .ch-bubble { border-top-left-radius: 20px; border-top-right-radius: 8px; }
.ch-author { display: block; font-size: 12px; font-weight: 700; color: var(--brand-ink); margin-bottom: 2px; }
.ch-via { display: block; font-size: 10.5px; font-weight: 600; opacity: 0.6; margin-bottom: 2px; }
.ch-text { white-space: pre-wrap; }
.ch-bubble a { color: inherit; text-decoration: underline; }
.ch-row:not(.mine) .ch-bubble a { color: var(--brand-ink); }
.ch-meta { display: flex; justify-content: flex-end; align-items: center; gap: 5px; margin-top: 3px; font-size: 10.5px; opacity: 0.7; }
.ch-tick { letter-spacing: -2px; }
.ch-tick.read { color: #b8f0c8; opacity: 1; font-weight: 700; }
.ch-bubble.k-file, .ch-bubble.k-card, .ch-bubble.k-call { padding: 6px 6px 6px; }
.ch-bubble.k-file .ch-meta, .ch-bubble.k-card .ch-meta, .ch-bubble.k-call .ch-meta { padding: 0 8px 2px; }
.ch-img img { display: block; max-width: 280px; max-height: 260px; width: 100%; object-fit: cover; border-radius: 14px; }
.ch-file { display: flex; align-items: center; gap: 10px; padding: 8px 10px; min-width: 220px; text-decoration: none !important; color: inherit !important; }
.ch-file-ic { width: 42px; height: 48px; border-radius: 10px; background: var(--brand-soft); color: var(--brand-ink); display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 800; flex-shrink: 0; }
.ch-row.mine .ch-file-ic { background: rgba(255, 255, 255, 0.25); color: #fff; }
.ch-file-t { display: flex; flex-direction: column; min-width: 0; }
.ch-file-t strong { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-file-t small { opacity: 0.7; }
.ch-call { display: flex; align-items: center; gap: 12px; padding: 8px 10px; min-width: 250px; }
.ch-call > .icon { width: 30px; height: 30px; padding: 8px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-ink); box-sizing: content-box; }
.ch-row.mine .ch-call > .icon { background: rgba(255, 255, 255, 0.25); color: #fff; }
.ch-call-t { flex: 1; display: flex; flex-direction: column; }
.ch-call-t small { opacity: 0.7; font-size: 11px; }

.ch-card { width: 300px; max-width: 100%; border-radius: 16px; overflow: hidden; background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.ch-mapprev { position: relative; height: 130px; background-color: #dfe7da; background-repeat: no-repeat; }
.ch-pin { position: absolute; left: 50%; top: 50%; width: 22px; height: 22px; margin: -22px 0 0 -11px; border-radius: 50% 50% 50% 0; background: var(--brand); border: 2px solid #fff; transform: rotate(-45deg); box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4); }
.ch-pin::after { content: ''; position: absolute; inset: 5px; border-radius: 50%; background: #fff; }
.ch-card-body { padding: 12px 14px 12px; display: flex; flex-direction: column; gap: 4px; }
.ch-card-body strong { font-size: 14px; }
.ch-card-body > span { font-size: 12.5px; }
.ch-muted { color: var(--text-dim); font-size: 12px; }
.ch-kv { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; padding: 5px 0; border-top: 1px solid var(--border); }
.ch-kv span { color: var(--text-dim); }
.ch-kv b { font-weight: 700; text-align: right; }
.ch-kv b.ok { color: var(--status-good-ink); } .ch-kv b.warn { color: var(--status-warn-ink); } .ch-kv b.bad { color: var(--danger); } .ch-kv b.muted { color: var(--text-dim); }
.ch-card-acts { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.ch-btn { display: inline-flex; align-items: center; justify-content: center; padding: 8px 14px; border-radius: 999px; background: var(--brand); color: var(--brand-on) !important; font-size: 12.5px; font-weight: 700; text-decoration: none !important; border: 1px solid var(--brand); }
.ch-btn.ghost { background: transparent; color: var(--brand-ink) !important; border-color: var(--border); }
.ch-btn:hover { opacity: 0.85; }

.ch-compose { position: relative; display: flex; align-items: flex-end; gap: 8px; padding: 12px 14px 14px; border-top: 1px solid var(--border); background: var(--surface); }
.ch-compose textarea { flex: 1; min-height: 44px; max-height: 130px; resize: none; padding: 12px 16px; border-radius: 22px; font-family: inherit; font-size: 14.5px; line-height: 1.4; background: var(--surface-alt); border: 1px solid var(--border); color: var(--text); }
.ch-compose textarea:focus { outline: 2px solid var(--brand); outline-offset: 1px; }
.ch-attach { width: 44px; height: 44px; background: var(--brand-soft); color: var(--brand); }
.ch-compose .ch-icon-btn { width: 44px; height: 44px; }
.ch-compose .ch-icon-btn.gif { width: auto; }
.ch-send { width: 50px; height: 50px; padding: 0; border-radius: 50%; background: var(--brand); color: var(--brand-on); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; box-shadow: 0 8px 18px -8px var(--brand); }
.ch-send .icon { width: 22px; height: 22px; }
.ch-pop { position: absolute; bottom: 74px; left: 14px; z-index: 5; min-width: 250px; padding: 8px; border-radius: 18px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-float); }
.ch-pop.hidden { display: none; }
.ch-menu-item { width: 100%; display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 12px; background: transparent; color: var(--text); font-size: 13.5px; font-weight: 600; text-align: left; }
.ch-menu-item:hover { background: var(--surface-alt); opacity: 1; }
.ch-menu-item .icon { color: var(--brand); }
.ch-emoji { left: auto; right: 130px; width: 320px; max-height: 300px; overflow-y: auto; }
.ch-emoji-cat { font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-dim); margin: 6px 6px 2px; }
.ch-emoji-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; }
.ch-emoji-grid button { padding: 4px 0; font-size: 21px; background: transparent; border-radius: 8px; }
.ch-emoji-grid button:hover { background: var(--surface-alt); opacity: 1; }

.ch-modal { position: absolute; inset: 0; z-index: 30; display: flex; align-items: center; justify-content: center; background: rgba(22, 23, 26, 0.5); backdrop-filter: blur(2px); border-radius: 0; }
.ch-modal.hidden { display: none; }
.ch-modal-box { width: min(380px, calc(100% - 28px)); max-height: calc(100% - 28px); overflow-y: auto; padding: 22px; border-radius: 24px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-float); display: flex; flex-direction: column; gap: 10px; }
.ch-modal-box.wide { width: min(520px, calc(100% - 28px)); }
.ch-modal-box h3 { margin: 0 0 4px; font-size: 18px; }
.ch-pick-list { display: flex; flex-direction: column; gap: 4px; max-height: 280px; overflow-y: auto; }
.ch-pick { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 12px; border-radius: 12px; background: var(--surface-alt); color: var(--text); text-align: left; font-size: 13.5px; }
.ch-pick:hover { background: var(--brand-soft); opacity: 1; }
.ch-pick span { font-size: 12px; color: var(--text-dim); }
.ch-pick.check { justify-content: flex-start; cursor: pointer; }
.ch-pick.check input { width: auto; accent-color: var(--brand); }
.ch-pick.check .ch-avatar { width: 30px; height: 30px; font-size: 11px; }
.ch-err { margin: 0; min-height: 16px; font-size: 12.5px; color: var(--danger); }
.ch-bridge { padding: 14px; border-radius: 16px; background: var(--surface-alt); border: 1px solid var(--border); display: flex; flex-direction: column; gap: 6px; }
.ch-bridge-head { display: flex; align-items: center; justify-content: space-between; }
.ch-badge { font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--surface); color: var(--text-dim); border: 1px solid var(--border); }
.ch-badge.on { background: var(--status-good-soft); color: var(--status-good-ink); border-color: transparent; }
.ch-field { display: flex; flex-direction: column; gap: 3px; margin: 0; }
.ch-field span { font-size: 12px; color: var(--text-dim); font-weight: 600; }
.ch-help { margin: 2px 0 0; font-size: 12px; line-height: 1.55; color: var(--text-dim); }

@media (max-width: 760px) {
  .ch-shell { display: block; padding: 8px; }
  .ch-side, .ch-main { position: absolute; inset: 8px; border-radius: 22px; }
  .ch-main { display: none; }
  .ch-shell.ch-open .ch-side { display: none; }
  .ch-shell.ch-open .ch-main { display: flex; }
  .ch-back { display: inline-flex; }
  .ch-bubble { max-width: 84%; }
  .ch-card { width: 260px; }
  .ch-emoji { right: 12px; left: 12px; width: auto; }
  .ch-compose { padding: 10px; gap: 6px; }
  .ch-compose .ch-icon-btn.gif { display: none; }
}


/* ======================================================================
   CHAT: playful look = Safety greens + fresh white + friendly accents
   ====================================================================== */

.chat-page {
  --brand: #14a357; --brand-soft: #e4fbef; --brand-ink: #0a8242; --brand-on: #ffffff;
  --bg: #f3f8f5; --surface: #ffffff; --surface-alt: #f2f8f4; --border: #e1ebe5;
  --ch-coral: #ff7a59; --ch-sun: #ffc83d; --ch-sky: #38bdf8; --ch-lilac: #a78bfa;
  --ch-t0: #e3faee; --ch-t1: #e2f3fe; --ch-t2: #fff3d1; --ch-t3: #ece6ff; --ch-t4: #ffe7e0;
  --ch-ink: #14201a;
  color: var(--ch-ink);
}
:root[data-theme="dark"] .chat-page {
  --brand: #27c472; --brand-soft: #123424; --brand-ink: #75ebac; --brand-on: #04230f;
  --bg: #0b1812; --surface: #11251b; --surface-alt: #16301f; --border: #1d3a2b;
  --ch-t0: #15402b; --ch-t1: #133a4d; --ch-t2: #4a3d12; --ch-t3: #2f2858; --ch-t4: #4a2a22;
  --ch-ink: #ecf6f0;
}
.chat-page.active {
  background:
    radial-gradient(520px 380px at 8% 6%, rgba(77, 219, 144, 0.22), transparent 70%),
    radial-gradient(460px 360px at 96% 12%, rgba(255, 200, 61, 0.2), transparent 70%),
    radial-gradient(520px 420px at 80% 100%, rgba(56, 189, 248, 0.16), transparent 70%),
    radial-gradient(420px 360px at 0% 100%, rgba(167, 139, 250, 0.14), transparent 70%),
    var(--bg);
}
.ch-side, .ch-main { border-radius: 30px; border-color: var(--border); box-shadow: 0 22px 44px -28px rgba(10, 130, 66, 0.45); }
.ch-side-head { justify-content: flex-start; flex-wrap: wrap; row-gap: 10px; }
.ch-side-head h2 { font-size: 24px; font-weight: 800; letter-spacing: -0.03em; flex: 1; }
.ch-side-head h2::after { content: ''; display: inline-block; width: 9px; height: 9px; margin-left: 6px; border-radius: 50%; background: var(--ch-sun); vertical-align: 2px; }
.ch-icon-btn { background: var(--surface); transition: transform .15s ease, background .15s ease, color .15s ease; }
.ch-icon-btn:hover { transform: translateY(-1px) scale(1.06); background: var(--brand-soft); }
.ch-icon-btn.on { background: linear-gradient(145deg, #4ddb90, #14a357); color: #fff; border-color: transparent; }
.ch-search input { background: var(--surface-alt); border-color: transparent; }
.ch-search input:focus { border-color: var(--brand); background: var(--surface); }
.ch-tab { transition: background .15s ease, transform .15s ease; }
.ch-tab:hover { transform: translateY(-1px); }
.ch-tab.active { background: linear-gradient(145deg, #27c472, #0a8242); color: #fff; box-shadow: 0 8px 16px -10px #0a8242; }
.ch-item { position: relative; border-radius: 20px; transition: background .15s ease, transform .15s ease; }
.ch-item:hover { transform: translateX(2px); }
.ch-item.active { background: linear-gradient(90deg, var(--ch-t0), var(--surface) 92%); box-shadow: inset 4px 0 0 var(--brand); }
.ch-unread { background: var(--ch-coral); color: #fff; box-shadow: 0 4px 10px -4px var(--ch-coral); }
.ch-unread.sm { background: var(--ch-coral); }

/* avatars */
.ch-avatar { border: 2.5px solid var(--surface); box-shadow: 0 6px 14px -8px rgba(10, 60, 30, 0.6); font-weight: 800; letter-spacing: 0.02em; user-select: none; }
.ch-avatar.emoji { font-size: 22px; letter-spacing: 0; }
.ch-row .ch-avatar.emoji { font-size: 17px; }
.ch-avatar.tg { background: linear-gradient(145deg, #5ec0f0, #2a9bd8); }
.ch-avatar.tm { background: linear-gradient(145deg, #7b7fe0, #5b5fc7); }
.ch-dot { border-color: var(--surface); }
.ch-me { position: relative; padding: 0; background: transparent; border-radius: 50%; flex-shrink: 0; transition: transform .2s ease; }
.ch-me:hover { transform: rotate(-6deg) scale(1.06); opacity: 1; }
.ch-me .ch-avatar { width: 46px; height: 46px; }
.ch-me-pen { position: absolute; right: -3px; bottom: -3px; width: 20px; height: 20px; border-radius: 50%; background: var(--ch-coral); border: 2px solid var(--surface); }
.ch-me-pen::after { content: '✎'; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 11px; font-style: normal; line-height: 1; }
.ch-tools { margin-left: auto; flex-wrap: wrap; }
.ch-edit-av { margin-left: 4px; width: 30px; height: 30px; border-radius: 50%; background: var(--surface-alt); color: var(--brand-ink); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; opacity: 0; transition: opacity .15s ease, background .15s ease; cursor: pointer; }
.ch-item:hover .ch-edit-av, .ch-edit-av:focus-visible { opacity: 1; }
.ch-edit-av:hover { background: var(--brand-soft); }
@media (hover: none) { .ch-edit-av { opacity: 1; } }

/* conversation */
.ch-head { background: linear-gradient(90deg, var(--ch-t0), var(--surface) 70%); border-bottom-color: var(--border); }
.ch-msgs {
  gap: 3px; padding: 18px 22px 10px;
  background:
    radial-gradient(circle at 20px 20px, rgba(39, 196, 114, 0.1) 2px, transparent 2.5px) 0 0 / 34px 34px,
    linear-gradient(180deg, var(--surface), var(--surface-alt));
}
.ch-day { background: var(--ch-sun); border-color: transparent; color: #4a3600; font-weight: 700; box-shadow: 0 6px 12px -8px #b88a00; }
:root[data-theme="dark"] .ch-day { background: #4a3d12; color: #ffe29a; }
.ch-bubble { border-radius: 22px 22px 22px 8px; background: var(--ch-t0); border: none; box-shadow: 0 4px 10px -8px rgba(10, 60, 30, 0.7); color: var(--ch-ink); font-size: 14.5px; }
.ch-bubble.t0 { background: var(--ch-t0); } .ch-bubble.t1 { background: var(--ch-t1); } .ch-bubble.t2 { background: var(--ch-t2); }
.ch-bubble.t3 { background: var(--ch-t3); } .ch-bubble.t4 { background: var(--ch-t4); }
.ch-row.mine .ch-bubble { background: linear-gradient(135deg, #2fd17c, #0a8242); color: #fff; border-radius: 22px 22px 8px 22px; box-shadow: 0 10px 18px -12px #0a8242; }
.ch-row.grouped .ch-bubble { border-top-left-radius: 10px; }
.ch-row.mine.grouped .ch-bubble { border-top-left-radius: 22px; border-top-right-radius: 10px; }
.ch-author { font-weight: 800; }
.ch-bubble.t0 .ch-author { color: #0a8242; } .ch-bubble.t1 .ch-author { color: #0b78b0; } .ch-bubble.t2 .ch-author { color: #9a6a00; }
.ch-bubble.t3 .ch-author { color: #6a4bd6; } .ch-bubble.t4 .ch-author { color: #d1432a; }
:root[data-theme="dark"] .ch-bubble .ch-author { color: var(--ch-ink); }
.ch-row:not(.mine) .ch-bubble a { color: var(--brand-ink); font-weight: 600; }
.ch-tick.read { color: #fff3a8; }
.ch-row.pop .ch-bubble { animation: ch-pop .38s cubic-bezier(.2, 1.4, .4, 1) both; transform-origin: bottom left; }
.ch-row.mine.pop .ch-bubble { transform-origin: bottom right; }
.ch-row.pop .ch-avatar { animation: ch-pop .38s cubic-bezier(.2, 1.4, .4, 1) both; }
@keyframes ch-pop { from { opacity: 0; transform: scale(.7) translateY(10px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .ch-row.pop .ch-bubble, .ch-row.pop .ch-avatar { animation: none; } .ch-item:hover, .ch-icon-btn:hover, .ch-tab:hover, .ch-me:hover { transform: none; } }
.ch-card { border: none; box-shadow: 0 6px 16px -10px rgba(10, 60, 30, 0.6); border-radius: 18px; }
.ch-bubble.k-card, .ch-bubble.k-file, .ch-bubble.k-call { background: var(--surface); border: 1px solid var(--border); }
.ch-row.mine .ch-bubble.k-card, .ch-row.mine .ch-bubble.k-file, .ch-row.mine .ch-bubble.k-call { background: linear-gradient(135deg, #2fd17c, #0a8242); border: none; }
.ch-row.mine .ch-card { background: var(--surface); color: var(--ch-ink); }
.ch-btn { background: linear-gradient(145deg, #27c472, #0a8242); border: none; box-shadow: 0 8px 14px -10px #0a8242; transition: transform .15s ease; }
.ch-btn:hover { transform: translateY(-1px); opacity: 1; }
.ch-btn.ghost { background: var(--surface-alt); box-shadow: none; border: 1px solid var(--border); }

/* composer */
.ch-compose { background: var(--surface); border-top-color: var(--border); }
.ch-compose textarea { background: var(--surface-alt); border-color: transparent; color: var(--ch-ink); }
.ch-compose textarea:focus { outline: none; border-color: var(--brand); background: var(--surface); box-shadow: 0 0 0 4px rgba(39, 196, 114, 0.18); }
.ch-attach { background: linear-gradient(145deg, var(--ch-sun), #ffa63d); color: #4a2a00; border: none; }
.ch-attach:hover { background: linear-gradient(145deg, #ffd45e, #ffa63d); }
.ch-send { background: linear-gradient(145deg, #4ddb90, #0a8242); box-shadow: 0 12px 20px -10px #0a8242; transition: transform .2s cubic-bezier(.2, 1.6, .4, 1); }
.ch-send:hover { transform: rotate(-12deg) scale(1.1); opacity: 1; }
.ch-send:active { transform: scale(.92); }
.ch-menu-item .icon { color: var(--brand); }
.ch-menu-item:nth-child(2) .icon { color: var(--ch-coral); } .ch-menu-item:nth-child(3) .icon { color: var(--ch-sky); }
.ch-menu-item:nth-child(4) .icon { color: var(--ch-lilac); } .ch-menu-item:nth-child(5) .icon { color: #e0a000; }
.ch-pop { border-radius: 22px; }
.ch-ph-ic { background: linear-gradient(145deg, var(--ch-t0), var(--ch-t2)); border-radius: 28px; transform: rotate(-6deg); }

/* modals */
.ch-modal-box { border-radius: 28px; }
.ch-pick:hover { background: var(--ch-t0); }

/* avatar maker */
.ch-av-stage { display: flex; justify-content: center; padding: 6px 0 2px; }
.ch-avatar.ch-av-big { width: 104px; height: 104px; font-size: 38px; border-width: 4px; box-shadow: 0 16px 28px -14px rgba(10, 60, 30, 0.7); }
.ch-avatar.ch-av-big.emoji { font-size: 54px; }
.ch-av-tabs { display: flex; gap: 6px; padding: 4px; border-radius: 999px; background: var(--surface-alt); }
.ch-av-tab { flex: 1; padding: 8px 10px; border-radius: 999px; background: transparent; color: var(--text-dim); font-size: 13px; font-weight: 700; }
.ch-av-tab.active { background: var(--surface); color: var(--brand-ink); box-shadow: 0 4px 10px -6px rgba(10, 60, 30, 0.6); }
.ch-av-pane { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; min-height: 124px; }
.ch-av-pane.hidden { display: none; }
.ch-av-emoji { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; align-items: stretch; align-content: start; }
.ch-av-emoji button { padding: 6px 0; font-size: 24px; background: var(--surface-alt); border-radius: 14px; transition: transform .12s ease; }
.ch-av-emoji button:hover { transform: scale(1.12); opacity: 1; }
.ch-av-emoji button.sel { background: var(--brand-soft); box-shadow: inset 0 0 0 2px var(--brand); }
.ch-av-colors { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; padding: 2px 0; }
.ch-av-colors button { width: 30px; height: 30px; min-width: 30px; padding: 0; flex: none; border-radius: 50%; border: 3px solid var(--surface); box-shadow: 0 0 0 1px var(--border); transition: transform .12s ease; }
.ch-av-colors button:hover { transform: scale(1.15); opacity: 1; }
.ch-av-colors button.sel { box-shadow: 0 0 0 3px var(--brand); }

/* topbar avatar follows the chat avatar */
.avatar { overflow: hidden; background-size: cover; background-position: center; }
.avatar.emoji { font-size: 16px; }

@media (max-width: 760px) {
  .ch-side, .ch-main { border-radius: 26px; }
  .ch-msgs { padding: 14px 12px 8px; }
  .ch-me .ch-avatar { width: 42px; height: 42px; }
}

.leaflet-container, .leaflet-popup-content, .leaflet-tooltip { font-family: var(--font); }

/* ======================================================================
   DRIVER: people directory (fresh white + Safety greens, same family as Chat and Enrollment)
   ====================================================================== */

.driver-page {
  --brand: #14a357; --brand-soft: #e4fbef; --brand-ink: #0a8242; --brand-on: #ffffff;
  --bg: #f3f6f4; --surface: #ffffff; --surface-alt: #f2f8f4; --border: #e1ebe5;
  --dp-sun: #ffc83d; --dp-sky: #38bdf8; --dp-coral: #ff7a59; --dp-lilac: #a78bfa;
}
:root[data-theme="dark"] .driver-page { --brand: #27c472; --brand-soft: #123424; --brand-ink: #75ebac; --brand-on: #04230f; --bg: #0b1812; --surface: #11251b; --surface-alt: #16301f; --border: #1d3a2b; }
.driver-page.active {
  background:
    radial-gradient(520px 380px at 6% 0%, rgba(77, 219, 144, 0.2), transparent 70%),
    radial-gradient(460px 360px at 100% 8%, rgba(255, 200, 61, 0.16), transparent 70%),
    var(--bg);
}
.driver-page .drv-tab.active { background: linear-gradient(145deg, #27c472, #0a8242); color: #fff; }
.driver-page .fleet-actions button { background: linear-gradient(145deg, #27c472, #0a8242); color: #fff; border: 0; }

.dp-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.dp-pills { display: flex; gap: 8px; flex-wrap: wrap; }
.dp-pill { display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; border-radius: 999px; background: var(--surface); color: var(--text-dim); border: 1px solid var(--border); font-size: 13px; font-weight: 700; }
.dp-pill b { font-size: 11px; padding: 1px 7px; border-radius: 999px; background: var(--surface-alt); color: var(--text-dim); }
.dp-pill:hover { color: var(--text); opacity: 1; }
.dp-pill.active { background: linear-gradient(145deg, #27c472, #0a8242); color: #fff; border-color: transparent; box-shadow: 0 10px 18px -12px #0a8242; }
.dp-pill.active b { background: rgba(255, 255, 255, 0.25); color: #fff; }
.dp-search { position: relative; width: min(300px, 100%); margin: 0; }
.dp-search .icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-dim); }
.dp-search input { width: 100%; padding: 10px 14px 10px 38px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); font-size: 13px; }

.dp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; margin-bottom: 8px; }
.dp-card { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 18px 16px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 26px; box-shadow: 0 18px 32px -26px rgba(10, 130, 66, 0.55); cursor: pointer; transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease; }
.dp-card:hover { transform: translateY(-2px); box-shadow: 0 22px 36px -24px rgba(10, 130, 66, 0.7); }
.dp-card.selected { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft), 0 22px 36px -24px rgba(10, 130, 66, 0.6); }
.dp-card[draggable="true"] { cursor: grab; }
.dp-card.dragging { opacity: 0.45; }
.dp-card.inactive { background: var(--surface-alt); }
.dp-card.inactive .dp-avatar, .dp-card.inactive .dp-name { opacity: 0.55; }
.dp-tag { padding: 5px 16px; border-radius: 999px; font-size: 11.5px; font-weight: 800; letter-spacing: 0.01em; }
.dp-tag.fixed { background: #d5f7e4; color: #0a7a3d; } .dp-tag.login { background: #dff1fd; color: #0b6a9d; }
.dp-tag.none { background: #fff0c4; color: #8a5d00; } .dp-tag.inactive { background: #e6ebe8; color: #4b5953; }
:root[data-theme="dark"] .dp-tag.fixed { background: #0f4a2a; color: #8ff0b8; } :root[data-theme="dark"] .dp-tag.login { background: #12394f; color: #8fd3f7; }
:root[data-theme="dark"] .dp-tag.none { background: #4a3d12; color: #ffe29a; } :root[data-theme="dark"] .dp-tag.inactive { background: #26352d; color: #b9c7bf; }
.dp-avatar { width: 84px; height: 84px; margin: 6px 0 2px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: #9aa6a0; color: #fff; font-size: 28px; font-weight: 800; letter-spacing: 0.02em; border: 4px solid var(--surface); box-shadow: 0 14px 24px -14px rgba(10, 60, 30, 0.7); }
.dp-avatar.sm { width: 48px; height: 48px; font-size: 17px; margin: 0; border-width: 3px; flex-shrink: 0; }
.dp-name { margin: 0; font-size: 16px; font-weight: 800; letter-spacing: -0.01em; text-align: center; }
.dp-contact { font-size: 12px; color: var(--text-dim); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dp-contact a { color: var(--text-dim); text-decoration: underline; }
.dp-vehicle { width: 100%; margin-top: 8px; padding: 10px 12px; border-radius: 18px; display: flex; align-items: center; gap: 10px; font-size: 12px; min-height: 58px; }
.dp-vehicle > .icon { width: 22px; height: 22px; flex-shrink: 0; }
.dp-vtext { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.dp-vtext strong { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dp-vtext span { color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dp-vtop { display: flex; align-items: center; gap: 8px; min-width: 0; }
.dp-vehicle.fixed { background: #ebfff4; border: 1px solid #bff2d6; } .dp-vehicle.fixed > .icon { color: #0a8242; }
.dp-vehicle.login { background: #eef8ff; border: 1px solid #cde9fb; } .dp-vehicle.login > .icon { color: #0b78b0; }
.dp-vehicle.none { background: transparent; border: 2px dashed #f0cf7a; } .dp-vehicle.none > .icon { color: #c98a00; }
.dp-vehicle.inactive { background: transparent; border: 1px dashed var(--border); } .dp-vehicle.inactive > .icon { color: var(--text-dim); }
:root[data-theme="dark"] .dp-vehicle.fixed { background: #0f3a24; border-color: #1d5a39; } :root[data-theme="dark"] .dp-vehicle.login { background: #10303f; border-color: #1c4c63; }
:root[data-theme="dark"] .dp-vehicle.none { border-color: #7a6120; }
.dp-actions { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 10px; }
.dp-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 38px; padding: 0; border-radius: 999px; background: var(--surface); color: var(--text); border: 1px solid var(--border); font-size: 12.5px; font-weight: 700; transition: transform .15s ease, background .15s ease; }
.dp-btn.round { width: 38px; color: var(--text-dim); }
.dp-btn.main { padding: 0 18px; background: var(--surface-alt); color: var(--brand-ink); }
.dp-btn:hover:not(:disabled) { transform: translateY(-1px); background: var(--brand-soft); color: var(--brand-ink); opacity: 1; border-color: var(--brand); }
.dp-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.dp-h { margin: 28px 0 12px; font-size: 12px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-dim); }
.driver-page .fleet-chip.muted { opacity: 0.6; }

/* popups: vehicle picker and big trip registration */
.dp-layer { position: fixed; inset: 0; z-index: 70; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(15, 29, 22, 0.55); backdrop-filter: blur(3px); }
.dp-layer.hidden { display: none; }
.dp-box { width: min(1120px, 100%); max-height: calc(100vh - 40px); overflow-y: auto; background: var(--surface, #fff); color: var(--text); border: 1px solid var(--border); border-radius: 30px; padding: 24px clamp(16px, 3vw, 32px) 28px; box-shadow: 0 40px 80px -30px rgba(0, 0, 0, 0.6); font-family: var(--font); }
.dp-box.small { width: min(520px, 100%); }
.dp-layer { --surface: #ffffff; --surface-alt: #f2f8f4; --border: #e1ebe5; --brand: #14a357; --brand-soft: #e4fbef; --brand-ink: #0a8242; }
:root[data-theme="dark"] .dp-layer { --surface: #11251b; --surface-alt: #16301f; --border: #1d3a2b; --brand: #27c472; --brand-soft: #123424; --brand-ink: #75ebac; }
.dp-box-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.dp-box-head h2 { margin: 0 0 2px; font-size: 20px; font-weight: 800; letter-spacing: -0.02em; }
.dp-box-head .hint { margin: 0; }
.dp-who { display: flex; align-items: center; gap: 14px; }
.dp-search-in { width: 100%; padding: 10px 14px; border-radius: 999px; margin-bottom: 10px; }
.dp-pick-list { display: flex; flex-direction: column; gap: 6px; max-height: 52vh; overflow-y: auto; }
.dp-pick { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 14px; border-radius: 18px; background: var(--surface-alt); color: var(--text); border: 1px solid transparent; text-align: left; }
.dp-pick:hover:not(:disabled) { border-color: var(--brand); background: var(--brand-soft); opacity: 1; }
.dp-pick:disabled { opacity: 0.55; cursor: not-allowed; }
.dp-pick.current { border-color: var(--brand); }
.dp-pick.unlink { background: transparent; border: 1px dashed var(--border); flex-direction: column; align-items: flex-start; gap: 2px; }
.dp-pick.unlink span { font-size: 12px; color: var(--text-dim); }
.dp-pick-l { display: flex; align-items: center; gap: 10px; min-width: 0; }
.dp-pick-l .icon { color: var(--brand); flex-shrink: 0; }
.dp-pick-l span { font-size: 12px; color: var(--text-dim); }
.dp-pick-r { font-size: 11.5px; font-weight: 800; padding: 3px 10px; border-radius: 999px; white-space: nowrap; background: var(--surface); }
.dp-pick-r.free { color: #0a7a3d; } .dp-pick-r.busy { color: #8a5d00; }

@media (max-width: 760px) {
  .dp-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
  .dp-layer { padding: 8px; align-items: flex-end; }
  .dp-box { border-radius: 26px; max-height: calc(100vh - 16px); }
}

/* Driver: sign-in tab (method cards, ID chip, vehicle tiles with the layout in use) */
.dp-tag.login.m-ibutton { background: #dff1fd; color: #0b6a9d; } .dp-tag.login.m-rfid { background: #ebe5ff; color: #5b3fc4; }
.dp-tag.login.m-nfc { background: #ffe3dc; color: #b3391f; } .dp-tag.login.m-ble { background: #d3f5f0; color: #0b7a6e; }
:root[data-theme="dark"] .dp-tag.login.m-ibutton { background: #12394f; color: #8fd3f7; } :root[data-theme="dark"] .dp-tag.login.m-rfid { background: #2f2858; color: #c3b4ff; }
:root[data-theme="dark"] .dp-tag.login.m-nfc { background: #4a2a22; color: #ffb8a6; } :root[data-theme="dark"] .dp-tag.login.m-ble { background: #0f423d; color: #8fe8dc; }
.dp-idchip { display: inline-flex; align-items: center; gap: 6px; margin-top: 2px; padding: 3px 10px; border-radius: 999px; background: var(--surface-alt); border: 1px solid var(--border); font-size: 11.5px; font-weight: 700; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--text-dim); }
.dp-idchip .icon { width: 13px; height: 13px; }
.driver-page .dp-method { text-align: left; cursor: pointer; background: var(--surface); transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease; }
.driver-page .dp-method:hover { transform: translateY(-2px); border-color: var(--brand); opacity: 1; }
.driver-page .dp-method.active { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.dp-nokey { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 14px 0 0; font-size: 12.5px; color: var(--text-dim); }
.dp-chip-btn { padding: 5px 12px; border-radius: 999px; background: var(--surface); color: var(--text); border: 1px dashed var(--border); font-size: 12px; font-weight: 700; }
.dp-chip-btn:hover { border-color: var(--brand); color: var(--brand-ink); opacity: 1; }
.dp-mode { align-self: flex-start; padding: 3px 11px; border-radius: 999px; font-size: 11px; font-weight: 800; white-space: nowrap; }
.dp-mode.fixed { background: #d5f7e4; color: #0a7a3d; } .dp-mode.login { background: #dff1fd; color: #0b6a9d; }
:root[data-theme="dark"] .dp-mode.fixed { background: #0f4a2a; color: #8ff0b8; } :root[data-theme="dark"] .dp-mode.login { background: #12394f; color: #8fd3f7; }
.dp-tile { gap: 8px; }
.dp-tile.is-login { border-color: #cde9fb; } .dp-tile.has-driver { border-color: #bff2d6; }
.dp-tile-line { margin: 0; font-size: 12px; color: var(--text-dim); }
.dp-tile-line.alert { color: var(--danger); font-weight: 700; }
.drv-vehicle-head .dp-mode { margin-left: auto; }

/* Driver: to-do list of vehicles without a driver + compact list of linked ones */
.dp-allgood { padding: 14px 18px; border-radius: 18px; background: var(--brand-soft); color: var(--brand-ink); font-weight: 700; font-size: 13px; }
.dp-linked { margin-top: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 22px; }
.dp-linked > summary { cursor: pointer; padding: 14px 18px; font-size: 13px; font-weight: 800; color: var(--text-dim); list-style: none; display: flex; justify-content: space-between; }
.dp-linked > summary::-webkit-details-marker { display: none; }
.dp-linked > summary::after { content: '+'; font-size: 18px; color: var(--brand); line-height: 1; }
.dp-linked[open] > summary::after { content: '\2013'; }
.dp-linked-list { padding: 0 18px 12px; display: flex; flex-direction: column; }
.dp-linked-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border); font-size: 13px; }
.dp-linked-row > .icon { color: var(--brand); flex-shrink: 0; }
.dp-linked-arrow { color: var(--text-dim); }
.dp-linked-who { font-weight: 800; padding: 3px 12px; border-radius: 999px; background: #d5f7e4; color: #0a7a3d; }
:root[data-theme="dark"] .dp-linked-who { background: #0f4a2a; color: #8ff0b8; }
.dp-linked-row .drv-sub { margin-left: auto; }
.dp-linked-row .drv-unlink { margin-left: 4px; }

.driver-page .dp-method { color: var(--text); font-family: inherit; }
.driver-page .dp-method h3 { color: var(--text); margin: 0; font-size: 15px; }
.driver-page .dp-method .rep-card-sub { color: var(--text-dim); }

/* build label + "new version" bar */
.build-label { display: block; margin: 4px 0 0; text-align: center; font-size: 9.5px; font-weight: 600; letter-spacing: 0.02em; color: var(--text-dim); opacity: 0.7; }
#update-banner { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 200; display: flex; align-items: center; gap: 14px; padding: 10px 12px 10px 18px; border-radius: 999px; background: #14201a; color: #fff; font-size: 13px; font-weight: 600; box-shadow: 0 18px 40px -16px rgba(0, 0, 0, 0.6); max-width: calc(100vw - 24px); }
#update-banner button { padding: 8px 16px; border-radius: 999px; background: linear-gradient(145deg, #27c472, #0a8242); color: #fff; font-size: 12.5px; font-weight: 700; border: 0; white-space: nowrap; }
@media (max-width: 760px) { #update-banner { bottom: 76px; } }
.dp-grid-empty { grid-column: 1 / -1; margin: 6px 0; }
.dp-btn.main.key { background: #fff0c4; color: #8a5d00; border-color: #f0cf7a; }
.dp-btn.main.key:hover:not(:disabled) { background: #ffe9a8; border-color: #e8b400; color: #6d4a00; }
:root[data-theme="dark"] .dp-btn.main.key { background: #4a3d12; color: #ffe29a; border-color: #7a6120; }
.dp-card .dp-actions { flex-wrap: wrap; }

/* Login: 3D depot background (login-scene.js). The canvas fades in over the photo, the veil keeps brand and card readable. */
#fleet-bg { position: fixed; inset: 0; width: 100%; height: 100%; display: block; opacity: 0; transition: opacity 1.4s ease; pointer-events: none; filter: saturate(0.68) contrast(0.96); }
#fleet-bg.ready { opacity: 1; }
.lg-veil { position: fixed; inset: 0; pointer-events: none; background:
  linear-gradient(90deg, rgba(15, 22, 48, 0.62) 0%, rgba(15, 22, 48, 0.34) 32%, rgba(15, 22, 48, 0) 58%),
  linear-gradient(180deg, rgba(15, 22, 48, 0.3) 0%, rgba(15, 22, 48, 0) 22%); }
@media (max-width: 760px) { .lg-veil { background: linear-gradient(180deg, rgba(15, 22, 48, 0.5) 0%, rgba(15, 22, 48, 0.3) 60%, rgba(15, 22, 48, 0.45) 100%); } }
/* Login over the bright 3D depot: slightly denser glass and brighter small text so card and Meldingen stay readable */
#login-screen.has-scene .lg-card, #login-screen.has-scene .lg-news { background: rgba(18, 21, 34, 0.78); border-color: rgba(255, 255, 255, 0.2); }
#login-screen.has-scene .lg-news-empty { color: rgba(255, 255, 255, 0.78); }
#login-screen.has-scene .lg-news-date { color: rgba(255, 255, 255, 0.6); }
#login-screen.has-scene .lg-sub { color: rgba(255, 255, 255, 0.82); }
#login-screen.has-scene .lg-brand-name { text-shadow: 0 1px 10px rgba(0, 0, 0, 0.45); }

/* Safety: example-vehicles switch and fleet KPI strip */
.sf-toggle { display: inline-flex; align-items: center; gap: 8px; margin: 0; padding: 9px 14px; border-radius: 999px; background: var(--sf-card); border: 1px solid var(--sf-line); font-size: 13px; font-weight: 700; color: var(--sf-ink); cursor: pointer; white-space: nowrap; }
.sf-toggle input { width: 16px; height: 16px; accent-color: var(--g600); margin: 0; }
.sf-fleetkpi { margin-bottom: 22px; }
.sf-fleetkpi-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.sf-fleetkpi-head .sf-h2 { margin: 0 0 12px; font-size: 18px; }
.sf-fleetgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.sf-fk { display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; border-radius: 20px; background: var(--sf-card); border: 1px solid var(--sf-line); min-width: 0; }
.sf-fk[role], .sf-fk { cursor: default; }
.sf-fk-l { font-size: 11.5px; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; color: var(--sf-dim); }
.sf-fk strong { font-size: 24px; font-weight: 800; letter-spacing: -0.02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sf-fk strong small { font-size: 13px; font-weight: 700; color: var(--sf-dim); letter-spacing: 0; }
.sf-fk-s { font-size: 12px; color: var(--sf-dim); }
.sf-fk.hero { background: linear-gradient(145deg, var(--g400), var(--g600) 70%); border: 0; color: #fff; }
.sf-fk.hero.mid { background: linear-gradient(145deg, #f6c453, #e29a1e); } .sf-fk.hero.bad { background: linear-gradient(145deg, #f27a7a, #d2453f); }
.sf-fk.hero .sf-fk-l, .sf-fk.hero .sf-fk-s, .sf-fk.hero strong small { color: rgba(255, 255, 255, 0.85); }
.sf-fk.warn { border-color: #f0cf7a; background: #fffaf0; }
:root[data-theme="dark"] .sf-fk.warn { background: #2a2410; border-color: #7a6120; }

/* ---------- Driver · koppelbord (people → vehicles along a road) ---------- */
:root { --kb-info: #3f6fb5; --kb-info-soft: #e5edf8; --kb-ground: #e8e1d4; --kb-ground-2: #ddd5c6; --kb-asphalt: #3a3c41; --kb-asphalt-2: #33353a; --kb-lane: #f1ece2; --kb-bayline: rgba(255, 255, 255, 0.8); --kb-mute: #efebe4; }
:root[data-theme="dark"] { --kb-info: #7aa5e6; --kb-info-soft: rgba(122, 165, 230, 0.15); --kb-ground: #1d1f22; --kb-ground-2: #1a1c1f; --kb-asphalt: #2a2c30; --kb-asphalt-2: #25272b; --kb-lane: #c9c2b4; --kb-bayline: rgba(255, 255, 255, 0.22); --kb-mute: #2b2d31; }

.kb-kpis { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 14px; margin: 18px 0; }
.kb-kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 16px 18px; box-shadow: var(--shadow-soft); }
.kb-kpi b { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; }
.kb-kpi b.warn { color: var(--status-warn-ink); }
.kb-kpi b small { font-size: 15px; color: var(--text-dim); font-weight: 700; }
.kb-kpi > span { display: block; font-size: 13px; color: var(--text-dim); margin-top: 2px; }
.kb-bar { height: 8px; border-radius: 99px; background: var(--kb-mute); margin-top: 12px; overflow: hidden; }
.kb-bar i { display: block; height: 100%; background: var(--brand-grad); border-radius: 99px; transition: width .6s cubic-bezier(.2, .8, .2, 1); }

.kb-steps { display: flex; gap: 10px; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 12px 14px; margin-bottom: 20px; box-shadow: var(--shadow-soft); }
.kb-step { display: flex; gap: 10px; align-items: center; flex: 1; font-size: 13px; color: var(--text-dim); }
.kb-step strong { color: var(--text); font-weight: 700; display: block; font-size: 14px; }
.kb-n { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 13px; background: var(--kb-mute); color: var(--text-dim); flex: none; transition: all .25s; }
.kb-step.on .kb-n { background: var(--brand-grad); color: #fff; box-shadow: 0 0 0 5px var(--brand-soft); }
.kb-step.done .kb-n { background: var(--status-good); color: #fff; }
.kb-step-sep { width: 34px; height: 2px; background: var(--border); border-radius: 2px; flex: none; }

.kb-board { display: grid; grid-template-columns: 380px 1fr; gap: 24px; align-items: start; }
.kb-people { position: sticky; top: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-soft); display: flex; flex-direction: column; max-height: calc(100vh - 40px); min-width: 0; }
.kb-people-head { padding: 18px 18px 14px; border-bottom: 1px solid var(--border); }
.kb-people-head h2 { margin: 0 0 12px; font-size: 17px; display: flex; justify-content: space-between; align-items: center; }
.kb-count { font-size: 12px; font-weight: 700; color: var(--brand-ink); background: var(--brand-soft); border-radius: 999px; padding: 3px 10px; }
.kb-people-head .dp-search { width: 100%; }
.kb-pills { margin-top: 10px; gap: 6px; }
.kb-pills .dp-pill { padding: 5px 10px; font-size: 12px; }
.kb-people-list { overflow: auto; padding: 14px; display: grid; gap: 12px; align-content: start; }
.kb-people > .hint { padding: 0 18px 18px; }

.kb-card { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 14px; display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; transition: box-shadow .2s, border-color .2s, transform .2s, opacity .2s; user-select: none; -webkit-user-select: none; outline: none; }
.kb-card[data-drag="1"] { cursor: grab; touch-action: pan-y; }
.kb-card:hover, .kb-card:focus-visible { box-shadow: var(--shadow-float); border-color: transparent; }
.kb-card.selected { border-color: var(--border); box-shadow: inset 3px 0 0 var(--brand), var(--shadow-soft); }
.kb-card.picked { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft), var(--shadow-float); }
.kb-card.dragging { opacity: .35; transform: scale(.98); }
.kb-card.inactive { opacity: .62; }
.kb-grip { position: absolute; left: 4px; top: 50%; transform: translateY(-50%); width: 6px; height: 22px; opacity: 0; transition: opacity .2s; background-image: radial-gradient(var(--text-dim) 1.2px, transparent 1.3px); background-size: 6px 6px; }
.kb-card:hover .kb-grip { opacity: .5; }
.kb-avatar { position: relative; width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 18px; letter-spacing: .02em; grid-row: span 2; flex: none; box-shadow: inset 0 -6px 14px rgba(0, 0, 0, .12), 0 6px 16px -6px rgba(0, 0, 0, .35); }
.kb-avatar::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2.5px solid var(--ring, transparent); }
.kb-badge { position: absolute; right: -6px; bottom: -4px; width: 25px; height: 25px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; box-shadow: 0 2px 6px rgba(0, 0, 0, .18); color: var(--text); }
.kb-badge .icon { width: 14px; height: 14px; }
.kb-badge.none { color: var(--status-warn-ink); } .kb-badge.fixed { color: var(--status-good-ink); } .kb-badge.login { color: var(--kb-info); }
.kb-top { display: flex; align-items: center; gap: 8px; justify-content: space-between; min-width: 0; }
.kb-name { font-size: 15px; font-weight: 700; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kb-tag { font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 99px; white-space: nowrap; }
.kb-tag.fixed { background: var(--status-good-soft); color: var(--status-good-ink); }
.kb-tag.login { background: var(--kb-info-soft); color: var(--kb-info); }
.kb-tag.none { background: var(--status-warn-soft); color: var(--status-warn-ink); }
.kb-tag.inactive { background: var(--kb-mute); color: var(--text-dim); }
.kb-contact { font-size: 12.5px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.kb-contact a { color: inherit; }
.kb-ticket { grid-column: 1 / -1; margin-top: 10px; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface-alt); min-width: 0; }
.kb-ticket.fixed { background: var(--status-good-soft); }
.kb-ticket.login { background: var(--kb-info-soft); }
.kb-ticket.none { background: var(--status-warn-soft); }
.kb-mini { width: 62px; height: 28px; flex: none; }
.kb-mini svg { width: 100%; height: 100%; display: block; }
.kb-ticket-ico { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); flex: none; }
.kb-ticket-ico .icon { width: 15px; height: 15px; }
.kb-ticket-text { min-width: 0; }
.kb-ticket-text strong { display: flex; align-items: center; gap: 6px; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kb-ticket-text span { font-size: 12px; color: var(--text-dim); display: block; }
.kb-actions { grid-column: 1 / -1; display: flex; gap: 8px; margin-top: 10px; }
.kb-actions .dp-btn { height: 34px; }
.kb-actions .dp-btn.round { width: 34px; }
.kb-actions .dp-btn.main { flex: 1; }

.kb-main { min-width: 0; }
.kb-scene { position: relative; border-radius: var(--radius-lg); overflow: hidden; background: var(--kb-ground); border: 1px solid var(--border); box-shadow: var(--shadow-soft); padding-bottom: 28px; min-height: 320px; }
.kb-scene::before { content: ""; position: absolute; inset: 0; background-image: radial-gradient(rgba(0, 0, 0, .035) 1px, transparent 1.2px); background-size: 14px 14px; pointer-events: none; }
.kb-road { position: absolute; top: 0; bottom: 0; left: 50%; width: 112px; transform: translateX(-50%); background: linear-gradient(90deg, var(--kb-asphalt-2), var(--kb-asphalt) 18%, var(--kb-asphalt) 82%, var(--kb-asphalt-2)); box-shadow: 0 0 0 6px var(--kb-ground-2); }
.kb-road::before, .kb-road::after { content: ""; position: absolute; top: 0; bottom: 0; width: 3px; background: rgba(255, 255, 255, .55); }
.kb-road::before { left: 8px; } .kb-road::after { right: 8px; }
.kb-dash { position: absolute; top: 0; bottom: 0; left: 50%; width: 4px; transform: translateX(-50%); background: repeating-linear-gradient(to bottom, var(--kb-lane) 0 26px, transparent 26px 52px); animation: kb-flow 2.4s linear infinite; opacity: .9; }
@keyframes kb-flow { to { background-position: 0 52px; } }
.kb-car { position: absolute; left: 50%; width: 26px; height: 52px; margin-left: 11px; border-radius: 9px; background: #e9e6e0; box-shadow: inset 0 -12px 0 -4px #39424b, inset 0 14px 0 -6px #39424b, 0 6px 10px rgba(0, 0, 0, .3); animation: kb-drive 14s linear infinite; }
.kb-car.up { margin-left: -37px; background: #c98440; animation-name: kb-drive-up; animation-duration: 17s; }
@keyframes kb-drive { from { top: -80px; } to { top: 100%; } }
@keyframes kb-drive-up { from { top: 100%; } to { top: -80px; } }
@media (prefers-reduced-motion: reduce) { .kb-dash { animation: none; } .kb-car { display: none; } }

.kb-section { position: relative; padding: 26px 0 6px; }
.kb-sign { position: relative; z-index: 2; margin: 0 auto 18px; width: max-content; max-width: calc(100% - 24px); display: flex; align-items: center; gap: 10px; padding: 8px 16px 8px 10px; border-radius: 999px; background: var(--surface); box-shadow: var(--shadow-float); font-weight: 700; font-size: 14px; }
.kb-sign small { color: var(--text-dim); font-weight: 600; font-size: 13px; }
.kb-sign-n { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 12px; font-weight: 800; }
.kb-sign-n.warn { background: var(--status-warn); } .kb-sign-n.good { background: var(--status-good); } .kb-sign-n.info { background: var(--kb-info); }
.kb-lots { position: relative; z-index: 1; display: grid; grid-template-columns: 1fr 112px 1fr; padding: 0 18px; }
.kb-col { display: grid; gap: 14px; align-content: start; min-width: 0; }
.kb-col.l { grid-column: 1; } .kb-col.r { grid-column: 3; }
.kb-bay { position: relative; padding: 14px 16px 12px; border-radius: 18px; transition: transform .25s, background .25s; outline: none; min-width: 0; }
.kb-bay::before { content: ""; position: absolute; inset: 0; border-radius: inherit; border: 2px solid var(--kb-bayline); border-right-color: transparent; pointer-events: none; }
.kb-bay.r::before { border-right-color: var(--kb-bayline); border-left-color: transparent; }
.kb-bay.droppable, .kb-bay.pickable { background: color-mix(in srgb, var(--brand) 7%, transparent); }
.kb-bay.droppable::before, .kb-bay.pickable::before { border-color: var(--brand); border-style: dashed; }
.kb-bay.pickable { cursor: pointer; }
.kb-bay.pickable:hover, .kb-bay.pickable:focus-visible, .kb-bay.over { background: color-mix(in srgb, var(--brand) 15%, transparent); }
.kb-bay.over { transform: scale(1.02); }
.kb-bay.locked { opacity: .5; }
.kb-bay:focus-visible { box-shadow: 0 0 0 3px var(--brand-soft); }
.kb-veh { position: relative; width: 100%; max-width: 240px; aspect-ratio: 140 / 62; margin-left: auto; filter: drop-shadow(0 10px 10px rgba(0, 0, 0, .18)); }
.kb-bay.r .kb-veh { margin-left: 0; margin-right: auto; }
.kb-veh svg { width: 100%; height: 100%; display: block; }
.kb-bay.r .kb-veh svg { transform: scaleX(-1); }
.kb-seat { position: absolute; width: 22%; aspect-ratio: 1; border-radius: 50%; transform: translate(-50%, -50%); display: grid; place-items: center; transition: transform .3s cubic-bezier(.2, 1.4, .4, 1); }
.kb-seat .icon { width: 44%; height: 44%; }
.kb-seat.empty { border: 2.5px dashed var(--brand); background: color-mix(in srgb, var(--surface) 72%, transparent); color: var(--brand); }
.kb-seat.empty::after { content: ""; position: absolute; inset: -6px; border-radius: 50%; border: 2px solid var(--brand); opacity: 0; animation: kb-ping 2.2s ease-out infinite; }
@keyframes kb-ping { 0% { transform: scale(.85); opacity: .6; } 80%, 100% { transform: scale(1.35); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .kb-seat.empty::after { animation: none; } }
.kb-seat.filled { color: #fff; font-weight: 800; font-size: clamp(11px, 1.15vw, 16px); box-shadow: 0 0 0 3px #fff, 0 6px 14px rgba(0, 0, 0, .35); }
.kb-seat.key { background: var(--kb-info); color: #fff; box-shadow: 0 0 0 3px #fff, 0 6px 14px rgba(0, 0, 0, .3); }
.kb-bay.over .kb-seat { transform: translate(-50%, -50%) scale(1.15); }
.kb-unlink { position: absolute; right: -7px; top: -7px; width: 22px; height: 22px; padding: 0; border-radius: 50%; border: 0; background: var(--surface); color: var(--text); box-shadow: 0 2px 6px rgba(0, 0, 0, .25); display: grid; place-items: center; opacity: 0; transition: opacity .2s; }
.kb-unlink .icon { width: 11px; height: 11px; }
.kb-bay:hover .kb-unlink, .kb-unlink:focus-visible { opacity: 1; }
@media (hover: none) { .kb-unlink { opacity: 1; } }
.kb-info { display: flex; align-items: center; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.kb-info strong { font-size: 14px; }
.kb-info .dp-mode { font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 99px; background: var(--surface); box-shadow: var(--shadow-soft); }
.kb-info .dp-mode.free { color: var(--status-warn-ink); }
.kb-sub { width: 100%; font-size: 12.5px; color: var(--text-dim); }
.kb-legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-dim); margin: 12px 4px 0; }
.kb-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; }
.kb-dot.brand { background: var(--brand); } .kb-dot.good { background: var(--status-good); } .kb-dot.info { background: var(--kb-info); }

.kb-pickbar { position: fixed; left: 50%; bottom: 24px; z-index: 60; transform: translate(-50%, 180%); visibility: hidden; background: var(--chip-bg); color: var(--chip-text); padding: 8px 8px 8px 18px; border-radius: 999px; display: flex; gap: 14px; align-items: center; box-shadow: var(--shadow-float); transition: transform .35s cubic-bezier(.2, .9, .3, 1), visibility .35s; font-size: 14px; }
.kb-pickbar.show { transform: translate(-50%, 0); visibility: visible; }
.kb-pickbar button { padding: 7px 14px; border-radius: 999px; background: transparent; color: inherit; border: 1px solid var(--chip-border); font-weight: 600; }
.kb-ghost { position: fixed; z-index: 70; width: 62px; height: 62px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 19px; pointer-events: none; transform: translate(-50%, -50%) scale(1.05); box-shadow: 0 0 0 4px #fff, 0 18px 30px -6px rgba(0, 0, 0, .45); transition: transform .12s; }
.kb-ghost.near { transform: translate(-50%, -50%) scale(.82); }
.kb-flyer { position: fixed; z-index: 70; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 800; pointer-events: none; box-shadow: 0 0 0 3px #fff, 0 10px 20px rgba(0, 0, 0, .35); }
.kb-veil { position: fixed; inset: 0; z-index: 65; background: rgba(20, 16, 10, .28); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); display: grid; place-items: center; opacity: 0; pointer-events: none; transition: opacity .2s; }
.kb-veil.show { opacity: 1; pointer-events: auto; }
.kb-confirm { width: min(440px, calc(100vw - 32px)); background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-float); padding: 22px; transform: translateY(10px) scale(.98); transition: transform .25s; }
.kb-veil.show .kb-confirm { transform: none; }
.kb-pair { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 4px 0 16px; }
.kb-pair .kb-avatar { grid-row: auto; font-size: 20px; }
.kb-pair .kb-veh { width: 150px; margin: 0; }
.kb-arrow { flex: none; width: 54px; height: 2px; background: repeating-linear-gradient(90deg, var(--brand) 0 6px, transparent 6px 11px); position: relative; }
.kb-arrow::after { content: ""; position: absolute; right: -2px; top: -4px; border: 5px solid transparent; border-left-color: var(--brand); }
.kb-confirm h3 { margin: 0 0 4px; font-size: 18px; text-align: center; }
.kb-lead { margin: 0 0 14px; color: var(--text-dim); font-size: 14px; text-align: center; line-height: 1.5; }
.kb-notes { display: grid; gap: 8px; margin-bottom: 14px; }
.kb-note { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--status-warn-soft); color: var(--status-warn-ink); font-size: 13px; line-height: 1.45; }
.kb-note .icon { width: 16px; height: 16px; flex: none; margin-top: 1px; }
.kb-field { display: grid; gap: 6px; font-size: 13px; font-weight: 600; }
.kb-field input { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; background: var(--surface-alt); color: var(--text); font: inherit; }
.kb-hint { margin: 6px 0 16px; font-size: 12px; color: var(--text-dim); line-height: 1.45; }
.kb-row { display: flex; gap: 10px; justify-content: flex-end; }
.kb-row .dp-btn { padding: 0 16px; }
.kb-row .kb-yes { background: var(--brand-grad); color: #fff; border: 0; }

@media (max-width: 1100px) { .kb-board { grid-template-columns: 1fr; } .kb-people { position: relative; top: 0; max-height: none; } .kb-people-list { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); } .kb-kpis { grid-template-columns: 1fr 1fr; } }
@media (max-width: 720px) {
  .kb-steps { flex-direction: column; align-items: stretch; } .kb-step-sep { display: none; }
  .kb-road { left: 30px; width: 48px; } .kb-car { display: none; }
  .kb-lots { grid-template-columns: 52px 1fr; padding: 0 12px 0 10px; } .kb-col.l, .kb-col.r { grid-column: 2; }
  .kb-bay.r::before { border-right-color: transparent; border-left-color: var(--kb-bayline); }
  .kb-bay.r .kb-veh { margin-left: 0; } .kb-veh { margin-left: 0; }
  .kb-sign { margin-left: 64px; }
}

/* koppelbord v2: one scene — sidewalk (people) | zebra crossing | road (vehicles) */
:root { --kb-pave: #dcd6cb; --kb-pave-line: rgba(255, 255, 255, 0.6); --kb-kerb: #c4bcae; --kb-kerb-top: #ece7de; }
:root[data-theme="dark"] { --kb-pave: #25272b; --kb-pave-line: rgba(255, 255, 255, 0.05); --kb-kerb: #34363b; --kb-kerb-top: #3d4045; }
.kb-board { grid-template-columns: 380px 78px 1fr; gap: 0; align-items: stretch; border-radius: var(--radius-lg); overflow: clip; border: 1px solid var(--border); box-shadow: var(--shadow-soft); background: var(--kb-ground); }
.kb-people { position: relative; top: auto; max-height: none; border: 0; border-radius: 0; background-color: var(--kb-pave); background-image: linear-gradient(var(--kb-pave-line) 2px, transparent 2px), linear-gradient(90deg, var(--kb-pave-line) 2px, transparent 2px); background-size: 36px 36px; box-shadow: inset -10px 0 0 var(--kb-kerb), inset -13px 0 0 var(--kb-kerb-top); }
.kb-people-inner { position: sticky; top: 12px; max-height: calc(100vh - 24px); display: flex; flex-direction: column; padding: 18px 26px 18px 16px; min-height: 0; }
.kb-people-head { padding: 14px 16px; border: 0; background: color-mix(in srgb, var(--surface) 90%, transparent); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); border-radius: var(--radius-md); box-shadow: var(--shadow-float); margin-bottom: 14px; }
.kb-people-head h2 { gap: 10px; justify-content: flex-start; }
.kb-people-head h2::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.kb-people-head h2 .kb-count { margin-left: auto; }
.kb-people-list { padding: 2px 2px 10px; gap: 14px; }
.kb-people-inner > .hint { margin: 0; padding: 14px 16px; border-radius: var(--radius-md); background: color-mix(in srgb, var(--surface) 90%, transparent); box-shadow: var(--shadow-soft); }
.kb-card { border-color: transparent; box-shadow: 0 14px 22px -16px rgba(0, 0, 0, 0.45), 0 2px 6px rgba(0, 0, 0, 0.06); }
.kb-main { display: flex; flex-direction: column; }
.kb-scene { flex: 1; border: 0; border-radius: 0; box-shadow: none; }
.kb-legend { margin: 12px 4px 0; }

.kb-cross { position: relative; background: var(--kb-asphalt); box-shadow: inset 0 0 0 0 transparent; }
.kb-cross::before { content: ""; position: absolute; top: 0; bottom: 0; left: 14px; right: 14px; background: repeating-linear-gradient(to bottom, rgba(255, 255, 255, 0.82) 0 14px, transparent 14px 32px); opacity: 0.85; }
.kb-cross::after { content: ""; position: absolute; top: 0; bottom: 0; right: 0; width: 6px; background: var(--kb-ground-2); }
.kb-cross-inner { position: sticky; top: 38vh; z-index: 2; display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 40px 0; }
.kb-cross-badge { width: 50px; height: 50px; border-radius: 50%; background: var(--surface); color: var(--brand); display: grid; place-items: center; box-shadow: var(--shadow-float); transition: background .25s, color .25s, box-shadow .25s; }
.kb-cross-badge .icon { width: 24px; height: 24px; animation: kb-nudge 1.8s ease-in-out infinite; }
@keyframes kb-nudge { 0%, 100% { transform: translateX(-3px); } 50% { transform: translateX(4px); } }
.kb-cross-label { writing-mode: vertical-rl; background: var(--surface); color: var(--text); font-size: 12px; font-weight: 700; letter-spacing: .02em; padding: 14px 7px; border-radius: 999px; box-shadow: var(--shadow-float); white-space: nowrap; }
.kb-board.is-dragging .kb-cross-badge, .kb-board.is-picking .kb-cross-badge { background: var(--brand-grad); color: #fff; box-shadow: 0 0 0 8px var(--brand-soft), var(--shadow-float); }
.kb-board.is-dragging .kb-cross-badge .icon, .kb-board.is-picking .kb-cross-badge .icon { animation-duration: .7s; }
.kb-board.is-dragging .kb-cross-label, .kb-board.is-picking .kb-cross-label { color: var(--brand-ink); }
@media (prefers-reduced-motion: reduce) { .kb-cross-badge .icon { animation: none; } }

@media (max-width: 1100px) {
  .kb-board { grid-template-columns: 1fr; }
  .kb-people { box-shadow: inset 0 -10px 0 var(--kb-kerb), inset 0 -13px 0 var(--kb-kerb-top); }
  .kb-people-inner { position: relative; top: 0; max-height: none; padding: 16px 16px 28px; }
  .kb-cross { height: 74px; }
  .kb-cross::before { top: 12px; bottom: 12px; left: 0; right: 0; background: repeating-linear-gradient(to right, rgba(255, 255, 255, 0.82) 0 14px, transparent 14px 32px); }
  .kb-cross::after { top: auto; left: 0; height: 6px; width: auto; }
  .kb-cross-inner { position: relative; top: 0; height: 100%; flex-direction: row; justify-content: center; padding: 0; }
  .kb-cross-badge { width: 44px; height: 44px; }
  .kb-cross-badge .icon { transform: rotate(90deg); animation-name: kb-nudge-down; }
  @keyframes kb-nudge-down { 0%, 100% { transform: rotate(90deg) translateX(-3px); } 50% { transform: rotate(90deg) translateX(4px); } }
  .kb-cross-label { writing-mode: horizontal-tb; padding: 8px 14px; }
}

/* koppelbord: path 2 (Aanmelden) + link between the paths */
.kb-other-path { display: flex; align-items: center; gap: 10px; width: 100%; padding: 12px 14px; border-radius: var(--radius-md); border: 1.5px dashed color-mix(in srgb, var(--kb-info) 55%, transparent); background: color-mix(in srgb, var(--surface) 85%, transparent); color: var(--text); font-size: 13px; font-weight: 600; text-align: left; }
.kb-other-path .icon { width: 16px; height: 16px; color: var(--kb-info); flex: none; }
.kb-other-path span { flex: 1; }
.kb-other-path b { color: var(--kb-info); white-space: nowrap; }
.kb-other-path:hover { border-style: solid; }
.kb-dot.muted { background: var(--text-dim); opacity: .5; } .kb-dot.danger { background: var(--danger); }
.kb-sign-n.muted { background: var(--text-dim); }
.kb-section.muted .kb-bay { opacity: .78; }
.kb-section.muted .kb-bay:hover { opacity: 1; }
.kb-cross-badge.key { color: var(--kb-info); }
.kb-cross-badge.key .icon { animation: none; width: 22px; height: 22px; }
.kb-seat.alert { background: var(--danger); color: #fff; box-shadow: 0 0 0 3px #fff, 0 0 0 9px color-mix(in srgb, var(--danger) 30%, transparent); animation: kb-alert 1.6s ease-in-out infinite; }
@keyframes kb-alert { 50% { box-shadow: 0 0 0 3px #fff, 0 0 0 14px color-mix(in srgb, var(--danger) 10%, transparent); } }
.kb-seat.muted { filter: saturate(.55); opacity: .85; }
.kb-seat.empty.still::after { display: none; }
.kb-seat.empty.still { border-color: var(--text-dim); color: var(--text-dim); }
.kb-seat-key { position: absolute; right: -6px; bottom: -6px; width: 46%; aspect-ratio: 1; border-radius: 50%; background: var(--kb-info); color: #fff; display: grid; place-items: center; box-shadow: 0 0 0 2px #fff; }
.kb-seat-key .icon { width: 62%; height: 62%; }
.kb-bay.alert { background: color-mix(in srgb, var(--danger) 8%, transparent); }
.kb-bay.alert::before { border-color: color-mix(in srgb, var(--danger) 55%, transparent); }
.kb-bay-ctrl { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.kb-bay-ctrl .drv-pick { flex: 1 1 160px; min-width: 0; margin: 0; font-size: 12px; padding: 7px 10px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); color: var(--text); }
.kb-scene-empty { position: relative; z-index: 2; text-align: center; }
.kb-how { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-soft); margin-bottom: 18px; }
.kb-how summary { list-style: none; display: flex; align-items: center; gap: 14px; padding: 14px 18px; cursor: pointer; }
.kb-how summary::-webkit-details-marker { display: none; }
.kb-how-ico { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--kb-info-soft); color: var(--kb-info); flex: none; }
.kb-how-ico .icon { width: 18px; height: 18px; }
.kb-how-t { flex: 1; min-width: 0; }
.kb-how-t strong { display: block; font-size: 14px; }
.kb-how-t span { font-size: 13px; color: var(--text-dim); }
.kb-how-chev { width: 18px; height: 18px; color: var(--text-dim); transition: transform .2s; }
.kb-how[open] .kb-how-chev { transform: rotate(180deg); }
.kb-how > .hint { padding: 0 18px 16px; margin: 0; }
.kb-methods { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; padding: 0 18px 14px; }
.kb-method { text-align: left; background: var(--surface-alt); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; color: var(--text); font: inherit; }
.kb-method:hover { border-color: var(--kb-info); }
.kb-method.active { border-color: var(--kb-info); box-shadow: 0 0 0 3px var(--kb-info-soft); }
.kb-method-head { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.kb-method-head strong { font-size: 13.5px; }
.kb-method p { margin: 6px 0 0; font-size: 12.5px; color: var(--text-dim); line-height: 1.45; }
.dp-pill .icon-sm { width: 12px; height: 12px; }
@media (max-width: 1100px) { .kb-methods { grid-template-columns: 1fr 1fr; } }
@media (max-width: 720px) { .kb-methods { grid-template-columns: 1fr; } .kb-how summary { align-items: flex-start; } }

/* koppelbord: seat illustration (path 1) and the switch-to-sign-in control (path 2) */
.kb-veh.kb-seatpic { aspect-ratio: 140 / 100; max-width: 190px; filter: drop-shadow(0 8px 8px rgba(0, 0, 0, .14)); }
.kb-veh.kb-seatpic .kb-seat { width: 30%; }
.kb-pair .kb-veh.kb-seatpic { width: 120px; }
.kb-addlogin { position: relative; z-index: 2; display: flex; justify-content: center; padding: 18px 18px 0; }
.kb-addlogin .drv-pick { width: auto; max-width: min(420px, 100%); margin: 0; padding: 9px 16px; border-radius: 999px; background: var(--surface); border: 1.5px dashed color-mix(in srgb, var(--kb-info) 55%, transparent); color: var(--text); font-weight: 600; font-size: 13px; box-shadow: var(--shadow-float); }
.kb-other-path.fixed { border-color: color-mix(in srgb, var(--status-good) 55%, transparent); }
.kb-other-path.fixed .icon, .kb-other-path.fixed b { color: var(--status-good-ink); }

/* koppelbord: unlinking (button, drag back to the sidewalk) */
.kb-unlink { opacity: .92; }
.kb-seat.movable { cursor: grab; touch-action: none; }
.kb-seat.lifted { opacity: .25; }
.kb-unlink-btn { display: inline-flex; align-items: center; gap: 5px; margin-left: auto; padding: 4px 10px 4px 8px; border-radius: 999px; border: 1px solid color-mix(in srgb, var(--danger) 35%, transparent); background: var(--surface); color: var(--danger); font-size: 11.5px; font-weight: 700; }
.kb-unlink-btn .icon { width: 11px; height: 11px; }
.kb-unlink-btn:hover { background: var(--danger-soft); border-color: var(--danger); }
.kb-danger { padding: 0 16px; background: var(--danger); color: #fff; border: 0; }
.kb-danger:hover:not(:disabled) { background: var(--danger); color: #fff; filter: brightness(1.06); }
.kb-board.is-unlinking .kb-people::after { content: "Laat los om te ontkoppelen"; position: absolute; inset: 14px 26px 14px 14px; z-index: 5; display: grid; place-items: center; border-radius: var(--radius-lg); border: 2.5px dashed var(--danger); background: color-mix(in srgb, var(--danger) 7%, transparent); color: var(--danger); font-weight: 800; font-size: 15px; pointer-events: none; transition: background .2s; }
.kb-board.is-unlinking.drop-out .kb-people::after { background: color-mix(in srgb, var(--danger) 16%, transparent); }
.kb-board.is-unlinking .kb-cross-badge { background: var(--danger); color: #fff; }
.kb-board.is-unlinking .kb-cross-badge .icon { transform: scaleX(-1); animation: none; }
.kb-board.is-unlinking .kb-cross-label { color: var(--danger); }

/* koppelbord: seat without wheel (square drawing) and the lay-out picker */
.kb-veh.kb-seatpic { aspect-ratio: 1; max-width: 140px; }
.kb-veh.kb-seatpic .kb-seat { width: 40%; }
.kb-pair .kb-veh.kb-seatpic { width: 90px; }
.kb-bay-ctrl .kb-layout-pick { flex: 1 1 100%; font-weight: 600; }
.kb-layout { font-size: 12px; font-weight: 600; color: var(--text-dim); padding: 6px 12px; border-radius: 999px; background: var(--surface); box-shadow: var(--shadow-soft); }

/* ---------- Driver · submenu + Drivercard ---------- */
.drv-subtab { padding: 8px 16px; border-radius: var(--radius-pill); border: 0; background: transparent; color: var(--text-dim); font-size: 13px; font-weight: 700; white-space: nowrap; flex-shrink: 0; }
.drv-subtab:hover { color: var(--text); background: var(--border); opacity: 1; }
.drv-subtab.active { background: var(--brand); color: var(--brand-on); }
.dc-page { min-height: 100%; }
.dc-wrap { display: grid; grid-template-columns: 270px 1fr; min-height: 100%; }
.dc-rail { position: sticky; top: 0; align-self: start; height: calc(100vh - 70px); display: flex; flex-direction: column; border-right: 1px solid var(--border); background: var(--surface); }
.dc-rail-head { padding: 22px 18px 12px; }
.dc-rail-head h2 { margin: 0 0 12px; font-size: 20px; letter-spacing: -.01em; }
.dc-search { width: 100%; }
.dc-people { overflow: auto; padding: 4px 10px 18px; display: grid; gap: 4px; align-content: start; }
.dc-person { display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 10px; border: 0; border-radius: var(--radius-md); background: transparent; color: var(--text); text-align: left; }
.dc-person:hover { background: var(--surface-alt); opacity: 1; }
.dc-person.active { background: var(--brand-soft); box-shadow: inset 3px 0 0 var(--brand); }
.dc-person.inactive { opacity: .6; }
.dc-av { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 13px; flex: none; }
.dc-person-t { display: grid; min-width: 0; }
.dc-person-t strong { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dc-person-t small { font-size: 12px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dc-main { padding: 24px clamp(16px, 2.6vw, 34px) 48px; display: grid; gap: 18px; align-content: start; min-width: 0; }
.dc-empty { padding: 40px 0; }
.dc-sub { margin: 4px 0 0; color: var(--text-dim); font-size: 13.5px; line-height: 1.5; }

.dc-hero { display: grid; grid-template-columns: 300px 1fr 280px; gap: 24px; align-items: stretch; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-soft); padding: 22px; }
.dc-media { position: relative; border-radius: var(--radius-md); overflow: hidden; min-height: 230px; display: grid; place-items: center; background: radial-gradient(circle at 50% 40%, var(--brand-soft), var(--surface-alt) 70%); }
.dc-media.m-dashcam { background: #0d0f12; }
.dc-bigav { position: relative; width: 150px; height: 150px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 52px; font-weight: 800; letter-spacing: .02em; box-shadow: inset 0 -14px 30px rgba(0, 0, 0, .14), 0 20px 40px -16px rgba(0, 0, 0, .45); }
.dc-bigav::after { content: ""; position: absolute; inset: -8px; border-radius: 50%; border: 4px solid var(--ring, transparent); }
.dc-seg { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); display: flex; padding: 3px; border-radius: 999px; background: rgba(20, 22, 26, .55); backdrop-filter: blur(6px); }
.dc-seg button { border: 0; background: transparent; color: rgba(255, 255, 255, .8); font-size: 12px; font-weight: 700; padding: 6px 12px; border-radius: 999px; }
.dc-seg button.active { background: #fff; color: #1d1f22; }
.dc-cam { position: absolute; inset: 0; display: grid; place-items: center; background: linear-gradient(160deg, #1b1f25, #0b0d10); color: #cfd6dd; }
.dc-cam::before { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(0deg, rgba(255, 255, 255, .025) 0 1px, transparent 1px 3px); }
.dc-cam-rec { position: absolute; left: 12px; top: 12px; font-size: 11px; font-weight: 800; letter-spacing: .12em; color: #ef6a5e; }
.dc-cam-rec::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: currentColor; margin-right: 6px; opacity: .5; }
.dc-cam-ts { position: absolute; right: 12px; top: 12px; font-size: 11px; color: #9aa3ad; font-variant-numeric: tabular-nums; }
.dc-cam-msg { position: relative; display: grid; justify-items: center; gap: 6px; text-align: center; max-width: 240px; font-size: 12.5px; line-height: 1.45; color: #9aa3ad; padding-bottom: 30px; }
.dc-cam-msg .icon { width: 30px; height: 30px; color: #cfd6dd; }
.dc-cam-msg strong { color: #f3efe8; font-size: 14px; }
.dc-id { min-width: 0; display: flex; flex-direction: column; }
.dc-id-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.dc-id h1 { margin: 0; font-size: 30px; letter-spacing: -.02em; }
.dc-acts { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0; }
.dc-act { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface-alt); color: var(--text); font-size: 13px; font-weight: 700; text-decoration: none; }
.dc-act .icon { width: 16px; height: 16px; color: var(--brand); }
.dc-act:hover { border-color: var(--brand); opacity: 1; }
.dc-act.off { opacity: .45; pointer-events: none; }
.dc-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 20px; margin: auto 0 0; }
.dc-fact dt { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-dim); }
.dc-fact dd { margin: 3px 0 0; font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.dc-car { display: flex; flex-direction: column; justify-content: center; gap: 12px; padding: 16px; border-radius: var(--radius-md); background: var(--surface-alt); }
.dc-car-pic { width: 100%; max-width: 230px; aspect-ratio: 140 / 62; margin: 0 auto; filter: drop-shadow(0 10px 12px rgba(0, 0, 0, .2)); }
.dc-car-pic svg { width: 100%; height: 100%; display: block; }
.dc-car-t { display: grid; gap: 4px; }
.dc-car-t small { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-dim); }
.dc-car-t strong { display: flex; align-items: center; gap: 8px; font-size: 16px; flex-wrap: wrap; }
.dc-car-t span { font-size: 12.5px; color: var(--text-dim); }

.dc-live { display: grid; grid-template-columns: 200px 220px 1fr 300px; gap: 18px; }
.dc-tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-soft); padding: 16px 18px; min-width: 0; }
.dc-tile h3 { margin: 0 0 8px; font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--text-dim); }
.dc-tile-sub { margin: 6px 0 0; font-size: 12.5px; color: var(--text-dim); }
.dc-tile-addr { margin: 8px 0 0; font-size: 13px; font-weight: 600; }
.dc-gauge-svg { width: 100%; max-width: 170px; display: block; margin: 0 auto; }
.dc-gauge-svg .trk { fill: none; stroke: var(--surface-alt); stroke-width: 9; stroke-linecap: round; }
.dc-gauge-svg .val { fill: none; stroke: var(--brand); stroke-width: 9; stroke-linecap: round; }
.dc-gauge-svg .tks line { stroke: var(--text-dim); stroke-width: 1.5; opacity: .5; }
.dc-gauge-svg .num { font: 800 26px var(--font); fill: var(--text); text-anchor: middle; }
.dc-gauge-svg .unit { font: 600 10px var(--font); fill: var(--text-dim); text-anchor: middle; }
.dc-gauge .dc-tile-sub { text-align: center; }
.dc-state { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.dc-state i { width: 14px; height: 14px; border-radius: 50%; background: var(--text-dim); box-shadow: 0 0 0 5px var(--surface-alt); }
.dc-state.drive i { background: var(--status-good); box-shadow: 0 0 0 5px var(--status-good-soft); }
.dc-state.idle i { background: var(--status-warn); box-shadow: 0 0 0 5px var(--status-warn-soft); }
.dc-state strong { font-size: 20px; }
.dc-maptile { padding: 0; overflow: hidden; display: flex; flex-direction: column; min-height: 230px; }
.dc-map-head { display: flex; justify-content: space-between; align-items: baseline; padding: 14px 18px 8px; gap: 10px; }
.dc-map-head h3 { margin: 0; }
.dc-map-note { font-size: 12px; color: var(--text-dim); }
.dc-map { flex: 1; min-height: 190px; }
.dc-kpi-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.dc-kpi-grid b { display: block; font-size: 20px; font-weight: 800; letter-spacing: -.01em; }
.dc-kpi-grid span { font-size: 12px; color: var(--text-dim); }
.dc-kpi-grid .warn b { color: var(--status-warn-ink); }

.dc-trips { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-soft); padding: 20px 22px; min-width: 0; }
.dc-trips-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.dc-trips-head h2 { margin: 0; font-size: 20px; }
.dc-trips-head .dc-sub { max-width: 720px; }
.dc-export { display: flex; gap: 8px; }
.dc-export .dp-btn { height: 38px; padding: 0 16px; }
.dc-filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 16px 0 14px; }
.dc-periods .dp-pill { padding: 7px 12px; }
.dc-custom { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-dim); }
.dc-custom input { padding: 7px 10px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-size: 13px; }
.dc-select { width: auto; margin: 0; padding: 8px 12px; border-radius: 999px; font-size: 13px; background: var(--surface); border: 1px solid var(--border); color: var(--text); }
.dc-tsearch { width: min(300px, 100%); margin-left: auto; }
.dc-table-wrap { overflow: auto; max-height: 70vh; border: 1px solid var(--border); border-radius: var(--radius-md); }
.dc-table { width: 100%; min-width: 1180px; border-collapse: collapse; }
.dc-table th { position: sticky; top: 0; z-index: 1; background: var(--surface-alt); text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-dim); padding: 10px 12px; white-space: nowrap; }
.dc-table td { padding: 10px 12px; border-top: 1px solid var(--border); vertical-align: top; font-size: 13px; }
.dc-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.dc-table td.nowrap { white-space: nowrap; }
.dc-table tbody tr:not(.dc-edit-row) { cursor: pointer; }
.dc-table tbody tr:not(.dc-edit-row):hover td { background: var(--surface-alt); }
.dc-table tr.sel td { background: var(--brand-soft); }
.dc-table tr.open td { background: var(--brand-soft); border-bottom-color: transparent; }
.dc-time { display: block; font-size: 12px; color: var(--text-dim); margin-top: 2px; }
.dc-addr { display: grid; gap: 2px; min-width: 180px; max-width: 260px; }
.dc-addr strong { font-size: 13px; }
.dc-addr span { font-size: 12.5px; color: var(--text); }
.dc-addr span.muted { color: var(--text-dim); font-style: italic; }
.dc-char { display: inline-block; font-size: 11.5px; font-weight: 800; padding: 3px 9px; border-radius: 999px; }
.dc-char.zakelijk { background: var(--kb-info-soft); color: var(--kb-info); }
.dc-char.woonwerk { background: var(--status-good-soft); color: var(--status-good-ink); }
.dc-char.prive { background: var(--brand-soft); color: var(--brand-ink); }
.dc-char.open { background: var(--status-warn-soft); color: var(--status-warn-ink); }
.dc-src { display: block; font-size: 11px; color: var(--text-dim); margin-top: 3px; }
.dc-notecell { max-width: 240px; color: var(--text-dim); font-size: 12.5px; }
.dc-none { padding: 18px; margin: 0; }
.dc-edit-row td { background: var(--brand-soft); padding: 0 12px 14px; border-top: 0; cursor: default; }
.dc-edit { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px 18px; background: var(--surface); border-radius: var(--radius-md); padding: 16px 18px; box-shadow: var(--shadow-soft); }
.dc-field { display: grid; gap: 6px; align-content: start; }
.dc-field.wide { grid-column: span 2; }
.dc-field label { font-size: 12px; font-weight: 700; color: var(--text); }
.dc-field small { font-size: 11.5px; color: var(--text-dim); line-height: 1.4; }
.dc-field input, .dc-field textarea { width: 100%; padding: 9px 12px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface-alt); color: var(--text); font: inherit; font-size: 13px; resize: vertical; }
.dc-seg2 { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--surface-alt); border: 1px solid var(--border); width: fit-content; }
.dc-seg2 button { border: 0; background: transparent; padding: 7px 16px; border-radius: 999px; font-weight: 700; font-size: 13px; color: var(--text-dim); }
.dc-seg2 button.active { background: var(--brand); color: var(--brand-on); }
.dc-linkbtn { justify-self: start; border: 0; background: none; padding: 0; color: var(--brand-ink); font-weight: 700; font-size: 12.5px; text-decoration: underline; }
.dc-edit-acts { grid-column: 1 / -1; display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.dc-edit-acts .dc-src { margin: 0 auto 0 0; }
.dc-edit-acts .dp-btn { padding: 0 16px; }

@media (max-width: 1300px) { .dc-hero { grid-template-columns: 260px 1fr; } .dc-car { grid-column: 1 / -1; flex-direction: row; align-items: center; } .dc-car-pic { max-width: 180px; margin: 0; } .dc-live { grid-template-columns: 1fr 1fr; } }
@media (max-width: 900px) {
  .dc-wrap { grid-template-columns: 1fr; }
  .dc-rail { position: relative; height: auto; border-right: 0; border-bottom: 1px solid var(--border); }
  .dc-people { display: flex; overflow-x: auto; padding-bottom: 12px; }
  .dc-person { width: auto; flex: none; }
  .dc-hero { grid-template-columns: 1fr; }
  .dc-live { grid-template-columns: 1fr; }
  .dc-edit { grid-template-columns: 1fr; } .dc-field.wide { grid-column: auto; }
  .dc-tsearch { margin-left: 0; }
}
.dc-edit { position: sticky; left: 12px; }
/* Drivercard: layout follows the width of the card area itself (container queries) */
.dc-main { container-type: inline-size; }
.dc-live { grid-template-columns: minmax(170px, .8fr) minmax(180px, .8fr) minmax(260px, 1.6fr) minmax(220px, 1fr); }
.dc-map-head { flex-wrap: wrap; }
@container (max-width: 1080px) {
  .dc-hero { grid-template-columns: 240px 1fr; }
  .dc-car { grid-column: 1 / -1; flex-direction: row; align-items: center; }
  .dc-car-pic { max-width: 170px; margin: 0; }
  .dc-live { grid-template-columns: 1fr 1fr; }
}
@container (max-width: 640px) {
  .dc-hero, .dc-live { grid-template-columns: 1fr; }
  .dc-car { flex-direction: column; align-items: stretch; }
  .dc-facts { grid-template-columns: 1fr; }
}

/* ---------- Driver avatars (avatars.js): drawn faces, photos, picker ---------- */
.av-custom { position: relative; }
.av-custom > .av-svg { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 50%; clip-path: circle(50%); pointer-events: none; }
.kb-seat.av-custom > .kb-unlink, .kb-avatar.av-custom > .kb-badge, .kb-seat.av-custom > .kb-seat-key { z-index: 1; }
.drvm-avrow { display: flex !important; flex-direction: row !important; align-items: center; gap: 14px; padding: 10px 12px; border-radius: var(--radius-md); background: var(--surface-alt); }
.drvm-av { position: relative; width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 18px; flex: none; box-shadow: 0 6px 14px -6px rgba(0, 0, 0, .35); }
.drvm-av-t { flex: 1; min-width: 0; display: grid; gap: 2px; }
.drvm-av-t label { margin: 0; }
.drvm-av-t span { font-size: 12.5px; color: var(--text-dim); }
.dc-av-edit { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 999px; border: 0; background: rgba(20, 22, 26, .62); color: #fff; font-size: 12px; font-weight: 700; backdrop-filter: blur(6px); }
.dc-av-edit .icon { width: 13px; height: 13px; }
.dc-av-edit:hover { background: rgba(20, 22, 26, .8); opacity: 1; }
.av-veil { position: fixed; inset: 0; z-index: 400; display: grid; place-items: center; background: rgba(20, 16, 10, .32); backdrop-filter: blur(3px); padding: 16px; }
.av-box { width: min(620px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: var(--surface); color: var(--text); border-radius: var(--radius-lg); box-shadow: var(--shadow-float); padding: 22px; display: grid; gap: 16px; }
.av-head { display: flex; align-items: center; gap: 16px; }
.av-head h2 { margin: 0; font-size: 19px; }
.av-head p { margin: 2px 0 0; color: var(--text-dim); font-size: 13.5px; }
.av-prev { position: relative; width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 28px; flex: none; box-shadow: 0 10px 22px -10px rgba(0, 0, 0, .45); }
.av-tabs { display: flex; gap: 6px; padding: 4px; border-radius: 999px; background: var(--surface-alt); border: 1px solid var(--border); width: fit-content; max-width: 100%; overflow-x: auto; }
.av-tab { border: 0; background: transparent; padding: 7px 14px; border-radius: 999px; font-weight: 700; font-size: 13px; color: var(--text-dim); white-space: nowrap; }
.av-tab.active { background: var(--brand); color: var(--brand-on); }
.av-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
.av-opt, .av-choices.mini button { aspect-ratio: 1; padding: 0; border-radius: 50%; border: 3px solid transparent; background: none; overflow: hidden; }
.av-opt svg, .av-choices.mini svg { width: 100%; height: 100%; display: block; border-radius: 50%; }
.av-opt:hover, .av-choices.mini button:hover { border-color: var(--border); opacity: 1; }
.av-opt.sel, .av-choices.mini button.sel { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.av-builder { display: grid; gap: 12px; }
.av-row { display: grid; grid-template-columns: 110px 1fr; gap: 12px; align-items: center; }
.av-row-l { font-size: 12.5px; font-weight: 700; color: var(--text-dim); }
.av-sw { display: flex; flex-wrap: wrap; gap: 8px; }
.av-sw button { width: 28px; height: 28px; padding: 0; border-radius: 50%; border: 2px solid rgba(0, 0, 0, .08); }
.av-sw button.sel { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--brand); }
.av-choices { display: flex; flex-wrap: wrap; gap: 6px; }
.av-choices button { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: 12.5px; font-weight: 600; }
.av-choices button.sel { background: var(--brand); color: var(--brand-on); border-color: transparent; }
.av-choices.mini button { width: 46px; }
.av-photo { display: grid; gap: 10px; justify-items: start; }
.av-help { margin: 0; color: var(--text-dim); font-size: 13px; line-height: 1.5; }
.av-err { margin: 0; color: var(--danger); font-size: 13px; }
.av-btn { padding: 9px 16px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface-alt); color: var(--text); font-weight: 700; font-size: 13px; }
.av-btn.primary { background: var(--brand-grad); color: #fff; border: 0; }
.av-btn.ghost { background: transparent; }
.av-acts { display: flex; justify-content: flex-end; gap: 10px; }
@media (max-width: 560px) { .av-grid { grid-template-columns: repeat(4, 1fr); } .av-row { grid-template-columns: 1fr; gap: 6px; } }

/* ======================================================================
   DRIVER: koppelen met kaarten. A person card has one slot; free cards wait in the tray and are dropped on a person.
   ====================================================================== */

.dpx-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 22px; align-items: start; margin: 4px 0 8px; }
@media (max-width: 1000px) { .dpx-wrap { grid-template-columns: 1fr; } .dpx-tray { position: static !important; max-height: none !important; } }
.dpx-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 18px; }
.dpx-bar .dp-search { margin-left: auto; }
.dpx-people { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 54px 18px; padding-bottom: 40px; }
.dpx-none { grid-column: 1 / -1; }

.dpx-person { position: relative; display: flex; flex-direction: column; padding: 16px 16px 0; background: var(--surface); border: 1.5px solid var(--border); border-radius: 22px; box-shadow: 0 18px 32px -28px rgba(10, 130, 66, .55); transition: box-shadow .15s, border-color .15s, transform .15s; min-height: 150px; }
.dpx-person.inactive { background: var(--surface-alt); }
.dpx-person.inactive .kb-avatar, .dpx-person.inactive h3 { opacity: .55; }
.dpx-person.hot { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(39, 196, 114, .2), 0 24px 40px -26px rgba(10, 130, 66, .7); transform: translateY(-2px); }
.dpx-person.deny { animation: dpx-shake .4s; border-color: #ff7a59; }
@keyframes dpx-shake { 20% { transform: translateX(-7px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(2px); } }
.dpx-who { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.dpx-who .kb-avatar { grid-row: auto; }
.dpx-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; align-items: flex-start; }
.dpx-txt h3 { margin: 0; font-size: 16px; font-weight: 800; letter-spacing: -0.01em; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dpx-tag { margin-top: 2px; padding: 3px 11px; border-radius: 999px; font-size: 11px; font-weight: 800; white-space: nowrap; }
.dpx-tag.ok { background: #d5f7e4; color: #0a7a3d; } .dpx-tag.open { background: #fff0c4; color: #8a5d00; } .dpx-tag.inactive { background: #e6ebe8; color: #4b5953; }
:root[data-theme="dark"] .dpx-tag.ok { background: #0f4a2a; color: #8ff0b8; } :root[data-theme="dark"] .dpx-tag.open { background: #4a3d12; color: #ffe29a; } :root[data-theme="dark"] .dpx-tag.inactive { background: #26352d; color: #b9c7bf; }
.dpx-acts { display: flex; flex-direction: column; gap: 6px; align-self: flex-start; }
.dpx-icobtn { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); color: var(--text-dim); border: 1px solid var(--border); padding: 0; }
.dpx-icobtn:hover:not(:disabled) { color: var(--brand-ink); border-color: var(--brand); background: var(--brand-soft); opacity: 1; }
.dpx-icobtn:disabled { opacity: .4; cursor: not-allowed; }

/* the slot hangs over the lower right of the person card */
.dpx-slot { position: relative; z-index: 1; margin: auto -14px -30px 22%; min-height: 96px; }
.dpx-slot.empty { border: 2px dashed #b9d9c7; border-radius: 18px; background: rgba(235, 255, 244, .78); backdrop-filter: blur(2px); display: grid; place-content: center; text-align: center; padding: 12px; color: var(--brand-ink); font-size: 12.5px; font-weight: 800; cursor: pointer; transition: border-color .15s, background .15s; }
.dpx-slot.empty small { display: block; margin-top: 2px; font-weight: 600; color: var(--text-dim); }
.dpx-slot.empty:hover, .dpx-person.hot .dpx-slot.empty { border-color: var(--brand); background: var(--brand-soft); }
.dpx-slot.empty.off { cursor: default; background: transparent; border-color: var(--border); color: var(--text-dim); }
:root[data-theme="dark"] .dpx-slot.empty { background: rgba(18, 52, 36, .7); border-color: #2a5a40; }

/* cards (vehicle, key) */
.dpx-card { position: relative; display: flex; gap: 12px; align-items: flex-start; padding: 13px 14px; background: var(--surface); border: 2px solid var(--brand); border-radius: 18px; box-shadow: 0 22px 34px -20px rgba(10, 80, 40, .65); user-select: none; flex-wrap: wrap; }
.dpx-card .dpx-ico { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-ink); flex-shrink: 0; }
.dpx-card .dpx-ico .icon { width: 22px; height: 22px; }
.dpx-rows { flex: 1; min-width: 150px; display: flex; flex-direction: column; gap: 3px; font-size: 12px; }
.dpx-row { display: flex; gap: 8px; align-items: baseline; white-space: nowrap; }
.dpx-row > span { color: var(--brand-ink); font-weight: 800; font-size: 10.5px; letter-spacing: .04em; text-transform: uppercase; min-width: 82px; }
.dpx-row b { font-weight: 700; color: var(--text); overflow: hidden; text-overflow: ellipsis; }
.dpx-row b.big { font-size: 15px; font-weight: 800; letter-spacing: .01em; }
.dpx-row b.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11.5px; }
.dpx-card .dpx-ctrl { flex-basis: 100%; }
.dpx-card .dpx-ctrl select { width: 100%; font-size: 11.5px; padding: 6px 8px; }
.dpx-slot .dpx-card { animation: none; }
.dpx-person.landed .dpx-slot .dpx-card { animation: dpx-land .38s cubic-bezier(.2, 1.3, .4, 1) both; }
@keyframes dpx-land { from { transform: translate(40px, 30px) scale(1.06) rotate(3deg); opacity: .4; } to { transform: none; opacity: 1; } }
.dpx-x { position: absolute; top: -10px; right: -10px; width: 26px; height: 26px; border-radius: 50%; background: var(--surface); border: 1.5px solid var(--border); color: var(--text-dim); font-size: 15px; line-height: 1; display: grid; place-items: center; padding: 0; box-shadow: 0 6px 12px -6px rgba(0, 0, 0, .4); }
.dpx-x:hover { color: #fff; background: #d9363e; border-color: #d9363e; opacity: 1; }

/* tray */
.dpx-tray { position: sticky; top: 14px; padding: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 24px; box-shadow: 0 22px 40px -30px rgba(10, 130, 66, .6); max-height: calc(100vh - 28px); display: flex; flex-direction: column; }
.dpx-tray h2 { margin: 0 0 2px; font-size: 16px; font-weight: 800; }
.dpx-tray-sub { margin: 0 0 12px; font-size: 12px; color: var(--text-dim); line-height: 1.5; }
.dpx-list { display: flex; flex-direction: column; gap: 14px; overflow-y: auto; padding: 8px 10px 10px 4px; margin: 0 -10px 0 -4px; min-height: 60px; }
.dpx-card.free { cursor: grab; border-color: #cfe5d8; box-shadow: 0 10px 20px -16px rgba(10, 80, 40, .6); touch-action: none; transition: transform .12s, border-color .12s; }
:root[data-theme="dark"] .dpx-card.free { border-color: #2a5a40; }
.dpx-card.free:hover, .dpx-card.free:focus-visible { border-color: var(--brand); transform: translateY(-2px); outline: none; }
.dpx-card.free.lifted { opacity: .35; }
.dpx-allgood { padding: 22px 12px; text-align: center; color: var(--brand-ink); font-weight: 800; font-size: 13px; background: var(--brand-soft); border-radius: 16px; }
.dpx-add { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 14px; padding: 13px 16px; border-radius: 16px; background: linear-gradient(145deg, #27c472, #0a8242); color: #fff; font-size: 14px; font-weight: 800; box-shadow: 0 14px 24px -14px #0a8242; transition: transform .15s; width: 100%; }
.dpx-add span { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: rgba(255, 255, 255, .25); font-size: 17px; line-height: 1; }
.dpx-add:hover { transform: translateY(-2px); opacity: 1; }
.dpx-other { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; margin-top: 12px; padding: 11px 14px; border-radius: 14px; background: var(--surface-alt); border: 1px dashed var(--border); color: var(--text-dim); font-size: 12px; text-align: left; }
.dpx-other b { color: var(--brand-ink); margin-left: auto; }
.dpx-ghost { position: fixed; z-index: 300; pointer-events: none; width: 300px; transform: rotate(-3deg); opacity: .96; }
.dpx-ghost .dpx-card { box-shadow: 0 34px 50px -18px rgba(0, 0, 0, .5); border-color: var(--brand); }

/* vehicles on sign-in */
.dpx-h { margin: 26px 0 12px; font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--text-dim); }
.dpx-vgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin-bottom: 22px; }
.dpx-vtile { padding: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; display: flex; flex-direction: column; gap: 8px; }
.dpx-vtile.alert { border-color: #ef6a5e; background: #fff6f5; }
:root[data-theme="dark"] .dpx-vtile.alert { background: #3a1f1d; }
.dpx-vtop { display: flex; align-items: center; gap: 10px; min-width: 0; }
.dpx-vico { width: 36px; height: 36px; border-radius: 11px; background: var(--brand-soft); color: var(--brand-ink); display: grid; place-items: center; flex-shrink: 0; }
.dpx-vname { display: flex; align-items: center; gap: 8px; min-width: 0; flex-wrap: wrap; }
.dpx-vname strong { font-size: 14px; }
.dpx-vline { margin: 0; font-size: 12px; color: var(--text-dim); }
.dpx-vtile.alert .dpx-vline { color: #c4262f; font-weight: 700; }

/* add-key popup */
.dpx-keybox { width: min(720px, 100%); }
.dpx-choices { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 620px) { .dpx-choices { grid-template-columns: 1fr; } }
.dpx-choice { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 18px; text-align: left; border: 1.5px solid var(--border); border-radius: 20px; background: var(--surface); color: var(--text); transition: border-color .15s, transform .15s; }
.dpx-choice:hover { border-color: var(--brand); transform: translateY(-2px); opacity: 1; }
.dpx-choice-ico { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-ink); }
.dpx-choice strong { font-size: 15px; font-weight: 800; }
.dpx-choice span { font-size: 12px; color: var(--text-dim); line-height: 1.5; }
.dpx-field { display: flex; flex-direction: column; gap: 5px; margin: 0 0 12px; }
.dpx-field > span { font-size: 12px; font-weight: 700; color: var(--text-dim); }
.dpx-field input, .dpx-field textarea, .dpx-field select { width: 100%; padding: 11px 13px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-alt); font: inherit; font-size: 14px; color: var(--text); }
.dpx-field textarea { min-height: 84px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; resize: vertical; }
.dpx-formula { margin: 8px 0 14px; padding: 10px 14px; border-radius: 14px; background: var(--brand-soft); color: var(--brand-ink); font-size: 12px; line-height: 1.6; }
.dpx-formula code, .dpx-conv td { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.dpx-tblwrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 14px; padding: 2px 6px; background: var(--surface); }
.dpx-conv { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.dpx-conv th { text-align: left; padding: 7px 8px; font-size: 10.5px; letter-spacing: .05em; text-transform: uppercase; color: var(--text-dim); border-bottom: 1px solid var(--border); white-space: nowrap; }
.dpx-conv th small { display: block; text-transform: none; letter-spacing: 0; font-weight: 600; opacity: .8; }
.dpx-conv td { padding: 9px 8px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.dpx-conv td.d { font-family: inherit; font-weight: 800; font-size: 15px; color: var(--brand-ink); }
.dpx-conv td.st { font-family: inherit; font-size: 11.5px; font-weight: 700; }
.dpx-conv td.st.ok { color: var(--brand-ink); }
.dpx-conv td.dpx-empty { font-family: inherit; color: var(--text-dim); }
.dpx-conv tr.bad td { color: #b4232b; } .dpx-conv tr.dup td { color: #8a5d00; }
.dpx-msg { margin: 0 0 6px; min-height: 18px; font-size: 12.5px; color: var(--text-dim); }
.dpx-mactions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; }

/* Driver: the people area sits in its own soft green box, apart from the tray and the KPIs */
.dpx-main { padding: 18px 18px 6px; background: rgba(39, 196, 114, 0.075); border: 1.5px solid rgba(39, 196, 114, 0.28); border-radius: 30px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6); min-width: 0; }
:root[data-theme="dark"] .dpx-main { background: rgba(39, 196, 114, 0.08); border-color: rgba(39, 196, 114, 0.3); box-shadow: none; }
.dpx-main .dpx-bar { margin-bottom: 22px; }
.dpx-main .dpx-slot.empty { background: rgba(255, 255, 255, .88); border-color: #9fd2b6; }
:root[data-theme="dark"] .dpx-main .dpx-slot.empty { background: rgba(18, 52, 36, .85); border-color: #2a5a40; }
.dpx-main .dpx-people { padding-bottom: 36px; }
@media (max-width: 760px) { .dpx-main { padding: 12px 10px 2px; border-radius: 24px; } }

/* Driver: stronger people box and a navigation that stands out */
.dpx-main { background: linear-gradient(180deg, rgba(20, 163, 87, 0.24), rgba(20, 163, 87, 0.15)); border: 2px solid rgba(10, 130, 66, 0.55); box-shadow: 0 18px 36px -26px rgba(10, 100, 50, .6), inset 0 1px 0 rgba(255, 255, 255, .35); }
:root[data-theme="dark"] .dpx-main { background: linear-gradient(180deg, rgba(39, 196, 114, 0.22), rgba(39, 196, 114, 0.12)); border-color: rgba(39, 196, 114, 0.6); box-shadow: none; }
.dpx-main .dp-pill { border-color: rgba(10, 130, 66, .25); }
.dpx-main .dp-search input { border-color: rgba(10, 130, 66, .3); }
.dpx-person { box-shadow: 0 16px 26px -20px rgba(0, 60, 25, .7); }


/* ======================================================================
   NAVIGATION BARS (Asset, Driver, Enrollment): one set of tokens, the chosen colour (Mint).
   ====================================================================== */
:root {
  --nav-bg: linear-gradient(145deg, #e6f8ee, #cdeedc);
  --nav-border: #a3dbbd;
  --nav-text: #1c5a3a;
  --nav-hover: rgba(255, 255, 255, 0.78);
  --nav-act-bg: linear-gradient(145deg, #34d184, #16a85e);
  --nav-act-text: #ffffff;
  --nav-shadow: 0 12px 22px -14px rgba(10, 100, 50, 0.55);
  --nav-act-shadow: 0 8px 16px -8px rgba(10, 110, 55, 0.7);
}
:root[data-theme="dark"] {
  --nav-bg: linear-gradient(145deg, rgba(39, 196, 114, 0.2), rgba(39, 196, 114, 0.12));
  --nav-border: rgba(39, 196, 114, 0.45);
  --nav-text: #bfe9d2;
  --nav-hover: rgba(255, 255, 255, 0.1);
  --nav-shadow: none;
}

.subnav, .drv-subnav, .driver-page .drv-tabs, .enr-tabs {
  display: flex; gap: 4px; padding: 5px;
  background: var(--nav-bg); border: 1.5px solid var(--nav-border); box-shadow: var(--nav-shadow);
  border-radius: 999px;
}
.subnav-tab, .drv-subnav .drv-subtab, .vid-subnav .vid-subtab, .driver-page .drv-tab, .enr-tab {
  background: transparent; border: 0; border-radius: 999px; font-family: inherit; cursor: pointer; color: var(--nav-text); font-weight: 800; letter-spacing: 0.01em;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}
.subnav-tab { padding: 8px 16px; font-size: 13.5px; }
.drv-subnav .drv-subtab, .vid-subnav .vid-subtab { padding: 9px 22px; font-size: 14px; }
.driver-page .drv-tab { padding: 11px 26px; font-size: 14.5px; }
.enr-tab { padding: 10px 20px; font-size: 14px; }
.subnav-tab:hover, .drv-subnav .drv-subtab:hover, .vid-subnav .vid-subtab:hover, .driver-page .drv-tab:hover, .enr-tab:hover { background: var(--nav-hover); color: var(--nav-text); opacity: 1; }
.subnav-tab.active, .drv-subnav .drv-subtab.active, .vid-subnav .vid-subtab.active, .driver-page .drv-tab.active, .enr-tab.active { background: var(--nav-act-bg); color: var(--nav-act-text); box-shadow: var(--nav-act-shadow); }
.driver-page .drv-tab-sub { font-weight: 600; opacity: 0.85; }
.driver-page .drv-tab.active .drv-tab-sub { color: rgba(255, 255, 255, 0.9); opacity: 1; }

/* Driver → Spelregels: the rules page lives in its own iframe so its styles stay separate */
.drv-rules { height: 100%; }
.drv-rules-frame { display: block; width: 100%; height: calc(100vh - 70px); border: 0; background: #f3f7f5; }
@media (max-width: 760px) { .drv-rules-frame { height: calc(100vh - 140px); } }

/* ======================================================================
   MAP TOOLS (landing page): fullscreen button, area selection and the activity card
   ====================================================================== */
.mt-control { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; border: none; box-shadow: none; background: none; }
.mt-btn { width: 44px; height: 44px; padding: 0; display: flex; align-items: center; justify-content: center; border-radius: var(--radius-md); border: 1px solid var(--border); background: var(--surface); color: var(--text); box-shadow: var(--shadow-float); }
.mt-btn:hover { color: var(--brand); opacity: 1; }
.mt-btn.on { background: var(--brand); border-color: var(--brand); color: var(--brand-on); }
.mt-btn.busy { color: var(--brand); animation: mt-pulse 0.9s ease-in-out infinite; }
@keyframes mt-pulse { 50% { opacity: 0.45; } }
.mt-me-wrap { background: none; border: 0; }
.mt-me { width: 34px; height: 34px; border-radius: 50%; background: #fff; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35); padding: 4px; }
.mt-me svg { width: 100%; height: 100%; display: block; }
@media (prefers-reduced-motion: reduce) { .mt-btn.busy { animation: none; } }
.mt-selecting, .mt-selecting * { cursor: crosshair !important; }
body.map-fs #rail, body.map-fs #topbar, body.map-fs #tabbar, body.map-fs #rail-backdrop { display: none !important; }
body.map-fs #content { position: fixed; inset: 0; z-index: 90; }
@media (max-width: 760px) { .mt-btn { width: 40px; height: 40px; } }

.mt-panel { width: 390px; padding: 20px; }
.mt-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.mt-head h2 { margin: 0 0 2px; font-size: 16px; }
.mt-sub { margin: 0; font-size: 12.5px; color: var(--text-dim); }
.mt-x { width: 30px; height: 30px; border-radius: 50%; padding: 0; background: var(--surface-alt); color: var(--text-dim); border: 1px solid var(--border); font-size: 18px; line-height: 1; display: grid; place-items: center; flex-shrink: 0; }
.mt-x:hover { color: #fff; background: #d9363e; border-color: #d9363e; opacity: 1; }
.mt-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.mt-chip { padding: 6px 13px; border-radius: 999px; background: var(--surface-alt); border: 1px solid var(--border); color: var(--text-dim); font-size: 12px; font-weight: 700; }
.mt-chip.active { background: var(--brand); border-color: var(--brand); color: var(--brand-on); }
.mt-chip.ghost { margin-left: auto; background: transparent; color: var(--brand-ink); }
.mt-empty { font-size: 13px; color: var(--text-dim); line-height: 1.55; padding: 8px 2px; }
.mt-card { position: relative; margin-bottom: 12px; padding: 14px 14px 12px 18px; background: var(--surface); border: 1.5px solid var(--border); border-radius: 18px; cursor: pointer; transition: border-color .15s, box-shadow .15s; overflow: hidden; }
.mt-card::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--mt, var(--brand)); }
.mt-card:hover { border-color: var(--mt, var(--brand)); }
.mt-card.open { border-color: var(--mt, var(--brand)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--mt, #2a3bd3) 22%, transparent); }
.mt-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.mt-card h3 { margin: 0 0 4px; font-size: 16px; font-weight: 800; letter-spacing: -0.01em; }
.mt-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12.5px; color: var(--text-dim); }
.mt-driver { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; background: var(--surface-alt); font-weight: 600; color: var(--text); }
.mt-now { padding: 2px 9px; border-radius: 999px; background: #d5f7e4; color: #0a7a3d; font-weight: 700; font-size: 11.5px; }
.mt-alerts { display: inline-flex; align-items: center; gap: 5px; padding: 5px 11px; border-radius: 999px; background: var(--surface-alt); color: var(--text-dim); font-size: 12.5px; font-weight: 800; border: 0; flex-shrink: 0; }
.mt-alerts.has { background: #fde0e2; color: #b4232b; }
.mt-alert-list { list-style: none; margin: 10px 0 0; padding: 8px 12px; border-radius: 12px; background: #fff3f3; font-size: 12.5px; line-height: 1.7; color: #8a1d24; }
:root[data-theme="dark"] .mt-alert-list { background: #3a1f1d; color: #ffb3b8; }
.mt-tl { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 4px; }
.mt-step { display: flex; gap: 12px; align-items: flex-start; }
.mt-step-ico { width: 24px; height: 24px; flex-shrink: 0; color: #1976d2; display: grid; place-items: center; margin-top: 2px; }
.mt-step.out .mt-step-ico { color: #1976d2; }
.mt-step-t { min-width: 0; }
.mt-step-l { display: block; font-size: 12px; color: var(--text-dim); }
.mt-step-line { display: flex; gap: 10px; align-items: baseline; font-size: 14px; flex-wrap: wrap; }
.mt-time { font-weight: 700; color: var(--text-dim); font-size: 13px; }
.mt-addr { font-weight: 700; color: var(--text); min-width: 0; }
.mt-pass { margin-left: 36px; font-size: 12px; color: var(--text-dim); padding: 2px 0; border-left: 2px dashed var(--border); padding-left: 12px; }
.mt-count { margin: 8px 0 0 2px; font-size: 12.5px; color: var(--text-dim); font-weight: 600; }
@media (max-width: 760px) { .mt-panel { width: auto; right: 10px; left: 10px; top: auto; bottom: 76px; max-height: 58vh; } }

/* Fleur logo as mouse pointer (light icon on light theme, dark icon on dark theme); hands and text carets stay */
:root { cursor: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMiIgaGVpZ2h0PSIzMiIgdmlld0JveD0iLTc4IC03OCAxNTYgMTU2Ij48ZyB0cmFuc2Zvcm09InRyYW5zbGF0ZSgwIDApIHNjYWxlKDEpIj48cGF0aCBmaWxsPSIjQjI2RTJDIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiIHRyYW5zZm9ybT0icm90YXRlKDApIiBkPSJNMCAtNiBDLTE0IC0yMiAtMjQgLTM2IC0yNCAtNTIgQTI0IDI0IDAgMSAxIDI0IC01MiBDMjQgLTM2IDE0IC0yMiAwIC02IFogTTEwIC01MiBBMTAgMTAgMCAxIDAgLTEwIC01MiBBMTAgMTAgMCAxIDAgMTAgLTUyIFoiLz48cGF0aCBmaWxsPSIjRDQ5QTFGIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiIHRyYW5zZm9ybT0icm90YXRlKDcyKSIgZD0iTTAgLTYgQy0xNCAtMjIgLTI0IC0zNiAtMjQgLTUyIEEyNCAyNCAwIDEgMSAyNCAtNTIgQzI0IC0zNiAxNCAtMjIgMCAtNiBaIE0xMCAtNTIgQTEwIDEwIDAgMSAwIC0xMCAtNTIgQTEwIDEwIDAgMSAwIDEwIC01MiBaIi8+PHBhdGggZmlsbD0iI0UwQTk1QyIgZmlsbC1ydWxlPSJldmVub2RkIiB0cmFuc2Zvcm09InJvdGF0ZSgxNDQpIiBkPSJNMCAtNiBDLTE0IC0yMiAtMjQgLTM2IC0yNCAtNTIgQTI0IDI0IDAgMSAxIDI0IC01MiBDMjQgLTM2IDE0IC0yMiAwIC02IFogTTEwIC01MiBBMTAgMTAgMCAxIDAgLTEwIC01MiBBMTAgMTAgMCAxIDAgMTAgLTUyIFoiLz48cGF0aCBmaWxsPSIjN0FBOTU2IiBmaWxsLXJ1bGU9ImV2ZW5vZGQiIHRyYW5zZm9ybT0icm90YXRlKDIxNikiIGQ9Ik0wIC02IEMtMTQgLTIyIC0yNCAtMzYgLTI0IC01MiBBMjQgMjQgMCAxIDEgMjQgLTUyIEMyNCAtMzYgMTQgLTIyIDAgLTYgWiBNMTAgLTUyIEExMCAxMCAwIDEgMCAtMTAgLTUyIEExMCAxMCAwIDEgMCAxMCAtNTIgWiIvPjxwYXRoIGZpbGw9IiM1QzhBM0UiIGZpbGwtcnVsZT0iZXZlbm9kZCIgdHJhbnNmb3JtPSJyb3RhdGUoMjg4KSIgZD0iTTAgLTYgQy0xNCAtMjIgLTI0IC0zNiAtMjQgLTUyIEEyNCAyNCAwIDEgMSAyNCAtNTIgQzI0IC0zNiAxNCAtMjIgMCAtNiBaIE0xMCAtNTIgQTEwIDEwIDAgMSAwIC0xMCAtNTIgQTEwIDEwIDAgMSAwIDEwIC01MiBaIi8+PGNpcmNsZSByPSIxMCIgZmlsbD0iIzJCMkQzMSIvPjwvZz48L3N2Zz4=") 16 16, auto; }
:root[data-theme="dark"] { cursor: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMiIgaGVpZ2h0PSIzMiIgdmlld0JveD0iLTc4IC03OCAxNTYgMTU2Ij48ZyB0cmFuc2Zvcm09InRyYW5zbGF0ZSgwIDApIHNjYWxlKDEpIj48cGF0aCBmaWxsPSIjRDk5NTRGIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiIHRyYW5zZm9ybT0icm90YXRlKDApIiBkPSJNMCAtNiBDLTE0IC0yMiAtMjQgLTM2IC0yNCAtNTIgQTI0IDI0IDAgMSAxIDI0IC01MiBDMjQgLTM2IDE0IC0yMiAwIC02IFogTTEwIC01MiBBMTAgMTAgMCAxIDAgLTEwIC01MiBBMTAgMTAgMCAxIDAgMTAgLTUyIFoiLz48cGF0aCBmaWxsPSIjRTZCMzQxIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiIHRyYW5zZm9ybT0icm90YXRlKDcyKSIgZD0iTTAgLTYgQy0xNCAtMjIgLTI0IC0zNiAtMjQgLTUyIEEyNCAyNCAwIDEgMSAyNCAtNTIgQzI0IC0zNiAxNCAtMjIgMCAtNiBaIE0xMCAtNTIgQTEwIDEwIDAgMSAwIC0xMCAtNTIgQTEwIDEwIDAgMSAwIDEwIC01MiBaIi8+PHBhdGggZmlsbD0iI0VCQzE4MyIgZmlsbC1ydWxlPSJldmVub2RkIiB0cmFuc2Zvcm09InJvdGF0ZSgxNDQpIiBkPSJNMCAtNiBDLTE0IC0yMiAtMjQgLTM2IC0yNCAtNTIgQTI0IDI0IDAgMSAxIDI0IC01MiBDMjQgLTM2IDE0IC0yMiAwIC02IFogTTEwIC01MiBBMTAgMTAgMCAxIDAgLTEwIC01MiBBMTAgMTAgMCAxIDAgMTAgLTUyIFoiLz48cGF0aCBmaWxsPSIjQTlDRjg2IiBmaWxsLXJ1bGU9ImV2ZW5vZGQiIHRyYW5zZm9ybT0icm90YXRlKDIxNikiIGQ9Ik0wIC02IEMtMTQgLTIyIC0yNCAtMzYgLTI0IC01MiBBMjQgMjQgMCAxIDEgMjQgLTUyIEMyNCAtMzYgMTQgLTIyIDAgLTYgWiBNMTAgLTUyIEExMCAxMCAwIDEgMCAtMTAgLTUyIEExMCAxMCAwIDEgMCAxMCAtNTIgWiIvPjxwYXRoIGZpbGw9IiM4RkI4NkEiIGZpbGwtcnVsZT0iZXZlbm9kZCIgdHJhbnNmb3JtPSJyb3RhdGUoMjg4KSIgZD0iTTAgLTYgQy0xNCAtMjIgLTI0IC0zNiAtMjQgLTUyIEEyNCAyNCAwIDEgMSAyNCAtNTIgQzI0IC0zNiAxNCAtMjIgMCAtNiBaIE0xMCAtNTIgQTEwIDEwIDAgMSAwIC0xMCAtNTIgQTEwIDEwIDAgMSAwIDEwIC01MiBaIi8+PGNpcmNsZSByPSIxMCIgZmlsbD0iI0YzRUZFOCIvPjwvZz48L3N2Zz4=") 16 16, auto; }


/* ======================================================================
   HOME: the Fleur look (petal strip, status tiles, petal-shaped map pins)
   ====================================================================== */
:root {
  --petal-copper: #b26e2c; --petal-gold: #d49a1f; --petal-tan: #e0a95c; --petal-leaf: #7aa956; --petal-moss: #5c8a3e;
  --st-moving: #5c8a3e; --st-idle: #d49a1f; --st-offline: #9a948a;
}
:root[data-theme="dark"] { --petal-copper: #d9954f; --petal-gold: #e6b341; --petal-tan: #ebc183; --petal-leaf: #a9cf86; --petal-moss: #8fb86a; --st-moving: #8fb86a; --st-idle: #e6b341; --st-offline: #7d786f; }

#live-list-view.home-card {
  width: 372px; bottom: auto; max-height: calc(100% - 40px); padding: 26px 20px 18px; border-radius: 30px; overflow-x: hidden;
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  -webkit-backdrop-filter: blur(16px) saturate(1.2); backdrop-filter: blur(16px) saturate(1.2);
  border-color: color-mix(in srgb, var(--border) 70%, transparent);
}
.hm-petals {
  position: absolute; left: 0; right: 0; top: 0; height: 6px;
  background: linear-gradient(90deg, var(--petal-copper) 0 20%, var(--petal-gold) 20% 40%, var(--petal-tan) 40% 60%, var(--petal-leaf) 60% 80%, var(--petal-moss) 80%);
}
.hm-greet { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.hm-mark { width: 46px; height: 46px; flex-shrink: 0; display: block; }
.hm-mark svg { width: 100%; height: 100%; }
.hm-mark svg { transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1); }
.hm-mark:hover svg { transform: rotate(72deg) scale(1.06); }
.hm-greet-t { flex: 1; min-width: 0; }
.hm-greet h1 { margin: 0; font-size: 18px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.2; }
.hm-greet p { margin: 2px 0 0; font-size: 12.5px; color: var(--text-dim); line-height: 1.35; }
.hm-greet .icon-btn-square { width: 40px; height: 40px; border-radius: 14px; background: var(--brand-grad); color: #fff; box-shadow: 0 8px 18px -6px var(--brand-glow); transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1); }
.hm-greet .icon-btn-square:hover { transform: rotate(90deg) scale(1.08); opacity: 1; }

.hm-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 18px; }
.hm-kpi {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 1px; padding: 10px 10px 9px;
  border-radius: 18px; background: var(--surface-alt); border: 1.5px solid transparent; color: var(--text); text-align: left;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), border-color 0.15s, background 0.15s; overflow: hidden;
}
.hm-kpi::before { content: ''; position: absolute; left: 10px; top: 0; width: 22px; height: 4px; border-radius: 0 0 4px 4px; background: var(--c); }
.hm-kpi[data-f="moving"] { --c: var(--st-moving); } .hm-kpi[data-f="idle"] { --c: var(--st-idle); }
.hm-kpi[data-f="offline"] { --c: var(--st-offline); } .hm-kpi[data-f="alerts"] { --c: var(--petal-copper); }
.hm-kpi:hover { transform: translateY(-2px); opacity: 1; border-color: color-mix(in srgb, var(--c) 45%, transparent); }
.hm-kpi.on { background: color-mix(in srgb, var(--c) 14%, var(--surface)); border-color: var(--c); }
.hm-kpi:focus-visible { outline: 2px solid var(--c); outline-offset: 2px; }
.hm-n { font-size: 22px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; margin-top: 4px; font-variant-numeric: tabular-nums; }
.hm-l { font-size: 10.5px; font-weight: 700; color: var(--text-dim); }
.hm-kpi[data-f="alerts"].has .hm-n { color: var(--danger); }
.hm-kpi[data-f="alerts"].has::after { content: ''; position: absolute; right: 9px; top: 9px; width: 7px; height: 7px; border-radius: 50%; background: var(--danger); animation: hm-ping 1.8s ease-out infinite; }
@keyframes hm-ping { 0% { box-shadow: 0 0 0 0 rgba(207, 58, 46, 0.5); } 100% { box-shadow: 0 0 0 9px rgba(207, 58, 46, 0); } }

.hm-list-head { margin-bottom: 8px; }
.hm-count { margin-left: 4px; padding: 1px 8px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-ink); font-size: 11.5px; font-weight: 800; vertical-align: 1px; }
.hm-reset { font-size: 12px; font-weight: 700; color: var(--brand-ink); background: transparent; padding: 4px 8px; border-radius: 999px; }
.hm-reset:hover { background: var(--brand-soft); opacity: 1; }

#device-list .device-item { padding: 8px 10px 8px 8px; gap: 12px; border-radius: 18px; transition: background 0.15s, transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1); }
#device-list .device-item:hover { transform: translateX(3px); }
.hm-av {
  position: relative; width: 38px; height: 38px; flex-shrink: 0; border-radius: 14px 14px 14px 5px; display: grid; place-items: center;
  background: color-mix(in srgb, var(--s) 16%, var(--surface)); color: var(--s);
}
.hm-av::after { content: ''; position: absolute; right: -2px; top: -2px; width: 11px; height: 11px; border-radius: 50%; background: var(--s); border: 2px solid var(--surface); }
.device-item[data-status="moving"] { --s: var(--st-moving); } .device-item[data-status="idle"] { --s: var(--st-idle); } .device-item[data-status="offline"] { --s: var(--st-offline); }
.device-item[data-status="moving"] .hm-av::after { animation: hm-pulse 2s ease-out infinite; }
@keyframes hm-pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--s) 55%, transparent); } 100% { box-shadow: 0 0 0 8px transparent; } }
.hm-body { flex: 1; min-width: 0; flex-direction: column; align-items: flex-start; gap: 1px; }
.hm-body .device-label { font-size: 13.5px; font-weight: 700; max-width: 100%; }
.hm-state { font-size: 11.5px; font-weight: 600; color: var(--s); }
.device-item[data-status="offline"] .hm-state { color: var(--text-dim); }

/* map pins: a Fleur petal (teardrop with a hole), coloured by status */
.marker-wrap { background: none; border: 0; }
.marker-pin { position: relative; width: 40px; height: 48px; --s: var(--st-offline); filter: drop-shadow(0 5px 6px rgba(43, 33, 20, 0.28)); transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1); transform-origin: 50% 94%; }
.marker-pin.st-moving { --s: var(--st-moving); } .marker-pin.st-idle { --s: var(--st-idle); }
.marker-pin:hover, .marker-pin.selected { transform: scale(1.14); }
.pin-body { position: absolute; left: 4px; top: 2px; width: 32px; height: 32px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); transform-origin: 50% 50%; background: var(--s); border: 2.5px solid #fff; box-sizing: border-box; top: 4px; }
.pin-hole { position: absolute; left: 11px; top: 11px; width: 18px; height: 18px; border-radius: 50%; background: #fff; display: grid; place-items: center; color: var(--s); }
.pin-hole .icon { width: 12px; height: 12px; }
.marker-pin.selected .pin-body { box-shadow: 0 0 0 4px color-mix(in srgb, var(--s) 30%, transparent); }
.marker-pin.st-moving::after { content: ''; position: absolute; left: 12px; top: 40px; width: 16px; height: 6px; border-radius: 50%; background: color-mix(in srgb, var(--s) 45%, transparent); animation: hm-shadow 2s ease-out infinite; z-index: -1; }
@keyframes hm-shadow { 0% { transform: scale(0.6); opacity: 0.9; } 100% { transform: scale(2.6); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .marker-pin.st-moving::after, .device-item[data-status="moving"] .hm-av::after, .hm-kpi[data-f="alerts"].has::after { animation: none; } }


@media (max-width: 760px) {
  #live-list-view.home-card { left: 8px; right: 8px; top: auto; bottom: 8px; width: auto; max-height: 46%; padding: 22px 14px 12px; border-radius: 24px; }
  .hm-greet h1 { font-size: 16px; }
  .hm-greet { margin-bottom: 12px; }
  .hm-kpis { margin-bottom: 12px; }
}


/* ======================================================================
   OBJECT ICONS: custom colour, driving-direction arrow, picker dialog
   ====================================================================== */
.marker-pin.has-color .pin-body { background: var(--pc); }
.marker-pin.has-color .pin-hole { color: var(--pc); }
.pin-st { display: none; position: absolute; right: 1px; top: 1px; width: 11px; height: 11px; border-radius: 50%; background: var(--s); border: 2px solid #fff; box-sizing: border-box; }
.marker-pin.has-color .pin-st { display: block; }
.marker-pin.has-color.st-moving .pin-st { animation: hm-dot 1.8s ease-out infinite; }
@keyframes hm-dot { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--s) 60%, transparent); } 100% { box-shadow: 0 0 0 7px transparent; } }
/* driving direction: an arrow on a ring around the pin head, turned to the course */
.pin-dir { position: absolute; left: -6px; top: -6px; width: 52px; height: 52px; pointer-events: none; transition: transform 0.6s ease; }
.pin-dir i { position: absolute; left: 50%; top: -3px; width: 0; height: 0; margin-left: -7px; border-left: 7px solid transparent; border-right: 7px solid transparent; border-bottom: 12px solid var(--pc, var(--s)); filter: drop-shadow(0 0 1.5px #fff) drop-shadow(0 0 1.5px #fff); }
.pin-dir.dim { opacity: 0.4; }
.oi-pin { position: absolute; left: 50%; top: 50%; margin: -30px 0 0 -20px; --s: var(--st-moving); }
@media (prefers-reduced-motion: reduce) { .marker-pin.has-color.st-moving .pin-st { animation: none; } .pin-dir { transition: none; } }

/* list avatar + Fleet round icon take the chosen colour */
.hm-av { color: var(--ic, var(--s)); background: color-mix(in srgb, var(--ic, var(--s)) 16%, var(--surface)); }
.fleet-locate { color: var(--ic, var(--brand)); background: color-mix(in srgb, var(--ic, var(--brand)) 14%, var(--surface)); }
.fleet-locate:hover { background: var(--ic, var(--brand)); color: #fff; }
.fleet-locate .icon { width: 20px; height: 20px; }

/* Home: select mode */
.hm-head-actions { display: flex; align-items: center; gap: 4px; }
.hm-select { font-size: 12px; font-weight: 700; color: var(--brand-ink); background: transparent; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--border); }
.hm-select:hover, .hm-select.on { background: var(--brand-soft); opacity: 1; }
.hm-sel { width: 18px; height: 18px; padding: 0; accent-color: var(--brand); flex-shrink: 0; margin: 0; }
.hm-bulk { display: flex; align-items: center; gap: 8px; margin: 6px 0 8px; padding: 8px 10px; border-radius: 16px; background: var(--brand-soft); font-size: 12.5px; font-weight: 700; }
.hm-bulk span { flex: 1; }
.hm-bulk .oi-ok { padding: 7px 12px; font-size: 12px; }

/* Objectprofiel: opens the dialog */
.oi-open { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; text-align: left; border-radius: 16px; background: var(--surface-alt); border: 1px solid var(--border); color: var(--text); }
.oi-open:hover { border-color: var(--brand); opacity: 1; }
.oi-open-ic { width: 40px; height: 40px; border-radius: 14px 14px 14px 5px; display: grid; place-items: center; background: color-mix(in srgb, currentColor 14%, var(--surface)); color: var(--brand); flex-shrink: 0; }
.oi-open strong { display: block; font-size: 13.5px; }
.oi-open small { display: block; font-size: 11.5px; color: var(--text-dim); font-weight: 500; }

/* picker dialog */
.oi-veil { position: fixed; inset: 0; z-index: 3000; background: rgba(30, 22, 12, 0.5); display: grid; place-items: center; padding: 16px; }
.oi-box { width: min(760px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: var(--surface); color: var(--text); border-radius: 26px; box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.5); padding: 22px 24px 18px; }
.oi-head { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.oi-head h2 { margin: 0; font-size: 19px; font-weight: 800; letter-spacing: -0.02em; }
.oi-head p { margin: 2px 0 0; color: var(--text-dim); font-size: 13px; }
.oi-x { width: 32px; height: 32px; border-radius: 50%; padding: 0; background: var(--surface-alt); color: var(--text-dim); font-size: 20px; line-height: 1; border: 1px solid var(--border); }
.oi-body { display: grid; grid-template-columns: 1.6fr 1fr; gap: 22px; }
.oi-box h3 { margin: 0 0 8px; font-size: 12px; font-weight: 800; color: var(--text-dim); letter-spacing: 0.02em; }
.oi-left h3:not(:first-child) { margin-top: 16px; }
.oi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.oi-ic { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px 8px; border-radius: 16px; background: var(--surface-alt); border: 2px solid transparent; color: var(--text); font-size: 11px; font-weight: 700; text-align: center; transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1), border-color 0.15s; }
.oi-ic .icon { width: 26px; height: 26px; }
.oi-ic:hover { transform: translateY(-2px); opacity: 1; border-color: color-mix(in srgb, var(--brand) 40%, transparent); }
.oi-ic.on { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-ink); }
.oi-swatches { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.oi-sw { width: 30px; height: 30px; padding: 0; border-radius: 50%; background: var(--c); border: 3px solid var(--surface); box-shadow: 0 0 0 1.5px var(--border); transition: transform 0.15s; }
.oi-sw:hover { transform: scale(1.12); opacity: 1; }
.oi-sw.on { box-shadow: 0 0 0 2.5px var(--text); }
.oi-sw-none { background: conic-gradient(var(--st-moving) 0 33%, var(--st-idle) 0 66%, var(--st-offline) 0); }
.oi-custom { appearance: none; -webkit-appearance: none; cursor: pointer; background: conic-gradient(#d6456b, #d49a1f, #5c8a3e, #3f6fb5, #8e5bb5, #d6456b); overflow: hidden; }
.oi-custom::-webkit-color-swatch-wrapper { padding: 0; opacity: 0; } .oi-custom::-moz-color-swatch { opacity: 0; border: 0; }
.oi-stage { position: relative; height: 150px; border-radius: 20px; overflow: hidden; background: color-mix(in srgb, var(--bg) 70%, var(--surface)); border: 1px solid var(--border); }
.oi-road { position: absolute; left: -10%; right: -10%; top: 50%; height: 34px; margin-top: -17px; background: color-mix(in srgb, var(--text-dim) 25%, var(--surface)); transform: rotate(-12deg); }
.oi-note { margin: 10px 2px 0; font-size: 12px; color: var(--text-dim); line-height: 1.5; }
.oi-foot { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.oi-status { flex: 1; font-size: 12.5px; color: var(--text-dim); }
.oi-ok { padding: 10px 18px; border-radius: 14px; background: var(--brand-grad); color: #fff; font-weight: 800; font-size: 13.5px; box-shadow: 0 8px 18px -8px var(--brand-glow); }
.oi-ok:disabled { opacity: 0.45; box-shadow: none; cursor: not-allowed; }
@media (max-width: 640px) { .oi-body { grid-template-columns: 1fr; } .oi-grid { grid-template-columns: repeat(3, 1fr); } .oi-right { order: -1; } }


/* ======================================================================
   HOME: Verkeersbulletin (news strip from live NDW data)
   ====================================================================== */
.bl {
  --bt: var(--petal-moss);
  position: absolute; z-index: 11; left: 20px; right: 92px; bottom: 20px;
  display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 14px;
  padding: 12px 16px 14px 12px; border-radius: 26px; overflow: hidden;
  background: color-mix(in srgb, var(--surface) 92%, transparent); border: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
  -webkit-backdrop-filter: blur(16px) saturate(1.2); backdrop-filter: blur(16px) saturate(1.2);
  box-shadow: var(--shadow-float);
}
.bl[data-tone="good"] { --bt: var(--st-moving); } .bl[data-tone="warn"] { --bt: var(--st-idle); }
.bl[data-tone="bad"] { --bt: var(--danger); } .bl[data-tone="idle"] { --bt: var(--st-offline); }
body[data-pillar]:not([data-pillar="home"]) .bl, body.map-fs .bl { display: none; }
.bl-badge { position: relative; width: 52px; height: 52px; flex-shrink: 0; display: grid; place-items: center; }
.bl-mark { position: relative; width: 38px; height: 38px; display: block; }
.bl-mark svg { width: 100%; height: 100%; animation: bl-spin 14s linear infinite; }
@keyframes bl-spin { to { transform: rotate(360deg); } }
.bl-wave { position: absolute; inset: 4px; border-radius: 50%; border: 2px solid var(--bt); opacity: 0; animation: bl-wave 2.8s ease-out infinite; }
.bl-wave.w2 { animation-delay: 1.4s; }
@keyframes bl-wave { 0% { transform: scale(0.7); opacity: 0.6; } 100% { transform: scale(1.35); opacity: 0; } }
.bl-main { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; min-width: 0; padding: 4px 6px; border-radius: 16px; background: transparent; color: var(--text); text-align: left; }
.bl-main:hover { background: color-mix(in srgb, var(--bt) 10%, transparent); opacity: 1; }
.bl-main:focus-visible { outline: 2px solid var(--bt); outline-offset: 2px; }
.bl-ic { width: 38px; height: 38px; border-radius: 13px 13px 13px 5px; display: grid; place-items: center; background: color-mix(in srgb, var(--bt) 16%, var(--surface)); color: var(--bt); flex-shrink: 0; }
.bl-ic svg { width: 21px; height: 21px; }
.bl-txt { display: flex; flex-direction: column; min-width: 0; gap: 2px; }
.bl-h { font-size: 15px; font-weight: 800; letter-spacing: -0.015em; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bl-s { font-size: 12.5px; color: var(--text-dim); line-height: 1.35; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bl-go { font-size: 12px; font-weight: 800; color: var(--bt); white-space: nowrap; padding: 6px 12px; border-radius: 999px; background: color-mix(in srgb, var(--bt) 12%, transparent); }
.bl-go::after { content: ' ›'; }
/* de knop "Maak zichtbaar op kaart" is nu de actie in de banner; een klik op de kop zoomt nog steeds naar de plek */
.bl-go { display: none; }
.bl-main.nogo .bl-go { display: none; }
.bl-main.in .bl-ic, .bl-main.in .bl-txt { animation: bl-in 0.45s cubic-bezier(0.22, 1, 0.36, 1); }
@keyframes bl-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.bl-show { font-size: 12px; font-weight: 800; white-space: nowrap; padding: 8px 14px; border-radius: 999px; background: var(--bt); color: #fff; border: 1px solid var(--bt); }
.bl-show:hover { opacity: 0.9; }
.bl-show.on { background: transparent; color: var(--bt); }
.bl-show:focus-visible { outline: 2px solid var(--bt); outline-offset: 2px; }
.bl-nav { display: flex; align-items: center; gap: 4px; }
.bl-nav button { width: 28px; height: 28px; border-radius: 50%; padding: 0; background: var(--surface-alt); color: var(--text-dim); font-size: 18px; line-height: 1; border: 1px solid var(--border); }
.bl-nav button:hover { color: var(--bt); opacity: 1; }
.bl-dots { display: flex; gap: 4px; padding: 0 4px; }
.bl-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--border); transition: all 0.25s; }
.bl-dots i.on { width: 16px; border-radius: 4px; background: var(--bt); }
.bl-src { position: absolute; right: 18px; top: 5px; font-size: 10px; font-weight: 700; color: var(--text-dim); opacity: 0.8; }
.bl-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: color-mix(in srgb, var(--border) 60%, transparent); }
.bl-bar i { display: block; height: 100%; width: 100%; transform-origin: left; background: linear-gradient(90deg, var(--petal-copper), var(--petal-gold), var(--petal-tan), var(--petal-leaf), var(--petal-moss)); animation: bl-bar linear forwards; }
@keyframes bl-bar { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.bl.hold .bl-bar i { animation-play-state: paused; }
body:not([data-pillar]) #live-list-view.home-card, body[data-pillar="home"] #live-list-view.home-card { max-height: calc(100% - 130px); }
@media (max-width: 900px) { .bl-go { display: none; } }
@media (max-width: 760px) {
  body:not([data-pillar]) #live-list-view.home-card, body[data-pillar="home"] #live-list-view.home-card { max-height: 46%; }
  .bl { left: 8px; right: 8px; top: 8px; bottom: auto; grid-template-columns: 1fr auto; gap: 8px; padding: 8px 10px 10px 8px; border-radius: 20px; }
  .bl-nav { display: none; }
  .bl-show { white-space: normal; max-width: 96px; padding: 6px 10px; font-size: 11px; line-height: 1.2; text-align: center; }
  .bl-badge { display: none; }
  .bl-src, .bl-nav .bl-prev, .bl-nav .bl-next { display: none; }
  .bl-h { font-size: 13.5px; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; } .bl-s { font-size: 11.5px; } .bl-ic { width: 32px; height: 32px; } .bl-go { display: none; }
}
@media (prefers-reduced-motion: reduce) { .bl-mark svg, .bl-wave, .bl-bar i, .bl-main.in .bl-ic, .bl-main.in .bl-txt { animation: none; } }


/* ======================================================================
   FLEET table without sideways scrolling: columns drop out by priority, actions stay pinned
   ====================================================================== */
.fleet-table-wrap.hide-seen .col-seen, .fleet-table-wrap.hide-maint .col-maint,
.fleet-table-wrap.hide-energy .col-energy, .fleet-table-wrap.hide-apk .col-apk,
.fleet-table-wrap.hide-odo .col-odo, .fleet-table-wrap.hide-driver .col-driver { display: none; }
.fleet-table-wrap.hide-sub .fleet-sub-line { display: none; }
.fleet-table td { padding: 12px 10px; }
.fleet-table th { padding: 14px 10px; }
.fleet-sub-line { max-width: 280px; }
.fleet-table th.col-rdw, .fleet-table td.col-rdw { position: sticky; right: 0; z-index: 2; width: 1%; padding-left: 14px; padding-right: 14px; box-shadow: -14px 0 14px -14px rgba(43, 33, 20, 0.25); }
.fleet-table td.col-rdw { background: var(--surface); }
.fleet-table th.col-rdw { background: var(--surface-alt); }
.fleet-table tbody tr:hover td.col-rdw, .fleet-table tbody tr:focus-visible td.col-rdw { background: var(--surface-alt); }
.fleet-rdw-btn.txt { width: auto; padding: 0 11px; font-size: 11.5px; font-weight: 800; letter-spacing: 0.04em; }
.rep-table th { white-space: normal; }
.fleet-table .col-maint .pill { display: inline-block; max-width: 150px; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; }


/* Login: Fleur logo with slogan (the donker version, the scene behind it is dark) */
.lg-brand.lg-brand-fleur { flex-direction: column; align-items: flex-start; gap: 0; top: 22px; }
.lg-fleur { display: block; height: 74px; width: auto; aspect-ratio: 435 / 168; filter: drop-shadow(0 2px 12px rgba(0, 0, 0, 0.45)); }
.lg-slogan { margin: -8px 0 0 calc(74px * 435 / 168 * 0.44); font-size: 15px; font-weight: 600; letter-spacing: 0.005em; color: rgba(243, 239, 232, 0.8); text-shadow: 0 1px 10px rgba(0, 0, 0, 0.55); }
@media (max-width: 640px) { .lg-fleur { height: 56px; } .lg-slogan { margin-left: calc(56px * 435 / 168 * 0.44); font-size: 13px; } }


/* Login: the Fleur film as background (login-bg.js). Scaled up a touch from the bottom right so the film's own corner logo
   falls outside the screen (the login has its own Fleur logo); the veil keeps the logo, card and Meldingen readable. */
#login-video { position: fixed; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 1.2s ease; pointer-events: none; transform: scale(1.14); transform-origin: right bottom; }
#login-video.ready { opacity: 1; }
#login-screen.has-video .lg-veil { background: linear-gradient(90deg, rgba(18, 21, 34, 0.68) 0%, rgba(18, 21, 34, 0.42) 38%, rgba(18, 21, 34, 0.18) 100%); }
#login-screen.has-video .lg-card, #login-screen.has-video .lg-news { background: rgba(18, 21, 34, 0.8); border-color: rgba(255, 255, 255, 0.2); }
#login-screen.has-video .lg-news-empty { color: rgba(255, 255, 255, 0.78); }
#login-screen.has-video .lg-news-date { color: rgba(255, 255, 255, 0.6); }
#login-screen.has-video .lg-sub { color: rgba(255, 255, 255, 0.82); }
@media (max-width: 760px) { #login-screen.has-video .lg-veil { background: linear-gradient(180deg, rgba(18, 21, 34, 0.6) 0%, rgba(18, 21, 34, 0.5) 60%, rgba(18, 21, 34, 0.6) 100%); } }
@media (prefers-reduced-motion: reduce) { #login-video { display: none; } }

/* ======================================================================
   VIDEO: Live monitoring, Records, Coaching, Instellingen & regels
   (uses the Safety tokens: --sf-*, --g*)
   ====================================================================== */
.vid-inner { max-width: 1320px; }
.vid-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.vid-head h1 { margin: 0; }
.vid-sub, .vid-note { margin: 4px 0 0; color: var(--sf-dim); font-size: 13px; line-height: 1.5; }
.vid-demo { padding: 6px 12px; border-radius: 999px; background: #fff4e5; color: #8a4b00; font-size: 12px; font-weight: 700; }
:root[data-theme="dark"] .vid-demo { background: #3a2a10; color: #f5c27a; }
.vid-card { background: var(--sf-card); border: 1px solid var(--sf-line); border-radius: 22px; padding: 18px 20px; box-shadow: 0 14px 34px -24px rgba(4, 89, 44, 0.28); }
.vid-card h2 { margin: 0 0 4px; font-size: 18px; font-weight: 800; letter-spacing: -0.01em; }
.vid-card h3 { margin: 0 0 10px; font-size: 15px; font-weight: 700; }
.vid-empty { color: var(--sf-dim); font-size: 13px; margin: 6px 0; }
.vid-ic { width: 18px; height: 18px; vertical-align: -3px; flex-shrink: 0; }
.vid-bar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.vid-page select, .vid-page input[type="search"], .vid-page input[type="number"], .vid-page input[type="date"], .vid-page textarea,
.vid-mbox textarea { font-family: inherit; font-size: 13px; padding: 9px 12px; border-radius: 12px; border: 1px solid var(--sf-line); background: var(--sf-card); color: var(--sf-ink); }
.vid-page textarea, .vid-mbox textarea { width: 100%; resize: vertical; box-sizing: border-box; }
.vid-page select:focus, .vid-page input:focus, .vid-page textarea:focus, .vid-page button:focus-visible, .vid-mbox button:focus-visible { outline: 2px solid var(--g500); outline-offset: 1px; }
.vid-seg { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 14px; background: var(--sf-card); border: 1px solid var(--sf-line); }
.vid-segb { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border: 0; border-radius: 10px; background: transparent; color: var(--sf-dim); font-family: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.vid-segb i { font-style: normal; font-size: 10px; font-weight: 800; padding: 2px 6px; border-radius: 999px; background: var(--g100); color: var(--g800); }
.vid-segb:hover { color: var(--sf-ink); }
.vid-segb.on { background: var(--g600); color: #fff; }
.vid-segb.on i { background: rgba(255, 255, 255, 0.25); color: #fff; }
.vid-btn { padding: 9px 16px; border-radius: 12px; border: 1px solid var(--g600); background: var(--g600); color: #fff; font-family: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.vid-btn:hover { background: var(--g700); opacity: 1; }
.vid-btn.ghost { background: transparent; color: var(--sf-ink); border-color: var(--sf-line); }
.vid-btn.ghost:hover { background: var(--g50); }
:root[data-theme="dark"] .vid-btn.ghost:hover { background: var(--sf-line); }

.vid-live { display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 16px; align-items: start; }
.vid-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.vid-gaugecard { text-align: center; }
.vid-gauge { width: 100%; max-width: 240px; }
.vid-speed { margin-top: -6px; font-size: 14px; color: var(--sf-dim); }
.vid-speed b { font-size: 40px; font-weight: 800; color: var(--sf-ink); letter-spacing: -0.03em; }
.vid-driver { text-align: center; }
.vid-driver h3 { margin: 10px 0 0; font-size: 18px; }
.vid-driver p { margin: 2px 0 12px; color: var(--sf-dim); font-size: 13px; }
.vid-av { width: 64px; height: 64px; border-radius: 50%; margin: 0 auto; display: grid; place-items: center; background: linear-gradient(145deg, var(--g500), var(--g800)); color: #fff; font-size: 22px; font-weight: 800; }
.vid-av.sm { width: 38px; height: 38px; font-size: 13px; margin: 0; flex-shrink: 0; }
.vid-dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; text-align: left; font-size: 12.5px; padding-top: 12px; border-top: 1px solid var(--sf-line); }
.vid-dl span { color: var(--sf-dim); }
.vid-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.vid-chip { display: inline-flex; align-items: center; gap: 7px; padding: 8px 12px; border-radius: 12px; background: var(--sf-bg); color: var(--sf-dim); font-size: 12.5px; font-weight: 700; border: 1px solid var(--sf-line); transition: background 0.2s, color 0.2s; }
.vid-chip.hot { background: var(--sf-red); color: #fff; border-color: var(--sf-red); animation: vidPulse 0.9s ease-in-out infinite alternate; }
@keyframes vidPulse { to { box-shadow: 0 0 0 5px rgba(229, 72, 77, 0.25); } }
@media (prefers-reduced-motion: reduce) { .vid-chip.hot, .vid-live-badge i { animation: none; } }
.vid-stage { position: relative; border-radius: 18px; overflow: hidden; background: #0e1114; aspect-ratio: 16 / 9; }
.vid-stage canvas, .vid-stage video { width: 100%; height: 100%; display: block; object-fit: cover; }
.vid-stage .hidden { display: none; }
.vid-play { position: absolute; inset: 0; margin: auto; width: 180px; height: 64px; border-radius: 999px; border: 0; background: rgba(20, 163, 87, 0.95); color: #fff; font-family: inherit; font-size: 15px; font-weight: 800; display: flex; align-items: center; justify-content: center; gap: 10px; cursor: pointer; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4); }
.vid-play:hover { background: var(--g700); opacity: 1; }
.vid-play.hidden { display: none; }
.vid-live-badge { position: absolute; top: 12px; left: 12px; padding: 5px 11px; border-radius: 999px; background: rgba(0, 0, 0, 0.6); color: #fff; font-size: 12px; font-weight: 800; display: flex; align-items: center; gap: 7px; }
.vid-live-badge.hidden { display: none; }
.vid-live-badge i { width: 9px; height: 9px; border-radius: 50%; background: var(--sf-red); animation: vidBlink 1.1s infinite; }
@keyframes vidBlink { 50% { opacity: 0.25; } }
.vid-priv { position: absolute; left: 12px; right: 12px; bottom: 34px; padding: 7px 12px; border-radius: 10px; background: rgba(0, 0, 0, 0.6); color: #fff; font-size: 12px; text-align: center; }
.vid-priv.hidden { display: none; }
.vid-ctl { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.vid-ctl input[type="range"] { flex: 1 1 160px; accent-color: var(--g600); }
.vid-two { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 16px; }
.vid-map { height: 230px; border-radius: 14px; overflow: hidden; background: var(--sf-bg); color: var(--sf-dim); font-size: 13px; }
.vid-kp { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.vid-kp b { display: block; font-size: 26px; font-weight: 800; letter-spacing: -0.02em; }
.vid-kp .bad b { color: var(--sf-red); }
.vid-kp span { font-size: 11.5px; color: var(--sf-dim); }
.vid-bar2 { height: 8px; border-radius: 99px; background: var(--sf-line); overflow: hidden; }
.vid-bar2 i { display: block; height: 100%; background: var(--g500); border-radius: 99px; }
.vid-feed { display: flex; flex-direction: column; gap: 4px; }
.vid-ev { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 14px; border: 0; background: transparent; color: var(--sf-ink); font-family: inherit; text-align: left; cursor: pointer; }
.vid-ev:hover { background: var(--sf-bg); opacity: 1; }
.vid-evi { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; flex-shrink: 0; }
.sev1 { background: var(--g100); color: var(--g800); }
.sev2 { background: #fdebd0; color: #9a5600; }
.sev3 { background: #fde1e2; color: #b4232a; }
:root[data-theme="dark"] .sev2 { background: #3a2a10; color: #f5c27a; }
:root[data-theme="dark"] .sev3 { background: #3d1719; color: #ff9a9d; }
.vid-evt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.vid-evt small, .vid-evw { color: var(--sf-dim); font-size: 12px; }

.vid-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.vid-kpi { background: var(--sf-card); border: 1px solid var(--sf-line); border-radius: 18px; padding: 14px 18px; }
.vid-kpi b { display: block; font-size: 28px; font-weight: 800; letter-spacing: -0.02em; }
.vid-kpi span { font-size: 12px; color: var(--sf-dim); }
.vid-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.vid-rec { position: relative; display: flex; flex-direction: column; text-align: left; padding: 0; border: 1px solid var(--sf-line); border-radius: 18px; overflow: hidden; background: var(--sf-card); color: var(--sf-ink); font-family: inherit; cursor: pointer; }
.vid-rec:hover { border-color: var(--g500); box-shadow: 0 12px 28px -18px rgba(4, 89, 44, 0.5); opacity: 1; }
.vid-thumb { position: relative; display: block; aspect-ratio: 16 / 9; background: #0e1114; }
.vid-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.vid-sevdot { position: absolute; top: 10px; left: 10px; width: 12px; height: 12px; border-radius: 50%; border: 2px solid #fff; }
.vid-sevdot.sev1 { background: var(--sf-green); } .vid-sevdot.sev2 { background: var(--sf-orange); } .vid-sevdot.sev3 { background: var(--sf-red); }
.vid-dur { position: absolute; right: 8px; bottom: 8px; padding: 2px 7px; border-radius: 6px; background: rgba(0, 0, 0, 0.65); color: #fff; font-size: 11px; font-weight: 700; }
.vid-recb { display: flex; flex-direction: column; gap: 2px; padding: 11px 14px 4px; }
.vid-recb b { font-size: 14px; display: flex; align-items: center; gap: 6px; }
.vid-recb small { color: var(--sf-dim); font-size: 12px; }
.vid-st { align-self: flex-start; margin: 4px 14px 12px; padding: 3px 9px; border-radius: 999px; background: #fdebd0; color: #9a5600; font-size: 11px; font-weight: 800; }
.vid-st.ok { background: var(--g100); color: var(--g800); }
.vid-st.fp { background: var(--sf-line); color: var(--sf-dim); }
:root[data-theme="dark"] .vid-st { background: #3a2a10; color: #f5c27a; }
:root[data-theme="dark"] .vid-st.ok { background: #0f3a24; color: var(--g300); }

.vid-modal { position: fixed; inset: 0; z-index: 2000; background: rgba(5, 12, 9, 0.72); display: grid; place-items: center; padding: 16px; overflow-y: auto; }
.vid-mbox { width: min(1080px, 100%); border-radius: 24px; padding: 20px 22px; font-family: 'Plus Jakarta Sans', var(--font); --g50: #ebfff4; --g100: #cbfee3; --g500: #27c472; --g600: #14a357; --g700: #0a8242; --g800: #04592c; --sf-card: #fff; --sf-ink: #14201a; --sf-dim: #6a7871; --sf-line: #e4ebe6; --sf-bg: #f3f6f4; --sf-red: #e5484d; background: var(--sf-card); color: var(--sf-ink); }
:root[data-theme="dark"] .vid-mbox { --sf-card: #11251b; --sf-ink: #ecf6f0; --sf-dim: #8fa89b; --sf-line: #1d3a2b; --sf-bg: #0b1812; }
.vid-mh { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.vid-mh h2 { margin: 0; font-size: 20px; display: flex; align-items: center; gap: 8px; }
.vid-mh p { margin: 2px 0 0; color: var(--sf-dim); font-size: 13px; }
.vid-x { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--sf-line); background: transparent; color: var(--sf-ink); font-size: 22px; line-height: 1; cursor: pointer; }
.vid-mgrid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(240px, 1fr); gap: 18px; }
.vid-mt { position: absolute; right: 10px; bottom: 34px; padding: 3px 9px; border-radius: 8px; background: rgba(0, 0, 0, 0.6); color: #fff; font-size: 12px; font-weight: 700; }
.vid-md dl { display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; margin: 0 0 12px; font-size: 13px; }
.vid-md dt { color: var(--sf-dim); } .vid-md dd { margin: 0; font-weight: 600; }
.vid-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.vid-sev { padding: 2px 9px; border-radius: 999px; font-size: 11px; font-weight: 800; }
.vid-sev.low { background: var(--g100); color: var(--g800); } .vid-sev.mid { background: #fdebd0; color: #9a5600; } .vid-sev.high { background: #fde1e2; color: #b4232a; }
.vid-mbox .vid-note { color: var(--sf-dim); font-size: 12px; }

.vid-coach { display: grid; grid-template-columns: 330px minmax(0, 1fr); gap: 16px; align-items: start; }
.vid-drv { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px; margin-top: 6px; border: 1px solid transparent; border-radius: 16px; background: transparent; color: var(--sf-ink); font-family: inherit; text-align: left; cursor: pointer; }
.vid-drv:hover { background: var(--sf-bg); opacity: 1; }
.vid-drv.on { background: var(--g50); border-color: var(--g500); }
:root[data-theme="dark"] .vid-drv.on { background: #0f3a24; }
.vid-drvt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.vid-drvt small { color: var(--sf-dim); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vid-score { font-size: 22px; font-weight: 800; display: flex; flex-direction: column; align-items: flex-end; line-height: 1; }
.vid-score small { font-size: 11px; font-weight: 700; margin-top: 3px; }
.vid-score.good { color: var(--g600); } .vid-score.mid { color: var(--sf-orange); } .vid-score.bad { color: var(--sf-red); }
.vid-score .up { color: var(--g600); } .vid-score .down { color: var(--sf-red); }
.vid-ch { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.vid-ch > div:nth-child(2) { flex: 1; min-width: 200px; }
.vid-ch h2 { margin: 0; }
.vid-spk { text-align: right; } .vid-spk small { display: block; font-size: 11px; color: var(--sf-dim); }
.vid-spark { width: 160px; height: 44px; }
.vid-bars { display: flex; flex-direction: column; gap: 8px; }
.vid-barr { display: grid; grid-template-columns: 190px 1fr 30px; align-items: center; gap: 10px; font-size: 13px; }
.vid-barr > div { height: 10px; border-radius: 99px; background: var(--sf-line); overflow: hidden; }
.vid-barr i { display: block; height: 100%; background: var(--g500); border-radius: 99px; }
.vid-barr b { text-align: right; }
.vid-tip { margin: 14px 0 0; padding: 12px 14px; border-radius: 14px; background: var(--g50); color: var(--g800); font-size: 13px; font-weight: 600; }
:root[data-theme="dark"] .vid-tip { background: #0f3a24; color: var(--g300); }
.vid-clips { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.vid-clip { display: flex; flex-direction: column; gap: 6px; padding: 0; border: 1px solid var(--sf-line); border-radius: 14px; overflow: hidden; background: var(--sf-card); color: var(--sf-ink); font-family: inherit; font-size: 12.5px; font-weight: 700; text-align: left; cursor: pointer; }
.vid-clip.on { border-color: var(--g500); }
.vid-clip img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; }
.vid-clip span { padding: 0 10px 8px; } .vid-clip small { display: block; color: var(--sf-dim); font-weight: 500; }
.vid-cform { display: grid; grid-template-columns: 1fr 1fr auto; gap: 10px; align-items: end; margin: 10px 0 12px; }
.vid-cform label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--sf-dim); }
.vid-cform .wide { grid-column: 1 / 3; }
.vid-sesr { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--sf-line); }
.vid-sesr > div { flex: 1; display: flex; flex-direction: column; font-size: 13px; }
.vid-sesr small { color: var(--sf-dim); }
.vid-sesr .vid-st { margin: 0; }

.vid-sec { margin-bottom: 16px; }
.vid-tw { overflow-x: auto; margin-top: 10px; }
.vid-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.vid-table th { text-align: left; padding: 8px 10px; color: var(--sf-dim); font-size: 12px; font-weight: 700; border-bottom: 1px solid var(--sf-line); }
.vid-table td { padding: 8px 10px; border-bottom: 1px solid var(--sf-line); vertical-align: middle; }
.vid-table td small { color: var(--sf-dim); margin-left: 6px; }
.vid-warn { margin-top: 12px; padding: 12px 14px; border-radius: 14px; background: #fff4e5; color: #8a4b00; font-size: 12.5px; line-height: 1.6; }
:root[data-theme="dark"] .vid-warn { background: #3a2a10; color: #f5c27a; }
.vid-form3 { display: flex; flex-wrap: wrap; gap: 16px; margin: 14px 0 6px; }
.vid-form3 label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--sf-dim); }
.vid-chk { display: flex !important; flex-direction: row !important; align-items: center; gap: 8px; margin: 8px 0; font-size: 13px !important; color: var(--sf-ink) !important; }
.vid-chk input { accent-color: var(--g600); }
.vid-h3 { margin-top: 18px !important; }
.vid-log { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--sf-dim); }
.vid-checks { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.vid-chkr { display: flex; gap: 10px; font-size: 13px; padding: 9px 12px; border-radius: 12px; background: var(--sf-bg); }
.vid-chkr i { font-style: normal; font-weight: 800; color: var(--sf-orange); }
.vid-chkr.ok i { color: var(--g600); }
.vid-form3 .vid-ch { display: flex; gap: 10px; margin: 0; }
.vid-form3 .vid-ch input { width: 72px; }
.vid-chn { gap: 2px; }

@media (max-width: 1000px) {
  .vid-live, .vid-coach, .vid-mgrid, .vid-two { grid-template-columns: 1fr; }
  .vid-kpis { grid-template-columns: repeat(2, 1fr); }
  .vid-barr { grid-template-columns: 130px 1fr 28px; }
  .vid-cform { grid-template-columns: 1fr; } .vid-cform .wide { grid-column: auto; }
}
.vid-page .vid-bar select, .vid-page .vid-ctl select, .vid-page .vid-bar input[type="search"], .vid-page .vid-table select { width: auto; max-width: 100%; }
.vid-page .vid-bar input[type="search"] { min-width: 160px; }
.vid-page .vid-cform input, .vid-page .vid-cform select { width: 100%; box-sizing: border-box; }

.vid-stage .vid-demofilm { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; }

.obd-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 18px; }
.obd-grid .ble-tile { min-width: 0; }
.obd-grid .ble-tile-value { overflow-wrap: anywhere; }
.ble-tile.obd-warn .ble-tile-value { color: var(--status-warn-ink); }

.fleet-energy-stack { display: flex; flex-direction: column; gap: 3px; }
.fleet-energy-line { display: flex; align-items: center; font-size: 12px; white-space: nowrap; }
.fleet-energy-line b { width: 62px; font-weight: 600; color: var(--text-dim); }

/* Driver app instellen: banner bovenaan de Driver-pagina */
.drv-appbanner { padding: 0 0 4px; }
.dab { display: flex; align-items: center; gap: 16px; margin: 0 0 14px; padding: 16px 20px; border-radius: 22px; background: linear-gradient(135deg, var(--brand-soft), var(--card)); border: 1px solid var(--border); box-shadow: 0 10px 26px -20px rgba(0, 0, 0, 0.35); }
.dab-ico { flex: 0 0 auto; width: 48px; height: 48px; border-radius: 16px; display: grid; place-items: center; background: var(--brand); color: var(--brand-on); }
.dab-txt { flex: 1 1 auto; min-width: 0; }
.dab-txt h2 { margin: 0; font-size: 16px; font-weight: 800; }
.dab-txt p { margin: 2px 0 0; font-size: 13.5px; color: var(--text-dim); }
.dab-txt small { display: block; margin-top: 4px; font-size: 12.5px; color: var(--brand-ink); font-weight: 600; }
.dab-btn { flex: 0 0 auto; }
.dab-steps { margin: 10px 0 4px; padding-left: 20px; font-size: 14px; line-height: 1.6; }
.dab-steps code { background: var(--brand-soft); padding: 2px 7px; border-radius: 8px; word-break: break-all; }
.dab-row { display: flex; gap: 8px; margin: 8px 0 4px; flex-wrap: wrap; }
.dab-h3 { margin: 16px 0 4px; font-size: 14.5px; }
.dab-rules { margin: 0 0 8px; padding-left: 20px; font-size: 13.5px; line-height: 1.55; }
.dab-warn { margin: 10px 0 0; padding: 10px 12px; border-radius: 12px; background: var(--status-warn-soft); color: var(--status-warn-ink); font-size: 13px; line-height: 1.5; }
@media (max-width: 640px) { .dab { flex-wrap: wrap; } .dab-btn { width: 100%; } }

.sf-details { margin-top: 12px; border-top: 1px solid var(--sf-line); padding-top: 10px; }
.sf-details > summary { cursor: pointer; font-size: 13px; font-weight: 700; color: var(--sf-ink); }
.sf-details p { margin: 8px 0 0; line-height: 1.5; }
.sf-na > .sf-chip { margin-top: -2px; }

/* rijscore met kleurverloop van 1 (dieprood) naar 10 (diepgroen) */
.sf-score { margin-top: 12px; }
.sf-score-num { font-size: 52px; font-weight: 800; letter-spacing: -0.03em; line-height: 1; }
.sf-score-num small { font-size: 18px; font-weight: 700; color: var(--sf-dim); letter-spacing: 0; }
.sf-score-chip { display: inline-block; margin-top: 10px; padding: 4px 14px; border-radius: 999px; font-size: 13px; font-weight: 800; }
.sf-scale { position: relative; height: 12px; border-radius: 999px; margin: 18px 6px 6px; }
.sf-scale i { position: absolute; top: 50%; width: 22px; height: 22px; margin: -11px 0 0 -11px; border-radius: 50%; background: #fff; border: 4px solid; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25); }
.sf-scale-l { display: flex; justify-content: space-between; font-size: 12px; color: var(--sf-dim); margin: 0 2px 10px; }

.vid-demotoggle { margin-left: auto; }

/* ---------- Fleet: miniatuurkaarten van een voertuig (fleetmap.js) ---------- */
.fm-overlay { position: fixed; inset: 0; z-index: 3000; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(22, 23, 26, 0.5); backdrop-filter: blur(2px); }
.fm-box { width: min(1080px, 100%); max-height: 100%; overflow-y: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-float); padding: 20px; }
.fm-head { display: flex; align-items: center; gap: 12px; }
.fm-title { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; flex: 1; min-width: 0; font-size: 17px; }
.fm-plate { font-size: 12px; font-weight: 800; letter-spacing: 0.04em; padding: 2px 8px; border-radius: 6px; background: var(--surface-alt); border: 1px solid var(--border); }
.fm-close { width: 34px; height: 34px; padding: 0 0 2px; display: inline-flex; align-items: center; justify-content: center; flex: none; border-radius: 50%; border: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: 22px; line-height: 1; cursor: pointer; }
.fm-close:hover { color: var(--brand); border-color: var(--brand); }
.fm-where { margin: 6px 0 14px; font-size: 13px; color: var(--text-dim); }
.fm-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.fm-cell { position: relative; padding: 0; border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; background: var(--surface-alt); cursor: pointer; display: block; }
.fm-cell:hover, .fm-cell:focus-visible { border-color: var(--brand); }
.fm-map { height: 300px; width: 100%; background: var(--surface-alt); pointer-events: none; }
:root[data-theme="dark"] .fm-map .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(0.92) contrast(0.9) saturate(0.8); }
.fm-cap { position: absolute; left: 10px; top: 10px; z-index: 500; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.fm-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; }
.fm-attr { font-size: 11px; color: var(--text-dim); }
@media (max-width: 860px) {
  .fm-grid { grid-template-columns: 1fr; }
  .fm-map { height: 190px; }
}

.fleet-map-hint { margin-top: 2px; font-size: 11px; font-weight: 600; color: var(--brand); opacity: 0.85; }

.obd-hint { margin: 0 0 10px; padding: 8px 12px; border-radius: 12px; font-size: 12px; line-height: 1.4; color: var(--text); background: color-mix(in srgb, var(--st-idle) 16%, var(--surface)); border: 1px solid color-mix(in srgb, var(--st-idle) 40%, transparent); }

/* ======================================================================
   MENU: iconenbalk die bij hover uitklapt (desktop, > 760px)
   Ingeklapt neemt de balk 72px in, uitgeklapt schuift hij als laag over de
   inhoud heen (geen herindeling van kaart of dashboards). Kleuren, labels,
   badges en volgorde zijn die van de bestaande balk. Telefoon houdt de lade.
   ====================================================================== */

.rl-wide, .rl-mark { display: block; width: 100%; height: 100%; }
.rl-mark { display: none; }

@media (min-width: 761px) {
  #rail {
    --rail-w: 72px; --rail-w-open: 200px;
    position: relative; z-index: 990; overflow: hidden;
    width: var(--rail-w);
    transition: width 0.22s ease, margin-right 0.22s ease, box-shadow 0.22s ease;
  }
  #rail:hover, #rail:has(:focus-visible) {
    width: var(--rail-w-open);
    margin-right: calc(var(--rail-w) - var(--rail-w-open));
    box-shadow: 18px 0 40px -16px rgba(20, 16, 12, 0.35);
  }

  /* logo: merkteken ingeklapt, woordmerk uitgeklapt */
  .rail-logo { position: relative; }
  .rl-wide, .rl-mark { position: absolute; inset: 0; transition: opacity 0.18s ease; }
  .rl-mark { display: flex; align-items: center; justify-content: center; opacity: 1; }
  .rl-mark svg { width: 38px; height: 38px; }
  .rl-wide { opacity: 0; }
  #rail:hover .rl-wide, #rail:has(:focus-visible) .rl-wide { opacity: 1; }
  #rail:hover .rl-mark, #rail:has(:focus-visible) .rl-mark { opacity: 0; }

  /* knoppen: het icoon blijft staan, het label schuift mee uit */
  #rail .nav-pill { position: relative; overflow: hidden; padding: 11px 12px; gap: 12px; }
  #rail .nav-pill span:not(.nav-badge) { opacity: 0; transition: opacity 0.12s ease; }
  #rail:hover .nav-pill span:not(.nav-badge), #rail:has(:focus-visible) .nav-pill span:not(.nav-badge) { opacity: 1; transition-delay: 0.08s; }

  /* meldingsbolletje (Chat) wordt ingeklapt een stip op het icoon */
  #rail:not(:hover):not(:has(:focus-visible)) .nav-pill .nav-badge {
    position: absolute; top: 3px; right: 3px; margin: 0;
    min-width: 16px; height: 16px; padding: 0 4px; font-size: 10px; line-height: 16px;
  }

  /* versielabel past niet in de smalle balk */
  #rail:not(:hover):not(:has(:focus-visible)) .build-label { display: none; }
}

@media (min-width: 761px) and (prefers-reduced-motion: reduce) {
  #rail, .rl-wide, .rl-mark, #rail .nav-pill span { transition: none !important; }
}

/* ---------- Tracker-gezondheid (geen GPS-fix, geen contact, accu laag) ---------- */
.fleet-gps-warn { margin-top: 2px; font-size: 11.5px; font-weight: 600; color: var(--status-warn-ink, #8a5a00); white-space: nowrap; }
.notif-item.notif-health { cursor: pointer; }
.notif-item.notif-health .notif-time { white-space: normal; line-height: 1.35; }
.detail-status-row { flex-wrap: wrap; gap: 6px 10px; padding-right: 34px; }
.detail-last-update { line-height: 1.35; min-width: 0; }

/* ---------- Meldingen per e-mail (profielmenu) ---------- */
#alerts-modal .modal-content { max-width: 520px; }
.al-status.warn { color: var(--status-warn-ink, #8a5a00); font-weight: 600; }
.al-status.ok { color: var(--status-good-ink, #2f6b3a); font-weight: 600; }
.al-row { display: flex; align-items: flex-start; gap: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface-alt); cursor: pointer; margin-bottom: 8px; }
.al-row input[type="checkbox"] { width: 18px; height: 18px; padding: 0; margin-top: 2px; flex-shrink: 0; accent-color: var(--brand); }
.al-text { display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
.al-sub { font-size: 12.5px; color: var(--text-dim); font-weight: 400; line-height: 1.35; }
.al-master { background: var(--surface); }
.al-list { margin-top: 4px; transition: opacity 0.15s; }
.al-list.al-off { opacity: 0.45; }
.al-note { margin-top: 10px; }

/* ---------- Werktijden (hos-ui.js) ---------- */
.hos-modal .modal-content { width: min(1020px, calc(100vw - 24px)); max-height: calc(100vh - 28px); overflow-y: auto; gap: 0; padding: 22px 26px; }
.hos-modal .modal-content > * { flex-shrink: 0; }
.hos-head { display: flex; align-items: flex-start; gap: 14px; }
.hos-head h2 { margin: 0 0 4px; font-size: 19px; }
.hos-head .hint { margin: 0; max-width: 720px; }
.hos-x { margin-left: auto; width: 34px; height: 34px; padding: 0; border-radius: 50%; background: var(--surface-alt); color: var(--text); font-size: 20px; line-height: 1; border: 1px solid var(--border); flex-shrink: 0; }
.hos-tabs { display: flex; gap: 6px; margin: 16px 0 14px; padding: 4px; width: fit-content; background: var(--surface-alt); border: 1px solid var(--border); border-radius: 999px; }
.hos-tab { padding: 7px 18px; border-radius: 999px; background: transparent; color: var(--text-dim); font-size: 13.5px; font-weight: 700; }
.hos-tab.active { background: var(--brand); color: var(--brand-on); }
.hos-grid { display: grid; grid-template-columns: minmax(250px, 0.85fr) 1.4fr; gap: 20px; align-items: start; }
.hos-col { min-width: 0; }
.hos-h { margin: 0 0 8px; font-size: 13px; font-weight: 800; letter-spacing: .02em; }
.hos-h2 { margin-top: 18px; }
.hos-chips, .hos-presets { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.hos-chip { padding: 6px 13px; border-radius: 999px; background: var(--surface-alt); color: var(--text); border: 1px solid var(--border); font-size: 12.5px; font-weight: 700; }
.hos-chip.on { background: var(--brand); color: var(--brand-on); border-color: var(--brand); }
.hos-chip:disabled { opacity: .45; cursor: not-allowed; }
.hos-q { padding: 8px 11px; font-size: 13.5px; margin-top: 4px; }
.hos-bar { display: flex; align-items: center; gap: 12px; margin: 6px 0; font-size: 12.5px; }
.hos-bar .hint { margin: 0 auto 0 0; }
.hos-link { background: transparent; color: var(--brand-ink); padding: 2px 0; font-size: 12.5px; font-weight: 700; text-decoration: underline; }
.hos-list { max-height: 210px; overflow-y: auto; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface-alt); padding: 4px; }
.hos-opt { display: flex; align-items: center; gap: 9px; padding: 6px 8px; border-radius: 8px; font-size: 13.5px; cursor: pointer; }
.hos-opt:hover { background: var(--surface); }
.hos-opt input[type="checkbox"], .hos-radio input[type="radio"], .hos-day input[type="checkbox"] { width: 17px; height: 17px; padding: 0; flex-shrink: 0; accent-color: var(--brand); }
.hos-sub { color: var(--text-dim); font-size: 11.5px; margin-left: auto; text-align: right; }
.hos-none { padding: 10px; margin: 0; }
.hos-ex { display: flex; flex-direction: column; gap: 6px; }
.hos-exrow { display: flex; align-items: stretch; gap: 4px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface-alt); }
.hos-extext { flex: 1; min-width: 0; padding: 8px 11px; background: transparent; color: var(--text); text-align: left; display: flex; flex-direction: column; gap: 1px; font-weight: 400; }
.hos-extext strong { font-size: 13px; }
.hos-extext span { font-size: 12px; color: var(--text-dim); }
.hos-del { width: 28px; padding: 0; background: transparent; color: var(--text-dim); font-size: 16px; border-radius: 8px; }
.hos-del:hover { background: var(--danger-soft); color: var(--danger); opacity: 1; }
.hos-del:disabled { opacity: .3; }
.hos-days { display: flex; flex-direction: column; gap: 4px; }
.hos-day { display: grid; grid-template-columns: 17px 96px 1fr; align-items: center; gap: 10px; padding: 5px 10px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface-alt); }
.hos-dname { font-size: 13.5px; font-weight: 700; cursor: pointer; }
.hos-wins { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-height: 32px; }
.hos-no { font-size: 12.5px; color: var(--text-dim); }
.hos-pair { display: inline-flex; align-items: center; gap: 6px; }
.hos-pair input { width: 98px; padding: 5px 8px; font-size: 13.5px; }
.hos-tol { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 12px; }
.hos-num { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.hos-num input { width: 70px; padding: 6px 9px; }
.hos-unit { color: var(--text-dim); font-size: 12.5px; }
.hos-notify { display: flex; flex-direction: column; gap: 6px; }
.hos-radio { display: flex; align-items: flex-start; gap: 10px; padding: 8px 11px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface-alt); cursor: pointer; }
.hos-radio span { display: flex; flex-direction: column; gap: 1px; font-size: 13.5px; }
.hos-radio small { color: var(--text-dim); font-size: 12px; }
.hos-channels { display: flex; flex-direction: column; margin-top: 2px; }
.hos-foot { display: flex; align-items: center; gap: 10px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border); }
.hos-sum { margin-right: auto; font-size: 12.5px; color: var(--text-dim); line-height: 1.4; }
.hos-status.ok { color: var(--status-good-ink); font-weight: 700; font-size: 13px; }
.hos-status.bad { color: var(--danger); font-weight: 700; font-size: 13px; }
.hos-warn { margin: 0 0 12px; padding: 9px 12px; border-radius: var(--radius-md); background: var(--status-warn-soft); color: var(--status-warn-ink); font-size: 13px; font-weight: 600; }
.hos-repbar { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; }
.hos-repbar select { width: auto; padding: 8px 12px; }
.hos-live { display: flex; flex-direction: column; gap: 3px; padding: 11px 14px; border-radius: var(--radius-md); background: var(--surface-alt); border: 1px solid var(--border); font-size: 13.5px; }
.hos-live.on { background: var(--danger-soft); border-color: var(--danger); }
.hos-live span { font-size: 12.5px; color: var(--text-dim); }
.hos-total { margin: 14px 0 8px; font-weight: 700; font-size: 14px; }
.hos-tablewrap { overflow-x: auto; }
.hos-table td, .hos-table th { white-space: nowrap; }
@media (max-width: 860px) { .hos-grid { grid-template-columns: 1fr; } .hos-day { grid-template-columns: 17px 80px 1fr; } .hos-foot { flex-wrap: wrap; } }

/* ---------- Meldingen beheren (alerts-admin.js) ---------- */
.al-adminlink { align-self: flex-start; margin-top: 4px; padding: 0; background: transparent; color: var(--brand-ink); font-size: 13px; font-weight: 700; text-decoration: underline; }
.aa-modal .modal-content { width: min(980px, calc(100vw - 24px)); max-height: calc(100vh - 28px); overflow-y: auto; gap: 0; padding: 22px 26px; }
.aa-modal .modal-content > * { flex-shrink: 0; }
.aa-head { display: flex; align-items: flex-start; gap: 14px; }
.aa-head h2 { margin: 0 0 4px; font-size: 19px; }
.aa-head .hint { margin: 0; max-width: 700px; }
.aa-x { margin-left: auto; width: 34px; height: 34px; padding: 0; border-radius: 50%; background: var(--surface-alt); color: var(--text); font-size: 20px; line-height: 1; border: 1px solid var(--border); flex-shrink: 0; }
.aa-tabs { display: flex; gap: 6px; margin: 16px 0 14px; padding: 4px; width: fit-content; max-width: 100%; overflow-x: auto; background: var(--surface-alt); border: 1px solid var(--border); border-radius: 999px; }
.aa-tab { padding: 7px 18px; border-radius: 999px; background: transparent; color: var(--text-dim); font-size: 13.5px; font-weight: 700; white-space: nowrap; }
.aa-tab.active { background: var(--brand); color: var(--brand-on); }
.aa-bar { display: flex; align-items: center; gap: 14px; margin-bottom: 10px; flex-wrap: wrap; }
.aa-q { width: 260px; max-width: 100%; padding: 8px 12px; font-size: 13.5px; }
.aa-count { margin-right: auto; font-size: 13px; color: var(--text-dim); }
.aa-link { background: transparent; color: var(--brand-ink); padding: 2px 0; font-size: 12.5px; font-weight: 700; text-decoration: underline; }
.aa-tablewrap { max-height: 46vh; overflow: auto; border: 1px solid var(--border); border-radius: var(--radius-md); }
.aa-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.aa-table th { position: sticky; top: 0; z-index: 1; text-align: left; padding: 9px 12px; background: var(--surface-alt); font-size: 11.5px; letter-spacing: .04em; text-transform: uppercase; color: var(--text-dim); border-bottom: 1px solid var(--border); white-space: nowrap; }
.aa-table td { padding: 9px 12px; border-top: 1px solid var(--border); vertical-align: middle; }
.aa-table tr.dirty td { background: var(--brand-soft); }
.aa-c { text-align: center !important; }
.aa-th { background: transparent; padding: 0; color: inherit; font: inherit; letter-spacing: inherit; text-transform: inherit; text-decoration: underline dotted; }
.aa-table input[type="checkbox"] { width: 17px; height: 17px; padding: 0; accent-color: var(--brand); }
.aa-sub { display: block; color: var(--text-dim); font-size: 12px; margin-top: 1px; }
.aa-warn { display: block; color: var(--status-warn-ink); font-size: 12px; font-weight: 600; margin-top: 1px; }
.aa-dim { color: var(--text-dim); }
.aa-note { margin: 10px 0 0; }
.aa-foot { display: flex; align-items: center; gap: 10px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }
.aa-status { margin-right: auto; font-size: 13px; font-weight: 700; }
.aa-status.ok { color: var(--status-good-ink); } .aa-status.bad { color: var(--danger); }
.aa-statusbox { display: flex; flex-direction: column; gap: 8px; }
.aa-row { display: flex; flex-direction: column; gap: 2px; padding: 10px 14px; border-radius: var(--radius-md); border: 1px solid var(--border); border-left-width: 4px; background: var(--surface-alt); font-size: 13.5px; }
.aa-row span { color: var(--text-dim); font-size: 13px; }
.aa-row.good { border-left-color: var(--status-good); } .aa-row.warn { border-left-color: var(--status-warn); } .aa-row.bad { border-left-color: var(--danger); }
.aa-h { margin: 14px 0 4px; font-size: 13px; font-weight: 800; }
.aa-dl { display: grid; grid-template-columns: 200px 1fr; gap: 6px 16px; margin: 0; font-size: 13.5px; }
.aa-dl dt { font-weight: 700; } .aa-dl dd { margin: 0; color: var(--text-dim); }
.aa-acts { display: flex; gap: 8px; margin-top: 12px; }
@media (max-width: 700px) { .aa-dl { grid-template-columns: 1fr; } }
