/* ================================================================
   SplitSun — app.css
   Mobiel-first (390px), zomers design
   ================================================================ */

/* ── Custom properties ─────────────────────────────────────────── */
:root {
  --kleur-zon:      #F5A623;
  --kleur-zon-licht:#FFC85E;
  --kleur-zon-donker:#D4880F;
  --kleur-lucht:    #2E86AB;
  --kleur-lucht-licht:#5BB3D0;
  --kleur-zand:     #FFF8F0;
  --kleur-tekst:    #1A1A2E;
  --kleur-tekst-licht: #6B6B85;
  --kleur-succes:   #27AE60;
  --kleur-gevaar:   #E74C3C;
  --kleur-lijn:     #E8DDD0;
  --kleur-kaart:    #FFFFFF;

  --radius-klein:   8px;
  --radius-middel:  14px;
  --radius-groot:   20px;
  --radius-rond:    999px;

  --schaduw-zacht:  0 2px 8px rgba(26,26,46,0.08);
  --schaduw-middel: 0 4px 16px rgba(26,26,46,0.12);
  --schaduw-groot:  0 8px 32px rgba(26,26,46,0.16);

  --tab-hoogte: 68px;
  --header-hoogte: 56px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* ── Reset & base ───────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  overscroll-behavior: none;
}

body {
  font-family: 'Nunito', system-ui, sans-serif;
  font-size: 16px;
  background: var(--kleur-zand);
  color: var(--kleur-tekst);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  margin: 0;
  line-height: 1.2;
}

p { margin: 0; }

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  outline: none;
  transition: transform 0.1s, opacity 0.1s;
}

button:active { transform: scale(0.96); }

input, select, textarea {
  font-family: inherit;
  font-size: 16px;
  outline: none;
  border: none;
}

/* ── App wrapper ────────────────────────────────────────────────── */
#app {
  position: fixed;
  inset: 0;
  overflow: hidden;
}

/* ── Views ──────────────────────────────────────────────────────── */
.view {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  background: var(--kleur-zand);
  overflow: hidden;
}

.view.active {
  display: flex;
}

.view-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px 16px calc(var(--tab-hoogte) + var(--safe-bottom) + 16px);
  -webkit-overflow-scrolling: touch;
}

/* Views zonder tab-bar: geen extra bottom padding */
#view-pin .view-content,
#view-nieuwe-trip .view-content,
#view-uitgave-form .view-content,
#view-uitgave-detail .view-content,
#view-loading .view-content {
  padding-bottom: 24px;
}

/* ── Header ─────────────────────────────────────────────────────── */
.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  height: var(--header-hoogte);
  background: var(--kleur-kaart);
  border-bottom: 1px solid var(--kleur-lijn);
  box-shadow: var(--schaduw-zacht);
  flex-shrink: 0;
  padding-top: env(safe-area-inset-top, 0px);
  height: calc(var(--header-hoogte) + env(safe-area-inset-top, 0px));
}

.header-back {
  gap: 12px;
}

.header-titel {
  flex: 1;
  font-size: 18px;
  font-weight: 700;
}

.app-naam {
  font-family: 'Lobster', cursive;
  font-size: 26px;
  color: var(--kleur-zon-donker);
  letter-spacing: 0.5px;
}

.subkop {
  font-size: 13px;
  color: var(--kleur-tekst-licht);
  margin-top: 2px;
}

/* ── Tab bar ─────────────────────────────────────────────────────── */
.tab-bar {
  display: flex;
  background: var(--kleur-kaart);
  border-top: 1px solid var(--kleur-lijn);
  height: calc(var(--tab-hoogte) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  flex-shrink: 0;
}

.tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  background: transparent;
  color: var(--kleur-tekst-licht);
  font-size: 11px;
  font-weight: 600;
  padding: 8px 4px;
  transition: color 0.15s;
}

.tab.actief {
  color: var(--kleur-zon-donker);
}

.tab-icon {
  font-size: 22px;
  line-height: 1;
}

/* ── Loading screen ─────────────────────────────────────────────── */
.loading-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 12px;
}

.app-logo-big {
  font-size: 72px;
  animation: zonsopkomst 1.5s ease-in-out infinite alternate;
}

@keyframes zonsopkomst {
  from { transform: translateY(4px); filter: brightness(0.9); }
  to   { transform: translateY(-4px); filter: brightness(1.1); }
}

.app-naam-groot {
  font-family: 'Lobster', cursive;
  font-size: 48px;
  color: var(--kleur-zon-donker);
}

