/* Law Cockpit — design tokens from ops/opdrachten/law-cockpit-ontwerp (Main = licht, Donker, Mobiel). */
@font-face { font-family: "Inter"; src: url("/static/fonts/InterVariable.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  --bg: #F4F5F8; --surface: #FFFFFF; --surface-2: #F8FAFC; --line: #E5E7EB; --line-soft: #F1F5F9;
  --text: #0F172A; --text-2: #334155; --text-3: #475569; --muted: #64748B; --faint: #94A3B8;
  --accent: #4F46E5; --accent-text: #FFFFFF; --accent-soft: #EEF0FF; --accent-strong: #3730A3; --accent-chip: #E0E7FF;
  --groen: #16A34A; --groen-text: #15803D; --groen-bg: #DCFCE7;
  --oranje: #D97706; --oranje-text: #92400E; --oranje-bg: #FEF3C7;
  --rood: #DC2626; --rood-text: #991B1B; --rood-bg: #FEE2E2;
  --blauw: #4F46E5; --blauw-text: #3730A3; --blauw-bg: #E0E7FF;
  --grijs: #94A3B8; --grijs-text: #475569; --grijs-bg: #F1F5F9;
  --radius: 16px; --radius-s: 10px; --shadow: 0 1px 2px rgba(15,23,42,.04);
  --side: 248px; --tab: 68px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0A0D14; --surface: #121826; --surface-2: #0F1420; --line: #1E2533; --line-soft: #1A2130;
    --text: #F8FAFC; --text-2: #E5E7EB; --text-3: #CBD5E1; --muted: #94A3B8; --faint: #64748B;
    --accent: #818CF8; --accent-text: #0A0D14; --accent-soft: #1E2547; --accent-strong: #C7D2FE; --accent-chip: #1E2547;
    --groen: #22C55E; --groen-text: #4ADE80; --groen-bg: #0F2A1B;
    --oranje: #F59E0B; --oranje-text: #FCD34D; --oranje-bg: #3B2A0B;
    --rood: #EF4444; --rood-text: #FCA5A5; --rood-bg: #3F1414;
    --blauw: #818CF8; --blauw-text: #C7D2FE; --blauw-bg: #1E2547;
    --grijs: #64748B; --grijs-text: #CBD5E1; --grijs-bg: #1A2130;
    --shadow: none; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0A0D14; --surface: #121826; --surface-2: #0F1420; --line: #1E2533; --line-soft: #1A2130;
  --text: #F8FAFC; --text-2: #E5E7EB; --text-3: #CBD5E1; --muted: #94A3B8; --faint: #64748B;
  --accent: #818CF8; --accent-text: #0A0D14; --accent-soft: #1E2547; --accent-strong: #C7D2FE; --accent-chip: #1E2547;
  --groen: #22C55E; --groen-text: #4ADE80; --groen-bg: #0F2A1B;
  --oranje: #F59E0B; --oranje-text: #FCD34D; --oranje-bg: #3B2A0B;
  --rood: #EF4444; --rood-text: #FCA5A5; --rood-bg: #3F1414;
  --blauw: #818CF8; --blauw-text: #C7D2FE; --blauw-bg: #1E2547;
  --grijs: #64748B; --grijs-text: #CBD5E1; --grijs-bg: #1A2130;
  --shadow: none; color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.5 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; font-feature-settings: "cv11", "ss01"; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-strong); }
h1 { font-size: 26px; line-height: 1.2; font-weight: 600; letter-spacing: -.4px; margin: 0 0 4px; }
h2 { font-size: 15px; font-weight: 600; margin: 22px 0 10px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.num, .big { font-variant-numeric: tabular-nums; }
.ic { flex: none; }
code { font: 12.5px ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--grijs-bg); padding: 1px 5px; border-radius: 5px; }

