

        :root {
            --primary-color: #2563eb;
            --secondary-color: #1e40af;
            --danger-color: #dc2626;
            --success-color: #16a34a;
            --warning-color: #ea580c;
            --border-color: rgba(255, 255, 255, 0.15);
            --sidebar-active: #3b82f6;
        }

        select {
            background: rgba(15, 15, 35, 0.9);
            border: 1px solid var(--border-color);
            color: #fff;
            backdrop-filter: blur(8px);
        }
        select option {
            background: rgb(20, 20, 45);
            color: #fff;
        }
        input[type="text"], input[type="number"], input[type="email"], input[type="password"], input[type="search"] {
            background: rgba(15, 15, 35, 0.9);
            border: 1px solid var(--border-color);
            color: #fff;
        }


        /* Hide top admin tabs when sidebar is present (logged-in users) */
        html.logged-in .admin-tabs {
            display: none !important;
        }

        /* Admin tab navigation (fallback for non-logged-in, kept for JS tab switching) */
        .admin-tabs {
            display: flex;
            flex-wrap: wrap;
            gap: 0.5rem;
            padding: 1rem 0;
            margin-bottom: 1.5rem;
            border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        }

        .admin-tabs .tab-item {
            display: flex;
            align-items: center;
            gap: 0.4rem;
            padding: 0.5rem 1rem;
            color: rgba(255, 255, 255, 0.6);
            cursor: pointer;
            transition: all 0.2s;
            font-size: 0.85rem;
            border-radius: 6px;
            border: none;
            background: none;
        }

        .admin-tabs .tab-item:hover {
            background: rgba(255, 255, 255, 0.1);
            color: white;
        }

        .admin-tabs .tab-item.active {
            background: var(--sidebar-active);
            color: white;
        }

        .admin-tabs .tab-item svg {
            width: 16px;
            height: 16px;
            flex-shrink: 0;
        }

        .admin-container {
            padding: 1rem 2rem 2rem;
        }

        .admin-header {
            margin-bottom: 0.5rem;
        }

        .admin-header h1 {
            font-size: 1.5rem;
            color: #ffffff;
        }

        .container {
            padding: 0;
        }

        .stats-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 1.25rem;
            margin-bottom: 2rem;
        }

        .stat-card {
            background: rgba(255, 255, 255, 0.09);
            backdrop-filter: blur(15px);
            -webkit-backdrop-filter: blur(15px);
            border: 1px solid rgba(255, 255, 255, 0.3);
            padding: 1.25rem;
            border-radius: 10px;
            box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
        }

        .stat-card .label {
            font-size: 0.8rem;
            color: rgba(255, 255, 255, 0.7);
            margin-bottom: 0.25rem;
        }

        .stat-card .value {
            font-size: 1.75rem;
            font-weight: 700;
            color: #ffffff;
        }

        .panel-section {
            background: rgba(255, 255, 255, 0.09);
            backdrop-filter: blur(15px);
            -webkit-backdrop-filter: blur(15px);
            border: 1px solid rgba(255, 255, 255, 0.3);
            padding: 1.5rem;
            border-radius: 10px;
            box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
            margin-bottom: 1.5rem;
            color: #ffffff;
        }

        .panel-section h2 {
            margin-bottom: 1.25rem;
            color: #ffffff;
            font-size: 1.1rem;
        }

        .search-bar {
            margin-bottom: 1.25rem;
        }

        .search-bar input {
            width: 100%;
            padding: 0.625rem 1rem;
            border: 1px solid var(--border-color);
            border-radius: 6px;
            font-size: 0.9rem;
            background: rgba(255, 255, 255, 0.1);
            color: #ffffff;
        }

        .search-bar input::placeholder {
            color: rgba(255, 255, 255, 0.4);
        }

        .users-table {
            width: 100%;
            border-collapse: collapse;
            font-size: 0.9rem;
        }

        .users-table th {
            text-align: left;
            padding: 0.875rem;
            background: rgba(255, 255, 255, 0.08);
            font-weight: 600;
            border-bottom: 1px solid var(--border-color);
        }

        .users-table td {
            padding: 0.875rem;
            border-bottom: 1px solid var(--border-color);
        }

        .users-table tr:hover {
            background: rgba(255, 255, 255, 0.05);
        }

        .badge {
            display: inline-block;
            padding: 0.2rem 0.6rem;
            border-radius: 5px;
            font-size: 0.7rem;
            font-weight: 600;
        }

        .badge-admin {
            background: var(--primary-color);
            color: white;
        }

        .badge-user {
            background: rgba(255, 255, 255, 0.15);
            color: rgba(255, 255, 255, 0.7);
        }

        .btn {
            padding: 0.5rem 1rem;
            border: none;
            border-radius: 6px;
            cursor: pointer;
            font-size: 0.8rem;
            font-weight: 500;
            transition: all 0.2s;
        }

        .btn-primary {
            background: var(--primary-color);
            color: white;
        }

        .btn-primary:hover {
            background: var(--secondary-color);
        }

        .btn-danger {
            background: var(--danger-color);
            color: white;
        }

        .btn-danger:hover {
            background: #b91c1c;
        }

        .btn-small {
            padding: 0.35rem 0.7rem;
            font-size: 0.75rem;
        }

        .action-buttons {
            display: flex;
            gap: 0.5rem;
        }

        .loading {
            text-align: center;
            padding: 2rem;
            color: rgba(255, 255, 255, 0.5);
        }

        .empty-state {
            text-align: center;
            padding: 3rem;
            color: rgba(255, 255, 255, 0.5);
        }

        .modal {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0, 0, 0, 0.5);
            align-items: center;
            justify-content: center;
            z-index: 1000;
        }

        .modal.active {
            display: flex;
        }

        .modal-content {
            background: rgba(30, 41, 59, 0.95);
            backdrop-filter: blur(20px);
            -webkit-backdrop-filter: blur(20px);
            border: 1px solid rgba(255, 255, 255, 0.2);
            padding: 1.5rem;
            border-radius: 10px;
            max-width: 500px;
            width: 90%;
            color: #ffffff;
        }

        .modal-content h3 {
            margin-bottom: 1rem;
            font-size: 1.1rem;
            color: #ffffff;
        }

        .modal-content p {
            color: rgba(255, 255, 255, 0.8);
        }

        .modal-content input,
        .modal-content select,
        .modal-content textarea {
            background: rgba(255, 255, 255, 0.1);
            border: 1px solid rgba(255, 255, 255, 0.2);
            color: #ffffff;
        }

        .modal-content input::placeholder,
        .modal-content textarea::placeholder {
            color: rgba(255, 255, 255, 0.4);
        }

        .modal-buttons {
            display: flex;
            gap: 0.75rem;
            margin-top: 1.25rem;
            justify-content: flex-end;
        }

        /* Legacy admin forms are mounted inside the desktop shell while open.
           Let the shell provide the window/panel chrome instead of nesting the
           old grey modal card inside it. */
        .menu-overlay__lazy-content > .admin-shell-modal-content {
            box-sizing: border-box;
            display: block !important;
            width: 100% !important;
            max-width: none !important;
            max-height: none !important;
            min-height: 0;
            overflow: visible !important;
            padding: 0 !important;
            border: 0 !important;
            border-radius: 0 !important;
            background: transparent !important;
            box-shadow: none !important;
            backdrop-filter: none !important;
            -webkit-backdrop-filter: none !important;
        }

        .menu-overlay__lazy-content > .admin-shell-modal-content > h3:first-child {
            display: none;
        }

        .menu-overlay__lazy-content > .admin-shell-modal-content .modal-buttons {
            position: sticky;
            bottom: -1px;
            margin: 1.25rem -1px -1px;
            padding: 0.875rem 1px 1px;
            background: linear-gradient(to bottom, rgba(10, 16, 34, 0), rgba(10, 16, 34, 0.96) 38%);
        }

        /* Game detail modal */
        .detail-section { margin-bottom: 1.25rem; }
        .detail-section h4 { color: #93c5fd; margin-bottom: 0.5rem; font-size: 0.9rem; text-transform: uppercase; letter-spacing: 0.05em; }
        .detail-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 0.5rem; }
        .detail-item .label { font-size: 0.75rem; color: rgba(255,255,255,0.5); }
        .detail-item .value { font-size: 0.9rem; font-weight: 600; }
        .mistakes-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; margin-top: 0.5rem; }
        .mistakes-table th, .mistakes-table td { padding: 0.3rem 0.5rem; border: 1px solid rgba(255,255,255,0.1); text-align: left; }
        .mistakes-table th { background: rgba(255,255,255,0.07); color: rgba(255,255,255,0.6); font-weight: normal; }
        .hit-badge { color: #27ae60; font-weight: 600; }
        .miss-badge { color: #f39c12; font-weight: 600; }
        .wrong-badge { color: #e74c3c; font-weight: 600; }
        .no-data { color: rgba(255,255,255,0.4); font-size: 0.8rem; margin: 0.5rem 0; }

        /* System panel */
        .system-panel {
            max-width: 1120px;
        }

        .system-panel__header,
        .system-section__header,
        .system-shard-card__topline,
        .system-capacity-meter__labels {
            display: flex;
            align-items: flex-start;
            justify-content: space-between;
            gap: 1rem;
        }

        .system-panel__header {
            margin-bottom: 1.5rem;
        }

        .system-panel__header h2,
        .system-section h3,
        .system-shard-card h4 {
            margin: 0;
            color: #fff;
        }

        .system-panel__header h2 {
            font-size: clamp(1.35rem, 2vw, 1.7rem);
        }

        .system-panel__eyebrow,
        .system-section__eyebrow,
        .system-status-card__label,
        .system-shard-card__index {
            margin: 0 0 0.35rem;
            color: #93c5fd;
            font-size: 0.7rem;
            font-weight: 700;
            letter-spacing: 0.09em;
            text-transform: uppercase;
        }

        .system-panel__intro,
        .system-section__header p,
        .system-shard-card__description,
        .system-shard-card__meta,
        .system-technical-details p,
        .system-routing-details p {
            margin: 0.45rem 0 0;
            color: rgba(255, 255, 255, 0.68);
            font-size: 0.86rem;
            line-height: 1.55;
        }

        .system-overview {
            display: grid;
            grid-template-columns: repeat(3, minmax(0, 1fr));
            gap: 0.75rem;
            margin-bottom: 1.5rem;
        }

        .system-status-card,
        .system-shard-card {
            background: rgba(15, 23, 42, 0.38);
            border: 1px solid rgba(255, 255, 255, 0.13);
            border-radius: 10px;
        }

        .system-status-card {
            display: flex;
            flex-direction: column;
            gap: 0.25rem;
            padding: 1rem;
        }

        .system-status-card strong {
            color: #fff;
            font-size: 1rem;
        }

        .system-status-card > span:last-child {
            color: rgba(255, 255, 255, 0.62);
            font-size: 0.78rem;
            line-height: 1.45;
        }

        .system-status-card--success { border-color: rgba(74, 222, 128, 0.42); }
        .system-status-card--warning { border-color: rgba(251, 191, 36, 0.48); }

        .system-section {
            margin-top: 1.5rem;
            padding-top: 1.5rem;
            border-top: 1px solid var(--border-color);
        }

        .system-section__header h3 {
            font-size: 1.05rem;
        }

        .system-section__actions {
            display: flex;
            flex-wrap: wrap;
            justify-content: flex-end;
            gap: 0.5rem;
            flex-shrink: 0;
        }

        .system-callout {
            margin: 1rem 0;
            padding: 0.75rem 0.9rem;
            border: 1px solid rgba(96, 165, 250, 0.32);
            border-left: 3px solid #60a5fa;
            border-radius: 7px;
            background: rgba(37, 99, 235, 0.12);
            color: rgba(219, 234, 254, 0.9);
            font-size: 0.83rem;
            line-height: 1.5;
        }

        .system-capacity-summary {
            display: flex;
            flex-wrap: wrap;
            gap: 0.4rem 1rem;
            margin-bottom: 0.8rem;
            color: rgba(255, 255, 255, 0.6);
            font-size: 0.78rem;
        }

        .system-shard-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
            gap: 0.8rem;
        }

        .system-shard-card {
            padding: 1rem;
        }

        .system-shard-card.is-active {
            border-color: rgba(96, 165, 250, 0.75);
            box-shadow: inset 0 0 0 1px rgba(96, 165, 250, 0.18);
        }

        .system-shard-card h4 {
            font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
            font-size: 0.95rem;
        }

        .system-badge {
            display: inline-flex;
            align-items: center;
            min-height: 1.55rem;
            padding: 0.15rem 0.55rem;
            border-radius: 999px;
            font-size: 0.7rem;
            font-weight: 700;
            white-space: nowrap;
        }

        .system-badge--success { background: rgba(22, 163, 74, 0.2); color: #86efac; }
        .system-badge--primary { background: rgba(37, 99, 235, 0.24); color: #bfdbfe; }
        .system-badge--warning { background: rgba(234, 88, 12, 0.22); color: #fdba74; }
        .system-badge--error { background: rgba(220, 38, 38, 0.22); color: #fca5a5; }
        .system-badge--muted { background: rgba(148, 163, 184, 0.18); color: #cbd5e1; }

        .system-capacity-meter {
            margin-top: 1rem;
        }

        .system-capacity-meter__track {
            position: relative;
            height: 0.55rem;
            overflow: visible;
            border-radius: 999px;
            background: rgba(255, 255, 255, 0.14);
        }

        .system-capacity-meter__fill {
            height: 100%;
            max-width: 100%;
            border-radius: inherit;
            transition: width 180ms ease;
        }

        .system-capacity-meter__fill--success { background: #22c55e; }
        .system-capacity-meter__fill--primary { background: #60a5fa; }
        .system-capacity-meter__fill--warning { background: #f59e0b; }
        .system-capacity-meter__fill--error { background: #ef4444; }
        .system-capacity-meter__fill--muted { background: #94a3b8; }

        .system-capacity-meter__threshold {
            position: absolute;
            top: -0.2rem;
            bottom: -0.2rem;
            width: 2px;
            border-radius: 2px;
            background: rgba(255, 255, 255, 0.85);
        }

        .system-capacity-meter__labels {
            align-items: center;
            margin-top: 0.45rem;
            color: rgba(255, 255, 255, 0.65);
            font-size: 0.76rem;
        }

        .system-capacity-meter__labels strong { color: #fff; }
        .system-shard-card__error { margin: 0.85rem 0 0; color: #fca5a5; font-size: 0.84rem; line-height: 1.45; }

        .system-routing-details,
        .system-technical-details {
            margin-top: 1rem;
            padding: 0.75rem 0.9rem;
            border: 1px solid rgba(255, 255, 255, 0.13);
            border-radius: 8px;
            background: rgba(15, 23, 42, 0.25);
        }

        .system-routing-details summary,
        .system-technical-details summary {
            cursor: pointer;
            color: #bfdbfe;
            font-size: 0.82rem;
            font-weight: 600;
        }

        .system-form-grid {
            display: grid;
            gap: 0.75rem;
            margin-top: 1rem;
        }

        .system-form-row {
            display: grid;
            grid-template-columns: minmax(180px, 1fr) 110px auto;
            align-items: center;
            gap: 0.65rem;
        }

        .system-form-row label {
            color: rgba(255, 255, 255, 0.85);
            font-size: 0.85rem;
            font-weight: 600;
        }

        .system-form-row input {
            min-width: 0;
            padding: 0.48rem 0.62rem;
            border-radius: 6px;
            font-size: 0.85rem;
        }

        .system-form-row--wide {
            grid-template-columns: minmax(180px, 1fr) 110px minmax(180px, 2fr) auto;
        }

        .sr-only {
            position: absolute;
            width: 1px;
            height: 1px;
            padding: 0;
            margin: -1px;
            overflow: hidden;
            clip: rect(0, 0, 0, 0);
            white-space: nowrap;
            border: 0;
        }

        .system-empty-state--error { color: #fca5a5; }
        .system-section button:disabled { cursor: wait; opacity: 0.7; }

        /* Responsive */
        @media (max-width: 768px) {
            .admin-tabs {
                gap: 0.25rem;
            }

            .admin-tabs .tab-item {
                padding: 0.4rem 0.6rem;
                font-size: 0.75rem;
            }

            .admin-tabs .tab-item svg {
                display: none;
            }

            .admin-container {
                padding: 1rem;
            }

            .system-overview {
                grid-template-columns: 1fr;
            }

            .system-panel__header,
            .system-section__header {
                flex-direction: column;
            }

            .system-section__actions {
                justify-content: flex-start;
            }

            .system-form-row,
            .system-form-row--wide {
                grid-template-columns: 1fr;
            }
        }
