/* Seguilo Driver Beheer — huisstijl Seguilo (seguilo.nl): primair #0066CC, secundair #059669, slate-neutralen,
   Montserrat voor koppen, Poppins voor tekst. Geen externe bronnen (alleen kaarttegels van PDOK). */
@font-face { font-family: "Poppins"; src: url("assets/fonts/poppins_regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Poppins"; src: url("assets/fonts/poppins_medium.ttf") format("truetype"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Poppins"; src: url("assets/fonts/poppins_semibold.ttf") format("truetype"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Montserrat"; src: url("assets/fonts/montserrat_semibold.ttf") format("truetype"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Montserrat"; src: url("assets/fonts/montserrat_bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }

:root {
  --primary: #0066cc; --primary-hover: #0057ad; --primary-tint: #eaf3fd; --primary-deep: #003a75; --on-primary: #ffffff;
  --secondary: #059669; --secondary-hover: #047857;
  --ink: #0f172a; --ink-2: #334155; --muted: #64748b; --faint: #94a3b8;
  --line: #e2e8f0; --line-2: #eef2f6; --bg: #f4f6f9; --card: #ffffff; --raised: #ffffff; --hover: #f6f8fb;
  --info-bg: #eaf3fd; --info-fg: #0057ad; --progress-bg: #e0f2fe; --progress-fg: #075985;
  --success-bg: #dcfce7; --success-fg: #166534; --warning-bg: #fef3c7; --warning-fg: #92400e;
  --danger-bg: #fee2e2; --danger-fg: #b91c1c; --neutral-bg: #f1f5f9; --neutral-fg: #475569;
  --side-bg: #0b1324; --side-fg: #aab6c8; --side-active: #16213a; --side-line: #1c2741;
  --radius: 12px; --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .05);
  --shadow-pop: 0 12px 32px rgba(15, 23, 42, .16), 0 2px 6px rgba(15, 23, 42, .08);
  --topbar-h: 60px;
  --line-strong: #cbd5e1; --attr-bg: rgba(255, 255, 255, .8); --s1: #2a78d6; --s2: #eb6834;
  color-scheme: light;
}
/* Donker: volgt het systeem, tenzij de gebruiker zelf licht of donker heeft gekozen (html[data-theme]). */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --primary: #5aa7ff; --primary-hover: #86bdff; --primary-tint: #0f2742; --primary-deep: #cfe4ff; --on-primary: #04213f;
    --secondary: #34d399; --secondary-hover: #6ee7b7;
    --ink: #e8edf5; --ink-2: #c3ccd9; --muted: #8b98ab; --faint: #64748b;
    --line: #263247; --line-2: #1b2536; --bg: #0a0f1a; --card: #111827; --raised: #162032; --hover: #172236;
    --info-bg: #0f2742; --info-fg: #a9cdff; --progress-bg: #0c3047; --progress-fg: #a5ddff;
    --success-bg: #0b3324; --success-fg: #8ff0c2; --warning-bg: #3a2608; --warning-fg: #fcd98a;
    --danger-bg: #3d1013; --danger-fg: #ffb4b4; --neutral-bg: #1c2638; --neutral-fg: #c3ccd9;
    --side-bg: #070b14; --side-fg: #93a0b4; --side-active: #131c2e; --side-line: #151e30;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-pop: 0 12px 32px rgba(0, 0, 0, .55);
    --line-strong: #34425a; --attr-bg: rgba(15, 23, 42, .75); --s1: #3987e5; --s2: #d95926;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --primary: #5aa7ff; --primary-hover: #86bdff; --primary-tint: #0f2742; --primary-deep: #cfe4ff; --on-primary: #04213f;
  --secondary: #34d399; --secondary-hover: #6ee7b7;
  --ink: #e8edf5; --ink-2: #c3ccd9; --muted: #8b98ab; --faint: #64748b;
  --line: #263247; --line-2: #1b2536; --bg: #0a0f1a; --card: #111827; --raised: #162032; --hover: #172236;
  --info-bg: #0f2742; --info-fg: #a9cdff; --progress-bg: #0c3047; --progress-fg: #a5ddff;
  --success-bg: #0b3324; --success-fg: #8ff0c2; --warning-bg: #3a2608; --warning-fg: #fcd98a;
  --danger-bg: #3d1013; --danger-fg: #ffb4b4; --neutral-bg: #1c2638; --neutral-fg: #c3ccd9;
  --side-bg: #070b14; --side-fg: #93a0b4; --side-active: #131c2e; --side-line: #151e30;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-pop: 0 12px 32px rgba(0, 0, 0, .55);
  --line-strong: #34425a; --attr-bg: rgba(15, 23, 42, .75); --s1: #3987e5; --s2: #d95926;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body { font-family: "Poppins", system-ui, sans-serif; font-size: 14px; line-height: 1.5; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-family: "Montserrat", "Poppins", sans-serif; font-weight: 700; margin: 0; line-height: 1.25; letter-spacing: -.01em; }
h1 { font-size: 22px; } h2 { font-size: 17px; } h3 { font-size: 15px; font-weight: 600; }
a { color: var(--primary); }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.num { font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.nowrap { white-space: nowrap; }
.strong { font-weight: 600; }

/* ---------------------------------------------------------------- knoppen en invoer */
button, .btn { font: inherit; font-weight: 500; border: 1px solid transparent; border-radius: var(--radius-sm); padding: 7px 14px; cursor: pointer;
  background: var(--primary); color: var(--on-primary); display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  text-decoration: none; line-height: 20px; white-space: nowrap; }
button:hover { background: var(--primary-hover); }
button svg, .btn svg { width: 16px; height: 16px; flex: none; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--primary); outline-offset: 2px; }
button.secondary { background: var(--card); color: var(--ink); border-color: var(--line); box-shadow: var(--shadow); }
button.secondary:hover { background: var(--hover); }
button.ghost { background: transparent; color: var(--ink-2); }
button.ghost:hover { background: var(--hover); }
button.success { background: var(--secondary); color: #fff; } button.success:hover { background: var(--secondary-hover); }
button.danger { background: var(--card); color: var(--danger-fg); border-color: var(--line); }
button.danger:hover { background: var(--danger-bg); border-color: var(--danger-bg); }
button.link { background: none; color: var(--primary); padding: 3px 6px; border-radius: 6px; }
button.link:hover { background: var(--primary-tint); }
button.link.danger-text { color: var(--danger-fg); }
button.link.danger-text:hover { background: var(--danger-bg); }
button.link:disabled { color: var(--muted); background: none; cursor: not-allowed; }
.card-body.stack h4 { margin: 0 0 6px; font-weight: 600; }
.card-body.stack table + h4, .card-body.stack p + h4 { margin-top: 16px; }
button.icon { padding: 7px; background: transparent; color: var(--ink-2); }
button.icon:hover { background: var(--hover); color: var(--ink); }
button.sm { padding: 4px 10px; font-size: 13px; }
button:disabled { opacity: .45; cursor: not-allowed; }
label { display: block; font-size: 12.5px; font-weight: 500; color: var(--ink-2); margin-bottom: 4px; }
input, select, textarea { font: inherit; width: 100%; padding: 7px 11px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--card); color: var(--ink); line-height: 20px; }
input::placeholder, textarea::placeholder { color: var(--faint); }
input:hover, select:hover, textarea:hover { border-color: var(--line-strong); }
input[type="checkbox"] { width: 16px; height: 16px; padding: 0; accent-color: var(--primary); cursor: pointer; vertical-align: middle; }
textarea { min-height: 76px; resize: vertical; }
.field { margin-bottom: 14px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 14px; }
.grid-host { display: grid; grid-template-columns: 1fr 160px; gap: 0 14px; }
@media (max-width: 640px) { .grid2, .grid3, .grid-host { grid-template-columns: 1fr; } }
.label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.label-row .link { font-size: 12.5px; }
.note { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; margin: 4px 0 14px; border-radius: 8px; background: var(--info-bg); color: var(--info-fg); }
.note svg { flex: none; width: 16px; height: 16px; margin-top: 2px; }
.note code { font-size: 12px; }
.form-foot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line-2); }
.form-foot .grow { flex: 1; }
.form-section { font-family: "Montserrat", sans-serif; font-weight: 600; font-size: 13px; color: var(--muted); margin: 18px 0 10px; padding-bottom: 6px; border-bottom: 1px solid var(--line-2); }

/* ---------------------------------------------------------------- inloggen */
.login { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); background: var(--card); }
.login-hero { background: #0b1324; color: #fff; padding: 48px 56px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.login-hero::after { content: ""; position: absolute; inset: auto -120px -160px auto; width: 520px; height: 520px; border-radius: 50%;
  border: 70px solid rgba(0, 102, 204, .16); pointer-events: none; }
