/* MD Admin styling — Warm Editorial design-pass.
   Open Sans voor body en UI, Fraunces (variable serif) voor display.
   Koraal #fc6e51 als accent, warm-dark anchor #1a0d0a voor focus en cijfers,
   warm paper als achtergrond. Mobile-first. */

/* ==== Reset & basis ==== */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
[x-cloak] { display: none !important; }
button { font-family: inherit; cursor: pointer; }
a { color: var(--primary-text); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
img { max-width: 100%; height: auto; display: block; }

/* ==== Design tokens ==== */
:root {
  --primary: #fc6e51;
  --primary-hover: #fb441f;
  --primary-soft: #ffe9e3;
  --primary-tint: #fff4f0;
  --primary-text: #b12103;

  --anchor: #1a0d0a;
  --anchor-soft: #2b1a14;

  --bg: #faf6f1;
  --bg-deep: #f4ede4;
  --surface: #ffffff;
  --surface-alt: #faf6f1;
  --surface-warm: #fdf9f4;
  --border: #ece5da;
  --border-strong: #d8cdbd;

  --text: #1a0d0a;
  --text-soft: #695d52;
  --text-muted: #9a8e80;

  --success: #2d8c5a;
  --success-soft: #e3f3eb;
  --warning: #d97706;
  --warning-soft: #fef3e2;
  --danger: #c8322c;
  --danger-soft: #fde6e5;
  --info: #1e6da6;
  --info-soft: #e0f0fb;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius: 10px;
  --radius-lg: 16px;
  --radius-xl: 22px;

  --shadow-sm: 0 1px 2px rgba(26, 13, 10, 0.05);
  --shadow: 0 2px 10px rgba(26, 13, 10, 0.06);
  --shadow-lg: 0 14px 36px rgba(26, 13, 10, 0.12);

  --sidebar-w: 240px;
  --topbar-h: 64px;
  --bottomnav-h: 64px;

  --transition: 160ms ease;
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);

  --font-display: 'Fraunces', 'Georgia', serif;
  --font-body: 'Open Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ==== Typografie ====
   Default Open Sans voor alle koppen. Fraunces alleen op echte sectie-koppen
   en dialog-titels (zie blok hieronder), niet op datapunten zoals KPI-cijfers,
   bedragen of namen. */
h1, h2, h3, h4 {
  margin: 0 0 0.5em;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: var(--text);
}
h1 { font-size: 1.625rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.0625rem; }
h4 { font-size: 0.9375rem; }

.page-header h1,
.topbar-title,
.card-header h2,
.card-header h3,
.section-divider h3,
.section-heading,
.day-sheet-header h2,
.cal-month,
.confirm-title,
.login-card h1 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--anchor);
  font-variation-settings: "opsz" 36;
}
.page-header h1 { font-size: 1.75rem; font-variation-settings: "opsz" 60; }
.login-card h1 { font-size: 1.85rem; font-variation-settings: "opsz" 80; }
.card-header h2 { font-size: 1.2rem; font-variation-settings: "opsz" 36; }
.card-header h3 { font-size: 1.05rem; }
.section-divider h3 { font-size: 1.05rem; }
.section-heading { font-size: 1.05rem; }
.day-sheet-header h2 { font-size: 1.1rem; }
.cal-month { font-size: 1.25rem; font-variation-settings: "opsz" 40; }
.confirm-title { font-size: 1.2rem; font-variation-settings: "opsz" 40; }
.topbar-title { font-size: 1.15rem; font-variation-settings: "opsz" 30; }
p { margin: 0 0 1em; }
small, .text-sm { font-size: 0.8125rem; }
.text-soft { color: var(--text-soft); }
.text-muted { color: var(--text-muted); }
.text-mono { font-family: 'SF Mono', Menlo, Consolas, monospace; font-size: 0.85em; }

/* ==== Login screen ==== */
.login-screen {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(1100px 540px at 18% -10%, rgba(252, 110, 81, 0.18), transparent 60%),
    radial-gradient(900px 460px at 100% 110%, rgba(26, 13, 10, 0.06), transparent 55%),
    var(--bg);
  position: relative;
  overflow: hidden;
}
.login-screen::before {
  content: "MD";
  position: absolute;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(280px, 38vw, 520px);
  font-variation-settings: "opsz" 144;
  color: var(--anchor);
  opacity: 0.035;
  line-height: 0.85;
  letter-spacing: -0.04em;
  bottom: -8%;
  right: -5%;
  pointer-events: none;
}
.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 44px 36px 36px;
  box-shadow: var(--shadow-lg);
  text-align: center;
  position: relative;
  z-index: 1;
}
.login-card .logo {
  width: 76px;
  height: 76px;
  margin: 0 auto 22px;
  background: linear-gradient(135deg, var(--primary-soft), var(--primary-tint));
  border: 1px solid var(--primary-soft);
  border-radius: 22px;
  display: grid;
  place-items: center;
  font-size: 34px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), 0 8px 18px rgba(252, 110, 81, 0.15);
}
.login-card h1 {
  margin-bottom: 6px;
  font-size: 1.85rem;
  font-variation-settings: "opsz" 80;
}
.login-card .subtitle {
  color: var(--text-soft);
  margin-bottom: 32px;
  font-size: 0.9375rem;
}
.login-card .google-button-wrap {
  display: grid;
  place-items: center;
  margin-bottom: 16px;
  min-height: 44px;
}
.login-card .login-help {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin: 24px 0 0;
  line-height: 1.6;
}

/* ==== App shell ==== */
.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  grid-template-rows: var(--topbar-h) 1fr;
  grid-template-areas:
    "sidebar topbar"
    "sidebar main";
  height: 100dvh;
  overflow: hidden;
  background: var(--bg);
}

.sidebar {
  grid-area: sidebar;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 20px 12px;
  display: flex;
  flex-direction: column;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px 22px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}
.sidebar-brand .brand-mark {
  width: 38px; height: 38px;
  background: var(--anchor);
  color: white;
  border-radius: 11px;
  display: grid; place-items: center;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 19px;
  font-variation-settings: "opsz" 30;
  letter-spacing: -0.02em;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
}
.sidebar-brand .brand-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
  font-variation-settings: "opsz" 30;
  letter-spacing: -0.01em;
}
.sidebar-brand .brand-tag {
  font-size: 0.7rem;
  color: var(--text-soft);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 2px;
}

.nav-group { display: flex; flex-direction: column; gap: 18px; }
.nav-section { display: flex; flex-direction: column; gap: 2px; }
.nav-section-label {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-soft);
  padding: 0 12px 6px;
  opacity: 0.65;
}
.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-soft);
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 500;
  transition: var(--transition);
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  position: relative;
}
.nav-link:hover { background: var(--surface-alt); color: var(--text); text-decoration: none; }
.nav-link.active {
  background: var(--primary-tint);
  color: var(--primary-text);
  font-weight: 600;
}
.nav-link.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--primary);
}
.nav-link .nav-icon {
  width: 20px; height: 20px;
  display: grid; place-items: center;
  font-size: 18px;
  flex-shrink: 0;
}
.nav-link .nav-icon svg { width: 20px; height: 20px; display: block; }
.bottom-nav-link .nav-icon svg { width: 22px; height: 22px; display: block; }

