/* MD Admin styling.
   Huisstijl koraal #fc6e51 als accent, witte basis, Open Sans, 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-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }

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

  --bg: #f7f6f4;
  --surface: #ffffff;
  --surface-alt: #fafaf9;
  --border: #e8e6e2;
  --border-strong: #d6d3cd;

  --text: #1a1a1a;
  --text-soft: #6b6863;
  --text-muted: #9b9892;

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

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;

  --shadow-sm: 0 1px 2px rgba(20, 18, 14, 0.04);
  --shadow: 0 2px 8px rgba(20, 18, 14, 0.06);
  --shadow-lg: 0 8px 24px rgba(20, 18, 14, 0.10);

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

  --transition: 150ms ease;
}

/* ==== Typografie ==== */
h1, h2, h3, h4 { margin: 0 0 0.5em; font-weight: 700; line-height: 1.25; letter-spacing: -0.01em; }
h1 { font-size: 1.625rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.0625rem; }
h4 { font-size: 0.9375rem; }
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: linear-gradient(135deg, #ffeae3 0%, #f7f6f4 60%);
}
.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 40px 32px;
  box-shadow: var(--shadow-lg);
  text-align: center;
}
.login-card .logo {
  width: 72px;
  height: 72px;
  margin: 0 auto 20px;
  background: var(--primary-soft);
  border-radius: 20px;
  display: grid;
  place-items: center;
  font-size: 32px;
}
.login-card h1 { margin-bottom: 4px; }
.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;
}

/* ==== 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;
}

.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 24px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}
.sidebar-brand .brand-mark {
  width: 36px; height: 36px;
  background: var(--primary);
  color: white;
  border-radius: 10px;
  display: grid; place-items: center;
  font-weight: 700;
  font-size: 16px;
}
.sidebar-brand .brand-name { font-weight: 700; font-size: 0.9375rem; }
.sidebar-brand .brand-tag { font-size: 0.75rem; color: var(--text-soft); }

.nav-group { display: flex; flex-direction: column; gap: 2px; }
.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;
}
.nav-link:hover { background: var(--surface-alt); color: var(--text); text-decoration: none; }
.nav-link.active {
  background: var(--primary-soft);
  color: var(--primary-text);
  font-weight: 600;
}
.nav-link .nav-icon {
  width: 20px; height: 20px;
  display: grid; place-items: center;
  font-size: 18px;
  flex-shrink: 0;
}

.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-size: 1.0625rem; font-weight: 600; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }

.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);
}
.user-chip:hover { background: var(--bg); }
.user-chip img {
  width: 28px; height: 28px;
  border-radius: 50%;
}
.user-chip .user-fallback {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: grid; place-items: center;
  font-size: 13px;
  font-weight: 600;
}
.user-chip .user-name { font-size: 0.875rem; font-weight: 500; }

.main {
  grid-area: main;
  overflow-y: auto;
  padding: 24px;
}
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 24px;
  gap: 16px;
  flex-wrap: wrap;
}

/* ==== 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: 16px;
    padding-bottom: calc(var(--bottomnav-h) + env(safe-area-inset-bottom) + 24px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .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 -2px 12px rgba(20, 18, 14, 0.04);
  }
  .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);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.card-header h2, .card-header h3 { margin: 0; }

/* KPI cards */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.kpi {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  position: relative;
  overflow: hidden;
}
.kpi-label {
  font-size: 0.8125rem;
  color: var(--text-soft);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
  margin-bottom: 6px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.kpi { cursor: help; }
.kpi-info {
  font-size: 0.75rem;
  color: var(--text-soft);
  opacity: 0.6;
  text-transform: none;
  font-weight: 400;
  transition: var(--transition);
}
.kpi:hover .kpi-info { opacity: 1; color: var(--primary); }
.kpi-value {
  font-size: 1.875rem;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
}
.kpi-meta { font-size: 0.8125rem; color: var(--text-soft); margin-top: 4px; }

.kpi--list .kpi-list {
  list-style: none;
  padding: 0;
  margin: 4px 0 0 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  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: 40px; height: 40px;
  background: var(--primary-soft);
  border-bottom-left-radius: 80px;
  display: grid;
  place-items: start end;
  padding: 6px 8px 0 0;
  font-size: 16px;
  color: var(--primary);
}

/* ==== Buttons ==== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: var(--surface);
  font-size: 0.9375rem;
  font-weight: 600;
  transition: var(--transition);
  cursor: pointer;
  white-space: nowrap;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background: var(--primary);
  color: white;
}
.btn-primary:hover:not(:disabled) { background: var(--primary-hover); }

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

.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;
}
.btn-danger:hover:not(:disabled) { filter: brightness(0.92); }

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

/* ==== Forms ==== */
.form-row { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.form-row label { font-size: 0.875rem; font-weight: 600; color: var(--text); }
.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);
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 16px;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 6;
}
.filter-bar::before {
  content: "";
  position: absolute;
  top: -24px;
  left: -24px;
  right: -24px;
  height: 24px;
  background: var(--bg);
  z-index: -1;
}
.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 .filter-search { flex: 1 1 200px; }

/* ==== Tables (desktop) and cards (mobile) ==== */
.bookings-table {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  border-collapse: separate;
  border-spacing: 0;
}
.bookings-table thead {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-soft);
}
.bookings-table thead th {
  background: var(--surface-alt);
  position: sticky;
  top: 65px;
  z-index: 5;
  box-shadow: inset 0 -1px 0 var(--border);
}
.bookings-table thead th:first-child { border-top-left-radius: var(--radius); }
.bookings-table thead th:last-child { border-top-right-radius: var(--radius); }
.bookings-table th, .bookings-table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 0.875rem;
}
.bookings-table tbody tr { cursor: pointer; transition: var(--transition); }
.bookings-table tbody tr:hover { background: var(--surface-alt); }
.bookings-table tbody tr:last-child td { border-bottom: 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);
  padding: 14px 16px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 12px;
  cursor: pointer;
}
.booking-card .b-name { font-weight: 600; }
.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; }
.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;
}

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

