/* ==========================================================================
   Werkbon – componenten en layout (gebruikt uitsluitend tokens.css)
   ========================================================================== */

/* ---------- Basis ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: var(--lh-base);
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p, figure { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
a { color: var(--color-primary); }
button, input, select, textarea { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }
fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
[hidden] { display: none !important; }

.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.tnum { font-variant-numeric: tabular-nums; }
.text-danger { color: var(--color-danger); font-weight: var(--fw-semibold); }

.icon {
  width: 1em; height: 1em; flex: none;
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}

:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
[tabindex="-1"]:focus { outline: none; }

.skip-link {
  position: absolute; left: var(--space-2); top: -120px; z-index: 200;
  padding: var(--space-2) var(--space-3); border-radius: var(--radius);
  background: var(--color-surface); color: var(--color-primary); font-weight: var(--fw-semibold);
  box-shadow: var(--shadow-lg);
}
.skip-link:focus { top: var(--space-2); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ---------- Knoppen ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: var(--control-h); padding: 0 var(--space-4);
  border: 1px solid transparent; border-radius: var(--radius);
  font-size: var(--fs-base); font-weight: var(--fw-semibold); line-height: 1.2;
  text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: background-color .12s, border-color .12s;
}
.btn .icon { font-size: 1.125em; }
.btn--primary { background: var(--color-primary); color: var(--color-on-primary); }
.btn--primary:hover { background: var(--color-primary-hover); }
.btn--primary:active { background: var(--color-primary-active); }
.btn--secondary { background: var(--color-surface); border-color: var(--color-border-strong); color: var(--color-text); }
.btn--secondary:hover { background: var(--color-surface-sunken); }
.btn--danger { background: var(--color-danger); color: #fff; }
.btn--danger:hover { background: var(--color-danger-hover); }
.btn--sm { min-height: 30px; padding: 0 var(--space-3); font-size: var(--fs-sm); }
.btn--touch { min-height: var(--touch-h); padding: 0 var(--space-5); font-size: var(--fs-md); }
.btn--block { width: 100%; white-space: normal; text-align: center; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

.icon-btn {
  display: inline-grid; place-items: center; flex: none;
  width: 36px; height: 36px; padding: 0;
  border: 1px solid transparent; border-radius: var(--radius);
  background: transparent; color: var(--color-text-muted);
  font-size: 1.125rem; cursor: pointer; text-decoration: none;
}
.icon-btn:hover { background: var(--color-surface-sunken); color: var(--color-text); }
.icon-btn--lg { width: 48px; height: 48px; font-size: 1.375rem; }

.link-btn {
  padding: 0; border: 0; background: none; cursor: pointer;
  color: var(--color-primary); font-weight: var(--fw-semibold);
  text-decoration: underline; text-underline-offset: 2px;
}

/* ---------- Status, tags en avatars ---------- */
.st-nieuw      { --st-bg: var(--status-nieuw-bg);      --st-fg: var(--status-nieuw-fg);      --st-dot: var(--status-nieuw-dot);      --st-border: var(--status-nieuw-border); }
.st-ingepland  { --st-bg: var(--status-ingepland-bg);  --st-fg: var(--status-ingepland-fg);  --st-dot: var(--status-ingepland-dot);  --st-border: var(--status-ingepland-border); }
.st-uitvoering { --st-bg: var(--status-uitvoering-bg); --st-fg: var(--status-uitvoering-fg); --st-dot: var(--status-uitvoering-dot); --st-border: var(--status-uitvoering-border); }
.st-controle   { --st-bg: var(--status-controle-bg);   --st-fg: var(--status-controle-fg);   --st-dot: var(--status-controle-dot);   --st-border: var(--status-controle-border); }
.st-afgerond   { --st-bg: var(--status-afgerond-bg);   --st-fg: var(--status-afgerond-fg);   --st-dot: var(--status-afgerond-dot);   --st-border: var(--status-afgerond-border); }

.status {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 1px 10px 1px 8px; border-radius: var(--radius-full);
  border: 1px solid var(--st-border); background: var(--st-bg); color: var(--st-fg);
  font-size: var(--fs-sm); font-weight: var(--fw-semibold); line-height: 1.5; white-space: nowrap;
}
.status__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--st-dot); }
.status--lg { padding: 3px 12px 3px 10px; font-size: var(--fs-base); }

.tag {
  display: inline-flex; align-items: center; padding: 0 8px; border-radius: var(--radius-sm);
  font-size: var(--fs-xs); font-weight: var(--fw-bold); line-height: 20px; white-space: nowrap;
}
.tag--spoed { background: var(--color-danger-soft); color: var(--color-danger); border: 1px solid var(--color-danger-border); }
.tag--next { background: var(--color-primary-soft); color: var(--color-primary-active); border: 1px solid var(--color-primary-border); }

.avatar {
  display: inline-grid; place-items: center; flex: none;
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--avatar, #64748B); color: #fff;
  font-size: 11px; font-weight: var(--fw-bold); letter-spacing: .02em;
}
.avatar--lg { width: 40px; height: 40px; font-size: 14px; }
.avatar--empty { background: var(--color-surface-sunken); color: var(--color-text-subtle); border: 1px dashed var(--color-border-strong); }
.person { display: inline-flex; align-items: center; gap: var(--space-2); }
.person--empty { color: var(--color-text-subtle); }