.nav-link--external {
  position: relative;
}
.nav-link--external .nav-link__ext {
  margin-left: auto;
  display: grid;
  place-items: center;
  width: 16px; height: 16px;
  opacity: 0.55;
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.nav-link--external .nav-link__ext svg { width: 14px; height: 14px; display: block; }
.nav-link--external:hover .nav-link__ext {
  opacity: 1;
  transform: translate(1px, -1px);
}

.topbar {
  grid-area: topbar;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  gap: 16px;
}
.topbar-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  font-variation-settings: "opsz" 30;
  letter-spacing: -0.01em;
}
.topbar-actions { display: flex; align-items: center; gap: 12px; }

.user-menu-wrap { position: relative; }
.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px 6px 6px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 100px;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
  color: var(--text);
}
.user-chip:hover { background: var(--bg-deep); border-color: var(--border-strong); }
.user-chip img {
  width: 28px; height: 28px;
  border-radius: 50%;
}
.user-chip .user-fallback {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--anchor);
  color: white;
  display: grid; place-items: center;
  font-size: 13px;
  font-weight: 600;
}
.user-chip .user-name { font-size: 0.875rem; font-weight: 500; }
.user-chevron {
  width: 14px;
  height: 14px;
  color: var(--text-soft);
  transition: transform 200ms var(--spring);
}
.user-chevron.is-open { transform: rotate(180deg); }

.user-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 240px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  z-index: 70;
}
.user-menu-header {
  padding: 8px 12px 10px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 6px;
}
.user-menu-name {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}
.user-menu-email {
  font-size: 0.8125rem;
  color: var(--text-soft);
  margin-top: 2px;
  word-break: break-all;
}
.user-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  border: none;
  background: transparent;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: var(--transition);
}
.user-menu-item:hover { background: var(--surface-alt); }
.user-menu-item svg { width: 16px; height: 16px; flex-shrink: 0; color: var(--text-soft); }
.user-menu-item--danger { color: var(--danger); }
.user-menu-item--danger:hover { background: var(--danger-soft); }
.user-menu-item--danger svg { color: var(--danger); }

@media (max-width: 768px) {
  .user-chip .user-name { display: none; }
  .user-menu { right: -4px; min-width: 220px; }
}

.main {
  grid-area: main;
  overflow-y: auto;
  /* Voorkomt horizontale sleepruimte op pages waar elementen onbedoeld */
  /* breder zijn dan de viewport (negative margins, brede kalender-grid). */
  overflow-x: clip;
  padding: 0 28px 28px;
  background: var(--bg);
}
.main > section {
  padding-top: 28px;
}
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 0;
  padding-bottom: 24px;
  gap: 16px;
  flex-wrap: wrap;
  position: relative;
  z-index: 10;
  background: var(--bg);
}
.page-header h1 {
  margin: 0 0 4px;
}

/* ==== Mobile ==== */
.bottom-nav { display: none; }
.menu-toggle { display: none; }

@media (max-width: 768px) {
  .app-shell {
    grid-template-columns: 1fr;
    grid-template-rows: var(--topbar-h) 1fr;
    grid-template-areas:
      "topbar"
      "main";
    height: 100dvh;
    min-height: 100dvh;
    overflow: hidden;
  }
  .sidebar { display: none; }
  .topbar { padding: 0 16px; position: sticky; top: 0; z-index: 40; }
  .main {
    padding: 0 18px;
    padding-bottom: calc(var(--bottomnav-h) + env(safe-area-inset-bottom) + 48px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .main > section {
    padding-top: 18px;
  }

  .bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 6px 4px env(safe-area-inset-bottom);
    z-index: 50;
    box-shadow: 0 -4px 18px rgba(26, 13, 10, 0.06);
  }
  .bottom-nav-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    color: var(--text-soft);
    background: transparent;
    border: none;
    padding: 6px 4px;
    border-radius: var(--radius-sm);
    font-size: 0.6875rem;
    font-weight: 500;
    transition: var(--transition);
  }
  .bottom-nav-link.active { color: var(--primary); }
  .bottom-nav-link .nav-icon { font-size: 20px; line-height: 1; }
}

/* ==== Cards ==== */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 22px;
  box-shadow: var(--shadow-sm);
}
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}
.card-header h2, .card-header h3 { margin: 0; }
@media (max-width: 520px) {
  .card-header { flex-direction: column; align-items: flex-start; gap: 4px; }
}

/* KPI cards */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}
.kpi {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  position: relative;
  overflow: hidden;
  transition: transform 220ms var(--spring), box-shadow var(--transition), border-color var(--transition);
}
.kpi:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: var(--border-strong);
}
.kpi-label {
  font-size: 0.7rem;
  color: var(--text-soft);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  margin-bottom: 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.kpi { cursor: help; }
.kpi.kpi--clickable { cursor: pointer; }
.kpi.kpi--clickable:hover { border-color: var(--primary); }
.kpi.kpi--clickable:active { transform: translateY(0); }
.kpi-info {
  font-size: 0.75rem;
  color: var(--text-soft);
  opacity: 0.5;
  text-transform: none;
  font-weight: 400;
  transition: var(--transition);
  letter-spacing: 0;
}
.kpi:hover .kpi-info { opacity: 1; color: var(--primary); }
.kpi-value {
  font-size: 1.9rem;
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--anchor);
  font-variant-numeric: tabular-nums;
}
.kpi-meta { font-size: 0.8125rem; color: var(--text-soft); margin-top: 6px; }

.kpi--list .kpi-list {
  list-style: none;
  padding: 0;
  margin: 4px 0 0 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  counter-reset: kpi-counter;
}
.kpi-list li {
  counter-increment: kpi-counter;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text);
  padding: 2px 0;
}
.kpi-list li::before {
  content: counter(kpi-counter) ".";
  margin-right: 8px;
  color: var(--primary);
  font-weight: 700;
  min-width: 1.4em;
}
.kpi-list-name { flex: 1; }
.kpi-list-count {
  font-size: 0.8125rem;
  color: var(--text-soft);
  font-weight: 500;
  margin-left: 8px;
}
.kpi-accent {
  position: absolute;
  top: 0; right: 0;
  width: 44px; height: 44px;
  background: linear-gradient(135deg, var(--primary-soft), var(--primary-tint));
  border-bottom-left-radius: 80px;
  display: grid;
  place-items: start end;
  padding: 7px 9px 0 0;
  font-size: 16px;
  color: var(--primary);
}

