:root {
    --navy: #1e3a5f;
    --navy-2: #16325a;
    --gold: #c9a84c;
    --gold-soft: #f5eed9;
    --ink: #1f2733;
    --muted: #5b6675;
    --line: #e4e8ee;
    --soft: #f6f8fb;
    --white: #ffffff;
    --ok-bg: #f0fdf4;
    --ok-bd: #bbf7d0;
    --ok-tx: #166534;
    --err: #dc2626;
    --shadow: 0 10px 30px rgba(13, 30, 53, 0.08);
    --radius: 18px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
    color: var(--ink);
    background: var(--soft);
    line-height: 1.6;
}

a { color: var(--navy-2); }

.wrap { max-width: 1040px; margin: 0 auto; padding: 0 1.25rem; }

/* ── Header ─────────────────────────────────────────── */
.site-header {
    background: var(--navy);
    color: var(--white);
    border-bottom: 3px solid var(--gold);
}
.site-header .wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-top: 1rem;
    padding-bottom: 1rem;
    flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 0.85rem; text-decoration: none; color: var(--white); }
.brand .crest {
    width: 44px; height: 44px; border-radius: 10px;
    background: var(--gold); color: var(--navy);
    display: grid; place-items: center; font-weight: 800; font-size: 1.1rem;
    flex-shrink: 0;
}
.brand .crest-logo {
    width: 68px; height: 68px; object-fit: contain; background: #fff;
    border-radius: 12px; padding: 5px; flex-shrink: 0;
}
.brand .brand-txt strong { display: block; font-size: 1.02rem; letter-spacing: 0.01em; }
.brand .brand-txt span { font-size: 0.8rem; color: #b9c4d6; }
.site-nav { display: flex; gap: 1.5rem; }
.site-nav a { color: #cdd6e4; text-decoration: none; font-size: 0.92rem; font-weight: 600; }
.site-nav a:hover, .site-nav a.active { color: var(--white); }

/* ── Hero ───────────────────────────────────────────── */
.hero {
    background: linear-gradient(135deg, var(--navy) 0%, var(--navy-2) 100%);
    color: var(--white);
    padding: 2.75rem 0 3.25rem;
}
.hero .eyebrow {
    text-transform: uppercase; letter-spacing: 0.14em; font-size: 0.75rem;
    font-weight: 700; color: var(--gold); margin-bottom: 0.6rem;
}
.hero h1 { margin: 0 0 0.6rem; font-size: 2rem; line-height: 1.2; }
.hero p { margin: 0; color: #cbd5e6; max-width: 640px; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1.4rem; }
.chip {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.16);
    padding: 0.4rem 0.85rem; border-radius: 999px;
    font-size: 0.83rem; color: #eaf0f9;
}
.chip b { color: var(--gold); font-weight: 700; }

/* ── Layout shell ───────────────────────────────────── */
main { padding: 2.5rem 0 3.5rem; }
.grid {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(260px, 0.5fr);
    gap: 2.5rem;
    align-items: start;
}

/* ── Cards & panels ─────────────────────────────────── */
.panel {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow);
}
.panel h2 { margin: 0 0 0.35rem; font-size: 1.35rem; }
.panel .lead { color: var(--muted); margin: 0 0 1.75rem; }

.rail-card {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.5rem;
}
.rail-card h3 {
    margin: 0 0 1rem; font-size: 0.82rem; text-transform: uppercase;
    letter-spacing: 0.07em; color: var(--navy); padding-bottom: 0.6rem;
    border-bottom: 2px solid var(--line);
}
.rail-item { display: flex; gap: 0.7rem; margin-bottom: 1rem; font-size: 0.92rem; }
.rail-item:last-child { margin-bottom: 0; }
.rail-item .ic { color: var(--gold); font-weight: 800; }
.rail-item .lbl { display: block; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }

/* ── Forms ──────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 0.4rem; margin-bottom: 1.25rem; }
.field label { font-weight: 600; font-size: 0.88rem; color: var(--navy); }
.req { color: var(--err); }
.field input, .field select, .field textarea {
    padding: 0.7rem 0.9rem; border: 1.5px solid var(--line); border-radius: 10px;
    font-size: 0.97rem; font-family: inherit; color: var(--ink);
    background: var(--white); width: 100%; transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field select:focus, .field textarea:focus {
    outline: none; border-color: var(--navy-2); box-shadow: 0 0 0 3px rgba(22, 48, 90, 0.1);
}
.field textarea { resize: vertical; min-height: 110px; }
.field input::placeholder, .field textarea::placeholder { color: #b4bcc7; opacity: 1; }
.field .err { color: var(--err); font-size: 0.83rem; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem; }
.hint { font-size: 0.82rem; color: var(--muted); }

.btn {
    display: inline-flex; align-items: center; gap: 0.5rem; cursor: pointer;
    background: var(--navy); color: var(--white); border: none;
    padding: 0.75rem 1.4rem; border-radius: 10px; font-size: 0.95rem;
    font-weight: 600; text-decoration: none; transition: background .15s;
}
.btn:hover { background: var(--navy-2); }
.btn.gold { background: var(--gold); color: var(--navy); }
.btn.gold:hover { background: #b6923f; }
.btn.ghost { background: transparent; color: var(--navy); border: 1.5px solid var(--line); }
.btn.ghost:hover { background: var(--soft); }
.btn.sm { padding: 0.45rem 0.85rem; font-size: 0.85rem; }
.submit-row { display: flex; justify-content: flex-end; gap: 0.75rem; margin-top: 0.5rem; }

/* ── Alerts ─────────────────────────────────────────── */
.alert { padding: 1rem 1.25rem; border-radius: 12px; margin-bottom: 1.5rem; font-size: 0.95rem; }
.alert.ok { background: var(--ok-bg); border: 1px solid var(--ok-bd); color: var(--ok-tx); }
.alert.warn { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; }
.alert.error { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }
.alert ul { margin: 0.4rem 0 0; padding-left: 1.2rem; }

/* ── Rating stars ───────────────────────────────────── */
.stars { display: flex; flex-direction: row-reverse; justify-content: flex-end; gap: 0.25rem; }
.stars input { display: none; }
.stars label { font-size: 1.9rem; color: var(--line); cursor: pointer; transition: color .1s; }
.stars label:hover, .stars label:hover ~ label,
.stars input:checked ~ label { color: var(--gold); }

/* ── Confirmation ───────────────────────────────────── */
.ticket {
    border: 2px dashed var(--gold); border-radius: 16px; padding: 1.5rem;
    background: var(--gold-soft); text-align: center; margin: 1.5rem 0;
}
.ticket .ref { font-size: 1.9rem; font-weight: 800; letter-spacing: 0.08em; color: var(--navy); }
.ticket .lbl { text-transform: uppercase; font-size: 0.72rem; letter-spacing: 0.08em; color: var(--muted); }

/* ── Tables (admin) ─────────────────────────────────── */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; }
table.data { width: 100%; border-collapse: collapse; font-size: 0.92rem; background: var(--white); }
table.data th, table.data td { text-align: left; padding: 0.75rem 0.9rem; border-bottom: 1px solid var(--line); }
table.data th { background: var(--soft); font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); white-space: nowrap; }
table.data tr:last-child td { border-bottom: none; }
.empty { padding: 2.5rem; text-align: center; color: var(--muted); }
.badge { display: inline-block; padding: 0.15rem 0.55rem; border-radius: 999px; font-size: 0.78rem; font-weight: 700; }
.badge.gold { background: var(--gold-soft); color: #7a5c12; }
.badge.ok { background: var(--ok-bg); color: var(--ok-tx); }
.badge.no { background: #fef2f2; color: #991b1b; }

/* ── Stat tiles (admin) ─────────────────────────────── */
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 2rem; }
.tile { background: var(--white); border: 1px solid var(--line); border-radius: 14px; padding: 1.25rem; }
.tile .n { font-size: 1.9rem; font-weight: 800; color: var(--navy); }
.tile .k { font-size: 0.82rem; color: var(--muted); }

/* ── Admin bar ──────────────────────────────────────── */
.admin-bar { background: var(--navy); color: var(--white); border-bottom: 3px solid var(--gold); }
.admin-bar .wrap { display: flex; align-items: center; justify-content: space-between; padding: 0.85rem 1.25rem; gap: 1rem; flex-wrap: wrap; }
.admin-bar .anav { display: flex; gap: 1.25rem; }
.admin-bar .anav a { color: #cdd6e4; text-decoration: none; font-weight: 600; font-size: 0.9rem; }
.admin-bar .anav a:hover, .admin-bar .anav a.active { color: var(--white); }
.admin-bar form { margin: 0; }

/* ── Toolbar ────────────────────────────────────────── */
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.toolbar .search { display: flex; gap: 0.5rem; }
.toolbar .search input { padding: 0.55rem 0.85rem; border: 1.5px solid var(--line); border-radius: 10px; min-width: 240px; }

/* ── Pagination ─────────────────────────────────────── */
.pagination { display: flex; gap: 0.35rem; list-style: none; padding: 0; margin: 1.25rem 0 0; flex-wrap: wrap; }
.pagination a, .pagination span { padding: 0.4rem 0.7rem; border: 1px solid var(--line); border-radius: 8px; text-decoration: none; font-size: 0.88rem; color: var(--navy); }
.pagination .active span { background: var(--navy); color: var(--white); border-color: var(--navy); }

/* ── Footer ─────────────────────────────────────────── */
.site-footer { background: var(--navy); color: #9fb0c7; padding: 1.75rem 0; font-size: 0.86rem; text-align: center; }

@media (max-width: 860px) {
    .grid { grid-template-columns: 1fr; }
    .row-2 { grid-template-columns: 1fr; }
    .tiles { grid-template-columns: repeat(2, 1fr); }
    .hero h1 { font-size: 1.6rem; }
}

/* ── Programme ──────────────────────────────────────── */
.programme { display: grid; gap: 1.5rem; }
.prog-day { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--white); }
.prog-day-head {
    display: flex; align-items: center; gap: 0.85rem;
    background: var(--navy); color: #fff; padding: 0.85rem 1.15rem;
}
.prog-day-badge {
    background: var(--gold); color: var(--navy); font-weight: 800;
    font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em;
    padding: 0.25rem 0.6rem; border-radius: 999px;
}
.prog-day-date { font-weight: 600; font-size: 0.95rem; }
.prog-rows { display: block; }
.prog-row {
    display: grid; grid-template-columns: 92px 1fr 200px; gap: 1rem;
    padding: 0.7rem 1.15rem; border-top: 1px solid var(--line); font-size: 0.9rem;
    align-items: start;
}
.prog-row:first-child { border-top: none; }
.prog-time { font-weight: 700; color: var(--navy); white-space: nowrap; }
.prog-act { color: var(--ink); }
.prog-who { color: var(--muted); font-size: 0.85rem; }
.prog-session {
    display: block; background: var(--gold-soft); color: #7a5c12;
    font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em;
    font-size: 0.78rem; padding: 0.55rem 1.15rem;
}
.prog-break { background: var(--soft); }
.prog-break .prog-act { grid-column: 2 / 4; font-weight: 600; color: var(--muted); font-style: italic; }
@media (max-width: 720px) {
    .prog-row { grid-template-columns: 78px 1fr; }
    .prog-who { grid-column: 2; }
    .prog-break .prog-act { grid-column: 2; }
}

/* ── Admin shell (rotary-style navy sidebar) ────────── */
.a-shell { display: flex; min-height: 100vh; }
.a-side {
    width: 250px; flex-shrink: 0; background: var(--navy); color: #fff;
    display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
    overflow-y: auto;
    scrollbar-width: none;         /* Firefox — hide the scrollbar */
    -ms-overflow-style: none;      /* old Edge */
}
.a-side::-webkit-scrollbar { width: 0; height: 0; }  /* Chrome/Safari — hide */
.a-side-head { position: sticky; top: 0; z-index: 2; background: var(--navy); padding: 1.25rem 1.25rem 1rem; border-bottom: 1px solid rgba(255,255,255,.1); }
.a-side-head .crest {
    width: 40px; height: 40px; border-radius: 9px; background: var(--gold);
    color: var(--navy); display: grid; place-items: center; font-weight: 800; margin-bottom: 0.6rem;
}
.a-side-head .a-logo {
    width: 72px; height: 72px; object-fit: contain; background: #fff;
    border-radius: 12px; padding: 5px; margin-bottom: 0.7rem; display: block;
}
.a-side-head strong { display: block; font-size: 0.85rem; line-height: 1.3; }
.a-side-head span { color: rgba(255,255,255,.4); font-size: 0.75rem; }
.a-nav { padding: 0.75rem; }
.a-nav-label {
    padding: 0.75rem 0.75rem 0.4rem; font-size: 0.63rem; font-weight: 800;
    text-transform: uppercase; letter-spacing: 0.13em; color: rgba(255,255,255,.3);
}
.a-nav-item {
    display: flex; align-items: center; gap: 0.65rem; padding: 0.55rem 0.75rem;
    border-radius: 9px; color: rgba(255,255,255,.62); text-decoration: none;
    font-size: 0.9rem; transition: background .15s, color .15s;
}
.a-nav-item:hover { color: #fff; background: rgba(255,255,255,.1); }
.a-nav-item.active { color: #fff; background: rgba(255,255,255,.15); }
.a-nav-item .ic { width: 18px; text-align: center; color: var(--gold); }
.a-side-foot { margin-top: auto; padding: 1rem; border-top: 1px solid rgba(255,255,255,.1); }
.a-side-foot .who { color: rgba(255,255,255,.35); font-size: 0.75rem; padding: 0 0.25rem 0.6rem; }
.a-signout {
    width: 100%; display: flex; align-items: center; gap: 0.5rem; cursor: pointer;
    background: transparent; border: none; color: rgba(255,255,255,.5);
    padding: 0.5rem 0.75rem; border-radius: 9px; font-size: 0.85rem; font-family: inherit;
}
.a-signout:hover { color: #fff; background: rgba(255,255,255,.1); }
.a-main { flex: 1; min-width: 0; overflow-x: hidden; }
.a-main-inner { max-width: 960px; padding: 1.75rem; }
.a-topbar {
    display: none; align-items: center; gap: 0.75rem; background: var(--navy);
    color: #fff; padding: 0.75rem 1rem;
}
.a-burger { background: none; border: none; color: #fff; font-size: 1.4rem; cursor: pointer; line-height: 1; }
.a-page-title { font-size: 1.5rem; font-weight: 800; margin: 0 0 0.2rem; }
.a-page-sub { color: var(--muted); margin: 0 0 1.5rem; font-size: 0.92rem; }

@media (max-width: 820px) {
    .a-topbar { display: flex; }
    .a-side {
        position: fixed; left: 0; top: 0; z-index: 40; transform: translateX(-100%);
        transition: transform .2s; height: 100vh;
    }
    .a-shell.open .a-side { transform: translateX(0); }
    .a-backdrop { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 30; }
    .a-shell.open .a-backdrop { display: block; }
}

/* ── Mobile polish (phones) ─────────────────────────── */
@media (max-width: 640px) {
    /* 16px form controls stop iOS Safari auto-zooming when a field is tapped */
    .field input, .field select, .field textarea { font-size: 16px; }
    /* Full-width primary actions are easier to tap with a thumb */
    .submit-row { flex-direction: column-reverse; align-items: stretch; gap: 0.6rem; }
    .submit-row .btn { width: 100%; justify-content: center; }
    /* Give content the width back on small screens */
    .panel { padding: 1.5rem; }
    .a-main-inner { padding: 1rem; }
    .site-nav { gap: 1rem; }
}