/* ---------- Formulieren ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field__label { font-size: var(--fs-sm); font-weight: var(--fw-semibold); color: var(--color-text); }
.field__opt { font-weight: 400; color: var(--color-text-subtle); }
.field__hint { font-size: var(--fs-xs); color: var(--color-text-subtle); }

.input, .select, .textarea {
  width: 100%; min-height: var(--control-h); padding: 0 var(--space-3);
  border: 1px solid var(--color-border-strong); border-radius: var(--radius);
  background: var(--color-surface); color: var(--color-text); font-size: var(--fs-base);
}
.textarea { field-sizing: content; max-height: 320px; min-height: 96px; padding: var(--space-2) var(--space-3); line-height: var(--lh-base); resize: vertical; }
.select {
  appearance: none; -webkit-appearance: none; padding-right: 32px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23475467' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 16px;
}
.input:hover, .select:hover, .textarea:hover { border-color: #AEB9C9; }
.input:focus-visible, .select:focus-visible, .textarea:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 0; border-color: var(--color-primary); }
.input::placeholder, .textarea::placeholder { color: #7A8699; }
[aria-invalid="true"] { border-color: var(--color-danger) !important; }

.form-error {
  padding: var(--space-2) var(--space-3); border-radius: var(--radius);
  background: var(--color-danger-soft); border: 1px solid var(--color-danger-border);
  color: var(--color-danger); font-weight: var(--fw-semibold);
}
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3) var(--space-4); }
.form-grid .span-2 { grid-column: 1 / -1; }
.form-section-title {
  font-size: var(--fs-xs); font-weight: var(--fw-bold); letter-spacing: .05em; text-transform: uppercase;
  color: var(--color-text-subtle); padding-top: var(--space-1);
}

.search { position: relative; }
.search .icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--color-text-subtle); font-size: 1rem; pointer-events: none; }
.search .input { padding-left: 34px; }

.stepper {
  display: inline-flex; align-items: center; flex: none;
  border: 1px solid var(--color-border-strong); border-radius: var(--radius);
  background: var(--color-surface); overflow: hidden;
}
.stepper button {
  display: grid; place-items: center; width: 36px; height: 36px; padding: 0;
  border: 0; background: var(--color-surface); cursor: pointer; font-size: 1rem; color: var(--color-text);
}
.stepper button:hover { background: var(--color-surface-sunken); }
.stepper button:disabled { color: #A0AABA; cursor: not-allowed; background: var(--color-surface); }
.stepper button:focus-visible { outline-offset: -2px; }
.stepper__val { min-width: 64px; padding: 0 var(--space-1); text-align: center; font-weight: var(--fw-semibold); font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
.stepper__input { width: 100%; min-width: 0; height: 36px; border: 0; text-align: center; font-weight: var(--fw-semibold); background: transparent; -moz-appearance: textfield; }
.stepper__input::-webkit-inner-spin-button, .stepper__input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.stepper__input:focus-visible { outline-offset: -2px; }
.stepper--field { display: flex; width: 100%; }

.chips { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.chip {
  min-height: 34px; padding: 5px 12px; border: 1px solid var(--color-border-strong); border-radius: var(--radius-full);
  background: var(--color-surface); font-size: var(--fs-sm); font-weight: var(--fw-medium); text-align: left; cursor: pointer;
}
.chip:hover { border-color: var(--color-primary); color: var(--color-primary-active); }
.chip[aria-pressed="true"] { background: var(--color-primary-soft); border-color: var(--color-primary); color: var(--color-primary-active); }

/* ---------- Demo-balk ---------- */
.demo-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3);
  padding: var(--space-2) var(--space-4);
  background: var(--color-demo-bar); color: #E2E8F0; font-size: var(--fs-sm);
}
.demo-badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px; border-radius: var(--radius-sm);
  background: var(--color-demo); color: var(--color-demo-text);
  font-size: var(--fs-xs); font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
}
.demo-bar__text { color: #CBD5E1; }
.seg { display: inline-flex; padding: 2px; border-radius: var(--radius); background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.18); }
.seg button {
  min-height: 30px; padding: 0 12px; border: 0; border-radius: 6px;
  background: transparent; color: #E2E8F0; font-weight: var(--fw-semibold); cursor: pointer;
}
.seg button:hover { background: rgba(255,255,255,.1); }
.seg button[aria-pressed="true"] { background: #fff; color: var(--color-text); }
.demo-select {
  min-height: 32px; padding: 0 28px 0 10px; border-radius: var(--radius-sm);
  border: 1px solid rgba(255,255,255,.25); background-color: #26324A; color: #fff; font-size: var(--fs-sm);
  appearance: none; -webkit-appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23E2E8F0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 8px center; background-size: 14px;
}
.demo-bar__reset {
  display: inline-flex; align-items: center; gap: 6px; margin-left: auto;
  min-height: 30px; padding: 0 10px; border-radius: var(--radius-sm);
  border: 1px solid rgba(255,255,255,.25); background: none; color: #E2E8F0; cursor: pointer;
}
.demo-bar__reset:hover { background: rgba(255,255,255,.1); }
.demo-bar :focus-visible { outline-color: #93B4FF; }
@media (max-width: 640px) {
  .demo-bar__text { display: none; }
  .demo-bar__reset span { display: none; }
  .demo-bar__reset { min-width: 32px; justify-content: center; }
}

/* ---------- Kantoor: shell ---------- */
.shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  display: flex; flex-direction: column;
  padding: var(--space-4) var(--space-3);
  background: var(--color-surface); border-right: 1px solid var(--color-border);
}
.brand { display: flex; align-items: center; gap: var(--space-2); font-size: var(--fs-lg); font-weight: var(--fw-bold); }
.sidebar .brand { padding: var(--space-1) var(--space-2) var(--space-5); }
.brand-mark {
  display: grid; place-items: center; width: 30px; height: 30px; border-radius: var(--radius);
  background: var(--color-primary); color: #fff; font-size: 1rem;
}
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav__item {
  display: flex; align-items: center; gap: var(--space-3); width: 100%;
  min-height: 40px; padding: 0 var(--space-3);
  border: 0; border-radius: var(--radius); background: none;
  color: var(--color-text-muted); font-weight: var(--fw-medium); text-align: left; text-decoration: none; cursor: pointer;
}
.nav__item .icon { font-size: 1.125rem; }
.nav__item:hover { background: var(--color-surface-sunken); color: var(--color-text); }
.nav__item.is-active { background: var(--color-primary-soft); color: var(--color-primary-active); font-weight: var(--fw-semibold); }
.nav__count {
  margin-left: auto; min-width: 22px; padding: 0 6px; border-radius: var(--radius-full);
  background: var(--status-controle-bg); color: var(--status-controle-fg); border: 1px solid var(--status-controle-border);
  font-size: var(--fs-xs); font-weight: var(--fw-bold); text-align: center; line-height: 18px;
}
.nav__later { margin-left: auto; font-size: var(--fs-xs); font-weight: var(--fw-medium); color: var(--color-text-subtle); }
.sidebar__foot {
  display: flex; align-items: center; gap: var(--space-3); margin-top: auto;
  padding: var(--space-3) var(--space-2) 0; border-top: 1px solid var(--color-border);
}
.shell__main { min-width: 0; }
.topbar { display: none; }
.scrim { position: fixed; inset: 0; z-index: 30; background: rgba(23, 32, 51, .4); }

.page { max-width: 1280px; margin: 0 auto; padding: var(--space-6) var(--space-8) var(--space-10); }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: var(--space-4); margin-bottom: var(--space-5); }
.page-title { font-size: var(--fs-2xl); font-weight: var(--fw-bold); line-height: var(--lh-tight); letter-spacing: -.01em; }
.page-sub { margin-top: var(--space-1); color: var(--color-text-muted); }

