/* ============================================================================
   SIDELINE COMMAND — PLATFORM CSS
   ============================================================================
   Shared styles for all platform (league admin) pages.
   Imports design-system.css and extends with platform-specific layout,
   components, and the premium GC aesthetic.

   Fonts: Saira Condensed (headlines) + Barlow (body)
   Accent: Purple via data-theme="platform" → var(--gc-accent-primary)
   ============================================================================ */

/* ============================================================================
   LAYOUT SHELL
   ============================================================================ */

:root {
    --sidebar-width: 260px;
    --sidebar-collapsed: 72px;
    --topbar-height: 64px;
    --platform-purple: #a855f7;
    --platform-purple-hover: #9333ea;
    --platform-purple-dim: rgba(168, 85, 247, 0.15);
    --platform-purple-glow: rgba(168, 85, 247, 0.3);
    /* Premium overrides — stronger borders & contrast */
    --platform-border: rgba(255, 255, 255, 0.12);
    --platform-border-strong: rgba(255, 255, 255, 0.18);

    /* Platform font overrides — Barlow body, Saira Condensed display.
       Coach app stays on Rajdhani via design-system.css defaults.
       Platform pages load Barlow via Google Fonts <link> in each HTML. */
    --gc-font-body: 'Barlow', system-ui, sans-serif;
    --gc-font-display: 'Saira Condensed', 'Barlow', system-ui, sans-serif;

    /* Legacy variable aliases — maps old page-level vars to design-system tokens.
       Pages used to define these in their own :root blocks. Now single source of truth. */
    --bg-primary: var(--gc-bg-app);
    --bg-secondary: var(--gc-bg-panel);
    --bg-card: var(--gc-bg-elevated);
    --bg-card-hover: var(--gc-bg-hover);
    --bg-elevated: var(--gc-bg-hover);
    --border-primary: var(--gc-border-subtle);
    --border-hover: var(--gc-border-default);
    --text-primary: var(--gc-text-color-primary);
    --text-secondary: var(--gc-text-color-secondary);
    --text-muted: var(--gc-text-color-muted);
    --accent-green: #22c55e;
    --accent-green-dim: rgba(34, 197, 94, 0.15);
    --accent-gold: #f59e0b;
    --accent-gold-dim: rgba(245, 158, 11, 0.15);
    --accent-blue: #3b82f6;
    --accent-blue-dim: rgba(59, 130, 246, 0.15);
    --accent-red: #ef4444;
    --accent-red-dim: rgba(239, 68, 68, 0.15);
    --accent-purple: #8b5cf6;
    --accent-purple-dim: rgba(139, 92, 246, 0.15);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.06) transparent;
}

*::-webkit-scrollbar { width: 5px; height: 5px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.06); border-radius: 4px; }
*:hover::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); }

html, body {
    height: 100%;
}

body {
    font-family: var(--gc-font-body);
    background: var(--gc-bg-app);
    color: var(--gc-text-color-primary);
    display: flex;
    overflow-x: hidden;
}

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

.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 100;
    background: var(--gc-bg-panel);
    border-right: 2px solid var(--platform-border-strong);
    display: flex;
    flex-direction: column;
    transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed);
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    min-height: 64px;
    border-bottom: 2px solid var(--platform-border);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.sidebar-logo img {
    height: 56px;
    width: auto;
    transition: opacity 0.2s;
}

.sidebar-logo .logo-light {
    display: none;
}

.sidebar-toggle {
    background: none;
    border: none;
    color: var(--gc-text-color-muted);
    cursor: pointer;
    padding: 6px;
    border-radius: var(--gc-radius-sm);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-toggle:hover {
    color: var(--gc-text-color-primary);
    background: var(--gc-bg-hover);
}

.sidebar.collapsed .sidebar-toggle i {
    transform: rotate(180deg);
}

.sidebar.collapsed .nav-item-text,
.sidebar.collapsed .nav-section-title,
.sidebar.collapsed .nav-item-badge,
.sidebar.collapsed .league-selector,
.sidebar.collapsed .user-info,
.sidebar.collapsed .chevron,
.sidebar.collapsed .sidebar-logo img {
    opacity: 0;
    width: 0;
    overflow: hidden;
    white-space: nowrap;
}

/* Sidebar nav */
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.06) transparent;
}

.sidebar-nav::-webkit-scrollbar {
    width: 4px;
}
.sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}
.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.06);
    border-radius: 4px;
}
.sidebar-nav:hover::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.12);
}

.nav-section-title {
    font-family: var(--gc-font-display);
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--gc-text-color-secondary);
    padding: 20px 12px 6px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--gc-radius-md);
    color: var(--gc-text-color-secondary);
    text-decoration: none;
    font-family: var(--gc-font-body);
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.15s;
    position: relative;
    cursor: pointer;
}

.nav-item:hover {
    color: var(--gc-text-color-primary);
    background: var(--gc-bg-hover);
}

