/* ============================================================
   ADMIN DASHBOARD — CSS
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&family=Montserrat:ital,wght@0,700;0,800;0,900;1,900&display=swap');

:root {
    --bg: #0b0d10;
    --bg-sidebar: #0f1117;
    --surface: rgba(255,255,255,0.04);
    --surface-hover: rgba(255,255,255,0.07);
    --surface-alt: rgba(255,255,255,0.025);
    --ink: #ffffff;
    --ink-secondary: rgba(255,255,255,0.7);
    --muted: #6b7280;
    --line: rgba(255,255,255,0.08);
    --line-strong: rgba(255,255,255,0.12);
    --accent: #f39818;
    --accent-deep: #bf1732;
    --accent-glow: rgba(243,152,24,0.15);
    --success: #22c55e;
    --danger: #ef4444;
    --warning: #f59e0b;
    --sidebar-w: 260px;
    --topbar-h: 64px;
    --radius: 12px;
    --radius-sm: 8px;
}

*{box-sizing:border-box;margin:0;padding:0}
html{height:100%}

body {
    background: var(--bg);
    color: var(--ink);
    font-family: 'Inter', system-ui, sans-serif;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* ============================================================
   ADMIN LAYOUT — sidebar + main
   ============================================================ */

.admin-layout {
    display: flex;
    min-height: 100vh;
}

.admin-main {
    flex: 1;
    margin-left: var(--sidebar-w);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.admin-content {
    flex: 1;
    padding: 32px 36px;
}

/* ============================================================
   SIDEBAR
   ============================================================ */

.sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: var(--sidebar-w);
    background: var(--bg-sidebar);
    border-right: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: transform 0.3s cubic-bezier(.4,0,.2,1);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 24px 22px 20px;
    border-bottom: 1px solid var(--line);
    text-decoration: none;
    color: #fff;
}

.sidebar-brand__logo {
    width: 40px; height: 40px;
    overflow: hidden;
    position: relative;
    flex-shrink: 0;
}

.sidebar-brand__logo img {
    display: block;
    width: 150%; height: 150%;
    max-width: none;
    position: absolute;
    top: 0; left: 0;
    transform: translate(-16%,-23%);
}

.sidebar-brand__text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sidebar-brand__name {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.8rem;
    font-weight: 900;
    font-style: italic;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.sidebar-brand__sub {
    font-size: 0.65rem;
    color: var(--muted);
    font-weight: 500;
    letter-spacing: 0.03em;
}

/* Sidebar Navigation */
.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow-y: auto;
}

.sidebar-label {
    font-size: 0.6rem;
    font-weight: 700;
    color: var(--muted);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 12px 14px 6px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    color: var(--ink-secondary);
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 500;
    transition: all 0.2s ease;
    position: relative;
}

.sidebar-link svg {
    width: 20px; height: 20px;
    flex-shrink: 0;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.sidebar-link:hover {
    background: var(--surface-hover);
    color: #fff;
}

.sidebar-link.active {
    background: linear-gradient(135deg, rgba(243,152,24,0.12), rgba(191,23,50,0.08));
    color: #fff;
    font-weight: 600;
}

.sidebar-link.active::before {
    content: '';
    position: absolute;
    left: 0; top: 6px; bottom: 6px;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: linear-gradient(180deg, var(--accent), var(--accent-deep));
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 16px 12px;
    border-top: 1px solid var(--line);
}

.sidebar-link--logout {
    color: var(--danger) !important;
}

.sidebar-link--logout:hover {
    background: rgba(239,68,68,0.08);
}

/* Sidebar overlay for mobile */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 999;
    backdrop-filter: blur(4px);
}

.sidebar-overlay.active { display: block; }

/* ============================================================
   TOPBAR
   ============================================================ */

.topbar {
    height: var(--topbar-h);
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 36px;
    background: rgba(11,13,16,0.8);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    position: sticky;
    top: 0;
    z-index: 100;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.hamburger {
    display: none;
    background: none;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    color: #fff;
    padding: 8px;
    cursor: pointer;
    transition: 0.2s;
}

.hamburger:hover { background: var(--surface-hover); }

.hamburger svg {
    width: 20px; height: 20px;
    stroke: currentColor; fill: none;
    stroke-width: 2; stroke-linecap: round;
}

.topbar-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #fff;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.topbar-date {
    font-size: 0.75rem;
    color: var(--muted);
    font-weight: 500;
}

