:root {
  --bg: #eef3f1;
  --bg-gradient-top: #f6fbf9;
  --panel: #ffffff;
  --panel-strong: #ffffff;
  --panel-soft: #eef4f3;
  --text: #16231e;
  --muted: #5c6f68;
  --accent: #0c7361;
  --accent-hover: #0a5f50;
  --accent-soft: #dcefe9;
  --accent-gradient-start: #0d7a67;
  --accent-gradient-mid: #13a085;
  --accent-gradient-end: #16927c;
  --line: rgba(20, 42, 35, 0.10);
  --line-strong: rgba(20, 42, 35, 0.16);
  --shadow-sm: 0 1px 2px rgba(16, 40, 34, 0.06);
  --shadow: 0 1px 2px rgba(16, 40, 34, 0.05), 0 10px 24px rgba(16, 40, 34, 0.07);
  /* Consistente radius-schaal (verving een wildgroei van 8–32px) */
  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 18px;
  --radius-pill: 999px;

  /* Statuskleuren (pills/badges), issue #228: als variabelen zodat de
     donkere modus ze in één plek kan overschrijven i.p.v. op tientallen
     plekken losse hex-waarden te dupliceren. */
  --pill-success-bg: #daf5e8;
  --pill-success-text: #18794d;
  --pill-warn-bg: #fff0d5;
  --pill-warn-text: #b06200;
  --pill-idle-bg: #e8edf1;
  --pill-idle-text: #52616d;
  --pill-live-bg: #dff4ef;
  --pill-live-text: #0a6b59;
  --pill-attention-bg: #ffe5db;
  --pill-attention-text: #b44721;
  --soft-gradient-start: #dfeceb;
  --soft-gradient-end: #f4f8f7;
  --panel-translucent: rgba(255, 255, 255, 0.6);
}

/* Donkere modus (issue #228): systeeminstelling standaard, handmatige keuze
   (data-theme="dark"/"light" op <html>, gezet door app.js) heeft voorrang. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1715;
    --bg-gradient-top: #121c19;
    --panel: #17211e;
    --panel-strong: #1c2723;
    --panel-soft: #1a2521;
    --text: #e7f1ec;
    --muted: #93a39b;
    --accent: #3ecfa8;
    --accent-hover: #5adbb8;
    --accent-soft: #1d3a32;
    --accent-gradient-start: #0f5f4e;
    --accent-gradient-mid: #14806b;
    --accent-gradient-end: #17735f;
    --line: rgba(231, 241, 236, 0.12);
    --line-strong: rgba(231, 241, 236, 0.2);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 24px rgba(0, 0, 0, 0.35);

    --pill-success-bg: #163a29;
    --pill-success-text: #6fe0ab;
    --pill-warn-bg: #3a2c0f;
    --pill-warn-text: #f2b95a;
    --pill-idle-bg: #232f2c;
    --pill-idle-text: #a9bab2;
    --pill-live-bg: #123a33;
    --pill-live-text: #5fe3cc;
    --pill-attention-bg: #3d2119;
    --pill-attention-text: #ff9b78;
    --soft-gradient-start: #1a2b26;
    --soft-gradient-end: #16201d;
    --panel-translucent: rgba(23, 33, 30, 0.7);
  }
}

:root[data-theme="dark"] {
  --bg: #0f1715;
  --bg-gradient-top: #121c19;
  --panel: #17211e;
  --panel-strong: #1c2723;
  --panel-soft: #1a2521;
  --text: #e7f1ec;
  --muted: #93a39b;
  --accent: #3ecfa8;
  --accent-hover: #5adbb8;
  --accent-soft: #1d3a32;
  --accent-gradient-start: #0f5f4e;
  --accent-gradient-mid: #14806b;
  --accent-gradient-end: #17735f;
  --line: rgba(231, 241, 236, 0.12);
  --line-strong: rgba(231, 241, 236, 0.2);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 24px rgba(0, 0, 0, 0.35);

  --pill-success-bg: #163a29;
  --pill-success-text: #6fe0ab;
  --pill-warn-bg: #3a2c0f;
  --pill-warn-text: #f2b95a;
  --pill-idle-bg: #232f2c;
  --pill-idle-text: #a9bab2;
  --pill-live-bg: #123a33;
  --pill-live-text: #5fe3cc;
  --pill-attention-bg: #3d2119;
  --pill-attention-text: #ff9b78;
  --soft-gradient-start: #1a2b26;
  --soft-gradient-end: #16201d;
  --panel-translucent: rgba(23, 33, 30, 0.7);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  background:
    radial-gradient(circle at top right, rgba(12, 115, 97, 0.09), transparent 30%),
    linear-gradient(180deg, var(--bg-gradient-top) 0%, var(--bg) 100%);
  line-height: 1.6;
}

/* Professionele typografie-schaal (issue #312) */
h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

h1 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

h2 {
  font-size: 1.5rem;
  margin-bottom: 0.4rem;
}

h3 {
  font-size: 1.2rem;
  margin-bottom: 0.3rem;
}

h4 {
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

p {
  margin: 0;
  color: var(--text);
}

.text-muted {
  color: var(--muted);
  font-size: 0.875rem;
}

.text-small {
  font-size: 0.875rem;
}

.text-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

/* Cijferkolommen (KPI's, tabellen) netjes uitgelijnd */
.metric-value,
.status-value,
.hero-panel-value,
.route-table td,
.metric-card strong {
  font-variant-numeric: tabular-nums;
}

a {
  color: inherit;
}

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px 1fr;
}

.sidebar {
  padding: 32px 24px;
  border-right: 1px solid var(--line);
  background: var(--panel-translucent);
  backdrop-filter: blur(18px);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: stretch;
  gap: 32px;
}

.sidebar-stack {
  display: grid;
  gap: 16px;
}

.eyebrow {
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.76rem;
  color: var(--muted);
}

.sidebar h1,
.hero h2,
.panel h3 {
  margin: 0;
}

.sidebar-copy,
.hero-copy,
.status-meta,
.metric-meta,
.route-meta {
  color: var(--muted);
}

.nav {
  display: grid;
  gap: 10px;
}

.nav-section {
  display: grid;
  gap: 10px;
}

.nav-item {
  text-decoration: none;
  color: var(--text);
  padding: 12px 14px;
  border-radius: 14px;
}

.nav-item.active,
.nav-item:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

.status-card,
.metric-card,
.panel,
.hero-panel,
.session-card,
.auth-callout {
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.status-card {
  padding: 18px;
  border-radius: var(--radius-lg);
}

.session-card,
.auth-callout {
  padding: 18px;
  border-radius: var(--radius-lg);
}

.status-label,
.hero-panel-label,
.metric-label {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.88rem;
}

.status-value,
.hero-panel-value,
.metric-value {
  margin: 0;
  font-size: 1.8rem;
  font-weight: 800;
}

.content {
  padding: 32px;
}

.hero {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 24px;
  align-items: stretch;
}

.hero-panel,
.panel,
.metric-card {
  border-radius: var(--radius-lg);
}

.hero-panel {
  padding: 24px;
  background: linear-gradient(135deg, var(--accent-gradient-start), var(--accent-gradient-mid));
  color: #fff;
}

.hero-panel-label,
.hero-panel-meta {
  color: rgba(255, 255, 255, 0.76);
}

.metrics {
  margin-top: 24px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.metric-card {
  padding: 22px;
}

.grid {
  margin-top: 24px;
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 18px;
}

.panel {
  padding: 22px;
}

.media-panel {
  margin-top: 24px;
}

.gallery-note {
  color: var(--muted);
  font-size: 0.88rem;
}

.exception-panel {
  margin-top: 24px;
}

.panel.wide {
  grid-row: span 2;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.panel-head-stack {
  align-items: flex-start;
}

.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  padding: 11px 16px;
  background: var(--accent-soft);
  color: var(--accent);
  font: inherit;
  cursor: pointer;
  text-decoration: none;
}

.route-list,
.exception-list,
.vehicle-list,
.alert-list,
.route-table {
  display: grid;
  gap: 12px;
}

.operations-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(340px, 0.9fr);
  gap: 18px;
}

.operations-main {
  display: grid;
  gap: 18px;
}

.operations-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.compact-card {
  padding: 18px;
  border-radius: var(--radius-lg);
}

.route-item,
.exception-item,
.vehicle-list li,
.alert-list li {
  list-style: none;
}

.route-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 16px 18px;
  border-radius: var(--radius);
  background: var(--panel-strong);
  border: 1px solid var(--line);
}

.exception-item {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: 14px;
  padding: 16px 18px;
  border-radius: var(--radius);
  background: var(--panel-strong);
  border: 1px solid var(--line);
}

.exception-title {
  margin: 0 0 4px;
  font-weight: 700;
}

.exception-meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.route-name {
  margin: 0 0 4px;
  font-weight: 700;
}

.route-meta {
  margin: 0;
  font-size: 0.92rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 86px;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.82rem;
}

.pill.success {
  background: var(--pill-success-bg);
  color: var(--pill-success-text);
}

.pill.warn {
  background: var(--pill-warn-bg);
  color: var(--pill-warn-text);
}

.pill.idle {
  background: var(--pill-idle-bg);
  color: var(--pill-idle-text);
}

.pill.live {
  background: var(--pill-live-bg);
  color: var(--pill-live-text);
  box-shadow: inset 0 0 0 1px rgba(13, 122, 103, 0.14);
}

.pill.attention {
  background: var(--pill-attention-bg);
  color: var(--pill-attention-text);
  box-shadow: inset 0 0 0 1px rgba(209, 78, 50, 0.14);
}

.vehicle-list li,
.alert-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.alert-list li {
  display: block;
}

.login-body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Bovenbalk in dezelfde stijl als de menubalk op de andere pagina's */
.login-topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px 18px;
  background: linear-gradient(180deg, var(--bg-gradient-top) 0%, var(--panel-soft) 100%);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 2px 10px rgba(20, 40, 38, 0.06);
}
.login-topbar-logo {
  height: 34px;
  width: auto;
  display: block;
}
.login-topbar-status {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}
.login-topbar-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #2d7d4f;
  box-shadow: 0 0 0 3px rgba(45, 125, 79, 0.16);
}

.login-main {
  flex: 1;
  display: grid;
  place-items: center;
  padding: 32px 24px;
}

/* Inlogkaart in dezelfde witte-paneel-stijl als het dashboard */
.login-card {
  width: min(460px, 100%);
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow);
  padding: 32px;
}
.login-card-logo {
  display: block;
  width: 100%;
  max-width: 260px;
  height: auto;
  margin: 0 auto 22px;
  background: #fff;
  padding: 14px 18px;
  border-radius: 18px;
}
.login-intro {
  color: var(--muted);
  margin: 6px 0 22px;
}

.login-shell {
  width: min(1120px, 100%);
  display: grid;
  grid-template-columns: 1.15fr 0.95fr;
  gap: 24px;
}

.login-panel {
  border-radius: 32px;
  background: var(--panel);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow);
  padding: 32px;
}

