/*
  Gedeelde componentenkit voor Stoel.
  Alle tikdoelen zijn minimaal 44 × 44 px, behalve .btn--sm (36 px).
  Status is nooit alleen kleur: er hoort altijd een icoon of tekst bij.
  Figtree, één radius van 5 px en kleuren uitsluitend via tokens.css.
*/

:root {
  --spring: cubic-bezier(0.34, 1.3, 0.64, 1);
}

/* ---------------------------------------------------------------- Knoppen */

.btn {
  --btn-bg: var(--surface);
  --btn-fg: var(--text);
  --btn-border: var(--border);

  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: var(--tap-min);
  padding: 0 var(--space-4);
  overflow: hidden;
  border: var(--line-thin) solid var(--btn-border);
  border-radius: 5px;
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-family: var(--font-ui);
  font-size: 15px;
  font-weight: var(--weight-semibold);
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition:
    transform 420ms var(--spring),
    background-color var(--t-fast) var(--ease),
    border-color var(--t-fast) var(--ease),
    color var(--t-fast) var(--ease),
    width var(--t-mid) var(--ease);
  will-change: transform;
}

.btn .ph {
  flex: 0 0 auto;
  font-size: 1.15em;
}

.btn:active:not(:disabled):not([aria-disabled="true"]) {
  transform: scale(0.96);
  transition-duration: var(--t-press);
  transition-timing-function: var(--ease-out);
}

.btn:focus-visible {
  outline: var(--focus-width) solid var(--accent);
  outline-offset: var(--focus-offset);
}

.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn--primary,
.btn--accent {
  --btn-bg: var(--accent-fill);
  --btn-fg: var(--accent-fg);
  --btn-border: var(--accent-fill);
}

.btn--ghost {
  --btn-bg: transparent;
  --btn-fg: var(--text);
  --btn-border: var(--border);
}

.btn--quiet {
  --btn-bg: transparent;
  --btn-fg: var(--text);
  --btn-border: transparent;
}

.btn--danger {
  --btn-bg: var(--danger);
  --btn-fg: var(--on-danger);
  --btn-border: var(--danger);
}

.btn--icon {
  width: var(--tap-min);
  min-width: var(--tap-min);
  padding: 0;
  border-color: transparent;
  background: transparent;
  color: var(--text);
}

.btn--icon .ph {
  font-size: 20px;
}

.btn--sm {
  min-height: var(--tap-sm);
  padding: 0 var(--space-3);
  font-size: var(--text-xs);
}

.btn--sm.btn--icon {
  width: var(--tap-sm);
  min-width: var(--tap-sm);
}

.btn--block {
  width: 100%;
}