/* ==== Buttons ==== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  background: var(--surface);
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  transition: transform 180ms var(--spring), background var(--transition), border-color var(--transition), box-shadow var(--transition), color var(--transition);
  cursor: pointer;
  white-space: nowrap;
  letter-spacing: -0.005em;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn:active:not(:disabled) { transform: translateY(1px); }

.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.2) inset, 0 4px 12px rgba(252, 110, 81, 0.22);
}
.btn-primary:hover:not(:disabled) { background: var(--primary-hover); box-shadow: 0 1px 0 rgba(255, 255, 255, 0.2) inset, 0 6px 16px rgba(251, 68, 31, 0.28); }

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border-strong);
}
.btn-secondary:hover:not(:disabled) { background: var(--surface-alt); border-color: var(--anchor); }

.btn-ghost {
  background: transparent;
  color: var(--text-soft);
}
.btn-ghost:hover:not(:disabled) { background: var(--surface-alt); color: var(--text); }

.btn-danger {
  background: var(--danger);
  color: white;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.15) inset, 0 4px 12px rgba(200, 50, 44, 0.2);
}
.btn-danger:hover:not(:disabled) { filter: brightness(0.94); }

.btn-danger-outline {
  background: transparent;
  color: var(--danger);
  border: 1px solid rgba(200, 50, 44, 0.45);
}
.btn-danger-outline:hover:not(:disabled) {
  background: var(--danger);
  color: white;
  border-color: var(--danger);
}

.btn-sm { padding: 6px 13px; font-size: 0.8125rem; }

/* ==== Forms ==== */
.form-row { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.form-row label { font-size: 0.8125rem; font-weight: 600; color: var(--text); letter-spacing: -0.005em; }
.form-row input,
.form-row select,
.form-row textarea {
  font-family: inherit;
  font-size: 0.9375rem;
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  transition: var(--transition);
}
.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

/* Inline bezorgkosten-input in de Totaal-card (nieuwe-boeking modal) */
.bezorg-input {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  justify-content: flex-end;
}
.bezorg-input__prefix {
  color: var(--text-soft, #5b5b5b);
  font-size: 0.9375rem;
}
.bezorg-input__field {
  width: 96px;
  text-align: right;
  font-family: inherit;
  font-size: 0.9375rem;
  padding: 8px 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  transition: var(--transition);
  -moz-appearance: textfield;
  appearance: textfield;
}
.bezorg-input__field:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
.bezorg-input__field::-webkit-outer-spin-button,
.bezorg-input__field::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.filter-bar {
  display: flex;
  /* nowrap op desktop: voorkomt dat filters omklappen zodra de Wis-knop
     verschijnt of een geselecteerde optie iets breder wordt. Mobiel zet
     dit terug op wrap (zie media-query onderaan), zodat het collapse-
     panel onder de search-rij kan landen. */
  flex-wrap: nowrap;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-bottom: 0;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 6;
  box-shadow: var(--shadow-sm);
}
.filter-bar select,
.filter-bar input {
  font-family: inherit;
  font-size: 0.875rem;
  padding: 7px 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
}
.filter-bar select:focus,
.filter-bar input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
/* search krimpt mee als de selects ernaast staan, maar nooit verder dan 180px
   zodat de placeholder leesbaar blijft. */
.filter-bar .filter-search { flex: 1 1 200px; min-width: 180px; }
/* Vaste minimum-breedte op de selects voorkomt dat ze pulseren bij wisselen
   van de geselecteerde optie (langere labels zoals "Wacht op betaling" of
   "via factuur" zouden anders re-flow triggeren). */
.filter-bar select { flex: 0 0 auto; min-width: 150px; }
.filter-bar .filter-date-range { flex: 0 0 auto; }
/* Wis-knop schuift altijd helemaal naar rechts en zit daardoor niet meer
   tussen de filters in. Zonder margin/order zou hij vlak na de search
   verschijnen en alle filters opzij duwen. */
.filter-bar .filter-reset { order: 99; margin-left: auto; }

.filter-toggle {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: var(--transition);
}
.filter-toggle svg { width: 16px; height: 16px; color: var(--text-soft); }
.filter-toggle:hover { background: var(--surface-alt); border-color: var(--anchor); }
.filter-toggle.is-open { background: var(--primary-tint); border-color: var(--primary); color: var(--primary-text); }
.filter-toggle.is-open svg { color: var(--primary-text); }
.filter-toggle.has-active { border-color: var(--primary); }
.filter-toggle-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--primary);
  color: white;
  font-size: 0.6875rem;
  font-weight: 700;
}

.filter-reset {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-soft);
  cursor: pointer;
  transition: var(--transition);
}
.filter-reset svg { width: 14px; height: 14px; }
.filter-reset:hover {
  background: var(--danger-soft);
  color: var(--danger);
}
@media (max-width: 700px) {
  .filter-reset-label { display: none; }
  .filter-reset { padding: 7px 10px; }
}

.filter-options {
  display: contents;
}

.filter-date-range {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.filter-date-range > span {
  font-size: 0.85rem;
  color: var(--text-soft);
}
.filter-date-range input[type="date"] {
  min-width: 120px;
}

@media (max-width: 700px) {
  /* Mobiel: search + toggle + reset op rij 1, options-panel collapse op
     rij 2. Vereist wrap; en de desktop-overrides (vaste min-widths op
     selects, order op reset) worden hier teruggedraaid. */
  .filter-bar { flex-wrap: wrap; }
  .filter-bar select { flex: 1 1 calc(50% - 4px); min-width: 0; }
  .filter-bar .filter-reset { order: 0; margin-left: 0; }
  .filter-toggle { display: inline-flex; }
  .filter-options {
    display: none;
    flex-basis: 100%;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
  }
  .filter-options.is-open { display: flex; }
  .filter-options select { flex: 1 1 calc(50% - 4px); min-width: 0; }
}
@media (max-width: 420px) {
  .filter-options select { flex-basis: 100%; }
}

/* ==== Bookings sticky toolbar ====
   Wrapt page-header (titel + acties) en filter-bar als 1 sticky-blok bovenin
   de boekingen-pagina, zodat 'Nieuwe boeking' en 'Exporteer' altijd binnen
   handbereik blijven, ook na 100+ boekingen scrollen. Compact op mobiel:
   titel + count inline, knoppen tonen kort label of alleen icoon. */
.bookings-toolbar {
  position: sticky;
  top: 0;
  z-index: 12;
  background: var(--bg);
  /* margin-bottom 0: anders ontstaat een gap onder de toolbar waar tabel-rows */
  /* doorheen kunnen scrollen. Visuele lucht onder de filterbalk zit nu IN de  */
  /* toolbar via padding-bottom, zodat het deel uitmaakt van de sticky-area.   */
  margin: 0 -28px 0;
  padding: 18px 28px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.bookings-toolbar::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--border) 12%, var(--border) 88%, transparent);
  pointer-events: none;
}
.bookings-toolbar .page-header {
  position: static;
  padding-bottom: 0;
  margin-bottom: 0;
  background: transparent;
  align-items: center;
  z-index: auto;
}
.bookings-toolbar .filter-bar {
  position: static;
  top: auto;
  z-index: auto;
  margin-bottom: 0;
}
.page-header-title {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  min-width: 0;
}
.page-header-title h1 {
  margin: 0;
}
.page-header-count {
  white-space: nowrap;
}
.page-header-actions {
  flex-shrink: 0;
}
.bookings-action-label-short { display: none; }

@media (max-width: 768px) {
  .bookings-toolbar {
    margin: 0 -18px 14px;
    padding: 12px 18px 10px;
    gap: 8px;
  }
  .bookings-toolbar .page-header h1 {
    font-size: 1.25rem;
    font-variation-settings: "opsz" 36;
  }
  .bookings-toolbar .page-header {
    gap: 10px;
  }
  .bookings-toolbar .filter-bar {
    padding: 8px 10px;
    gap: 8px;
  }
  .bookings-action-btn {
    padding: 7px 10px;
    font-size: 0.8125rem;
  }
}

@media (max-width: 520px) {
  .bookings-action-label { display: none; }
  .bookings-action-label-short { display: inline; }
  .bookings-action-btn .bookings-action-label-short {
    margin-left: 2px;
  }
  /* Exporteer wordt icon-only op smal scherm, behoudt aria-label voor screenreaders */
  .bookings-action-btn[aria-label="Exporteer naar Excel"] .bookings-action-label-short {
    display: none;
  }
  .bookings-toolbar .page-header h1 {
    font-size: 1.125rem;
  }
}

/* ==== Reviews master overrides grid ==== */
.reviews-master-grid {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 14px;
  align-items: end;
}
.reviews-master-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.reviews-master-field > span {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
}
.reviews-master-field input {
  font-family: inherit;
  font-size: 0.9375rem;
  padding: 9px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  width: 100%;
}
.reviews-master-field input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
.reviews-master-actions {
  display: flex;
  align-items: end;
}
@media (max-width: 600px) {
  .reviews-master-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .reviews-master-actions { justify-self: stretch; }
  .reviews-master-actions .btn { width: 100%; }
}

