/* Designify Paneel: opbouw uit VS Code, gevoel uit Notion, huisstijl uit Designify.
   Gebaseerd op aipaneel-portal/admin/admin.css. Alle kleuren, fonts en maten komen uit tokens.css. */

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--text-compact);
  line-height: 1.45;
  color: var(--fg);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
a.plain, .plain a { color: inherit; }
a.plain:hover { text-decoration: none; }
b, strong { font-weight: 600; }
kbd {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--fg-3);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0 4px;
  background: var(--bg);
}
.mono { font-family: var(--mono); font-size: 11.5px; }
.muted { color: var(--fg-2); }
.faint { color: var(--fg-3); }
.small { font-size: 12px; }
.spacer { flex: 1; }
.hidden { display: none !important; }
.nowrap { white-space: nowrap; }
.i { flex: none; vertical-align: -3px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.page-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 24px;
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin: 0;
}
.page-title b { font-weight: 700; }

/* Tone: statuskleur via --c */
.tone-ok { --c: var(--ok); --c-fg: var(--ok-fg); }
.tone-warn { --c: var(--warn); --c-fg: var(--warn-fg); }
.tone-bad { --c: var(--bad); --c-fg: var(--bad); }
.tone-info { --c: var(--info); --c-fg: var(--info); }
.tone-muted { --c: var(--muted); --c-fg: var(--fg-2); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--c, var(--fg-3)); flex: none; display: inline-block; }
.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 1px 8px 1px 7px;
  border-radius: var(--r-pill);
  font-size: 12px;
  line-height: 18px;
  white-space: nowrap;
  color: var(--c-fg, var(--fg-2));
  background: color-mix(in srgb, var(--c, var(--fg-3)) 14%, transparent);
}
.pill .i { width: 12px; height: 12px; vertical-align: 0; }
.actor { display: inline-flex; align-items: center; gap: 4px; color: var(--c-fg, var(--fg-2)); font-size: 11.5px; }
.actor .i { width: 13px; height: 13px; }
.prio-critical { color: var(--bad); }
.prio-high { color: var(--warn-fg); }
.prio-low { color: var(--fg-3); }

/* Controls */
button, select, input, textarea, .btn {
  font: inherit;
  font-size: 13px;
  color: var(--fg);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 5px 10px;
}
button, .btn {
  cursor: pointer;
  border-radius: var(--r-btn);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  text-decoration: none;
  color: var(--fg);
}
button:hover, .btn:hover { background: var(--bg-2); text-decoration: none; }
.btn-primary, button.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn-primary:hover, button.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-danger { color: var(--bad); }
button.ghost, .btn-ghost, button.icon { border-color: transparent; background: none; color: var(--fg-2); }
button.ghost:hover, .btn-ghost:hover, button.icon:hover { background: var(--bg-3); color: var(--fg); }
button.icon, .btn.icon { padding: 4px; display: inline-grid; place-items: center; }
button:disabled { opacity: 0.5; cursor: default; }
input:focus, textarea:focus, select:focus { outline: 1px solid var(--accent); outline-offset: -1px; border-color: var(--accent); }
button:focus-visible, a:focus-visible, .btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
textarea { width: 100%; resize: vertical; min-height: 60px; line-height: 1.5; }
input[type="checkbox"] { accent-color: var(--accent); width: 14px; height: 14px; padding: 0; }
label.field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--fg-2); }
label.field input, label.field select, label.field textarea { font-size: 13px; }
.field-hint { color: var(--fg-3); font-size: 11.5px; }
.errors { border-left: 3px solid var(--bad); background: color-mix(in srgb, var(--bad) 8%, transparent); padding: 8px 12px; border-radius: var(--r-sm); margin: 0 0 16px; }
.errors p { margin: 2px 0; }

/* ---------- Shell (staff, compact) ---------- */
body.shell {
  display: grid;
  grid-template-columns: var(--activity-w) var(--sidebar-w) minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) var(--status-h);
  grid-template-areas: "act side main" "status status status";
  overflow: hidden;
}
body.shell.sidebar-collapsed, body.shell:not(:has(> .sidebar)) { --sidebar-w: 0px; }
body.shell:not(:has(> .sidebar)) [data-action="toggle-sidebar"] { display: none; }
body.shell:not(:has(> .sidebar)) .header { padding-left: 24px; }
body.shell.sidebar-collapsed .sidebar { display: none; }

/* Activity bar */
.activity {
  grid-area: act;
  background: var(--bg-2);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 0;
}
.activity a, .activity .soon {
  position: relative;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  color: var(--fg-3);
  border-radius: var(--r-sm);
}
.activity a:hover { color: var(--fg); text-decoration: none; }
/* Tools die nog komen: zelfde knop, gedimd, doet niets bij klikken */
.activity .soon { padding: 0; border: 0; background: none; font: inherit; cursor: default; }
.activity .soon > .i { opacity: 0.45; }
.activity .soon .tip em { font-style: normal; opacity: 0.6; margin-left: 4px; }
.activity-sep { width: 16px; height: 1px; background: var(--line); margin: 4px 0; flex: none; }
.activity a.active { color: var(--fg); background: var(--bg-3); }
.activity a.active::before {
  content: "";
  position: absolute;
  left: -6px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  border-radius: 2px;
  background: var(--accent);
}
.activity .tip {
  position: absolute;
  left: calc(100% + 8px);
  top: 50%;
  transform: translateY(-50%);
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--fg);
  color: var(--bg);
  font-size: 12px;
  line-height: 1.3;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  z-index: 40;
  transition: opacity 60ms ease;
}
.activity a:hover .tip, .activity a:focus-visible .tip, .activity .soon:hover .tip, .activity .soon:focus-visible .tip { opacity: 1; transition-delay: 160ms; }

/* Bovenbalk in plaats van de activity bar (per gebruiker, User.nav = "top"): zelfde links, met tekst */
body.shell.nav-top {
  --activity-w: 0px;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: var(--header-h) minmax(0, 1fr) var(--status-h);
  grid-template-areas: "act" "main" "status";
}
body.shell.nav-top .header { padding-left: 24px; }
body.shell.nav-top .board-home { height: calc(100dvh - 2 * var(--header-h) - var(--status-h)); }
.nav-top .activity {
  flex-direction: row;
  gap: 2px;
  padding: 0 12px 0 16px;
  border-right: 0;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  scrollbar-width: none;
}
.nav-top .activity .wordmark { width: auto; height: auto; display: block; margin-right: 16px; flex: none; color: var(--fg); }
.nav-top .activity a:not(.wordmark), .nav-top .activity .soon, .nav-menu > summary {
  width: auto;
  height: 28px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  flex: none;
  font-size: 13px;
  color: var(--fg-2);
}
.nav-top .activity a.active::before, .nav-menu > summary.active::before { left: 10px; right: 10px; top: auto; bottom: -6px; width: auto; height: 2px; }
.nav-top .activity .tip, .nav-top .activity a:hover .tip, .nav-top .activity .soon:hover .tip {
  position: static;
  transform: none;
  padding: 0;
  background: none;
  color: inherit;
  font-size: inherit;
  opacity: 1;
  transition: none;
}
.nav-top .activity .soon .tip { opacity: 0.6; }
.nav-top .activity-sep { width: 1px; height: 16px; margin: 0 6px; }
.nav-menu { flex: none; }
.nav-menu > summary { position: relative; list-style: none; border-radius: var(--r-sm); cursor: pointer; user-select: none; }
.nav-menu > summary::-webkit-details-marker { display: none; }
.nav-menu > summary:hover, .nav-menu[open] > summary { color: var(--fg); background: var(--bg-3); }
.nav-menu > summary.active { color: var(--fg); background: var(--bg-3); }
.nav-menu > summary.active::before { content: ""; position: absolute; border-radius: 2px; background: var(--accent); }
/* Fixed, zodat de overflow van de balk het menu niet afknipt; horizontaal blijft het onder de knop */
.nav-menu-panel {
  position: fixed;
  top: calc(var(--header-h) + 2px);
  z-index: 30;
  width: 280px;
  max-width: calc(100vw - 16px);
  max-height: min(560px, 75vh);
  overflow: auto;
  padding: 6px;
  font-size: 13px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-float);
}
.nav-menu-foot { display: flex; align-items: center; gap: 6px; margin-top: 6px; padding: 6px 8px 2px; border-top: 1px solid var(--line); color: var(--fg-2); }
.nav-menu-foot:hover { color: var(--fg); text-decoration: none; }

