/* Teampuls — één stylesheet voor alle pagina's, licht en donker. Kleuren zoals teamscan. */

:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #f0f2f5;
  --line: #e2e6ec;
  --text: #16202b;
  --muted: #5d6b7c;
  --accent: #0f766e;
  --accent-soft: #d7f0eb;
  --accent-text: #0b5a54;
  --op-accent: #ffffff;
  --danger: #b42318;
  --warn: #b54708;
  --good: #1a7f4b;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 8px 24px rgba(16, 24, 40, .06);
  --radius: 14px;
  /* Grafieken: categorische volgorde uit de gevalideerde referentiepalet. */
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100;
  --s5: #e87ba4; --s6: #008300; --s7: #6250d6; --s8: #e34948;
  --totaal: #16202b;
  --grid: #e7eaee;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #10151b;
    --surface: #171e26;
    --surface-2: #1e262f;
    --line: #2a3440;
    --text: #e8edf3;
    --muted: #9aa8b8;
    --accent: #2dd4bf;
    --accent-soft: #133b38;
    --accent-text: #7ee7dc;
    --op-accent: #06201d;
    --danger: #f97066;
    --warn: #fdb022;
    --good: #47cd89;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 12px 32px rgba(0, 0, 0, .35);
    --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500;
    --s5: #d55181; --s6: #008300; --s7: #9085e9; --s8: #e66767;
    --totaal: #e8edf3;
    --grid: #26303b;
  }
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5rem; }
h1 { font-size: clamp(1.4rem, 3.5vw, 1.9rem); letter-spacing: -.02em; }
h2 { font-size: 1.1rem; }
h3 { font-size: .95rem; }
p { margin: 0 0 .75rem; }
a { color: var(--accent-text); }
.muted { color: var(--muted); font-size: .9rem; }
.klein { font-size: .82rem; }

/* ── Kader ── */
.top {
  display: flex; align-items: center; gap: 12px; padding: 12px 20px;
  background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5;
}
.merk { font-weight: 750; color: var(--accent-text); text-decoration: none; letter-spacing: -.01em; }
.merk span { color: var(--muted); font-weight: 500; }
.top .ruimte { flex: 1; }
.kruimel { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; min-width: 0; color: var(--muted); font-size: .9rem; }
.kruimel a { text-decoration: none; }
main { max-width: 1120px; margin: 0 auto; padding: 24px 16px 64px; }