@media (max-width: 1023px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: fixed; inset: 0 auto 0 0; z-index: 40; width: min(280px, 85vw); height: 100%;
    transform: translateX(-100%); visibility: hidden; box-shadow: var(--shadow-lg);
    transition: transform .2s ease, visibility .2s;
  }
  .shell.is-menu-open .sidebar { transform: none; visibility: visible; }
  .topbar {
    position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: var(--space-2);
    height: 56px; padding: 0 var(--space-3);
    background: var(--color-surface); border-bottom: 1px solid var(--color-border);
  }
  .topbar .icon-btn { width: var(--touch-min); height: var(--touch-min); }
  .page { padding: var(--space-5) var(--space-4) var(--space-10); }
}
@media (max-width: 640px) {
  body { font-size: 15px; }
  .page-title { font-size: var(--fs-xl); }
  .page-head .btn { width: 100%; min-height: var(--touch-min); }
  .input, .select, .textarea { font-size: 16px; min-height: var(--touch-min); }
  .textarea { min-height: 110px; }
  .btn { min-height: var(--touch-min); }
  .btn--sm { min-height: 40px; }
  .chip { min-height: var(--touch-min); }
  .icon-btn { width: var(--touch-min); height: var(--touch-min); }
  .stepper button { width: var(--touch-min); height: var(--touch-min); }
  .stepper__input { height: var(--touch-min); }
}

/* ---------- Kantoor: overzicht ---------- */
.notice {
  display: flex; align-items: center; gap: var(--space-3);
  margin-bottom: var(--space-4); padding: var(--space-3) var(--space-4);
  background: var(--st-bg); border: 1px solid var(--st-border); border-radius: var(--radius);
}
.notice > .icon { font-size: 1.25rem; color: var(--st-fg); }
.notice p { flex: 1; min-width: 0; }
@media (max-width: 640px) { .notice { flex-wrap: wrap; } .notice .btn { width: 100%; } }

.filters {
  display: grid; grid-template-columns: minmax(220px, 2fr) repeat(3, minmax(150px, 1fr)); gap: var(--space-3);
  padding: var(--space-4); background: var(--color-surface);
  border: 1px solid var(--color-border); border-radius: var(--radius);
}
@media (max-width: 900px) {
  .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filters .field--search { grid-column: 1 / -1; }
}
@media (max-width: 360px) { .filters { grid-template-columns: minmax(0, 1fr); } }

.results-bar {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
  min-height: 40px; padding: var(--space-2) var(--space-1);
  font-size: var(--fs-sm); color: var(--color-text-muted);
}

.table-wrap { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius); overflow: hidden; }
.table { width: 100%; border-collapse: collapse; }
.table th {
  padding: var(--space-2) var(--space-3); text-align: left; white-space: nowrap;
  font-size: var(--fs-xs); font-weight: var(--fw-semibold); letter-spacing: .04em; text-transform: uppercase;
  color: var(--color-text-subtle); background: var(--color-surface-alt); border-bottom: 1px solid var(--color-border);
}
.table td { padding: var(--space-3); border-bottom: 1px solid var(--color-border); vertical-align: top; }
.table th:first-child, .table td:first-child { padding-left: var(--space-4); }
.table th:last-child, .table td:last-child { padding-right: var(--space-4); }
.cell-plaats-inline { display: none; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr { cursor: pointer; }
.table tbody tr:hover { background: var(--color-surface-alt); }
.table tbody tr:focus-within { background: var(--color-primary-soft); }
.row-link { font-weight: var(--fw-semibold); color: var(--color-text); text-decoration: none; white-space: nowrap; font-variant-numeric: tabular-nums; }
.row-link:hover { color: var(--color-primary); text-decoration: underline; }
.cell-strong { font-weight: var(--fw-semibold); }
.cell-sub { font-size: var(--fs-sm); color: var(--color-text-subtle); }
.cell-nowrap { white-space: nowrap; }
.cell-work { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }

/* Tabel of kaarten op basis van de beschikbare breedte (zijbalk telt mee) */
.list-area { container-type: inline-size; }
.card-list { display: none; }
@container (max-width: 1040px) {
  .col-plaats { display: none; }
  .cell-plaats-inline { display: inline; }
}
@container (max-width: 820px) {
  .table-wrap { display: none; }
  .card-list { display: flex; flex-direction: column; gap: var(--space-2); }
}
.wb-card {
  display: block; padding: var(--space-3) var(--space-4);
  background: var(--color-surface); border: 1px solid var(--color-border); border-left: 4px solid var(--st-dot);
  border-radius: var(--radius); color: inherit; text-decoration: none;
}
.wb-card:hover { border-color: var(--color-border-strong); border-left-color: var(--st-dot); }
.wb-card__top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2); margin-bottom: var(--space-1); }
.wb-card__id { font-size: var(--fs-sm); font-weight: var(--fw-semibold); color: var(--color-text-muted); font-variant-numeric: tabular-nums; }
.wb-card__title { font-size: var(--fs-md); font-weight: var(--fw-semibold); line-height: 1.35; }
.wb-card__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin-top: var(--space-1); font-size: var(--fs-sm); color: var(--color-text-muted); }
.wb-card__meta .icon { margin-right: 4px; vertical-align: -2px; }

.empty-state {
  display: flex; flex-direction: column; align-items: center; gap: var(--space-2);
  padding: var(--space-10) var(--space-4); text-align: center;
  background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius);
  color: var(--color-text-muted);
}
.empty-state__title { font-size: var(--fs-md); font-weight: var(--fw-semibold); color: var(--color-text); }

/* ---------- Werkbondetail ---------- */
.back-link {
  display: inline-flex; align-items: center; gap: 4px; min-height: 32px; margin-bottom: var(--space-2);
  color: var(--color-text-muted); font-weight: var(--fw-medium); text-decoration: none;
}
.back-link:hover { color: var(--color-primary); }
.detail-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: var(--space-3) var(--space-4); margin-bottom: var(--space-4); }
.detail-head__main { min-width: 0; flex: 1 1 320px; }
.detail-head__id { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin-bottom: var(--space-1); font-size: var(--fs-sm); font-weight: var(--fw-semibold); color: var(--color-text-muted); font-variant-numeric: tabular-nums; }
.detail-head__meta { margin-top: var(--space-1); color: var(--color-text-muted); }