.btn--link {
  min-height: var(--tap-min);
  padding: 0 var(--space-1);
  border-color: transparent;
  background: transparent;
  color: var(--link);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.btn--link:hover:not(:disabled):not([aria-disabled="true"]) {
  color: var(--link-hover);
}

.btn__roll {
  grid-area: 1 / 1;
  display: grid;
  overflow: hidden;
  height: 1.3em;
  align-items: center;
}

.btn__roll .btn__label {
  grid-area: 1 / 1;
  white-space: nowrap;
  transition: transform 250ms var(--ease);
}

.btn__roll .btn__label--next {
  transform: translateY(105%);
}

.btn:hover .btn__roll .btn__label {
  transform: translateY(-105%);
}

.btn:hover .btn__roll .btn__label--next {
  transform: translateY(0);
}

.btn__icon {
  display: inline-flex;
  transition: transform 250ms var(--ease);
}

.btn:hover .btn__icon {
  transform: translateX(2px);
}

/* Label, spinner en vinkje liggen in dezelfde grid-cel: nooit overlap. */
.btn__inner {
  display: inline-grid;
  grid-auto-flow: column;
  align-items: center;
  justify-items: center;
  gap: var(--space-2);
}

.btn__label,
.btn__spinner,
.btn__check {
  grid-area: 1 / 1;
}

.btn__label {
  transition:
    opacity var(--t-fast) var(--ease),
    transform var(--t-mid) var(--ease);
}

.btn.is-loading .btn__label,
.btn.is-done .btn__label {
  opacity: 0;
  transform: scale(0.92);
}

.btn__spinner {
  width: 15px;
  height: 15px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: var(--r-round);
  opacity: 0;
  transform: scale(0.6);
  transition:
    opacity var(--t-fast) var(--ease),
    transform var(--t-mid) var(--spring);
}

.btn.is-loading .btn__spinner {
  opacity: 1;
  transform: scale(1);
  animation: btn-spin 620ms linear infinite;
}

.btn__check {
  width: 18px;
  height: 18px;
  opacity: 0;
  transform: scale(0.7);
  transition:
    opacity 60ms linear,
    transform var(--t-mid) var(--spring);
}

.btn__check path {
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 24;
  stroke-dashoffset: 24;
}

.btn.is-done .btn__check {
  opacity: 1;
  transform: scale(1);
}

.btn.is-done .btn__check path {
  animation: btn-draw 260ms var(--ease) forwards;
}

.btn.is-loading,
.btn.is-done {
  width: 44px;
  min-width: 44px;
  padding: 0;
}

.btn--sm.is-loading,
.btn--sm.is-done {
  width: 40px;
  min-width: 40px;
}

.btn.is-done {
  border-color: var(--ok);
  background: var(--ok-soft);
  color: var(--ok);
}

@keyframes btn-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes btn-draw {
  to {
    stroke-dashoffset: 0;
  }
}

/* ---------------------------------------------------------------- Velden */

.field {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  min-width: 0;
}

.field__label {
  color: var(--text);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  line-height: var(--leading-snug);
}

.field__hint {
  color: var(--muted);
  font-size: var(--text-xs);
  line-height: 1.4;
}

.field__error {
  display: flex;
  align-items: flex-start;
  gap: var(--space-1);
  color: var(--danger);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  line-height: 1.4;
}

.input,
.select,
.textarea {
  width: 100%;
  min-height: var(--tap-min);
  padding: var(--space-2) var(--space-3);
  border: var(--line-thin) solid var(--border);
  border-radius: 5px;
  background: var(--surface);
  color: var(--text);
  font-size: var(--text-md);
  line-height: var(--leading-snug);
  transition:
    border-color var(--t-fast) var(--ease),
    box-shadow var(--t-fast) var(--ease),
    background-color var(--t-fast) var(--ease);
}

.textarea {
  min-height: 112px;
  resize: vertical;
}

.select {
  padding-right: var(--space-4);
}

.input:hover:not(:disabled),
.select:hover:not(:disabled),
.textarea:hover:not(:disabled) {
  border-color: var(--muted);
}

.input:focus-visible,
.select:focus-visible,
.textarea:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.input[aria-invalid="true"],
.select[aria-invalid="true"],
.textarea[aria-invalid="true"] {
  border-color: var(--danger);
  box-shadow: inset 0 0 0 1px var(--danger);
}

.input[aria-invalid="true"]:focus-visible,
.select[aria-invalid="true"]:focus-visible,
.textarea[aria-invalid="true"]:focus-visible {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px var(--danger-soft);
}

.field--inline {
  flex-direction: row;
  align-items: center;
  gap: var(--space-3);
}

/* Checkbox: 18 px vierkant, SVG-vinkje met vaste viewBox en een kleine overshoot. */
.check {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--text);
  font-size: var(--text-sm);
  cursor: pointer;
}

.check input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.check__box {
  position: relative;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border: var(--line-thin) solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface);
  transition:
    background-color var(--t-fast) var(--ease),
    border-color var(--t-fast) var(--ease);
}

.check__box svg {
  display: block;
  width: 14px;
  height: 14px;
  overflow: visible;
}

.check__box path {
  fill: none;
  stroke: var(--accent-fg);
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 21;
  stroke-dashoffset: 21;
  transition: stroke-dashoffset 200ms var(--ease);
}

.check input:checked + .check__box {
  border-color: var(--accent);
  background: var(--accent);
  animation: check-pop 380ms var(--spring);
}

.check input:checked + .check__box path {
  stroke-dashoffset: 0;
}

.check input:focus-visible + .check__box {
  outline: var(--focus-width) solid var(--accent);
  outline-offset: var(--focus-offset);
}