/* ==== Tables (desktop) and cards (mobile) ==== */
.bookings-table {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: var(--radius-md);
  border-collapse: separate;
  border-spacing: 0;
  overflow: clip;
  box-shadow: var(--shadow-sm);
  table-layout: fixed;
}
.bookings-table th, .bookings-table td {
  word-wrap: break-word;
  overflow-wrap: break-word;
}
.bookings-table thead {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-soft);
}
.bookings-table thead th {
  background: var(--surface-warm);
  box-shadow: inset 0 -1px 0 var(--border);
  font-weight: 700;
  position: sticky;
  top: var(--filter-bar-h, 132px);
  z-index: 5;
}
.bookings-table th, .bookings-table td {
  padding: 13px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 0.875rem;
}
.bookings-table tbody tr { cursor: pointer; transition: background var(--transition); }
.bookings-table tbody tr:hover { background: var(--surface-alt); }
.bookings-table tbody tr:last-child td { border-bottom: none; }

.cell-truncate {
  cursor: help;
  border-bottom: 1px dotted var(--text-soft);
  display: inline-block;
  max-width: 240px;
}
.cell-truncate:hover { border-bottom-style: solid; }

.hover-tooltip {
  position: fixed;
  z-index: 1000;
  max-width: 380px;
  padding: 12px 14px;
  background: #1a1a1a;
  color: #f5f5f5;
  border-radius: 8px;
  font-size: 0.95rem;
  line-height: 1.5;
  white-space: pre-wrap;
  box-shadow: 0 6px 20px rgba(0,0,0,.22);
  pointer-events: none;
}

.bookings-cards { display: none; flex-direction: column; gap: 10px; }
.bookings-cards--always { display: flex; }
.booking-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 12px;
  cursor: pointer;
  transition: border-color var(--transition), box-shadow var(--transition), transform 180ms var(--spring);
}
.booking-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}
.booking-card .b-name { font-weight: 600; color: var(--text); }
.booking-card .b-meta { color: var(--text-soft); font-size: 0.8125rem; }
.booking-card .b-amount {
  font-weight: 700;
  font-size: 1rem;
  text-align: right;
  color: var(--anchor);
  font-variant-numeric: tabular-nums;
}
.booking-card .b-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}
.booking-card .b-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px;
}

/* ==== Bezorgkosten cards (mobile) ==== */
.bezorg-cards { display: none; flex-direction: column; gap: 10px; }
.bezorg-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: var(--shadow-sm);
}
.bezorg-card.is-inactive { opacity: 0.6; }
.bezorg-card-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.bezorg-card-label {
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--text);
}
.bezorg-card-meta {
  font-size: 0.8125rem;
  color: var(--text-soft);
  margin-top: 2px;
}
.bezorg-card-amount {
  font-weight: 700;
  font-size: 1.0625rem;
  color: var(--anchor);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

@media (max-width: 768px) {
  .bookings-table { display: none; }
  .bookings-cards { display: flex; }
  .bezorg-table-wrap { display: none; }
  .bezorg-cards { display: flex; }
}

/* ==== Status badges ==== */
.badge-prefix {
  font-size: 0.6875rem;
  font-weight: 600;
  opacity: 0.65;
  margin-right: 6px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.badge-suffix {
  font-size: 0.6875rem;
  font-weight: 500;
  opacity: 0.7;
  margin-left: 6px;
}
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: capitalize;
  white-space: nowrap;
  letter-spacing: -0.005em;
}
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-info { background: var(--info-soft); color: var(--info); }
.badge-neutral { background: var(--surface-alt); color: var(--text-soft); border: 1px solid var(--border); }

/* ==== Alerts ==== */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  margin-bottom: 16px;
}
.alert-warning { background: var(--warning-soft); color: var(--warning); border: 1px solid #f8d9a8; }
.alert-danger { background: var(--danger-soft); color: var(--danger); border: 1px solid #f3c2c0; }
.alert-info { background: var(--info-soft); color: var(--info); border: 1px solid #b9def0; }
.alert-success { background: var(--success-soft); color: var(--success); border: 1px solid #b9e0c8; }
.alert-sm { padding: 8px 12px; font-size: 0.8125rem; margin-top: 6px; margin-bottom: 0; }

/* ==== Empty state ==== */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-soft);
}
.empty-state .empty-icon {
  font-size: 48px;
  margin-bottom: 12px;
  opacity: 0.5;
}

/* ==== Loader ==== */
.loader {
  display: inline-block;
  width: 18px; height: 18px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.loader-page {
  display: grid;
  place-items: center;
  padding: 80px 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ==== Calendar ==== */
.cal-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.cal-nav { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
@media (max-width: 720px) {
  .cal-nav { width: 100%; justify-content: space-between; gap: 6px; }
  .cal-month {
    min-width: 0 !important;
    flex: 1 1 auto;
    font-size: 1.05rem !important;
    padding: 0 4px;
  }
  .cal-nav-btn { width: 34px; height: 34px; font-size: 16px; }
}
.cal-nav-btn {
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  display: grid; place-items: center;
  font-size: 18px;
  cursor: pointer;
  transition: transform 180ms var(--spring), background var(--transition), border-color var(--transition);
  color: var(--text);
}
.cal-nav-btn:hover { background: var(--surface-alt); border-color: var(--anchor); transform: scale(1.05); }
.cal-month {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  text-transform: capitalize;
  min-width: 200px;
  text-align: center;
  letter-spacing: -0.01em;
  font-variation-settings: "opsz" 40;
}

.cal-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  font-size: 0.75rem;
  color: var(--text-soft);
}
.cal-legend-item { display: inline-flex; align-items: center; gap: 5px; }
.cal-legend-dot { width: 8px; height: 8px; border-radius: 50%; }

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  gap: 1px;
  box-shadow: var(--shadow-sm);
}
.cal-weekday {
  background: var(--surface-warm);
  text-align: center;
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
  color: var(--text-soft);
  padding: 9px 4px;
}
.cal-cell {
  background: var(--surface);
  min-height: 96px;
  padding: 6px 8px;
  cursor: pointer;
  position: relative;
  transition: background var(--transition);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.cal-cell:hover { background: var(--surface-alt); }
.cal-cell.out-of-month { background: var(--surface-warm); color: var(--text-muted); }
.cal-cell.weekend { background: linear-gradient(180deg, var(--surface) 0%, var(--surface-warm) 100%); }
.cal-cell.today { box-shadow: inset 0 0 0 2px var(--primary); }
.cal-cell.all-blocked {
  background: repeating-linear-gradient(45deg, var(--surface), var(--surface) 6px, var(--bg-deep) 6px, var(--bg-deep) 12px);
}
.cal-cell-day {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text);
}
.cal-cell.out-of-month .cal-cell-day { color: var(--text-muted); font-weight: 500; }
.cal-cell.today .cal-cell-day {
  background: var(--primary);
  color: white;
  width: 22px; height: 22px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-weight: 700;
}
.cal-cell-bookings {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: auto;
}
.cal-booking-pill {
  font-size: 0.6875rem;
  padding: 1px 6px;
  border-radius: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 600;
}
.cal-cell-blocks {
  display: flex;
  gap: 3px;
  flex-wrap: wrap;
}
.cal-block-tag {
  font-size: 0.6875rem;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--anchor);
  color: white;
  font-weight: 600;
}
.cal-cell-overflow { font-size: 0.6875rem; color: var(--text-soft); }

@media (max-width: 768px) {
  .cal-cell { min-height: 60px; padding: 4px; }
  .cal-cell-day { font-size: 0.75rem; }
  .cal-booking-pill, .cal-block-tag { font-size: 0; padding: 0; width: 6px; height: 6px; border-radius: 50%; display: inline-block; }
  .cal-cell-bookings { flex-direction: row; flex-wrap: wrap; gap: 3px; }
  .cal-weekday { font-size: 0.625rem; padding: 6px 2px; }
}

/* Day detail sheet */
.day-sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  justify-content: center;
  align-items: flex-end;
}
@media (max-width: 768px) {
  .day-sheet-backdrop {
    background: rgba(26, 13, 10, 0.45);
    backdrop-filter: blur(2px);
    animation: fadeIn 150ms ease;
  }
}
@media (min-width: 768px) {
  .day-sheet-backdrop {
    align-items: flex-end;
    justify-content: flex-end;
    padding: 24px;
    pointer-events: none;
  }
}
.day-sheet {
  background: var(--surface);
  width: 100%;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  box-shadow: var(--shadow-lg);
  max-height: 85dvh;
  overflow-y: auto;
  animation: slideUp 220ms var(--spring);
  pointer-events: auto;
  border: 1px solid var(--border);
  border-bottom: none;
}
@media (min-width: 768px) {
  .day-sheet {
    width: 440px;
    border-radius: var(--radius-lg);
    max-height: 80dvh;
    border: 1px solid var(--border);
  }
}
.day-sheet-header {
  position: sticky; top: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.day-sheet-header h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  text-transform: capitalize;
  letter-spacing: -0.01em;
  font-variation-settings: "opsz" 40;
}
.day-sheet-body { padding: 18px 22px; }
.day-sheet-section { margin-bottom: 20px; }
.day-sheet-section h3 {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-soft);
  margin: 0 0 10px;
  font-weight: 700;
}
.day-mini-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
  font-size: 0.875rem;
  cursor: pointer;
  transition: var(--transition);
}
.day-mini-card:hover { background: var(--surface-alt); border-color: var(--border-strong); }
.day-mini-card .mini-name { font-weight: 600; }
.day-mini-card .mini-meta { color: var(--text-soft); font-size: 0.8125rem; }