.nav-item.active {
    color: var(--gc-accent-primary);
    background: var(--gc-accent-primaryMuted);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 22px;
    background: var(--gc-accent-primary);
    border-radius: 0 3px 3px 0;
}

.nav-item i,
.nav-item svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.nav-item-text {
    white-space: nowrap;
    transition: opacity 0.2s;
}

.nav-item-badge {
    margin-left: auto;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: var(--gc-radius-full);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.live-badge {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    animation: pulse-badge 2s infinite;
}

@keyframes pulse-badge {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* League selector */
.league-selector {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    margin: 8px;
    border-radius: var(--gc-radius-md);
    background: var(--gc-bg-elevated);
    cursor: pointer;
    transition: background 0.15s;
}

.league-selector:hover {
    background: var(--gc-bg-active);
}

.league-avatar {
    width: 32px;
    height: 32px;
    border-radius: var(--gc-radius-md);
    background: linear-gradient(135deg, var(--gc-accent-primary), var(--gc-accent-primaryHover));
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--gc-font-display);
    font-weight: 700;
    font-size: 0.75rem;
    color: white;
    flex-shrink: 0;
}

.league-info {
    flex: 1;
    min-width: 0;
}

.league-name {
    font-family: var(--gc-font-display);
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--gc-text-color-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.league-season {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    color: var(--gc-text-color-muted);
}

.season-badge {
    font-size: 0.6rem;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: var(--gc-radius-sm);
    background: var(--gc-accent-primaryMuted);
    color: var(--gc-accent-primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.league-chevron {
    color: var(--gc-text-color-muted);
}

.league-chevron svg {
    width: 16px;
    height: 16px;
}

/* Sidebar footer / user menu */
.sidebar-footer {
    padding: 8px;
    border-top: 2px solid var(--platform-border);
    position: relative;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 8px;
    border-radius: var(--gc-radius-md);
    cursor: pointer;
    transition: background 0.15s;
}

.user-menu:hover {
    background: var(--gc-bg-hover);
}

.user-avatar {
    width: 34px;
    height: 34px;
    border-radius: var(--gc-radius-full);
    background: linear-gradient(135deg, var(--gc-accent-primary), var(--gc-accent-primaryHover));
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--gc-font-display);
    font-weight: 700;
    font-size: 0.75rem;
    color: white;
    flex-shrink: 0;
}

.user-info {
    flex: 1;
    min-width: 0;
}

.user-name {
    font-family: var(--gc-font-display);
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--gc-text-color-primary);
}

.user-role {
    font-size: 0.72rem;
    color: var(--gc-text-color-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.chevron {
    color: var(--gc-text-color-muted);
}

.chevron svg {
    width: 16px;
    height: 16px;
}

.user-dropdown {
    position: absolute;
    bottom: 100%;
    left: 8px;
    right: 8px;
    background: var(--gc-bg-elevated);
    border: 1px solid var(--gc-border-default);
    border-radius: var(--gc-radius-md);
    padding: 4px;
    display: none;
    box-shadow: var(--gc-shadow-lg);
}

.user-dropdown.show {
    display: block;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: var(--gc-radius-sm);
    color: var(--gc-text-color-secondary);
    text-decoration: none;
    font-size: 0.85rem;
    transition: all 0.15s;
}

.dropdown-item:hover {
    background: var(--gc-bg-hover);
    color: var(--gc-text-color-primary);
}

.logout-item:hover {
    color: var(--gc-status-error);
    background: var(--gc-status-errorMuted);
}

.dropdown-item svg {
    width: 16px;
    height: 16px;
}

/* ============================================================================
   MAIN CONTENT
   ============================================================================ */

.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    min-height: 100vh;
    transition: margin-left 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    background: var(--gc-bg-app);
}

.sidebar.collapsed ~ .main-content {
    margin-left: var(--sidebar-collapsed);
}

/* Top bar — SINGLE SOURCE OF TRUTH
   Do NOT duplicate these rules in page-level <style> blocks.
   Override only with page-specific additions (e.g., extra buttons). */
.top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    height: var(--topbar-height);
    min-height: var(--topbar-height);
    background: rgba(15, 15, 18, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--platform-border-strong);
    position: sticky;
    top: 0;
    z-index: 50;
}

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

.top-bar-left h1,
.top-bar .page-title {
    font-family: 'Saira Condensed', var(--gc-font-display), sans-serif;
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--gc-text-color-primary);
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
}

.top-bar .page-title svg {
    width: 22px;
    height: 22px;
    color: var(--gc-accent-primary);
}

.top-bar-actions,
.top-bar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.top-bar-breadcrumb {
    font-size: 0.8rem;
    color: var(--gc-text-color-muted);
}

.top-bar-breadcrumb a {
    color: var(--gc-text-color-muted);
    text-decoration: none;
}

.top-bar-breadcrumb a:hover {
    color: var(--gc-accent-primary);
}

/* Page content */
.page-content {
    padding: 32px 40px;
    flex: 1;
}

/* ============================================================================
   CONTROLS BAR — Search, Sort, Filters (shared across entity pages)
   ============================================================================ */

.controls-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 0;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--platform-border);
    flex-wrap: wrap;
}

