@font-face {
    font-family: 'Acumin';
    src: url('Acumin-Variable-Concept.ttf') format('truetype');
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

/* =============================================
   DSL Visitor Kiosk — Brand Stylesheet
   Colours: Midnight #13223F | Tangerine #EE6123 | Rice #FAF6EA
   ============================================= */

:root {
    --white: #fff;
    --black: #000;
    --midnight: #13223F;
    --tangerine: #EE6123;
    --rice: #FAF6EA;
    --sky-blue: #9fc2d9;
    --royal-blue: #849DE7;
    --midnight-light: #1e3460;
    --midnight-dark: #0d1828;
    --tangerine-light: #f2743a;
    --tangerine-dark: #c44e1a;
    --rice-dark: #ede8d5;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.12);
    --shadow-md: 0 6px 20px rgba(0,0,0,0.18);
    --shadow-lg: 0 12px 40px rgba(0,0,0,0.22);
    --radius: 14px;
    --radius-sm: 8px;
    --transition: 0.2s ease;
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
    font-family: 'Acumin', 'Segoe UI', Arial, sans-serif;
    background: var(--rice);
    color: var(--midnight);
    font-size: 18px;
}

/* =============================================
   LAYOUT
   ============================================= */

.kiosk-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* HEADER */
.kiosk-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: var(--midnight);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.header-left {
    display: flex;
    align-items: center;
}

.logo-svg {
    height: 38px;
    width: auto;
}

.header-center {
    flex: 1;
    text-align: center;
}

.company-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--rice);
    letter-spacing: 0.5px;
}

.header-right {
    display: flex;
    gap: 10px;
    align-items: center;
}

.header-btn {
    background: rgba(255,255,255,0.12);
    color: var(--white);
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: var(--radius-sm);
    padding: 8px 16px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background var(--transition);
}

    .header-btn:hover {
        background: rgba(255,255,255,0.22);
    }

    .header-btn.accent {
        background: var(--tangerine);
        border-color: var(--tangerine-dark);
    }

        .header-btn.accent:hover {
            background: var(--tangerine-dark);
        }

/* MAIN */
.kiosk-main {
    padding-top: 64px;
    flex: 1;
    display: flex;
    justify-content: center;
    overflow-y: auto;
}

.step-container {
    width: 100%;
    max-width: 680px;
    padding: 40px 20px 80px;
}

/* =============================================
   STEP CARDS
   ============================================= */

.step {
    width: 100%;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(14px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.step-title {
    font-size: 2rem;
    font-weight: 800;
    color: var(--midnight);
    margin-bottom: 8px;
    line-height: 1.2;
}

.step-subtitle {
    font-size: 1.05rem;
    color: #666;
    margin-bottom: 30px;
}

/* =============================================
   SITE GRID
   ============================================= */

.site-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
    margin-top: 10px;
}

.site-card {
    background: var(--white);
    border: 2px solid var(--rice-dark);
    border-radius: var(--radius);
    padding: 28px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: all var(--transition);
    box-shadow: var(--shadow-sm);
    font-size: 1rem;
}

    .site-card:hover {
        border-color: var(--tangerine);
        box-shadow: var(--shadow-md);
        transform: translateY(-2px);
    }

.site-icon {
    font-size: 2.2rem;
}

.site-name {
    font-weight: 700;
    font-size: 1rem;
    color: var(--midnight);
    text-align: center;
}

/* =============================================
   ACTION CARDS
   ============================================= */

.action-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 10px;
}

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

.action-card {
    background: var(--midnight);
    color: var(--white);
    border: none;
    border-radius: var(--radius);
    padding: 36px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: all var(--transition);
    box-shadow: var(--shadow-md);
    font-size: 1rem;
}

    .action-card:hover {
        transform: translateY(-3px);
        box-shadow: var(--shadow-lg);
    }

    .action-card:active {
        transform: scale(0.97);
    }

    .action-card.primary {
        background: var(--midnight);
    }

        .action-card.primary:hover {
            background: var(--midnight-light);
        }

    .action-card.secondary {
        background: #5a6268;
    }

        .action-card.secondary:hover {
            background: #3d4347;
        }

    .action-card.tangerine {
        background: var(--tangerine);
    }

        .action-card.tangerine:hover {
            background: var(--tangerine-dark);
        }

