/* Handleidingen — zelfde kleuren, lettertypes en navigatierail als planning.koningterijk.nl.
   Standaard licht ("fris"); donker (navy en goud) via het maantje, onthouden per apparaat (assets/theme.js).
   Opbouw: 1 tokens · 2 basis · 3 shell (beheer) · 4 knoppen en velden · 5 kaarten en tabellen
           6 formulieren · 7 gastenpagina's · 8 meldingen en setup */

/* ============ 1. Tokens ============ */
:root {
    --navy-950: #0b1030; --navy-900: #121a44; --navy-800: #1b2560; --navy-700: #27347d;
    --gold-600: #a8821a; --gold-500: #d4ad3a; --gold-400: #e6c565; --gold-100: #faf1d6;
    --bg: #f5f7fb; --card: #ffffff; --card-2: #f8fafd; --ink: #16203f; --sub: #56607d; --faint: #8b93ab;
    --line: rgba(20,24,52,.09); --line-2: rgba(20,24,52,.055); --field-line: rgba(20,24,52,.16);
    --busy: #3b74f6; --busy-bg: #e6efff;
    --done: #1fae78; --done-bg: #dcf7ec; --done-ink: #12805a;
    --urgent: #ec5656; --urgent-bg: #ffe8e8; --urgent-ink: #c23b3b;
    --shadow: 0 1px 1px rgba(16,20,48,.03), 0 10px 30px -12px rgba(16,20,48,.14);
    --display: 'Instrument Serif', Georgia, 'Times New Roman', serif;
    --sans: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --radius: 22px; --rail: 84px;
    color-scheme: light;
}
html[data-theme="dark"] {
    --bg: #0a0e26; --card: #121839; --card-2: #171e48; --ink: #eef0fb; --sub: #a9aecb; --faint: #767da4;
    --line: rgba(255,255,255,.09); --line-2: rgba(255,255,255,.05); --field-line: rgba(255,255,255,.16);
    --busy-bg: rgba(69,102,232,.22);
    --done-bg: rgba(31,157,102,.22); --done-ink: #3fcf96;
    --urgent-bg: rgba(224,74,74,.2); --urgent-ink: #ff8a8a;
    --gold-100: rgba(212,173,58,.14);
    --shadow: 0 10px 30px -12px rgba(0,0,0,.65);
    color-scheme: dark;
}

/* ============ 2. Basis ============ */
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
    min-height: 100dvh; background: var(--bg); color: var(--ink);
    font-family: var(--sans); font-size: 15px; line-height: 1.45; -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
a.link { color: var(--busy); font-weight: 700; }
a.link:hover { text-decoration: underline; }
:focus-visible { outline: 3px solid var(--gold-400); outline-offset: 2px; }
h1, h2, h3 { margin: 0; }
code { background: var(--card-2); border: 1px solid var(--line); padding: 1px 6px; border-radius: 6px; font-size: 13px; }
.eyebrow { display: block; margin: 0; font-size: 11.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--gold-600); font-weight: 800; }
html[data-theme="dark"] .eyebrow { color: var(--gold-400); }
.muted-text { color: var(--sub); font-size: 13px; }

