/* ===================================
   FINAL FIX - PRIORITÉ ABSOLUE
   Résout tous les problèmes d'un coup
   =================================== */

/* 1. SUPPRIME LA BARRE BEIGE SUR TOUTES LES PAGES DASHBOARD */
html {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

body.page-template-page-dashboard {
    margin-top: 0 !important;
    padding-top: 0 !important;
    background: #f8f9fa !important;
}

body.page-template-page-dashboard::before,
body.page-template-page-dashboard::after {
    display: none !important;
}

.b2b-dashboard {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* 2. MOBILE - Supprime l'overlay sombre et rend tout cliquable */
@media (max-width: 768px) {
    /* Supprime complètement l'overlay sombre */
    .sidebar-overlay {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        pointer-events: none !important;
    }
    
    /* Sidebar sans filtre sombre */
    .dashboard-sidebar,
    .dashboard-sidebar.open,
    .dashboard-sidebar.active {
        filter: none !important;
        opacity: 1 !important;
        pointer-events: auto !important;
        background: #2c5530 !important;
    }
    
    /* Tout le contenu cliquable */
    .dashboard-sidebar * {
        pointer-events: auto !important;
        filter: none !important;
        opacity: 1 !important;
    }
    
    /* Header vert sur mobile */
    .dashboard-header {
        background: #2c5530 !important;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        z-index: 9999 !important;
        margin: 0 !important;
        padding-top: 0 !important;
    }
    
    /* Sidebar positionnée sous le header */
    .dashboard-sidebar {
        position: fixed !important;
        top: 56px !important;
        height: calc(100vh - 56px) !important;
        z-index: 9998 !important;
    }
    
    /* Main content sous le header */
    .dashboard-main {
        margin-top: 56px !important;
        background: #f8f9fa !important;
    }
}

/* 3. TABLETTE - Fix le logo blanc sur fond vert */
@media (min-width: 769px) and (max-width: 1024px) {
    /* Logo Euravia en blanc sur tablette */
    .sidebar-header .logo-text {
        color: white !important;
    }
    
    .sidebar-header .logo {
        color: white !important;
    }
    
    .sidebar-header .logo * {
        color: white !important;
    }
    
    /* Sidebar verte */
    .dashboard-sidebar {
        background: #2c5530 !important;
    }
    
    /* Header blanc sur tablette */
    .dashboard-header {
        background: white !important;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        margin: 0 !important;
        z-index: 9999 !important;
    }
}

/* 4. DESKTOP - Fix le header décalé */
@media (min-width: 1025px) {
    /* Sidebar verte fixe */
    .dashboard-sidebar {
        background: #2c5530 !important;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        height: 100vh !important;
        width: 280px !important;
        z-index: 100 !important;
    }
    
    /* Header décalé pour la sidebar et largeur corrigée */
    .dashboard-header {
        position: fixed !important;
        top: 0 !important;
        left: 280px !important;
        right: 0 !important;
        width: calc(100% - 280px) !important;
        max-width: calc(100% - 280px) !important;
        margin-left: 0 !important;
        background: white !important;
        z-index: 99 !important;
        height: 60px !important;
    }
    
    /* Main décalé */
    .dashboard-main {
        margin-left: 280px !important;
        padding-top: 60px !important;
        background: #f8f9fa !important;
        width: calc(100% - 280px) !important;
    }
    
    /* Logo blanc sur tous les écrans */
    .sidebar-header .logo-text {
        color: white !important;
    }
}

/* 5. FORCER LES COULEURS DU TEXTE SIDEBAR */
.dashboard-sidebar {
    color: white !important;
}

.dashboard-sidebar .logo-text {
    color: white !important;
}

.dashboard-sidebar .nav-item {
    color: white !important;
}

.dashboard-sidebar .user-info strong,
.dashboard-sidebar .user-info span {
    color: white !important;
}

.dashboard-sidebar .logout-btn {
    color: white !important;
    background: rgba(255,255,255,0.1) !important;
    border-color: rgba(255,255,255,0.3) !important;
}

/* 6. SUPPRIMER TOUT ESPACE AU-DESSUS */
#wpadminbar {
    display: none !important;
}

.page-template-page-dashboard {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* DEBUG */
body::before {
    content: "FINAL-FIX-LOADED" !important;
    display: none !important;
}
