:root {
    --b4kings-bg-base: #faf7f2;
    --b4kings-bg-shell: #ffffff;
    --b4kings-black: #0b0b0b;
    --b4kings-charcoal: #1a1a1a;
    --b4kings-surface-1: #ffffff;
    --b4kings-surface-2: #fffaf4;
    --b4kings-text-strong: #171717;
    --b4kings-text-muted: #675f57;
    --b4kings-border-soft: #e7ded2;
    --b4kings-border-strong: #d8cabc;
    --b4kings-accent: #f26a1b;
    --b4kings-accent-dark: #c74f0d;
    --b4kings-accent-soft: #fff1e8;
    --b4kings-success: #18a058;
    --b4kings-success-soft: #eaf8f0;
    --b4kings-warning: #f5a623;
    --b4kings-warning-soft: #fff6df;
    --b4kings-danger: #d93025;
    --b4kings-danger-soft: #fff0ef;
    --b4kings-shadow-xs: 0 1px 2px rgba(11, 11, 11, 0.06);
    --b4kings-shadow-sm: 0 8px 18px rgba(11, 11, 11, 0.08);
    --b4kings-shadow-md: 0 18px 34px rgba(11, 11, 11, 0.12);
    --b4kings-radius-sm: 8px;
    --b4kings-radius-md: 8px;
    --b4kings-radius-lg: 8px;
    --b4kings-radius-xl: 8px;
    --b4kings-transition: 160ms ease;
}

body.b4kings-staff-route {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 16px;
    box-sizing: border-box;
    background:
        linear-gradient(180deg, rgba(242, 106, 27, 0.08) 0%, rgba(242, 106, 27, 0) 34%),
        var(--b4kings-bg-base);
}

body.b4kings-staff-route * {
    box-sizing: border-box;
}

.b4kings-staff-login-block *,
.b4kings-staff-shell * {
    min-width: 0;
}

.b4kings-staff-login-block,
.b4kings-staff-shell {
    max-width: 1120px;
    width: min(100%, 1120px);
    margin: 0 auto;
    padding: 20px;
    color: var(--b4kings-text-strong);
    font-family: Inter, Manrope, "Segoe UI", Arial, sans-serif;
    line-height: 1.45;
    background: var(--b4kings-bg-shell);
    border: 1px solid var(--b4kings-border-soft);
    border-radius: 8px;
    box-shadow: var(--b4kings-shadow-md);
    overflow-wrap: anywhere;
}

.b4kings-staff-shell {
    position: relative;
    overflow: visible;
}

.b4kings-staff-shell::before {
    content: "";
    display: block;
    height: 5px;
    margin: -20px -20px 18px;
    border-radius: 8px 8px 0 0;
    background: linear-gradient(90deg, var(--b4kings-accent) 0%, var(--b4kings-black) 100%);
}

.b4kings-staff-shell.is-fullscreen,
.b4kings-staff-shell:fullscreen,
.b4kings-staff-shell:-webkit-full-screen {
    max-width: none;
    width: 100vw;
    height: 100dvh;
    margin: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    padding: 14px 14px calc(120px + env(safe-area-inset-bottom));
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    scrollbar-gutter: stable both-edges;
    background: var(--b4kings-black);
}

.b4kings-staff-shell.is-fullscreen::before,
.b4kings-staff-shell:fullscreen::before,
.b4kings-staff-shell:-webkit-full-screen::before {
    margin: -14px -14px 14px;
    border-radius: 0;
}

.b4kings-staff-shell.is-fullscreen .b4kings-staff-panel,
.b4kings-staff-shell:fullscreen .b4kings-staff-panel,
.b4kings-staff-shell:-webkit-full-screen .b4kings-staff-panel {
    margin-bottom: 8px;
}

.b4kings-staff-login-block h2,
.b4kings-staff-shell h2,
.b4kings-staff-shell h3,
.b4kings-staff-shell h4 {
    margin: 0;
    letter-spacing: 0;
}

.b4kings-staff-shell h2 {
    font-size: clamp(23px, 3.1vw, 30px);
    font-weight: 780;
}

.b4kings-staff-shell h3 {
    font-size: clamp(18px, 2.1vw, 22px);
    font-weight: 740;
}

