/* ============================================================================
   UNIFIED PRO NAVIGATION SYSTEM (Glassmorphism + Premium Dark)
   ============================================================================ */

:root {
    --nav-height: 72px;
    --nav-height-mobile: 60px;
    --sidebar-width: 280px;
    
    /* Inherit from global but provide fallbacks */
    --nav-glass: hsla(240, 10%, 4%, 0.85);
    --nav-border: hsla(0, 0%, 100%, 0.08);
}

/* Base Mobile Height Overrides */
@media (max-width: 991px) {
    .pro-header, header.header, .header { height: var(--nav-height-mobile) !important; }
    .pro-bottom-nav { height: var(--nav-height-mobile) !important; }
}

/* Strong mobile overrides (ensure density changes apply) */
@media (max-width: 991px) {
    .pro-header, header.header, .header { 
        height: 56px !important; 
        padding: 0 0.6rem !important; 
        display: flex !important;
        align-items: center !important;
    }
    .pro-bottom-nav, .pro-bottom-nav.mobile-only { height: 56px !important; }
    body:not(.no-bottom-spacing) { padding-bottom: 72px !important; }
    .user-avatar-sm { width: 32px !important; height: 32px !important; }
}

/* 🛡️ Legacy Navigation Shield: Prevent old UI from surfacing on dashboards */
.dashboard-view #loggedInNav, 
.dashboard-view #loggedOutNav, 
.dashboard-view .nav-buttons:not(.pro-header .nav-buttons),
.dashboard-view .user-info:not(.pro-header .user-info) {
    display: none !important;
}

