/* Manager · het enige stylesheet van de backend. Kleuren alleen via variabelen (zie design.md). */

:root{color-scheme:light dark;
--bg:#FAF9F6;--bg-alt:#F0EEE6;--surface:#FFFFFF;--surface-sunken:#F5F3EC;--border:#E6E2D8;--border-strong:#D8D3C4;--border-control:#8F8979;--scrim:rgba(48,41,31,.45);
--text:#141413;--text-muted:#5E5D59;--text-faint:#736F65;
--accent:#D97757;--accent-strong:#B5502C;--accent-hover:#9A4325;--accent-soft:#F3E3D8;--accent-text:#7A3B1F;--on-accent:#FFFFFF;--btn:#D97757;--btn-hover:#C6613F;
--success:#46703A;--success-soft:#E6EFDF;--danger:#B03324;--danger-soft:#F8E3E0;--warn:#86590C;--warn-soft:#F5EBD3;--on-solid:#FFFFFF;
--info:#3C6E8F;--info-soft:#E0ECF3;
--shadow-sm:0 1px 2px rgba(48,41,31,.06);--shadow:0 4px 16px rgba(48,41,31,.08);
--font-display:ui-serif,"Iowan Old Style","Palatino Linotype",Georgia,"Times New Roman",serif;
--font-sans:ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
--font-mono:ui-monospace,SFMono-Regular,Menlo,monospace;
--sidebar-w:232px;--nav-h:64px;--touch:40px;--page-max:1080px;--page-max-lg:1080px;--radius-sm:8px;--radius:14px;--radius-lg:20px}
@media (prefers-color-scheme:dark){:root:not([data-theme=light]){
--bg:#21201C;--bg-alt:#2A2822;--surface:#2A2822;--surface-sunken:#24231F;--border:#3B382F;--border-strong:#4A4638;--border-control:#8A846F;--scrim:rgba(0,0,0,.6);
--text:#FAF9F5;--text-muted:#B0AEA5;--text-faint:#A19B87;--accent:#E28B6D;--accent-strong:#E28B6D;--accent-hover:#EDA486;--accent-soft:#3D2A21;--accent-text:#F0B79A;--on-accent:#24150E;--btn:#E28B6D;--btn-hover:#EDA486;
--success:#8DB87C;--success-soft:#26301F;--danger:#E5827A;--danger-soft:#3A211E;--warn:#D9A441;--warn-soft:#362D19;--on-solid:#1B1A16;--info:#86B6D4;--info-soft:#1F2A31;
--shadow-sm:0 1px 2px rgba(0,0,0,.3);--shadow:0 4px 20px rgba(0,0,0,.35)}}
:root[data-theme=dark]{
--bg:#21201C;--bg-alt:#2A2822;--surface:#2A2822;--surface-sunken:#24231F;--border:#3B382F;--border-strong:#4A4638;--border-control:#8A846F;--scrim:rgba(0,0,0,.6);
--text:#FAF9F5;--text-muted:#B0AEA5;--text-faint:#A19B87;--accent:#E28B6D;--accent-strong:#E28B6D;--accent-hover:#EDA486;--accent-soft:#3D2A21;--accent-text:#F0B79A;--on-accent:#24150E;--btn:#E28B6D;--btn-hover:#EDA486;
--success:#8DB87C;--success-soft:#26301F;--danger:#E5827A;--danger-soft:#3A211E;--warn:#D9A441;--warn-soft:#362D19;--on-solid:#1B1A16;--info:#86B6D4;--info-soft:#1F2A31;
--shadow-sm:0 1px 2px rgba(0,0,0,.3);--shadow:0 4px 20px rgba(0,0,0,.35)}