/* Sidebar */
.sidebar {
  grid-area: side;
  background: var(--bg-2);
  border-right: 1px solid var(--line);
  overflow: auto;
  font-size: 13px;
  padding: 0 6px 24px;
}
.sidebar-head {
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 8px;
  position: sticky;
  top: 0;
  background: var(--bg-2);
  z-index: 1;
}
.wordmark { font-family: var(--font); font-size: 16px; letter-spacing: -0.02em; color: var(--fg); font-weight: 400; }
.wordmark b { font-weight: 700; }
.wordmark:hover { text-decoration: none; }
.wordmark img { height: 18px; display: block; }
.sidebar h4 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 12px 8px 4px;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--fg-3);
}
.tree { list-style: none; margin: 0; padding: 0; }
.tree ul { list-style: none; margin: 0; padding: 0 0 2px 14px; }
.tree a, .tree summary {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border-radius: 6px;
  color: var(--fg-2);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  cursor: pointer;
}
.tree summary { list-style: none; color: var(--fg); font-weight: 500; }
.tree summary::-webkit-details-marker { display: none; }
.tree summary .caret { transition: transform 80ms ease; color: var(--fg-3); }
.tree details[open] > summary .caret { transform: rotate(90deg); }
.tree a:hover, .tree summary:hover { background: var(--bg-3); color: var(--fg); text-decoration: none; }
.tree a.active { background: var(--accent-bg); color: var(--fg); }
.tree .label { overflow: hidden; text-overflow: ellipsis; flex: 1; }
.tree .count { color: var(--fg-3); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.tree li.row { position: relative; }
.tree .soon { display: flex; align-items: center; gap: 6px; padding: 3px 8px; color: var(--fg-3); white-space: nowrap; cursor: default; }
.tree .soon em { font-style: normal; font-size: 11px; opacity: 0.8; }
.panel.soon { border-style: dashed; color: var(--fg-3); }
.tree li.row > a.add {
  position: absolute;
  top: 50%;
  right: 4px;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  padding: 0;
  justify-content: center;
  color: var(--fg-3);
  opacity: 0;
  pointer-events: none;
}
.tree li.row:hover > a.add, .tree li.row > a.add:focus-visible { opacity: 1; pointer-events: auto; }
.tree li.row:hover > a:first-child .count { visibility: hidden; }

/* Main column */
.main { grid-area: main; display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.header {
  height: var(--header-h);
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px 0 8px;
  border-bottom: 1px solid var(--line);
}
.crumbs { display: flex; align-items: center; gap: 6px; min-width: 0; color: var(--fg-2); }
.crumbs a { color: var(--fg-2); }
.crumbs a:hover { color: var(--fg); text-decoration: none; }
.crumbs .sep { color: var(--fg-3); }
.crumbs .last { color: var(--fg); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.header-actions { display: flex; align-items: center; gap: 6px; }
.palette-btn { color: var(--fg-3); gap: 10px; padding: 3px 6px 3px 10px; }
.page { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: auto; }
.page-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 20px 24px 12px; }
.page-head .sub { flex-basis: 100%; color: var(--fg-2); margin-top: -4px; }
.doc { max-width: 1080px; width: 100%; padding: 20px 24px 64px; }
.doc.narrow { max-width: 760px; }
.page-head + .doc { padding-top: 0; }
.doc > .section-title:first-child { margin-top: 8px; }
.doc > table.grid + p, .doc > .form + .section-title { margin-top: 16px; }
p.error { color: var(--bad); }
.section-title {
  font-size: 11px;
  font-weight: 500;
  color: var(--fg-3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 28px 0 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}
/* Productiviteit bovenaan home: stat tiles, label klein, waarde groot, uitleg eronder */
.metrics { flex: none; padding: 0 24px 12px; }
.metrics-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 8px; }
.metrics-head .section-title { margin: 0 auto 0 0; }
.metrics-head .tabs label { padding: 3px 10px; border-radius: var(--r-sm); color: var(--fg-2); cursor: pointer; border: 1px solid transparent; }
.metrics-head .tabs label:hover { color: var(--fg); }
.metrics-head .tabs label.active { background: var(--bg); color: var(--fg); border-color: var(--line); }
.metrics-head .tabs input { position: absolute; opacity: 0; pointer-events: none; }
.metrics-head .tabs label:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 1px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 8px; }
.tile { border: 1px solid var(--line); border-radius: var(--r-card); background: var(--bg); padding: 12px 14px; min-width: 0; }
.tile-label { font-size: 12px; color: var(--fg-2); }
.tile-value { font-size: 24px; font-weight: 600; line-height: 1.3; margin-top: 2px; }
.tile-sub { font-size: 12px; color: var(--fg-3); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toolbar {
  flex: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 8px 24px;
  border-bottom: 1px solid var(--line);
}
.toolbar input[type="search"] { width: 200px; }
.toolbar .counter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  font: inherit;
  font-size: 13px;
  color: var(--fg);
  border: 1px solid var(--line);
  border-radius: var(--r-btn);
  background: var(--bg);
  cursor: pointer;
}
.toolbar .counter:hover { background: var(--bg-2); }
.toolbar .counter strong { font-weight: 600; font-variant-numeric: tabular-nums; color: var(--warn-fg); }
.toolbar .counter.active { background: var(--accent-bg); border-color: var(--accent); }
.toolbar + .table-wrap { padding-top: 0; }
/* Selector: knop met vinkjesmenu, zoals aipaneel-portal */
.selector { position: relative; z-index: 6; }
.selector-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 240px;
  padding: 5px 10px;
  font-size: 13px;
  border: 1px solid var(--line);
  border-radius: var(--r-btn);
  background: var(--bg);
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.selector-btn::-webkit-details-marker { display: none; }
.selector-btn:hover { background: var(--bg-2); }
.selector-btn.active { background: var(--accent-bg); border-color: var(--accent); }
.selector-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.selector-caret { width: 0; height: 0; border-left: 4px solid transparent; border-right: 4px solid transparent; border-top: 5px solid var(--fg-3); flex: none; }
.selector-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 220px;
  max-width: min(320px, calc(100vw - 32px));
  max-height: min(420px, 70vh);
  overflow: auto;
  padding: 4px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-float);
}
.selector-menu label { display: flex; align-items: center; gap: 8px; padding: 5px 8px; border-radius: var(--r-sm); cursor: pointer; color: var(--fg); }
.selector-menu label:hover { background: var(--bg-2); }
.selector-menu input[type="checkbox"] { margin: 0; flex: none; }
.selector-clear {
  display: block;
  width: 100%;
  margin-top: 4px;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  background: var(--bg);
  color: var(--fg-2);
  text-align: left;
  position: sticky;
  bottom: 0;
}
.selector-clear[hidden], [data-filters-reset][hidden] { display: none; }
/* Datumfilter: van/t-m en snelkeuzes in hetzelfde menu */
.date-menu { min-width: 260px; }
.selector-menu label.date-row { cursor: default; justify-content: space-between; }
.selector-menu label.date-row:hover { background: none; }
.date-row span { color: var(--fg-2); font-size: 13px; }
.date-row input, .date-row select { width: 170px; }
.date-presets { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px 8px 6px; }
.date-presets .btn { padding: 3px 8px; font-size: 12px; }
.tabs { display: inline-flex; gap: 2px; padding: 2px; background: var(--bg-2); border-radius: var(--r-btn); }
.tabs a { padding: 3px 10px; border-radius: var(--r-sm); color: var(--fg-2); display: inline-flex; gap: 6px; align-items: center; }
.tabs a:hover { color: var(--fg); text-decoration: none; }
.tabs a.active { background: var(--bg); color: var(--fg); border: 1px solid var(--line); }
.chips { display: flex; flex-wrap: wrap; gap: 4px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  color: var(--fg-2);
  font-size: 12px;
}
.chip:hover { background: var(--bg-2); color: var(--fg); text-decoration: none; }
.chip.active { border-color: var(--accent); background: var(--accent-bg); color: var(--fg); }
.chip .n { color: var(--fg-3); font-variant-numeric: tabular-nums; }

