/* ── Tokens ── */
:root {
  --bg:           #0d1017;
  --surface:      #141720;
  --surface2:     #1b1f2e;
  --border:       #323850;
  --text:         #dce3f0;
  --text-muted:   #8e9ab5;
  --text-dim:     #545e78;
  --accent:       #0d9488;
  --accent-bg:    rgba(13,148,136,0.13);
  --red:          #f04e41;
  --red-bg:       rgba(240,78,65,0.12);
  --orange:       #e8a03d;
  --orange-bg:    rgba(232,160,61,0.12);
  --green:        #3ebd78;
  --green-bg:     rgba(62,189,120,0.12);
  --radius:       6px;
  --sidebar-w:    224px;
  --stripe-a:     var(--bg);
  --stripe-b:     var(--surface2);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 14px; }

body {
  font-family: 'IBM Plex Sans', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Layout ── */
.app-layout {
  display: flex;
  min-height: 100vh;
}

.app-content {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
}

.app-content main {
  padding: 28px 32px;
  animation: fadeIn 0.14s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(3px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Sidebar ── */
.nav-main {
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: sticky;
  top: 0;
  flex-shrink: 0;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 16px 14px;
  border-bottom: 1px solid var(--border);
}

.sidebar-brand-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}

.nav-main nav {
  flex: 1;
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: 13.5px;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.12s, color 0.12s;
}

.nav-item svg { flex-shrink: 0; }

.nav-item:hover {
  background: var(--surface2);
  color: var(--text);
  text-decoration: none;
}

.nav-item[aria-current="page"] {
  background: var(--accent-bg);
  color: var(--accent);
}

.sidebar-footer {
  padding: 10px 8px;
  border-top: 1px solid var(--border);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius);
}

.sidebar-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-bg);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
}

.sidebar-username {
  flex: 1;
  font-size: 13px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-logout {
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  color: var(--text-muted);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.12s, background 0.12s;
}

.sidebar-logout:hover {
  color: var(--text);
  background: var(--surface2);
}

.logout-form { display: contents; }

/* ── Mobile bottom nav (hidden on desktop) ── */
.bottom-nav { display: none; }

/* ── Typography ── */
.page-title {
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.025em;
  color: var(--text);
  margin-bottom: 20px;
}

.section-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 12px;
  margin-top: 24px;
}

.page-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.page-header .page-title { margin-bottom: 0; }

.text-muted { color: var(--text-muted); }
.mono { font-family: 'IBM Plex Mono', monospace; font-size: 12px; }

/* ── Buttons ── */
.button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  font-family: inherit;
  transition: all 0.12s;
  white-space: nowrap;
  text-decoration: none;
}

.button:hover { text-decoration: none; }

.button-primary { background: var(--accent); color: #fff; }
.button-primary:hover { filter: brightness(1.12); color: #fff; }

.button-secondary {
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--border);
}
.button-secondary:hover { border-color: var(--accent); color: var(--accent); }

.button-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.button-ghost:hover { color: var(--text); border-color: var(--text-dim); }

.button-danger {
  background: var(--red-bg);
  color: var(--red);
  border: 1px solid rgba(240,78,65,0.2);
}
.button-danger:hover { filter: brightness(1.1); }

.button-sm { padding: 5px 10px; font-size: 12px; }
.input-with-action { display: flex; gap: 6px; align-items: center; }
.input-with-action input { flex: 1; min-width: 0; }

/* Plain buttons (without .button class) inside forms */
button:not(.button):not(.sidebar-logout) {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid var(--border);
  font-family: inherit;
  background: var(--surface2);
  color: var(--text);
  transition: all 0.12s;
}

button:not(.button):not(.sidebar-logout):hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ── Forms ── */
.form-label {
  display: block;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 5px;
}

.form-group { margin-bottom: 14px; }

.form-group label:not(.form-label) {
  display: block;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 5px;
}

input[type="text"],
input[type="number"],
input[type="password"],
input[type="date"],
input[type="time"],
input[type="datetime-local"],
select,
textarea {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 7px 11px;
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.12s;
  appearance: none;
  -webkit-appearance: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
}

input::placeholder { color: var(--text-dim); }

input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator,
input[type="datetime-local"]::-webkit-calendar-picker-indicator {
  filter: invert(0.5) brightness(1.4);
  cursor: pointer;
  opacity: 0.7;
}

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2366728a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 32px;
}

textarea {
  resize: vertical;
  min-height: 72px;
}

.form-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 16px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.form-row-3 { grid-template-columns: 1fr 1fr 1fr; }

.form-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 24px;
  max-width: 780px;
}

.form-section-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 14px;
  margin-top: 22px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.form-section-title:first-child { margin-top: 0; }

