:root {
    --x3de-bg-base: #eff3f9;
    --x3de-bg-shell: #f7f9fc;
    --x3de-surface-1: #ffffff;
    --x3de-surface-2: #f4f7fc;
    --x3de-text-strong: #0f172a;
    --x3de-text-muted: #5b667a;
    --x3de-border-soft: #d7dfec;
    --x3de-border-strong: #c4d0e4;
    --x3de-accent: #0a84ff;
    --x3de-accent-soft: #e9f2ff;
    --x3de-success: #117f4f;
    --x3de-success-soft: #e8f8ef;
    --x3de-warning: #a35616;
    --x3de-warning-soft: #fff5ea;
    --x3de-danger: #b83b4e;
    --x3de-danger-soft: #fff1f3;
    --x3de-shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.06);
    --x3de-shadow-sm: 0 8px 18px rgba(15, 23, 42, 0.08);
    --x3de-shadow-md: 0 18px 34px rgba(15, 23, 42, 0.12);
    --x3de-radius-sm: 10px;
    --x3de-radius-md: 14px;
    --x3de-radius-lg: 18px;
    --x3de-radius-xl: 24px;
    --x3de-transition: 160ms ease;
}

.x3de-staff-login-block,
.x3de-staff-shell {
    max-width: 1120px;
    margin: 0 auto;
    padding: 20px;
    color: var(--x3de-text-strong);
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", Arial, sans-serif;
    line-height: 1.45;
    background:
        radial-gradient(120% 75% at 0% -10%, #ffffff 0%, rgba(255, 255, 255, 0) 62%),
        linear-gradient(180deg, var(--x3de-bg-shell) 0%, var(--x3de-bg-base) 100%);
    border: 1px solid var(--x3de-border-soft);
    border-radius: var(--x3de-radius-xl);
    box-shadow: var(--x3de-shadow-md);
}

.x3de-staff-shell {
    --x3de-shell-bottom-space: 168px;
    position: relative;
    overflow: visible;
}

.x3de-staff-shell.is-fullscreen-locked {
    overflow: hidden;
}

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

.x3de-staff-shell.is-fullscreen {
    position: fixed;
    inset: 0;
    z-index: 2147483645;
}

html.x3de-staff-fullscreen,
body.x3de-staff-fullscreen {
    height: 100%;
    overflow: hidden;
}

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

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

.x3de-fullscreen-gate {
    position: fixed;
    inset: 0;
    z-index: 2147483646;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(7, 12, 22, 0.78);
    backdrop-filter: blur(5px);
}

.x3de-fullscreen-gate[hidden] {
    display: none !important;
}

.x3de-fullscreen-gate-card {
    width: min(420px, 100%);
    display: grid;
    gap: 10px;
    padding: 18px;
    border: 1px solid #c9d7ee;
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 20px 42px rgba(7, 12, 22, 0.28);
    text-align: center;
}

.x3de-fullscreen-gate-card h3 {
    font-size: 20px;
}

.x3de-fullscreen-gate-card p {
    margin: 0;
    color: #42556f;
}

.x3de-fullscreen-gate-card .button {
    width: 100%;
    min-height: 46px;
}

.x3de-fullscreen-gate-error {
    font-size: 12px;
    color: #9b2f41;
}

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

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

.x3de-staff-shell h4 {
    font-size: 16px;
    font-weight: 640;
}

.x3de-staff-login-block form {
    display: grid;
    gap: 10px;
    max-width: 440px;
}

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

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

.x3de-staff-login-block .button,
.x3de-staff-shell .button {
    min-height: 42px;
    border-radius: var(--x3de-radius-sm);
    border: 1px solid var(--x3de-border-strong);
    background: #ffffff;
    color: #14233d;
    font-weight: 600;
    transition: border-color var(--x3de-transition), background var(--x3de-transition), box-shadow var(--x3de-transition), transform var(--x3de-transition);
}

.x3de-staff-login-block .button:hover,
.x3de-staff-shell .button:hover {
    border-color: #b4c4de;
    box-shadow: var(--x3de-shadow-sm);
}

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

.x3de-staff-login-block .button:focus-visible,
.x3de-staff-shell .button:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.22);
}