.next {
  display: flex; align-items: center; gap: var(--space-4);
  margin-bottom: var(--space-5); padding: var(--space-4) var(--space-5);
  background: var(--color-surface); border: 1px solid var(--color-border); border-left: 4px solid var(--st-dot);
  border-radius: var(--radius);
}
.next--primary { background: var(--color-primary-soft); border-color: var(--color-primary-border); border-left-color: var(--color-primary); }
.next__body { flex: 1; min-width: 0; }
.next__label { font-size: var(--fs-xs); font-weight: var(--fw-bold); letter-spacing: .05em; text-transform: uppercase; color: var(--color-text-subtle); }
.next__title { font-size: var(--fs-lg); font-weight: var(--fw-bold); line-height: 1.3; }
.next__text { margin-top: 2px; color: var(--color-text-muted); }
.next__checks { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: var(--space-2); font-size: var(--fs-sm); }
.next__checks li { display: inline-flex; align-items: center; gap: 6px; }
.next__actions { display: flex; flex-wrap: wrap; gap: var(--space-2); flex: none; }
@media (max-width: 760px) {
  .next { flex-direction: column; align-items: stretch; padding: var(--space-4); }
  .next__actions { flex-direction: column-reverse; }
  .next__actions .btn { width: 100%; min-height: var(--touch-min); }
}

.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: var(--space-5); align-items: start; }
.detail-main, .detail-side { display: flex; flex-direction: column; gap: var(--space-4); min-width: 0; }
.detail-main { grid-column: 1; grid-row: 1; }
.detail-side { grid-column: 2; grid-row: 1; }
@media (max-width: 1100px) {
  .detail-grid { grid-template-columns: minmax(0, 1fr); }
  .detail-main, .detail-side { grid-column: auto; grid-row: auto; }
  .detail-side { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
}

/* ---------- Panelen ---------- */
.panel { min-width: 0; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius); }
.panel__head {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2) var(--space-3);
  min-height: 52px; padding: var(--space-2) var(--space-4); border-bottom: 1px solid var(--color-border);
}
.panel__title { display: flex; align-items: center; gap: var(--space-2); font-size: var(--fs-md); font-weight: var(--fw-semibold); }
.panel__title .icon { color: var(--color-text-subtle); }
.panel__count { font-size: var(--fs-sm); font-weight: var(--fw-medium); color: var(--color-text-subtle); }
.panel__body { padding: var(--space-4); }
.panel__body--flush { padding: 0; }
.panel__foot {
  display: flex; justify-content: space-between; gap: var(--space-3);
  padding: var(--space-3) var(--space-4); border-top: 1px solid var(--color-border);
  background: var(--color-surface-alt); border-radius: 0 0 var(--radius) var(--radius); font-weight: var(--fw-semibold);
}
.empty { color: var(--color-text-subtle); font-size: var(--fs-sm); }
.empty--pad { padding: var(--space-4); }

.dl { margin: 0; display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: var(--space-2) var(--space-4); }
.dl dt { color: var(--color-text-subtle); }
.dl dd { margin: 0; font-weight: var(--fw-medium); overflow-wrap: anywhere; }
.address { font-weight: var(--fw-medium); margin-bottom: var(--space-3); }
.callout {
  margin-top: var(--space-3); padding: var(--space-2) var(--space-3);
  background: var(--color-warning-soft); border: 1px solid var(--color-warning-border); border-radius: var(--radius-sm);
  color: var(--color-warning-text); font-size: var(--fs-sm);
}

.melding { margin-bottom: var(--space-4); padding: var(--space-3); border-radius: var(--radius-sm); background: var(--color-surface-sunken); }
.melding__label { margin-bottom: 2px; font-size: var(--fs-xs); font-weight: var(--fw-bold); letter-spacing: .05em; text-transform: uppercase; color: var(--color-text-subtle); }

.checklist li + li .check { border-top: 1px solid var(--color-border); }
.check { display: flex; align-items: center; gap: var(--space-3); min-height: 44px; padding: var(--space-2) 0; cursor: pointer; }
.check input { flex: none; width: 20px; height: 20px; margin: 0; accent-color: var(--color-primary); cursor: pointer; }
.check.is-done span { color: var(--color-text-muted); }
.check input:disabled { cursor: default; }
.check input:disabled + span { cursor: default; }
.task-add { display: flex; gap: var(--space-2); margin-top: var(--space-3); }
.task-add .input { flex: 1; min-width: 0; }

.entries > li { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-4); }
.entries > li + li { border-top: 1px solid var(--color-border); }
.entry__main { flex: 1; min-width: 0; }
.entry__title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; font-weight: var(--fw-semibold); }
.entry__dur { font-variant-numeric: tabular-nums; color: var(--color-text-muted); font-weight: var(--fw-semibold); }
.entry__meta { font-size: var(--fs-sm); color: var(--color-text-muted); }
.entry__qty { font-weight: var(--fw-semibold); font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (max-width: 480px) {
  .entries--mat > li { flex-wrap: wrap; }
  .entries--mat .entry__main { flex-basis: 100%; }
  .entries--mat .stepper { margin-right: auto; }
}

.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: var(--space-3); }
.photo {
  display: block; width: 100%; padding: 0; overflow: hidden; text-align: left; cursor: pointer;
  background: var(--color-surface-sunken); border: 1px solid var(--color-border); border-radius: var(--radius);
}
.photo:hover { border-color: var(--color-border-strong); }
.photo img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.photo__cap { display: block; padding: 6px 8px; font-size: var(--fs-xs); color: var(--color-text-muted); background: var(--color-surface); }
.photo-add {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  width: 100%; height: 100%; min-height: 120px; padding: var(--space-3);
  border: 1.5px dashed var(--color-border-strong); border-radius: var(--radius);
  background: var(--color-surface); color: var(--color-primary); font-weight: var(--fw-semibold); text-align: center; cursor: pointer;
}
.photo-add .icon { font-size: 1.5rem; }
.photo-add:hover { background: var(--color-primary-soft); border-color: var(--color-primary); }
.photo-add:focus-within { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.photo-view img { width: 100%; max-height: 60vh; object-fit: contain; border-radius: var(--radius); background: var(--color-surface-sunken); }
.photo-view figcaption { margin-top: var(--space-2); color: var(--color-text-muted); }

.notes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-4); }
@media (max-width: 760px) { .notes { grid-template-columns: minmax(0, 1fr); } }
.note { display: flex; flex-direction: column; gap: var(--space-2); min-width: 0; padding: var(--space-3); border: 1px solid; border-radius: var(--radius); }
.note--klant { background: var(--color-primary-soft); border-color: var(--color-primary-border); }
.note--intern { background: var(--color-warning-soft); border-color: var(--color-warning-border); }
.note__head { display: flex; align-items: center; gap: var(--space-2); }
.note__head h3 { font-size: var(--fs-base); font-weight: var(--fw-bold); }
.note--klant .note__head .icon { color: var(--color-primary); }
.note--intern .note__head .icon { color: var(--color-warning-icon); }
.note__hint { font-size: var(--fs-xs); color: var(--color-text-muted); }
.note__text { white-space: pre-wrap; overflow-wrap: anywhere; }
.note__saved { min-height: 1em; font-size: var(--fs-xs); color: var(--color-success-text); font-weight: var(--fw-semibold); }