@media (max-width: 991px) {
    .side-menu-trigger { 
        width: 40px !important; 
        height: 40px !important; 
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        margin-right: 0.75rem !important;
        background: rgba(255,255,255,0.05) !important;
        border-radius: 10px !important;
        border: 1px solid rgba(255,255,255,0.1) !important;
        flex-shrink: 0 !important;
        cursor: pointer !important;
    }
    .side-menu-trigger svg, .side-menu-trigger i {
        width: 22px !important;
        height: 22px !important;
        font-size: 1.2rem !important;
    }    
    .action-btn { 
        width: 36px !important; 
        height: 36px !important; 
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
}


/* Desktop Overrides (Standardize 992px Breakpoint) */
@media (min-width: 992px) {
    /* Fixed/Transparent for Landing Page */
    .clubhub-unified:not(.dashboard-view) .pro-header, 
    .clubhub-unified:not(.dashboard-view) header.header {
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        z-index: 1000 !important;
        background: transparent !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        border-bottom: 1px solid transparent !important;
        display: block !important;
        padding: 0 3rem !important;
        height: 100px !important; /* Taller home header */
    }

    /* Fixed/Solid for Dashboards */
    .dashboard-view .pro-header, 
    .dashboard-view header.header {
        position: fixed !important;
        top: 0 !important;
        left: 280px !important; 
        width: calc(100% - 280px) !important;
        padding: 0 2rem !important;
        height: 72px !important;
        display: flex !important;
        align-items: center !important;
        z-index: 100 !important;
        background: rgba(10, 10, 12, 0.8) !important;
        backdrop-filter: blur(20px) !important;
        -webkit-backdrop-filter: blur(20px) !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1), width 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    }

    .pro-header .nav-container { display: flex !important; }
    .desktop-only { display: inline-flex !important; }
    .mobile-only { display: none !important; }

    /* Force Sidebar to be visible ONLY on actual dashboards */
    .dashboard-view .pro-sidebar {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        left: 0 !important;
        transform: none !important;
        position: fixed !important;
        width: 280px; /* Default width */
        transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
    }

    .dashboard-view .sidebar-overlay {
        display: none !important;
    }

    .pro-bottom-nav, .side-menu-trigger {
        display: none !important;
    }


    /* Remove centering/max-width on dashboards to fix gap */
    .dashboard-view .container,
    .dashboard-view .dashboard-container {
        max-width: none !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        width: 100% !important;
        padding-left: 2.5rem !important;
        padding-right: 2.5rem !important;
    }

    .dashboard-view .main, 
    .dashboard-view .dashboard-main,
    .dashboard-view .app-container {
        padding-top: 80px !important;
        margin-left: 280px !important; /* Sidebar width — use margin, not padding */
        width: calc(100% - 280px) !important;
        transition: margin-left 0.28s cubic-bezier(0.16, 1, 0.3, 1), width 0.28s cubic-bezier(0.16, 1, 0.3, 1) !important;
    }

    /* Global Catch-All: Offset any direct container if sidebar is present */
    .dashboard-view .container:not(.pro-header .container) {
        margin-left: 0 !important;
        margin-right: auto !important;
    }

    body.sidebar-collapsed .dashboard-view .main,
    body.sidebar-collapsed .dashboard-view .dashboard-main {
        margin-left: 72px !important;
        width: calc(100% - 72px) !important;
    }

    body.has-top-tabs .main, 
    body.has-top-tabs .dashboard-main {
        padding-top: 130px !important;
    }

    /* Dashboard Header Left/Right alignment */
    .dash-header-left {
        display: flex !important;
        align-items: center !important;
        gap: 1.5rem !important;
    }

    .dash-header-right {
        display: flex !important;
        align-items: center !important;
        gap: 1rem !important;
        margin-left: auto !important; /* Forces right alignment in flex nav */
    }

    /* ── NAV ICON BASE STYLES ─────────────────────────────────────────────── */
    .nav-icon {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 20px;
        height: 20px;
        flex-shrink: 0;
        margin-right: 12px;
        color: inherit;
        opacity: 0.7;
        transition: opacity 0.2s;
    }

    .nav-icon svg {
        width: 18px;
        height: 18px;
        display: block;
    }

    .sidebar-link:hover .nav-icon,
    .sidebar-link.active .nav-icon {
        opacity: 1;
    }

    .sidebar-link {
        display: flex !important;
        align-items: center !important;
        padding: 12px 18px !important;
        border-radius: 12px !important;
        font-size: 0.95rem !important;
        font-weight: 600 !important;
        letter-spacing: -0.01em;
        transition: background 0.15s, color 0.15s, transform 0.1s !important;
        position: relative;
        margin-bottom: 4px !important;
        color: rgba(255,255,255,0.65) !important;
        text-decoration: none !important;
    }

    .sidebar-link:hover {
        background: rgba(220, 38, 38, 0.12) !important;
        color: rgba(255,255,255,0.95) !important;
    }

    .sidebar-link.active {
        background: rgba(220, 38, 38, 0.85) !important;
        color: #fff !important;
        box-shadow: 0 4px 20px rgba(220, 38, 38, 0.35) !important;
    }

    .sidebar-link.active .nav-icon {
        opacity: 1 !important;
        color: #fff !important;
    }

    .sidebar-link .nav-icon {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 24px !important;
        height: 24px !important;
        margin-right: 12px !important;
        flex-shrink: 0 !important;
    }

    .sidebar-link span {
        white-space: nowrap;
        overflow: hidden;
        transition: opacity 0.2s, max-width 0.25s;
        opacity: 1;
        max-width: 200px;
    }

    /* ── COLLAPSED SIDEBAR ────────────────────────────────────────────────── */
    body.sidebar-collapsed .pro-sidebar {
        width: 72px !important;
    }

    body.sidebar-collapsed .pro-header,
    body.sidebar-collapsed header.header {
        left: 72px !important;
        width: calc(100% - 72px) !important;
    }

    body.sidebar-collapsed .main,
    body.sidebar-collapsed .dashboard-main,
    body.sidebar-collapsed main {
        margin-left: 72px !important;
        width: calc(100% - 72px) !important;
    }

    /* Hide text in collapsed state */
    body.sidebar-collapsed .sidebar-link span {
        display: none !important;
    }

    body.sidebar-collapsed .pro-sidebar .nav-group-title,
    body.sidebar-collapsed .pro-sidebar .sidebar-header > div > span,
    body.sidebar-collapsed .pro-sidebar .sidebar-group-switcher-area,
    body.sidebar-collapsed .pro-sidebar .sidebar-profile-switcher-area,
    body.sidebar-collapsed .pro-sidebar .group-info,
    body.sidebar-collapsed .pro-sidebar .group-switcher-arrow,
    body.sidebar-collapsed .sidebar-link .fa-chevron-right,
    body.sidebar-collapsed .sidebar-link .fa-chevron-down {
        display: none !important;
    }

    body.sidebar-collapsed .sidebar-link {
        justify-content: center !important;
        padding: 12px !important;
        border-radius: 12px !important;
        margin: 4px 10px !important;
        width: auto !important;
    }

    body.sidebar-collapsed .nav-icon {
        margin-right: 0 !important;
        opacity: 0.8;
        width: 24px !important;
        height: 24px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    body.sidebar-collapsed .nav-icon svg,
    body.sidebar-collapsed .nav-icon i {
        width: 20px !important;
        height: 20px !important;
        font-size: 20px !important;
    }

    body.sidebar-collapsed .sidebar-link.active {
        background: #b91c1c !important; /* Darker red */
        box-shadow: 0 4px 15px rgba(185, 28, 28, 0.4) !important;
    }

    body.sidebar-collapsed .sidebar-link.active .nav-icon {
        opacity: 1 !important;
        color: #fff !important;
    }

    body.sidebar-collapsed .sidebar-link.active .nav-icon svg,
    body.sidebar-collapsed .sidebar-link.active .nav-icon i {
        width: 22px !important;
        height: 22px !important;
        font-size: 22px !important;
    }

    body.sidebar-collapsed .sidebar-sublink {
        padding-left: 12px !important; /* Reset indentation when collapsed */
    }

    /* Icon-only tooltip on hover when collapsed */
    body.sidebar-collapsed .sidebar-link::after {
        content: attr(data-tooltip);
        position: absolute;
        left: calc(100% + 12px);
        top: 50%;
        transform: translateY(-50%);
        background: rgba(20, 20, 22, 0.95);
        border: 1px solid rgba(255,255,255,0.1);
        color: white;
        font-size: 0.75rem;
        font-weight: 600;
        padding: 5px 10px;
        border-radius: 8px;
        white-space: nowrap;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.15s;
        backdrop-filter: blur(10px);
        z-index: 9999;
    }

    body.sidebar-collapsed .sidebar-link:hover::after {
        opacity: 1;
    }

    body.sidebar-collapsed .pro-sidebar .sidebar-header {
        padding: 1.25rem 0 !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        width: 100% !important;
    }

    body.sidebar-collapsed .pro-sidebar .sidebar-footer {
        padding: 0.75rem 0 !important;
    }

    /* ── SIDEBAR HEADER LOGO HIDE IN COLLAPSED ──────────────────────────── */
    body.sidebar-collapsed .sidebar-header .logo-area,
    body.sidebar-collapsed .sidebar-header > div > img {
        display: none !important;
    }

    /* ── SMOOTH TRANSITIONS ──────────────────────────────────────────────── */
    .pro-sidebar {
        transition: width 0.28s cubic-bezier(0.16, 1, 0.3, 1) !important;
    }
    .main, .dashboard-main, main, .pro-header, header.header {
        transition: padding-left 0.28s cubic-bezier(0.16, 1, 0.3, 1),
                    left 0.28s cubic-bezier(0.16, 1, 0.3, 1),
                    width 0.28s cubic-bezier(0.16, 1, 0.3, 1) !important;
    }
    .sidebar-link span, .nav-icon {
        transition: opacity 0.2s, max-width 0.25s, margin 0.2s !important;
    }
}

/* Mobile Breakpoint (0-991px) */
@media (max-width: 991px) {
    .desktop-only { display: none !important; }
    .mobile-only { display: block !important; }
    
    /* Ensure mobile-specific UI components are available but not necessarily visible */
    .pro-sidebar, .sidebar-overlay {
        display: block !important;
        /* Toggle state is handled by .active class and base styles below */
    }
    
    .pro-bottom-nav, .side-menu-trigger {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        pointer-events: auto !important;
    }
}

/* Mobile: hide sidebar and ensure header + bottom nav visible and touch-friendly */
@media (max-width: 991px) {
    /* Hide sidebar by default on mobile, but allow .active to override */
    .pro-sidebar { 
        position: fixed !important;
        top: 0 !important;
        left: -100% !important;
        width: 85% !important;
        max-width: 300px !important;
        height: 100% !important;
        background: #0a0a0c !important;
        z-index: 6000 !important;
        transition: left 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
        box-shadow: 20px 0 50px rgba(0,0,0,0.5) !important;
        display: flex !important;
        flex-direction: column !important;
    }
    .pro-sidebar.active { left: 0 !important; display: flex !important; }

    .sidebar-overlay {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 100% !important;
        background: rgba(0,0,0,0.7) !important;
        backdrop-filter: blur(4px) !important;
        z-index: 5500 !important;
        display: none !important;
    }
    .sidebar-overlay.active { display: block !important; }

    header.header, .pro-header { left: 0 !important; width: 100% !important; height: 56px !important; padding: 0 0.75rem !important; }
    .pro-bottom-nav { display: flex !important; position: fixed !important; left: 0; right: 0; bottom: 0; height: 56px; z-index: 5000; }
    .pro-bottom-nav .bottom-nav-container { max-width: 720px; margin: 0 auto; }
}

/* Enforce full-width, touch-friendly bottom nav on mobile and small screens */
@media (max-width: 991px) {
    .pro-bottom-nav {
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        padding: 6px 8px !important;
        box-sizing: border-box !important;
        pointer-events: auto !important;
    }

    .pro-bottom-nav .bottom-nav-container {
        width: 100% !important;
        display: flex !important;
        justify-content: space-around !important;
        align-items: center !important;
        gap: 0.5rem !important;
        padding: 0 0.75rem !important;
    }

    .pro-bottom-nav .bottom-nav-link {
        flex: 1 1 auto !important;
        display: inline-flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 4px !important;
        padding: 6px 6px !important;
        min-width: 52px !important;
        color: inherit !important;
        text-decoration: none !important;
        -webkit-tap-highlight-color: rgba(0,0,0,0.15) !important;
    }

    .pro-bottom-nav .bottom-nav-link svg { width: 20px !important; height: 20px !important; }

    .pro-bottom-nav .bottom-nav-link.active { color: var(--primary) !important; }

    /* Ensure page content doesn't get hidden below nav */
    body:not(.no-bottom-spacing) { padding-bottom: 72px !important; }
}

/* Mobile: Pro header polish */
@media (max-width: 991px) {
    .pro-header, header.header {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 56px !important;
        padding: 0 0.85rem !important;
        display: flex !important;
        align-items: center !important;
        background: linear-gradient(90deg, rgba(12,12,14,0.98), rgba(22,22,24,0.96)) !important;
        border-bottom: 1px solid rgba(255,255,255,0.04) !important;
        box-shadow: 0 8px 30px rgba(0,0,0,0.6) !important;
        z-index: 5000 !important;
        backdrop-filter: blur(10px) !important;
    }

    .pro-header .nav-container,
    header.header .nav-container,
    .nav.container {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        width: 100% !important;
        max-width: none !important;
        padding: 0 !important;
        gap: 0.5rem !important;
    }

    .logo-area-wrapper.mobile-only { display: flex !important; align-items: center !important; gap: 0.5rem !important; }

    .side-menu-trigger {
        width: 44px !important;
        height: 44px !important;
        border-radius: 12px !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        background: rgba(255,255,255,0.05) !important;
        border: 1px solid rgba(255,255,255,0.1) !important;
        padding: 0 !important;
        transition: transform 0.2s, background 0.2s !important;
    }
    .side-menu-trigger:active { transform: scale(0.92); background: rgba(255,255,255,0.1) !important; }

    .logo { display:flex !important; align-items:center !important; gap:0.5rem !important; }
    .logo .logo-text, .logo-text { font-size: 1rem !important; color: #fff !important; font-weight: 800 !important; }

    .dash-header-right { display:flex !important; align-items:center !important; gap:0.5rem !important; }
    .user-profile-trigger { padding: 5px 8px !important; border-radius: 9px !important; }
    .user-avatar-sm { width: 32px !important; height: 32px !important; border-radius: 8px !important; }

    /* Make back-button more visible on mobile */
    .back-button.mobile-only { font-size: 1.15rem !important; color: #fff !important; background: rgba(255,255,255,0.02) !important; border-radius: 8px !important; padding: 0.5rem !important; }

    /* Bottom navigation: polished pro look */
    .pro-bottom-nav.mobile-only {
        position: fixed !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        height: 56px !important;
        background: linear-gradient(180deg, rgba(10,10,12,0.95), rgba(6,6,8,0.95)) !important;
        border-top: 1px solid rgba(255,255,255,0.04) !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        z-index: 4500 !important;
        box-shadow: 0 -8px 20px rgba(0,0,0,0.6) !important;
    }

    .pro-bottom-nav .bottom-nav-container {
        display: flex !important;
        gap: 0.75rem !important;
        width: 100% !important;
        max-width: 640px !important;
        padding: 0 1rem !important;
        justify-content: space-between !important;
        align-items: center !important;
    }

    .pro-bottom-nav .bottom-nav-link {
        color: rgba(255,255,255,0.95) !important;
        text-decoration: none !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        font-size: 0.75rem !important;
        gap: 0.25rem !important;
    }

    /* Ensure page content isn't hidden behind bottom nav */
    body:not(.no-bottom-spacing) { padding-bottom: 64px !important; }
}

/* --- Global Header (Standardized) --- */
.pro-header, header.header {
    height: 80px;
    background: rgba(8, 8, 10, 0.8) !important;
    backdrop-filter: blur(30px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(30px) saturate(180%) !important;
    border-bottom: 1px solid var(--glass-border) !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    z-index: 3500 !important; /* Above everything */
    display: flex !important;
    align-items: center !important;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.pro-header .nav-container,
header.header .nav,
header.header .nav-container,
.nav.container {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
    height: 100% !important;
    max-width: 1400px; /* Base for landing */
    margin: 0 auto;
    padding: 0 2rem !important;
}

.dashboard-view .pro-header .nav-container,
.dashboard-view header.header .nav,
.dashboard-view header.header .nav-container,
.dashboard-view .nav.container {
    max-width: none !important;
    margin: 0 !important;
    padding-left: 2rem !important;
    padding-right: 2rem !important;
}

.header-center {
    display: none !important;
}

.pro-header .logo-area {
    display: flex !important;
    align-items: center !important;
    gap: 0.75rem !important;
    cursor: pointer !important;
    z-index: 10;
}

.logo-img {
    height: 34px !important;
    width: auto !important;
    filter: drop-shadow(0 0 10px rgba(220, 38, 38, 0.4));
}

.logo-text {
    font-family: 'Outfit', sans-serif !important;
    font-weight: 800 !important;
    font-size: 1.3rem !important;
    letter-spacing: -0.5px !important;
    color: #fff !important;
}

/* --- Header Actions --- */
.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.action-btn {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-main);
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.action-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(220, 38, 38, 0.3);
    transform: translateY(-2px);
}

@media (max-width: 991px) {
    /* Ensure group switcher is correctly sized on mobile */
    #header-group-switcher-container {
        display: flex !important;
        align-items: center !important;
        max-width: 130px !important;
        overflow: hidden !important;
    }
    
    #header-group-switcher-container .group-switcher-btn {
        padding: 4px 6px !important;
        font-size: 0.75rem !important;
        height: 28px !important;
    }
}

.action-btn .badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--primary);
    color: white;
    font-size: 10px;
    font-weight: 800;
    min-width: 18px;
    height: 18px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--bg-dark);
}