code {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  color: var(--accent);
  background: var(--accent-bg);
  padding: 1px 6px;
  border-radius: 4px;
}

/* ── Flash messages ── */
.flash-error {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 14px;
  background: var(--red-bg);
  border: 1px solid rgba(240,78,65,0.25);
  color: var(--red);
  border-radius: var(--radius);
  font-size: 13px;
  margin-bottom: 16px;
}

.flash-success {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--green-bg);
  border: 1px solid rgba(62,189,120,0.25);
  color: var(--green);
  border-radius: var(--radius);
  font-size: 13px;
  margin-bottom: 16px;
}

.needs-review-alert {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  background: var(--orange-bg);
  border: 1px solid rgba(232,160,61,0.25);
  color: var(--orange);
  margin-bottom: 14px;
}

/* ── Badges ── */
.status-badge,
[class^="badge-"],
[class*=" badge-"] {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.status-badge[data-status="complete"]      { background: var(--green-bg);  color: var(--green);  }
.status-badge[data-status="needs_review"]  { background: var(--orange-bg); color: var(--orange); }
.status-badge[data-status="edited"]        { background: rgba(99,102,241,0.12); color: #818cf8; }

.badge-business { background: var(--accent-bg); color: var(--accent); }
.badge-private  { background: var(--orange-bg); color: var(--orange); }
.badge-commute  { background: rgba(139,92,246,0.12); color: #a78bfa; }

/* ── Tables ── */
.table-wrapper {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead th {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: var(--surface);
  padding: 9px 14px;
  text-align: left;
  white-space: nowrap;
}

tbody td {
  font-size: 13px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

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

tr.day-a td { background: var(--stripe-a); }
tr.day-b td { background: var(--stripe-b); }

tbody tr:hover td { background: var(--surface2); transition: background 0.08s; }

.address-cell {
  font-size: 12px;
  color: var(--text-muted);
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table-empty {
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
  padding: 24px !important;
}

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

.table-link:hover { color: var(--accent); }

/* ── Filter form ── */
.filter-form {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.filter-form .form-group { margin-bottom: 0; min-width: 120px; }

.filter-actions { margin-top: 0; }

/* ── Pagination ── */
.pagination {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 2px;
  color: var(--text-muted);
  font-size: 13px;
}

.pagination-spacer { flex: 1; }

/* ── Dashboard ── */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
  margin-bottom: 28px;
}

.dashboard-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 18px 20px;
  display: block;
  text-decoration: none;
  color: inherit;
}

.dashboard-card--link {
  transition: border-color 0.12s;
}

.dashboard-card--link:hover {
  border-color: var(--accent);
  text-decoration: none;
}

.dashboard-card-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.dashboard-card-value {
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--text);
  line-height: 1.1;
  margin-bottom: 6px;
}

.dashboard-card-value--empty { color: var(--text-dim); }

.dashboard-card-unit {
  font-size: 14px;
  font-weight: 400;
  color: var(--text-muted);
  letter-spacing: 0;
}

.dashboard-card-sub {
  font-size: 12px;
  color: var(--text-muted);
}

a.dashboard-card-sub:hover { color: var(--accent); }

/* Privé-km indicator */
.prive-km-indicator[data-status="green"]         { border-color: rgba(62,189,120,0.3); }
.prive-km-indicator[data-status="orange"]        { border-color: rgba(232,160,61,0.3); }
.prive-km-indicator[data-status="red"]           { border-color: rgba(240,78,65,0.3); }
.prive-km-indicator[data-status="red_exceeded"]  { border-color: rgba(240,78,65,0.3); }

.prive-km-indicator[data-status="green"]         .dashboard-card-value { color: var(--green); }
.prive-km-indicator[data-status="orange"]        .dashboard-card-value { color: var(--orange); }
.prive-km-indicator[data-status="red"]           .dashboard-card-value { color: var(--red); }
.prive-km-indicator[data-status="red_exceeded"]  .dashboard-card-value { color: var(--red); }

.prive-gauge {
  height: 5px;
  background: var(--surface2);
  border-radius: 3px;
  margin-top: 10px;
  overflow: hidden;
}

.prive-gauge-fill {
  height: 100%;
  border-radius: 3px;
  background: var(--accent);
  transition: width 0.3s ease;
}

.prive-km-indicator[data-status="orange"]       .prive-gauge-fill { background: var(--orange); }
.prive-km-indicator[data-status="red"]          .prive-gauge-fill { background: var(--red); }
.prive-km-indicator[data-status="red_exceeded"] .prive-gauge-fill { background: var(--red); }

/* ── Route kaart ── */
.route-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 16px;
}

.route-endpoints {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}

.route-point { flex: 1; min-width: 0; }

.route-point--end { text-align: right; }

.route-point-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 3px;
}

.route-point-address {
  font-size: 13px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.route-distance-badge {
  flex-shrink: 0;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  font-weight: 500;
  color: var(--accent);
  background: var(--accent-bg);
  padding: 3px 10px;
  border-radius: 20px;
  border: 1px solid rgba(13,148,136,0.2);
  white-space: nowrap;
}

.route-map {
  height: 220px;
  background: var(--surface2);
}

/* Leaflet dark theme tweaks */
.leaflet-container { background: var(--surface2); }
.leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(0.85) contrast(0.9); }
.leaflet-control-zoom a {
  background: var(--surface) !important;
  color: var(--text-muted) !important;
  border-color: var(--border) !important;
}
.leaflet-control-zoom a:hover { color: var(--text) !important; }
.leaflet-control-attribution {
  background: rgba(13,16,23,0.7) !important;
  color: var(--text-dim) !important;
  font-size: 10px !important;
}
.leaflet-control-attribution a { color: var(--text-muted) !important; }

.map-marker {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid #fff;
}
.map-marker--start { background: var(--accent); }
.map-marker--end   { background: var(--orange); }

/* ── Ride detail ── */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 16px;
  align-items: start;
}

.meta-card { max-width: 100%; margin-bottom: 12px; }

.ride-meta {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 16px;
  font-size: 13px;
}

.ride-meta dt { color: var(--text-muted); white-space: nowrap; }
.ride-meta dd { color: var(--text); }

.ride-delete-form { margin-top: 4px; }

/* ── Week blocks (werkdagen) ── */
.week-block {
  margin-bottom: 24px;
}

.week-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 4px 10px;
  font-size: 12px;
}

