/* ==========================================================================
   EHGI Nulmeting - portaal. Security-console design system.
   Geen JS, geen inline styles (strikte CSP: style-src 'self'). Alles via classes.
   Merk: navy + goud. Signatuur: mono technische chips + hairline console-textuur.
   ========================================================================== */

:root {
  --navy: #1b2a4a;
  --navy-900: #101d38;
  --navy-700: #26375a;
  --ink: #182236;
  --slate: #58627450;      /* niet gebruikt direct */
  --muted: #5b6577;
  --muted-2: #8a93a4;
  --line: #e5e8ef;
  --line-2: #eef1f6;
  --bg: #f4f6fb;
  --surface: #ffffff;
  --gold: #e8b931;
  --gold-soft: #f7edcb;
  --ok: #0f7a43;    --ok-bg: #e7f6ec;    --ok-line: #b9e3c8;
  --warn: #8a5a00;  --warn-bg: #fff2d1;  --warn-line: #f0dca0;
  --danger: #b42318; --danger-bg: #fdece9; --danger-line: #f3c6c0;

  --r-sm: 8px; --r: 12px; --r-lg: 16px;
  --sh-sm: 0 1px 2px rgba(16,29,56,.06), 0 1px 1px rgba(16,29,56,.04);
  --sh-md: 0 14px 34px -18px rgba(16,29,56,.30);
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Code", "Roboto Mono", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
[hidden], input[type="hidden"] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-wrap: break-word;
  /* sticky footer: pagina eindigt bij de footer, geen lege sectie eronder */
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}
main.wrap { flex: 1 0 auto; }
.top, .site-foot { flex: 0 0 auto; }
.docsub { overflow-wrap: anywhere; }

.wrap { max-width: 1040px; margin: 0 auto; padding: 0 24px; }
/* breed portaal op desktop; mobiel valt terug op dezelfde volle breedte */
.wrap.wide { max-width: 1320px; }

a { color: var(--navy); }

/* ----- Header / hero -------------------------------------------------------- */
.top {
  position: relative;
  overflow: hidden;
  border-top: 3px solid var(--gold);
  background:
    radial-gradient(120% 150% at 88% -30%, rgba(232,185,49,.14), transparent 55%),
    linear-gradient(165deg, var(--navy-900), var(--navy) 62%);
}
.top::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: repeating-linear-gradient(90deg, rgba(255,255,255,.035) 0 1px, transparent 1px 44px);
}
.top .wrap { position: relative; z-index: 1; padding: 22px 24px 32px; }
.bar { display: none; }  /* accent zit nu in de border-top van .top */