@keyframes check-pop {
  0% {
    transform: scale(0.9);
  }

  60% {
    transform: scale(1.03);
  }

  100% {
    transform: scale(1);
  }
}

/* ------------------------------------------------- Chips, badges, avatar */

.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  min-height: var(--tap-min);
  padding: 0 var(--space-3);
  border: var(--line-thin) solid var(--border);
  border-radius: 5px;
  background: var(--surface);
  color: var(--text);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition:
    transform 420ms var(--spring),
    background-color var(--t-fast) var(--ease),
    border-color var(--t-fast) var(--ease),
    color var(--t-fast) var(--ease);
}

.chip:hover {
  border-color: var(--muted);
  background: var(--fill);
}

.chip:active {
  transform: scale(0.96);
  transition-duration: var(--t-press);
  transition-timing-function: var(--ease-out);
}

.chip--active,
.chip[aria-pressed="true"],
.chip[aria-selected="true"] {
  border-color: var(--accent-fill);
  background: var(--accent-fill);
  color: var(--accent-fg);
}

.chip--active:hover,
.chip[aria-pressed="true"]:hover,
.chip[aria-selected="true"]:hover {
  border-color: var(--accent-hover);
  background: var(--accent-hover);
}

.chip--soft {
  border-color: transparent;
  background: var(--fill);
  color: var(--text);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  min-height: 22px;
  padding: 1px var(--space-2);
  border: var(--line-thin) solid var(--border);
  border-radius: 5px;
  background: var(--fill);
  color: var(--muted);
  font-size: 12px;
  font-weight: var(--weight-semibold);
  line-height: 1.3;
  white-space: nowrap;
}

.badge--brand {
  border-color: transparent;
  background: var(--accent-soft);
  color: var(--accent-text);
}

.badge--ok {
  border-color: transparent;
  background: var(--ok-soft);
  color: var(--ok);
}

.avatar {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--r-round);
  background: var(--fill);
  color: var(--text);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  line-height: 1;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.avatar--sm {
  width: 32px;
  height: 32px;
  font-size: var(--text-xs);
}

.avatar--lg {
  width: 48px;
  height: 48px;
  font-size: var(--text-md);
}

.avatar--muted {
  background: var(--fill);
  color: var(--muted);
}

/* ---------------------------------------------------- Kaarten en layout */

.card {
  min-width: 0;
  padding: var(--space-4);
  border: var(--line-thin) solid var(--border);
  border-radius: 5px;
  background: var(--surface);
}

.card--flat {
  border-color: transparent;
  background: var(--fill);
}

.card--interactive {
  cursor: pointer;
  transition:
    transform 420ms var(--spring),
    border-color var(--t-fast) var(--ease),
    background-color var(--t-fast) var(--ease);
}

.card--interactive:hover {
  border-color: var(--muted);
  background: var(--fill);
}

.card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.card__title {
  color: var(--text);
  font-size: var(--text-md);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-snug);
}

.row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  min-width: 0;
}

.row--between {
  justify-content: space-between;
}

.row--nowrap {
  flex-wrap: nowrap;
}

.row--end {
  justify-content: flex-end;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  min-width: 0;
}

.stack--tight {
  gap: var(--space-2);
}

.stack--loose {
  gap: var(--space-5);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: var(--space-3);
  min-width: 0;
}

.grid--2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid--4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

@media (max-width: 767px) {
  .grid--3,
  .grid--4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ------------------------------------------- Panelen, sheets, modals, toast */

.panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  border-left: var(--line-thin) solid var(--border);
  background: var(--surface);
  color: var(--text);
}

.panel__head {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-4);
  border-bottom: var(--line-thin) solid var(--border);
  background: var(--surface);
}

.panel__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-tight);
}

.panel__body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: var(--space-4);
  overscroll-behavior: contain;
}

.panel__foot {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-4);
  border-top: var(--line-thin) solid var(--border);
  background: var(--surface);
}

.overlay,
.sheet__backdrop,
.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: var(--z-overlay);
  background: var(--overlay);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity var(--dur-panel) var(--ease),
    visibility 0s linear var(--dur-panel);
}

.sheet__backdrop,
.sheet-backdrop {
  z-index: calc(var(--z-sheet) - 1);
}