/* ==== Onderhoud bottom-sheet (mobile) ==== */
.maintenance-sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 95;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(26, 13, 10, 0.45);
  backdrop-filter: blur(2px);
  animation: fadeIn 150ms ease;
}
.maintenance-sheet {
  background: var(--surface);
  width: 100%;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  box-shadow: var(--shadow-lg);
  padding: 10px 16px calc(env(safe-area-inset-bottom) + 20px);
  border: 1px solid var(--border);
  border-bottom: none;
  animation: slideUp 220ms var(--spring);
}
.maintenance-sheet-handle {
  width: 40px;
  height: 4px;
  border-radius: 2px;
  background: var(--border-strong);
  opacity: 0.5;
  margin: 0 auto 14px;
}
.maintenance-sheet-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-soft);
  padding: 0 6px 10px;
}
.maintenance-sheet-item {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 14px 12px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 8px;
  text-align: left;
  cursor: pointer;
  transition: var(--transition);
  color: var(--text);
}
.maintenance-sheet-item:hover { background: var(--surface-alt); }
.maintenance-sheet-item.active {
  background: var(--primary-tint);
  border-color: var(--primary-tint);
  color: var(--primary-text);
}
.maintenance-sheet-item .nav-icon { width: 22px; height: 22px; flex-shrink: 0; }
.maintenance-sheet-item .nav-icon svg { width: 22px; height: 22px; }
.maintenance-sheet-item-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.maintenance-sheet-item-body strong {
  font-size: 0.9375rem;
  font-weight: 600;
}
.maintenance-sheet-item-body small {
  font-size: 0.8125rem;
  color: var(--text-soft);
}
.maintenance-sheet-item.active .maintenance-sheet-item-body small { color: var(--primary-text); opacity: 0.75; }

.block-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
  font-size: 0.875rem;
}
.block-row .block-info { display: flex; flex-direction: column; gap: 2px; }
.block-row .block-reden { color: var(--text-soft); font-size: 0.8125rem; }

.bulk-block-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}
.bulk-block-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  flex-wrap: wrap;
}
@media (max-width: 520px) {
  .bulk-block-grid { grid-template-columns: 1fr; }
  .bulk-block-actions { flex-direction: column-reverse; align-items: stretch; }
  .bulk-block-actions .btn { width: 100%; }
  .bulk-block-actions .text-soft { text-align: center; }
}

.add-block-form {
  display: grid;
  gap: 10px;
  padding: 14px;
  background: var(--surface-warm);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.add-block-form select,
.add-block-form input {
  font-family: inherit;
  font-size: 0.875rem;
  padding: 8px 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
}
.add-block-form select:focus,
.add-block-form input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

/* ==== Modal ==== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(26, 13, 10, 0.55);
  backdrop-filter: blur(3px);
  z-index: 100;
  display: grid;
  place-items: end center;
  animation: fadeIn 180ms ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.modal {
  background: var(--surface);
  width: 100%;
  max-width: 720px;
  max-height: 92dvh;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: slideUp 240ms var(--spring);
  border: 1px solid var(--border);
  border-bottom: none;
}
@media (min-width: 768px) {
  .modal-backdrop { place-items: center; padding: 24px; }
  .modal { border-radius: var(--radius-lg); max-height: 86dvh; border: 1px solid var(--border); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 26px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  background: var(--surface);
}
.modal-title { display: flex; flex-direction: column; gap: 4px; }
.modal-title h2 {
  margin: 0;
  font-family: inherit;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.005em;
  color: var(--text);
}
.modal-title .modal-subtitle { color: var(--text-soft); font-size: 0.8125rem; }
.modal-header-actions { display: flex; align-items: center; gap: 4px; }
.modal-icon-btn {
  background: transparent;
  border: none;
  width: 36px; height: 36px;
  border-radius: 50%;
  display: grid; place-items: center;
  color: var(--text-soft);
  cursor: pointer;
  transition: var(--transition);
}
.modal-icon-btn svg { width: 18px; height: 18px; }
.modal-icon-btn:hover { background: var(--primary-tint); color: var(--primary-text); }
.modal-close {
  background: transparent;
  border: none;
  width: 36px; height: 36px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 22px;
  color: var(--text-soft);
  cursor: pointer;
  transition: var(--transition);
}
.modal-close:hover { background: var(--surface-alt); color: var(--text); }

.edit-form {
  margin-bottom: 22px;
  padding: 18px 20px;
  background: var(--surface-warm);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.edit-form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0 20px;
}
.edit-form-grid .form-row--wide { grid-column: 1 / -1; }
.edit-form-grid .form-row { margin-bottom: 12px; }
.edit-form-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 6px;
  flex-wrap: wrap;
}
@media (max-width: 520px) {
  .edit-form-grid { grid-template-columns: 1fr; }
  .edit-form-actions { flex-direction: column-reverse; align-items: stretch; }
  .edit-form-actions .flex { justify-content: flex-end; }
}

/* Read-only weergave van een veld dat elders gemuteerd wordt (zoals
   bezorg_blok / ophaal_blok via de Bezorgplanning-flow). Visueel matchend
   met de andere form-row inputs, alleen gedempter zodat duidelijk is dat
   hij niet bewerkbaar is in deze context. */
.form-row .readonly-value {
  font-family: inherit;
  font-size: 0.9375rem;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface-warm);
  color: var(--text-soft);
}