/* ── Basis ─────────────────────────────────────────── */
*,*::before,*::after{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
body{margin:0;background:var(--bg);color:var(--text);font:400 1.0625rem/1.6 var(--font-sans);-webkit-font-smoothing:antialiased}
[hidden]{display:none!important}
a{color:var(--accent-text);text-decoration:none}
a:hover{text-decoration:underline;text-underline-offset:3px}
:focus-visible{outline:2px solid var(--accent-strong);outline-offset:2px}
h1,h2,h3{font-family:var(--font-display);font-weight:500;margin:0;color:var(--text)}
h1{font-size:clamp(1.9rem,4vw,2.6rem);line-height:1.12;letter-spacing:-.02em}
h2{font-size:1.35rem;line-height:1.2}
h3{font-size:1.15rem;line-height:1.25}
p{margin:0 0 .6em}
.sub{font-size:.97rem;color:var(--text-muted);margin:4px 0 0}
.section-title{font:700 .9062rem var(--font-sans);text-transform:uppercase;letter-spacing:.05em;color:var(--text-muted);margin:26px 0 10px}
.overline{font-size:.75rem;font-weight:600;text-transform:uppercase;letter-spacing:.1em;color:var(--text-muted);padding:0 12px;margin:14px 0 4px}
label,.label{display:block;font-size:.8125rem;font-weight:600;line-height:18px;color:var(--text-muted)}
.hint{display:block;font-size:.8438rem;font-weight:400;line-height:1.125rem;color:var(--text-faint);margin-top:6px}
.small{font-size:.875rem}.muted{color:var(--text-muted)}.center{text-align:center}.right{text-align:right}.nowrap{white-space:nowrap}.block{display:block}
.text-danger{color:var(--danger)}.grow{flex:1;min-width:0}.mt{margin-top:14px}.pad{padding:18px}
.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
kbd{font:.8125rem var(--font-mono);border:1px solid var(--border-strong);color:var(--text-faint);border-radius:5px;padding:0 6px}
.icon{width:20px;height:20px;flex:none;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;vertical-align:-4px}
.icon.sm{width:16px;height:16px;vertical-align:-3px}
.icon.up{color:var(--success)}

/* ── Opbouw ────────────────────────────────────────── */
.shell{display:flex;min-height:100vh}
.sidebar{width:var(--sidebar-w);flex:none;background:var(--surface);border-right:1px solid var(--border);padding:20px 14px;display:flex;flex-direction:column;gap:4px;position:sticky;top:0;height:100vh;overflow-y:auto;scrollbar-width:none;z-index:30}
.sidebar::-webkit-scrollbar{display:none}
.brand{display:flex;align-items:center;gap:10px;padding:0 6px 10px;color:var(--text);text-decoration:none!important}
.brand-name{font:500 1.15rem var(--font-display);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.logo{width:30px;height:30px;border-radius:9px;background:var(--accent);color:#fff;display:grid;place-items:center;font:600 1rem var(--font-display);flex:none}
.logo.has-img{background:none;overflow:hidden}
.logo img{width:100%;height:100%;object-fit:cover;display:block}
.logo.lg{width:44px;height:44px;border-radius:12px;font-size:1.4rem}
.nav-link{display:flex;align-items:center;gap:12px;min-height:var(--touch);padding:10px 12px;border-radius:var(--radius-sm);color:var(--text-muted);font:inherit;font-size:.97rem;background:none;border:0;width:100%;cursor:pointer;text-align:left;text-decoration:none!important}
.nav-link:hover{background:var(--bg-alt);color:var(--text)}
.nav-link[aria-current=page]{background:var(--accent-soft);color:var(--accent-text);font-weight:600}
.nav-link.danger{color:var(--danger)}
.nav-link span:not(.count){flex:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.count{margin-left:auto;min-width:22px;height:22px;padding:0 7px;border-radius:11px;border:1px solid var(--border);font-size:.78rem;font-weight:600;display:inline-grid;place-items:center;color:var(--text-muted);background:var(--surface)}
.nav-link[aria-current=page] .count{border-color:transparent;background:var(--accent-strong);color:var(--on-accent)}
.collapse-btn{margin-bottom:4px}
.side-foot{margin-top:auto;border-top:1px solid var(--border);padding-top:12px;display:flex;flex-direction:column;gap:4px}
.side-user{display:flex;align-items:center;gap:10px;padding:4px 6px}
.side-user-text{display:flex;flex-direction:column;align-items:flex-start;gap:2px;min-width:0}
.side-user-text b{font-size:.94rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:140px}
.sidebar .drawer-close{display:none;margin-left:auto}
html.collapsed .sidebar{width:68px;padding:20px 10px}
html.collapsed .sidebar .brand-name,html.collapsed .sidebar .nav-link span,html.collapsed .overline,html.collapsed .side-user-text{display:none}
html.collapsed .nav-link{justify-content:center;padding:10px 0}
html.collapsed .brand{justify-content:center;padding:0 0 10px}
html.collapsed .side-user{justify-content:center}

.content{flex:1;min-width:0;display:flex;flex-direction:column}
.topbar{display:none}
.appbar{position:sticky;top:0;z-index:5;display:flex;align-items:center;gap:12px;padding:12px 40px;background:var(--bg);border-bottom:1px solid var(--border)}
.appbar-actions{display:flex;align-items:center;gap:6px}
.main{padding:34px 40px;flex:1}
.page{max-width:var(--page-max);margin:0 auto}
.foot{padding:16px 40px 24px;text-align:center;font-size:.8125rem;color:var(--text-faint)}

.search{position:relative;flex:1;max-width:460px;display:flex;align-items:center}
.search>.icon{position:absolute;left:12px;color:var(--text-faint);pointer-events:none}
.search input{padding-left:38px!important;padding-right:40px!important}
.search kbd{position:absolute;right:10px}
.zoek-menu{position:absolute;top:calc(100% + 6px);left:0;right:0;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);box-shadow:var(--shadow);padding:6px;max-height:70vh;overflow:auto;z-index:40}
.zoek-menu a{display:block;padding:9px 12px;border-radius:var(--radius-sm);color:var(--text);text-decoration:none}
.zoek-menu a:hover,.zoek-menu a.on{background:var(--surface-sunken)}
.zoek-menu small{display:block;color:var(--text-muted);font-size:.8125rem}
.zoek-menu p{margin:0;padding:10px 12px;color:var(--text-muted)}

.avatar{width:40px;height:40px;border-radius:10px;background:var(--accent-soft);color:var(--accent-text);display:inline-grid;place-items:center;font:600 1.05rem var(--font-display);flex:none}
.avatar.lg{width:56px;height:56px;border-radius:14px;font-size:1.5rem}
.avatar-btn{border:0;cursor:pointer}
.menu-wrap{position:relative}
.menu{position:absolute;right:0;top:46px;min-width:230px;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);box-shadow:var(--shadow);padding:6px;z-index:40}
.menu a,.menu button{display:flex;align-items:center;gap:10px;width:100%;min-height:40px;padding:8px 12px;border-radius:var(--radius-sm);color:var(--text);background:none;border:0;font:inherit;font-size:.97rem;cursor:pointer;text-decoration:none!important;text-align:left}
.menu a:hover,.menu button:hover{background:var(--surface-sunken)}
.menu .danger{color:var(--danger)}
.menu form{margin:0}

/* ── Paginakop ─────────────────────────────────────── */
.page-header{display:flex;align-items:flex-start;gap:16px;margin-bottom:22px;flex-wrap:wrap}
.page-header .actions{margin-left:auto}
.back-link{display:inline-flex;align-items:center;gap:4px;min-height:40px;color:var(--text-muted);font-size:.94rem;margin:-8px 0 4px}
.actions{display:flex;flex-wrap:wrap;gap:10px;align-items:center}
.actions form{display:contents}

/* ── Knoppen ───────────────────────────────────────── */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:var(--touch);padding:10px 18px;border-radius:8px;border:1px solid transparent;font:600 1rem var(--font-sans);cursor:pointer;text-decoration:none!important;white-space:nowrap;line-height:1.2;transition:background .15s,border-color .15s}
.btn-primary{background:var(--btn);color:var(--on-accent)}
.btn-primary:hover{background:var(--btn-hover)}
.btn-secondary{background:var(--surface);color:var(--text);border-color:var(--border-strong)}
.btn-secondary:hover{background:var(--surface-sunken)}
.btn-danger{background:var(--danger-soft);color:var(--danger)}
.btn-danger:hover{opacity:.85}
.btn-ghost{background:none;color:var(--text-muted)}
.btn-ghost:hover{background:var(--surface-sunken);color:var(--text)}
.btn-sm{min-height:34px;padding:6px 12px;font-size:.9062rem}
.btn-block{width:100%}
.btn-icon{width:40px;padding:0}
.btn-icon.btn-sm{width:36px}
.btn:disabled{opacity:.55;cursor:not-allowed}
.has-dot{position:relative}
.dot-badge{position:absolute;top:8px;right:8px;width:9px;height:9px;border-radius:50%;background:var(--accent-strong);border:2px solid var(--bg)}

/* ── Formulieren ───────────────────────────────────── */
input:not([type=checkbox]):not([type=radio]):not([type=color]):not([type=file]),select,textarea{display:block;width:100%;min-height:var(--touch);padding:10px 12px;border:1px solid var(--border-control);border-radius:8px;background:var(--surface);color:var(--text);font:400 1.0625rem/1.6 var(--font-sans);margin-top:6px}
input[type=date],input[type=time]{min-height:46px}
textarea{min-height:96px;resize:vertical;line-height:1.5}
select{appearance:none;-webkit-appearance:none;padding-right:38px;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%238F8979' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 10px center}
input:focus,select:focus,textarea:focus{outline:none;border-color:var(--accent-strong);box-shadow:0 0 0 3px var(--accent-soft)}
input:disabled,select:disabled,textarea:disabled{opacity:.7}
input::placeholder,textarea::placeholder{color:var(--text-faint)}
.form-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:12px}
.cols{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.time-cols{max-width:320px}
.inline{display:flex;gap:8px;align-items:stretch}
.inline .num{max-width:90px}
.inline select{flex:1}
.inline-form{display:flex;gap:10px;align-items:flex-end;flex-wrap:wrap}
.inline-form input{flex:1;min-width:140px}
.inline-form select{width:auto;min-width:150px}
.inline-form input,.inline-form select{margin-top:0}
.stack{display:flex;flex-direction:column;gap:16px}
.stack-lg{display:flex;flex-direction:column;gap:18px}
.u-tools{display:flex;gap:10px;margin-bottom:16px;flex-wrap:wrap}
.u-tools input{flex:2;min-width:200px;margin-top:0!important}
.u-tools select{flex:1;min-width:160px;margin-top:0!important;width:auto}
.check{display:flex;align-items:center;gap:8px;min-height:32px;font-size:.94rem;font-weight:500;color:var(--text);cursor:pointer}
input[type=checkbox],input[type=radio]{width:18px;height:18px;accent-color:var(--accent-strong);margin:0}
.switch{position:relative;display:inline-block;width:44px;height:26px;flex:none}
.switch input{position:absolute;inset:0;opacity:0;width:100%;height:100%;margin:0;cursor:pointer;z-index:1}
.switch i{position:absolute;inset:0;border-radius:13px;background:var(--border-control);transition:background .15s}
.switch i:after{content:"";position:absolute;top:3px;left:3px;width:20px;height:20px;border-radius:50%;background:#fff;transition:transform .15s}
.switch input:checked+i{background:var(--accent-strong)}
.switch input:checked+i:after{transform:translateX(18px)}
.switch input:focus-visible+i{outline:2px solid var(--accent-strong);outline-offset:2px}
.switch input:disabled+i{opacity:.55}
.switch-row{display:flex;align-items:center;justify-content:space-between;gap:16px}
.switch-row b{display:block;font-size:1rem}
.seg{display:inline-flex;flex-wrap:wrap;gap:2px;padding:3px;border-radius:10px;background:var(--surface-sunken);margin-top:6px}
.seg label{display:block;margin:0;cursor:pointer}
.seg input{position:absolute;opacity:0;pointer-events:none}
.seg span,.seg button{display:block;padding:6px 14px;border-radius:8px;font:600 .94rem var(--font-sans);color:var(--text-muted);border:0;background:none;cursor:pointer;min-height:34px}
.seg input:checked+span,.seg button[aria-pressed=true]{background:var(--surface);color:var(--text);box-shadow:var(--shadow-sm)}
.seg input:focus-visible+span{outline:2px solid var(--accent-strong)}
.repeat{display:flex;flex-direction:column;gap:8px}
.repeat-row{display:flex;gap:8px;align-items:center}
.repeat-row input{margin-top:0!important}
.repeat-row .num{max-width:90px}
.repeat-row .unit{max-width:120px}

/* Kleur en bestand */
.color-row{display:flex;gap:10px;align-items:center;margin-top:6px}
input[type=color]{width:64px;height:40px;padding:2px;border:1px solid var(--border-control);border-radius:8px;background:var(--surface);cursor:pointer;flex:none}
.color-row .hex{margin-top:0!important;max-width:140px;font-family:var(--font-mono);text-transform:uppercase}
.file{font-size:.9rem;flex:1;min-width:200px}
.contrast .badge{white-space:normal}
.card-footer.split{justify-content:space-between}
.preview-label{padding:0;margin:0 0 8px}

/* Chips */
.chips{display:flex;flex-wrap:wrap;gap:8px}
.chips.fl{flex-wrap:nowrap;overflow-x:auto;margin-bottom:14px;scrollbar-width:none;padding-bottom:2px}
.chips.fl::-webkit-scrollbar{display:none}
.chip{display:inline-flex;align-items:center;gap:6px;min-height:36px;padding:0 14px;border-radius:18px;border:1px solid var(--border-strong);color:var(--text-muted);font-weight:600;font-size:.94rem;white-space:nowrap;background:var(--surface);text-decoration:none!important;cursor:pointer}
.chip:hover{background:var(--surface-sunken)}
.chip[aria-pressed=true]{background:var(--accent-soft);color:var(--accent-text);border-color:transparent}
.chip.static{cursor:default;color:var(--text);font-weight:500}
.chip-check{margin:0}
.chip-check input{position:absolute;opacity:0;pointer-events:none}
.chip-check small{font-weight:400;color:var(--text-faint);font-size:.8rem}
.chip-check:has(input:checked){background:var(--accent-soft);color:var(--accent-text);border-color:transparent}
.chip-check:has(input:focus-visible){outline:2px solid var(--accent-strong);outline-offset:2px}

/* ── Kaarten, rijen, tabellen ──────────────────────── */
.card{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);box-shadow:var(--shadow-sm);padding:18px 20px}
.card+.card{margin-top:18px}
.stack-lg>.card+.card{margin-top:0}
.card h2{margin-bottom:12px}
.card-flow{display:flex;flex-direction:column;gap:16px}
.card-flow>h2{margin-bottom:0}
.card>.card-flow+.card-footer,form.card>.card-footer{margin:18px -20px -18px}
.card-footer{border-top:1px solid var(--border);padding:14px 20px;display:flex;gap:10px;justify-content:flex-end;flex-wrap:wrap}
.card-head{display:flex;align-items:baseline;justify-content:space-between;gap:12px;margin-bottom:10px}
.card-head h2{margin:0}
.danger-card{border-color:var(--danger);margin-top:26px}
.danger-card form{margin-top:10px}
details.fold>summary{list-style:none;cursor:pointer;display:grid;grid-template-columns:1fr auto;align-items:center;gap:2px 12px}
details.fold>summary::-webkit-details-marker{display:none}
details.fold>summary h2{margin:0}
details.fold>summary .hint{grid-column:1;margin:0}
details.fold>summary .chev{grid-row:1/3;grid-column:2;transition:transform .2s}
details.fold[open]>summary{margin-bottom:16px}
details.fold[open]>summary .chev{transform:rotate(180deg)}

.rows{display:flex;flex-direction:column;gap:10px}
.row{display:flex;align-items:center;gap:16px;padding:14px 18px;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);box-shadow:var(--shadow-sm);color:var(--text);text-decoration:none!important}
.row--link:hover{border-color:var(--accent-strong);box-shadow:var(--shadow)}
.row.off{opacity:.6}
.row-main{flex:1;min-width:0;display:flex;flex-direction:column;color:var(--text);text-decoration:none!important}
a.row-main:hover .row-title{color:var(--accent-text)}
.row-title{font:500 1.15rem/1.3 var(--font-display)}
.row-sub{font-size:.97rem;color:var(--text-muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.row-time{min-width:96px;font-size:.94rem;font-variant-numeric:tabular-nums}
.row-meta{display:flex;align-items:center;gap:10px;flex-wrap:wrap;justify-content:flex-end}
.row-meta form{margin:0}
.row.is-done .row-title{text-decoration:line-through;color:var(--text-muted)}
.rows.tight{gap:0;border:1px solid var(--border);border-radius:var(--radius);overflow:hidden}

.dl{display:flex;flex-direction:column}
.dl-row{display:flex;align-items:center;gap:12px;padding:9px 10px;border-radius:var(--radius-sm);color:var(--text);text-decoration:none!important}
a.dl-row:hover{background:var(--surface-sunken)}
.dl-main{flex:1;min-width:0;display:flex;flex-direction:column}
.dl-main b{font-size:.9375rem;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.dl-main small{color:var(--text-muted);font-size:.8438rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.dl-meta{color:var(--text-muted);font-size:.875rem;white-space:nowrap}

.xrow{border-top:1px solid var(--border)}
.xrow:first-child{border-top:0}
.xhead{display:flex;align-items:center;gap:14px;padding:12px 16px;cursor:pointer;list-style:none}
.xhead::-webkit-details-marker{display:none}
.xhead .umain{flex:1;min-width:0;display:flex;flex-wrap:wrap;align-items:baseline;gap:4px 8px}
.xhead .umain small{flex-basis:100%}
.xhead .chev{transition:transform .2s;color:var(--text-muted)}
.xrow[open]{background:var(--surface-sunken)}
.xrow[open] .chev{transform:rotate(180deg)}
.xbody{padding:0 16px 14px 126px}
.xbody p{margin:0 0 8px}

.table-wrap{overflow-x:auto;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);box-shadow:var(--shadow-sm)}
.table-wrap.flat{border:0;box-shadow:none;border-radius:0;margin:-18px -20px 0}
table{width:100%;border-collapse:collapse;min-width:560px}
th{font-size:.8438rem;font-weight:600;text-transform:uppercase;letter-spacing:.03em;color:var(--text-muted);background:var(--surface-sunken);text-align:left;padding:11px 16px;white-space:nowrap}
td{font-size:.9688rem;padding:11px 16px;border-top:1px solid var(--border);white-space:nowrap}
td.wrap{white-space:normal}
tbody tr:hover td{background:var(--surface-sunken)}
th.right,td.right{text-align:right}
th.center,td.center{text-align:center}
.kv th{width:45%;white-space:normal;text-transform:none;letter-spacing:0;font-size:.94rem;background:none;border-top:1px solid var(--border)}
.kv td{white-space:normal}
.kv tr:first-child th,.kv tr:first-child td{border-top:0}
.pm-g th{background:var(--surface);color:var(--accent-text);padding-top:18px}

.facts{list-style:none;margin:0;padding:0}
.facts li{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:9px 0;border-top:1px solid var(--border);flex-wrap:wrap}
.facts li:first-child{border-top:0}
.checklist{list-style:none;margin:0 0 8px;padding:0}
.checklist li{display:flex;gap:8px;align-items:flex-start;padding:4px 0}
.checklist .icon{color:var(--success);margin-top:4px}
.msgbody{white-space:normal;line-height:1.65}

/* ── Badges, meldingen, lege staat ─────────────────── */
.badge{display:inline-flex;align-items:center;padding:3px 10px;border-radius:999px;font-size:.8438rem;font-weight:600;background:var(--surface-sunken);color:var(--text-muted);white-space:nowrap;line-height:1.3}
.badge.accent{background:var(--accent-soft);color:var(--accent-text)}
.badge.success{background:var(--success-soft);color:var(--success)}
.badge.warn{background:var(--warn-soft);color:var(--warn)}
.badge.danger{background:var(--danger-soft);color:var(--danger)}
.tabs .badge{margin-left:6px;padding:1px 8px}
.alert{display:flex;align-items:center;gap:10px;padding:10px 14px;border-radius:8px;margin-bottom:16px;background:var(--surface-sunken)}
.alert.error{background:var(--danger-soft);color:var(--danger)}
.alert.success{background:var(--success-soft);color:var(--success)}
.alert.warn{background:var(--warn-soft);color:var(--warn)}
.alert span{color:var(--text)}
.alert.error span{color:inherit}
.empty-state{border:1px dashed var(--border-strong);border-radius:var(--radius);padding:34px 20px;text-align:center;color:var(--text-muted)}
.empty-state .ico{width:48px;height:48px;border-radius:14px;background:var(--accent-soft);color:var(--accent-text);display:inline-grid;place-items:center;margin-bottom:10px}
.empty-state h3{margin-bottom:6px}
.empty-state p{max-width:360px;margin:0 auto 8px}
.small-empty{padding:18px}
.small-empty p{max-width:none;margin:0}
.dot{display:inline-block;width:10px;height:10px;border-radius:50%;background:var(--accent-strong);flex:none;margin-top:7px}
.dot.muted{background:var(--border-strong)}
.dot.warn{background:var(--danger)}
.dev{font-size:.8438rem;font-weight:600;color:var(--text-muted);font-variant-numeric:tabular-nums}
.dev.up{color:var(--danger)}
.dev.down{color:var(--success)}

/* ── Tabs ──────────────────────────────────────────── */
.tabs{display:flex;gap:8px;margin:-6px 0 22px;overflow-x:auto;scrollbar-width:none}
.tabs::-webkit-scrollbar{display:none}
.tabs a{display:inline-flex;align-items:center;gap:6px;min-height:40px;padding:6px 16px;border-radius:999px;border:1px solid var(--border);background:var(--surface);color:var(--text-muted);font-weight:600;white-space:nowrap;text-decoration:none!important}
.tabs a:hover{background:var(--surface-sunken)}
.tabs a[aria-selected=true]{background:var(--accent-soft);color:var(--accent-text);border-color:transparent}

/* ── Tegels ────────────────────────────────────────── */
.stat-tiles{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:12px;margin-bottom:18px}
.stat-tiles.dash{grid-template-columns:repeat(auto-fit,minmax(170px,1fr))}
.stat{display:flex;flex-direction:column;gap:2px;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);box-shadow:var(--shadow-sm);padding:14px 16px;color:var(--text);text-decoration:none!important}
a.stat:hover{border-color:var(--accent-strong)}
.stat-label{font-size:.875rem;font-weight:700;text-transform:uppercase;letter-spacing:.05em;color:var(--text-muted)}
.stat-value{font:600 1.6rem/1.25 var(--font-display)}
.stat-sub{font-size:.8125rem;color:var(--text-muted)}
.split-cols{display:grid;gap:18px}
.dash-grid{display:grid;gap:18px;grid-template-columns:repeat(auto-fit,minmax(320px,1fr));align-items:start}
.dash-grid .card+.card{margin-top:0}

/* ── Competenties ──────────────────────────────────── */
.lv{display:inline-grid;place-items:center;min-width:26px;height:26px;padding:0 4px;border-radius:7px;font:700 .875rem var(--font-sans);font-variant-numeric:tabular-nums;color:var(--text-muted);background:var(--surface-sunken);border:1px solid var(--border)}
.lv1{background:var(--warn-soft);color:var(--warn);border-color:transparent}
.lv2{background:var(--info-soft);color:var(--info);border-color:transparent}
.lv3{background:var(--success-soft);color:var(--success);border-color:transparent}
.lv4{background:var(--success);color:var(--on-solid);border-color:transparent}
.lv.wants{box-shadow:0 0 0 2px var(--accent-strong)}
.chip .lv{min-width:22px;height:22px;font-size:.78rem}
.levels{display:flex;flex-direction:column;gap:22px}
.level-group{border:0;margin:0;padding:0}
.level-group legend{font:700 .9062rem var(--font-sans);text-transform:uppercase;letter-spacing:.05em;color:var(--text-muted);padding:0;margin-bottom:6px}
.level-row{display:grid;grid-template-columns:minmax(160px,1.1fr) auto minmax(200px,1.2fr);gap:8px 16px;align-items:center;padding:10px 0;border-top:1px solid var(--border)}
.level-name b{font-weight:600}
.level-name .hint{margin-top:2px}
.level-extra{display:flex;gap:10px;align-items:center}
.level-extra input{margin-top:0!important;min-height:36px;padding:6px 10px;font-size:.94rem}
.level-extra .check{white-space:nowrap;font-size:.875rem}
.seg-levels{margin:0}
.seg-levels span.lv{border:0;background:none;color:var(--text-muted);min-width:34px;height:30px;padding:0 6px;box-shadow:none}
.seg-levels .lv-label{display:none}
.seg-levels input:checked+.lv{box-shadow:var(--shadow-sm)}
.seg-levels input:checked+.lv0{background:var(--surface);color:var(--text)}
.seg-levels input:checked+.lv1{background:var(--warn-soft);color:var(--warn)}
.seg-levels input:checked+.lv2{background:var(--info-soft);color:var(--info)}
.seg-levels input:checked+.lv3{background:var(--success-soft);color:var(--success)}
.seg-levels input:checked+.lv4{background:var(--success);color:var(--on-solid)}
.seg-levels input:focus-visible+.lv{outline:2px solid var(--accent-strong)}
.legend-levels{display:flex;flex-wrap:wrap;gap:6px 16px}
.legend-levels>span{display:inline-flex;align-items:center;gap:6px}
.matrix-wrap table{min-width:0}
.matrix th,.matrix td{padding:8px 10px}
.matrix thead th{vertical-align:bottom;text-align:center}
.matrix thead th:first-child{text-align:left}
.matrix .vert{writing-mode:vertical-rl;transform:rotate(180deg);white-space:nowrap;text-transform:none;letter-spacing:0;font-size:.875rem;max-height:170px;display:inline-block}
.matrix tbody th{background:var(--surface);text-transform:none;letter-spacing:0;font-size:.97rem;color:var(--text);border-top:1px solid var(--border)}
.matrix tbody th a{color:var(--text);font-weight:600}
.matrix .sticky{position:sticky;left:0;z-index:1;min-width:150px}
.matrix tbody tr:hover th{background:var(--surface-sunken)}
.matrix tfoot th,.matrix tfoot td{background:var(--surface-sunken);border-top:2px solid var(--border-strong);text-transform:none;letter-spacing:0}
.prev-talk{background:var(--surface-sunken);margin-bottom:18px}

/* ── MJOP ──────────────────────────────────────────── */
.chart{margin:0}
.chart figcaption{margin-bottom:12px}
.ybars{display:grid;grid-template-columns:repeat(10,minmax(0,1fr));gap:6px;align-items:end;height:200px}
.ybar{display:flex;flex-direction:column;align-items:center;justify-content:flex-end;height:100%;gap:4px;color:var(--text-muted);text-decoration:none!important;border-radius:8px;padding:4px 2px}
.ybar:hover,.ybar.on{background:var(--surface-sunken)}
.ybar i{display:block;width:70%;max-width:44px;height:max(2px,calc(var(--h) * 1.3px));background:var(--accent-soft);border:1px solid var(--accent-strong);border-radius:5px 5px 2px 2px}
.ybar.on i{background:var(--accent-strong)}
.ybar-v{font-size:.72rem;font-weight:600;white-space:nowrap;color:var(--text)}
.ybar-y{font-size:.8125rem;font-variant-numeric:tabular-nums}
.ybar.on .ybar-y{color:var(--accent-text);font-weight:700}
table.plan th.sticky,table.plan td{font-variant-numeric:tabular-nums}
table.plan .sticky{position:sticky;left:0;background:var(--surface);z-index:1}
table.plan tbody th{text-transform:none;letter-spacing:0;font-size:.94rem;background:var(--surface);border-top:1px solid var(--border)}
table.plan tbody th a{color:var(--text)}
table.plan thead .sticky,table.plan tfoot .sticky{background:var(--surface-sunken)}
table.plan tfoot th,table.plan tfoot td{background:var(--surface-sunken);border-top:2px solid var(--border-strong);text-transform:none;letter-spacing:0}
.inline-del{display:inline-block;margin:0 0 0 4px;vertical-align:middle}

/* ── Materialen ─────────────────────────────────────── */
.stepper{display:flex;gap:4px}
.stepper .btn{font-size:1.15rem}
.stock-card{display:flex;align-items:flex-end;justify-content:space-between;gap:16px;flex-wrap:wrap}
.stock-card.is-low{border-color:var(--danger)}
.stock-now{display:flex;flex-direction:column;gap:2px}
.stock-card .inline-form .num{max-width:100px}

/* ── Agenda ────────────────────────────────────────── */
.cal-head{display:flex;align-items:center;gap:8px;margin-bottom:12px}
.cal-btn{width:40px;height:40px;display:grid;place-items:center;border-radius:10px;border:1px solid var(--border-strong);background:var(--surface);color:var(--text)}
.cal-btn:hover{background:var(--surface-sunken)}
.cal-title{font:500 1.125rem var(--font-display);letter-spacing:-.02em;color:var(--text);min-width:150px;text-align:center}
.cal-legend{display:flex;gap:14px;font-size:.8438rem;color:var(--text-muted)}
.cal-legend span{display:inline-flex;align-items:center;gap:6px}
.cal{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));border:1px solid var(--border);border-radius:var(--radius);overflow:hidden;background:var(--surface)}
.cal-h{font-size:.75rem;font-weight:600;text-transform:uppercase;letter-spacing:.08em;color:var(--text-muted);text-align:center;padding:8px 0;background:var(--surface-sunken)}
.cal-d{min-height:56px;padding:6px 4px;border:0;border-top:1px solid var(--border);background:var(--surface);color:var(--text);font:inherit;cursor:pointer;display:flex;flex-direction:column;align-items:center;gap:4px;text-align:left;min-width:0}
.cal-d:hover{background:var(--surface-sunken)}
.cal-d b{width:30px;height:30px;border-radius:50%;display:grid;place-items:center;font-weight:600;font-size:.94rem;flex:none}
.cal-d.weekend b{color:var(--text-muted)}
.cal-d.out{color:var(--text-faint)}
.cal-d.out b{color:var(--text-faint);font-weight:400}
.cal-d.today b{background:var(--accent-strong);color:var(--on-accent)}
.cal-d[aria-current=date]{box-shadow:inset 0 0 0 2px var(--accent-strong)}
.cal-d[aria-expanded=true]{background:var(--accent-soft)}
.dots{display:flex;gap:3px}
.cdot{display:inline-block;width:7px;height:7px;border-radius:50%;background:var(--accent-strong);flex:none;vertical-align:1px}
.cdot.action{background:var(--warn)}
.cdot.note{background:var(--text-faint)}
.cdot.task{background:var(--success)}
.cdot.talk{background:var(--info)}
.cdot.mjop{background:var(--text-muted)}
.cal-items{display:flex;flex-direction:column;gap:2px;width:100%}
.cal-item{font-size:.75rem;line-height:1.35;padding:1px 5px;border-radius:4px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;background:var(--accent-soft);color:var(--accent-text)}
.cal-item.action{background:var(--warn-soft);color:var(--warn)}
.cal-item.note{background:var(--surface-sunken);color:var(--text-muted)}
.cal-item.task{background:var(--success-soft);color:var(--success)}
.cal-item.talk{background:var(--info-soft);color:var(--info)}
.cal-item.mjop{background:var(--surface-sunken);color:var(--text)}
.cal-item.done{opacity:.55;text-decoration:line-through}
.cal-more{font-size:.75rem;color:var(--text-muted);padding-left:5px}
.tick{width:30px;height:30px;border-radius:50%;border:2px solid var(--border-control);background:var(--surface);color:transparent;display:grid;place-items:center;cursor:pointer;flex:none}
.tick:hover{border-color:var(--success);color:var(--success)}

/* ── Ballonmenu, panelen, modal, toasts ────────────── */
.pop{position:fixed;z-index:60;min-width:210px;max-width:calc(100vw - 24px);background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);box-shadow:var(--shadow);padding:6px}
.pop:before{content:"";position:absolute;top:-7px;left:var(--ax,24px);width:12px;height:12px;background:var(--surface);border-left:1px solid var(--border);border-top:1px solid var(--border);transform:translateX(-50%) rotate(45deg)}
.pop.above:before{top:auto;bottom:-7px;transform:translateX(-50%) rotate(225deg)}
.pop a,.pop button{display:flex;align-items:center;gap:12px;min-height:46px;padding:8px 12px;border-radius:var(--radius-sm);color:var(--text);font-size:1.0625rem;text-decoration:none!important;background:none;border:0;width:100%;cursor:pointer;font-family:inherit}
.pop a:hover{background:var(--surface-sunken)}
.pop .icon{width:22px;height:22px;color:var(--text-muted)}
.pop-title{font-size:.8125rem;font-weight:600;color:var(--text-muted);padding:6px 12px 4px;text-transform:uppercase;letter-spacing:.05em}
.scrim{position:fixed;inset:0;background:var(--scrim);z-index:25}
.panel{position:fixed;top:0;right:0;bottom:0;width:min(380px,100%);background:var(--surface);border-left:1px solid var(--border);box-shadow:var(--shadow);z-index:50;overflow-y:auto}
.panel-head{display:flex;align-items:center;justify-content:space-between;padding:14px 16px 10px 20px;border-bottom:1px solid var(--border);position:sticky;top:0;background:var(--surface)}
.notice{display:flex;gap:12px;padding:12px 20px;border-bottom:1px solid var(--border);color:var(--text);text-decoration:none!important}
a.notice:hover{background:var(--surface-sunken)}
.notice b{display:block;font-weight:600;font-size:.94rem}
.notice small{color:var(--text-muted);font-size:.8438rem}
.modal-wrap{position:fixed;inset:0;background:var(--scrim);display:grid;place-items:center;z-index:70;padding:16px}
.modal{background:var(--surface);border-radius:var(--radius-lg);box-shadow:var(--shadow);max-width:440px;width:100%;padding:24px}
.modal h2{margin-bottom:8px}
.modal .actions{justify-content:flex-end;margin-top:18px}
.toasts{position:fixed;left:50%;bottom:24px;transform:translateX(-50%);width:min(92%,380px);display:flex;flex-direction:column;gap:8px;z-index:80;pointer-events:none}
.toast{background:var(--text);color:var(--bg);padding:12px 16px;border-radius:12px;box-shadow:var(--shadow);font-weight:500;animation:toast-in .25s ease-out}
.toast.ok{background:var(--success);color:var(--on-solid)}
.toast.err{background:var(--danger);color:var(--on-solid)}
@keyframes toast-in{from{opacity:0;transform:translateY(12px)}}