.timeline li { position: relative; display: grid; grid-template-columns: 12px minmax(0, 1fr); gap: var(--space-3); padding-bottom: var(--space-3); }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before { content: ""; width: 8px; height: 8px; margin-top: 7px; border-radius: 50%; background: var(--color-border-strong); }
.timeline li:first-child::before { background: var(--color-primary); }
.timeline__meta { font-size: var(--fs-xs); color: var(--color-text-subtle); }

/* ---------- Dialogen ---------- */
.dialog {
  width: min(560px, calc(100vw - 32px)); max-width: none; max-height: none; padding: 0;
  border: 1px solid var(--color-border); border-radius: var(--radius-lg);
  background: var(--color-surface); color: var(--color-text); box-shadow: var(--shadow-lg);
}
.dialog--lg { width: min(760px, calc(100vw - 32px)); }
.dialog::backdrop { background: rgba(23, 32, 51, .45); }
.dialog__form { display: flex; flex-direction: column; max-height: calc(100vh - 48px); }
.dialog__head {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
  padding: var(--space-3) var(--space-3) var(--space-3) var(--space-5); border-bottom: 1px solid var(--color-border);
}
.dialog__head h2 { font-size: var(--fs-lg); font-weight: var(--fw-bold); }
.dialog__body { display: flex; flex-direction: column; gap: var(--space-4); padding: var(--space-5); overflow-y: auto; }
.dialog__foot {
  display: flex; justify-content: flex-end; gap: var(--space-2);
  padding: var(--space-3) var(--space-5); border-top: 1px solid var(--color-border);
  background: var(--color-surface-alt); border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}
.duration { color: var(--color-text-muted); }
.checks li { display: flex; align-items: flex-start; gap: var(--space-2); padding: 4px 0; }
.checks .icon { margin-top: 3px; font-size: 1.05rem; }
.check-ok .icon { color: var(--color-success-text); }
.check-warn .icon { color: var(--color-warning-icon); }
.check-missing { font-weight: var(--fw-semibold); }
.check-missing .icon { color: var(--color-danger); }
@media (max-width: 640px) {
  .dialog, .dialog--lg {
    width: 100%; margin: auto 0 0; border-bottom: 0;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  }
  .dialog__form { max-height: 92vh; }
  .dialog__body { padding: var(--space-4); }
  .dialog__head { padding-left: var(--space-4); }
  .dialog__foot {
    flex-direction: column-reverse; border-radius: 0;
    padding: var(--space-3) var(--space-4) calc(var(--space-3) + env(safe-area-inset-bottom));
  }
  .dialog__foot .btn { width: 100%; min-height: var(--touch-h); font-size: var(--fs-md); }
}
@media (max-width: 480px) {
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .form-grid .span-2 { grid-column: auto; }
  .form-grid.form-grid--keep { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- Toasts ---------- */
.toasts {
  position: fixed; left: 50%; bottom: var(--space-6); z-index: 100; transform: translateX(-50%);
  display: flex; flex-direction: column; gap: var(--space-2);
  width: min(440px, calc(100vw - 32px)); pointer-events: none;
}
body.has-bottombar .toasts { bottom: calc(var(--bottombar-h) + env(safe-area-inset-bottom) + 12px); }
.toast {
  display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-4);
  border-radius: var(--radius); background: var(--color-text); color: #fff; box-shadow: var(--shadow-lg);
  font-weight: var(--fw-medium); pointer-events: auto;
}
.toast p { flex: 1; min-width: 0; }
.toast button {
  flex: none; min-height: 32px; padding: 0 8px; border: 0; border-radius: var(--radius-sm);
  background: none; color: #A9C3FF; font-weight: var(--fw-bold); cursor: pointer;
}
.toast button:hover { background: rgba(255,255,255,.1); }
.toast button:focus-visible { outline-color: #fff; }

/* ---------- Monteur (mobiel eerst) ---------- */
.m-shell { min-height: 100vh; font-size: var(--fs-md); }
.m-appbar { position: sticky; top: 0; z-index: 20; background: var(--color-surface); border-bottom: 1px solid var(--color-border); }
.m-appbar__inner {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
  max-width: var(--mobile-max); min-height: 60px; margin: 0 auto; padding: var(--space-2) var(--space-4);
}
.m-appbar__center { flex: 1; min-width: 0; text-align: center; }
.m-appbar__eyebrow { font-size: var(--fs-sm); font-weight: var(--fw-medium); color: var(--color-text-muted); }
.m-appbar__title { font-size: var(--fs-xl); font-weight: var(--fw-bold); line-height: 1.2; }
.m-appbar__title--sm { font-size: var(--fs-md); font-weight: var(--fw-semibold); }
.m-appbar__spacer { width: 48px; flex: none; }
.m-content { max-width: var(--mobile-max); margin: 0 auto; padding: var(--space-4) var(--space-4) var(--space-8); }
.m-content--with-bar { padding-bottom: calc(var(--bottombar-h) + env(safe-area-inset-bottom) + var(--space-6)); }

.day-nav {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-2);
  margin-bottom: var(--space-3); padding: var(--space-1);
  background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius);
}
.day-nav__label { display: flex; flex-direction: column; align-items: center; line-height: 1.3; text-align: center; }
.day-nav__label strong { font-size: var(--fs-md); }
.day-nav__label span { font-size: var(--fs-sm); color: var(--color-text-muted); }
.day-summary { margin-bottom: var(--space-3); font-size: var(--fs-sm); color: var(--color-text-muted); }

.job-list { display: flex; flex-direction: column; gap: var(--space-3); }
.job-card {
  display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: var(--space-3);
  padding: var(--space-4); color: inherit; text-decoration: none;
  background: var(--color-surface); border: 1px solid var(--color-border); border-left: 4px solid var(--st-dot);
  border-radius: var(--radius);
}
.job-card:hover { border-color: var(--color-border-strong); border-left-color: var(--st-dot); }
.job-card:active { background: var(--color-surface-alt); }
.job-card.is-done { background: var(--color-surface-alt); }
.job-card__time { display: flex; flex-direction: column; font-variant-numeric: tabular-nums; line-height: 1.3; }
.job-card__time strong { font-size: var(--fs-lg); }
.job-card__time span { font-size: var(--fs-sm); color: var(--color-text-muted); }
.job-card__top { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin-bottom: var(--space-1); }
.job-card__klant { font-size: var(--fs-md); font-weight: var(--fw-bold); line-height: 1.3; }
.job-card__line { display: flex; align-items: flex-start; gap: 6px; margin-top: 2px; font-size: var(--fs-sm); color: var(--color-text-muted); }
.job-card__line .icon { margin-top: 3px; }
.job-card__desc { margin-top: var(--space-2); font-size: var(--fs-base); }