.modal-body {
  padding: 22px 26px;
  overflow-y: auto;
  flex: 1;
}
.modal-footer {
  padding: 14px 26px;
  border-top: 1px solid var(--border);
  background: var(--surface-warm);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}
.modal-footer { justify-content: flex-start; }
.modal-footer .actions { display: flex; flex-wrap: wrap; gap: 10px; }
/* Veilige acties links, danger-acties met auto-spacer naar rechts, Sluiten   */
/* helemaal rechts via tweede auto-margin. Bij wrap behoudt elke rij dezelfde */
/* uitlijning: safe op rij 1, danger op rij 2 links, Sluiten rij 2 rechts.    */
.modal-footer .actions--safe { width: 100%; }
.modal-footer .actions--danger { margin-right: auto; }
.modal-footer .modal-footer__close { margin-left: auto; }

/* Detail-grid in modal */
.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px 28px;
  margin-bottom: 22px;
  padding: 18px 20px;
  background: var(--surface-warm);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.detail-item .detail-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-soft);
  font-weight: 700;
  margin-bottom: 3px;
}
.detail-item .detail-value {
  font-size: 0.9375rem;
  color: var(--text);
  word-break: break-word;
}
.detail-item .detail-value a { color: var(--primary-text); }

.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 22px;
}
.contact-actions a, .contact-actions button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 100px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  transition: transform 180ms var(--spring), background var(--transition), border-color var(--transition);
}
.contact-actions a:hover, .contact-actions button:hover {
  background: var(--surface-alt);
  border-color: var(--anchor);
  text-decoration: none;
  transform: translateY(-1px);
}

.section-divider {
  margin: 22px 0 18px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}
.section-divider h3 {
  margin: 0 0 14px;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  font-variation-settings: "opsz" 30;
  color: var(--anchor);
}

.note-textarea {
  width: 100%;
  font-family: inherit;
  font-size: 0.9375rem;
  padding: 11px 13px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  resize: vertical;
  min-height: 80px;
  transition: var(--transition);
  line-height: 1.5;
}
.note-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
.note-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
  font-size: 0.8125rem;
  color: var(--text-soft);
}

/* Mollie betaallink resultaat */
.payment-link-result {
  margin-top: 8px;
}

.payment-status-info {
  padding: 12px 14px;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  line-height: 1.5;
}
.payment-status-info--paid {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #bbf7d0;
}
.payment-status-info--canceled {
  background: var(--surface-alt);
  color: var(--text-soft);
  border: 1px solid var(--border);
}
.payment-status-info--warn {
  background: #fef3c7;
  color: #78350f;
  border: 1px solid #fde68a;
}
.payment-status-info--warn a { color: #78350f; text-decoration: underline; }

.payment-feedback {
  margin-bottom: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  background: #dcfce7;
  color: #166534;
  border: 1px solid #bbf7d0;
  font-size: 0.875rem;
  font-weight: 600;
  animation: fadeIn 200ms ease;
  display: flex;
  align-items: center;
  gap: 8px;
}
.payment-feedback--loading {
  background: var(--surface-alt);
  color: var(--text-soft);
  border: 1px solid var(--border);
}
.payment-link-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}
.payment-link-input {
  flex: 1;
  min-width: 0;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.8125rem;
  padding: 9px 11px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
  color: var(--text);
}
.payment-link-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
.form-row__label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}
.flex-wrap { flex-wrap: wrap; }

/* ==== Confirm dialog ==== */
.confirm-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(26, 13, 10, 0.55);
  backdrop-filter: blur(3px);
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 24px;
  animation: fadeIn 140ms ease;
}
.confirm-dialog {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 460px;
  padding: 30px 30px 0 30px;
  animation: slideUp 200ms var(--spring);
  display: flex;
  flex-direction: column;
}
.confirm-title {
  margin: 0 0 12px 0;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--anchor);
  line-height: 1.25;
  letter-spacing: -0.01em;
  font-variation-settings: "opsz" 40;
}
.confirm-message {
  margin: 0 0 24px 0;
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--text-soft);
}
.confirm-type-row {
  margin: 0 0 24px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.confirm-type-label {
  font-size: 0.875rem;
  color: var(--text-soft);
}
.confirm-type-label code {
  background: rgba(200, 50, 44, 0.1);
  color: var(--danger);
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 700;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.875rem;
}
.confirm-type-input {
  padding: 10px 12px;
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 0.9375rem;
  font-family: inherit;
  background: var(--surface);
  color: var(--text);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.confirm-type-input:focus {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(200, 50, 44, 0.15);
}
.confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0 -30px;
  padding: 16px 26px;
  border-top: 1px solid var(--border);
  background: var(--surface-warm);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}
.confirm-actions .btn-ghost {
  background: var(--surface);
  border: 1px solid var(--border);
}
.confirm-actions .btn-ghost:hover:not(:disabled) {
  background: var(--bg);
  border-color: var(--border-strong);
}

/* ==== Util ==== */
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.mt-2 { margin-top: 8px; } .mt-4 { margin-top: 16px; }

/* ==== Inflatables grid ==== */
.inflatable-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 18px;
  margin-top: 8px;
}
.inflatable-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  transition: transform 220ms var(--spring), box-shadow var(--transition), border-color var(--transition);
  display: flex;
  flex-direction: column;
}
.inflatable-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow);
  transform: translateY(-3px);
}
.inflatable-card.is-inactive { opacity: 0.55; }

.inflatable-cover {
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--surface-alt);
  overflow: hidden;
}
.inflatable-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 400ms var(--spring);
}
.inflatable-card:hover .inflatable-cover img { transform: scale(1.04); }
.inflatable-cover.cover-broken {
  background: linear-gradient(135deg, var(--primary-soft), var(--surface-alt));
}
.inflatable-cover-placeholder {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  font-size: 2.5rem;
  background: linear-gradient(135deg, var(--primary-soft), var(--surface-alt));
  color: var(--primary);
}
.inflatable-photo-count {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(26, 13, 10, 0.7);
  color: white;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 100px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  backdrop-filter: blur(4px);
}
.inflatable-photo-count--empty {
  background: var(--primary-soft);
  color: var(--primary-text);
  backdrop-filter: none;
}
.inflatable-inactive-tag {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--anchor);
  color: white;
  font-size: 0.6875rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 100px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.inflatable-body {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}
.inflatable-title {
  margin: 0;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.005em;
  color: var(--text);
}
.inflatable-meta {
  font-size: 0.8125rem;
  color: var(--text-soft);
}
.inflatable-price {
  margin-top: auto;
  padding-top: 8px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary-text);
  font-variant-numeric: tabular-nums;
}

/* ==== Inflatable edit modal ==== */
.modal--wide { max-width: 880px; }

.section-heading {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  margin: 24px 0 12px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  letter-spacing: -0.01em;
  color: var(--anchor);
  font-variation-settings: "opsz" 30;
}
.section-heading:first-child { padding-top: 0; border-top: none; margin-top: 0; }
.section-heading--with-action {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.inflatable-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0 20px;
}
.form-row--toggle { grid-column: 1 / -1; margin-bottom: 8px; }
.toggle-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9375rem;
  font-weight: 500;
  cursor: pointer;
}
.toggle-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  cursor: pointer;
}