.controls-bar .search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--gc-bg-elevated);
    border: 1px solid var(--platform-border);
    border-radius: var(--gc-radius-md);
    padding: 8px 14px;
    flex: 1;
    max-width: 320px;
    transition: border-color 0.2s;
}

.controls-bar .search-box:focus-within {
    border-color: var(--gc-accent-primary);
}

.controls-bar .search-box svg {
    width: 16px;
    height: 16px;
    color: var(--gc-text-color-secondary);
    flex-shrink: 0;
}

.controls-bar .search-box input {
    background: none;
    border: none;
    outline: none;
    color: var(--gc-text-color-primary);
    font-family: var(--gc-font-body);
    font-size: 0.85rem;
    width: 100%;
}

.controls-bar .search-box input::placeholder {
    color: var(--gc-text-color-muted);
}

/* Sort dropdown */
.sort-select {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--gc-bg-elevated);
    border: 1px solid var(--platform-border);
    border-radius: var(--gc-radius-md);
    padding: 8px 14px;
    color: var(--gc-text-color-primary);
    font-family: var(--gc-font-body);
    font-size: 0.82rem;
    cursor: pointer;
    transition: border-color 0.2s;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 30px;
}

.sort-select:hover,
.sort-select:focus {
    border-color: var(--gc-accent-primary);
    outline: none;
}

/* Filter chips */
.filter-chips {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 14px;
    border-radius: 20px;
    font-family: var(--gc-font-body);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid var(--platform-border);
    background: var(--gc-bg-elevated);
    color: var(--gc-text-color-secondary);
}

.filter-chip:hover {
    border-color: var(--gc-accent-primary);
    color: var(--gc-text-color-primary);
}

.filter-chip.active {
    background: var(--gc-accent-primary);
    border-color: var(--gc-accent-primary);
    color: #fff;
}

/* Controls bar responsive */
@media (max-width: 639px) {
    .controls-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    .controls-bar .search-box {
        max-width: none;
    }
    .filter-chips {
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
    }
}

/* ============================================================================
   ENTITY CARD GRID (shared layout for teams, players, coaches, referees, fields)
   ============================================================================ */

.entity-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

@media (max-width: 639px) {
    .entity-grid {
        grid-template-columns: 1fr;
    }
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--gc-text-color-secondary);
}

.empty-state svg {
    width: 48px;
    height: 48px;
    color: var(--gc-text-color-muted);
    margin-bottom: 16px;
}

.empty-state h3 {
    font-family: 'Saira Condensed', sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 8px;
    color: var(--gc-text-color-primary);
}

.empty-state p {
    font-size: 0.88rem;
    max-width: 400px;
    margin: 0 auto;
    line-height: 1.5;
}
/* ============================================================================
   STAT CARDS
   ============================================================================ */

.stat-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--gc-bg-panel);
    border: 2px solid var(--platform-border);
    border-radius: var(--gc-radius-lg);
    padding: 20px;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}

.stat-card:hover {
    border-color: var(--gc-accent-primaryGlow);
    box-shadow: 0 0 30px var(--platform-purple-glow);
}

.stat-card-label {
    font-family: var(--gc-font-display);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--gc-text-color-secondary);
    margin-bottom: 8px;
}

.stat-card-value {
    font-family: var(--gc-font-display);
    font-size: 2.8rem;
    font-weight: 900;
    line-height: 1;
    background: linear-gradient(135deg, var(--gc-accent-primary), #c084fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-card-sub {
    font-size: 0.8rem;
    color: var(--gc-text-color-secondary);
    margin-top: 6px;
}

.stat-card-icon {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    border-radius: var(--gc-radius-md);
    background: var(--gc-accent-primaryMuted);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gc-accent-primary);
}

.stat-card-icon svg {
    width: 20px;
    height: 20px;
}

/* ============================================================================
   CONTROLS BAR (search, filters, actions)
   ============================================================================ */

.controls-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.controls-bar-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.controls-bar-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.search-input {
    flex: 1;
    min-width: 200px;
    max-width: 360px;
    background: var(--gc-bg-elevated);
    border: 2px solid var(--platform-border);
    border-radius: var(--gc-radius-md);
    padding: 10px 14px 10px 40px;
    color: var(--gc-text-color-primary);
    font-family: var(--gc-font-body);
    font-size: 0.9rem;
    font-weight: 500;
    transition: border-color 0.2s;
    outline: none;
}

.search-input:focus {
    border-color: var(--gc-accent-primary);
}

.search-wrapper {
    position: relative;
    flex: 1;
    min-width: 200px;
    max-width: 360px;
}

.search-wrapper svg {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--gc-text-color-muted);
    pointer-events: none;
}

/* Search box (used across entity pages) */
.search-box {
    position: relative;
    flex: 1;
    min-width: 200px;
    max-width: 360px;
}

.search-box .search-icon,
.search-box > svg,
.search-box > i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--gc-text-color-muted);
    pointer-events: none;
    z-index: 1;
}

