/* Bistro Hero Backoffice */
:root {
    --bg: #f6f3ee;
    --surface: #ffffff;
    --ink: #22201e;
    --muted: #6a645d;
    --line: #e4ddd3;
    /* Huisstijl Hero café-bistro: rood uit het logo (CMYK 35/100/80/5) en zwart */
    --bh-donker: #1c1a19;
    --bh-rood: #a82033;
    --bh-goud: #c9932e;
    --bh-groen: #3f6b4f;
    --brand: var(--bh-rood);
    --topbar: #ffffff;
    --topbar-ink: var(--bh-donker);
    --topbar-hover: #f1ebe2;
    --accent: #a82033;
    --primary: var(--bh-donker);
    --primary-hover: #3a3632;
    --ok-bg: #e4f1e7; --ok-ink: #1f5631;
    --warn-bg: #fbf0d8; --warn-ink: #774f00;
    --err-bg: #fbe5e1; --err-ink: #8f1d15;
    --off-bg: #ece7df; --off-ink: #514b44;
    --radius: 6px;
}
@media (prefers-color-scheme: dark) {
    :root {
        --bg: #161412; --surface: #201d1a; --ink: #efe9e1; --muted: #a79f95; --line: #3a3530;
        --topbar: #201d1a; --topbar-ink: #efe9e1; --topbar-hover: #2f2a26;
        --accent: #f08793; --primary: #c43347; --primary-hover: #d34558;
        --ok-bg: #183424; --ok-ink: #a3dbb4;
        --warn-bg: #3c2f0e; --warn-ink: #efcd7f;
        --err-bg: #461b16; --err-ink: #f5aaa3;
        --off-bg: #2d2925; --off-ink: #c2b9ae;
    }
}
* { 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(var(--bh-rood), var(--bh-rood)) 1;
}
.topbar a { color: inherit; }
.brand { display: flex; align-items: center; gap: 0.75rem; font-weight: 600; white-space: nowrap; }
.brand img { display: block; height: 3.25rem; 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; }
.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(--bh-rood); 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; width: 15rem; max-width: 100%; height: auto; }
.authpage .authcard { background: linear-gradient(var(--bh-rood), var(--bh-rood)) 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; overflow-x: auto; scrollbar-width: thin; border-bottom: 1px solid var(--line); margin: 0 0 1.25rem; }
.tabs a { white-space: nowrap; 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(var(--bh-rood), var(--bh-rood)) 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(--bh-groen); 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(--bh-donker); 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); }

/* Startpagina: tegels per systeem */
.tilegroup { font-size: 0.9375rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 1.75rem 0 0.625rem; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 0.75rem; }
.tile { display: flex; gap: 0.875rem; align-items: flex-start; padding: 0.875rem 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; color: var(--ink); transition: border-color 0.15s, box-shadow 0.15s; }
.tile:hover, .tile:focus-visible { text-decoration: none; border-color: var(--accent); box-shadow: 0 2px 10px rgba(34, 32, 30, 0.08); }
.tilebody { display: flex; flex-direction: column; gap: 0.125rem; min-width: 0; }
.tilename { font-weight: 600; font-size: 1rem; }
.tiledesc { color: var(--muted); font-size: 0.875rem; }
.tilehint { font-size: 0.8125rem; color: var(--muted); margin-top: 0.25rem; padding-top: 0.25rem; border-top: 1px dashed var(--line); }
.tilemark { flex: none; display: inline-grid; place-items: center; width: 2.5rem; height: 2.5rem; border-radius: 9px; color: #fff; font-family: Georgia, serif; font-weight: 700; font-size: 1.25rem; }
td .tilemark { width: 1.75rem; height: 1.75rem; font-size: 0.9375rem; border-radius: 6px; vertical-align: middle; margin-right: 0.25rem; }
.tile-rood { background: #a82033; }
.tile-goud { background: #a8761d; }
.tile-groen { background: #3f6b4f; }
.tile-blauw { background: #2f5d8a; }
.tile-donker { background: #3a3632; }
input.ordernum { width: 5rem; text-align: right; }

/* Personeelshandboek */
.searchbar { display: flex; gap: 0.5rem; max-width: 40rem; margin: 0 0 1.25rem; }
.searchbar input { flex: 1; }
.toc { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin: 0; padding: 1rem 1.25rem 1rem 3rem; max-width: 46rem; }
.toc li { padding: 0.375rem 0; font-size: 1.0625rem; }
.toc li::marker { color: var(--muted); font-weight: 600; }
.chapternum { color: var(--muted); font-weight: 500; }
.chapter { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem 1.75rem; max-width: 46rem; }
.richtext { font-size: 1rem; line-height: 1.65; overflow-wrap: anywhere; }
.richtext > :first-child { margin-top: 0; }
.richtext > :last-child { margin-bottom: 0; }
.richtext p { margin: 0 0 0.875rem; }
.richtext h2 { font-size: 1.25rem; margin: 1.75rem 0 0.5rem; }
.richtext h3 { font-size: 1.0625rem; margin: 1.25rem 0 0.375rem; }
.richtext ul, .richtext ol { margin: 0 0 0.875rem; padding-left: 1.5rem; }
.richtext li { margin: 0.25rem 0; }
.richtext blockquote { margin: 1rem 0; padding: 0.75rem 1rem; background: var(--warn-bg); color: var(--warn-ink); border-left: 4px solid var(--bh-goud); border-radius: 0 var(--radius) var(--radius) 0; }
.richtext blockquote p:last-child { margin-bottom: 0; }
.form-page { max-width: 52rem; }
.editorarea.richtext { min-height: 22rem; }
.doclist { list-style: none; padding: 0; margin: 0 0 1rem; max-width: 46rem; }
.doclist li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 0.75rem; padding: 0.5rem 0.75rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 0.375rem; }
.dockind { font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); min-width: 5.5rem; }
.chaptermeta { margin-top: 1rem; }
.chapternav { display: flex; justify-content: space-between; gap: 1rem; max-width: 46rem; margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.results { list-style: none; padding: 0; max-width: 46rem; }
.results li { padding: 0.75rem 0; border-bottom: 1px solid var(--line); }
.results p { margin: 0.25rem 0 0; color: var(--muted); }
mark { background: #f6dd9a; color: inherit; padding: 0 0.125rem; border-radius: 2px; }
@media (prefers-color-scheme: dark) { mark { background: #6b5317; } }

/* 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(--bh-rood); }
.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] { 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; }
