/* =============================================================================
   Twyford Village Hall — Main Stylesheet
   Brand colour: #2c5f8a (deep blue)
   ============================================================================= */

/* ── Custom Properties ────────────────────────────────────────────────────── */
:root {
    --brand:           #2c5f8a;
    --brand-dark:      #1e4364;
    --brand-light:     #4a80aa;
    --brand-pale:      #e8f1f8;
    --accent:          #e8a020;
    --accent-dark:     #c07010;

    --text:            #1a1a1a;
    --text-muted:      #5a6472;
    --text-inverse:    #ffffff;

    --bg:              #ffffff;
    --bg-soft:         #f8f9fb;
    --bg-dark:         #1a2633;

    --border:          #d1d9e0;
    --border-focus:    var(--brand);

    --success:         #1a7a4a;
    --success-bg:      #eaf6ef;
    --warning:         #946800;
    --warning-bg:      #fff8e1;
    --error:           #b91c1c;
    --error-bg:        #fef2f2;
    --info:            #1e56a0;
    --info-bg:         #e8f0fb;

    --radius-sm:       0.25rem;
    --radius:          0.5rem;
    --radius-lg:       0.75rem;
    --radius-xl:       1.25rem;

    --shadow-sm:       0 1px 3px rgba(0,0,0,.08);
    --shadow:          0 4px 16px rgba(0,0,0,.10);
    --shadow-lg:       0 8px 32px rgba(0,0,0,.14);

    --nav-height:      4rem;
    --container-max:   1200px;
    --gap:             1.5rem;

    --font-sans:       system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --font-size-base:  1rem;
    --line-height:     1.6;

    --lilac:           hsl(270,50%,45%);
    --lilac-pale:      hsl(270,60%,92%);
}

/* ── Reset & Base ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
    font-size: 100%;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-sans);
    font-size: var(--font-size-base);
    line-height: var(--line-height);
    color: var(--text);
    background: var(--bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main { flex: 1; }

a { color: var(--brand); text-decoration: underline; text-underline-offset: 3px; }
a:hover { color: var(--brand-dark); }
a:focus-visible { outline: 3px solid var(--brand); outline-offset: 3px; border-radius: 2px; }

img, svg { display: block; max-width: 100%; height: auto; }

h1, h2, h3, h4, h5, h6 {
    line-height: 1.25;
    color: var(--text);
    font-weight: 700;
}
h1 { font-size: clamp(1.8rem, 4vw, 2.75rem); }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); }
h3 { font-size: clamp(1.15rem, 2.5vw, 1.5rem); }
h4 { font-size: 1.15rem; }

p { margin-bottom: 1em; }
p:last-child { margin-bottom: 0; }

ul, ol { padding-left: 1.5em; }
li { margin-bottom: .35em; }

/* ── Layout ───────────────────────────────────────────────────────────────── */
.container {
    width: 100%;
    max-width: var(--container-max);
    margin-inline: auto;
    padding-inline: 1.25rem;
}
@media (min-width: 640px)  { .container { padding-inline: 2rem; } }
@media (min-width: 1024px) { .container { padding-inline: 2.5rem; } }

.page-content { padding-block: 3rem; }

.grid-2 { display: grid; gap: var(--gap); }
.grid-3 { display: grid; gap: var(--gap); }
.grid-4 { display: grid; gap: var(--gap); }
@media (min-width: 640px)  { .grid-2 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 768px)  { .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .grid-3 { grid-template-columns: repeat(3, 1fr); }
                              .grid-4 { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 768px)  { .grid-4 { grid-template-columns: repeat(2, 1fr); } }

/* ── Navigation ───────────────────────────────────────────────────────────── */
.site-nav {
    position: sticky;
    top: 0;
    z-index: 200;
    background: var(--brand);
    box-shadow: 0 1px 0 rgba(0,0,0,.15), var(--shadow-sm);
    height: var(--nav-height);
}

.nav-inner {
    display: flex;
    align-items: center;
    gap: .25rem;
    height: 100%;
    max-width: var(--container-max);
    margin-inline: auto;
    padding-inline: 1.25rem;
}
@media (min-width: 640px) { .nav-inner { padding-inline: 2rem; } }

/* Logo */
.nav-logo {
    display: flex;
    align-items: center;
    gap: .4rem;
    text-decoration: none;
    flex-shrink: 0;
    margin-right: .75rem;
}
.nav-logo-img {
    height: 1.8rem;
    width: auto;
    flex-shrink: 0;
}
.nav-logo-text {
    font-size: 1.05rem;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    letter-spacing: -.01em;
}

/* ── Primary links list (desktop: inline row; mobile: hidden) ── */
.nav-links {
    display: none;
    list-style: none;
    padding: 0;
    margin: 0;
    flex: 1;
    align-items: center;
    gap: 0;
}
@media (min-width: 900px) {
    .nav-links { display: flex; }
}

/* Shared link style */
.nav-links > li > a,
.nav-group-label {
    display: flex;
    align-items: center;
    gap: .25rem;
    padding: .5rem .75rem;
    color: rgba(255,255,255,.85);
    text-decoration: none;
    font-size: .9rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    border: none;
    background: none;
    cursor: pointer;
    white-space: nowrap;
    transition: background .15s, color .15s;
    line-height: 1;
    font-family: inherit;
}
.nav-links > li > a:hover,
.nav-group-label:hover,
.nav-links > li > a[aria-current="page"] {
    background: rgba(255,255,255,.15);
    color: #fff;
}

/* Hire-style groups: highlight the entire pill (label + chevron) on hover */
@media (min-width: 900px) {
    .nav-links .nav-group {
        border-radius: var(--radius-sm);
        transition: background .15s;
    }
    .nav-links .nav-group:hover,
    .nav-links .nav-group:focus-within {
        background: rgba(255,255,255,.15);
    }
    /* Children must not add their own background — group handles it */
    .nav-links .nav-group .nav-group-label,
    .nav-links .nav-group .nav-group-toggle {
        border-radius: 0;
        transition: color .15s;
    }
    .nav-links .nav-group:hover .nav-group-label,
    .nav-links .nav-group:hover .nav-group-toggle,
    .nav-links .nav-group:focus-within .nav-group-label,
    .nav-links .nav-group:focus-within .nav-group-toggle {
        color: #fff;
        background: transparent;
    }
    /* Chevron toggle: tight padding since group provides the padding */
    .nav-links .nav-group .nav-group-toggle {
        padding-left: .1rem;
        padding-right: .6rem;
    }
    .nav-links .nav-group .nav-group-label {
        padding-right: .2rem;
    }
}

/* Donate link */
.nav-donate {
    color: #fcd34d !important;
    font-weight: 600 !important;
}
.nav-donate:hover { background: rgba(252,211,77,.15) !important; }

/* ── Group (dropdown trigger) ──────────────────────────────────── */
.nav-group {
    position: relative;
    display: flex;
    align-items: center;
}

/* JS wraps label + toggle in this row — must always be flex */
.nav-group-header {
    display: flex;
    align-items: center;
}

/* The chevron SVG */
.nav-chevron {
    width: 0.875rem;
    height: 0.875rem;
    flex-shrink: 0;
    transition: transform .2s;
}
.nav-group.is-open .nav-chevron { transform: rotate(180deg); }

/* Separate toggle button for desktop (sits next to the label link) */
.nav-group-toggle {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    padding: .5rem .3rem;
    color: rgba(255,255,255,.75);
    background: none;
    border: none;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: background .15s, color .15s;
    line-height: 1;
}
.nav-group-toggle:hover { background: rgba(255,255,255,.15); color: #fff; }
/* On desktop the chevron is on the toggle button; hide it on the label link */
.nav-group-label + .nav-group-toggle { margin-left: -.4rem; }

/* When group is a button-only trigger (admin/account) */
.nav-group-label--btn {
    gap: .4rem;
}

/* ── Dropdown panel ────────────────────────────────────────────── */
.nav-sub {
    display: none;
    position: absolute;
    top: calc(100% + 0.375rem);
    left: 0;
    min-width: 12.5rem;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 8px 24px rgba(0,0,0,.12);
    list-style: none;
    padding: .4rem 0;
    z-index: 201;
    animation: navSubIn .12s ease;
}
.nav-sub--right { left: auto; right: 0; }
@keyframes navSubIn {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Invisible bridge covers the gap between nav bar and panel,
   preventing mouseleave from firing as the cursor crosses the gap */
.nav-sub::before {
    content: '';
    position: absolute;
    top: -0.625rem;
    left: -0.5rem;
    right: -0.5rem;
    height: 0.625rem;
}

/* Desktop: CSS-native hover+focus for left-nav groups, focus-only for right-side */
@media (min-width: 900px) {
    /* Hire (left) — hover or keyboard focus shows submenu */
    .nav-links .nav-group:hover > .nav-sub,
    .nav-links .nav-group:focus-within > .nav-sub { display: block; }
    .nav-links .nav-group:hover .nav-chevron,
    .nav-links .nav-group:focus-within .nav-chevron { transform: rotate(180deg); }

    /* Admin/Account (right) — hover OR focus shows submenu */
    .nav-group--right:hover > .nav-sub,
    .nav-group--right:focus-within > .nav-sub { display: block; }
    .nav-group--right:hover .nav-chevron,
    .nav-group--right:focus-within .nav-chevron { transform: rotate(180deg); }
}

/* JS-driven fallback / mobile accordion */
.nav-group.is-open > .nav-sub { display: block; }

/* Dropdown items */
.nav-sub li > a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .5rem 1rem;
    color: var(--text);
    text-decoration: none;
    font-size: .88rem;
    font-weight: 400;
    transition: background .1s, color .1s;
    gap: .5rem;
}
.nav-sub li > a:hover { background: var(--bg-soft); color: var(--brand); }
.nav-sub-sep { height: 1px; background: var(--border); margin: .35rem 0; }
.nav-sub-heading {
    padding: .45rem 1rem .2rem;
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--text-muted);
}
.nav-sub-cta {
    color: var(--brand) !important;
    font-weight: 600 !important;
}
.nav-sub-signout { color: var(--danger) !important; }

/* Notification badge */
.nav-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.125rem;
    height: 1.125rem;
    padding: 0 0.25rem;
    background: #ef4444;
    color: #fff;
    font-size: .68rem;
    font-weight: 700;
    border-radius: 99px;
    line-height: 1;
}
.nav-badge--inline { flex-shrink: 0; }