.search-box input {
    width: 100%;
    background: var(--gc-bg-elevated);
    border: 2px solid var(--platform-border);
    border-radius: var(--gc-radius-md);
    padding: 10px 14px 10px 42px;
    color: var(--gc-text-color-primary);
    font-family: var(--gc-font-body);
    font-size: 0.9rem;
    font-weight: 500;
    transition: border-color 0.2s;
    outline: none;
}

.search-box input::placeholder {
    color: var(--gc-text-color-muted);
}

.search-box input:focus {
    border-color: var(--gc-accent-primary);
}

.filter-chips {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.filter-chip {
    padding: 7px 16px;
    border-radius: var(--gc-radius-full);
    border: 2px solid var(--platform-border);
    background: transparent;
    color: var(--gc-text-color-secondary);
    font-family: var(--gc-font-display);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}

.filter-chip:hover {
    border-color: var(--gc-accent-primary);
    color: var(--gc-accent-primary);
}

.filter-chip.active {
    background: var(--gc-accent-primaryMuted);
    border-color: var(--gc-accent-primary);
    color: var(--gc-accent-primary);
}

.controls-spacer {
    flex: 1;
}

/* ============================================================================
   BUTTONS (platform-specific)
   ============================================================================ */

.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 22px;
    background: var(--gc-accent-primary);
    color: white;
    border: 2px solid transparent;
    border-radius: var(--gc-radius-md);
    font-family: var(--gc-font-display);
    font-size: 0.88rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary:hover {
    background: var(--gc-accent-primaryHover);
    box-shadow: 0 0 20px var(--platform-purple-glow);
}

.btn-primary svg {
    width: 18px;
    height: 18px;
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: transparent;
    color: var(--gc-text-color-primary);
    border: 2px solid var(--platform-border-strong);
    border-radius: var(--gc-radius-md);
    font-family: var(--gc-font-display);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
    white-space: nowrap;
}

.btn-secondary:hover {
    border-color: var(--gc-accent-primary);
    color: var(--gc-accent-primary);
}

.btn-ghost {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 22px;
    background: transparent;
    color: var(--gc-text-color-secondary);
    border: 2px solid var(--platform-border);
    border-radius: var(--gc-radius-md);
    font-family: var(--gc-font-display);
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    white-space: nowrap;
}

.btn-ghost:hover {
    border-color: var(--gc-border-default);
    color: var(--gc-text-color-primary);
    background: var(--gc-bg-hover);
}

.btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    background: transparent;
    border: 2px solid var(--platform-border);
    border-radius: var(--gc-radius-md);
    color: var(--gc-text-color-muted);
    cursor: pointer;
    transition: all 0.15s;
}

.btn-icon:hover {
    color: var(--gc-text-color-primary);
    border-color: var(--gc-border-default);
}

/* ============================================================================
   DATA TABLES
   ============================================================================ */

.data-table {
    width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
}

.data-table thead {
    background: var(--gc-bg-panel);
    position: sticky;
    top: var(--topbar-height);
    z-index: 10;
}

.data-table th {
    font-family: var(--gc-font-display);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--gc-text-color-secondary);
    padding: 14px 16px;
    text-align: left;
    border-bottom: 2px solid var(--platform-border-strong);
    white-space: nowrap;
    cursor: default;
    user-select: none;
}

.data-table th.sortable {
    cursor: pointer;
}

.data-table th.sortable:hover {
    color: var(--gc-accent-primary);
}

.data-table th.sorted-asc::after {
    content: ' \25B2';
    font-size: 0.6rem;
}

.data-table th.sorted-desc::after {
    content: ' \25BC';
    font-size: 0.6rem;
}

.data-table td {
    padding: 14px 16px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--gc-text-color-primary);
    border-bottom: 1px solid var(--platform-border);
    vertical-align: middle;
}

.data-table tbody tr {
    transition: background 0.1s;
}

.data-table tbody tr:hover {
    background: var(--gc-bg-hover);
}

.data-table .cell-name {
    font-family: var(--gc-font-display);
    font-weight: 700;
    font-size: 0.95rem;
}

.data-table .cell-muted {
    color: var(--gc-text-color-muted);
    font-size: 0.82rem;
}

/* ============================================================================
   CARD GRID
   ============================================================================ */

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

.card-grid-sm {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

.entity-card {
    background: var(--gc-bg-panel);
    border: 2px solid var(--platform-border);
    border-radius: var(--gc-radius-lg);
    padding: 20px;
    transition: all 0.2s;
    cursor: pointer;
}

.entity-card:hover {
    border-color: var(--gc-accent-primaryGlow);
    box-shadow: 0 0 30px var(--platform-purple-glow);
}

.entity-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.entity-card-avatar {
    width: 44px;
    height: 44px;
    border-radius: var(--gc-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--gc-font-display);
    font-weight: 700;
    font-size: 1rem;
    color: white;
    flex-shrink: 0;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
}

.entity-card-title {
    font-family: var(--gc-font-display);
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--gc-text-color-primary);
}