.login-panel-brand {
  background:
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.2), transparent 32%),
    linear-gradient(145deg, var(--accent-gradient-start), var(--accent-gradient-end));
  color: #fff;
}

.login-panel-brand .eyebrow,
.login-panel-brand .hero-copy,
.login-feature span {
  color: rgba(255, 255, 255, 0.8);
}

.login-feature-list {
  margin-top: 28px;
  display: grid;
  gap: 16px;
}

.login-feature {
  padding: 18px 20px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.login-feature strong,
.login-feature span {
  display: block;
}

.login-feature strong {
  margin-bottom: 6px;
}

.login-form {
  display: grid;
  gap: 18px;
}

.field {
  display: grid;
  gap: 8px;
  font-weight: 600;
}

.field input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px 18px;
  font: inherit;
  background: var(--panel-strong);
}

.field input:focus {
  outline: 2px solid rgba(13, 122, 103, 0.18);
  border-color: rgba(13, 122, 103, 0.3);
}

.auth-callout {
  display: grid;
  gap: 8px;
  color: var(--muted);
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
}

.primary-button {
  border: 0;
  border-radius: 18px;
  padding: 16px 18px;
  font: inherit;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, var(--accent-gradient-start), var(--accent-gradient-end));
  cursor: pointer;
  box-shadow: 0 16px 30px rgba(13, 122, 103, 0.18);
}

.google-button {
  min-height: 56px;
}

.auth-status {
  min-height: 24px;
  margin: 0;
  color: var(--muted);
  font-size: 0.94rem;
}

.session-user {
  margin: 0 0 6px;
  font-weight: 800;
}

.session-email {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 0.92rem;
}

.session-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 14px;
  background: var(--panel-strong);
  color: var(--text);
  font: inherit;
  cursor: pointer;
  text-decoration: none;
}

.session-empty {
  color: var(--muted);
  margin: 0;
}

.form-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.toolbar {
  margin: 24px 0 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.filter-pills {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.filter-pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 16px;
  background: var(--panel-strong);
  font: inherit;
  color: var(--text);
  cursor: pointer;
}

.filter-pill.active {
  border-color: transparent;
  background: var(--accent);
  color: #fff;
}

.filter-toolbar {
  flex-direction: column;
  align-items: stretch;
  gap: 14px;
}

.filter-toolbar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.filter-toolbar-controls {
  justify-content: flex-start;
  align-items: end;
}

.filter-field {
  gap: 6px;
  min-width: 160px;
  font-size: 0.86rem;
}

.filter-field-date {
  min-width: 140px;
}

.filter-field select,
.filter-field input[type="date"] {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  font: inherit;
  background: rgba(255, 255, 255, 0.95);
}

.filter-field select:focus,
.filter-field input[type="date"]:focus {
  outline: 2px solid rgba(13, 122, 103, 0.18);
  border-color: rgba(13, 122, 103, 0.3);
}

.filter-reset-button {
  align-self: end;
}

.filter-active-chips {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-result-summary {
  margin: 0;
  min-height: 1.25rem;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 650;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 6px 8px 6px 12px;
  background: var(--panel-strong);
  border: 1px solid var(--line);
  font-size: 0.84rem;
  color: var(--text);
}

.filter-chip-remove {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  padding: 2px 4px;
}

.filter-chip-remove:hover {
  color: var(--text);
}

.filter-reset-all {
  border: 0;
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  padding: 6px 4px;
  text-decoration: underline;
}

@media (max-width: 720px) {
  .filter-toolbar-controls {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-field,
  .filter-reset-button {
    width: 100%;
  }
}

.route-table-item {
  display: grid;
  grid-template-columns: 1.4fr 0.9fr 0.8fr 0.8fr;
  gap: 12px;
  align-items: start;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: var(--panel-strong);
  border: 1px solid var(--line);
}

.route-table-head {
  color: var(--muted);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: transparent;
  border-style: dashed;
}

.route-table-item strong,
.route-table-item span {
  display: block;
}

.route-summary {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.route-thumb {
  width: 64px;
  height: 48px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--soft-gradient-start), var(--soft-gradient-end));
}

.route-thumb-placeholder {
  width: 64px;
  height: 48px;
  border-radius: 14px;
  border: 1px dashed var(--line);
  background: var(--panel-strong);
}

.route-thumb-stack {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.route-thumb-secondary {
  width: 100%;
  height: 40px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--soft-gradient-start), var(--soft-gradient-end));
}

.route-primary-alert {
  margin: 6px 0 0;
  font-size: 0.9rem;
  line-height: 1.3;
  color: var(--text);
  font-weight: 700;
}

.route-secondary-meta {
  color: var(--muted);
}

.route-card-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.route-focus-chip {
  display: inline-flex;
  align-items: center;
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.route-focus-chip-idle {
  background: var(--panel-soft);
  color: var(--muted);
}

.route-focus-chip-live,
.route-focus-chip-ok {
  background: var(--pill-live-bg);
  color: var(--pill-live-text);
}

.route-focus-chip-warn {
  background: var(--pill-attention-bg);
  color: var(--pill-attention-text);
}

.route-table-item.is-selected {
  border-color: rgba(13, 122, 103, 0.3);
  background: linear-gradient(180deg, var(--pill-live-bg), var(--panel));
}

.route-table-item.is-clickable {
  cursor: pointer;
}

.route-table-item.is-clickable:hover {
  border-color: rgba(13, 122, 103, 0.22);
  box-shadow: 0 14px 28px rgba(16, 44, 40, 0.08);
}

.route-table-stack {
  display: grid;
  gap: 6px;
}

.route-table-status {
  justify-items: start;
}

.route-card-footer {
  display: none;
}

.route-inline-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.route-progress-track {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: var(--panel-soft);
  overflow: hidden;
}

.route-progress-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent-gradient-start), var(--accent-gradient-mid));
}

.detail-pane {
  display: grid;
  gap: 18px;
  align-content: start;
  min-height: 480px;
}

.detail-focus {
  display: grid;
}

.detail-focus-card {
  display: grid;
  gap: 12px;
  padding: 16px 18px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--pill-live-bg), var(--panel));
}

.detail-focus-card strong,
.detail-focus-card span,
.detail-focus-card p {
  display: block;
}

.detail-focus-card p {
  margin: 0 0 6px;
}

.detail-focus-label {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.detail-focus-card strong {
  font-size: 1.1rem;
}

.detail-focus-card span {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.93rem;
}

.detail-focus-card-warn {
  border-color: rgba(209, 78, 50, 0.22);
  background: linear-gradient(180deg, var(--pill-attention-bg), var(--panel));
}

.detail-focus-card-live,
.detail-focus-card-ok {
  border-color: rgba(13, 122, 103, 0.18);
}

.detail-preview {
  min-height: 210px;
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--soft-gradient-start), var(--soft-gradient-end));
}

.detail-preview img {
  width: 100%;
  height: 210px;
  object-fit: cover;
  display: block;
}

.detail-preview-empty {
  min-height: 210px;
  display: grid;
  place-items: center;
  color: var(--muted);
  padding: 24px;
  text-align: center;
}

.detail-gallery,
.overview-gallery {
  display: grid;
  gap: 14px;
}

.overview-gallery {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.overview-gallery-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border-radius: 22px;
  background: var(--panel-strong);
  border: 1px solid var(--line);
}

.overview-gallery-photos {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}

.overview-gallery-photo,
.detail-gallery-photo {
  width: 100%;
  object-fit: cover;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--soft-gradient-start), var(--soft-gradient-end));
}

.overview-gallery-photo {
  height: 166px;
}

.overview-gallery-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.overview-gallery-meta strong,
.overview-gallery-meta span {
  display: block;
}

.overview-gallery-meta span {
  color: var(--muted);
  font-size: 0.9rem;
}

.detail-gallery {
  grid-template-columns: 1fr;
}

.detail-gallery-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: var(--panel-strong);
}

.detail-gallery-photos {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 8px;
}

.detail-gallery-photo {
  height: 160px;
}

.detail-gallery-caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 0.9rem;
}

.detail-map {
  height: 280px;
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--soft-gradient-start), var(--soft-gradient-end));
}

.map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  padding: 14px 16px;
  border-radius: 18px;
  background: var(--panel-strong);
  border: 1px solid var(--line);
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.9rem;
}

.legend-swatch {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  display: inline-block;
}

.legend-swatch-route {
  background: var(--accent-gradient-start);
}

.legend-swatch-track {
  background: #d14e32;
}

.legend-swatch-vehicle {
  background: #2563eb;
}

.legend-swatch-poi {
  background: #f1a43a;
}

.legend-swatch-marker-collection {
  background: #9f67ff;
}

.vehicle-marker {
  background: transparent;
  border: 0;
}

.vehicle-marker-dot {
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: #2563eb;
  border: 3px solid #ffffff;
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.35);
}

.photo-marker-wrapper {
  background: transparent;
  border: 0;
}

.photo-marker {
  width: 54px;
  height: 68px;
  position: relative;
}

.photo-marker img {
  width: 54px;
  height: 68px;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 10px 14px rgba(16, 44, 40, 0.24));
}

.detail-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.detail-stat-card {
  padding: 14px 16px;
  border-radius: 20px;
  background: var(--panel-strong);
  border: 1px solid var(--line);
}

.detail-stat-card strong,
.detail-stat-card span {
  display: block;
}

.detail-stat-card span {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 6px;
}

.detail-stat-card em {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.82rem;
  font-style: normal;
}

.detail-section {
  display: grid;
  gap: 10px;
}

.accordion-panel {
  border-radius: 20px;
  border: 1px solid var(--line);
  background: var(--panel-strong);
  padding: 0;
  overflow: hidden;
}

.accordion-summary {
  list-style: none;
  cursor: pointer;
  padding: 16px 18px;
  font-weight: 800;
}

.accordion-summary::-webkit-details-marker {
  display: none;
}

.accordion-summary::after {
  content: "+";
  float: right;
  color: var(--muted);
}

.accordion-panel[open] .accordion-summary::after {
  content: "−";
}

.accordion-panel .detail-list {
  padding: 0 12px 12px;
}

.detail-actions {
  display: grid;
  gap: 10px;
}

