/* ===== MENU MOBILE SIMPLE ET FONCTIONNEL ===== */

/* DESKTOP par défaut */
.mobile-header {
    display: none;
}

.mobile-overlay {
    display: none;
}

.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 260px;
    height: 100vh;
    background: #1a1b26;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 100;
    display: flex;
    flex-direction: column;
}

.dashboard-main {
    margin-left: 260px;
}

/* MOBILE - Responsive */
@media (max-width: 768px) {
    /* Layout principal */
    .dashboard-main {
        margin-left: 0 !important;
        width: 100% !important;
    }

    /* Header mobile */
    .mobile-header {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        padding: 1rem 1.25rem !important;
        background: #1a1b26 !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
        position: sticky !important;
        top: 0 !important;
        z-index: 1000 !important;
    }

    .mobile-menu-btn {
        width: 44px !important;
        height: 44px !important;
        background: rgba(99, 102, 241, 0.15) !important;
        border: none !important;
        border-radius: 10px !important;
        color: #6366f1 !important;
        cursor: pointer !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        transition: all 0.2s !important;
    }

    .mobile-menu-btn:hover {
        background: rgba(99, 102, 241, 0.25) !important;
    }

    .mobile-menu-btn svg {
        width: 24px !important;
        height: 24px !important;
        stroke: #6366f1 !important;
    }

    .mobile-logo {
        font-size: 1.25rem !important;
        font-weight: 700 !important;
        color: #fff !important;
    }

    /* Sidebar cachée par défaut */
    .sidebar {
        position: fixed !important;
        left: -280px !important;
        top: 0 !important;
        width: 280px !important;
        height: 100vh !important;
        background: #1a1b26 !important;
        z-index: 1001 !important;
        transition: left 0.3s ease !important;
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.5) !important;
        display: flex !important;
        flex-direction: column !important;
        overflow-y: auto !important;
    }

    /* Sidebar ouverte - FORCER LA POSITION */
    .sidebar.open {
        left: 0 !important;
        transform: translateX(0) !important;
    }

    /* Overlay - seulement la partie droite de l'écran */
    .mobile-overlay {
        position: fixed !important;
        top: 0 !important;
        left: 280px !important;
        width: calc(100vw - 280px) !important;
        height: 100vh !important;
        background: transparent !important;
        z-index: 1000 !important;
        opacity: 0 !important;
        visibility: hidden !important;
        transition: all 0.3s ease !important;
        pointer-events: none !important;
    }

    /* Overlay ouvert */
    .mobile-overlay.open {
        display: block !important;
        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: auto !important;
    }

    /* Bloquer le scroll */
    body.menu-open {
        overflow: hidden !important;
    }

    /* FORCER LA VISIBILITÉ DU CONTENU SIDEBAR */
    .sidebar .sidebar-header {
        display: flex !important;
        padding: 1.5rem 1.25rem !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
    }

    .sidebar .logo {
        display: flex !important;
        align-items: center !important;
        gap: 0.75rem !important;
        color: #fff !important;
        font-size: 1.25rem !important;
        font-weight: 700 !important;
    }

    .sidebar .logo-icon {
        width: 32px !important;
        height: 32px !important;
        background: #6366f1 !important;
        border-radius: 8px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    .sidebar .logo-icon .icon-inner {
        width: 16px !important;
        height: 16px !important;
        background: #fff !important;
        border-radius: 3px !important;
    }

    .sidebar .logo .accent {
        color: #6366f1 !important;
    }

    .sidebar .sidebar-nav {
        flex: 1 !important;
        padding: 1rem 0 !important;
        overflow-y: auto !important;
    }

    .sidebar .nav-section {
        margin-bottom: 2rem !important;
    }

    .sidebar .nav-section-title {
        color: rgba(255, 255, 255, 0.5) !important;
        font-size: 0.75rem !important;
        font-weight: 600 !important;
        text-transform: uppercase !important;
        letter-spacing: 0.05em !important;
        padding: 0 1.25rem 0.75rem !important;
        display: block !important;
    }

    .sidebar .nav-item {
        display: flex !important;
        align-items: center !important;
        gap: 0.75rem !important;
        padding: 0.75rem 1.25rem !important;
        color: rgba(255, 255, 255, 0.8) !important;
        text-decoration: none !important;
        transition: all 0.2s !important;
        border-left: 3px solid transparent !important;
    }

    .sidebar .nav-item span {
        color: rgba(255, 255, 255, 0.8) !important;
        font-weight: 500 !important;
    }

    .sidebar .nav-item svg {
        width: 20px !important;
        height: 20px !important;
        color: rgba(255, 255, 255, 0.8) !important;
        stroke: rgba(255, 255, 255, 0.8) !important;
    }

    .sidebar .nav-item.active {
        background: rgba(99, 102, 241, 0.15) !important;
        color: #6366f1 !important;
        border-left: 3px solid #6366f1 !important;
    }

    .sidebar .nav-item.active span {
        color: #6366f1 !important;
    }

    .sidebar .nav-item.active svg {
        color: #6366f1 !important;
        stroke: #6366f1 !important;
    }

    .sidebar .nav-item:hover {
        background: rgba(255, 255, 255, 0.1) !important;
    }

    .sidebar .sidebar-footer {
        padding: 1.25rem !important;
        border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
    }

    .sidebar .user-card {
        display: flex !important;
        align-items: center !important;
        gap: 0.75rem !important;
        padding: 1rem !important;
        background: rgba(255, 255, 255, 0.05) !important;
        border: 1px solid rgba(255, 255, 255, 0.1) !important;
        border-radius: 12px !important;
        margin-bottom: 1rem !important;
    }

    .sidebar .user-avatar {
        width: 40px !important;
        height: 40px !important;
        background: rgba(99, 102, 241, 0.2) !important;
        border-radius: 10px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    .sidebar .user-avatar svg {
        width: 20px !important;
        height: 20px !important;
        color: #6366f1 !important;
        stroke: #6366f1 !important;
    }

    .sidebar .user-info {
        flex: 1 !important;
    }

    .sidebar .user-name {
        color: #fff !important;
        font-weight: 600 !important;
        font-size: 0.875rem !important;
        margin-bottom: 0.25rem !important;
    }

    .sidebar .user-badge {
        color: rgba(255, 255, 255, 0.6) !important;
        font-size: 0.75rem !important;
        padding: 0.25rem 0.5rem !important;
        background: rgba(255, 255, 255, 0.1) !important;
        border-radius: 6px !important;
        display: inline-block !important;
    }

    .sidebar .btn-logout {
        width: 100% !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 0.5rem !important;
        padding: 0.75rem !important;
        background: rgba(239, 68, 68, 0.15) !important;
        border: 1px solid rgba(239, 68, 68, 0.3) !important;
        border-radius: 10px !important;
        color: #ef4444 !important;
        cursor: pointer !important;
        transition: all 0.2s !important;
    }

    .sidebar .btn-logout span {
        color: #ef4444 !important;
        font-weight: 500 !important;
    }

    .sidebar .btn-logout svg {
        width: 18px !important;
        height: 18px !important;
        color: #ef4444 !important;
        stroke: #ef4444 !important;
    }

    .sidebar .btn-logout:hover {
        background: rgba(239, 68, 68, 0.25) !important;
    }

    /* Contenu responsive */
    .section-header {
        padding: 1.5rem 1.25rem 1rem !important;
    }

    .stats-grid,
    .content-grid,
    .controls-grid {
        grid-template-columns: 1fr !important;
        padding: 0 1.25rem !important;
        gap: 1rem !important;
    }

    .card,
    .console-card {
        margin: 0 1.25rem 1.5rem !important;
    }
}

/* Très petits écrans - sidebar pleine largeur */
@media (max-width: 480px) {
    .sidebar {
        width: 100vw !important;
        left: -100vw !important;
    }

    .sidebar.open {
        left: 0 !important;
    }

    /* Pas d'overlay sur très petits écrans */
    .mobile-overlay {
        display: none !important;
    }

    .section-header {
        padding: 1.25rem 1rem !important;
    }

    .stats-grid,
    .content-grid {
        padding: 0 1rem !important;
    }

    .card {
        margin: 0 1rem 1.25rem !important;
    }
}