.sidebar-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-logo {
    font-size: 1.6rem;
}

.sidebar-title {
    font-weight: 700;
    font-size: 1.05rem;
}

.sidebar-nav {
    padding: 12px 8px;
}

/* Lien de premier niveau sans sous-menu (ex: Tableau de bord) - look bouton */
.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    margin-bottom: 4px;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    font-size: 0.9rem;
    transition: background 0.15s;
}

    .nav-item:hover {
        background: rgba(255, 255, 255, 0.1);
        color: white;
    }

    .nav-item.active {
        background: #3498db;
        color: white;
        font-weight: 600;
        box-shadow: 0 2px 6px rgba(52, 152, 219, 0.4);
    }

/* En-tête de module (déclencheur de l'accordéon) - look bouton */
.nav-module {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    margin-bottom: 4px;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.9rem;
    cursor: pointer;
    user-select: none;
    transition: background 0.15s;
}

    .nav-module:hover {
        background: rgba(255, 255, 255, 0.1);
        color: white;
    }

/* Module actif : fond bleu plein, nettement visible */
.nav-module-active {
    background: #3498db;
    color: white;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(52, 152, 219, 0.4);
}

.nav-module-label {
    flex: 1;
}

.nav-chevron {
    font-size: 0.75rem;
    opacity: 0.7;
}

/* Zone des sous-éléments */
.nav-submenu {
    padding: 2px 0 6px 0;
    margin-bottom: 4px;
}

/* Sous-élément = vrai bouton : fond visible, coins arrondis, espacement net.
   text-decoration/color/border forcés en !important pour garantir qu'aucun
   style de lien natif du navigateur (bleu souligné) ne puisse prendre le dessus. */
.nav-subitem {
    display: block !important;
    padding: 8px 14px;
    margin: 3px 4px 3px 32px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.75) !important;
    text-decoration: none !important;
    border: none;
    font-size: 0.85rem;
    transition: background 0.15s, color 0.15s;
}

    .nav-subitem:hover {
        background: rgba(255, 255, 255, 0.15) !important;
        color: white !important;
    }

    /* Sous-élément actif : vert plein, bien distinct du bleu du module */
    .nav-subitem.active {
        background: #27ae60 !important;
        color: white !important;
        font-weight: 600;
        box-shadow: 0 2px 6px rgba(39, 174, 96, 0.4);
    }

.nav-subitem-disabled {
    display: block;
    padding: 8px 14px;
    margin: 3px 4px 3px 32px;
    border-radius: 6px;
    color: rgba(255, 255, 255, 0.3);
    font-size: 0.85rem;
    cursor: not-allowed;
}

/* ============================================================
   Photo utilisateur (barre du haut) - global car TopbarUserPhoto
   est un composant enfant de MainLayout : le CSS isolé du parent
   ne s'applique jamais à ses propres éléments rendus.
   ============================================================ */
.app-topbar-photo {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.6);
}

.app-topbar-photo-placeholder {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: white;
}

/* ============================================================
   Logo applicatif (sidebar, Welcome, Login) - même raison :
   AppLogo est utilisé dans plusieurs composants différents.
   ============================================================ */
.app-logo-img {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    object-fit: cover;
}

.app-logo-emoji {
    font-size: 1.6rem;
}

.app-logo-img-large {
    max-width: 100px;
    max-height: 100px;
    object-fit: contain;
}

.app-logo-emoji-large {
    font-size: 3.5rem;
}

/* ============================================================
   Tableaux sur mobile - défilement horizontal plutôt que casser
   la mise en page. Règle globale car appliquée à des dizaines de
   pages existantes sans avoir à toucher chacune individuellement.
   ============================================================ */
@media (max-width: 768px) {
    .app-content table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
}