.user-profile-trigger {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.user-profile-trigger:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(220, 38, 38, 0.2);
}

.user-profile-trigger .user-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-main);
}

.user-avatar-sm {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--primary), #991b1b);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    color: #fff;
    font-size: 0.8rem;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.2);
}

/* --- Mode Switcher (Aligned Left) --- */
.mode-toggle-container {
    display: flex !important;
    align-items: center !important;
    gap: 0.75rem !important;
    margin: 0 1.5rem !important;
}

.header-mode-toggle {
    display: flex;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    padding: 3px;
    border-radius: 100px;
    gap: 3px;
}

.mode-pill {
    padding: 6px 14px;
    border-radius: 100px;
    font-size: 0.65rem;
    font-weight: 900;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    color: rgba(255, 255, 255, 0.3);
    text-transform: uppercase;
    letter-spacing: 1px;
    white-space: nowrap;
}

.mode-pill.active {
    background: #fff;
    color: #000;
}

.mode-pill:not(.active):hover {
    color: #fff;
    background: rgba(255,255,255,0.08);
}

/* --- Hamburger (Menu Trigger) --- */
.side-menu-trigger {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 16px;
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    color: rgba(255, 255, 255, 0.92);
    margin-right: 1rem;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 18px 35px rgba(0, 0, 0, 0.18);
    backdrop-filter: blur(20px);
}