/* Panels */
.panel { border: 1px solid var(--line); border-radius: var(--r-card); padding: 16px; background: var(--bg); }
.panels { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.stat { font-family: var(--font-display); font-size: 28px; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat-label { color: var(--fg-2); font-size: 12px; }
/* Profielen: kanaaltegels en scoreboard */
.channel-name { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 0; }
.kpis dd { margin: 2px 0 0; font-variant-numeric: tabular-nums; }
.scoreboard td.sorted { font-weight: 600; color: var(--fg); }
.scoreboard tr.top td { background: var(--accent-bg); }
.scoreboard th a { color: inherit; }
.scoreboard th a.active { color: var(--fg); }
.scoreboard tr.me td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.scoreboard td.sorted { position: relative; }
.scoreboard .share { position: absolute; right: 8px; bottom: 3px; height: 2px; width: calc(var(--w) * 0.6); max-width: 60%; border-radius: 2px; background: var(--accent); opacity: 0.5; }
.board-head { margin-top: 28px; }
.board-head .section-title { margin: 0 auto 0 0; }
.rank {
  display: inline-grid; place-items: center; min-width: 24px; height: 24px; padding: 0 6px;
  border-radius: var(--r-pill); font-weight: 600; font-size: 12px; font-variant-numeric: tabular-nums;
  color: var(--fg-2); background: var(--bg-2);
}
.rank.rank-1 { background: var(--medal-1); color: var(--on-medal); }
.rank.rank-2 { background: var(--medal-2); color: var(--on-medal); }
.rank.rank-3 { background: var(--medal-3); color: var(--on-medal); }
/* Kaartweergave: podium voor de top 3, daaronder de rest */
.podium, .score-cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.podium { grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: end; margin-bottom: 12px; }
.score-cards { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.score-card {
  border: 1px solid var(--line); border-radius: var(--r-card); background: var(--bg);
  padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; min-width: 0;
}
.score-card.me { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.score-card.unranked { opacity: 0.6; }
.score-who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.score-name { display: flex; flex-direction: column; min-width: 0; }
.score-name > * { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.score-name a { color: inherit; }
.avatar {
  flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent-bg); color: var(--accent); font-weight: 600; font-size: 12px;
}
.score-main { display: grid; grid-template-columns: 1fr auto; align-items: end; column-gap: 12px; row-gap: 4px; }
.score-figure { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.score-main .share-bar { grid-column: 1 / -1; }
/* Verloop: mini-lijndiagram in accent, stip op het lopende tijdvak, stippellijn voor wat nog komt */
.spark { display: block; overflow: visible; }
.spark-line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.spark-area { fill: var(--accent-bg); }
.spark-future { stroke: var(--line); stroke-width: 1.5; stroke-dasharray: 2 3; }
.spark-hit { fill: transparent; }
.spark-pt circle { fill: var(--accent); stroke: var(--bg); stroke-width: 1.5; opacity: 0; }
.spark-pt.spark-now circle, .spark-pt:hover circle { opacity: 1; }
.delta { display: inline-flex; align-items: center; gap: 2px; font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--fg-2); }
.delta-up { color: var(--ok-fg); }
.delta-down { color: var(--bad); }
.score-figure .delta { align-self: flex-start; }
/* Scoreboard-animaties. app.js zet .anim op [data-animate] (niet bij minder beweging) en .play zodra het
   blok in beeld komt; zonder JS staat alles er meteen. Elk item heeft --i voor de volgorde. */
.anim :is(.channel, .score-card, tbody tr) { --d: calc(var(--i, 0) * 60ms); }
.anim .podium-3 { --d: 0ms; }
.anim .podium-2 { --d: 140ms; }
.anim .podium-1 { --d: 300ms; }
.anim:not(.play) :is(.channel, .score-card, tbody tr) { opacity: 0; }
.anim.play :is(.channel, .score-card) { animation: rise 600ms cubic-bezier(.2, .8, .2, 1) var(--d) both; }
.anim.play tbody tr { animation: fade-up 450ms cubic-bezier(.2, .8, .2, 1) var(--d) both; }
.anim.play .podium .score-card { animation-name: podium-rise; animation-duration: 750ms; }
.anim.play .podium-1 .rank { animation: medal-pop 500ms cubic-bezier(.3, 1.6, .5, 1) calc(var(--d) + 650ms) both; }
.anim.play .share-bar > span { transform-origin: left; animation: grow 900ms cubic-bezier(.2, .8, .2, 1) calc(var(--d) + 200ms) both; }
.anim.play .scoreboard .share { transform-origin: right; animation: grow 900ms cubic-bezier(.2, .8, .2, 1) calc(var(--d) + 200ms) both; }
.anim .spark-line { stroke-dasharray: 1; stroke-dashoffset: 1; }
.anim.play .spark-line { animation: draw 1100ms cubic-bezier(.45, 0, .2, 1) calc(var(--d) + 250ms) both; }
.anim:not(.play) :is(.spark-area, .spark-future, .spark-now circle, .delta) { opacity: 0; }
.anim.play .spark-area { animation: fade 700ms ease-out calc(var(--d) + 700ms) both; }
.anim.play .spark-future { animation: fade 500ms ease-out calc(var(--d) + 1100ms) both; }
.anim.play .spark-now circle { transform-box: fill-box; transform-origin: center; animation: dot-pop 450ms cubic-bezier(.3, 1.6, .5, 1) calc(var(--d) + 1250ms) both; }
.anim.play .delta { animation: fade-up 400ms ease-out calc(var(--d) + 900ms) both; }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }
@keyframes podium-rise { from { opacity: 0; transform: translateY(28px) scale(.97); } }
@keyframes fade-up { from { opacity: 0; transform: translateY(4px); } }
@keyframes fade { from { opacity: 0; } }
@keyframes grow { from { transform: scaleX(0); } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes medal-pop { 0% { transform: scale(.4); opacity: 0; } 60% { transform: scale(1.18); opacity: 1; } }
@keyframes dot-pop { 0% { transform: scale(0); opacity: 0; } 60% { transform: scale(1.5); opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .anim :is(.channel, .score-card, tbody tr, .spark-area, .spark-future, .spark-now circle, .delta) { opacity: 1 !important; animation: none !important; }
  .anim :is(.share-bar > span, .share, .rank) { animation: none !important; }
  .anim .spark-line { stroke-dasharray: none; animation: none !important; }
}
.spark-cell { vertical-align: middle !important; }
.share-bar { display: block; height: 4px; border-radius: 2px; background: var(--bg-2); overflow: hidden; margin-top: 4px; }
.share-bar > span { display: block; height: 100%; width: var(--w); background: var(--accent); border-radius: inherit; }
.score-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 0; }
.score-kpis dd { margin: 2px 0 0; font-variant-numeric: tabular-nums; }
.score-channels { display: flex; flex-wrap: wrap; gap: 4px; font-size: 12px; }
.score-channels .chip:hover { background: none; color: var(--fg-2); }
/* Podium: 2 · 1 · 3, de winnaar het hoogst */
.podium .score-card { position: relative; padding-top: 20px; }
.podium .score-card::before { content: ""; position: absolute; inset: 0 0 auto; height: 4px; border-radius: var(--r-card) var(--r-card) 0 0; background: var(--medal, var(--line)); }
.score-card.rank-1 { --medal: var(--medal-1); }
.score-card.rank-2 { --medal: var(--medal-2); }
.score-card.rank-3 { --medal: var(--medal-3); }
.podium .podium-1 { order: 2; padding-top: 32px; padding-bottom: 24px; }
.podium .podium-2 { order: 1; }
.podium .podium-3 { order: 3; }
.podium .podium-1 .stat { font-size: 36px; }
.podium .podium-1 .rank { min-width: 32px; height: 32px; font-size: 14px; }
.podium .podium-1 .avatar { width: 40px; height: 40px; font-size: 14px; }
.podium:has(> :only-child) { grid-template-columns: minmax(0, 1fr); }
.podium:has(> :nth-child(2):last-child) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.podium:has(> :nth-child(2):last-child) .podium-1 { order: 1; }
.podium:has(> :nth-child(2):last-child) .podium-2 { order: 2; }
@media (max-width: 720px) {
  .podium { grid-template-columns: minmax(0, 1fr); }
  .podium .score-card { order: 0; }
  .podium .podium-1 { padding-top: 20px; padding-bottom: 14px; }
}
.scroll-x { overflow-x: auto; }
.color-field { display: flex; gap: 8px; align-items: center; }
.color-field input[type="text"] { flex: 1; min-width: 0; font-family: var(--mono); }
.color-pick { width: 36px; height: 36px; padding: 2px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--bg); cursor: pointer; flex: none; }
.focus-metrics { margin: 32px 0; }
/* Klantoverzicht: modulepanelen met statustabel */
.mod-panel { display: flex; flex-direction: column; gap: 12px; }
.mod-head { display: flex; align-items: flex-start; gap: 4px; }
.mod-title { font-weight: 600; color: var(--fg); }
.mod-title:hover { color: var(--accent); text-decoration: none; }
.mod-open { display: flex; align-items: baseline; gap: 8px; margin-top: 6px; }
.mod-states { width: 100%; border-collapse: collapse; font-size: 13px; }
.mod-states td { padding: 5px 0; border-top: 1px solid var(--line); }
.mod-states td.num { text-align: right; font-variant-numeric: tabular-nums; color: var(--fg-2); width: 1%; padding-left: 12px; }
.mod-states a { display: flex; align-items: center; gap: 8px; color: var(--fg); }
.mod-states a:hover { text-decoration: none; color: var(--accent); }
.mod-states tr:hover td.num { color: var(--fg); }
.mod-empty { margin: 0; font-size: 13px; }
.meter { height: 6px; background: var(--bg-3); border-radius: var(--r-pill); margin-top: 8px; overflow: hidden; }
.meter span { display: block; height: 100%; background: var(--c, var(--ok)); border-radius: var(--r-pill); }

/* Board */
.board { flex: 1; display: flex; gap: 12px; padding: 16px 24px 24px; overflow: auto; align-items: flex-start; min-height: 0; }
.column { flex: 0 0 272px; display: flex; flex-direction: column; gap: 6px; }
.column-head { position: relative; display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; color: var(--fg-2); padding: 2px 4px 4px; }
.deadline { font-variant-numeric: tabular-nums; }
.column-head .deadline { color: var(--fg-3); font-weight: 400; }
.deadline.overdue, .column-head .deadline.overdue { color: var(--bad); font-weight: 600; }
.column-head .n { color: var(--fg-3); font-weight: 400; font-variant-numeric: tabular-nums; }
.column-head .actor { margin-left: auto; }
.column-head:focus-visible { outline: none; }
.column-head .tip {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  padding: 6px 9px;
  border-radius: 6px;
  background: var(--fg);
  color: var(--bg);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.4;
  pointer-events: none;
  opacity: 0;
  z-index: 40;
  transition: opacity 60ms ease;
}
.column-head .tip b { font-weight: 600; }
.column-head:hover > .tip, .column-head:focus-visible > .tip, .column-head .actor:hover .tip { opacity: 1; transition-delay: 160ms; }
.column-head:has(.actor:hover) > .tip { opacity: 0; transition-delay: 0ms; }
.column .more { color: var(--fg-3); font-size: 12px; padding: 2px 4px; }
.column-empty { border: 1px dashed var(--line); border-radius: var(--r-card); padding: 12px; color: var(--fg-3); font-size: 12px; text-align: center; }
.bcard {
  display: block;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  padding: 9px 12px 10px;
  color: var(--fg);
  text-decoration: none;
  cursor: pointer;
}
.bcard:hover { background: var(--bg-2); text-decoration: none; }
.bcard.running { border-color: var(--info); box-shadow: inset 0 0 0 1px var(--info); }
.running-badge { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 4px; font-size: 11.5px; font-weight: 600; color: var(--info); }
.spinner { width: 10px; height: 10px; border-radius: 999px; border: 2px solid color-mix(in srgb, var(--info) 30%, transparent); border-top-color: var(--info); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; border-color: var(--info); } }
.bcard.selected { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.bcard .title { line-height: 1.35; overflow-wrap: anywhere; }
.bcard .meta { display: flex; flex-wrap: wrap; align-items: center; gap: 3px 10px; margin-top: 6px; font-size: 11.5px; color: var(--fg-3); }
.bcard .meta .mono { font-size: 11px; }
.bcard .client { font-size: 11.5px; color: var(--fg-2); margin-bottom: 2px; }

/* Kaarten: dezelfde tegels als op het bord, in een raster */
.gallery { flex: 1; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; padding: 16px 24px 48px; align-content: start; overflow: auto; min-height: 0; }
.gallery > .empty { grid-column: 1 / -1; }
.bcard .bprops { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; margin: 6px 0 0; font-size: 11.5px; }
.bcard .bprops dt { color: var(--fg-3); }
.bcard .bprops dd { margin: 0; color: var(--fg-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Kalender: maandraster op een datumeigenschap */
.calendar { flex: 1; display: flex; flex-direction: column; gap: 10px; padding: 8px 24px 48px; min-height: 0; overflow: auto; }
.cal-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.cal-month { margin: 0; font-size: 16px; font-weight: 600; min-width: 150px; }
.cal-nav { display: inline-flex; gap: 2px; }
.cal-count { margin-left: auto; }
.cal-grid { border: 1px solid var(--line); border-radius: var(--r-card); overflow: hidden; min-width: 640px; }
.cal-row { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-row + .cal-row { border-top: 1px solid var(--line); }
.cal-weekdays div { padding: 6px 8px; font-size: 12px; font-weight: 500; color: var(--fg-2); }
.cal-day { min-height: 112px; padding: 4px 6px 6px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal-day + .cal-day { border-left: 1px solid var(--line); }
.cal-day.outside { background: var(--bg-2); }
.cal-day.outside .cal-date { color: var(--fg-3); }
.cal-date { align-self: flex-end; font-size: 12px; color: var(--fg-2); font-variant-numeric: tabular-nums; padding: 1px 6px; border-radius: var(--r-pill); }
.cal-day.today .cal-date { background: var(--accent); color: var(--bg); font-weight: 600; }
.cal-card { display: flex; align-items: center; gap: 6px; padding: 3px 6px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--bg); color: var(--fg); font-size: 12px; text-decoration: none; cursor: pointer; min-width: 0; }
.cal-card:hover { background: var(--bg-2); text-decoration: none; }
.cal-card.running { border-color: var(--info); }
.cal-card.selected { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.cal-card .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-more { display: flex; flex-direction: column; gap: 3px; }
.cal-more summary { color: var(--fg-3); font-size: 12px; padding: 0 4px; cursor: pointer; list-style: none; }
.cal-more[open] summary { display: none; }

/* Tables */
table.grid { width: 100%; border-collapse: collapse; }
table.grid th {
  text-align: left;
  font-weight: 500;
  font-size: 12px;
  color: var(--fg-2);
  border-bottom: 1px solid var(--line);
  padding: 6px 8px;
  white-space: nowrap;
  position: sticky;
  top: 0;
  background: var(--bg);
}
table.grid td { border-bottom: 1px solid var(--line); padding: 6px 8px; vertical-align: top; }
table.grid tr.clickable { cursor: pointer; }
table.grid tr.clickable:hover td { background: var(--bg-2); }
table.grid td.num, table.grid th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table-wrap { padding: 0 24px 48px; }
.board > .empty { padding: 24px 0; }
/* Home: bord en recente overgangen delen de pagina, dus het bord krijgt zelf een schermhoogte */
.board-home { flex: none; height: calc(100dvh - var(--header-h) - var(--status-h)); min-height: 360px; }
.empty { color: var(--fg-3); padding: 24px 16px; text-align: center; }

/* Peek: kaart als Notion-pagina rechts, of volledig scherm */
.peek {
  position: fixed;
  top: 0;
  right: 0;
  bottom: var(--status-h);
  width: min(760px, 62vw);
  background: var(--bg);
  border-left: 1px solid var(--line);
  display: none;
  flex-direction: column;
  z-index: 20;
}
.peek.open { display: flex; }
.peek.full { width: calc(100vw - var(--activity-w)); }
.peek-head {
  height: var(--header-h);
  flex: none;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 10px;
  border-bottom: 1px solid var(--line);
  color: var(--fg-2);
}
.peek-body { flex: 1; overflow: auto; }
.peek-body .card-doc { padding: 28px 44px 64px; }
.peek.full .peek-body .card-doc { padding-left: max(44px, calc((100% - 860px) / 2)); padding-right: max(44px, calc((100% - 860px) / 2)); }
.htmx-request.peek-body { opacity: 0.6; }

/* Kaart */
.card-doc { max-width: 900px; width: 100%; padding: 28px 44px 64px; margin: 0 auto; }
.card-doc .kicker { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; color: var(--fg-3); font-size: 12px; margin-bottom: 8px; }
.title-form { margin: 0 0 16px; }
.title-edit {
  display: block;
  width: 100%;
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.25;
  color: var(--fg);
  background: transparent;
  border: none;
  border-radius: var(--r-sm);
  padding: 2px 4px;
  margin-left: -4px;
}
.title-edit:hover { background: var(--bg-2); }
.title-edit:focus { outline: none; background: var(--bg-2); }
.card-title { font-family: var(--font-display); font-size: 26px; font-weight: 700; line-height: 1.25; margin: 0 0 16px; }
.props { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 2px 12px; margin: 0 0 16px; align-items: center; }
.props dt { color: var(--fg-2); display: flex; align-items: center; gap: 6px; padding: 4px 0; }
.props dd { margin: 0; min-width: 0; overflow-wrap: anywhere; padding: 1px 0; }
.props input, .props select, .props textarea {
  border-color: transparent;
  background: transparent;
  width: 100%;
  max-width: 420px;
  padding: 3px 6px;
  margin-left: -6px;
}
.props input[type="checkbox"] { width: 14px; margin-left: 0; }
.props textarea { min-height: 32px; max-width: none; }
.props input:hover, .props select:hover, .props textarea:hover { background: var(--bg-2); }
.props input:focus, .props select:focus, .props textarea:focus { background: var(--bg); }
.callout {
  border: 1px solid var(--line);
  border-left: 3px solid var(--c, var(--warn));
  border-radius: var(--r-sm);
  padding: 8px 12px;
  margin: 0 0 16px;
  background: var(--bg-2);
}
.callout p { margin: 0; }
.moves { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 12px 0; margin: 0 0 20px; }
.moves .row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.moves textarea { min-height: 36px; margin-bottom: 8px; }
.locked { color: var(--info); display: inline-flex; gap: 6px; align-items: center; }
.body-head { display: flex; align-items: center; gap: 8px; }
.body-head .section-title { margin: 0; }
.body-view { min-height: 48px; }
.body-edit textarea { min-height: 280px; font-family: var(--mono); font-size: 13px; line-height: 1.55; tab-size: 2; }
.edit-bar { display: flex; gap: 6px; margin-top: 8px; }
/* Formuliergroep op de kaart (bijvoorbeeld de briefing): labels boven de velden, secties inklapbaar,
   twee kolommen voor korte velden zodra er ruimte is (niet in de smalle peek). */
.form-group { margin: 0 0 8px; container-type: inline-size; }
.form-group .body-head { margin: 28px 0 8px; }
.form-group .fg-body { border: 0; padding: 0; margin: 0; min-width: 0; }
.fg-section { border: 1px solid var(--line); border-radius: var(--r-sm); margin: 0 0 8px; background: var(--bg); }
.fg-section > summary {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 8px 12px;
  cursor: pointer;
  list-style: none;
  border-radius: var(--r-sm);
}
.fg-section > summary::-webkit-details-marker { display: none; }
.fg-section > summary::before { content: "\25B8"; color: var(--fg-3); font-size: 11px; transition: transform 0.15s; }
.fg-section[open] > summary::before { transform: rotate(90deg); }
.fg-section > summary:hover { background: var(--bg-2); }
.fg-title { font-weight: 600; color: var(--fg); }
.fg-count { margin-left: auto; color: var(--fg-3); font-size: 12px; font-variant-numeric: tabular-nums; }
.fg-count.complete { color: var(--ok-fg); }
.fg-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px 16px; padding: 4px 12px 14px; }
@container (min-width: 700px) {
  .fg-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fg-field.wide { grid-column: 1 / -1; }
}
.fg-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.fg-field > label { font-size: 12px; font-weight: 500; color: var(--fg-2); }
.fg-field input:not([type="checkbox"]), .fg-field select, .fg-field textarea { width: 100%; }
.fg-field textarea { min-height: 72px; resize: vertical; field-sizing: content; max-height: 60vh; }
.fg-field .field-hint { line-height: 1.4; }
.fg-field .req { color: var(--fg-3); }
.fg-field.missing input, .fg-field.missing select, .fg-field.missing textarea { border-color: color-mix(in srgb, var(--warn) 55%, var(--line)); }
.fg-field.missing .req { color: var(--warn-fg); }
.fg-check { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--fg); }
.form-group .edit-bar { align-items: center; }
.dirty-note { color: var(--warn-fg); font-size: 12px; font-weight: 500; }
.dirty-note[hidden] { display: none; }
/* Klantweergave: dezelfde groep alleen-lezen */
.fg-readonly .fg-section { padding: 0; }
.fg-readonly dl { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; margin: 0; padding: 4px 12px 14px; }
.fg-readonly dt { color: var(--fg-2); font-size: 13px; }
.fg-readonly dd { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.files { list-style: none; padding: 0; margin: 0 0 8px; }
.files li { display: flex; align-items: center; gap: 8px; padding: 4px 6px; border-radius: var(--r-sm); }
.files li:hover { background: var(--bg-2); }
.files .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--fg); }
.upload { display: flex; gap: 6px; align-items: center; }
.upload input[type="file"] { border-style: dashed; flex: 1; min-width: 0; }
.thread { margin: 0 0 12px; }
.thread .entry { padding: 10px 0; border-bottom: 1px solid var(--line); }
.thread .who { font-size: 12px; color: var(--fg-3); margin-bottom: 2px; display: flex; gap: 8px; }
.thread .who b { color: var(--fg-2); font-weight: 600; }
.comment-form textarea { min-height: 56px; }
.comment-form .row { display: flex; justify-content: flex-end; margin-top: 6px; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline > li { display: grid; grid-template-columns: 116px minmax(0, 1fr); gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.timeline .when { color: var(--fg-3); font-size: 12px; font-variant-numeric: tabular-nums; }
.timeline .what { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; min-width: 0; }
.timeline .note { flex-basis: 100%; color: var(--fg-2); white-space: pre-wrap; overflow-wrap: anywhere; }
.timeline details { flex-basis: 100%; }
.timeline summary { cursor: pointer; color: var(--fg-2); font-size: 12px; }
pre, .code {
  font-family: var(--mono);
  font-size: 12px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 10px 12px;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 420px;
  margin: 6px 0 0;
}
pre.error { border-left: 3px solid var(--bad); }

/* Markdown */
.markdown { font-size: 14px; line-height: 1.65; overflow-wrap: anywhere; }
.markdown h1 { font-size: 22px; margin: 20px 0 8px; }
.markdown h2 { font-size: 18px; margin: 20px 0 6px; }
.markdown h3 { font-size: 15px; margin: 16px 0 4px; }
.markdown p { margin: 0 0 10px; }
.markdown ul, .markdown ol { padding-left: 22px; }
.markdown code { font-family: var(--mono); font-size: 12px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 4px; padding: 0 3px; }
.markdown pre code { border: none; padding: 0; background: none; }
.markdown blockquote { margin: 0 0 10px; padding-left: 12px; border-left: 3px solid var(--line); color: var(--fg-2); }
.markdown table { border-collapse: collapse; }
.markdown th, .markdown td { border: 1px solid var(--line); padding: 4px 8px; }
.markdown hr { border: none; border-top: 1px solid var(--line); }
.markdown img { max-width: 100%; }
.markdown.is-empty { color: var(--fg-3); }

/* Formulier (nieuwe kaart, instellingen) */
.form { display: grid; gap: 14px; max-width: 640px; }
.form > button, .form > .btn { justify-self: start; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.form-actions { display: flex; gap: 8px; align-items: center; }
/* Profielformulier: vaste blokken */
.profile-form { max-width: none; gap: 8px; }
.profile-form fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.profile-form legend.section-title { padding: 0; margin: 16px 0 10px; }
.profile-form .form-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.form-stack { display: grid; gap: 12px; }
.profile-form .field { display: grid; gap: 4px; align-content: start; }
.profile-form .field > label { font-size: 12px; color: var(--fg-2); }
.profile-form .field input, .profile-form .field select, .profile-form .field textarea { width: 100%; }
.profile-form .field p { margin: 0; font-size: 11.5px; }
.profile-form > button { margin-top: 12px; }
/* Klantpagina: kop met logo, gegevens, moduletegels en komende modules */
.client-head { display: flex; align-items: center; gap: 14px; }
.client-logo { width: 48px; height: 48px; flex: none; border-radius: var(--r-btn-lg); border: 1px solid var(--line); background: var(--bg); object-fit: contain; padding: 4px; }
.client-logo--empty { display: grid; place-items: center; padding: 0; background: var(--accent-bg); color: var(--accent); font-family: var(--font-display); font-weight: 700; font-size: 20px; text-transform: uppercase; }
.client-sub { display: flex; align-items: center; gap: 10px; margin: 4px 0 0; color: var(--fg-3); }
.client-form { max-width: none; gap: 8px; }
.client-form fieldset { border: 0; padding: 0; margin: 0; min-width: 0; display: grid; gap: 12px; }
.client-form fieldset + fieldset { margin-top: 24px; }
.client-form legend.section-title { padding: 0; margin: 8px 0 10px; }
.client-form .form-grid { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.client-form .field { display: grid; gap: 4px; align-content: start; }
.client-form .field > label { font-size: 12px; color: var(--fg-2); }
.client-form .field input:not([type="checkbox"]), .client-form .field textarea { width: 100%; }
.client-form .field p { margin: 0; font-size: 11.5px; }
.client-form .fs-hint { margin: -6px 0 0; font-size: 12px; }
.client-form textarea { font-family: var(--mono); font-size: 12px; }
.client-save { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }

/* Schakelaar: verstopt vinkje met een track en knop */
.switch { position: relative; flex: none; width: 30px; height: 18px; }
.switch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.switch i { position: absolute; inset: 0; border-radius: var(--r-pill); background: var(--bg-3); border: 1px solid var(--line); transition: background .15s, border-color .15s; pointer-events: none; }
.switch i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; border-radius: 50%; background: var(--bg); box-shadow: 0 1px 2px rgba(14, 10, 49, .25); transition: transform .15s; }
.switch input:checked + i { background: var(--accent); border-color: var(--accent); }
.switch input:checked + i::after { transform: translateX(12px); background: var(--on-accent); }
.switch input:focus-visible + i { outline: 2px solid var(--accent); outline-offset: 2px; }
.switch-row { display: flex; align-items: center; gap: 16px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-card); cursor: pointer; }
.switch-row > span:first-child { flex: 1; display: grid; gap: 2px; }
.switch-row .muted { font-size: 12px; }

.module-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.module-tile { display: flex; flex-direction: column; gap: 8px; padding: 14px; border: 1px solid var(--line); border-radius: var(--r-card); background: var(--bg); cursor: pointer; transition: border-color .15s, background .15s; min-width: 0; }
.module-tile:hover { border-color: var(--fg-3); }
.module-tile:has(input:checked) { border-color: var(--accent); background: var(--accent-bg); }
.module-tile-head { display: flex; align-items: center; gap: 10px; }
.module-tile-head b { flex: 1; min-width: 0; font-size: 14px; }
.module-tile-icon { display: grid; place-items: center; width: 28px; height: 28px; flex: none; border-radius: var(--r-sm); background: var(--bg-2); color: var(--fg-2); transition: background .15s, color .15s; }
.module-tile:has(input:checked) .module-tile-icon { background: var(--accent); color: var(--on-accent); }
.module-tile-desc { color: var(--fg-2); font-size: 12.5px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.module-tile-meta { margin-top: auto; color: var(--fg-3); font-size: 11.5px; }


.checks { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.checks label { display: flex; align-items: center; gap: 6px; font-weight: normal; }

/* Status bar */
.statusbar {
  grid-area: status;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 12px;
  font-size: 12px;
  color: var(--fg-2);
  background: var(--bg-2);
  border-top: 1px solid var(--line);
  white-space: nowrap;
  overflow: hidden;
}
.statusbar a, .statusbar button.item { color: var(--fg-2); }
.statusbar .item { display: inline-flex; align-items: center; gap: 5px; }
.statusbar .item .i { width: 13px; height: 13px; }
.statusbar a.item:hover, .statusbar button.item:hover { color: var(--fg); text-decoration: none; background: none; }
.statusbar button.item { border: 0; background: none; padding: 0; font: inherit; font-size: inherit; border-radius: 0; }
.statusbar .tone-ok .i, .statusbar .tone-ok .dot { color: var(--ok); }

/* Command palette */
.palette-backdrop { position: fixed; inset: 0; background: var(--backdrop); display: none; z-index: 50; }
.palette-backdrop.open { display: block; }
.palette {
  width: min(600px, 92vw);
  margin: 12vh auto 0;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  overflow: hidden;
  box-shadow: var(--shadow-float);
}
.palette input { width: 100%; border: none; border-bottom: 1px solid var(--line); border-radius: 0; padding: 14px 16px; font-size: 15px; outline: none; background: var(--bg); }
.palette input:focus { outline: none; border-color: var(--line); }
.palette ul { list-style: none; margin: 0; padding: 6px; max-height: 52vh; overflow: auto; }
.palette li { display: flex; gap: 10px; align-items: center; padding: 7px 10px; border-radius: var(--r-sm); cursor: pointer; }
.palette li.active { background: var(--accent-bg); }
.palette li .kind { color: var(--fg-3); font-size: 11.5px; width: 56px; flex: none; }
.palette li .label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.palette li .hint { color: var(--fg-3); margin-left: auto; font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 45%; }
.palette-foot { display: flex; gap: 14px; padding: 8px 14px; border-top: 1px solid var(--line); color: var(--fg-3); font-size: 11.5px; }

/* Dialog */
dialog { border: 1px solid var(--line); border-radius: var(--r-card); background: var(--bg); color: var(--fg); padding: 20px; width: min(460px, 92vw); box-shadow: var(--shadow-float); }
dialog.viewer { width: min(920px, 94vw); max-height: 88vh; padding: 0; display: none; flex-direction: column; overflow: hidden; }
dialog.viewer[open] { display: flex; }
.viewer-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px 10px 16px; border-bottom: 1px solid var(--line); }
.viewer-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.viewer-modes { display: inline-flex; gap: 2px; }
.viewer-modes .active { background: var(--bg-3); color: var(--fg); }
.viewer-body { overflow: auto; padding: 16px 20px 20px; }
.viewer-source { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font-family: var(--mono); font-size: 12.5px; line-height: 1.55; }
.viewer-image { display: block; max-width: 100%; height: auto; margin: 0 auto; border-radius: var(--r-sm); }
.viewer-edit textarea { width: 100%; min-height: 55vh; font-family: var(--mono); font-size: 13px; line-height: 1.55; tab-size: 2; }
.viewer-page { border: 1px solid var(--line); border-radius: var(--r-card); }
dialog::backdrop { background: var(--backdrop); }
dialog h3 { margin: 0 0 12px; font-size: 16px; }
dialog .dialog-actions { display: flex; gap: 6px; justify-content: flex-end; margin-top: 16px; }

/* Toast */
.toasts { position: fixed; right: 16px; bottom: calc(var(--status-h) + 12px); display: flex; flex-direction: column; gap: 6px; z-index: 60; }
.toast {
  background: var(--fg);
  color: var(--bg);
  padding: 9px 14px;
  border-radius: var(--r-btn);
  font-size: 13px;
  max-width: 440px;
  box-shadow: var(--shadow-float);
  display: flex;
  gap: 8px;
  align-items: flex-start;
}
.toast.error { background: var(--bad); color: var(--on-status); }
.toast .i { margin-top: 1px; }

/* Klantweergave: knop op de klantpagina en balk bovenin het klantscherm */
.user-menu { position: relative; }
.user-menu > summary { list-style: none; cursor: pointer; }
.user-menu > summary::-webkit-details-marker { display: none; }
.user-menu > summary:hover { color: var(--fg); }
.user-menu-panel {
  /* fixed: de statusbalk knipt overflow af */
  position: fixed;
  bottom: calc(var(--status-h) + 6px);
  left: 8px;
  z-index: 40;
  min-width: 240px;
  max-height: min(480px, 70vh);
  overflow: auto;
  padding: 4px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-float);
  font-size: 13px;
}
.user-menu-head { padding: 6px 8px 4px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--fg-3); }
.user-menu-panel form { display: grid; }
.user-menu-panel button { display: flex; justify-content: space-between; gap: 12px; text-align: left; padding: 5px 8px; border: 0; border-radius: var(--r-sm); background: none; color: var(--fg); font: inherit; }
.user-menu-panel button.sub { padding-left: 20px; color: var(--fg-2); }
.user-menu-panel button:hover { background: var(--bg-2); }
.user-menu-panel p { margin: 0; padding: 6px 8px; }
.view-as-bar {
  display: flex;
  align-items: center;
  gap: var(--s-16);
  padding: var(--s-8) var(--s-40);
  background: var(--warn);
  color: #1a1a1a;
  font-size: 14px;
}
.view-as-bar form { margin-left: auto; }

/* ---------- Focus (klant en profiel, ruim) ---------- */
body.focus { font-size: var(--text-focus); line-height: 1.6; background: var(--bg); min-height: 100%; }
.focus-top {
  display: flex;
  align-items: center;
  gap: var(--s-16);
  padding: var(--s-20) var(--s-40);
  border-bottom: 1px solid var(--line);
}
.focus-top .wordmark { font-size: 18px; }
.focus-top .wordmark--client img { height: 28px; width: auto; max-width: 180px; object-fit: contain; }
.focus-top .client { display: inline-flex; align-items: center; gap: var(--s-12); color: var(--fg-2); }
.focus-top .client img { height: 24px; max-width: 120px; object-fit: contain; }
.focus-top .client::before { content: ""; width: 1px; height: 20px; background: var(--line); }
.focus-top nav { margin-left: auto; display: flex; align-items: center; gap: var(--s-8); }
.focus-top nav a, .focus-top nav button { color: var(--fg-2); font-size: 14px; }
.focus-tabs { display: flex; gap: 2px; }
.focus-tab { padding: 6px 12px; border-radius: var(--r-sm); font-weight: 500; }
.focus-tab:hover { background: var(--bg-2); color: var(--fg); text-decoration: none; }
.focus-top nav .focus-tab.active, .focus-top nav .btn-ghost.active { color: var(--fg); background: var(--accent-bg); }
.focus-nav-sep { width: 1px; height: 20px; background: var(--line); margin: 0 var(--s-4, 4px); }
.f-chips { margin: var(--s-24) 0 0; }
.f-chips .pill { margin-left: 4px; }
.f-module--soon { opacity: .6; cursor: default; }
.f-module--soon:hover { background: none; }
.focus-main { padding: var(--s-48) var(--s-40) var(--s-96); }
.focus-wrap { max-width: 760px; margin: 0 auto; }
.focus-wrap.narrow { max-width: 480px; }
body.focus .page-title { font-size: 34px; margin-bottom: var(--s-8); }
.focus-lead { color: var(--fg-2); font-size: 18px; margin: 0 0 var(--s-40); }
body.focus .section-title { font-size: 12px; margin: var(--s-48) 0 var(--s-16); }
body.focus button, body.focus .btn, body.focus input, body.focus select, body.focus textarea { font-size: 15px; }
body.focus button, body.focus .btn { padding: 10px 18px; border-radius: var(--r-btn-lg); }
body.focus input, body.focus select, body.focus textarea { padding: 10px 14px; border-radius: var(--r-sm); }
body.focus label.field { font-size: 14px; gap: 6px; }
.btn-lg { padding: 14px 24px !important; font-size: 16px !important; font-weight: 500; }
.f-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-12); }
.f-item {
  display: flex;
  align-items: center;
  gap: var(--s-16);
  padding: var(--s-20) var(--s-24);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  color: var(--fg);
  text-decoration: none;
}
.f-item:hover { background: var(--bg-2); text-decoration: none; }
.f-item .t { flex: 1; min-width: 0; }
.f-item .t b { display: block; font-weight: 600; overflow-wrap: anywhere; }
.f-item .t span { color: var(--fg-2); font-size: 14px; }
.f-item .i { color: var(--fg-3); }
.f-modules { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: var(--s-12); }
.f-module {
  display: grid;
  gap: var(--s-8);
  padding: var(--s-20) var(--s-24);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  color: var(--fg);
  text-decoration: none;
}
.f-module:hover { background: var(--bg-2); text-decoration: none; }
.f-module.active { border-color: var(--accent); background: var(--accent-bg); }
.f-module b { font-size: 17px; font-weight: 600; }
.f-module-counts { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-8) var(--s-12); color: var(--fg-2); font-size: 14px; }
.f-note { color: var(--fg-2); font-size: 15px; margin-top: var(--s-24); display: flex; align-items: center; gap: 8px; }
.f-card .props { grid-template-columns: 180px minmax(0, 1fr); gap: var(--s-8) var(--s-16); font-size: 15px; }
.f-card .props dt { padding: 0; }
.f-preview { border: 1px solid var(--line); border-radius: var(--r-card); padding: var(--s-32); margin: 0 0 var(--s-24); }
.f-preview .markdown { font-size: 16px; line-height: 1.7; }
.f-actions { display: grid; gap: var(--s-12); padding: var(--s-24); border-radius: var(--r-card); background: var(--bg-2); margin: var(--s-32) 0; }
.f-actions .row { display: flex; flex-wrap: wrap; gap: var(--s-12); align-items: center; }
.f-actions textarea { min-height: 80px; background: var(--bg); }
.f-results { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: var(--s-16); }
.f-results .stat { font-size: 32px; }
.f-card .thread .who { font-size: 13px; }
.f-card .markdown { font-size: 16px; }
.f-card details.edit summary { cursor: pointer; color: var(--accent); font-size: 15px; margin-bottom: var(--s-12); }
.f-card details.edit textarea { min-height: 260px; font-family: var(--font); font-size: 16px; line-height: 1.6; }

/* Gradient en glas: alleen login en de lege klantomgeving */
body.focus.focus--glass { background: var(--gradient); background-attachment: fixed; color: var(--on-gradient); }
body.focus.focus--glass .focus-top { border-bottom-color: transparent; }
body.focus.focus--glass .wordmark, body.focus.focus--glass .focus-top nav a { color: var(--on-gradient); }
body.focus.focus--glass .focus-lead, body.focus.focus--glass .muted { color: var(--on-gradient-2); }
.glass-panel {
  background: var(--glass);
  -webkit-backdrop-filter: blur(var(--glass-blur));
  backdrop-filter: blur(var(--glass-blur));
  border: none;
  border-radius: var(--r-card);
  padding: var(--s-48);
  color: var(--on-gradient);
}
.glass-panel input, .glass-panel select, .glass-panel textarea { background: var(--bg); color: var(--fg); }
.focus-empty { background: var(--gradient); border-radius: var(--r-card); padding: var(--s-16); }
.focus-empty .glass-panel { text-align: center; padding: var(--s-64) var(--s-40); }
.focus-empty .glass-panel .page-title { color: var(--on-gradient); }
.focus-empty .glass-panel p { color: var(--on-gradient-2); max-width: 420px; margin: var(--s-12) auto var(--s-32); }
.focus .toasts { bottom: var(--s-24); }

/* Login: merkvlak links, formulier rechts */
body.focus--auth .focus-top { display: none; }
body.focus--auth .focus-main { padding: 0; }
.auth { display: grid; grid-template-columns: minmax(360px, 5fr) 7fr; min-height: 100vh; }
.auth-brand {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: var(--s-40);
  padding: var(--s-40) var(--s-48);
  background: radial-gradient(90% 70% at 100% 0%, rgba(1, 111, 231, 0.85) 0%, rgba(1, 111, 231, 0) 60%),
              radial-gradient(80% 60% at 0% 100%, rgba(1, 111, 231, 0.35) 0%, rgba(1, 111, 231, 0) 60%),
              linear-gradient(170deg, #130F36 0%, #0E0A31 100%);
  color: var(--on-gradient);
  border-right: 1px solid var(--line);
  overflow: hidden;
}
.auth-brand .wordmark { color: var(--on-gradient); font-size: 20px; }
.auth-brand .wordmark img { height: 22px; }
.auth-kicker { margin: 0 0 var(--s-12); font-size: 13px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--on-gradient-2); }
.auth-statement { margin: 0; max-width: 440px; font-size: 40px; line-height: 1.12; letter-spacing: -0.025em; font-weight: 600; text-wrap: balance; }
.auth-brand-foot { margin: 0; font-size: 13px; color: var(--on-gradient-2); }
.auth-main { display: grid; place-items: center; padding: var(--s-48) var(--s-24); background: var(--bg); color: var(--fg); }
.auth-box { width: 100%; max-width: 400px; }
.auth-title { margin: 0; font-size: 30px; line-height: 1.2; letter-spacing: -0.02em; font-weight: 600; }
.auth-lead { margin: var(--s-8) 0 var(--s-32); color: var(--fg-2); font-size: 15px; }
.auth-form { display: grid; gap: var(--s-20); }
.auth-field { display: grid; gap: 6px; }
.auth-field label { font-size: 14px; font-weight: 500; color: var(--fg); }
body.focus .auth-field input { width: 100%; height: 46px; padding: 0 14px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-btn); transition: border-color 120ms, box-shadow 120ms; }
body.focus .auth-field input:hover { border-color: var(--fg-3); }
body.focus .auth-field input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-bg); }
body.focus .auth-field:has(.auth-field-error) input { border-color: var(--bad); }
body.focus .auth-field input[autocomplete="one-time-code"] { font-family: var(--mono); font-size: 20px; letter-spacing: 0.24em; height: 52px; }
.auth-password { position: relative; }
body.focus .auth-password input { padding-right: 76px; }
body.focus .auth-reveal { position: absolute; top: 50%; right: 6px; transform: translateY(-50%); padding: 5px 10px; font-size: 13px; font-weight: 500; border: none; background: none; color: var(--fg-2); border-radius: var(--r-sm); }
body.focus .auth-reveal:hover { background: var(--bg-2); color: var(--fg); }
.auth-field-error { margin: 0; font-size: 13px; color: var(--bad); }
.auth-error { display: flex; gap: var(--s-8); align-items: flex-start; margin: 0; padding: var(--s-12) var(--s-16); border-radius: var(--r-btn); font-size: 14px; line-height: 1.45; color: var(--fg); background: color-mix(in srgb, var(--bad) 10%, transparent); border: 1px solid color-mix(in srgb, var(--bad) 35%, transparent); }
.auth-error svg { flex: none; margin-top: 2px; color: var(--bad); }
body.focus .auth-submit { width: 100%; height: 46px; justify-content: center; padding: 0 18px; font-size: 15px; font-weight: 600; margin-top: var(--s-4); }
.auth-note { margin: var(--s-32) 0 0; padding-top: var(--s-20); border-top: 1px solid var(--line); color: var(--fg-2); font-size: 14px; }
.auth-step, .auth-status { margin: 0 0 var(--s-12); font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }
.auth-status { display: inline-flex; align-items: center; gap: 6px; color: var(--ok-fg); }
.auth-status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.auth-lead strong { color: var(--fg); font-weight: 600; }
.auth-hint { margin: -8px 0 0; font-size: 13px; color: var(--fg-2); }
.auth-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-12); }
body.focus .auth-secondary { width: 100%; height: 46px; justify-content: center; font-size: 15px; font-weight: 500; }
a.auth-submit, a.auth-secondary { text-decoration: none; }
a.auth-submit:hover, a.auth-submit:visited { text-decoration: none; color: var(--on-accent); }
.auth-alt { margin: var(--s-24) 0 0; font-size: 14px; color: var(--fg-2); }
body.focus .auth-link { display: inline; padding: 0; border: none; background: none; font-size: 14px; color: var(--accent); }
body.focus .auth-link:hover { background: none; text-decoration: underline; }
.auth-note--plain { border-top: none; padding-top: 0; margin: 0 0 var(--s-24); }
.auth-error--block { margin-bottom: var(--s-20); }
body.focus .auth-google { gap: 10px; }
.auth-divider { display: flex; align-items: center; gap: var(--s-12); margin: var(--s-20) 0; font-size: 13px; color: var(--fg-3); }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.auth-steps { margin: 0 0 var(--s-24); padding: 0; list-style: none; counter-reset: step; display: grid; gap: var(--s-12); font-size: 14px; line-height: 1.5; color: var(--fg-2); }
.auth-steps li { counter-increment: step; display: grid; grid-template-columns: 24px 1fr; gap: var(--s-12); }
.auth-steps li::before { content: counter(step); width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 600; color: var(--accent); background: var(--accent-bg); }
.auth-qr { display: flex; align-items: center; gap: var(--s-20); padding: var(--s-16); margin: 0 0 var(--s-24); border: 1px solid var(--line); border-radius: var(--r-card); }
.auth-qr .qr { flex: none; width: 132px; height: 132px; padding: 6px; background: #FFFFFF; border-radius: var(--r-sm); }
.auth-qr .qr svg { display: block; width: 100%; height: 100%; }
.auth-secret { display: grid; gap: 4px; min-width: 0; }
.auth-secret span { font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--fg-2); }
.auth-secret code { font-family: var(--mono); font-size: 13px; line-height: 1.6; color: var(--fg); overflow-wrap: anywhere; user-select: all; }
.auth-warning { margin: 0 0 var(--s-16); padding: var(--s-12) var(--s-16); border-radius: var(--r-btn); font-size: 14px; font-weight: 500; background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--warn-fg); }
.auth-codes { list-style: none; margin: 0 0 var(--s-24); padding: var(--s-16); display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-8) var(--s-16); border: 1px solid var(--line); border-radius: var(--r-card); background: var(--bg-2); }
.auth-codes code { font-family: var(--mono); font-size: 14px; letter-spacing: 0.04em; color: var(--fg); }
@media (max-width: 860px) {
  .auth { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .auth-brand { padding: var(--s-20) var(--s-16) var(--s-32); gap: var(--s-24); }
  .auth-statement { font-size: 26px; }
  .auth-brand-foot { display: none; }
  .auth-row { grid-template-columns: 1fr; }
  .auth-main { place-items: start center; padding: var(--s-32) var(--s-16) var(--s-48); }
}

@media (max-width: 760px) {
  body.shell { --sidebar-w: 0px; }
  body.shell .sidebar { display: none; }
  body.shell.sidebar-open { --sidebar-w: min(248px, calc(100vw - 88px)); }
  body.shell.sidebar-open .sidebar { display: block; }
  .peek, .peek.full { width: calc(100vw - var(--activity-w)); }
  .peek-body .card-doc, .card-doc, .doc { padding: 20px 16px 48px; }
  .page-head, .toolbar, .table-wrap, .metrics, .gallery, .calendar { padding-left: 16px; padding-right: 16px; }
  .props, .f-card .props { grid-template-columns: 1fr; }
  .focus-top { padding: var(--s-12) var(--s-16); flex-wrap: wrap; gap: var(--s-8); }
  .focus-top nav { gap: 2px; }
  .focus-top nav .btn-ghost span, .focus-top nav button span { display: none; }
  .focus-tab { padding: 6px 8px; }
  .view-as-bar { padding: var(--s-8) var(--s-16); }
  .focus-main { padding: var(--s-24) var(--s-16) var(--s-64); }
  .glass-panel { padding: var(--s-24); }
  .palette-btn span { display: none; }
}

/* Documenten met versies: klantprofiel en instructies (templates/docs/) */
.docs {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr) 200px;
  gap: 0 40px;
  align-items: start;
  padding: 0 24px 64px;
  max-width: 1440px;
  width: 100%;
}
.docs:not(:has(.docs-toc)) { grid-template-columns: 248px minmax(0, 1fr); }
.docs-nav, .docs-toc { position: sticky; top: 0; max-height: calc(100vh - var(--header-h) - var(--status-h)); overflow: auto; padding: 24px 0 32px; }
.docs-intro { padding: 0 8px 8px; }
.docs-intro p { color: var(--fg-2); font-size: 12.5px; line-height: 1.5; margin: 8px 0 0; }
.docs-nav h4, .docs-toc h4 {
  font-size: 11px; font-weight: 500; color: var(--fg-3); text-transform: uppercase; letter-spacing: 0.04em;
  margin: 20px 8px 4px;
}
.docs-nav ul, .docs-toc ul { list-style: none; margin: 0; padding: 0; }
.docs-nav li a {
  display: flex; align-items: center; gap: 8px; padding: 5px 8px; border-radius: var(--r-sm);
  color: var(--fg-2);
}
.docs-nav li a .i { color: var(--fg-3); }
.docs-nav li a:hover { background: var(--bg-2); color: var(--fg); text-decoration: none; }
.docs-nav li a.active { background: var(--accent-bg); color: var(--fg); font-weight: 500; }
.docs-nav li a.active .i { color: var(--accent); }
.docs-nav .label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.docs-nav .meta { color: var(--fg-3); font-size: 11px; font-variant-numeric: tabular-nums; font-weight: 400; }
.docs-none { padding: 4px 8px; }
.docs-add { margin: 12px 0 0; width: 100%; justify-content: flex-start; gap: 8px; color: var(--fg-2); }