.kaart { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.kaart + .kaart, .stapel > * + * { margin-top: 16px; }
.raster { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.rij { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.rij.tussen { justify-content: space-between; }
.kop { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }

/* ── Knoppen & formulieren ── */
button, .knop {
  font: inherit; font-weight: 600; font-size: .9rem; cursor: pointer; border-radius: 9px;
  padding: 8px 14px; border: 1px solid var(--line); background: var(--surface); color: var(--text);
  text-decoration: none; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
}
button:hover, .knop:hover { background: var(--surface-2); }
button.primair, .knop.primair { background: var(--accent); border-color: var(--accent); color: var(--op-accent); }
button.primair:hover { filter: brightness(1.08); background: var(--accent); }
button.gevaar { color: var(--danger); }
button.link { border: none; background: none; padding: 2px 4px; color: var(--accent-text); font-weight: 500; }
button.link.gevaar { color: var(--danger); }
button:disabled { opacity: .5; cursor: default; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}

label { display: block; font-weight: 600; font-size: .88rem; margin: 12px 0 4px; }
label .muted { font-weight: 400; }
input, select, textarea {
  font: inherit; width: 100%; padding: 8px 10px; border-radius: 9px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text);
}
textarea { min-height: 110px; resize: vertical; }
input[type="checkbox"], input[type="radio"] { width: auto; }
.keuze { display: flex; gap: 8px; align-items: flex-start; font-weight: 400; margin: 6px 0; cursor: pointer; }
.keuze input { margin-top: 4px; }
.velden { display: grid; gap: 0 16px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

/* ── Labels, tabellen ── */
.label { display: inline-block; font-size: .75rem; font-weight: 650; padding: 2px 8px; border-radius: 99px; background: var(--surface-2); color: var(--muted); }
.label.open { background: var(--accent-soft); color: var(--accent-text); }
.label.gepland { background: #fff1d6; color: #7a4b00; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .label.gepland { background: #3a2a0c; color: #fdb022; } }
.label.ingeleverd { background: var(--accent-soft); color: var(--accent-text); }

table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 650; }
td.getal, th.getal { text-align: right; font-variant-numeric: tabular-nums; }
.tabelscroll { overflow-x: auto; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs a { padding: 9px 14px; text-decoration: none; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a.actief { color: var(--text); border-color: var(--accent); }

.melding { padding: 10px 14px; border-radius: 10px; background: var(--surface-2); margin-bottom: 12px; }
.melding.fout { background: #fde8e6; color: #8a1c12; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .melding.fout { background: #3b1513; color: #f97066; } }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 10px; z-index: 20; }

/* ── Boom ── */
.boom .afd { border-left: 3px solid var(--accent-soft); padding-left: 14px; margin: 16px 0; }
.teamregel { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px; }
.teamregel:hover { background: var(--surface-2); }
.teamregel a { font-weight: 600; text-decoration: none; color: var(--text); }

/* ── Scores ── */
.held { display: flex; gap: 28px; flex-wrap: wrap; align-items: flex-end; }
.held .getal { font-size: 2.6rem; font-weight: 750; letter-spacing: -.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.held .sub { color: var(--muted); font-size: .85rem; margin-top: 4px; }
.balk { display: grid; grid-template-columns: minmax(120px, 220px) 1fr 44px; gap: 10px; align-items: center; margin: 7px 0; font-size: .9rem; }
.balk .spoor { height: 10px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.balk .vul { height: 100%; background: var(--s1); border-radius: 99px; }
.balk .w { text-align: right; font-variant-numeric: tabular-nums; font-weight: 650; }
.balk.met-vorige { grid-template-columns: minmax(120px, 220px) 1fr 44px 56px; }
.balk .spoor { position: relative; }
.balk .vorig { position: absolute; top: -2px; bottom: -2px; width: 2px; margin-left: -1px; background: var(--text); border-radius: 1px; }
.verschil.op { color: var(--good); } .verschil.neer { color: var(--danger); }

/* ── Grafiek ── */
.grafiek { position: relative; }
.grafiek svg { display: block; width: 100%; height: auto; overflow: visible; }
.grafiek text { fill: var(--muted); font-size: 11px; }
.grafiek .as { stroke: var(--line); }
.grafiek .rooster { stroke: var(--grid); }
.tip {
  position: absolute; pointer-events: none; background: var(--surface); border: 1px solid var(--line);
  box-shadow: var(--shadow); border-radius: 10px; padding: 8px 10px; font-size: .82rem; min-width: 160px; z-index: 4;
}
.tip .r { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.legenda { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .84rem; margin-bottom: 8px; }
.legenda span { display: inline-flex; align-items: center; gap: 6px; }
.legenda i { display: inline-block; width: 14px; height: 3px; border-radius: 2px; }
.legenda button { padding: 2px 8px; font-weight: 500; }
.legenda button.uit { opacity: .45; }

.heat td.cel { text-align: center; font-variant-numeric: tabular-nums; font-weight: 650; border: 2px solid var(--surface); border-radius: 6px; }

/* ── Inloggen & invullen ── */
.smal { max-width: 640px; margin: 0 auto; padding: 32px 16px 80px; }
.vraag { padding: 16px 0; border-bottom: 1px solid var(--line); }
.vraag p { font-weight: 550; }
.schaal { display: grid; grid-template-columns: repeat(5, 1fr) auto; gap: 6px; }
.schaal button { justify-content: center; padding: 10px 4px; font-weight: 600; flex-direction: column; gap: 2px; white-space: normal; line-height: 1.15; font-size: .78rem; }
.schaal button b { font-size: 1rem; }
.schaal button.gekozen, .optie.gekozen { background: var(--accent); border-color: var(--accent); color: var(--op-accent); }
.schaal .wn { font-weight: 500; color: var(--muted); }
.optie { display: block; width: 100%; text-align: left; white-space: normal; margin: 6px 0; font-weight: 500; }
.voortgang { position: sticky; top: 0; background: var(--bg); padding: 10px 0; z-index: 3; }
.voortgang .spoor { height: 6px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.voortgang .vul { height: 100%; background: var(--accent); transition: width .2s; }
.dimkop { margin: 28px 0 0; color: var(--accent-text); }

@media (max-width: 560px) {
  .top { padding: 10px 14px; }
  .schaal { grid-template-columns: repeat(5, 1fr); }
  .schaal .wn { grid-column: 1 / -1; }
  .balk, .balk.met-vorige { grid-template-columns: 1fr 44px; }
  .balk.met-vorige { grid-template-columns: 1fr 44px 56px; }
  .balk .spoor { grid-column: 1 / -1; grid-row: 2; }
}

/* Opvallend */
.opvallend { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); margin-top: 18px; }
.opvallend > div { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.opvallend .wat { font-size: .78rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.opvallend b { display: block; margin-top: 2px; }

/* Lopende rondes */
.lopend { display: grid; gap: 10px; }
.lopend a { display: grid; grid-template-columns: 1fr 160px 70px; gap: 12px; align-items: center; color: inherit; text-decoration: none; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }
.lopend a:hover { border-color: var(--accent); }
.lopend .spoor { height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.lopend .vul { height: 100%; background: var(--accent); border-radius: 99px; }
.label.let-op { background: #fff1d6; color: #7a4b00; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .label.let-op { background: #3a2a0c; color: #fdb022; } }
@media (max-width: 560px) { .lopend a { grid-template-columns: 1fr 60px; } .lopend a .spoor { grid-column: 1 / -1; grid-row: 2; } }

/* Afdrukken / opslaan als PDF */
.alleen-print { display: none; }
@media print {
  :root { color-scheme: light; }
  body { background: #fff !important; color: #000; }
  header.top, .niet-printen, button, select, .knop, nav.tabs { display: none !important; }
  .alleen-print { display: block; }
  .kaart { break-inside: avoid; box-shadow: none !important; border: 1px solid #ccc; }
  main { max-width: none; padding: 0; }
  details > summary { display: none; }
  a { color: inherit; text-decoration: none; }
}

/* Voorbeeldweergave van een vragenlijst */
.melding.voorbeeld { background: #fff1d6; color: #7a4b00; border: 1px dashed #b54708; margin-bottom: 16px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .melding.voorbeeld { background: #3a2a0c; color: #fdb022; border-color: #fdb022; } }

/* Vragenlijst bewerken */
.stelling { border-top: 1px solid var(--line); padding: 10px 0; }
.stelling textarea { min-height: 56px; }
.stelling .rij { margin-top: 6px; align-items: center; }
.ruimte { flex: 1; }
.actiebalk { position: sticky; bottom: 0; z-index: 4; display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  margin-top: 16px; padding: 12px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }

/* Mailstatus */
.label.fout { background: #fde2e0; color: #a3150b; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .label.fout { background: #3b1513; color: #f97066; } }
tr.mailregels > td { background: var(--surface-2); }
dialog.maildialoog { width: min(760px, 94vw); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--text); padding: 18px; }
dialog.maildialoog::backdrop { background: rgba(0, 0, 0, .45); }
.mailregel { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); }
.mailregel:last-child { border-bottom: 0; }

/* Vragenlijst over pagina's */
.paginaknoppen { display: flex; gap: 10px; align-items: center; margin: 28px 0 8px; }