.detail-action-card {
  padding: 16px;
  border-radius: 18px;
  background: var(--panel-strong);
  border: 1px solid var(--line);
  box-shadow: 0 10px 22px rgba(16, 44, 40, 0.05);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.detail-action-copy {
  min-width: 0;
}

.detail-action-card strong,
.detail-action-card span {
  display: block;
}

.detail-action-card span {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.92rem;
}

.detail-action-card-warn {
  border-color: rgba(209, 78, 50, 0.2);
  background: linear-gradient(180deg, var(--pill-attention-bg), var(--panel));
}

.detail-action-button {
  border: 0;
  border-radius: 999px;
  padding: 10px 14px;
  background: var(--accent-soft);
  color: var(--accent);
  font: inherit;
  font-weight: 700;
  white-space: nowrap;
}

.detail-action-button-warn {
  background: var(--pill-attention-bg);
  color: var(--pill-attention-text);
}

.detail-action-state {
  min-height: 24px;
}

.detail-action-state span {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}

.detail-callout {
  border: 1px solid rgba(13, 122, 103, 0.14);
  background: linear-gradient(180deg, var(--pill-live-bg), var(--panel));
}

.detail-callout-warn {
  border-color: rgba(209, 78, 50, 0.2);
  background: linear-gradient(180deg, var(--pill-attention-bg), var(--panel));
}

.detail-callout-ok {
  border-color: rgba(13, 122, 103, 0.18);
}

.detail-section h4 {
  margin: 0;
}

.detail-health-hero {
  border-width: 1px;
}

.detail-health-hero-ok {
  border-color: rgba(13, 122, 103, 0.18);
  background: linear-gradient(180deg, var(--pill-live-bg), var(--panel));
}

.detail-health-hero-warn {
  border-color: rgba(209, 78, 50, 0.2);
  background: linear-gradient(180deg, var(--pill-attention-bg), var(--panel));
}

.detail-health-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.detail-health-label {
  color: var(--muted);
  font-size: 0.92rem;
}

.detail-health-value {
  text-align: right;
}

.detail-health-value-warn {
  color: var(--pill-attention-text);
}

.detail-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.micro-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border-radius: 999px;
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
}

.micro-badge.strong {
  background: var(--pill-live-bg);
  color: var(--pill-live-text);
}

.micro-badge.warn {
  background: var(--pill-attention-bg);
  color: var(--pill-attention-text);
}

.detail-list {
  display: grid;
  gap: 10px;
}

.detail-list-item {
  padding: 14px 16px;
  border-radius: 18px;
  background: var(--panel-strong);
  border: 1px solid var(--line);
}

.detail-list-item-with-thumb {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.detail-list-item strong,
.detail-list-item span {
  display: block;
}

.detail-list-item span {
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 4px;
}

.detail-marker-thumb,
.detail-marker-thumb-placeholder {
  width: 54px;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.detail-marker-thumb img {
  width: 54px;
  height: 68px;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 8px 12px rgba(16, 44, 40, 0.18));
}

.detail-marker-thumb-placeholder {
  border-radius: 16px;
  background: linear-gradient(180deg, var(--soft-gradient-start), var(--soft-gradient-end));
  border: 1px dashed var(--line);
}

@media (max-width: 980px) {
  .shell,
  .hero,
  .metrics,
  .grid,
  .login-shell {
    grid-template-columns: 1fr;
  }

  .operations-grid,
  .operations-strip {
    grid-template-columns: 1fr;
  }

  .overview-gallery,
  .detail-gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .detail-pane {
    order: 2;
    min-height: auto;
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .panel.wide {
    grid-row: auto;
  }

  .route-table-item {
    grid-template-columns: 1fr 1fr;
  }

  .route-table-status {
    grid-column: span 2;
  }

  .detail-stats {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    display: none;
  }

  .content {
    padding: 12px;
  }

  .sidebar-copy,
  .nav-section,
  .status-card,
  .hero-copy {
    display: none;
  }

  .hero {
    gap: 10px;
    margin-bottom: 6px;
  }

  .hero h2 {
    font-size: 1.45rem;
    line-height: 1.08;
    max-width: 11ch;
  }

  .hero-panel {
    padding: 12px 14px;
    border-radius: 18px;
  }

  .hero-panel-label,
  .hero-panel-meta {
    display: none;
  }

  .hero-panel-value {
    font-size: 1.6rem;
    line-height: 1.05;
  }

  .toolbar {
    position: sticky;
    top: 0;
    z-index: 15;
    margin: 0 -12px 8px;
    padding: 8px 12px 10px;
    backdrop-filter: blur(18px);
    background: rgba(238, 247, 245, 0.92);
    border-bottom: 1px solid rgba(16, 44, 40, 0.06);
  }

  .filter-pills {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .filter-pills::-webkit-scrollbar {
    display: none;
  }

  .ghost-button {
    display: none;
  }

  .operations-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .compact-card {
    padding: 12px 10px;
    border-radius: 16px;
  }

  .compact-card .metric-meta {
    display: none;
  }

  .compact-card .metric-value {
    font-size: 1.5rem;
  }

  .login-panel {
    padding: 22px;
  }

  .route-table-head {
    display: none;
  }

  .route-table-item {
    grid-template-columns: 1fr;
    padding: 12px;
    gap: 10px;
  }

  .route-summary {
    grid-template-columns: 58px minmax(0, 1fr);
    gap: 10px;
  }

  .route-table-status {
    grid-column: auto;
  }

  .route-stack-run,
  .route-stack-status {
    display: none;
  }

  .route-stack-progress {
    gap: 6px;
  }

  .route-primary-alert {
    font-size: 0.86rem;
    margin-top: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .route-card-topline {
    margin-bottom: 6px;
  }

  .route-secondary-meta {
    display: none;
  }

  .route-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding-top: 2px;
  }

  .route-card-link {
    color: var(--accent);
    font-size: 0.85rem;
    font-weight: 800;
  }

  .map-legend {
    display: none;
  }

  #objects-category,
  #markers-category {
    padding: 12px;
  }

  .route-thumb,
  .route-thumb-placeholder {
    width: 58px;
    height: 46px;
    border-radius: 10px;
  }

  .overview-gallery-photo,
  .detail-gallery-photo {
    height: 108px;
    border-radius: 12px;
  }

  .detail-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .detail-stat-card {
    padding: 12px 14px;
    border-radius: 16px;
  }

  .detail-stat-card span {
    font-size: 0.8rem;
  }

  .detail-stat-card strong {
    font-size: 1.1rem;
  }

  .detail-preview {
    display: none;
  }

  .detail-preview img,
  .detail-preview-empty {
    height: 180px;
    min-height: 180px;
  }

  .accordion-summary {
    padding: 12px 14px;
    font-size: 0.92rem;
  }

  .detail-action-card {
    padding: 12px;
    gap: 8px;
  }

  .detail-action-button {
    padding: 8px 11px;
    font-size: 0.8rem;
  }

  .overview-gallery {
    grid-template-columns: 1fr;
  }

  .detail-gallery {
    display: none;
  }

  .map-legend {
    display: none;
  }

  .detail-map {
    height: 210px;
  }

  .detail-section {
    gap: 8px;
  }

  .detail-pane {
    gap: 12px;
  }

  .detail-focus-card {
    padding: 14px;
    gap: 10px;
  }

  .detail-focus-card strong {
    font-size: 1rem;
  }

  .detail-focus-card span {
    font-size: 0.88rem;
  }

  .detail-badges,
  .route-inline-badges {
    gap: 6px;
  }

  .micro-badge {
    padding: 6px 9px;
    font-size: 0.76rem;
  }
}

/* User Management Styles */
.user-table {
  display: grid;
  gap: 12px;
}

.user-loading {
  text-align: center;
  padding: 40px 20px;
  color: var(--muted);
}

.user-loading i {
  margin-right: 8px;
}

.user-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 16px 18px;
  border-radius: var(--radius);
  background: var(--panel-strong);
  border: 1px solid var(--line);
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.user-item:hover {
  transform: translateY(-1px);
  border-color: rgba(13, 122, 103, 0.3);
  box-shadow: 0 10px 24px rgba(16, 44, 40, 0.08);
}

.user-item.active {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.user-item.inactive {
  opacity: 0.6;
}

.user-summary {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.user-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.user-info {
  min-width: 0;
}

.user-info strong {
  display: block;
  font-size: 1rem;
  margin-bottom: 2px;
}

.user-info span {
  display: block;
  color: var(--muted);
  font-size: 0.88rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-item-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.user-item-actions button {
  border: 0;
  border-radius: 999px;
  padding: 8px 12px;
  background: var(--panel-strong);
  color: var(--text);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.16s ease;
}

.user-item-actions button:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

.user-item-actions button.deactivate {
  color: var(--pill-attention-text);
}

.user-item-actions button.deactivate:hover {
  background: var(--pill-attention-bg);
}

.user-item-actions button.activate {
  color: var(--pill-success-text);
}

.user-item-actions button.activate:hover {
  background: var(--pill-success-bg);
}

/* User Detail Panel */
.user-detail-content {
  margin-bottom: 20px;
}

.user-detail-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--muted);
}

.user-detail-empty i {
  font-size: 3rem;
  margin-bottom: 12px;
  opacity: 0.4;
}

.user-detail-card {
  padding: 18px;
  border-radius: 20px;
  background: var(--panel-strong);
  border: 1px solid var(--line);
}

.user-detail-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.user-detail-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.5rem;
}

.user-detail-header-info strong {
  display: block;
  font-size: 1.2rem;
  margin-bottom: 4px;
}

.user-detail-header-info span {
  color: var(--muted);
  font-size: 0.92rem;
}

.user-detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.user-detail-row:last-child {
  border-bottom: none;
}

.user-detail-row span:first-child {
  color: var(--muted);
  font-size: 0.88rem;
}

.user-detail-row span:last-child {
  font-weight: 600;
}

/* Modal Styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal-content {
  background: var(--panel-strong);
  border-radius: 28px;
  box-shadow: var(--shadow);
  max-width: 480px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
}

.modal-header h3 {
  margin: 0;
  font-size: 1.2rem;
}

.modal-close {
  border: 0;
  background: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--muted);
  padding: 4px 8px;
  border-radius: 8px;
  transition: background 0.16s ease;
}

.modal-close:hover {
  background: var(--line);
}

.modal-form {
  padding: 24px;
  display: grid;
  gap: 18px;
}

.modal-form .field {
  display: grid;
  gap: 8px;
  font-weight: 600;
}

.modal-form .field input,
.modal-form .field select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 16px;
  font: inherit;
  background: var(--panel-strong);
}

.modal-form .field input:focus,
.modal-form .field select:focus {
  outline: 2px solid rgba(13, 122, 103, 0.18);
  border-color: rgba(13, 122, 103, 0.3);
}

.modal-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 8px;
}

.modal-actions .primary-button {
  border: 0;
  border-radius: 18px;
  padding: 14px 20px;
  font: inherit;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, var(--accent-gradient-start), var(--accent-gradient-end));
  cursor: pointer;
  box-shadow: 0 16px 30px rgba(13, 122, 103, 0.18);
}

.modal-actions .secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 14px 18px;
  background: var(--panel-strong);
  color: var(--text);
  font: inherit;
  cursor: pointer;
  text-decoration: none;
}

/* User role pills */
.pill.chauffeur {
  background: var(--pill-idle-bg);
  color: var(--pill-idle-text);
}

.pill.beheerder {
  background: var(--pill-success-bg);
  color: var(--pill-success-text);
}

.pill.inactive {
  background: var(--pill-attention-bg);
  color: var(--pill-attention-text);
}

/* Objectlogboek (#96) */
.toolbar-search {
  flex: 1 1 260px;
  min-width: 200px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 14px;
  font: inherit;
  color: inherit;
  background: var(--panel);
}

.toolbar-search:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(47, 109, 246, 0.15);
}

.notice {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 18px;
  background: var(--pill-warn-bg);
  color: var(--pill-warn-text);
  font-weight: 600;
}

.objectlog-group {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px 20px;
  margin-bottom: 16px;
  background: var(--panel);
}

.objectlog-body {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin-top: 12px;
  flex-wrap: wrap;
}

.objectlog-thumb {
  flex: 0 0 auto;
  width: 220px;
  max-width: 100%;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--panel-soft);
}

