:root {
  --paper: #f6f4ef;
  --surface: #ffffff;
  --ink: #18202e;
  --navy: #1f2d47;
  --navy-700: #2c3d5e;
  --navy-100: #e9edf5;
  --navy-50: #f3f5fa;
  --slot-line: #cdd5e4;
  --muted: #6b6a66;
  --line: #e5e1d8;
  --accent: #b5532c;
  --accent-700: #964222;
  --accent-50: #fbf1ec;
  --ok: #2f6f5e;
  --ok-50: #eaf3f0;
  --warn: #9a6a12;
  --warn-50: #fbf4e4;
  --bad: #a83a32;
  --bad-50: #faecea;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(24, 32, 46, .05), 0 6px 20px rgba(24, 32, 46, .06);
  --font: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 15px/1.5 var(--font); }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.muted { color: var(--muted); margin: 0; }
.small { font-size: 13px; }

/* ── Demo-balk, header, hero, footer ─────────────────────────────────────── */
.demo-ribbon { background: var(--ink); color: #c9cfdb; font-size: 12px; text-align: center; padding: 6px 16px; letter-spacing: .02em; }
.demo-ribbon strong { color: #fff; font-weight: 600; }

.site-header { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.header-inner { display: flex; align-items: center; gap: 28px; min-height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--navy); text-decoration: none; }
.brand-mark { width: 38px; height: 38px; }
.brand-text { display: grid; line-height: 1.05; }
.brand-small { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.brand-name { font-size: 19px; font-weight: 800; letter-spacing: -.02em; }
.main-nav { display: flex; gap: 22px; margin-right: auto; }
.main-nav a { color: var(--ink); text-decoration: none; font-weight: 500; font-size: 14px; }
.main-nav a:hover { color: var(--accent); }
.account { display: flex; align-items: center; gap: 10px; }
.account-btn { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 4px 12px 4px 4px; cursor: pointer; font-size: 14px; font-weight: 500; }
.account-btn:hover { border-color: var(--slot-line); }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--navy); color: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 600; }

.hero { background: var(--navy); color: #fff; padding: 40px 0 72px; background-image: radial-gradient(1200px 300px at 85% 0%, rgba(255,255,255,.07), transparent 60%); }
.eyebrow { margin: 0 0 6px; text-transform: uppercase; letter-spacing: .16em; font-size: 12px; color: #aeb9cf; }
.hero h1 { font-weight: 700; letter-spacing: -.02em; font-size: clamp(32px, 5vw, 44px); line-height: 1.1; margin: 0 0 10px; }
.hero-lead { margin: 0; max-width: 560px; color: #d6dcea; }

.site-footer { border-top: 1px solid var(--line); margin-top: 48px; padding: 20px 0 32px; color: var(--muted); font-size: 13px; }
.footer-inner { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* ── Boekingsblok ────────────────────────────────────────────────────────── */
.booking { margin-top: -44px; }
.tabs { display: flex; gap: 4px; }
.tabs [role="tab"] { border: 0; background: rgba(255,255,255,.12); color: #e5e9f2; padding: 11px 18px; border-radius: 10px 10px 0 0; cursor: pointer; font-weight: 600; font-size: 14px; display: flex; align-items: center; gap: 8px; }
.tabs [role="tab"][aria-selected="true"] { background: var(--surface); color: var(--ink); }
.tabs [role="tab"]:not([aria-selected="true"]):hover { background: rgba(255,255,255,.2); }
.count { background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; min-width: 20px; height: 20px; border-radius: 999px; display: inline-grid; place-items: center; padding: 0 6px; }
.panel { background: var(--surface); border-radius: 0 var(--radius) var(--radius) var(--radius); box-shadow: var(--shadow); padding: 24px; }

.filters { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.field { display: grid; gap: 6px; min-width: 0; }
.field-label { font-size: 13px; font-weight: 600; color: var(--ink); }
.field-help { margin: 0; font-size: 12.5px; color: var(--muted); }
.field-help.error { color: var(--bad); }

input, select { font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; min-width: 0; width: 100%; }
input:hover { border-color: var(--slot-line); }
input:focus, button:focus-visible, .date-display:focus-within { outline: 2px solid var(--navy-700); outline-offset: 1px; }input[aria-invalid="true"] { border-color: var(--bad); background: var(--bad-50); }

.date-nav { display: flex; gap: 8px; }
.date-display { position: relative; flex: 1; border: 1px solid var(--line); border-radius: 10px; display: flex; align-items: center; justify-content: center; font-weight: 600; cursor: pointer; padding: 0 12px; min-height: 44px; text-align: center; }
.date-display input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.date-display input::-webkit-calendar-picker-indicator { position: absolute; inset: 0; width: 100%; height: 100%; cursor: pointer; }
.date-field { justify-content: space-between; font-weight: 400; text-align: left; background: var(--surface); }
.date-field::after { content: ""; width: 18px; height: 18px; flex: none; opacity: .55; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'%3E%3Crect x='3' y='5' width='18' height='16' rx='2'/%3E%3Cpath d='M3 10h18M8 3v4M16 3v4'/%3E%3C/svg%3E") center / contain no-repeat; }
.date-field:hover { border-color: var(--slot-line); }
.icon-btn { border: 1px solid var(--line); background: var(--surface); width: 44px; min-height: 44px; border-radius: 10px; cursor: pointer; font-size: 20px; line-height: 1; display: grid; place-items: center; flex: none; }
.icon-btn:hover:not(:disabled) { background: var(--navy-50); }
.icon-btn:disabled { opacity: .35; cursor: default; }

.segmented { display: flex; background: var(--navy-50); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 3px; min-height: 44px; }
.segmented button { flex: 1; border: 0; background: transparent; border-radius: 7px; cursor: pointer; font-weight: 600; padding: 6px 10px; color: var(--muted); }
.segmented button:hover { color: var(--ink); }
.segmented button[aria-checked="true"] { background: var(--navy); color: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.15); }

/* Zoekopdracht-oproep */
.search-cta { margin: 20px 0 22px; display: flex; align-items: center; gap: 16px; padding: 16px 18px; border-radius: var(--radius); background: var(--accent-50); border: 1px solid #f0d6c9; }
.search-cta-icon { width: 44px; height: 44px; flex: none; border-radius: 50%; background: var(--accent); display: grid; place-items: center; }
.search-cta-icon svg { width: 22px; height: 22px; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.search-cta-text { display: grid; gap: 2px; flex: 1; font-size: 14px; color: #4a3a33; }
.search-cta-text strong { font-size: 16px; color: var(--ink); }

.grid-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 13px; color: var(--muted); margin-bottom: 10px; flex-wrap: wrap; }

.tee-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; align-items: start; }
.loops { display: grid; grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr)); gap: 10px; align-items: start; }
.search-cta-inline { margin-top: 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 14px; border-radius: 10px; border: 1px dashed #e2bfae; background: var(--accent-50); font-size: 14px; color: #4a3a33; }
.search-cta-inline strong { color: var(--ink); }
.col-head { background: var(--navy); color: #fff; font-weight: 600; font-size: 14px; text-align: center; padding: 9px 8px; border-radius: 8px; margin-bottom: 8px; display: flex; align-items: center; justify-content: center; gap: 7px; }
.col-head .dot { width: 10px; height: 10px; border-radius: 50%; box-shadow: 0 0 0 2px rgba(255,255,255,.25); }
.col-list { display: grid; gap: 8px; max-height: 560px; overflow-y: auto; padding-right: 2px; }
.slot { border: 1px solid var(--slot-line); background: var(--navy-50); border-radius: 8px; padding: 10px 12px; cursor: pointer; font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; text-align: center; transition: background .15s, border-color .15s; }
.slot:hover { background: var(--navy-100); border-color: var(--navy-700); }
.col-empty { font-size: 13px; color: var(--muted); border: 1px dashed var(--line); border-radius: 8px; padding: 12px; text-align: center; }
.col-empty button { display: block; margin: 6px auto 0; }

.grid-empty { grid-column: 1 / -1; text-align: center; padding: 40px 16px; border: 1px dashed var(--line); border-radius: var(--radius); }
.grid-empty strong { display: block; font-size: 17px; margin-bottom: 4px; }
.grid-empty p { margin: 0 0 16px; color: var(--muted); }

/* ── Knoppen ─────────────────────────────────────────────────────────────── */
.btn { border-radius: 10px; padding: 11px 18px; cursor: pointer; border: 1px solid transparent; font-weight: 600; font-size: 14px; white-space: nowrap; }
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--ink); }
.btn-primary:disabled { opacity: .55; cursor: not-allowed; }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-700); }
.btn-ghost { background: var(--surface); border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { background: var(--navy-50); }
.btn-link { background: none; border: 0; padding: 0; color: var(--muted); text-decoration: underline; cursor: pointer; font-size: 13px; }
.btn-danger { background: var(--bad); color: #fff; }
.btn-sm { padding: 7px 12px; font-size: 13px; }

/* ── Mijn zoekopdrachten ─────────────────────────────────────────────────── */
.panel-head { display: flex; justify-content: space-between; align-items: start; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.panel-head h2 { font-weight: 700; letter-spacing: -.02em; font-size: 26px; margin: 0 0 2px; }
.live { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--muted); margin-left: 6px; }
.live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #b9b6ae; }
.live.on { color: var(--ok); }
.live.on::before { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-50); }

.alert-list { display: grid; gap: 12px; }
.alert-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; display: grid; grid-template-columns: auto 1fr auto; gap: 16px; align-items: center; transition: border-color .3s, box-shadow .3s; }
.alert-card.flash { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-50); }
.alert-date { width: 56px; text-align: center; border-radius: 10px; background: var(--navy-50); border: 1px solid var(--line); padding: 6px 0; line-height: 1.1; }
.alert-date .d { display: block; font-size: 21px; font-weight: 700; }
.alert-date .m { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.alert-main { min-width: 0; display: grid; gap: 4px; }
.alert-title { font-weight: 600; font-size: 16px; }
.alert-title .day { text-transform: capitalize; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: 12px; border: 1px solid var(--line); border-radius: 999px; padding: 1px 9px; color: var(--muted); }
.chip.auto { border-color: #d9c1b5; color: var(--accent-700); background: var(--accent-50); }
.alert-side { display: grid; justify-items: end; gap: 8px; }
.status { font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status.active { background: var(--navy-50); color: var(--navy-700); }
.status.active::before { animation: pulse 1.6s ease-in-out infinite; }
.status.matched, .status.booked { background: var(--ok-50); color: var(--ok); }
.status.failed { background: var(--warn-50); color: var(--warn); }
.status.deleted, .status.expired, .status.unknown { background: #f1efe9; color: var(--muted); }
@keyframes pulse { 50% { opacity: .25; } }
.found { grid-column: 2 / -1; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 13px; }
.found b { background: var(--ok); color: #fff; border-radius: 6px; padding: 1px 8px; font-variant-numeric: tabular-nums; }
.history { grid-column: 2 / -1; list-style: none; margin: 0; padding: 8px 0 0; border-top: 1px dashed var(--line); font-size: 12.5px; color: var(--muted); display: grid; gap: 2px; }
.history time { font-variant-numeric: tabular-nums; margin-right: 8px; }
.confirm { display: flex; gap: 6px; align-items: center; font-size: 13px; }

.section-label { font-size: 12px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); margin: 28px 0 10px; }
.alert-card.past { opacity: .72; }

.empty-state { text-align: center; padding: 48px 16px; }
.empty-state strong { display: block; font-size: 17px; margin-bottom: 4px; }
.empty-state p { margin: 0 auto 16px; color: var(--muted); max-width: 420px; }

/* ── Modal ───────────────────────────────────────────────────────────────── */
.modal { border: 0; padding: 0; border-radius: 16px; width: min(520px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); box-shadow: 0 24px 64px rgba(24, 32, 46, .28); color: var(--ink); background: var(--surface); }
.modal-sm { width: min(400px, calc(100vw - 24px)); }
html:has(dialog[open]) { overflow: hidden; } /* pagina erachter niet laten meescrollen */
.modal { overscroll-behavior: contain; }
.modal::backdrop { background: rgba(24, 32, 46, .5); backdrop-filter: blur(2px); }
.modal[open] { animation: pop .18s ease-out; }
@keyframes sheet { from { transform: translateY(24px); opacity: 0; } }
@keyframes pop { from { transform: translateY(8px) scale(.98); opacity: 0; } }
.modal form { display: flex; flex-direction: column; max-height: calc(100dvh - 24px); }
.modal-head { display: flex; justify-content: space-between; align-items: start; gap: 12px; padding: 22px 24px 4px; }
.modal-head h2 { font-weight: 700; letter-spacing: -.02em; font-size: 24px; margin: 0 0 2px; }
.close { width: 36px; min-height: 36px; font-size: 14px; border-radius: 50%; }
.modal-body { padding: 16px 24px 8px; display: grid; gap: 18px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 24px 20px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.actions { display: flex; gap: 8px; margin-left: auto; }
.powered { font-size: 12px; color: var(--muted); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.span-2 { grid-column: 1 / -1; margin-top: -6px; }

.who { background: var(--navy-50); border-radius: 10px; padding: 14px; display: grid; gap: 10px; }
.who-title { margin: 0; font-weight: 600; font-size: 14px; }
.who .muted { margin-top: -8px; }

.time-range { display: flex; align-items: center; gap: 10px; }
.time { text-align: center; font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: .03em; max-width: 120px; min-height: 44px; }
.time-sep { color: var(--muted); }

.autobook { border: 1px solid var(--line); border-radius: 10px; padding: 14px; display: grid; gap: 10px; }
.toggle { display: flex; align-items: center; gap: 14px; cursor: pointer; }
.toggle > span { flex: 1; display: grid; gap: 1px; }
.toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.toggle i { flex: none; width: 46px; height: 28px; border-radius: 999px; background: #d7d4cc; position: relative; transition: background .2s; }
.toggle i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s; }
.toggle input:checked + i { background: var(--navy); }
.toggle input:checked + i::after { transform: translateX(18px); }
.toggle input:focus-visible + i { outline: 2px solid var(--navy-700); outline-offset: 2px; }
.mates { display: grid; gap: 8px; }
.mate-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 640px) { .mate-fields { grid-template-columns: 1fr; } }

.form-error { color: var(--bad); font-size: 14px; margin: 0; }
.form-error:empty { display: none; }
.service-banner { margin: 0 0 16px; padding: 12px 16px; border-radius: 10px; background: var(--bad-50); color: var(--bad); border: 1px solid var(--bad); font-size: 14px; }
.service-banner[hidden] { display: none; }

.done { padding: 36px 28px 28px; text-align: center; }
.done-icon { width: 56px; height: 56px; border-radius: 50%; background: var(--ok-50); color: var(--ok); font-size: 26px; display: grid; place-items: center; margin: 0 auto 14px; }
.done h2 { font-weight: 700; letter-spacing: -.02em; font-size: 26px; margin: 0 0 6px; }
.done .muted { margin-bottom: 22px; }
.done .actions { justify-content: center; margin: 0; }

/* ── Meldingen ───────────────────────────────────────────────────────────── */
.toasts { position: fixed; right: 16px; bottom: 16px; display: grid; gap: 10px; z-index: 20; max-width: min(380px, calc(100vw - 32px)); }
.toast { background: var(--ink); color: #fff; border-radius: 12px; padding: 14px 16px; box-shadow: 0 10px 30px rgba(0,0,0,.25); animation: rise .25s ease-out; font-size: 14px; border-left: 4px solid var(--accent); }
.toast strong { display: block; margin-bottom: 2px; }
.toast.good { border-left-color: #6fbfa6; }
.toast.warn { border-left-color: #e0a43a; }
@keyframes rise { from { transform: translateY(10px); opacity: 0; } }

/* ── Klein scherm ────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .main-nav { display: none; }
  .header-inner { justify-content: space-between; }
  .col-list { max-height: none; }
  .search-cta-inline .btn { width: 100%; }
}
@media (max-width: 640px) {
  .panel { padding: 16px; }
  .filters, .two { grid-template-columns: 1fr; }
  .search-cta { flex-wrap: wrap; }
  .search-cta .btn { width: 100%; }
  .alert-card { grid-template-columns: auto 1fr; }
  .alert-side { grid-column: 1 / -1; grid-auto-flow: column; justify-content: space-between; align-items: center; }
  .found, .history { grid-column: 1 / -1; }
  .account-btn .name { display: none; }
  .account-btn { padding-right: 4px; }
  .modal-body, .modal-head, .modal-foot { padding-left: 18px; padding-right: 18px; }
  .modal-head h2 { font-size: 21px; }
  /* Mobiel: zoekopdracht als schermvullend paneel dat in één keer scrollt (geen vaste kop/knoppenbalk). */
  .modal:not(.modal-sm) { width: 100%; max-width: 100%; height: 100dvh; max-height: 100dvh; margin: 0; inset: 0; border-radius: 0; overflow-y: auto; }
  .modal:not(.modal-sm)[open] { animation: sheet .22s ease-out; }
  .modal form { display: block; max-height: none; }
  .modal-body { overflow: visible; }
  .modal-foot { border-top: 0; padding-top: 8px; padding-bottom: 28px; }
  .modal-foot .actions { width: 100%; }
  .modal-foot .actions .btn { flex: 1; }
  .modal-foot .powered { order: 2; width: 100%; text-align: center; }
  .done { min-height: 100dvh; display: flex; flex-direction: column; justify-content: center; }
  .done .actions { flex-direction: column-reverse; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
