:root {
  color-scheme: light;
  --achtergrond: #F2F3F5;
  --kaart: #FFFFFF;
  --lijn: #E1E3E8;
  --lijn-zacht: #ECEEF1;
  --veld: #F6F7F9;
  --inkt: #14171C;
  --tekst2: #3A3F48;
  --stil: #5B616B;
  --blauw: #2557D6;
  --blauw-zacht: #DCE5FB;
  --blauw-mid: #93B0F0;
  --onderweg: #9AA1AC;
  --gemist: #C9CDD5;
  --leeg: #D5D8DE;
  --kop: "Space Grotesk", Inter, system-ui, sans-serif;
}

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

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

body {
  margin: 0;
  background: var(--achtergrond);
  color: var(--inkt);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.35;
  -webkit-tap-highlight-color: transparent;
}

button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }

:focus-visible { outline: 2px solid var(--inkt); outline-offset: 2px; }
input:focus, textarea:focus { outline: 2px solid var(--blauw); outline-offset: 0; border-color: var(--blauw); }
input::placeholder, textarea::placeholder { color: #6B717B; }

.getal { font-family: var(--kop); font-variant-numeric: tabular-nums; }

/* Opbouw */
.app { max-width: 480px; margin: 0 auto; min-height: 100dvh; }
.scherm {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: calc(16px + env(safe-area-inset-top)) 16px calc(96px + env(safe-area-inset-bottom));
}

.menu {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  max-width: 480px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: 0 8px calc(10px + env(safe-area-inset-bottom));
  background: var(--kaart);
  border-top: 1px solid var(--lijn);
  z-index: 10;
}
.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-height: 56px;
  color: var(--stil);
  font-size: 11px;
  font-weight: 500;
  text-decoration: none;
}
.tab .streep { width: 28px; height: 3px; border-radius: 0 0 3px 3px; background: transparent; }
.tab.actief { color: var(--inkt); font-weight: 700; }
.tab.actief .streep { background: var(--blauw); }