.action-icon {
    font-size: 2.8rem;
}

.action-label {
    font-size: 1.6rem;
    font-weight: 800;
}

.action-desc {
    font-size: 0.9rem;
    opacity: 0.75;
}

/* =============================================
   INPUTS
   ============================================= */

.search-box {
    margin-bottom: 10px;
}

.kiosk-input {
    display: block;
    width: 100%;
    padding: 16px 20px;
    font-size: 1.25rem;
    border: 2px solid var(--rice-dark);
    border-radius: var(--radius);
    background: var(--white);
    color: var(--midnight);
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
    box-shadow: var(--shadow-sm);
    margin-bottom: 16px;
}

    .kiosk-input:focus {
        border-color: var(--tangerine);
        box-shadow: 0 0 0 3px rgba(238,97,35,0.18);
    }

.kiosk-textarea {
    resize: vertical;
    min-height: 120px;
    font-family: inherit;
}

/* =============================================
   TYPEAHEAD
   ============================================= */

.typeahead-container {
    background: var(--white);
    border: 2px solid var(--rice-dark);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    margin-bottom: 20px;
    max-height: 420px;
    overflow-y: auto;
}

.typeahead-info {
    padding: 10px 16px;
    font-size: 0.85rem;
    color: #888;
    background: var(--rice);
    border-bottom: 1px solid var(--rice-dark);
}

.typeahead-btn {
    display: block;
    width: 100%;
    padding: 18px 20px;
    text-align: left;
    border: none;
    border-bottom: 1px solid var(--rice-dark);
    background: var(--white);
    cursor: pointer;
    transition: background var(--transition);
}

    .typeahead-btn:last-child {
        border-bottom: none;
    }

    .typeahead-btn:hover {
        background: var(--rice);
    }

.typeahead-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--midnight);
}

.typeahead-sub {
    font-size: 0.85rem;
    color: #666;
    margin-top: 2px;
}

/* =============================================
   BUTTONS
   ============================================= */

.kiosk-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 18px 36px;
    font-size: 1.2rem;
    font-weight: 700;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition);
    box-shadow: var(--shadow-sm);
    color: var(--white);
    margin-top: 8px;
    min-width: 0;
}

    .kiosk-btn:hover {
        box-shadow: var(--shadow-md);
        transform: translateY(-2px);
    }

    .kiosk-btn:active {
        transform: scale(0.97);
    }

    .kiosk-btn.primary {
        background: var(--midnight);
    }

        .kiosk-btn.primary:hover {
            background: var(--midnight-light);
        }

    .kiosk-btn.danger {
        background: var(--tangerine);
    }

        .kiosk-btn.danger:hover {
            background: var(--tangerine-dark);
        }

    .kiosk-btn.secondary {
        background: var(--white);
        color: var(--midnight);
        border: 2px solid var(--midnight);
        box-shadow: none;
    }

        .kiosk-btn.secondary:hover {
            background: var(--midnight);
            color: var(--white);
            box-shadow: var(--shadow-md);
        }

    .kiosk-btn.disabled-btn {
        opacity: 0.45;
        cursor: not-allowed;
        transform: none !important;
    }

    .kiosk-btn:disabled {
        opacity: 0.45;
        cursor: not-allowed;
        transform: none;
    }

.new-person-action {
    margin-top: 24px;
}

.step-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

    /* Desktop: each button is exactly half the input width, single row */
    .step-actions .kiosk-btn {
        flex: 1 1 0;
        min-width: 0;
    }

/* Mobile: stack buttons full-width to match the input above */
@media (max-width: 600px) {
    .step-actions {
        flex-direction: column-reverse;
        gap: 10px;
    }

        .step-actions .kiosk-btn {
            width: 100%;
            flex: none;
        }
}

