/* Cuu Long -- mobile-first, licht thema, hoog contrast */

:root {
  --accent: #1a5490;
  --accent-donker: #0f3d6b;
  --tekst: #111;
  --tekst-zacht: #555;
  --lijn: #e2e2e2;
  --achtergrond: #ffffff;
  --paneel: #f7f5f2;
  --waarschuw: #b3610a;
  --waarschuw-bg: #fff4e0;
  --ok: #2e7d32;
  --raakdoel: 44px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--achtergrond);
  color: var(--tekst);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.4;
  -webkit-text-size-adjust: 100%;
}

/* --- Header --------------------------------------------------------------- */
.app-header {
  background: var(--accent);
  color: #fff;
  padding: env(safe-area-inset-top) 16px 12px;
  padding-top: max(env(safe-area-inset-top), 12px);
}
.app-header h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.5px;
}
.app-header .subtitel {
  margin: 2px 0 0;
  font-size: 13px;
  opacity: 0.9;
}

/* --- Tabs ----------------------------------------------------------------- */
.tabs {
  display: flex;
  overflow-x: auto;
  background: #fff;
  border-bottom: 1px solid var(--lijn);
  position: sticky;
  top: 0;
  z-index: 10;
  -webkit-overflow-scrolling: touch;
}
.tab {
  flex: 0 0 auto;
  min-height: var(--raakdoel);
  padding: 10px 18px;
  border: 0;
  background: transparent;
  color: var(--tekst-zacht);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  border-bottom: 3px solid transparent;
}
.tab.actief {
  color: var(--accent-donker);
  border-bottom-color: var(--accent);
}
.tab.uit {
  color: #bbb;
  cursor: not-allowed;
}

/* --- Schermen ------------------------------------------------------------- */
.scherm {
  display: none;
  padding: 14px 16px 40px;
}
.scherm.actief { display: block; }

.scherm h2 { font-size: 20px; margin: 12px 0 4px; }
.scherm h3 { font-size: 16px; margin: 18px 0 6px; color: var(--tekst); }
.scherm p  { margin: 8px 0; }

