/* Bandeau du haut : une seule ligne — logo · menu · compte, le tchat s'aligne à droite dans le bandeau (26/10/2026).
   Les pages de pilotage (En direct, E-mailing, Concurrence, Commissions, Particuliers, Paramètres) sont regroupées sous « Pilotage ».
   Sous 1300 px le menu se replie derrière le bouton (les pages de pilotage y sont alors listées à plat) et le tchat passe en bas à droite. */

.topbar {
    display: flex; align-items: center; flex-wrap: nowrap; justify-content: flex-start;
    gap: 1.4rem; min-height: 58px; padding: 0.35rem 1.2rem 0.35rem 1.5rem; padding-right: 7.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.topbar-brand { flex: 0 0 auto; }
.topbar-logo { height: 24px; }

.topbar-nav { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; flex-wrap: nowrap; gap: 0.1rem; }
.topbar-nav > a, .topbar-groupe-bouton {
    flex: 0 0 auto; white-space: nowrap; display: inline-flex; align-items: center; gap: 0.35rem;
    font-size: 0.82rem; font-weight: 500; letter-spacing: 0.005em; padding: 0.45rem 0.7rem; border-radius: 999px;
    color: #fff; opacity: 0.86; text-decoration: none !important; transition: background 0.2s ease, opacity 0.2s ease;
}
.topbar-nav > a:hover, .topbar-groupe-bouton:hover { background: rgba(255, 255, 255, 0.1); opacity: 1; }
.topbar-nav > a.active, .topbar-groupe-bouton.active, .topbar-groupe-bouton[aria-expanded="true"] { background: rgba(255, 255, 255, 0.18); font-weight: 600; opacity: 1; }
.topbar-groupe-bouton { border: 0; background: none; font-family: inherit; cursor: pointer; }
.topbar-groupe-bouton:focus-visible, .topbar-nav > a:focus-visible { outline: 2px solid #fff; outline-offset: 1px; }
.topbar-groupe-bouton svg { transition: transform 0.2s ease; }
.topbar-groupe-bouton[aria-expanded="true"] svg { transform: rotate(180deg); }

.topbar-groupe { position: relative; flex: 0 0 auto; }
.topbar-groupe-menu {
    position: absolute; top: calc(100% + 10px); left: 0; z-index: 1200; min-width: 220px; padding: 0.4rem;
    display: flex; flex-direction: column; gap: 1px;
    background: rgba(13, 58, 72, 0.97); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
    border: 1px solid rgba(255, 255, 255, 0.14); border-radius: 14px; box-shadow: 0 22px 44px -14px rgba(3, 22, 29, 0.6);
}
.topbar-groupe-menu[hidden] { display: none; }
.topbar-groupe-menu a { display: block; padding: 0.55rem 0.8rem; border-radius: 9px; color: #fff; font-size: 0.86rem; opacity: 0.92; text-decoration: none !important; }
.topbar-groupe-menu a:hover { background: rgba(255, 255, 255, 0.12); opacity: 1; }
.topbar-groupe-menu a.active { background: rgba(255, 255, 255, 0.18); font-weight: 600; opacity: 1; }

.topbar-utilisateur { margin-left: auto; display: flex; align-items: center; gap: 0.2rem; padding-left: 0.8rem; flex: 0 0 auto; }
.topbar-utilisateur .topbar-avatar { padding: 0; margin: 0; background: none !important; }
.topbar-utilisateur .topbar-logout { padding: 0.4rem 0.5rem; border-radius: 999px; }
.topbar-utilisateur .topbar-logout:hover { background: rgba(255, 255, 255, 0.1); }

/* tchat : dans le bandeau, à droite ; au-delà de 1500 px toutes les têtes en ligne, en dessous les deux premières */
.chat-widget { top: 7px; right: 1.2rem; }
.chat-panel { top: 4.6rem; }
@media (min-width: 1500px) { .topbar { padding-right: 16rem; } }
@media (max-width: 1499px) { .chat-avatar-wrap:nth-child(n+3), .chat-online-more { display: none; } }
@media (max-width: 1320px) {
    .topbar { gap: 1rem; }
    .topbar-nav > a, .topbar-groupe-bouton { font-size: 0.8rem; padding: 0.42rem 0.55rem; }
}

/* menu replié */
@media (max-width: 1300px) {
    .topbar { flex-wrap: wrap; padding: 0.5rem 1rem; gap: 0.5rem; }
    .topbar-toggle { display: flex; margin-left: auto; }
    .topbar-nav {
        display: none; flex: 1 0 100%; flex-direction: column; align-items: stretch; gap: 0;
        margin-top: 0.4rem; padding-top: 0.4rem; border-top: 1px solid rgba(255, 255, 255, 0.2);
    }
    .topbar-nav.is-open { display: flex; }
    .topbar-nav > a { padding: 0.65rem 0.4rem; font-size: 0.95rem; border-radius: 8px; }
    .topbar-groupe { display: contents; }
    .topbar-groupe-bouton { display: none; }
    .topbar-groupe-menu, .topbar-groupe-menu[hidden] {
        display: flex; position: static; min-width: 0; padding: 0; gap: 0; background: none; border: 0; border-radius: 0; box-shadow: none;
        -webkit-backdrop-filter: none; backdrop-filter: none;
    }
    .topbar-groupe-menu a { padding: 0.65rem 0.4rem; font-size: 0.95rem; border-radius: 8px; }
    .topbar-utilisateur { margin: 0; padding: 0.5rem 0 0.2rem; }
    .chat-widget { top: auto; bottom: 1rem; right: 1rem; }
    .chat-panel { top: auto; bottom: 5.2rem; right: 1rem; max-height: calc(100vh - 7rem); }
}
@media (max-width: 780px) { .chat-panel { right: 0.5rem; } }
