/* Kleuterdoelen: rustig en leesbaar. Eén tintfamilie (blauwgroen, licht naar donker) voor de
   vier scorestappen; nooit rood/groen en nooit een cijfer of oordeel. */
:root {
  --achtergrond: #f6f8f9;
  --vlak: #ffffff;
  --tekst: #1f2d33;
  --tekst-zacht: #52666e;
  --lijn: #d5dee2;
  --accent: #1d6b78;
  --accent-tekst: #ffffff;
  --focus: #0b4f9c;

  /* scorestappen: vier tinten van dezelfde kleur. Contrast tegen wit (WCAG):
     stap 1 3.29:1, stap 2 5.00:1, stap 3 7.80:1, stap 4 12.50:1; tussen
     opeenvolgende stappen 1.5-1.6:1. Stap 1 tegen "niet geobserveerd" 2.92:1. */
  --stap-1: #2a9bad;
  --stap-2: #217a88;
  --stap-3: #195a65;
  --stap-4: #0f3940;
  --stap-0: #eef2f4; /* niet geobserveerd */
  --stap-0-streep: #b7c4ca;

  --rij-hoogte: 56px;
  --straal: 8px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--achtergrond);
  color: var(--tekst);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.45;
}

a { color: var(--accent); }
a:focus-visible, button:focus-visible, select:focus-visible, .tabel-wrap:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.alleen-lezer {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* Kop */
.kop {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1.25rem;
  padding: 0.5rem 1rem;
  background: var(--vlak);
  border-bottom: 1px solid var(--lijn);
}
.appnaam { font-weight: 700; font-size: 1.125rem; color: var(--accent); text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; }
.groepsnaam { font-weight: 600; flex: 1 1 auto; }
.groepkeuze { display: flex; align-items: center; gap: 0.5rem; margin: 0; }
.groepkeuze label { color: var(--tekst-zacht); font-weight: 400; }
.beheerlinks { display: flex; gap: 1rem; }
.beheerlinks a { color: var(--accent); min-height: 44px; display: inline-flex; align-items: center; }
.gebruiker { display: flex; align-items: center; gap: 0.75rem; margin-left: auto; }
.gebruiker form { margin: 0; }
.email { color: var(--tekst-zacht); font-size: 0.9rem; overflow-wrap: anywhere; }

select, .knop-klein {
  min-height: 44px; padding: 0 0.75rem;
  font: inherit;
  border: 1px solid var(--lijn); border-radius: var(--straal);
  background: var(--vlak); color: var(--tekst);
}
.knop-klein { cursor: pointer; }
.knop-klein:hover { border-color: var(--accent); }

/* Pagina */
.pagina { max-width: 100%; padding: 1rem; }
.paginatitel { margin: 0.25rem 0 0.75rem; font-size: 1.5rem; }
.schooljaar { color: var(--tekst-zacht); font-size: 1rem; font-weight: 400; margin-left: 0.25rem; }
.melding { max-width: 36rem; margin: 2rem auto; padding: 1.5rem; background: var(--vlak); border: 1px solid var(--lijn); border-radius: var(--straal); }
.leeg { color: var(--tekst-zacht); }

/* Keuzeknoppen (instrument, leerjaar) */
.keuzes { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.75rem; }
.keuze {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 1rem;
  border: 1px solid var(--lijn); border-radius: 999px;
  background: var(--vlak); color: var(--tekst); text-decoration: none;
}
.keuze.actief { background: var(--accent); border-color: var(--accent); color: var(--accent-tekst); font-weight: 600; }
.keuzes-klein .keuze { padding: 0 0.85rem; font-size: 0.95rem; }

/* Tabel: scrollt binnen de container, niet de hele pagina */
.tabel-wrap {
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  background: var(--vlak); border: 1px solid var(--lijn); border-radius: var(--straal);
}
table.overzicht { border-collapse: separate; border-spacing: 0; width: 100%; }
.overzicht th, .overzicht td {
  padding: 0.35rem 0.75rem; text-align: left; vertical-align: middle;
  border-bottom: 1px solid var(--lijn); background: var(--vlak);
}
.overzicht tbody tr { height: var(--rij-hoogte); }
.overzicht thead th { font-weight: 600; font-size: 0.9rem; vertical-align: bottom; }
.overzicht th.domein { color: var(--tekst-zacht); font-weight: 600; border-bottom-color: var(--lijn); border-left: 1px solid var(--lijn); }
.overzicht th.aspect { min-width: 9.5rem; border-left: 1px solid var(--lijn); }
.overzicht td { min-width: 9.5rem; border-left: 1px solid var(--lijn); }
.overzicht th.aspect a, .overzicht .naamkolom a { display: inline-flex; align-items: center; min-height: 44px; }
.overzicht tbody tr:last-child th, .overzicht tbody tr:last-child td { border-bottom: 0; }

.naamkolom {
  position: sticky; left: 0; z-index: 1;
  min-width: 10rem; max-width: 14rem;
  border-right: 1px solid var(--lijn);
}
thead .naamkolom { z-index: 2; }
.overzicht .naamkolom a { color: var(--tekst); font-weight: 600; text-decoration-color: var(--lijn); }

.cel-leeg { color: var(--tekst-zacht); text-align: center; }
.cel-fase { font-weight: 600; }

/* Verdelingsbalk */
.balk-blok { min-width: 8rem; }
.balk {
  display: flex; height: 14px; overflow: hidden;
  border-radius: 7px; background: var(--stap-0); border: 1px solid var(--lijn);
}
.stap { display: block; flex-basis: 0; min-width: 4px; }
.stap-1 { background: var(--stap-1); }
.stap-2 { background: var(--stap-2); }
.stap-3 { background: var(--stap-3); }
.stap-4 { background: var(--stap-4); }
.stap-0 {
  background: repeating-linear-gradient(45deg, var(--stap-0), var(--stap-0) 3px, var(--stap-0-streep) 3px, var(--stap-0-streep) 4px);
}
.balk-tekst { margin: 0.2rem 0 0; font-size: 0.78rem; color: var(--tekst-zacht); line-height: 1.25; }

/* Legenda */
.legenda { margin-top: 1rem; padding: 0.75rem 1rem; background: var(--vlak); border: 1px solid var(--lijn); border-radius: var(--straal); }
.legenda h2 { margin: 0 0 0.5rem; font-size: 1rem; }
.legenda ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; }
.legenda li { display: inline-flex; align-items: center; gap: 0.5rem; }
.blokje { width: 28px; height: 14px; border-radius: 4px; border: 1px solid var(--lijn); flex: none; }
.uitleg { margin: 0.5rem 0 0; color: var(--tekst-zacht); font-size: 0.9rem; }