.x3de-staff-login-block .button.button-primary,
.x3de-staff-shell .button.button-primary {
    border-color: #0a6fd9;
    background: linear-gradient(180deg, #1f8fff 0%, #0a84ff 100%);
    color: #ffffff;
}

.x3de-staff-login-block .button.button-primary:hover,
.x3de-staff-shell .button.button-primary:hover {
    border-color: #0a64c3;
    background: linear-gradient(180deg, #2894ff 0%, #0a84ff 100%);
}

.x3de-staff-header {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 12px;
    padding-top: 10px;
    margin-bottom: 16px;
}

.x3de-staff-title {
    text-align: center;
    justify-self: center;
}

.x3de-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-self: end;
}

.x3de-staff-menu-btn.button {
    width: 44px;
    min-width: 44px;
    min-height: 44px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.x3de-staff-menu-icon {
    position: relative;
    display: block;
    width: 20px;
    height: 14px;
    margin: 0 auto;
}

.x3de-staff-menu-icon::before,
.x3de-staff-menu-icon::after {
    content: "";
    position: absolute;
    left: 0;
    width: 20px;
    height: 2px;
    border-radius: 999px;
    background: #1e2d44;
}

.x3de-staff-menu-icon::before {
    top: 3px;
}

.x3de-staff-menu-icon::after {
    bottom: 3px;
}

.x3de-header-actions .button.is-active {
    border-color: var(--x3de-accent);
    color: #0b5eba;
    background: var(--x3de-accent-soft);
}

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

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

.x3de-staff-notice-success {
    color: #11623d;
    border-color: #99e0b7;
    background: #eefdf4;
}

.x3de-staff-notice-error {
    color: #9b2f41;
    border-color: #f0b5be;
    background: #fff6f8;
}

.x3de-staff-drawer-backdrop {
    position: fixed;
    inset: 0;
    z-index: 39;
    background: rgba(11, 19, 33, 0.45);
}

.x3de-staff-drawer {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 40;
    width: min(320px, 86vw);
    display: grid;
    align-content: start;
    gap: 8px;
    padding: 92px 12px 18px;
    border-right: 1px solid #ced8ea;
    background: rgba(248, 251, 255, 0.96);
    backdrop-filter: blur(8px);
    box-shadow: 22px 0 34px rgba(16, 26, 44, 0.24);
    transform: translateX(calc(-100% - 16px));
    transition: transform 220ms ease;
}

.x3de-staff-drawer.is-open {
    transform: translateX(0);
}

.x3de-staff-drawer-close.button {
    position: absolute;
    top: 16px;
    right: 12px;
    width: 40px;
    min-width: 40px;
    min-height: 40px;
    padding: 0;
    font-size: 20px;
    line-height: 1;
}

.x3de-nav-btn {
    border: 1px solid transparent;
    border-radius: 12px;
    min-height: 48px;
    padding: 10px;
    font-size: 14px;
    font-weight: 640;
    color: #1b2940;
    background: transparent;
    cursor: pointer;
    transition: border-color var(--x3de-transition), background var(--x3de-transition), box-shadow var(--x3de-transition), transform var(--x3de-transition);
    text-align: left;
}

.x3de-nav-btn:hover {
    background: rgba(236, 242, 252, 0.82);
}

.x3de-nav-btn.is-active {
    border-color: #bfd5f4;
    background: linear-gradient(180deg, #f2f8ff 0%, #e8f2ff 100%);
    box-shadow: var(--x3de-shadow-sm);
    transform: translateY(-1px);
}

.x3de-nav-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.22);
}

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

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

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

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

.x3de-campers-layout {
    display: grid;
    grid-template-columns: minmax(300px, 360px) minmax(0, 1fr);
    gap: 14px;
}

.x3de-card {
    background: var(--x3de-surface-1);
    border: 1px solid var(--x3de-border-soft);
    border-radius: var(--x3de-radius-md);
    padding: 14px;
    box-shadow: var(--x3de-shadow-xs);
}

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

.x3de-staff-form {
    display: grid;
    gap: 11px;
}

.x3de-staff-form label,
.x3de-stats-filter label {
    display: grid;
    gap: 6px;
    font-size: 13px;
    color: #24344f;
}

.x3de-staff-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
}

.x3de-staff-checkbox input {
    width: auto;
}

.x3de-staff-filters {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr auto;
    gap: 8px;
    margin-bottom: 12px;
}

.x3de-ticket-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--x3de-border-soft);
    border-radius: 12px;
    background: #ffffff;
}

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

.x3de-ticket-table th,
.x3de-ticket-table td {
    border-bottom: 1px solid #e3eaf5;
    padding: 10px 9px;
    text-align: left;
    font-size: 13px;
}

.x3de-ticket-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    color: #35445c;
    background: linear-gradient(180deg, #f8fbff 0%, #eef3fb 100%);
    font-weight: 650;
}

.x3de-ticket-table tbody tr:hover td {
    background: #f9fbff;
}

.x3de-ticket-table tr.is-row-checked td {
    background: #f1fbf5;
}

.x3de-ticket-table tr.is-row-pending td {
    background: #fff4f6;
}