.docs-main { min-width: 0; padding: 32px 0 0; }
.docs-head { margin: 0 0 24px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.docs-head .kicker { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; color: var(--fg-3); font-size: 12px; margin-bottom: 8px; }
.docs-head .kicker a { color: var(--fg-2); }
.docs-title-row { display: flex; align-items: flex-start; gap: 16px; }
.docs-title { font-family: var(--font-display); font-size: 28px; font-weight: 700; line-height: 1.2; margin: 0; flex: 1; min-width: 0; overflow-wrap: anywhere; }
.docs-edit-btn { flex: none; display: inline-flex; gap: 6px; align-items: center; margin-top: 4px; }
.docs-desc { color: var(--fg-2); font-size: 14px; line-height: 1.55; margin: 10px 0 0; max-width: 68ch; }
.docs-note, .docs-usage { display: flex; gap: 6px; align-items: flex-start; color: var(--fg-2); font-size: 12.5px; margin: 10px 0 0; }
.docs-note .i, .docs-usage .i { margin-top: 2px; color: var(--fg-3); }
.docs-usage.tone-warn, .docs-usage.tone-warn .i { color: var(--warn-fg); }
.docs-usage code { font-family: var(--mono); font-size: 11.5px; }

.docs-body { font-size: 15px; line-height: 1.7; max-width: 72ch; }
.docs-body h1 { font-size: 22px; margin: 32px 0 10px; }
.docs-body h2 { font-size: 19px; margin: 36px 0 10px; padding-top: 4px; }
.docs-body h3 { font-size: 16px; margin: 24px 0 6px; }
.docs-body > :first-child { margin-top: 0; }
.docs-body li { margin: 2px 0; }
.docs-body table { width: 100%; font-size: 13.5px; margin: 0 0 14px; }
.docs-body th { background: var(--bg-2); text-align: left; font-weight: 600; }
.docs-body pre { font-size: 12.5px; }
.markdown [id^="h-"] { scroll-margin-top: 16px; }
.docs-empty { border: 1px dashed var(--line); border-radius: var(--r-card); padding: 32px; text-align: center; color: var(--fg-2); }
.docs-empty p { margin: 0 0 12px; }
.docs-empty button { display: inline-flex; gap: 6px; align-items: center; }
.docs-empty--page { margin-top: 24px; }

.docs-toc { padding-top: 40px; }
.docs-toc h4 { margin-top: 0; }
.docs-toc li a { display: block; padding: 3px 8px; border-left: 2px solid var(--line); color: var(--fg-2); font-size: 12.5px; line-height: 1.4; }
.docs-toc li.lvl-3 a { padding-left: 20px; font-size: 12px; color: var(--fg-3); }
.docs-toc li a:hover { color: var(--fg); border-left-color: var(--fg-3); text-decoration: none; }
.docs-toc li a.active { color: var(--accent); border-left-color: var(--accent); }

/* Editor */
.docs-editor { display: flex; flex-direction: column; gap: 10px; }
.editor-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.editor-bar .tabs a { cursor: pointer; }
.editor-hint kbd { font-size: 10.5px; }
.editor-panes { display: grid; gap: 16px; }
.editor-panes textarea {
  min-height: 60vh; font-family: var(--mono); font-size: 13px; line-height: 1.6; tab-size: 2;
  padding: 16px 18px; border-radius: var(--r-card); resize: vertical; background: var(--bg);
}
.editor-preview {
  display: none; min-height: 60vh; border: 1px solid var(--line); border-radius: var(--r-card);
  padding: 20px 24px; font-size: 15px; line-height: 1.7; overflow: auto; background: var(--bg);
}
.editor-panes[data-mode="preview"] textarea { display: none; }
.editor-panes[data-mode="preview"] .editor-preview { display: block; }
.editor-panes[data-mode="split"] { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.editor-panes[data-mode="split"] .editor-preview { display: block; max-height: 75vh; position: sticky; top: 12px; }
.editor-panes[data-mode="split"] textarea { min-height: 75vh; }
.editor-foot {
  display: flex; gap: 8px; align-items: center; position: sticky; bottom: 0; z-index: 2;
  padding: 12px 0; background: var(--bg); border-top: 1px solid var(--line);
}
.editor-foot input { flex: 1; min-width: 0; }
.editor-foot button { display: inline-flex; gap: 6px; align-items: center; white-space: nowrap; }
.docs.is-editing { grid-template-columns: 248px minmax(0, 1fr); }
.docs.is-editing .docs-toc { display: none; }

/* Geschiedenis en verschil */
.docs-history-head { margin: 0 0 20px; }
.docs-history-head p { margin: 8px 0 0; }
.versions { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--r-card); overflow: hidden; }
.versions li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 10px 14px; border-top: 1px solid var(--line); }
.versions li:first-child { border-top: none; }
.versions li:hover { background: var(--bg-2); }
.versions li.is-current { background: color-mix(in srgb, var(--ok) 5%, transparent); }
.versions .pick { display: flex; gap: 6px; }
.versions .pick input { accent-color: var(--accent); margin: 0; }
.versions .line { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
.versions .note { color: var(--fg-2); margin-top: 2px; overflow-wrap: anywhere; }
.versions .act { display: flex; gap: 4px; }
.versions-submit { display: flex; gap: 12px; align-items: center; margin-top: 12px; }
.diff-stats { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; color: var(--fg-3); }
.diff-add-n { color: var(--ok-fg); font-weight: 600; font-variant-numeric: tabular-nums; }
.diff-del-n { color: var(--bad); font-weight: 600; font-variant-numeric: tabular-nums; }
.diff { font-family: var(--mono); font-size: 12.5px; line-height: 1.6; border: 1px solid var(--line); border-radius: var(--r-card); overflow: auto; padding: 8px 0; }
.diff > div { padding: 0 16px 0 36px; position: relative; white-space: pre-wrap; overflow-wrap: anywhere; min-height: 1.6em; }
.diff .sign { position: absolute; left: 14px; color: var(--fg-3); user-select: none; }
.diff-add { background: color-mix(in srgb, var(--ok) 13%, transparent); }
.diff-add .sign { color: var(--ok-fg); }
.diff-del { background: color-mix(in srgb, var(--bad) 11%, transparent); }
.diff-del .sign { color: var(--bad); }
.diff-ctx { color: var(--fg-2); }
.diff-hunk { color: var(--fg-3); background: var(--bg-2); margin: 6px 0; text-align: center; padding: 0 16px !important; }

@media (max-width: 1180px) {
  .docs, .docs:not(:has(.docs-toc)) { grid-template-columns: 220px minmax(0, 1fr); }
  .docs-toc { display: none; }
  .wide-only { display: none !important; }
}
@media (max-width: 760px) {
  .docs, .docs:not(:has(.docs-toc)), .docs.is-editing { grid-template-columns: minmax(0, 1fr); padding: 0 16px 48px; }
  .docs-nav { position: static; max-height: none; padding-bottom: 0; }
  .docs-nav ul { display: flex; flex-wrap: wrap; gap: 4px; }
  .docs-nav li a { border: 1px solid var(--line); border-radius: var(--r-pill); padding: 3px 10px; }
  .docs-nav li a .i, .docs-nav .meta { display: none; }
  .docs-title { font-size: 22px; }
  .editor-foot { flex-wrap: wrap; }
  .editor-foot input { flex-basis: 100%; }
  .versions li { grid-template-columns: auto minmax(0, 1fr); }
  .versions .act { grid-column: 2; }
}

/* Klantomgeving (ruime layout) */
body.focus .docs { padding: 0; margin: 0 auto; }
body.focus .focus-main:has(.docs) { padding-top: var(--s-16); }

/* Privé to-do lijst */
.todo-add { display: flex; gap: 8px; margin: 0 0 8px; }
.todo-add input[type="text"] { flex: 1; min-width: 0; }
.todo-add button { display: inline-flex; gap: 6px; align-items: center; }
.todo-items { list-style: none; margin: 0; padding: 0; }
.todo-item { display: flex; align-items: center; gap: 10px; padding: 4px 0; border-bottom: 1px solid var(--line); }
.todo-item > form { display: contents; }
.todo-fields { display: contents; }
.todo-item .todo-title { flex: 1; min-width: 0; border-color: transparent; background: none; }
.todo-item .todo-title:hover { border-color: var(--line); }
.todo-item .todo-due { width: 140px; border-color: transparent; background: none; color: var(--fg-2); }
.todo-item .todo-due:hover { border-color: var(--line); }
.todo-item.overdue .todo-due { color: var(--bad); }
.todo-item.done .todo-title { color: var(--fg-3); text-decoration: line-through; }
.todo-done summary { cursor: pointer; list-style: none; }
.todo-done > form { margin-top: 8px; }
@media (max-width: 560px) {
  .todo-add { flex-wrap: wrap; }
  .todo-item .todo-due { width: 118px; }
}
