* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font-ui);
  background: var(--color-bg);
  color: var(--color-text);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--navy); }
h1, h2, h3, h4 { color: var(--navy); margin: 0; line-height: 1.2; font-weight: 800; }
button, input, select, textarea { font: inherit; color: inherit; }
.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.muted { color: var(--color-text-muted); }
.small { font-size: 13px; }
.wrap { max-width: 1320px; margin: 0 auto; padding: 0 24px; }

/* ── Header ─────────────────────────────────────────────── */
.topbar { background: #fff; border-bottom: 1px solid var(--color-border); position: sticky; top: 0; z-index: 30; }
.topbar .wrap { display: flex; align-items: center; gap: 28px; height: 68px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand img { height: 52px; display: block; margin: -6px 0; }
.brand .mark { font-weight: 900; font-size: 22px; color: var(--navy); letter-spacing: -.02em; }
.brand .mark b { color: var(--orange); }
.brand .sub { font-size: 12px; color: var(--color-text-muted); border-left: 1px solid var(--color-border); padding-left: 12px; line-height: 1.25; }
.nav { display: flex; gap: 4px; flex: 1; }
.nav a { text-decoration: none; font-weight: 700; color: var(--color-text); padding: 8px 14px; border-radius: 999px; }
.nav a:hover { background: var(--color-hover); }
.nav a.active { color: var(--navy); background: var(--blue-pale); }
.role { display: flex; align-items: center; gap: 10px; }
.seg { display: inline-flex; background: var(--color-bg); border-radius: 999px; padding: 3px; }
.seg button { border: 0; background: transparent; padding: 6px 14px; border-radius: 999px; font-weight: 700; font-size: 13px; cursor: pointer; color: var(--color-text-muted); }
.seg button.on { background: var(--navy); color: #fff; }
.role select { border: 1px solid var(--color-border); border-radius: 999px; padding: 6px 12px; font-weight: 700; font-size: 13px; background: #fff; }

/* ── Hero met chevron (factsheet-stijl) ─────────────────── */
.hero { background: var(--navy); color: #fff; padding: 40px 0 72px; clip-path: polygon(0 0, 100% 0, 100% calc(100% - 32px), 50% 100%, 0 calc(100% - 32px)); }
.hero.orange { background: var(--orange); }
.hero h1 { color: #fff; font-size: 38px; letter-spacing: -.02em; }
.hero .kicker { color: var(--orange); font-weight: 800; text-transform: uppercase; letter-spacing: .08em; font-size: 12px; margin-bottom: 8px; }
.hero.orange .kicker { color: var(--navy-dark); }
.hero p { color: rgba(255,255,255,.85); max-width: 760px; margin: 10px 0 0; }
.hero .row { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; }
.page { margin-top: -40px; padding-bottom: 80px; position: relative; }
.page.flat { margin-top: 24px; }

/* ── Cards & grid ───────────────────────────────────────── */
.card { background: var(--color-surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px 24px; margin-bottom: 20px; }
.card > h3 { font-size: 18px; margin-bottom: 14px; display: flex; align-items: center; gap: 10px; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head h3 { font-size: 18px; }
.grid { display: grid; gap: 20px; }
.g2 { grid-template-columns: 1fr 1fr; }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g4 { grid-template-columns: repeat(4, 1fr); }
.side { grid-template-columns: minmax(0, 1fr) 360px; align-items: start; }
@media (max-width: 1000px) { .g2, .g3, .g4, .side { grid-template-columns: 1fr; } }

/* ── KPI tiles ──────────────────────────────────────────── */
.kpi { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; border-top: 4px solid var(--navy); }
.kpi.o { border-top-color: var(--orange); }
.kpi .label { font-size: 13px; color: var(--color-text-muted); font-weight: 600; }
.kpi .value { font-size: 30px; font-weight: 900; color: var(--navy); letter-spacing: -.02em; margin-top: 4px; font-variant-numeric: tabular-nums; }
.kpi .foot { font-size: 13px; color: var(--color-text-muted); margin-top: 2px; }
.bar { height: 8px; background: var(--color-bg); border-radius: 99px; overflow: hidden; margin-top: 10px; display: flex; gap: 2px; }
.bar span { display: block; height: 100%; }

/* ── Proces-chevrons ────────────────────────────────────── */
.chevrons { display: flex; gap: 4px; margin: 4px 0; }
.chev { flex: 1; position: relative; background: var(--blue-pale); color: var(--navy); padding: 12px 18px 12px 28px; clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 50%, calc(100% - 14px) 100%, 0 100%, 14px 50%); min-height: 64px; display: flex; flex-direction: column; justify-content: center; cursor: default; }
.chev:first-child { clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 50%, calc(100% - 14px) 100%, 0 100%); padding-left: 18px; }
.chev .n { font-size: 22px; font-weight: 900; line-height: 1; }
.chev .t { font-size: 12px; font-weight: 700; }
.chev .r { font-size: 11px; opacity: .75; }
.chev.done { background: var(--navy); color: #fff; }
.chev.now { background: var(--orange); color: #fff; }
.chev.click { cursor: pointer; }
.chev.click:hover { filter: brightness(.96); }
.chev.sel { outline: 3px solid var(--orange); outline-offset: -3px; }

/* ── Badges ─────────────────────────────────────────────── */
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 800; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.badge::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.st-concept { background: #eceef3; color: #5f6b7f; }
.st-ingediend { background: var(--blue-pale); color: var(--navy); }
.st-beoordeling { background: #ffe9d9; color: #b34700; }
.st-expertpanel { background: #efe4fb; color: #6b2fb3; }
.st-besloten { background: #ddf1f5; color: #0f6b80; }
.st-toegekend { background: var(--ok-bg); color: var(--ok); }
.chip { display: inline-block; font-size: 11px; font-weight: 800; padding: 1px 7px; border-radius: 4px; background: var(--blue-pale); color: var(--navy); vertical-align: middle; }
.chip.o { background: #ffe9d9; color: #b34700; }

/* ── Buttons ────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; gap: 8px; border: 0; border-radius: 999px; padding: 10px 20px; font-weight: 800; cursor: pointer; text-decoration: none; background: var(--orange); color: #fff; transition: background .15s; }
.btn:hover { background: var(--orange-dark); }
.btn.navy { background: var(--navy); }
.btn.navy:hover { background: var(--navy-dark); }
.btn.ghost { background: transparent; color: var(--navy); box-shadow: inset 0 0 0 2px var(--blue-light); }
.btn.ghost:hover { background: var(--blue-pale); }
.btn.white { background: #fff; color: var(--navy); }
.btn.sm { padding: 6px 14px; font-size: 13px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.linkbtn { border: 0; background: none; color: var(--navy); font-weight: 700; cursor: pointer; padding: 6px 0; }
.linkbtn:hover { color: var(--orange); }

/* ── Tabellen ───────────────────────────────────────────── */
.tbl-wrap { overflow-x: auto; margin: 0 -8px; padding: 0 8px; }
table.tbl { width: 100%; border-collapse: collapse; }
.tbl th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--color-text-muted); text-align: left; font-weight: 700; padding: 8px 8px; border-bottom: 2px solid var(--color-border); white-space: nowrap; }
.tbl th.num { text-align: right; }
.tbl td { padding: 8px 8px; border-bottom: 1px solid var(--color-border); vertical-align: middle; }
.tbl tr.click { cursor: pointer; }
.tbl tr.click:hover td { background: var(--color-hover); }
.tbl tr.sub td { font-weight: 800; color: var(--navy); background: #f7f8fc; }
.tbl tr.total td { font-weight: 900; color: var(--navy); border-top: 2px solid var(--navy); border-bottom: 0; font-size: 16px; }
.tbl tr.head td { font-weight: 800; color: var(--orange); padding-top: 18px; border-bottom: 0; text-transform: uppercase; font-size: 12px; letter-spacing: .06em; }
.tbl td.indent { padding-left: 22px; }
.bondcell b { color: var(--navy); display: block; }

/* Bewerkbare tabel (vervangt de witte Excel-cellen) */
.edit td { padding: 3px 3px; }
.edit th { padding: 6px 4px; }
.edit input, .edit select { width: 100%; border: 1px solid transparent; background: transparent; border-radius: var(--radius-sm); padding: 7px 8px; min-width: 0; }
.edit tr:hover input, .edit tr:hover select { border-color: var(--color-border); background: #fff; }
.edit input:focus, .edit select:focus { outline: none; border-color: var(--navy); background: #fff; box-shadow: 0 0 0 3px rgba(0,55,138,.12); }
.edit input.num { text-align: right; }
.edit input::placeholder { color: #8b95a7; font-style: italic; }
.edit input.over { border-color: var(--warn) !important; background: var(--warn-bg); }
.edit .calc { padding: 7px 8px; font-weight: 700; color: var(--navy); }
.edit .band { font-size: 12px; color: var(--color-text-muted); white-space: nowrap; padding: 0 6px; }
.edit .band.over { color: var(--warn); font-weight: 700; }
.edit .del { border: 0; background: none; color: #a0a8b8; cursor: pointer; font-size: 18px; width: 28px; border-radius: 4px; }
.edit .del:hover { color: var(--red); background: var(--error-bg); }
.edit tfoot td { font-weight: 800; color: var(--navy); border-bottom: 0; padding: 10px 8px; }
.w-xs { width: 64px; } .w-s { width: 90px; } .w-m { width: 118px; } .w-l { width: 180px; }
.add { margin-top: 8px; }
.hint { font-size: 13px; color: var(--color-text-muted); margin: -6px 0 12px; }
.lock { color: var(--color-text-muted); font-size: 12px; }

/* ── Wizard ─────────────────────────────────────────────── */
.wizard { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 24px; align-items: start; }
@media (max-width: 1000px) { .wizard { grid-template-columns: 1fr; } }
.steps { position: sticky; top: 88px; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 10px; }
.steps a { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 6px; text-decoration: none; color: var(--color-text); }
.steps a:hover { background: var(--color-hover); }
.steps a.on { background: var(--blue-pale); }
.steps .i { width: 28px; height: 28px; border-radius: 50%; background: var(--color-bg); color: var(--navy); display: grid; place-items: center; font-weight: 900; font-size: 13px; flex: none; }
.steps a.on .i { background: var(--navy); color: #fff; }
.steps .i.ok { background: var(--ok-bg); color: var(--ok); }
.steps .i.warn { background: var(--warn-bg); color: var(--warn); }
.steps .i.err { background: var(--error-bg); color: var(--error); }
.steps .l { font-weight: 700; font-size: 14px; line-height: 1.2; }
.steps .v { font-size: 12px; color: var(--color-text-muted); font-variant-numeric: tabular-nums; }
.section-title { display: flex; justify-content: space-between; align-items: flex-end; margin: 4px 0 18px; gap: 16px; }
.section-title h2 { font-size: 30px; color: var(--orange); letter-spacing: -.02em; }
.pills { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.pills a { font-size: 13px; font-weight: 700; text-decoration: none; background: #fff; border-radius: 999px; padding: 5px 12px; box-shadow: var(--shadow); color: var(--navy); }
.pills a:hover { background: var(--blue-pale); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 20px; }
.field label { display: block; font-size: 13px; font-weight: 700; color: var(--color-text-muted); margin-bottom: 6px; }
.field input, .field select, .field textarea { width: 100%; border: 1px solid var(--color-border); border-radius: 6px; padding: 10px 12px; background: #fff; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px rgba(0,55,138,.12); }
.field.full { grid-column: 1 / -1; }

/* Sticky totaalbalk (vervangt de "Juist/Onjuist"-checks) */
.totalbar { position: fixed; left: 0; right: 0; bottom: 0; background: var(--navy-deep); color: #fff; z-index: 40; box-shadow: 0 -4px 20px rgba(0,0,0,.15); }
.totalbar .wrap { display: flex; align-items: center; gap: 28px; height: 64px; }
.totalbar .t { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; opacity: .7; }
.totalbar .v { font-size: 18px; font-weight: 900; font-variant-numeric: tabular-nums; }
.totalbar .years { display: flex; gap: 6px; margin-left: auto; }
.yr { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; padding: 6px 10px; border-radius: 999px; background: rgba(255,255,255,.08); }
.yr.ok .dot { background: #4cd07d; }
.yr.bad { background: rgba(225,0,26,.35); }
.yr .dot { width: 8px; height: 8px; border-radius: 50%; background: #ff6b7a; }
.saved { font-size: 12px; opacity: .7; min-width: 90px; }

/* ── Checks ─────────────────────────────────────────────── */
.checks { list-style: none; padding: 0; margin: 0; }
.checks li { display: flex; gap: 10px; padding: 9px 12px; border-radius: 6px; margin-bottom: 6px; font-size: 14px; align-items: flex-start; }
.checks li .ic { font-weight: 900; flex: none; width: 18px; text-align: center; }
.checks .error { background: var(--error-bg); color: var(--error); }
.checks .warn { background: var(--warn-bg); color: #7a5000; }
.checks .info { background: var(--blue-pale); color: var(--navy); }
.checks .ok { background: var(--ok-bg); color: var(--ok); }
.checks .where { display: block; font-size: 12px; opacity: .8; }

/* ── Timeline ───────────────────────────────────────────── */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 16px 24px; border-left: 2px solid var(--color-border); margin-left: 6px; }
.timeline li:last-child { border-left-color: transparent; padding-bottom: 0; }
.timeline li::before { content: ''; position: absolute; left: -7px; top: 3px; width: 12px; height: 12px; border-radius: 50%; background: var(--navy); border: 2px solid #fff; box-shadow: 0 0 0 2px var(--navy); }
.timeline li:last-child::before { background: var(--orange); box-shadow: 0 0 0 2px var(--orange); }
.timeline .d { font-size: 12px; color: var(--color-text-muted); }
.timeline .w { font-weight: 800; color: var(--navy); font-size: 14px; }
.timeline .o { font-size: 13px; }

/* ── Actiepaneel beoordeling ────────────────────────────── */
.panel { position: sticky; top: 88px; }
.panel .card { border-top: 4px solid var(--orange); }
.panel textarea { min-height: 90px; resize: vertical; }
.panel .btn { width: 100%; justify-content: center; margin-top: 10px; }
.roles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-top: 6px; }
.roles div { font-size: 11px; color: var(--color-text-muted); text-align: center; }

/* ── Grafiek & legenda ──────────────────────────────────── */
.chart { position: relative; height: 280px; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; margin-bottom: 10px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }

/* TFV afwijkingsbalk */
.dev { display: flex; align-items: center; gap: 8px; justify-content: flex-end; }
.dev .track { width: 120px; height: 8px; background: var(--color-bg); border-radius: 99px; position: relative; overflow: hidden; }
.dev .track span { position: absolute; top: 0; bottom: 0; }
.dev .track::after { content: ''; position: absolute; left: 50%; top: -2px; bottom: -2px; width: 2px; background: #b9c0cc; }

/* ── Overige ────────────────────────────────────────────── */
.empty { text-align: center; padding: 40px; color: var(--color-text-muted); }
.toast { position: fixed; top: 84px; right: 24px; background: var(--navy); color: #fff; padding: 12px 18px; border-radius: 8px; box-shadow: var(--shadow); z-index: 60; font-weight: 700; transform: translateY(-10px); opacity: 0; transition: .2s; pointer-events: none; }
.toast.show { transform: none; opacity: 1; }
.toast.ok { background: var(--ok); }
footer.foot { text-align: center; font-size: 12px; color: var(--color-text-muted); padding: 24px 0 90px; }
footer.foot button { border: 0; background: none; color: var(--navy); font-weight: 700; cursor: pointer; font-size: 12px; }
.notice { background: var(--blue-pale); color: var(--navy); padding: 12px 16px; border-radius: 6px; font-size: 14px; margin-bottom: 20px; display: flex; gap: 10px; align-items: center; }
.notice.o { background: #ffe9d9; color: #8a3a00; }