.spinner {
  width: 28px;
  height: 28px;
  border: 3px solid var(--kleur-lijn);
  border-top-color: var(--kleur-zon);
  border-radius: 50%;
  animation: draaien 0.8s linear infinite;
}

@keyframes draaien {
  to { transform: rotate(360deg); }
}

/* ── Trips overzicht ────────────────────────────────────────────── */
.trips-lijst {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.trip-kaart {
  background: var(--kleur-kaart);
  border-radius: var(--radius-middel);
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--schaduw-zacht);
  cursor: pointer;
  border: 1px solid var(--kleur-lijn);
  transition: box-shadow 0.15s, transform 0.1s;
}

.trip-kaart:active {
  box-shadow: var(--schaduw-middel);
  transform: scale(0.98);
}

.trip-kaart.gearchiveerd {
  opacity: 0.65;
}

.trip-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.trip-naam {
  font-size: 17px;
  font-weight: 700;
}

.trip-jaar {
  font-size: 14px;
  color: var(--kleur-tekst-licht);
}

.badge {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-rond);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-actief {
  background: #E8F8EF;
  color: var(--kleur-succes);
}

.badge-archief {
  background: var(--kleur-lijn);
  color: var(--kleur-tekst-licht);
}

/* ── PIN scherm ─────────────────────────────────────────────────── */
.pin-scherm {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
  padding-top: 40px;
}

.pin-instructie {
  font-size: 17px;
  color: var(--kleur-tekst-licht);
}

.pin-dots {
  display: flex;
  gap: 16px;
}

.dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--kleur-zon);
  background: transparent;
  transition: background 0.15s;
}

.dot.gevuld {
  background: var(--kleur-zon);
}

.numpad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  width: 100%;
  max-width: 280px;
}

.numpad-knop {
  aspect-ratio: 1;
  background: var(--kleur-kaart);
  border-radius: var(--radius-middel);
  font-size: 24px;
  font-weight: 700;
  color: var(--kleur-tekst);
  box-shadow: var(--schaduw-zacht);
  border: 1px solid var(--kleur-lijn);
  min-height: 68px;
}

.numpad-knop:active {
  background: var(--kleur-zon-licht);
}

.numpad-leeg {
  background: transparent;
  box-shadow: none;
  border-color: transparent;
}

.numpad-wis {
  color: var(--kleur-gevaar);
}

