/* ========== MOBILE TABS (Stats vs Navigation) ========== */

@media (max-width: 768px) {
    /* Header title section - STICKY at top */
    .header-title-section {
        position: sticky !important;
        top: 0;
        z-index: 700;
        background: linear-gradient(135deg, var(--oil-black) 0%, #252528 100%);
        border-bottom: 4px solid var(--rust-orange);
        box-shadow: 0 4px 12px rgba(0,0,0,0.5);
    }
    
    /* Smaller title on mobile */
    .header-text h1 {
        font-size: 2em !important; /* Smaller so it fits one line */
        letter-spacing: 1px !important;
    }
    
    .subtitle {
        font-size: 0.75em !important;
    }
    
    /* Tab toggle buttons - full width below title */
    .mobile-tab-toggle {
        display: flex !important;
        gap: 0;
        width: 100%;
        background: var(--steel-gray);
        border-top: 2px solid var(--rust-orange);
    }
    
    .tab-btn {
        flex: 1;
        background: var(--steel-gray);
        border: none;
        border-right: 1px solid var(--oil-black);
        color: #FFF;
        padding: 12px 10px;
        font-family: 'Rajdhani', sans-serif;
        font-weight: 700;
        font-size: 0.9em;
        cursor: pointer;
        transition: all 0.3s;
        text-transform: uppercase;
        letter-spacing: 1px;
    }
    
    .tab-btn:last-child {
        border-right: none;
    }
    
    .tab-btn.active {
        background: linear-gradient(135deg, var(--rust-orange) 0%, #D46B3E 100%);
        color: #FFF;
    }
    
    /* Grey out button for current page */
    .tab-btn:disabled {
        background: #3a3a3c;
        color: #666;
        cursor: not-allowed;
    }
    
    /* Tab contents - only show active */
    .mobile-tab-content {
        display: none;
    }
    
    .mobile-tab-content.active {
        display: block !important;
    }
    
    /* Stats section as tab */
    .header-stats-section {
        background: var(--steel-gray);
        border-bottom: 2px solid #555;
        position: relative; /* NOT sticky - in normal flow */
    }
    
    /* Navigation as tab - 2 COLUMN GRID */
    .main-nav {
        position: static !important; /* Override navigation.css sticky */
        top: auto !important;
        background: var(--steel-gray);
        border-bottom: 2px solid #555;
        box-shadow: none !important;
    }
    
    .main-nav .nav-container {
        display: flex !important; /* Override mobile.css display:none */
        flex-direction: column !important; /* Single column stack */
        gap: 0;
        background: var(--steel-gray);
        padding: 0;
        position: static !important; /* Override mobile.css absolute positioning */
        top: auto !important;
        left: auto !important;
        right: auto !important;
        max-height: none !important;
    }
    
    .main-nav .nav-link {
        width: 100%;
        text-align: center;
        border-bottom: 1px solid var(--oil-black);
        padding: 18px 15px;
        font-size: 0.95em;
    }
    
    /* Remove all grid positioning since we're using flexbox */
    .nav-container > a,
    .nav-container > .nav-dropdown {
        /* No specific positioning needed - flex handles it */
    }
    
    /* Dropdown parent - normal flow */
    .nav-dropdown {
        display: block; /* Normal block element */
    }
    
    .nav-dropdown > .nav-link {
        /* Dropdown toggle button */
    }
    
    /* Dropdown content - full width below button */
    .nav-dropdown .dropdown-content {
        display: none;
        background: #1a1a1c;
        border-top: 2px solid var(--rust-orange);
        border-bottom: 2px solid var(--rust-orange); /* Divider at bottom */
    }
    
    .nav-dropdown.open .dropdown-content {
        display: block !important;
    }
    
    .nav-dropdown .dropdown-content a {
        padding: 14px 20px;
        font-size: 0.85em;
        border-top: 1px solid var(--oil-black);
    }
    
    /* Stats grid - same as before */
    .stats-bar {
        display: grid;
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto auto auto auto auto;
        gap: 8px;
        padding: 12px;
        background: var(--steel-gray);
        border-top: 1px solid #555;
    }
    
    .stat-item.user-info {
        grid-column: 1 / -1;
        grid-row: 1;
        text-align: center;
        margin-bottom: 8px;
        padding-bottom: 8px;
        border-bottom: 1px solid #555;
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 8px;
    }
    
    .stat-item {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 6px 8px;
        background: rgba(0,0,0,0.3);
        border-radius: 3px;
    }
    
    .stat-item:nth-of-type(2) { grid-column: 1; grid-row: 2; }
    .stat-item:nth-of-type(3) { grid-column: 1; grid-row: 3; }
    .stat-item:nth-of-type(4) { grid-column: 1; grid-row: 4; }
    .stat-item:nth-of-type(5) { grid-column: 2; grid-row: 2; }
    .stat-item:nth-of-type(6) { grid-column: 2; grid-row: 3; }
    
    .stat-item.logout-item,
    .stat-item:has(.logout-btn) {
        grid-column: 1;
        grid-row: 5;
        background: transparent;
        padding: 0;
    }
    
    .logout-btn {
        width: 100%;
        padding: 10px;
        font-size: 0.8em;
    }
    
    .staff-menu-container {
        grid-column: 2;
        grid-row: 5;
        background: transparent;
        padding: 0;
        position: relative;
    }
    
    .staff-menu-toggle {
        width: 100%;
        padding: 10px;
        font-size: 0.8em;
    }
    
    .staff-menu-dropdown {
        position: absolute;
        bottom: 100%;
        right: 0;
        margin-bottom: 5px;
        min-width: 140px;
        z-index: 700;
    }
    
    .stat-label {
        font-size: 0.75em;
        color: #888;
        margin-right: 4px;
        white-space: nowrap;
    }
    
    .stat-value {
        font-family: 'Rajdhani', sans-serif;
        font-size: 0.95em;
        font-weight: 700;
        color: var(--warning-yellow);
        text-align: right;
    }
}

/* Hide tabs on desktop */
@media (min-width: 769px) {
    .mobile-tab-toggle {
        display: none !important;
    }
    
    .mobile-tab-content {
        display: block !important;
    }
}