.overlay.is-open,
.overlay[data-open="true"],
.sheet__backdrop.is-open,
.sheet__backdrop[data-open="true"],
.sheet-backdrop.is-open,
.sheet-backdrop[data-open="true"] {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity var(--dur-panel) var(--ease);
}

/* Bottom sheet: schuift van onderen in, met greep en backdrop. */
.sheet {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: var(--z-sheet);
  display: flex;
  flex-direction: column;
  max-height: 90dvh;
  padding: var(--space-2) var(--space-4) calc(var(--space-4) + env(safe-area-inset-bottom));
  overflow: auto;
  overscroll-behavior: contain;
  border-radius: 5px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-lg);
  visibility: hidden;
  pointer-events: none;
  transform: translateY(100%);
  transition:
    transform var(--dur-panel) var(--ease),
    visibility 0s linear var(--dur-panel);
}

.sheet.is-open,
.sheet[data-open="true"] {
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
  transition: transform var(--dur-panel) var(--ease);
}

.sheet__grip,
.sheet__handle {
  flex: 0 0 auto;
  width: 40px;
  height: 4px;
  margin: 0 auto var(--space-2);
  border-radius: 5px;
  background: var(--border);
}

.sheet__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-2) 0 var(--space-3);
}

.sheet__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-tight);
}

.sheet__body {
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
}

.sheet__foot {
  display: flex;
  gap: var(--space-2);
  padding-top: var(--space-4);
  padding-bottom: env(safe-area-inset-bottom);
}

@media (min-width: 768px) {
  .sheet {
    right: auto;
    left: 50%;
    width: min(560px, calc(100% - var(--space-6)));
    transform: translate(-50%, 100%);
  }

  .sheet.is-open,
  .sheet[data-open="true"] {
    transform: translate(-50%, 0);
  }
}

.modal {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: grid;
  place-items: center;
  padding: var(--space-4);
  background: transparent;
  visibility: hidden;
  pointer-events: none;
  transition: visibility 0s linear var(--dur-panel);
}

.modal::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--overlay);
  opacity: 0;
  transition: opacity var(--dur-panel) var(--ease);
}

.modal.is-open,
.modal[data-open="true"] {
  visibility: visible;
  pointer-events: auto;
  transition: none;
}

.modal.is-open::before,
.modal[data-open="true"]::before {
  opacity: 1;
}

.modal__dialog,
.modal > .card {
  position: relative;
  z-index: 1;
  width: min(560px, 100%);
  max-height: 90dvh;
  padding: var(--space-5);
  overflow: auto;
  overscroll-behavior: contain;
  border: var(--line-thin) solid var(--border);
  border-radius: 5px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-lg);
  transform: translateY(8px) scale(0.98);
  transition: transform var(--dur-panel) var(--ease);
}

.modal.is-open .modal__dialog,
.modal.is-open > .card,
.modal[data-open="true"] .modal__dialog,
.modal[data-open="true"] > .card {
  transform: translateY(0) scale(1);
}

.modal__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.modal__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-tight);
}

.modal__foot {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-2);
  margin-top: var(--space-5);
}

/* Toast staat onderaan, boven de mobiele onderbalk. Levensduur: 8 seconden. */
.toast {
  position: fixed;
  bottom: calc(var(--bottomnav-height) + env(safe-area-inset-bottom) + var(--space-3));
  left: 50%;
  z-index: var(--z-toast);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: min(560px, calc(100% - var(--space-6)));
  padding: var(--space-1) var(--space-2) var(--space-1) var(--space-4);
  overflow: hidden;
  border: var(--line-thin) solid var(--border);
  border-radius: 5px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-lg);
  visibility: hidden;
  pointer-events: none;
  transform: translate(-50%, 16px);
  transition:
    transform var(--dur-slow) var(--ease),
    visibility 0s linear var(--dur-slow);
}

.toast.is-open,
.toast[data-open="true"] {
  visibility: visible;
  pointer-events: auto;
  transform: translate(-50%, 0);
  transition: transform var(--dur-slow) var(--ease);
}

.toast__text {
  flex: 1;
  min-width: 0;
  font-size: var(--text-sm);
  line-height: var(--leading-snug);
}