.week-label {
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.02em;
}

.week-stats {
  color: var(--text-muted);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
}

.week-stats strong {
  color: var(--text);
}

/* ── Overtime coloring ── */
.overtime-pos  { color: var(--green);  font-weight: 500; }
.overtime-neg  { color: var(--red);    font-weight: 500; }
.overtime-zero { color: var(--text-muted); }

/* ── Vehicles ── */
.vehicles-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 640px;
}

.vehicle-anchors {
  max-width: 640px;
  margin-top: -4px;
  margin-bottom: 8px;
  padding: 8px 14px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
}
.vehicle-anchors summary {
  cursor: pointer;
  color: var(--text-muted);
  padding: 4px 0;
}
.vehicle-anchors-body { margin-top: 10px; display: flex; flex-direction: column; gap: 12px; }
.anchors-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.anchors-table th, .anchors-table td { padding: 6px 8px; text-align: left; border-bottom: 1px solid var(--border); }
.anchors-table th { color: var(--text-muted); font-weight: 500; }
.anchor-form { padding-top: 6px; border-top: 1px dashed var(--border); }
.form-group--grow { flex: 1; }

.gap-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  font-size: 10px;
  font-weight: 600;
  border-radius: 3px;
  background: rgba(245, 158, 11, 0.18);
  color: #b45309;
  border: 1px solid rgba(245, 158, 11, 0.4);
  vertical-align: middle;
}

.warning-card {
  margin: 16px 0;
  padding: 12px 16px;
  background: rgba(245, 158, 11, 0.10);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-left: 3px solid #f59e0b;
  border-radius: 6px;
  font-size: 13px;
  color: var(--text);
}
.warning-card strong { display: block; margin-bottom: 4px; color: #b45309; }

.ride-nav { margin-left: auto; display: flex; gap: 6px; }
.ride-nav .button { display: inline-flex; align-items: center; gap: 4px; }

.vehicle-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
}

.vehicle-card--inactive { opacity: 0.6; }

.vehicle-icon {
  width: 44px;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  flex-shrink: 0;
}

.vehicle-icon--default {
  border-color: rgba(13,148,136,0.4);
  background: var(--accent-bg);
  color: var(--accent);
}

.vehicle-info { flex: 1; min-width: 0; }

.vehicle-plate {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.03em;
}

.vehicle-plate--default { color: var(--accent); }

.vehicle-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

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

.vehicle-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.vehicle-badge--default  { background: var(--accent-bg); color: var(--accent); }
.vehicle-badge--inactive { background: var(--red-bg); color: var(--red); }

.vehicle-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

/* ── Settings ── */
.settings-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 640px;
}

.settings-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

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

.settings-section-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.settings-unit {
  font-size: 11px;
  color: var(--text-muted);
}

.settings-card .form-group {
  padding: 0 18px;
  margin-bottom: 14px;
}

