:root {
  /* Huisstijl Coretic (coretic.nl): navy met oranje accent */
  --paper: #F3F5F9;
  --surface: #FFFFFF;
  --ink: #001D45;
  --muted: #4A5872;
  --line: #CDD5E1;
  --line-soft: #E3E8EF;
  --accent: #001D45;
  --accent-soft: #E6ECF5;
  --on-accent: #FFFFFF;
  --brand: #FF8D00;
  --brand-ink: #B35F00;
  --brand-soft: #FFE6C7;
  --draft: #8A97A8;
  --submitted: #A86A00;
  --approved: #2F7D4F;
  --rejected: #B3412E;
  --invoiced: #5B4FA0;
  --focus: #FF8D00;
  --radius-s: 6px;
  --radius-m: 10px;
  --font: 'Schibsted Grotesk', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #00122B;
    --surface: #0A2347;
    --ink: #E8EEF7;
    --muted: #9AAAC2;
    --line: #1F3B63;
    --line-soft: #16304F;
    --accent: #FFA53D;
    --accent-soft: #13325C;
    --on-accent: #00122B;
    --brand: #FF8D00;
    --brand-ink: #FFA53D;
    --brand-soft: #3A2A12;
    --draft: #7F8EA3;
    --submitted: #E6B34D;
    --approved: #5CB07F;
    --rejected: #E07563;
    --invoiced: #A79CEB;
    --focus: #FF8D00;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--paper);
  font-variant-numeric: tabular-nums;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
a { color: var(--accent); }
h1, h2, h3 { line-height: 1.2; margin: 0; }
h1 { font-size: 1.6rem; font-weight: 600; letter-spacing: -0.01em; }
h2 { font-size: 1.15rem; font-weight: 600; }
h3 { font-size: 1rem; font-weight: 600; }
p { margin: 0 0 0.75rem; max-width: 70ch; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* ---------- Shell ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: calc(0.6rem + env(safe-area-inset-top, 0px)) 1.25rem 0.6rem;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.brand { font-weight: 700; font-size: 1.05rem; color: var(--ink); text-decoration: none; white-space: nowrap; }
.nav { display: flex; gap: 0.25rem; flex: 1; overflow-x: auto; }
.nav a {
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-s);
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
  white-space: nowrap;
}
.nav a:hover { color: var(--ink); background: var(--line-soft); }
.nav a[aria-current="page"] { color: var(--accent); background: var(--accent-soft); }
.nav .badge { margin-left: 0.35rem; }
.userbox { display: flex; align-items: center; gap: 0.75rem; white-space: nowrap; color: var(--muted); }
.userbox a { color: var(--muted); }
main { max-width: 1240px; margin: 0 auto; padding: 1.5rem 1.25rem 4rem; }


/* ---------- Basiscomponenten ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  font: inherit; font-weight: 500;
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-s);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--rejected); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.small { padding: 0.2rem 0.55rem; font-size: 0.875rem; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); }
.panel-pad { padding: 1.25rem; }
.stack > * + * { margin-top: 1rem; }
.row { display: flex; gap: 0.75rem; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }

label.field { display: grid; gap: 0.25rem; font-weight: 500; font-size: 0.9rem; }
label.field .hint { font-weight: 400; color: var(--muted); }
input, select, textarea {
  font: inherit;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  padding: 0.45rem 0.6rem;
  min-width: 0;
}
textarea { resize: vertical; min-height: 5rem; }
input[type="checkbox"] { width: 1.05rem; height: 1.05rem; accent-color: var(--accent); }
.check { display: flex; gap: 0.5rem; align-items: center; font-weight: 500; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0.9rem 1rem; }

.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; }
table.data th, table.data td { padding: 0.55rem 0.75rem; border-bottom: 1px solid var(--line-soft); text-align: left; vertical-align: top; }
table.data th { font-size: 0.85rem; font-weight: 600; color: var(--muted); background: var(--surface); }
table.data td.num, table.data th.num { text-align: right; white-space: nowrap; }
table.data tr:last-child td { border-bottom: 0; }
table.data tfoot td { font-weight: 600; border-top: 1px solid var(--line); }

.badge {
  display: inline-block;
  padding: 0.05rem 0.5rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  background: var(--line-soft);
  color: var(--muted);
}
.badge.submitted { background: color-mix(in srgb, var(--submitted) 16%, transparent); color: var(--submitted); }
.badge.approved { background: color-mix(in srgb, var(--approved) 16%, transparent); color: var(--approved); }
.badge.rejected { background: color-mix(in srgb, var(--rejected) 16%, transparent); color: var(--rejected); }
.badge.invoiced { background: color-mix(in srgb, var(--invoiced) 16%, transparent); color: var(--invoiced); }
.badge.count { background: var(--submitted); color: #fff; }

.notice {
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-s);
}
.notice.warn { border-color: var(--submitted); background: color-mix(in srgb, var(--submitted) 12%, var(--surface)); }
.notice.error { border-color: var(--rejected); background: color-mix(in srgb, var(--rejected) 12%, var(--surface)); }

.tabs { display: flex; gap: 0.25rem; border-bottom: 1px solid var(--line); margin-bottom: 1.25rem; overflow-x: auto; }
.tabs button {
  font: inherit; font-weight: 500;
  padding: 0.55rem 0.9rem;
  border: 0; border-bottom: 2px solid transparent;
  background: none; color: var(--muted); cursor: pointer; white-space: nowrap;
}
.tabs button[aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); }

.bar { position: relative; height: 6px; border-radius: 3px; background: var(--line-soft); overflow: hidden; min-width: 80px; }
.bar > span { position: absolute; inset: 0 auto 0 0; background: var(--accent); border-radius: 3px; }
.bar.over > span { background: var(--rejected); }

.empty { text-align: center; padding: 3rem 1rem; color: var(--muted); }
.empty h2 { color: var(--ink); margin-bottom: 0.5rem; }

/* ---------- Urenstaat: het hart van de app ---------- */

.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.week-nav { display: flex; align-items: center; gap: 0.5rem; }
.week-nav h1 { min-width: 6.5ch; text-align: center; }
.week-nav .range { color: var(--muted); }
.week-total { display: flex; align-items: baseline; gap: 0.4rem; }
.week-total strong { font-size: 1.6rem; font-weight: 600; }

.grid-wrap { overflow-x: auto; border-radius: var(--radius-m); border: 1px solid var(--line); background: var(--surface); }
table.grid { width: 100%; min-width: 760px; border-collapse: separate; border-spacing: 0; }
table.grid th, table.grid td { border-bottom: 1px solid var(--line-soft); padding: 0; }
table.grid thead th {
  padding: 0.6rem 0.25rem 0.5rem;
  font-weight: 500;
  font-size: 0.85rem;
  color: var(--muted);
  text-align: center;
  border-bottom: 1px solid var(--line);
}
table.grid thead th .dnum { display: block; font-size: 1.15rem; color: var(--ink); font-weight: 600; }
table.grid thead th.today { box-shadow: inset 0 3px 0 var(--accent); }
table.grid thead th.today .dnum { color: var(--accent); }
table.grid th.weekend, table.grid td.weekend { background: color-mix(in srgb, var(--paper) 55%, var(--surface)); }
table.grid .proj { text-align: left; padding: 0.6rem 0.9rem; min-width: 210px; max-width: 280px; }
table.grid .proj .client { display: block; font-size: 0.8rem; color: var(--muted); font-weight: 400; }
table.grid .proj .name { font-weight: 600; }
table.grid .proj .tag { display: block; font-size: 0.75rem; color: var(--muted); font-weight: 400; }
table.grid .rowtotal, table.grid .coltotal { text-align: right; padding: 0.6rem 0.9rem; font-weight: 600; white-space: nowrap; }

td.cell { position: relative; width: 11%; border-left: 1px solid var(--line-soft); }
td.cell:hover { background: color-mix(in srgb, var(--accent-soft) 45%, transparent); }
td.cell::before {
  content: '';
  position: absolute;
  left: 0; top: 6px; bottom: 6px;
  width: 3px;
  border-radius: 2px;
  background: transparent;
}
td.cell.s-draft::before { background: var(--draft); }
td.cell.s-submitted::before { background: var(--submitted); }
td.cell.s-approved::before { background: var(--approved); }
td.cell.s-rejected::before { background: var(--rejected); }
td.cell.s-invoiced::before { background: var(--invoiced); }
td.cell input.hrs {
  width: 100%;
  border: 0;
  border-radius: 0;
  background: transparent;
  text-align: center;
  font-size: 1.15rem;
  font-weight: 500;
  padding: 0.75rem 0.25rem 0.75rem 0.4rem;
}
td.cell input.hrs:focus { background: var(--accent-soft); outline: none; box-shadow: inset 0 0 0 2px var(--focus); }
td.cell input.hrs:disabled { color: var(--muted); cursor: default; }
td.cell input.hrs.saving { opacity: 0.55; }
td.cell input.hrs.error { box-shadow: inset 0 0 0 2px var(--rejected); }
td.cell .note {
  position: absolute; right: 3px; top: 3px;
  width: 18px; height: 18px;
  border: 0; border-radius: 50%;
  padding: 0;
  background: transparent;
  cursor: pointer;
  color: var(--muted);
  font-size: 12px;
  line-height: 18px;
  opacity: 0;
}
td.cell:hover .note, td.cell:focus-within .note, td.cell .note.has { opacity: 1; }
td.cell .note.has { color: var(--accent); }
td.cell .note::before { content: '✎'; }
table.grid tfoot td { border-bottom: 0; border-top: 1px solid var(--line); }
td.cell .grip {
  position: absolute; left: 6px; bottom: 3px;
  width: 16px; height: 16px;
  display: none;
  color: var(--muted);
  font-size: 13px; line-height: 16px; text-align: center;
  cursor: grab;
  touch-action: none;
  user-select: none;
}
td.cell .grip::before { content: '⠿'; }
td.cell.s-draft .grip, td.cell.s-rejected .grip { display: block; }
td.cell:has(input.hrs:disabled) .grip { display: none; }
@media (hover: hover) {
  td.cell .grip { opacity: 0; }
  td.cell:hover .grip, td.cell:focus-within .grip { opacity: 1; }
}
@media (pointer: coarse) {
  td.cell .grip { width: 24px; height: 24px; line-height: 24px; left: 2px; bottom: 0; }
}
td.cell.drag-source { opacity: 0.4; }
td.cell.drop-target { background: var(--accent-soft); box-shadow: inset 0 0 0 2px var(--accent); }
body.dragging, body.dragging * { cursor: grabbing !important; user-select: none; }
.drag-ghost {
  position: fixed; left: 0; top: 0; z-index: 60;
  pointer-events: none;
  background: var(--ink); color: var(--paper);
  padding: 0.3rem 0.65rem;
  border-radius: var(--radius-s);
  font-size: 0.85rem; font-weight: 500; white-space: nowrap;
  box-shadow: 0 10px 24px -8px rgba(0, 0, 0, 0.4);
}
table.grid tfoot .coltotal { text-align: center; padding: 0.6rem 0.25rem; }
table.grid tfoot .coltotal.over { color: var(--rejected); }

.legend { display: flex; gap: 1rem; flex-wrap: wrap; font-size: 0.85rem; color: var(--muted); margin-top: 0.75rem; }
.legend i { display: inline-block; width: 3px; height: 0.9rem; border-radius: 2px; vertical-align: -2px; margin-right: 0.35rem; }


/* ---------- Goedkeuren ---------- */

.approval-group + .approval-group { margin-top: 1rem; }
.approval-group header { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; padding: 0.9rem 1.1rem; border-bottom: 1px solid var(--line-soft); }
.approval-group header .who { font-weight: 600; }
.approval-group table.data { table-layout: fixed; min-width: 640px; }
.approval-group th:nth-child(1) { width: 2.75rem; }
.approval-group th:nth-child(2) { width: 7.5rem; }
.approval-group th:nth-child(3) { width: 34%; }
.approval-group th.num { width: 5.5rem; }

/* ---------- Dialogen en meldingen ---------- */

dialog {
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  padding: 0;
  width: min(560px, calc(100vw - 2rem));
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 24px 60px -20px rgba(10, 25, 40, 0.45);
}
dialog::backdrop { background: rgba(15, 25, 35, 0.45); }
dialog form { padding: 1.25rem; }
dialog .actions { display: flex; justify-content: flex-end; gap: 0.5rem; margin-top: 1.25rem; }
dialog .err { color: var(--rejected); font-size: 0.9rem; margin-top: 0.75rem; }

#toasts { position: fixed; right: 1rem; bottom: calc(1rem + env(safe-area-inset-bottom, 0px)); display: grid; gap: 0.5rem; z-index: 50; }
.toast {
  background: var(--ink);
  color: var(--paper);
  padding: 0.6rem 1rem;
  border-radius: var(--radius-s);
  max-width: 420px;
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.4);
}
.toast.error { background: var(--rejected); color: #fff; }

/* ---------- Inloggen ---------- */

.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
}
.login .panel { width: min(400px, 100%); padding: 2rem; }
.login h1 { margin-bottom: 0.25rem; }
.login form { display: grid; gap: 1rem; margin-top: 1.5rem; }