/* ── Formulieren ────────────────────────────────────────────────── */
.formulier {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.veld {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.veld label {
  font-size: 14px;
  font-weight: 700;
  color: var(--kleur-tekst-licht);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.veld input[type="text"],
.veld input[type="number"],
.veld input[type="password"] {
  background: var(--kleur-kaart);
  border: 1.5px solid var(--kleur-lijn);
  border-radius: var(--radius-klein);
  padding: 14px 16px;
  font-size: 16px;
  color: var(--kleur-tekst);
  width: 100%;
  transition: border-color 0.15s;
}

.veld input:focus {
  border-color: var(--kleur-zon);
}

.deelnemer-rij {
  display: flex;
  gap: 8px;
  align-items: center;
}

.deelnemer-rij input {
  flex: 1;
  background: var(--kleur-kaart);
  border: 1.5px solid var(--kleur-lijn);
  border-radius: var(--radius-klein);
  padding: 12px 14px;
  font-size: 15px;
  color: var(--kleur-tekst);
}

/* ── Bedrag + valuta toggle ─────────────────────────────────────── */
.bedrag-rij {
  display: flex;
  gap: 10px;
  align-items: center;
}

.bedrag-rij input {
  flex: 1;
  background: var(--kleur-kaart);
  border: 1.5px solid var(--kleur-lijn);
  border-radius: var(--radius-klein);
  padding: 14px 16px;
  font-size: 20px;
  font-weight: 700;
}

.valuta-toggle {
  display: flex;
  background: var(--kleur-lijn);
  border-radius: var(--radius-rond);
  padding: 3px;
  gap: 3px;
}

.valuta-knop {
  padding: 8px 14px;
  border-radius: var(--radius-rond);
  font-size: 13px;
  font-weight: 700;
  background: transparent;
  color: var(--kleur-tekst-licht);
  transition: background 0.15s, color 0.15s;
}

.valuta-knop.actief {
  background: var(--kleur-zon);
  color: white;
}

.dkk-hint {
  font-size: 14px;
  color: var(--kleur-lucht);
  font-weight: 600;
  padding-left: 4px;
}

/* ── Persoon knoppen (betaler / voor wie) ───────────────────────── */
.personen-knoppen {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.persoon-knop {
  padding: 10px 16px;
  border-radius: var(--radius-rond);
  font-size: 14px;
  font-weight: 700;
  background: var(--kleur-kaart);
  color: var(--kleur-tekst);
  border: 1.5px solid var(--kleur-lijn);
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.persoon-knop.actief {
  background: var(--kleur-zon);
  color: white;
  border-color: var(--kleur-zon);
}

.voor-wie-header {
  display: flex;
  gap: 12px;
  margin-bottom: 4px;
}

/* ── Foto knoppen ───────────────────────────────────────────────── */
.foto-knoppen-rij {
  display: flex;
  gap: 10px;
}

/* ── Foto upload ────────────────────────────────────────────────── */
.foto-upload-gebied {
  background: var(--kleur-kaart);
  border: 2px dashed var(--kleur-lijn);
  border-radius: var(--radius-middel);
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: border-color 0.15s;
}

.foto-upload-gebied:active {
  border-color: var(--kleur-zon);
}

.foto-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--kleur-tekst-licht);
  font-size: 14px;
  font-weight: 600;
}

.foto-icon {
  font-size: 32px;
}

.foto-preview-container {
  width: 100%;
  position: relative;
}

.foto-preview-container img {
  width: 100%;
  max-height: 200px;
  object-fit: cover;
  border-radius: var(--radius-klein);
}

.foto-verwijder-knop {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  background: rgba(0,0,0,0.55);
  color: white;
  border-radius: 50%;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Bubbel visualisatie ────────────────────────────────────────── */
.bubble-sectie {
  background: linear-gradient(145deg, #F5A623 0%, #D4880F 60%, #2E86AB 100%);
  border-radius: var(--radius-groot);
  padding: 16px 16px 12px;
  margin-bottom: 20px;
  box-shadow: var(--schaduw-middel);
  overflow: hidden;
}

.bubble-totaal-rij {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 8px;
}

.bubble-totaal-label {
  font-size: 12px;
  font-weight: 700;
  color: rgba(255,255,255,0.75);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.bubble-totaal-bedrag {
  font-size: 22px;
  font-weight: 800;
  color: white;
}

.bubble-container {
  position: relative;
  width: 100%;
  overflow: hidden;
}

.bubble {
  position: absolute;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 8px;
  transition: transform 0.2s;
  cursor: default;
}

.bubble:active { transform: scale(0.96); }

.bubble-neg {
  background: rgba(26, 26, 46, 0.82);
  backdrop-filter: blur(4px);
  border: 1.5px solid rgba(255,255,255,0.1);
}

.bubble-pos {
  background: rgba(255, 255, 255, 0.58);
  backdrop-filter: blur(4px);
  border: 2px solid rgba(255,255,255,0.9);
  box-shadow: 0 2px 12px rgba(0,0,0,0.15);
}

.bubble-pos .bubble-naam,
.bubble-pos .bubble-bedrag { color: rgba(26,26,46,0.92); }

.bubble-naam {
  font-size: 11px;
  font-weight: 700;
  color: rgba(255,255,255,0.85);
  line-height: 1.2;
  max-width: 90%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bubble-bedrag {
  font-size: 13px;
  font-weight: 800;
  color: white;
  line-height: 1.3;
  max-width: 90%;
}

.bubble-label {
  font-size: 9px;
  color: rgba(255,255,255,0.65);
  margin-top: 2px;
  text-transform: lowercase;
}

.bubble-quitte {
  text-align: center;
  color: rgba(255,255,255,0.85);
  font-size: 15px;
  font-weight: 600;
  padding: 32px 0;
}

/* ── Dashboard ──────────────────────────────────────────────────── */
.dashboard-totaal {
  background: linear-gradient(135deg, var(--kleur-zon), var(--kleur-zon-donker));
  border-radius: var(--radius-groot);
  padding: 20px 24px;
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-shadow: var(--schaduw-middel);
}

.totaal-label {
  font-size: 13px;
  color: rgba(255,255,255,0.8);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.totaal-bedrag {
  font-size: 36px;
  font-weight: 800;
  color: white;
}

.totaal-balk {
  background: var(--kleur-kaart);
  border-radius: var(--radius-klein);
  padding: 12px 16px;
  font-size: 15px;
  color: var(--kleur-tekst-licht);
  margin-bottom: 12px;
  border: 1px solid var(--kleur-lijn);
}

/* ── Uitgaven lijst ─────────────────────────────────────────────── */
.uitgaven-lijst {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.uitgave-rij {
  background: var(--kleur-kaart);
  border-radius: var(--radius-middel);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-shadow: var(--schaduw-zacht);
  border: 1px solid var(--kleur-lijn);
  cursor: pointer;
  transition: box-shadow 0.15s;
}

.uitgave-rij:active {
  box-shadow: var(--schaduw-middel);
}

.uitgave-rij-links {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.uitgave-beschrijving {
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.uitgave-meta {
  font-size: 12px;
  color: var(--kleur-tekst-licht);
}

.uitgave-voor-wie {
  font-size: 12px;
  color: var(--kleur-lucht);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.uitgave-bedrag {
  font-size: 16px;
  font-weight: 800;
  color: var(--kleur-tekst);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── FAB ────────────────────────────────────────────────────────── */
.fab {
  position: fixed;
  bottom: calc(var(--tab-hoogte) + var(--safe-bottom) + 16px);
  right: 20px;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--kleur-zon);
  color: white;
  font-size: 32px;
  font-weight: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--schaduw-groot);
  z-index: 100;
  line-height: 1;
  padding-bottom: 2px;
}

.fab:active {
  background: var(--kleur-zon-donker);
}

/* ── Sectie kop ─────────────────────────────────────────────────── */
.sectie-kop {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.sectie-kop h2 {
  font-size: 17px;
  font-weight: 700;
}

.sectie-tussenkop {
  font-size: 15px;
  font-weight: 700;
  color: var(--kleur-tekst-licht);
  margin: 20px 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ── Persoon selector & overzicht ───────────────────────────────── */
.persoon-selector {
  margin-bottom: 20px;
}

.persoon-selector-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--kleur-tekst-licht);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}

.persoon-overzicht {
  margin-bottom: 24px;
}

.persoon-balans-kaart {
  border-radius: var(--radius-middel);
  padding: 16px 20px;
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.persoon-balans-positief {
  background: linear-gradient(135deg, #E8F8EF, #C8F0DA);
  border: 1.5px solid #A8E0C0;
}

.persoon-balans-negatief {
  background: linear-gradient(135deg, #FEF0EF, #FDDEDE);
  border: 1.5px solid #F5B8B8;
}

.persoon-balans-neutraal {
  background: var(--kleur-kaart);
  border: 1.5px solid var(--kleur-lijn);
}

.persoon-naam-groot {
  font-size: 20px;
  font-weight: 800;
  color: var(--kleur-tekst);
}

.persoon-balans-tekst {
  font-size: 15px;
  font-weight: 600;
  color: var(--kleur-tekst);
}

.persoon-transacties {
  background: var(--kleur-kaart);
  border-radius: var(--radius-middel);
  border: 1px solid var(--kleur-lijn);
  overflow: hidden;
  margin-bottom: 10px;
}

.persoon-transacties .sectie-tussenkop {
  padding: 10px 16px 6px;
  margin: 0;
  border-bottom: 1px solid var(--kleur-lijn);
}

.persoon-trans-rij {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--kleur-lijn);
}

.persoon-trans-rij:last-child {
  border-bottom: none;
}

.persoon-trans-naam {
  font-size: 15px;
  font-weight: 700;
}

.persoon-trans-bedrag {
  font-size: 16px;
  font-weight: 800;
}

.positief-tekst { color: var(--kleur-succes); }
.negatief-tekst { color: var(--kleur-gevaar); }

/* ── Verrekening ────────────────────────────────────────────────── */
.balans-lijst {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 8px;
}

.balans-rij {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--kleur-kaart);
  border-radius: var(--radius-klein);
  border: 1px solid var(--kleur-lijn);
}

.balans-naam {
  font-weight: 700;
  font-size: 15px;
}

.balans-bedrag {
  font-size: 15px;
  font-weight: 800;
}

.balans-rij.positief .balans-bedrag { color: var(--kleur-succes); }
.balans-rij.negatief .balans-bedrag { color: var(--kleur-gevaar); }
.balans-rij.neutraal .balans-bedrag { color: var(--kleur-tekst-licht); }

.transacties-lijst {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.transactie-kaart {
  background: var(--kleur-kaart);
  border-radius: var(--radius-middel);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-shadow: var(--schaduw-zacht);
  border: 1px solid var(--kleur-lijn);
}

.transactie-info {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  flex: 1;
}

.transactie-van {
  font-weight: 700;
  font-size: 15px;
}

.transactie-pijl {
  color: var(--kleur-tekst-licht);
}

.transactie-aan {
  font-weight: 700;
  font-size: 15px;
}

.transactie-bedrag {
  font-size: 15px;
  font-weight: 800;
  color: var(--kleur-gevaar);
}

.transactie-acties {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-shrink: 0;
}

/* ── Betaalverzoek banner ────────────────────────────────────────── */
.betaalverzoek-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  background: var(--kleur-accent, #6366f1);
  color: #fff;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.25);
}

.betaalverzoek-banner #betaalverzoek-tekst {
  font-size: 15px;
  font-weight: 600;
}

.betaalverzoek-knoppen {
  display: flex;
  gap: 8px;
}

.betaalverzoek-knoppen .knop-ghost {
  color: #fff;
  border-color: rgba(255,255,255,0.5);
}

.betaald-sectie {
  margin-top: 16px;
}

.betaald-rij {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--kleur-kaart);
  border-radius: var(--radius-klein);
  border: 1px solid var(--kleur-lijn);
  font-size: 14px;
  color: var(--kleur-tekst-licht);
  margin-top: 6px;
  text-decoration: line-through;
}

/* ── Persoonlijk aandeel per uitgave ────────────────────────────── */
.persoon-uitgaven {
  margin-top: 16px;
}

.persoon-uitgaven-rij {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: var(--radius-klein);
  border: 1px solid var(--kleur-lijn);
  background: var(--kleur-kaart);
  margin-top: 4px;
  font-size: 13px;
}

.persoon-uitgaven-naam {
  flex: 1;
  font-weight: 600;
}

.persoon-uitgaven-totaal-bedrag {
  color: var(--kleur-tekst-licht);
  font-size: 12px;
  white-space: nowrap;
}

.persoon-uitgaven-aandeel {
  font-weight: 700;
  white-space: nowrap;
  min-width: 52px;
  text-align: right;
}

.persoon-uitgaven-totaal {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px 0;
  font-weight: 700;
  font-size: 14px;
  border-top: 1px solid var(--kleur-lijn);
  margin-top: 8px;
}

/* ── Geldstromen diagram ────────────────────────────────────────── */
.geldstromen-sectie {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--kleur-lijn);
}

.geldstromen-svg {
  width: 100%;
  max-height: 300px;
  display: block;
  background: var(--kleur-kaart);
  border-radius: var(--radius-klein);
  border: 1px solid var(--kleur-lijn);
}

.transactie-detail-lijst {
  margin-top: 16px;
}

.detail-rij {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-klein);
  margin-top: 6px;
  font-size: 13px;
}

.detail-rij-uitgave {
  background: color-mix(in srgb, var(--kleur-kaart) 90%, #6366f1 10%);
  border: 1px solid var(--kleur-lijn);
}

.detail-rij-verrekening {
  background: color-mix(in srgb, var(--kleur-kaart) 90%, #22c55e 10%);
  border: 1px solid #22c55e44;
}

.detail-icoon {
  font-size: 15px;
  flex-shrink: 0;
  margin-top: 1px;
}

.detail-omschrijving {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.detail-sub {
  font-size: 11px;
  color: var(--kleur-tekst-licht);
}

.detail-bedrag {
  font-weight: 700;
  white-space: nowrap;
  color: var(--kleur-tekst);
}

/* ── Handmatige verrekening ─────────────────────────────────────── */
.handmatig-verrekening-sectie {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--kleur-lijn);
}

.handmatig-verrekening-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

.handmatig-select {
  flex: 1;
  min-width: 100px;
  padding: 8px 10px;
  border: 1px solid var(--kleur-lijn);
  border-radius: var(--radius-klein);
  background: var(--kleur-kaart);
  color: var(--kleur-tekst);
  font-size: 14px;
}

.handmatig-label {
  font-size: 13px;
  color: var(--kleur-tekst-licht);
  white-space: nowrap;
}

.handmatig-bedrag {
  width: 110px;
  padding: 8px 10px;
  border: 1px solid var(--kleur-lijn);
  border-radius: var(--radius-klein);
  background: var(--kleur-kaart);
  color: var(--kleur-tekst);
  font-size: 14px;
}

/* ── Instellingen ───────────────────────────────────────────────── */
.instellingen-sectie {
  background: var(--kleur-kaart);
  border-radius: var(--radius-middel);
  padding: 16px;
  margin-bottom: 16px;
  border: 1px solid var(--kleur-lijn);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.instellingen-sectie h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--kleur-tekst-licht);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.instellingen-gevaar {
  border-color: #FDDEDE;
}

.koers-rij {
  display: flex;
  gap: 10px;
  align-items: center;
}

.koers-rij input {
  flex: 1;
  background: var(--kleur-zand);
  border: 1.5px solid var(--kleur-lijn);
  border-radius: var(--radius-klein);
  padding: 12px 14px;
}

.deelnemers-beheer {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.deelnemer-instelling-rij {
  display: flex;
  gap: 8px;
  align-items: center;
}

.deelnemer-naam-invoer {
  flex: 1;
  background: var(--kleur-zand);
  border: 1.5px solid var(--kleur-lijn);
  border-radius: var(--radius-klein);
  padding: 10px 12px;
  font-size: 15px;
  color: var(--kleur-tekst);
}

/* ── Detail view ────────────────────────────────────────────────── */
.detail-kaart {
  background: var(--kleur-kaart);
  border-radius: var(--radius-middel);
  overflow: hidden;
  border: 1px solid var(--kleur-lijn);
}

.detail-rij {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 14px 16px;
  border-bottom: 1px solid var(--kleur-lijn);
  gap: 12px;
}

.detail-rij:last-of-type {
  border-bottom: none;
}

.detail-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--kleur-tekst-licht);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  flex-shrink: 0;
}

.detail-foto {
  width: 100%;
}

.detail-foto img {
  width: 100%;
  max-height: 300px;
  object-fit: cover;
}

/* ── Knoppen ────────────────────────────────────────────────────── */
.knop-primair {
  background: var(--kleur-zon);
  color: white;
  border-radius: var(--radius-rond);
  padding: 14px 24px;
  font-size: 15px;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(245,166,35,0.4);
}

.knop-primair:active {
  background: var(--kleur-zon-donker);
}

.knop-ghost {
  background: transparent;
  color: var(--kleur-lucht);
  border-radius: var(--radius-rond);
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 700;
  border: 1.5px solid var(--kleur-lucht);
}

.knop-gevaar {
  background: var(--kleur-gevaar);
  color: white;
  border-radius: var(--radius-rond);
  padding: 14px 24px;
  font-size: 15px;
  font-weight: 700;
}

.knop-gevaar-outline {
  background: transparent;
  color: var(--kleur-gevaar);
  border: 1.5px solid var(--kleur-gevaar);
  border-radius: var(--radius-rond);
  padding: 14px 24px;
  font-size: 15px;
  font-weight: 700;
}

.knop-succes {
  background: var(--kleur-succes);
  color: white;
  border-radius: var(--radius-rond);
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.knop-terug {
  background: transparent;
  color: var(--kleur-tekst);
  font-size: 22px;
  padding: 8px;
  border-radius: var(--radius-klein);
  flex-shrink: 0;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.knop-icon {
  background: transparent;
  font-size: 22px;
  padding: 8px;
  border-radius: var(--radius-klein);
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.knop-link {
  background: transparent;
  color: var(--kleur-lucht);
  font-size: 14px;
  font-weight: 700;
  padding: 4px 8px;
}

.knop-link-klein {
  background: transparent;
  color: var(--kleur-lucht);
  font-size: 13px;
  font-weight: 700;
  padding: 2px 0;
}

.knop-klein {
  padding: 8px 16px;
  font-size: 14px;
}

.knop-breed {
  width: 100%;
}

.knop-gevaar-klein {
  background: #FDDEDE;
  color: var(--kleur-gevaar);
  border-radius: var(--radius-klein);
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 700;
  min-width: 36px;
  min-height: 36px;
}

.veld-knoppen {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}

/* ── Feedback elementen ─────────────────────────────────────────── */
.foutmelding {
  color: var(--kleur-gevaar);
  font-size: 14px;
  font-weight: 600;
  padding: 10px 14px;
  background: #FEF0EF;
  border-radius: var(--radius-klein);
  border: 1px solid #FDDEDE;
}

.leeg-tekst {
  text-align: center;
  color: var(--kleur-tekst-licht);
  font-size: 15px;
  padding: 32px 16px;
}

.laadindicator {
  text-align: center;
  color: var(--kleur-tekst-licht);
  font-size: 15px;
  padding: 32px 16px;
}

/* ── Toast ──────────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: calc(var(--tab-hoogte) + var(--safe-bottom) + 12px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--kleur-tekst);
  color: white;
  padding: 12px 24px;
  border-radius: var(--radius-rond);
  font-size: 14px;
  font-weight: 600;
  box-shadow: var(--schaduw-groot);
  z-index: 1000;
  white-space: nowrap;
  max-width: calc(100vw - 32px);
  text-overflow: ellipsis;
  overflow: hidden;
  animation: toast-in 0.25s ease;
}

.toast.toast-succes { background: var(--kleur-succes); }
.toast.toast-fout   { background: var(--kleur-gevaar); }

@keyframes toast-in {
  from { opacity: 0; transform: translateX(-50%) translateY(8px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ── Verborgen utility ──────────────────────────────────────────── */
.verborgen { display: none !important; }

/* ── Admin ──────────────────────────────────────────────────────── */
.header-naam-blok { display: flex; flex-direction: column; }
.header-naam-rij { display: flex; align-items: center; gap: 6px; }

.admin-badge {
  font-size: 14px;
  background: var(--kleur-zon);
  border-radius: var(--radius-rond);
  padding: 1px 6px;
  font-weight: 700;
}

.admin-status-tekst {
  font-size: 13px;
  color: var(--kleur-tekst-licht);
  margin-bottom: 8px;
}

.admin-status-tekst.admin-actief {
  color: var(--kleur-succes);
  font-weight: 700;
}

.admin-scheiding {
  height: 1px;
  background: var(--kleur-lijn);
  margin: 14px 0;
}

.admin-sectie-titel {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--kleur-tekst);
}

.knop-admin-edit {
  background: transparent;
  font-size: 16px;
  padding: 4px;
  border-radius: var(--radius-klein);
  opacity: 0.7;
  flex-shrink: 0;
}

.knop-admin-edit:active { opacity: 1; }

.uitgave-rij-rechts {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

/* ── Modal ──────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26,26,46,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
  padding: 24px;
}

.modal-kaart {
  background: var(--kleur-kaart);
  border-radius: var(--radius-groot);
  padding: 24px;
  width: 100%;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: var(--schaduw-groot);
}

.modal-titel {
  font-size: 18px;
  font-weight: 800;
}

.modal-tekst {
  font-size: 14px;
  color: var(--kleur-tekst-licht);
}

.modal-invoer {
  background: var(--kleur-zand);
  border: 1.5px solid var(--kleur-lijn);
  border-radius: var(--radius-klein);
  padding: 14px 16px;
  font-size: 16px;
  font-family: inherit;
  width: 100%;
}

.modal-knoppen {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* ── CSV ────────────────────────────────────────────────────────── */
.csv-upload-rij {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.csv-bestandsnaam {
  font-size: 13px;
  color: var(--kleur-tekst-licht);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.csv-preview {
  background: var(--kleur-zand);
  border-radius: var(--radius-klein);
  padding: 10px;
  font-size: 12px;
  overflow-x: auto;
  margin-bottom: 8px;
}

.csv-fouten {
  color: var(--kleur-gevaar);
  margin-bottom: 8px;
  font-size: 12px;
}

.csv-fouten ul { margin: 4px 0 0 16px; padding: 0; }

.csv-tel { font-size: 13px; margin-bottom: 8px; }

.csv-tabel {
  border-collapse: collapse;
  width: 100%;
  font-size: 11px;
}

.csv-tabel th, .csv-tabel td {
  border: 1px solid var(--kleur-lijn);
  padding: 4px 6px;
  text-align: left;
  white-space: nowrap;
}

.csv-tabel th { background: var(--kleur-lijn); font-weight: 700; }
.csv-meer { text-align: center; color: var(--kleur-tekst-licht); font-style: italic; }

/* ── Locatie ────────────────────────────────────────────────────── */
.locatie-rij {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.locatie-status {
  font-size: 12px;
  color: var(--kleur-tekst-licht);
}

.locatie-status.locatie-ok { color: var(--kleur-succes); font-weight: 700; }
.locatie-status.locatie-fout { color: var(--kleur-gevaar); }

/* ── Kaart (Leaflet + stats) ────────────────────────────────────── */
.kaart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  flex-wrap: wrap;
  gap: 8px;
}

.kaart-toggle {
  display: flex;
  background: var(--kleur-lijn);
  border-radius: var(--radius-rond);
  padding: 3px;
  gap: 3px;
}

.kaart-toggle-knop {
  padding: 6px 12px;
  border-radius: var(--radius-rond);
  font-size: 12px;
  font-weight: 700;
  background: transparent;
  color: var(--kleur-tekst-licht);
  transition: background 0.15s, color 0.15s;
}

.kaart-toggle-knop.actief {
  background: var(--kleur-kaart);
  color: var(--kleur-tekst);
  box-shadow: var(--schaduw-zacht);
}

.kaart-stats {
  margin-bottom: 10px;
}

.kaart-stat-rij {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.kaart-stat {
  background: var(--kleur-zand);
  border-radius: var(--radius-klein);
  padding: 6px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  border: 1px solid var(--kleur-lijn);
}

.kaart-stat-duurste { flex: 1; }

.kaart-stat-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--kleur-tekst-licht);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.kaart-stat-waarde {
  font-size: 13px;
  font-weight: 800;
  color: var(--kleur-tekst);
}

/* ── Form hints ─────────────────────────────────────────────────── */
.label-optioneel { font-weight: 400; color: var(--kleur-tekst-licht); font-size: 12px; }
.veld-hint { font-size: 12px; color: var(--kleur-tekst-licht); margin-top: 4px; }

/* ── Statistieken ───────────────────────────────────────────────── */
.grafiek-kaart {
  background: var(--kleur-kaart);
  border-radius: var(--radius-middel);
  padding: 16px;
  margin-bottom: 16px;
  border: 1px solid var(--kleur-lijn);
  box-shadow: var(--schaduw-zacht);
}

.grafiek-titel {
  font-size: 15px;
  font-weight: 700;
  color: var(--kleur-tekst);
  margin-bottom: 12px;
}

.grafiek-wrapper {
  position: relative;
  width: 100%;
}

/* ── Uitgave thumbnail ──────────────────────────────────────────── */
.uitgave-thumbnail {
  width: 46px;
  height: 46px;
  border-radius: var(--radius-klein);
  object-fit: cover;
  flex-shrink: 0;
  border: 1.5px solid var(--kleur-lijn);
  box-shadow: var(--schaduw-zacht);
}

/* ── Foto strip (dashboard) ─────────────────────────────────────── */
.foto-strip {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.foto-strip::-webkit-scrollbar { display: none; }

.foto-strip-item {
  flex-shrink: 0;
  width: 82px;
  height: 82px;
  border-radius: var(--radius-middel);
  overflow: hidden;
  cursor: pointer;
  border: 2px solid var(--kleur-kaart);
  box-shadow: var(--schaduw-zacht);
  transition: transform 0.15s;
  position: relative;
}

.foto-strip-item:active { transform: scale(0.95); }

.foto-strip-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.foto-strip-item .strip-naam {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,0.6));
  color: white;
  font-size: 9px;
  font-weight: 700;
  padding: 8px 4px 3px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Galerij view ───────────────────────────────────────────────── */
.galerij-grid {
  columns: 2;
  column-gap: 10px;
}

.galerij-item {
  break-inside: avoid;
  margin-bottom: 10px;
  border-radius: var(--radius-middel);
  overflow: hidden;
  cursor: pointer;
  position: relative;
  box-shadow: var(--schaduw-zacht);
  border: 1px solid var(--kleur-lijn);
}

.galerij-item img {
  width: 100%;
  display: block;
  transition: transform 0.2s;
}

.galerij-item:active img { transform: scale(0.97); }

.galerij-item-info {
  padding: 8px 10px;
  background: var(--kleur-kaart);
}

.galerij-item-beschrijving {
  font-size: 12px;
  font-weight: 700;
  color: var(--kleur-tekst);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.galerij-item-meta {
  font-size: 11px;
  color: var(--kleur-tekst-licht);
}

/* ── Lightbox ───────────────────────────────────────────────────── */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.92);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.lightbox-overlay img {
  max-width: 100%;
  max-height: 85vh;
  border-radius: var(--radius-middel);
  object-fit: contain;
  box-shadow: var(--schaduw-groot);
}

.lightbox-sluit {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  background: rgba(255,255,255,0.15);
  color: white;
  border-radius: 50%;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: none;
}

.lightbox-info {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.6);
  color: white;
  padding: 8px 16px;
  border-radius: var(--radius-rond);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

/* ── Scrollbar (webkit) ─────────────────────────────────────────── */
.view-content::-webkit-scrollbar { width: 4px; }
.view-content::-webkit-scrollbar-thumb { background: var(--kleur-lijn); border-radius: 2px; }

/* ── Tablet / desktop (optioneel) ───────────────────────────────── */
@media (min-width: 640px) {
  #app {
    max-width: 440px;
    margin: 0 auto;
    box-shadow: var(--schaduw-groot);
  }

  body {
    background: linear-gradient(135deg, #FFF0D0 0%, #E8F4FF 100%);
  }
}