.b4kings-staff-shell h4 {
    font-size: 16px;
    font-weight: 720;
}

.b4kings-staff-login-block form {
    display: grid;
    gap: 10px;
    width: min(100%, 440px);
}

.b4kings-staff-login-block .input,
.b4kings-staff-shell input[type="text"],
.b4kings-staff-shell input[type="search"],
.b4kings-staff-shell input[type="email"],
.b4kings-staff-shell input[type="number"],
.b4kings-staff-shell select {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    color: var(--b4kings-text-strong);
    border: 1px solid var(--b4kings-border-strong);
    border-radius: var(--b4kings-radius-sm);
    background: #ffffff;
    box-shadow: var(--b4kings-shadow-xs);
    transition: border-color var(--b4kings-transition), box-shadow var(--b4kings-transition), background var(--b4kings-transition);
}

.b4kings-staff-login-block .input:focus,
.b4kings-staff-shell input[type="text"]:focus,
.b4kings-staff-shell input[type="search"]:focus,
.b4kings-staff-shell input[type="email"]:focus,
.b4kings-staff-shell input[type="number"]:focus,
.b4kings-staff-shell select:focus {
    outline: none;
    border-color: var(--b4kings-accent);
    box-shadow: 0 0 0 3px rgba(242, 106, 27, 0.2);
}

.b4kings-staff-login-block .button,
.b4kings-staff-shell .button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    max-width: 100%;
    min-height: 42px;
    padding: 0 14px;
    border-radius: var(--b4kings-radius-sm);
    border: 1px solid var(--b4kings-border-strong);
    background: #ffffff;
    color: var(--b4kings-black);
    font-weight: 680;
    line-height: 1.2;
    text-align: center;
    white-space: normal;
    transition: border-color var(--b4kings-transition), background var(--b4kings-transition), box-shadow var(--b4kings-transition), transform var(--b4kings-transition);
}

.b4kings-staff-login-block .button:hover,
.b4kings-staff-shell .button:hover {
    border-color: var(--b4kings-accent);
    color: var(--b4kings-accent-dark);
    box-shadow: var(--b4kings-shadow-sm);
}

.b4kings-staff-login-block .button:active,
.b4kings-staff-shell .button:active {
    transform: translateY(1px);
}

.b4kings-staff-login-block .button:focus-visible,
.b4kings-staff-shell .button:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(242, 106, 27, 0.22);
}

.b4kings-staff-login-block .button.button-primary,
.b4kings-staff-shell .button.button-primary {
    border-color: var(--b4kings-accent-dark);
    background: var(--b4kings-accent);
    color: #ffffff;
}

.b4kings-staff-login-block .button.button-primary:hover,
.b4kings-staff-shell .button.button-primary:hover {
    border-color: var(--b4kings-black);
    background: var(--b4kings-accent-dark);
    color: #ffffff;
}

.b4kings-staff-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
    padding: 16px;
    border-radius: 8px;
    background: var(--b4kings-black);
    color: #ffffff;
    overflow: hidden;
}

.b4kings-staff-header > div:first-child {
    flex: 1 1 auto;
    min-width: 0;
}

.b4kings-staff-subtitle {
    margin: 6px 0 0;
    color: #f4e8dc;
    font-size: 14px;
}