pre.json {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  padding: 0.75rem;
  overflow: auto;
  max-height: 340px;
  font-size: 0.8rem;
}

@media (prefers-reduced-motion: no-preference) {
  .toast { animation: rise 0.18s ease-out; }
  @keyframes rise { from { transform: translateY(6px); opacity: 0; } to { transform: none; opacity: 1; } }
}

.dialog-body { margin-top: 1rem; }
code { font-size: 0.9em; background: var(--line-soft); padding: 0.05rem 0.3rem; border-radius: 3px; }

/* ---------- Weergaveschakelaar en lijst ---------- */

.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius-s); overflow: hidden; background: var(--surface); }
.seg button { font: inherit; font-weight: 500; padding: 0.4rem 0.85rem; border: 0; background: none; color: var(--muted); cursor: pointer; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); }

.list-add {
  display: grid;
  grid-template-columns: minmax(9rem, 0.8fr) minmax(11rem, 1.2fr) minmax(10rem, 1fr) 5.5rem minmax(11rem, 1.6fr) auto;
  gap: 0.75rem;
  align-items: end;
  padding: 1rem 1.1rem;
  margin-bottom: 1rem;
}
@media (max-width: 900px) {
  .list-add { grid-template-columns: 1fr 1fr; }
  .list-add .grow, .list-add button { grid-column: 1 / -1; }
}
.list-day + .list-day { margin-top: 0.75rem; }
.list-day header { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding: 0.75rem 1.1rem; border-bottom: 1px solid var(--line-soft); }
.list-day h3::first-letter { text-transform: uppercase; }
.list-entries { list-style: none; margin: 0; padding: 0; }
.list-entry {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto 7.5rem 12rem;
  gap: 1rem;
  align-items: center;
  padding: 0.75rem 1.1rem 0.75rem 1.35rem;
}
.list-entry + .list-entry { border-top: 1px solid var(--line-soft); }
.list-entry::before { content: ''; position: absolute; left: 0.5rem; top: 12px; bottom: 12px; width: 3px; border-radius: 2px; background: var(--draft); }
.list-entry.s-submitted::before { background: var(--submitted); }
.list-entry.s-approved::before { background: var(--approved); }
.list-entry.s-rejected::before { background: var(--rejected); }
.list-entry.s-invoiced::before { background: var(--invoiced); }
.le-main .client { display: block; font-size: 0.8rem; color: var(--muted); }
.le-main .name { font-weight: 600; }
.le-desc { margin: 0.15rem 0 0; }
.le-reject { margin: 0.25rem 0 0; color: var(--rejected); font-size: 0.9rem; }
.le-hours { font-size: 1.15rem; font-weight: 600; text-align: right; white-space: nowrap; }
.le-hours span { font-size: 0.85rem; font-weight: 400; color: var(--muted); }
.le-actions { display: flex; gap: 0.25rem; justify-content: flex-end; }
@media (max-width: 700px) {
  .list-entry { grid-template-columns: 1fr auto; gap: 0.5rem 1rem; }
  .le-status { grid-column: 1; }
  .le-actions { grid-column: 2; }
}

/* Inline bewerken in de lijst */
.le-desc-input, .le-hours-input {
  font: inherit;
  color: var(--ink);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-s);
}
.le-desc-input {
  display: block;
  width: 100%;
  min-height: 0;
  margin: 0.1rem 0 0 -0.4rem;
  padding: 0.2rem 0.4rem;
  resize: none;
  overflow: hidden;
  line-height: 1.45;
  field-sizing: content;
}
.le-hours-input {
  width: 4.5rem;
  padding: 0.15rem 0.35rem;
  text-align: right;
  font-size: 1.15rem;
  font-weight: 600;
}
.list-entry.editable .le-desc-input:hover, .list-entry.editable .le-hours-input:hover { border-color: var(--line); }
.le-desc-input:focus, .le-hours-input:focus {
  outline: none;
  border-color: var(--focus);
  background: var(--surface);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--focus) 25%, transparent);
}
.le-desc-input::placeholder { color: var(--muted); }
.le-hours-input.error { border-color: var(--rejected); }
.list-entry.saving { opacity: 0.6; }
.le-status { display: flex; flex-direction: column; align-items: flex-start; gap: 0.15rem; }
.le-saved { font-size: 0.8rem; color: var(--approved); min-height: 1em; }
@media (hover: none) {
  .list-entry.editable .le-desc-input, .list-entry.editable .le-hours-input { border-color: var(--line-soft); }
}

dialog.wide { width: min(880px, calc(100vw - 2rem)); }
.import-preview { max-height: 46vh; overflow: auto; border: 1px solid var(--line-soft); border-radius: var(--radius-s); }
.import-preview thead th { position: sticky; top: 0; }
input[type="file"] { padding: 0.35rem; }

/* Activiteiten in urenstaat */
table.grid .proj .act { display: block; font-size: 0.85rem; color: var(--accent); font-weight: 500; }
.le-act { display: block; font-size: 0.85rem; color: var(--accent); font-weight: 500; }
.add-row-bar { margin-top: 0.75rem; }
td.empty-row { padding: 1.5rem 1rem; text-align: center; color: var(--muted); }
@media (min-width: 901px) and (max-width: 1100px) {
  .list-add { grid-template-columns: 1fr 1fr 1fr; }
  .list-add .grow, .list-add button { grid-column: 1 / -1; }
}

#eb-form h3, dialog h3 { margin-top: 0.5rem; }
[data-line-example] { font-weight: 500; }

#hours-import h3 { margin-top: 0.75rem; }

/* Lijst per project/activiteit */
.list-card + .list-card { margin-top: 0.75rem; }
.list-card header { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; padding: 0.8rem 1.1rem; border-bottom: 1px solid var(--line-soft); }
.list-card header .client { display: block; font-size: 0.8rem; color: var(--muted); }
.list-card header h3 { font-size: 1rem; }
.le-date { display: block; font-weight: 600; font-size: 0.9rem; }
.le-date::first-letter { text-transform: uppercase; }
.list-quick {
  display: grid;
  grid-template-columns: minmax(9rem, 11rem) 5.5rem minmax(10rem, 1fr) auto;
  gap: 0.5rem;
  padding: 0.75rem 1.1rem;
  background: color-mix(in srgb, var(--paper) 45%, var(--surface));
  border-top: 1px solid var(--line-soft);
  border-radius: 0 0 var(--radius-m) var(--radius-m);
}
.list-card header + .list-quick { border-top: 0; }
@media (max-width: 640px) {
  .list-quick { grid-template-columns: 1fr 5.5rem; }
  .list-quick input[name="description"], .list-quick button { grid-column: 1 / -1; }
}

/* Filter boven urenstaat */
.sheet-filter { display: flex; flex-wrap: wrap; gap: 0.75rem 1rem; align-items: flex-end; margin-bottom: 0.9rem; }
.sheet-filter .field { min-width: 0; }
.sheet-filter select { width: 20rem; max-width: 100%; }
.sheet-filter-info { display: flex; align-items: center; gap: 0.5rem; padding-bottom: 0.3rem; }
@media (max-width: 640px) {
  .sheet-filter .field, .sheet-filter select { width: 100%; }
}

/* Budget per regel */
.budget { display: inline-block; margin-top: 0.2rem; font-size: 0.75rem; font-weight: 500; color: var(--muted); }
table.grid .proj .budget { display: block; }
.budget.warn { color: var(--submitted); }
.budget.over { color: var(--rejected); font-weight: 600; }
.list-card header .budget { display: block; }
.act-table input[inputmode] { width: 5.5rem; }
.act-table th, .act-table td { padding-left: 0.5rem; padding-right: 0.5rem; }
.act-table td:first-child { min-width: 12rem; }
dialog.wide { width: min(980px, calc(100vw - 2rem)); }

/* Meervoudige selectie in het filter */
.ms { position: relative; display: grid; gap: 0.25rem; }
.ms-label { font-weight: 500; font-size: 0.9rem; }
.ms-button {
  font: inherit; text-align: left; cursor: pointer;
  width: 20rem; max-width: 100%;
  padding: 0.45rem 2rem 0.45rem 0.6rem;
  border: 1px solid var(--line); border-radius: var(--radius-s);
  background: var(--surface); color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  position: relative;
}
.ms-button::after { content: '▾'; position: absolute; right: 0.65rem; top: 50%; transform: translateY(-50%); color: var(--muted); }
.ms.active .ms-button { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.ms-panel {
  position: absolute; top: 100%; left: 0; z-index: 40; margin-top: 0.25rem;
  width: max(20rem, 100%); max-width: calc(100vw - 2rem);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m);
  box-shadow: 0 16px 40px -16px rgba(10, 25, 40, 0.35);
  padding: 0.5rem;
}
.ms-search { width: 100%; }
.ms-actions { display: flex; justify-content: space-between; margin: 0.35rem 0; }
.ms-options { max-height: 18rem; overflow: auto; display: grid; }
.ms-option { padding: 0.35rem 0.4rem; border-radius: var(--radius-s); font-weight: 400; align-items: flex-start; }
.ms-option:hover { background: var(--line-soft); }
.ms-option input { margin-top: 0.15rem; flex: none; }
.ms-empty { padding: 0.4rem; }
@media (max-width: 640px) {
  .ms, .ms-button { width: 100%; }
}

/* Maandraster: hele maand in beeld op een normaal scherm (vaste kolombreedtes, dagkolommen verdelen de rest).
   Op smalle schermen scrollt het raster horizontaal en blijft de projectkolom staan. */