/* =============================================
   HEALTH & SAFETY
   ============================================= */

.hs-content {
    background: var(--white);
    border: 2px solid var(--rice-dark);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.hs-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.hs-section-title {
    font-size: 1rem;
    font-weight: 800;
    color: var(--midnight);
    padding-bottom: 6px;
    border-bottom: 2px solid var(--rice-dark);
}

.hs-section-mpi {
    background: #f0fdf4;
    border: 2px solid #86efac;
    border-radius: var(--radius-sm);
    padding: 16px;
}

    .hs-section-mpi .hs-section-title {
        color: #166534;
        border-bottom-color: #86efac;
    }

.hs-section-intro {
    font-size: 0.95rem;
    color: #166534;
    line-height: 1.5;
}

.hs-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

    .hs-list li {
        padding: 10px 14px;
        background: var(--rice);
        border-radius: var(--radius-sm);
        font-size: 0.95rem;
        color: var(--midnight);
        font-weight: 500;
        line-height: 1.4;
    }

.hs-section-mpi .hs-list li {
    background: #dcfce7;
    color: #14532d;
}

/* Toggle switch */
.toggle-label {
    display: flex;
    align-items: center;
    gap: 16px;
    cursor: pointer;
    padding: 16px;
    background: var(--white);
    border: 2px solid var(--rice-dark);
    border-radius: var(--radius);
    margin-bottom: 20px;
    transition: border-color var(--transition);
    user-select: none;
}

    .toggle-label:hover {
        border-color: var(--tangerine);
    }

.toggle-switch {
    position: relative;
    flex-shrink: 0;
}

    .toggle-switch input {
        display: none;
    }

.toggle-track {
    display: block;
    width: 68px;
    height: 38px;
    background: #ccc;
    border-radius: 999px;
    position: relative;
    transition: background var(--transition);
}

.toggle-thumb {
    display: block;
    width: 34px;
    height: 34px;
    background: var(--white);
    border-radius: 50%;
    position: absolute;
    top: 2px;
    left: 2px;
    transition: transform var(--transition);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.toggle-switch input:checked ~ .toggle-track {
    background: var(--midnight);
}

    .toggle-switch input:checked ~ .toggle-track .toggle-thumb {
        transform: translateX(30px);
    }

.toggle-text {
    font-size: 1rem;
    font-weight: 600;
    color: var(--midnight);
}

/* =============================================
   CONFIRMATION
   ============================================= */

.confirmation-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 20px 0;
}

.confirmation-ring {
    position: relative;
    width: 160px;
    height: 160px;
    margin-bottom: 24px;
}

.countdown-svg {
    width: 160px;
    height: 160px;
    transform: rotate(-90deg);
}

.ring-bg {
    fill: none;
    stroke: var(--rice-dark);
    stroke-width: 10;
}

.ring-fg {
    fill: none;
    stroke: var(--tangerine);
    stroke-width: 10;
    stroke-linecap: round;
    transition: stroke-dashoffset 1s linear;
}

.countdown-inner {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.countdown-number {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--midnight);
}

.confirmation-icon {
    font-size: 3rem;
    margin-bottom: 12px;
}

.confirmation-message {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--midnight);
    margin-bottom: 10px;
    max-width: 460px;
}

.confirmation-sub {
    color: #888;
    font-size: 0.95rem;
    margin-bottom: 28px;
}

/* =============================================
   MISC / UTILITIES
   ============================================= */

.no-results, .loading-text {
    padding: 20px;
    text-align: center;
    color: #888;
    font-size: 1rem;
}

.error-text {
    padding: 20px;
    text-align: center;
    color: var(--tangerine);
    font-weight: 600;
}

.field-error {
    color: var(--tangerine);
    font-size: 0.9rem;
    margin: -8px 0 12px;
    font-weight: 600;
}