@media (max-width: 600px) {
  .pagina { padding: 0.75rem 0.5rem; }
  .naamkolom { min-width: 7.5rem; max-width: 9rem; }
  .email { display: none; }
}

/* ParnasSys-import */
.fout { font-weight: 600; color: var(--tekst); }
.importformulier input[type="text"], .importformulier input[type="file"] { min-height: 44px; font: inherit; }
.importformulier label { font-weight: 600; }

/* Invoerraster: tikvlakken van minstens 44x44 px; waarde = gevulde stip (vorm, niet alleen kleur) */
.kruimel { margin: 0 0 0.25rem; }
.kruimel a { display: inline-flex; align-items: center; min-height: 44px; }
.overzicht.raster th.punt { min-width: 12rem; max-width: 16rem; vertical-align: top; font-weight: 500; }
.punt-tekst {
  display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical;
  overflow: hidden; font-size: 0.85rem; line-height: 1.3;
}
.badge {
  display: inline-block; margin-bottom: 0.2rem; padding: 0 0.4rem;
  border: 1px solid var(--lijn); border-radius: 999px;
  font-size: 0.72rem; font-weight: 600; color: var(--tekst-zacht); background: var(--achtergrond);
}
.overzicht.raster td.cel { min-width: 12rem; padding: 0.25rem 0.5rem; }
.overzicht.raster tbody tr { height: auto; }
.stippen { display: flex; gap: 0; }
.stip-knop {
  width: 44px; height: 44px; padding: 0; margin: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: 0; border-radius: var(--straal); cursor: pointer;
  touch-action: manipulation;
}
.stip {
  display: inline-block; width: 26px; height: 26px; border-radius: 50%;
  background: var(--vlak); border: 3px solid var(--stap-3);
}
.stip-knop.stap-1 .stip { border-color: var(--stap-2); }
.stip-knop.stap-4 .stip { border-color: var(--stap-4); }
.stip-knop[aria-pressed="true"] .stip { border-color: var(--stap-4); box-shadow: 0 0 0 2px var(--vlak), 0 0 0 4px var(--stap-4); }
.stip-knop[aria-pressed="true"].stap-1 .stip, .stip.stap-1.gevuld { background: var(--stap-1); }
.stip-knop[aria-pressed="true"].stap-2 .stip, .stip.stap-2.gevuld { background: var(--stap-2); }
.stip-knop[aria-pressed="true"].stap-3 .stip, .stip.stap-3.gevuld { background: var(--stap-3); }
.stip-knop[aria-pressed="true"].stap-4 .stip, .stip.stap-4.gevuld { background: var(--stap-4); }
.stip-knop:hover .stip { border-color: var(--stap-4); }
.stippen-alleen-lezen { gap: 0.35rem; padding: 0.25rem 0; }
.stippen-alleen-lezen .stip { width: 18px; height: 18px; border-width: 2px; }
.stippen-alleen-lezen .stip:not(.gevuld) { background: var(--stap-0); border-color: var(--stap-0-streep); }
.cel-tekst { margin: 0; font-size: 0.8rem; color: var(--tekst-zacht); }
.celacties { display: flex; gap: 0.25rem; }
.icoon-knop {
  min-width: 44px; min-height: 44px; padding: 0; font-size: 1.15rem; line-height: 1;
  background: transparent; color: var(--accent); border: 1px solid transparent; border-radius: var(--straal); cursor: pointer;
  touch-action: manipulation;
}
.icoon-knop:hover:not(:disabled) { border-color: var(--accent); }
.icoon-knop:disabled { color: var(--stap-0-streep); cursor: not-allowed; }
.cel-fout { margin: 0.25rem 0 0; font-size: 0.85rem; font-weight: 600; color: var(--tekst); border-left: 4px solid var(--stap-4); padding-left: 0.5rem; }
.htmx-request .stip-knop, .htmx-request.stip-knop { opacity: 0.6; }