.side-menu-trigger:hover {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.22);
    transform: scale(1.05);
}

.hamburger-box {
    width: 20px;
    height: 14px;
    display: inline-block;
    position: relative;
}

.hamburger-inner, .hamburger-inner::before, .hamburger-inner::after {
    width: 20px;
    height: 2px;
    background-color: currentColor;
    border-radius: 4px;
    position: absolute;
    transition: transform 0.15s ease;
}

.hamburger-inner {
    top: 50%;
    transform: translateY(-50%);
}

.hamburger-inner::before {
    content: "";
    top: -6px;
}

/* Final desktop-safe overrides (placed at end to win cascade) */
/* Removed redundant desktop override block */

.hamburger-inner::after {
    content: "";
    bottom: -6px;
}

/* --- Profile Dropdown --- */
.pro-dropdown {
    position: absolute;
    top: calc(100% + 12px);
    right: 1.5rem;
    width: 300px;
    background: rgba(15, 15, 18, 0.98);
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 1.5rem;
    z-index: 5000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px) scale(0.98);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
}

.pro-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.dropdown-user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.dropdown-avatar {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--primary), #991b1b);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    color: white;
    font-size: 1.1rem;
}

.dropdown-name {
    font-weight: 700;
    font-size: 1rem;
    color: #fff;
}

.dropdown-role {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.4);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dropdown-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
    margin: 1rem -1.5rem;
}

.dropdown-mode-switcher {
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 14px;
    padding: 4px;
    gap: 4px;
}

.dropdown-mode-pill {
    padding: 0.6rem;
    text-align: center;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    color: rgba(255, 255, 255, 0.4);
}

.dropdown-mode-pill.active {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.dropdown-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: 12px;
    transition: all 0.2s;
}

.dropdown-link:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
}

/* --- Sidebar (Pro Menu) --- */
.pro-sidebar {
    position: fixed;
    top: 0;
    left: -var(--sidebar-width);
    width: var(--sidebar-width);
    height: 100vh;
    background: rgba(10, 10, 12, 0.98);
    backdrop-filter: blur(40px) saturate(200%);
    -webkit-backdrop-filter: blur(40px) saturate(200%);
    border-right: 1px solid var(--glass-border);
    z-index: 5000;
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    display: none;
    flex-direction: column;
    box-shadow: 20px 0 60px rgba(0, 0, 0, 0.8);
}

.pro-sidebar.active {
    transform: translateX(var(--sidebar-width));
    display: flex !important;
    visibility: visible !important;
}

.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(12px);
    z-index: 4500;
    opacity: 0;
    visibility: hidden;
    transition: all 0.5s ease;
    pointer-events: none;
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Mobile Sidebar - Open All The Way (Standardize on 991px breakpoint) */
@media (max-width: 991px) {
    :root {
        --sidebar-width: 100%;
    }
    
    .pro-sidebar {
        border-right: none;
        left: -100%; /* Ensure it starts off-screen */
    }
    
    .pro-sidebar.active {
        transform: translateX(100%);
    }
    
    .sidebar-header {
        padding: 1.5rem !important;
    }

    .sidebar-burger {
        position: absolute !important;
        top: 1.25rem !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        transition: all 0.2s ease;
    }

    .sidebar-burger:hover {
        opacity: 1 !important;
        transform: translateX(-50%) scale(1.1) !important;
    }

    body.sidebar-collapsed .sidebar-burger {
        left: 50% !important;
        margin: 0 !important;
    }
}

/* --- Nav Menu in Sidebar --- */
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 0 1.5rem;
    scrollbar-width: none; /* Hide scrollbar Firefox */
    list-style: none !important;
}

.sidebar-nav ul, .sidebar-nav li {
    list-style: none !important;
    padding: 0;
    margin: 0;
}

.sidebar-nav::-webkit-scrollbar {
    display: none; /* Hide scrollbar Chrome/Safari */
}

.nav-group-title {
    font-size: 0.8rem;
    font-weight: 800;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin: 0.6rem 0 0.25rem;
    padding: 0.65rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    background: rgba(140, 15, 15, 0.85);
    border-radius: 10px;
    border: 1px solid rgba(220, 38, 38, 0.25);
    user-select: none;
    transition: background 0.2s;
}

.nav-group-title:hover {
    background: rgba(180, 20, 20, 0.95);
}

.nav-group-title .group-toggle {
    font-size: 0.75rem;
    opacity: 0.85;
    transition: transform 0.2s;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.85rem 1rem;
    color: rgba(255, 255, 255, 0.65);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 12px;
    transition: all 0.2s ease;
    margin-bottom: 4px;
    border: none;
    background: transparent;
}

.sidebar-link.active {
    background: rgba(220, 38, 38, 0.85) !important;
    color: #fff !important;
    box-shadow: 0 4px 18px rgba(220, 38, 38, 0.3);
}

.sidebar-link i {
    font-size: 1.3rem;
    width: 36px;
    text-align: center;
    opacity: 0.95;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-org-switcher-wrapper {
    margin-left: 0.5rem;
    display: flex;
    align-items: center;
}

@media (max-width: 991px) {
    .header-org-switcher-wrapper {
        display: none; /* Already in sidebar for mobile */
    }
}

.sidebar-burger {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    opacity: 0.85;
    transition: all 0.25s ease;
    width: 48px;
    height: 48px;
    justify-content: center;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 20px 35px rgba(0, 0, 0, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.16);
}

.sidebar-burger:hover {
    opacity: 1;
    transform: scale(1.03);
    background: rgba(255, 255, 255, 0.12);
}

.sidebar-link:hover {
    background: rgba(220, 38, 38, 0.1);
    color: rgba(255,255,255,0.95);
}

.sidebar-link:hover i {
    opacity: 1;
    transform: scale(1.2) rotate(5deg);
}

.sidebar-link.active {
    background: var(--primary) !important;
    color: #fff !important;
    border-radius: 12px;
}

.sidebar-link.active i, .sidebar-link.active span {
    color: #fff !important;
}

/* --- Bottom Navigation --- */
.pro-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 1001;
    background: rgba(10,10,12,0.95);
    backdrop-filter: blur(15px);
    border-top: 1px solid rgba(255,255,255,0.08);
    display: none; /* Hidden by default on desktop */
}