.error-banner {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #c0392b;
    color: white;
    padding: 14px 24px;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 14px;
    z-index: 2000;
    box-shadow: var(--shadow-lg);
    max-width: 600px;
    width: 90%;
}

.dismiss-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0 4px;
    margin-left: auto;
}

.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(19,34,63,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
}

.spinner {
    width: 56px;
    height: 56px;
    border: 5px solid rgba(255,255,255,0.25);
    border-top-color: var(--tangerine);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

#blazor-error-ui {
    background: #c0392b;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0,0,0,0.2);
    color: white;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

/* =============================================
   NOT FOUND / INVALID SITE / NO SLUG
   ============================================= */

.notfound-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 64px);
    padding: 40px 20px;
    background: var(--rice);
}

.notfound-card {
    background: var(--white);
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    padding: 48px 40px;
    max-width: 480px;
    width: 100%;
    text-align: center;
    border-top: 5px solid var(--tangerine);
}

.notfound-graphic {
    margin-bottom: 24px;
}

.notfound-svg {
    width: 180px;
    height: auto;
}

.notfound-title {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--midnight);
    margin-bottom: 12px;
    line-height: 1.2;
}

.notfound-body {
    font-size: 1.05rem;
    color: #555;
    line-height: 1.6;
    margin-bottom: 0;
}

.notfound-divider {
    height: 1px;
    background: var(--rice-dark);
    margin: 28px 0;
}

.notfound-help {
    font-size: 0.95rem;
    color: #888;
    margin-bottom: 14px;
}

.notfound-phone,
.notfound-email {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    font-size: 1.05rem;
    font-weight: 700;
    padding: 14px 28px;
    border-radius: var(--radius);
    transition: background var(--transition), transform var(--transition);
    box-shadow: var(--shadow-sm);
    margin: 6px auto;
    width: 100%;
    justify-content: center;
}

.notfound-phone {
    background: var(--rice);
    color: var(--midnight);
    border: 2px solid var(--rice-dark);
}

    .notfound-phone:hover {
        background: var(--rice-dark);
        transform: translateY(-2px);
    }

.notfound-email {
    background: var(--midnight);
    color: var(--white);
}

    .notfound-email:hover {
        background: var(--midnight-light);
        transform: translateY(-2px);
    }

.email-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* =============================================
   SPLASH LOADING
   ============================================= */

.splash-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 64px);
}

/* =============================================
   SITE NAME IN HEADER
   ============================================= */

