:root {
  --ink: #1d2433;
  --muted: #5b6475;
  --line: #e3e6ec;
  --accent: #c0392b;
  --accent-ink: #ffffff;
  --accent-soft: #fdecea;
  --bg: #fafaf8;
  --card: #ffffff;
  --chip: #f2f3f6;
  --ok: #1e7b4a;
  --shadow: 0 1px 2px rgba(20, 24, 33, .06);
  --radius: 12px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #e8eaf0; --muted: #a2a9b8; --line: #2c3240; --accent: #ef6f61; --accent-ink: #1a1d24;
    --accent-soft: #3a2422; --bg: #14171d; --card: #1c2028; --chip: #262b35; --ok: #5cc98d;
    --shadow: none; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --ink: #e8eaf0; --muted: #a2a9b8; --line: #2c3240; --accent: #ef6f61; --accent-ink: #1a1d24;
  --accent-soft: #3a2422; --bg: #14171d; --card: #1c2028; --chip: #262b35; --ok: #5cc98d;
  --shadow: none; color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 64px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink); line-height: 1.5;
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
a { color: var(--accent); }
main { max-width: 820px; margin: 0 auto; padding: 20px 16px 80px; }
h1 { font-size: 1.7rem; line-height: 1.2; margin: 8px 0 4px; }
h2 {
  font-size: 1.2rem; margin: 36px 0 12px; display: inline-block;
  border-bottom: 2px solid var(--accent); padding-bottom: 4px;
}
.sub { color: var(--muted); margin: 0 0 12px; }
.muted { color: var(--muted); }
.klein { font-size: .85rem; }
[hidden] { display: none !important; }

/* ---------- bovenbalk ---------- */
.balk {
  position: sticky; top: 0; z-index: 1000; background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
}
.balk-in {
  max-width: 820px; margin: 0 auto; padding: 8px 16px; display: flex; align-items: center; gap: 8px;
}
.balk nav { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; flex: 1; min-width: 0; }
.balk nav::-webkit-scrollbar { display: none; }
.balk nav a {
  flex: none; text-decoration: none; color: var(--ink); font-size: .9rem; padding: 6px 10px; border-radius: 999px;
}
.balk nav a:hover { background: var(--chip); }

/* ---------- knoppen ---------- */
button, .knop {
  font: inherit; font-size: .95rem; cursor: pointer; border-radius: 999px; padding: 8px 14px; min-height: 40px;
  border: 1px solid var(--line); background: var(--card); color: var(--ink); text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
button:hover, .knop:hover { border-color: var(--muted); }
button.primair, .knop.primair { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
button.klein { min-height: 32px; padding: 4px 10px; font-size: .85rem; }
button.tekst { border: 0; background: none; padding: 4px 6px; min-height: 0; color: var(--muted); }
button:disabled { opacity: .5; cursor: default; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 60%, transparent); outline-offset: 2px; }

/* ---------- vandaag / voortgang ---------- */
.vandaag {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px;
  margin: 12px 0 0; box-shadow: var(--shadow); display: grid; gap: 10px;
}
.vandaag-kop { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.vandaag strong { font-size: 1.05rem; }
.voortgang { height: 8px; background: var(--chip); border-radius: 999px; overflow: hidden; }
.voortgang > div { height: 100%; background: var(--accent); border-radius: 999px; transition: width .6s ease; }
.gps-uitkomst { font-size: .9rem; color: var(--muted); }

/* ---------- kaart ---------- */
#kaart {
  height: 380px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--chip);
  z-index: 0;
}
@media (min-width: 700px) { #kaart { height: 460px; } }
.kaart-fout { padding: 24px; color: var(--muted); }
.mk-hotel {
  width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: var(--accent-ink);
  font-weight: 700; font-size: 14px; display: grid; place-items: center; border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .35);
}
.mk-stop {
  width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 3px solid var(--accent);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .3);
}
.mk-thuis {
  width: 26px; height: 26px; border-radius: 6px; background: var(--ink); color: var(--bg);
  font-size: 18px; line-height: 1; display: grid; place-items: center; border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .35);
}
.mk-ik {
  width: 16px; height: 16px; border-radius: 50%; background: #2b7bd9; border: 3px solid #fff;
  box-shadow: 0 0 0 6px rgba(43, 123, 217, .25);
}
.leaflet-container { font: inherit; }
.leaflet-tooltip { font-size: .85rem; }

/* ---------- tabel ---------- */
.tabel-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); }
tr:last-child td { border-bottom: 0; }
th { background: var(--chip); font-weight: 600; font-size: .9rem; }
td a { color: inherit; text-decoration: none; }
td a:hover { color: var(--accent); }
tbody tr.nu td { background: var(--accent-soft); }