.b4kings-header-actions {
    display: flex;
    align-items: center;
    flex: 0 1 auto;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.b4kings-header-actions .button.is-active {
    border-color: var(--b4kings-accent);
    color: #ffffff;
    background: var(--b4kings-accent);
}

.b4kings-staff-logout.button {
    background: #ffffff;
}

.b4kings-staff-notice {
    margin: 0 0 14px;
    padding: 12px;
    border-radius: var(--b4kings-radius-md);
    border: 1px solid transparent;
    font-size: 14px;
    font-weight: 650;
}

.b4kings-staff-notice-success {
    color: #0c6736;
    border-color: #9ddeba;
    background: var(--b4kings-success-soft);
}

.b4kings-staff-notice-error {
    color: #9f1f17;
    border-color: #f0aaa5;
    background: var(--b4kings-danger-soft);
}

.b4kings-fullscreen-gate {
    display: none;
    margin: 0 0 14px;
    padding: 18px;
    border: 1px solid #f1c6ab;
    border-radius: 8px;
    background: var(--b4kings-accent-soft);
    color: var(--b4kings-text-strong);
    box-shadow: var(--b4kings-shadow-sm);
}

.b4kings-fullscreen-gate,
.b4kings-fullscreen-gate h3,
.b4kings-fullscreen-gate p,
.b4kings-fullscreen-gate span,
.b4kings-fullscreen-gate div {
    color: var(--b4kings-text-strong) !important;
}

.b4kings-fullscreen-gate h3 {
    margin: 0 0 8px;
}

.b4kings-fullscreen-gate p {
    margin: 0 0 14px;
    color: var(--b4kings-text-muted) !important;
}

.b4kings-fullscreen-gate .button.button-primary {
    color: #ffffff !important;
}

.b4kings-staff-shell.is-scanner-only:not(.is-fullscreen-ready) .b4kings-fullscreen-gate {
    display: block;
}

.b4kings-staff-shell.is-scanner-only:not(.is-fullscreen-ready) .b4kings-staff-panel[data-panel="scanner"] {
    display: none;
}

.b4kings-staff-shell.is-scanner-only .b4kings-kiosk-drawer,
.b4kings-staff-shell.is-scanner-only .b4kings-kiosk-bottom-nav [data-role="manual-toggle"],
.b4kings-staff-shell.is-scanner-only .b4kings-kiosk-bottom-nav [data-role="code-toggle"] {
    display: none !important;
}

.b4kings-staff-shell.is-scanner-only .b4kings-staff-panel[data-panel="scanner"] {
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    overflow: visible;
}

.b4kings-staff-shell.is-scanner-only .b4kings-staff-panel[data-panel="scanner"] > h3,
.b4kings-staff-shell.is-scanner-only .b4kings-staff-panel[data-panel="scanner"] > .b4kings-panel-intro {
    display: none;
}

/* Scanner-only: the kiosk has its own brand header, so drop the duplicate
   page title/subtitle and keep just a slim action bar (Full Screen / Log out). */
.b4kings-staff-shell.is-scanner-only .b4kings-staff-header {
    padding: 10px 14px;
    margin-bottom: 12px;
}

.b4kings-staff-shell.is-scanner-only .b4kings-staff-header > div:first-child {
    display: none;
}

.b4kings-staff-shell.is-scanner-only .b4kings-header-actions {
    width: 100%;
    justify-content: flex-end;
}

/* Scanner-only fullscreen = one fixed screen, no page scrolling. Cap the camera
   height so the status/result panel and action buttons always stay on screen. */
.b4kings-staff-shell.is-scanner-only.is-fullscreen,
.b4kings-staff-shell.is-scanner-only:fullscreen,
.b4kings-staff-shell.is-scanner-only:-webkit-full-screen {
    overflow: hidden;
}

.b4kings-staff-shell.is-scanner-only.is-fullscreen .b4kings-kiosk-viewport,
.b4kings-staff-shell.is-scanner-only:fullscreen .b4kings-kiosk-viewport,
.b4kings-staff-shell.is-scanner-only:-webkit-full-screen .b4kings-kiosk-viewport {
    min-height: 0;
    max-height: 46vh;
}

.b4kings-staff-nav {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 14px;
    padding: 6px;
    border: 1px solid var(--b4kings-border-soft);
    border-radius: var(--b4kings-radius-lg);
    background: #ffffff;
    position: sticky;
    top: 10px;
    z-index: 25;
    box-shadow: var(--b4kings-shadow-xs);
    overflow: hidden;
}

.b4kings-nav-btn {
    border: 1px solid transparent;
    border-radius: 8px;
    min-height: 48px;
    padding: 10px;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.2;
    color: var(--b4kings-black);
    background: transparent;
    cursor: pointer;
    transition: border-color var(--b4kings-transition), background var(--b4kings-transition), box-shadow var(--b4kings-transition), transform var(--b4kings-transition);
}

.b4kings-nav-btn:hover {
    background: var(--b4kings-accent-soft);
}

.b4kings-nav-btn.is-active {
    border-color: var(--b4kings-accent);
    background: var(--b4kings-accent);
    color: #ffffff;
    box-shadow: var(--b4kings-shadow-sm);
    transform: translateY(-1px);
}

.b4kings-nav-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(242, 106, 27, 0.22);
}