.settings-card .form-group:first-of-type { margin-top: 14px; }
.settings-card .form-group:last-child { margin-bottom: 18px; }

.contract-grid {
  display: grid;
  grid-template-columns: auto repeat(5, 1fr);
  gap: 6px 10px;
  padding: 14px 18px;
  align-items: center;
}

.contract-grid-day {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  text-align: center;
  letter-spacing: 0.03em;
}

.contract-grid-label {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  padding-right: 8px;
}

.contract-input {
  width: 100% !important;
  text-align: center;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 13px;
  padding: 6px 4px !important;
}

/* ── Login ── */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
}

.login-card {
  width: 360px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 36px;
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
}

.login-brand-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}

.login-card .page-title {
  font-size: 16px;
  margin-bottom: 20px;
}

.login-form .form-actions { margin-top: 20px; }

/* ── Responsive ── */
@media (max-width: 700px) {
  .nav-main { display: none; }

  .bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--surface);
    border-top: 1px solid var(--border);
    z-index: 100;
    padding: 4px 0 env(safe-area-inset-bottom, 4px);
  }

  .bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 6px 4px;
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.12s;
  }

  .bottom-nav-item[aria-current="page"] { color: var(--accent); }
  .bottom-nav-item:hover { color: var(--text); text-decoration: none; }

  .app-content main {
    padding: 16px;
    padding-bottom: 80px;
  }

  .hide-mobile { display: none !important; }

  .form-row, .form-row-3 { grid-template-columns: 1fr; }

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

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

  .filter-form { gap: 6px; }

  .login-card { width: 100%; max-width: 360px; padding: 24px; }

  /* Brede tabellen horizontaal scrollbaar i.p.v. afgeknipt */
  .table-wrapper { overflow-x: auto; }
  .vehicle-anchors-body { overflow-x: auto; }

  /* Paginakop met rit-navigatie mag wrappen */
  .page-header { flex-wrap: wrap; }

  /* Paginering: veel elementen, laat wrappen */
  .pagination { flex-wrap: wrap; row-gap: 8px; }

  /* Filterformulier: nette 2-koloms grid, knoppen op eigen rij */
  .filter-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .filter-form .form-group { min-width: 0; }
  .filter-form .filter-actions {
    grid-column: 1 / -1;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
  }

  /* Kaart groter op telefoon — primair apparaat */
  .route-map { height: 280px; }
}

/* ── Semantische hulpclasses (geen inline styles in templates — §13) ── */
.prive-gauge-fill { width: var(--gauge-pct, 0%); }

.form-hint {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 6px;
  line-height: 1.5;
}
.form-hint--tight { margin-top: -4px; }
.form-hint--spaced { margin-top: 12px; line-height: 1.4; }

.intro-text {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
}
.checkbox-label input { width: auto; }

.mt-section { margin-top: 24px; }
.mt-block { margin-top: 14px; }
.mt-sm { margin-top: 8px; }
.mt-lg { margin-top: 32px; }
.mt-text { margin-top: 12px; }

.button-disabled { opacity: 0.4; cursor: not-allowed; }
.button-block { width: 100%; }

.form-card-narrow { max-width: 480px; }
.form-label-sm { font-size: 12px; }

.ride-link-list {
  list-style: none;
  padding: 0;
  font-size: 13px;
}
.ride-link-list li {
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}
.ride-link-list a { color: var(--text); }

.text-sm { font-size: 13px; }
.field-required { color: var(--red); }

/* ── Mobiele kaartweergave ritten (desktop: tabel, mobiel: cards) ── */
.ride-cards { display: none; }

.ride-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 10px;
  color: var(--text);
  text-decoration: none;
}
.ride-card:hover { background: var(--surface2); text-decoration: none; }

.ride-card-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.ride-card-row + .ride-card-row { margin-top: 6px; }

.ride-card-date { font-weight: 600; }
.ride-card-time { color: var(--text-muted); font-size: 13px; }
.ride-card-distance { margin-left: auto; font-weight: 600; }

.ride-card-addresses {
  font-size: 12px;
  color: var(--text-muted);
  overflow: hidden;
}
.ride-card-addresses span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ride-card-arrow { flex-shrink: 0; }

/* Toggle ná de base-definitie van .ride-cards, anders wint display:none */
@media (max-width: 700px) {
  .table-wrapper--rides { display: none; }
  .ride-cards { display: block; }
}

/* ── Print (PDF exports) ── */
@media print {
  .nav-main, .bottom-nav { display: none; }
  .app-content main { padding: 0; }
  body { background: #fff; color: #000; }
  table { border-collapse: collapse; }
  th, td { border: 1px solid #ddd; padding: 6px 8px; font-size: 11px; }
}