.entity-card-subtitle {
    font-size: 0.78rem;
    color: var(--gc-text-color-muted);
}

.entity-card-stats {
    display: flex;
    gap: 16px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 2px solid var(--platform-border);
}

.entity-card-stat {
    text-align: center;
    flex: 1;
}

.entity-card-stat-value {
    font-family: var(--gc-font-display);
    font-weight: 800;
    font-size: 1.2rem;
    color: var(--gc-accent-primary);
}

.entity-card-stat-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--gc-text-color-muted);
    font-weight: 600;
}

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

.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: var(--gc-radius-full);
    font-family: var(--gc-font-display);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: nowrap;
}

.badge-success {
    background: var(--gc-status-successMuted);
    color: var(--gc-status-success);
}

.badge-warning {
    background: var(--gc-status-warningMuted);
    color: var(--gc-status-warning);
}

.badge-error {
    background: var(--gc-status-errorMuted);
    color: var(--gc-status-error);
}

.badge-info {
    background: var(--gc-status-infoMuted);
    color: var(--gc-status-info);
}

.badge-purple {
    background: var(--platform-purple-dim);
    color: var(--platform-purple);
}

.badge-neutral {
    background: rgba(255, 255, 255, 0.06);
    color: var(--gc-text-color-secondary);
}

.badge-live {
    background: var(--gc-status-errorMuted);
    color: var(--gc-status-error);
    animation: pulse-badge 2s infinite;
}

/* ============================================================================
   MODALS
   ============================================================================ */

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
}

.modal-backdrop.active {
    display: flex;
}

.modal-container {
    background: var(--gc-bg-panel);
    border: 2px solid var(--platform-border-strong);
    border-radius: var(--gc-radius-lg);
    width: 90%;
    max-width: 600px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: var(--gc-shadow-2xl);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 2px solid var(--platform-border);
}

.modal-title {
    font-family: var(--gc-font-display);
    font-size: 1.2rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.modal-close {
    background: none;
    border: none;
    color: var(--gc-text-color-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: var(--gc-radius-sm);
    transition: color 0.15s;
}

.modal-close:hover {
    color: var(--gc-text-color-primary);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 2px solid var(--platform-border);
}

/* ============================================================================
   FORM ELEMENTS (platform-styled)
   ============================================================================ */

.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-family: var(--gc-font-display);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--gc-text-color-secondary);
    margin-bottom: 6px;
}

.form-input {
    width: 100%;
    background: var(--gc-bg-input);
    border: 2px solid var(--platform-border);
    border-radius: var(--gc-radius-md);
    padding: 10px 14px;
    color: var(--gc-text-color-primary);
    font-family: var(--gc-font-body);
    font-size: 0.9rem;
    font-weight: 500;
    outline: none;
    transition: border-color 0.2s;
}

.form-input:focus {
    border-color: var(--gc-accent-primary);
}

.form-input::placeholder {
    color: var(--gc-text-color-muted);
}

.form-select {
    width: 100%;
    background: var(--gc-bg-input);
    border: 2px solid var(--platform-border);
    border-radius: var(--gc-radius-md);
    padding: 10px 14px;
    color: var(--gc-text-color-primary);
    font-family: var(--gc-font-body);
    font-size: 0.9rem;
    font-weight: 500;
    outline: none;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpolyline points='6,9 12,15 18,9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* ============================================================================
   LOADING SKELETONS
   ============================================================================ */

.skeleton {
    background: linear-gradient(90deg, var(--gc-bg-elevated) 25%, var(--gc-bg-active) 50%, var(--gc-bg-elevated) 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s infinite;
    border-radius: var(--gc-radius-md);
}

@keyframes skeleton-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-text {
    height: 14px;
    margin-bottom: 8px;
}

.skeleton-text-lg {
    height: 32px;
    width: 120px;
    margin-bottom: 8px;
}

.skeleton-card {
    height: 160px;
}

.skeleton-row {
    height: 56px;
    margin-bottom: 2px;
}

/* ============================================================================
   EMPTY STATES
   ============================================================================ */

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.empty-state-icon {
    width: 48px;
    height: 48px;
    color: var(--gc-text-color-muted);
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state-title {
    font-family: var(--gc-font-display);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--gc-text-color-primary);
    margin-bottom: 8px;
}

.empty-state-desc {
    font-size: 0.9rem;
    color: var(--gc-text-color-muted);
    max-width: 360px;
    margin-bottom: 20px;
}

/* ============================================================================
   SECTION HEADERS
   ============================================================================ */

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

.section-title {
    font-family: var(--gc-font-display);
    font-size: 1.2rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gc-text-color-primary);
}

.section-subtitle {
    font-size: 0.8rem;
    color: var(--gc-text-color-muted);
}

.section-link {
    font-family: var(--gc-font-display);
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--gc-accent-primary);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    transition: opacity 0.15s;
}

.section-link:hover {
    opacity: 0.8;
}

