/* ===== Admin Sidebar Layout ===== */
.admin-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    min-height: calc(100vh - 60px);
    background: var(--bg-secondary);
}

.admin-sidebar {
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    padding: 1.25rem 0;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 60px;
    height: calc(100vh - 60px);
    overflow-y: auto;
    align-self: start;
}

.admin-sidebar-section {
    padding: 0 0.75rem;
    margin-bottom: 1.5rem;
}

/* Sidebar navigation group (3 groups: Event Setup, Check-in, Payments) */
.admin-sidebar-group {
    padding: 0 0.75rem;
    margin-bottom: 1rem;
}

.admin-sidebar-group-label {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    padding: 0 0.75rem;
    margin-bottom: 0.35rem;
    opacity: 0.7;
}

.admin-sidebar-group .admin-sidebar-item {
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
}

.admin-sidebar-heading {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    padding: 0 0.75rem;
    margin-bottom: 0.5rem;
}

.admin-sidebar-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.88rem;
    cursor: pointer;
    border-radius: var(--radius-sm);
    border-left: 3px solid transparent;
    transition: all 0.15s ease;
    text-align: left;
}

.admin-sidebar-item:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
}

.admin-sidebar-item.active {
    background: rgba(255, 92, 57, 0.08);
    color: var(--accent);
    border-left-color: var(--accent);
    font-weight: 600;
}

.admin-sidebar-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.admin-sidebar-icon svg {
    width: 100%;
    height: 100%;
}