main:has(table.grid.month) { max-width: 1680px; }
table.grid.month { width: 100%; min-width: 980px; table-layout: fixed; }
table.grid.month thead th.proj { width: 190px; padding: 0.6rem 0.75rem; font-size: 0.85rem; }
table.grid.month thead th.rowtotal { width: 66px; font-size: 0.8rem; padding-right: 0.6rem; }
table.grid.month .proj {
  position: sticky; left: 0; z-index: 2; background: var(--surface);
  box-shadow: 1px 0 0 var(--line-soft); padding: 0.5rem 0.75rem;
  overflow-wrap: anywhere;
}
table.grid.month .proj .name { font-size: 0.9rem; }
table.grid.month thead th { padding: 0.4rem 0; font-size: 0.7rem; }
table.grid.month thead th .dnum { font-size: 0.9rem; }
table.grid.month td.cell::before { top: 4px; bottom: 4px; width: 2px; }
table.grid.month td.cell input.hrs { font-size: 0.85rem; padding: 0.55rem 0 0.55rem 0.1rem; }
table.grid.month td.cell .note { width: 12px; height: 12px; font-size: 9px; line-height: 12px; right: 0; top: 0; }
table.grid.month td.cell .grip { left: 2px; bottom: 0; font-size: 10px; }
table.grid.month .rowtotal { padding: 0.5rem 0.5rem; font-size: 0.9rem; }
table.grid.month tfoot .coltotal { font-size: 0.75rem; padding: 0.5rem 0; }
@media (max-width: 1000px) {
  table.grid.month { width: max-content; min-width: 0; }
  table.grid.month thead th:not(.proj):not(.rowtotal) { width: 2.6rem; }
}

/* Budgetbalk: kleur op basis van wat er nog over is */
.budget-line { display: flex; align-items: center; gap: 0.45rem; font-size: 0.75rem; color: var(--muted); }
.bbar { position: relative; flex: 1; min-width: 60px; height: 6px; border-radius: 3px; background: var(--line-soft); overflow: hidden; }
.bbar > span { position: absolute; inset: 0 auto 0 0; border-radius: 3px; background: var(--approved); }
.lvl-ok .bbar > span { background: var(--approved); }
.lvl-warn .bbar > span { background: var(--submitted); }
.lvl-low .bbar > span, .lvl-over .bbar > span { background: var(--rejected); }
.budget-line.lvl-warn { color: var(--submitted); }
.budget-line.lvl-low, .budget-line.lvl-over { color: var(--rejected); font-weight: 600; }
.budget-slot { margin-top: 0.35rem; }
table.grid .proj .budget-slot { max-width: 190px; }
table.grid.month .proj .budget-line .nowrap { font-size: 0.7rem; }
.list-card header .budget-slot { max-width: 320px; }
td .budget-line { min-width: 200px; font-size: 0.85rem; }
.budget-legend { display: flex; flex-wrap: wrap; gap: 0.4rem 1rem; color: var(--muted); margin: 0.4rem 0 0; }
.budget-legend i { display: inline-block; width: 18px; height: 6px; border-radius: 3px; margin-right: 0.35rem; vertical-align: middle; }
.budget-legend .lvl-ok i { background: var(--approved); }
.budget-legend .lvl-warn i { background: var(--submitted); }
.budget-legend .lvl-low i { background: var(--rejected); }

.budget-line.lvl-ok { color: var(--muted); font-weight: 500; }
.budget-legend { max-width: none; }

.budget-row { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 0.4rem; }
.budget-row + .budget-row { margin-top: 0.2rem; }
.budget-kind { font-size: 0.68rem; color: var(--muted); min-width: 3.9rem; }
table.grid.month .budget-kind { min-width: 0; }
/* In het raster: label en tekst op één regel, balk eronder over de volle breedte */
table.grid .proj .budget-slot { max-width: none; }
table.grid .proj .budget-row { grid-template-columns: 1fr; gap: 0; }
table.grid .proj .budget-row .budget-kind { display: none; }
table.grid .proj .budget-line { flex-wrap: wrap; gap: 0.1rem 0.35rem; }
table.grid .proj .budget-line .bbar { order: 2; flex-basis: 100%; min-width: 0; }
table.grid .proj .budget-line .nowrap::before { content: attr(data-kind) ' '; font-weight: 600; }
table.grid .proj { overflow: hidden; }

.po-input { width: 11rem; max-width: 100%; padding: 0.25rem 0.45rem; }
.po-input.missing { border-style: dashed; border-color: var(--submitted); }

/* Resterend budget onder de balk */
.budget-line { flex-wrap: wrap; }
.budget-left { flex-basis: 100%; order: 3; font-size: 0.72rem; font-weight: 500; }
.budget-line.lvl-ok .budget-left { color: var(--approved); }
.budget-line.lvl-warn .budget-left { color: var(--submitted); }
.budget-line.lvl-low .budget-left, .budget-line.lvl-over .budget-left { color: var(--rejected); }
td .budget-line .budget-left { font-size: 0.78rem; }
table.grid.month .budget-left { font-size: 0.66rem; }

/* Tweestapsverificatie */
.code-input { font-size: 1.4rem; letter-spacing: 0.3em; text-align: center; width: 10rem; font-variant-numeric: tabular-nums; }
.mfa-panel { width: min(560px, 100%) !important; }
.mfa-steps { padding-left: 1.2rem; display: grid; gap: 0.9rem; }
.mfa-qr { margin: 0.6rem 0; padding: 10px; background: #fff; display: inline-block; border-radius: var(--radius-s); border: 1px solid var(--line); min-height: 40px; }
.mfa-qr img, .mfa-qr canvas { display: block; }
.mfa-secret { word-break: break-all; font-size: 0.95rem; }
pre.recovery-codes { font-size: 1rem; line-height: 1.7; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 0.75rem 1rem; columns: 2; }
.login .mfa-steps form { display: flex; gap: 0.5rem; align-items: center; margin-top: 0.5rem; }
.login .mfa-steps form .btn { width: auto; }


/* =====================================================================
   UX-ronde 2: mobiel eerst, compact raster, overzicht, factuurpaneel
   ===================================================================== */

.ico { width: 20px; height: 20px; flex: none; }

/* ---------- Kop en navigatie ---------- */
.topbar { gap: 1.25rem; }
.user-link { display: inline-flex; align-items: center; gap: 0.5rem; text-decoration: none; }
.avatar {
  display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent); font-size: 0.78rem; font-weight: 700; letter-spacing: 0.02em;
}
.tabbar { display: none; }

@media (max-width: 760px) {
  .topbar { padding: calc(0.45rem + env(safe-area-inset-top, 0px)) 0.9rem 0.45rem; gap: 0.75rem; }
  .topbar .nav, .user-name, .logout-btn { display: none; }
  .userbox { margin-left: auto; }
  .avatar { width: 34px; height: 34px; }
  main { padding: 0.9rem 0.75rem calc(5.5rem + env(safe-area-inset-bottom, 0px)); }
  body.has-tabbar .tabbar {
    display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    background: var(--surface); border-top: 1px solid var(--line);
    padding: 0.25rem 0.25rem calc(0.25rem + env(safe-area-inset-bottom, 0px));
  }
  .tabbar a, .tabbar button {
    position: relative; display: grid; justify-items: center; gap: 0.15rem; min-height: 52px; padding: 0.4rem 0.2rem;
    font: inherit; font-size: 0.7rem; font-weight: 500; color: var(--muted); text-decoration: none;
    background: none; border: 0; border-radius: var(--radius-s); cursor: pointer;
  }
  .tabbar .ico { width: 24px; height: 24px; }
  .tabbar [aria-current="page"] { color: var(--accent); }
  .tabbar [aria-current="page"] .ico { stroke-width: 2.2; }
  .tab-badge {
    position: absolute; top: 0.2rem; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px;
    border-radius: 9px; background: var(--submitted); color: #fff; font-size: 0.68rem; font-weight: 700; line-height: 18px;
  }
}

/* Bladmenu "Meer" */
.sheet-backdrop { position: fixed; inset: 0; z-index: 60; background: rgba(15, 25, 35, 0.45); display: flex; align-items: flex-end; }
.sheet {
  width: 100%; background: var(--surface); border-radius: 14px 14px 0 0;
  padding: 0.5rem 0.75rem calc(0.75rem + env(safe-area-inset-bottom, 0px));
}
.sheet-handle { width: 40px; height: 4px; border-radius: 2px; background: var(--line); margin: 0.25rem auto 0.6rem; }
.sheet-item {
  display: flex; align-items: center; gap: 0.85rem; width: 100%; min-height: 52px; padding: 0 0.6rem;
  font: inherit; font-size: 1rem; font-weight: 500; color: var(--ink); text-decoration: none;
  background: none; border: 0; border-radius: var(--radius-s); cursor: pointer;
}
.sheet-item + .sheet-item { border-top: 1px solid var(--line-soft); }
.sheet-item .chev { margin-left: auto; color: var(--muted); width: 18px; }
.sheet-item.danger { color: var(--rejected); }