.job-head { margin-bottom: var(--space-4); }
.job-head__row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin-bottom: var(--space-2); font-size: var(--fs-sm); color: var(--color-text-muted); }
.job-head h1 { font-size: var(--fs-xl); font-weight: var(--fw-bold); line-height: 1.25; }
.job-head__klant { margin-top: var(--space-2); font-weight: var(--fw-semibold); }
.job-head__addr { display: flex; gap: 6px; color: var(--color-text-muted); }
.job-head__addr .icon { margin-top: 4px; }

.quick-actions { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: var(--space-2); margin-bottom: var(--space-4); }
.qa {
  grid-column: span 2; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  min-height: 76px; padding: var(--space-2);
  background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius);
  color: var(--color-text); font-size: var(--fs-sm); font-weight: var(--fw-semibold); text-align: center; text-decoration: none; cursor: pointer;
}
.qa .icon { font-size: 1.5rem; color: var(--color-primary); }
.qa--wide { grid-column: span 3; flex-direction: row; gap: var(--space-3); min-height: 60px; font-size: var(--fs-md); }
.qa--wide .qa__text { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; text-align: left; line-height: 1.25; }
.qa__sub { max-width: 100%; font-size: var(--fs-xs); font-weight: 400; color: var(--color-text-muted); overflow-wrap: anywhere; }
.qa:hover { background: var(--color-primary-soft); border-color: var(--color-primary-border); }
.qa:focus-within { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.qa:disabled, .qa.is-disabled { background: var(--color-surface-sunken); color: var(--color-text-subtle); cursor: not-allowed; }
.qa:disabled .icon, .qa.is-disabled .icon { color: inherit; }

.m-sections { display: flex; flex-direction: column; gap: var(--space-3); }
.m-shell .check { min-height: 52px; }
.m-shell .check input { width: 24px; height: 24px; }
.m-shell .icon-btn { width: var(--touch-min); height: var(--touch-min); }
.m-shell .stepper button { width: var(--touch-min); height: var(--touch-min); }
.m-shell .btn { min-height: var(--touch-min); }
.m-shell .btn--touch { min-height: var(--touch-h); }
.m-shell .input, .m-shell .textarea { font-size: 16px; }
.m-shell .input { min-height: var(--touch-min); }
.m-shell .dl a { display: inline-flex; align-items: center; min-height: var(--touch-min); margin: -11px 0; }
.m-shell .photo-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }

.banner {
  display: flex; align-items: flex-start; gap: var(--space-3); margin-bottom: var(--space-4);
  padding: var(--space-3) var(--space-4); border: 1px solid; border-radius: var(--radius);
}
.banner > .icon { margin-top: 3px; font-size: 1.15rem; }
.banner--warn { background: var(--color-warning-soft); border-color: var(--color-warning-border); color: var(--color-warning-text); }
.banner--status { background: var(--st-bg); border-color: var(--st-border); color: var(--st-fg); }
.banner strong { display: block; }

.bottombar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 25;
  background: var(--color-surface); border-top: 1px solid var(--color-border);
  box-shadow: 0 -4px 16px rgba(23, 32, 51, .06);
}
.bottombar__inner {
  display: flex; align-items: center; gap: var(--space-2);
  max-width: var(--mobile-max); min-height: var(--bottombar-h); margin: 0 auto;
  padding: var(--space-3) var(--space-4) calc(var(--space-3) + env(safe-area-inset-bottom));
}
.bottombar__info { display: flex; flex: 1; align-items: center; gap: var(--space-2); min-width: 0; font-size: var(--fs-sm); font-weight: var(--fw-semibold); color: var(--st-fg, var(--color-text-muted)); }
.bottombar__info .icon { font-size: 1.25rem; }

/* ---------- Inloggen en installatie ---------- */
.app-loading { padding: var(--space-10) var(--space-4); text-align: center; color: var(--color-text-muted); }
.auth { display: grid; place-items: center; min-height: 100vh; padding: var(--space-6) var(--space-4); }
.auth__card {
  display: flex; flex-direction: column; gap: var(--space-4); width: min(440px, 100%);
  padding: var(--space-8) var(--space-6); background: var(--color-surface);
  border: 1px solid var(--color-border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
}
.auth__brand { font-size: var(--fs-xl); }
.auth__title { font-size: var(--fs-xl); font-weight: var(--fw-bold); }
.auth__form { display: flex; flex-direction: column; gap: var(--space-4); }
.auth .input { min-height: var(--touch-min); font-size: 16px; }
.auth .callout, .auth .form-error { margin: 0; }
.install-steps { display: flex; gap: var(--space-2); font-size: var(--fs-sm); color: var(--color-text-subtle); }
.install-steps li { flex: 1; padding-top: var(--space-2); border-top: 3px solid var(--color-border); }
.install-steps li.is-active { border-color: var(--color-primary); color: var(--color-primary-active); font-weight: var(--fw-semibold); }
.install-steps li.is-done { border-color: var(--status-afgerond-dot); color: var(--color-success-text); }
.install-list { margin-top: var(--space-2); padding-left: var(--space-5); list-style: disc; font-weight: 400; }
.install-code { font-family: ui-monospace, Consolas, monospace; font-size: var(--fs-xs); field-sizing: fixed; }
@media (max-width: 480px) { .auth__card { padding: var(--space-6) var(--space-4); } }

.sidebar__foot { flex-direction: column; align-items: stretch; }
.sidebar__user { display: flex; align-items: center; gap: var(--space-3); }
.sidebar__account { display: flex; gap: var(--space-4); padding: var(--space-2) 0 var(--space-1) 40px; font-size: var(--fs-sm); }
.sidebar__account .link-btn { min-height: 32px; }

.usermenu { position: relative; }
.usermenu summary { list-style: none; cursor: pointer; border-radius: 50%; }
.usermenu summary::-webkit-details-marker { display: none; }
.usermenu summary:focus-visible { outline-offset: 3px; }
.usermenu__panel {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 30; display: flex; flex-direction: column;
  min-width: 220px; padding: var(--space-2); background: var(--color-surface);
  border: 1px solid var(--color-border); border-radius: var(--radius); box-shadow: var(--shadow-lg);
}
.usermenu__panel > p { padding: var(--space-2) var(--space-3); }
.usermenu__item {
  display: flex; align-items: center; gap: var(--space-3); min-height: var(--touch-min); padding: 0 var(--space-3);
  border: 0; border-radius: var(--radius-sm); background: none; text-align: left; cursor: pointer; font-size: var(--fs-base);
}
.usermenu__item:hover { background: var(--color-surface-sunken); }
.usermenu__item .icon { color: var(--color-text-subtle); }

/* ---------- Algemene aanvullingen ---------- */
.nav__count--neutral { background: var(--color-surface-sunken); color: var(--color-text-muted); border-color: var(--color-border); }
.page--wide { max-width: 1600px; }
.page--narrow { max-width: 880px; }
.page-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); }
.detail-head__side { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.tag--neutral { background: var(--color-surface-sunken); color: var(--color-text-muted); border: 1px solid var(--color-border); }
.tag--demo { background: var(--color-demo); color: var(--color-demo-text); }
.form-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--space-2); margin-top: var(--space-4); }
.check--top { align-items: flex-start; }
.check--top input { margin-top: 2px; }
.check--top > span { display: flex; flex-direction: column; gap: 2px; }
.table-wrap--flush { border: 0; border-radius: 0 0 var(--radius) var(--radius); }
.card-list--pad { padding: var(--space-3); }
@media (min-width: 901px) { .filters--3 { grid-template-columns: minmax(220px, 2fr) repeat(2, minmax(150px, 1fr)); } }
@media (max-width: 640px) {
  .page-actions, .detail-head__side { width: 100%; }
  .page-actions > .btn, .detail-head__side > .btn { flex: 1 1 auto; }
}