.admin-sidebar-kbd {
    font-size: 0.65rem;
    color: var(--text-muted, #888);
    background: var(--bg-primary, #0d0d1a);
    padding: 0.1rem 0.3rem;
    border-radius: 0.2rem;
    border: 1px solid var(--border, rgba(255, 255, 255, 0.08));
    margin-left: auto;
    font-family: monospace;
    opacity: 0;
    transition: opacity 0.15s ease;
}
.admin-sidebar-item:hover .admin-sidebar-kbd,
.admin-sidebar-item.active .admin-sidebar-kbd {
    opacity: 1;
}

/* External link variant (e.g. "View Google Sheet") — anchors look like sidebar
   items but navigate to an external URL in a new tab. The ↗ marker replaces
   the keyboard-shortcut badge and is always visible (external nav should be
   discoverable, not hidden behind hover). */
.admin-sidebar-link-external {
    text-decoration: none;
    color: var(--text-secondary);
}

.admin-sidebar-link-external:hover {
    color: var(--accent);
}

.admin-sidebar-external-arrow {
    margin-left: auto;
    font-size: 0.75rem;
    color: var(--text-muted, #888);
    opacity: 0.7;
    transition: opacity 0.15s ease;
}

.admin-sidebar-link-external:hover .admin-sidebar-external-arrow {
    opacity: 1;
    color: var(--accent);
}

.admin-sidebar-stats {
    margin-top: auto;
    padding: 1rem 1rem 0.5rem;
    border-top: 1px solid var(--border);
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
}

.admin-sidebar-stat {
    text-align: center;
}

.admin-sidebar-stat-value {
    display: block;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.admin-sidebar-stat-label {
    display: block;
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-top: 2px;
}

.admin-sidebar-stats-empty {
    text-align: center;
    color: var(--text-muted, #888);
    font-size: 0.75rem;
    padding: 0.75rem;
    grid-column: 1 / -1;
}

.admin-content {
    padding: 1.25rem;
    max-width: 100%;
    overflow-x: hidden;
    background: var(--bg-primary);
}

/* ===== Admin sidebar: Home quick-nav ===== */
.admin-sidebar-topnav {
    padding: 0 0.5rem;
    margin-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.75rem;
}

.admin-sidebar-home {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    width: 100%;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.02);
    transition:
        background 0.15s ease,
        color 0.15s ease;
}

.admin-sidebar-home:hover {
    background: rgba(255, 92, 57, 0.08);
    color: var(--accent);
}

/* ===== Admin deposit: refund flow hint ===== */
.admin-dep-flow-hint {
    font-size: 0.78rem;
    color: var(--text-muted, #888);
    margin: 0.35rem 0 0;
    line-height: 1.4;
}

.admin-dep-flow-hint strong {
    color: var(--text-secondary);
    font-weight: 600;
}

/* Mobile: stack sidebar into horizontal nav */
@media (max-width: 767px) {
    .admin-layout {
        grid-template-columns: 1fr;
    }

    .admin-content {
        padding: 0.75rem;
    }

    .admin-sidebar {
        position: static;
        height: auto;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        padding: 0.75rem;
        gap: 0.5rem;
        border-right: none;
        border-bottom: 1px solid var(--border);
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }

    .admin-sidebar-section {
        margin-bottom: 0;
        display: flex;
        align-items: center;
        gap: 0.5rem;
        padding: 0;
    }

    .admin-sidebar-heading {
        display: none;
    }

    .admin-sidebar-group {
        display: flex;
        align-items: center;
        gap: 0.25rem;
        padding: 0;
        margin-bottom: 0;
    }

    .admin-sidebar-group-label {
        display: none;
    }

    .admin-sidebar-item {
        white-space: nowrap;
        padding: 0.4rem 0.75rem;
        border-left: none;
        border-bottom: 2px solid transparent;
        border-radius: var(--radius-sm);
        font-size: 0.82rem;
    }

    .admin-sidebar-item.active {
        border-left-color: transparent;
        border-bottom-color: var(--accent);
    }

    .admin-sidebar-stats {
        display: none;
    }

    /* Mobile: give the event selector its own full-width row at the top of
       the sidebar, clearly separated from the horizontal nav below. Targets
       the new searchable component root (.admin-evt-selector) rather than the
       legacy wrapper. */
    .admin-sidebar-section:has(.admin-evt-selector) {
        flex-basis: 100%;
        order: -1;
        padding: 0.5rem 0;
        margin-bottom: 0.25rem;
        border-bottom: 1px solid var(--border);
    }

    .admin-evt-selector {
        width: 100%;
        min-width: 0;
    }

    /* Home quick-nav also gets a full-width row on mobile, above the event
       selector (both have order: -1; the home link's section is first in DOM
       so it appears at the very top). */
    .admin-sidebar-topnav {
        flex-basis: 100%;
        order: -2;
        padding: 0 0 0.5rem;
        margin-bottom: 0;
        border-bottom: 1px solid var(--border);
    }

    .admin-sidebar-kbd {
        display: none;
    }
}

/* ===== Admin Inline Style Classes ===== */
.admin-stat-value-success {
    color: var(--success);
}

.admin-stat-value-warning {
    color: var(--warning);
}

.admin-actions-row {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.admin-force-regen-row {
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.admin-force-regen-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ===== Admin event selector — searchable combobox =====
   Custom dropdown replacing the native <select>. Supports text filtering,
   smart sort (active+upcoming first), and per-event relative date hints.
   See src/pages/admin_event_selector.rs for the component logic. */
.admin-evt-selector {
    position: relative;
    width: 100%;
}

.admin-evt-trigger {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.5rem 0.7rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.85rem;
    cursor: pointer;
    text-align: left;
    transition:
        border-color 0.15s ease,
        box-shadow 0.15s ease;
    min-width: 0;
}

.admin-evt-trigger:hover {
    border-color: var(--border-hover);
    background: var(--bg-hover);
}

.admin-evt-selector.open .admin-evt-trigger {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-bg);
}

.admin-evt-badge {
    flex-shrink: 0;
    font-size: 0.7rem;
    line-height: 1;
}

.admin-evt-status-active {
    color: var(--success-bright);
}
.admin-evt-status-draft {
    color: var(--text-muted);
}
.admin-evt-status-done {
    color: var(--info-bright);
}
.admin-evt-status-archived {
    color: var(--text-muted);
}

.admin-evt-label {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}

.admin-evt-name {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-primary);
}

.admin-evt-hint {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 1px;
}

.admin-evt-placeholder {
    color: var(--text-muted);
    font-style: italic;
    flex: 1;
}

.admin-evt-chevron {
    flex-shrink: 0;
    width: 14px;
    height: 14px;
    color: var(--text-muted);
    transition: transform 0.15s ease;
}

.admin-evt-selector.open .admin-evt-chevron {
    transform: rotate(180deg);
}

/* Backdrop: fixed full-viewport, sits above everything except the panel. */
.admin-evt-backdrop {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: transparent;
}

/* Dropdown panel: absolutely positioned under the trigger.
   The panel can grow WIDER than the trigger (like a native <select>) so long
   event names remain readable without truncation. `min-width: 100%` keeps it
   at least as wide as the trigger; `width: max-content` lets it fit the longest
   item; `max-width` caps it so it never overflows the viewport on narrow screens.
   `right: 0` is intentionally omitted — pinning both left+right would force the
   panel back to the trigger's width and re-truncate the names. */
.admin-evt-panel {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    min-width: 100%;
    width: max-content;
    max-width: min(440px, calc(100vw - 2rem));
    z-index: 101;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow:
        0 10px 25px rgba(0, 0, 0, 0.5),
        0 4px 6px rgba(0, 0, 0, 0.3);
    max-height: 60vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.admin-evt-search {
    position: relative;
    padding: 0.5rem;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.admin-evt-search-icon {
    position: absolute;
    left: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    width: 14px;
    height: 14px;
    color: var(--text-muted);
    pointer-events: none;
}

.admin-evt-search-input {
    width: 100%;
    padding: 0.4rem 0.6rem 0.4rem 1.9rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.admin-evt-search-input::placeholder {
    color: var(--text-muted);
}

.admin-evt-search-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-bg);
}

.admin-evt-list {
    overflow-y: auto;
    flex: 1;
    padding: 0.25rem;
}

.admin-evt-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.5rem 0.6rem;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    text-align: left;
    color: var(--text-primary);
    transition: background 0.1s ease;
}

.admin-evt-item:hover,
.admin-evt-item:focus-visible {
    background: var(--bg-hover);
}

.admin-evt-item.selected {
    background: var(--accent-bg);
}

.admin-evt-item-label {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}

.admin-evt-item-name {
    font-size: 0.84rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.admin-evt-item-hint {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 1px;
}

.admin-evt-check {
    flex-shrink: 0;
    width: 14px;
    height: 14px;
    color: var(--accent);
}

.admin-evt-empty {
    padding: 1rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.82rem;
    font-style: italic;
}

.admin-count-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.admin-count-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.admin-empty-state {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
}

.admin-load-more {
    text-align: center;
    padding: 1rem 0 1.5rem;
}

.admin-load-more .btn {
    min-width: 200px;
}

.admin-empty-state-sm {
    text-align: center;
    padding: 1.5rem;
    color: var(--text-muted);
}

/* .admin-ticket-row removed — replaced by .admin-ticket-tag in card layout */
/* .admin-time-ago (block) removed — replaced by .admin-time-ago-inline */

.admin-cross-tab-summary {
    text-align: center;
    margin: 0.5rem 0;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.admin-tab-switch-link {
    cursor: pointer;
    text-decoration: underline;
}

.admin-progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.admin-progress-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}

.admin-progress-pct {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.admin-qr-result-card {
    border-color: rgba(34, 197, 94, 0.4);
    background: rgba(34, 197, 94, 0.05);
}

.admin-qr-result-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.admin-qr-result-title {
    font-weight: 600;
    color: var(--text-primary);
}

.admin-qr-stats-row {
    display: flex;
    gap: 1rem;
}

.admin-qr-count-success {
    font-weight: 600;
    color: var(--success);
}

.admin-qr-count-warning {
    font-weight: 600;
    color: var(--warning);
}

.admin-qr-count-label {
    color: var(--text-secondary);
}

.admin-section-heading {
    margin-bottom: 0.75rem;
}

.admin-recent-email {
    font-size: 0.8rem;
}

.admin-badge-inline {
    font-size: 0.7rem;
    margin-bottom: 4px;
    display: inline-block;
}

.admin-checkin-time {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

@keyframes ring-pulse {
    0% {
        transform: scale(0.85);
        opacity: 1;
    }
    100% {
        transform: scale(1.3);
        opacity: 0;
    }
}

/* ===== Landing Waitlist Responsive ===== */
@media (max-width: 480px) {
    .landing-footer-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== Landing Nav — Hamburger Menu (Mobile) ===== */
.landing-nav-hamburger {
    display: none;
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-secondary);
    padding: 0.4rem;
    cursor: pointer;
    transition:
        color 0.2s,
        border-color 0.2s;
    align-items: center;
    justify-content: center;
}

.landing-nav-hamburger:hover {
    color: var(--text-heading);
    border-color: var(--text-secondary);
}

.landing-nav-mobile-menu {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0.5rem 1.5rem 1rem;
    border-top: 1px solid var(--border);
    background: rgba(15, 15, 15, 0.95);
}

.landing-nav-mobile-menu a {
    display: block;
    padding: 0.65rem 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-bottom: 1px solid var(--border);
    transition: color 0.2s;
}

.landing-nav-mobile-menu a:last-child {
    border-bottom: none;
}

.landing-nav-mobile-menu a:hover {
    color: var(--text-heading);
}

@media (max-width: 767px) {
    .landing-nav-links {
        display: none;
    }
    .landing-nav-actions {
        display: none;
    }
    .landing-nav-hamburger {
        display: flex;
    }
}