.objectlog-thumb img {
  display: block;
  width: 100%;
  height: 120px;
  object-fit: cover;
}

.objectlog-entries {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1 1 260px;
  min-width: 240px;
}

.objectlog-entry {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.objectlog-entry:first-child {
  border-top: none;
}

.objectlog-entry time {
  white-space: nowrap;
  flex: 0 0 auto;
}

.objectlog-entry-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.objectlog-entry-name {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.objectlog-note {
  display: block;
}

/* Login: logo-kaart in het brand-paneel (logo heeft witte achtergrond) */
.login-logo-card {
  display: inline-block;
  background: #ffffff;
  border-radius: 18px;
  padding: 16px 20px;
  box-shadow: 0 10px 26px rgba(16, 44, 40, 0.18);
  margin-bottom: 22px;
}
.login-logo-card img {
  display: block;
  width: 100%;
  max-width: 280px;
  height: auto;
}

/* Kaart: label met de uitvoerder van de route (beheerder-weergave) */
.route-executor-label {
  background: rgba(13, 122, 103, 0.95);
  color: #ffffff;
  border: 0;
  border-radius: 999px;
  padding: 5px 12px;
  font-weight: 700;
  font-size: 12px;
  box-shadow: 0 4px 12px rgba(16, 44, 40, 0.28);
  white-space: nowrap;
}
.route-executor-label strong { font-weight: 800; }
.route-executor-label::before { display: none; }

/* ── Compacter (2026-07-11) ──────────────────────────────────────────────
   Kleinere tegels, minder witruimte, alles dichter op elkaar en hoger.
   Staat bewust als laatste blok zodat het de ruimere basiswaarden overschrijft. */
.content { padding: 16px 20px; }
.hero { gap: 14px; align-items: start; }
.hero h2 { font-size: 1.35rem; line-height: 1.2; }
.hero-copy { font-size: 0.85rem; line-height: 1.35; }
.hero-panel { padding: 14px 16px; border-radius: 16px; }
.toolbar { margin-top: 14px; }
.operations-grid { gap: 12px; }
.operations-main { gap: 12px; }
.operations-strip { gap: 10px; }
.metric-card { padding: 12px 14px; border-radius: 16px; }
.compact-card { padding: 10px 12px; border-radius: 14px; }
.metric-label { margin: 0 0 2px; font-size: 0.72rem; }
.metric-value { font-size: 1.4rem; }
.metric-meta { font-size: 0.76rem; }
.panel { padding: 14px 16px; border-radius: 16px; }
.metrics { margin-top: 14px; gap: 12px; }
.grid { margin-top: 14px; gap: 12px; }
.status-card { padding: 14px; border-radius: 16px; }
.session-card, .auth-callout { padding: 14px; border-radius: 16px; }
.route-item, .exception-item { padding: 11px 13px; border-radius: 14px; }
.media-panel, .exception-panel { margin-top: 14px; }

/* Toewijzen via pop-up (#211) */
.modal-form .field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 16px;
  font: inherit;
  background: var(--panel-strong);
  resize: vertical;
}

.modal-form .field textarea:focus {
  outline: 2px solid rgba(13, 122, 103, 0.18);
  border-color: rgba(13, 122, 103, 0.3);
}

.route-modal-summary {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(13, 122, 103, 0.06);
}

.route-modal-hint {
  color: var(--muted);
  font-weight: 500;
  font-size: 0.82rem;
}

.route-modal-state {
  margin: 0;
  min-height: 1.2em;
  color: var(--accent);
  font-weight: 600;
  font-size: 0.9rem;
}

.assignment-modal-content .modal-actions {
  flex-wrap: wrap;
}

.assignment-remove-button {
  border-color: rgba(209, 78, 50, 0.4);
  color: #d14e32;
}

.assignment-current-active {
  color: var(--accent);
  font-weight: 700;
}

.assign-trigger {
  padding: 8px 14px;
  font-size: 0.85rem;
  font-weight: 700;
  white-space: nowrap;
}

.route-stack-status .assign-trigger {
  align-self: flex-start;
  margin-top: 6px;
}

.detail-list-item-with-thumb .point-assign-button {
  margin-left: auto;
  align-self: center;
}

.leaflet-popup-content .assign-trigger {
  margin-top: 6px;
}

/* Bulk-selectie van punten (#200) */
.point-select-label {
  display: inline-flex;
  align-items: center;
  align-self: center;
  padding: 4px;
  cursor: pointer;
}

.point-select-label input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: var(--accent-gradient-start);
  cursor: pointer;
}

.bulk-select-bar {
  gap: 12px;
  flex-wrap: wrap;
}

.bulk-select-bar-empty {
  opacity: 0.75;
}

.bulk-select-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.bulk-select-buttons button[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Thema-toggle (issue #228): vaste knop rechtsonder, door app.js in <body>
   gezet zodra het script laadt, op elke pagina die app.js gebruikt. */
.theme-toggle-button {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 40;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  padding: 10px 16px;
  background: var(--panel-strong);
  color: var(--text);
  font: inherit;
  font-weight: 700;
  font-size: 0.86rem;
  box-shadow: var(--shadow);
  cursor: pointer;
}

.theme-toggle-button:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Taalwissel-knop (issue #227) */
.language-toggle-button {
  position: fixed;
  bottom: 80px;
  right: 20px;
  border: 1px solid var(--line-strong);
  background: var(--panel);
  color: var(--text);
  padding: 8px 12px;
  border-radius: var(--radius-pill);
  z-index: 999;
  font: inherit;
  font-weight: 700;
  font-size: 0.86rem;
  box-shadow: var(--shadow);
  cursor: pointer;
}

.language-toggle-button:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Geavanceerde filters (issue #220) */
.advanced-filter-button {
  padding: 8px 12px;
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  color: var(--text);
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.advanced-filter-button:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.advanced-filter-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.advanced-filter-modal.open {
  opacity: 1;
  pointer-events: auto;
}

.filter-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  cursor: pointer;
}

.filter-dialog {
  position: relative;
  background: var(--panel);
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  max-width: 480px;
  width: 90%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  z-index: 10;
}

.filter-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px;
  border-bottom: 1px solid var(--line);
}

.filter-header h3 {
  margin: 0;
  font-size: 1.1rem;
  color: var(--text);
}

.close-button {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--muted);
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  transition: all 0.2s ease;
}

.close-button:hover {
  background: var(--panel-soft);
  color: var(--text);
}

.filter-content {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: grid;
  gap: 20px;
}

.filter-group {
  display: grid;
  gap: 6px;
}

.filter-group label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
}

.filter-group select,
.filter-group input[type="text"],
.filter-group input[type="date"] {
  padding: 8px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--text);
  font-size: 0.875rem;
  font-family: inherit;
}

.filter-group select:focus,
.filter-group input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.date-range {
  display: flex;
  align-items: center;
  gap: 10px;
}

.date-range input {
  flex: 1;
}

.date-sep {
  color: var(--muted);
  font-weight: 600;
}