.site-name-header {
    font-weight: 700;
    font-size: 1rem;
    color: var(--rice);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* =============================================
   DUPLICATE VISITOR WARNINGS
   ============================================= */

.duplicate-warning {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    background: #fffbeb;
    border: 2px solid #f59e0b;
    border-radius: var(--radius);
    padding: 18px;
    margin: 12px 0 4px;
}

.duplicate-warning-icon {
    font-size: 1.6rem;
    flex-shrink: 0;
    line-height: 1;
}

.duplicate-warning strong {
    display: block;
    font-size: 1rem;
    color: #92400e;
    margin-bottom: 6px;
}

.duplicate-warning p {
    font-size: 0.95rem;
    color: #78350f;
    margin: 4px 0 0;
    line-height: 1.5;
}

.duplicate-block {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    background: #fff1f2;
    border: 2px solid #f43f5e;
    border-radius: var(--radius);
    padding: 18px;
    margin: 12px 0 4px;
}

.duplicate-block-icon {
    font-size: 1.6rem;
    flex-shrink: 0;
    line-height: 1;
}

.duplicate-block strong {
    display: block;
    font-size: 1rem;
    color: #9f1239;
    margin-bottom: 6px;
}

.duplicate-block p {
    font-size: 0.95rem;
    color: #881337;
    margin: 4px 0 0;
    line-height: 1.5;
}

.kiosk-btn.warning {
    background: #d97706;
}

    .kiosk-btn.warning:hover {
        background: #b45309;
    }
/* =============================================
   VISITOR BOARD — shared / reset
   ============================================= */

.board-gate,
.board-page {
    min-height: 100vh;
    font-family: 'Acumin', 'Segoe UI', Arial, sans-serif;
}

/* =============================================
   PHASE 1 + 2 — Gate & Site Picker
   ============================================= */

.board-gate {
    background: var(--midnight);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 16px;
    min-height: 100vh;
}

.board-gate-card {
    background: var(--midnight-light);
    border-radius: 20px;
    padding: 36px 24px 32px;
    width: 100%;
    max-width: 420px;
    text-align: center;
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(255,255,255,0.07);
}

.board-site-card {
    max-width: 500px;
}

.board-gate-logo {
    height: 44px;
    width: auto;
    margin-bottom: 22px;
}

.board-gate-title {
    font-size: 1.7rem;
    font-weight: 800;
    color: var(--rice);
    margin-bottom: 6px;
}

.board-gate-sub {
    font-size: 0.95rem;
    color: rgba(250,246,234,0.5);
    margin-bottom: 28px;
}

/* ── PIN dots ─────────────────────────────── */

.board-pin-dots {
    display: flex;
    justify-content: center;
    gap: 18px;
    margin-bottom: 10px;
}

.board-pin-dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid rgba(250,246,234,0.3);
    background: transparent;
    transition: background 0.12s ease, border-color 0.12s ease, transform 0.1s ease;
}

    .board-pin-dot.filled {
        background: var(--tangerine);
        border-color: var(--tangerine);
        transform: scale(1.1);
    }

    .board-pin-dot.error {
        border-color: #e55;
        background: #e55;
    }

.board-pin-error {
    color: var(--tangerine);
    font-size: 0.88rem;
    font-weight: 600;
    min-height: 1.4em;
    margin-bottom: 18px;
}

/* ── Numpad ───────────────────────────────── */

.board-numpad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.numpad-btn {
    background: rgba(255,255,255,0.09);
    color: var(--rice);
    border: 1px solid rgba(255,255,255,0.11);
    border-radius: 14px;
    padding: 0;
    height: 64px;
    font-size: 1.5rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.12s ease, transform 0.1s ease;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

    .numpad-btn:hover {
        background: rgba(255,255,255,0.14);
    }

    .numpad-btn:active {
        background: rgba(255,255,255,0.22);
        transform: scale(0.93);
    }

.numpad-back {
    color: var(--tangerine);
    font-size: 1.3rem;
}

/* ── Site list ───────────────────────────── */

.board-sites-loading {
    display: flex;
    justify-content: center;
    padding: 32px 0;
}

.spinner-light {
    border-color: rgba(255,255,255,0.2);
    border-top-color: var(--tangerine);
}

.board-sites-error {
    color: var(--tangerine);
    font-size: 0.95rem;
    padding: 8px 0;
}

.board-sites-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.board-site-btn {
    display: flex;
    align-items: center;
    gap: 14px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 14px;
    padding: 18px 20px;
    color: var(--rice);
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    transition: background 0.12s ease;
    -webkit-tap-highlight-color: transparent;
}

    .board-site-btn:hover {
        background: rgba(255,255,255,0.14);
    }

    .board-site-btn:active {
        background: rgba(255,255,255,0.2);
    }

.board-site-btn-icon {
    font-size: 1.3rem;
    flex-shrink: 0;
}

.board-site-btn-name {
    flex: 1;
}

.board-site-btn-arrow {
    font-size: 1.4rem;
    opacity: 0.45;
}

.board-site-btn-all {
    border-color: rgba(238,97,35,0.4);
    background: rgba(238,97,35,0.1);
}

    .board-site-btn-all:hover {
        background: rgba(238,97,35,0.18);
    }

.board-back-btn {
    background: none;
    border: none;
    color: rgba(250,246,234,0.45);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    padding: 10px 16px;
    font-family: inherit;
    -webkit-tap-highlight-color: transparent;
    transition: color 0.12s ease;
}

    .board-back-btn:hover {
        color: rgba(250,246,234,0.75);
    }

/* =============================================
   PHASE 3 — Visitor Board
   ============================================= */

.board-page {
    background: var(--rice);
    display: flex;
    flex-direction: column;
}

/* ── Top bar ──────────────────────────────── */

.board-topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--midnight);
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 16px;
    height: 60px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.35);
    flex-shrink: 0;
}