@media (max-width: 991px) {
    .pro-bottom-nav, .app-bottom-nav, .unified-bottom-nav {
        display: flex !important;
    }
    .desktop-only {
        display: none !important;
    }
    .mobile-only {
        display: flex !important;
    }
    .side-menu-trigger.mobile-only,
    .sidebar-burger.mobile-only {
        display: flex !important;
    }
    .dashboard-nav,
    .top-headline-tabs {
        display: none !important;
    }
    .main {
        padding-bottom: 90px !important;
    }
}

.bottom-nav-container {
    display: flex;
    justify-content: space-around;
    align-items: center;
    width: 100%;
    height: 100%;
}

.bottom-nav-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: rgba(255, 255, 255, 0.5);
    text-decoration: none;
    font-size: 0.7rem;
    font-weight: 700;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    flex: 1;
    height: 100%;
}

.bottom-nav-link i, .bottom-nav-link svg {
    font-size: 1.4rem;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    opacity: 0.6;
}

.bottom-nav-link.active {
    color: var(--primary);
}

.bottom-nav-link.active i, .bottom-nav-link.active svg {
    color: var(--primary);
    opacity: 1;
    transform: translateY(-2px) scale(1.1);
}

.bottom-nav-link:active {
    transform: scale(0.92);
}

#pwa-floating-btn, 
#pwa-install-btn, 
.pwa-floating-install {
    display: none !important;
}

/* 📊 Full-Width Tables & Data Grid Polish */
.table-responsive {
    width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    margin-bottom: 1.5rem !important;
}

/* Ensure actions column doesn't squash and is always reachable */
table th:last-child, 
table td:last-child,
[data-label="Actions"] {
    min-width: 120px !important;
    text-align: right !important;
}

.dashboard-main table, 
.dashboard-content table,
.admin-table,
.table-container table,
.glass-card table {
    width: 100% !important;
    min-width: 600px; /* Force scroll on very narrow containers */
    border-collapse: separate !important;
    border-spacing: 0 !important;
}

.dashboard-main .dash-grid,
.dashboard-content .dash-grid {
    width: 100% !important;
    display: grid !important;
    gap: 1.5rem !important;
}

@media (max-width: 991px) {
    .dashboard-main table, 
    .dashboard-content table {
        min-width: auto; /* Allow design-system's card-conversion to take over */
    }
}

/* Hide PWA floating button when bottom nav is present */
@media (max-width: 991px) {
}

.bottom-nav-link {
    border-radius: 18px;
    margin: 0 0.25rem;
    padding: 0.6rem 0.5rem;
    background: rgba(255, 255, 255, 0.04);
    min-width: 62px;
    justify-content: center;
}

.bottom-nav-link span {
    font-size: 0.68rem;
    line-height: 1.2;
    margin-top: 4px;
    color: inherit;
}

.bottom-nav-link:hover {
    background: rgba(255, 255, 255, 0.08);
}

.pro-bottom-nav, .unified-bottom-nav {
    border-top: 1px solid rgba(255,255,255,0.06);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.05), 0 -10px 30px rgba(0, 0, 0, 0.22);
}

.bottom-nav-link i, .bottom-nav-link svg {
    font-size: 1.25rem;
}

@media (max-width: 991px) {
    .pro-bottom-nav {
        display: flex;
    }
    
    .pro-header {
        padding: 0 1rem;
    }
    
    .user-profile-trigger .user-name {
        display: none;
    }
    
    .main {
        padding-bottom: 80px; /* Space for bottom nav */
    }
}