.filter-footer {
  display: flex;
  gap: 10px;
  padding: 20px;
  border-top: 1px solid var(--line);
  background: var(--panel-soft);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.primary-button,
.secondary-button {
  flex: 1;
  padding: 10px 16px;
  border: none;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.primary-button {
  background: var(--accent);
  color: white;
}

.primary-button:hover {
  background: var(--accent-hover);
}

.secondary-button {
  background: transparent;
  border: 1px solid var(--line-strong);
  color: var(--text);
}

.secondary-button:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Enhanced button system (issue #312) */
button,
.btn {
  font-weight: 600;
  font-size: 0.95rem;
  padding: 10px 16px;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.btn-primary,
.btn-primary:is(button) {
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  color: white;
  box-shadow: 0 4px 12px rgba(12, 115, 97, 0.2);
}

.btn-primary:hover,
.btn-primary:is(button):hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(12, 115, 97, 0.3);
}

.btn-secondary,
.btn-secondary:is(button) {
  background: var(--panel);
  color: var(--accent);
  border: 1.5px solid var(--accent);
}

.btn-secondary:hover,
.btn-secondary:is(button):hover {
  background: var(--accent-soft);
}

.btn-ghost,
.btn-ghost:is(button) {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--line-strong);
}

.btn-ghost:hover,
.btn-ghost:is(button):hover {
  background: var(--panel-soft);
  border-color: var(--accent);
}

.btn-danger,
.btn-danger:is(button) {
  background: var(--warning-soft);
  color: var(--warning);
  border: 1px solid rgba(185, 80, 39, 0.3);
}

.btn-danger:hover,
.btn-danger:is(button):hover {
  background: rgba(185, 80, 39, 0.15);
  border-color: var(--warning);
}

.btn-small {
  padding: 6px 12px;
  font-size: 0.85rem;
}

.btn-large {
  padding: 14px 24px;
  font-size: 1rem;
}

.btn-full {
  width: 100%;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

/* Professionele form-element styling (issue #312) */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="time"],
textarea,
select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  transition: all 0.2s ease;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
input[type="time"]:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  background: var(--panel-strong);
}

input::placeholder {
  color: var(--muted);
  opacity: 0.7;
}

/* Status badges (issue #312) */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.status-badge.success {
  background: var(--pill-success-bg);
  color: var(--pill-success-text);
}

.status-badge.warning {
  background: var(--pill-warn-bg);
  color: var(--pill-warn-text);
}

.status-badge.idle {
  background: var(--pill-idle-bg);
  color: var(--pill-idle-text);
}

.status-badge.live {
  background: var(--pill-live-bg);
  color: var(--pill-live-text);
  animation: pulse 2s ease-in-out infinite;
}

.status-badge.attention {
  background: var(--pill-attention-bg);
  color: var(--pill-attention-text);
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* Card styling verbetering (issue #312) */
.card,
.panel,
.modal-form {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.card:hover,
.panel:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-body {
  padding: 20px;
}

.card-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--line);
  background: var(--panel-soft);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* Empty state styling (issue #312) */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-state-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}

.empty-state-text {
  font-size: 0.95rem;
  line-height: 1.6;
}

/* Loading skeleton (issue #312) */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--panel-soft) 0%,
    var(--panel-strong) 50%,
    var(--panel-soft) 100%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius);
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Enhanced modal/dialog styling (issue #312) */
.modal,
.dialog {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-backdrop,
.dialog-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.modal.open .modal-backdrop,
.dialog.open .dialog-backdrop {
  opacity: 1;
}

.modal-content,
.dialog-content {
  position: relative;
  background: var(--panel);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow: auto;
  transform: scale(0.95) translateY(20px);
  transition: all 0.2s ease;
  z-index: 10;
}

.modal.open .modal-content,
.dialog.open .dialog-content {
  transform: scale(1) translateY(0);
}

.modal-header,
.dialog-header {
  padding: 24px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title,
.dialog-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}

.modal-body,
.dialog-body {
  padding: 24px;
}

/* Data table styling (issue #312) */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

thead th {
  text-align: left;
  padding: 12px 16px;
  font-weight: 700;
  background: var(--panel-soft);
  border-bottom: 1px solid var(--line-strong);
  color: var(--text);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

tbody td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

tbody tr {
  transition: background-color 0.2s ease;
}

tbody tr:hover {
  background: var(--panel-soft);
}

tbody tr:last-child td {
  border-bottom: none;
}

/* List styling (issue #312) */
.list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.list-item {
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  transition: all 0.2s ease;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.list-item:hover {
  border-color: var(--accent);
  background: var(--panel-strong);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.list-item-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.list-item-title {
  font-weight: 600;
  color: var(--text);
}

.list-item-subtitle {
  font-size: 0.85rem;
  color: var(--muted);
}

.list-item-meta {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}

/* Responsive improvements (issue #312) */
@media (max-width: 768px) {
  h1 { font-size: 1.5rem; }
  h2 { font-size: 1.2rem; }
  h3 { font-size: 1rem; }

  .modal-content,
  .dialog-content {
    width: 95%;
    max-height: 95vh;
  }

  button,
  .btn {
    font-size: 0.9rem;
    padding: 8px 12px;
  }

  table {
    font-size: 0.85rem;
  }

  thead th,
  tbody td {
    padding: 8px 12px;
  }

  .list-item {
    flex-direction: column;
    align-items: flex-start;
  }

  .list-item-meta {
    width: 100%;
    margin-top: 8px;
  }
}

@media (max-width: 480px) {
  h1 { font-size: 1.25rem; }
  h2 { font-size: 1rem; }

  body {
    font-size: 0.95rem;
  }

  table {
    font-size: 0.8rem;
  }

  thead th,
  tbody td {
    padding: 6px 8px;
  }
}

/* ============================================================================
   COCKPIT SECTION — Dagstart-cockpit voor dagelijks beheer
   ============================================================================ */

.cockpit-section {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 20px;
  margin-bottom: 18px;
  animation: slideInDown 0.3s ease;
}

@keyframes slideInDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.cockpit-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.cockpit-title {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
}

.cockpit-subtitle {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.cockpit-close-btn {
  background: transparent;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--muted);
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: background-color 0.2s ease, color 0.2s ease;
}

.cockpit-close-btn:hover {
  background-color: var(--line);
  color: var(--text);
}

.cockpit-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}

.cockpit-stat-card {
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 16px;
  display: grid;
  gap: 8px;
  text-align: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  border-left: 4px solid transparent;
}

.cockpit-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.cockpit-stat-card.alert {
  border-left-color: var(--accent);
  background: rgba(12, 115, 97, 0.05);
}

.cockpit-stat-card.warning {
  border-left-color: var(--warning);
  background: rgba(185, 80, 39, 0.05);
}

.stat-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 600;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text);
}

.stat-meta {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.4;
}

.cockpit-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.cockpit-actions button {
  min-width: 140px;
}

.cockpit-details {
  border-top: 1px solid var(--line);
  padding-top: 20px;
  display: grid;
  gap: 16px;
}

.details-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}

.details-tab-btn {
  background: transparent;
  border: none;
  padding: 12px 16px;
  cursor: pointer;
  color: var(--muted);
  font-weight: 600;
  font-size: 14px;
  border-bottom: 3px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.details-tab-btn:hover {
  color: var(--text);
}

.details-tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.details-tab-content {
  display: none;
}

.details-tab-content.active {
  display: block;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.cockpit-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.cockpit-table thead {
  background: var(--panel-soft);
  border-bottom: 1px solid var(--line);
}

.cockpit-table th {
  padding: 12px;
  text-align: left;
  font-weight: 600;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.cockpit-table td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  color: var(--text);
}

.cockpit-table tbody tr:hover {
  background: var(--panel-soft);
}

.cockpit-table .action-btn {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--accent);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.cockpit-table .action-btn:hover {
  background-color: var(--accent-soft);
  color: var(--accent-hover);
}

/* ============================================================================
   SYNC STATUS INDICATOR — Topbar sync status
   ============================================================================ */

.sync-status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: var(--radius-pill);
  background: var(--panel);
  border: 1px solid var(--line);
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.sync-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  font-size: 12px;
  flex-shrink: 0;
}

.sync-dot.sync-dot-synced {
  color: var(--success);
}

.sync-dot.sync-dot-syncing {
  color: var(--info);
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.sync-dot.sync-dot-offline {
  color: var(--warning);
}

.sync-dot.sync-dot-error {
  color: var(--warning);
  animation: pulse 0.8s infinite;
}

.sync-text {
  color: inherit;
}

/* ============================================================================
   OUTBOX DRAWER — Synchronisatie wachtrij en status
   ============================================================================ */

.outbox-drawer {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-bottom: 18px;
}

.outbox-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  user-select: none;
  transition: background-color 0.2s ease;
}

.outbox-header:hover {
  background-color: var(--panel-soft);
}

.outbox-title {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1rem;
  font-weight: 600;
}

.sync-indicator-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  font-size: 14px;
  border-radius: 50%;
  background: rgba(21, 127, 74, 0.1);
}

.outbox-toggle-btn {
  background: transparent;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: var(--muted);
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, color 0.2s ease;
}

.outbox-toggle-btn:hover {
  color: var(--text);
}

.outbox-toggle-btn.open {
  transform: rotate(180deg);
}

.outbox-content {
  padding: 16px;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 16px;
}

.outbox-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}

.outbox-summary-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  background: var(--panel-soft);
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
}

.summary-icon {
  font-size: 18px;
  flex-shrink: 0;
}

.summary-text {
  font-size: 14px;
  color: var(--text);
  flex: 1;
}

.summary-text strong {
  font-weight: 700;
}

.summary-size {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

.outbox-list {
  display: grid;
  gap: 8px;
  max-height: 300px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 8px;
}

.outbox-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  background: var(--panel-soft);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--line);
  font-size: 13px;
}

.outbox-item.error {
  border-left-color: var(--warning);
  background: rgba(185, 80, 39, 0.05);
}

.outbox-item.syncing {
  border-left-color: var(--info);
  background: rgba(31, 95, 176, 0.05);
}

.outbox-item.completed {
  border-left-color: var(--success);
  background: rgba(21, 127, 74, 0.05);
}

.outbox-item-icon {
  font-size: 16px;
  flex-shrink: 0;
}

.outbox-item-text {
  flex: 1;
  color: var(--text);
}

.outbox-item-time {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

.outbox-item-error {
  color: var(--warning);
  font-size: 12px;
  margin-top: 4px;
}

.outbox-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.outbox-actions button {
  flex: 1;
  min-width: 140px;
  font-size: 14px;
  padding: 10px 16px;
}

/* ============================================================================
   DARK MODE ADJUSTMENTS FOR COCKPIT & OUTBOX
   ============================================================================ */

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --cockpit-stat-bg: rgba(12, 115, 97, 0.15);
  }

  .cockpit-stat-card.alert {
    background: rgba(12, 115, 97, 0.1);
  }

  .cockpit-stat-card.warning {
    background: rgba(185, 80, 39, 0.1);
  }

  .outbox-item.error {
    background: rgba(185, 80, 39, 0.1);
  }

  .outbox-item.syncing {
    background: rgba(31, 95, 176, 0.1);
  }

  .outbox-item.completed {
    background: rgba(21, 127, 74, 0.1);
  }
}

/* ============================================================================
   RESPONSIVE ADJUSTMENTS
   ============================================================================ */