/* ============================================================================
   CONTENT PANELS (two-column dashboard layout)
   ============================================================================ */

.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 24px;
}

.panel {
    background: var(--gc-bg-panel);
    border: 2px solid var(--platform-border);
    border-radius: var(--gc-radius-lg);
    overflow: hidden;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 2px solid var(--platform-border);
}

.panel-title {
    font-family: var(--gc-font-display);
    font-size: 0.85rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--gc-text-color-primary);
}

.panel-body {
    padding: 16px 20px;
}

.panel-body-flush {
    padding: 0;
}

/* ============================================================================
   LIVE GAME STRIP
   ============================================================================ */

.live-strip {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 4px 0;
    margin-bottom: 24px;
    scrollbar-width: none;
}

.live-strip::-webkit-scrollbar {
    display: none;
}

.live-card {
    flex-shrink: 0;
    background: var(--gc-bg-panel);
    border: 2px solid var(--platform-border);
    border-radius: var(--gc-radius-lg);
    padding: 16px;
    min-width: 260px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.live-card:hover {
    border-color: var(--gc-status-errorBorder);
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.15);
}

.live-card-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 10px;
}

.live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ef4444;
    animation: pulse-dot 1.5s infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.8); }
}

.live-card-teams {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.live-card-team {
    display: flex;
    align-items: center;
    gap: 8px;
}

.live-card-team img {
    width: 28px;
    height: 28px;
    object-fit: contain;
}

.live-card-team-name {
    font-family: var(--gc-font-display);
    font-weight: 700;
    font-size: 0.9rem;
}

.live-card-score {
    font-family: var(--gc-font-display);
    font-weight: 800;
    font-size: 1.3rem;
    color: var(--gc-text-color-primary);
    text-align: center;
    min-width: 40px;
}

.live-card-meta {
    font-size: 0.72rem;
    color: var(--gc-text-color-muted);
    text-align: center;
    margin-top: 6px;
}

/* ============================================================================
   UPCOMING GAMES STRIP
   ============================================================================ */

.upcoming-strip {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 4px 0;
    scrollbar-width: none;
}

.upcoming-strip::-webkit-scrollbar {
    display: none;
}

.upcoming-card {
    flex-shrink: 0;
    background: var(--gc-bg-panel);
    border: 2px solid var(--platform-border);
    border-radius: var(--gc-radius-lg);
    padding: 14px 18px;
    min-width: 220px;
    transition: all 0.2s;
    cursor: pointer;
}

.upcoming-card:hover {
    border-color: var(--gc-accent-primaryGlow);
    box-shadow: 0 0 20px var(--platform-purple-glow);
}

.upcoming-card-date {
    font-family: var(--gc-font-display);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--gc-accent-primary);
    margin-bottom: 8px;
}

.upcoming-card-matchup {
    display: flex;
    align-items: center;
    gap: 8px;
}

.upcoming-card-matchup img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.upcoming-card-vs {
    font-family: var(--gc-font-display);
    font-weight: 700;
    font-size: 0.75rem;
    color: var(--gc-text-color-muted);
}

.upcoming-card-info {
    font-size: 0.75rem;
    color: var(--gc-text-color-muted);
    margin-top: 6px;
}

/* ============================================================================
   ACTIVITY FEED
   ============================================================================ */

.activity-list {
    list-style: none;
}

.activity-item {
    display: flex;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--platform-border);
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--gc-radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

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

.activity-icon-green {
    background: var(--gc-status-successMuted);
    color: var(--gc-status-success);
}

.activity-icon-purple {
    background: var(--platform-purple-dim);
    color: var(--platform-purple);
}

.activity-icon-gold {
    background: var(--gc-status-warningMuted);
    color: var(--gc-status-warning);
}

.activity-icon-blue {
    background: var(--gc-status-infoMuted);
    color: var(--gc-status-info);
}

.activity-icon-red {
    background: var(--gc-status-errorMuted);
    color: var(--gc-status-error);
}

.activity-content {
    flex: 1;
    min-width: 0;
}

.activity-text {
    font-size: 0.85rem;
    color: var(--gc-text-color-primary);
    line-height: 1.4;
}

.activity-text strong {
    font-weight: 600;
}

.activity-time {
    font-size: 0.72rem;
    color: var(--gc-text-color-muted);
    margin-top: 2px;
}

/* ============================================================================
   QUICK ACTIONS
   ============================================================================ */

.quick-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.quick-action-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: var(--gc-bg-elevated);
    border: 2px solid var(--platform-border);
    border-radius: var(--gc-radius-md);
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
    color: inherit;
}

.quick-action-btn:hover {
    border-color: var(--gc-accent-primary);
    background: var(--gc-accent-primaryMuted);
}

.quick-action-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--gc-radius-md);
    background: var(--gc-accent-primaryMuted);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gc-accent-primary);
    flex-shrink: 0;
}

.quick-action-icon svg {
    width: 16px;
    height: 16px;
}

.quick-action-label {
    font-family: var(--gc-font-display);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--gc-text-color-primary);
}