/* --- Responsive Tables (Card Mode) --- */
@media (max-width: 768px) {
    table {
        border: 0 !important;
        background: transparent !important;
    }

    table thead {
        display: none !important;
    }

    table tr {
        display: block !important;
        margin-bottom: 1.25rem !important;
        background: rgba(255, 255, 255, 0.03) !important;
        border: 1px solid rgba(255, 255, 255, 0.08) !important;
        border-radius: 16px !important;
        padding: 1rem !important;
        position: relative !important;
    }

    table td {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        text-align: right !important;
        padding: 0.75rem 0.5rem !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
        font-size: 0.9rem !important;
    }

    .top-headline-tabs {
        display: block !important;
        background: rgba(10, 10, 12, 0.9) !important;
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
        padding: 0.75rem 0 !important;
        position: sticky;
        top: 56px;
        z-index: 100;
        overflow: hidden;
    }

    .top-headline-tabs, .dashboard-nav {
        display: block !important;
        background: rgba(10, 10, 12, 0.9) !important;
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
        padding: 0.75rem 0 !important;
        position: sticky !important;
        top: 56px !important;
        z-index: 100 !important;
        overflow: hidden;
    }

    .tabs-scroll-container, .dashboard-nav-inner {
        display: flex !important;
        flex-direction: row !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        padding: 0 1rem !important;
        gap: 0.75rem !important;
        scrollbar-width: none;
        -ms-overflow-style: none;
        -webkit-overflow-scrolling: touch;
    }

    .tabs-scroll-container::-webkit-scrollbar, .dashboard-nav-inner::-webkit-scrollbar {
        display: none !important;
    }

    .headline-tab {
        flex: 0 0 auto !important;
        padding: 0.6rem 1.25rem !important;
        font-size: 0.85rem !important;
        font-weight: 700 !important;
        border-radius: 100px !important;
        background: rgba(255, 255, 255, 0.05) !important;
        border: 1px solid rgba(255, 255, 255, 0.1) !important;
        color: rgba(255, 255, 255, 0.7) !important;
        display: flex !important;
        align-items: center !important;
        gap: 0.5rem !important;
        transition: all 0.3s ease !important;
    }

    .headline-tab.active {
        background: var(--primary) !important;
        color: #fff !important;
        border-color: var(--primary) !important;
        box-shadow: 0 4px 15px rgba(220, 38, 38, 0.3);
    }

    .tab-icon {
        font-size: 1.1rem;
    }

    .pro-header {
        height: 64px !important;
        background: rgba(10, 10, 12, 0.8) !important;
        backdrop-filter: blur(20px) saturate(180%) !important;
        -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
        padding: 0 1rem !important;
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        position: fixed !important;
        top: 0 !important;
        width: 100% !important;
        z-index: 2000 !important;
    }

    .logo-area-wrapper.mobile-only {
        width: 100% !important;
        justify-content: space-between !important;
        gap: 0 !important;
    }

    .side-menu-trigger {
        width: 44px !important;
        height: 44px !important;
        border-radius: 12px !important;
        background: rgba(255, 255, 255, 0.05) !important;
        border: 1px solid rgba(255, 255, 255, 0.1) !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    .sidebar-burger {
        width: 56px !important;
        height: 56px !important;
        background: var(--primary) !important;
        border-radius: 50% !important;
        box-shadow: 0 8px 32px rgba(220, 38, 38, 0.4) !important;
        margin-bottom: 2rem !important;
        border: none !important;
        color: white !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    .sidebar-burger svg {
        width: 32px !important;
        height: 32px !important;
    }

    .main, .dashboard-main {
        padding-top: 80px !important;
        padding-bottom: 100px !important;
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }

    /* ── TOP HEADLINE TABS (MODERN PREMIUM) ─────────────────────────────── */
.top-headline-tabs {
    background: var(--glass-bg);
    border-bottom: 1px solid var(--glass-border);
    padding: 0 1rem;
    position: sticky;
    top: 72px; /* Below desktop header */
    z-index: 90;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

@media (max-width: 991px) {
    .top-headline-tabs {
        top: 56px; /* Below mobile header */
        padding: 0;
    }
}

.tabs-scroll-container {
    display: flex;
    overflow-x: auto;
    gap: 1.5rem;
    scrollbar-width: none;
    -ms-overflow-style: none;
    max-width: 1200px;
    margin: 0 auto;
}

.tabs-scroll-container::-webkit-scrollbar {
    display: none;
}

.headline-tab {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 0.5rem;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
    font-family: 'Outfit', sans-serif;
}

.headline-tab:hover {
    color: #fff;
}

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

.headline-tab .tab-icon {
    font-size: 1.1rem;
}

/* Sidebar Fixes */
@media (min-width: 992px) {
    .dashboard-view .pro-sidebar {
        display: flex !important;
        left: 0 !important;
        position: fixed !important;
        z-index: 2000 !important;
        width: 280px !important;
        background: #0a0a0c !important;
        border-right: 1px solid rgba(255,255,255,0.05) !important;
    }
    
    .dashboard-view .pro-header {
        left: 280px !important;
        width: calc(100% - 280px) !important;
    }
    
    .dashboard-view main.main {
        margin-left: 280px !important;
        width: calc(100% - 280px) !important;
    }
}

    .has-top-tabs .dashboard-main {
        padding-top: 105px !important; /* Offset for both header and tabs */
    }

    /* Family Switcher Dropdown */
    .family-dropdown.open {
        display: block !important;
        animation: familySlideUp 0.2s ease-out;
    }

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

    /* Force Grid Cleanup for mobile */
    .dashboard-grid, .stats-grid, .account-types-grid, .card-grid, .filters-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }
}

/* Custom Scrollbar for Desktop (Premium) */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* --- Cleanup & Priority --- */
/* Let desktop headers have their original components visible! */
.pro-header.unified-header .nav-container {
    display: flex !important;
}

/* On mobile, standard desktop headers should be hidden gracefully */
@media (max-width: 991px) {
    .header nav, 
    #header-nav,
    .nav-buttons,
    .mobile-nav-toggle {
        display: none !important;
    }
}

/* Ensure Unified Components are Visible */
.pro-header.unified-header .nav-container {
    display: flex !important;
}

/* Fix main content padding */
.main {
    padding-top: 100px !important;
}

@media (max-width: 768px) {
    .main {
        padding-top: 90px !important;
        padding-bottom: 80px !important;
    }
}

/* --- Tactics & Form Builder Grid Bases (Desktop) --- */
.planner-layout, .form-builder-grid {
    display: grid !important;
    gap: 1.5rem !important;
    min-height: 750px !important;
}

.planner-layout {
    grid-template-columns: 280px 1fr 100px !important;
}

.form-builder-grid {
    grid-template-columns: 280px 1fr 300px !important;
}

@media (max-width: 991px) {
    .planner-layout, .form-builder-grid {
        grid-template-columns: 1fr !important;
        height: auto !important;
        min-height: auto !important;
    }
}

/* ============================================================================
   MOBILE UI/UX ENHANCEMENTS (Pro & Cool)
   ============================================================================ */

/* --- Responsive Layouts (Forms & Tactics) --- */
@media (max-width: 991px) {
    /* Form Builder Grid */
    #form-builder > .card > div[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
    }

    #form-builder .card[style*="height: fit-content"] {
        order: 2; /* Move My Forms and Palette below Canvas */
    }

    #adminFieldCanvas {
        min-height: 400px !important;
    }

    /* Tactics Board Layout */
    .planner-layout {
        grid-template-columns: 1fr !important;
        height: auto !important;
        gap: 1.5rem !important;
    }

    .pitch-container {
        height: 500px !important;
        order: 1;
    }

    .roster-sidebar {
        height: 400px !important;
        order: 2;
    }

    .equipment-drawer {
        flex-direction: row !important;
        width: 100% !important;
        height: auto !important;
        overflow-x: auto !important;
        padding: 0.75rem !important;
        order: 3;
        justify-content: flex-start !important;
        gap: 2rem !important;
    }

    .equipment-drawer h4 { display: none; }
    .equipment-drawer .btn-icon { margin-left: auto; }

    /* Horizontal Scroll for Tabs */
    .dashboard-nav, .tabs, .modal-tabs {
        display: flex !important;
        overflow-x: auto !important;
        white-space: nowrap !important;
        padding-bottom: 5px !important;
        -webkit-overflow-scrolling: touch;
        gap: 0.5rem !important;
        border-bottom: 1px solid var(--glass-border) !important;
    }

    .dashboard-nav button, .tab-btn, .modal-tab-btn {
        flex: 0 0 auto !important;
    }

    /* Stats Grid stacking */
    .stats-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 1rem !important;
    }
}

/* --- Premium Table Styles --- */
.table-responsive {
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--glass-border);
    background: rgba(0,0,0,0.2);
    margin: 1.5rem 0;
}

.data-table, table.table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.9rem;
}

.data-table th, table.table th {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 1px;
    padding: 1.25rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--glass-border);
}

.data-table td, table.table td {
    padding: 1.25rem 1rem;
    color: var(--text-main);
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    vertical-align: middle;
}

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

.data-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

/* --- Tournament Card Enhancements --- */
.tournament-card, .event-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 1.5rem;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

.tournament-card:hover {
    transform: translateY(-5px);
    border-color: rgba(220, 38, 38, 0.3);
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.tournament-card .format-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(220, 38, 38, 0.1);
    color: var(--primary);
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
}

/* --- Scrollbar Customization --- */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ============================================================================
   TACTICAL BOARD PRO (Premium Pitch & Assets)
   ============================================================================ */

.pitch-container {
    background: #0d2b18 !important; /* Deep dark green */
    background-image: 
        repeating-linear-gradient(90deg, 
            #0d2b18, 
            #0d2b18 50px, 
            #11321d 50px, 
            #11321d 100px
        ) !important;
    position: relative;
    border: 3px solid rgba(255, 255, 255, 0.8) !important;
    border-radius: 12px !important;
    box-shadow: inset 0 0 100px rgba(0,0,0,0.5), 0 20px 40px rgba(0,0,0,0.4);
}

.pitch-markings {
    position: absolute;
    inset: 0;
    pointer-events: none;
    border: 2px solid rgba(255, 255, 255, 0.6);
}