.toast__action {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap-min);
  padding: 0 var(--space-3);
  border-radius: 5px;
  background: transparent;
  color: inherit;
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.toast__action:focus-visible {
  outline-color: currentColor;
}

.toast--ok {
  border-color: var(--ok);
  background: var(--ok);
  color: var(--on-ok);
}

.toast--error {
  border-color: var(--danger);
  background: var(--danger);
  color: var(--on-danger);
}

.toast.is-open::after,
.toast[data-open="true"]::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 3px;
  background: currentColor;
  opacity: 0.35;
  transform-origin: left center;
  animation: toast-progress var(--toast-life) linear forwards;
}

@keyframes toast-progress {
  from {
    transform: scaleX(1);
  }

  to {
    transform: scaleX(0);
  }
}

@media (min-width: 768px) {
  .toast {
    bottom: var(--space-5);
  }
}

/* ------------------------------------------------ Laden, leegte, spinner */

.skeleton {
  position: relative;
  min-height: 1em;
  overflow: hidden;
  border-radius: 5px;
  background: var(--fill);
  color: transparent;
  pointer-events: none;
}

.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    var(--skeleton-shine) 50%,
    transparent 100%
  );
  transform: translateX(-100%);
  animation: skeleton-shimmer 1.3s var(--ease-standard) infinite;
}

@keyframes skeleton-shimmer {
  from {
    transform: translateX(-100%);
  }

  to {
    transform: translateX(100%);
  }
}

.skeleton--text {
  width: 100%;
  height: 1em;
  border-radius: 5px;
}

.skeleton--title {
  width: 60%;
  height: 1.4em;
  border-radius: 5px;
}

.skeleton--avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--r-round);
}

.skeleton--block {
  height: 72px;
}

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  padding: var(--space-7) var(--space-5);
  color: var(--muted);
  text-align: center;
}

.empty__icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 5px;
  background: var(--fill);
  color: var(--accent-text);
  font-size: 28px;
}

.empty__title {
  margin: 0;
  color: var(--text);
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-snug);
}

.empty__text {
  max-width: 38ch;
  margin: 0;
  color: var(--muted);
  font-size: var(--text-sm);
}

.empty__action {
  margin-top: var(--space-2);
}

.spinner {
  width: 24px;
  height: 24px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: var(--r-round);
  animation: spinner-rotate 700ms linear infinite;
}

.spinner--sm {
  width: 16px;
  height: 16px;
  border-width: 2px;
}

.spinner--lg {
  width: 32px;
  height: 32px;
  border-width: 3px;
}

@keyframes spinner-rotate {
  to {
    transform: rotate(360deg);
  }
}

/* ------------------------------------ Segmented, tabs, switch en status */

.segmented {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 4px;
  border: var(--line-thin) solid var(--border);
  border-radius: 5px;
  background: var(--fill);
}

.segmented__item,
.segmented > button {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  min-height: var(--tap-min);
  padding: 0 var(--space-3);
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: color var(--t-fast) var(--ease);
}

.segmented__item:hover,
.segmented > button:hover {
  color: var(--text);
}

.segmented__item--active,
.segmented__item[aria-pressed="true"],
.segmented__item[aria-selected="true"],
.segmented > button[aria-pressed="true"],
.segmented .is-active {
  background: var(--surface);
  color: var(--text);
}

.segmented:has(.segmented__thumb) .segmented__item--active,
.segmented:has(.segmented__thumb) .segmented__item[aria-pressed="true"],
.segmented:has(.segmented__thumb) .segmented__item[aria-selected="true"],
.segmented:has(.segmented__thumb) > button[aria-pressed="true"],
.segmented:has(.segmented__thumb) .is-active {
  background: transparent;
}

.segmented__thumb {
  position: absolute;
  top: 4px;
  left: 4px;
  z-index: 0;
  height: calc(100% - 8px);
  border-radius: 5px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
  pointer-events: none;
  transition:
    transform 380ms var(--spring),
    width 300ms var(--ease);
}

.tabs {
  position: relative;
  display: flex;
  gap: var(--space-1);
  overflow-x: auto;
  box-shadow: inset 0 -1px 0 var(--border);
  scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
  display: none;
}