.board-nav-btn {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.15);
    color: var(--rice);
    border-radius: 10px;
    width: 44px;
    height: 44px;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.12s ease;
}

    .board-nav-btn:hover {
        background: rgba(255,255,255,0.18);
    }

.board-topbar-info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.board-topbar-site {
    font-size: 1rem;
    font-weight: 800;
    color: var(--rice);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.board-count-badge {
    display: inline-block;
    background: var(--tangerine);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 999px;
    white-space: nowrap;
    flex-shrink: 0;
}

.board-topbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.board-time {
    font-size: 0.85rem;
    font-weight: 600;
    color: rgba(250,246,234,0.6);
    min-width: 62px;
    text-align: right;
}

.board-icon-btn {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.15);
    color: var(--rice);
    border-radius: 10px;
    width: 40px;
    height: 40px;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.12s ease;
}

    .board-icon-btn:hover {
        background: rgba(255,255,255,0.18);
    }

    .board-icon-btn.spinning {
        animation: spin 0.7s linear infinite;
    }

/* ── Content wrapper — constrained on desktop ── */

.board-content {
    flex: 1;
    padding: 16px 12px 32px;
    /* centre and cap width on large screens */
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
    box-sizing: border-box;
}

/* ── Status / empty screens ──────────────────── */

.board-status-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 120px);
    gap: 14px;
    text-align: center;
    padding: 20px;
}

.board-status-msg {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--midnight);
}

.board-status-error {
    color: var(--tangerine);
}

.board-status-sub {
    font-size: 1rem;
    color: #999;
}

.board-retry-btn {
    background: var(--midnight);
    color: var(--rice);
    border: none;
    border-radius: var(--radius);
    padding: 14px 28px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    margin-top: 8px;
    transition: background 0.12s ease;
}

    .board-retry-btn:hover {
        background: var(--midnight-light);
    }

/* ── Visitor card list ───────────────────────── */

.board-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.board-card {
    background: #fff;
    border-radius: var(--radius);
    padding: 18px 18px 14px;
    box-shadow: var(--shadow-sm);
    border-left: 4px solid var(--midnight);
    animation: fadeIn 0.25s ease;
    display: flex;
    flex-direction: column;
    gap: 7px;
    transition: box-shadow 0.15s ease, transform 0.15s ease;
}

    .board-card:hover {
        box-shadow: var(--shadow-md);
        transform: translateY(-1px);
    }

.board-card--contractor {
    border-left-color: var(--tangerine);
}

.board-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.board-badge {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 999px;
    letter-spacing: 0.2px;
}

.badge--visitor {
    background: #e8edf5;
    color: var(--midnight);
}

.badge--contractor {
    background: #fde8d8;
    color: var(--tangerine-dark);
}

.board-duration {
    font-size: 0.8rem;
    font-weight: 600;
    color: #aaa;
}

.board-card-name {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--midnight);
    line-height: 1.2;
}

.board-card-company {
    font-size: 0.88rem;
    color: #666;
}

.board-card-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 2px;
}

.board-card-chip {
    font-size: 0.78rem;
    color: #777;
    background: var(--rice);
    border-radius: 6px;
    padding: 3px 8px;
}

.board-card-chip--site {
    background: #e8edf5;
    color: var(--midnight);
    font-weight: 600;
}

.board-card-reason {
    font-size: 0.85rem;
    color: #555;
    font-style: italic;
    background: var(--rice);
    border-left: 3px solid var(--rice-dark);
    border-radius: 0 6px 6px 0;
    padding: 7px 10px;
    margin-top: 2px;
}

