/* =====================================================================
   stijl.css — de opmaak van alle pagina's
   De kleuren lijken op die van de hand-out.
   ===================================================================== */

:root {
  --donker: #1d5b70;     /* koppen, zoals op de hand-out */
  --licht: #e4eef3;      /* achtergrond van tabelkoppen */
  --lijn: #33434c;       /* randen */
  --af: #3d8db0;         /* een opdracht of boek dat af is */
  --groen: #6dbf6a;
  --oranje: #f4ab3c;
  --rood: #e2574c;
  --grijs: #d5dadf;      /* nog niet te berekenen */
  --streep: #1a7a4c;     /* de groene 65%-streep */
}

* { box-sizing: border-box; }
body { margin: 0; font-family: "Segoe UI", Arial, Helvetica, sans-serif; color: #222; background: #eef1f4; font-size: 15px; }
main { max-width: 1000px; margin: 0 auto; padding: 16px; }
.smal { max-width: 560px; margin-left: auto; margin-right: auto; }
h1 { color: var(--donker); margin: .3em 0 .6em; }
h2 { color: var(--donker); }
.klein { font-size: 12.5px; color: #555; }
.grijs { color: #9aa4ab; }
[hidden] { display: none !important; }

/* ----- knoppen en invulvelden ----- */
button, .knop {
  font: inherit; font-size: 14px; padding: 6px 12px; border-radius: 6px; cursor: pointer;
  border: 1px solid #aab4bb; background: white; color: #222; text-decoration: none; display: inline-block;
}
button:hover, .knop:hover { background: #f1f5f7; }
button.hoofdknop { background: var(--donker); border-color: var(--donker); color: white; }
button.hoofdknop:hover { background: #164a5b; }
button.gevaar { color: #b3261e; border-color: #e0a19c; }
button.mini { padding: 2px 7px; font-size: 13px; }
input[type=text], input[type=date], input:not([type]), select, textarea {
  font: inherit; font-size: 14px; padding: 5px 7px; border: 1px solid #aab4bb; border-radius: 5px; background: white;
}
textarea { resize: vertical; width: 100%; }
label { cursor: pointer; }

/* ----- kaarten en de balk bovenin ----- */
.kaart { background: white; border-radius: 10px; padding: 16px 20px; margin-bottom: 16px; box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.kaart h2 { margin-top: 0; }
.bovenbalk {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 8px 16px;
  background: var(--donker); color: white;
}
.bovenbalk a { color: white; }
.bovenbalk .ruimte { flex: 1; }
.bovenbalk button { border-color: transparent; }
.bovenbalk .keuze { background: rgba(255,255,255,.12); padding: 4px 10px; border-radius: 6px; }

/* ----- startpagina ----- */
.rollen { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.rol { display: block; background: white; border-radius: 10px; padding: 18px; text-decoration: none; color: #222;
       box-shadow: 0 1px 3px rgba(0,0,0,.12); border-left: 6px solid var(--donker); }
.rol:hover { background: #f6fafb; }
.rol b { display: block; font-size: 18px; color: var(--donker); margin-bottom: 4px; }

/* ----- tabbladen ----- */
.tabs { display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 0 14px; }
.tabs button { border-radius: 8px 8px 0 0; border-bottom: 3px solid transparent; background: #dfe6ea; }
.tabs button.actief { background: white; border-bottom-color: var(--donker); font-weight: 600; }

/* ----- tabellen op de beheer-, docent- en coachpagina ----- */
.lijst { border-collapse: collapse; width: 100%; }
.lijst th, .lijst td { border-bottom: 1px solid #dde3e7; padding: 6px 6px; text-align: left; vertical-align: middle; }
.lijst th { background: var(--licht); font-size: 13px; }
.lijst td.midden, .lijst th.midden { text-align: center; }
.lijst tr.klikbaar:hover td { background: #f3f8fa; cursor: pointer; }

.rij { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 10px 0 0; }
.ruimte { flex: 1; }
.nowrap { white-space: nowrap; }
.volgorde { white-space: nowrap; width: 1%; }
.volgorde button { margin-right: 2px; }
.chip { display: inline-flex; align-items: center; gap: 6px; background: var(--licht); border-radius: 14px;
        padding: 3px 4px 3px 12px; margin: 0 6px 6px 0; }
.formulier td { padding: 4px 14px 4px 0; }
.lijst.vakkentabel { max-width: 640px; }
.vakkentabel select { min-width: 110px; }

/* ----- beheerpagina: leerlingen ----- */
.inlezen { background: #f3f8fa; border: 1px solid #c9dbe3; border-radius: 8px; padding: 4px 16px 14px; margin: 12px 0; }
.inlezen .rij label { white-space: nowrap; }
.inlezen select { max-width: 230px; }
.lijst.voorbeeld { margin: 10px 0; background: white; }
.lijst tr.let-op-rij td { background: #fdf0d9; }
.melding { background: #e3f4e2; color: #1f5f36; padding: 8px 12px; border-radius: 6px; }
input[type=search] { font: inherit; font-size: 14px; padding: 5px 7px; border: 1px solid #aab4bb; border-radius: 5px; min-width: 220px; }

/* ----- docentpagina ----- */
.opdracht-uitleg { font-size: 16px; background: #f3f8fa; border-left: 4px solid var(--donker); padding: 8px 12px; margin-top: 0; }
.lijst td.breed { width: 40%; }
.lijst input:not([type=checkbox]) { width: 100%; }
.lijst td.nowrap input { width: 60px; }
.totaal { font-weight: 600; padding: 6px 10px; border-radius: 6px; display: inline-block; }
.totaal.goed { background: #e3f4e2; color: #1f6f43; }
.totaal.let-op { background: #fdf0d9; color: #8a5300; }
.nieuwe-opdracht { display: grid; grid-template-columns: 1fr 2fr auto auto auto; gap: 8px 12px; align-items: end; }
.nieuwe-opdracht label { display: flex; flex-direction: column; gap: 3px; font-size: 13px; }
.nieuwe-opdracht label.vinkje { flex-direction: row; align-items: center; padding-bottom: 8px; }
.docent svg.taart { max-width: 480px; margin: 0 auto; }
@media (max-width: 760px) { .nieuwe-opdracht { grid-template-columns: 1fr; } }

/* ----- coachpagina ----- */
.legenda-coach { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 13px; color: #444; }
.legenda-coach b { display: inline-block; width: 18px; height: 18px; border-radius: 50%; background: var(--donker);
                   color: white; text-align: center; font-size: 12px; line-height: 18px; }
.rapport-knoppen { margin-top: 0; }

/* ===================================================================
   DE A4-PAGINA'S VAN HET RAPPORT
   =================================================================== */
.a4 {
  background: white; max-width: 820px; margin: 0 auto 24px; padding: 26px 34px 30px;
  box-shadow: 0 1px 4px rgba(0,0,0,.15);
}
.pagina-kop { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.bovenkop { margin: 0; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--donker); }
.pagina-titel { margin: 2px 0 0; font-size: 26px; color: #222; }
.invulvelden { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.invullijn { display: inline-block; min-width: 200px; border-bottom: 1px solid #333; padding: 0 4px; }
.invullijn.kort { min-width: 80px; }
input.jaartal { width: 90px; padding: 2px 6px; }
.tip { background: #f3f8fa; border-left: 4px solid var(--af); padding: 6px 10px; font-size: 13px; margin: 0 0 12px; }
.sectie { color: #222; border-bottom: 1px solid #666; padding-bottom: 3px; margin: 18px 0 8px; font-size: 17px; }
.nog-niets { color: #888; font-style: italic; font-size: 13px; margin: 10px 0; }

/* ----- pagina 1, rondjes: een taart per vak ----- */
.taarten { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 6px 18px; }
.taart-blok { break-inside: avoid; }
.taart-kop { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; border-bottom: 1px solid #e2e7ea; padding-bottom: 2px; }
.vaknaam-vak { display: inline-block; border: 2px solid #222; padding: 1px 8px; font-weight: 700; min-width: 74px; }
.vak-voluit { font-size: 13px; color: #444; flex: 1; }
.pct-af { font-weight: 700; color: var(--donker); font-size: 13px; }
svg.taart { width: 100%; height: auto; display: block; font-family: "Segoe UI", Arial, sans-serif; }
.punt { fill: white; stroke: #4a5a63; stroke-width: 1.3; }
.punt.af { fill: var(--af); }
.punt.lees { fill: #fff3c4; }
.punt.rest { fill: #e9ecef; stroke-dasharray: 4 3; }
.punt.klikbaar:hover { fill: #cfe6f0; }
.punt.af.klikbaar:hover { fill: #2f7697; }
.klikbaar { cursor: pointer; }
.streepje { fill: none; stroke: #6b7a83; stroke-width: 1; }
.label { font-size: 11px; fill: #222; }
.label.klikbaar:hover { text-decoration: underline; }
.cijfer-in-punt { font-size: 12px; font-weight: 700; fill: #333; pointer-events: none; }
.cijfer-in-punt.af { fill: white; }

/* ----- pagina 1, balkjes: een downloadbalk per vak ----- */
.balken {
  --naam: 110px;           /* breedte van de kolom met de vaknamen */
  --tussen: 10px;          /* ruimte tussen naam en balk */
  display: grid; grid-template-columns: var(--naam) 1fr; gap: 10px var(--tussen); align-items: center;
  margin-top: 24px; position: relative;
}
.balk-naam { display: flex; flex-direction: column; gap: 2px; }
.schaal { position: relative; height: 16px; font-size: 11px; color: #555; }
.schaal span { position: absolute; transform: translateX(-50%); }
.balk {
  display: flex; height: 36px; border: 2px solid #8d979e; background-color: white; overflow: hidden;
  /* de streepjes van de schaal: dun om de 2%, dikker om de 10% */
  background-image:
    repeating-linear-gradient(90deg, #a8b1b7 0 2px, transparent 2px 10%),
    repeating-linear-gradient(90deg, #dde2e6 0 1px, transparent 1px 2%);
}
.balk.nog-niets { align-items: center; padding-left: 8px; background-image: none; }
.stukje {
  flex: 0 0 auto; border-right: 2px solid #222; overflow: hidden; white-space: nowrap;
  display: flex; flex-direction: column; justify-content: center; padding: 0 3px; font-size: 11px; line-height: 1.15;
}
.stukje:last-child { border-right: none; }
.stukje span { overflow: hidden; text-overflow: ellipsis; background: rgba(255,255,255,.7); }
.stukje.af { background: var(--af); color: white; }
.stukje.af span { background: none; }
.stukje.lees { background-color: #fff3c4; }
.stukje.rest { background: repeating-linear-gradient(45deg, #eceff1 0 6px, #dfe4e7 6px 12px); color: #555; }
.stukje.klikbaar:hover { outline: 3px solid #9ccbe0; outline-offset: -3px; }
/* De groene streep ligt los over alle balken heen. "--procent" zet de pagina zelf (bijvoorbeeld 65).
   Positie = naamkolom + tussenruimte + 65% van de breedte die er voor de balken overblijft. */
.streep {
  position: absolute; top: -6px; bottom: -6px; width: 4px; margin-left: -2px; background: var(--streep);
  left: calc(var(--naam) + var(--tussen) + (100% - var(--naam) - var(--tussen)) * var(--procent) / 100);
  pointer-events: none; z-index: 2;
}
.streep span {
  position: absolute; top: -18px; left: 50%; transform: translateX(-50%);
  background: var(--streep); color: white; font-size: 11px; font-weight: 700; padding: 1px 5px;
}

/* ----- pagina 3: de tabel ----- */
table.p3 { border-collapse: collapse; width: 100%; font-size: 13px; }
.p3 th, .p3 td { border: 1px solid var(--lijn); padding: 6px; height: 34px; }
.p3 th { background: var(--licht); font-size: 12px; }
.p3 th.links { text-align: left; }
.p3 .tussen { border-top: none; border-bottom: none; width: 14px; background: white; padding: 0; }
.p3 .uitkomst-kolom { width: 70px; }
.p3 .vink { text-align: center; font-size: 18px; width: 120px; }
.p3 .vink input { width: 18px; height: 18px; }
.vaknaam-cel { font-weight: 600; font-size: 12.5px; }
.vaknaam-cel small { font-weight: 400; color: #777; }
.midden { text-align: center; }
.rechts { text-align: right; }
.eindregel td { background: var(--licht); position: relative; height: 44px; white-space: nowrap; }
.kleurvak.leeg-vak { background: white; min-width: 54px; height: 22px; vertical-align: middle; }
.eindregel td.na-teken { padding-left: 18px; }   /* ruimte voor het +-teken op de rand */
.eindregel td.uitkomst { font-weight: 700; font-size: 15px; }
.teken { position: absolute; right: -9px; top: 50%; transform: translateY(-50%); z-index: 1;
         background: var(--donker); color: white; font-weight: 700; width: 18px; height: 18px; line-height: 18px;
         text-align: center; border-radius: 3px; font-size: 13px; }
.onder-tabel { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px 20px; margin-top: 12px; font-size: 13px; }
.afgerond-regel { font-size: 13px; margin-top: 14px; }
.p3 input.cijfer-invoer { width: 62px; text-align: center; padding: 3px 4px; }
.cijfer-invoer::placeholder { color: #7d878e; font-style: italic; }   /* de schatting: grijs */
.voetnoot { font-size: 12px; color: #444; margin: 6px 0 0; }

/* ----- het bolletje met de i: de uitleg verschijnt als je erop staat of tikt ----- */
.info {
  display: inline-block; position: relative; width: 15px; height: 15px; margin-left: 5px; border-radius: 50%;
  background: var(--af); color: white; font: italic 700 11px/15px Georgia, "Times New Roman", serif;
  text-align: center; vertical-align: 1px; cursor: help;
}
.voetnoot .info, .tip .info { margin: 0 2px 0 0; }
.info:hover::after, .info:focus::after {
  content: attr(data-uitleg);
  position: absolute; left: -12px; top: 21px; z-index: 5; width: 250px;
  background: #2b3a42; color: white; font: 12px/1.4 "Segoe UI", Arial, sans-serif; text-align: left;
  padding: 7px 10px; border-radius: 6px; box-shadow: 0 3px 10px rgba(0,0,0,.25); white-space: normal;
}
.info:focus { outline: 2px solid #9ccbe0; outline-offset: 1px; }

/* ----- wens en argumentatie (tabblad 4, en onder het leesdossier op papier) ----- */
.wens-vraag { font-weight: 600; margin: 6px 0 8px; line-height: 1.4; }
textarea.wens-tekst { min-height: 300px; font-size: 15px; line-height: 1.5; padding: 10px 12px; }
.wens-antwoord { white-space: pre-wrap; overflow-wrap: anywhere; border: 1px solid #8d979e; padding: 8px 12px;
                 font-size: 13px; line-height: 1.45; }
.schrijflijnen { height: 337px; border: 1px solid #8d979e;   /* twaalf lijntjes om met de hand op te schrijven */
                 background: repeating-linear-gradient(to bottom, white 0 27px, #aab3b9 27px 28px); }

/* ----- pagina 4: leesdossier ----- */
table.lees { border-collapse: collapse; width: 100%; font-size: 13px; }
.lees th, .lees td { border: 1px solid var(--lijn); padding: 4px; height: 32px; }
.lees th { background: var(--licht); font-size: 12px; }
.lees th.links { text-align: left; }
.lees .boeknr { width: 30px; }
.lees .boek { text-align: center; font-size: 11px; font-weight: 700; }
.lees .boek.af { background: var(--af); color: white; }
.lees .boek.klikbaar:hover { outline: 3px solid #9ccbe0; outline-offset: -3px; }
.lees .boek.niet-nodig { background: #222; }

/* ----- pagina 4: tempo ----- */
.formule { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 10px 0; }
.formule-naam { display: flex; flex-direction: column; width: 92px; }
.formule-naam small { color: #555; font-size: 11px; }
.formule-blok { background: #eef4f7; border: 1px solid #b8c9d2; padding: 8px 10px; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.formule-blok > small { color: #555; }
.breuk { display: flex; flex-direction: column; align-items: center; }
.breuk > :first-child { border-bottom: 3px solid var(--donker); padding-bottom: 4px; margin-bottom: 4px; }
.breuk-boven { display: flex; align-items: center; gap: 4px; font-weight: 700; font-size: 16px; }
.invulvakje { display: inline-flex; flex-direction: column; align-items: center; min-width: 86px; min-height: 36px;
              background: white; border: 1px solid #555; padding: 2px 6px; font-weight: 700; font-size: 15px; }
.invulvakje small { font-weight: 400; font-size: 10px; color: #666; }
.formule > .teken { position: static; transform: none; width: auto; height: auto; background: none; color: var(--donker); font-size: 26px; }

/* ----- kleuren, legenda en vierkantjes ----- */
.kleur-groen { background: var(--groen) !important; }
.kleur-oranje { background: var(--oranje) !important; }
.kleur-rood { background: var(--rood) !important; }
.kleur-grijs { background: var(--grijs) !important; }
.kleurvak { display: inline-block; border: 1px solid #555; text-align: center; font-weight: 700; }
.kleurvak.mini { width: 13px; height: 13px; vertical-align: -2px; margin-right: 4px; border-radius: 2px; }
.kleurvak.inline { padding: 1px 8px; min-width: 40px; border-radius: 3px; }
.kleurvak.groot { min-width: 90px; padding: 10px; font-size: 18px; background: white; }
.legenda { display: inline-flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12.5px; }
.legenda-regel { font-size: 13px; margin-top: 10px; }
.vierkantje { display: inline-block; width: 22px; height: 22px; border-radius: 4px; border: 1px solid rgba(0,0,0,.35); }

/* ----- het venster om een opdracht af te vinken ----- */
dialog.venster { border: none; border-radius: 12px; padding: 20px 24px; width: min(460px, 92vw); box-shadow: 0 10px 40px rgba(0,0,0,.3); }
dialog.venster::backdrop { background: rgba(20,30,40,.45); }
.venster h2 { margin: 2px 0 8px; }
.venster-vak { margin: 0; color: #666; font-size: 13px; }
.beschrijving { white-space: pre-wrap; background: #f4f7f9; padding: 8px 10px; border-radius: 6px; }
.vinkregel { display: block; margin: 10px 0; font-size: 15px; }
.vinkregel input[type=checkbox] { width: 18px; height: 18px; vertical-align: -3px; }
.knoppen { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.foutmelding { color: #b3261e; font-size: 13px; min-height: 1em; margin: 4px 0; }

/* ----- "Opgeslagen ✓" rechtsonder ----- */
#status { position: fixed; right: 16px; bottom: 16px; background: #1f6f43; color: white; padding: 7px 14px;
          border-radius: 7px; opacity: 0; transition: opacity .3s; pointer-events: none; z-index: 10; }
#status.zichtbaar { opacity: 1; }
#status.fout { background: #b3261e; }

/* ----- smalle schermen (telefoon) ----- */
@media (max-width: 600px) {
  main { padding: 10px; }
  .a4 { padding: 16px 12px; overflow-x: auto; }   /* brede tabellen kun je dan opzij schuiven */
  .taarten { grid-template-columns: 1fr; }
  .pagina-titel { font-size: 22px; }
  .balken { --naam: 78px; }
  .schaal span:nth-child(even) { display: none; }  /* alleen 0%, 20%, 40%, ... */
  .vaknaam-vak { min-width: 0; }
}

/* ===================================================================
   PRINTEN: alleen het printvak, elke pagina op een eigen A4
   =================================================================== */
#print-gebied { display: none; }
@page { size: A4 portrait; margin: 11mm 12mm; }
@media print {
  body { background: white; font-size: 13px; }
  body > *:not(#print-gebied) { display: none !important; }
  #print-gebied { display: block !important; }
  #print-gebied .a4 { box-shadow: none; padding: 0; margin: 0; max-width: none; break-after: page; }
  #print-gebied .a4:last-child { break-after: auto; }
  .alleen-scherm { display: none !important; }
  .taarten { grid-template-columns: 1fr 1fr; }
  tr, .taart-blok { break-inside: avoid; }
  .sectie, .wens-vraag { break-after: avoid; }      /* een kopje niet los onderaan een pagina */
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