.login-hero img { height: 40px; align-self: flex-start; }
.login-hero h1 { font-size: 34px; margin: 36px 0 14px; max-width: 520px; }
.login-hero p { color: #c3ccd9; max-width: 480px; font-size: 16px; margin: 0; }
.login-points { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 12px; }
.login-points li { display: flex; gap: 12px; align-items: flex-start; color: #dbe3ee; }
.login-points svg { width: 20px; height: 20px; color: #5aa7ff; flex: none; margin-top: 1px; }
.login-foot { color: #8b98ab; font-size: 12.5px; position: relative; z-index: 1; }
.login-form { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 24px; }
.login-form form { width: 100%; max-width: 360px; }
.login-form h2 { font-size: 22px; margin-bottom: 4px; }
.login-form button[type="submit"] { width: 100%; padding: 10px 14px; margin-top: 6px; }
.login-extra { margin-top: 10px; width: 100%; max-width: 360px; }
.login-extra button.link { padding-left: 0; }
@media (max-width: 860px) { .login { grid-template-columns: 1fr; } .login-hero { padding: 28px 24px; } .login-hero h1 { font-size: 24px; margin-top: 20px; } .login-points { display: none; } }

/* ---------------------------------------------------------------- schil: zijbalk en bovenbalk */
.shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }
.sidebar { background: var(--side-bg); color: var(--side-fg); padding: 18px 12px 14px; display: flex; flex-direction: column; gap: 2px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.sidebar .brand { padding: 2px 10px 18px; display: flex; flex-direction: column; gap: 4px; }
.sidebar .brand img { height: 26px; align-self: flex-start; }
.sidebar .brand span { font-size: 12px; color: var(--side-fg); }
.nav-group { font-size: 11.5px; color: #66748a; padding: 14px 12px 6px; }
.nav-item { text-decoration: none; display: flex; align-items: center; gap: 11px; padding: 8px 12px; border-radius: var(--radius-sm); color: var(--side-fg);
  background: none; font-weight: 500; width: 100%; justify-content: flex-start; position: relative; border: 0; }
.nav-item:hover { background: var(--side-active); color: #fff; }
.nav-item[aria-current="page"] { background: var(--side-active); color: #fff; }
.nav-item[aria-current="page"]::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: #3b8ff0; }
.nav-item svg { width: 18px; height: 18px; flex: none; }
.nav-item .badge { margin-left: auto; }
.sidebar .spacer { flex: 1; }
.sidebar .tenant { margin-top: 10px; padding: 12px; border-top: 1px solid var(--side-line); font-size: 12.5px; }
.sidebar .tenant .t { color: #e2e8f0; font-weight: 500; }

.workspace { min-width: 0; display: flex; flex-direction: column; }
.topbar { height: var(--topbar-h); display: flex; align-items: center; gap: 10px; padding: 0 24px; background: var(--card); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 15; }
.search-trigger { flex: 0 1 420px; justify-content: flex-start; background: var(--bg); color: var(--muted); border: 1px solid var(--line); font-weight: 400; }
.search-trigger:hover { background: var(--hover); color: var(--ink-2); }
.search-trigger kbd { margin-left: auto; }
kbd { font: 500 11px/1 "Poppins", system-ui, sans-serif; padding: 3px 6px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; color: var(--muted); background: var(--card); }
.topbar .grow { flex: 1; }
.live { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--muted); padding: 0 6px; }
.live .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.live.on .dot { background: #16a34a; box-shadow: 0 0 0 3px rgba(22, 163, 74, .18); }
.live.on .label { color: var(--ink-2); }
.bell { position: relative; }
.bell .count { position: absolute; top: 1px; right: 0; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: #dc2626; color: #fff;
  font-size: 10.5px; font-weight: 600; display: grid; place-items: center; border: 2px solid var(--card); }
.user-btn { background: transparent; color: var(--ink); padding: 4px 8px 4px 4px; gap: 10px; }
.user-btn:hover { background: var(--hover); }
.user-btn .who { text-align: left; line-height: 1.25; }
.user-btn .who .small { color: var(--muted); }
.avatar { --c: #0066cc; width: 32px; height: 32px; border-radius: 50%; background: var(--c); color: #fff; display: inline-grid; place-items: center;
  font: 600 12px/1 "Montserrat", sans-serif; flex: none; }
.avatar.sm { width: 26px; height: 26px; font-size: 10.5px; }
.avatar.lg { width: 40px; height: 40px; font-size: 14px; }
.main { padding: 24px 28px 48px; min-width: 0; }
.demo-chip { font-size: 12px; font-weight: 600; color: var(--warning-fg); background: var(--warning-bg); padding: 3px 10px; border-radius: 999px; }

@media (max-width: 960px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { flex-direction: row; overflow-x: auto; padding: 8px 10px; align-items: center; position: static; height: auto; gap: 4px; }
  .sidebar .brand, .sidebar .spacer, .sidebar .tenant, .nav-group { display: none; }
  .nav-item { width: auto; white-space: nowrap; }
  .nav-item[aria-current="page"]::before { display: none; }
  .topbar { padding: 0 16px; position: static; }
  .user-btn .who, .search-trigger kbd, .search-trigger .label, .live .label { display: none; }
  .search-trigger { flex: 0 0 auto; }
  .main { padding: 18px 16px 40px; }
}

/* ---------------------------------------------------------------- paginakop en werkbalk */
.page-head { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head .titles { flex: 1; min-width: 200px; }
.page-head .sub { color: var(--muted); margin-top: 3px; }
.page-head > select { width: auto; min-width: 200px; }
td select { min-width: 210px; }
.detail-grid .kv { grid-template-columns: 96px 1fr; }
.toolbar { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .field { margin: 0; min-width: 150px; }
.toolbar .field.grow { flex: 1; min-width: 220px; }

/* ---------------------------------------------------------------- kaarten, kengetallen */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--line); }
.card.pad { padding: 18px; }
.card-head { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line-2); }
.card-head h2, .card-head h3 { flex: 1; font-size: 15px; }
.card-head .count { color: var(--muted); font-weight: 500; font-family: "Poppins", sans-serif; }
.card-body { padding: 14px 18px; }
.kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--card); border-radius: var(--radius); padding: 14px 16px 12px; border: 1px solid var(--line); box-shadow: var(--shadow);
  display: grid; grid-template-columns: 1fr auto; grid-template-areas: "label icon" "value value" "foot spark"; row-gap: 4px; min-height: 118px; }
.kpi .l { grid-area: label; color: var(--muted); font-size: 12.5px; font-weight: 500; }
.kpi .ic { grid-area: icon; width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--primary-tint); color: var(--primary); }
.kpi .ic svg { width: 16px; height: 16px; }
.kpi .ic.green { background: var(--success-bg); color: var(--success-fg); }
.kpi .ic.amber { background: var(--warning-bg); color: var(--warning-fg); }
.kpi .ic.red { background: var(--danger-bg); color: var(--danger-fg); }
.kpi .ic.sky { background: var(--progress-bg); color: var(--progress-fg); }
.kpi .v { grid-area: value; font-family: "Montserrat", sans-serif; font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.15; }
.kpi .v .unit { font-size: 15px; color: var(--muted); font-weight: 600; margin-left: 2px; }
.kpi .foot { grid-area: foot; font-size: 12px; color: var(--muted); align-self: end; }
.kpi .spark { grid-area: spark; align-self: end; }
.delta { font-weight: 600; font-variant-numeric: tabular-nums; }
.delta.up { color: var(--success-fg); } .delta.down { color: var(--danger-fg); } .delta.flat { color: var(--muted); }
.spark svg { display: block; }
.bar { height: 5px; border-radius: 3px; background: var(--line-2); overflow: hidden; margin-top: 6px; }
.bar > span { display: block; height: 100%; background: var(--secondary); border-radius: 3px; }
@media (max-width: 1280px) { .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 640px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .kpi .spark { display: none; } }

.control { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 16px; margin-bottom: 16px; }
.control .map { height: 460px; min-height: 0; border-radius: 0 0 var(--radius) var(--radius); }
@media (max-width: 1200px) { .control { grid-template-columns: 1fr; } }

/* Aandacht nodig */
.alerts { max-height: 460px; overflow-y: auto; }
.alert { display: grid; grid-template-columns: 28px 1fr auto; gap: 10px; align-items: start; padding: 11px 18px; border-bottom: 1px solid var(--line-2);
  cursor: pointer; width: 100%; text-align: left; background: none; color: var(--ink); border-radius: 0; font-weight: 400; white-space: normal; }
.alert:hover { background: var(--hover); }
.alert:last-child { border-bottom: 0; }
.alert .ai { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; }
.alert .ai svg { width: 15px; height: 15px; }
.alert .ai.red { background: var(--danger-bg); color: var(--danger-fg); }
.alert .ai.amber { background: var(--warning-bg); color: var(--warning-fg); }
.alert .ai.blue { background: var(--info-bg); color: var(--info-fg); }
.alert .t { font-weight: 600; line-height: 1.35; }
.alert .s { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.alert .when { font-size: 12px; color: var(--muted); white-space: nowrap; }
.all-good { padding: 36px 18px; text-align: center; color: var(--muted); }
.all-good svg { width: 28px; height: 28px; color: var(--secondary); display: block; margin: 0 auto 8px; }

/* Tijdlijn per chauffeur */
.gantt { overflow-x: auto; }
.gantt-inner { min-width: 980px; }
.g-row { display: grid; grid-template-columns: 230px 1fr; align-items: center; border-bottom: 1px solid var(--line-2); min-height: 52px; }
.g-row:last-child { border-bottom: 0; }
.g-row.head { min-height: 32px; position: sticky; top: 0; background: var(--card); z-index: 2; }
.g-who { display: flex; align-items: center; gap: 10px; padding: 6px 14px 6px 18px; min-width: 0; }
.g-who .n { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-who .s { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-who .txt { min-width: 0; flex: 1; }
.g-track { position: relative; height: 52px; margin-right: 16px; }
.g-row.head .g-track { height: 32px; }
.g-hour { position: absolute; top: 0; bottom: 0; border-left: 1px solid var(--line-2); }
.g-hour span { position: absolute; top: 8px; left: 4px; font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.g-now { position: absolute; top: 0; bottom: 0; width: 2px; background: #dc2626; z-index: 1; }
.g-row.head .g-now::before { content: attr(data-t); position: absolute; top: 7px; left: 50%; transform: translateX(-50%); background: #dc2626; color: #fff;
  font-size: 11px; font-weight: 600; padding: 1px 6px; border-radius: 4px; font-variant-numeric: tabular-nums; }
.g-block { position: absolute; top: 12px; height: 28px; border-radius: 6px; min-width: 6px; padding: 0 6px; display: flex; align-items: center; overflow: hidden;
  font-size: 11.5px; font-weight: 600; color: #fff; cursor: pointer; border: 0; line-height: 1; white-space: nowrap; }
.g-block:hover { filter: brightness(1.08); z-index: 3; }
.g-block.done { background: #16a34a; }
.g-block.failed { background: #dc2626; }
.g-block.active { background: var(--primary); box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--primary); }
.g-block.planned { background: var(--primary-tint); color: var(--primary-deep); border: 1px dashed #7fb2ea; }
.g-block.risk { background: var(--warning-bg); color: var(--warning-fg); border: 1px dashed #d99a2b; }
.g-block.cancelled { background: var(--neutral-bg); color: var(--muted); text-decoration: line-through; }
.g-track.stack .g-block { height: 19px; font-weight: 500; font-size: 11px; }
.g-travel { position: absolute; top: 25px; height: 2px; background: var(--line); }
.legend-row { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.legend-row span { display: inline-flex; align-items: center; gap: 6px; }
.legend-row i { width: 14px; height: 10px; border-radius: 3px; display: inline-block; }
.legend-row i.done { background: #16a34a; } .legend-row i.active { background: var(--primary); }
.legend-row i.planned { background: var(--primary-tint); border: 1px dashed #7fb2ea; } .legend-row i.risk { background: var(--warning-bg); border: 1px dashed #d99a2b; }
.legend-row i.failed { background: #dc2626; }

/* ---------------------------------------------------------------- tabellen */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: separate; border-spacing: 0; }
th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap;
  background: var(--card); position: sticky; top: 0; z-index: 1; }
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { color: var(--ink); }
th .arrow { display: inline-block; width: 12px; margin-left: 3px; color: var(--primary); }
td { padding: 9px 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
th.check, td.check { width: 40px; padding-right: 0; }
td.right, th.right { text-align: right; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: var(--hover); }
tr.selected td { background: var(--primary-tint); }
tr.selected:hover td { background: var(--primary-tint); }
.cell-main { font-weight: 500; }
.cell-sub { font-size: 12px; color: var(--muted); }
.who-cell { display: flex; align-items: center; gap: 10px; }
.table-foot { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.table-foot .grow { flex: 1; }
.table-foot select { width: auto; padding: 4px 8px; }
.table-tools { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--line); flex-wrap: wrap; min-height: 54px; }
.table-tools .grow { flex: 1; }
.bulkbar { display: flex; align-items: center; gap: 8px; flex: 1; flex-wrap: wrap; }
.bulkbar .n { font-weight: 600; color: var(--primary); margin-right: 6px; }
.empty { padding: 36px; text-align: center; color: var(--muted); }
.views { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; align-items: center; }
.view-chip { background: var(--card); color: var(--ink-2); border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; font-size: 13px; font-weight: 500; gap: 6px; }
.view-chip:hover { background: var(--hover); }
.view-chip[aria-pressed="true"] { background: var(--ink); color: var(--card); border-color: var(--ink); }
.view-chip .c { font-variant-numeric: tabular-nums; opacity: .7; }
.view-chip .x { margin-left: 2px; opacity: .6; }

/* ---------------------------------------------------------------- statuslabels */
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 500; white-space: nowrap; line-height: 18px; }
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.chip.plain::before { display: none; }
.chip.info { background: var(--info-bg); color: var(--info-fg); }
.chip.progress { background: var(--progress-bg); color: var(--progress-fg); }
.chip.success { background: var(--success-bg); color: var(--success-fg); }
.chip.warning { background: var(--warning-bg); color: var(--warning-fg); }
.chip.danger { background: var(--danger-bg); color: var(--danger-fg); }
.chip.neutral { background: var(--neutral-bg); color: var(--neutral-fg); }
.prio { display: inline-flex; align-items: center; font-size: 11.5px; font-weight: 600; padding: 1px 7px; border-radius: 5px; margin-left: 6px; vertical-align: 1px; }
.prio.urgent { background: var(--danger-bg); color: var(--danger-fg); }
.prio.high { background: var(--warning-bg); color: var(--warning-fg); }
.badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: #dc2626; color: #fff; font-size: 11px; font-weight: 600; display: inline-grid; place-items: center; }
.badge.soft { background: var(--side-active); color: var(--side-fg); }

/* ---------------------------------------------------------------- popovers, datumkiezer, menu */
.popover { position: fixed; z-index: 1200; background: var(--raised); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-pop); padding: 6px; min-width: 200px; }
.menu-item { display: flex; width: 100%; justify-content: flex-start; background: none; color: var(--ink); font-weight: 400; padding: 7px 10px; border-radius: 6px; gap: 10px; }
.menu-item:hover, .menu-item.active { background: var(--hover); }
.menu-item.danger { color: var(--danger-fg); }
.menu-sep { height: 1px; background: var(--line-2); margin: 5px 0; }
.menu-title { font-size: 12px; color: var(--muted); padding: 6px 10px 4px; }
.check-item { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-radius: 6px; cursor: pointer; margin: 0; font-size: 13.5px; font-weight: 400; color: var(--ink); }
.check-item:hover { background: var(--hover); }
.check-item.sub { margin-left: 26px; }

.datenav { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--card); box-shadow: var(--shadow); }
.datenav button { background: none; color: var(--ink); border-radius: 0; padding: 7px 10px; border: 0; }
.datenav button:hover { background: var(--hover); }
.datenav .d { border-left: 1px solid var(--line); border-right: 1px solid var(--line); min-width: 170px; font-weight: 500; gap: 8px; }
.datenav .d svg { color: var(--muted); }
.datenav .today { border-left: 1px solid var(--line); color: var(--primary); font-weight: 500; }
.datenav .today:disabled { color: var(--muted); opacity: 1; cursor: default; }
.datenav button:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.datenav button:last-child { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.cal { padding: 8px; width: 284px; }
.cal-head { display: flex; align-items: center; justify-content: space-between; padding: 2px 2px 8px; }
.cal-head .m { font-weight: 600; text-transform: capitalize; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cal-grid .dow { font-size: 11.5px; color: var(--muted); text-align: center; padding: 4px 0; }
.cal-grid button { background: none; color: var(--ink); padding: 0; height: 34px; border-radius: 6px; font-weight: 400; font-variant-numeric: tabular-nums; }
.cal-grid button:hover { background: var(--hover); }
.cal-grid button.other { color: var(--faint); }
.cal-grid button.today { color: var(--primary); font-weight: 600; }
.cal-grid button.sel { background: var(--primary); color: var(--on-primary); font-weight: 600; }

/* Zoeken (Ctrl+K) */
.palette-wrap { position: fixed; inset: 0; background: rgba(15, 23, 42, .4); z-index: 1150; display: flex; justify-content: center; align-items: flex-start; padding: 12vh 16px 16px; }
.palette { width: min(620px, 100%); background: var(--raised); border-radius: 14px; box-shadow: var(--shadow-pop); overflow: hidden; border: 1px solid var(--line); }
.palette .q { display: flex; align-items: center; gap: 10px; padding: 4px 16px; border-bottom: 1px solid var(--line); }
.palette .q svg { width: 18px; height: 18px; color: var(--muted); flex: none; }
.palette .q input { border: 0; padding: 14px 0; font-size: 16px; background: transparent; }
.palette .q input:focus-visible { outline: none; }
.palette .results { max-height: 52vh; overflow-y: auto; padding: 6px; }
.palette .group { font-size: 12px; color: var(--muted); padding: 8px 10px 4px; }
.palette .hit { display: flex; width: 100%; justify-content: flex-start; align-items: center; gap: 12px; background: none; color: var(--ink); font-weight: 400; padding: 8px 10px; border-radius: 8px; text-align: left; white-space: normal; }
.palette .hit svg { width: 16px; height: 16px; color: var(--muted); }
.palette .hit .txt { flex: 1; min-width: 0; }
.palette .hit .sub { font-size: 12px; color: var(--muted); }
.palette .hit.active { background: var(--primary-tint); }
.palette .hint { display: flex; gap: 14px; padding: 9px 16px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }

/* ---------------------------------------------------------------- lade (opdrachtdetails) en dialogen */
.overlay { position: fixed; inset: 0; background: rgba(15, 23, 42, .4); display: flex; justify-content: flex-end; z-index: 1100; }
.overlay.center { justify-content: center; align-items: center; padding: 16px; }
.drawer { background: var(--bg); width: min(720px, 100%); height: 100%; overflow-y: auto; box-shadow: -8px 0 32px rgba(0, 0, 0, .18); display: flex; flex-direction: column; }
.drawer-head { background: var(--card); padding: 20px 24px 0; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 2; }
.drawer-head .top { display: flex; align-items: flex-start; gap: 12px; }
.drawer-head .top .titles { flex: 1; min-width: 0; }
.drawer-head h2 { font-size: 19px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.drawer-head .meta { color: var(--muted); margin-top: 4px; font-size: 13px; }
.drawer-head .acts { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.drawer-body { padding: 20px 24px 32px; }
.drawer-body > * + * { margin-top: 14px; }
.section { margin-top: 16px; }
.section h3 { margin-bottom: 10px; }
.lbl { display: block; font-size: 12.5px; font-weight: 500; color: var(--ink-2); margin-bottom: 4px; }
.tabs { display: flex; gap: 4px; margin-top: 14px; overflow-x: auto; }
.tab { background: none; color: var(--muted); border-radius: 0; padding: 9px 12px; border-bottom: 2px solid transparent; font-weight: 500; }
.tab:hover { background: none; color: var(--ink); }
.tab[aria-selected="true"] { color: var(--primary); border-bottom-color: var(--primary); }
.tab .c { font-size: 11.5px; background: var(--neutral-bg); color: var(--neutral-fg); border-radius: 9px; padding: 0 7px; margin-left: 4px; }
.modal { background: var(--card); width: min(760px, 100%); max-height: 92vh; overflow-y: auto; border-radius: 14px; padding: 24px; box-shadow: var(--shadow-pop); }
.modal.narrow { width: min(480px, 100%); }
.modal h2 { margin-bottom: 6px; }
.modal .intro { color: var(--muted); margin: 0 0 16px; }
.actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; flex-wrap: wrap; }
.actions.start { justify-content: flex-start; margin-top: 12px; }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 9px 16px; margin: 0; }
.kv dt { color: var(--muted); font-size: 13px; } .kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.detail-grid .span2 { grid-column: 1 / -1; }
@media (max-width: 640px) { .detail-grid { grid-template-columns: 1fr; } .kv { grid-template-columns: 110px 1fr; } }
.mini-map { height: 200px; border-radius: 0 0 var(--radius) var(--radius); }
.steps { display: flex; align-items: center; gap: 0; margin: 4px 0 2px; }
.step { display: flex; flex-direction: column; align-items: center; gap: 6px; flex: 1; position: relative; font-size: 11.5px; color: var(--muted); text-align: center; }
.step::before { content: ""; position: absolute; top: 9px; left: -50%; right: 50%; height: 2px; background: var(--line); }
.step:first-child::before { display: none; }
.step .b { width: 20px; height: 20px; border-radius: 50%; background: var(--card); border: 2px solid var(--line); z-index: 1; display: grid; place-items: center; }
.step .b svg { width: 12px; height: 12px; }
.step.done { color: var(--ink-2); }
.step.done .b { background: var(--secondary); border-color: var(--secondary); color: #fff; }
.step.done::before, .step.current::before { background: var(--secondary); }
.step.current { color: var(--ink); font-weight: 600; }
.step.current .b { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-tint); }
.step.bad .b { background: #dc2626; border-color: #dc2626; color: #fff; }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { padding: 0 0 18px 24px; position: relative; }
.timeline li::before { content: ""; position: absolute; left: 5px; top: 18px; bottom: 0; width: 2px; background: var(--line); }
.timeline li:last-child::before { display: none; }
.timeline li::after { content: ""; position: absolute; left: 0; top: 5px; width: 12px; height: 12px; border-radius: 50%; background: var(--card); border: 2px solid var(--primary); }
.timeline li.ok::after { border-color: var(--secondary); background: var(--secondary); }
.timeline li.bad::after { border-color: #dc2626; background: #dc2626; }
.timeline .t { font-weight: 600; } .timeline .w { color: var(--muted); font-size: 12.5px; margin-left: 6px; }
.photos { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-start; }
.att { margin: 0; display: grid; gap: 6px; }
.att figcaption { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: 12.5px; color: var(--muted); }
.att figcaption b { color: var(--primary); font-weight: 600; }
.att-thumb { width: 150px; height: 120px; padding: 0; border-radius: 10px; border: 1px solid var(--line); background: #fff; overflow: hidden; display: grid; place-items: center; cursor: zoom-in; transition: border-color .15s, box-shadow .15s; }
.att-thumb:hover, .att-thumb:focus-visible { background: #fff; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-tint); }
.att-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.att-thumb.sig img { object-fit: contain; padding: 6px; }
.att-thumb .att-ph { width: 100%; height: 100%; border-radius: 0; }
.att-doc { display: grid; justify-items: center; gap: 6px; padding: 8px; font-size: 12px; color: var(--neutral-fg); word-break: break-all; text-align: center; }
.att-doc svg { width: 22px; height: 22px; }
.att-dl { background: none; color: var(--muted); padding: 4px; border-radius: 6px; line-height: 0; }
.att-dl:hover { background: var(--hover); color: var(--primary); }
.att-dl svg { width: 16px; height: 16px; }

/* popup met bijlage op groot formaat */
.overlay:has(> .lightbox) { background: rgba(15, 23, 42, .72); }
.lightbox { background: var(--card); width: min(1100px, 100%); height: min(92vh, 1000px); border-radius: 14px; box-shadow: var(--shadow-pop); display: flex; flex-direction: column; overflow: hidden; }
.lb-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px 12px 20px; border-bottom: 1px solid var(--line); }
.lb-titles { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; min-width: 0; }
.lb-title { font-weight: 600; font-size: 15px; }
.lb-title b { color: var(--primary); }
.lb-count { font-size: 12.5px; }
.lb-acts { display: flex; gap: 8px; align-items: center; }
.lb-close { background: none; color: var(--muted); padding: 8px; line-height: 0; }
.lb-close:hover { background: var(--hover); color: var(--ink); }
.lb-body { flex: 1; min-height: 0; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-rows: minmax(0, 1fr); align-items: center; gap: 8px; padding: 12px; background: var(--line-2); }
.lb-stage { height: 100%; min-height: 0; min-width: 0; position: relative; display: grid; place-items: center; }
.lb-stage.loading::after { content: "Laden…"; position: absolute; color: var(--muted); font-size: 13px; }
.lb-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; display: block; }
.lb-stage.sig .lb-img { background: #fff; border-radius: 8px; padding: 16px; box-sizing: border-box; }
.lb-file { max-width: 40ch; text-align: center; padding: 16px; }
.lb-nav { background: var(--card); color: var(--ink); border: 1px solid var(--line); border-radius: 50%; width: 42px; height: 42px; padding: 0; display: grid; place-items: center; }
.lb-nav:hover { background: var(--primary-tint); color: var(--primary); }
.lb-nav svg { width: 20px; height: 20px; }
@media (max-width: 640px) {
  .lightbox { height: 100%; border-radius: 0; }
  .overlay.center:has(> .lightbox) { padding: 0; }
  .lb-body { grid-template-columns: minmax(0, 1fr); position: relative; padding: 8px; }
  .lb-nav { position: absolute; top: 50%; transform: translateY(-50%); z-index: 1; }
  .lb-nav.prev { left: 12px; } .lb-nav.next { right: 12px; }
  .lb-acts .secondary { padding-inline: 10px; }
}
.suggest { border: 1px solid var(--line); border-radius: var(--radius-sm); margin-top: 4px; overflow: hidden; }
.suggest button { display: block; width: 100%; text-align: left; border-radius: 0; background: var(--card); color: var(--ink); font-weight: 400; padding: 8px 12px; border-bottom: 1px solid var(--line-2); white-space: normal; }
.suggest button:hover { background: var(--primary-tint); }
.secret { font-family: ui-monospace, monospace; font-size: 18px; background: var(--warning-bg); color: var(--warning-fg); padding: 10px 14px; border-radius: var(--radius-sm); user-select: all; }
.notice { display: flex; gap: 10px; padding: 10px 14px; border-radius: var(--radius-sm); background: var(--info-bg); color: var(--info-fg); font-size: 13px; }

/* ---------------------------------------------------------------- berichten */
.chat { display: grid; grid-template-columns: 300px minmax(0, 1fr); min-height: 560px; overflow: hidden; }
.chat .list { border-right: 1px solid var(--line); overflow-y: auto; max-height: 72vh; padding: 6px; }
.chat .list button { width: 100%; justify-content: flex-start; gap: 10px; border-radius: var(--radius-sm); background: none; color: var(--ink); font-weight: 500; padding: 8px 10px; text-align: left; }
.chat .list button:hover { background: var(--hover); }
.chat .list button[aria-current="true"] { background: var(--primary-tint); }
.chat .list .txt { flex: 1; min-width: 0; }
.chat .list .txt .small { display: block; color: var(--muted); font-weight: 400; }
.thread { display: flex; flex-direction: column; min-width: 0; }
.thread-head { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.thread-head .titles { flex: 1; }
.bubbles { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 18px; max-height: 58vh; min-height: 300px; background: var(--bg); }
.bubble { max-width: 72%; padding: 9px 13px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); }
.bubble.me { align-self: flex-end; background: var(--primary-tint); border-color: transparent; }
.bubble .meta { font-size: 11.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; margin-bottom: 2px; }
.bubble .bubble-delete { margin-left: auto; padding: 0 6px; line-height: 18px; font-size: 16px; background: none; border: 0; color: var(--muted); opacity: 0; }
.bubble:hover .bubble-delete, .bubble .bubble-delete:focus-visible { opacity: 1; }
.bubble .bubble-delete:hover { background: none; color: var(--danger-fg); }
@media (hover: none) { .bubble .bubble-delete { opacity: 1; } }
.composer { display: flex; gap: 10px; padding: 12px 18px; border-top: 1px solid var(--line); align-items: flex-end; }
.composer textarea { min-height: 42px; height: 42px; }
@media (max-width: 900px) { .chat { grid-template-columns: 1fr; } .chat .list { border-right: 0; border-bottom: 1px solid var(--line); max-height: 220px; } }

#toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%) translateY(8px); background: var(--ink); color: var(--card); padding: 10px 18px; border-radius: 10px;
  opacity: 0; transition: opacity .2s, transform .2s; pointer-events: none; z-index: 1300; box-shadow: var(--shadow-pop); }
#toast.show { opacity: 1; transform: translateX(-50%); }
#toast.error { background: #b91c1c; color: #fff; }
#toast.has-action { display: flex; align-items: center; gap: 14px; max-width: calc(100vw - 32px); }
#toast.has-action.show { pointer-events: auto; }
#toast button { background: none; border: 0; color: inherit; font-weight: 600; text-decoration: underline; padding: 2px 0; cursor: pointer; white-space: nowrap; }
.error-text { color: var(--danger-fg); font-size: 13.5px; margin: 6px 0; }
.error-text:empty { display: none; }

/* Laadstatus */
.skel { background: linear-gradient(90deg, var(--line-2) 0%, var(--line) 50%, var(--line-2) 100%); background-size: 200% 100%; border-radius: 6px; animation: shimmer 1.4s linear infinite; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .skel { animation: none; } }
.skel-kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.skel-kpis .skel { height: 118px; border-radius: var(--radius); }
.skel-block { height: 460px; border-radius: var(--radius); }
.skel-line { height: 14px; margin: 14px 0; }
@media (max-width: 1280px) { .skel-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* ---------------------------------------------------------------- kaart */
.map-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
.map-wrap { overflow: hidden; }
.map { height: calc(100vh - 210px); min-height: 420px; background: var(--line-2); }
.map-foot { padding: 8px 14px; border-top: 1px solid var(--line-2); }
.map-side { padding: 14px; }
.map-side h3 { margin-bottom: 8px; }
.map-side .legend { margin-top: 12px; line-height: 1.45; }
.map-row { display: grid; grid-template-columns: 14px 1fr; column-gap: 10px; row-gap: 1px; align-items: center; width: 100%;
  text-align: left; background: none; color: var(--ink); border-radius: var(--radius-sm); padding: 7px 10px; font-weight: 500; white-space: normal; }
.map-row:hover { background: var(--hover); }
.map-row.static:hover { background: none; }
.map-row .small { grid-column: 2; font-weight: 400; color: var(--muted); }
.map-row .n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.swatch { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
.map-icon { background: none; border: 0; }
.map-stop { --c: #0066cc; width: 26px; height: 26px; border-radius: 50%; background: #fff; color: var(--c); border: 2.5px solid var(--c);
  display: grid; place-items: center; font: 700 11.5px/1 Poppins, system-ui, sans-serif; box-shadow: 0 1px 4px rgba(15, 23, 42, .35); }
.map-stop.active { background: var(--c); color: #fff; }
.map-stop.done { background: #e2e8f0; color: #475569; border-color: #94a3b8; }
.map-stop.failed { background: #fee2e2; color: #b91c1c; border-color: #dc2626; }
.map-stop.cancelled { opacity: .45; text-decoration: line-through; }
.map-stop.unassigned { border-style: dashed; }
.map-driver { --c: #0066cc; width: 34px; height: 34px; border-radius: 50%; background: var(--c); color: #fff; border: 3px solid #fff;
  display: grid; place-items: center; font: 700 12px/1 Montserrat, system-ui, sans-serif; box-shadow: 0 0 0 2px var(--c), 0 2px 8px rgba(15, 23, 42, .45); position: relative; }
.map-driver.stale { opacity: .55; }
.map-driver .hd { position: absolute; top: -9px; left: 50%; width: 0; height: 0; margin-left: -5px; border: 5px solid transparent; border-bottom: 7px solid var(--c); transform-origin: 5px 26px; }
.map-depot { width: 26px; height: 26px; border-radius: 6px; background: #0f172a; color: #fff; display: grid; place-items: center;
  font: 700 12px/1 Montserrat, system-ui, sans-serif; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(15, 23, 42, .4); }
.map-popup { display: grid; gap: 4px; min-width: 210px; font-family: Poppins, system-ui, sans-serif; }
.map-popup .t { font-weight: 600; font-size: 14px; }
.map-popup .row { display: flex; gap: 8px; align-items: center; margin-top: 2px; }
.map-popup button.link { justify-self: start; padding-left: 0; }
.leaflet-container { font-family: Poppins, system-ui, sans-serif; }
/* Leaflet-lagen (z-index 400–1000) binnen de kaart houden, zodat bovenbalk, lade en menu's erboven blijven. */
.map, .mini-map { position: relative; z-index: 0; isolation: isolate; }
.leaflet-container a.leaflet-popup-close-button { color: var(--muted); }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--raised); color: var(--ink); }
.leaflet-bar a, .leaflet-bar a:hover { background: var(--raised); color: var(--ink); border-color: var(--line); }
.leaflet-container .leaflet-control-attribution { background: var(--attr-bg); color: var(--ink-2); }
.leaflet-control-attribution a { color: var(--primary); }
@media (max-width: 1100px) { .map-layout { grid-template-columns: 1fr; } .map { height: 60vh; } }
/* Donkere modus: de grijze PDOK-stijl omgekeerd tot een donkere kaart (alleen de tegellaag). */
.tiles-dark { filter: invert(1) hue-rotate(180deg) brightness(.85) contrast(.9); }
.map:has(.tiles-dark), .mini-map:has(.tiles-dark) { background: #1e293b; }

/* ---------------------------------------------------------------- planbord */
.board { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 16px; align-items: start; }
.pool { position: sticky; top: calc(var(--topbar-h) + 16px); max-height: calc(100vh - var(--topbar-h) - 40px); display: flex; flex-direction: column; overflow: hidden; }
.pool.drop-over { outline: 2px dashed var(--primary); outline-offset: -2px; background: var(--primary-tint); }
.pool-search { padding: 10px 14px 4px; }
.pool-list { overflow-y: auto; padding: 8px 14px 14px; display: grid; gap: 8px; }
.pool-list .pcard { width: auto; }
/* Door een chauffeur geweigerd: apart en opvallend bovenaan "Niet ingepland". */
.pool.has-rejected { border-color: var(--danger-fg); }
.pool-group { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--muted); margin-top: 4px; }
.pool-group.rejected { color: var(--danger-fg); }
.pool-group svg { width: 14px; height: 14px; }
.pcard.rejected { border: 1px solid var(--danger-fg); border-left: 4px solid var(--danger-fg); background: var(--danger-bg); }
.pcard.rejected:hover { border-color: var(--danger-fg); filter: brightness(.98); }
.pcard.rejected .rj { flex: none; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .02em; padding: 1px 6px; border-radius: 9px; background: var(--danger-fg); color: var(--card); }
.pool-list > * { min-width: 0; }
.pcard.rejected .eta { color: var(--danger-fg); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pcard.rejected .why { margin-top: 4px; font-size: 12px; color: var(--ink-2); font-style: italic; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pcard.rejected.cancelled { border-color: var(--line-strong); border-left-color: var(--neutral-fg); background: var(--neutral-bg); }
.pcard.rejected.cancelled:hover { border-color: var(--neutral-fg); }
.pcard.rejected.cancelled .rj { background: var(--neutral-fg); }
.pcard.rejected.cancelled .eta { color: var(--muted); }
.pool-toggle { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); border-top: 1px dashed var(--line); padding-top: 8px; margin-top: 6px; cursor: pointer; }
.pool-toggle input { margin: 0; }
.attempt-tag { display: inline-flex; align-items: center; font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 999px; background: var(--info-bg); color: var(--info-fg); white-space: nowrap; vertical-align: middle; }
.attempt-head { font-size: 11.5px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); margin: 4px 0 10px; }
.attempt-block { display: grid; gap: 8px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.attempt-block > p { margin: 0; }
.timeline li.re::after { border-color: var(--primary); background: var(--primary); }
.reject-banner { display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px; margin-bottom: 14px; border-radius: var(--radius-sm); background: var(--danger-bg); color: var(--danger-fg); border: 1px solid var(--danger-fg); font-size: 13px; }
.reject-banner[hidden] { display: none; }
.reject-banner svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.reject-banner .days { display: block; margin-top: 4px; }
.reject-banner .linkish { background: none; border: 0; padding: 0 8px 0 0; color: inherit; text-decoration: underline; cursor: pointer; font: inherit; }
.lanes { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; min-width: 0; }
.plane { min-width: 0; }
.done-pill { flex: none; display: inline-flex; flex-direction: column; align-items: flex-start; gap: 2px; background: var(--success-bg); color: var(--success-fg);
  border-radius: var(--radius-sm); padding: 8px 12px; font-size: 12.5px; font-weight: 600; min-height: 70px; justify-content: center; }
.done-pill:hover { background: var(--success-bg); filter: brightness(.97); }
.done-pill .small { font-weight: 400; }
.plane-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line-2); flex-wrap: wrap; }
.plane-head .txt { flex: 1; min-width: 180px; }
.plane-head .n { font-weight: 600; display: flex; gap: 8px; align-items: center; }
.plane-head .s { font-size: 12px; color: var(--muted); }
.ptrack { display: flex; align-items: center; gap: 0; padding: 12px 14px; overflow-x: auto; min-height: 104px; }
.ptrack.drop-end { box-shadow: inset -3px 0 0 var(--primary); background: var(--primary-tint); }
.lane-empty { color: var(--muted); font-size: 13px; padding: 20px; border: 1px dashed var(--line); border-radius: var(--radius-sm); flex: 1; text-align: center; }
.leg { font-size: 11px; color: var(--muted); padding: 0 6px; white-space: nowrap; position: relative; font-variant-numeric: tabular-nums; }
.pcard { width: 176px; flex: none; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px 10px; cursor: grab; position: relative;
  box-shadow: var(--shadow); font-size: 12.5px; line-height: 1.35; }
.pcard:hover { border-color: #b6cde6; }
.pcard.dragging { opacity: .4; }
.pcard.locked { cursor: pointer; background: var(--bg); box-shadow: none; color: var(--muted); }
.pcard.late { border-color: #e0a23a; }
.pcard.urgent { border-left: 3px solid #dc2626; }
.pcard.drop-before::before { content: ""; position: absolute; left: -14px; top: 4px; bottom: 4px; width: 3px; border-radius: 2px; background: var(--primary); }
.pcard .top { display: flex; align-items: center; gap: 6px; }
.pcard .n { min-width: 18px; height: 18px; border-radius: 9px; background: var(--primary); color: var(--on-primary); font-size: 11px; font-weight: 600; display: grid; place-items: center; padding: 0 4px; }
.pcard.locked .n { background: var(--neutral-bg); color: var(--neutral-fg); }
.pcard .c { font-weight: 600; color: var(--ink); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pcard .m { color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pcard .m .prio { margin-left: 4px; }
.pcard .w { margin-top: 4px; display: flex; justify-content: space-between; gap: 6px; color: var(--ink-2); }
.pcard .eta { color: var(--muted); }
.pcard .eta.bad { color: var(--danger-fg); font-weight: 600; }
.pcard .pmenu { padding: 2px; margin: -2px -4px -2px 0; }
.pcard .pmenu svg { width: 14px; height: 14px; }
.pcard .lk svg { width: 13px; height: 13px; color: var(--muted); }
@media (max-width: 1000px) { .board { grid-template-columns: 1fr; } .pool { position: static; max-height: 360px; } }
.pcard.overlap { box-shadow: inset 0 -3px 0 #e0a23a; }

/* Planbord: weergave kiezen en tijdlijn */
.view-switch { display: inline-flex; gap: 4px; }
.view-switch .view-chip { display: inline-flex; align-items: center; padding: 6px 12px; }
.view-switch svg { width: 14px; height: 14px; }
.timeline { min-width: 0; overflow: hidden; }
.tl-scroll { overflow-x: auto; position: relative; }
.tl-inner { position: relative; }
.tl-axis, .tl-row { display: grid; }
.tl-axis { height: 34px; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; background: var(--card); }
.tl-corner, .tl-label { position: sticky; left: 0; z-index: 4; background: var(--card); border-right: 1px solid var(--line); }
.tl-corner { display: flex; align-items: center; padding: 0 14px; font-size: 12px; color: var(--muted); }
.tl-hours { position: relative; }
.tl-hours span { position: absolute; top: 9px; transform: translateX(-50%); font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tl-hours span.edge { transform: none; padding-left: 4px; }
.tl-row { border-bottom: 1px solid var(--line-2); }
.tl-row:last-of-type { border-bottom: 0; }
.tl-label { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; min-width: 0; }
.tl-label .txt { min-width: 0; flex: 1; }
.tl-label .n { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-label .s { font-size: 12px; color: var(--muted); }
.tl-label .chips .pl { font-size: 11px; font-weight: 500; color: var(--muted); border: 1px solid var(--line); border-radius: 4px; padding: 0 5px; line-height: 18px; }
.tl-label .chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.tl-label .chips:empty { display: none; }
.tl-label .chip { font-size: 11px; }
.tl-label .chip svg { width: 11px; height: 11px; }
.tl-lane { position: relative; min-height: 82px; transition: background-color .12s; }
.tl-lane > i { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--line); }
.tl-lane > i.half { background: var(--line-2); }
.tl-lane.drop-over { background: var(--primary-tint); }
.tl-empty { position: absolute; inset: 10px 12px; display: grid; place-items: center; border: 1px dashed var(--line-strong); border-radius: var(--radius-sm); color: var(--muted); font-size: 12.5px; pointer-events: none; }
.tl-ghost { position: absolute; top: 8px; bottom: 8px; border: 2px dashed var(--primary); border-radius: var(--radius-sm); background: var(--primary-tint); color: var(--primary); font-size: 12px; font-weight: 600;
  display: grid; place-items: center; pointer-events: none; z-index: 3; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tl-block { position: absolute; z-index: 2; border: 1px solid var(--primary); background: var(--primary-tint); border-radius: var(--radius-sm); padding: 5px 10px; overflow: hidden;
  cursor: grab; user-select: none; -webkit-user-select: none; touch-action: none; display: flex; flex-direction: column; justify-content: center; gap: 1px; font-size: 12px; color: var(--ink); }
.tl-block:hover { filter: brightness(.98); }
.tl-block:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.tl-block .tl-t { display: flex; align-items: center; gap: 5px; min-width: 0; }
.tl-block .n { flex: none; min-width: 17px; height: 17px; border-radius: 9px; background: var(--primary); color: var(--on-primary); font-size: 10.5px; font-weight: 600; display: grid; place-items: center; padding: 0 4px; }
.tl-block .c { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-block .tl-m, .tl-block .tl-w { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-block .tl-m { color: var(--muted); font-size: 11.5px; }
.tl-block .tl-w { font-variant-numeric: tabular-nums; font-size: 11.5px; color: var(--ink-2); }
.tl-block .ov svg, .tl-block .lk svg { width: 12px; height: 12px; flex: none; }
.tl-block .ov { color: #b45309; display: inline-flex; }
.tl-block .lk { color: var(--muted); display: inline-flex; margin-left: auto; }
.tl-block.s-en_route { border-color: var(--secondary); background: var(--success-bg); }
.tl-block.s-en_route .n { background: var(--secondary); }
.tl-block.locked { cursor: pointer; border-color: var(--line); background: var(--bg); color: var(--muted); }
.tl-block.locked .n { background: var(--neutral-bg); color: var(--neutral-fg); }
.tl-block.locked .c { color: var(--ink-2); }
.tl-block.urgent { border-left: 3px solid #dc2626; }
.tl-block.late { border-color: #e0a23a; box-shadow: inset 0 0 0 1px #e0a23a; }
.tl-block.overlap { background-image: repeating-linear-gradient(135deg, transparent 0 7px, rgba(224, 162, 58, .16) 7px 12px); border-style: dashed; border-color: #d48a1c; }
.tl-block.dragging { cursor: grabbing; z-index: 6; pointer-events: none; box-shadow: var(--shadow-pop); opacity: .95; }
.tl-h { position: absolute; top: 0; bottom: 0; width: 10px; cursor: ew-resize; z-index: 1; }
.tl-h.l { left: 0; } .tl-h.r { right: 0; }
.tl-h::after { content: ""; position: absolute; top: 50%; width: 3px; height: 20px; margin-top: -10px; border-radius: 2px; background: currentColor; opacity: 0; transition: opacity .12s; }
.tl-h.l::after { left: 3px; } .tl-h.r::after { right: 3px; }
.tl-block:hover .tl-h::after, .tl-block.dragging .tl-h::after, .tl-block:focus-visible .tl-h::after { opacity: .35; }
.tl-eta { position: absolute; width: 0; border-left: 2px dashed var(--secondary); z-index: 3; opacity: .9; pointer-events: none; }
.tl-eta.late { border-color: var(--danger-fg); }
.tl-now { position: absolute; top: 0; bottom: 0; width: 2px; background: #dc2626; z-index: 3; pointer-events: none; }
.tl-now span { position: absolute; top: 36px; left: 4px; font-size: 10px; font-weight: 700; color: #dc2626; background: var(--card); padding: 0 3px; border-radius: 3px; font-variant-numeric: tabular-nums; }
.tl-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.tl-zoom { display: inline-flex; align-items: center; gap: 4px; }
.tl-zoom > span { min-width: 44px; text-align: center; font-size: 12px; color: var(--muted); }
.tl-zoom svg { width: 14px; height: 14px; }
.tl-filters { margin-left: auto; display: inline-flex; flex-wrap: wrap; gap: 4px; }
.tl-filters .view-chip { padding: 5px 11px; font-size: 12.5px; }
.tl-none { position: sticky; left: 0; padding: 22px 16px; text-align: center; color: var(--muted); font-size: 13px; }
.tl-none .linkish { background: none; border: 0; padding: 0; color: var(--primary); text-decoration: underline; cursor: pointer; font: inherit; }
.tl-route { position: absolute; height: 2px; border-radius: 2px; background: var(--line-strong); z-index: 0; pointer-events: none; }
.tl-route.done { background: var(--line); }
.tl-cluster { position: absolute; z-index: 2; display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-start; gap: 1px; padding: 5px 8px 9px; overflow: hidden;
  border: 1px solid var(--primary); border-radius: var(--radius-sm); background: var(--card); color: var(--ink); font: inherit; font-size: 12px; text-align: left; cursor: zoom-in;
  box-shadow: 3px 3px 0 -1px var(--card), 3px 3px 0 0 var(--primary-tint); }
.tl-cluster:hover { background: var(--primary-tint); }
.tl-cluster:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.tl-cluster .tl-t { display: flex; align-items: baseline; gap: 6px; min-width: 0; max-width: 100%; white-space: nowrap; }
.tl-cluster .c { font-weight: 600; }
.tl-cluster .nr, .tl-cluster .tl-w { color: var(--muted); font-size: 11.5px; white-space: nowrap; }
.tl-cluster .warns { display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.tl-cluster .warns .bad { color: var(--danger-fg); } .tl-cluster .warns .ov { color: #b45309; display: inline-flex; }
.tl-cluster .warns svg { width: 11px; height: 11px; }
.tl-cluster.late { border-color: #e0a23a; box-shadow: inset 0 0 0 1px #e0a23a; }
.tl-cluster.done { border-color: var(--line); background: var(--bg); color: var(--muted); }
.tl-cluster .marks { position: absolute; left: 0; right: 0; bottom: 2px; height: 5px; pointer-events: none; }
.tl-cluster .marks i { position: absolute; bottom: 0; width: 3px; height: 5px; border-radius: 1px; background: var(--primary); opacity: .55; }
.tl-cluster .marks i.late { background: var(--danger-fg); opacity: 1; }
.tl-cluster .marks i.ov { background: #d48a1c; opacity: 1; }
.tl-cluster .marks i.done { background: var(--muted); }
.tl-label .tl-exp { flex: none; align-self: flex-start; width: 26px; height: 26px; padding: 0; display: grid; place-items: center; border: 0; border-radius: 6px; background: none; color: var(--muted); }
.tl-label .tl-exp:hover { background: var(--hover); color: var(--ink); }
.tl-label .tl-exp svg { width: 15px; height: 15px; transition: transform .15s; }
.tl-label .tl-exp[aria-expanded="true"] svg { transform: rotate(90deg); }
.tl-row.open { border-bottom-style: dashed; }
.tl-eta-link { position: absolute; height: 0; border-top: 2px dotted var(--secondary); z-index: 1; pointer-events: none; }
.tl-eta-link.late { border-color: var(--danger-fg); }
.tl-stops { position: sticky; left: 0; z-index: 4; background: var(--bg); border-bottom: 1px solid var(--line-2); padding: 10px 14px 14px; }
.tl-stops-h { font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.tl-stops-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 2px 18px; }
.tl-stops-list li { padding: 0; }
.tl-stops-list li::before, .tl-stops-list li::after { content: none; }
.tl-stop { width: 100%; display: grid; grid-template-columns: 22px 84px minmax(0, 1fr) auto auto; align-items: center; gap: 8px; padding: 5px 6px; border: 0; border-radius: 6px;
  background: none; color: var(--ink); font: inherit; font-size: 12.5px; text-align: left; cursor: pointer; }
.tl-stop:hover { background: var(--card); }
.tl-stop:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.tl-stop .n { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: var(--primary); color: var(--on-primary); font-size: 10.5px; font-weight: 600; }
.tl-stop.late .n { background: var(--danger-fg); } .tl-stop.done .n { background: var(--neutral-bg); color: var(--neutral-fg); }
.tl-stop .w { color: var(--muted); }
.tl-stop .c { min-width: 0; display: flex; gap: 6px; align-items: baseline; }
.tl-stop .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.tl-stop .ct { color: var(--muted); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-stop .chip { font-size: 10.5px; }
.tl-stop .e { font-size: 11.5px; font-weight: 600; color: var(--secondary); white-space: nowrap; }
.tl-stop.late .e { color: var(--danger-fg); } .tl-stop.done .e { color: var(--muted); font-weight: 500; }
.tl-card { position: fixed; z-index: 1400; pointer-events: none; width: max-content; max-width: 300px; background: var(--card); color: var(--ink); border: 1px solid var(--line);
  border-radius: var(--radius-sm); box-shadow: var(--shadow-pop); padding: 10px 12px; font-size: 12.5px; line-height: 1.45; }
.tl-card .tc-h { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.tl-card .tc-h b { font-weight: 600; }
.tl-card .tc-sub { color: var(--muted); font-size: 12px; margin-bottom: 6px; }
.tl-card .tc-r { display: flex; justify-content: space-between; gap: 16px; }
.tl-card .tc-r > span:first-child { color: var(--muted); }
.tl-card .tc-r.ok > span:last-child { color: var(--secondary); font-weight: 600; }
.tl-card .tc-r.late > span:last-child { color: var(--danger-fg); font-weight: 600; }
.tl-card .tc-ov { display: flex; gap: 6px; align-items: flex-start; margin-top: 6px; color: #b45309; }
.tl-card .tc-ov svg { width: 13px; height: 13px; flex: none; margin-top: 3px; }
.tl-card .tc-urgent { font-size: 11px; font-weight: 600; color: var(--danger-fg); }
.tl-card .tc-hint { margin-top: 8px; padding-top: 6px; border-top: 1px solid var(--line-2); color: var(--muted); font-size: 11.5px; }
.tl-card .tc-list { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 1px; }
.tl-card .tc-list li { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; gap: 6px; }
.tl-card .tc-list .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-card .tc-list li.late .nm, .tl-card .tc-list li.late span:last-child { color: var(--danger-fg); }
.tl-card .tc-list li.ov .nm { color: #b45309; }
.tl-card .tc-list li.done { color: var(--muted); }
.tl-foot { display: flex; flex-wrap: wrap; gap: 8px 18px; justify-content: space-between; padding: 10px 14px; border-top: 1px solid var(--line-2); font-size: 12px; color: var(--muted); }
.tl-foot .legend { display: inline-flex; align-items: center; gap: 6px; }
.tl-foot .lg { display: inline-block; width: 14px; height: 10px; border-radius: 3px; margin-left: 8px; }
.tl-foot .lg.eta { width: 0; height: 12px; border-left: 2px dashed var(--secondary); border-radius: 0; }
.tl-foot .lg.ov { border: 1px dashed #d48a1c; background: repeating-linear-gradient(135deg, transparent 0 3px, rgba(224, 162, 58, .3) 3px 6px); }
.tl-foot .lg.late { border: 2px solid #e0a23a; }
.tl-foot .lg.cl { border: 1px solid var(--primary); background: var(--card); box-shadow: 2px 2px 0 -1px var(--card), 2px 2px 0 0 var(--primary-tint); }
.tl-tip { position: fixed; z-index: 1400; pointer-events: none; background: var(--ink); color: var(--card); font-size: 12px; font-weight: 600; padding: 5px 9px; border-radius: 6px;
  white-space: nowrap; font-variant-numeric: tabular-nums; box-shadow: var(--shadow-pop); }
@media (prefers-reduced-motion: reduce) { .tl-lane, .tl-h::after, .tl-label .tl-exp svg { transition: none; } }
.compare { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 16px; }
.compare .big { font-family: "Montserrat", sans-serif; font-size: 24px; font-weight: 700; }
.compare .saving { grid-column: 1 / -1; color: var(--success-fg); font-weight: 600; }
.compare .saving:empty { display: none; }
.plist { margin: 6px 0 0; padding-left: 20px; font-size: 13px; }
.plist li { padding: 3px 0; }
.plist li > span { display: inline-flex; width: 100%; justify-content: space-between; gap: 8px; }
.plist li.bad .num { color: var(--danger-fg); font-weight: 600; }
.modal.wide { width: min(1000px, 100%); }
.imp-preview { max-height: 46vh; margin-top: 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.notice { margin-top: 10px; }
.notice.ok { background: var(--success-bg); color: var(--success-fg); }
.notice.warn { background: var(--warning-bg); color: var(--warning-fg); }

/* ---------------------------------------------------------------- rapportages
   Reeksen: blauw/oranje (gevalideerd op kleurenblindheid en contrast, licht en donker). */
.report-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
@media (max-width: 1100px) { .report-grid { grid-template-columns: 1fr; } }
.chart { padding: 10px 12px 6px; min-height: 250px; }
.chart svg { display: block; overflow: visible; max-width: 100%; height: auto; }
.chart .grid { stroke: var(--line-2); stroke-width: 1; }
.chart .axis { stroke: var(--line); stroke-width: 1; }
.chart .tick { fill: var(--muted); font-size: 11px; font-family: Poppins, sans-serif; font-variant-numeric: tabular-nums; }
.chart .s1 { fill: var(--s1); } .chart .s2 { fill: var(--s2); }
.chart .line { fill: none; stroke: var(--s1); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .dot { stroke: var(--card); stroke-width: 2; }
.chart .cross { stroke: var(--faint); stroke-width: 1; stroke-dasharray: 3 3; }
.chart .hit { fill: transparent; cursor: crosshair; }
.legend-row i.s1 { background: var(--s1); } .legend-row i.s2 { background: var(--s2); }
.viz-tip { position: fixed; z-index: 1300; background: var(--raised); color: var(--ink); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px;
  font-size: 12.5px; box-shadow: var(--shadow-pop); pointer-events: none; min-width: 150px; }
.hbars { display: grid; gap: 10px; }
.hbar { display: grid; grid-template-columns: 170px 1fr auto; gap: 12px; align-items: center; font-size: 13px; }
.hbar .track { height: 10px; background: var(--line-2); border-radius: 0 4px 4px 0; overflow: hidden; }
.hbar .fill { display: block; height: 100%; background: var(--s1); border-radius: 0 4px 4px 0; }
.hbar .v { color: var(--ink-2); }
.kpi.slim { min-height: 0; grid-template-areas: "label label" "value value" "foot foot"; }
.section-title { font-size: 17px; margin: 4px 0 12px; }

@media print {
  .sidebar, .topbar, .page-head button, .page-head select, .table-tools, .table-foot { display: none !important; }
  .shell { display: block; } body { background: #fff; } .card { box-shadow: none; break-inside: avoid; }
  .main { padding: 0; } .report-grid { grid-template-columns: 1fr 1fr; }
}

/* ---------------------------------------------------------------- klanten, facturatie, integraties */
.kpis.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 640px) { .kpis.three { grid-template-columns: 1fr; } }
.spacer16 { height: 16px; }
.warn-text { color: var(--warning-fg); }
pre.code { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; font: 12.5px/1.55 ui-monospace, SFMono-Regular, Menlo, monospace;
  overflow-x: auto; white-space: pre; color: var(--ink-2); margin: 10px 0 0; }
code { font: 12.5px ui-monospace, SFMono-Regular, Menlo, monospace; }
.notice + .spacer16 { height: 12px; }

/* Supportsessie van een Seguilo-medewerker: altijd zichtbaar boven de inhoud. */
.support-banner { display: flex; align-items: center; gap: 12px; padding: 10px 24px; background: var(--warning-bg); color: var(--warning-fg);
  border-bottom: 1px solid var(--line); font-size: 13px; position: sticky; top: var(--topbar-h); z-index: 5; }
.support-banner .grow { flex: 1; min-width: 0; }
.support-banner > svg { width: 18px; height: 18px; flex: none; }
@media (max-width: 760px) { .support-banner { padding: 10px 16px; flex-wrap: wrap; position: static; } }

/* Opsomming in een bevestigingsvenster (bijv. chauffeur verwijderen). */
.plain-list { margin: 0 0 14px; padding-left: 18px; color: var(--ink-2); display: grid; gap: 6px; }
.modal .check-item:has(.small) { align-items: flex-start; padding: 10px; border: 1px solid var(--line); margin-bottom: 8px; }
.modal .check-item:has(.small) input { margin-top: 3px; }

/* ---------------------------------------------------------------- formulierbeheer */
.ff-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 24px; align-items: start; margin-top: 12px; }
@media (max-width: 860px) { .ff-layout { grid-template-columns: 1fr; } }
.ff-list { display: grid; gap: 10px; }
.ff-row { border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--card); padding: 10px; }
.ff-row-head { display: grid; grid-template-columns: 24px minmax(0, 1fr) 160px auto; gap: 8px; align-items: center; }
.ff-num { color: var(--muted); font-size: 12.5px; text-align: center; }
.ff-tools { display: flex; gap: 2px; }
.ff-row-body { padding-left: 32px; margin-top: 8px; display: grid; gap: 8px; }
.ff-row-line { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.ff-req { padding: 4px 8px; }
.ff-options { display: grid; gap: 6px; }
.ff-option { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px; align-items: center; }
.ff-options button.link { justify-self: start; display: inline-flex; gap: 4px; }
@media (max-width: 640px) {
  .ff-row-head { grid-template-columns: 24px minmax(0, 1fr); }
  .ff-row-head select, .ff-row-head .ff-tools { grid-column: 2; }
  .ff-row-body { padding-left: 0; }
}
.ff-preview { position: sticky; top: 0; }
.ff-preview-title { margin-bottom: 6px; }
.ff-phone { border: 1px solid var(--line); border-radius: 22px; padding: 10px; background: var(--bg); }
.ff-phone-body { background: var(--card); border-radius: 14px; padding: 14px; display: grid; gap: 12px; max-height: 60vh; overflow-y: auto; }
.ff-phone-title { font-family: "Montserrat", sans-serif; font-weight: 600; font-size: 14px; }
.ff-mock { display: grid; gap: 4px; }
.ff-mock-label { font-size: 12.5px; font-weight: 500; color: var(--ink-2); }
.ff-mock-label .req { color: var(--danger-fg); }
.ff-mock input, .ff-mock select { pointer-events: none; }
.ff-mock-check { padding: 0; }
.ff-mock-box { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; border: 1px dashed var(--line-strong); border-radius: var(--radius-sm); color: var(--muted); font-size: 12.5px; }
.ff-mock-box.tall { min-height: 80px; }
.ff-mock-box svg { width: 16px; height: 16px; }

/* ---------------------------------------------------------------- QR-sticker voor gedeelde voertuigen */
.sticker-modal { width: min(420px, 100%); }
.sticker { display: grid; justify-items: center; gap: 6px; padding: 24px 20px; margin-bottom: 14px; text-align: center;
  border: 2px dashed var(--line-strong); border-radius: 16px; background: #fff; color: #0f172a; }
.sticker .qr-img { width: 240px; height: 240px; image-rendering: pixelated; }
.sticker-title { font-family: "Montserrat", sans-serif; font-weight: 700; font-size: 18px; color: #0066cc; }
.sticker-name { font-family: "Montserrat", sans-serif; font-weight: 600; font-size: 20px; }
.sticker-plate { font-size: 16px; letter-spacing: .06em; }
.sticker-help { font-size: 13px; max-width: 260px; color: #334155; }
@media print {
  body:has(.sticker-modal) > :not(.overlay:has(.sticker-modal)) { display: none !important; }
  .overlay:has(.sticker-modal) { position: static; background: none; }
  .sticker-modal { box-shadow: none; padding: 0; max-height: none; }
  .no-print { display: none !important; }
}

/* Aanmeldregels van een gedeeld voertuig */
.rules-box { display: grid; gap: 8px; margin-top: 8px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.rules-box[hidden] { display: none; }
.license-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 4px 12px; margin-bottom: 12px; }

/* Chauffeurkiezer (toegestane chauffeurs van een gedeeld voertuig) */
.driver-picker { display: grid; gap: 10px; margin-top: 4px; }
.dp-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.driver-picker .small { margin: 2px 0 0; }
.dp-chips { display: flex; flex-wrap: wrap; gap: 6px; max-height: 96px; overflow-y: auto; }
.dp-chips[hidden] { display: none; }
.dp-chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 2px 2px 3px; border-radius: 999px; background: var(--primary-tint);
  color: var(--primary-deep); font-size: 12.5px; font-weight: 500; line-height: 20px; }
.dp-chip button.icon { padding: 3px; border-radius: 50%; color: inherit; }
.dp-chip button.icon svg { width: 12px; height: 12px; }
.avatar.xs { width: 20px; height: 20px; font-size: 8.5px; }
.dp-tools { display: flex; gap: 8px; align-items: center; }
.dp-search { position: relative; flex: 1; min-width: 0; }
.dp-search svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--faint); pointer-events: none; }
.dp-search input { padding-left: 32px; }
.dp-tabs { display: inline-flex; padding: 2px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg); flex: none; }
.dp-tabs .dp-tab { background: transparent; color: var(--muted); padding: 5px 10px; font-size: 12.5px; font-weight: 500; border-radius: 5px; box-shadow: none; }
.dp-tabs .dp-tab:hover { color: var(--ink); background: transparent; }
.dp-tabs .dp-tab.on { background: var(--card); color: var(--ink); box-shadow: var(--shadow); }
.dp-actions { display: flex; gap: 4px; justify-content: flex-end; margin: -4px 0 -6px; min-height: 4px; }
.dp-actions button[hidden] { display: none; }
.dp-list { border: 1px solid var(--line); border-radius: var(--radius-sm); max-height: 264px; overflow-y: auto; overscroll-behavior: contain; }
.dp-row { display: flex; align-items: center; gap: 10px; padding: 7px 12px; margin: 0; cursor: pointer; font-size: 13.5px; font-weight: 400; color: var(--ink);
  border-bottom: 1px solid var(--line-2); }
.dp-row:last-child { border-bottom: 0; }
.dp-row:hover { background: var(--hover); }
.dp-row.on { background: var(--primary-tint); }
.dp-who { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.dp-name { font-weight: 500; }
.dp-sub { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fd-chosen { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--primary); border-radius: var(--radius-sm); background: var(--primary-tint); }
.fd-chosen.none { border: 1px dashed var(--line-strong); background: transparent; }
.fd-chosen.none .dp-name { color: var(--ink-2); }
.fd-none-ic { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--bg); color: var(--muted); flex: none; }
.fd-none-ic svg { width: 16px; height: 16px; }
.dp-row input[type="radio"] { width: 16px; height: 16px; margin: 0; padding: 0; accent-color: var(--primary); flex: none; cursor: pointer; }
.notice-text { margin: 0; color: var(--warning-fg); }
.notice-text[hidden] { display: none; }
.dp-empty { margin: 0; padding: 16px 12px; text-align: center; color: var(--muted); font-size: 13px; }
@media (max-width: 640px) { .dp-tools { flex-direction: column; align-items: stretch; } .dp-tabs { align-self: flex-start; } }
.assign-row { align-items: end; }