/* ============ 3. Shell: navigatierail (zoals planning) en pagina ============ */
.shell { display: grid; grid-template-columns: var(--rail) minmax(0, 1fr); min-height: 100dvh; }
.rail {
    position: sticky; top: 0; height: 100dvh; z-index: 40;
    display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 18px 0;
    background: #fff; border-right: 1px solid var(--line); box-shadow: 4px 0 24px -18px rgba(22,32,63,.25);
}
.rail .logo {
    width: 48px; height: 48px; margin-bottom: 14px; border-radius: 15px; display: grid; place-items: center;
    background: #fff; border: 1px solid var(--line); box-shadow: 0 8px 18px -12px rgba(27,37,96,.45);
}
.rail .logo img { width: 34px; height: 34px; object-fit: contain; }
.rail a { position: relative; width: 52px; height: 52px; border-radius: 15px; display: grid; place-items: center; color: #7d87a3; }
.rail svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.rail a:hover { background: var(--card-2); color: var(--navy-800); }
.rail a.on { background: linear-gradient(145deg, var(--navy-700), var(--navy-900)); color: #fff; box-shadow: 0 10px 22px -10px rgba(27,37,96,.7); }
.rail a.on:after { content: ""; position: absolute; right: -6px; top: 14px; bottom: 14px; width: 3px; border-radius: 3px; background: var(--gold-500); }
.rail .tip {
    position: absolute; left: 62px; z-index: 5; white-space: nowrap; pointer-events: none;
    background: #05081c; color: #fff; font-size: 12.5px; font-weight: 700; padding: 6px 10px; border-radius: 8px;
    opacity: 0; transform: translateX(-4px); transition: .15s;
}
.rail a:hover .tip, .rail a:focus-visible .tip { opacity: 1; transform: none; }
.rail .sep { width: 30px; height: 1px; background: var(--line); margin: 8px 0; }
.rail .bottom { margin-top: auto; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.theme { border: 0; background: transparent; color: #7d87a3; width: 42px; height: 42px; border-radius: 12px; font-size: 17px; cursor: pointer; }
.theme:hover { background: var(--card-2); color: var(--navy-800); }
.rail .me { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: var(--gold-500); color: var(--navy-950); font-weight: 800; font-size: 13px; cursor: default; }
.rail .ver { font-size: 10px; font-weight: 600; letter-spacing: .03em; color: #8d94bd; opacity: .6; }
html[data-theme="dark"] .rail { background: var(--navy-950); border-color: rgba(255,255,255,.05); box-shadow: none; }
html[data-theme="dark"] .rail a, html[data-theme="dark"] .theme { color: #8d94bd; }
html[data-theme="dark"] .rail a:hover, html[data-theme="dark"] .theme:hover { background: rgba(255,255,255,.07); color: #fff; }
html[data-theme="dark"] .rail a.on { background: linear-gradient(145deg, var(--gold-400), var(--gold-500)); color: var(--navy-950); }
html[data-theme="dark"] .rail .logo { background: linear-gradient(145deg, #fff, #e9e6dc); }
html[data-theme="dark"] .rail .sep { background: rgba(255,255,255,.1); }

.page { min-width: 0; width: 100%; max-width: 1240px; padding: 30px clamp(18px, 3vw, 40px) 40px; }
.app-version { margin: 32px 0 0; text-align: center; font-size: 11px; font-weight: 600; letter-spacing: .04em; color: var(--faint); opacity: .7; user-select: none; }

/* Paginakop: eyebrow, serif-titel, uitleg en knoppen rechts */
.hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.hero h1 { margin: 6px 0 0; font-family: var(--display); font-weight: 400; font-size: 44px; line-height: 1.02; max-width: 820px; }
.hero p { margin: 6px 0 0; color: var(--sub); max-width: 680px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

@media (max-width: 860px) {
    .shell { grid-template-columns: 1fr; }
    .rail {
        position: fixed; top: auto; bottom: 0; left: 0; right: 0; height: auto;
        flex-direction: row; justify-content: flex-start; gap: 4px; overflow-x: auto;
        padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
        border-right: 0; border-top: 1px solid var(--line); box-shadow: 0 -10px 30px -22px rgba(22,32,63,.4);
    }
    .rail .logo, .rail .sep, .rail .tip, .rail .ver, .rail .me { display: none; }
    .rail a { width: 48px; height: 48px; flex: none; }
    .rail a.on:after { display: none; }
    .rail .bottom { margin: 0 0 0 auto; flex-direction: row; }
    .page { padding: 20px 16px 110px; }
    .hero h1 { font-size: 34px; }
}

/* ============ 4. Knoppen, velden, labels ============ */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 42px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--line);
    background: var(--card); color: var(--ink); font-weight: 700; font-size: 14px; white-space: nowrap; cursor: pointer;
}
.btn:hover { border-color: color-mix(in srgb, var(--ink) 25%, transparent); }
.btn.primary { background: var(--navy-800); border-color: var(--navy-800); color: #fff; }
.btn.primary:hover { background: var(--navy-700); }
html[data-theme="dark"] .btn.primary { border: 0; background: linear-gradient(145deg, var(--gold-400), var(--gold-500)); color: var(--navy-950); }
.btn.ghost { background: transparent; }
.btn.small { min-height: 34px; padding: 0 12px; border-radius: 10px; font-size: 13px; }
.btn.danger { color: var(--urgent-ink); }
.btn.danger:hover { background: var(--urgent-bg); border-color: transparent; }
.btn.wide { width: 100%; min-height: 52px; font-size: 15px; border-radius: 14px; }

.pill { display: inline-flex; align-items: center; width: max-content; border-radius: 20px; padding: 3px 10px; font-size: 12px; font-weight: 800; background: var(--gold-100); color: var(--gold-600); }
html[data-theme="dark"] .pill { color: var(--gold-400); }

input, select, textarea {
    width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--field-line); border-radius: 12px;
    background: var(--card); color: var(--ink); font-weight: 500; font-size: 14.5px; outline: none;
    transition: border-color .16s ease, box-shadow .16s ease;
}
textarea { resize: vertical; }
input::placeholder, textarea::placeholder { color: var(--faint); }
input:focus, select:focus, textarea:focus { border-color: var(--gold-500); box-shadow: 0 0 0 4px rgba(212,173,58,.18); }
input[type=checkbox] { accent-color: var(--gold-500); width: 20px; height: 20px; min-height: 0; padding: 0; flex: none; }
input[type=file] { padding: 9px 12px; }
select {
    appearance: none; padding-right: 36px;
    background-image: linear-gradient(45deg, transparent 50%, var(--sub) 50%), linear-gradient(135deg, var(--sub) 50%, transparent 50%);
    background-position: calc(100% - 19px) 50%, calc(100% - 14px) 50%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat;
}

/* ============ 5. Kaarten, kerncijfers en tabellen ============ */
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 0 0 18px; }
.stat { display: block; background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 18px 20px; box-shadow: var(--shadow); transition: border-color .15s, transform .15s; }
.stat:hover { border-color: color-mix(in srgb, var(--gold-500) 55%, transparent); transform: translateY(-1px); }
.stat strong { display: block; font-family: var(--display); font-weight: 400; font-size: 44px; line-height: 1; }
.stat span { display: block; margin-top: 6px; color: var(--sub); font-size: 13px; font-weight: 600; }

.card, .quick-card { display: block; background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 18px 20px; box-shadow: var(--shadow); }
.quick-card { transition: border-color .15s, transform .15s; }
.quick-card:hover { border-color: color-mix(in srgb, var(--gold-500) 55%, transparent); transform: translateY(-1px); }
.quick-card strong { display: block; margin: 6px 0 4px; font-family: var(--display); font-weight: 400; font-size: 28px; line-height: 1.1; }
.quick-card p { margin: 0; color: var(--sub); font-size: 13.5px; font-weight: 700; }
.card h1 { font-family: var(--display); font-weight: 400; font-size: 34px; line-height: 1.1; margin: 6px 0 8px; }
.card p { color: var(--sub); }

.admin-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.table-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; padding: 12px 16px; font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); font-weight: 800; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 12px 16px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--card-2); }
.num { width: 1%; text-align: right; font-variant-numeric: tabular-nums; }
.row-actions { width: 1%; white-space: nowrap; text-align: right; }
.row-actions form { display: inline; margin-left: 6px; }

/* ============ 6. Formulieren ============ */
.form-card { margin: 0 0 18px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.form-card h2 { margin: 0 0 14px; font-family: var(--display); font-weight: 400; font-size: 28px; line-height: 1.1; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.span2 { grid-column: span 2; }
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.form-grid .field { margin-bottom: 0; }
.field > span { font-size: 13px; font-weight: 700; color: var(--sub); }
.field > span small { font-weight: 500; color: var(--faint); }
fieldset { margin: 0 0 16px; padding: 14px; border: 1px solid var(--line); border-radius: 16px; background: var(--card-2); }
legend { padding: 0 8px; font-weight: 800; }
.checkbox-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.toggle { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); font-weight: 700; cursor: pointer; }
.toggle:has(input:checked) { border-color: color-mix(in srgb, var(--gold-500) 60%, transparent); background: color-mix(in srgb, var(--gold-100) 70%, var(--card)); }
.admin-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; margin-top: 14px; }
.photo-card { padding: 12px; border: 1px solid var(--line); border-radius: 16px; background: var(--card-2); }
.photo-card img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 10px; margin-bottom: 10px; background: var(--card); }

/* ============ 7. Gastenpagina's (openbaar, zonder rail) ============ */
.guest-top { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--card) 92%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.guest-top-inner { max-width: 980px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.guest-brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.guest-brand img { width: 40px; height: 40px; padding: 5px; border-radius: 12px; border: 1px solid var(--line); background: #fff; object-fit: contain; flex: none; }
.guest-brand span { display: grid; min-width: 0; }
.guest-brand small { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--gold-600); font-weight: 800; }
html[data-theme="dark"] .guest-brand small { color: var(--gold-400); }
.guest-brand strong { font-size: 16px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.guest-page { max-width: 980px; margin: 0 auto; padding: 26px 16px 40px; }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 6px; margin: 0 0 20px; scrollbar-width: thin; }
.guest-chips { max-width: 980px; margin: 14px auto 0; padding: 2px 16px 6px; }
.chips a { flex: none; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--sub); font-weight: 700; font-size: 14px; }
.chips a:hover { color: var(--ink); border-color: color-mix(in srgb, var(--ink) 25%, transparent); }
.chips a.on { background: var(--navy-800); border-color: var(--navy-800); color: #fff; }
html[data-theme="dark"] .chips a.on { background: linear-gradient(145deg, var(--gold-400), var(--gold-500)); border-color: transparent; color: var(--navy-950); }

.accommodation-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.video-wrap { position: relative; aspect-ratio: 16 / 9; margin: 0 0 18px; border-radius: var(--radius); overflow: hidden; background: #000; box-shadow: var(--shadow); }
.video-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; margin: 0 0 18px; }
.gallery figure { margin: 0; background: var(--card); border: 1px solid var(--line); border-radius: 20px; overflow: hidden; box-shadow: var(--shadow); }
.gallery img { display: block; width: 100%; height: auto; background: var(--card-2); }
.gallery figcaption { padding: 12px 16px; font-size: 14px; font-weight: 600; color: var(--sub); }
.manual-text { font-size: 16px; line-height: 1.65; }

/* ============ 8. Meldingen, lege staat en setup ============ */
.empty { display: grid; gap: 4px; padding: 26px 20px; text-align: center; color: var(--sub); background: var(--card); border: 1px dashed var(--field-line); border-radius: var(--radius); }
.empty strong { color: var(--ink); }
.flash { margin-bottom: 14px; padding: 13px 16px; border-radius: 16px; font-weight: 600; background: var(--done-bg); color: var(--done-ink); }
.flash.error { background: var(--urgent-bg); color: var(--urgent-ink); }
.setup-page { max-width: 640px; margin: 0 auto; padding: 10vh 18px 40px; }

@media (max-width: 860px) {
    .admin-grid, .form-grid { grid-template-columns: 1fr; }
    .span2 { grid-column: span 1; }
    .stat strong { font-size: 36px; }
}
@media (max-width: 560px) {
    .stats { gap: 8px; }
    .stat { padding: 14px; }
    .stat strong { font-size: 30px; }
    .guest-page .hero h1 { font-size: 32px; }
    .row-actions { white-space: normal; }
    .row-actions form { display: block; margin: 6px 0 0; }
}
