/* CRM — wit met één accentkleur. Pas de kleur aan via --accent hieronder. */
:root {
  --accent: #5b4bdb;
  --accent-hover: #4b3bcb;
  --accent-ink: #ffffff;
  --accent-soft: #f0eefd;
  --accent-line: #d9d4fa;

  --bg: #ffffff;
  --surface: #ffffff;
  --subtle: #f8f8fb;
  --line: #e8e8ef;
  --line-strong: #d6d6e0;
  --fg: #1b1b2b;
  --muted: #6d6d82;

  --ok: #157a4a; --ok-soft: #e6f5ed;
  --warn: #8a5a00; --warn-soft: #fdf3dc;
  --bad: #c0362c; --bad-soft: #fdeceb;

  /* Kleuren voor het whiteboard */
  --mm-ink: #1b1b2b; --mm-ink-soft: #f1f1f5;
  --mm-indigo: #5b4bdb; --mm-indigo-soft: #f0eefd;
  --mm-blue: #2f6fe0; --mm-blue-soft: #eaf1fd;
  --mm-green: #1b8a5a; --mm-green-soft: #e7f6ee;
  --mm-amber: #c07a00; --mm-amber-soft: #fdf4e1;
  --mm-rose: #d0416f; --mm-rose-soft: #fdebf1;
  --mm-gray: #6d6d82; --mm-gray-soft: #f1f1f5;

  --shadow-sm: 0 1px 2px rgba(27, 27, 43, .05);
  --shadow: 0 1px 2px rgba(27, 27, 43, .04), 0 6px 20px rgba(27, 27, 43, .06);
  --shadow-lg: 0 2px 6px rgba(27, 27, 43, .06), 0 20px 50px rgba(27, 27, 43, .14);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  --r: 10px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 15px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
h1, h2, h3 { margin: 0; letter-spacing: -.015em; text-wrap: balance; }
h1 { font-size: 1.75rem; font-weight: 700; }
h2 { font-size: 1rem; font-weight: 650; }
h3 { font-size: .95rem; font-weight: 650; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.num, .mono { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); font-size: .92em; }
.strong { font-weight: 650; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.pre { white-space: pre-line; }
.late { color: var(--bad); font-weight: 600; }
.pad { padding: 1.5rem 0; }
.r { text-align: right; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.boot { display: grid; place-items: center; min-height: 100vh; color: var(--muted); }
svg { width: 1.15em; height: 1.15em; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
kbd { font-family: var(--mono); font-size: .8em; border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 4px; padding: 0 .3em; background: #fff; }

/* ---------- Knoppen en velden ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; border: 1px solid var(--line-strong); background: var(--surface); padding: .5rem .9rem; border-radius: var(--r); cursor: pointer; font-weight: 550; white-space: nowrap; line-height: 1.3; color: var(--fg); text-decoration: none; }
.btn:hover { border-color: #b9b9c8; background: var(--subtle); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.danger { color: var(--bad); }
.btn.danger.armed { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--subtle); }
.btn.small { padding: .3rem .65rem; font-size: .85rem; border-radius: 8px; }
.btn.big { padding: .7rem 1rem; }
.btn:disabled { opacity: .5; cursor: default; }
.linkbtn { border: 0; background: none; padding: 0; color: var(--accent); cursor: pointer; font-weight: 550; }
.linkbtn:hover { text-decoration: underline; }
.iconbtn { border: 1px solid var(--line-strong); background: var(--surface); border-radius: 8px; width: 2rem; height: 2rem; display: inline-grid; place-items: center; cursor: pointer; color: var(--muted); font-size: 1.05rem; line-height: 1; }
.iconbtn:hover { color: var(--fg); background: var(--subtle); }
.iconbtn.plain { border-color: transparent; background: transparent; }
.iconbtn svg { width: 1.3rem; height: 1.3rem; }

.field { display: flex; flex-direction: column; gap: .3rem; min-width: 0; }
.field label { font-size: .82rem; font-weight: 600; color: var(--muted); }
.field .hint { font-size: .78rem; color: var(--muted); }
input, select, textarea { width: 100%; border: 1px solid var(--line-strong); background: var(--surface); border-radius: 8px; padding: .55rem .7rem; min-height: 2.5rem; }
textarea { resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input:disabled, textarea:disabled, select:disabled { background: var(--subtle); color: var(--muted); }
.err { background: var(--bad-soft); color: var(--bad); border-radius: 8px; padding: .6rem .8rem; font-size: .9rem; }
.notice { background: var(--accent-soft); border: 1px solid var(--accent-line); border-radius: var(--r); padding: .7rem 1rem; margin: 0 0 1rem; font-size: .92rem; }

.pill { display: inline-flex; align-items: center; padding: .12rem .55rem; border-radius: 999px; font-size: .78rem; font-weight: 600; background: var(--subtle); color: var(--muted); border: 1px solid var(--line); white-space: nowrap; }
.pill.accent { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-line); }
.pill.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.pill.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.pill.bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }

.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: var(--r); padding: 2px; background: var(--surface); }
.seg button { border: 0; background: none; padding: .38rem .75rem; border-radius: 8px; cursor: pointer; color: var(--muted); font-weight: 550; font-size: .9rem; }
.seg button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); }
.search { width: 13rem; min-height: 2.35rem; }

.avatar { width: 2.1rem; height: 2.1rem; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: inline-grid; place-items: center; font-weight: 700; font-size: .8rem; border: 0; cursor: pointer; flex: none; }
.avatar.sm { width: 1.9rem; height: 1.9rem; font-size: .72rem; cursor: default; }

/* ---------- Inloggen ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; background: linear-gradient(180deg, var(--accent-soft), #fff 55%); }
.auth .box { width: min(400px, 100%); background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 2rem; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 1.25rem; }
.auth form { display: flex; flex-direction: column; gap: .9rem; }
.auth .brand { display: flex; align-items: center; gap: .6rem; font-weight: 750; font-size: 1.1rem; }
.auth .brand img { width: 2rem; height: 2rem; }

/* ---------- Bovenbalk ---------- */
.topbar { position: sticky; top: 0; z-index: 20; background: rgba(255, 255, 255, .92); backdrop-filter: saturate(1.4) blur(8px); border-bottom: 1px solid var(--line); }
.topbar-in { max-width: 1240px; margin: 0 auto; padding: .65rem 1.5rem; display: flex; align-items: center; gap: 1.5rem; }
.brand { display: flex; align-items: center; gap: .55rem; color: var(--fg); font-weight: 750; font-size: 1.05rem; letter-spacing: -.01em; }
.brand:hover { text-decoration: none; }
.brand img { width: 1.85rem; height: 1.85rem; }
.topnav { display: flex; gap: .25rem; }
.topnav a { color: var(--muted); font-weight: 600; padding: .45rem .8rem; border-radius: 8px; }
.topnav a:hover { color: var(--fg); background: var(--subtle); text-decoration: none; }
.topnav a[aria-current="page"] { color: var(--accent); background: var(--accent-soft); }
.topright { margin-left: auto; display: flex; align-items: center; gap: .4rem; }

.main { max-width: 1240px; margin: 0 auto; padding: 1.75rem 1.5rem 4rem; }
.phead { margin-bottom: 1.4rem; }
.back { display: inline-block; color: var(--muted); font-size: .9rem; font-weight: 550; margin-bottom: .35rem; }
.back:hover { color: var(--accent); text-decoration: none; }
.phead-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.phead-title { min-width: 0; }
.phead-title h1 { overflow-wrap: anywhere; }
.sub { color: var(--muted); display: flex; align-items: center; gap: .6rem; margin-top: .35rem; flex-wrap: wrap; }
.tools { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }

/* ---------- Start: tegels ---------- */
.home { max-width: 1180px; margin: 0 auto; padding-top: 2.5rem; }
.hello { margin-bottom: 2rem; }
.hello h1 { font-size: 2.1rem; }
.hello p { margin: .3rem 0 0; font-size: 1.05rem; }
.hello p::first-letter { text-transform: uppercase; }
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.1rem; }
.tile { position: relative; display: flex; flex-direction: column; gap: .45rem; padding: 1.4rem 1.4rem 1.2rem; min-height: 12.5rem; border: 1px solid var(--line); border-radius: 18px; background: #fff; color: var(--fg); box-shadow: var(--shadow-sm); transition: border-color .15s, box-shadow .15s, transform .15s; }
.tile:hover { text-decoration: none; border-color: var(--accent-line); box-shadow: var(--shadow); transform: translateY(-2px); }
.tile-icon { width: 3.2rem; height: 3.2rem; border-radius: 14px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; margin-bottom: .6rem; }
.tile-icon svg { width: 1.7rem; height: 1.7rem; }
.tile-title { font-size: 1.35rem; font-weight: 700; letter-spacing: -.015em; }
.tile-text { color: var(--muted); font-size: .95rem; }
.tile-stat { margin-top: auto; padding-top: 1rem; border-top: 1px solid var(--line); font-size: .9rem; color: var(--muted); }
.tile-stat strong { color: var(--fg); }
.tile-go { position: absolute; top: 1.75rem; right: 1.5rem; color: var(--line-strong); transition: color .15s, transform .15s; }
.tile:hover .tile-go { color: var(--accent); transform: translateX(3px); }

/* ---------- Kaarten en lijsten ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-sm); min-width: 0; }
.card > header { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .9rem 1.1rem; border-bottom: 1px solid var(--line); }
.card > .body { padding: 1rem 1.1rem; }
.rows { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; gap: .75rem; padding: .7rem 1.1rem; border-bottom: 1px solid var(--line); color: var(--fg); background: none; border-left: 0; border-right: 0; border-top: 0; width: 100%; text-align: left; }
.row:last-child { border-bottom: 0; }
.row.click { cursor: pointer; }
.row.click:hover { background: var(--subtle); text-decoration: none; }
.row .grow, .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.row .title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .meta { color: var(--muted); font-size: .85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.empty { color: var(--muted); padding: 1rem 1.1rem; font-size: .92rem; }
.empty.big { display: flex; flex-direction: column; align-items: center; text-align: center; gap: .5rem; padding: 3.5rem 1.5rem; border: 1px dashed var(--line-strong); border-radius: 16px; }
.empty.big strong { color: var(--fg); font-size: 1.1rem; }
.empty.big span { max-width: 32rem; }
.empty.big .btn { margin-top: .6rem; }

/* ---------- Projecten ---------- */
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.pcard { display: flex; flex-direction: column; gap: .3rem; padding: 1.15rem 1.2rem 1rem; border: 1px solid var(--line); border-radius: 14px; color: var(--fg); background: #fff; box-shadow: var(--shadow-sm); transition: border-color .15s, box-shadow .15s; }
.pcard:hover { text-decoration: none; border-color: var(--accent-line); box-shadow: var(--shadow); }
.pcard h3 { font-size: 1.08rem; margin-top: .45rem; overflow-wrap: anywhere; }
.pcard p { margin: 0; font-size: .9rem; }
.pcard-top { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.pcard-foot { display: flex; gap: 1rem; margin-top: auto; padding-top: .9rem; color: var(--muted); font-size: .85rem; }
.pcard-foot span { display: inline-flex; align-items: center; gap: .3rem; }

.tabs { display: flex; gap: .2rem; border-bottom: 1px solid var(--line); margin-bottom: 1.4rem; overflow-x: auto; scrollbar-width: none; }
.tabs a, .tabs button { padding: .65rem .95rem; color: var(--muted); font-weight: 600; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; background: none; cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; gap: .4rem; }
.tabs a:hover, .tabs button:hover { color: var(--fg); text-decoration: none; }
.tabs [aria-current="page"] { color: var(--accent); border-bottom-color: var(--accent); }
.tabs .count { font-size: .75rem; background: var(--subtle); border: 1px solid var(--line); color: var(--muted); border-radius: 999px; padding: 0 .45rem; }
.tabs.small { margin: 0; padding: 0 1.25rem; }

.ov-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem; }
.span2 { grid-column: 1 / -1; }
.prose { white-space: pre-line; max-width: 75ch; }
.quick { display: grid; grid-template-columns: repeat(3, 1fr); gap: .75rem; margin-top: 1.2rem; }
.quick-link { display: flex; flex-direction: column; gap: .1rem; padding: .8rem 1rem; border: 1px solid var(--line); border-radius: 10px; color: var(--fg); font-size: .9rem; }
.quick-link:hover { border-color: var(--accent-line); background: var(--accent-soft); text-decoration: none; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: .55rem 1.25rem; margin: 0; }
.kv dt { color: var(--muted); font-size: .9rem; }
.kv dd { margin: 0; overflow-wrap: anywhere; }

/* ---------- Kleuren (whiteboard en kleurknopjes) ---------- */
.c-ink { --c: var(--mm-ink); --cs: var(--mm-ink-soft); --cp: #ececf1; }
.c-indigo { --c: var(--mm-indigo); --cs: var(--mm-indigo-soft); --cp: #e6e1ff; }
.c-blue { --c: var(--mm-blue); --cs: var(--mm-blue-soft); --cp: #d9e8ff; }
.c-green { --c: var(--mm-green); --cs: var(--mm-green-soft); --cp: #d3f2e1; }
.c-amber { --c: var(--mm-amber); --cs: var(--mm-amber-soft); --cp: #fff0a8; }
.c-rose { --c: var(--mm-rose); --cs: var(--mm-rose-soft); --cp: #ffdbe7; }
.c-gray { --c: var(--mm-gray); --cs: var(--mm-gray-soft); --cp: #ececf1; }
.swatch { width: 1.3rem; height: 1.3rem; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line-strong); cursor: pointer; padding: 0; background: var(--c); flex: none; }
.swatch:hover { transform: scale(1.12); }
.swatch[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--accent); }
.seg.sm button { padding: .22rem .55rem; font-size: .82rem; min-width: 1.9rem; }
.seg.sm button:disabled { opacity: .4; cursor: default; }

/* ---------- Whiteboard ---------- */
.wb { display: flex; flex-direction: column; gap: .6rem; }
.wb-float { position: absolute; z-index: 10; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
.wb-bar { left: .7rem; top: .7rem; max-width: calc(100% - 11.5rem); display: flex; align-items: center; gap: .35rem; flex-wrap: wrap; padding: 4px 6px; min-height: 2.6rem; }
.wb-bar .sep, .wb-props .sep { width: 1px; align-self: stretch; background: var(--line); margin: 3px .15rem; }
.wb-bar .iconbtn:disabled { opacity: .35; cursor: default; }
.wb-bar .iconbtn.danger { color: var(--bad); }
.wb-bar .iconbtn svg { width: 1.2rem; height: 1.2rem; }
.wb-group { display: inline-flex; gap: 2px; align-items: center; }
.wb-props { display: contents; }
.wb-props > .muted { padding: 0 .3rem; }
.wb-swatches { display: inline-flex; gap: .2rem; padding: 0 .1rem; }
.wb-select { width: auto; min-height: 2rem; padding: .2rem .3rem .2rem .45rem; font-size: .85rem; }
.wb-live { right: .7rem; top: .7rem; display: flex; align-items: center; gap: .5rem; padding: .35rem .7rem .35rem .45rem; min-height: 2.6rem; }
.wb-zoomgrp { right: .7rem; bottom: .7rem; display: flex; align-items: center; gap: 2px; padding: 3px; }
.wb-zoom { min-width: 3.6rem; font-variant-numeric: tabular-nums; }
.wb-dot { display: block; border-radius: 50%; background: currentColor; }
.wb-dot.w2 { width: 3px; height: 3px; } .wb-dot.w4 { width: 5px; height: 5px; } .wb-dot.w8 { width: 9px; height: 9px; } .wb-dot.w16 { width: 14px; height: 14px; }
.wb-status { display: inline-flex; align-items: center; gap: .4rem; color: var(--muted); white-space: nowrap; }
.wb-status i { width: 8px; height: 8px; border-radius: 50%; background: var(--line-strong); }
.wb-status.ok i { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.wb-status.wait i { background: #c07a00; }
.wb-status.bad { color: var(--bad); }
.wb-status.bad i { background: var(--bad); }
.wb-people { display: inline-flex; align-items: center; padding-left: 6px; }
.wb-people:empty { display: none; }
.wb-people .avatar { background: var(--pc, var(--accent)); color: #fff; margin-left: -6px; border: 2px solid #fff; }

.wb-stage { position: relative; height: max(520px, calc(100vh - 290px)); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none;
  background-color: #fff; background-image: radial-gradient(circle, #dcdce6 1px, transparent 1.2px); background-size: 22px 22px; }
.wb-stage:focus-visible { outline-offset: -2px; }
.wb-stage[data-tool="pen"], .wb-stage[data-tool="shape"], .wb-stage[data-tool="sticky"], .wb-stage[data-tool="connect"] { cursor: crosshair; }
.wb-stage[data-tool="text"] { cursor: text; }
.wb-stage[data-tool="eraser"] { cursor: cell; }
.wb-stage[data-tool="hand"], .wb-stage.space { cursor: grab; }
.wb-stage.panning { cursor: grabbing; }
.wb-stage.dropping { box-shadow: inset 0 0 0 3px var(--accent); }
.wb-world { position: absolute; left: 0; top: 0; transform-origin: 0 0; --z: 1; }

.wb-edges { position: absolute; overflow: visible; pointer-events: none; z-index: 0; width: 0; height: 0; fill: none; stroke: none; }
.wb-edge .ln { fill: none; stroke: var(--c); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.wb-edge.tree .ln { stroke-width: 2.2; opacity: .55; }
.wb-edge .ln.dash { stroke-dasharray: 7 6; }
.wb-edge .head { fill: var(--c); stroke: none; }
.wb-edge .hit { fill: none; stroke: transparent; stroke-width: 16; pointer-events: stroke; cursor: pointer; }
.wb-edge.sel .ln { stroke: var(--accent); opacity: 1; stroke-width: 3; }
.wb-edge.sel .head { fill: var(--accent); }
.wb-labels { position: absolute; left: 0; top: 0; z-index: 1; }
.wb-elabel { position: absolute; transform: translate(-50%, -50%); background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: .1rem .45rem; font-size: .8rem; font-weight: 550; white-space: pre-wrap; max-width: 220px; width: max-content; text-align: center; cursor: pointer; color: var(--fg); line-height: 1.35; }
.wb-elabel.sel { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.wb-elabel.editing { pointer-events: auto; min-width: 120px; padding: .2rem .4rem; box-shadow: 0 0 0 2px var(--accent); }

.wb-item { position: absolute; }
.wb-item.sel { outline: calc(2px / var(--z)) solid var(--accent); outline-offset: calc(4px / var(--z)); }
.wb-item.peer:not(.sel) { outline: calc(2px / var(--z)) dashed var(--pc); outline-offset: calc(4px / var(--z)); }
.wb-item.target { outline: calc(3px / var(--z)) solid var(--accent); outline-offset: calc(3px / var(--z)); }
.wb-shape { transform: translate(-50%, -50%); width: max-content; max-width: 280px; min-width: 56px; min-height: 2.3rem; display: flex; align-items: center; justify-content: center;
  padding: .55rem .9rem; border-radius: 10px; border: 1.5px solid var(--c); background: var(--cs); color: var(--fg); font-size: .92rem; font-weight: 550; line-height: 1.35; text-align: center; cursor: pointer; box-shadow: var(--shadow-sm); }
.wb-text { white-space: pre-wrap; overflow-wrap: anywhere; max-width: 100%; position: relative; }
.wb-shape.sel .wb-text:empty::before { content: 'Dubbelklik om te typen'; color: var(--muted); font-weight: 400; font-size: .85em; }
.wb-shape.f-solid { background: var(--c); color: #fff; }
.wb-shape.f-outline { background: #fff; }
.wb-shape.k-rect { border-radius: 4px; }
.wb-shape.k-round { border-radius: 14px; }
.wb-shape.k-ellipse { border-radius: 50%; padding: .8rem 1.5rem; }
.wb-shape.k-diamond { background: transparent; border: 0; box-shadow: none; padding: 1rem 2.2rem; }
.wb-dia { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; overflow: visible; filter: drop-shadow(0 1px 1px rgba(27, 27, 43, .06)); }
.wb-dia polygon { fill: var(--cs); stroke: var(--c); stroke-width: 1.5; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.wb-shape.k-diamond.f-solid polygon { fill: var(--c); }
.wb-shape.k-diamond.f-outline polygon { fill: #fff; }
.wb-shape.k-sticky { background: var(--cp); color: #1b1b2b; border: 0; border-radius: 3px; align-items: flex-start; justify-content: flex-start; text-align: left; padding: .9rem 1rem; font-weight: 500;
  box-shadow: 0 1px 2px rgba(27, 27, 43, .08), 0 8px 18px rgba(27, 27, 43, .12); }
.wb-shape.k-text { background: transparent; border-color: transparent; box-shadow: none; color: var(--c); padding: .2rem .35rem; text-align: left; justify-content: flex-start; max-width: 560px; font-weight: 500; min-height: 0; }
.wb-shape.s-s { font-size: .8rem; }
.wb-shape.s-l { font-size: 1.15rem; font-weight: 650; }
.wb-shape.s-xl { font-size: 1.65rem; font-weight: 750; line-height: 1.2; letter-spacing: -.01em; }
.wb-shape.editing { cursor: text; z-index: 1999999999 !important; }
.wb-edit { display: block; width: 100%; min-width: 4ch; min-height: 0; border: 0; padding: 0; margin: 0; resize: none; background: transparent; text-align: inherit; font: inherit; color: inherit; line-height: inherit; overflow: hidden; box-shadow: none; border-radius: 0; }
.wb-edit:focus { box-shadow: none; outline: none; }
.wb-edit::placeholder { color: currentColor; opacity: .45; }
.wb-image { transform: translate(-50%, -50%); cursor: pointer; }
.wb-image img { width: 100%; height: 100%; display: block; object-fit: contain; pointer-events: none; border-radius: 4px; }
.wb-image.broken { background: var(--subtle); border: 1px dashed var(--line-strong); border-radius: 6px; }
.wb-image.broken img { display: none; }
.wb-image.broken::after { content: 'Afbeelding niet gevonden'; position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: .85rem; }
.wb-stroke { pointer-events: none; }
.wb-stroke svg { display: block; overflow: visible; width: 100%; height: 100%; }
.wb-stroke .ink { fill: none; stroke: var(--c); stroke-linecap: round; stroke-linejoin: round; }
.wb-stroke .hit { fill: none; stroke: transparent; stroke-linecap: round; stroke-linejoin: round; pointer-events: stroke; cursor: pointer; }
.wb-stage[data-tool="pen"] .wb-stroke .hit, .wb-stage[data-tool="eraser"] .wb-stroke .hit { cursor: inherit; }

.wb-overlay { position: absolute; left: 0; top: 0; z-index: 2000000000; pointer-events: none; }
.wb-draft { position: absolute; left: 0; top: 0; overflow: visible; width: 1px; height: 1px; fill: none; }
.wb-draft path { fill: none; stroke: var(--c, var(--accent)); stroke-linecap: round; stroke-linejoin: round; }
.wb-draft .wb-draftbox { fill: rgba(91, 75, 219, .08); stroke: var(--accent); stroke-width: calc(1.5px / var(--z)); stroke-dasharray: 6 4; }
.wb-draft .wb-draftline { stroke: var(--accent); stroke-width: calc(2px / var(--z)); stroke-dasharray: 6 5; }
.wb-h { position: absolute; width: 0; height: 0; transform: scale(calc(1 / var(--z))); pointer-events: auto; }
.wb-h::before { content: ''; position: absolute; width: 12px; height: 12px; left: -6px; top: -6px; border-radius: 3px; background: #fff; border: 2px solid var(--accent); box-sizing: border-box; }
.wb-h.resize { cursor: nwse-resize; }
.wb-h.dot { cursor: crosshair; }
.wb-h.dot::before { width: 14px; height: 14px; left: -7px; top: -7px; border-radius: 50%; background: var(--accent); border-color: #fff; box-shadow: 0 0 0 1px var(--accent), var(--shadow-sm); opacity: .55; transition: opacity .12s, transform .12s; }
.wb-h.dot:hover::before { opacity: 1; transform: scale(1.25); }
.wb-h.d-n::before { top: -29px; } .wb-h.d-s::before { top: 15px; } .wb-h.d-e::before { left: 15px; } .wb-h.d-w::before { left: -29px; }
.wb-cursor { position: absolute; width: 0; height: 0; transform: scale(calc(1 / var(--z))); transform-origin: 0 0; pointer-events: none; transition: left .1s linear, top .1s linear; }
.wb-cursor svg { position: absolute; left: -2px; top: -2px; width: 18px; height: 18px; fill: var(--pc); stroke: #fff; stroke-width: 1.3; }
.wb-cursor span { position: absolute; left: 13px; top: 15px; background: var(--pc); color: #fff; font-size: 12px; font-weight: 650; padding: 1px 7px; border-radius: 6px; white-space: nowrap; box-shadow: var(--shadow-sm); }

.wb-tools { left: .7rem; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; gap: 2px; padding: 4px; }
.wb-tool { width: 2.4rem; height: 2.4rem; border: 0; background: none; border-radius: 8px; display: grid; place-items: center; color: var(--muted); cursor: pointer; flex: none; padding: 0; }
.wb-tool:hover { background: var(--subtle); color: var(--fg); }
.wb-tool[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); }
.wb-tool svg { width: 1.3rem; height: 1.3rem; }
.wb-tsep { height: 1px; background: var(--line); margin: 2px 4px; flex: none; }
.wb-marquee { position: absolute; border: 1px solid var(--accent); background: rgba(91, 75, 219, .07); pointer-events: none; z-index: 5; border-radius: 2px; }
.wb-empty { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: .35rem; text-align: center; max-width: 26rem; color: var(--muted); pointer-events: none; padding: 1rem; }
.wb-empty strong { color: var(--fg); font-size: 1.1rem; }
.wb-hint { margin: 0; }
.wb.full { position: fixed; inset: 0; z-index: 40; background: #fff; padding: .75rem; }
.wb.full .wb-stage { flex: 1; height: auto; }
body.wb-noscroll { overflow: hidden; }

/* ---------- Kennisbank ---------- */
.kb-search { width: 18rem; }
.kb-cats { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.chipbtn { display: inline-flex; align-items: center; gap: .4rem; border: 1px solid var(--line-strong); background: #fff; border-radius: 999px; padding: .3rem .75rem; font-size: .88rem; font-weight: 550; color: var(--muted); cursor: pointer; }
.chipbtn:hover { color: var(--fg); background: var(--subtle); }
.chipbtn[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-line); }
.chipbtn .count { font-size: .75rem; opacity: .75; }
.kb-group { margin-bottom: 1.75rem; }
.kb-group > h2 { font-size: .82rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: .7rem; }
.kb-group > h2 .muted { font-weight: 500; margin-left: .25rem; }
.kb-count { margin: 0 0 .75rem; }
.kb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 1rem; }
.kb-card { display: flex; flex-direction: column; gap: .35rem; padding: 1rem 1.15rem .9rem; border: 1px solid var(--line); border-radius: 14px; color: var(--fg); background: #fff; box-shadow: var(--shadow-sm); transition: border-color .15s, box-shadow .15s; min-width: 0; }
.kb-card:hover { text-decoration: none; border-color: var(--accent-line); box-shadow: var(--shadow); }
.kb-card h3 { font-size: 1.05rem; overflow-wrap: anywhere; }
.kb-card p { margin: 0; font-size: .88rem; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.kb-card mark, .md mark { background: #fff0a8; color: inherit; border-radius: 3px; padding: 0 .1em; }
.kb-card-top { display: flex; justify-content: space-between; align-items: center; min-height: 1.4rem; }
.kb-card-foot { display: flex; flex-wrap: wrap; gap: .35rem .6rem; align-items: center; margin-top: auto; padding-top: .55rem; }
.kb-when { margin-left: auto; }
.kb-pin { color: var(--accent); display: inline-flex; }
.tag { font-size: .8rem; color: var(--accent); font-weight: 550; }
.kb-read { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 1.1rem; align-items: start; }
.kb-doc { padding: 1.6rem 2rem; min-height: 14rem; }
.kb-side { display: flex; flex-direction: column; gap: 1.1rem; position: sticky; top: 5rem; }
.kb-side .file { padding: .6rem .9rem; gap: .65rem; }
.kb-side .thumb { width: 2.4rem; height: 2.4rem; }
.kb-files.over { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.kb-files .upload { margin: .5rem .9rem 0; }
.kb-editwrap { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 1.1rem; align-items: start; }
.kb-edit { display: flex; flex-direction: column; }
.kb-meta { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: .75rem; padding: .9rem 1.25rem; border-bottom: 1px solid var(--line); }
.kb-toolbar { display: flex; flex-wrap: wrap; gap: .15rem; align-items: center; padding: .45rem .9rem; border-bottom: 1px solid var(--line); background: var(--subtle); }
.kb-toolbar .spacer { flex: 1; }
.kb-toolbar .btn.small { padding: .25rem .5rem; font-weight: 600; }
.kb-body { font-family: var(--font); overflow: hidden; flex: none; }
.kb-preview { padding: 1.25rem 1.5rem; min-height: 380px; }
.kb-edit footer { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .55rem 1rem; border-top: 1px solid var(--line); }

/* Opgemaakte tekst */
.md { line-height: 1.65; max-width: 75ch; overflow-wrap: anywhere; }
.md > :first-child { margin-top: 0; }
.md > :last-child, .md blockquote > :last-child { margin-bottom: 0; }
.md h2 { font-size: 1.3rem; margin: 1.6rem 0 .5rem; }
.md h3 { font-size: 1.1rem; margin: 1.3rem 0 .4rem; }
.md h4, .md h5 { font-size: 1rem; margin: 1.1rem 0 .3rem; }
.md p { margin: 0 0 .85rem; }
.md ul, .md ol { margin: 0 0 .9rem; padding-left: 1.4rem; }
.md li { margin: .2rem 0; }
.md ul.check { list-style: none; padding-left: .2rem; }
.md ul.check .box { display: inline-block; width: 1rem; height: 1rem; border: 1.5px solid var(--line-strong); border-radius: 4px; margin-right: .55rem; vertical-align: -.15rem; background: #fff; }
.md ul.check li.done { color: var(--muted); text-decoration: line-through; }
.md ul.check li.done .box { background: var(--accent); border-color: var(--accent); box-shadow: inset 0 0 0 2px #fff; }
.md blockquote { margin: 0 0 .9rem; padding: .6rem 1rem; border-left: 3px solid var(--accent); background: var(--accent-soft); border-radius: 0 8px 8px 0; }
.md code { font-family: var(--mono); font-size: .88em; background: var(--subtle); border: 1px solid var(--line); border-radius: 5px; padding: .05em .35em; }
.md pre { background: #1b1b2b; color: #f1f1f5; border-radius: 10px; padding: .9rem 1rem; overflow-x: auto; margin: 0 0 .9rem; }
.md pre code { background: none; border: 0; padding: 0; color: inherit; }
.md hr { border: 0; border-top: 1px solid var(--line); margin: 1.4rem 0; }
.md table { margin: 0 0 .9rem; border: 1px solid var(--line); border-radius: 8px; }
.md th { text-transform: none; letter-spacing: 0; font-size: .85rem; color: var(--fg); background: var(--subtle); }
.md td, .md th { padding: .5rem .75rem; }
@media (max-width: 980px) {
  .kb-read, .kb-editwrap { grid-template-columns: 1fr; }
  .kb-side { position: static; }
}

/* ---------- Notities ---------- */
.notes { display: grid; grid-template-columns: 280px 1fr; gap: 1.1rem; align-items: start; }
.notes-list { position: sticky; top: 5rem; max-height: calc(100vh - 7rem); display: flex; flex-direction: column; }
.notes-list .rows { overflow-y: auto; }
.note-item { cursor: pointer; font: inherit; }
.note-item.active { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.note-editor { display: flex; flex-direction: column; min-height: calc(100vh - 290px); }
.note-title { border: 0; border-bottom: 1px solid var(--line); border-radius: 14px 14px 0 0; font-size: 1.3rem; font-weight: 700; padding: 1rem 1.25rem; min-height: 0; }
.note-body { flex: 1; border: 0; border-radius: 0; padding: 1rem 1.25rem; min-height: 380px; resize: none; font-size: 1rem; line-height: 1.65; }
.note-title:focus, .note-body:focus { box-shadow: none; }
.note-editor footer { display: flex; justify-content: space-between; align-items: center; padding: .55rem 1rem; border-top: 1px solid var(--line); }

/* ---------- Bestanden ---------- */
.drop { display: flex; flex-direction: column; align-items: center; gap: .35rem; padding: 2rem 1rem; border: 2px dashed var(--line-strong); border-radius: 14px; text-align: center; cursor: pointer; margin-bottom: 1rem; transition: background .15s, border-color .15s; }
.drop:hover, .drop.over { border-color: var(--accent); background: var(--accent-soft); }
.drop:focus-within { border-color: var(--accent); }
.drop-icon { width: 2.8rem; height: 2.8rem; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; margin-bottom: .3rem; }
.drop-icon svg { width: 1.4rem; height: 1.4rem; }
.upload { display: flex; align-items: center; gap: .75rem; padding: .55rem .9rem; border: 1px solid var(--line); border-radius: 10px; margin-bottom: .5rem; font-size: .9rem; }
.upload .bar { width: 140px; height: 6px; border-radius: 3px; background: var(--subtle); overflow: hidden; }
.upload .bar span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.upload.failed { border-color: var(--bad); }
.upload.failed .pct { color: var(--bad); }
.file { display: flex; align-items: center; gap: .9rem; padding: .75rem 1.1rem; border-bottom: 1px solid var(--line); }
.file:last-child { border-bottom: 0; }
.file .title { font-weight: 600; color: var(--fg); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file .meta { color: var(--muted); font-size: .84rem; }
.thumb { width: 3rem; height: 3rem; border-radius: 8px; overflow: hidden; flex: none; background: var(--subtle); border: 1px solid var(--line); display: grid; place-items: center; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb.ext { font-size: .68rem; font-weight: 750; color: var(--accent); background: var(--accent-soft); border-color: var(--accent-line); }

/* ---------- Facturen ---------- */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-bottom: 1.25rem; }
.stat { border: 1px solid var(--line); border-radius: 14px; padding: 1rem 1.15rem; display: flex; flex-direction: column; gap: .15rem; }
.stat .lbl { color: var(--muted); font-size: .85rem; font-weight: 600; }
.stat .val { font-size: 1.5rem; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat.bad .val { color: var(--bad); }
.tablewrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .93rem; }
th { text-align: left; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 650; padding: .75rem 1.1rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: .8rem 1.1rem; border-bottom: 1px solid var(--line); vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; }
tr.click { cursor: pointer; }
tr.click:hover td { background: var(--subtle); }
td .sub { display: block; color: var(--muted); font-size: .84rem; }
td a.mono { color: var(--fg); }

.inv { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem; }
.formgrid { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem; }
.formgrid .full, .formgrid footer, .formgrid > p, .formgrid > h3 { grid-column: 1 / -1; }
.lines { padding: .5rem 1.1rem 1rem; }
.line { display: grid; grid-template-columns: 1fr 5.5rem 7.5rem 5.5rem 7.5rem 2rem; gap: .5rem; align-items: start; padding: .35rem 0; }
.line.head { font-size: .76rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 650; padding-bottom: 0; }
.line textarea { min-height: 2.5rem; resize: none; overflow: hidden; }
.line input.r { text-align: right; }
.ln-sum { padding-top: .6rem; font-weight: 600; }
.line .iconbtn { margin-top: .25rem; }
.lines-foot { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-top: .6rem; padding-top: .8rem; border-top: 1px solid var(--line); flex-wrap: wrap; }
.totals { min-width: 16rem; display: flex; flex-direction: column; gap: .3rem; }
.totals div { display: flex; justify-content: space-between; gap: 2rem; color: var(--muted); }
.totals .grand { color: var(--fg); font-weight: 700; font-size: 1.15rem; padding-top: .4rem; border-top: 1px solid var(--line); margin-top: .2rem; }
.formfoot { display: flex; justify-content: space-between; align-items: center; gap: .5rem; flex-wrap: wrap; }
.formfoot .right { display: flex; gap: .5rem; flex-wrap: wrap; margin-left: auto; }

/* Factuur als document */
.pdf-tools { max-width: 210mm; margin: 0 auto 1rem; display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.pdf-tools .back { margin: 0; }
body[data-view="pdf"] .notice { max-width: 210mm; margin-left: auto; margin-right: auto; }
.sheet { width: 210mm; max-width: 100%; min-height: 297mm; margin: 0 auto; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow); padding: 18mm 18mm 16mm; font-size: 10.5pt; line-height: 1.5; color: #1b1b2b; display: flex; flex-direction: column; }
.sh-head { display: flex; justify-content: space-between; gap: 2rem; padding-bottom: 10mm; border-bottom: 3px solid var(--accent); }
.sh-company { font-size: 17pt; font-weight: 750; color: var(--accent); letter-spacing: -.01em; margin-bottom: .3rem; }
.sh-from { color: #4a4a5e; }
.sh-title { text-align: right; }
.sh-title h1 { font-size: 22pt; font-weight: 750; text-transform: uppercase; letter-spacing: .06em; margin-bottom: .5rem; }
.sh-title dl { display: grid; grid-template-columns: auto auto; gap: .1rem 1rem; margin: 0; justify-content: end; }
.sh-title dt { color: #6d6d82; }
.sh-title dd { margin: 0; font-weight: 600; text-align: right; }
.sh-to { margin: 10mm 0 8mm; }
.sh-to .lbl { text-transform: uppercase; letter-spacing: .08em; font-size: 8pt; color: #6d6d82; font-weight: 700; margin-bottom: .2rem; }
.sh-lines { font-size: 10pt; }
.sh-lines th { color: #6d6d82; font-size: 8pt; padding: .5rem .4rem; border-bottom: 1.5px solid #1b1b2b; }
.sh-lines td { padding: .55rem .4rem; border-bottom: 1px solid var(--line); }
.sh-lines th:first-child, .sh-lines td:first-child { padding-left: 0; }
.sh-lines th:last-child, .sh-lines td:last-child { padding-right: 0; }
.sh-totals { margin: 5mm 0 0 auto; width: 85mm; display: flex; flex-direction: column; gap: .2rem; }
.sh-totals div { display: flex; justify-content: space-between; gap: 1rem; }
.sh-totals .grand { font-size: 13pt; font-weight: 750; border-top: 1.5px solid #1b1b2b; padding-top: .4rem; margin-top: .3rem; }
.sh-totals .grand span:last-child { color: var(--accent); }
.sh-foot { margin-top: auto; padding-top: 12mm; font-size: 9.5pt; color: #4a4a5e; }
.sh-foot p { margin: 0 0 .6rem; }
.sh-legal { border-top: 1px solid var(--line); padding-top: .6rem; margin-top: .6rem; font-size: 8.5pt; color: #6d6d82; text-align: center; }

/* ---------- Agenda ---------- */
.agenda { display: grid; grid-template-columns: 1fr 340px; gap: 1.1rem; align-items: start; }
.cal-head { border-bottom: 0 !important; }
.cal-head h2 { font-size: 1.2rem; }
.cal-head h2::first-letter { text-transform: uppercase; }
.cal-nav { display: flex; gap: .35rem; align-items: center; }
.wk { display: grid; grid-template-columns: repeat(7, 1fr); padding: 0 .6rem; }
.wk span { text-align: center; font-size: .75rem; font-weight: 650; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: .3rem 0; }
.grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; background: var(--line); border-top: 1px solid var(--line); border-radius: 0 0 14px 14px; overflow: hidden; }
.day { background: #fff; min-height: 6.6rem; padding: .35rem .4rem; cursor: pointer; display: flex; flex-direction: column; gap: .2rem; min-width: 0; position: relative; }
.day:hover { background: var(--subtle); }
.day.out { background: #fcfcfd; }
.day.out .dnum { color: #b4b4c2; }
.dnum { font-size: .85rem; font-weight: 600; width: 1.7rem; height: 1.7rem; display: grid; place-items: center; border-radius: 50%; }
.day.today .dnum { background: var(--accent); color: #fff; }
.day.sel { box-shadow: inset 0 0 0 2px var(--accent); }
.chips { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.chip { font-size: .74rem; line-height: 1.3; padding: .12rem .35rem; border-radius: 5px; background: var(--accent-soft); color: #3a2db0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.chip:hover { background: var(--accent-line); }
.chip.deadline { background: var(--bad-soft); color: var(--bad); }
.chip b { font-weight: 650; }
.more { font-size: .72rem; color: var(--muted); padding-left: .35rem; }
.dots { display: none; gap: 3px; justify-content: center; }
.dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.dots i.deadline { background: var(--bad); }
.side { display: flex; flex-direction: column; gap: 1.1rem; }
.item .when { width: 4.6rem; flex: none; display: flex; flex-direction: column; font-size: .84rem; font-weight: 600; color: var(--accent); font-variant-numeric: tabular-nums; }
.item.deadline .when { color: var(--bad); }
.item .when .muted { font-weight: 500; }

.copyline { display: flex; gap: .5rem; margin: .9rem 0; }
.copyline input { font-family: var(--mono); font-size: .82rem; }
.steps { padding-left: 1.3rem; margin: .5rem 0 1rem; display: flex; flex-direction: column; gap: .45rem; }

/* ---------- Modal ---------- */
.modal-wrap { position: fixed; inset: 0; background: rgba(27, 27, 43, .32); display: grid; place-items: center; padding: 1rem; z-index: 50; animation: fade .12s ease-out; }
.modal { width: min(560px, 100%); max-height: calc(100vh - 2rem); overflow: auto; background: #fff; border-radius: 16px; box-shadow: var(--shadow-lg); }
.modal.wide { width: min(720px, 100%); }
.modal > header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.1rem 1.25rem .9rem; position: sticky; top: 0; background: #fff; z-index: 1; }
.modal > header h2 { font-size: 1.15rem; }
.modal form#recForm, .modal form#userForm { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem; padding: .3rem 1.25rem 1.25rem; }
.modal form .full, .modal form .err, .modal form footer, .modal form > p { grid-column: 1 / -1; }
.modal .content { padding: .5rem 1.25rem 1.25rem; }
.modal .content > p:first-child { margin-top: 0; }
.modal .content h3 { margin: 1.2rem 0 .3rem; }
.modal footer { display: flex; align-items: center; gap: .5rem; margin-top: .5rem; }
.modal footer .right { margin-left: auto; display: flex; gap: .5rem; }
.sect { margin-top: .6rem !important; padding-top: .9rem; border-top: 1px solid var(--line); font-size: .9rem; }
.modal #setBody .rows { margin: .75rem -1.25rem; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.modal #setBody .row { padding-left: 1.25rem; padding-right: 1.25rem; }
.modal #setBody .formgrid { padding-top: .75rem; }

.toast { position: fixed; left: 50%; bottom: 1.5rem; transform: translateX(-50%); background: #1b1b2b; color: #fff; padding: .65rem 1.1rem; border-radius: 10px; box-shadow: var(--shadow-lg); z-index: 60; font-size: .92rem; max-width: calc(100vw - 2rem); }
@keyframes fade { from { opacity: 0; } }

/* ---------- Tweestapsverificatie ---------- */
.auth .box.wide { width: min(560px, 100%); }
.auth-links { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; font-size: .9rem; }
.auth-links .muted { color: var(--muted); }
input.otp { font-size: 1.35rem; letter-spacing: .25em; text-align: center; font-variant-numeric: tabular-nums; }
.qrbox { display: flex; align-items: center; gap: 1.25rem; padding: 1rem; border: 1px solid var(--line); border-radius: 14px; margin: .25rem 0 .5rem; }
.qrbox > div { display: flex; flex-direction: column; gap: .4rem; min-width: 0; }
.qr { width: 180px; height: 180px; flex: none; border-radius: 6px; stroke: none; }
.qr path, .qr rect { stroke: none; }
.secret { font-family: var(--mono); font-size: .92rem; background: var(--subtle); border: 1px solid var(--line); border-radius: 8px; padding: .5rem .6rem; word-break: break-all; user-select: all; }
.tfa-form { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.auth form.tfa-form { flex-direction: row; }
.tfa-form input { flex: 1 1 8rem; width: auto; min-width: 0; }
.okbox { background: var(--ok-soft); color: var(--ok); border-radius: 10px; padding: .65rem .9rem; font-weight: 600; margin-bottom: .75rem; }
.codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: .4rem; margin: .75rem 0; }
.codes code { font-family: var(--mono); font-size: 1rem; text-align: center; padding: .45rem; border: 1px dashed var(--line-strong); border-radius: 8px; background: var(--subtle); letter-spacing: .05em; }
.tfa-done { display: flex; justify-content: flex-end; margin-top: 1rem; }
#tfaBox p { display: flex; gap: .5rem; align-items: baseline; flex-wrap: wrap; }
.switch-row { display: flex; gap: .75rem; align-items: flex-start; padding: .85rem 1rem; border: 1px solid var(--line); border-radius: 12px; margin: .75rem 0 0; cursor: pointer; }
.switch-row input, .checkline input { width: 1.15rem; height: 1.15rem; min-height: 0; margin-top: .2rem; accent-color: var(--accent); flex: none; }
.switch-row > span { display: flex; flex-direction: column; gap: .1rem; }
.checkline { display: flex; gap: .6rem; align-items: flex-start; font-size: .9rem; }
@media (max-width: 720px) {
  .auth { padding: .75rem; place-items: start center; }
  .auth .box { padding: 1.25rem; }
  .qrbox { flex-direction: column; text-align: center; }
  .qr { width: 200px; height: 200px; }
}

/* ---------- Kleinere schermen ---------- */
@media (max-width: 980px) {
  .tile { min-height: 0; padding: 1.3rem 1.3rem 1.1rem; }
  .tile-stat { padding-top: .75rem; }
  .agenda { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr 1fr 1fr; }
  .notes { grid-template-columns: 1fr; }
  .notes-list { position: static; max-height: 260px; }
}
@media (max-width: 720px) {
  body { font-size: 15px; }
  h1 { font-size: 1.45rem; }
  .topbar-in { padding: .55rem 1rem; gap: .75rem; flex-wrap: wrap; }
  .topnav { order: 3; width: 100%; margin: 0 -.3rem; }
  .topnav a { flex: 1; text-align: center; padding: .4rem .3rem; }
  .main { padding: 1.2rem 1rem 3rem; }
  .home { padding-top: .75rem; }
  .hello h1 { font-size: 1.6rem; }
  .hello { margin-bottom: 1.25rem; }
  .tile-icon { width: 2.6rem; height: 2.6rem; margin-bottom: .2rem; }
  .tile-title { font-size: 1.2rem; }
  .tile-go { top: 1.3rem; right: 1.2rem; }
  .phead-row { align-items: stretch; flex-direction: column; }
  .tools .search { flex: 1 1 100%; width: 100%; }
  .ov-grid, .inv, .formgrid, .quick { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr; }
  .modal form#recForm, .modal form#userForm { grid-template-columns: 1fr; }
  .modal-wrap { padding: 0; align-items: end; }
  .modal, .modal.wide { width: 100%; max-height: 92vh; border-radius: 16px 16px 0 0; }
  .line { grid-template-columns: 1fr 1fr 2rem; grid-template-areas: "d d x" "q p p" "v s s"; padding: .75rem 0; border-bottom: 1px solid var(--line); }
  .line.head { display: none; }
  .line .ln-desc { grid-area: d; } .line .ln-qty { grid-area: q; } .line .ln-price { grid-area: p; }
  .line .ln-vat { grid-area: v; } .line .ln-sum { grid-area: s; } .line .iconbtn { grid-area: x; }
  .totals { width: 100%; }
  .day { min-height: 3.3rem; align-items: center; padding: .25rem .1rem; }
  .chips { display: none; }
  .dots { display: flex; }
  .wb-stage { height: calc(100svh - 150px); min-height: 420px; }
  .wb-bar { left: .5rem; right: .5rem; top: .5rem; max-width: none; }
  .wb-bar .btn.small { padding: .3rem .5rem; }
  .wb-props > .muted { display: none; }
  .wb-live { top: auto; left: .5rem; right: auto; bottom: 4.1rem; padding: .25rem .55rem; min-height: 0; }
  .kb-side .file { flex-wrap: nowrap; }
  .kb-side .file .grow { flex-basis: auto; }
  .wb-zoomgrp { bottom: 4.1rem; right: .5rem; }
  .wb-zoomgrp [data-wb="zoom"] { display: none; }
  .wb-tools { left: .5rem; right: .5rem; top: auto; bottom: .5rem; transform: none; flex-direction: row; overflow-x: auto; scrollbar-width: none; }
  .wb-tsep { width: 1px; height: auto; margin: 4px 2px; }
  .wb-hint { display: none; }
  .kb-read, .kb-editwrap { grid-template-columns: 1fr; }
  .kb-meta { grid-template-columns: 1fr; }
  .kb-doc { padding: 1.1rem 1.1rem; }
  .file { flex-wrap: wrap; }
  .file .grow { flex-basis: calc(100% - 4rem); }
  .file .btn { flex: 1; }
  .sheet { padding: 8mm; min-height: 0; font-size: 9.5pt; }
  .sh-head { flex-direction: column; gap: 1rem; }
  .sh-title { text-align: left; }
  .sh-title dl { justify-content: start; }
  .sh-totals { width: 100%; }
}

/* ---------- Afdrukken (factuur als PDF) ---------- */
@page { size: A4; margin: 0; }
@media print {
  body { background: #fff; }
  .topbar, .noprint, .toast, .modal-wrap { display: none !important; }
  .main { max-width: none; padding: 0; margin: 0; }
  .sheet { width: 210mm; min-height: 297mm; border: 0; box-shadow: none; margin: 0; padding: 18mm 18mm 16mm; font-size: 10.5pt; }
  .sh-head { flex-direction: row; }
  .sh-title { text-align: right; }
  .sh-totals { width: 85mm; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ---------- Personen (kleur per collega) ---------- */
.avatar.xs { width: 1.45rem; height: 1.45rem; font-size: .6rem; cursor: default; background: var(--pc, var(--accent-soft)); color: #fff; border: 2px solid #fff; }
.who { display: inline-flex; flex: none; }
.who .avatar + .avatar { margin-left: -6px; }
.people-pick { display: flex; flex-wrap: wrap; gap: .4rem; }
.person-chip { display: inline-flex; align-items: center; gap: .4rem; padding: .25rem .7rem .25rem .3rem; border: 1px solid var(--line-strong); border-radius: 999px; cursor: pointer; font-size: .88rem; font-weight: 550; color: var(--muted); user-select: none; }
.person-chip input { position: absolute; opacity: 0; width: 1px; height: 1px; min-height: 0; }
.person-chip:has(input:checked) { border-color: var(--pc); background: color-mix(in srgb, var(--pc) 10%, #fff); color: var(--fg); }
.person-chip:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.person-chip:not(:has(input:checked)) .avatar { background: var(--line-strong); }

/* ---------- Agenda: kleuren per persoon ---------- */
.chip.person { background: color-mix(in srgb, var(--pc) 14%, #fff); color: color-mix(in srgb, var(--pc) 75%, #000); box-shadow: inset 2px 0 0 var(--pc); }
.chip.todo { background: var(--subtle); color: var(--fg); box-shadow: inset 2px 0 0 var(--line-strong); }
.chip.todo.person { background: #fff; box-shadow: inset 2px 0 0 var(--pc), 0 0 0 1px color-mix(in srgb, var(--pc) 30%, #fff); }
.dots i[data-pc] { background: var(--pc); }
.dots i.todo:not([data-pc]) { background: var(--line-strong); }
.item[data-pc] .when { color: color-mix(in srgb, var(--pc) 80%, #000); }
.item.todo .when { color: var(--muted); }
.team-legend .body { display: flex; flex-direction: column; gap: .4rem; font-size: .9rem; }
.legend-item { display: flex; align-items: center; gap: .55rem; }
.legend-item i { width: .75rem; height: .75rem; border-radius: 3px; background: var(--pc, var(--accent)); flex: none; }
.legend-item i.team { background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent-line); }
.legend-item i.deadline { background: var(--bad-soft); box-shadow: inset 0 0 0 1px var(--bad); }
.ical-choice { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin: 1rem 0; }
.ical-choice section { border: 1px solid var(--line); border-radius: 12px; padding: .9rem 1rem; }
.ical-choice h3 { margin: 0 0 .2rem !important; }
.ical-choice p { margin: 0; }
.ical-choice .copyline { margin: .7rem 0 .5rem; }

/* ---------- Taken ---------- */
.todos-wrap { display: flex; flex-direction: column; gap: 1rem; max-width: 980px; }
.todo-add { display: flex; gap: .5rem; padding: .6rem; align-items: center; }
.todo-add #todoNew { flex: 1; }
.todo-add select, .todo-add input[type="date"] { width: auto; }
.todo-list { display: flex; flex-direction: column; }
.todo { display: flex; align-items: center; gap: .55rem; padding: .45rem .8rem .45rem .5rem; border-bottom: 1px solid var(--line); background: #fff; }
.todo:last-child { border-bottom: 0; }
.todo-list.card .todo:first-child { border-radius: 14px 14px 0 0; }
.todo-list.card .todo:last-child { border-radius: 0 0 14px 14px; }
.todo-grip { color: var(--line-strong); cursor: grab; font-size: .8rem; letter-spacing: -2px; padding: 0 .1rem; user-select: none; }
.todo:hover .todo-grip { color: var(--muted); }
.todo.dragging { opacity: .45; }
.todo.drop-before { box-shadow: inset 0 2px 0 var(--accent); }
.todo.drop-after { box-shadow: inset 0 -2px 0 var(--accent); }
.todo-check { width: 1.3rem; height: 1.3rem; border-radius: 6px; border: 2px solid var(--line-strong); background: #fff; cursor: pointer; flex: none; padding: 0; display: grid; place-items: center; transition: background .15s, border-color .15s; }
.todo-check:hover { border-color: var(--accent); }
.todo-check[aria-pressed="true"] { background: var(--ok); border-color: var(--ok); }
.todo-check[aria-pressed="true"]::after { content: ''; width: .35rem; height: .65rem; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg) translate(-1px, -1px); }
.todo-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.todo-title { border: 1px solid transparent; background: transparent; padding: .3rem .45rem; min-height: 0; font-weight: 550; border-radius: 6px; }
.todo-title:hover { border-color: var(--line); }
.todo-title:focus { background: #fff; }
.todo.done .todo-title { color: var(--muted); text-decoration: line-through; font-weight: 400; }
.todo-proj { font-size: .8rem; color: var(--muted); padding: 0 .5rem; }
.todo-proj:hover { color: var(--accent); }
.due { font-size: .78rem; font-weight: 600; padding: .1rem .5rem; border-radius: 999px; background: var(--subtle); color: var(--muted); white-space: nowrap; }
.due.soon { background: var(--warn-soft); color: var(--warn); }
.due.late { background: var(--bad-soft); color: var(--bad); }
.todo-date { position: relative; width: 2rem; height: 2rem; flex: none; display: grid; place-items: center; border-radius: 8px; cursor: pointer; color: var(--muted); }
.todo-date svg { width: 1.15rem; height: 1.15rem; pointer-events: none; }
.card > .todo-list.compact { border-radius: 0 0 14px 14px; overflow: hidden; }
.todo-date:hover { background: var(--subtle); color: var(--fg); }
.todo-date input { position: absolute; inset: 0; opacity: 0; cursor: pointer; min-height: 0; padding: 0; border: 0; }
.todo-date input::-webkit-calendar-picker-indicator { position: absolute; inset: 0; width: 100%; height: 100%; cursor: pointer; }
.todo-who { width: 9rem; min-height: 2rem; padding: .2rem .4rem; font-size: .85rem; color: var(--muted); }
.todo-who[data-pc] { color: color-mix(in srgb, var(--pc) 80%, #000); border-color: color-mix(in srgb, var(--pc) 35%, #fff); background: color-mix(in srgb, var(--pc) 7%, #fff); font-weight: 600; }
.todo-del { opacity: 0; width: 1.8rem; height: 1.8rem; }
.todo:hover .todo-del, .todo-del:focus-visible { opacity: 1; }
.todo-donebtn { align-self: flex-start; font-size: .9rem; }
.done-list { opacity: .85; }
.todo-list.compact .todo { padding-left: .9rem; }
.todo-list.compact .todo-grip { display: none; }
.more-todos { font-size: .88rem; color: var(--accent); padding: .6rem 1.1rem; }
.todo-group { margin-bottom: 1.5rem; max-width: 980px; }
.todo-group > h2 { font-size: .82rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: .6rem; }
.todo-group.late > h2 { color: var(--bad); }

/* ---------- Borden ---------- */
.bgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 1rem; }
.bcard { display: flex; gap: .9rem; align-items: center; padding: 1rem 1.1rem; border: 1px solid var(--line); border-radius: 14px; background: #fff; color: var(--fg); box-shadow: var(--shadow-sm); transition: border-color .15s, box-shadow .15s; min-width: 0; }
.bcard:hover { text-decoration: none; border-color: var(--accent-line); box-shadow: var(--shadow); }
.bcard-body { display: flex; flex-direction: column; min-width: 0; }
.bcard-body strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bcard-icon { width: 2.8rem; height: 2.8rem; border-radius: 12px; display: grid; place-items: center; flex: none; background: var(--accent-soft); color: var(--accent); }
.bcard-icon svg { width: 1.5rem; height: 1.5rem; }
.k-mindmap .bcard-icon { background: var(--mm-blue-soft); color: var(--mm-blue); }
.k-flowchart .bcard-icon { background: var(--mm-green-soft); color: var(--mm-green); }
.bnew-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.bnew { display: flex; flex-direction: column; align-items: flex-start; gap: .4rem; text-align: left; padding: 1.2rem 1.2rem 1.1rem; border: 1px dashed var(--line-strong); border-radius: 14px; background: #fff; cursor: pointer; font: inherit; color: var(--fg); }
.bnew:hover { border-color: var(--accent); border-style: solid; background: var(--subtle); }
.bnew .bcard-icon { margin-bottom: .3rem; }
.bsub { font-size: .82rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 1.6rem 0 .7rem; }
.bkind-pick { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; }
.bkind { display: flex; flex-direction: column; gap: .3rem; padding: .8rem .85rem; border: 1.5px solid var(--line); border-radius: 12px; cursor: pointer; }
.bkind input { position: absolute; opacity: 0; width: 1px; height: 1px; min-height: 0; }
.bkind .bcard-icon { width: 2.2rem; height: 2.2rem; border-radius: 9px; }
.bkind:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.bkind:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.field .lbl { font-size: .82rem; font-weight: 600; color: var(--muted); }

/* ---------- Notities: mappen, live, PDF ---------- */
.notes-list > header .tools { gap: .35rem; }
.notes-list > header .btn svg { width: 1rem; height: 1rem; }
.note-tree { overflow-y: auto; padding: .35rem 0; min-height: 4rem; }
.note-tree.drop { background: var(--accent-soft); }
.tree-row { display: flex; align-items: center; gap: .45rem; width: 100%; border: 0; background: none; text-align: left; padding: .5rem .9rem .5rem calc(.9rem + var(--depth, 0) * 1rem); cursor: pointer; color: var(--fg); font: inherit; }
.tree-row:hover { background: var(--subtle); }
.tree-row .grow { min-width: 0; }
.tree-row .title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.tree-row .meta { color: var(--muted); font-size: .8rem; display: block; }
.note-item.active { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.tree-folder { position: relative; }
.tree-folder .folder-row { padding-right: 4.5rem; color: var(--fg); }
.tree-folder .folder-row svg { width: 1.05rem; height: 1.05rem; color: var(--accent); flex: none; }
.tree-folder .chev { width: .8rem; color: var(--muted); transition: transform .15s; display: inline-block; font-size: 1.05rem; line-height: 1; }
.tree-folder.open > .folder-row .chev { transform: rotate(90deg); }
.tree-folder .count { font-size: .75rem; color: var(--muted); }
.tree-folder.current > .folder-row { background: var(--subtle); }
.tree-folder.drop > .folder-row { background: var(--accent-soft); box-shadow: inset 0 0 0 2px var(--accent); }
.folder-tools { position: absolute; right: .4rem; top: 50%; transform: translateY(-50%); display: none; gap: 2px; }
.tree-folder:hover > .folder-tools, .tree-folder:focus-within > .folder-tools { display: inline-flex; }
.folder-tools .iconbtn { width: 1.7rem; height: 1.7rem; font-size: 1rem; }
.tree-empty { font-size: .82rem; color: var(--muted); padding: .3rem .9rem .3rem calc(2.6rem + var(--depth, 0) * 1rem); font-style: italic; }
.notes-foot { border-top: 1px solid var(--line); padding: .5rem .9rem; }
.folder-menu { display: flex; flex-direction: column; gap: .5rem; align-items: stretch; }
.folder-menu .btn { justify-content: flex-start; }
.modal h2 svg { width: 1.1rem; height: 1.1rem; color: var(--accent); vertical-align: -.15rem; }
.note-foot { display: inline-flex; align-items: center; gap: .6rem; min-width: 0; }
.note-people { display: inline-flex; align-items: center; gap: .4rem; }
.note-people .avatar { background: var(--pc); color: #fff; }
.note-live { color: var(--ok); font-weight: 600; }
.note-editor footer .tools { gap: .4rem; }
.note-folder-pick { display: inline-flex; align-items: center; gap: .3rem; color: var(--muted); }
.note-folder-pick svg { width: 1rem; height: 1rem; }
.note-folder-pick select { width: auto; max-width: 12rem; min-height: 2rem; padding: .2rem .4rem; font-size: .85rem; }
.note-sheet { min-height: 0; margin-bottom: 1.5rem; }
.ns-head { display: flex; justify-content: space-between; gap: 1rem; padding-bottom: 5mm; border-bottom: 2px solid var(--accent); font-size: 9pt; color: #6d6d82; }
.ns-org { font-weight: 700; color: var(--accent); }
.ns-title { font-size: 20pt; margin: 8mm 0 1mm; letter-spacing: -.01em; }
.ns-sub { color: #6d6d82; font-size: 9pt; margin-bottom: 7mm; }
.ns-body { max-width: none; font-size: 10.5pt; }
@media print {
  .note-sheet { min-height: 0; margin: 0; page-break-after: always; }
  .note-sheet:last-child { page-break-after: auto; }
}
@media (max-width: 980px) {
  .tiles { grid-template-columns: 1fr 1fr; }
  .bnew-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .tiles { grid-template-columns: 1fr; }
  .topnav { overflow-x: auto; scrollbar-width: none; }
  .topnav a { flex: none; padding: .4rem .55rem; }
  .todo-add { flex-wrap: wrap; }
  .todo-add #todoNew { flex-basis: 100%; }
  .todo { flex-wrap: wrap; }
  .todo-main { flex-basis: calc(100% - 4rem); }
  .todo-who { width: auto; flex: 1; }
  .todo-del { opacity: 1; }
  .ical-choice, .bkind-pick { grid-template-columns: 1fr; }
  .note-editor footer { flex-wrap: wrap; gap: .5rem; }
}
.notes-list .note-tree { flex: 1; min-height: 0; }
@media (hover: none) { .folder-tools { display: inline-flex; } .todo-del { opacity: 1; } }