/* ==== Status badges ==== */
.badge-prefix {
  font-size: 0.6875rem;
  font-weight: 600;
  opacity: 0.65;
  margin-right: 6px;
  letter-spacing: 0.04em;
  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;
}
.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; }

/* ==== 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: 16px;
  flex-wrap: wrap;
}
.cal-nav { display: flex; align-items: center; gap: 8px; }
.cal-nav-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  display: grid; place-items: center;
  font-size: 18px;
  cursor: pointer;
  transition: var(--transition);
}
.cal-nav-btn:hover { background: var(--surface-alt); }
.cal-month {
  font-size: 1.125rem;
  font-weight: 700;
  text-transform: capitalize;
  min-width: 180px;
  text-align: center;
}

.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);
  overflow: hidden;
  gap: 1px;
}
.cal-weekday {
  background: var(--surface-alt);
  text-align: center;
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
  color: var(--text-soft);
  padding: 8px 4px;
}
.cal-cell {
  background: var(--surface);
  min-height: 92px;
  padding: 6px 8px;
  cursor: pointer;
  position: relative;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.cal-cell:hover { background: var(--surface-alt); }
.cal-cell.out-of-month { background: var(--surface-alt); color: var(--text-muted); }
.cal-cell.weekend { background: linear-gradient(180deg, var(--surface) 0%, #fcfaf6 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) 6px, var(--bg) 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(--text);
  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(20, 18, 14, 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 200ms ease;
  pointer-events: auto;
}
@media (min-width: 768px) {
  .day-sheet {
    width: 420px;
    border-radius: var(--radius-lg);
    max-height: 80dvh;
  }
}
.day-sheet-header {
  position: sticky; top: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.day-sheet-header h2 { margin: 0; font-size: 1rem; text-transform: capitalize; }
.day-sheet-body { padding: 16px 20px; }
.day-sheet-section { margin-bottom: 18px; }
.day-sheet-section h3 {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-soft);
  margin: 0 0 8px;
  font-weight: 700;
}
.day-mini-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
  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); }
.day-mini-card .mini-name { font-weight: 600; }
.day-mini-card .mini-meta { color: var(--text-soft); font-size: 0.8125rem; }

.block-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
  background: var(--surface-alt);
  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; }

.add-block-form {
  display: grid;
  gap: 8px;
  padding: 12px;
  background: var(--surface-alt);
  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);
}

/* ==== Modal ==== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(20, 18, 14, 0.55);
  backdrop-filter: blur(2px);
  z-index: 100;
  display: grid;
  place-items: end center;
  animation: fadeIn 150ms 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 200ms ease;
}
@media (min-width: 768px) {
  .modal-backdrop { place-items: center; padding: 24px; }
  .modal { border-radius: var(--radius-lg); max-height: 86dvh; }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.modal-title { display: flex; flex-direction: column; gap: 2px; }
.modal-title h2 { margin: 0; font-size: 1.125rem; }
.modal-title .modal-subtitle { color: var(--text-soft); font-size: 0.8125rem; }
.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); }

.modal-body {
  padding: 20px 24px;
  overflow-y: auto;
  flex: 1;
}
.modal-footer {
  padding: 14px 24px;
  border-top: 1px solid var(--border);
  background: var(--surface-alt);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}
.modal-footer .actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* Detail-grid in modal */
.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px 24px;
  margin-bottom: 20px;
}
.detail-item .detail-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-soft);
  font-weight: 600;
  margin-bottom: 2px;
}
.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: 20px;
}
.contact-actions a, .contact-actions button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  transition: var(--transition);
}
.contact-actions a:hover, .contact-actions button:hover { background: var(--bg); text-decoration: none; }

.section-divider {
  margin: 20px 0 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.section-divider h3 { margin: 0 0 12px; font-size: 0.9375rem; }

.note-textarea {
  width: 100%;
  font-family: inherit;
  font-size: 0.9375rem;
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  resize: vertical;
  min-height: 80px;
  transition: var(--transition);
}
.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: 8px;
  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: 8px 10px;
  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(20, 18, 14, 0.55);
  backdrop-filter: blur(2px);
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 24px;
  animation: fadeIn 120ms ease;
}
.confirm-dialog {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 460px;
  padding: 28px 28px 0 28px;
  animation: slideUp 160ms ease;
  display: flex;
  flex-direction: column;
}
.confirm-title {
  margin: 0 0 12px 0;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}
.confirm-message {
  margin: 0 0 24px 0;
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--text-soft);
}
.confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0 -28px;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  background: var(--surface-alt);
  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: 16px;
  margin-top: 8px;
}
.inflatable-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}
.inflatable-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}
.inflatable-card.is-inactive { opacity: 0.6; }

.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;
}
.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(20, 18, 14, 0.65);
  color: white;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 100px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.inflatable-photo-count--empty {
  background: var(--primary-soft);
  color: var(--primary-text);
}
.inflatable-inactive-tag {
  position: absolute;
  top: 10px;
  left: 10px;
  background: #1a1a1a;
  color: white;
  font-size: 0.6875rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 100px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.inflatable-body {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}
.inflatable-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
}
.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);
}

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

.section-heading {
  font-size: 0.9375rem;
  font-weight: 700;
  margin: 20px 0 10px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.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-alt);
  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(20, 18, 14, 0.65);
}

.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-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; }
