:root {
  --bg: #EEF0EC;
  --surface: #FFFFFF;
  --ink: #1D2B2A;
  --muted: #5F6B68;
  --line: #D6DBD5;
  --herb: #2F6B4F;
  --herb-soft: #E3EEE7;
  --brass: #A86B12;
  --brass-soft: #F6EBD7;
  --closed: #9AA19E;
  --danger: #A33B2F;
  --radius-day: 14px;
  --radius-btn: 999px;
  --font-display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --font-body: "Public Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.wrap {
  max-width: 640px;
  margin: 0 auto;
  padding: calc(28px + env(safe-area-inset-top, 0px)) 18px 64px;
}

.wrap.breed { max-width: 1040px; }

.merk {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
  color: var(--muted);
  margin: 0 0 22px;
}

h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(34px, 8vw, 48px);
  line-height: 1.02;
  letter-spacing: -0.02em;
  margin: 0 0 10px;
}

h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 19px;
  margin: 34px 0 10px;
}

.intro { color: var(--muted); max-width: 52ch; margin: 0 0 8px; }

/* ---------- Dagen ---------- */

.dag {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 14px;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-day);
  padding: 12px 14px 12px 12px;
  margin-bottom: 8px;
}

.dag.ingepland { border-color: var(--herb); box-shadow: inset 5px 0 0 var(--herb); }
.dag.reserve   { border-color: var(--brass); box-shadow: inset 5px 0 0 var(--brass); }
.dag.volzet    { background: transparent; border-style: dashed; color: var(--closed); }

.datum { text-align: center; line-height: 1; }
.datum .wd { font-size: 13px; font-weight: 600; color: var(--muted); }
.datum .nr {
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 32px;
  letter-spacing: -0.03em;
  margin: 3px 0 2px;
}
.datum .mnd { font-size: 12px; color: var(--muted); }
.dag.volzet .datum .nr, .dag.volzet .datum .wd, .dag.volzet .datum .mnd { color: var(--closed); }

.status { font-weight: 600; }
.sub { font-size: 14px; color: var(--muted); margin-top: 2px; }
.notitie { font-size: 14px; margin-top: 4px; color: var(--ink); }

.plaatsen { display: flex; gap: 4px; margin-top: 6px; flex-wrap: wrap; }
.plaatsen i {
  width: 12px; height: 12px; border-radius: 50%;
  border: 2px solid var(--herb); display: inline-block;
}
.plaatsen i.bezet { background: var(--herb); }
.plaatsen i.res { border-color: var(--brass); border-style: dashed; }
.plaatsen i.res.bezet { background: var(--brass); border-style: solid; }

/* ---------- Knoppen ---------- */

button, .knop {
  font: inherit;
  font-weight: 600;
  font-size: 15px;
  border-radius: var(--radius-btn);
  border: 1.5px solid var(--ink);
  background: var(--ink);
  color: #fff;
  padding: 10px 18px;
  cursor: pointer;
  white-space: nowrap;
  min-height: 44px;
}
button.herb { background: var(--herb); border-color: var(--herb); }
button.brass { background: var(--brass); border-color: var(--brass); }
button.licht { background: transparent; color: var(--ink); border-color: var(--line); }
button.gevaar { background: transparent; color: var(--danger); border-color: var(--line); }
button:disabled { opacity: .45; cursor: not-allowed; }
button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 3px solid var(--herb); outline-offset: 2px;
}

.week-kop {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
  color: var(--muted);
  margin: 26px 0 8px 4px;
}

.leeg, .melding {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-day);
  padding: 22px;
  color: var(--muted);
}

.contact { color: var(--muted); font-size: 14px; margin-top: 34px; }

/* ---------- Toast ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  transform: translate(-50%, 20px);
  opacity: 0;
  background: var(--ink);
  color: #fff;
  padding: 12px 18px;
  border-radius: 12px;
  max-width: calc(100% - 32px);
  transition: opacity .2s, transform .2s;
  pointer-events: none;
  z-index: 10;
}
.toast.zicht { opacity: 1; transform: translate(-50%, 0); }
.toast.fout { background: var(--danger); }

/* ---------- Formulieren (beheer) ---------- */

label { font-size: 14px; font-weight: 600; display: block; margin-bottom: 4px; }

input[type=text], input[type=email], input[type=password], input[type=number], input[type=date] {
  font: inherit;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 9px 11px;
  background: var(--surface);
  color: var(--ink);
  width: 100%;
  min-height: 44px;
}
input[type=number] { width: 72px; text-align: center; }

.kaart {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-day);
  padding: 18px;
  margin-bottom: 12px;
}

.rij { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.rij > div { min-width: 0; }

.tabs { display: flex; gap: 8px; margin: 18px 0 8px; }
.tabs button[aria-pressed=false] { background: transparent; color: var(--ink); border-color: var(--line); }

.beheer-dag {
  display: grid;
  grid-template-columns: 90px auto auto 1fr;
  gap: 12px;
  align-items: start;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-day);
  padding: 12px 14px;
  margin-bottom: 6px;
}
.beheer-dag.dicht { background: transparent; }
.beheer-dag .datum { text-align: left; }
.beheer-dag .datum .nr { font-size: 24px; }
.beheer-dag .veld label { font-size: 12px; color: var(--muted); font-weight: 600; }
.beheer-dag .notitie-veld { grid-column: 4; }
.namen { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--herb-soft); color: var(--herb);
  border-radius: 999px; padding: 4px 6px 4px 12px;
  font-size: 14px; font-weight: 600;
}
.chip.res { background: var(--brass-soft); color: var(--brass); }
.chip button {
  min-height: 0; padding: 0; width: 24px; height: 24px; line-height: 1;
  background: transparent; border: 0; color: inherit; font-size: 18px;
}
.teller { font-size: 14px; font-weight: 600; color: var(--muted); }
.teller.te-veel { color: var(--danger); }
.teller.ok { color: var(--herb); }

.flexi-rij {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  padding: 10px 0; border-bottom: 1px solid var(--line);
}
.flexi-rij:last-child { border-bottom: 0; }
.flexi-rij .naam { flex: 1 1 160px; font-weight: 600; }
.flexi-rij.inactief .naam { color: var(--closed); text-decoration: line-through; }

.weekdagen { display: flex; gap: 6px; flex-wrap: wrap; }
.weekdagen label {
  display: inline-flex; align-items: center; gap: 4px;
  border: 1.5px solid var(--line); border-radius: 999px; padding: 6px 12px;
  font-weight: 600; margin: 0; cursor: pointer;
}

.nav { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 10px 0; }

@media (max-width: 640px) {
  .beheer-dag { grid-template-columns: 70px auto auto; }
  .beheer-dag .notitie-veld { grid-column: 1 / -1; }
}

@media (max-width: 420px) {
  .dag { grid-template-columns: 52px 1fr; }
  .dag > .actie { grid-column: 1 / -1; }
  .dag > .actie button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .toast { transition: none; }
}