.x3de-status-pill {
    display: inline-block;
    padding: 4px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
}

.x3de-status-pill.is-checked {
    color: var(--x3de-success);
    border: 1px solid #a9e3c4;
    background: var(--x3de-success-soft);
}

.x3de-status-pill.is-pending {
    color: var(--x3de-danger);
    border: 1px solid #f3bcc5;
    background: var(--x3de-danger-soft);
}

.x3de-row-delete-form {
    margin: 0;
}

.x3de-delete-btn.button {
    min-height: 34px;
    padding: 6px 10px;
    border-color: #e4a5af;
    color: #9b2f41;
    background: #fff3f5;
}

.x3de-delete-btn.button:hover {
    border-color: #d88795;
    background: #ffe8ec;
}

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

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

.x3de-staff-stat-card {
    border: 1px solid var(--x3de-border-soft);
    border-radius: 14px;
    padding: 12px;
    background: #ffffff;
}

.x3de-staff-stat-card.is-total {
    background: linear-gradient(180deg, #f4f8ff 0%, #eaf1ff 100%);
}

.x3de-staff-stat-card.is-checked {
    background: linear-gradient(180deg, #edfdf4 0%, #e2f9ec 100%);
    border-color: #b9e7cf;
}

.x3de-staff-stat-card.is-pending {
    background: linear-gradient(180deg, #fff5f6 0%, #ffecee 100%);
    border-color: #f3c9cf;
}

.x3de-staff-stat-card.is-boys {
    background: linear-gradient(180deg, #eff7ff 0%, #e1efff 100%);
}

.x3de-staff-stat-card.is-girls {
    background: linear-gradient(180deg, #fff1f9 0%, #ffe8f5 100%);
}

.x3de-staff-stat-card.is-unknown {
    background: linear-gradient(180deg, #f8f8fb 0%, #eef0f7 100%);
}

.x3de-staff-stat-card h4 {
    margin: 0;
    font-size: 12px;
    color: #4a5a74;
}

.x3de-staff-stat-card p {
    margin: 8px 0 0;
    font-size: 26px;
    line-height: 1.08;
    letter-spacing: -0.02em;
    font-weight: 700;
}

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

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

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

@media (max-width: 767px) {
    .x3de-staff-login-block,
    .x3de-staff-shell {
        padding: 12px;
        border-radius: 16px;
    }

    .x3de-staff-header {
        grid-template-columns: auto 1fr;
        align-items: center;
        row-gap: 10px;
    }

    .x3de-header-actions {
        grid-column: 1 / -1;
        width: 100%;
        justify-self: stretch;
    }

    .x3de-header-actions .button {
        flex: 1;
    }

    .x3de-staff-title {
        grid-column: 2;
    }

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

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

    .x3de-ticket-table {
        min-width: 100%;
    }

    .x3de-ticket-table-wrap {
        border: 0;
        background: transparent;
    }

    .x3de-ticket-table {
        min-width: 0;
        display: block;
    }

    .x3de-ticket-table thead {
        display: none;
    }

    .x3de-ticket-table tbody {
        display: grid;
        gap: 10px;
    }

    .x3de-ticket-table tbody tr {
        display: grid;
        gap: 7px;
        padding: 10px;
        border: 1px solid var(--x3de-border-soft);
        border-radius: 12px;
    }

    .x3de-ticket-table tbody tr.is-row-checked {
        border-color: #a8dec4;
        background: #effaf4;
    }

    .x3de-ticket-table tbody tr.is-row-pending {
        border-color: #efc4cb;
        background: #fff2f4;
    }

    .x3de-ticket-table tbody tr > td[data-label] {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 12px;
        padding: 0;
        border-bottom: 0;
        font-size: 13px;
        text-align: right;
        background: transparent !important;
    }

    .x3de-ticket-table tbody tr > td[data-label]::before {
        content: attr(data-label);
        font-weight: 640;
        color: #4a5a74;
        text-align: left;
    }

    .x3de-ticket-table tbody tr > td[colspan] {
        padding: 10px;
        border: 1px dashed var(--x3de-border-strong);
        border-radius: 10px;
        background: #ffffff;
        font-size: 13px;
    }

    .x3de-col-actions {
        padding-top: 4px;
    }

    .x3de-col-actions .x3de-row-delete-form {
        margin-left: auto;
    }

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

    .x3de-staff-shell.is-fullscreen,
    .x3de-staff-shell:fullscreen,
    .x3de-staff-shell:-webkit-full-screen {
        --x3de-shell-bottom-space: 154px;
        border-radius: 0;
        padding: 12px 10px calc(var(--x3de-shell-bottom-space) + env(safe-area-inset-bottom));
    }
}