/* ---------- Urenkop ---------- */
.sheet-head { display: grid; grid-template-columns: auto 1fr auto; grid-template-areas: "nav total actions" "switches switches switches"; align-items: center; gap: 0.75rem 1.25rem; margin-bottom: 1rem; }
.week-nav { grid-area: nav; display: flex; align-items: center; gap: 0.4rem; }
.week-title { display: grid; text-align: center; min-width: 9.5rem; }
.week-title h1 { min-width: 0; font-size: 1.45rem; }
.week-title .range { font-size: 0.82rem; color: var(--muted); }
.icon-btn { width: 40px; height: 40px; padding: 0; font-size: 1.25rem; }
.week-total { grid-area: total; display: grid; grid-template-columns: auto auto 1fr; align-items: baseline; gap: 0.15rem 0.4rem; max-width: 260px; }
.week-total strong { font-size: 1.5rem; }
.week-progress { grid-column: 1 / -1; height: 5px; border-radius: 3px; background: var(--line-soft); overflow: hidden; }
.week-progress > span { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.week-status { grid-column: 1 / -1; }
.sheet-switches { grid-area: switches; display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: center; }
.sheet-actions { grid-area: actions; display: flex; gap: 0.5rem; align-items: center; }
.sheet-actions-info { display: none; }
.only-narrow { display: none !important; }
.filter-toggle { display: none; }
.filter-toggle.active { border-color: var(--accent); color: var(--accent); }
.filter-toggle .badge { margin-left: 0.15rem; }
.only-hours { padding-bottom: 0.45rem; font-weight: 500; }

@media (max-width: 760px) {
  .only-wide { display: none !important; }
  .only-narrow { display: inline-block !important; }
  .sheet-head { grid-template-columns: 1fr auto; grid-template-areas: "nav total" "switches switches"; gap: 0.6rem; margin-bottom: 0.75rem; }
  .week-title { min-width: 0; }
  .week-title h1 { font-size: 1.2rem; }
  .today-btn { display: none; }
  .week-total { max-width: 9rem; justify-self: end; }
  .week-total strong { font-size: 1.25rem; }
  .week-status { display: none; }
  .sheet-switches { gap: 0.5rem; }
  .sheet-switches .seg button { padding: 0.45rem 0.75rem; }
  .filter-toggle { display: inline-flex; margin-left: auto; }
  .sheet-filter:not(.open) { display: none; }
  .sheet-filter { padding: 0.75rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); }
  .sheet-filter .only-hours { padding-bottom: 0; }
  /* Indienen als vaste balk boven de tabbalk */
  .sheet-actions {
    position: fixed; left: 0; right: 0; bottom: calc(60px + env(safe-area-inset-bottom, 0px)); z-index: 25;
    padding: 0.55rem 0.75rem; background: color-mix(in srgb, var(--surface) 94%, transparent);
    backdrop-filter: blur(6px); border-top: 1px solid var(--line);
  }
  .sheet-actions-info { display: block; flex: 1; font-size: 0.85rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .sheet-actions-info strong { color: var(--ink); }
  body.has-tabbar main:has(.sheet-actions) { padding-bottom: calc(9.5rem + env(safe-area-inset-bottom, 0px)); }
}

/* ---------- Compacte budgetregel ---------- */
.budget-slot.compact { margin-top: 0.3rem; display: grid; gap: 0.15rem; }
.bmini { display: grid; grid-template-columns: 2.3rem 1fr auto; align-items: center; gap: 0.35rem; font-size: 0.7rem; color: var(--muted); }
.bmini .bbar { height: 4px; min-width: 30px; }
.bmini-kind { font-weight: 600; }
.bmini-left { white-space: nowrap; font-weight: 500; }
.bmini.lvl-ok .bmini-left { color: var(--approved); }
.bmini.lvl-warn .bmini-left { color: var(--submitted); }
.bmini.lvl-low .bmini-left, .bmini.lvl-over .bmini-left { color: var(--rejected); font-weight: 600; }

/* ---------- Raster: compacter, met klantgroepen ---------- */
table.grid .proj { padding: 0.45rem 0.8rem; min-width: 200px; max-width: 250px; }
table.grid .proj .name, table.grid .proj .act { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 230px; }
table.grid .proj .name { font-size: 0.92rem; }
table.grid .proj .act { font-size: 0.8rem; }
td.cell input.hrs { padding: 0.55rem 0.25rem 0.55rem 0.4rem; font-size: 1.05rem; }
tr.grp th, tr.grp td { background: color-mix(in srgb, var(--paper) 65%, var(--surface)); border-bottom: 1px solid var(--line); }
tr.grp td { text-align: center; font-size: 0.82rem; font-weight: 600; color: var(--muted); padding: 0.4rem 0.1rem; }
tr.grp td.rowtotal { text-align: right; color: var(--ink); }
.grp-toggle {
  display: flex; align-items: center; gap: 0.4rem; width: 100%; padding: 0.15rem 0; font: inherit; font-weight: 600;
  font-size: 0.85rem; color: var(--ink); background: none; border: 0; cursor: pointer; text-align: left;
}
.grp-chev { width: 16px; height: 16px; transition: transform 0.15s; transform: rotate(90deg); color: var(--muted); }
tr.grp.closed .grp-chev { transform: none; }
table.grid.month .proj .name, table.grid.month .proj .act { max-width: 170px; }

/* ---------- Dagweergave ---------- */
.day-strip {
  display: flex; gap: 0.35rem; overflow-x: auto; scroll-snap-type: x proximity; padding: 0.1rem 0.1rem 0.5rem; margin: 0 -0.1rem 0.4rem;
  scrollbar-width: none;
}
.day-strip::-webkit-scrollbar { display: none; }
.day-chip {
  flex: 1 0 3.1rem; display: grid; justify-items: center; gap: 0.05rem; padding: 0.4rem 0.2rem; min-height: 64px;
  font: inherit; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); color: var(--ink);
  cursor: pointer; scroll-snap-align: center; position: relative;
}
.day-chip.weekend { background: color-mix(in srgb, var(--paper) 55%, var(--surface)); }
.day-chip .dc-dow { font-size: 0.72rem; color: var(--muted); }
.day-chip .dc-num { font-size: 1.05rem; font-weight: 600; }
.day-chip .dc-hrs { font-size: 0.72rem; color: var(--muted); }
.day-chip.today .dc-num { color: var(--accent); }
.day-chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.day-chip[aria-pressed="true"] .dc-dow, .day-chip[aria-pressed="true"] .dc-hrs, .day-chip[aria-pressed="true"].today .dc-num { color: var(--on-accent); }
.day-chip::after { content: ''; position: absolute; bottom: 4px; left: 50%; width: 14px; height: 3px; margin-left: -7px; border-radius: 2px; background: transparent; }
.day-chip.s-draft::after { background: var(--draft); }
.day-chip.s-submitted::after { background: var(--submitted); }
.day-chip.s-approved::after { background: var(--approved); }
.day-chip.s-rejected::after { background: var(--rejected); }
.day-chip.s-invoiced::after { background: var(--invoiced); }
.day-head { display: flex; justify-content: space-between; align-items: baseline; margin: 0.25rem 0 0.6rem; }
.day-head h2 { font-size: 1.05rem; }
.day-card { position: relative; padding: 0.8rem 0.9rem; }
.day-card + .day-card { margin-top: 0.6rem; }
.day-card::before { content: ''; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 0 2px 2px 0; background: transparent; }
.day-card.s-draft::before { background: var(--draft); }
.day-card.s-submitted::before { background: var(--submitted); }
.day-card.s-approved::before { background: var(--approved); }
.day-card.s-rejected::before { background: var(--rejected); }
.day-card.s-invoiced::before { background: var(--invoiced); }
.day-card.saving { opacity: 0.6; }
.day-card.saved { box-shadow: 0 0 0 2px color-mix(in srgb, var(--approved) 55%, transparent); transition: box-shadow 0.2s; }
.dcard-head { display: flex; justify-content: space-between; gap: 0.75rem; align-items: flex-start; }
.dcard-title .client { display: block; font-size: 0.78rem; color: var(--muted); }
.dcard-title .name { display: block; font-weight: 600; }
.dcard-title .act { display: block; font-size: 0.85rem; color: var(--accent); font-weight: 500; }
.dcard-input { display: flex; gap: 0.6rem; align-items: center; margin-top: 0.6rem; }
.dv-hours-wrap { display: flex; align-items: baseline; gap: 0.35rem; color: var(--muted); }
.dv-hours { width: 5.2rem; min-height: 48px; font-size: 1.4rem; font-weight: 600; text-align: center; }
.dv-hours.error { border-color: var(--rejected); }
.quick { display: flex; gap: 0.35rem; margin-left: auto; }
.quick-btn { min-width: 44px; min-height: 44px; padding: 0 0.5rem; font-size: 1rem; }
.dv-desc { display: block; width: 100%; margin-top: 0.5rem; min-height: 44px; resize: none; overflow: hidden; line-height: 1.4; }
.dcard-locked { margin: 0.5rem 0 0; color: var(--muted); }
.day-card .le-reject { margin: 0.4rem 0 0; }

/* ---------- Overzicht ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0.8rem; }
.tile { display: grid; gap: 0.2rem; padding: 1rem 1.1rem; text-decoration: none; color: var(--ink); border-left: 4px solid var(--line); transition: border-color 0.15s, transform 0.15s; }
.tile:hover { border-color: var(--accent); }
.tile-label { font-size: 0.85rem; color: var(--muted); font-weight: 500; }
.tile-value { font-size: 1.7rem; font-weight: 600; line-height: 1.15; }
.tile-ok { border-left-color: var(--approved); }
.tile-warn { border-left-color: var(--submitted); }
.tile-low { border-left-color: var(--rejected); }
.tile-accent { border-left-color: var(--accent); }
.dash-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); gap: 0.9rem; align-items: start; }
.dash-cols .panel-pad.row { padding-bottom: 0.6rem; }
.dash-list { list-style: none; margin: 0; padding: 0 0.4rem 0.5rem; }
.dash-list li + li { border-top: 1px solid var(--line-soft); }
.dash-list a, .dash-li { display: grid; grid-template-columns: 1fr auto auto; gap: 0.75rem; align-items: center; padding: 0.65rem 0.75rem; color: var(--ink); text-decoration: none; border-radius: var(--radius-s); }
.dash-list a:hover { background: var(--line-soft); }
.dash-list.budgets li { display: grid; gap: 0.35rem; padding: 0.65rem 0.75rem; }
.dash-list.budgets li > div:first-child { display: grid; }
.dash-foot { border-top: 1px solid var(--line-soft); padding-top: 0.75rem; padding-bottom: 0.9rem; margin: 0; }
.empty.small { padding: 1.5rem 1rem; }
@media (max-width: 760px) {
  .dash > .row h1 { font-size: 1.3rem; }
  .dash > .row .btn { display: none; }
  .tiles { grid-template-columns: 1fr 1fr; gap: 0.6rem; }
  .tile { padding: 0.75rem 0.85rem; }
  .tile-value { font-size: 1.35rem; }
  .tile-sub { display: none; }
  .dash-cols { grid-template-columns: 1fr; }
}

/* ---------- Facturen ---------- */
.period-bar { display: flex; flex-wrap: wrap; gap: 0.6rem 1rem; align-items: center; }
.period-custom summary { list-style: none; cursor: pointer; }
.period-custom summary::-webkit-details-marker { display: none; }
.period-custom[open] summary { margin-bottom: 0.5rem; }
.client-pick { list-style: none; margin: 0; padding: 0 0.4rem 0.4rem; }
.client-pick li + li { border-top: 1px solid var(--line-soft); }
.client-row {
  display: grid; grid-template-columns: 1fr auto auto 20px; gap: 1rem; align-items: center; width: 100%; min-height: 56px;
  padding: 0.6rem 0.75rem; font: inherit; color: var(--ink); text-align: left; background: none; border: 0; border-radius: var(--radius-s); cursor: pointer;
}
.client-row:hover:not(:disabled) { background: var(--accent-soft); }
.client-row:disabled { opacity: 0.55; cursor: default; }
.cr-name { display: grid; font-weight: 600; }
.cr-name .muted { font-weight: 400; }
.cr-hours { display: flex; gap: 0.4rem; align-items: center; color: var(--muted); white-space: nowrap; }
.cr-amount { white-space: nowrap; }
.client-row .chev { color: var(--muted); width: 18px; }
@media (max-width: 640px) {
  .client-row { grid-template-columns: 1fr auto 18px; gap: 0.25rem 0.75rem; }
  .cr-hours { grid-row: 2; grid-column: 1; }
  .cr-amount { grid-row: 1 / span 2; grid-column: 2; }
  .client-row .chev { grid-row: 1 / span 2; grid-column: 3; }
}

/* Zijpaneel */
.drawer-backdrop { position: fixed; inset: 0; z-index: 50; background: rgba(15, 25, 35, 0); transition: background 0.2s; }
.drawer-backdrop.in { background: rgba(15, 25, 35, 0.4); }
.drawer {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(860px, 100%); display: flex; flex-direction: column;
  background: var(--surface); box-shadow: -20px 0 50px -20px rgba(10, 25, 40, 0.45);
  transform: translateX(100%); transition: transform 0.22s ease-out;
}
.drawer-backdrop.in .drawer { transform: none; }
.drawer-head {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: calc(0.75rem + env(safe-area-inset-top, 0px)) 1rem 0.75rem 1.4rem; border-bottom: 1px solid var(--line);
}
.drawer-head h2 { font-size: 1.15rem; }
.drawer-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; }
.drawer-pad { padding: 1.1rem 1.4rem; }
.drawer-foot {
  position: sticky; bottom: 0; display: flex; justify-content: flex-end; gap: 0.5rem; flex-wrap: wrap;
  margin: 0.5rem -1.4rem -1.1rem; padding: 0.8rem 1.4rem calc(0.8rem + env(safe-area-inset-bottom, 0px));
  background: var(--surface); border-top: 1px solid var(--line);
}
body.drawer-open { overflow: hidden; }
h3.step { display: flex; align-items: center; gap: 0.55rem; font-size: 1rem; margin-top: 0.4rem; }
h3.step > span {
  display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%;
  background: var(--accent); color: var(--on-accent); font-size: 0.8rem; font-weight: 700;
}
@media (max-width: 760px) {
  .drawer { width: 100%; }
  .drawer-pad { padding: 1rem; }
  .drawer-foot { margin: 0.5rem -1rem -1rem; padding-left: 1rem; padding-right: 1rem; }
  .drawer-foot .btn { flex: 1; }
}