.fasen { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.fase-knop {
  min-width: 44px; min-height: 44px; padding: 0 0.9rem; font: inherit; cursor: pointer; touch-action: manipulation;
  background: var(--vlak); color: var(--tekst); border: 2px solid var(--stap-3); border-radius: 999px;
}
.fase-knop[aria-pressed="true"] { background: var(--stap-4); border-color: var(--stap-4); color: var(--accent-tekst); font-weight: 700; }

.dialoog { max-width: 28rem; width: calc(100% - 2rem); padding: 1rem 1.25rem; border: 1px solid var(--lijn); border-radius: var(--straal); color: var(--tekst); }
.dialoog::backdrop { background: rgba(31, 45, 51, 0.45); }
.dialoog h2 { margin: 0 0 0.75rem; font-size: 1.1rem; }
.dialoog label { font-weight: 600; display: block; margin-bottom: 0.25rem; }
.dialoog textarea { width: 100%; font: inherit; padding: 0.5rem; border: 1px solid var(--lijn); border-radius: var(--straal); }
.dialoog-acties { display: flex; justify-content: flex-end; gap: 0.5rem; margin-top: 0.75rem; }
.knop-primair { background: var(--accent); border-color: var(--accent); color: var(--accent-tekst); font-weight: 600; }

/* Kindprofiel */
.profielkop { margin-bottom: 0.75rem; }
.profiel-gegevens { margin: 0 0 0.75rem; color: var(--tekst-zacht); }
.profiel-acties { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; }
.print-alleen { display: none; margin: 0.25rem 0 0; color: var(--tekst-zacht); font-size: 0.85rem; }
.doelenboom { max-width: 60rem; }
.knoop { margin: 0.5rem 0; background: var(--vlak); border: 1px solid var(--lijn); border-radius: var(--straal); }
.knoop > summary {
  display: grid; grid-template-columns: minmax(10rem, 1fr) minmax(8rem, 14rem) auto; align-items: center;
  gap: 0.25rem 1rem; padding: 0.5rem 0.75rem; min-height: 44px; cursor: pointer;
}
.knoop > summary { list-style: none; position: relative; padding-left: 2rem; }
.knoop > summary::-webkit-details-marker { display: none; }
.knoop > summary::before {
  content: ""; position: absolute; left: 0.8rem; top: 50%; width: 0.5rem; height: 0.5rem;
  border-right: 2px solid var(--accent); border-bottom: 2px solid var(--accent);
  transform: translateY(-70%) rotate(-45deg); transition: transform 0.15s;
}
.knoop[open] > summary::before { transform: translateY(-70%) rotate(45deg); }
.knoop-instrument > summary { font-size: 1.1rem; font-weight: 700; }
.knoop-domein > summary { font-weight: 600; }
.knoop-aspect > summary { font-weight: 500; }
.knoop > summary .balk-tekst { display: none; } /* de tekst staat al rechts ervan */
.knoop-tekst { font-size: 0.85rem; font-weight: 400; color: var(--tekst-zacht); }
.knoop-inhoud { padding: 0 0.75rem 0.5rem 1.25rem; }
.knoop .knoop { border-color: var(--lijn); }
.opbouw {
  display: inline-block; margin-left: 0.5rem; padding: 0 0.5rem; cursor: help;
  border: 1px dashed var(--stap-0-streep); border-radius: 999px;
  background: var(--stap-0); color: var(--tekst-zacht); font-size: 0.75rem; font-weight: 600;
}
.punten { list-style: none; margin: 0; padding: 0; }
.punt { padding: 0.4rem 0; border-top: 1px solid var(--lijn); }
.punt:first-child { border-top: 0; }
.punt-regel { display: grid; grid-template-columns: minmax(10rem, 1fr) minmax(10rem, 18rem) auto; gap: 0.25rem 1rem; align-items: center; }
.punt-label { font-weight: 600; }
.punt-datum, .punt-leeg { color: var(--tekst-zacht); font-size: 0.9rem; }
.spelregel { margin: 0.5rem 0; padding: 0.5rem 0.75rem; background: var(--vlak); border: 1px solid var(--lijn); border-radius: var(--straal); font-weight: 600; }
.geschiedenis:empty { display: none; }
.gesch-lijst { list-style: none; margin: 0.25rem 0 0 1rem; padding: 0; font-size: 0.9rem; }
.gesch-lijst li { padding: 0.2rem 0; }
.gesch-datum { color: var(--tekst-zacht); margin-right: 0.5rem; }
.gesch-label { font-weight: 600; margin-right: 0.5rem; }
.gesch-door { color: var(--tekst-zacht); }
.gesch-notitie { display: block; margin-left: 0; white-space: pre-line; }
@media (max-width: 600px) {
  .knoop > summary, .punt-regel { grid-template-columns: 1fr; }
}

/* Tijdelijke wachtwoordlogin (testperiode) */
.tijdelijk { margin: 0 0 1rem; padding: 0.5rem 0.75rem; background: var(--stap-0); border-left: 4px solid var(--accent); color: var(--tekst); }
.wachtwoordlogin input[type="email"], .wachtwoordlogin input[type="password"] { width: 100%; min-height: 44px; font: inherit; }
.wachtwoordlogin label { font-weight: 600; }