/* ---------- shell ---------- */
body.app { display: flex; min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; width: var(--side); flex: none; background: var(--surface); border-right: 1px solid var(--line); padding: 22px 14px 14px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 650; font-size: 17px; letter-spacing: -.2px; padding: 0 8px 20px; }
.brand:hover { color: var(--text); }
.logo { width: 32px; height: 32px; border-radius: 10px; background: var(--accent); color: var(--accent-text); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 15px; }
.menu { display: flex; flex-direction: column; gap: 2px; }
.menu a { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 12px; border-radius: var(--radius-s); color: var(--text-2); font-size: 14px; }
.menu a:hover { background: var(--surface-2); color: var(--text); }
.menu a[aria-current] { background: var(--accent-soft); color: var(--accent-strong); font-weight: 500; }
.menu .lbl { display: flex; align-items: center; gap: 10px; }
.menu-label { font-size: 12px; color: var(--muted); font-weight: 500; padding: 18px 12px 6px; }
.badge { font-size: 12px; font-weight: 500; padding: 1px 8px; border-radius: 999px; background: var(--accent-chip); color: var(--blauw-text); }
.badge.oranje { background: var(--oranje-bg); color: var(--oranje-text); }
.badge.rood { background: var(--rood-bg); color: var(--rood-text); }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; display: inline-block; background: var(--grijs); }
.dot.groen { background: var(--groen); } .dot.oranje { background: var(--oranje); } .dot.rood { background: var(--rood); }
.companies a { justify-content: flex-start; padding: 8px 12px; }
.grow { flex: 1; }
.me { display: flex; align-items: center; gap: 8px; padding: 12px 6px 4px; border-top: 1px solid var(--line); margin-top: 14px; }
.me .who { flex: 1; min-width: 0; font-size: 13px; font-weight: 500; line-height: 1.3; }
.me form { margin: 0; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--accent-chip); color: var(--blauw-text); display: inline-flex; align-items: center; justify-content: center; font-size: 12.5px; font-weight: 600; flex: none; }
.iconbtn { width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; border-radius: 9px; border: 1px solid transparent; background: none; color: var(--muted); cursor: pointer; padding: 0; }
.iconbtn:hover { background: var(--surface-2); color: var(--text); border-color: var(--line); }
.content { flex: 1; min-width: 0; }
main { padding: 28px 36px 48px; max-width: 1320px; margin: 0 auto; }
main.narrow { max-width: 440px; padding-top: 10vh; }
body.plain main { padding: 16px; }
.mtop, .tabbar { display: none; }

/* ---------- generic ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow); }
.card > h2:first-child, .card .head h2 { margin-top: 0; }
.head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; }
.head h2 { margin: 0; }
.head .muted, .head a { font-size: 12.5px; }
.banner { background: var(--accent-soft); color: var(--accent-strong); border-radius: var(--radius-s); padding: 10px 14px; margin: 14px 0; font-size: 13.5px; }
.banner.warn { background: var(--oranje-bg); color: var(--oranje-text); }
.banner.err { background: var(--rood-bg); color: var(--rood-text); }
.banner.ok { background: var(--groen-bg); color: var(--groen-text); }
.btn { font: 500 14px Inter, system-ui, sans-serif; height: 40px; padding: 0 16px; border-radius: var(--radius-s); border: 1px solid var(--line); background: var(--surface); color: var(--text-2); cursor: pointer; display: inline-flex; align-items: center; gap: 8px; }
.btn:hover { border-color: var(--faint); color: var(--text); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.btn.primary:hover { filter: brightness(1.08); color: var(--accent-text); }
.btn.sm { height: 32px; padding: 0 12px; font-size: 12.5px; border-radius: 8px; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; }
.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.pill.groen { background: var(--groen-bg); color: var(--groen-text); } .pill.oranje { background: var(--oranje-bg); color: var(--oranje-text); }
.pill.rood { background: var(--rood-bg); color: var(--rood-text); } .pill.blauw { background: var(--blauw-bg); color: var(--blauw-text); }
.pill.grijs { background: var(--grijs-bg); color: var(--grijs-text); }
.tag { font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 6px; letter-spacing: .02em; text-transform: uppercase; white-space: nowrap; }
.tag.rood { background: var(--rood-bg); color: var(--rood-text); } .tag.oranje { background: var(--oranje-bg); color: var(--oranje-text); }
.tag.blauw { background: var(--blauw-bg); color: var(--blauw-text); } .tag.groen { background: var(--groen-bg); color: var(--groen-text); } .tag.grijs { background: var(--grijs-bg); color: var(--grijs-text); }
.bv { display: inline-block; font-size: 12px; padding: 1px 7px; border-radius: 6px; background: var(--grijs-bg); color: var(--grijs-text); white-space: nowrap; }

/* ---------- Administratie ---------- */
.counters { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 18px 0 12px; }
.counter { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; color: var(--text); box-shadow: var(--shadow); position: relative; }
.counter::before { content: ""; position: absolute; left: 18px; top: 18px; width: 8px; height: 8px; border-radius: 50%; background: var(--grijs); }
.counter.groen::before { background: var(--groen); } .counter.oranje::before { background: var(--oranje); } .counter.rood::before { background: var(--rood); } .counter.blauw::before { background: var(--blauw); }
.counter:hover { border-color: var(--accent); color: var(--text); }
.counter[aria-current] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.counter b { display: block; font-size: 30px; font-weight: 600; letter-spacing: -.6px; line-height: 1.1; margin-top: 18px; font-variant-numeric: tabular-nums; }
.counter span { font-size: 13px; color: var(--muted); font-weight: 500; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; margin: 14px 0 10px; }
.filters label { display: flex; flex-direction: column; font-size: 12px; color: var(--muted); gap: 4px; font-weight: 500; }
.filters select, .filters input, .field { font: 14px Inter, system-ui, sans-serif; height: 40px; padding: 0 10px; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--surface); color: var(--text); }
.filters select:focus, .filters input:focus, .field:focus, form.stack input:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.chip { display: inline-flex; align-items: center; height: 30px; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px; font-size: 12.5px; color: var(--text-2); background: var(--surface); }
.chip[aria-current] { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
table.list { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
table.list th, table.list td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
table.list th { font-size: 12px; color: var(--muted); font-weight: 500; background: var(--surface-2); border-bottom-color: var(--line); }
table.list td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.list td.nowrap { white-space: nowrap; }
table.list tr:last-child td { border-bottom: 0; }
table.list tbody tr:hover td { background: var(--surface-2); }
.reason { font-size: 13px; color: var(--text-3); }
.reason.rood { color: var(--rood-text); } .reason.oranje { color: var(--oranje-text); }
.shadow { font-size: 12px; color: var(--muted); margin-top: 2px; }
.shadow.verschil { color: var(--rood-text); }
dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; margin: 0; }
dl.kv dt { color: var(--muted); font-size: 12.5px; }
dl.kv dd { margin: 0; overflow-wrap: anywhere; }
ul.reasons { margin: 6px 0 14px; padding-left: 18px; }
ul.reasons li { margin: 4px 0; }
ul.reasons li.rood { color: var(--rood-text); } ul.reasons li.oranje { color: var(--oranje-text); } ul.reasons li.ok { color: var(--groen-text); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.pager { display: flex; justify-content: space-between; margin: 14px 0; }
form.stack { display: flex; flex-direction: column; gap: 14px; }
form.stack label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 500; color: var(--text-2); }
form.stack input { font: 15px Inter, system-ui, sans-serif; height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--surface); color: var(--text); }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; margin-top: 16px; }
.tile { display: block; color: var(--text); }
.tile:hover { border-color: var(--accent); color: var(--text); }