/* Kop-balk met logo (naar portaal) links en nav rechtsboven */
.top-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.brand-link { display: inline-flex; text-decoration: none; }
.top-nav { display: flex; align-items: center; gap: 8px; }
.topnav-link {
  display: inline-flex; align-items: center; font-size: 13px; font-weight: 600;
  color: rgba(255,255,255,.82); text-decoration: none; border: 1px solid rgba(255,255,255,.20);
  border-radius: 999px; padding: 7px 15px; transition: border-color .15s, color .15s, background .15s;
}
.topnav-link:hover { border-color: var(--gold); color: #fff; }
.topnav-link + .topnav-link { background: rgba(255,255,255,.04); }

.brand-logo { height: 30px; width: auto; display: block; margin-bottom: 16px; }
.top-bar .brand-logo, .brand-link .brand-logo { margin-bottom: 0; }
.top h1 {
  color: #fff; font-size: 30px; line-height: 1.12; font-weight: 700;
  letter-spacing: -.015em; margin-bottom: 9px;
}
.lead { color: rgba(255,255,255,.74); max-width: 64ch; font-size: 15px; }
.top-actions { margin-top: 18px; }
.logout {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 13px; font-weight: 600; color: rgba(255,255,255,.86);
  text-decoration: none; border: 1px solid rgba(255,255,255,.20);
  border-radius: 999px; padding: 6px 15px; transition: border-color .15s, color .15s;
}
.logout:hover { border-color: var(--gold); color: #fff; }

/* ----- Main + typografie ---------------------------------------------------- */
main.wrap { padding-top: 30px; padding-bottom: 8px; }

main h2 {
  font-size: 18px; color: var(--navy); font-weight: 700; letter-spacing: -.01em;
  margin: 26px 0 12px; padding-bottom: 8px; border-bottom: 2px solid var(--line);
}
h2.plain { border: 0; padding: 0; margin: 0 0 8px; }
h2.plain.mt { margin-top: 30px; }

p { margin-bottom: 12px; }
p:last-child { margin-bottom: 0; }

.note {
  color: var(--muted); font-size: 14px; line-height: 1.55;
  margin: 4px 0 18px; max-width: 74ch;
}
.backlink { margin: 4px 0 14px; }
.backlink a {
  font-family: var(--mono); font-size: 12px; letter-spacing: .02em;
  color: var(--muted); text-decoration: none;
}
.backlink a:hover { color: var(--navy); }

/* ----- Cards ---------------------------------------------------------------- */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 22px 24px; margin: 16px 0; box-shadow: var(--sh-sm);
}
.card h2 { border: 0; padding: 0; margin: 0 0 10px; font-size: 16px; }
.card.ok { border-color: var(--ok-line); background: var(--ok-bg); color: var(--ok); }
.card.err { border-color: var(--danger-line); background: var(--danger-bg); color: var(--danger); }
.card.ok p, .card.err p { margin: 0; font-weight: 500; }

/* ----- Buttons -------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--navy); color: #fff; border: 1px solid var(--navy);
  border-radius: var(--r); padding: 11px 20px; font: inherit; font-weight: 600;
  font-size: 14px; cursor: pointer; text-decoration: none;
  transition: background .15s, transform .05s, box-shadow .15s;
}
.btn:hover { background: var(--navy-700); box-shadow: var(--sh-md); }
.btn:active { transform: translateY(1px); }
.btn.ghost { background: #fff; color: var(--navy); border-color: var(--line); box-shadow: none; }
.btn.ghost:hover { border-color: var(--navy); background: #fff; }

/* ----- Forms ---------------------------------------------------------------- */
.fld { display: block; margin: 16px 0; font-weight: 600; color: var(--navy); font-size: 14px; }
.fld input {
  display: block; width: 100%; margin-top: 7px; font: inherit; font-size: 15px; font-weight: 400;
  color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: var(--r);
  padding: 12px 13px; transition: border-color .15s, box-shadow .15s;
}
input[type="file"] { display: block; margin-top: 8px; font: inherit; font-size: 14px; color: var(--muted); }
textarea {
  width: 100%; font: inherit; font-size: 14px; color: var(--ink); background: #fff;
  border: 1px solid var(--line); border-radius: var(--r-sm); padding: 9px 11px; resize: vertical; margin-top: 6px;
}
.fld input:focus, textarea:focus, input[type="file"]:focus-visible {
  outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px rgba(27,42,74,.14);
}
input[type="radio"], input[type="checkbox"] { accent-color: var(--navy); width: 15px; height: 15px; }

.actions { display: flex; gap: 12px; justify-content: flex-end; padding: 18px 0 4px; flex-wrap: wrap; }
form.card .actions { padding: 6px 0 0; }

/* ----- Vragenlijst (deel-1 + ronde) ---------------------------------------- */
section { margin-bottom: 8px; }
.q { background: #fff; border: 1px solid var(--line); border-radius: var(--r);
  padding: 16px 18px; margin: 12px 0; box-shadow: var(--sh-sm); }
.qhead { font-weight: 600; color: var(--navy); font-size: 15px; }
.code { display: inline-block; font-family: var(--mono); font-size: 11px; font-weight: 600;
  background: var(--navy); color: var(--gold); border-radius: 5px; padding: 1px 7px; margin-right: 7px; }
.help { color: var(--muted); font-size: 13px; margin: 5px 0 9px; }
.opts { display: flex; flex-wrap: wrap; gap: 7px 18px; margin: 10px 0; }
.opt { font-size: 14px; cursor: pointer; display: inline-flex; align-items: center; gap: 7px; color: var(--ink); }
.na { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--muted); margin: 4px 0 8px; }