.topbar-avatar {
    width: 34px; height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-deep), var(--accent));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: 0.04em;
}

/* ============================================================
   PAGE HEADER
   ============================================================ */

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 28px;
    flex-wrap: wrap;
}

.page-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    color: #fff;
}

.page-title span {
    color: var(--accent);
}

/* ============================================================
   DASHBOARD STAT CARDS
   ============================================================ */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4,1fr);
    gap: 20px;
    margin-bottom: 36px;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 24px;
    position: relative;
    overflow: hidden;
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    border-radius: var(--radius) var(--radius) 0 0;
}

.stat-card--total::before    { background: linear-gradient(90deg, var(--accent-deep), var(--accent)); }
.stat-card--7k::before       { background: linear-gradient(90deg, #6366f1, #8b5cf6); }
.stat-card--9k::before        { background: linear-gradient(90deg, #06b6d4, #22d3ee); }
.stat-card--pending::before   { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.stat-card--verified::before  { background: linear-gradient(90deg, #22c55e, #4ade80); }
.stat-card--rejected::before  { background: linear-gradient(90deg, #ef4444, #f87171); }

.stat-card:hover {
    border-color: rgba(255,255,255,0.15);
    transform: translateY(-3px);
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}

.stat-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.stat-card__icon {
    width: 42px; height: 42px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-card__icon svg {
    width: 22px; height: 22px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.stat-card--total .stat-card__icon    { background: rgba(243,152,24,0.12); color: var(--accent); }
.stat-card--7k .stat-card__icon       { background: rgba(99,102,241,0.12); color: #818cf8; }
.stat-card--9k .stat-card__icon       { background: rgba(6,182,212,0.12); color: #22d3ee; }
.stat-card--pending .stat-card__icon  { background: rgba(245,158,11,0.12); color: #fbbf24; }
.stat-card--verified .stat-card__icon { background: rgba(34,197,94,0.12); color: #4ade80; }
.stat-card--rejected .stat-card__icon { background: rgba(239,68,68,0.12); color: #f87171; }

.stat-card__value {
    font-family: 'Montserrat', sans-serif;
    font-size: 2rem;
    font-weight: 900;
    color: #fff;
    line-height: 1;
    margin-bottom: 6px;
}

.stat-card__label {
    font-size: 0.75rem;
    color: var(--muted);
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

/* ============================================================
   SECTION CARD (wraps tables, etc.)
   ============================================================ */

.section-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
}

.section-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--line);
}

.section-card__title {
    font-size: 0.92rem;
    font-weight: 700;
    color: #fff;
}

/* ============================================================
   TABLE
   ============================================================ */

.admin-table-wrap {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: auto;
}

.admin-table {
    border-collapse: collapse;
    min-width: 900px;
    width: 100%;
}

.admin-table thead {
    background: rgba(255,255,255,0.025);
}

.admin-table th {
    border-bottom: 1px solid var(--line-strong);
    color: var(--muted);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    padding: 14px 16px;
    text-align: left;
    text-transform: uppercase;
    white-space: nowrap;
}

.admin-table td {
    border-bottom: 1px solid var(--line);
    color: var(--ink-secondary);
    font-size: 0.85rem;
    padding: 14px 16px;
}

.admin-table tbody tr {
    transition: background 0.15s;
}

.admin-table tbody tr:hover {
    background: rgba(255,255,255,0.03);
}

.admin-table tbody tr:last-child td {
    border-bottom: none;
}

/* ============================================================
   BADGES
   ============================================================ */

.badge {
    display: inline-flex;
    align-items: center;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    padding: 5px 10px;
    border-radius: 6px;
    text-transform: uppercase;
}

.badge--pending  { background: rgba(245,158,11,0.12); color: #fbbf24; }
.badge--verified { background: rgba(34,197,94,0.12);  color: #4ade80; }
.badge--rejected { background: rgba(239,68,68,0.12);  color: #f87171; }

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

.admin-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
    background: var(--surface);
    color: #fff;
    font-family: 'Inter', sans-serif;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-decoration: none;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.admin-btn:hover {
    background: var(--surface-hover);
    border-color: rgba(255,255,255,0.2);
}

.admin-btn--verify {
    background: rgba(34,197,94,0.1);
    border-color: rgba(34,197,94,0.2);
    color: #4ade80;
}
.admin-btn--verify:hover {
    background: rgba(34,197,94,0.18);
}

.admin-btn--reject {
    background: rgba(239,68,68,0.1);
    border-color: rgba(239,68,68,0.2);
    color: #f87171;
}
.admin-btn--reject:hover {
    background: rgba(239,68,68,0.18);
}

.admin-btn--primary {
    background: linear-gradient(135deg, var(--accent-deep), #d41e3c);
    border: none;
    box-shadow: 0 2px 12px rgba(191,23,50,0.25);
}
.admin-btn--primary:hover {
    box-shadow: 0 4px 20px rgba(191,23,50,0.4);
    transform: translateY(-1px);
}

.admin-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* Filter Tabs */
.filter-tabs {
    display: flex;
    gap: 4px;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 4px;
}

.filter-tab {
    padding: 8px 18px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--muted);
    text-decoration: none;
    transition: all 0.2s ease;
}

.filter-tab:hover {
    color: #fff;
    background: var(--surface-hover);
}

.filter-tab.active {
    background: rgba(243,152,24,0.12);
    color: var(--accent);
}

.filter-tab--verified.active {
    background: rgba(34,197,94,0.12);
    color: #4ade80;
}

.filter-tab--rejected.active {
    background: rgba(239,68,68,0.12);
    color: #f87171;
}

/* ============================================================
   FOOTER
   ============================================================ */

.admin-footer {
    padding: 20px 36px;
    text-align: center;
    color: var(--muted);
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    border-top: 1px solid var(--line);
}

/* ============================================================
   LOGIN PAGE (preserved & polished)
   ============================================================ */

.login-bg {
    background:
        radial-gradient(ellipse 80% 60% at 50% 0%, rgba(191,23,50,0.12) 0%, transparent 60%),
        radial-gradient(ellipse 60% 50% at 80% 100%, rgba(243,152,24,0.08) 0%, transparent 50%),
        var(--bg);
    display: flex;
    flex: 1;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 40px 20px;
    min-height: 100vh;
    position: relative;
    overflow: hidden;
}

.login-bg::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
    background-size: 60px 60px;
    pointer-events: none;
}

.login-bg::after {
    content: '';
    position: absolute;
    width: 500px; height: 500px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(191,23,50,0.06) 0%, transparent 70%);
    top: 50%; left: 50%;
    transform: translate(-50%,-50%);
    animation: orbPulse 6s ease-in-out infinite;
    pointer-events: none;
}

@keyframes orbPulse {
    0%,100% { transform: translate(-50%,-50%) scale(1); opacity:.6 }
    50% { transform: translate(-50%,-50%) scale(1.15); opacity:1 }
}

.login-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    margin-bottom: 40px;
    position: relative;
    z-index: 1;
    animation: fadeDown .8s cubic-bezier(.2,.9,.25,1) both;
}

.login-brand__logo {
    width: 56px; height: 56px;
    overflow: hidden;
    position: relative;
}

.login-brand__logo img {
    display: block;
    width: 150%; height: 150%;
    max-width: none;
    position: absolute;
    top: 0; left: 0;
    transform: translate(-16%,-23%);
}

.login-brand__name {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.1rem;
    font-weight: 900;
    font-style: italic;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #fff;
}

.login-brand__sub {
    color: var(--muted);
    font-size: .82rem;
    font-weight: 500;
    letter-spacing: .02em;
}

.login-card {
    background: rgba(255,255,255,0.03);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    max-width: 420px;
    padding: 40px 36px 36px;
    position: relative;
    width: 100%;
    z-index: 1;
    animation: fadeUp .8s cubic-bezier(.2,.9,.25,1) .15s both;
}

.login-card__accent {
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    border-radius: var(--radius) var(--radius) 0 0;
    background: linear-gradient(90deg, var(--accent-deep), var(--accent));
}

.login-card__title {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: .02em;
    margin-bottom: 6px;
}

.login-card__desc {
    color: var(--muted);
    font-size: .85rem;
    line-height: 1.5;
    margin-bottom: 30px;
}

.login-field { margin-bottom: 20px; }

.login-label {
    color: rgba(255,255,255,0.7);
    display: block;
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .1em;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.login-input-wrap { position: relative; }

.login-input {
    appearance: none;
    background: var(--surface);
    border: 1.5px solid var(--line);
    border-radius: var(--radius-sm);
    color: #fff;
    font-family: 'Inter', sans-serif;
    font-size: .92rem;
    outline: none;
    padding: 14px 16px;
    transition: border-color .25s ease, box-shadow .25s ease, background .25s ease;
    width: 100%;
}

.login-input::placeholder { color: rgba(255,255,255,0.25); }

.login-input:focus {
    background: var(--surface-hover);
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.login-btn {
    align-items: center;
    background: linear-gradient(135deg, var(--accent-deep), #d41e3c);
    border: 0;
    border-radius: var(--radius-sm);
    box-shadow: 0 4px 20px rgba(191,23,50,0.3);
    color: #fff;
    cursor: pointer;
    display: flex;
    font-family: 'Inter', sans-serif;
    font-size: .82rem;
    font-weight: 800;
    gap: 8px;
    justify-content: center;
    letter-spacing: .1em;
    padding: 16px 28px;
    text-transform: uppercase;
    transition: transform .2s ease, box-shadow .2s ease;
    width: 100%;
}

.login-btn:hover {
    box-shadow: 0 6px 28px rgba(191,23,50,0.45);
    transform: translateY(-2px);
}

.login-error {
    background: rgba(239,68,68,0.1);
    border: 1px solid rgba(239,68,68,0.25);
    border-radius: var(--radius-sm);
    color: #f87171;
    display: none;
    font-size: .84rem;
    margin-bottom: 20px;
    padding: 12px 16px;
}

.login-error.is-visible {
    display: block;
    animation: shake .4s ease;
}

@keyframes shake {
    0%,100% { transform: translateX(0) }
    20%,60% { transform: translateX(-6px) }
    40%,80% { transform: translateX(6px) }
}

.login-footer {
    color: rgba(255,255,255,0.3);
    font-size: .62rem;
    font-weight: 700;
    letter-spacing: .1em;
    margin-top: 40px;
    position: relative;
    text-align: center;
    text-transform: uppercase;
    z-index: 1;
    animation: fadeUp .8s cubic-bezier(.2,.9,.25,1) .3s both;
}

@keyframes fadeDown {
    from { opacity:0; transform:translateY(-20px) }
    to { opacity:1; transform:translateY(0) }
}

@keyframes fadeUp {
    from { opacity:0; transform:translateY(24px) }
    to { opacity:1; transform:translateY(0) }
}

/* ============================================================
   ADMIN CARD (generic card used on racepack, etc.)
   ============================================================ */

.admin-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 24px;
    position: relative;
    overflow: hidden;
}

.admin-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    border-radius: var(--radius) var(--radius) 0 0;
    background: linear-gradient(90deg, var(--accent-deep), var(--accent));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.admin-card:hover::before {
    opacity: 1;
}

/* Admin Input */
.admin-input {
    appearance: none;
    background: rgba(255,255,255,0.04);
    border: 1.5px solid var(--line);
    border-radius: var(--radius-sm);
    color: #fff;
    font-family: 'Inter', sans-serif;
    font-size: 0.88rem;
    outline: none;
    padding: 12px 16px;
    transition: border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
    width: 100%;
}

.admin-input::placeholder {
    color: rgba(255,255,255,0.3);
}

.admin-input:focus {
    background: var(--surface-hover);
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

/* ============================================================
   RACEPACK PAGE
   ============================================================ */

/* Search */
.racepack-search {
    margin-bottom: 24px;
}

.racepack-search__form {
    display: flex;
    gap: 12px;
    align-items: center;
}

.racepack-search__form .admin-input {
    max-width: 360px;
    flex: 1;
}

.racepack-search__form .admin-btn svg {
    flex-shrink: 0;
}

/* Main grid */
.racepack-grid {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 24px;
    align-items: start;
}

/* Card headers */
.racepack-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 12px;
}

.racepack-card-header h2 {
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
}

/* Card icons */
.racepack-card-icon {
    width: 38px; height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.racepack-card-icon--scanner {
    background: rgba(99,102,241,0.12);
    color: #818cf8;
}

.racepack-card-icon--pending {
    background: rgba(245,158,11,0.12);
    color: #fbbf24;
}

.racepack-card-icon--collected {
    background: rgba(34,197,94,0.12);
    color: #4ade80;
}

/* Table card */
.racepack-table-card {
    margin-bottom: 24px;
}

.racepack-table-card:last-child {
    margin-bottom: 0;
}

/* Override min-width for racepack tables (they have fewer columns) */
.racepack-table {
    min-width: 0;
}

/* Scanner reader override */
#reader {
    border-radius: var(--radius-sm);
    overflow: hidden;
}

#reader video {
    border-radius: var(--radius-sm);
}

/* Scan result styling */
#scan-result:not(:empty) {
    padding: 16px;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    animation: fadeUp 0.3s ease;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 1100px) {
    .stats-grid { grid-template-columns: repeat(2,1fr); }

    /* Racepack grid — single column on smaller desktops */
    .racepack-grid {
        grid-template-columns: 1fr;
    }
}

/* ── TABLET ── */
@media (max-width: 768px) {

    /* Layout */
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .admin-main {
        margin-left: 0;
    }
    .hamburger {
        display: flex;
    }
    .admin-content {
        padding: 24px 16px;
    }
    .topbar {
        padding: 0 16px;
    }
    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }
    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    /* Filter tabs — scrollable on tablet */
    .filter-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .filter-tabs::-webkit-scrollbar { display: none; }

    /* Section card header stack */
    .section-card__header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    /* ──────────────────────────────────────────────────────────
       RESPONSIVE TABLE → CARD LAYOUT
       Each <tr> becomes a stacked card; <thead> is hidden;
       each <td>::before shows the column label from data-label.
    ────────────────────────────────────────────────────────── */

    .admin-table {
        min-width: 0;
    }

    .admin-table thead {
        display: none;
    }

    .admin-table tbody tr {
        display: block;
        background: var(--surface);
        border: 1px solid var(--line);
        border-radius: var(--radius);
        margin-bottom: 12px;
        padding: 16px;
        position: relative;
        overflow: hidden;
        transition: border-color 0.2s ease, box-shadow 0.2s ease;
    }

    .admin-table tbody tr::before {
        content: '';
        position: absolute;
        top: 0; left: 0; right: 0;
        height: 3px;
        background: linear-gradient(90deg, var(--accent-deep), var(--accent));
        border-radius: var(--radius) var(--radius) 0 0;
    }

    .admin-table tbody tr:hover {
        border-color: rgba(255,255,255,0.15);
        box-shadow: 0 4px 20px rgba(0,0,0,0.25);
        background: var(--surface);
    }

    .admin-table tbody tr:last-child {
        margin-bottom: 0;
    }

    .admin-table td {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 10px 0;
        border-bottom: 1px solid var(--line);
        font-size: 0.85rem;
        gap: 12px;
    }

    .admin-table td:last-child {
        border-bottom: none;
        padding-bottom: 4px;
    }

    .admin-table td:first-child {
        padding-top: 8px;
    }

    /* Label from data-label attribute */
    .admin-table td::before {
        content: attr(data-label);
        font-size: 0.7rem;
        font-weight: 700;
        color: var(--muted);
        letter-spacing: 0.08em;
        text-transform: uppercase;
        flex-shrink: 0;
        min-width: 90px;
    }

    /* Action buttons stack vertically */
    .admin-table .admin-actions {
        width: 100%;
        justify-content: flex-start;
    }

    /* Table wrapper — remove background/border since cards handle it */
    .admin-table-wrap {
        background: transparent;
        border: none;
        border-radius: 0;
        overflow: visible;
    }

    /* Section card overflow for table cards */
    .section-card {
        overflow: visible;
    }

    .section-card > div[style*="overflow"] {
        overflow: visible !important;
    }

    /* ── RACEPACK RESPONSIVE ── */

    .racepack-grid {
        grid-template-columns: 1fr;
    }

    .racepack-search__form {
        flex-direction: column;
        align-items: stretch;
    }

    .racepack-search__form .admin-input {
        max-width: none;
    }

    .racepack-search__form .admin-btn {
        justify-content: center;
    }

    .racepack-card-header {
        flex-wrap: wrap;
    }

    /* Table overflow wrapper — visible for card layout */
    .racepack-table-card > div[style*="overflow"] {
        overflow: visible !important;
    }
}

/* ── PHONE ── */
@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .stat-card {
        padding: 18px;
    }

    .stat-card__value {
        font-size: 1.6rem;
    }

    .page-title {
        font-size: 1.25rem;
    }

    .page-header {
        gap: 12px;
        margin-bottom: 20px;
    }

    /* Filter tabs — smaller on phone */
    .filter-tabs {
        width: 100%;
    }

    .filter-tab {
        padding: 7px 14px;
        font-size: 0.7rem;
        flex: 1;
        text-align: center;
    }

    /* Admin buttons — full width on phone */
    .admin-btn--primary {
        width: 100%;
        justify-content: center;
        padding: 12px 16px;
    }

    /* Table card tweaks */
    .admin-table td {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
        padding: 8px 0;
    }

    .admin-table td::before {
        min-width: auto;
        margin-bottom: 2px;
    }

    .admin-table .admin-actions {
        flex-direction: column;
        gap: 6px;
    }

    .admin-table .admin-actions .admin-btn {
        width: 100%;
        justify-content: center;
        padding: 10px 14px;
    }

    /* Topbar */
    .topbar-date {
        display: none;
    }

    .topbar-title {
        font-size: 0.82rem;
    }

    /* Admin content */
    .admin-content {
        padding: 16px 12px;
    }

    .admin-footer {
        padding: 16px 12px;
    }

    /* Racepack — phone */
    .racepack-search {
        padding: 16px;
    }

    .admin-card {
        padding: 16px;
    }

    .racepack-card-header h2 {
        font-size: 0.9rem;
    }

    .racepack-card-icon {
        width: 32px; height: 32px;
        border-radius: 8px;
    }

    .racepack-card-icon svg {
        width: 16px; height: 16px;
    }

    /* Login */
    .login-card {
        padding: 32px 24px 28px;
    }
    .login-brand__logo {
        width: 48px; height: 48px;
    }
}

/* ============================================================
   RFID PAGE
   ============================================================ */

.rfid-grid{
    display:grid;
    grid-template-columns:420px 1fr;
    gap:24px;
    align-items:start;
}

.rfid-live-card{
    text-align:center;
}

.rfid-live-label{
    font-size:.72rem;
    font-weight:700;
    letter-spacing:.12em;
    text-transform:uppercase;
    color:var(--muted);
    margin-bottom:14px;
}

.rfid-uid{
    background:rgba(255,255,255,.04);
    border:1px solid var(--line);
    border-radius:var(--radius);
    padding:22px;
    font-family:monospace;
    font-size:1.4rem;
    font-weight:700;
    color:#fff;
    letter-spacing:.08em;
    margin-bottom:20px;
    min-height:80px;

    display:flex;
    align-items:center;
    justify-content:center;
}

.rfid-status{
    margin-top:18px;
}

.rfid-table-card{
    overflow:hidden;
}

.rfid-table{
    min-width:0;
}

.rfid-badge{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    padding:6px 12px;
    border-radius:999px;
    font-size:.68rem;
    font-weight:700;
    letter-spacing:.06em;
    text-transform:uppercase;
}

.rfid-badge--active{
    background:rgba(34,197,94,.12);
    color:#4ade80;
}

.rfid-badge--empty{
    background:rgba(239,68,68,.12);
    color:#f87171;
}

.rfid-action{
    display:flex;
    gap:8px;
    flex-wrap:wrap;
}

.rfid-empty{
    text-align:center;
    color:var(--muted);
    padding:24px;
    font-size:.85rem;
}

@media(max-width:1100px){

    .rfid-grid{
        grid-template-columns:1fr;
    }

}

@media(max-width:768px){

    .rfid-action{
        width:100%;
        flex-direction:column;
    }

    .rfid-action .admin-btn{
        width:100%;
        justify-content:center;
    }

    .rfid-uid{
        font-size:1rem;
        padding:18px;
    }

}