/* ============================================================================
   ALERTS PANEL
   ============================================================================ */

.alert-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: var(--gc-radius-md);
    margin-bottom: 6px;
    font-size: 0.85rem;
    transition: background 0.15s;
}

.alert-item:hover {
    background: var(--gc-bg-hover);
}

.alert-item-warning {
    border-left: 3px solid var(--gc-status-warning);
}

.alert-item-error {
    border-left: 3px solid var(--gc-status-error);
}

.alert-item-icon {
    flex-shrink: 0;
}

.alert-item-icon svg {
    width: 16px;
    height: 16px;
}

.alert-item-warning .alert-item-icon {
    color: var(--gc-status-warning);
}

.alert-item-error .alert-item-icon {
    color: var(--gc-status-error);
}

.alert-item-text {
    flex: 1;
    color: var(--gc-text-color-secondary);
}

.alert-item-action {
    font-family: var(--gc-font-display);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--gc-accent-primary);
    text-decoration: none;
    white-space: nowrap;
}

.alert-item-action:hover {
    text-decoration: underline;
}

/* ============================================================================
   PROGRESS BAR
   ============================================================================ */

.progress-bar {
    width: 100%;
    height: 6px;
    background: var(--gc-bg-elevated);
    border-radius: var(--gc-radius-full);
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--gc-accent-primary), #c084fc);
    border-radius: var(--gc-radius-full);
    transition: width 0.4s ease;
}

/* ============================================================================
   TABS
   ============================================================================ */

.tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--platform-border-strong);
    margin-bottom: 20px;
}

.tab {
    padding: 12px 20px;
    font-family: var(--gc-font-display);
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gc-text-color-muted);
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.15s;
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
    white-space: nowrap;
}

.tab:hover {
    color: var(--gc-text-color-primary);
}

.tab.active {
    color: var(--gc-accent-primary);
    border-bottom-color: var(--gc-accent-primary);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* ============================================================================
   THEME TOGGLE
   ============================================================================ */

.theme-toggle {
    background: none;
    border: none;
    color: var(--gc-text-color-muted);
    cursor: pointer;
    padding: 8px;
    border-radius: var(--gc-radius-md);
    transition: all 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle:hover {
    color: var(--gc-text-color-primary);
    background: var(--gc-bg-hover);
}

.theme-toggle svg {
    width: 20px;
    height: 20px;
}

.theme-toggle .sun-icon { display: none; }
.theme-toggle .moon-icon { display: block; }
body.light-mode .theme-toggle .sun-icon,
html[data-theme="platform-light"] .theme-toggle .sun-icon { display: block; }
body.light-mode .theme-toggle .moon-icon,
html[data-theme="platform-light"] .theme-toggle .moon-icon { display: none; }

/* ============================================================================
   LIGHT MODE OVERRIDES
   ============================================================================
   Most styles auto-adapt via var(--gc-*) tokens. These fix the few
   hardcoded rgba values that assume a dark background.
   ============================================================================ */

html[data-theme="platform-light"] .badge-neutral {
    background: rgba(0, 0, 0, 0.05);
}

html[data-theme="platform-light"] .stat-card {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

html[data-theme="platform-light"] .stat-card:hover,
html[data-theme="platform-light"] .entity-card:hover,
html[data-theme="platform-light"] .upcoming-card:hover {
    box-shadow: 0 4px 16px rgba(147, 51, 234, 0.12);
}

html[data-theme="platform-light"] .btn-primary:hover {
    box-shadow: 0 2px 12px rgba(147, 51, 234, 0.2);
}

html[data-theme="platform-light"] .modal-backdrop {
    background: rgba(0, 0, 0, 0.35);
}

/* SIDEBAR ALWAYS DARK — sidebar keeps dark palette in all modes */
html[data-theme="platform-light"] .sidebar {
    background: #0d1117;
    border-right-color: rgba(255, 255, 255, 0.12);
    box-shadow: none;
}

html[data-theme="platform-light"] .sidebar .sidebar-header {
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

html[data-theme="platform-light"] .sidebar .sidebar-footer {
    border-top-color: rgba(255, 255, 255, 0.1);
}

html[data-theme="platform-light"] .sidebar .nav-section-title {
    color: #8b949e;
}

html[data-theme="platform-light"] .sidebar .nav-item {
    color: #c9d1d9;
}

html[data-theme="platform-light"] .sidebar .nav-item:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.06);
}

html[data-theme="platform-light"] .sidebar .nav-item.active {
    color: var(--gc-accent-primary);
    background: rgba(168, 85, 247, 0.12);
}

html[data-theme="platform-light"] .sidebar .league-selector {
    background: rgba(255, 255, 255, 0.04);
}

html[data-theme="platform-light"] .sidebar .league-selector:hover {
    background: rgba(255, 255, 255, 0.08);
}

html[data-theme="platform-light"] .sidebar .league-name,
html[data-theme="platform-light"] .sidebar .user-name {
    color: #ffffff;
}

html[data-theme="platform-light"] .sidebar .league-season,
html[data-theme="platform-light"] .sidebar .user-role {
    color: #8b949e;
}

html[data-theme="platform-light"] .sidebar .league-chevron,
html[data-theme="platform-light"] .sidebar .chevron,
html[data-theme="platform-light"] .sidebar .sidebar-toggle {
    color: #8b949e;
}

html[data-theme="platform-light"] .sidebar .sidebar-toggle:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
}

html[data-theme="platform-light"] .sidebar .user-menu:hover {
    background: rgba(255, 255, 255, 0.06);
}

html[data-theme="platform-light"] .sidebar .user-dropdown {
    background: #161b22;
    border-color: rgba(255, 255, 255, 0.12);
}

html[data-theme="platform-light"] .sidebar .dropdown-item {
    color: #c9d1d9;
}

html[data-theme="platform-light"] .sidebar .dropdown-item:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #ffffff;
}