/* Admin button accent */
.nav-admin-btn {
    background: rgba(255,255,255,.12) !important;
    color: #fff !important;
    border: 1px solid rgba(255,255,255,.25) !important;
    border-radius: var(--radius-sm) !important;
    font-size: .85rem !important;
}
.nav-admin-btn:hover { background: rgba(255,255,255,.22) !important; }

/* Account button hover */
@media (min-width: 900px) {
    .nav-group--right:hover > .nav-group-label--btn:not(.nav-admin-btn),
    .nav-group--right:focus-within > .nav-group-label--btn:not(.nav-admin-btn) {
        background: rgba(255,255,255,.15);
        color: #fff;
    }
}

/* ── Auth area ─────────────────────────────────────────────────── */
.nav-auth {
    display: none;
    align-items: center;
    gap: .4rem;
    margin-left: auto;
    flex-shrink: 0;
}
@media (min-width: 900px) {
    .nav-auth { display: flex; }
}

/* Ghost white button variant */
.btn-ghost-white {
    color: rgba(255,255,255,.85);
    background: transparent;
    border: 1px solid transparent;
}
.btn-ghost-white:hover { background: rgba(255,255,255,.12); color: #fff; border-color: rgba(255,255,255,.2); }
.btn-white {
    background: #fff;
    color: var(--brand);
    font-weight: 600;
}
.btn-white:hover { background: rgba(255,255,255,.88); }

/* ── Burger button ─────────────────────────────────────────────── */
.nav-burger {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 1.625rem;
    height: 1.125rem;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    margin-left: auto;
    flex-shrink: 0;
    position: relative;
    z-index: 220;
}
.nav-burger span {
    display: block;
    height: 2px;
    background: #fff;
    border-radius: 2px;
    transition: transform .2s, opacity .2s, width .2s;
    transform-origin: center;
}
/* Animated X when open */
.nav-burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(0.5rem) rotate(45deg); }
.nav-burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-0.5rem) rotate(-45deg); }
@media (min-width: 900px) { .nav-burger { display: none; } }

/* ── Nav backdrop (mobile) ─────────────────────────────────────── */
/* z-index must be below site-nav's 200 so .site-nav stacking context
   (which contains the drawer) is always above the backdrop.           */
.nav-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 199;
}
.nav-backdrop.is-open { display: block; }

/* ── Nav drawer: desktop = inline flex row; mobile = slide-in ─── */
.nav-drawer {
    display: flex;
    align-items: center;
    flex: 1;
    gap: .25rem;
    min-width: 0;
}

/* Kill the global li margin inside all nav contexts */
.nav-links li,
.nav-sub li { margin-bottom: 0; }
.nav-drawer-header { display: none; }
.nav-drawer-close  { display: none; }