.b4kings-staff-shell.is-js .b4kings-staff-panel {
    display: none;
}

.b4kings-staff-shell.is-js .b4kings-staff-panel.is-active {
    display: block;
}

.b4kings-staff-panel {
    background: var(--b4kings-surface-1);
    border: 1px solid var(--b4kings-border-soft);
    border-radius: 8px;
    padding: 16px;
    box-shadow: var(--b4kings-shadow-sm);
    overflow: hidden;
}

.b4kings-panel-intro {
    margin: 8px 0 14px;
    color: var(--b4kings-text-muted);
    font-size: 14px;
}

.b4kings-campers-layout {
    display: grid;
    grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
    gap: 14px;
    align-items: start;
}

.b4kings-card {
    background: var(--b4kings-surface-1);
    border: 1px solid var(--b4kings-border-soft);
    border-radius: 8px;
    padding: 14px;
    box-shadow: var(--b4kings-shadow-xs);
    overflow: hidden;
}

.b4kings-card h4 {
    margin-bottom: 12px;
}

.b4kings-staff-form {
    display: grid;
    gap: 12px;
}

.b4kings-staff-form label,
.b4kings-stats-filter label {
    display: grid;
    gap: 6px;
    font-size: 13px;
    color: var(--b4kings-charcoal);
    font-weight: 640;
}

.b4kings-staff-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    line-height: 1.35;
}

.b4kings-staff-checkbox input {
    flex: 0 0 auto;
    width: auto;
    margin-top: 2px;
}

.b4kings-staff-filters {
    display: grid;
    grid-template-columns: minmax(180px, 2fr) minmax(150px, 1fr) minmax(140px, 1fr) minmax(96px, auto);
    align-items: stretch;
    gap: 8px;
    margin-bottom: 12px;
}

.b4kings-ticket-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--b4kings-border-soft);
    border-radius: 8px;
    background: #ffffff;
    max-width: 100%;
}

.b4kings-ticket-table {
    width: 100%;
    min-width: 760px;
    border-collapse: separate;
    border-spacing: 0;
}

.b4kings-ticket-table th,
.b4kings-ticket-table td {
    border-bottom: 1px solid #eee5da;
    padding: 10px 9px;
    text-align: left;
    font-size: 13px;
    overflow-wrap: anywhere;
}

.b4kings-ticket-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    color: #ffffff;
    background: var(--b4kings-black);
    font-weight: 700;
    white-space: nowrap;
}

.b4kings-ticket-table tbody tr:hover td {
    background: var(--b4kings-accent-soft);
}

.b4kings-ticket-table tr.is-row-checked td {
    background: var(--b4kings-success-soft);
}

.b4kings-ticket-table tr.is-row-pending td {
    background: var(--b4kings-warning-soft);
}

.b4kings-status-pill {
    display: inline-block;
    max-width: 100%;
    padding: 4px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    line-height: 1.2;
    white-space: normal;
}

.b4kings-status-pill.is-checked {
    color: #0c6736;
    border: 1px solid #9ddeba;
    background: var(--b4kings-success-soft);
}

.b4kings-status-pill.is-pending {
    color: #8a5700;
    border: 1px solid #f0cf82;
    background: var(--b4kings-warning-soft);
}

.b4kings-stats-filter {
    display: flex;
    align-items: end;
    flex-wrap: wrap;
    gap: 9px;
    margin: 0 0 14px;
}

.b4kings-stats-filter label {
    flex: 1 1 220px;
}

.b4kings-staff-stats-grid {
    margin: 0 0 14px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 165px), 1fr));
    gap: 10px;
}

.b4kings-staff-stat-card {
    border: 1px solid var(--b4kings-border-soft);
    border-radius: 8px;
    padding: 13px;
    background: #ffffff;
    overflow: hidden;
}

.b4kings-staff-stat-card.is-total {
    border-color: #f1c6ab;
    background: var(--b4kings-accent-soft);
}

.b4kings-staff-stat-card.is-checked {
    background: var(--b4kings-success-soft);
    border-color: #b9e7cf;
}