/* Sidebar logo: show light logo in light mode, dark logo in dark mode */
body.light-mode .sidebar-logo .logo-dark { display: none; }
body.light-mode .sidebar-logo .logo-light { display: block; }

html[data-theme="platform-light"] .sidebar .sidebar-logo .logo-dark {
    display: block;
}

html[data-theme="platform-light"] .sidebar .sidebar-logo .logo-light {
    display: none;
}

/* User/league avatar: deeper purple for light bg (main content only) */
html[data-theme="platform-light"] .main-content .user-avatar,
html[data-theme="platform-light"] .main-content .league-avatar {
    background: linear-gradient(135deg, #9333ea, #7c3aed);
}

/* Override custom props for light mode contrast */
html[data-theme="platform-light"],
body.light-mode {
    --platform-purple: #9333ea;
    --platform-purple-hover: #7c3aed;
    --platform-purple-dim: rgba(147, 51, 234, 0.1);
    --platform-purple-glow: rgba(147, 51, 234, 0.15);
    --platform-border: rgba(0, 0, 0, 0.12);
    --platform-border-strong: rgba(0, 0, 0, 0.18);

    /* Legacy variable aliases — light mode overrides */
    --bg-primary: #f5f5f7;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --bg-card-hover: #f9fafb;
    --bg-elevated: #f3f4f6;
    --border-primary: rgba(0, 0, 0, 0.14);
    --border-hover: rgba(0, 0, 0, 0.22);
    --text-primary: #111827;
    --text-secondary: #4b5563;
    --text-muted: #9ca3af;
}

/* Sidebar separator for light mode */
html[data-theme="platform-light"] .sidebar,
body.light-mode .sidebar {
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.05);
}

body.light-mode .card {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* Top bar for light mode */
html[data-theme="platform-light"] .top-bar,
body.light-mode .top-bar {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.05);
}

/* ============================================================================
   STAGGERED ANIMATIONS
   ============================================================================ */

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

.animate-in {
    animation: fadeInUp 0.3s ease forwards;
    opacity: 0;
}

.animate-in:nth-child(1) { animation-delay: 0ms; }
.animate-in:nth-child(2) { animation-delay: 60ms; }
.animate-in:nth-child(3) { animation-delay: 120ms; }
.animate-in:nth-child(4) { animation-delay: 180ms; }
.animate-in:nth-child(5) { animation-delay: 240ms; }
.animate-in:nth-child(6) { animation-delay: 300ms; }
.animate-in:nth-child(7) { animation-delay: 360ms; }
.animate-in:nth-child(8) { animation-delay: 420ms; }

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

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

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

@media (max-width: 1023px) {
    .sidebar {
        width: var(--sidebar-collapsed);
    }

    .sidebar .nav-item-text,
    .sidebar .nav-section-title,
    .sidebar .nav-item-badge,
    .sidebar .league-selector,
    .sidebar .user-info,
    .sidebar .chevron,
    .sidebar .sidebar-logo img {
        opacity: 0;
        width: 0;
        overflow: hidden;
    }

    .main-content {
        margin-left: var(--sidebar-collapsed);
    }

    .top-bar {
        padding: 0 20px;
    }

    .page-content {
        padding: 24px;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        width: var(--sidebar-width);
        z-index: 200;
    }

    .sidebar.mobile-open {
        transform: translateX(0);
    }

    .sidebar .nav-item-text,
    .sidebar .nav-section-title,
    .sidebar .nav-item-badge,
    .sidebar .league-selector,
    .sidebar .user-info,
    .sidebar .chevron,
    .sidebar .sidebar-logo img {
        opacity: 1;
        width: auto;
    }

    .main-content {
        margin-left: 0;
    }

    .stat-cards {
        grid-template-columns: repeat(2, 1fr);
    }

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

    .quick-actions {
        grid-template-columns: 1fr;
    }

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

    .controls-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .search-wrapper {
        max-width: 100%;
    }

    .top-bar {
        padding: 0 16px;
    }

    .page-content {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .stat-cards {
        grid-template-columns: 1fr;
    }

    .stat-card-value {
        font-size: 2rem;
    }
}