@media (max-width: 899px) {
    /* Slide-in panel from the right */
    .nav-drawer {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        width: min(20rem, 88vw);
        background: var(--brand-dark);
        transform: translateX(110%);
        transition: transform .28s ease;
        z-index: 210;
        flex-direction: column;
        align-items: stretch;
        overflow-y: auto;
        gap: 0;
    }
    .nav-drawer.is-open { transform: translateX(0); }

    /* Drawer header */
    .nav-drawer-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 1rem 1.25rem;
        border-bottom: 1px solid rgba(255,255,255,.12);
        flex-shrink: 0;
    }
    .nav-drawer-title {
        color: #fff;
        font-weight: 700;
        font-size: 1.05rem;
    }
    .nav-drawer-close {
        display: block;
        background: none;
        border: none;
        cursor: pointer;
        color: rgba(255,255,255,.7);
        font-size: 1.5rem;
        line-height: 1;
        padding: 0 .2rem;
    }

    /* Nav links section fills available space */
    .nav-drawer .nav-links {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        padding: .75rem .75rem;
        flex: 1;
        gap: .1rem;
    }

    /* Auth section pinned to bottom of drawer */
    .nav-drawer .nav-auth {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        padding: .75rem 1rem 1.5rem;
        border-top: 1px solid rgba(255,255,255,.15);
        gap: .4rem;
    }

    /* Mobile: links full-width */
    .nav-links > li > a {
        padding: .75rem .85rem;
        font-size: 1rem;
        border-radius: var(--radius-sm);
        width: 100%;
    }
    /* nav-group-label (Hire trigger) must NOT have width:100% —
       the flex-row header handles its sizing via flex:1           */
    .nav-group-label {
        padding: .75rem .85rem;
        font-size: 1rem;
        border-radius: var(--radius-sm);
    }
    .nav-links > li { width: 100%; }

    /* Mobile: group label + toggle sit side-by-side */
    .nav-group { flex-direction: column; align-items: stretch; }
    .nav-group-header { width: 100%; }
    .nav-group-header .nav-group-label { flex: 1; min-width: 0; }
    .nav-group-toggle {
        padding: .75rem .85rem;
        color: rgba(255,255,255,.9);
    }

    /* Brighter base link colour inside the drawer */
    .nav-drawer .nav-links > li > a,
    .nav-drawer .nav-group-label {
        color: #fff;
    }

    /* Mobile: sub-menu is inline (accordion), not absolute */
    .nav-sub {
        position: static;
        box-shadow: none;
        border: none;
        background: rgba(0,0,0,.15);
        border-radius: var(--radius-sm);
        padding: .25rem 0;
        margin: .2rem 0 .4rem;
        animation: none;
    }
    .nav-sub li > a {
        color: rgba(255,255,255,.92);
        padding: .6rem 1.2rem;
        font-size: .9rem;
    }
    .nav-sub li > a:hover { background: rgba(255,255,255,.12); color: #fff; }
    .nav-sub-sep { background: rgba(255,255,255,.12); }
    .nav-sub-heading { color: rgba(255,255,255,.45); }
    .nav-sub-cta { color: #fcd34d !important; }
    .nav-sub-signout { color: #f87171 !important; }

    /* Mobile auth: full-width */
    .nav-drawer .nav-auth .btn { width: 100%; justify-content: center; text-align: center; }
    .nav-drawer .nav-auth .nav-group { width: 100%; }
    .nav-drawer .nav-auth .nav-group-label--btn {
        width: 100%;
        justify-content: space-between;
        background: rgba(255,255,255,.1);
        border-radius: var(--radius-sm);
        padding: .75rem 1rem;
        font-size: 1rem;
    }
    .nav-drawer .nav-auth .nav-sub { background: rgba(0,0,0,.2); }
    .nav-drawer .nav-auth .nav-sub--right { right: auto; }
    .nav-admin-btn { border: 1px solid rgba(255,255,255,.2) !important; }
}

/* ── Flash messages ───────────────────────────────────────────────────────── */
.flash-bar { padding-block: .5rem; }
.flash {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: .75rem 1rem;
    border-radius: var(--radius);
    margin-bottom: .5rem;
    font-size: .9rem;
}
.flash--success { background: var(--success-bg); color: var(--success); border: 1px solid #a8d5b8; }
.flash--error   { background: var(--error-bg);   color: var(--error);   border: 1px solid #fca5a5; }
.flash--warning { background: var(--warning-bg); color: var(--warning); border: 1px solid #fcd34d; }
.flash--info    { background: var(--info-bg);    color: var(--info);    border: 1px solid #93c5fd; }
.flash-close {
    background: none; border: none; cursor: pointer;
    font-size: 1.25rem; line-height: 1; padding: 0;
    color: inherit; opacity: .6; flex-shrink: 0;
}
.flash-close:hover { opacity: 1; }

/* ── Buttons ──────────────────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    padding: .6rem 1.2rem;
    font-family: inherit;
    font-size: .95rem;
    font-weight: 600;
    line-height: 1.25;
    text-decoration: none;
    border: 2px solid transparent;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background .15s, border-color .15s, color .15s, box-shadow .15s;
    white-space: nowrap;
    user-select: none;
}
.btn:disabled, .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; pointer-events: none; }
.btn:focus-visible { outline: 3px solid var(--brand); outline-offset: 3px; }

.btn-primary   { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; }
.btn-secondary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-secondary:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: #fff; }
.btn-outline   { background: transparent; border-color: #fff; color: #fff; }
.btn-outline:hover { background: rgba(255,255,255,.15); color: #fff; }
.btn-outline-dark { background: transparent; border-color: var(--brand); color: var(--brand); }
.btn-outline-dark:hover { background: var(--brand); color: #fff; }
.btn-ghost       { background: transparent; border-color: transparent; color: #fff; }
.btn-ghost:hover { background: rgba(255,255,255,.12); color: #fff; }
/* For light backgrounds — text stays dark on hover */
.btn-ghost-dark       { background: transparent; border-color: transparent; color: var(--text-muted); }
.btn-ghost-dark:hover { background: var(--bg-soft); border-color: var(--border); color: var(--text); }
.btn-danger    { background: var(--error); border-color: var(--error); color: #fff; }
.btn-danger:hover { background: #991b1b; border-color: #991b1b; color: #fff; }
.btn-error     { background: var(--error); border-color: var(--error); color: #fff; }
.btn-error:hover  { background: #991b1b; border-color: #991b1b; color: #fff; }
.btn-success   { background: var(--success,#16a34a); border-color: var(--success,#16a34a); color: #fff; }
.btn-success:hover { background: #15803d; border-color: #15803d; color: #fff; }

.btn-sm { padding: .4rem .85rem; font-size: .85rem; }
.btn-lg { padding: .85rem 1.75rem; font-size: 1.05rem; }
.btn-full { width: 100%; }

/* ── Cards ────────────────────────────────────────────────────────────────── */
.card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: box-shadow .2s;
}
.card:hover { box-shadow: var(--shadow); }
.card-body { padding: 1.5rem; }
.card-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
    background: var(--bg-soft);
    font-weight: 600;
}
.card-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
    background: var(--bg-soft);
}

/* ── Forms ────────────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 1.25rem; }
.form-label {
    display: block;
    font-size: .9rem;
    font-weight: 600;
    margin-bottom: .35rem;
    color: var(--text);
}
.form-label .required { color: var(--error); margin-left: 2px; }

.form-control {
    display: block;
    width: 100%;
    padding: .55rem .85rem;
    font-family: inherit;
    font-size: 1rem;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    transition: border-color .15s, box-shadow .15s;
    -webkit-appearance: none;
}
.form-control:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(44,95,138,.15);
}
.form-control.is-invalid { border-color: var(--error); }
.form-control.is-invalid:focus { box-shadow: 0 0 0 3px rgba(185,28,28,.12); }
textarea.form-control { resize: vertical; min-height: 6.25rem; }
select.form-control { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%235a6472' stroke-width='1.5' fill='none'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right .75rem center; padding-right: 2.2rem; }

.form-text  { font-size: .82rem; color: var(--text-muted); margin-top: .3rem; }
.form-error { font-size: .82rem; color: var(--error); margin-top: .3rem; }

.form-check { display: flex; align-items: flex-start; gap: .6rem; margin-bottom: .75rem; }
.form-check-input {
    width: 1.125rem; height: 1.125rem; flex-shrink: 0; margin-top: 0.125rem;
    accent-color: var(--brand); cursor: pointer;
}
.form-check-label { font-size: .9rem; cursor: pointer; }

/* ── Tables ───────────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { padding: .65rem 1rem; text-align: left; border-bottom: 1px solid var(--border); }
th { font-weight: 600; color: var(--text-muted); font-size: .82rem; text-transform: uppercase; letter-spacing: .04em; background: var(--bg-soft); }
tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--bg-soft); }
/* Label-value tables inside cards — compact rows, proper horizontal breathing room */
.table-detail td, .table-detail th { padding: .4rem .75rem; }
.table-detail tr:last-child td { border-bottom: none; }

/* ── Badges ───────────────────────────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    padding: .2rem .55rem;
    font-size: .75rem;
    font-weight: 600;
    border-radius: 99px;
    white-space: nowrap;
}
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-error   { background: var(--error-bg);   color: var(--error); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-info    { background: var(--info-bg);    color: var(--info); }
.badge-neutral { background: var(--bg-soft);    color: var(--text-muted); border: 1px solid var(--border); }

/* ── Hero logo ────────────────────────────────────────────────────────────── */
.hero-logo {
    height: 8rem;
    width: auto;
    display: block;
    margin-inline: auto;
    margin-bottom: 1rem;
}

/* ── Map pin marker ───────────────────────────────────────────────────────── */
.map-pin { width: 4.5rem; height: 4.5rem; transform: translateY(-2.25rem); }
.map-pin img { width: 100%; height: 100%; display: block; }

/* ── Map embed ────────────────────────────────────────────────────────────── */
.map-embed {
    width: 100%;
    height: 28rem;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border);
}

/* ── Page hero ────────────────────────────────────────────────────────────── */
.hero {
    background: linear-gradient(135deg, var(--brand-dark) 0%, var(--brand) 100%);
    color: #fff;
    padding: 4rem 0;
    text-align: center;
}
.hero--compact { padding: 2.5rem 0; }
.hero h1 { color: #fff; margin-bottom: .75rem; }
.hero p { color: rgba(255,255,255,.85); font-size: 1.1rem; max-width: 600px; margin-inline: auto; }
.hero .btn-group { display: flex; gap: .75rem; flex-wrap: wrap; justify-content: center; margin-top: 1.75rem; }

/* ── Section headings ─────────────────────────────────────────────────────── */
.section { padding-block: 3rem; }
.section-alt { background: var(--bg-soft); }
.section-title { text-align: center; margin-bottom: 2rem; }
.section-title h2 { margin-bottom: .5rem; }
.section-title p { color: var(--text-muted); max-width: 560px; margin-inline: auto; }

/* ── Breadcrumb ───────────────────────────────────────────────────────────── */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: .85rem;
    color: var(--text-muted);
    padding-block: 1rem;
    list-style: none;
    flex-wrap: wrap;
}
.breadcrumb a { color: var(--brand); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb li + li::before { content: '›'; margin-right: .5rem; color: var(--border); }

/* ── Pagination ───────────────────────────────────────────────────────────── */
.pagination {
    display: flex;
    align-items: center;
    gap: .35rem;
    justify-content: center;
    margin-top: 2rem;
    list-style: none;
    flex-wrap: wrap;
}
.pagination a, .pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.25rem;
    height: 2.25rem;
    padding: 0 .5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: .9rem;
    text-decoration: none;
    color: var(--text);
    transition: background .15s;
}
.pagination a:hover { background: var(--bg-soft); }
.pagination .is-current { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.pagination .disabled { opacity: .4; pointer-events: none; }

/* ── Alert boxes ──────────────────────────────────────────────────────────── */
.alert {
    display: flex;
    gap: .75rem;
    padding: 1rem 1.25rem;
    border-radius: var(--radius);
    border: 1px solid;
    margin-bottom: 1.25rem;
    font-size: .9rem;
    align-items: flex-start;
}
.alert-success { background: var(--success-bg); color: var(--success); border-color: #a8d5b8; }
.alert-error   { background: var(--error-bg);   color: var(--error);   border-color: #fca5a5; }
.alert-warning { background: var(--warning-bg); color: var(--warning); border-color: #fcd34d; }
.alert-info    { background: var(--info-bg);    color: var(--info);    border-color: #93c5fd; }

/* ── Loading spinner ──────────────────────────────────────────────────────── */
.spinner {
    display: inline-block;
    width: 1.25rem; height: 1.25rem;
    border: 2.5px solid rgba(44,95,138,.2);
    border-top-color: var(--brand);
    border-radius: 50%;
    animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Footer ───────────────────────────────────────────────────────────────── */
.site-footer {
    background: var(--bg-dark);
    color: rgba(255,255,255,.75);
    padding-block: 3rem 1.5rem;
    margin-top: auto;
}
.footer-grid {
    display: grid;
    gap: 2rem;
    grid-template-columns: 1fr;
    margin-bottom: 2.5rem;
}
@media (min-width: 640px) { .footer-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .footer-grid { grid-template-columns: 2fr 1fr 1fr 1.5fr; } }

.footer-brand-logo { height: 4rem; width: auto; margin-bottom: .75rem; opacity: .75; }
.footer-name { font-size: 1.1rem; font-weight: 700; color: #fff; margin-bottom: .5rem; }
.footer-address, .footer-email { font-size: .875rem; line-height: 1.7; margin-bottom: .5rem; }
address { font-style: normal; }
.footer-email a { color: rgba(255,255,255,.75); }
.footer-email a:hover { color: #fff; }

.footer-heading { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: rgba(255,255,255,.5); margin-bottom: .75rem; }
.footer-links { list-style: none; padding: 0; }
.footer-links li { margin-bottom: .4rem; }
.footer-links a { color: rgba(255,255,255,.7); text-decoration: none; font-size: .875rem; }
.footer-links a:hover { color: #fff; }

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,.1);
    padding-top: 1.25rem;
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
    justify-content: space-between;
}
.footer-legal { font-size: .78rem; color: rgba(255,255,255,.72); } /* FIO-03 AA contrast */
.footer-legal a { color: rgba(255,255,255,.82); }
.footer-legal a:hover { color: #fff; }

/* ── Admin layout ─────────────────────────────────────────────────────────── */
.admin-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin: 1.5rem 0; flex-wrap: wrap; }
.admin-header h1 { font-size: 1.5rem; }

.stat-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(11.25rem, 1fr)); margin-bottom: 1.5rem; }
.stat-card { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; }
.stat-card .stat-value { font-size: 2rem; font-weight: 700; color: var(--brand); line-height: 1; }
.stat-card .stat-label { font-size: .82rem; color: var(--text-muted); margin-top: .25rem; }

/* ── Auth pages ───────────────────────────────────────────────────────────── */
.auth-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - var(--nav-height) - 12.5rem);
    padding: 2rem 1rem;
}
.auth-card {
    width: 100%;
    max-width: 27.5rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 2rem;
}
.auth-card h1 { font-size: 1.5rem; text-align: center; margin-bottom: .5rem; }
.auth-card .auth-sub { text-align: center; color: var(--text-muted); font-size: .9rem; margin-bottom: 1.5rem; }

/* ── Utility ──────────────────────────────────────────────────────────────── */
.text-center  { text-align: center; }
.text-right   { text-align: right; }
.text-muted   { color: var(--text-muted); }
.text-sm      { font-size: .875rem; }
.text-xs      { font-size: .78rem; }
.text-error   { color: var(--error); }
.text-success { color: var(--success); }
.fw-bold      { font-weight: 700; }
.mt-1  { margin-top: .5rem; }
.mt-2  { margin-top: 1rem; }
.mt-3  { margin-top: 1.5rem; }
.mt-4  { margin-top: 2rem; }
.mb-1  { margin-bottom: .5rem; }
.mb-2  { margin-bottom: 1rem; }
.mb-3  { margin-bottom: 1.5rem; }
.mb-4  { margin-bottom: 2rem; }
.d-none { display: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: .5rem; }
.gap-2 { gap: 1rem; }

/* ── Room listing cards ───────────────────────────────────────────────────── */
.room-card-body {
    display: flex;
    flex-direction: column;
    gap: 0;
}
.room-card-content { flex: 1; }
.room-card-content h2 { margin-bottom: .4rem; }

/* Mobile: aside sits below content as a bottom bar */
.room-card-aside {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-top: 1rem;
    margin-top: 1rem;
    border-top: 1px solid var(--border);
}
.room-card-aside .room-card-btns {
    display: flex;
    flex-direction: column;
    gap: .5rem;
    flex-shrink: 0;
}
.room-card-aside .room-card-btns .btn { white-space: nowrap; }

.room-card-price { line-height: 1.2; }
.room-card-price .price-from  { font-size: .75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }
.room-card-price .price-amt   { font-size: 1.5rem; font-weight: 700; color: var(--brand); display: block; }
.room-card-price .price-unit  { font-size: .75rem; color: var(--text-muted); }

/* Desktop: aside becomes a right column */
@media (min-width: 640px) {
    .room-card-body {
        display: grid;
        grid-template-columns: 1fr auto;
        gap: 2rem;
        align-items: start;
    }
    .room-card-aside {
        flex-direction: column;
        align-items: flex-end;
        padding-top: 0;
        margin-top: 0;
        border-top: none;
        border-left: 1px solid var(--border);
        padding-left: 1.5rem;
        min-width: 8.75rem;
        text-align: right;
    }
    .room-card-aside .price-from { font-size: .8rem; }
    .room-card-aside .price-amt  { font-size: 1.75rem; margin-top: -.1rem; }
    .room-card-aside .price-unit { font-size: .8rem; margin-top: -.25rem; }
    .room-card-aside .room-card-btns { width: 100%; }
    .room-card-aside .room-card-btns .btn { text-align: center; }
}

/* ── Booking availability calendar ───────────────────────────────────────── */
#cal-card { overflow: visible; }
.cal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    margin-bottom: .75rem;
    position: relative;
}
.cal-nav-btn {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 2rem;
    font-weight: 300;
    line-height: 0;
    padding: 0 .9rem;
    min-height: 3rem;
    cursor: pointer;
    color: var(--text);
    transition: background .15s;
}
.cal-nav-btn:hover:not(:disabled) { background: var(--bg-muted, #f3f4f6); }
.cal-nav-btn:disabled { opacity: .3; cursor: not-allowed; }
.cal-title-btn {
    flex: 1;
    background: none;
    border: 1px solid transparent;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    cursor: pointer;
    padding: .4rem .75rem;
    text-align: center;
    transition: background .15s, border-color .15s;
}
.cal-title-btn:hover,
.cal-title-btn[aria-expanded="true"] { background: var(--bg-muted, #f3f4f6); border-color: var(--border); }
.cal-picker {
    position: absolute;
    top: calc(100% + .25rem);
    left: 0;
    right: 0;
    background: var(--bg, #fff);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    z-index: 200;
    padding: 1rem;
}
.cal-picker-yr-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: .75rem;
    font-size: 1rem;
}
.cal-picker-yr-btn {
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 1.3rem;
    font-weight: 300;
    line-height: 1;
    padding: .2rem .6rem;
    cursor: pointer;
    color: var(--text);
    transition: background .15s;
}
.cal-picker-yr-btn:hover:not(:disabled) { background: var(--bg-muted, #f3f4f6); }
.cal-picker-yr-btn:disabled { opacity: .3; cursor: not-allowed; }
.cal-picker-months {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: .375rem;
}
.cal-picker-month {
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: .5rem .25rem;
    font-size: .875rem;
    cursor: pointer;
    text-align: center;
    transition: background .15s;
}
.cal-picker-month:hover:not(:disabled) { background: var(--bg-muted, #f3f4f6); }
.cal-picker-month--active { background: var(--brand); color: #fff; border-color: var(--brand); font-weight: 700; }
.cal-picker-month:disabled { opacity: .3; cursor: not-allowed; }
.cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.1875rem;
}
.cal-grid .cal-day-name {
    text-align: center;
    font-size: .7rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    padding: .25rem 0 .4rem;
}
.cal-day {
    text-align: center;
    padding: .45rem .2rem;
    border-radius: var(--radius);
    font-size: .875rem;
    cursor: default;
    line-height: 1.1;
    user-select: none;
}
.cal-day--empty       { background: none; }
.cal-day--past        { color: var(--text-muted); opacity: .35; }
.cal-day--out-of-range{ color: var(--text-muted); opacity: .35; }
.cal-day--bookable    { cursor: pointer; }
.cal-day--bookable:hover { filter: brightness(.88); }
.cal-day--selected    { background: var(--brand) !important; color: #fff !important; font-weight: 700; }
.cal-day--today       { outline: 2px solid var(--brand); outline-offset: -2px; }
.cal-loading {
    text-align: center;
    padding: 1.5rem;
    color: var(--text-muted);
    font-size: .875rem;
    grid-column: 1 / -1;
}
.cal-legend {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: .75rem;
    font-size: .75rem;
    color: var(--text-muted);
}
.cal-legend-item { display: flex; align-items: center; gap: .35rem; }
.cal-swatch {
    display: inline-block;
    width: 1.75rem;
    height: 0.75rem;
    border-radius: 0.1875rem;
}
.cal-swatch--gradient   { background: linear-gradient(to right, hsl(0,65%,88%), hsl(60,65%,88%), hsl(120,65%,88%)); border: 1px solid #ccc; }
.cal-swatch--unavailable{ background: var(--bg-muted, #f3f4f6); border: 1px solid var(--border); }
.cal-swatch--selected   { background: var(--brand); }
.cal-swatch--school-hol { background: transparent; box-shadow: inset 0 2px 0 0 hsl(270,55%,65%), inset 0 -2px 0 0 hsl(270,55%,65%); height: .75rem; border-radius: 0; }
.cal-swatch--bank-hol   { background: transparent; box-shadow: inset 0 2px 0 0 hsl(20,85%,55%),  inset 0 -2px 0 0 hsl(20,85%,55%);  height: .75rem; border-radius: 0; }

/* ── School holiday border grouping ──────────────────────────────────────── */
.cal-day--school-hol {
    --sh-t: 0 0 0 0 transparent;
    --sh-b: 0 0 0 0 transparent;
    --sh-l: 0 0 0 0 transparent;
    --sh-r: 0 0 0 0 transparent;
    box-shadow: var(--sh-t), var(--sh-b), var(--sh-l), var(--sh-r);
    position: relative;
    z-index: 1;
}
.cal-day--sh-top    { --sh-t: inset 0  3px 0 0 hsl(270,55%,65%); }
.cal-day--sh-bottom { --sh-b: inset 0 -3px 0 0 hsl(270,55%,65%); }
.cal-day--sh-left   { --sh-l: inset  3px 0 0 0 hsl(270,55%,65%); }
.cal-day--sh-right  { --sh-r: inset -3px 0 0 0 hsl(270,55%,65%); }

.sh-badge {
    background: var(--lilac-pale);
    color: var(--lilac);
    padding: .15rem .5rem;
    border-radius: 99px;
    font-weight: 600;
    font-size: .75rem;
    white-space: nowrap;
}

.cal-day--bank-hol {
    --bh-t: 0 0 0 0 transparent;
    --bh-b: 0 0 0 0 transparent;
    --bh-l: 0 0 0 0 transparent;
    --bh-r: 0 0 0 0 transparent;
    box-shadow: var(--bh-t), var(--bh-b), var(--bh-l), var(--bh-r);
    position: relative;
    z-index: 1;
}
.cal-day--bh-top    { --bh-t: inset 0  3px 0 0 hsl(20,85%,55%); }
.cal-day--bh-bottom { --bh-b: inset 0 -3px 0 0 hsl(20,85%,55%); }
.cal-day--bh-left   { --bh-l: inset  3px 0 0 0 hsl(20,85%,55%); }
.cal-day--bh-right  { --bh-r: inset -3px 0 0 0 hsl(20,85%,55%); }

.bh-badge {
    background: hsl(20,90%,93%);
    color: hsl(20,75%,35%);
    padding: .15rem .5rem;
    border-radius: 99px;
    font-weight: 600;
    font-size: .75rem;
    white-space: nowrap;
}

/* ── Day timeline strip ───────────────────────────────────────────────────── */
#cal-timeline { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.cal-timeline-placeholder {
    text-align: center;
    font-size: .8125rem;
    color: var(--text-muted);
    padding: .4rem 0;
}
.cal-timeline-placeholder--loading { opacity: .6; }
.cal-timeline-wrap { display: flex; flex-direction: column; gap: .75rem; }
.cal-timeline-heading {
    font-size: .8125rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: -.25rem;
}
.cal-tl-room  { display: flex; flex-direction: column; gap: .25rem; }
.cal-tl-name  { font-size: .75rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }
.cal-tl-bar   { display: flex; border-radius: var(--radius); overflow: hidden; height: 1.75rem; }
.cal-tl-seg   { display: flex; align-items: center; justify-content: center; overflow: hidden; flex-shrink: 0; }
.cal-tl-seg--free   { background: #dcfce7; }
.cal-tl-seg--booked { background: #fee2e2; }
.cal-tl-seg--closed { background: var(--bg-muted, #f3f4f6); color: var(--text-muted); font-size: .7rem; width: 100%; }
.cal-tl-label {
    font-size: .65rem;
    font-weight: 600;
    color: #991b1b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0 .3rem;
    pointer-events: none;
}
.cal-tl-times {
    display: flex;
    justify-content: space-between;
    font-size: .65rem;
    color: var(--text-muted);
    padding: 0 .1rem;
}

/* ── Help buttons & popovers ──────────────────────────────────────────────── */
.help-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    min-width: 18px;
    background: var(--bg-muted, #f3f4f6);
    border: 1px solid var(--border);
    border-radius: 50%;
    font-size: .65rem;
    font-weight: 700;
    color: var(--text-muted);
    cursor: pointer;
    vertical-align: middle;
    margin-left: .3rem;
    flex-shrink: 0;
    line-height: 1;
    padding: 0;
    transition: background .1s, color .1s, border-color .1s;
}
.help-btn:hover {
    background: var(--brand-pale);
    color: var(--brand);
    border-color: var(--brand);
}
.help-btn:focus-visible { /* FIO-09 visible keyboard focus */
    outline: 3px solid var(--brand);
    outline-offset: 2px;
}
.help-popover-anchor { position: relative; display: inline-block; }
.help-popover {
    position: absolute;
    z-index: 200;
    max-width: 260px;
    width: max-content;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 4px 16px rgba(0,0,0,.12);
    padding: .65rem .75rem .65rem .75rem;
    font-size: .8rem;
    font-weight: normal;
    line-height: 1.5;
    color: var(--text);
    top: 100%;
    left: 0;
    margin-top: .25rem;
}
.help-popover-close {
    position: absolute;
    top: .2rem;
    right: .35rem;
    background: none;
    border: none;
    cursor: pointer;
    font-size: .95rem;
    color: var(--text-muted);
    padding: .1rem .25rem;
    line-height: 1;
}

/* ── Print ────────────────────────────────────────────────────────────────── */
@media print {
    .site-nav, .site-footer, .flash-bar, .btn { display: none !important; }
    body { color: #000; background: #fff; }
}

/* ── Session approve/reject radio toggle ─────────────────────────────────── */
.sess-opt {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .25rem .6rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    font-size: .8rem;
    user-select: none;
    opacity: .55;
    transition: opacity .12s, background .12s, border-color .12s, color .12s;
}
.sess-opt input[type=radio] { display: none; }
.sess-opt:hover { opacity: .85; }
.sess-opt--approve.is-selected { background: #dcfce7; border-color: var(--success, #16a34a); color: var(--success, #16a34a); font-weight: 600; opacity: 1; }
.sess-opt--reject.is-selected  { background: #fee2e2; border-color: var(--error,   #dc2626); color: var(--error,   #dc2626); font-weight: 600; opacity: 1; }
.sess-row--rejected > td                { opacity: .4; text-decoration: line-through; color: var(--text-muted); transition: opacity .2s; }
.sess-row--rejected > td:last-child     { opacity: 1; text-decoration: none; color: inherit; }

/* ── Admin layout ─────────────────────────────────────────────────────────── */
.admin-wrap {
    display: grid;
    grid-template-columns: 13.75rem 1fr;
    min-height: 100vh;
    transition: grid-template-columns .25s ease;
}
/* Suppress all sidebar transitions during initial page paint */
body.preload .admin-wrap,
body.preload .admin-sidebar,
body.preload .admin-nav-label,
body.preload .admin-nav-link,
body.preload .admin-brand-label,
body.preload .admin-brand,
body.preload .admin-nav-icon,
body.preload .admin-sidebar-footer,
body.preload .admin-sidebar-footer-label { transition: none !important; }
.admin-sidebar {
    background: #1a2e44;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
}
.admin-brand {
    padding: 1.25rem 1rem;
    border-bottom: 1px solid rgba(255,255,255,.12);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
}
.admin-brand-label {
    white-space: nowrap;
    overflow: hidden;
    transition: opacity .15s ease;
}
.admin-nav { padding: .75rem 0; flex: 1; }
.admin-nav-link {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .6rem 1rem;
    color: rgba(255,255,255,.8);
    text-decoration: none;
    font-size: .9rem;
    transition: background .15s, color .15s;
    white-space: nowrap;
    overflow: hidden;
}
.admin-nav-link:hover {
    background: rgba(255,255,255,.88);
    color: #1a2e44;
}
.admin-nav-link:hover .admin-nav-icon { opacity: 1; }
.admin-nav-link.active { background: var(--brand); color: #fff; }
.admin-nav-link.active .admin-nav-icon { opacity: 1; }
.admin-nav-icon { flex-shrink: 0; opacity: .6; display: block; }
.admin-nav-label { overflow: hidden; max-width: 999px; transition: opacity .15s ease, max-width .25s ease; }
.admin-nav-section {
    padding: .9rem 1.25rem .3rem;
    font-size: .68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: rgba(255,255,255,.4);
    white-space: nowrap;
    overflow: hidden;
    transition: opacity .15s ease;
}
.admin-nav-section:not(:first-child) {
    border-top: 1px solid rgba(255,255,255,.1);
    margin-top: .35rem;
}
.admin-main {
    display: flex;
    flex-direction: column;
    background: var(--bg-soft);
    min-height: 100vh;
    min-width: 0; /* prevent grid child from overflowing viewport */
}
.admin-topbar {
    background: #fff;
    border-bottom: 1px solid var(--border);
    padding: .875rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 50;
}
.admin-page-title { margin: 0; font-size: 1.15rem; }
.admin-content { padding: 1.5rem; flex: 1; }

/* Admin stat cards */
.admin-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(11.25rem, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.admin-stat {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
}
.admin-stat-value { font-size: 2rem; font-weight: 700; color: var(--brand); line-height: 1; }
.admin-stat-label { font-size: .8rem; color: var(--text-muted); margin-top: .25rem; }
.admin-stat-sub   { font-size: .75rem; color: var(--text-muted); margin-top: .5rem; }

/* Sidebar toggle — always visible, handles collapse on desktop / drawer on mobile */
.admin-sidebar-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: .4rem .5rem;
    margin-right: .5rem;
    color: var(--text);
    line-height: 1;
    flex-shrink: 0;
}
.admin-sidebar-toggle span {
    display: block;
    width: 1.375rem;
    height: 0.125rem;
    background: currentColor;
    margin: 0.25rem 0;
    border-radius: 2px;
    transition: transform .2s, opacity .2s;
}

/* Sidebar close button (inside drawer, mobile only) */
.admin-sidebar-close {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    color: rgba(255,255,255,.7);
    font-size: 1.4rem;
    line-height: 1;
    padding: 0 .25rem;
    flex-shrink: 0;
}

/* Backdrop (mobile drawer) */
.admin-sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 299;
}
.admin-sidebar-backdrop.is-open { display: block; }

/* ── Desktop collapsed sidebar ──────────────────────────────────────────── */
.admin-wrap.sidebar-collapsed {
    grid-template-columns: 3.5rem 1fr;
}
.admin-wrap.sidebar-collapsed .admin-nav-label,
.admin-wrap.sidebar-collapsed .admin-nav-section,
.admin-wrap.sidebar-collapsed .admin-brand-label,
.admin-wrap.sidebar-collapsed .admin-sidebar-footer-label {
    opacity: 0;
    pointer-events: none;
}
.admin-wrap.sidebar-collapsed .admin-nav-label {
    max-width: 0;
}
.admin-wrap.sidebar-collapsed .admin-nav-link {
    justify-content: center;
    padding: .6rem 0;
    gap: 0;
}
.admin-wrap.sidebar-collapsed .admin-nav-icon { opacity: 1; }
.admin-wrap.sidebar-collapsed .admin-nav-link .badge { display: none; }
.admin-wrap.sidebar-collapsed .admin-brand { justify-content: center; }
.admin-wrap.sidebar-collapsed .admin-sidebar-footer { justify-content: center; }

/* ── Tablet & mobile: slide-out drawer ≤1023px ──────────────────────────── */
@media (max-width: 1023px) {
    .admin-wrap { grid-template-columns: 1fr; }
    .admin-wrap.sidebar-collapsed { grid-template-columns: 1fr; }

    .admin-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: 16.25rem;
        height: 100%;
        transform: translateX(-100%);
        transition: transform .25s ease;
        z-index: 300;
        overflow-y: auto;
    }
    .admin-sidebar.is-open { transform: translateX(0); }

    /* Reset any desktop-collapsed styles inside the drawer */
    .admin-wrap.sidebar-collapsed .admin-nav-label,
    .admin-wrap.sidebar-collapsed .admin-nav-section,
    .admin-wrap.sidebar-collapsed .admin-brand-label,
    .admin-wrap.sidebar-collapsed .admin-sidebar-footer-label { opacity: 1; pointer-events: auto; }
    .admin-wrap.sidebar-collapsed .admin-nav-link { justify-content: flex-start; padding: .6rem 1rem; gap: .6rem; }
    .admin-wrap.sidebar-collapsed .admin-nav-icon { opacity: .6; }
    .admin-wrap.sidebar-collapsed .admin-nav-link .badge { display: inline-flex; }
    .admin-wrap.sidebar-collapsed .admin-brand { justify-content: space-between; }
    .admin-wrap.sidebar-collapsed .admin-sidebar-footer { justify-content: flex-start; }

    .admin-sidebar-close { display: block; }

    .admin-content { padding: 1rem; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   ROOM IMAGES & GALLERY
   ═══════════════════════════════════════════════════════════════════════════ */

/* Card image thumbnails */
.room-card-img {
    margin: 0;
    overflow: hidden;
    border-radius: var(--radius) var(--radius) 0 0;
    aspect-ratio: 3 / 2;
    background: var(--bg-soft);
}
.room-card-img--wide {
    aspect-ratio: 16 / 9;
}
.room-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .35s ease;
}
.card:hover .room-card-img img {
    transform: scale(1.04);
}

/* Photo-backed hero */
.hero--photo {
    position: relative;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}
.hero--photo::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,.55) 0%, rgba(0,0,0,.35) 60%, rgba(0,0,0,.55) 100%);
}
.hero--photo .container {
    position: relative;
}

/* About page exterior photo */
.about-exterior {
    margin: 0;
    width: 100%;
    max-height: 26rem;
    overflow: hidden;
}
.about-exterior img {
    width: 100%;
    max-height: 26rem;
    object-fit: cover;
    object-position: center;
    display: block;
}

/* Room detail: gallery + about side by side */
.room-detail-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    align-items: stretch;
}
.room-detail-split > *:only-child {
    grid-column: 1 / -1;
}
.room-gallery-card {
    display: flex;
    flex-direction: column;
}
.room-gallery-card .room-gallery {
    flex: 1;
    aspect-ratio: unset;
    border-radius: 0;
    min-height: 18rem;
}
@media (max-width: 768px) {
    .room-detail-split { grid-template-columns: 1fr; }
    .room-gallery-card .room-gallery { min-height: 14rem; }
}

/* Rooms listing: horizontal card with image on left */
.room-list-card {
    display: flex;
    align-items: stretch;
}
.room-list-img {
    margin: 0;
    flex: 0 0 13rem;
    overflow: hidden;
    background: var(--bg-soft);
}
.room-list-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: left center;
    display: block;
    transition: transform .35s ease;
}
.room-list-card:hover .room-list-img img {
    transform: scale(1.04);
}
.room-list-card .card-body { flex: 1; min-width: 0; }
@media (max-width: 600px) {
    .room-list-card { flex-direction: column; }
    .room-list-img { flex: none; height: 12rem; }
}

/* Room carousel gallery */
.room-gallery {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-lg);
    background: #111;
    aspect-ratio: 16 / 9;
    margin-bottom: 1.5rem;
    cursor: grab;
}
.room-gallery.is-dragging { cursor: grabbing; }

.room-gallery-track {
    display: flex;
    height: 100%;
    transition: transform .35s ease;
}
.room-gallery-slide {
    flex: 0 0 100%;
    height: 100%;
}
.room-gallery-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    user-select: none;
    pointer-events: none;
}

/* Prev/next buttons */
.room-gallery-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,.55);
    border: none;
    color: #fff;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    z-index: 2;
    transition: background .2s;
    backdrop-filter: blur(4px);
}
.room-gallery-btn:hover { background: rgba(0,0,0,.8); }
.room-gallery-btn--prev { left: .75rem; }
.room-gallery-btn--next { right: .75rem; }
.room-gallery-btn[disabled] { opacity: .3; pointer-events: none; }

/* Dot indicators */
.room-gallery-dots {
    position: absolute;
    bottom: .75rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: .4rem;
    z-index: 2;
}
.room-gallery-dot {
    width: .5rem;
    height: .5rem;
    border-radius: 50%;
    background: rgba(255,255,255,.45);
    border: none;
    cursor: pointer;
    padding: 0;
    transition: background .2s, transform .2s;
}
.room-gallery-dot.is-active {
    background: #fff;
    transform: scale(1.3);
}

/* Slide counter label */
.room-gallery-counter {
    position: absolute;
    top: .65rem;
    right: .75rem;
    background: rgba(0,0,0,.55);
    color: #fff;
    font-size: .72rem;
    font-weight: 600;
    padding: .15rem .5rem;
    border-radius: 1rem;
    backdrop-filter: blur(4px);
    z-index: 2;
}

/* Shared facilities photo strip */
.room-shared-photos {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr));
    gap: .5rem;
    margin-top: .75rem;
}
.room-shared-photos figure {
    margin: 0;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border-radius: var(--radius-sm);
    background: var(--bg-soft);
}
.room-shared-photos img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

@media (max-width: 600px) {
    .room-gallery-btn { width: 2.2rem; height: 2.2rem; font-size: .9rem; }
    .room-shared-photos { grid-template-columns: repeat(auto-fill, minmax(6rem, 1fr)); }
}

.pricing-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}

@media (max-width: 600px) {
    .pricing-grid { grid-template-columns: 1fr; }
}

/* ── Event listing upload zones ──────────────────────────────────── */
.ev-upload-zone { border:2px dashed var(--border); border-radius:var(--radius); display:flex; flex-direction:column; overflow:hidden; transition:border-color .15s,background .15s; cursor:pointer; }
.ev-upload-zone.has-preview { border-style:solid; border-color:var(--brand-light,#60a5fa); }
.ev-upload-zone:hover { border-color:#94a3b8; }
.ev-upload-zone.drag-over { border-color:var(--brand,#2563eb); border-style:solid; background:#eff6ff; }
.ev-upload-zone__preview { background:#f9fafb; min-height:130px; display:flex; align-items:center; justify-content:center; overflow:hidden; }
.ev-upload-zone__preview img { width:100%; height:160px; object-fit:cover; display:block; }
.ev-upload-zone__icon { font-size:2.5rem; color:#d1d5db; line-height:1; }
.ev-file-name { font-size:.8rem; color:#6b7280; text-align:center; padding:.5rem 1rem; word-break:break-all; }
.ev-upload-zone__body { padding:.75rem 1rem .25rem; }
.ev-upload-zone__title { font-weight:600; font-size:.88rem; margin-bottom:.15rem; }
.ev-upload-zone__actions { padding:.5rem 1rem .85rem; display:flex; align-items:center; gap:.75rem; flex-wrap:wrap; }
.ev-upload-zone__remove { font-size:.8rem; color:#dc2626; cursor:pointer; display:flex; align-items:center; gap:.3rem; }

/* ── Accessibility (Phase 6: FIO-02/04/05) ─────────────────────────────────── */
/* Skip-to-content link: visually hidden until focused */
.skip-link {
    position: absolute; left: .5rem; top: -3rem; z-index: 1000;
    background: var(--brand, #2c5f8a); color: #fff;
    padding: .55rem 1rem; border-radius: 0 0 .35rem .35rem;
    text-decoration: none; transition: top .15s ease;
}
.skip-link:focus { top: 0; outline: 3px solid #fff; outline-offset: 2px; }

/* Visible keyboard focus on the visually-hidden room checkboxes (2.4.7 AA) */
.room-check:focus-visible + .room-card,
.room-individual-check:focus-visible + .room-card {
    outline: 3px solid var(--brand, #2c5f8a);
    outline-offset: 2px;
}

/* Event card image hover (AMARA-04: replaces inline onmouseover/onmouseout) */
.event-card-img:hover { transform: scale(1.03); }

/* Respect reduced-motion: disable smooth scroll, reveal/transition animation */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ── Booking room selector (multi-select tick-boxes, accessible) ──────────────── */
.room-selector { border: 0; padding: 0; margin: 0 0 .25rem; min-width: 0; }
.room-selector-legend { font-size: .95rem; font-weight: 700; padding: 0; margin-bottom: .35rem; }
.room-selector-help { font-size: .8rem; color: var(--text-muted); margin: 0 0 .6rem; }
.room-selector .room-label { display: block; cursor: pointer; margin: 0; }
/* checkbox kept in the DOM and focusable, but visually replaced by the tick box */
.room-selector .room-check { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.room-selector .room-grid { display: grid; gap: .5rem; }
.room-selector .room-card {
    display: flex; align-items: flex-start; gap: .6rem;
    border: 2px solid var(--border); border-radius: .5rem; padding: .8rem;
    background: var(--surface, #fff); transition: border-color .15s, background .15s;
}
/* visible tick box (a shape cue, so the selected state never relies on colour alone) */
.room-selector .room-tick {
    flex-shrink: 0; width: 22px; height: 22px; margin-top: 1px;
    border: 2px solid var(--border); border-radius: 5px; background: #fff; position: relative;
}
.room-selector .room-card.is-selected .room-tick { background: var(--brand); border-color: var(--brand); }
.room-selector .room-card.is-selected .room-tick::after {
    content: ""; position: absolute; left: 6px; top: 2px; width: 5px; height: 11px;
    border: solid #fff; border-width: 0 3px 3px 0; transform: rotate(45deg);
}
.room-selector .room-card-main { flex: 1; min-width: 0; }
.room-selector .room-card-row { display: flex; align-items: center; gap: .45rem; }
.room-selector .room-name { font-weight: 700; }
.room-selector .room-price { margin-left: auto; font-size: .75rem; color: var(--text-muted); white-space: nowrap; }
.room-selector .room-sub { display: block; font-size: .75rem; color: var(--text-muted); margin-top: .15rem; }
/* selected state: border + tint (colour) PLUS the tick checkmark + the word "Selected" (non-colour) */
.room-selector .room-card.is-selected { border-color: var(--brand); background: var(--brand-tint, #eef4fb); }
.room-selector .room-selected-pill {
    display: none; font-size: .62rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
    color: var(--brand); border: 1px solid var(--brand); border-radius: 99px; padding: .03rem .4rem; background: #fff;
}
.room-selector .room-card.is-selected .room-selected-pill { display: inline-block; }
/* visible keyboard focus (2.4.7), independent of JS */
.room-selector .room-label:focus-within .room-card { outline: 3px solid var(--brand, #2c5f8a); outline-offset: 2px; }
/* the combined space (Whole Hall): a distinct, full-width tile */
.room-selector .room-label-whole { display: block; margin-bottom: .15rem; }
.room-selector .room-card-whole { border-style: dashed; }
.room-selector .room-card-whole.is-selected { border-style: solid; }
.room-selector .room-or { text-align: center; font-size: .75rem; color: var(--text-muted); margin: .1rem 0 .55rem; position: relative; }
.room-selector .room-or span { background: var(--surface, #fff); padding: 0 .5rem; position: relative; z-index: 1; }
.room-selector .room-or::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: var(--border); }
.room-echo { font-size: .8rem; color: var(--text); margin: .6rem 0 0; min-height: 1.1em; }
.room-echo:empty { margin: 0; }
.room-consolidate-note { font-size: .8rem; margin: .5rem 0 0; padding: .55rem .7rem; border-radius: .4rem;
    background: var(--brand-tint, #eef4fb); border: 1px solid var(--brand); color: var(--text); }
.room-consolidate-note[hidden] { display: none; }
.room-selection-hint { font-size: .8rem; color: var(--error, #b00); margin: .5rem 0 0; }
.room-selection-hint[hidden] { display: none; }

/* ── Invoice builder ──────────────────────────────────────────────────────────── */
.user-results { position: absolute; left: 0; right: 0; top: calc(100% + 2px); z-index: 20;
    background: var(--surface, #fff); border: 1px solid var(--border); border-radius: .4rem;
    box-shadow: 0 6px 20px rgba(0,0,0,.12); max-height: 320px; overflow-y: auto; }
.user-result { display: block; padding: .5rem .7rem; border-bottom: 1px solid var(--border); color: var(--text); text-decoration: none; }
.user-result:last-child { border-bottom: 0; }
.user-result:hover { background: var(--brand-tint, #eef4fb); }
.user-result span { color: var(--text-muted); font-size: .8rem; margin-left: .3rem; }
.user-result--empty { color: var(--text-muted); cursor: default; }
.builder-summary table { margin: 0; }
.builder-total { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
    margin-top: .5rem; padding-top: .5rem; border-top: 2px solid var(--border); font-size: 1.05rem; }
.builder-total strong { font-size: 1.25rem; color: var(--brand); }