@media (max-width: 768px) {
  .cockpit-section {
    padding: 16px;
    gap: 16px;
  }

  .cockpit-stats {
    grid-template-columns: 1fr;
  }

  .cockpit-actions {
    justify-content: stretch;
  }

  .cockpit-actions button {
    flex: 1;
  }

  .cockpit-table {
    font-size: 12px;
  }

  .cockpit-table th,
  .cockpit-table td {
    padding: 8px;
  }

  .details-tabs {
    gap: 4px;
  }

  .details-tab-btn {
    padding: 8px 12px;
    font-size: 12px;
  }

  .outbox-summary {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 480px) {
  .cockpit-section {
    padding: 12px;
  }

  .cockpit-title {
    font-size: 1.1rem;
  }

  .cockpit-header {
    flex-direction: column;
  }

  .cockpit-close-btn {
    align-self: flex-end;
  }

  .stat-value {
    font-size: 1.5rem;
  }

  .cockpit-actions {
    flex-direction: column;
  }

  .cockpit-actions button {
    width: 100%;
  }

  .outbox-summary {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .outbox-summary-item {
    padding: 8px;
    font-size: 12px;
  }

  .summary-icon {
    font-size: 16px;
  }

  .cockpit-table {
    font-size: 11px;
  }

  .cockpit-table th,
  .cockpit-table td {
    padding: 6px;
  }

  .details-tab-btn {
    padding: 8px 10px;
    font-size: 11px;
  }
}


/* index.html extracted inline styles (issue #345 regression fix) */
        :root {
            --bg: #eef3f1;
            --panel: #ffffff;
            --panel-strong: #ffffff;
            --line: rgba(20, 42, 35, 0.10);
            --line-strong: rgba(20, 42, 35, 0.16);
            --text: #16231e;
            --muted: #5c6f68;
            --primary: #0c7361;
            --primary-soft: #dcefe9;
            --accent: #0c7361;
            --accent-hover: #0a5f50;
            --accent-soft: #dcefe9;
            --warning: #9a5a12;
            --warning-soft: #fbeccd;
            --info: #1f5fb0;
            --info-soft: #dcebfb;
            --success: #157f4a;
            --shadow: 0 1px 2px rgba(16, 40, 34, 0.05), 0 10px 24px rgba(16, 40, 34, 0.07);
            --shadow-sm: 0 1px 2px rgba(16, 40, 34, 0.06);
            /* Consistente radius-schaal, gelijk aan style.css */
            --radius-xl: 18px;
            --radius-lg: 18px;
            --radius-md: 14px;
            --radius-sm: 10px;
        }

        * {
            box-sizing: border-box;
        }

        body {
            margin: 0;
            font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
            color: var(--text);
            -webkit-font-smoothing: antialiased;
            text-rendering: optimizeLegibility;
            background:
                radial-gradient(circle at top right, rgba(12, 115, 97, 0.09), transparent 30%),
                linear-gradient(180deg, var(--bg-gradient-top) 0%, var(--bg) 100%);
        }

        button,
        input,
        textarea,
        select {
            font: inherit;
        }

        .app-shell {
            min-height: 100vh;
            padding: 24px;
        }

        .layout-shell {
            max-width: 1760px;
            margin: 0 auto;
            display: grid;
            grid-template-columns: 280px minmax(0, 1fr);
            gap: 18px;
            align-items: start;
        }

        .sidebar-nav {
            position: sticky;
            top: 24px;
            background: var(--panel);
            border: 1px solid var(--line);
            box-shadow: var(--shadow);
            border-radius: var(--radius-xl);
            padding: 18px;
            display: grid;
            gap: 16px;
        }

        .sidebar-brand {
            display: grid;
            gap: 8px;
            padding-bottom: 14px;
            border-bottom: 1px solid var(--line);
        }

        .sidebar-brand strong {
            font-size: 22px;
            line-height: 1.15;
        }

        .sidebar-brand span {
            color: var(--muted);
            font-size: 14px;
            line-height: 1.5;
        }

        .nav-menu,
        .mobile-nav-menu {
            display: grid;
            gap: 10px;
        }

        .nav-link,
        .mobile-nav-link {
            border: 1px solid rgba(35, 79, 63, 0.1);
            background: var(--panel);
            border-radius: 16px;
            padding: 12px 14px;
            color: var(--text);
            cursor: pointer;
            display: flex;
            align-items: center;
            gap: 12px;
            font-weight: 700;
            transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
        }

        .nav-link span,
        .mobile-nav-link span {
            color: var(--muted);
            font-size: 13px;
            font-weight: 500;
        }

        .nav-link:hover,
        .mobile-nav-link:hover,
        .nav-link.active,
        .mobile-nav-link.active {
            transform: translateY(-1px);
            border-color: rgba(35, 79, 63, 0.35);
            box-shadow: 0 10px 24px rgba(53, 43, 25, 0.08);
            background: linear-gradient(180deg, var(--panel), var(--panel-soft));
        }

        .mobile-nav {
            display: none;
            background: var(--panel);
            border: 1px solid var(--line);
            box-shadow: var(--shadow);
            border-radius: var(--radius-xl);
            padding: 12px;
            overflow-x: auto;
        }

        .mobile-nav-menu {
            display: flex;
            gap: 10px;
            min-width: max-content;
        }

        .mobile-nav-link {
            white-space: nowrap;
        }

        .overview-split-grid {
            display: grid;
            grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.6fr);
            gap: 18px;
            margin-top: 0;
        }

        .overview-half-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 18px;
            margin-top: 0;
        }

        .dashboard {
            display: grid;
            gap: 18px;
        }

        .page-view {
            display: none;
            gap: 18px;
        }

        .page-view.active {
            display: grid;
        }

        .topbar,
        .priority-strip,
        .workspace,
        .section-grid {
            background: var(--panel);
            backdrop-filter: blur(10px);
            border: 1px solid var(--line);
            box-shadow: var(--shadow);
        }

        .topbar {
            border-radius: var(--radius-xl);
            padding: 12px 20px;
            display: flex;
            flex-wrap: wrap;
            gap: 12px;
            align-items: center;
            justify-content: space-between;
        }

        .brand-kicker {
            display: inline-flex;
            align-items: center;
            gap: 10px;
            padding: 8px 14px;
            border-radius: 999px;
            background: rgba(35, 79, 63, 0.1);
            color: var(--primary);
            font-size: 13px;
            font-weight: 700;
            letter-spacing: 0.03em;
            text-transform: uppercase;
        }

        .brand-title {
            margin: 14px 0 10px;
            font-size: clamp(2rem, 3vw, 3.2rem);
            line-height: 1.05;
        }

        /* Bovenbalk-overlap (issue #345): .topbar-side stond op flex-shrink:0 en
           eiste al zijn contentbreedte op, waardoor de linkergroep tot ~89px
           werd samengedrukt. De status-chip daarin heeft flex-shrink:0 en liep
           dus buiten zijn container, dwars over de rechterkant heen. Door de
           rechterkant wél te laten krimpen (en intern te laten afbreken) houdt
           de linkergroep zijn ruimte en verdwijnt de overlap. */
        .topbar .brand-title {
            min-width: 0;
        }

        .topbar .topbar-side {
            flex-shrink: 1 !important;
            min-width: 0;
            flex-wrap: wrap;
        }

        /* De linkergroep stond op flex-basis 0 en kreeg dus alleen restruimte
           (~89px), te weinig voor titel + status-chip. Met basis auto telt zijn
           eigen contentbreedte mee, zodat de balk netjes afbreekt (.topbar heeft
           flex-wrap: wrap) in plaats van te overlappen. */
        .topbar > div:first-child {
            flex: 1 1 auto !important;
        }

        .brand-copy {
            margin: 0;
            max-width: 720px;
            color: var(--muted);
            font-size: 16px;
            line-height: 1.6;
        }

        .topbar-side {
            display: flex;
            align-items: center;
            gap: 12px;
            flex-wrap: wrap;
        }

        .status-row,
        .filters-row {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
            align-items: center;
        }

        .status-chip,
        .filter-chip {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            padding: 11px 14px;
            border-radius: 999px;
            border: 1px solid var(--line);
            background: var(--panel);
            color: var(--text);
        }

        .status-chip strong,
        .filter-chip strong {
            font-size: 13px;
        }

        .status-chip span,
        .filter-chip span {
            font-size: 13px;
            color: var(--muted);
        }

        .filter-chip select {
            border: none;
            background: transparent;
            color: var(--text);
            font-weight: 600;
            outline: none;
            min-width: 120px;
        }

        .hero-actions {
            display: flex;
            flex-wrap: wrap;
            gap: 12px;
            justify-content: flex-end;
        }

        .primary-btn,
        .secondary-btn,
        .danger-btn {
            border: none;
            cursor: pointer;
            border-radius: 999px;
            padding: 14px 20px;
            font-weight: 700;
            display: inline-flex;
            align-items: center;
            gap: 10px;
            transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
        }

        .primary-btn:hover,
        .secondary-btn:hover,
        .danger-btn:hover {
            transform: translateY(-1px);
        }

        .primary-btn {
            background: linear-gradient(135deg, var(--accent), var(--accent-gradient-mid));
            color: #fff;
            box-shadow: 0 16px 28px rgba(13, 122, 103, 0.24);
        }

        .secondary-btn {
            background: var(--panel);
            color: var(--primary);
            border: 1px solid rgba(35, 79, 63, 0.2);
        }

        .danger-btn {
            background: var(--warning-soft);
            color: var(--warning);
            border: 1px solid rgba(185, 80, 39, 0.2);
        }

        .priority-strip {
            border-radius: var(--radius-xl);
            padding: 18px;
            display: grid;
            grid-template-columns: repeat(4, minmax(0, 1fr));
            gap: 14px;
        }

        .priority-card {
            min-height: 140px;
            border-radius: var(--radius-lg);
            padding: 18px;
            border: 1px solid var(--line);
            background: var(--panel);
            box-shadow: var(--shadow-sm);
            display: grid;
            gap: 10px;
            cursor: pointer;
            transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
        }

        .priority-card:hover {
            transform: translateY(-1px);
            box-shadow: 0 10px 24px rgba(53, 43, 25, 0.08);
            border-color: rgba(35, 79, 63, 0.35);
        }

        .priority-card .eyebrow {
            font-size: 12px;
            text-transform: uppercase;
            letter-spacing: 0.08em;
            color: var(--muted);
            font-weight: 700;
        }

        .priority-card .value {
            font-size: 2.1rem;
            font-weight: 800;
            line-height: 1;
        }

        .priority-card .meta {
            color: var(--muted);
            line-height: 1.5;
            font-size: 14px;
        }

        /* Solide witte tegels met een subtiele semantische accentrand links,
           i.p.v. een pastel-gradient-wash — rustiger en professioneler. */
        .priority-card.alert {
            background: var(--panel);
            border-left: 3px solid var(--accent);
        }

        .priority-card.warning {
            background: var(--panel);
            border-left: 3px solid var(--warning);
        }

        .priority-card.info {
            background: var(--panel);
            border-left: 3px solid var(--info);
        }

        .priority-card.success {
            background: var(--panel);
            border-left: 3px solid var(--success);
        }

        .acceleration-board {
            background: var(--panel);
            border: 1px solid var(--line);
            border-radius: var(--radius-xl);
            padding: 20px;
            display: grid;
            gap: 16px;
            min-width: 0;
            overflow: hidden;
        }

        .acceleration-head {
            display: flex;
            align-items: flex-start;
            justify-content: space-between;
            gap: 16px;
            flex-wrap: wrap;
        }

        .acceleration-head h2 {
            margin: 0;
            font-size: 1.2rem;
        }

        .acceleration-grid {
            display: grid;
            grid-template-columns: repeat(7, minmax(150px, 1fr));
            gap: 10px;
        }

        .acceleration-item {
            background: var(--panel-strong);
            border: 1px solid var(--line);
            border-radius: var(--radius-md);
            padding: 12px;
            display: grid;
            gap: 9px;
            min-width: 0;
            overflow: hidden;
        }

        .acceleration-item strong {
            font-size: 13px;
            line-height: 1.25;
        }

        .acceleration-item span {
            color: var(--muted);
            font-size: 12px;
            line-height: 1.35;
        }

        .progress-track {
            height: 9px;
            border-radius: 999px;
            background: var(--accent-soft);
            overflow: hidden;
            min-width: 0;
        }

        .progress-fill {
            height: 100%;
            border-radius: inherit;
            background: var(--accent);
        }

        .acceleration-actions {
            display: flex;
            gap: 10px;
            flex-wrap: wrap;
        }

        .qr-box {
            display: grid;
            grid-template-columns: auto minmax(0, 1fr);
            gap: 16px;
            align-items: center;
        }

        .qr-frame {
            width: 132px;
            min-height: 132px;
            border-radius: 18px;
            background: var(--panel);
            border: 1px solid var(--line);
            display: grid;
            place-items: center;
            padding: 10px;
        }

        .qr-frame svg {
            width: 108px;
            height: 108px;
        }

        .mini-form-grid {
            display: grid;
            grid-template-columns: minmax(0, 1fr) auto;
            gap: 10px;
            align-items: end;
        }

        .mini-form-grid select,
        .mini-form-grid input {
            width: 100%;
            padding: 10px 12px;
            border: 1px solid var(--line);
            border-radius: var(--radius-md);
            background: var(--panel-strong);
            color: var(--text);
            outline: none;
        }

        .workspace {
            border-radius: var(--radius-xl);
            padding: 18px;
            display: grid;
            grid-template-columns: minmax(0, 1.65fr) minmax(320px, 0.8fr);
            gap: 18px;
            min-height: 480px;
        }

        .detail-main {
            min-width: 0;
            display: grid;
        }

        .map-panel,
        .context-panel,
        .section-card {
            background: var(--panel-strong);
            border: 1px solid var(--line);
            border-radius: var(--radius-lg);
            overflow: hidden;
        }

        .page-panel {
            display: none !important;
            min-width: 0;
        }

        .page-panel.active {
            display: grid !important;
        }

        .page-panel.section-card.active {
            min-height: 480px;
        }

        .map-panel {
            display: grid;
            grid-template-rows: auto auto minmax(420px, 1fr);
        }

        .panel-head {
            padding: 20px 22px 12px;
            display: flex;
            align-items: flex-start;
            justify-content: space-between;
            gap: 12px;
        }

        .panel-head h2,
        .panel-head h3 {
            margin: 0;
            font-size: 1.45rem;
        }

        .panel-copy {
            margin: 6px 0 0;
            color: var(--muted);
            font-size: 14px;
            line-height: 1.5;
        }

        .map-toolbar {
            display: flex;
            flex-wrap: wrap;
            gap: 10px;
            padding: 0 22px 16px;
        }

        .pill {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            padding: 10px 12px;
            border-radius: 999px;
            background: var(--panel);
            border: 1px solid var(--line);
            color: var(--text);
            font-size: 13px;
            font-weight: 600;
        }

        button.pill {
            cursor: pointer;
            transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
        }

        button.pill:hover {
            transform: translateY(-1px);
            border-color: rgba(35, 79, 63, 0.35);
            box-shadow: 0 10px 24px rgba(53, 43, 25, 0.08);
        }

        .pill strong {
            color: var(--primary);
        }

        #map {
            width: 100%;
            height: 100%;
            min-height: 420px;
        }

        .context-panel {
            display: grid;
            grid-template-rows: auto auto 1fr;
        }

        .context-summary {
            padding: 20px 22px 0;
            display: grid;
            gap: 12px;
        }

        .context-highlight {
            border-radius: var(--radius-md);
            padding: 16px;
            background: linear-gradient(135deg, rgba(35, 79, 63, 0.1), rgba(35, 79, 63, 0.04));
            border: 1px solid rgba(35, 79, 63, 0.14);
        }

        .context-highlight strong {
            display: block;
            margin-bottom: 8px;
            font-size: 18px;
        }

        .context-highlight p {
            margin: 0;
            color: var(--muted);
            font-size: 14px;
            line-height: 1.6;
        }

        .context-details {
            padding: 16px 22px 22px;
            overflow-y: auto;
            display: grid;
            gap: 14px;
        }

        .detail-card {
            border-radius: var(--radius-md);
            border: 1px solid var(--line);
            padding: 14px 16px;
            background: rgba(255, 255, 255, 0.88);
        }

        .detail-card h4 {
            margin: 0 0 8px;
            font-size: 14px;
            text-transform: uppercase;
            letter-spacing: 0.06em;
            color: var(--muted);
        }

        .detail-list {
            display: grid;
            gap: 8px;
            margin: 0;
        }

        .detail-row {
            display: flex;
            justify-content: space-between;
            gap: 12px;
            padding-bottom: 8px;
            border-bottom: 1px dashed var(--line);
        }

        .detail-row:last-child {
            border-bottom: none;
            padding-bottom: 0;
        }

        .detail-label {
            color: var(--muted);
            font-size: 13px;
        }

        .detail-value {
            text-align: right;
            font-weight: 600;
            font-size: 13px;
        }

        .context-actions {
            display: flex;
            flex-wrap: wrap;
            gap: 10px;
        }

        .section-grid {
            border-radius: var(--radius-xl);
            padding: 18px;
            display: grid;
            grid-template-columns: repeat(3, minmax(0, 1fr));
            gap: 18px;
        }

        .section-card {
            display: grid;
            grid-template-rows: auto 1fr;
            min-height: 200px;
        }

        .section-body {
            padding: 0 18px 18px;
            display: grid;
            gap: 12px;
            align-content: start;
        }

        .item-list {
            display: grid;
            gap: 10px;
        }

        .list-item {
            border: 1px solid var(--line);
            border-radius: var(--radius-md);
            padding: 10px 12px;
            background: rgba(255, 255, 255, 0.92);
            cursor: pointer;
            transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
        }

        .list-item:hover {
            transform: translateY(-1px);
            border-color: rgba(35, 79, 63, 0.35);
            box-shadow: 0 10px 24px rgba(53, 43, 25, 0.08);
        }

        .list-item.active {
            border-color: rgba(35, 79, 63, 0.55);
            box-shadow: inset 0 0 0 1px rgba(35, 79, 63, 0.16);
            background: linear-gradient(180deg, var(--panel), var(--panel-soft));
        }

        .item-layout {
            display: grid;
            grid-template-columns: 72px minmax(0, 1fr) auto;
            gap: 12px;
            align-items: center;
        }

        .preview-frame {
            border-radius: 14px;
            overflow: hidden;
            border: 1px solid var(--line);
            background: linear-gradient(180deg, var(--panel), var(--panel-soft, #f0e7db));
            aspect-ratio: 1.2 / 1;
        }

        .preview-frame img {
            display: block;
            width: 100%;
            height: 100%;
            object-fit: cover;
        }

        .preview-split {
            display: grid;
            grid-template-columns: repeat(2, minmax(0, 1fr));
            height: 100%;
        }

        .preview-split-pane {
            position: relative;
            min-width: 0;
            height: 100%;
            overflow: hidden;
            background: linear-gradient(180deg, var(--panel), var(--panel-soft, #f0e7db));
        }

        .preview-split-pane + .preview-split-pane {
            border-left: 1px solid var(--line);
        }

        .preview-split-pane img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }

        .preview-split-label {
            position: absolute;
            left: 8px;
            bottom: 8px;
            padding: 4px 8px;
            border-radius: 999px;
            background: rgba(255, 253, 249, 0.9);
            color: var(--text);
            font-size: 11px;
            font-weight: 700;
        }

        .preview-trigger {
            display: block;
            width: 72px;
            padding: 0;
            border: none;
            background: transparent;
            cursor: zoom-in;
            text-align: left;
        }

        .poi-sheet {
            border: 1px solid var(--line);
            border-radius: var(--radius-md);
            overflow: hidden;
            background: rgba(255, 255, 255, 0.92);
        }

        .poi-sheet-row {
            display: grid;
            grid-template-columns: 34px minmax(120px, 1.1fr) minmax(90px, 0.7fr) minmax(96px, 0.7fr) minmax(86px, 0.6fr);
            gap: 10px;
            align-items: center;
            min-height: 38px;
            padding: 7px 10px;
            border-top: 1px solid var(--line);
            cursor: pointer;
            font-size: 13px;
        }

        .poi-sheet-row:first-child {
            border-top: none;
        }

        .poi-sheet-row.header {
            background: var(--panel-strong);
            color: var(--muted);
            cursor: default;
            font-size: 11px;
            font-weight: 800;
            letter-spacing: .02em;
            text-transform: uppercase;
        }

        .poi-sheet-row:not(.header):hover,
        .poi-sheet-row.active {
            background: var(--panel-soft, #f5faf6);
        }

        .poi-sheet-row input {
            width: 16px;
            height: 16px;
        }

        .poi-sheet-cell {
            min-width: 0;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .user-location-list {
            display: grid;
            gap: 8px;
            margin-top: 16px;
        }

        .user-location-row {
            display: grid;
            grid-template-columns: minmax(0, 1fr) auto;
            gap: 12px;
            align-items: center;
            width: 100%;
            padding: 10px 12px;
            border: 1px solid var(--line);
            border-radius: var(--radius-md);
            background: var(--panel-strong);
            color: var(--text);
            text-align: left;
            cursor: pointer;
        }

        .user-location-row:disabled {
            cursor: default;
            opacity: .62;
        }

        .user-location-name,
        .user-location-meta {
            display: block;
            min-width: 0;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .user-location-name {
            font-weight: 800;
        }

        .user-location-meta {
            color: var(--muted);
            font-size: 12px;
            margin-top: 2px;
        }

        .preview-frame.large {
            aspect-ratio: 1.5 / 1;
        }

        .poi-map-icon {
            width: 54px;
            height: 54px;
            border-radius: 18px;
            border: 4px solid #2d7d4f;
            background: var(--panel);
            box-shadow: 0 12px 26px rgba(35, 32, 24, 0.28);
            overflow: visible;
            position: relative;
        }

        .poi-map-icon img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            display: block;
            border-radius: 15px;
        }

        .poi-map-icon::after {
            content: "";
            position: absolute;
            left: 50%;
            bottom: -9px;
            width: 16px;
            height: 16px;
            transform: translateX(-50%) rotate(45deg);
            background: inherit;
            border-right: 4px solid #2d7d4f;
            border-bottom: 4px solid #2d7d4f;
            box-shadow: 5px 5px 10px rgba(35, 32, 24, 0.16);
        }

        .poi-map-icon.rotation-green {
            border-color: #2d7d4f;
        }

        .poi-map-icon.rotation-green::after {
            border-color: #2d7d4f;
        }

        .poi-map-icon.rotation-yellow {
            border-color: #d6a52b;
        }

        .poi-map-icon.rotation-yellow::after {
            border-color: #d6a52b;
        }

        .poi-map-icon.rotation-red {
            border-color: var(--warning);
        }

        .poi-map-icon.rotation-red::after {
            border-color: var(--warning);
        }

        .poi-map-icon.fallback {
            display: grid;
            place-items: center;
            color: #fffdf9;
            background: #b95027;
            font-size: 21px;
        }

        .poi-map-icon.weed.fallback {
            background: #2d7d4f;
        }

        .poi-map-icon.rotation-yellow.fallback {
            background: #d6a52b;
        }

        .poi-map-icon.rotation-red.fallback {
            background: #b95027;
        }

        .leaflet-popup-content .marker-popup-thumb {
            width: 160px;
            height: 112px;
            object-fit: cover;
            border-radius: 12px;
            border: 1px solid var(--line);
            display: block;
            margin-bottom: 8px;
        }

        .item-main {
            min-width: 0;
            display: flex;
            align-items: center;
            gap: 12px;
            overflow: hidden;
        }

        .item-title {
            font-size: 15px;
            font-weight: 700;
            margin: 0;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .item-summary {
            margin: 0;
            color: var(--muted);
            font-size: 13px;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .item-meta {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
        }

        .item-meta.compact {
            flex-wrap: nowrap;
            justify-content: flex-end;
            overflow: hidden;
        }

        .badge {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            padding: 6px 10px;
            border-radius: 999px;
            font-size: 12px;
            font-weight: 700;
            background: var(--primary-soft);
            color: var(--primary);
        }

        .badge.warning {
            background: var(--warning-soft);
            color: var(--warning);
        }

        .badge.accent {
            background: var(--accent-soft);
            color: var(--accent);
        }

        .badge.info {
            background: var(--info-soft);
            color: var(--info);
        }

        .badge.success {
            background: var(--pill-success-bg);
            color: var(--success);
        }

        .empty-state {
            min-height: 120px;
            border: 1px dashed var(--line);
            border-radius: var(--radius-md);
            padding: 18px;
            background: var(--warning-soft);
            color: var(--muted);
            display: grid;
            align-content: center;
            gap: 10px;
            text-align: left;
        }

        .empty-state strong {
            color: var(--text);
            font-size: 16px;
        }

        .dialog-backdrop {
            position: fixed;
            inset: 0;
            background: rgba(29, 22, 11, 0.38);
            display: none;
            align-items: center;
            justify-content: center;
            padding: 18px;
            z-index: 4000;
        }

        .dialog-backdrop.open {
            display: flex;
        }

        .dialog {
            width: min(540px, 100%);
            background: var(--panel);
            border: 1px solid var(--line);
            border-radius: var(--radius-xl);
            box-shadow: 0 30px 60px rgba(42, 29, 12, 0.24);
            overflow: hidden;
        }

        .dialog-header,
        .dialog-body,
        .dialog-actions {
            padding: 20px 22px;
        }

        .dialog-header {
            border-bottom: 1px solid rgba(215, 196, 170, 0.9);
        }

        .dialog-header h3 {
            margin: 0 0 8px;
            font-size: 1.35rem;
        }

        .dialog-header p {
            margin: 0;
            color: var(--muted);
            line-height: 1.5;
            font-size: 14px;
        }

        .form-grid {
            display: grid;
            gap: 14px;
        }

        .field {
            display: grid;
            gap: 8px;
        }

        .field label {
            font-size: 13px;
            font-weight: 700;
            color: var(--muted);
            text-transform: uppercase;
            letter-spacing: 0.05em;
        }

        .field input,
        .field textarea,
        .field select {
            width: 100%;
            border: 1px solid var(--line);
            border-radius: var(--radius-sm);
            padding: 13px 14px;
            background: var(--panel);
            color: var(--text);
            outline: none;
        }

        .field textarea {
            resize: vertical;
            min-height: 110px;
        }

        .dialog-actions {
            display: flex;
            justify-content: flex-end;
            gap: 10px;
            border-top: 1px solid rgba(215, 196, 170, 0.9);
        }

        .toast {
            position: fixed;
            right: 24px;
            bottom: 24px;
            z-index: 4200;
            display: none;
            align-items: center;
            gap: 12px;
            padding: 14px 16px;
            border-radius: 16px;
            background: rgba(31, 44, 33, 0.96);
            color: #fff;
            box-shadow: 0 20px 40px rgba(31, 44, 33, 0.28);
        }

        .toast.visible {
            display: inline-flex;
        }

        .presence-alert {
            position: fixed;
            right: 24px;
            top: 24px;
            z-index: 4300;
            width: min(360px, calc(100vw - 32px));
            display: none;
            align-items: flex-start;
            gap: 12px;
            padding: 16px;
            border-radius: 18px;
            border: 1px solid rgba(159, 214, 148, 0.8);
            background: var(--success-soft, #f2fbef);
            color: var(--pill-success-text);
            box-shadow: 0 24px 54px rgba(31, 44, 33, 0.24);
        }

        .presence-alert.visible {
            display: flex;
        }

        .presence-alert-icon {
            width: 42px;
            height: 42px;
            border-radius: 50%;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
            background: var(--pill-success-bg);
            color: var(--pill-success-text);
            font-size: 18px;
        }

        .presence-alert-copy {
            flex: 1;
            min-width: 0;
        }

        .presence-alert-copy strong {
            display: block;
            font-size: 15px;
            margin-bottom: 4px;
        }

        .presence-alert-copy span {
            display: block;
            font-size: 13px;
            line-height: 1.45;
            color: var(--muted);
        }

        .presence-alert-close {
            border: 0;
            background: transparent;
            color: var(--muted);
            cursor: pointer;
            padding: 4px;
        }

        .map-popup-backdrop {
            position: fixed;
            inset: 0;
            background: rgba(29, 22, 11, 0.42);
            display: none;
            align-items: center;
            justify-content: center;
            padding: 18px;
            z-index: 4100;
        }

        .map-popup-backdrop.open {
            display: flex;
        }

        .map-popup-card {
            width: min(760px, 100%);
            background: var(--panel);
            border: 1px solid var(--line);
            border-radius: var(--radius-xl);
            box-shadow: 0 30px 60px rgba(42, 29, 12, 0.24);
            overflow: hidden;
        }

        .map-popup-header,
        .map-popup-body,
        .map-popup-actions {
            padding: 20px 22px;
        }

        .map-popup-header {
            border-bottom: 1px solid rgba(215, 196, 170, 0.9);
            display: flex;
            justify-content: space-between;
            gap: 12px;
            align-items: start;
        }

        .map-popup-header h3 {
            margin: 0 0 6px;
            font-size: 1.4rem;
        }

        .map-popup-header p {
            margin: 0;
            color: var(--muted);
            line-height: 1.5;
        }

        .icon-btn {
            border: none;
            background: rgba(35, 79, 63, 0.08);
            color: var(--primary);
            width: 38px;
            height: 38px;
            border-radius: 999px;
            cursor: pointer;
        }

        .map-popup-body {
            display: grid;
            gap: 18px;
        }

        .detail-tabs {
            display: grid;
            gap: 14px;
        }

        .detail-tablist {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
        }

        .detail-tab {
            border: 1px solid var(--line);
            background: var(--panel);
            color: var(--muted);
            border-radius: 999px;
            padding: 10px 14px;
            font-weight: 700;
            cursor: pointer;
        }

        .detail-tab.active {
            background: var(--primary-soft);
            color: var(--primary);
            border-color: rgba(35, 79, 63, 0.26);
        }

        .detail-tabpanel {
            display: none;
            gap: 14px;
        }

        .detail-tabpanel.active {
            display: grid;
        }

        .popup-grid {
            display: grid;
            grid-template-columns: minmax(220px, 0.9fr) minmax(0, 1.1fr);
            gap: 18px;
            align-items: start;
        }

        .map-popup-actions {
            border-top: 1px solid rgba(215, 196, 170, 0.9);
            display: flex;
            justify-content: flex-end;
            gap: 10px;
            flex-wrap: wrap;
        }

        .preview-lightbox {
            position: fixed;
            inset: 0;
            background: rgba(21, 16, 8, 0.68);
            display: none;
            align-items: center;
            justify-content: center;
            padding: 24px;
            z-index: 4300;
        }

        .preview-lightbox.open {
            display: flex;
        }

        .preview-lightbox-card {
            width: min(1100px, 100%);
            max-height: 92vh;
            overflow: auto;
            background: var(--panel);
            border: 1px solid var(--line);
            border-radius: var(--radius-xl);
            box-shadow: 0 30px 60px rgba(42, 29, 12, 0.24);
        }

        .preview-lightbox-head,
        .preview-lightbox-body {
            padding: 20px 22px;
        }

        .preview-lightbox-head {
            display: flex;
            justify-content: space-between;
            gap: 16px;
            align-items: start;
            border-bottom: 1px solid rgba(215, 196, 170, 0.9);
        }

        .preview-lightbox-head h3 {
            margin: 0 0 6px;
            font-size: 1.4rem;
        }

        .preview-lightbox-head p {
            margin: 0;
            color: var(--muted);
            line-height: 1.5;
        }

        .preview-lightbox-body {
            display: grid;
            gap: 16px;
        }

        .preview-lightbox-frame {
            border-radius: 20px;
            overflow: hidden;
            border: 1px solid var(--line);
            background: linear-gradient(180deg, var(--panel), var(--panel-soft, #f0e7db));
            aspect-ratio: 16 / 10;
        }

        .preview-lightbox-frame img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            display: block;
        }

        @media (min-width: 1261px) {
            body.has-desktop-chrome .topbar {
                padding: 18px 24px;
                gap: 18px;
            }

            body.has-desktop-chrome .priority-strip {
                grid-template-columns: repeat(4, minmax(0, 1fr));
                gap: 18px;
                padding: 22px;
            }

            body.has-desktop-chrome .priority-card {
                min-height: 154px;
                padding: 22px;
            }

            body.has-desktop-chrome .acceleration-board {
                padding: 24px;
                gap: 20px;
            }

            body.has-desktop-chrome .acceleration-grid {
                grid-template-columns: repeat(7, minmax(160px, 1fr));
                gap: 14px;
            }

            body.has-desktop-chrome .acceleration-item {
                min-height: 128px;
                padding: 14px;
            }

            body.has-desktop-chrome .section-card {
                border-radius: var(--radius-xl);
            }
        }

        @media (max-width: 1260px) {
            .layout-shell {
                grid-template-columns: 1fr;
            }

            .sidebar-nav {
                display: none;
            }

            .mobile-nav {
                display: block;
            }

            .workspace,
            .popup-grid {
                grid-template-columns: 1fr;
            }

            /* .topbar is een flex-container: grid-template-columns had hier geen
               effect, waardoor de status-, filter- en actie-elementen tussen
               861–1260px op één rij botsten (issue #345). We stapelen de twee
               topbar-groepen en laten de chips/knoppen krimpen i.p.v. overlappen. */
            .topbar > div {
                flex: 1 1 100%;
                min-width: 0;
            }

            .topbar-side,
            .filters-row,
            .hero-actions {
                min-width: 0;
                width: 100%;
            }

            .filter-chip {
                min-width: min(100%, 180px);
            }

            .filter-chip select {
                max-width: 100%;
            }

            .status-row,
            .filters-row,
            .hero-actions {
                justify-content: flex-start;
            }

            .priority-strip {
                grid-template-columns: repeat(2, minmax(0, 1fr));
            }

            .acceleration-grid {
                grid-template-columns: repeat(2, minmax(0, 1fr));
            }

            .section-grid {
                grid-template-columns: 1fr;
            }

            .overview-split-grid,
            .overview-half-grid {
                grid-template-columns: 1fr;
            }
        }

        @media (max-width: 860px) {
            .app-shell {
                padding: 14px;
                overflow-x: hidden;
            }

            .item-layout {
                grid-template-columns: 64px minmax(0, 1fr);
                align-items: start;
            }

            .preview-trigger {
                width: 64px;
            }

            .item-main {
                display: grid;
                gap: 4px;
            }

            .item-meta.compact {
                grid-column: 2;
                justify-content: flex-start;
                flex-wrap: wrap;
            }

            .topbar,
            .workspace,
            .priority-strip,
            .section-grid {
                padding: 14px;
            }

            .topbar {
                align-items: stretch;
                box-sizing: border-box;
                max-width: 100%;
                min-width: 0;
                width: 100%;
            }

            .topbar > div {
                flex: 1 1 100% !important;
                max-width: 100%;
                min-width: 0;
            }

            .priority-strip {
                grid-template-columns: 1fr;
            }

            .topbar-side,
            .filters-row,
            .hero-actions {
                min-width: 0;
                width: 100%;
            }

            .topbar-side {
                flex-shrink: 1 !important;
            }

            .hero-actions {
                flex-wrap: wrap;
            }

            .hero-actions button {
                flex: 1 1 100%;
                min-width: 0;
            }

            .filter-chip {
                min-width: min(100%, 180px);
            }

            .filter-chip select {
                max-width: 100%;
            }

            .acceleration-grid {
                grid-template-columns: 1fr !important;
            }

            .qr-box,
            .mini-form-grid {
                grid-template-columns: 1fr;
            }

            .map-panel {
                grid-template-rows: auto auto minmax(340px, 1fr);
            }

            .context-panel {
                min-height: 0;
            }

            .panel-head,
            .context-summary,
            .context-details,
            .section-body {
                padding-left: 14px;
                padding-right: 14px;
            }

            .map-toolbar {
                padding-left: 14px;
                padding-right: 14px;
            }

            .dialog-actions {
                flex-direction: column-reverse;
            }

            .dialog-actions button {
                width: 100%;
                justify-content: center;
            }

            .map-popup-actions {
                flex-direction: column-reverse;
            }

            .map-popup-actions button {
                width: 100%;
                justify-content: center;
            }
        }