/* ── Inlogscherm en fout ───────────────────────────── */
body.auth{min-height:100vh;display:grid;place-items:center;padding:24px 16px;background:radial-gradient(circle at 20% 0,var(--accent-soft),transparent 45%),var(--bg)}
.auth-card{width:100%;max-width:380px;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-lg);box-shadow:var(--shadow);padding:36px 32px}
.auth-card h1{font-size:2rem;margin:18px 0 8px}
.auth-brand{display:flex;align-items:center;gap:12px}
.error-page{text-align:center;padding:30px 0}
.error-page .ico{width:56px;height:56px;border-radius:16px;background:var(--accent-soft);color:var(--accent-text);display:inline-grid;place-items:center;margin-bottom:14px}
.error-page h1{margin-bottom:10px}

/* ── Responsief ────────────────────────────────────── */
@media (min-width:1024px){
  .split-cols{grid-template-columns:1.2fr 1fr;align-items:start}
}
@media (max-width:1023.98px){
  .sidebar{position:fixed;left:0;top:0;bottom:0;width:min(300px,86%);transform:translateX(-102%);transition:transform .25s;height:auto}
  .sidebar.open{transform:none}
  .sidebar .drawer-close{display:inline-flex}
  .row-time{min-width:0;flex-basis:100%;font-size:.875rem;color:var(--text-muted)}
  .rows.tight .row-time,.xhead .row-time{flex-basis:auto;min-width:56px}
  .collapse-btn,.desk-only{display:none!important}
  html.collapsed .sidebar{width:min(300px,86%)}
  html.collapsed .sidebar .brand-name,html.collapsed .sidebar .nav-link span,html.collapsed .overline,html.collapsed .side-user-text{display:revert}
  .topbar{display:flex;align-items:center;gap:4px;position:sticky;top:0;z-index:10;padding:10px 12px 10px 16px;background:var(--bg);border-bottom:1px solid var(--border)}
  .topbar .brand{padding:0}
  .appbar{display:none;padding:10px 16px;top:61px}
  body.zoek-open .appbar{display:flex}
  .search{max-width:none}
  .main{padding:22px 20px}
  .foot{padding:12px 20px 24px}
  .row{flex-wrap:wrap;gap:10px 14px}
  .row-main{flex:1 1 220px}
  .row-meta{justify-content:flex-start}
  .modal-wrap{place-items:end center;padding:0}
  .modal{border-radius:var(--radius-lg) var(--radius-lg) 0 0;max-width:none}
  .level-row{grid-template-columns:1fr;gap:6px}
  .xbody{padding-left:16px}
  .tabs{margin-left:-20px;margin-right:-20px;padding:0 20px;-webkit-mask-image:linear-gradient(90deg,transparent,#000 16px,#000 calc(100% - 16px),transparent);mask-image:linear-gradient(90deg,transparent,#000 16px,#000 calc(100% - 16px),transparent)}
  .page-header .actions{margin-left:0}
  .page-header .grow{flex-basis:60%}
}
@media (min-width:700px){
  .cal-d{min-height:104px;align-items:stretch}
  .cal-d b{align-self:flex-start}
  .cal-d.out{background:var(--surface-sunken)}
  .cal-d+.cal-d,.cal-h+.cal-d{border-left:1px solid var(--border)}
  .cal-d:nth-child(7n+8){border-left:0}
  .cal-d .dots{display:none}
}
@media (max-width:599px){
  .stat-tiles,.stat-tiles.dash{grid-template-columns:1fr 1fr}
  .ybars{gap:2px;height:170px}
  .ybar-v{display:none}
  .ybar:nth-child(even) .ybar-y{visibility:hidden}
  .stat-value{font-size:1.35rem}
  .cal-title{min-width:0}
  .cols{grid-template-columns:1fr 1fr}
  .repeat-row{flex-wrap:wrap}
  .repeat-row input[name="mat_name[]"]{flex-basis:100%}
}
@media (prefers-reduced-motion:reduce){*,*::before,*::after{transition:none!important;animation:none!important}}
