/* TGI-portaal (opmaak uit de IOB Backoffice) */
:root {
    --bg: #f4f5f7;
    --surface: #ffffff;
    --ink: #1c2330;
    --muted: #5d6778;
    --line: #dfe3ea;
    /* Kleur uit het logo van TGI (RGB Kleur: #141f27); oranje als accent uit hun beeldmateriaal */
    --tgi-donker: #141f27;
    --tgi-oranje: #d47942;
    --iob-navy: var(--tgi-donker);
    --iob-oranje: var(--tgi-oranje);
    --iob-turkoois: var(--tgi-oranje);
    --iob-grijs: #6b7380;
    --brand: var(--tgi-donker);
    --topbar: var(--tgi-donker);
    --topbar-ink: #ffffff;
    --topbar-hover: #24313d;
    --accent: #a8552a;
    --primary: var(--tgi-donker);
    --primary-hover: #2a3a49;
    --ok-bg: #e4f4e9; --ok-ink: #17592e;
    --warn-bg: #fdf1d8; --warn-ink: #7a5200;
    --err-bg: #fbe5e3; --err-ink: #8f1d15;
    --off-bg: #e9ecf1; --off-ink: #4a5361;
    --radius: 6px;
}
@media (prefers-color-scheme: dark) {
    :root {
        --bg: #12161d; --surface: #1b212b; --ink: #e7ebf1; --muted: #9ba6b6; --line: #2e3745;
        --topbar: #0e151c; --topbar-ink: #e7ebf1; --topbar-hover: #24313d;
        --accent: #e8a073; --primary: #b8612f; --primary-hover: #cf7240;
        --ok-bg: #173524; --ok-ink: #9fdcb3;
        --warn-bg: #3d2f0d; --warn-ink: #f0cd7c;
        --err-bg: #431a17; --err-ink: #f5aaa3;
        --off-bg: #2a313d; --off-ink: #b3bcc9;
    }
}
* { box-sizing: border-box; }
html { font-size: 16px; }
body {
    margin: 0; background: var(--bg); color: var(--ink);
    font: 0.9375rem/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.5rem; margin: 0 0 1rem; line-height: 1.25; }