.tabs__item,
.tab {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  min-height: var(--tap-min);
  padding: 0 var(--space-3);
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: color var(--t-fast) var(--ease);
}

.tabs__item:hover,
.tab:hover {
  color: var(--text);
}

.tabs__item--active,
.tabs__item[aria-selected="true"],
.tab--active {
  color: var(--text);
}

.tabs:not(:has(.tabs__ink, .tabs__indicator)) .tabs__item--active,
.tabs:not(:has(.tabs__ink, .tabs__indicator)) .tabs__item[aria-selected="true"],
.tabs:not(:has(.tabs__ink, .tabs__indicator)) .tab--active {
  box-shadow: inset 0 -2px 0 var(--accent);
}

.tabs__ink,
.tabs__indicator {
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 0;
  height: 2px;
  border-radius: 5px;
  background: var(--accent);
  pointer-events: none;
  transition:
    transform 380ms var(--spring),
    width 300ms var(--ease);
}

.switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  min-height: var(--tap-min);
  color: var(--text);
  font-size: var(--text-sm);
  cursor: pointer;
}

.switch input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.switch__track {
  position: relative;
  flex: 0 0 auto;
  width: 48px;
  height: 28px;
  border: var(--line-thin) solid var(--border);
  border-radius: var(--r-sm);
  background: var(--fill);
  transition:
    background-color var(--t-mid) var(--ease),
    border-color var(--t-mid) var(--ease);
}

.switch__thumb,
.switch__track:not(:has(.switch__thumb))::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: var(--r-sm);
  background: var(--surface);
  transition:
    transform 380ms var(--spring),
    background-color var(--t-mid) var(--ease);
}

.switch__track:not(:has(.switch__thumb))::after {
  content: "";
}

.switch input:checked + .switch__track {
  border-color: var(--accent-fill);
  background: var(--accent-fill);
}

.switch input:checked + .switch__track .switch__thumb {
  transform: translateX(20px);
}

.switch input:checked + .switch__track:not(:has(.switch__thumb))::after {
  transform: translateX(20px);
}

.switch input:focus-visible + .switch__track {
  outline: var(--focus-width) solid var(--focus-color);
  outline-offset: var(--focus-offset);
}

.switch input:disabled + .switch__track {
  opacity: 0.55;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  min-height: 24px;
  padding: 2px var(--space-2);
  border: var(--line-thin) solid currentColor;
  border-radius: 5px;
  font-size: 12px;
  font-weight: var(--weight-semibold);
  line-height: 1.3;
  white-space: nowrap;
}

.status .ph {
  font-size: 1em;
}

.status--gepland {
  background: var(--status-gepland-bg);
  color: var(--status-gepland-text);
}

.status--bevestigd {
  background: var(--status-bevestigd-bg);
  color: var(--status-bevestigd-text);
}

.status--aangekomen {
  background: var(--status-aangekomen-bg);
  color: var(--status-aangekomen-text);
}

.status--bezig {
  background: var(--status-bezig-bg);
  color: var(--status-bezig-text);
}

.status--afgerond {
  background: var(--status-afgerond-bg);
  color: var(--status-afgerond-text);
}

.status--geannuleerd {
  background: var(--status-geannuleerd-bg);
  color: var(--status-geannuleerd-text);
  text-decoration: line-through;
}

.status--no_show,
.status--no-show {
  background: var(--status-no_show-bg);
  color: var(--status-no_show-text);
}

/* --------------------------------------------- Tabellen, lijsten, meta */

.table {
  width: 100%;
  border-collapse: collapse;
  color: var(--text);
  font-size: var(--text-sm);
}

.table th {
  padding: var(--space-2) var(--space-3);
  border-bottom: var(--line-thin) solid var(--border);
  color: var(--muted);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  text-align: left;
  vertical-align: bottom;
}

.table td {
  padding: var(--space-3);
  border-bottom: var(--line-thin) solid var(--border);
  vertical-align: top;
}

.table tbody tr:last-child td {
  border-bottom: 0;
}

.table tbody tr:hover {
  background: var(--fill);
}

.table--compact th,
.table--compact td {
  padding: var(--space-1) var(--space-2);
}