/* Center Circle */
.pitch-markings::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 120px;
    height: 120px;
    border: 2px solid rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    transform: translate(-50%, -50%);
}

/* Halfway Line */
.pitch-markings::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 2px;
    background: rgba(255, 255, 255, 0.6);
    transform: translateY(-50%);
}

.pitch-goal-area {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 240px;
    height: 80px;
    border: 2px solid rgba(255, 255, 255, 0.6);
}

.pitch-goal-area.top { top: 0; border-top: none; }
.pitch-goal-area.bottom { bottom: 0; border-bottom: none; }

.pitch-penalty-spot {
    position: absolute;
    left: 50%;
    width: 6px;
    height: 6px;
    background: #fff;
    border-radius: 50%;
    transform: translateX(-50%);
}
.pitch-penalty-spot.top { top: 60px; }
.pitch-penalty-spot.bottom { bottom: 60px; }

/* Tactical Pins */
.tactical-pin {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 800;
    color: #fff;
    cursor: grab;
    z-index: 10;
    user-select: none;
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.2s;
    border: 2px solid #fff;
}

.tactical-pin:active { cursor: grabbing; transform: scale(1.15); z-index: 100; }

.tactical-pin.player-home {
    background: linear-gradient(135deg, #dc2626, #991b1b);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.4);
}

.tactical-pin.player-away {
    background: linear-gradient(135deg, #2563eb, #1e40af);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

.tactical-pin.equipment {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(8px);
    border-color: rgba(255, 255, 255, 0.3);
    font-size: 1.2rem;
}

/* Smooth Transitions for Animation */
.tactical-pin.animating {
    transition: left 0.6s cubic-bezier(0.4, 0, 0.2, 1), 
                top 0.6s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* Equipment Tray Items */
.eq-item {
    transition: transform 0.2s;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.3));
}
.eq-item:hover { transform: scale(1.2); }

.equipment-tray {
    backdrop-filter: blur(20px);
    background: rgba(255,255,255,0.02) !important;
}


/* --- Premium Event Manager - Pro UI Kit --- */
.event-card-pro {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 1.25rem;
    margin-bottom: 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.event-card-pro:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.3);
}

.event-type-strip {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
}

.event-type-match { background: linear-gradient(to bottom, #ef4444, #b91c1c); }
.event-type-training { background: linear-gradient(to bottom, #3b82f6, #1d4ed8); }
.event-type-social { background: linear-gradient(to bottom, #10b981, #047857); }

.event-header-pro {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.event-title-pro {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 700;
    color: #fff;
}

.event-badge-pro {
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    letter-spacing: 0.05em;
}

.badge-upcoming { background: rgba(59, 130, 246, 0.15); color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.3); }
.badge-completed { background: rgba(255, 255, 255, 0.05); color: var(--text-muted); border: 1px solid rgba(255, 255, 255, 0.1); }
.badge-live { background: rgba(239, 68, 68, 0.15); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.3); animation: pulse-live 2s infinite; }

@keyframes pulse-live {
    0% { opacity: 0.8; }
    50% { opacity: 1; transform: scale(1.05); }
    100% { opacity: 0.8; }
}

.event-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
}

.stat-item-pro {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

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

.stat-value-pro {
    font-size: 0.85rem;
    font-weight: 600;
    color: #f1f5f9;
}

.event-footer-pro {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

/* -----------------------------
   Landing page header + hero tweaks
   ----------------------------- */

/* Force transparent header on landing pages (body.clubhub-unified) */
body.clubhub-unified header.header,
body.clubhub-unified .pro-header {
    background: transparent !important;
    box-shadow: none !important;
    border-bottom: 0 !important;
    transition: background 0.25s ease, box-shadow 0.25s ease;
}

/* Landing hero: add a soft dark overlay (keeps underlying image visible) */
.landing-hero { position: relative; overflow: hidden; }
.landing-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.45); /* change alpha to taste (0.25 - 0.65) */
    pointer-events: none;
    z-index: 6;
}
.landing-hero .container { position: relative; z-index: 10; }

/* Ensure Install App CTA is visible on landing header */
body.clubhub-unified .pwa-install-btn {
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
}

/* Slight polish: make header items vertically centered and smooth */
body.clubhub-unified header.header .nav { align-items: center; }
body.clubhub-unified .logo { display: flex; align-items: center; gap: 0.5rem; }


/* ==========================================================================
   UI Polish Overrides (minimal, safe)
   - Centralize small visual/spacing tweaks for header, dashboard and sidebar
   - Kept intentionally small to avoid regressions
   ========================================================================== */

:root {
    --nav-height: 64px;
    --nav-height-landing: 88px;
}

.pro-header {
    height: var(--nav-height) !important;
    box-shadow: 0 6px 18px rgba(0,0,0,0.45);
    padding-left: 1.25rem !important;
    padding-right: 1.25rem !important;
    border-bottom: 1px solid rgba(255,255,255,0.03) !important;
}

.clubhub-unified:not(.dashboard-view) .pro-header,
.clubhub-unified:not(.dashboard-view) header.header {
    height: var(--nav-height-landing) !important;
    padding-left: 2rem !important;
    padding-right: 2rem !important;
}

.dashboard-view .pro-header {
    left: var(--sidebar-width) !important;
    width: calc(100% - var(--sidebar-width)) !important;
    height: var(--nav-height) !important;
    align-items: center !important;
}

.main, .dashboard-main {
    padding-top: calc(var(--nav-height) + 18px) !important;
}

body.has-top-tabs .main, 
body.has-top-tabs .dashboard-main {
    padding-top: calc(var(--nav-height) + 72px) !important;
}

.top-headline-tabs {
    position: sticky !important;
    top: var(--nav-height) !important;
    z-index: 3000 !important;
    background: rgba(10, 10, 12, 0.95) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 0.75rem 0 !important;
}

@media (min-width: 992px) {
    .dashboard-view .top-headline-tabs {
        left: var(--sidebar-width) !important;
        width: calc(100% - var(--sidebar-width)) !important;
    }
}
@media (max-width: 991px) {
    .dashboard-view .top-headline-tabs {
        left: 0 !important;
        width: 100% !important;
    }
}

.dashboard-container {
    max-width: 1200px;
    margin: 0 auto;
    padding-left: 2rem;
    padding-right: 2rem;
}

.dashboard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 0;
    margin-top: 0;
}

/* Ensure dashboard header remains full-width on small screens (mobile)
   Some rules above apply desktop offsets unconditionally; this override
   resets the left/width so mobile header is visible and not clipped. */
@media (max-width: 991px) {
    .dashboard-view .pro-header,
    .dashboard-view header.header {
        left: 0 !important;
        width: 100% !important;
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
}

.dashboard-nav {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin: 0.5rem 0;
}

.sidebar-link { transition: transform 0.12s, box-shadow 0.12s; }
.sidebar-link:hover { transform: translateX(2px); box-shadow: 0 6px 18px rgba(0,0,0,0.35); }

.mode-pill { padding: 8px 16px !important; font-size: 0.75rem !important; }
.mode-pill.active { box-shadow: 0 6px 16px rgba(0,0,0,0.4); }

/* Ensure content containers don't overlap fixed header on desktop */
@media (min-width: 992px) {
    .container { padding-top: 0 !important; }
}

/* Small accessibility/contrast uplift */
.action-btn { border-radius: 10px; }

/* Small, safe overrides added by agent: center icons and collapsible nav groups */
.sidebar-link {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
}
.sidebar-link .nav-icon, .sidebar-link i {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 28px !important;
    height: 28px !important;
}

.nav-group { padding-left: 0; }
.nav-group-title { display: flex; align-items: center; justify-content: space-between; cursor: pointer; }
.nav-group-title .group-toggle { font-size: 10px; opacity: 0.5; margin-left: 8px; transition: transform 0.2s; }

/* Sub-menu links are slightly smaller for better hierarchy */
.nav-group .sidebar-link {
    font-size: 0.88rem !important;
    padding: 10px 16px !important;
    margin-left: 4px !important;
    margin-right: 4px !important;
    color: rgba(255,255,255,0.5) !important;
}

.nav-group .sidebar-link .nav-icon {
    width: 20px !important;
    height: 20px !important;
    margin-right: 10px !important;
}

.nav-group .sidebar-link .nav-icon svg,
.nav-group .sidebar-link .nav-icon i {
    width: 16px !important;
    height: 16px !important;
    font-size: 1rem !important;
}

.nav-group .sidebar-link:hover {
    color: rgba(255,255,255,0.9) !important;
}

/* Hide generic form headers when user requested removal */
.form-header { display: none !important; }
.user-profile-trigger .user-name { font-weight: 700 !important; }

/* End UI Polish Overrides */


/* ============================================================================
   UNIFIED GROUP SWITCHER (Premium Pill Design)
   ============================================================================ */
.group-switcher {
  position: relative;
  display: inline-block;
  margin: 0.5rem 0;
}

.group-switcher-trigger {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 0.75rem !important;
  padding: 6px 14px !important;
  background: rgba(255, 255, 255, 0.04) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-radius: 12px !important;
  cursor: pointer !important;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
  color: white !important;
  width: auto !important;
  height: auto !important;
}

.group-switcher-trigger:hover {
  background: rgba(255, 255, 255, 0.08) !important;
  border-color: var(--primary) !important;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2) !important;
}

.group-switcher-current {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 0.75rem !important;
}

.group-avatar {
  width: 24px !important;
  height: 24px !important;
  border-radius: 50% !important; /* Matches profile dropdown circle */
  background: linear-gradient(135deg, var(--primary) 0%, #b91c1c 100%) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  overflow: hidden !important;
  flex-shrink: 0 !important;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2) !important;
}

.group-avatar span {
  color: white !important;
  font-weight: 800 !important;
  font-size: 0.7rem !important;
  text-transform: uppercase !important;
}

.group-avatar img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
}

.group-info {
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;
  text-align: left !important;
  gap: 0 !important;
}

.group-name {
  font-weight: 700 !important;
  font-size: 0.9rem !important;
  color: white !important;
  line-height: 1.2 !important;
  white-space: nowrap !important;
}

.group-role {
  display: block !important;
  font-size: 0.65rem !important;
  color: rgba(255, 255, 255, 0.5) !important;
  text-transform: uppercase !important;
  letter-spacing: 0.5px !important;
  font-weight: 600 !important;
  margin-top: 1px !important;
}

.group-switcher-arrow {
  opacity: 0.5 !important;
  margin-left: 0.5rem !important;
  transition: transform 0.2s !important;
}

/* Dropdown */
.group-switcher-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    width: 320px;
    background: #18181b;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
}

.group-switcher-dropdown.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.group-switcher-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    font-size: 0.7rem;
    font-weight: 700;
    color: rgba(255,255,255,0.4);
    text-transform: uppercase;
}

.group-switcher-list {
    max-height: 350px;
    overflow-y: auto;
    padding: 0.5rem;
}

.group-switcher-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0.75rem 1rem;
    width: 100%;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}