h2 { font-size: 1.125rem; margin: 2rem 0 0.75rem; }
.mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 0.875rem; }
.small { font-size: 0.75rem; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

/* Kop */
.topbar {
    display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1.5rem;
    background: var(--topbar); color: var(--topbar-ink); padding: 0.625rem 1.25rem;
    border-bottom: 4px solid transparent;
    border-image: linear-gradient(90deg, var(--tgi-oranje), var(--tgi-oranje)) 1;
}
.topbar a { color: inherit; }
.brand { display: flex; align-items: center; gap: 0.75rem; font-weight: 600; white-space: nowrap; }
.brand img { height: 2.5rem; width: auto; }
.brand span { padding-left: 0.75rem; border-left: 1px solid var(--line); color: var(--muted); font-weight: 500; }
.brand:hover { text-decoration: none; }
.brand img { display: block; }
.mainnav { display: flex; flex-wrap: wrap; gap: 0.25rem; flex: 1; }
.mainnav a { padding: 0.25rem 0.625rem; border-radius: var(--radius); }
.mainnav a { font-weight: 500; }
.mainnav a:hover { background: var(--topbar-hover); text-decoration: none; }
.mainnav a.current { background: var(--topbar-hover); box-shadow: inset 0 -3px 0 var(--iob-oranje); border-radius: var(--radius) var(--radius) 0 0; }
.usermenu { display: flex; align-items: center; gap: 0.625rem; }
.usermenu .tag { background: var(--topbar-hover); color: inherit; }
.usermenu .btn-quiet { background: transparent; color: inherit; border-color: var(--line); }
.usermenu { margin-left: auto; }
@media (max-width: 760px) { .mainnav { order: 3; flex-basis: 100%; } }

.page { max-width: 1200px; margin: 0 auto; padding: 1.5rem 1.25rem 3rem; }
.pagehead { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem; margin-bottom: 1rem; }
.pagehead h1, .pagehead h2 { margin: 0; }
.crumbs { margin: 0 0 0.25rem; color: var(--muted); font-size: 0.875rem; }

/* Knoppen */
.btn {
    display: inline-block; padding: 0.4375rem 0.875rem; border: 1px solid var(--line); border-radius: var(--radius);
    background: var(--surface); color: var(--ink); font: inherit; font-weight: 500; cursor: pointer; white-space: nowrap;
}
.btn:hover { text-decoration: none; border-color: var(--accent); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-danger { background: #b3261e; border-color: #b3261e; color: #fff; }
.btn-quiet { background: transparent; }
.btn-primary:hover, .btn-danger:hover { border-color: transparent; }
.btn-wide { width: 100%; margin-top: 1rem; }
.linkbutton { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; cursor: pointer; }
.linkbutton:hover { text-decoration: underline; }
form.inline { display: inline; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Meldingen */
.notice { padding: 0.75rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; }
.notice ul { margin: 0; padding-left: 1.25rem; }
.notice-ok { background: var(--ok-bg); color: var(--ok-ink); }
.notice-error { background: var(--err-bg); color: var(--err-ink); }
.empty { background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); padding: 1.5rem; color: var(--muted); }

/* Tabellen */
.tablewrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 0.5625rem 0.75rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
th { font-size: 0.8125rem; color: var(--muted); font-weight: 600; white-space: nowrap; }
th.num { text-align: right; }
tbody tr:last-child td { border-bottom: 0; }
td.actions { text-align: right; white-space: nowrap; }
td.actions > * + * { margin-left: 0.75rem; }

/* Labels */
.tag, .status { display: inline-block; padding: 0.0625rem 0.5rem; border-radius: 999px; font-size: 0.8125rem; font-weight: 500; white-space: nowrap; }
.tag { background: var(--off-bg); color: var(--off-ink); }
.tag-p { background: var(--err-bg); color: var(--err-ink); }
.tag-ota { background: var(--warn-bg); color: var(--warn-ink); }
.status-actief { background: var(--ok-bg); color: var(--ok-ink); }
.status-in_aanbouw, .status-opgeschort { background: var(--warn-bg); color: var(--warn-ink); }
.status-vervallen { background: var(--off-bg); color: var(--off-ink); }
.status-fout { background: var(--err-bg); color: var(--err-ink); }
.status-ingevuld { background: #dff3f6; color: #035e6b; }
@media (prefers-color-scheme: dark) { .status-ingevuld { background: #123d44; color: #9fe3ee; } }

/* Kerncijfers en filters */
.stats { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-bottom: 1.25rem; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 0.75rem 1.25rem; min-width: 9rem; }
.stat-value { display: block; font-size: 1.75rem; font-weight: 600; line-height: 1.2; }
.stat-label { color: var(--muted); font-size: 0.875rem; }
.filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.75rem; margin-bottom: 1rem; }
.filters label { display: flex; flex-direction: column; gap: 0.1875rem; font-size: 0.8125rem; color: var(--muted); }

/* Formulieren */
input[type=text], input[type=email], input[type=password], input[type=url], input[type=number], input[type=search], input[type=tel], input[type=date], select, textarea {
    width: 100%; padding: 0.4375rem 0.625rem; border: 1px solid var(--line); border-radius: var(--radius);
    background: var(--surface); color: var(--ink); font: inherit;
}
.filters input, .filters select { width: auto; min-width: 10rem; }
.form { max-width: 34rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; }
.form label, .authcard label { display: block; font-weight: 500; margin: 0.875rem 0 0.25rem; }
.form > input[type=hidden]:first-child + label, .form > input[type=hidden]:first-child + .fieldrow label, .form > input[type=hidden]:first-child + h2 { margin-top: 0; }
.form label.check, .authcard label.check { font-weight: 400; display: flex; align-items: center; gap: 0.5rem; }
.hint { margin: 0.25rem 0 0; font-size: 0.8125rem; color: var(--muted); }
.formactions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-top: 1.25rem; }
.pagehead .formactions { margin-top: 0; }
.danger { max-width: 34rem; margin-top: 2rem; padding: 1.25rem; border: 1px solid var(--err-ink); border-radius: var(--radius); }
.danger h2 { margin-top: 0; }
.details { display: grid; grid-template-columns: 11rem 1fr; gap: 0.375rem 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.25rem; margin: 0 0 1.5rem; }
.details dt { color: var(--muted); }
.details dd { margin: 0; }
@media (max-width: 560px) { .details { grid-template-columns: 1fr; } .details dd { margin-bottom: 0.5rem; } }

/* Inloggen */
.authpage { display: flex; min-height: 100vh; align-items: center; justify-content: center; padding: 1rem; }
.authcard { width: 100%; max-width: 24rem; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 1.75rem; }
.authbrand { display: flex; flex-direction: column; align-items: center; gap: 0.375rem; font-weight: 600; color: var(--muted); margin-bottom: 1.5rem; }
.authbrand img { display: block; max-width: 100%; height: auto; }
.authpage .authcard { background: linear-gradient(90deg, var(--tgi-oranje), var(--tgi-donker)) top / 100% 4px no-repeat, var(--surface); overflow: hidden; }
.authcard .code { font-size: 1.5rem; letter-spacing: 0.3em; text-align: center; }
.steps { padding-left: 1.25rem; }
.qr { display: block; margin: 1rem auto 0.5rem; background: #fff; padding: 0.5rem; border-radius: var(--radius); }
.secret { text-align: center; font-family: ui-monospace, Consolas, monospace; font-size: 0.875rem; overflow-wrap: anywhere; }

/* Bladeren */
.pagination { display: flex; gap: 0.25rem; list-style: none; padding: 0; margin: 1rem 0 0; }
.pagination a, .pagination span { display: block; padding: 0.25rem 0.625rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.pagination .active a { background: var(--primary); color: #fff; border-color: var(--primary); }

/* Klantkaart */
.tabs { display: flex; gap: 0.25rem; border-bottom: 1px solid var(--line); margin: 0 0 1.25rem; }
.tabs a { padding: 0.5rem 1rem; border: 1px solid transparent; border-bottom: 0; border-radius: var(--radius) var(--radius) 0 0; color: var(--muted); font-weight: 500; margin-bottom: -1px; }
.tabs a:hover { color: var(--ink); text-decoration: none; }
.tabs a.current { background: var(--surface); border-color: var(--line); color: var(--ink); }
.fieldrow { display: flex; flex-wrap: wrap; gap: 0 0.75rem; }
.fieldrow > div { flex: 0 0 9rem; }
.fieldrow > .grow { flex: 1 1 12rem; }
.form .fieldrow label { margin-top: 0.875rem; }
.envcards { display: grid; grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); gap: 1rem; }
.envcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.25rem; }
.envcard header { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.75rem; }
.envcard header .status { margin-left: auto; }
.envcard dl { display: grid; grid-template-columns: 6.5rem 1fr; gap: 0.25rem 0.75rem; margin: 0; }
.envcard dt { color: var(--muted); }
.envcard dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.envcard h3 { font-size: 0.9375rem; margin: 1rem 0 0.375rem; }
.envcard ul { margin: 0; padding-left: 1.125rem; }
.envcard footer { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; margin-top: 0.875rem; padding-top: 0.75rem; border-top: 1px solid var(--line); }
.contactnote { color: var(--muted); font-size: 0.8125rem; margin-top: 0.125rem; }

.notice-warn { background: var(--warn-bg); color: var(--warn-ink); }
.linkbox { margin: 0.5rem 0 0; overflow-wrap: anywhere; user-select: all; }
.authlink { margin: 1rem 0 0; text-align: center; }
.form h2 { margin-top: 1.75rem; }
.form-wide { max-width: 44rem; }
textarea.tall { min-height: 20rem; font-family: ui-monospace, Consolas, monospace; font-size: 0.875rem; }

/* Controlelijst bij importeren */
.edittable td { vertical-align: middle; padding: 0.3125rem 0.5rem; }
.edittable input[type=text] { min-width: 9rem; padding: 0.3125rem 0.5rem; }
.edittable input.short { min-width: 4rem; width: 4rem; }
.edittable select { width: auto; padding: 0.3125rem 0.5rem; }
.rowerror td { background: var(--err-bg); }
.rowmessage { color: var(--err-ink); font-size: 0.8125rem; }
input[type=file] { font: inherit; }

.crontable { font-size: 0.875rem; }
.crontable th, .crontable td { padding: 0.375rem 0.5rem 0.375rem 0; }
.crontable td:first-child { white-space: nowrap; }
.crontable td:last-child { overflow-wrap: anywhere; word-break: break-word; }
.envcards { grid-template-columns: repeat(auto-fit, minmax(22rem, 1fr)); }

/* Inloggegevens van het supportaccount */
.loginbox dl { display: grid; grid-template-columns: 9rem 1fr; gap: 0.375rem 0.75rem; margin: 0.75rem 0; align-items: center; }
.loginbox dd { margin: 0; }
.loginbox p { margin: 0.5rem 0 0; }
.secretvalue { user-select: all; background: var(--surface); color: var(--ink); padding: 0.125rem 0.375rem; border-radius: 4px; }
.btn-small { padding: 0.125rem 0.5rem; font-size: 0.8125rem; }

/* Opdracht van een cronjob: twee regels, uitklapbaar */
.command summary { list-style: none; cursor: pointer; display: flex; gap: 0.375rem; align-items: flex-start; }
.command summary::-webkit-details-marker { display: none; }
.command summary::before { content: "\25B8"; color: var(--muted); flex: none; line-height: 1.5; }
.command[open] summary::before { content: "\25BE"; }
.command summary span { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; word-break: break-word; }
.command[open] summary span { display: block; -webkit-line-clamp: unset; line-clamp: unset; overflow: visible; }

/* Versie */
.pagefoot { max-width: 1200px; margin: 0 auto; padding: 0 1.25rem 2rem; color: var(--muted); font-size: 0.8125rem; }
.pagefoot a { color: inherit; text-decoration: underline; }
.authversion { margin: 1.25rem 0 0; text-align: center; color: var(--muted); font-size: 0.75rem; }
.changelog { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.5rem 1.25rem; max-width: 52rem; }
.changelog h2 { margin-top: 1.25rem; }
.changelog h2:first-child { margin-top: 0.25rem; }
.changelog ul { padding-left: 1.25rem; margin: 0.5rem 0; }
.changelog li { margin: 0.25rem 0; }

.tag-role { background: var(--primary); color: #fff; margin-left: 0.25rem; }

/* Mailing */
.mailbody { white-space: normal; overflow-wrap: anywhere; }
.mailbody img.maillogo { display: block; background: #fff; padding: 0.375rem; border-radius: var(--radius); box-sizing: content-box; }
details > summary { cursor: pointer; margin-bottom: 0.5rem; }
.mailbody p { margin: 0 0 0.75rem; }
.mailbody h2 { font-size: 1.1875rem; margin: 1.25rem 0 0.5rem; }
.mailbody h3 { font-size: 1rem; margin: 1rem 0 0.5rem; }
.mailbody ul, .mailbody ol { margin: 0 0 0.75rem; padding-left: 1.5rem; }
.editor { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.editorbar { display: flex; flex-wrap: wrap; gap: 0.25rem; padding: 0.375rem; border-bottom: 1px solid var(--line); }
.linkrow { display: flex; gap: 0.375rem; padding: 0.375rem; border-bottom: 1px solid var(--line); }
.linkrow[hidden], .editor[hidden] { display: none; }
.editorarea { min-height: 16rem; padding: 0.75rem; outline: none; }
.editorarea:focus-visible { box-shadow: inset 0 0 0 2px var(--primary); }
.attachments { list-style: none; padding: 0; max-width: 44rem; }
.attachments li { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: baseline; padding: 0.25rem 0; }
.stat-link { display: block; color: inherit; text-decoration: none; }
.stat-link:hover, .stat-link:focus-visible { border-color: var(--primary); }
.stat-link.current { border-color: var(--primary); box-shadow: inset 0 -3px 0 var(--primary); }

/* Openbaar formulier (onboarding) */
.publicpage { background: var(--bg); }
.publichead { background: var(--surface); padding: 0.875rem 1rem; display: flex; justify-content: center;
    border-bottom: 4px solid transparent; border-image: linear-gradient(90deg, var(--tgi-oranje), var(--tgi-oranje)) 1; }
.publichead img { display: block; height: 2.75rem; width: auto; }
.publicmain { max-width: 46rem; margin: 0 auto; padding: 1.5rem 1rem 3rem; }
.publicform { max-width: none; }
fieldset { border: 0; padding: 0; margin: 0 0 1.75rem; min-width: 0; }
legend { font-size: 1.125rem; font-weight: 600; padding: 0; margin-bottom: 0.25rem; }
.contactrows { display: grid; gap: 0.75rem; margin-bottom: 0.75rem; }
.contactrow { border: 1px solid var(--line); border-radius: var(--radius); padding: 0.75rem 1rem; }
.contactrow-title { margin: 0; font-weight: 600; }
.contactrow label { font-weight: 500; }
.contactrow label input { margin-top: 0.25rem; font-weight: 400; }
.checkrow { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; margin-top: 0.5rem; }
.checkrow label.check { margin: 0.25rem 0; }
.inputaddon { display: flex; align-items: center; gap: 0.375rem; }
.inputaddon input { flex: 1; }
.inputaddon span { color: var(--muted); white-space: nowrap; }
[hidden] { display: none !important; }
.contactrow label input { display: block; }
.contactrow.is-deleted { opacity: 0.55; border-style: dashed; }
.contactrow.is-deleted .deletecheck { opacity: 1; }
.deletecheck { margin-top: 0.5rem; color: var(--err-ink); }
textarea.narrow { max-width: 34rem; }

/* Klantkaart: in welke WeFact-administraties staat de klant */
.checkgroup { border: 1px solid var(--line); border-radius: var(--radius); padding: 0.5rem 1rem 0.875rem; margin: 1rem 0 0; }
.checkgroup legend { font-weight: 500; padding: 0 0.25rem; }
.adminrow { margin-top: 0.75rem; }
.adminrow + .adminrow { border-top: 1px solid var(--line); padding-top: 0.5rem; }
.adminrow label.check { margin: 0; }
.admindetails { padding-left: 1.5rem; }

/* Formulier in blokken naast elkaar (klantkaart) */
.formgrid { display: grid; grid-template-columns: 1fr; gap: 1rem; align-items: start; }
@media (min-width: 900px) { .formgrid { grid-template-columns: 1fr 1fr; } }
.formgrid .formcard { max-width: none; margin: 0; }
.formgrid .formcard > h2 { margin: 0 0 0.25rem; font-size: 1rem; }
.formgrid .checkgroup { margin-top: 0.5rem; }
.formgrid .formbar { grid-column: 1 / -1; position: sticky; bottom: 0; margin: 0; padding: 0.75rem 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.06); z-index: 1; }

/* Ondertekenen: het document op de pagina */
.pdfframe { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; overflow: hidden; margin: 1rem 0 0.25rem; }
.pdfframe iframe { display: block; width: 100%; height: 70vh; min-height: 24rem; border: 0; }

/* Aanmeldrondes: voortgangsbalk */
.progress { height: 0.625rem; background: var(--off-bg); border-radius: 999px; overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--iob-turkoois); border-radius: 999px; }
.progress-big { height: 0.875rem; margin: 0 0 1.25rem; }

/* Stappen op openbare pagina's */
.steps { display: flex; flex-wrap: wrap; gap: 0.5rem; list-style: none; padding: 0; margin: 1rem 0; counter-reset: stap; }
.steps li { counter-increment: stap; padding: 0.25rem 0.75rem; border-radius: 999px; background: var(--off-bg); color: var(--muted); font-size: 0.875rem; }
.steps li::before { content: counter(stap) ". "; }
.steps li.current { background: var(--iob-navy); color: #fff; }
.steps li.done { background: var(--ok-bg); color: var(--ok-ink); }
.publicform .checkgroup label.check { align-items: flex-start; margin: 0.5rem 0 0; }

/* Overzicht: kaart per aanmeldronde */
.campaigncards { display: grid; grid-template-columns: repeat(auto-fill, minmax(20rem, 1fr)); gap: 0.75rem; }
.campaigncard { display: flex; flex-direction: column; gap: 0.5rem; }
.campaigncard-head { display: flex; justify-content: space-between; gap: 0.5rem; align-items: baseline; }
.campaigncard-counts { display: flex; flex-direction: column; gap: 0.125rem; color: var(--muted); }
tr.rowstart td { border-top: 2px solid var(--line); }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); gap: 1rem; margin-top: 1rem; }
.card { display: block; padding: 1rem 1.25rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); }
.card:hover { text-decoration: none; border-color: var(--accent); }
.card h2 { margin: 0 0 0.375rem; font-size: 1.0625rem; color: var(--accent); }
.card p { margin: 0; color: var(--muted); font-size: 0.9375rem; }
.btn-microsoft { display: flex; align-items: center; justify-content: center; gap: 0.5rem; }
.authdivider { display: flex; align-items: center; gap: 0.75rem; color: var(--muted); font-size: 0.875rem; margin: 1.25rem 0 0.5rem; }
.authdivider::before, .authdivider::after { content: ""; flex: 1; border-top: 1px solid var(--line); }

/* Financiën */
.refreshbar { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.periodlabel { align-self: center; }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); gap: 0.75rem; margin-bottom: 1.5rem; }
.kpi { display: flex; flex-direction: column; gap: 0.125rem; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 0.875rem 1rem; color: var(--ink); }
.kpi-link:hover, .kpi-link:focus-visible { text-decoration: none; border-color: var(--accent); }
.kpi-label { color: var(--muted); font-size: 0.8125rem; font-weight: 500; }
.kpi-value { font-size: 1.625rem; font-weight: 650; line-height: 1.2; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.kpi-small .kpi-value { font-size: 1.125rem; }
.kpi-sub { color: var(--muted); font-size: 0.8125rem; }
.delta { font-size: 0.8125rem; color: var(--muted); margin-top: 0.25rem; }
.delta-good { color: var(--ok-ink); }
.delta-bad { color: var(--err-ink); }
.chartgrid { display: grid; grid-template-columns: 1fr; gap: 1rem; margin-bottom: 1rem; }
@media (min-width: 980px) { .chartgrid { grid-template-columns: 1fr 1fr; } }
.chartcard { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 1rem 1.25rem; margin-bottom: 1rem; min-width: 0; }
.chartgrid .chartcard { margin-bottom: 0; }
.chartcard h2 { margin: 0 0 0.5rem; font-size: 1rem; }
.legend { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; font-size: 0.8125rem; color: var(--muted); margin-bottom: 0.25rem; }
.legend span { display: inline-flex; align-items: center; gap: 0.375rem; }
.swatch { display: inline-block; width: 0.75rem; height: 0.75rem; border-radius: 3px; }

.chart { display: block; width: 100%; height: auto; overflow: visible; font-family: inherit; }
.chart .gridline { stroke: var(--line); stroke-width: 1; }
.chart .axis { stroke: var(--muted); stroke-width: 1; opacity: 0.6; }
.chart .ticklabel { fill: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
.chart .endlabel { fill: var(--ink); font-size: 14px; font-weight: 600; paint-order: stroke; stroke: var(--surface); stroke-width: 3px; }
.chart .line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .dot { stroke: var(--surface); stroke-width: 2; }
.chart .bar { stroke: none; }
.chart .hit { fill: transparent; }
.chart .hit:hover { fill: var(--ink); fill-opacity: 0.05; }

/* Kleuren van de reeksen (gecontroleerd op kleurenblindheid; licht en donker apart) */
.chart, .legend { --series-1: #2a78d6; --series-2: #eb6834; --series-3: #1baf7a; --series-4: #eda100; }
@media (prefers-color-scheme: dark) { .chart, .legend { --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70; --series-4: #c98500; } }
.series-1 { stroke: var(--series-1); fill: var(--series-1); background: var(--series-1); }
.series-2 { stroke: var(--series-2); fill: var(--series-2); background: var(--series-2); }
.series-3 { stroke: var(--series-3); fill: var(--series-3); background: var(--series-3); }
.series-4 { stroke: var(--series-4); fill: var(--series-4); background: var(--series-4); }
.chart .line.series-1, .chart .line.series-2 { fill: none; }

.tablewrap.flat { border: 0; }
.pltable th, .pltable td { padding: 0.375rem 0.5rem; font-size: 0.8125rem; white-space: nowrap; }
.pltable tbody th { text-align: left; color: var(--ink); font-weight: 500; }
.pltable tr.total td, .pltable tr.total th { font-weight: 650; }
table.compact td { padding: 0.4375rem 0.5rem 0.4375rem 0; font-size: 0.875rem; }
.details.flat { border: 0; padding: 0; margin: 0 0 0.75rem; }

@media (max-width: 600px) { .chart .ticklabel, .chart .endlabel { font-size: 22px; } .kpis { grid-template-columns: 1fr 1fr; } .kpi-value { font-size: 1.25rem; } }

/* Betalen */
.subnav { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 1rem; margin: -0.5rem 0 1rem; }
.subnav a { font-weight: 500; color: var(--muted); padding: 0.125rem 0; }
.subnav a.current { color: var(--ink); box-shadow: inset 0 -2px 0 var(--iob-oranje); }
.subnav-status { margin-left: auto; }
.filterchips { display: flex; flex-wrap: wrap; gap: 0.375rem; margin-bottom: 1rem; }
.filterchips a { padding: 0.25rem 0.75rem; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink); font-size: 0.875rem; }
.filterchips a span { color: var(--muted); margin-left: 0.25rem; }
.filterchips a.current { background: var(--primary); border-color: var(--primary); color: #fff; }
.filterchips a.current span { color: rgba(255, 255, 255, 0.75); }
.filterchips a:hover { text-decoration: none; border-color: var(--accent); }
.warntext { color: var(--warn-ink); }
.paybar { position: sticky; bottom: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.25rem; margin-top: 0.75rem; padding: 0.75rem 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.06); }
.paybar label { display: flex; align-items: center; gap: 0.5rem; }
.paybar input[type=date], .paybar input[type=datetime-local] { width: auto; }
.paybar .btn { margin-left: auto; }
.invoicegrid { display: grid; grid-template-columns: 1fr; gap: 1rem; align-items: start; }
@media (min-width: 1000px) { .invoicegrid { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); } .invoicegrid .pdfframe { position: sticky; top: 1rem; } }
.pdfframe { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; overflow: hidden; }
.pdfframe iframe { display: block; width: 100%; height: 80vh; min-height: 28rem; border: 0; }
.invoicegrid .form, .invoicegrid .danger { max-width: none; margin: 0 0 1rem; }
.kpi-text { font-size: 1rem; }
pre.mono { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--off-bg); padding: 0.5rem 0.75rem; border-radius: var(--radius); }
td.num { white-space: nowrap; }

/* Inkoop per productgroep */
.groupstable td, .groupstable th { padding: 0.4375rem 0.5rem; }
.groupstable .barcol { width: 30%; min-width: 8rem; }
.pctbar { position: relative; display: block; height: 0.75rem; background: var(--off-bg); border-radius: 999px; }
.pctfill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--series-1, #2a78d6); border-radius: 999px; }
.pctprev { position: absolute; top: -0.1875rem; bottom: -0.1875rem; width: 2px; margin-left: -1px; background: var(--ink); border-radius: 1px; }
.groupstable, .grouptrend { --series-1: #2a78d6; }
@media (prefers-color-scheme: dark) { .groupstable, .grouptrend { --series-1: #3987e5; } }
.grouptrend td.pctcell { font-variant-numeric: tabular-nums; }
.grouprow label { margin-top: 0.375rem; }
.grouprow { margin-bottom: 0.125rem; }
.accountlist { columns: 2 18rem; padding-left: 1rem; }
.pltable tr.pctrow th, .pltable tr.pctrow td { color: var(--muted); }

/* Streefpercentages */
.target { display: inline-block; font-size: 0.8125rem; margin-top: 0.25rem; font-weight: 500; }
.target-ok { color: var(--ok-ink); }
.target-over { color: var(--err-ink); }
td .target { margin-top: 0; margin-left: 0.25rem; }
.pcttarget { position: absolute; top: -0.5rem; width: 0; height: 0; margin-left: -0.3125rem; border-left: 0.3125rem solid transparent; border-right: 0.3125rem solid transparent; border-top: 0.4375rem solid var(--iob-oranje); }
@media (prefers-color-scheme: dark) { .pcttarget { border-top-color: var(--accent); } }
.grouptrend td.over { color: var(--err-ink); font-weight: 600; }
.targetcol { flex: 0 0 8rem; }
.barlegend { display: flex; flex-wrap: wrap; gap: 0.25rem 0.875rem; font-weight: 500; }
.barlegend span { display: inline-flex; align-items: center; gap: 0.3125rem; }
.barlegend i { display: inline-block; }
.lg-now { width: 1rem; height: 0.5rem; border-radius: 999px; background: var(--series-1, #2a78d6); }
.lg-prev { width: 2px; height: 0.875rem; background: var(--ink); }
.lg-target { width: 0; height: 0; border-left: 0.3125rem solid transparent; border-right: 0.3125rem solid transparent; border-top: 0.4375rem solid var(--iob-oranje); }
@media (prefers-color-scheme: dark) { .lg-target { border-top-color: var(--accent); } }

/* Factuur: van wie is deze factuur (A: bestaande, B: nieuwe leverancier) */
.form > form + form { border-top: 1px solid var(--line); margin-top: 1.25rem; padding-top: .5rem; }
.form > form h3 { font-size: 1rem; margin: .75rem 0 .25rem; }

/* Specificatie per grootboekrekening */
.pltable a.speclink { color: inherit; text-decoration: none; border-bottom: 1px dotted var(--line); }
.pltable a.speclink:hover { color: var(--accent); border-bottom-color: var(--accent); }
.spectable thead a { color: inherit; }
.spectable tbody th { max-width: 22rem; overflow: hidden; text-overflow: ellipsis; }
.spectable th.sel, .spectable td.sel { background: var(--off-bg); }
.spectable th.future, .spectable td.future { color: var(--muted); }
.spectable td.spike, .spike-sample { background: var(--warn-bg); color: var(--warn-ink); font-weight: 600; }
.spike-sample { padding: 0 0.25rem; border-radius: 3px; }

/* Betalen: balk met aangevinkte facturen */
.paybar .btn { margin-left: 0; }
.paybar .btn[data-pay] { margin-left: auto; }
.paybar select { width: auto; }
.paybar label { white-space: nowrap; }

/* Migratie: geblokkeerde accounts verbergen */
.hide-suspended tr[data-suspended] { display: none; }

/* Uren */
.status-open, .status-wachtrij, .status-bezig { background: var(--warn-bg); color: var(--warn-ink); }
.status-afgewezen { background: var(--err-bg); color: var(--err-ink); }
.status-goedgekeurd, .status-afgerond { background: #dff3f6; color: #035e6b; }
.status-gefactureerd, .status-aangemaakt { background: var(--ok-bg); color: var(--ok-ink); }
@media (prefers-color-scheme: dark) { .status-goedgekeurd, .status-afgerond { background: #123d44; color: #9fe3ee; } }
.hoursform { margin-bottom: 0.5rem; }
.hoursform .fieldrow .grow select { width: 100%; }

/* Weekstaat */
.weekstatus { table-layout: fixed; width: 100%; min-width: 52rem; }
.weekstatus th:first-child { width: 10rem; }
.weekstatus th:last-child { width: 8.5rem; }
.weekstatus td.daycell { vertical-align: top; white-space: normal; }
.weeklegend { display: flex; flex-wrap: wrap; align-items: center; gap: 0.375rem 0.5rem; margin: 0 0 0.75rem; color: var(--muted); }
.weekstatus td.daycell a { color: inherit; font-weight: 600; text-decoration: none; }
.weekstatus td.daycell a:hover { text-decoration: underline; }
.weekstatus .daynote { display: block; white-space: normal; overflow-wrap: anywhere; font-size: 0.75rem; font-weight: 400; line-height: 1.25; margin-top: 0.125rem; }
.weekstatus th.today { color: var(--accent); }
.weekstatus td.today { box-shadow: inset 0 0 0 2px var(--accent); }
.day-ok { background: var(--ok-bg); color: var(--ok-ink); }
.day-let_op { background: var(--warn-bg); color: var(--warn-ink); }
.day-leeg { background: var(--err-bg); color: var(--err-ink); }
.day-bezig { background: var(--off-bg); color: var(--off-ink); }
.daycell-key { display: inline-block; padding: 0 0.5rem; border-radius: 999px; }

/* Klokken */
.clockcard { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem 1.5rem; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--off-ink); border-radius: var(--radius); padding: 0.875rem 1.25rem; margin: 0 0 1.5rem; }
.clockcard.clock-in { border-left-color: var(--ok-ink); }
.clockcard.clock-klaar { border-left-color: var(--accent); }
.clockinfo { display: flex; flex-direction: column; gap: 0.125rem; }
.clockday { font-size: 0.8125rem; color: var(--muted); }
.clockstate { font-size: 1.125rem; }
.clockactions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.btn-clock { background: #1d7a46; border-color: #1d7a46; color: #fff; font-size: 1.0625rem; padding: 0.625rem 1.75rem; }
.btn-clock:hover { background: #16633a; border-color: #16633a; color: #fff; }
.btn-clock-out { background: var(--iob-oranje, #E6700A); border-color: var(--iob-oranje, #E6700A); }
.btn-clock-out:hover { background: #c45f08; border-color: #c45f08; }
.clockwarn { flex-basis: 100%; margin: 0; color: var(--warn-ink); }
@media (max-width: 600px) { .clockactions, .clockactions form, .btn-clock { width: 100%; } }
.day-vrij { background: var(--off-bg); color: var(--off-ink); }
.coverage td { font-size: 0.8125rem; vertical-align: top; }
.coverage .gap { color: var(--err-ink); font-weight: 600; }
.coverage .covered { color: var(--ok-ink); }

/* ---------- TGI-portaal ---------- */
.mt-0 { margin-top: 0; }
.mt-15 { margin-top: 1.5rem; }
.details-plain { border: 0; padding: 0; margin-bottom: 1rem; }
form.form + form.form { margin-top: 1.5rem; }
.brand img { vertical-align: middle; height: 28px; width: auto; }
.authbrand img { width: 200px; height: auto; }
.stafflogin { margin-top: 1.5rem; border-top: 1px solid var(--line); padding-top: 1rem; }
.stafflogin summary { cursor: pointer; color: var(--muted); margin-bottom: .75rem; }
.fingerprint { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 1.5rem; letter-spacing: .05em; font-weight: 600; margin: .5rem 0 1rem; word-spacing: .3em; }
.steps li.done::after { content: " ✓"; }
.itemchip { display: inline-block; font-size: .8rem; padding: .1rem .45rem; border-radius: 999px; background: var(--off-bg); color: var(--off-ink); margin: .1rem .15rem .1rem 0; white-space: nowrap; }
.itemchip.item-beschikbaar, .itemchip.item-klaar { background: var(--warn-bg); color: var(--warn-ink); }
.itemchip.item-opgehaald { background: var(--ok-bg); color: var(--ok-ink); }
.itemchip.item-ingetrokken, .itemchip.item-verlopen { background: var(--err-bg); color: var(--err-ink); }
.openbox { display: grid; gap: .5rem; min-width: 16rem; }
.codeform { display: flex; gap: .4rem; }
.codeform input { width: 8rem; margin: 0; }
.messagebox { white-space: pre-wrap; word-break: break-word; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: .75rem; max-width: 40rem; font-family: inherit; }
.devicecheck { margin-bottom: 1rem; }
.current-device td:first-child::after { content: " (deze browser)"; color: var(--ok-ink); font-size: .85rem; }
progress { width: 100%; max-width: 30rem; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: .75rem 1rem; margin: 1rem 0; }
.linkbutton-danger { color: var(--err-ink); }