/* --- Navigatiebalk (dropdown + < >) --------------------------------------- */
.nav-balk {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px;
  align-items: center;
  background: var(--paneel);
  border: 1px solid var(--lijn);
  border-radius: 10px;
  padding: 8px;
  margin: 6px 0 14px;
}
.nav-balk select {
  width: 100%;
  min-height: var(--raakdoel);
  font-size: 16px;
  padding: 4px 8px;
  border: 1px solid var(--lijn);
  border-radius: 8px;
  background: #fff;
  color: var(--tekst);
  -webkit-appearance: none;
  appearance: none;
}
.nav-balk button {
  min-width: var(--raakdoel);
  min-height: var(--raakdoel);
  border: 1px solid var(--lijn);
  background: #fff;
  border-radius: 8px;
  font-size: 20px;
  font-weight: 600;
  color: var(--accent-donker);
  cursor: pointer;
}
.nav-balk button:disabled { color: #ccc; cursor: not-allowed; }

/* --- Dag-badge ------------------------------------------------------------ */
.badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.badge {
  display: inline-block;
  padding: 3px 10px;
  font-size: 13px;
  border-radius: 999px;
  background: var(--paneel);
  color: var(--tekst-zacht);
}
.badge.fietsdag  { background: #fef3c7; color: #8a5a00; }
.badge.rustdag   { background: #e6f4ea; color: #1e5a2a; }
.badge.buffer    { background: #fff4e0; color: #7a4b00; }
.badge.reisdag   { background: #f0e6ff; color: #4a2a7a; }

/* --- Info-blok ------------------------------------------------------------ */
.blok {
  background: var(--paneel);
  border: 1px solid var(--lijn);
  border-radius: 10px;
  padding: 12px 14px;
  margin: 10px 0;
}
.blok .label {
  font-size: 12px;
  color: var(--tekst-zacht);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.blok .waarde {
  font-size: 17px;
  margin-top: 2px;
  color: var(--tekst);
}
.blok .waarde strong { color: var(--tekst); }

.grote-cijfer {
  font-size: 32px;
  font-weight: 700;
  line-height: 1;
  color: var(--accent-donker);
}

/* --- Knoppenrij ----------------------------------------------------------- */
.knoppen {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 4px;
}
.knop {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: var(--raakdoel);
  padding: 8px 14px;
  border: 1px solid var(--accent);
  background: #fff;
  color: var(--accent-donker);
  border-radius: 22px;
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
}
.knop.primair {
  background: var(--accent);
  color: #fff;
}
.knop.klein {
  min-height: 36px;
  padding: 4px 10px;
  font-size: 13px;
  border-radius: 18px;
}

/* --- Item-kaartjes (POI's) ------------------------------------------------ */
.categorie-titel {
  margin: 22px 0 6px;
  font-size: 17px;
  font-weight: 700;
  color: var(--accent-donker);
  border-bottom: 2px solid var(--accent);
  padding-bottom: 4px;
}
.item {
  padding: 10px 0;
  border-bottom: 1px solid var(--lijn);
}
.item:last-child { border-bottom: 0; }
.item .naam {
  font-size: 16px;
  font-weight: 600;
}
.item .sub-tag {
  display: inline-block;
  margin-left: 6px;
  font-size: 11px;
  font-weight: 500;
  color: var(--tekst-zacht);
  background: var(--paneel);
  border-radius: 6px;
  padding: 1px 6px;
  vertical-align: middle;
}
.item .categorie-tag {
  font-size: 12px;
  color: var(--tekst-zacht);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.item .details {
  margin: 4px 0 6px;
  color: var(--tekst);
  font-size: 15px;
}
.item .meta {
  font-size: 13px;
  color: var(--tekst-zacht);
  margin: 2px 0;
}
.item .status {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  margin-top: 4px;
}
.item .status.warn {
  background: var(--waarschuw-bg);
  color: var(--waarschuw);
}
.item .status.ok {
  background: #eaf5ea;
  color: var(--ok);
}

/* --- Vandaag: kritisch pad ------------------------------------------------ */
.kritisch {
  border-left: 4px solid var(--waarschuw);
  background: var(--waarschuw-bg);
  padding: 10px 12px;
  border-radius: 6px;
  margin: 10px 0;
  font-size: 14px;
}
.kritisch strong { color: var(--waarschuw); }

/* --- Kaart-scherm --------------------------------------------------------- */
.kaart-wrap {
  position: relative;
  margin: 4px 0 10px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--lijn);
}
.kaart-groot { height: 70vh; min-height: 400px; }
.kaart-mini  { height: 220px; }
.kaart-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  padding: 8px 4px;
  font-size: 14px;
}
.kaart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 12px;
  color: var(--tekst-zacht);
  padding: 2px 4px 10px;
}
.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.legend-lijn {
  display: inline-block;
  width: 22px;
  height: 3px;
  border-radius: 2px;
}
.legend-lijn.gestreept {
  background-image: linear-gradient(to right, currentColor 60%, transparent 60%);
  background-size: 6px 3px;
  background-repeat: repeat-x;
  height: 3px;
  background-color: transparent;
}

/* Toggle switch */
.toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}
.toggle input {
  appearance: none;
  -webkit-appearance: none;
  width: 40px;
  height: 24px;
  border-radius: 12px;
  background: #ccc;
  position: relative;
  cursor: pointer;
  transition: background 0.15s;
}
.toggle input::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.15s;
}
.toggle input:checked {
  background: var(--accent);
}
.toggle input:checked::after {
  transform: translateX(16px);
}

/* Marker labels */
.plaats-marker-label {
  background: rgba(255,255,255,0.92);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid rgba(0,0,0,0.15);
  font-size: 12px;
  font-weight: 600;
  color: var(--tekst);
  white-space: nowrap;
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

/* --- Etappes-scherm ------------------------------------------------------- */
.etappe-lijst { list-style: none; padding: 0; margin: 8px 0; }
.etappe-rij {
  display: grid;
  grid-template-columns: 42px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 12px 8px;
  border-bottom: 1px solid var(--lijn);
  cursor: pointer;
  min-height: var(--raakdoel);
}
.etappe-rij:hover { background: #f5f9fd; }
.etappe-nr {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
}
.etappe-nr.variant { background: transparent; color: var(--accent-donker); border: 2px dashed var(--accent); }
.etappe-nr.excursie { background: #7c4a9c; }
.etappe-content .titel {
  font-size: 15px;
  font-weight: 600;
}
.etappe-content .meta {
  font-size: 13px;
  color: var(--tekst-zacht);
  margin-top: 2px;
}
.etappe-content .veer {
  color: var(--waarschuw);
  font-weight: 500;
}
.chevron {
  font-size: 22px;
  color: var(--tekst-zacht);
  padding-right: 4px;
}

.etappe-detail-terug {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: var(--raakdoel);
  padding: 10px 18px;
  background: var(--accent);
  border: 0;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  border-radius: 22px;
  cursor: pointer;
  margin: 2px 0 14px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.etappe-detail-terug:hover { background: var(--accent-donker); }
.etappe-detail-terug::before {
  content: "‹";
  font-size: 22px;
  line-height: 1;
  font-weight: 700;
  margin-right: 2px;
}

/* --- Filter-chips (op scherm Plaats) -------------------------------------- */
.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0 14px;
}
.filter-chip {
  min-height: 36px;
  padding: 6px 12px;
  border: 1px solid var(--lijn);
  background: #fff;
  color: var(--tekst);
  border-radius: 20px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
}
.filter-chip .aantal {
  display: inline-block;
  margin-left: 4px;
  padding: 0 6px;
  background: var(--paneel);
  color: var(--tekst-zacht);
  border-radius: 10px;
  font-size: 12px;
}
.filter-chip.actief {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.filter-chip.actief .aantal {
  background: rgba(255,255,255,0.25);
  color: #fff;
}
.filter-chip.leeg {
  color: #bbb;
  cursor: not-allowed;
}

/* --- Notitieveld ---------------------------------------------------------- */
.notitie-blok, .praktisch-blok {
  margin: 16px 0;
  border: 1px solid var(--lijn);
  border-radius: 10px;
  padding: 12px 14px;
  background: #fff;
}
.notitie-blok h3 { margin-top: 0; }
.notitie-blok textarea, .praktisch-blok textarea {
  width: 100%;
  min-height: 90px;
  padding: 10px;
  border: 1px solid var(--lijn);
  border-radius: 8px;
  font-family: inherit;
  font-size: 15px;
  line-height: 1.4;
  resize: vertical;
  box-sizing: border-box;
}
.opslag-status {
  font-size: 12px;
  color: var(--tekst-zacht);
  margin-top: 6px;
  min-height: 16px;
}
.opslag-status.opgeslagen { color: var(--ok); }

/* --- AI-blok -------------------------------------------------------------- */
.ai-blok {
  margin: 20px 0;
  border: 2px solid var(--accent);
  border-radius: 12px;
  padding: 14px;
  background: #f2f6fb;
}
.ai-blok h3 { margin-top: 0; }
.ai-blok textarea {
  width: 100%;
  min-height: 60px;
  padding: 10px;
  border: 1px solid var(--lijn);
  border-radius: 8px;
  font-family: inherit;
  font-size: 15px;
  box-sizing: border-box;
}
.ai-antwoord {
  margin-top: 12px;
  padding: 12px;
  background: #fff;
  border: 1px solid var(--lijn);
  border-radius: 8px;
  white-space: pre-wrap;
  font-size: 15px;
  line-height: 1.5;
}
.ai-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  margin-left: 6px;
  vertical-align: middle;
}
.ai-badge.stub { background: #fff4e0; color: #7a4b00; }
.ai-badge.live { background: #eaf5ea; color: var(--ok); }
.ai-fout { color: var(--waarschuw); font-size: 14px; margin-top: 8px; }

/* --- Checklist ------------------------------------------------------------ */
.checklist-groep { margin-top: 14px; }
.checklist-groep-titel {
  font-size: 15px;
  font-weight: 700;
  color: var(--accent-donker);
  margin: 12px 0 4px;
}
.checklist-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 4px;
  border-bottom: 1px solid var(--lijn);
  min-height: 40px;
}
.checklist-item input[type="checkbox"] {
  width: 22px;
  height: 22px;
  cursor: pointer;
  accent-color: var(--accent);
  flex-shrink: 0;
}
.checklist-item.done .naam {
  text-decoration: line-through;
  color: var(--tekst-zacht);
}
.checklist-item .naam { flex: 1; font-size: 15px; }
.checklist-item .verwijder {
  background: transparent;
  border: 0;
  color: var(--tekst-zacht);
  font-size: 22px;
  cursor: pointer;
  padding: 2px 10px;
  border-radius: 4px;
  line-height: 1;
}
.checklist-item .verwijder:hover { color: var(--waarschuw); background: #f5f5f5; }
.checklist-add {
  display: flex;
  gap: 6px;
  margin: 8px 0 4px;
}
.checklist-add input {
  flex: 1;
  min-height: 40px;
  padding: 6px 10px;
  border: 1px solid var(--lijn);
  border-radius: 6px;
  font-size: 15px;
}
.checklist-add button {
  min-height: 40px;
  padding: 4px 14px;
  background: var(--accent);
  color: #fff;
  border: 0;
  border-radius: 6px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

/* --- Instellingen --------------------------------------------------------- */
.instelling-rij {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--lijn);
  min-height: var(--raakdoel);
}
.instelling-rij .label { font-size: 15px; font-weight: 500; }
.instelling-rij .beschrijving { font-size: 12px; color: var(--tekst-zacht); }
.export-knop {
  min-height: var(--raakdoel);
  padding: 10px 16px;
  background: var(--accent);
  color: #fff;
  border: 0;
  border-radius: 22px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  margin: 4px 0;
}
.export-knop.zacht { background: #fff; color: var(--accent-donker); border: 1px solid var(--accent); }

/* --- Voet ----------------------------------------------------------------- */
.voet {
  text-align: center;
  color: var(--tekst-zacht);
  font-size: 12px;
  padding: 14px 0 max(env(safe-area-inset-bottom), 14px);
  border-top: 1px solid var(--lijn);
  margin-top: 20px;
}