/* ---------- Cockpit ---------- */
.hello { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.hello .sub { color: var(--muted); font-size: 14px; }
.ask { display: flex; gap: 8px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 6px 6px 6px 14px; box-shadow: var(--shadow); margin-bottom: 18px; }
.ask:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.ask .ic { color: var(--muted); }
.ask input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; font: 15px Inter, system-ui, sans-serif; color: var(--text); height: 40px; }
.ask input::placeholder { color: var(--faint); }
.preview { margin: -6px 0 18px; }
.preview dl.kv { margin: 10px 0 14px; }
.scope { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13.5px; margin-bottom: 12px; }
.scope label { display: flex; gap: 6px; align-items: center; }
.kpis { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow); min-width: 0; }
.kpi .lbl { font-size: 13px; color: var(--muted); font-weight: 500; }
.kpi .big { font-size: 30px; font-weight: 600; letter-spacing: -.6px; margin-top: 8px; line-height: 1.15; }
.kpi .big.empty { color: var(--faint); }
.kpi .sub { font-size: 13px; color: var(--text-3); margin-top: 6px; }
.kpi .sub b { font-weight: 500; }
.kpi .good { color: var(--groen-text); font-weight: 500; }
.kpi.north { display: flex; align-items: center; gap: 24px; }
.ring { flex: none; }
.ring .track { stroke: var(--accent-soft); } .ring .val { stroke: var(--accent); }
.ring text { fill: var(--text); font-family: Inter, sans-serif; }
.ring .rsub { fill: var(--muted); }
.bar { height: 6px; background: var(--accent-soft); border-radius: 3px; margin-top: 16px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--groen); border-radius: 3px; }
.soft-chip { font-size: 12px; color: var(--muted); margin-top: 14px; background: var(--grijs-bg); display: inline-block; padding: 4px 10px; border-radius: 999px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; align-items: start; }
.rows { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line-soft); min-height: 48px; }
.row:last-child { border-bottom: 0; }
.row .main { flex: 1; min-width: 0; }
.row .t { font-size: 14px; font-weight: 500; color: var(--text); overflow-wrap: anywhere; }
.row .s { font-size: 12.5px; color: var(--muted); }
.row form { margin: 0; }
.row .right { color: var(--muted); font-size: 13px; white-space: nowrap; }
a.row { color: inherit; }
.row.task { flex-wrap: wrap; row-gap: 8px; }
.row.task .main { flex: 1 1 calc(100% - 24px); }
.row.task .actions { flex-basis: 100%; padding-left: 20px; }
a.row:hover .t { color: var(--accent); }
.when { width: 48px; text-align: center; flex: none; }
.when .m { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.when .d { font-size: 18px; font-weight: 600; line-height: 1.1; font-variant-numeric: tabular-nums; }
.when.late .d { color: var(--rood-text); }
.cos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.co { display: block; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; color: var(--text); }
.co:hover { border-color: var(--accent); color: var(--text); }
.co .n { display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 500; }
.co .k { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.five { list-style: none; padding: 0; margin: 0 0 4px; display: grid; gap: 4px; font-size: 13px; color: var(--text-3); }
.five b { color: var(--muted); font-weight: 500; }
details.more { margin-top: 8px; }
details.more summary { cursor: pointer; color: var(--accent); font-size: 12.5px; list-style: none; }
details.more summary::-webkit-details-marker { display: none; }
.md { font-size: 13.5px; color: var(--text-2); }
.md p { margin: 6px 0; }
.md ul, .md ol { padding-left: 20px; margin: 6px 0; }
.md li { margin: 3px 0; }
.tablewrap { overflow-x: auto; }
table.md { border-collapse: collapse; width: 100%; font-size: 13px; margin: 8px 0; }
table.md th, table.md td { border-bottom: 1px solid var(--line-soft); padding: 7px 8px; text-align: left; vertical-align: top; }
table.md th { color: var(--muted); font-weight: 500; }
.check { display: inline-block; width: 14px; height: 14px; border: 1.5px solid var(--faint); border-radius: 4px; margin-right: 6px; vertical-align: -2px; }
.check.done { background: var(--groen); border-color: var(--groen); }
.empty-state { color: var(--muted); font-size: 13px; padding: 10px 0; }
.updated { font-size: 12px; color: var(--muted); margin-top: 22px; }
.doc { max-width: 860px; }
.doc .md { font-size: 14.5px; }
.doc .md h2 { font-size: 18px; margin-top: 24px; } .doc .md h3 { font-size: 15px; }
.mailrow .s { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- phone ---------- */
@media (max-width: 860px) {
  body.app { display: block; padding-bottom: calc(var(--tab) + env(safe-area-inset-bottom)); }
  .side { display: none; }
  .mtop { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px 4px; }
  .mtop .brand { padding: 0; font-size: 16px; }
  .mtop .logo { width: 30px; height: 30px; border-radius: 9px; font-size: 14px; }
  .mtop-r { display: flex; align-items: center; gap: 6px; }
  .tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: var(--surface); border-top: 1px solid var(--line); justify-content: space-around; padding: 8px 4px calc(8px + env(safe-area-inset-bottom)); }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 11px; color: var(--muted); min-width: 64px; min-height: 48px; justify-content: center; position: relative; }
  .tabbar a[aria-current] { color: var(--accent); font-weight: 500; }
  .tbadge { position: absolute; top: 2px; right: 18px; width: 8px; height: 8px; border-radius: 50%; background: var(--oranje); }
  main { padding: 10px 16px 28px; }
  main.narrow { padding-top: 6vh; }
  h1 { font-size: 23px; }
  .kpis { grid-template-columns: 1fr 1fr; gap: 12px; }
  .kpi.north { grid-column: 1 / -1; gap: 16px; padding: 16px; }
  .kpi.north .ring { width: 88px; height: 88px; }
  .kpi { padding: 16px; }
  .kpi .big { font-size: 24px; }
  .grid { grid-template-columns: 1fr; gap: 12px; }
  .card { padding: 14px 16px; border-radius: 14px; }
  .counters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid2 { grid-template-columns: 1fr; }
  .filters label { flex: 1 1 140px; }
  .filters select, .filters input { width: 100%; }
  .cos { grid-template-columns: 1fr; }
  table.list, table.list tbody, table.list tr, table.list td { display: block; width: 100%; }
  table.list thead { display: none; }
  table.list { border: 0; background: none; box-shadow: none; }
  table.list tr { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; margin-bottom: 10px; padding: 10px 14px; }
  table.list td { border: 0; padding: 3px 0; }
  table.list tbody tr:hover td { background: none; }
  table.list td.num { text-align: left; }
  table.list td[data-l]::before { content: attr(data-l) ": "; color: var(--muted); font-size: 12px; }
  .ask input { font-size: 16px; }
  .row .btn.sm { height: 36px; }
  .row .mailbtn { display: none; }
}
@media (max-width: 380px) { .kpis { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: no-preference) { .card, .kpi, .counter, .co { transition: border-color .15s ease; } }