.b4kings-staff-stat-card.is-pending {
    background: var(--b4kings-warning-soft);
    border-color: #f0cf82;
}

.b4kings-staff-stat-card.is-boys,
.b4kings-staff-stat-card.is-girls,
.b4kings-staff-stat-card.is-unknown {
    background: #fffdf9;
}

.b4kings-staff-stat-card h4 {
    margin: 0;
    font-size: 12px;
    color: var(--b4kings-text-muted);
    overflow-wrap: anywhere;
}

.b4kings-staff-stat-card p {
    margin: 8px 0 0;
    font-size: 26px;
    line-height: 1.08;
    letter-spacing: 0;
    font-weight: 780;
    color: var(--b4kings-black);
}

.b4kings-age-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.b4kings-age-list span {
    display: inline-block;
    border: 1px solid var(--b4kings-border-strong);
    background: var(--b4kings-surface-2);
    border-radius: 999px;
    padding: 6px 11px;
    font-size: 12px;
    color: var(--b4kings-charcoal);
    overflow-wrap: anywhere;
}

@media (max-width: 980px) {
    .b4kings-campers-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 767px) {
    body.b4kings-staff-route {
        padding: 0;
    }

    .b4kings-staff-login-block,
    .b4kings-staff-shell {
        padding: 12px;
        border-radius: 0;
        min-height: 100dvh;
        border: 0;
    }

    .b4kings-staff-shell::before {
        margin: -12px -12px 14px;
        border-radius: 0;
    }

    .b4kings-staff-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        padding: 14px;
    }

    .b4kings-header-actions {
        width: 100%;
        justify-content: stretch;
    }

    .b4kings-header-actions .button {
        flex: 1;
        min-width: 0;
    }

    .b4kings-staff-nav {
        grid-template-columns: 1fr;
    }

    .b4kings-staff-filters {
        grid-template-columns: 1fr;
    }

    .b4kings-ticket-table-wrap {
        overflow-x: visible;
    }

    .b4kings-ticket-table {
        min-width: 100%;
        table-layout: fixed;
    }

    .b4kings-ticket-table .b4kings-col-shortcode,
    .b4kings-ticket-table .b4kings-col-source,
    .b4kings-ticket-table .b4kings-col-gender {
        display: none;
    }

    .b4kings-ticket-table th,
    .b4kings-ticket-table td {
        padding: 8px 7px;
        font-size: 12px;
        white-space: normal;
    }

    .b4kings-staff-form button.button,
    .b4kings-stats-filter button.button,
    .b4kings-staff-filters button.button {
        width: 100%;
        min-height: 44px;
    }

    .b4kings-staff-shell.is-fullscreen,
    .b4kings-staff-shell:fullscreen,
    .b4kings-staff-shell:-webkit-full-screen {
        border-radius: 0;
        padding: 12px 8px calc(112px + env(safe-area-inset-bottom));
    }

    .b4kings-staff-shell.is-scanner-only.is-fullscreen,
    .b4kings-staff-shell.is-scanner-only:fullscreen,
    .b4kings-staff-shell.is-scanner-only:-webkit-full-screen {
        padding-left: 0;
        padding-right: 0;
    }
}

/* Custom Staff Portal Aesthetics */
.b4kings-nav-btn {
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.b4kings-nav-btn:hover {
    background: var(--b4kings-accent-soft);
    transform: translateY(-1px);
}

.b4kings-nav-btn.is-active {
    box-shadow: 0 4px 12px rgba(242, 106, 27, 0.25);
}

.b4kings-card,
.b4kings-staff-stat-card {
    transition: all 0.22s ease;
}

.b4kings-card:hover {
    box-shadow: var(--b4kings-shadow-sm);
    border-color: var(--b4kings-border-strong);
}

.b4kings-staff-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--b4kings-shadow-sm);
}

.b4kings-staff-stat-card.is-total {
    border-left: 4px solid var(--b4kings-accent);
}
.b4kings-staff-stat-card.is-checked {
    border-left: 4px solid var(--b4kings-success);
}
.b4kings-staff-stat-card.is-pending {
    border-left: 4px solid var(--b4kings-warning);
}