/* ---------- Koppeling ---------- */
fieldset.group { border: 1px solid var(--line); margin: 0; min-width: 0; }
fieldset.group legend { float: left; width: 100%; padding: 0; }
fieldset.group legend + * { clear: both; }
fieldset.group > .row.spread { width: 100%; }
fieldset.group > .row.spread legend { float: none; width: auto; }
.jump { display: flex; gap: 0.4rem; flex-wrap: wrap; position: sticky; top: 58px; z-index: 5; padding: 0.4rem 0; background: var(--paper); }
.jump a { padding: 0.35rem 0.75rem; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink); text-decoration: none; font-size: 0.88rem; }
.jump a:hover { border-color: var(--accent); color: var(--accent); }
.save-bar {
  position: sticky; bottom: 0; z-index: 6; display: flex; justify-content: flex-end; align-items: center; gap: 1rem;
  padding: 0.75rem 1rem; background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(6px);
  border: 1px solid var(--line); border-radius: var(--radius-m);
}
@media (max-width: 760px) {
  .jump { top: 50px; overflow-x: auto; flex-wrap: nowrap; }
  .save-bar { bottom: calc(62px + env(safe-area-inset-bottom, 0px)); }
}

/* ---------- Tabellen als kaarten op smalle schermen ---------- */
@media (max-width: 640px) {
  .table-wrap > table.data { min-width: 0 !important; table-layout: auto !important; }
  .table-wrap > table.data thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .table-wrap > table.data, .table-wrap > table.data tbody, .table-wrap > table.data tfoot { display: block; }
  .table-wrap > table.data tr {
    display: grid; grid-template-columns: 1fr auto; gap: 0.15rem 0.75rem; padding: 0.7rem 0.9rem;
    border-bottom: 1px solid var(--line-soft);
  }
  .table-wrap > table.data td, .table-wrap > table.data th { display: block; padding: 0; border: 0; text-align: left; }
  .table-wrap > table.data td:first-child { grid-column: 1 / -1; font-weight: 600; }
  .table-wrap > table.data td:empty { display: none; }
  .table-wrap > table.data td[data-label]:not(:first-child):not([data-label=""])::before {
    content: attr(data-label); display: block; font-size: 0.72rem; color: var(--muted); font-weight: 500;
  }
  .table-wrap > table.data td.num { text-align: left; }
  .table-wrap > table.data td.right { grid-column: 1 / -1; text-align: left; margin-top: 0.3rem; }
  .table-wrap > table.data td.right .btn { margin-right: 0.35rem; }
  .table-wrap > table.data tfoot tr { border-bottom: 0; background: var(--line-soft); border-radius: var(--radius-s); }
  /* Goedkeuren: vinkje en datum naast elkaar */
  .approval-group table.data tr { grid-template-columns: auto 1fr auto; }
  .approval-group table.data td:first-child { grid-column: auto; grid-row: span 3; padding-top: 0.15rem; }
  .approval-group table.data td:nth-child(2) { font-weight: 600; }
  .approval-group table.data td:nth-child(3) { grid-column: 2 / -1; }
  .approval-group table.data td:nth-child(4) { grid-column: 3; grid-row: 1; font-weight: 600; }
  .approval-group table.data td:nth-child(4)::before { display: none !important; }
  .approval-group table.data td:nth-child(n+5) { grid-column: 2 / -1; }
  .approval-group header { padding: 0.75rem 0.9rem; }
  .approval-group header .row { width: 100%; }
  .approval-group header .row .btn { flex: 1; }
  /* Factuurregels in het paneel */
  table.data.lines tr { grid-template-columns: 1fr auto; }
  table.data.lines td:first-child { font-weight: 400; }
  .drawer .table-wrap > table.data td:nth-child(2):not(:first-child) { grid-column: 1; }
  .tabs { margin-bottom: 0.75rem; }
  .panel-pad { padding: 1rem; }
  h1 { font-size: 1.35rem; }
}

/* ---------- Aanraakdoelen ---------- */
@media (pointer: coarse) {
  .btn { min-height: 44px; }
  .btn.small { min-height: 40px; padding: 0.3rem 0.75rem; }
  input, select, textarea { min-height: 44px; font-size: 16px; }
  input[type="checkbox"] { min-height: 0; width: 22px; height: 22px; }
  .check { min-height: 44px; }
  .seg button { min-height: 42px; }
  .tabs button { min-height: 44px; }
  td.cell .note { width: 28px; height: 28px; line-height: 28px; font-size: 14px; opacity: 1; }
  .ms-option { min-height: 44px; }
}

/* Verfijningen na test */
.jump a { white-space: nowrap; }
@media (max-width: 640px) {
  table.data.lines tr { grid-template-columns: auto auto 1fr; gap: 0.1rem 1rem; }
  table.data.lines td:first-child { grid-column: 1 / -1; }
  table.data.lines td:nth-child(2), table.data.lines td:nth-child(3) { grid-column: auto; font-size: 0.85rem; color: var(--muted); }
  table.data.lines td:nth-child(2)::after { content: ' uur'; }
  table.data.lines td:nth-child(n+2)::before { display: none !important; }
  table.data.lines td:nth-child(4) { grid-column: 3; text-align: right; font-weight: 600; }
  table.data.lines tfoot td:first-child { grid-column: 1 / 3; }
  table.data.lines tfoot td:nth-child(3) { display: none; }
  #rperiod { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; }
  #rperiod .field input { width: 100%; }
  #rperiod > .row { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4, auto); gap: 0.4rem; }
  #rperiod > .row .btn { padding-left: 0.5rem; padding-right: 0.5rem; }
}
@media (max-width: 420px) {
  .filter-toggle { padding-left: 0.6rem; padding-right: 0.6rem; }
  .sheet-switches .seg button { padding-left: 0.6rem; padding-right: 0.6rem; }
}

/* ---------- Controle (accountant) ---------- */
.badge.readonly { display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.2rem 0.6rem; background: var(--accent-soft); color: var(--accent); }
.badge.readonly .ico { width: 15px; height: 15px; }
.control-intro { margin: -0.4rem 0 0; }
.block { display: block; }
.linkish { font: inherit; color: var(--accent); background: none; border: 0; padding: 0; cursor: pointer; text-align: left; text-decoration: underline; text-underline-offset: 2px; }
.linkish.strong { font-weight: 600; }
.checks { list-style: none; margin: 0; padding: 0 0.4rem 0.5rem; }
.checks > li { display: grid; grid-template-columns: auto 1fr auto; gap: 0.75rem; align-items: start; padding: 0.75rem; }
.checks > li + li { border-top: 1px solid var(--line-soft); }
.check-dot { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--line-soft); color: var(--muted); }
.check-dot .ico { width: 16px; height: 16px; }
.check-ok .check-dot { background: color-mix(in srgb, var(--approved) 16%, transparent); color: var(--approved); }
.check-warn .check-dot { background: color-mix(in srgb, var(--submitted) 18%, transparent); color: var(--submitted); }
.check-body { display: grid; gap: 0.15rem; min-width: 0; }
.check-body details { margin-top: 0.35rem; }
.check-body summary { cursor: pointer; color: var(--accent); font-weight: 500; }
.check-items { list-style: none; margin: 0.35rem 0 0; padding: 0; display: grid; gap: 0.25rem; }
.check-items li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.2rem 1rem; padding: 0.35rem 0.6rem; background: var(--paper); border-radius: var(--radius-s); font-size: 0.9rem; }
.month-bar-col { width: 22%; min-width: 90px; vertical-align: middle !important; }
.ohw-date { flex-direction: row; display: flex; align-items: center; gap: 0.5rem; font-weight: 500; }
.control-filter { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 0.75rem 1rem; }
table.control-entries td.desc { min-width: 14rem; max-width: 26rem; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 0.4rem 1rem; margin: 0; }
.facts dt { color: var(--muted); font-size: 0.9rem; }
.facts dd { margin: 0; }
.audit { list-style: none; margin: 0; padding: 0.3rem 0.4rem 0.5rem; }
.audit li { display: grid; grid-template-columns: 11rem 11rem 1fr; gap: 0.75rem; padding: 0.6rem 0.75rem; align-items: baseline; }
.audit li + li { border-top: 1px solid var(--line-soft); }
.audit time { color: var(--muted); font-size: 0.875rem; white-space: nowrap; }
.audit-who { font-weight: 500; }
@media (max-width: 760px) {
  .checks > li { grid-template-columns: auto 1fr; }
  .checks > li > .badge { grid-column: 2; justify-self: start; }
  .audit li { grid-template-columns: 1fr; gap: 0.1rem; }
  .month-bar-col { display: none; }
  .control .tabs { margin-bottom: 0.5rem; }
}
.control .period-bar .seg { max-width: 100%; overflow-x: auto; }
.control .period-bar .seg button { white-space: nowrap; }
@media (max-width: 760px) {
  .control .period-bar .seg button { padding: 0.4rem 0.6rem; font-size: 0.9rem; }
  .control-filter { grid-template-columns: 1fr 1fr; gap: 0.6rem; padding: 0.85rem; }
  .control-filter select { width: 100%; }
}

/* ---------- Zelffacturen zzp ---------- */
.zzp-box { border-top: 1px solid var(--line-soft); padding-top: 0.9rem; display: grid; gap: 0.75rem; }
ul.tight { margin: 0.35rem 0 0; padding-left: 1.1rem; }
.bill-card { padding: 1rem 1.15rem; display: grid; gap: 0.75rem; }
.bill-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.bill-head h2 { margin-bottom: 0.15rem; }
.bill-card .facts { grid-template-columns: repeat(4, max-content 1fr); }
@media (max-width: 640px) { .bill-card .facts { grid-template-columns: max-content 1fr; } }

