/* ======================================================
   SIDEBAR – BASE FIXE
   ====================================================== */

.sidebar {
    width: 192px !important;
    height: 100vh;
    background-color: #0a73c9;
    overflow: visible; /* IMPORTANT pour dropdowns */
}

.sidebar-layout {
    display: flex;
    flex-direction: column;
}

/* ======================================================
   HEADER / LOGO
   ====================================================== */

.sidebar-header {
    height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.branding-link {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #ffffff !important;
    text-decoration: none;
    font-size: 1.4rem;
    font-weight: 700;
}

.branding-link img {
    height: 40px;
}

.sidebar-separator {
    width: 80%;
    height: 1px;
    background: rgba(255,255,255,0.4);
    margin-top: 12px;
}

/* ======================================================
   MENUS – ALIGNÉS À GAUCHE
   ====================================================== */

.sidebar-menu,
.sidebar-user {
    width: 100%;
    margin: 0;
    padding: 0;
}

.sidebar-menu li,
.sidebar-user li {
    position: relative; /* ancrage dropdown */
}

.sidebar-menu li a,
.sidebar-user li a {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;

    padding: 12px 14px;
    margin: 0;
    border-radius: 0;

    color: #ffffff !important;
    background: transparent !important;
    text-align: left;
}

/* Colonne icône FIXE */
.sidebar-menu li a span,
.sidebar-user li a span {
    min-width: 22px;
    text-align: center;
    flex-shrink: 0;
}

/* Hover / active */
.sidebar-menu li a:hover,
.sidebar-menu li.active > a,
.sidebar-user li a:hover {
    background-color: rgba(255,255,255,0.18) !important;
}

/* ======================================================
   DROPDOWNS – COMPORTEMENT FIGÉ
   ====================================================== */

.d-menu {
    position: absolute !important;

    right: 0 !important;   /* toujours à droite */
    left: auto !important;

    bottom: 100% !important; /* ouverture vers le haut */
    top: auto !important;

    margin-bottom: 6px;

    min-width: 180px;
    background-color: #ffffff !important;
    color: #000000;

    border-radius: 4px;
    box-shadow: 0 6px 14px rgba(0,0,0,0.25);
    z-index: 9999;
}

/* ======================================================
   CORRECTION CRITIQUE : ICÔNES TOUJOURS VISIBLES
   ====================================================== */

/* Forcer l’affichage des icônes Metro UI */
.d-menu span[class^="mif-"],
.d-menu span[class*=" mif-"] {
    display: inline-block !important;
    font-size: 16px !important;
    line-height: 1 !important;
    width: 20px;
    text-align: center;
    color: #000000 !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* Liens dropdown */
.d-menu li a {
    display: flex;
    align-items: center;
    gap: 10px;

    padding: 10px 14px;
    color: #000000 !important;
    background: transparent !important;
}

/* Hover dropdown */
.d-menu li a:hover {
    background-color: rgba(0,0,0,0.08) !important;
}

/* ======================================================
   UTILISATEUR – COLLÉ EN BAS
   ====================================================== */

.sidebar-user {
    margin-top: auto; /* vraiment collé en bas */
    padding-bottom: 6px;
}

/* ======================================================
   CONTENU PRINCIPAL
   ====================================================== */

.page-content {
    margin-left: 192px;
}

/* ======================================================
   FOOTER
   ====================================================== */

.footer {
    position: fixed;
    bottom: 0;
    left: 192px;
    width: calc(100% - 192px);
    z-index: 1000;
}
/* ======================================================
   CORRECTION FINALE METRO UI – DROPDOWN FOOTER
   ====================================================== */

/* Metro UI met font-size:0 sur les <a> des dropdowns */
.sidebar .sidebar-user .d-menu li a {
    font-size: 14px !important;      /* RÉTABLIT LE TEXTE + ICÔNES */
    line-height: 1.4 !important;
}

/* Icônes MIF – forcer affichage */
.sidebar .sidebar-user .d-menu li a span[class^="mif-"],
.sidebar .sidebar-user .d-menu li a span[class*=" mif-"] {
    display: inline-block !important;
    font-size: 16px !important;
    width: 20px !important;
    min-width: 20px !important;
    text-align: center;
    color: #000000 !important;
}

/* Sécurité supplémentaire */
.sidebar .sidebar-user .d-menu * {
    opacity: 1 !important;
    visibility: visible !important;
}
/* Flèche dropdown (toutes variantes Metro UI 3) */
.sidebar .dropdown-toggle::after,
.sidebar .dropdown-toggle::before {
    color: #ffffff !important;
    border-top-color: #ffffff !important;
}
/* ======================================================
   CENTRAGE HORIZONTAL DES ÉLÉMENTS DE SOUS-MENU
   ====================================================== */

.d-menu li a {
    justify-content: center !important; /* centrage horizontal */
    text-align: center;
}

/* Icône + texte bien centrés ensemble */
.d-menu li a span[class^="mif-"],
.d-menu li a span[class*=" mif-"] {
    margin-right: 6px; /* petit espace visuel */
}