/* Kop */
.kop { display: flex; flex-direction: column; gap: 10px; }
.kop-rij { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; }
.kop h1 {
  margin: 0;
  font-family: var(--kop);
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.05;
}
.sub { margin: 0 0 2px; font-size: 13px; font-weight: 500; color: var(--stil); }
.pijlen { display: flex; gap: 6px; flex: none; }
.rond {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--lijn);
  background: var(--kaart);
  color: var(--inkt);
  padding: 0;
}
.rond:disabled { color: #B4B9C2; }
.chip-donker {
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--inkt);
  color: #FFFFFF;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.afspraak { margin: 0; font-size: 14px; font-style: italic; line-height: 1.4; color: var(--tekst2); }

.segmenten { display: flex; gap: 3px; }
.segmenten span { flex: 1; height: 6px; border-radius: 3px; background: var(--leeg); }
.segmenten .klaar { background: var(--inkt); }
.segmenten .nu { background: var(--blauw); }

/* Secties en kaarten */
.sectie { display: flex; flex-direction: column; gap: 8px; }
.sectiekop { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.label {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--stil);
}
.hint { font-size: 12px; color: var(--stil); }
.kaart {
  background: var(--kaart);
  border: 1px solid var(--lijn);
  border-radius: 16px;
  padding: 14px;
}
.kaart-titel { margin: 0; font-family: var(--kop); font-size: 18px; font-weight: 600; }
.kaart-kop { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.notitie { margin: 0; font-size: 12px; font-weight: 500; color: var(--stil); }

/* Trainingstegels */
.tegels { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tegel {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 14px;
  min-height: 112px;
  padding: 14px;
  border-radius: 16px;
  border: 1.5px solid var(--lijn);
  background: var(--kaart);
  color: var(--inkt);
  text-align: left;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}
.tegel-top { display: flex; justify-content: space-between; align-items: center; }
.vink {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid #B4B9C2;
  display: flex;
  align-items: center;
  justify-content: center;
}
.vink svg { visibility: hidden; }
.tegel-onder { display: flex; flex-direction: column; gap: 6px; }
.tegel-titel { font-family: var(--kop); font-size: 20px; font-weight: 600; line-height: 1.1; }
.tegel-titel small { font-size: 13px; font-weight: 500; }
.pips { display: flex; gap: 4px; flex-wrap: wrap; }
.pips span { width: 18px; height: 5px; border-radius: 3px; background: var(--leeg); }
.pips .vol { background: var(--inkt); }
.stand { font-size: 12px; font-weight: 500; color: var(--stil); }
.tegel.aan { background: var(--blauw); border-color: var(--blauw); color: #FFFFFF; }
.tegel.aan .vink { background: #FFFFFF; border-color: #FFFFFF; }
.tegel.aan .vink svg { visibility: visible; }
.tegel.aan .pips span { background: rgba(255, 255, 255, 0.35); }
.tegel.aan .pips .vol { background: #FFFFFF; }
.tegel.aan .stand { color: #FFFFFF; }

/* Invoer */
.duo { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.invoer { display: flex; flex-direction: column; gap: 8px; }
.veldlabel { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--tekst2); }
.met-eenheid { display: flex; align-items: center; gap: 6px; }
.eenheid { font-size: 14px; font-weight: 500; color: var(--stil); }
.veld-groot {
  width: 100%;
  min-width: 0;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--lijn);
  background: var(--veld);
  font-family: var(--kop);
  font-size: 24px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.balk { display: flex; height: 6px; border-radius: 3px; background: var(--lijn-zacht); overflow: hidden; }
.balk.dun { height: 4px; }
.balk span { width: 0; border-radius: inherit; background: var(--onderweg); transition: width 0.25s; }
.balk span.gehaald { background: var(--blauw); }
.balk span.voortgang { background: var(--inkt); }

/* Voeding */
.voeding { padding-top: 2px; padding-bottom: 2px; }
.macro { display: flex; flex-direction: column; gap: 6px; padding: 10px 0; border-bottom: 1px solid var(--lijn-zacht); }
.macro-rij { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.macro label { display: flex; flex-direction: column; gap: 1px; }
.macro-naam { font-size: 15px; font-weight: 600; }
.macro-doel { font-size: 12px; color: var(--stil); }
.veld-klein {
  width: 92px;
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid var(--lijn);
  background: var(--veld);
  text-align: right;
  font-family: var(--kop);
  font-size: 20px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.totaal { display: flex; flex-direction: column; gap: 8px; padding: 12px 0; }
.totaal-rij { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.totaal-getal { font-family: var(--kop); font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1; }
.chip {
  align-self: flex-start;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--lijn-zacht);
  font-size: 12px;
  font-weight: 600;
}
.chip.gehaald { background: var(--blauw); color: #FFFFFF; }

.bewaarstatus { margin: 0; text-align: center; font-size: 12px; color: var(--stil); min-height: 16px; }
.bewaarstatus.fout { color: #B42318; font-weight: 600; }

/* Week */
.training { display: flex; flex-direction: column; gap: 8px; }
.training-rij { display: flex; align-items: center; gap: 8px; }
.training-naam { width: 76px; flex: none; display: flex; flex-direction: column; line-height: 1.15; }
.training-naam strong { font-size: 14px; }
.training-naam small { font-size: 11px; color: var(--stil); }
.training-dagen { flex: 1; display: flex; gap: 4px; }
.training-dagen > span { flex: 1; display: flex; justify-content: center; }
.dagletter { font-size: 11px; font-weight: 500; color: var(--stil); text-align: center; flex: 1; }
.dagletter.vandaag { color: var(--inkt); font-weight: 700; }
.training-telling { width: 40px; flex: none; text-align: right; font-family: var(--kop); font-size: 17px; font-weight: 600; }
.training-telling small { color: var(--stil); font-size: 17px; }
.stip { width: 24px; height: 24px; border-radius: 50%; background: var(--lijn-zacht); border: 1.5px solid var(--lijn-zacht); }
.stip.gedaan { background: var(--blauw); border-color: var(--blauw); }
.stip.gemist { background: #FFFFFF; border-color: var(--gemist); }
.stip.vandaag { background: #FFFFFF; border: 1.5px dashed var(--inkt); }

.grafiek { position: relative; display: flex; align-items: flex-end; gap: 4px; height: 108px; }
.doellijn { position: absolute; left: 0; right: 0; border-top: 1.5px dashed var(--inkt); pointer-events: none; }
.doellabel { position: absolute; right: 0; padding-left: 4px; background: var(--kaart); font-size: 10px; font-weight: 700; }
.kolom { flex: 1; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; }
.waarde { font-size: 10px; font-weight: 600; color: var(--tekst2); font-variant-numeric: tabular-nums; }
.staaf { width: 68%; border-radius: 6px 6px 2px 2px; background: var(--gemist); }
.staaf.gehaald { background: var(--blauw); }
.staaf.onderweg { background: #FFFFFF; border: 1.5px dashed var(--inkt); }
.staaf.leeg { height: 3px !important; background: var(--lijn-zacht); }
.daglabels { display: flex; gap: 4px; }

.rij-lijst { display: flex; flex-direction: column; }
.rij {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--lijn-zacht);
}
.rij:last-child { border-bottom: 0; }
.rij-naam { font-size: 14px; font-weight: 500; }
.rij-waarde { font-family: var(--kop); font-variant-numeric: tabular-nums; font-size: 17px; font-weight: 600; white-space: nowrap; }
.rij-waarde small { font-size: 13px; font-weight: 500; color: var(--stil); }

/* 21 dagen */
.score { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.score-getal { margin: 0; font-family: var(--kop); line-height: 1; font-variant-numeric: tabular-nums; }
.score-getal strong { font-size: 46px; font-weight: 700; letter-spacing: -0.02em; }
.score-getal small { font-size: 20px; font-weight: 600; color: var(--stil); }
.score-rechts { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.score-procent { font-family: var(--kop); font-size: 28px; font-weight: 700; }

.rooster { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.rooster .dagletter { padding-bottom: 2px; }
.cel {
  height: 50px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-start;
  padding: 5px 6px;
  border-radius: 10px;
  border: 1px solid var(--gemist);
  background: #FFFFFF;
  color: var(--inkt);
  text-align: left;
}
.cel-dag { font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.cel-training { font-size: 10px; font-weight: 700; letter-spacing: 0.04em; }
.cel.n1 { background: var(--blauw-zacht); border-color: var(--blauw-zacht); }
.cel.n2 { background: var(--blauw-mid); border-color: var(--blauw-mid); }
.cel.n3 { background: var(--blauw); border-color: var(--blauw); color: #FFFFFF; }
.cel.nu { border: 2px solid var(--inkt); }
.cel.later { background: transparent; border-style: dashed; color: #6B717B; }

.legenda { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 11px; color: var(--stil); }
.legenda-blokjes { display: flex; align-items: center; gap: 4px; }
.blokje { width: 14px; height: 14px; border-radius: 4px; border: 1px solid transparent; }
.legenda strong { color: var(--inkt); }

.weken { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.weekvak { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border-radius: 10px; background: var(--achtergrond); }
.weekvak-titel { font-size: 11px; font-weight: 600; color: var(--stil); }
.weekvak-stand { font-size: 12px; font-weight: 600; }
.weekvak-stand.stil { font-weight: 500; color: var(--stil); }

.voortgang-lijst { display: flex; flex-direction: column; gap: 12px; }
.voortgang { display: flex; flex-direction: column; gap: 6px; }
.voortgang-rij { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }

/* Doelen */
.waarom textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--lijn);
  background: var(--veld);
  font-size: 16px;
  line-height: 1.4;
  resize: none;
}
.doelrij { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--lijn-zacht); }
.doelrij:last-child { border-bottom: 0; }
.doel-icoon {
  width: 36px;
  height: 36px;
  flex: none;
  border-radius: 10px;
  background: var(--achtergrond);
  display: flex;
  align-items: center;
  justify-content: center;
}
.doel-tekst { flex: 1; display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.doel-naam { font-size: 15px; font-weight: 600; }
.doel-uitleg { font-size: 12px; color: var(--stil); }
.doel-waarde { font-family: var(--kop); font-variant-numeric: tabular-nums; font-size: 20px; font-weight: 700; white-space: nowrap; }
.doel-waarde small { font-size: 13px; font-weight: 500; color: var(--stil); }
.kaart.lijst { padding-top: 0; padding-bottom: 0; }

.regels { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px; border-radius: 16px; background: #E8EAEE; }
.regels h2 { margin: 0; font-size: 14px; font-weight: 600; }
.regels ul { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; font-size: 13px; line-height: 1.4; color: var(--tekst2); }

.knop {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 18px;
  border-radius: 12px;
  border: 1.5px solid var(--inkt);
  background: transparent;
  color: var(--inkt);
  font-size: 15px;
  font-weight: 600;
}
.knop.vol { background: var(--blauw); border-color: var(--blauw); color: #FFFFFF; }
.knoppen { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }

.formulier { display: flex; flex-direction: column; }
.formrij { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--lijn-zacht); }
.formrij:last-child { border-bottom: 0; }
.formrij label { display: flex; flex-direction: column; gap: 1px; font-size: 15px; font-weight: 600; }
.formrij label small { font-size: 12px; font-weight: 400; color: var(--stil); }
.formrij input { width: 120px; }
.formrij input[type="date"] {
  width: 160px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--lijn);
  background: var(--veld);
  font-size: 16px;
}
.formfout { margin: 0; font-size: 13px; font-weight: 600; color: #B42318; }

/* Slot (code) */
.slot {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}
.slot-kaart {
  width: 100%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 24px 20px;
  border-radius: 20px;
  background: var(--kaart);
  border: 1px solid var(--lijn);
}
.slot-kaart h1 { margin: 0; font-family: var(--kop); font-size: 28px; font-weight: 700; letter-spacing: -0.02em; }
.slot-kaart p { margin: 0; color: var(--tekst2); }
.slot-veld { display: flex; flex-direction: column; gap: 6px; }
.slot-veld label { font-size: 13px; font-weight: 600; color: var(--tekst2); }
.slot-veld input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--lijn);
  background: var(--veld);
  font-size: 18px;
}
.melding { margin: 0; font-size: 14px; color: var(--tekst2); text-align: center; padding: 40px 16px; }