.group-switcher-item:hover {
    background: rgba(255,255,255,0.05);
}

.group-item-avatar {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    background: linear-gradient(135deg, var(--primary), #b91c1c);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.group-item-name {
    font-weight: 600;
    font-size: 0.9rem;
    display: block;
}

.group-item-role {
    font-size: 0.7rem;
    opacity: 0.5;
}

.group-switcher-footer {
    padding: 0.75rem;
    border-top: 1px solid rgba(255,255,255,0.06);
}

.group-switcher-action {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 0.75rem;
    background: rgba(220, 38, 38, 0.1);
    border: 1px dashed rgba(220, 38, 38, 0.3);
    border-radius: 8px;
    color: var(--primary);
    font-weight: 600;
    cursor: pointer;
}


/* --- Tournament Bracket (Premium Glass) --- */
.bracket-tree {
    display: flex;
    gap: 2rem;
    padding: 2rem;
    overflow-x: auto;
    align-items: center;
}

.bracket-round {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    gap: 1.5rem;
    min-width: 220px;
}

.bracket-round-label {
    text-align: center;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 2px;
    margin-bottom: 1rem;
    opacity: 0.6;
}

.bracket-match-container {
    position: relative;
    display: flex;
    align-items: center;
}

.bracket-match {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    width: 100%;
    overflow: hidden;
    transition: transform 0.2s, border-color 0.2s;
    backdrop-filter: blur(10px);
}

.bracket-match:hover {
    transform: translateX(4px);
    border-color: rgba(220, 38, 38, 0.3);
}

.match-team {
    padding: 0.75rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
}

.match-team.winner {
    color: #fff;
    font-weight: 700;
    background: rgba(220, 38, 38, 0.05);
}

.team-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 140px;
}

.match-score {
    font-weight: 800;
    font-family: 'JetBrains Mono', monospace;
    opacity: 0.9;
}

.bracket-match-container.upper::after {
    content: '';
    position: absolute;
    right: -1rem;
    top: 50%;
    width: 1rem;
    height: calc(50% + 0.75rem + 2px);
    border-right: 2px solid rgba(255,255,255,0.1);
    border-top: 2px solid rgba(255,255,255,0.1);
    border-top-right-radius: 8px;
}

.bracket-match-container.lower::after {
    content: '';
    position: absolute;
    right: -1rem;
    bottom: 50%;
    width: 1rem;
    height: calc(50% + 0.75rem + 2px);
    border-right: 2px solid rgba(255,255,255,0.1);
    border-bottom: 2px solid rgba(255,255,255,0.1);
    border-bottom-right-radius: 8px;
}