/* ---------- Huisstijl Coretic ---------- */
body { letter-spacing: -0.005em; }
h1 { font-weight: 700; letter-spacing: -0.025em; }
h2, h3 { letter-spacing: -0.015em; }
.brand { display: inline-flex; align-items: center; gap: 0.6rem; }
.brand .logo img { display: block; height: 34px; width: auto; }
.brand-app { padding-left: 0.6rem; border-left: 1px solid var(--line); color: var(--muted); font-weight: 600; font-size: 1rem; }
.login-brand { margin-bottom: 1.25rem; }
.login-brand .logo img { display: block; height: 44px; width: auto; }
.nav a[aria-current="page"] { color: var(--ink); background: var(--brand-soft); box-shadow: inset 0 -2px 0 var(--brand); }
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--brand); }
.seg button[aria-pressed="true"] { background: var(--brand-soft); color: var(--ink); }
.avatar { background: var(--accent); color: var(--on-accent); }
.bar > span, .week-progress > span { background: var(--brand); }
table.grid thead th.today { box-shadow: inset 0 3px 0 var(--brand); }
table.grid thead th.today .dnum, .day-chip.today .dc-num { color: var(--brand-ink); }
.tile-accent { border-left-color: var(--brand); }
.tile:hover { border-color: var(--brand); }
.tabbar [aria-current="page"] { color: var(--brand-ink); }
.badge.count, .tab-badge { background: var(--brand); color: #00122B; }
.btn.primary:hover { filter: none; background: color-mix(in srgb, var(--accent) 88%, var(--brand)); border-color: color-mix(in srgb, var(--accent) 88%, var(--brand)); }
.jump a:hover { border-color: var(--brand); color: var(--ink); }
.ms.active .ms-button { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.filter-toggle.active { border-color: var(--brand); color: var(--ink); }
td.cell input.hrs:focus { background: color-mix(in srgb, var(--brand-soft) 60%, var(--surface)); }
.badge.readonly { background: var(--brand-soft); color: var(--ink); }
@media (max-width: 760px) {
  .brand .logo img { height: 30px; }
  .brand-app { font-size: 0.9rem; padding-left: 0.5rem; }
}

/* ---------- Inhuur zzp'ers ---------- */

.notice.ok { border-color: var(--approved); background: color-mix(in srgb, var(--approved) 12%, var(--surface)); }
.ib-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.45rem; }
.ib-list li { display: grid; gap: 0.1rem; padding: 0.35rem 0 0.35rem 0.75rem; border-left: 3px solid var(--line); font-size: 0.92rem; }
.ib-list li span { color: var(--muted); font-size: 0.85rem; }
.ib-list li a { font-weight: 600; font-size: 0.85rem; }
.ib-list .ib-bad { border-left-color: var(--rejected); }
.ib-list .ib-warn { border-left-color: var(--submitted); }
.ib-list .ib-info { border-left-color: var(--accent); }
.ib-list .ib-ok { border-left-color: var(--approved); }
tr.ib-row { cursor: pointer; }
tr.ib-row:hover td { background: var(--paper); }
tr.ib-row:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.ib-top { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 0.9rem; align-items: start; }
.ib-split { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 1rem; align-items: start; }
.ib-split.narrow { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
.ib-split > .stack:first-child, .ib-split > * { min-width: 0; }
.ib-split:has(.ib-paper) { grid-template-columns: minmax(0, 420px) minmax(0, 1fr); }
.ib-side { position: sticky; top: 5rem; }
.ib-paper { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-s); padding: clamp(1rem, 3vw, 2.5rem); font-family: Georgia, 'Times New Roman', serif; line-height: 1.6; max-height: calc(100vh - 8rem); overflow: auto; position: sticky; top: 5rem; }
.ib-paper h1 { font-size: 1.3rem; text-align: center; margin: 0; }
.ib-paper .psub { text-align: center; color: var(--muted); font-size: 0.85rem; margin: 0.2rem 0 1.2rem; }
.ib-paper h3 { font-size: 1rem; margin: 1.1rem 0 0.35rem; }
.ib-paper p, .ib-paper li { margin: 0 0 0.4rem; }
.ib-paper ol { padding-left: 1.4rem; }
.ib-paper mark { background: var(--brand-soft); color: var(--ink); padding: 0 0.2rem; border-radius: 3px; font-family: var(--font); font-size: 0.85rem; }
.ib-paper .sig { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1.5rem; margin-top: 1.8rem; }
.ib-paper .sig div { border-top: 1px solid var(--ink); padding-top: 0.4rem; font-size: 0.85rem; }
/* Inhuur via leverancier: documentvoorbeeld in Coretic-huisstijl */
.ib-split:has(.lv-paper) { grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); }
.lv-preview { position: sticky; top: 5rem; }
.lv-toolbar { gap: 0.5rem; flex-wrap: wrap; }
.lv-preview [data-checks] .ib-list { max-height: 9rem; overflow: auto; }
.ib-paper.lv-paper { position: static; max-height: calc(100vh - 17rem); font-family: var(--font); background: #fff; color: #001D45; font-size: 0.92rem; padding-top: 0; }
.lv-paper .lv-head { margin: 0 calc(-1 * clamp(1rem, 3vw, 2.5rem)) 1.2rem; padding: 1.1rem clamp(1rem, 3vw, 2.5rem) 0.8rem; border-bottom: 3px solid var(--brand); }
.lv-paper .lv-head img { height: 30px; width: auto; display: block; }
.lv-paper h1 { text-align: left; font-size: 1.35rem; font-weight: 800; }
.lv-paper h1 .tag { font-size: 0.9rem; font-weight: 500; color: #4A5872; }
.lv-paper .psub { text-align: left; color: #4A5872; }
.lv-paper h2 { font-size: 1.05rem; margin: 0 0 0.3rem; }
.lv-paper h3 { padding-left: 0.5rem; border-left: 3px solid var(--brand); }
.lv-paper ul { padding-left: 1.4rem; }
.lv-paper .m { color: #4A5872; font-size: 0.85rem; }
.lv-paper mark { color: #001D45; }
.lv-paper .annex { margin-top: 2rem; padding-top: 1.2rem; border-top: 1px dashed var(--line); }
.lv-paper h1 + .psub + .annex { margin-top: 0.5rem; padding-top: 0; border-top: 0; }
.lv-paper table.kv td.fill { height: 1.8rem; }
.lv-paper table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.lv-paper table.kv th, .lv-paper table.kv td { border-bottom: 1px solid #E6EAEE; padding: 0.35rem 0.3rem; text-align: left; vertical-align: top; }
.lv-paper table.kv th { width: 38%; color: #4A5872; font-weight: 600; }
.lv-paper .sig > div { border-top: 2px solid #001D45; }
.lv-paper .sigt td { padding: 0.25rem 0; border-bottom: 1px solid #E6EAEE; }
.lv-paper .sigt td:first-child { width: 34%; color: #4A5872; }
.lv-paper .sigt .sigline { height: 2rem; }
.lv-inzet { border: 1px solid var(--line); border-radius: var(--radius-s); padding: 0.8rem 1rem 1rem; display: grid; gap: 0.6rem; }
.lv-inzet legend { font-weight: 600; padding: 0 0.3rem; }
.lv-more summary { cursor: pointer; font-weight: 500; margin: 0.3rem 0 0.6rem; }
.lv-access { border-top: 1px solid var(--line-soft); padding-top: 0.7rem; display: grid; gap: 0.4rem; }
.lv-access .facts { gap: 0.2rem 0.8rem; }
.lv-projects { display: grid; gap: 0.35rem; max-height: 50vh; overflow: auto; }
.ib-doc { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.5rem 1rem; padding: 0.75rem 0.9rem; border: 1px solid var(--line-soft); border-radius: var(--radius-s); background: var(--paper); }
.ib-doc.done { background: var(--surface); }
.ib-doc-t { min-width: 0; }
.ib-doc-c { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; justify-content: flex-end; }
.ib-doc-c select { max-width: 15rem; }
.ib-files { list-style: none; margin: 0.4rem 0 0; padding: 0; display: grid; gap: 0.2rem; font-size: 0.9rem; }
.ib-files a { overflow-wrap: anywhere; }
.ib-hist { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.ib-hist li { display: grid; gap: 0.2rem; padding: 0.6rem 0.75rem; border: 1px solid var(--line-soft); border-radius: var(--radius-s); }
.ib-savebar { position: sticky; bottom: 0; z-index: 5; display: flex; justify-content: flex-end; align-items: center; gap: 0.75rem; padding: 0.75rem 0; margin-top: 1rem; background: var(--paper); border-top: 1px solid var(--line); }
.ib-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 0.9rem; align-items: start; }
.ib-card .badge { justify-self: start; }
.ib-card h2 { font-size: 1.05rem; }
.ib-pre { white-space: pre-wrap; font: inherit; font-size: 0.9rem; background: var(--paper); border-radius: var(--radius-s); padding: 0.75rem; margin: 0; overflow-wrap: anywhere; }
.ib-check { align-items: flex-start; }
.ib-check input { margin-top: 0.2rem; }
.ib-check .hint { font-weight: 400; color: var(--muted); font-size: 0.85rem; }
.iq { border: 0; padding: 0.75rem 0 0; margin: 0; border-top: 1px solid var(--line-soft); min-width: 0; }
.iq legend { font-weight: 600; padding: 0; margin-bottom: 0.15rem; float: left; width: 100%; }
.iq .hint { clear: both; color: var(--muted); font-size: 0.85rem; margin: 0 0 0.35rem; }
.iq-opts { clear: both; display: flex; flex-wrap: wrap; gap: 0.4rem; padding-top: 0.35rem; }
.iq-opts label { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.4rem 0.7rem; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--surface); cursor: pointer; font-size: 0.92rem; }
.iq-opts input { accent-color: var(--accent); margin: 0; }
.iq-opts label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.iq-opts label:has(input:disabled) { cursor: default; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 1000px) {
  .ib-top, .ib-split, .ib-split.narrow, .ib-split:has(.ib-paper) { grid-template-columns: minmax(0, 1fr); }
  .ib-side, .ib-paper { position: static; max-height: none; }
  .ib-split:has(.lv-paper) { grid-template-columns: minmax(0, 1fr); }
  .lv-preview { position: static; }
  .ib-paper.lv-paper { max-height: 70vh; }
}
@media (max-width: 640px) {
  .ib-doc { grid-template-columns: minmax(0, 1fr); }
  .ib-doc-c { justify-content: flex-start; }
  .ib-savebar { bottom: calc(64px + env(safe-area-inset-bottom, 0px)); }
}

.ib-proj-group { display: grid; gap: 0.4rem; }
.ib-proj-group h3 { font-size: 0.95rem; color: var(--muted); margin: 0.4rem 0 0; }
.ib-proj { display: grid; gap: 0.4rem; padding: 0.6rem 0.8rem; border: 1px solid var(--line-soft); border-radius: var(--radius-s); }
.ib-proj.on { border-color: var(--accent); background: var(--accent-soft); }
.ib-acts { display: flex; flex-wrap: wrap; gap: 0.35rem 1rem; align-items: center; padding-left: 1.6rem; }
.ib-acts .check { font-weight: 400; }

/* ---------- Publieke intakepagina ---------- */

body.intake-page { background: var(--paper); }
.intake-top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; max-width: 820px; margin: 0 auto; padding: 1rem max(1rem, env(safe-area-inset-right, 0px)) 0 max(1rem, env(safe-area-inset-left, 0px)); }
.intake-top .logo img { height: 34px; width: auto; }
.intake-main { max-width: 820px; margin: 0 auto; padding: 1.25rem max(1rem, env(safe-area-inset-right, 0px)) 4rem max(1rem, env(safe-area-inset-left, 0px)); }
.intake-main h1 { font-size: clamp(1.5rem, 4vw, 2rem); }
.intake-main h2 { font-size: 1.15rem; }
.intake-progress { position: sticky; top: 0; z-index: 5; }
.idoc { display: grid; gap: 0.5rem; padding: 0.8rem 0.9rem; border: 1px solid var(--line-soft); border-radius: var(--radius-s); background: var(--paper); }
.idoc-head { display: flex; justify-content: space-between; gap: 0.75rem; align-items: flex-start; }
.idoc-head .hint { color: var(--muted); font-size: 0.85rem; margin: 0.15rem 0 0; }
.idoc-files { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.25rem; font-size: 0.92rem; }
.idoc-files li { display: flex; justify-content: space-between; gap: 0.5rem; align-items: center; overflow-wrap: anywhere; }
.idoc-up { justify-self: start; }

/* Drie filters (klant, project, activiteit) naast elkaar */
@media (min-width: 761px) {
  .sheet-filter .ms-button { width: 15rem; }
}

/* ---------- Snel kopiëren / verplaatsen in het raster ---------- */
td.cell .cellmenu {
  position: absolute; right: 2px; bottom: 2px;
  width: 20px; height: 18px; padding: 0; border: 0; border-radius: 4px;
  background: transparent; color: var(--muted); cursor: pointer;
  display: none; font-size: 14px; line-height: 14px;
}
td.cell .cellmenu::before { content: '⋯'; }
td.cell.s-draft .cellmenu, td.cell.s-rejected .cellmenu { display: block; }
td.cell:has(input.hrs:disabled) .cellmenu { display: none; }
td.cell .cellmenu:hover, td.cell .cellmenu[aria-expanded="true"] { background: var(--brand-soft); color: var(--ink); }
@media (hover: hover) {
  td.cell .cellmenu { opacity: 0; }
  td.cell:hover .cellmenu, td.cell:focus-within .cellmenu, td.cell .cellmenu[aria-expanded="true"] { opacity: 1; }
}
@media (pointer: coarse) { td.cell .cellmenu { width: 26px; height: 24px; } }
table.grid.month td.cell .cellmenu { width: 14px; height: 14px; font-size: 11px; line-height: 10px; right: 0; bottom: 0; }
td.cell.clip { box-shadow: inset 0 0 0 2px var(--brand); }
td.cell.clip-cut { box-shadow: inset 0 0 0 2px var(--brand); background-image: repeating-linear-gradient(135deg, transparent 0 6px, color-mix(in srgb, var(--brand) 12%, transparent) 6px 12px); }

.cell-pop {
  position: fixed; z-index: 70; width: min(330px, calc(100vw - 16px));
  background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius-m);
  box-shadow: 0 18px 44px -18px rgba(0, 20, 50, 0.45); padding: 0.75rem 0.85rem 0.8rem;
}
.cell-pop p { margin: 0; }
.cp-title { margin-bottom: 0.4rem !important; }
.cp-label { font-size: 0.8rem; font-weight: 600; color: var(--muted); margin: 0.55rem 0 0.3rem !important; }
.cp-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 0.3rem; }
.day-pick {
  display: grid; justify-items: center; gap: 0; padding: 0.3rem 0; min-height: 44px;
  font: inherit; font-size: 0.75rem; color: var(--muted); cursor: pointer;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-s);
}
.day-pick strong { font-size: 0.95rem; color: var(--ink); }
.day-pick:hover:not(:disabled) { border-color: var(--brand); background: var(--brand-soft); }
.day-pick.has { border-style: dashed; }
.day-pick:disabled { opacity: 0.35; cursor: not-allowed; }
.cp-all { width: 100%; margin-top: 0.4rem; }
.cp-hint { margin-top: 0.6rem !important; }

/* ---------- Omschrijving verplicht en interne notitie ---------- */
td.cell.needs-desc { background: color-mix(in srgb, var(--brand-soft) 70%, transparent); }
td.cell.needs-desc .note { opacity: 1; color: var(--brand-ink); font-weight: 700; }
td.cell.needs-desc .note::before { content: '!'; }
.dv-desc.missing, .le-desc-input.missing { border-color: var(--brand) !important; background: color-mix(in srgb, var(--brand-soft) 45%, var(--surface)); }
.dv-desc.missing::placeholder, .le-desc-input.missing::placeholder { color: var(--brand-ink); }
.note-wrap { margin-top: 0.35rem; }
.note-wrap summary { cursor: pointer; font-size: 0.82rem; color: var(--muted); width: max-content; }
.note-wrap summary:hover { color: var(--ink); }
.note-wrap[open] summary { margin-bottom: 0.25rem; }
.dv-note { display: block; width: 100%; min-height: 40px; resize: none; overflow: hidden; line-height: 1.4; font-size: 0.92rem; }
.le-note { font-size: 0.92rem; }
.le-note-ro { margin: 0.2rem 0 0; }
.missing-list { margin: 0.25rem 0 0.5rem; padding-left: 1.1rem; display: grid; gap: 0.2rem; }

/* ---------- Overzicht v2: twee doorlopende kolommen ---------- */
.dash-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 0.9rem; align-items: start; }
.dash-main, .dash-side { min-width: 0; }
.dash2 .stack > * + * { margin-top: 0.9rem; }
.todo { list-style: none; margin: 0; padding: 0 0.4rem 0.45rem; }
.todo li { display: grid; grid-template-columns: auto 1fr auto; gap: 0.8rem; align-items: center; padding: 0.7rem 0.75rem; border-radius: var(--radius-s); }
.todo li + li { border-top: 1px solid var(--line-soft); }
.todo-ic { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--line-soft); color: var(--muted); }
.todo-ic .ico { width: 18px; height: 18px; }
.todo-warn .todo-ic { background: color-mix(in srgb, var(--submitted) 16%, transparent); color: var(--submitted); }
.todo-accent .todo-ic { background: var(--brand-soft); color: var(--brand-ink); }
.todo-low .todo-ic { background: color-mix(in srgb, var(--rejected) 14%, transparent); color: var(--rejected); }
.todo-body { display: grid; gap: 0.1rem; min-width: 0; }
.todo-done { display: flex; gap: 0.8rem; align-items: center; padding: 0 1.25rem 1.2rem; }
.todo-done > .ico { width: 34px; height: 34px; padding: 7px; border-radius: 50%; background: color-mix(in srgb, var(--approved) 16%, transparent); color: var(--approved); flex: none; }
.todo-done > div { display: grid; gap: 0.1rem; }
table.data.team td { vertical-align: middle; }
.meter { display: inline-block; vertical-align: middle; width: 72px; height: 6px; border-radius: 3px; background: var(--line-soft); overflow: hidden; margin-right: 0.35rem; }
.meter > span { display: block; height: 100%; background: var(--brand); border-radius: 3px; }
.bud-list { list-style: none; margin: 0; padding: 0 1.1rem 0.6rem; display: grid; gap: 0.75rem; }
.bud-list li { display: grid; gap: 0.25rem; }
.bud-top { display: flex; justify-content: space-between; gap: 0.75rem; align-items: baseline; }
.bud-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.bud-left { font-size: 0.82rem; font-weight: 600; white-space: nowrap; color: var(--approved); }
.bud-list .lvl-warn .bud-left { color: var(--submitted); }
.bud-list .lvl-low .bud-left, .bud-list .lvl-over .bud-left { color: var(--rejected); }
.bud-list .bbar { display: block; min-width: 0; }
.bud-sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.month-box .facts { grid-template-columns: 1fr auto; }
.month-box .facts dd { text-align: right; }
@media (max-width: 980px) { .dash-grid { grid-template-columns: 1fr; } }
@media (max-width: 760px) {
  .todo li { grid-template-columns: auto 1fr; }
  .todo li > .btn { grid-column: 2; justify-self: start; }
  table.data.team th:nth-child(3), table.data.team td:nth-child(3) { display: table-cell; }
}

.bud-list li { gap: 0.15rem; }
.bud-list .bbar { margin-top: 0.2rem; }
.month-box > p { margin-top: 0.4rem !important; }

/* Planning: de projectplanner in een frame over de volle breedte onder het menu */
main.full { max-width: none; padding: 0; }
.planning-frame { display: block; width: 100%; border: 0; background: var(--bg, transparent); }
@media (max-width: 760px) { main.full { padding: 0; } }

/* ---------- Menu links, verticaal (desktop) ---------- */
.nav-label { display: none; }
.nav a .ico { display: none; }
@media (min-width: 761px) {
  .shell { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; }
  .shell > .topbar {
    position: sticky; top: 0; height: 100vh; z-index: 20;
    flex-direction: column; align-items: stretch; gap: 1rem;
    padding: calc(1rem + env(safe-area-inset-top, 0px)) 0.75rem 1rem;
    border-bottom: 0; border-right: 1px solid var(--line);
  }
  .shell > .topbar .brand { padding: 0 0.5rem; }
  .shell > .topbar .nav { flex-direction: column; gap: 1rem; overflow-x: visible; overflow-y: auto; }
  .nav-group { display: flex; flex-direction: column; gap: 0.15rem; }
  .shell .nav-label { display: block; padding: 0 0.6rem 0.2rem; font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
  .shell .nav a { display: flex; align-items: center; gap: 0.6rem; padding: 0.45rem 0.6rem; box-shadow: none; }
  .shell .nav a .ico { display: block; width: 18px; height: 18px; flex: none; }
  .shell .nav a[aria-current="page"] { box-shadow: inset 3px 0 0 var(--brand); }
  .shell .nav a .badge { margin-left: auto; }
  .shell > .topbar .userbox { flex-direction: column; align-items: stretch; gap: 0.5rem; padding: 0.75rem 0.5rem 0; border-top: 1px solid var(--line); margin-top: auto; }
  .shell > .topbar .userbox .user-link { display: flex; align-items: center; gap: 0.5rem; text-decoration: none; }
  .shell > main { width: 100%; }
}

.planning-head { padding: 0.75rem 1.25rem 0; }
.planning-head .tabs { margin-bottom: 0; }

/* ---------- Mobiel: verfijningen ---------- */
@media (max-width: 640px) {
  /* Tabbladen lopen door op een tweede regel in plaats van buiten beeld te vallen. */
  .tabs { flex-wrap: wrap; overflow-x: visible; gap: 0 0.1rem; }
  .tabs button { padding: 0.55rem 0.6rem; font-size: 0.95rem; }
  /* Knoppen in een kaartregel mogen naar de volgende regel. */
  .table-wrap > table.data td.right { display: flex; flex-wrap: wrap; gap: 0.4rem; }
  .table-wrap > table.data td.right .btn { margin-right: 0; }
  .table-wrap > table.data td.right.nowrap { white-space: normal; }
  /* Budgetbalken over de volle breedte van de kaart. */
  .table-wrap > table.data td:has(.budget-line) { grid-column: 1 / -1; }
  td .budget-line { min-width: 0; flex-wrap: wrap; }
  td .budget-line .bbar { flex-basis: 100%; }
  td .budget-line .budget-left { margin-left: auto; }
  /* Rapportage: periodeknoppen 2 x 2 en filters in twee kolommen. */
  #rperiod > .row { grid-template-columns: 1fr 1fr; }
  #rfilter { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; }
  #rfilter .field, #rfilter select { width: 100%; min-width: 0; }
  #rfilter > .btn { grid-column: 1 / -1; }
  /* Kopregel met titel en knoppen: knoppen onder de titel. */
  .stack > .row.spread { flex-wrap: wrap; gap: 0.6rem; }
  /* Dialogen: velden onder elkaar. */
  dialog .form-grid { grid-template-columns: 1fr; }
}
/* Dagkeuze in Uren: zeven dagen passen op een telefoon. */
@media (max-width: 420px) {
  .day-chip { flex: 1 1 0; min-width: 2.5rem; padding-left: 0.1rem; padding-right: 0.1rem; }
  .day-strip { gap: 0.25rem; }
}
@media (max-width: 640px) { .hide-sm { display: none; } }

/* Melding nieuwe versie */
.toast.update { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.toast.update .btn { background: var(--paper); color: var(--ink); border-color: transparent; }
@media (max-width: 760px) { body.has-tabbar #toasts { bottom: calc(76px + env(safe-area-inset-bottom, 0px)); left: 1rem; } }

/* Logo licht op de achtergrond (achter alle inhoud, niet klikbaar) */
body::before {
  content: ''; position: fixed; z-index: -1; pointer-events: none;
  right: -4vw; bottom: -6vh; width: min(44vw, 560px); aspect-ratio: 294 / 328;
  background: url('/assets/logo-mark.png') no-repeat center / contain;
  opacity: 0.07;
}
@media (min-width: 761px) { body:has(.shell)::before { right: 2vw; } }
@media (max-width: 760px) { body::before { width: 78vw; right: -18vw; bottom: 12vh; opacity: 0.05; } }
@media (prefers-color-scheme: dark) { body::before { opacity: 0.07; filter: brightness(2.6) saturate(0.7); } }
body.intake-page::before { display: none; }

/* Voortgang: verbruik van het budget met een streep op de verstreken doorlooptijd */
.pmeter { position: relative; display: inline-block; vertical-align: middle; width: 96px; height: 8px; border-radius: 4px; background: var(--line-soft); margin-right: 0.35rem; }
.pmeter > span { display: block; height: 100%; border-radius: 4px; background: var(--approved); max-width: 100%; }
.pmeter.pm-let_op > span, .pmeter.pm-niet_gestart > span, .pmeter.pm-loopt_uit > span { background: var(--submitted); }
.pmeter.pm-overschreden > span { background: var(--rejected); }
.pmeter > i { position: absolute; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; background: var(--ink, currentColor); border-radius: 1px; }
ul.plain { margin: 0.5rem 0 0; padding-left: 1.1rem; }
ul.plain li { margin: 0.2rem 0; }
.neg { color: var(--rejected); font-weight: 600; }
/* Info-knop bij een activiteit (uitleg uit de planning) */
.info-dot { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; margin: 0 .3rem 0 0; padding: 0; border-radius: 50%; border: 0; background: var(--brand); color: #fff; font: italic 600 11px/1 Georgia, serif; cursor: pointer; vertical-align: middle; }
.info-dot:hover { filter: brightness(1.1); }
/* Rollen: naam, medewerkers en knoppen in de eerste kolom, zodat de tabel niet breder wordt dan het scherm */
.role-cell { min-width: 17rem; }
.role-actions { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .5rem; align-items: center; }
.role-actions .icon-only { padding: .3rem .45rem; }
.role-actions .icon-only .ico { width: 16px; height: 16px; }

/* Bezetting: per persoon per week */
.occ-table th.num, .occ-table td.occ { text-align: center; min-width: 4.2rem; }
.occ-table td.occ { font-weight: 600; font-size: .85rem; border-left: 2px solid var(--surface, #fff); }
.occ-table .occ-h { display: block; font-weight: 400; font-size: .72rem; opacity: .75; }
.occ-free { background: color-mix(in srgb, var(--approved) 10%, transparent); }
.occ-ok { background: color-mix(in srgb, var(--approved) 24%, transparent); }
.occ-full { background: color-mix(in srgb, var(--submitted) 26%, transparent); }
.occ-over { background: color-mix(in srgb, var(--rejected) 28%, transparent); color: var(--rejected); }
.occ-row { cursor: pointer; }
.occ-row .tog-btn { border: 0; background: none; padding: 0 .2rem; cursor: pointer; color: inherit; }
.occ-sub td { font-size: .82rem; background: var(--line-soft, #f3f5f8); }
.occ-sub .sub-name { padding-left: 2rem; }
.occ-group td { background: var(--line-soft, #f3f5f8); }
.occ-key { display: inline-block; width: .8rem; height: .8rem; border-radius: 3px; vertical-align: middle; margin-right: .15rem; }
.occ-table td:first-child, .occ-table th:first-child { position: sticky; left: 0; background: var(--surface, #fff); z-index: 1; min-width: 13rem; }
.occ-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
@media (max-width: 640px) { .occ-table td:first-child, .occ-table th:first-child { min-width: 9rem; } }

/* Omzetprognose: gestapelde staven per maand (kleuren volgens het datavisualisatie-palet, gevalideerd voor kleurenblindheid) */
.fc-chart { --fc-real: #2a78d6; --fc-exp: #eb6834; --fc-pipe: #1baf7a; display: grid; grid-template-columns: auto 1fr; gap: .5rem; margin-top: .75rem; }
@media (prefers-color-scheme: dark) { .fc-chart { --fc-real: #3987e5; --fc-exp: #d95926; --fc-pipe: #199e70; } }
.fc-y { display: flex; flex-direction: column; justify-content: space-between; height: 220px; font-size: .72rem; color: var(--muted); text-align: right; padding-bottom: 1.3rem; }
.fc-plot { display: flex; align-items: stretch; gap: 6px; height: 220px; border-bottom: 1px solid var(--line); background: linear-gradient(var(--line-soft) 1px, transparent 1px) 0 0 / 100% 50%; overflow-x: auto; }
.fc-col { flex: 1 1 0; min-width: 28px; display: flex; flex-direction: column; justify-content: flex-end; position: relative; padding-bottom: 1.3rem; outline: none; }
.fc-col:hover .fc-stack, .fc-col:focus .fc-stack { filter: brightness(1.08); }
.fc-col.now .fc-x { font-weight: 700; color: var(--ink); }
.fc-stack { display: flex; flex-direction: column-reverse; justify-content: flex-start; height: 100%; gap: 2px; }
.fc-seg { display: block; min-height: 2px; }
.fc-seg:last-child { border-radius: 4px 4px 0 0; }
.fc-seg.fc-real, .fc-legend .fc-real { background: var(--fc-real); }
.fc-seg.fc-exp, .fc-legend .fc-exp { background: var(--fc-exp); }
.fc-seg.fc-pipe, .fc-legend .fc-pipe { background: repeating-linear-gradient(45deg, var(--fc-pipe) 0 4px, color-mix(in srgb, var(--fc-pipe) 55%, transparent) 4px 7px); }
.fc-x { position: absolute; bottom: 0; left: 0; right: 0; text-align: center; font-size: .72rem; color: var(--muted); white-space: nowrap; }
.fc-legend { display: flex; flex-wrap: wrap; gap: .9rem; font-size: .82rem; color: var(--muted); }
.fc-legend i { display: inline-block; width: .8rem; height: .8rem; border-radius: 3px; margin-right: .35rem; vertical-align: -1px; }
.fc-legend { --fc-real: #2a78d6; --fc-exp: #eb6834; --fc-pipe: #1baf7a; }
@media (prefers-color-scheme: dark) { .fc-legend { --fc-real: #3987e5; --fc-exp: #d95926; --fc-pipe: #199e70; } }
tr.row-now td { background: color-mix(in srgb, var(--brand) 7%, transparent); }
.fc-stack { width: 62%; max-width: 56px; margin: 0 auto; }

/* ---------- Trajecten: de keten van intake tot factuur als flow ---------- */
.process-flow { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, 1fr); gap: 0; counter-reset: none; }
.process-flow li { position: relative; display: flex; }
.process-flow li + li::before { content: ""; position: absolute; left: -9px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%) rotate(45deg); border-top: 2px solid var(--line); border-right: 2px solid var(--line); background: transparent; z-index: 1; }
.process-step { flex: 1; display: flex; flex-direction: column; align-items: flex-start; gap: .2rem; text-align: left; font: inherit; color: inherit; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-s); margin: 0 .55rem; padding: .75rem .8rem; cursor: pointer; }
.process-step:hover { border-color: var(--brand); }
.process-step.on { border-color: var(--brand); background: var(--brand-soft); }
.process-ic { display: inline-flex; width: 30px; height: 30px; border-radius: 50%; align-items: center; justify-content: center; background: var(--accent-soft); color: var(--accent); }
.process-n { font-weight: 700; }
.process-d { font-size: .78rem; color: var(--muted); line-height: 1.3; }
.process-c { margin-top: auto; padding-top: .3rem; font-size: .8rem; font-weight: 600; color: var(--brand-ink); }
@media (max-width: 900px) {
  .process-flow { grid-template-columns: 1fr 1fr; gap: .5rem; }
  .process-flow li + li::before { display: none; }
  .process-step { margin: 0; }
}

.flow { list-style: none; margin: .75rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(6, 1fr); }
.flow-step { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; padding: 0 .3rem; min-width: 0; }
.flow-step::before { content: ""; position: absolute; top: 13px; left: -50%; right: 50%; height: 3px; background: var(--line); z-index: 0; }
.flow-step:first-child::before { display: none; }
.flow-step.fs-klaar::before, .flow-step.fs-current::before, .flow-step.fs-bezig::before { background: var(--approved); }
.flow-dot { position: relative; z-index: 1; width: 28px; height: 28px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; border: 2px solid var(--line); background: var(--surface); color: var(--muted); font-weight: 700; }
.flow-dot .ico { width: 16px; height: 16px; }
.fs-klaar .flow-dot { background: var(--approved); border-color: var(--approved); color: #fff; }
.fs-bezig .flow-dot { border-color: var(--brand); background: var(--brand-soft); }
.fs-current .flow-dot { border-color: var(--brand); background: var(--brand); box-shadow: 0 0 0 5px color-mix(in srgb, var(--brand) 22%, transparent); }
.fs-overgeslagen .flow-dot { border-style: dashed; }
.fs-mislukt .flow-dot { background: var(--rejected); border-color: var(--rejected); color: #fff; }
.flow-label { margin-top: .35rem; font-size: .82rem; font-weight: 600; }
.fs-overgeslagen .flow-label, .fs-todo .flow-label { color: var(--muted); font-weight: 500; }
.fs-current .flow-label { color: var(--brand-ink); }
.flow-sub { font-size: .74rem; color: var(--muted); line-height: 1.25; margin-top: .1rem; overflow-wrap: anywhere; }
.flow-warn { font-size: .72rem; color: var(--rejected); margin-top: .15rem; display: inline-flex; gap: .2rem; align-items: center; }
.flow-warn .ico { width: 12px; height: 12px; }
.traj { padding: .9rem 1rem 1rem; }
.traj-head { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; }
.traj-name { font-weight: 700; font-size: 1.02rem; color: var(--ink); text-decoration: none; }
.traj-name:hover { text-decoration: underline; }
.traj-done { opacity: .78; }
.traj-banner .flow { margin-top: .5rem; }
/* Op een smal scherm: de fasen onder elkaar, met de lijn verticaal */
@media (max-width: 640px) {
  .flow { grid-template-columns: 1fr; gap: .1rem; }
  .flow-step { flex-direction: row; align-items: flex-start; text-align: left; gap: .6rem; padding: .25rem 0; flex-wrap: wrap; }
  .flow-step::before { top: -50%; bottom: 50%; left: 13px; right: auto; width: 3px; height: auto; }
  .flow-label { margin-top: .25rem; min-width: 6.5rem; }
  .flow-sub { margin-top: .3rem; flex: 1; }
  .flow-warn { flex-basis: 100%; padding-left: 2.4rem; }
  .traj-head { flex-direction: column; }
}

/* Overstap naar een ander bedrijf */
.checklist { list-style: none; padding: 0; margin: .25rem 0 1rem; display: grid; gap: .35rem; }
.checklist li { display: flex; gap: .5rem; align-items: baseline; flex-wrap: wrap; }
.warn-text { color: var(--warn, #b45309); }
#transition h3 { font-size: 1rem; margin: 1rem 0 .4rem; }

/* Maandafsluiting */
.mc-month { min-width: 9rem; text-align: center; }
.mc-num { display: inline-grid; place-items: center; width: 1.5rem; height: 1.5rem; border-radius: 50%; background: var(--surface-2, #eef1f6); font-size: .8rem; margin-right: .35rem; }
.mc-done .mc-num { background: var(--ok-bg, #e3f4ea); }
.mc-step h2 { font-size: 1.05rem; margin: 0 0 .25rem; }
.mc-step p { margin: 0; }
.mc-list { list-style: none; margin: .75rem 0 0; padding: 0; display: grid; gap: .3rem; }
.mc-list li { display: grid; grid-template-columns: 1fr auto 6rem; gap: .75rem; align-items: baseline; }
.mc-list li strong { text-align: right; }
.mc-table { margin-top: .75rem; }
@media (min-width: 641px) { .flow.mc-flow { grid-template-columns: repeat(5, 1fr); } }
@media (max-width: 640px) { .mc-list li { grid-template-columns: 1fr auto; } .mc-list li span.muted { display: none; } }
.mc-flow .flow-step::before { background: var(--line); }
.mc-flow .fs-klaar + .fs-klaar::before, .mc-flow .fs-klaar + .fs-bezig::before, .mc-flow .fs-klaar + .fs-current::before { background: var(--approved); }
.mail-prev { border: 1px solid var(--line); border-radius: 8px; padding: .5rem .75rem; }
.mail-prev pre { white-space: pre-wrap; font: inherit; font-size: .85rem; margin: .5rem 0 0; }

/* Klantportaal */
.cp-meter { display: inline-block; width: 7rem; height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; vertical-align: middle; }
.cp-meter span { display: block; height: 100%; background: var(--approved); }
.cp-tiles { margin-top: .75rem; }
.cp-tiles .tile .cp-meter { width: 100%; margin-top: .4rem; }
.cp-phases { display: flex; gap: .35rem; flex-wrap: wrap; justify-content: flex-end; }
.cp-story { margin-top: .3rem; color: var(--text); font-style: italic; max-width: 60ch; }
.cp-project h2 { margin: 0; }