/* =============================================
   BOARD — Responsive breakpoints
   ============================================= */

/* Tablet: 2 columns */
@media (min-width: 640px) {
    .board-content {
        padding: 24px 24px 40px;
    }

    .board-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .board-topbar {
        height: 64px;
        padding: 0 24px;
    }

    .board-gate-card {
        padding: 48px 40px 40px;
    }

    .numpad-btn {
        height: 70px;
    }
}

/* Desktop: 3 columns */
@media (min-width: 1024px) {
    .board-content {
        padding: 32px 40px 48px;
    }

    .board-list {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }

    .board-topbar {
        height: 68px;
        padding: 0 40px;
    }

    .board-topbar-site {
        font-size: 1.1rem;
    }

    .board-card {
        padding: 22px 20px 18px;
    }

    .board-card-name {
        font-size: 1.25rem;
    }
}

/* Wide desktop: 4 columns */
@media (min-width: 1400px) {
    .board-list {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* =============================================
   BOARD — Checkout & Select Mode
   ============================================= */

/* Check Out button in normal topbar */
.board-checkout-btn {
    background: var(--tangerine) !important;
    border-color: var(--tangerine-dark) !important;
    color: #fff !important;
    font-size: 0.85rem !important;
    font-weight: 700 !important;
    width: auto !important;
    padding: 0 14px !important;
    gap: 5px;
    white-space: nowrap;
}

    .board-checkout-btn:hover {
        background: var(--tangerine-dark) !important;
    }

/* Select-mode topbar variant */
.board-topbar--select {
    background: var(--midnight-dark);
    border-bottom: 3px solid var(--tangerine);
}

.board-select-all-btn {
    background: none;
    border: 1px solid rgba(250,246,234,0.3);
    color: rgba(250,246,234,0.75);
    border-radius: 6px;
    padding: 3px 10px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    white-space: nowrap;
    transition: all 0.12s ease;
}

    .board-select-all-btn:hover {
        background: rgba(255,255,255,0.1);
        color: var(--rice);
    }

/* Confirm checkout button */
.board-checkout-confirm-btn {
    background: var(--tangerine);
    color: #fff;
    border: none;
    border-radius: 10px;
    height: 40px;
    padding: 0 16px;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: background 0.12s ease;
}

    .board-checkout-confirm-btn:hover:not(.disabled) {
        background: var(--tangerine-dark);
    }

    .board-checkout-confirm-btn.disabled {
        opacity: 0.4;
        cursor: not-allowed;
    }

.btn-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    display: inline-block;
}

/* Checkout error banner */
.board-checkout-error {
    background: #c0392b;
    color: #fff;
    padding: 12px 20px;
    font-size: 0.9rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

    .board-checkout-error button {
        background: none;
        border: none;
        color: #fff;
        font-size: 1rem;
        cursor: pointer;
        padding: 0 4px;
        flex-shrink: 0;
    }

/* Selectable card states */
.board-card--selectable {
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    padding-left: 52px;
    position: relative;
}

.board-card--selected {
    border-left-color: var(--tangerine) !important;
    background: #fff8f5;
    box-shadow: 0 0 0 2px var(--tangerine), var(--shadow-sm);
}

/* Checkbox */
.board-card-checkbox {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    border-radius: 6px;
    border: 2px solid var(--rice-dark);
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 800;
    color: #fff;
    transition: all 0.12s ease;
    flex-shrink: 0;
}

    .board-card-checkbox.checked {
        background: var(--tangerine);
        border-color: var(--tangerine);
    }

/* Per-card checkout button (normal mode) */
.board-card-checkout-btn {
    margin-top: 6px;
    align-self: flex-start;
    background: none;
    border: 1.5px solid var(--rice-dark);
    border-radius: 8px;
    color: #888;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 5px 12px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.12s ease;
}

    .board-card-checkout-btn:hover {
        background: var(--tangerine);
        border-color: var(--tangerine);
        color: #fff;
    }