/* Organizr house style (Brand & product system v1.0.0, 27 October 2026): typeface Organizr Sans (DejaVu Sans 400/700,
   bundled in assets/fonts with its licence), the light semantic colours and the radii of tokens.css. Only the look follows
   the brand book; layout and interaction stay as they were. */
@font-face { font-family: "Organizr Sans"; src: url("../assets/fonts/DejaVuSans-Regular.woff") format("woff"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Organizr Sans"; src: url("../assets/fonts/DejaVuSans-Bold.woff") format("woff"); font-weight: 700; font-display: swap; }
/* Design tokens: colours, type, spacing, radii, shadows. Only a light theme. The company colours
   (--primary, --secondary) are set at runtime from the branding settings. */
:root {
  --font: "Organizr Sans", system-ui, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --fs-xs: 11px; --fs-sm: 13px; --fs-md: 14px; --fs-lg: 16px; --fs-xl: 20px; --fs-xxl: 28px;
  --r-sm: 6px; --r-md: 10px; --r-lg: 16px; --r-xl: 16px;
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 20px; --sp-6: 24px; --sp-8: 32px;
  --topbar-h: 56px; --tabbar-h: 58px;
  --ease: cubic-bezier(.2, .7, .2, 1); --dur: 160ms;
  --primary: #155EE8; --primary-ink: #ffffff; --primary-soft: #EAF1FF; --primary-line: rgba(21, 94, 232, .35);
  --brand-dot: #209BFA;
  --secondary: #0f8a7e; --secondary-ink: #ffffff; --secondary-soft: rgba(15, 138, 126, .14);
  --bg: #F5F6F8; --bg-elev: #FFFFFF; --bg-sunken: #EEF0F4; --bg-hover: rgba(17, 19, 24, .05); --bg-active: rgba(17, 19, 24, .08);
  --text: #111318; --text-2: #596170; --text-3: #8A93A3; --ink-on-dark: #ffffff;
  --line: #D9DDE5; --line-strong: #7A8494;
  --shadow-sm: none;
  --shadow-md: 0 8px 24px rgba(0, 0, 0, .12), 0 0 0 1px rgba(60, 60, 67, .08);
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, .22), 0 0 0 1px rgba(60, 60, 67, .08);
  --backdrop: rgba(0, 0, 0, .32);
  --ok: #176A47; --ok-soft: #E9F6EF;
  --warn: #B47800; --warn-soft: #FFF4D6;
  --danger: #B42336; --danger-soft: #FDEDF0;
  --info: #155EE8; --info-soft: #EAF1FF;
  --neutral: #8e8e93; --neutral-soft: rgba(142, 142, 147, .18);
  --purple: #7b5bd6; --purple-soft: rgba(123, 91, 214, .14);
  --holiday: rgba(217, 67, 59, .10); --bouwvak: rgba(217, 144, 13, .14); --school: rgba(59, 125, 216, .10); --own: rgba(123, 91, 214, .14);
  color-scheme: light;
}

/* Base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); font-size: var(--fs-md); line-height: 1.45; color: var(--text); background: var(--bg);
  -webkit-font-smoothing: antialiased; overscroll-behavior-y: none;
}
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -.01em; }
h1 { font-size: var(--fs-xxl); }
h2 { font-size: var(--fs-xl); }
h3 { font-size: var(--fs-lg); }
h4 { font-size: var(--fs-md); }
p { margin: 0 0 var(--sp-3); }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img { max-width: 100%; display: block; }
.hidden { display: none !important; }
.muted { color: var(--text-2); }
.small { font-size: var(--fs-sm); }
.tiny { font-size: var(--fs-xs); }
.mono { font-family: var(--font-mono); }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row { display: flex; align-items: center; gap: var(--sp-2); }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1 1 auto; min-width: 0; }
.col { display: flex; flex-direction: column; gap: var(--sp-2); }
.gap-1 { gap: var(--sp-1); }
.gap-3 { gap: var(--sp-3); }
.gap-4 { gap: var(--sp-4); }
.mt-2 { margin-top: var(--sp-2); }
.mt-3 { margin-top: var(--sp-3); }
.mt-4 { margin-top: var(--sp-4); }
.mb-2 { margin-bottom: var(--sp-2); }
.mb-3 { margin-bottom: var(--sp-3); }
.mb-4 { margin-bottom: var(--sp-4); }
.icon { flex: none; vertical-align: -5px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
::selection { background: var(--primary-soft); }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 6px; }

/* App layout */
.app { min-height: 100vh; min-height: 100dvh; display: grid; transition: grid-template-columns var(--dur) var(--ease); }
.app.no-shell { grid-template-columns: 1fr; }
.main { min-width: 0; display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }
.topbar { position: sticky; top: 0; z-index: 30; height: var(--topbar-h); display: flex; align-items: center; gap: 10px; padding: 0 16px; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(180%) blur(18px); -webkit-backdrop-filter: saturate(180%) blur(18px); border-bottom: 1px solid var(--line); }
.topbar .title { font-size: var(--fs-lg); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.topbar .spacer { flex: 1; }
.topbar .search { position: relative; width: 260px; max-width: 40vw; }
.topbar .search input { padding-left: 34px; height: 36px; border-radius: 10px; background: var(--bg-sunken); border-color: transparent; }
.topbar .search .icon { position: absolute; left: 9px; top: 8px; color: var(--text-2); }
.iconbtn { position: relative; width: 36px; height: 36px; border-radius: 10px; border: 0; background: transparent; color: var(--text); display: inline-grid; place-items: center; transition: background var(--dur) var(--ease); flex: none; }
.iconbtn:hover { background: var(--bg-hover); }
.iconbtn:active { background: var(--bg-active); }
.iconbtn .badge-count { position: absolute; top: 3px; right: 3px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px; background: var(--danger); color: #fff; font-size: 10.5px; font-weight: 700; display: grid; place-items: center; line-height: 1; }
.iconbtn.sm { width: 30px; height: 30px; border-radius: 8px; }
.iconbtn.sm .icon { width: 17px; height: 17px; }
.view { padding: 20px 24px 40px; flex: 1; }
.view > .page-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.page-head h1 { font-size: 24px; }
.page-head .sub { color: var(--text-2); font-size: var(--fs-sm); }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.tabbar { display: none; }
.login { position: fixed; inset: 0; z-index: 100; background: var(--bg); overflow: auto; }

/* Cards and groups */
.card { background: var(--bg-elev); border-radius: var(--r-lg); padding: 16px; }
.card.pad-0 { padding: 0; overflow: hidden; }
.card.flat { box-shadow: none; border: 1px solid var(--line); }
.card-title { display: flex; align-items: center; gap: 10px; font-weight: 600; margin-bottom: 10px; }
.card-title .actions { margin-left: auto; display: flex; gap: 6px; }
.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.auto { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.detail-grid { display: grid; gap: 16px; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
.detail-head .ref, .page-head .ref { white-space: nowrap; }
.list { display: flex; flex-direction: column; }
.list > .item { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-top: 1px solid var(--line); min-width: 0; }
.list > .item:first-child { border-top: 0; }
.list > .item.link { cursor: pointer; transition: background var(--dur) var(--ease); }
.list > .item.link:hover { background: var(--bg-hover); }
.item .body { flex: 1; min-width: 0; }
.item .body .t { font-weight: 500; }
.item .body .s { color: var(--text-2); font-size: var(--fs-sm); }
.kv { display: grid; grid-template-columns: minmax(120px, 36%) 1fr; gap: 6px 14px; font-size: var(--fs-sm); }
.kv dt { color: var(--text-2); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.empty { text-align: center; color: var(--text-2); padding: 40px 16px; }
.empty .icon { width: 36px; height: 36px; opacity: .5; margin-bottom: 8px; }
.section-title { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .06em; color: var(--text-2); font-weight: 600; margin: 18px 0 8px; }
.divider { height: 1px; background: var(--line); margin: 12px 0; }
.note { background: var(--info-soft); border-radius: var(--r-md); padding: 10px 12px; font-size: var(--fs-sm); }
.note.warn { background: var(--warn-soft); }
.note.danger { background: var(--danger-soft); }
.note.ok { background: var(--ok-soft); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: 10px; border: 1px solid transparent; background: var(--bg-sunken); color: var(--text); font-weight: 500; font-size: var(--fs-sm); white-space: nowrap; transition: background var(--dur) var(--ease), transform var(--dur) var(--ease); user-select: none; }
.btn:hover { background: var(--bg-active); text-decoration: none; }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--primary); color: var(--primary-ink); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.ghost { background: transparent; }
.btn.ghost:hover { background: var(--bg-hover); }
.btn.danger { background: var(--danger-soft); color: var(--danger); }
.btn.danger.solid { background: var(--danger); color: #fff; }
.btn.sm { height: 30px; padding: 0 10px; border-radius: 8px; font-size: var(--fs-xs); }
.btn.lg { height: 44px; padding: 0 20px; font-size: var(--fs-md); border-radius: 12px; }
.btn:disabled { opacity: .45; pointer-events: none; }
.btn .icon { width: 18px; height: 18px; }
.btn.block { width: 100%; }

/* Forms */
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > label, .label { font-size: var(--fs-sm); font-weight: 500; color: var(--text-2); }
.field .help { font-size: var(--fs-xs); color: var(--text-3); }
.field.req > label::after { content: ' *'; color: var(--danger); }
input[type="text"], input[type="search"], input[type="email"], input[type="tel"], input[type="number"], input[type="date"], input[type="datetime-local"], input[type="time"], input[type="password"], input[type="url"], select, textarea { width: 100%; height: 38px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--bg-elev); color: var(--text); transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease); min-width: 0; }
textarea { height: auto; min-height: 90px; padding: 9px 12px; resize: vertical; line-height: 1.4; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
input::placeholder, textarea::placeholder { color: var(--text-3); }
select { appearance: none; -webkit-appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--text-2) 50%), linear-gradient(135deg, var(--text-2) 50%, transparent 50%); background-position: calc(100% - 16px) 16px, calc(100% - 11px) 16px; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 30px; }
input[type="color"] { width: 44px; height: 38px; padding: 2px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--bg-elev); }
input[type="checkbox"], input[type="radio"] { accent-color: var(--primary); width: 18px; height: 18px; }
.check { display: flex; align-items: center; gap: 9px; font-size: var(--fs-sm); cursor: pointer; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; }
.form-grid .span-2 { grid-column: span 2; }
.form-error { color: var(--danger); font-size: var(--fs-sm); }
.switch { position: relative; width: 44px; height: 26px; border-radius: 999px; background: var(--neutral-soft); border: 0; padding: 0; transition: background var(--dur) var(--ease); flex: none; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform var(--dur) var(--ease); }
.switch[aria-checked="true"] { background: var(--ok); }
.switch[aria-checked="true"]::after { transform: translateX(18px); }
.switch:disabled { opacity: .5; }
.switch-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.switch-row:first-child { border-top: 0; }
.switch-row .body { flex: 1; min-width: 0; }
.switch-row .body .t { font-weight: 500; font-size: var(--fs-sm); }
.switch-row .body .s { color: var(--text-2); font-size: var(--fs-xs); }
.segmented { display: inline-flex; background: var(--bg-sunken); border-radius: 10px; padding: 3px; gap: 2px; }
.segmented button { border: 0; background: transparent; padding: 5px 12px; border-radius: 8px; font-size: var(--fs-sm); font-weight: 500; color: var(--text-2); transition: all var(--dur) var(--ease); white-space: nowrap; }
.segmented button.active { background: var(--bg-elev); color: var(--text); box-shadow: var(--shadow-sm); }
.segmented.sm button { padding: 3px 9px; font-size: var(--fs-xs); }

/* Chips, badges, avatars */
.badge { display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; font-size: var(--fs-xs); white-space: nowrap; line-height: 1; }
.badge .dot { border-radius: 50%; background: currentColor; }
.badge.outline { background: transparent; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 9px 0 6px; border-radius: 999px; font-size: var(--fs-xs); font-weight: 500; white-space: nowrap; max-width: 100%; }
.chip .avatar { width: 18px; height: 18px; font-size: 8px; }
.chip .sw { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.chip.btn-like { cursor: pointer; }
.chip.btn-like:hover { background: var(--bg-active); }
.chip .x { border: 0; background: none; padding: 0; display: grid; place-items: center; color: var(--text-2); }
.chip .x .icon { width: 14px; height: 14px; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); display: inline-grid; place-items: center; font-size: 11px; font-weight: 700; flex: none; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.lg { width: 56px; height: 56px; font-size: 20px; }
.avatar.sm { width: 24px; height: 24px; font-size: 9px; }
.avatars { display: flex; }
.avatars .avatar { border: 2px solid var(--bg-elev); margin-left: -8px; }
.avatars .avatar:first-child { margin-left: 0; }
.dot-state { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }
.deadline { white-space: nowrap; }
.deadline .icon { width: 15px; height: 15px; vertical-align: -3px; }
.sw { display: inline-block; width: 12px; height: 12px; border-radius: 4px; vertical-align: -1px; }

/* Tables */
.table-wrap { position: relative; overflow: auto; background: var(--bg-elev); border-radius: var(--r-lg); max-height: calc(100vh - 230px); }
.table-wrap.auto-h { max-height: none; }
table.data { border-collapse: separate; border-spacing: 0; width: max-content; min-width: 100%; font-size: var(--fs-sm); table-layout: fixed; }
table.data th, table.data td { padding: 0 10px; height: 42px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
table.data th { position: sticky; top: 0; z-index: 2; background: var(--bg-elev); font-size: var(--fs-xs); text-transform: uppercase; user-select: none; }
table.data th .th { display: flex; align-items: center; gap: 6px; height: 100%; }
table.data th .th .lbl { overflow: hidden; text-overflow: ellipsis; flex: 1; cursor: pointer; }
table.data th .th .icon { width: 14px; height: 14px; }
table.data th .resizer { position: absolute; top: 0; right: 0; width: 8px; height: 100%; cursor: col-resize; }
table.data th .resizer::after { content: ''; position: absolute; right: 3px; top: 10px; bottom: 10px; width: 1px; }
table.data th.dragging { opacity: .4; }
table.data th.drop-left { box-shadow: inset 3px 0 0 var(--primary); }
table.data th.drop-right { box-shadow: inset -3px 0 0 var(--primary); }
table.data th.sticky, table.data td.sticky { position: sticky; left: 0; z-index: 1; background: var(--bg-elev); }
table.data th.sticky { z-index: 3; }
table.data tbody tr { cursor: pointer; transition: background var(--dur) var(--ease); }
table.data tbody tr:hover td { background: var(--bg-hover); }
table.data tbody tr:hover td.sticky { background: color-mix(in srgb, var(--bg-elev) 92%, var(--text)); }
table.data tbody tr.late td.sticky::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--danger); }
table.data tbody tr.soon td.sticky::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--warn); }
table.data td.num { text-align: right; font-variant-numeric: tabular-nums; }
table.data tr.group td { background: var(--bg-sunken); font-weight: 600; color: var(--text-2); font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .04em; height: 32px; }
table.data tfoot td { position: sticky; bottom: 0; background: var(--bg-elev); font-weight: 600; }
.table-tools { display: flex; align-items: center; margin-bottom: 10px; flex-wrap: wrap; }
.table-tools .search { position: relative; }
.table-tools .search input { padding-left: 32px; width: 220px; height: 34px; }
.table-tools .search .icon { position: absolute; left: 9px; top: 7px; width: 18px; height: 18px; color: var(--text-2); }
.table-tools .spacer { flex: 1; }
.filters { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.filters .chip.active { background: var(--primary-soft); color: var(--primary); }
.table-foot { display: flex; align-items: center; color: var(--text-2); font-size: var(--fs-xs); }
.simple { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.simple th, .simple td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.simple th { color: var(--text-2); font-weight: 600; font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .04em; }

/* Dropdown menu, popover */
.menu { position: fixed; z-index: 90; min-width: 200px; max-width: 320px; max-height: 60vh; overflow: auto; background: var(--bg-elev); border-radius: 12px; box-shadow: var(--shadow-md); padding: 6px; animation: pop var(--dur) var(--ease); }
.menu .mi { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: none; text-align: left; padding: 8px 10px; border-radius: 8px; font-size: var(--fs-sm); color: var(--text); }
.menu .mi:hover { background: var(--bg-hover); }
.menu .mi.danger { color: var(--danger); }
.menu .mi .icon { width: 18px; height: 18px; color: var(--text-2); }
.menu .mi.danger .icon { color: inherit; }
.menu .mi.checked { color: var(--primary); }
.menu .sep { height: 1px; background: var(--line); margin: 5px 4px; }
.menu .mh { padding: 6px 10px 4px; font-size: var(--fs-xs); color: var(--text-2); text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
.menu .mi input[type="checkbox"] { margin: 0; }
.popover { position: fixed; z-index: 90; background: var(--bg-elev); border-radius: 14px; box-shadow: var(--shadow-md); padding: 12px; width: 300px; animation: pop var(--dur) var(--ease); }
@keyframes pop { from { opacity: 0; transform: translateY(-4px) scale(.98); } to { opacity: 1; transform: none; } }

/* Modal and sheet */
.modal-back { position: fixed; inset: 0; z-index: 80; background: var(--backdrop); display: flex; align-items: center; justify-content: center; padding: 20px; animation: fade var(--dur) var(--ease); }
.modal { background: var(--bg-elev); border-radius: 18px; box-shadow: var(--shadow-lg); width: 560px; max-width: 100%; max-height: calc(100vh - 40px); display: flex; flex-direction: column; animation: rise 220ms var(--ease); }
.modal.lg { width: 860px; }
.modal.xl { width: 1100px; }
.modal.sm { width: 420px; }
.modal.full { width: calc(100vw - 40px); height: calc(100vh - 40px); }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 16px 20px 10px; }
.modal-head h3 { flex: 1; min-width: 0; }
.modal-body { padding: 6px 20px 16px; overflow: auto; flex: 1; }
.modal-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 12px 20px 18px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.modal-foot .left { margin-right: auto; display: flex; gap: 8px; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
.panel { position: fixed; top: 0; right: 0; bottom: 0; width: 380px; max-width: 100vw; z-index: 70; background: var(--bg-elev); box-shadow: var(--shadow-lg); display: flex; flex-direction: column; animation: slide 220ms var(--ease); }
@keyframes slide { from { transform: translateX(30px); opacity: 0; } to { transform: none; opacity: 1; } }
.panel-head { display: flex; align-items: center; gap: 8px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.panel-head h3 { flex: 1; }
.panel-body { padding: 14px 16px; overflow: auto; flex: 1; }
.panel-body h4 { margin: 14px 0 6px; }
.panel-body ul { padding-left: 18px; margin: 0 0 10px; }
.panel-body li { margin-bottom: 4px; font-size: var(--fs-sm); }
.toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 120; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 12px; font-size: var(--fs-sm); font-weight: 500; box-shadow: var(--shadow-md); animation: rise 200ms var(--ease); max-width: 90vw; pointer-events: auto; }
.toast.danger { background: var(--danger); color: #fff; }
.toast.ok { background: var(--ok); color: #fff; }

/* Notifications */
.notif { display: flex; gap: 10px; padding: 10px 8px; border-radius: 10px; cursor: pointer; }
.notif:hover { background: var(--bg-hover); }
.notif.unread .t { font-weight: 600; }
.notif .ic { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); flex: none; }
.notif .ic.warn { background: var(--warn-soft); color: var(--warn); }
.notif .ic.danger { background: var(--danger-soft); color: var(--danger); }
.notif .ic.ok { background: var(--ok-soft); color: var(--ok); }
.notif .t { font-size: var(--fs-sm); }
.notif .s { font-size: var(--fs-xs); color: var(--text-2); }
.notif .when { font-size: var(--fs-xs); color: var(--text-3); white-space: nowrap; }
.notif.unread::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--primary); margin: 11px 0 0 -2px; flex: none; }

/* Tabs */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs button { border: 0; background: none; padding: 8px 12px; font-size: var(--fs-sm); font-weight: 500; color: var(--text-2); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button.active { color: var(--primary); border-color: var(--primary); }

/* Action detail and updates */
.detail-head { display: flex; gap: 14px; align-items: flex-start; flex-wrap: wrap; }
.detail-head .ref { font-family: var(--font-mono); font-size: var(--fs-sm); color: var(--text-2); }
.updates { display: flex; flex-direction: column; gap: 10px; }
.update { background: var(--bg-elev); border-radius: var(--r-lg); padding: 12px 14px; }
.update.system { border-left-color: var(--neutral); box-shadow: none; }
.update .head { display: flex; gap: 10px; align-items: center; font-size: var(--fs-sm); margin-bottom: 6px; }
.update .head .when { color: var(--text-2); margin-left: auto; font-size: var(--fs-xs); white-space: nowrap; }
.update .text { white-space: pre-wrap; overflow-wrap: anywhere; }
.update .changes { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.update .changes .chg { font-size: var(--fs-xs); background: var(--bg-sunken); border-radius: 8px; padding: 3px 8px; }
.update .changes .chg b { font-weight: 600; }
.thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.thumbs .thumb { width: 120px; height: 90px; border-radius: 10px; overflow: hidden; background: var(--bg-sunken); cursor: zoom-in; position: relative; }
.thumbs .thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumbs .file { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 10px; border-radius: 10px; background: var(--bg-sunken); font-size: var(--fs-xs); max-width: 220px; }
.original .tag { font-size: var(--fs-xs); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.drop { border: 1.5px dashed var(--line-strong); border-radius: 12px; padding: 14px; text-align: center; color: var(--text-2); font-size: var(--fs-sm); cursor: pointer; }
.drop.over { border-color: var(--primary); background: var(--primary-soft); }
.lightbox { position: fixed; inset: 0; z-index: 110; background: rgba(0,0,0,.9); display: grid; place-items: center; cursor: zoom-out; animation: fade var(--dur) var(--ease); }
.lightbox img { max-width: 94vw; max-height: 90vh; object-fit: contain; border-radius: 8px; }

/* Gantt */
.legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: var(--fs-xs); color: var(--text-2); align-items: center; }
.legend .sw { margin-right: 4px; }

/* Calendar */
.cal-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.cal-head h2 { min-width: 200px; }
.cal-month { display: grid; grid-template-columns: 36px repeat(7, minmax(0, 1fr)); background: var(--bg-elev); border-radius: var(--r-lg); overflow: hidden; }
.cal-month .dow { padding: 8px 6px; font-size: var(--fs-xs); font-weight: 600; color: var(--text-2); text-transform: uppercase; letter-spacing: .04em; border-bottom: 1px solid var(--line); text-align: center; }
.cal-month .wk { font-size: var(--fs-xs); color: var(--text-3); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); display: flex; align-items: flex-start; justify-content: center; padding-top: 6px; }
.cal-month .day { min-height: 96px; border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); padding: 4px 5px; font-size: var(--fs-xs); position: relative; cursor: pointer; }
.cal-month .day:nth-child(8n) { border-right: 0; }
.cal-month .day .n { font-weight: 600; font-size: var(--fs-sm); display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; }
.cal-month .day.other { color: var(--text-3); }
.cal-month .day.other .n { opacity: .5; }
.cal-month .day.today .n { background: var(--primary); color: var(--primary-ink); }
.cal-month .day.weekend { background: var(--bg-hover); }
.cal-month .day.l-holiday { background: var(--holiday); }
.cal-month .day.l-bouwvak { background: var(--bouwvak); }
.cal-month .day.l-school { background: var(--school); }
.cal-month .day.l-own { background: var(--own); }
.cal-month .day.l-holiday.l-school { background: linear-gradient(135deg, var(--holiday) 50%, var(--school) 50%); }
.cal-month .day.l-bouwvak.l-school { background: linear-gradient(135deg, var(--bouwvak) 50%, var(--school) 50%); }
.cal-month .day .lay { font-size: 10px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-month .day .ev { margin-top: 2px; padding: 1px 5px; border-radius: 5px; font-size: 10.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); border-left: 3px solid var(--primary); }
.cal-month .day .ev.conflict { border-left-color: var(--danger); }
.cal-month .day .more { font-size: 10px; color: var(--text-2); }
.cal-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; }
.cal-week .wday { background: var(--bg-elev); border-radius: var(--r-md); padding: 10px; min-height: 240px; }
.cal-week .wday.today { outline: 2px solid var(--primary); }
.cal-week .wday .h { font-weight: 600; font-size: var(--fs-sm); margin-bottom: 6px; }
.cal-week .wday .lay, .cal-day .lay { font-size: var(--fs-xs); color: var(--text-2); margin-bottom: 4px; }
.cal-ev { display: block; padding: 6px 8px; border-radius: 8px; border-left: 3px solid var(--primary); font-size: var(--fs-xs); margin-top: 6px; cursor: pointer; color: var(--text); }
.cal-ev.conflict { border-left-color: var(--danger); }
.cal-ev .s { color: var(--text-2); }
.cal-year { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.cal-year .mini { background: var(--bg-elev); border-radius: var(--r-md); padding: 10px; }
.cal-year .mini h4 { margin-bottom: 6px; font-size: var(--fs-sm); }
.cal-year .mini .g { display: grid; grid-template-columns: 22px repeat(7, 1fr); gap: 1px; font-size: 10px; text-align: center; }
.cal-year .mini .g .w { color: var(--text-3); font-size: 9px; }
.cal-year .mini .g .d { height: 22px; display: grid; place-items: center; border-radius: 5px; position: relative; cursor: pointer; }
.cal-year .mini .g .d.other { opacity: .3; }
.cal-year .mini .g .d.today { background: var(--primary); color: var(--primary-ink); font-weight: 700; }
.cal-year .mini .g .d.l-holiday { background: var(--holiday); }
.cal-year .mini .g .d.l-bouwvak { background: var(--bouwvak); }
.cal-year .mini .g .d.l-school { background: var(--school); }
.cal-year .mini .g .d.l-own { background: var(--own); }
.cal-year .mini .g .d .m { position: absolute; bottom: 1px; left: 50%; transform: translateX(-50%); width: 5px; height: 5px; border-radius: 50%; background: var(--primary); }
.cal-year .mini .g .d .m.conflict { background: var(--danger); }
.cal-day { background: var(--bg-elev); border-radius: var(--r-lg); padding: 16px; }
.layer-toggles { display: flex; flex-wrap: wrap; gap: 6px; }

/* Chat */
.chat-layout { display: grid; grid-template-columns: 300px 1fr; gap: 14px; height: calc(100vh - 130px); min-height: 420px; }
.chat-list { background: var(--bg-elev); border-radius: var(--r-lg); overflow: auto; }
.chat-list .item.active { background: var(--primary-soft); }
.chat-room { background: var(--bg-elev); border-radius: var(--r-lg); display: flex; flex-direction: column; min-height: 0; }
.chat-room .head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.chat-room .msgs { flex: 1; overflow: auto; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.msg { display: flex; gap: 8px; max-width: 78%; }
.msg.mine { align-self: flex-end; flex-direction: row-reverse; }
.msg .bubble { background: var(--bg-sunken); border-radius: 16px; padding: 8px 12px; font-size: var(--fs-sm); overflow-wrap: anywhere; }
.msg.mine .bubble { background: var(--primary); color: var(--primary-ink); border-bottom-right-radius: 5px; }
.msg:not(.mine) .bubble { border-bottom-left-radius: 5px; }
.msg .who { font-size: var(--fs-xs); color: var(--text-2); margin-bottom: 2px; }
.msg .when { font-size: 10px; opacity: .7; margin-top: 3px; text-align: right; }
.msg .ref { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; padding: 6px 9px; border-radius: 10px; background: rgba(255,255,255,.18); font-size: var(--fs-xs); font-weight: 600; cursor: pointer; }
.msg:not(.mine) .ref { background: var(--bg-elev); }
.msg .ref.noaccess { opacity: .7; cursor: default; }
.msg.mine .bubble a { color: inherit; text-decoration: underline; }
.chat-room .composer { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line); align-items: flex-end; }
.chat-room .composer textarea { min-height: 40px; max-height: 140px; height: 40px; border-radius: 14px; }
.day-sep { align-self: center; font-size: var(--fs-xs); color: var(--text-2); background: var(--bg-sunken); border-radius: 999px; padding: 2px 10px; }

/* Wizard */
.steps { display: flex; gap: 6px; margin-bottom: 16px; flex-wrap: wrap; }
.steps .step { display: flex; align-items: center; gap: 8px; font-size: var(--fs-sm); color: var(--text-2); }
.steps .step .n { width: 24px; height: 24px; border-radius: 50%; background: var(--bg-sunken); display: grid; place-items: center; font-size: var(--fs-xs); font-weight: 700; }
.steps .step.active { color: var(--text); font-weight: 600; }
.steps .step.active .n { background: var(--primary); color: var(--primary-ink); }
.steps .step.done .n { background: var(--ok); color: #fff; }
.steps .step + .step::before { content: ''; width: 20px; height: 1px; background: var(--line-strong); }
.mapping { display: grid; grid-template-columns: 1fr 24px 1fr 1fr; gap: 8px 10px; align-items: center; font-size: var(--fs-sm); }
.mapping .hdr { font-weight: 600; color: var(--text-2); font-size: var(--fs-xs); text-transform: uppercase; }
.valid-err { color: var(--danger); }
.valid-ok { color: var(--ok); }

/* Print preview */
.preview-wrap { background: var(--bg-sunken); border-radius: var(--r-md); padding: 20px; overflow: auto; max-height: 60vh; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.sheet { background: #fff; color: #111; box-shadow: 0 4px 20px rgba(0,0,0,.2); position: relative; overflow: hidden; font-family: var(--font); }
.sheet .ph { display: flex; align-items: center; gap: 10px; border-bottom: 1px solid #999; padding-bottom: 4mm; margin-bottom: 4mm; }
.sheet .ph img { height: 10mm; width: auto; }
.sheet .ph .t { font-weight: 700; font-size: 13pt; }
.sheet .ph .s { color: #555; font-size: 9pt; }
.sheet .pf { position: absolute; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-between; font-size: 8pt; color: #666; }
.sheet table { border-collapse: collapse; width: 100%; table-layout: fixed; }
.sheet th, .sheet td { border: 1px solid #ccc; padding: 1.4mm 1.8mm; text-align: left; vertical-align: top; overflow-wrap: anywhere; }
.sheet th { color: #fff; font-weight: 600; }
.sheet h2 { font-size: 13pt; margin: 4mm 0 2mm; }
.sheet h3 { font-size: 11pt; margin: 3mm 0 1.5mm; }
.sheet p { margin: 0 0 2mm; }
.print-root { display: none; }

/* Login */
.login-box { max-width: 520px; margin: 8vh auto; padding: 24px; }
.login-box .brandrow { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.login-box .account { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-elev); margin-bottom: 8px; }
.login-box .account:hover { border-color: var(--primary); background: var(--primary-soft); }
.login-box .account .who b { display: block; font-size: var(--fs-sm); }
.login-box .account .who span { font-size: var(--fs-xs); color: var(--text-2); }

/* Rights matrix */
.rights { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.rights th, .rights td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; }
.rights th { font-size: var(--fs-xs); color: var(--text-2); text-transform: uppercase; }
.rights td.c { text-align: center; }

/* Responsive */
@media (max-width: 1100px) {
  .grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .chat-layout { grid-template-columns: 240px 1fr; }
}
@media (max-width: 760px) {
  .main { padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); }
  .tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; height: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: color-mix(in srgb, var(--bg-elev) 88%, transparent); backdrop-filter: saturate(180%) blur(18px); -webkit-backdrop-filter: saturate(180%) blur(18px); border-top: 1px solid var(--line); }
  .tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 10.5px; color: var(--text-2); font-weight: 500; padding-top: 6px; }
  .tabbar a.active { color: var(--primary); }
  .tabbar a .icon { width: 24px; height: 24px; }
  .tabbar a:hover { text-decoration: none; }
  .view { padding: 14px 14px 30px; }
  .topbar { padding: 0 10px; }
  .topbar .search { display: none; }
  .page-head h1 { font-size: 21px; }
  .grid.cols-2, .grid.cols-3 { grid-template-columns: 1fr; }
  .grid.cols-4 { grid-template-columns: 1fr 1fr; gap: 10px; }
  .detail-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: auto; }
  .modal-back { padding: 0; align-items: flex-end; }
  .modal, .modal.lg, .modal.xl, .modal.sm, .modal.full { width: 100%; max-height: 94vh; border-radius: 18px 18px 0 0; height: auto; }
  .modal-foot { padding-bottom: calc(18px + env(safe-area-inset-bottom)); }
  .panel { width: 100%; }
  .chat-layout { grid-template-columns: 1fr; height: auto; }
  .chat-layout .chat-list.has-room { display: none; }
  .chat-room { height: calc(100vh - 200px); }
  .cal-month .day { min-height: 56px; padding: 2px 3px; }
  .cal-month .day .ev { display: none; }
  .cal-month .day .lay { display: none; }
  .cal-month .day .dots { display: flex; gap: 2px; margin-top: 2px; }
  .cal-month .day .dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--primary); }
  .cal-month .day .dots i.conflict { background: var(--danger); }
  .cal-week { grid-template-columns: 1fr; }
  .table-wrap { max-height: none; }
  .kv { grid-template-columns: 1fr; gap: 2px 0; }
  .kv dt { margin-top: 6px; }
  .mapping { grid-template-columns: 1fr 1fr; }
  .mapping .arrow { display: none; }
}
@media (min-width: 761px) {
  .cal-month .day .dots { display: none; }
  .only-mobile { display: none !important; }
}
@media (max-width: 760px) {
  .only-desktop { display: none !important; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Rustige weergave: kleur alleen waar die iets betekent, geen kaders rond waarden, lichte lijnen. */
.card, .table-wrap, .cal-month, .chat-list, .chat-room, .update, .cal-week .wday, .cal-year .mini, .cal-day { box-shadow: none; }

/* waarden in tabellen en kaarten: platte tekst */
.val { display: inline-flex; align-items: center; gap: 7px; max-width: 100%; min-width: 0; color: var(--text); }
.val > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.val + .val { margin-left: 14px; }
.val .pdot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.val.strong { font-weight: 600; }
.val.dim { color: var(--text-3); }
.val.alert { color: var(--danger); font-weight: 600; }

/* tabel */
table.data th { font-weight: 500; letter-spacing: .02em; color: var(--text-3); }
table.data th .iconbtn { opacity: 0; transition: opacity var(--dur) var(--ease); }
table.data th:hover .iconbtn, table.data th .iconbtn:focus-visible { opacity: 1; }
table.data th .resizer::after { background: transparent; }
table.data th:hover .resizer::after { background: var(--line-strong); }
table.data th .th .sorted { color: var(--text); }
table.data tbody tr.late td.sticky::before, table.data tbody tr.soon td.sticky::before { display: none; }
table.data td { color: var(--text); }

/* deadlines: alleen tekstkleur, geen pictogrammen */
.deadline .icon { display: none; }
.deadline.late { color: var(--danger); font-weight: 600; }
.deadline.today, .deadline.soon { color: var(--text); font-weight: 600; }
.conflict-mark { color: var(--text-3); margin-left: 4px; }
.conflict-mark .icon { width: 15px; height: 15px; vertical-align: -3px; }

/* labels zonder vlakken en omlijningen */
.badge { background: transparent; padding: 0; height: auto; font-weight: 500; color: var(--text-2); }
.badge.ok, .badge.warn, .badge.info, .badge.purple, .badge.primary { background: transparent; color: var(--text-2); }
.badge.danger { background: transparent; color: var(--danger); }
.badge.outline { border: 0; color: var(--text-3); }
.badge .dot { width: 7px; height: 7px; }

/* knoppen en velden */
.btn.secondary { background: var(--bg-sunken); border-color: transparent; }
input[type="text"], input[type="search"], input[type="email"], input[type="tel"], input[type="number"], input[type="date"], input[type="datetime-local"], input[type="time"], input[type="password"], input[type="url"], select, textarea { border-color: var(--line-strong); }

/* kaarten, updates en kalender zonder gekleurde randen */
.update { border-left: 0; }
.update.system { background: transparent; border-top: 1px solid var(--line); border-radius: 0; }
.original { border-left: 0; }
.original .tag { color: var(--text-2); }
.cal-month .day .ev, .cal-ev { background: var(--bg-sunken); border-left-width: 2px; }
.chip { background: var(--bg-sunken); }

/* Tijdlijn rechts naast de actielijst */
.tl-split { display: flex; align-items: stretch; background: var(--bg-elev); overflow: hidden; }
.tl-split > .table-wrap { flex: 1 1 46%; border-radius: 0; }
.tl-wrap { flex: 1 1 0; min-width: 200px; overflow-x: auto; overflow-y: hidden; position: relative; background: var(--bg-elev); }
.tl-head { position: sticky; top: 0; z-index: 2; background: var(--bg-elev); }
.tl-head svg, .tl-body svg { display: block; font-family: var(--font); }
.tl-head text { font-size: 11px; fill: var(--text-2); }
.tl-head text.m { font-size: 12px; fill: var(--text); font-weight: 600; }
.tl-body .bar-label { font-size: 12px; fill: var(--text); paint-order: stroke; stroke: var(--bg-elev); stroke-width: 4px; stroke-linejoin: round; }
.tl-body .bar-label.inside { fill: #fff; font-weight: 600; stroke: none; }
.tl-row { fill: transparent; cursor: pointer; }
.tl-row:hover { fill: var(--bg-hover); }
.tl-dep { fill: none; stroke: var(--text-2); stroke-width: 1.3; pointer-events: stroke; }
.tl-dep.bad { stroke: var(--danger); stroke-width: 1.6; }
.xp-deps { margin-top: 12px; display: flex; flex-direction: column; gap: 3px; font-size: var(--fs-sm); }
.xp-deps a { font-family: var(--font-mono); font-size: var(--fs-xs); }
.dep-warn { color: var(--danger); }
.dep-warn .icon { width: 15px; height: 15px; vertical-align: -3px; }
select.multi { height: auto; padding: 4px 6px; }
select.multi option { padding: 3px 4px; border-radius: 4px; }
.tl-bar { cursor: pointer; }
.tl-bar.can { cursor: grab; }
.tl-bar.can [data-edge] { cursor: ew-resize; }
.tl-bar.can:hover .tl-rect { opacity: 1; stroke: var(--text); stroke-opacity: .25; stroke-width: 1; }
.tl-bar.dragging { cursor: grabbing; }
.tl-bar.dragging .tl-rect { opacity: 1; stroke: var(--text); stroke-opacity: .45; stroke-width: 1.5; }
.tl-bar.dragging .tl-date { font-weight: 600; fill: var(--text); }
.btn.sm.on { background: var(--bg-active); }
@media (max-width: 760px) {
  .tl-wrap { display: none; }
  .tl-split > .table-wrap { flex-basis: 100%; }
}

/* Uitklapbare actiepunten in de lijst */
.xchev { display: inline-flex; width: 16px; margin-right: 4px; color: var(--text-3); transition: transform var(--dur) var(--ease); vertical-align: middle; }
.xchev .icon { width: 14px; height: 14px; }
table.data tbody tr.expanded .xchev { transform: rotate(90deg); color: var(--text); }
table.data tbody tr.expanded td { background: var(--bg-sunken); }
table.data tbody tr.xrow { cursor: default; }
table.data tbody tr.xrow td, table.data tbody tr.xrow:hover td { height: auto; padding: 0; white-space: normal; overflow: visible; background: var(--bg-sunken); text-overflow: clip; vertical-align: top; }
.xpanel { position: sticky; left: 0; }
.xgrid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr) minmax(0, 1.25fr); gap: 28px; }
.xlabel { font-size: var(--fs-xs); color: var(--text-3); text-transform: uppercase; letter-spacing: .04em; font-weight: 500; margin-bottom: 8px; }
.xdesc { white-space: pre-wrap; font-size: var(--fs-sm); margin-bottom: 10px; }
.xpanel .kv { grid-template-columns: minmax(110px, 40%) 1fr; gap: 4px 12px; }
.xup { font-size: var(--fs-sm); }
.xup-h { margin-bottom: 2px; }
.xup-c { margin-top: 2px; }
.xform .form-grid { gap: 8px 10px; }
.xform textarea { min-height: 70px; background: var(--bg-elev); }
.xform input, .xform select { height: 34px; background-color: var(--bg-elev); }
.xform .field > label { font-size: var(--fs-xs); }
.tl-split { position: relative; }
.xlayer { position: absolute; left: 0; right: 0; overflow: hidden; pointer-events: none; }
.xlayer .xpanel { position: absolute; left: 0; right: 0; top: 0; pointer-events: auto; }
@media (max-width: 1100px) {
  .xgrid { grid-template-columns: 1fr 1fr; }
  .xgrid > :last-child { grid-column: span 2; }
}
@media (max-width: 760px) {
  .xgrid { grid-template-columns: 1fr; gap: 18px; }
  .xgrid > :last-child { grid-column: auto; }
}

/* minder kaders */
button.chip { border: 0; }
.layer-toggles .chip { background: transparent; color: var(--text-3); padding: 0 6px; height: 26px; }
.layer-toggles .chip.on { background: transparent; color: var(--text); }
.layer-toggles .chip .icon { width: 14px; height: 14px; }
.layer-toggles .chip:hover { background: var(--bg-hover); }
.tabs { overflow-y: hidden; }
.colpick-list { max-height: 52vh; overflow: auto; margin: 0 -4px; }
.colpick-row { display: flex; align-items: center; gap: 4px; padding: 3px 4px; border-radius: 8px; border-top: 2px solid transparent; border-bottom: 2px solid transparent; }
.colpick-row:hover { background: var(--bg-hover); }
.colpick-row.off .ellipsis { color: var(--text-3); }
.colpick-row .grip { color: var(--text-3); cursor: grab; display: grid; place-items: center; }
.colpick-row .grip .icon { width: 16px; height: 16px; }
.colpick-row.dragging { opacity: .4; }
.colpick-row.drop-above { border-top-color: var(--primary); }
.colpick-row.drop-below { border-bottom-color: var(--primary); }
.colpick-row .check { min-width: 0; }
.colpick-row .iconbtn .icon.up { transform: rotate(180deg); }
.colpick-row .iconbtn:disabled { opacity: .25; }
.table-tools .scope-select { width: auto; height: 34px; padding-left: 12px; font-weight: 500; font-size: var(--fs-sm); background-color: var(--bg-elev); }

/* een dunne onderbalk: aantal regels en legenda op één regel, dunne schuifbalken */
.table-foot { margin-top: 4px; gap: 18px; min-height: 18px; line-height: 18px; overflow: hidden; white-space: nowrap; }
.table-foot .legend { gap: 14px; flex-wrap: nowrap; font-size: var(--fs-xs); color: var(--text-3); overflow: hidden; }
.table-foot .legend .sw { width: 9px; height: 9px; border-radius: 3px; }
.table-wrap, .tl-wrap { scrollbar-width: auto; scrollbar-color: rgba(120, 120, 128, .45) transparent; }
.table-wrap::-webkit-scrollbar, .tl-wrap::-webkit-scrollbar { width: 14px; height: 14px; }
.table-wrap::-webkit-scrollbar-thumb, .tl-wrap::-webkit-scrollbar-thumb { background: rgba(120, 120, 128, .4); border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; min-width: 40px; min-height: 40px; }
.table-wrap::-webkit-scrollbar-thumb:hover, .tl-wrap::-webkit-scrollbar-thumb:hover { background-color: rgba(120, 120, 128, .65); }
.table-wrap::-webkit-scrollbar-track, .tl-wrap::-webkit-scrollbar-track { background: transparent; }
.table-wrap::-webkit-scrollbar-corner, .tl-wrap::-webkit-scrollbar-corner { background: transparent; }
.view:has(.tl-split) { padding-bottom: 10px; }
.topbar.merged { display: none; }
.head-tools { display: flex; align-items: center; gap: 2px; }
.page-head .head-tools { margin-left: 10px; padding-left: 10px; border-left: 1px solid var(--line); }
.topbar a.iconbtn { color: var(--text); text-decoration: none; }
.topbar .iconbtn.active { background: var(--primary-soft); color: var(--primary); }
.tl-split { border-radius: 10px; }
.tl-split > .table-wrap { border-right: 0; }
.tl-wrap { border-left: 0; }
.tl-split > .table-wrap { min-width: 200px; }
.tl-gutter { flex: none; width: 9px; margin: 0 -4px; position: relative; z-index: 5; cursor: col-resize; touch-action: none; }
.tl-gutter::before { content: ''; position: absolute; top: 0; bottom: 0; left: 4px; width: 1px; background: var(--line-strong); }
.tl-gutter::after { content: ''; position: absolute; top: 50%; left: 2px; width: 5px; height: 36px; margin-top: -18px; border-radius: 3px; background: var(--line-strong); opacity: 0; transition: opacity var(--dur) var(--ease); }
.tl-gutter:hover::before, .tl-gutter.dragging::before, .tl-gutter:focus-visible::before { width: 3px; left: 3px; background: var(--primary); }
.tl-gutter:hover::after, .tl-gutter.dragging::after { opacity: 1; background: var(--primary); }
@media (max-width: 760px) {
  .tl-gutter { display: none; }
  .tl-split > .table-wrap { flex: 1 1 100% !important; }
}
.table-tools .segmented { background: transparent; }
.table-tools .segmented button.active { background: var(--bg-sunken); box-shadow: none; }

/* Uitklapvenster: rustig, leesbaar, met een vaste maximale breedte */
.xpanel { padding: 0; }
.xlayer { z-index: 7; }
.xlayer .xpanel, table.data tbody tr.xrow td .xpanel { background: var(--bg-elev); border-top: 1px solid var(--line-strong); border-bottom: 1px solid var(--line-strong); box-shadow: inset 3px 0 0 var(--primary); }
.xp { max-width: 1180px; padding: 18px 28px 22px; font-size: var(--fs-sm); line-height: 1.5; }
.xp-head { display: flex; gap: 24px; align-items: flex-start; }
.xp-desc { flex: 1; min-width: 0; font-size: var(--fs-md); white-space: pre-wrap; overflow-wrap: anywhere; max-width: 72ch; }
.xp-notes { margin-top: 6px; font-size: var(--fs-sm); color: var(--text-2); white-space: normal; }
.xp-actions { display: flex; gap: 8px; flex: none; }
.xp-facts { display: flex; flex-wrap: wrap; gap: 10px 32px; margin: 14px 0 0; padding: 12px 0 16px; border-bottom: 1px solid var(--line); }
.xp-facts > div { min-width: 0; max-width: 260px; }
.xp-facts dt { font-size: var(--fs-xs); color: var(--text-2); margin: 0 0 1px; }
.xp-facts dd { margin: 0; color: var(--text); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.xp-cols { display: grid; grid-template-columns: minmax(340px, 480px) minmax(0, 1fr); gap: 40px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); align-items: start; }
.xp h4 { font-size: var(--fs-sm); font-weight: 600; margin: 0 0 10px; color: var(--text); }
.xp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; }
.xp-grid .span-2 { grid-column: span 2; }
.xp-grid .field > label { font-size: var(--fs-xs); color: var(--text-2); font-weight: 500; }
.xp-grid textarea { min-height: 76px; }
.xp-grid input, .xp-grid select { height: 36px; }
.xp-buttons { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.xup { display: flex; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.xup:first-of-type { border-top: 0; padding-top: 2px; }
.xup .avatar { margin-top: 1px; }
.xup-b { flex: 1; min-width: 0; }
.xup-h { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.xup-h { font-size: var(--fs-sm); color: var(--text); margin: 0; }
.xup-h b { font-weight: 600; color: var(--text); }
.xup-h span { font-size: var(--fs-xs); color: var(--text-2); }
.xup-t { margin-top: 2px; white-space: pre-wrap; overflow-wrap: anywhere; max-width: 72ch; }
.xup-c { list-style: none; margin: 4px 0 0; padding: 0; font-size: var(--fs-xs); color: var(--text-2); }
.xup-c li span { color: var(--text-2); }
.xup-c li b { color: var(--text); font-weight: 600; }
.xup .thumbs .thumb { width: 84px; height: 63px; }
.xpanel { container-type: inline-size; }
@container (max-width: 860px) {
  .xp-cols { grid-template-columns: 1fr; gap: 22px; }
  .xp { padding: 16px 18px 18px; }
  .xp-head { flex-direction: column; gap: 10px; }
  .xp-form { max-width: 520px; }
}
@media (max-width: 760px) {
  .xp-cols { grid-template-columns: 1fr; gap: 22px; }
  .xp { padding: 16px; }
  .xp-head { flex-direction: column; gap: 10px; }
}

/* chat als paneel aan de rechterkant */
.chatpanel { position: fixed; top: 0; right: 0; bottom: 0; width: min(760px, 92vw); z-index: 67; background: var(--bg); box-shadow: var(--shadow-lg); display: flex; flex-direction: column; animation: slide 220ms var(--ease); border-left: 1px solid var(--line); border-top-left-radius: 14px; overflow: hidden; }
.chatpanel-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--line); background: var(--bg-elev); }
.chatpanel-body { flex: 1; min-height: 0; padding: 12px; }
.chatpanel .chat-layout { height: 100%; min-height: 0; grid-template-columns: 230px 1fr; gap: 10px; }
.chatpanel .chat-room { min-height: 0; }
.chatpanel .msg { max-width: 88%; }
@media (max-width: 760px) {
  .chatpanel { width: 100vw; }
  .chatpanel .chat-layout { grid-template-columns: 1fr; }
  .chatpanel .chat-list.has-room { display: none; }
  .chatpanel .chat-room { height: 100%; }
  .chatpanel .chat-list:not(.has-room) + .chat-room { display: none; }
}

/* klok en kalender rechtsonder */
.clock { position: fixed; right: 16px; bottom: 5px; z-index: 65; display: flex; flex-direction: row; align-items: center; gap: 8px; height: 22px; padding: 0 8px; border: 0; border-radius: 6px; background: transparent; color: var(--text-2); font-size: 11.5px; line-height: 22px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.clock .clock-t { font-weight: 600; color: var(--text); font-size: 12px; }
.clock .clock-d::before { content: ''; display: inline-block; width: 1px; height: 11px; background: var(--line-strong); margin-right: 8px; vertical-align: -1px; }
.clock:hover, .clock.on { background: var(--bg-active); }
.calfly { position: fixed; right: 12px; bottom: 34px; z-index: 66; width: 320px; max-height: calc(100vh - 70px); overflow: auto; background: var(--bg-elev); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 14px 14px 10px; animation: rise 180ms var(--ease); }
.calfly-top { padding-bottom: 10px; border-bottom: 1px solid var(--line); margin-bottom: 10px; }
.calfly-day { font-weight: 600; font-size: var(--fs-md); }
.calfly-nav { display: flex; align-items: center; gap: 2px; margin-bottom: 6px; }
.calfly-grid { display: grid; grid-template-columns: 24px repeat(7, 1fr); gap: 2px; text-align: center; }
.calfly-grid .h { font-size: 10.5px; color: var(--text-3); padding: 2px 0; }
.calfly-grid .w { font-size: 10px; color: var(--text-3); display: grid; place-items: center; }
.calfly-grid .d { position: relative; height: 32px; border: 0; background: transparent; border-radius: 8px; font-size: var(--fs-sm); color: var(--text); font-variant-numeric: tabular-nums; }
.calfly-grid .d:hover { background: var(--bg-hover); }
.calfly-grid .d.other { color: var(--text-3); }
.calfly-grid .d.we { color: var(--text-2); }
.calfly-grid .d.hol { color: var(--danger); }
.calfly-grid .d.off { background: var(--bg-sunken); }
.calfly-grid .d.sel { box-shadow: inset 0 0 0 1.5px var(--text); }
.calfly-grid .d.today { background: var(--primary); color: var(--primary-ink); font-weight: 600; }
.calfly-grid .d i { position: absolute; left: 50%; bottom: 3px; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: var(--text-2); }
.calfly-grid .d i.late { background: var(--danger); }
.calfly-grid .d.today i { background: var(--primary-ink); }
.calfly-list { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; }
.calfly-lh { font-size: var(--fs-xs); color: var(--text-2); font-weight: 600; margin-bottom: 4px; }
.calfly-item { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; border: 0; background: transparent; padding: 6px; border-radius: 8px; font-size: var(--fs-sm); color: var(--text); }
button.calfly-item:hover { background: var(--bg-hover); }
.calfly-item .icon { width: 16px; height: 16px; color: var(--text-3); }
.calfly-item .late { color: var(--danger); }
.calfly-item span.grow { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.calfly-foot { display: flex; align-items: center; margin-top: 8px; padding-top: 6px; border-top: 1px solid var(--line); }
.table-foot { padding-right: 190px; }
@media (max-width: 760px) {
  .clock, .calfly { display: none; }
}

/* geen zijbalk: de onderdelen staan in de kopregel */
.app { grid-template-columns: minmax(0, 1fr); }
.head-nav { display: flex; align-items: center; gap: 2px; margin-right: 6px; padding-right: 8px; border-right: 1px solid var(--line); }
.head-nav a { padding: 6px 10px; border-radius: 8px; font-size: var(--fs-sm); font-weight: 500; color: var(--text-2); text-decoration: none; white-space: nowrap; }
.head-nav a:hover { background: var(--bg-hover); color: var(--text); }
.head-nav a.active { color: var(--text); background: var(--bg-sunken); }
.head-tools a.iconbtn { color: var(--text); text-decoration: none; }
.head-tools .iconbtn.active { background: var(--primary-soft); color: var(--primary); }
.page-head .actions { align-items: center; }

/* één compacte kop: onderdelen als titel, subtitel ernaast, knoppen van de lijst in de werkbalk */
.page-head.navhead > div:first-child { display: flex; align-items: baseline; gap: 18px; flex-wrap: wrap; min-width: 0; }
.page-head.navhead h1 { display: none; }
.main-nav { display: flex; align-items: baseline; gap: 4px; }
.main-nav a { font-size: 20px; font-weight: 600; letter-spacing: -.01em; color: var(--text-3); padding: 2px 8px; border-radius: 8px; text-decoration: none; }
.main-nav a:first-child { margin-left: -8px; }
.main-nav a:hover { color: var(--text-2); background: var(--bg-hover); }
.main-nav a.active { color: var(--text); }
.page-head.navhead .sub { display: none; }
.settings-embed > .page-head { margin-bottom: 10px; }
.settings-embed > .page-head h1 { font-size: var(--fs-lg); }
.settings-embed > .page-head .sub { font-size: var(--fs-xs); }
.page-head.navhead .head-tools { border-left: 0; padding-left: 0; margin-left: 0; }
.view > .page-head { margin-bottom: 12px; }
.table-tools { gap: 6px; }
.table-tools .spacer { min-width: 8px; }
@media print {
  /* Printing: only the prepared pages in #print-root are printed. */
  @page { margin: 0; }
  body { background: #fff; }
  .app > *:not(.print-root) { display: none !important; }
  .print-root { display: block !important; }
  .print-root .sheet { box-shadow: none; margin: 0; page-break-after: always; break-after: page; overflow: visible; }
  .print-root .sheet:last-child { page-break-after: auto; break-after: auto; }
}

/* Organizr logo (horizontal, light) in the page heading and on the sign-in screen */
.oz-brand { display: inline-flex; align-items: center; flex: none; margin-right: 10px; align-self: center; }
.oz-brand img { height: 28px; width: auto; display: block; }
.login-box .brandrow .oz-logo { height: 40px; width: auto; display: block; }