/* ---------- weer ---------- */
.weer { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.weer-vak { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.weer-vak b { display: block; font-size: .9rem; }
.weer-temp { font-size: 1.4rem; font-weight: 700; }

/* ---------- dagkaartjes ---------- */
.dag {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px;
  margin: 10px 0; display: grid; grid-template-columns: 52px 1fr; gap: 12px; box-shadow: var(--shadow);
  transition: box-shadow .3s, border-color .3s;
}
.dag.vandaag-dag { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.dag.voorbij { opacity: .78; }
.dag.flits { animation: flits 1.4s ease; }
@keyframes flits { 0%, 40% { box-shadow: 0 0 0 4px var(--accent); } 100% { box-shadow: var(--shadow); } }
.num { font-size: 1.6rem; font-weight: 700; color: var(--accent); line-height: 1; text-align: center; }
.num small { display: block; font-size: .68rem; font-weight: 500; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 2px; }
.num .datum { display: block; font-size: .7rem; font-weight: 500; color: var(--muted); margin-top: 6px; line-height: 1.2; }
.place { font-weight: 600; font-size: 1.08rem; }
.rijden {
  display: inline-flex; align-items: center; gap: 6px; font-size: .82rem; color: var(--muted);
  background: var(--chip); border-radius: 999px; padding: 2px 10px; margin: 4px 0 6px;
}
.rijden.laden { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.rijden .label { text-transform: uppercase; font-size: .7rem; letter-spacing: .04em; }
.wat { margin: 0; }
.dag-acties { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------- notities ---------- */
.notities { margin-top: 10px; display: grid; gap: 8px; }
.notities:empty { display: none; }
.notitie { border-left: 3px solid var(--accent); padding: 4px 0 4px 10px; }
.notitie p { margin: 0 0 4px; white-space: pre-wrap; overflow-wrap: anywhere; }
.notitie img { display: block; max-width: 100%; max-height: 320px; border-radius: 8px; margin: 4px 0; cursor: zoom-in; }
.notitie .meta { font-size: .78rem; color: var(--muted); display: flex; gap: 8px; align-items: center; }
.notitie-form { margin-top: 10px; display: grid; gap: 8px; }
textarea, input[type="text"], input[type="password"], input[type="date"], input[type="number"], select {
  font: inherit; width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--bg); color: var(--ink);
}
textarea { min-height: 80px; resize: vertical; }
.form-rij { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.bestand-label { font-size: .9rem; }
.voorbeeld img { max-width: 160px; border-radius: 8px; display: block; }

/* ---------- checklist ---------- */
.checklist { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.checklist label {
  display: grid; grid-template-columns: 28px 1fr; gap: 10px; align-items: start; cursor: pointer;
  background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px;
}
.checklist input { width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--accent); }
.checklist .gedaan span.tekst { text-decoration: line-through; color: var(--muted); }
.checklist .door { display: block; font-size: .75rem; color: var(--ok); margin-top: 2px; }
.checklist-telling { font-size: .9rem; color: var(--muted); margin: -4px 0 10px; }

/* ---------- melding ---------- */
.melding {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 2000;
  background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-size: .9rem;
  max-width: calc(100% - 32px); box-shadow: 0 4px 16px rgba(0, 0, 0, .25);
}
.offline-band { background: var(--chip); color: var(--muted); text-align: center; font-size: .85rem; padding: 4px 16px; }

/* ---------- foto groot ---------- */
dialog.lichtbak { border: 0; padding: 0; background: transparent; max-width: 96vw; max-height: 92vh; }
dialog.lichtbak::backdrop { background: rgba(0, 0, 0, .85); }
dialog.lichtbak img { max-width: 96vw; max-height: 92vh; display: block; border-radius: 6px; }

/* ---------- login ---------- */
.login { max-width: 380px; margin: 12vh auto 0; padding: 0 16px; }
.login form { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; display: grid; gap: 12px; }
.login label { display: grid; gap: 4px; font-size: .9rem; color: var(--muted); }
.fout { color: var(--accent); font-size: .9rem; min-height: 1.2em; margin: 0; }

/* ---------- beheer ---------- */
.beheer-dag { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin: 10px 0; display: grid; gap: 8px; }
.beheer-dag label, .veld { display: grid; gap: 4px; font-size: .85rem; color: var(--muted); }
.beheer-dag .check { display: flex; gap: 8px; align-items: center; color: var(--ink); }
.vaste-knoppen {
  position: sticky; bottom: 0; background: var(--bg); border-top: 1px solid var(--line);
  padding: 10px 0; display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
}
#json { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .82rem; min-height: 420px; }
.praktisch-rij { display: grid; grid-template-columns: 1fr auto; gap: 6px; margin: 6px 0; }

/* ---------- verblijf ---------- */
.boeking {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px;
  margin: 8px 0; box-shadow: var(--shadow);
}
.boeking-kop { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.boeking-kop b { font-size: 1rem; }
.status { font-size: .78rem; border-radius: 999px; padding: 2px 10px; background: var(--chip); color: var(--muted); white-space: nowrap; }
.status.ok { background: color-mix(in srgb, var(--ok) 15%, transparent); color: var(--ok); font-weight: 600; }
.boeking dl { display: grid; grid-template-columns: max-content 1fr; gap: 2px 12px; margin: 8px 0 0; font-size: .92rem; }
.boeking dt { color: var(--muted); }
.boeking dd { margin: 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.boeking-form { display: grid; gap: 8px; margin-top: 10px; }
.boeking-form .twee { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
@media (max-width: 480px) { .boeking-form .twee { grid-template-columns: 1fr; } }
.boeking-form label { display: grid; gap: 2px; font-size: .82rem; color: var(--muted); }
.hotel-in-dag { margin: 8px 0 0; font-size: .92rem; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }

/* ---------- links ---------- */
.links { list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-wrap: wrap; gap: 6px; }
.links:empty { display: none; }
.links li { display: inline-flex; align-items: center; gap: 2px; }
.links a {
  font-size: .85rem; text-decoration: none; background: var(--chip); color: var(--ink);
  border-radius: 999px; padding: 4px 10px; display: inline-block;
}
.links a:hover { color: var(--accent); }
.links .eigen a { border: 1px dashed var(--muted); }
.links button.tekst { font-size: .9rem; padding: 2px 4px; }
.link-form { display: grid; grid-template-columns: 1fr 1fr auto auto; gap: 6px; margin-top: 8px; }
@media (max-width: 560px) { .link-form { grid-template-columns: 1fr 1fr; } }

footer { margin-top: 40px; color: var(--muted); font-size: .85rem; }

/* ---------- print ---------- */
@media print {
  :root { --bg: #fff; --card: #fff; --ink: #000; --muted: #444; --line: #ccc; --chip: #eee; --accent: #b0281b; --accent-soft: #fbe3e0; }
  html { scroll-padding-top: 0; }
  body { background: #fff; font-size: 11pt; }
  .balk, .vandaag, #kaart-sectie, #weer-sectie, .dag-acties, .notitie-form, .link-form, .boeking-form, .melding, .offline-band, button { display: none !important; }
  .boeking { break-inside: avoid; box-shadow: none; }
  .links a { padding: 0; background: none; }
  .links a::after { content: " (" attr(href) ")"; font-size: 8pt; color: #555; }
  main { padding: 0; max-width: none; }
  h2 { margin-top: 18px; }
  .dag { break-inside: avoid; box-shadow: none; opacity: 1 !important; padding: 8px 10px; margin: 6px 0; }
  .notitie img { max-height: 160px; }
  .checklist label { padding: 6px 10px; break-inside: avoid; }
  a { color: inherit; text-decoration: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .dag.flits { animation: none; }
}

/* kleine hulpklassen (geen inline styles i.v.m. Content-Security-Policy) */
input.smal { width: auto; }
.gps-rij { margin-bottom: 8px; }
.vastgelegd { margin: 6px 0 0; }
.praktisch-rij.link-rij { grid-template-columns: 1fr 1.4fr auto; }
@media (max-width: 480px) { .praktisch-rij.link-rij { grid-template-columns: 1fr auto; } .praktisch-rij.link-rij input:first-child { grid-column: 1 / -1; } }

/* ---------- illustratie bovenaan ---------- */
.hero { line-height: 0; overflow: hidden; border-bottom: 1px solid var(--line); background: linear-gradient(to bottom, var(--bg), color-mix(in srgb, var(--accent) 5%, var(--bg))); }
.hero svg { display: block; width: min(100%, 1400px); margin: 0 auto; overflow: visible; height: clamp(130px, 21.6vw, 302px); }
.hero .zon { fill: var(--accent); opacity: .16; }
.hero .heuvel-ver { fill: var(--accent); opacity: .07; }
.hero .silhouet { fill: var(--ink); opacity: .17; }
.hero .water { fill: #3d8fd1; opacity: .16; }
.hero .heuvel { fill: var(--accent); opacity: .12; }
.hero .weg { fill: none; stroke: var(--muted); stroke-width: 2; stroke-dasharray: 14 10; opacity: .4; }
.hero .auto { fill: var(--accent); }
.hero .auto .wiel { fill: var(--ink); }
@media (prefers-reduced-motion: no-preference) {
  .hero .auto { animation: rijden 2.4s ease-out both; }
  @keyframes rijden { from { transform: translateX(-140px); opacity: 0; } to { transform: none; opacity: 1; } }
}
main { padding-top: 12px; }
@media print { .hero { display: none; } }