/* ---------- Planning ---------- */
.week-nav { display: inline-flex; align-items: center; gap: var(--space-1); padding: 2px; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius); }
/* 'In te plannen' staat boven de weektabel; pas op hele brede schermen ernaast */
.planning { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-4); align-items: start; }
.planning__board { min-width: 0; container-type: inline-size; }
.todo-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: var(--space-2); padding: var(--space-3); }
.todo-list > li { display: flex; flex-direction: column; padding: var(--space-3); border: 1px solid var(--color-border); border-radius: var(--radius-sm); background: var(--color-surface-alt); }
.todo-list > li.empty { border: 0; background: none; padding: var(--space-1); }
.todo .btn { align-self: flex-start; }
@media (min-width: 1600px) {
  .planning { grid-template-columns: 280px minmax(0, 1fr); }
  .planning__todo { position: sticky; top: var(--space-4); max-height: calc(100vh - 32px); overflow-y: auto; }
  .todo-list { grid-template-columns: minmax(0, 1fr); }
}
.todo__top { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin-bottom: 2px; }
.todo .btn { margin-top: var(--space-2); }

.board-wrap { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius); overflow: hidden; }
.board { width: 100%; border-collapse: collapse; table-layout: fixed; }
.board th, .board td { border-bottom: 1px solid var(--color-border); border-left: 1px solid var(--color-border); vertical-align: top; text-align: left; }
.board thead th { padding: var(--space-2); font-size: var(--fs-sm); font-weight: var(--fw-semibold); color: var(--color-text-muted); background: var(--color-surface-alt); }
.board__corner { width: 168px; border-left: 0 !important; }
.board th.is-weekend { width: 9%; }
.board__date { color: var(--color-text); font-weight: var(--fw-bold); }
.board tbody th { padding: var(--space-3); border-left: 0; font-weight: 400; }
.board tbody th .person { align-items: flex-start; }
.board__hours { display: block; }
.board tbody tr:last-child th, .board tbody tr:last-child td { border-bottom: 0; }
.board td { padding: 6px; }
.board .is-today { background: #F5F8FF; }
.board thead th.is-today { color: var(--color-primary-active); box-shadow: inset 0 -2px 0 var(--color-primary); }
.board .is-weekend { background: var(--color-surface-alt); }
.board__cell { display: flex; flex-direction: column; gap: 6px; min-height: 64px; }
.slot {
  display: flex; flex-direction: column; gap: 1px; padding: 6px 8px;
  border-radius: var(--radius-sm); border: 1px solid var(--st-border); border-left: 3px solid var(--st-dot);
  background: var(--st-bg); color: var(--color-text); text-decoration: none; font-size: var(--fs-xs); line-height: 1.35;
}
.slot:hover { border-color: var(--st-dot); }
.slot__time { font-weight: var(--fw-bold); font-variant-numeric: tabular-nums; }
.slot__klant { font-weight: var(--fw-semibold); font-size: var(--fs-sm); overflow-wrap: anywhere; }
.slot__meta { color: var(--st-fg); overflow-wrap: anywhere; }
.slot-add {
  display: grid; place-items: center; width: 100%; min-height: 28px; margin-top: auto;
  border: 1px dashed var(--color-border-strong); border-radius: var(--radius-sm);
  background: transparent; color: var(--color-text-subtle); cursor: pointer;
}
.slot-add:hover { border-color: var(--color-primary); color: var(--color-primary); background: var(--color-primary-soft); }

.board-narrow { display: none; }
@container (max-width: 760px) {
  .board-wrap { display: none; }
  .board-narrow { display: block; }
}
.day-tabs { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: var(--space-1); margin-bottom: var(--space-3); }
.day-tab {
  display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 52px; padding: 4px 0;
  border: 1px solid var(--color-border); border-radius: var(--radius); background: var(--color-surface);
  color: var(--color-text-muted); font-size: var(--fs-xs); cursor: pointer;
}
.day-tab strong { font-size: var(--fs-md); color: var(--color-text); }
.day-tab.is-today { border-color: var(--color-primary-border); }
.day-tab.is-active { background: var(--color-primary); border-color: var(--color-primary); color: #fff; }
.day-tab.is-active strong { color: #fff; }
.board-narrow__title { margin-bottom: var(--space-2); font-weight: var(--fw-semibold); }
.day-group { margin-bottom: var(--space-2); padding: var(--space-3); background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius); }
.day-group__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2); margin-bottom: var(--space-2); }
.day-group__slots { display: flex; flex-direction: column; gap: 6px; }
.day-group .slot { font-size: var(--fs-sm); padding: 8px 10px; }