/* ----- Traject-overzicht ---------------------------------------------------- */
.traject { list-style: none; padding: 0; margin: 20px 0; }
.ronde-card {
  display: flex; gap: 18px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 20px 22px; margin: 14px 0; box-shadow: var(--sh-sm);
  transition: border-color .15s, box-shadow .15s;
}
.ronde-card:hover { box-shadow: var(--sh-md); }
.ronde-card.current { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold), var(--sh-md); }
.ronde-num {
  flex: 0 0 42px; height: 42px; border-radius: 10px; background: var(--navy); color: var(--gold);
  font-family: var(--mono); font-weight: 700; font-size: 17px;
  display: flex; align-items: center; justify-content: center;
}
.ronde-body { flex: 1; min-width: 0; }
.ronde-titel {
  font-weight: 700; color: var(--navy); font-size: 16px; letter-spacing: -.01em;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.ronde-thema { color: var(--muted); font-size: 13px; margin: 3px 0 7px; }

.badge { font-size: 11px; font-weight: 700; border-radius: 999px; padding: 2px 11px; white-space: nowrap;
  border: 1px solid transparent; }
.badge.todo { background: var(--line-2); color: var(--muted); border-color: var(--line); }
.badge.busy { background: var(--warn-bg); color: var(--warn); border-color: var(--warn-line); }
.badge.done { background: var(--ok-bg); color: var(--ok); border-color: var(--ok-line); }

.kaders { margin: 8px 0 4px; display: flex; flex-wrap: wrap; gap: 6px; }
.kader {
  font-family: var(--mono); font-size: 10.5px; font-weight: 600; letter-spacing: .02em;
  color: var(--navy-700); background: var(--line-2); border: 1px solid var(--line);
  border-radius: 6px; padding: 2px 8px;
}

.bar-track { height: 6px; background: var(--line-2); border-radius: 999px; margin: 12px 0 14px; overflow: hidden; }
.bar-fill { height: 100%; background: linear-gradient(90deg, var(--gold), #f0c94a); border-radius: 999px; transition: width .3s ease; }
/* CSP-veilige breedtes (geen inline style): stappen van 5% */
.bar-fill.w0{width:0} .bar-fill.w5{width:5%} .bar-fill.w10{width:10%} .bar-fill.w15{width:15%}
.bar-fill.w20{width:20%} .bar-fill.w25{width:25%} .bar-fill.w30{width:30%} .bar-fill.w35{width:35%}
.bar-fill.w40{width:40%} .bar-fill.w45{width:45%} .bar-fill.w50{width:50%} .bar-fill.w55{width:55%}
.bar-fill.w60{width:60%} .bar-fill.w65{width:65%} .bar-fill.w70{width:70%} .bar-fill.w75{width:75%}
.bar-fill.w80{width:80%} .bar-fill.w85{width:85%} .bar-fill.w90{width:90%} .bar-fill.w95{width:95%}
.bar-fill.w100{width:100%}
.ronde-body .btn { padding: 9px 16px; font-size: 14px; }

/* ----- Dashboard ------------------------------------------------------------ */
.kv { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 28px; margin-top: 10px; }
.kv .k { display: block; font-family: var(--mono); font-size: 10.5px; color: var(--muted-2);
  text-transform: uppercase; letter-spacing: .1em; }
.kv .v { display: block; font-weight: 600; color: var(--navy); font-size: 16px; margin-top: 2px; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; margin: 24px 0; }
/* op ruime desktop: vier stevige tegels op een rij, meer lucht per tegel */
@media (min-width: 900px) { .tiles { grid-template-columns: repeat(4, 1fr); } }
.tile {
  display: flex; flex-direction: column; gap: 12px; min-height: 190px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 24px; text-decoration: none; color: inherit; box-shadow: var(--sh-sm);
  transition: border-color .15s, box-shadow .15s, transform .1s;
}
.tile:hover { border-color: var(--gold); box-shadow: var(--sh-md); transform: translateY(-2px); }
.tile-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.tile-titel { font-weight: 700; color: var(--navy); font-size: 17px; letter-spacing: -.01em; }
.tile-aantal {
  font-family: var(--mono); background: var(--navy); color: var(--gold); font-weight: 700;
  border-radius: 8px; min-width: 28px; height: 26px; display: inline-flex; align-items: center;
  justify-content: center; font-size: 13px; padding: 0 8px;
}
.tile-desc { color: var(--muted); font-size: 13.5px; flex: 1; }
.tile-cta { color: var(--navy); font-weight: 600; font-size: 14px; margin-top: auto; }
.tile-cta::after { content: "\2192"; margin-left: 6px; }

/* ----- Documenten- en uploadlijst ------------------------------------------ */
.doclist { list-style: none; padding: 0; margin: 16px 0; }
.docrow {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  padding: 14px 18px; margin: 10px 0; box-shadow: var(--sh-sm);
}
.doctitel { display: block; font-weight: 600; color: var(--navy); }
.docsub { display: block; font-family: var(--mono); color: var(--muted-2); font-size: 12px; margin-top: 3px; }
.docrow .btn { padding: 8px 15px; font-size: 13px; white-space: nowrap; }

/* ----- Footer --------------------------------------------------------------- */
/* ----- Footer (bedrijfsgegevens) ------------------------------------------- */
/* horizontale marge komt van .wrap; hier alleen verticale padding (geen shorthand) */
.site-foot { border-top: 1px solid var(--line); background: var(--surface); margin-top: 44px; }
.foot-grid { display: grid; grid-template-columns: 2fr repeat(3, minmax(140px, 1fr)); gap: 22px 32px;
  padding-top: 30px; padding-bottom: 22px; }
.foot-logo { height: 22px; width: auto; display: block; margin-bottom: 11px; }
.foot-org { font-weight: 600; color: var(--navy); font-size: 13px; margin: 0 0 4px; }
.foot-note { color: var(--muted); font-size: 12px; margin: 0; max-width: 32ch; }
.foot-h { display: block; font-family: var(--mono); font-size: 10.5px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--muted-2); margin-bottom: 7px; }
.foot-col p { color: var(--muted); font-size: 13px; margin: 0; line-height: 1.65; }
.foot-col a { color: var(--muted); text-decoration: none; }
.foot-col a:hover { color: var(--navy); }
.foot-bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px;
  border-top: 1px solid var(--line-2); padding-top: 14px; padding-bottom: 30px;
  color: var(--muted-2); font-size: 12px; }

/* ----- Kwaliteitsvloer ------------------------------------------------------ */
a:focus-visible, .btn:focus-visible, .tile:focus-visible, .logout:focus-visible,
input:focus-visible, textarea:focus-visible, button:focus-visible {
  outline: 2px solid var(--gold); outline-offset: 2px;
}
@media (max-width: 720px) {
  .wrap { padding-left: 18px; padding-right: 18px; }
  .top .wrap { padding-left: 18px; padding-right: 18px; }
  .top h1 { font-size: 24px; }
  .kv, .tiles { grid-template-columns: 1fr; }
  .tile { min-height: auto; }
  .ronde-card { padding: 16px; gap: 14px; }
  .actions { flex-direction: column; align-items: stretch; }
  .actions .btn, .ronde-body .btn { width: 100%; }
  .docrow { flex-direction: column; align-items: flex-start; }
  .docrow .btn { width: 100%; }
  .top-bar { flex-wrap: wrap; }
  .foot-grid { grid-template-columns: 1fr 1fr; gap: 20px 24px; }
  .foot-brand { grid-column: 1 / -1; }
}
@media (max-width: 460px) {
  .foot-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* Actieregister */
.reg-scroll { overflow-x: auto; margin: 16px 0; }
table.reg { width: 100%; border-collapse: collapse; font-size: 13.5px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
table.reg th { background: var(--navy); color: #fff; text-align: left; padding: 10px 12px;
  font-size: 11px; text-transform: uppercase; letter-spacing: .04em; font-weight: 600; white-space: nowrap; }
table.reg td { padding: 11px 12px; border-top: 1px solid var(--line); vertical-align: top; color: var(--ink); }
table.reg tr:nth-child(even) td { background: #fbfcfe; }
.reg-bev { font-weight: 600; color: var(--navy); min-width: 180px; }
.sev { font-size: 11px; font-weight: 700; border-radius: 999px; padding: 2px 9px; white-space: nowrap; border: 1px solid transparent; }
.sev-krit { background: #fde7e7; color: #a11; border-color: #f3c6c0; }
.sev-hoog { background: var(--danger-bg); color: var(--danger); border-color: var(--danger-line); }
.sev-mid  { background: var(--warn-bg); color: var(--warn); border-color: var(--warn-line); }
.sev-laag { background: var(--line-2); color: var(--muted); border-color: var(--line); }
.st { font-size: 11px; font-weight: 700; border-radius: 999px; padding: 2px 9px; white-space: nowrap; border: 1px solid transparent; }
.st-open   { background: var(--line-2); color: var(--muted); border-color: var(--line); }
.st-loopt  { background: #e7eefb; color: #274b8f; border-color: #cddcf5; }
.st-gedaan { background: var(--ok-bg); color: var(--ok); border-color: var(--ok-line); }
.st-acc    { background: #efeafc; color: #5b3fa0; border-color: #ddd2f4; }

/* Volwassenheidsbeeld */
.mat-overall { display: flex; align-items: baseline; gap: 12px; background: var(--surface);
  border: 1px solid var(--line); border-left: 4px solid var(--gold); border-radius: var(--r);
  padding: 16px 20px; margin: 16px 0 22px; box-shadow: var(--sh-sm); }
.mat-overall-num { font-family: var(--mono); font-size: 34px; font-weight: 700; color: var(--navy); }
.mat-overall-lbl { color: var(--muted); font-size: 14px; }
.mat-list { list-style: none; padding: 0; margin: 8px 0; }
.mat-row { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  padding: 14px 18px; margin: 10px 0; box-shadow: var(--sh-sm); }
.mat-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.mat-titel { font-weight: 600; color: var(--navy); }
.mat-num { font-family: var(--mono); font-weight: 700; color: var(--navy); font-size: 18px; }
.mat-meta { color: var(--muted-2); font-size: 12px; margin-top: 6px; }
.mat-delta { font-weight: 700; border-radius: 999px; padding: 1px 8px; margin-left: 6px; }
.mat-delta.up { background: var(--ok-bg); color: var(--ok); }
.mat-delta.down { background: var(--danger-bg); color: var(--danger); }
.mat-delta.flat { background: var(--line-2); color: var(--muted); }

/* Sessieplanning */
.reg-ics { font-family: var(--mono); font-size: 12px; color: var(--navy); text-decoration: none; white-space: nowrap; }
.reg-ics:hover { color: var(--gold); text-decoration: underline; }