.empty-state--compact {
  padding: 24px;
  text-align: center;
  background: var(--surface-warm);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-soft);
  margin-bottom: 12px;
}

/* Foto-grid in modal */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}
.photo-tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
  cursor: grab;
}
.photo-tile.is-cover { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-soft); }
.photo-tile.is-dragging { opacity: 0.4; }

.photo-tile-image {
  position: relative;
  aspect-ratio: 1 / 1;
  background: var(--surface-alt);
  overflow: hidden;
}
.photo-tile-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.photo-tile-image.is-broken img { display: none; }
.photo-tile-image .photo-broken-label {
  display: none;
  position: absolute;
  inset: 0;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 12px;
  font-size: 0.75rem;
  color: var(--text-soft);
  background: var(--surface-alt);
}
.photo-tile-image.is-broken .photo-broken-label { display: flex; }

.photo-cover-tag,
.photo-order-tag {
  position: absolute;
  top: 8px;
  left: 8px;
  font-size: 0.6875rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 100px;
  background: var(--primary);
  color: white;
}
.photo-order-tag {
  background: rgba(26, 13, 10, 0.7);
}

.photo-tile-meta {
  padding: 8px 10px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.photo-filename {
  font-size: 0.75rem;
  color: var(--text-soft);
  word-break: break-all;
  line-height: 1.3;
}
.photo-actions {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.btn-xs {
  padding: 3px 8px;
  font-size: 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  transition: var(--transition);
}
.btn-xs:hover:not(:disabled) { background: var(--surface-alt); }
.btn-xs:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-danger-text { color: #b91c1c; }
.btn-danger-text:hover:not(:disabled) { background: #fee2e2; }

.photo-add-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
  align-items: center;
}

.upload-queue {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
  padding: 12px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.upload-row {
  display: grid;
  grid-template-columns: 1fr 120px 90px;
  gap: 12px;
  align-items: center;
  font-size: 0.8125rem;
}
.upload-row-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.upload-row-bar {
  height: 6px;
  background: var(--border);
  border-radius: 100px;
  overflow: hidden;
}
.upload-row-fill {
  height: 100%;
  background: var(--primary);
  transition: width 200ms ease;
}
.upload-row[data-status="klaar"] .upload-row-fill { background: #16a34a; }
.upload-row[data-status="mislukt"] .upload-row-fill { background: #b91c1c; }
.upload-row-status {
  font-size: 0.75rem;
  color: var(--text-soft);
  text-align: right;
}
.upload-row[data-status="klaar"] .upload-row-status { color: #16a34a; font-weight: 600; }
.upload-row[data-status="mislukt"] .upload-row-status { color: #b91c1c; font-weight: 600; }
.hidden { display: none !important; }

/* ==== Chart (boekingen 6 maanden vooruit) ==== */
.chart-card .card-header h2 { letter-spacing: -0.01em; }
.chart-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 640 / 240;
  padding: 4px 0 0;
}
.chart-svg {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
}
.chart-grid {
  stroke: var(--border);
  stroke-width: 1;
  stroke-dasharray: 3 5;
  fill: none;
}
.chart-grid--strong {
  stroke: var(--border-strong);
  stroke-dasharray: none;
}
.chart-area {
  fill: var(--primary-soft);
  opacity: 0.7;
}
.chart-line {
  fill: none;
  stroke: var(--primary);
  stroke-width: 2.25;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.chart-point-group { cursor: pointer; touch-action: manipulation; }
.chart-point-hit { fill: transparent; }
.chart-point {
  fill: white;
  stroke: var(--primary);
  stroke-width: 2;
  transition: r 180ms var(--spring), fill 180ms ease, stroke-width 180ms ease;
  pointer-events: none;
}
.chart-point-group:hover .chart-point,
.chart-point.is-active {
  r: 6;
  fill: var(--primary);
  stroke-width: 2.5;
}

.chart-action {
  display: flex;
  justify-content: center;
  margin-top: 14px;
}
.chart-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border: 1px solid var(--border-strong);
  border-radius: 100px;
  background: var(--surface);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: var(--transition);
  touch-action: manipulation;
  white-space: nowrap;
}
.chart-action-btn svg {
  width: 16px;
  height: 16px;
  color: var(--primary);
  transition: transform 200ms var(--spring);
}
.chart-action-btn:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}
.chart-action-btn:hover svg { color: white; transform: translateX(3px); }
.chart-action-btn:active { transform: translateY(1px); }

/* HTML tooltip overlay (schaalt niet mee met SVG, vaste leesgrootte) */
.chart-tooltip-html {
  position: absolute;
  background: var(--anchor);
  color: white;
  padding: 8px 14px;
  border-radius: 8px;
  pointer-events: none;
  white-space: nowrap;
  box-shadow: 0 6px 18px rgba(26, 13, 10, 0.3);
  z-index: 5;
  line-height: 1.3;
}
.chart-tooltip-html * { pointer-events: none; }
.chart-tooltip-html::after {
  content: "";
  position: absolute;
  bottom: -5px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 10px;
  height: 10px;
  background: var(--anchor);
  pointer-events: none;
}
.chart-tooltip-title-html {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.7;
  margin-bottom: 3px;
}
.chart-tooltip-value-html {
  font-size: 0.875rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
@media (max-width: 600px) {
  .chart-tooltip-html { padding: 9px 14px; border-radius: 8px; }
  .chart-tooltip-title-html { font-size: 0.7rem; }
  .chart-tooltip-value-html { font-size: 0.9375rem; }
}
.chart-value {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 700;
  fill: var(--anchor);
  pointer-events: none;
}
.chart-x-label {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  fill: var(--text-soft);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  pointer-events: none;
}
.chart-y-label {
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 500;
  fill: var(--text-muted);
}
@media (max-width: 600px) {
  .chart-value { font-size: 11px; }
  .chart-x-label { font-size: 11px; }
}

/* ==== Bezorgplanning-pagina ====
   Refined-functional: planner-tool, scanbaarheid boven sier. Mobile-first
   met compacte header, sticky datumfilter en duidelijke knop-hierarchie. */

.bezorgplanning-page {
  display: flex;
  flex-direction: column;
  gap: 14px;
  /* Voorkomt 3-5px horizontale sleepruimte die negative-margins veroorzaakten */
  overflow-x: clip;
}
.bezorgplanning-intro .page-title {
  margin: 0 0 4px 0;
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}
.bezorgplanning-intro .page-subtitle {
  margin: 0;
  color: var(--text-soft, #737373);
  font-size: 0.95rem;
  max-width: 720px;
}

/* Alleen de datumbalk sticky - titel en uitleg scrollen mee weg op desktop. */
.bezorgplanning-toolbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 8px 0;
}
.bezorgplanning-toolbar::after {
  content: "";
  position: absolute;
  inset: auto 0 -1px;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--border) 10%, var(--border) 90%, transparent);
  pointer-events: none;
}
.bezorgplanning-date-label {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface, #fff);
  border: 1px solid var(--border, #e5e5e5);
  border-radius: 8px;
  padding: 6px 12px;
  flex: 1 1 auto;
  min-width: 0;
  transition: border-color 120ms;
}
.bezorgplanning-date-label:focus-within {
  border-color: #fc6e51;
}
.bezorgplanning-date-label > span {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-soft, #737373);
  white-space: nowrap;
}
.bezorgplanning-date-label input[type="date"] {
  flex: 1 1 auto;
  border: none;
  background: transparent;
  padding: 4px 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-strong, #1a1a1a);
  font-family: inherit;
  min-width: 0;
}
.bezorgplanning-date-label input[type="date"]:focus { outline: none; }

/* Section-heading compactere variant */
.section-heading--compact {
  margin: 4px 0 8px;
  padding-top: 0;
  border-top: none;
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-strong, #1a1a1a);
}

/* Inline empty-state - geen vol paneel meer */
.bezorgplanning-empty {
  padding: 10px 14px;
  background: var(--surface-warm, #faf8f5);
  border: 1px dashed var(--border, #e5e5e5);
  border-radius: 8px;
  color: var(--text-soft, #737373);
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 8px;
}
.bezorgplanning-empty > span[aria-hidden] {
  color: #2d8a3e;
  font-weight: 800;
}

.bezorgplanning-feedback {
  background: #fff5ec;
  border: 1px solid #fed7c2;
  color: #8a3d10;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.9rem;
}

.bezorgplanning-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Card: refined-functional. Op desktop een rustige lijst-item, op mobiel  */
/* tactiele klik-feedback omdat de hele card daar als touch-target werkt.   */
.bezorgplanning-card {
  background: #fff;
  border: 1px solid var(--border, #e5e5e5);
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  cursor: pointer;
}
.bezorgplanning-card--confirmed {
  background: #f8fbf7;
  border-color: #cfe6cf;
}
@media (max-width: 600px) {
  .bezorgplanning-card {
    transition: border-color 120ms, box-shadow 120ms, transform 80ms;
  }
  .bezorgplanning-card:active {
    transform: scale(0.998);
    border-color: #fc6e51;
  }
  .bezorgplanning-card--confirmed:active {
    border-color: #2d8a3e;
  }
}

/* Booking-card-achtig patroon: 1fr auto grid, naam links, status rechts. */
.bezorgplanning-card__row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: start;
  gap: 12px;
}
.bezorgplanning-card__main { min-width: 0; }
.bezorgplanning-card__klant {
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.3;
  color: var(--text-strong, #1a1a1a);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bezorgplanning-card__meta {
  font-size: 0.85rem;
  color: var(--text-soft, #737373);
  margin-top: 2px;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bezorgplanning-card__status {
  flex-shrink: 0;
  align-self: start;
}

/* Wens compact, één regel met linker accent-streep */
.bezorgplanning-card__wens {
  padding: 6px 10px;
  font-size: 0.82rem;
  color: var(--text-soft, #737373);
  background: #faf9f7;
  border-left: 3px solid #fc6e51;
  border-radius: 0 4px 4px 0;
  line-height: 1.4;
}
.bezorgplanning-card__wens > span > strong {
  font-weight: 700;
  color: var(--text-strong, #1a1a1a);
}
.bezorgplanning-card__opm {
  display: block;
  margin-top: 2px;
  font-style: italic;
  font-size: 0.8rem;
}

/* Slot-form: stack op mobile, 2 kolommen vanaf 600px */
.bezorgplanning-card__slots {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
@media (min-width: 600px) {
  .bezorgplanning-card__slots {
    grid-template-columns: 1fr 1fr;
  }
  .bezorgplanning-card__actions {
    grid-column: 1 / -1;
  }
}
.bezorgplanning-card__slots .form-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.bezorgplanning-card__slots label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-soft, #737373);
}
.bezorgplanning-card__slots select {
  padding: 10px 12px;
  border: 1px solid var(--border, #e5e5e5);
  border-radius: 8px;
  font-size: 0.95rem;
  background: #fff;
  font-family: inherit;
}
.bezorgplanning-custom-input {
  margin-top: 6px;
  padding: 10px 12px;
  border: 1px solid var(--border, #e5e5e5);
  border-radius: 8px;
  font-size: 0.9rem;
  width: 100%;
  background: #fff;
  font-family: inherit;
}
.bezorgplanning-card__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* Bevestigde tijden in 1 horizontale regel */
.bezorgplanning-card__confirmed-slots {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  padding: 8px 12px;
  background: #ecf6ec;
  border-radius: 6px;
  font-size: 0.9rem;
}
.bezorgplanning-card__confirmed-slots > div {
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.bezorgplanning-card__confirmed-slots .text-soft {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #5a6e5a;
}

.bezorgplanning-bulk {
  display: flex;
  justify-content: flex-end;
  margin-top: 2px;
}

/* "Wijzigen en opnieuw versturen" - duidelijke secondary knop in brand-oranje */
.btn--reconfirm {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border: 1px solid #fc6e51;
  background: #fff;
  color: #fb441f;
  font-weight: 600;
  font-size: 0.85rem;
  border-radius: 8px;
  cursor: pointer;
  transition: background 120ms, color 120ms;
  white-space: nowrap;
}
.btn--reconfirm:hover {
  background: #fc6e51;
  color: #fff;
}

/* Sidebar nav-badge */
.nav-link__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  margin-left: 8px;
  background: #fc6e51;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1;
  border-radius: 9px;
  flex-shrink: 0;
}

/* Primaire actie op bevestigd-card: full-width, prominent */
.bezorgplanning-card__reconfirm {
  width: 100%;
  justify-content: center;
}

/* Mobile (<=600px) ===================================================== */
@media (max-width: 600px) {
  /* Verberg de lange uitleg-tekst; planner kent de flow */
  .bezorgplanning-intro .page-subtitle { display: none; }
  .bezorgplanning-intro .page-title {
    font-size: 1.2rem;
  }

  /* Actions full-width op mobile */
  .bezorgplanning-card__actions {
    flex-direction: column-reverse;
  }
  .bezorgplanning-card__actions .btn { width: 100%; }
  .bezorgplanning-bulk { justify-content: stretch; }
  .bezorgplanning-bulk .btn { width: 100%; }
}

/* ==== Weekdag-aanvragen ==== */
/* Dashboard-alert: verschijnt alleen als er open aanvragen zijn. */
.aanvraag-alert {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  width: 100%;
  text-align: left;
  margin-bottom: 1.5rem;
  padding: 1rem 1.15rem;
  background: var(--warning-soft);
  border: 1px solid #f4d199;
  border-left: 4px solid var(--warning);
  border-radius: var(--radius, 12px);
  cursor: pointer;
  transition: box-shadow var(--transition), transform var(--transition);
}
.aanvraag-alert:hover { box-shadow: 0 6px 18px rgba(217, 119, 6, 0.18); transform: translateY(-1px); }
.aanvraag-alert__icon { font-size: 1.5rem; line-height: 1; flex-shrink: 0; }
.aanvraag-alert__body { display: flex; flex-direction: column; gap: 0.15rem; flex: 1; min-width: 0; }
.aanvraag-alert__body strong { color: #92400e; font-size: 1.02rem; }
.aanvraag-alert__sub { color: #a16207; font-size: 0.85rem; }
.aanvraag-alert__arrow { color: var(--warning); font-size: 1.2rem; flex-shrink: 0; }

/* Beoordelingsblok in de boeking-detailmodal. */
.aanvraag-besluit {
  background: var(--warning-soft);
  border: 1px solid #f4d199;
  border-radius: var(--radius, 12px);
  padding: 1rem 1.15rem;
}
.aanvraag-besluit h3 { color: #92400e; }
.aanvraag-besluit__acties { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-bottom: 0.5rem; }
.aanvraag-besluit__afkeur { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 0.5rem; }
.aanvraag-besluit__afkeur label { color: #a16207; font-weight: 600; }
.aanvraag-besluit__afkeur .btn-danger { align-self: flex-start; }

/* ==== Reduced motion ==== */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
