
/* ==========================================================
   FIX MENU LATERAL : scroll interne + déconnexion accessible
   ========================================================== */

/* Le menu complet doit pouvoir défiler */
#appSidebar,
.sidebar {
    height: 100vh !important;
    max-height: 100vh !important;
    min-height: 100vh !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    padding-bottom: 140px !important;
    scrollbar-width: thin !important;
}

/* La carte utilisateur / déconnexion ne doit pas être cachée */
#appSidebar .user-card,
.sidebar .user-card {
    margin-bottom: 80px !important;
    flex-shrink: 0 !important;
}

/* Le lien déconnexion reste visible et cliquable */
#appSidebar a[href*="logout"],
.sidebar a[href*="logout"],
#appSidebar .deconnexion,
.sidebar .deconnexion {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
    z-index: 99999 !important;
    margin-bottom: 60px !important;
}

/* Corrige les CSS qui bloquaient le scroll */
#appSidebar .nav,
.sidebar .nav {
    overflow: visible !important;
    max-height: none !important;
}

/* Scrollbar Chrome/Edge */
#appSidebar::-webkit-scrollbar,
.sidebar::-webkit-scrollbar {
    width: 8px !important;
}

#appSidebar::-webkit-scrollbar-thumb,
.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,.45) !important;
    border-radius: 999px !important;
}

#appSidebar::-webkit-scrollbar-track,
.sidebar::-webkit-scrollbar-track {
    background: rgba(255,255,255,.08) !important;
}

/* Téléphone : menu ouvert avec son propre scroll */
@media (max-width: 900px) {
    #appSidebar,
    .sidebar,
    body.sidebar-collapsed #appSidebar,
    body.sidebar-collapsed .sidebar {
        height: 100dvh !important;
        max-height: 100dvh !important;
        min-height: 100dvh !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        padding-bottom: 160px !important;
        -webkit-overflow-scrolling: touch !important;
    }

    #appSidebar .user-card,
    .sidebar .user-card {
        margin-bottom: 100px !important;
    }
}