/* ---------- Medewerkers ---------- */
.person-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: var(--space-4); }
.person-card { display: flex; flex-direction: column; gap: var(--space-3); padding: var(--space-4); background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius); }
.person-card.is-inactive { background: var(--color-surface-alt); border-style: dashed; }
.person-card__head { display: flex; align-items: center; gap: var(--space-3); }
.person-card__name { flex: 1; min-width: 0; }
.person-card__name h2 { font-size: var(--fs-md); font-weight: var(--fw-bold); }
.person-card__contact { display: flex; flex-direction: column; gap: 4px; font-size: var(--fs-sm); }
.person-card__contact li { display: flex; align-items: center; gap: var(--space-2); overflow-wrap: anywhere; }
.person-card__contact .icon { color: var(--color-text-subtle); }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-2); margin: 0; padding: var(--space-3); background: var(--color-surface-alt); border-radius: var(--radius-sm); }
.stats dt { font-size: var(--fs-xs); color: var(--color-text-subtle); }
.stats dd { margin: 0; font-weight: var(--fw-bold); }
.person-card__now { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); font-size: var(--fs-sm); }
.person-card__actions { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: auto; }

/* ---------- Instellingen ---------- */
.settings { display: flex; flex-direction: column; gap: var(--space-4); }
.rules { display: flex; flex-direction: column; margin-top: var(--space-2); }
.rules li + li { border-top: 1px solid var(--color-border); }
.rules .check { padding: var(--space-3) 0; }
.cat-add { display: grid; grid-template-columns: minmax(0, 1fr) 120px auto; align-items: end; gap: var(--space-3); padding: var(--space-4); border-bottom: 1px solid var(--color-border); }
@media (max-width: 560px) {
  .cat-add { grid-template-columns: minmax(0, 1fr) 110px; }
  .cat-add .btn { grid-column: 1 / -1; }
}

/* ---------- Handtekening ---------- */
.signature { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--space-4); }
.signature img { width: 240px; max-width: 100%; height: auto; background: #fff; border: 1px solid var(--color-border); border-radius: var(--radius-sm); }
.signature figcaption { display: flex; flex-direction: column; font-size: var(--fs-sm); color: var(--color-text-muted); }
.signature figcaption strong { color: var(--color-text); }
.sigpad { position: relative; background: #fff; border: 1px dashed var(--color-border-strong); border-radius: var(--radius); }
.sigpad__canvas { display: block; width: 100%; height: 180px; touch-action: none; cursor: crosshair; }
.sigpad__line { position: absolute; left: var(--space-4); right: var(--space-4); bottom: 40px; border-bottom: 1px solid var(--color-border-strong); pointer-events: none; }
.sigpad__foot { display: flex; justify-content: space-between; align-items: center; gap: var(--space-3); min-height: var(--touch-min); }

/* ---------- Werkbon voor de klant ---------- */
.print-page { max-width: 860px; margin: 0 auto; padding: var(--space-5) var(--space-4) var(--space-10); }
.print-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-4); }
.print-toolbar .back-link { margin: 0; }
.sheet { padding: 40px; background: #fff; border: 1px solid var(--color-border); border-radius: var(--radius); box-shadow: var(--shadow-sm); color: var(--color-text); }
.sheet h2 { margin-bottom: 4px; font-size: var(--fs-xs); font-weight: var(--fw-bold); letter-spacing: .06em; text-transform: uppercase; color: var(--color-text-subtle); }
.sheet__head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-4); padding-bottom: var(--space-4); border-bottom: 2px solid var(--color-text); }
.sheet__company { font-size: var(--fs-lg); font-weight: var(--fw-bold); }
.sheet__muted { color: var(--color-text-muted); font-size: var(--fs-sm); }
.sheet__title { text-align: right; }
.sheet__title h1 { font-size: var(--fs-2xl); font-weight: var(--fw-bold); letter-spacing: .02em; }
.sheet__title p { font-weight: var(--fw-semibold); font-variant-numeric: tabular-nums; }
.sheet__concept { display: inline-block; margin-top: 4px; padding: 0 8px; border: 1px solid var(--color-warning-border); border-radius: var(--radius-sm); background: var(--color-warning-soft); color: var(--color-warning-text); font-size: var(--fs-xs); }
.sheet__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-4); margin-top: var(--space-5); }
.sheet__block { margin-top: var(--space-6); }
.sheet__lead { font-size: var(--fs-md); font-weight: var(--fw-semibold); }
.sheet__summary { white-space: pre-wrap; }
.sheet__tasks { margin-top: var(--space-2); }
.sheet__tasks li { display: flex; align-items: center; gap: var(--space-2); }
.sheet__tasks .icon { color: var(--color-success-text); }
.sheet__table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.sheet__table th, .sheet__table td { padding: 6px 8px 6px 0; border-bottom: 1px solid var(--color-border); text-align: left; }
.sheet__table thead th { font-size: var(--fs-xs); color: var(--color-text-subtle); font-weight: var(--fw-semibold); }
.sheet__table tfoot th, .sheet__table tfoot td { border-bottom: 0; font-weight: var(--fw-bold); }
.sheet__table .num { text-align: right; padding-right: 0; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sheet__photos { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-2); }
.sheet__photos img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 4px; }
.sheet__photos span { display: block; font-size: var(--fs-xs); color: var(--color-text-muted); }
.sheet__sign { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-8); margin-top: var(--space-8); }
.sheet__sign img { max-height: 90px; max-width: 100%; }
.sheet__sigline { height: 64px; border-bottom: 1px solid var(--color-text-muted); }
.sheet__sigline--name { display: flex; align-items: flex-end; padding-bottom: 4px; font-weight: var(--fw-semibold); }
.sheet__foot { margin-top: var(--space-8); padding-top: var(--space-3); border-top: 1px solid var(--color-border); font-size: var(--fs-xs); color: var(--color-text-subtle); }
@media (max-width: 640px) {
  .sheet { padding: var(--space-5) var(--space-4); }
  .sheet__grid, .sheet__sign { grid-template-columns: minmax(0, 1fr); gap: var(--space-4); }
  .sheet__photos { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sheet__title { text-align: left; }
  .print-toolbar .btn { width: 100%; }
}
@media print {
  @page { size: A4; margin: 15mm; }
  body { background: #fff; font-size: 11pt; }
  .demo-bar, .print-toolbar, .print-hide, .toasts, .skip-link { display: none !important; }
  .print-page { max-width: none; padding: 0; }
  .sheet { padding: 0; border: 0; box-shadow: none; }
  .sheet__grid { grid-template-columns: repeat(3, 1fr); }
  .sheet__sign { grid-template-columns: repeat(2, 1fr); break-inside: avoid; }
  .sheet__block { break-inside: avoid; }
}