.table__num {
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.table__actions {
  text-align: right;
  white-space: nowrap;
}

.list {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  list-style: none;
}

.list__item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: var(--tap-min);
  padding: var(--space-3) 0;
  border-bottom: var(--line-thin) solid var(--border);
}

.list__item:last-child {
  border-bottom: 0;
}

.list__main {
  flex: 1;
  min-width: 0;
}

.list__title {
  color: var(--text);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  line-height: var(--leading-snug);
}

.list__sub {
  color: var(--muted);
  font-size: var(--text-xs);
  line-height: 1.4;
}

.list__item--interactive {
  width: 100%;
  padding-right: var(--space-2);
  padding-left: var(--space-2);
  border-radius: 5px;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition:
    background-color var(--t-fast) var(--ease),
    color var(--t-fast) var(--ease);
}

.list__item--interactive:hover {
  background: var(--fill);
}

.meta {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  color: var(--muted);
  font-size: var(--text-xs);
  line-height: 1.4;
}

.divider {
  height: 0;
  margin: var(--space-4) 0;
  border: 0;
  border-top: var(--line-thin) solid var(--border);
}

.divider--vertical {
  width: 0;
  height: auto;
  align-self: stretch;
  margin: 0 var(--space-2);
  border-top: 0;
  border-left: var(--line-thin) solid var(--border);
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
}

.toolbar--between {
  justify-content: space-between;
}

.toolbar__group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}

/* -------------------------------------------------------- Datumstrip */

.daystrip {
  display: flex;
  gap: var(--space-1);
  padding: var(--space-1) 0;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
}

.daystrip::-webkit-scrollbar {
  display: none;
}

.daystrip__item,
.datestrip__item {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 60px;
  min-height: 68px;
  padding: var(--space-2);
  border: var(--line-thin) solid transparent;
  border-radius: 5px;
  background: transparent;
  color: var(--text);
  font-size: var(--text-xs);
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  scroll-snap-align: start;
  transition:
    transform 420ms var(--spring),
    background-color var(--t-fast) var(--ease),
    border-color var(--t-fast) var(--ease),
    color var(--t-fast) var(--ease);
}

.daystrip__item:hover,
.datestrip__item:hover {
  background: var(--fill);
}

.daystrip__item--active,
.daystrip__item[aria-current="date"],
.datestrip__item--active,
.datestrip__item[aria-current="date"] {
  border-color: var(--accent-fill);
  background: var(--accent-fill);
  color: var(--accent-fg);
}

.daystrip__item--active:hover,
.datestrip__item--active:hover {
  border-color: var(--accent-hover);
  background: var(--accent-hover);
}

.daystrip__label {
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  text-transform: capitalize;
}

.daystrip__date {
  font-size: var(--text-md);
  font-weight: var(--weight-semibold);
  font-variant-numeric: tabular-nums;
}

.daystrip__count {
  font-size: var(--text-xs);
  color: currentColor;
  opacity: 0.8;
}

/* ------------------------------------------------------- Menu */

.menu {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 200px;
  max-width: 320px;
  margin: 0;
  padding: var(--space-1);
  border: var(--line-thin) solid var(--border);
  border-radius: 5px;
  background: var(--surface);
  box-shadow: var(--sh-menu);
  list-style: none;
}

.menu__item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  min-height: var(--tap-min);
  padding: var(--space-2) var(--space-3);
  border-radius: 5px;
  background: transparent;
  color: var(--text);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  line-height: 1.2;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition:
    background-color var(--t-fast) var(--ease),
    color var(--t-fast) var(--ease);
}

.menu__item:hover {
  background: var(--fill);
}

.menu__item .ph {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 20px;
}

.menu__item--active,
.menu__item[aria-current="page"] {
  background: var(--accent-soft);
  color: var(--accent-text);
}

.menu__item--active .ph,
.menu__item[aria-current="page"] .ph {
  color: currentColor;
}

.menu__item--danger {
  color: var(--danger);
}

.menu__item--danger .ph {
  color: currentColor;
}

.menu__divider {
  height: 0;
  margin: var(--space-1) 0;
  border: 0;
  border-top: var(--line-thin) solid var(--border);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0ms !important;
    transition-duration: 1ms !important;
    transition-delay: 0ms !important;
    scroll-behavior: auto !important;
  }
}
