:root {
  --bg: #F8F5F7;
  --kaart: #FFFFFF;
  --rand: #EAE3E8;
  --tekst: #24171F;
  --zacht: #645660;
  --stil: #7A6E76;
  --accent: #6E2E52;
  --accent-donker: #561F3F;
  --accent-licht: #F5EAF0;
  --vrij-bg: #DCF2E4;
  --vrij-rand: #9BD3AE;
  --vrij-hover: #C8EAD5;
  --vrij-tekst: #0F5128;
  --bezet-bg: #EFEBEE;
  --bezet-tekst: #77717F;
  --radius: 16px;
  --font: "Helvetica Neue", Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--tekst);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent-donker); }

button { font: inherit; color: inherit; }

.wrap {
  max-width: 640px;
  margin: 0 auto;
  padding: 16px 16px calc(40px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* ---------- Kop ---------- */
.kop {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 52px;
}
.merk { display: flex; align-items: center; gap: 10px; min-width: 0; }
.logo {
  width: 40px; height: 40px; flex-shrink: 0;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  display: grid; place-items: center;
  font-weight: 700; font-size: 18px;
}
.logo-img { display: block; height: 60px; width: auto; }
.logo-img.klein { height: 36px; }
@media (min-width: 720px) { .logo-img { height: 76px; } .logo-img.klein { height: 40px; } }
.merk-naam { font-weight: 650; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.knop-rand {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--rand);
  background: var(--kaart);
  color: var(--tekst);
  text-decoration: none;
  font-weight: 550; font-size: 15px;
  cursor: pointer;
  white-space: nowrap;
}
.knop-rand:hover { border-color: #D5C8D0; }

/* ---------- Intro ---------- */
.intro { display: flex; flex-direction: column; gap: 10px; }
.label-klein {
  font-size: 13px; font-weight: 650;
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--accent);
}
.intro h1 {
  margin: 0;
  font-size: 30px; line-height: 1.12; letter-spacing: -0.02em; font-weight: 700;
}
.intro h1 .accent { color: var(--accent); display: block; }
.intro p { margin: 0; color: var(--zacht); font-size: 16px; }

.legenda { display: flex; gap: 16px; flex-wrap: wrap; font-size: 14px; color: var(--zacht); }
.legenda span { display: inline-flex; align-items: center; gap: 8px; }
.legenda i { width: 16px; height: 16px; border-radius: 5px; display: inline-block; }
.legenda .l-vrij { background: var(--vrij-bg); border: 1px solid var(--vrij-rand); }
.legenda .l-bezet { background: var(--bezet-bg); border: 1px solid #DED6DB; }

/* ---------- Weekkeuze ---------- */
.weken {
  display: flex; gap: 8px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  padding: 2px 16px 6px;
  margin: 0 -16px;
  scrollbar-width: none;
}
.weken::-webkit-scrollbar { display: none; }
.week-chip {
  flex: 0 0 auto;
  scroll-snap-align: start;
  display: flex; flex-direction: column; align-items: flex-start; gap: 0;
  min-height: 56px; min-width: 104px;
  padding: 8px 14px;
  border-radius: 14px;
  border: 1px solid var(--rand);
  background: var(--kaart);
  cursor: pointer;
  text-align: left;
}
.week-chip .wk { font-weight: 650; font-size: 15px; }
.week-chip .aantal { font-size: 13px; color: var(--stil); }
.week-chip .aantal.heeft { color: var(--vrij-tekst); font-weight: 550; }
.week-chip[aria-pressed="true"] {
  border: 2px solid var(--accent);
  padding: 7px 13px;
  background: var(--accent-licht);
}

/* ---------- Kalender ---------- */
.kaart {
  background: var(--kaart);
  border: 1px solid var(--rand);
  border-radius: 22px;
  padding: 16px 12px 8px;
}
.kaart-kop {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  padding: 0 4px 10px;
}
.kaart-kop h2 { margin: 0; font-size: 20px; font-weight: 700; letter-spacing: -0.01em; }
.kaart-kop .bereik { font-size: 14px; color: var(--zacht); white-space: nowrap; }

.kolomkop {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
  padding: 0 0 4px;
  font-size: 12px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase;
  color: var(--stil);
}
.kolomkop span:not(:first-child) { padding-left: 4px; }
.kolomkop small { display: block; font-size: 11px; font-weight: 500; letter-spacing: 0; text-transform: none; }

.dag {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
  padding: 6px 0;
  border-top: 1px solid #F2EDF0;
}
.dag:first-of-type { border-top: 0; }
.datum {
  display: flex; flex-direction: column; justify-content: center;
  line-height: 1.15;
  padding-left: 4px;
  border-radius: 12px;
  border: 0; background: transparent; text-align: left;
}
.datum .dow { font-size: 12px; font-weight: 650; text-transform: uppercase; letter-spacing: .06em; color: var(--zacht); }
.datum .nr { font-size: 22px; font-weight: 700; }
.datum .mnd { font-size: 12px; color: var(--stil); }
.dag.vandaag .datum .dow { color: var(--accent); }
.dag.vandaag .datum .nr { color: var(--accent); }
.dag.voorbij { opacity: .42; }

.slot {
  min-height: 60px;
  border-radius: 14px;
  padding: 8px 12px;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  text-decoration: none;
  border: 1px solid transparent;
  text-align: left;
  min-width: 0;
}
.slot .tekst { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.slot .deel { font-weight: 650; font-size: 15px; }
.slot .sub { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slot svg { flex-shrink: 0; width: 20px; height: 20px; }

.slot.vrij {
  background: var(--vrij-bg);
  border-color: var(--vrij-rand);
  color: var(--vrij-tekst);
}
a.slot.vrij:hover, button.slot.vrij:hover { background: var(--vrij-hover); }
a.slot.vrij:active { transform: scale(.98); }
.slot.bezet {
  background: var(--bezet-bg);
  color: var(--bezet-tekst);
}
.slot.bezet .deel { font-weight: 550; }

a.slot:focus-visible, button:focus-visible, .knop-rand:focus-visible, input:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

/* ---------- Leeg / contact / voet ---------- */
.leeg {
  text-align: center;
  padding: 20px 12px 16px;
  color: var(--zacht);
  font-size: 15px;
}

.contact {
  background: var(--tekst);
  color: #fff;
  border-radius: 22px;
  padding: 24px 20px;
  display: flex; flex-direction: column; gap: 14px;
}
.contact h2 { margin: 0; font-size: 22px; font-weight: 700; }
.contact p { margin: 0; color: #D8CBD3; }
.knop-accent {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 0 24px;
  border-radius: 999px; border: 0;
  background: var(--accent); color: #fff;
  font-weight: 650; font-size: 16px;
  text-decoration: none;
  cursor: pointer;
}
.knop-accent:hover { background: var(--accent-donker); }
.knop-accent[disabled] { background: #C2B3BC; cursor: default; }
.contact .knop-accent { align-self: stretch; }
.contact .mail-los { font-size: 14px; color: #D8CBD3; }
.contact .mail-los a { color: #fff; }

.voet {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px;
  font-size: 13px; color: var(--stil);
}

/* ---------- Groter scherm ---------- */
@media (min-width: 560px) {
  .kolomkop, .dag { grid-template-columns: 84px minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
  .slot { min-height: 64px; padding: 10px 16px; }
  .kaart { padding: 20px 20px 12px; }
  .contact { flex-direction: row; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 28px; }
  .contact .knop-accent { align-self: auto; }
}
@media (min-width: 720px) {
  .wrap { padding-top: 32px; gap: 28px; }
  .intro h1 { font-size: 40px; }
  .weken {
    margin: 0; padding: 2px 0 6px; overflow: visible;
    display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }
  .week-chip { min-width: 0; }
}

/* ---------- Beheer ---------- */
.badge {
  font-size: 12px; font-weight: 600;
  padding: 3px 10px; border-radius: 999px;
  background: var(--accent-licht); color: var(--accent-donker);
}
.beheer .slot { cursor: pointer; width: 100%; }
.beheer .slot.bezet { border: 1px dashed #D8CED4; background: #F8F6F7; }
.beheer .slot.bezet:hover { border-color: var(--vrij-rand); background: #EEF7F1; }
.beheer .slot[disabled] { cursor: not-allowed; }
.beheer .datum { cursor: pointer; font: inherit; color: inherit; }
.beheer .datum:hover { background: var(--accent-licht); }
.beheer .datum[disabled] { cursor: not-allowed; background: transparent; }

.week-acties { display: flex; gap: 8px; flex-wrap: wrap; padding: 12px 4px 8px; }
.week-acties .knop-rand { min-height: 40px; font-size: 14px; padding: 0 14px; }

.opslaanbalk {
  position: sticky; bottom: 0; z-index: 5;
  margin: 0 -16px;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: rgba(248, 245, 247, .92);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--rand);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.status { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--zacht); min-width: 0; }
.status i { width: 8px; height: 8px; border-radius: 50%; background: #1F8A45; flex-shrink: 0; }
.status.vuil i { background: #C77700; }
.status.fout { color: #B42318; }
.status.fout i { background: #B42318; }
@media (min-width: 720px) {
  .opslaanbalk { margin: 0; border: 1px solid var(--rand); border-radius: 18px; bottom: 16px; }
}

/* ---------- Inloggen ---------- */
.login {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid; place-items: center;
  padding: 24px 16px;
}
.login-kaart {
  width: 100%; max-width: 400px;
  background: var(--kaart);
  border: 1px solid var(--rand);
  border-radius: 24px;
  padding: 28px 22px;
  display: flex; flex-direction: column; gap: 18px;
}
.login-kaart h1 { margin: 0; font-size: 24px; letter-spacing: -0.01em; }
.login-kaart p { margin: 0; color: var(--zacht); font-size: 15px; }
.veld { display: flex; flex-direction: column; gap: 6px; }
.veld label { font-weight: 600; font-size: 14px; }
.veld input {
  min-height: 50px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid #D9CFD5;
  font: inherit; font-size: 16px;
  background: #fff;
}
.melding {
  padding: 10px 14px; border-radius: 12px;
  background: #FEF0EE; color: #8F1D12; font-size: 14px;
}
