/*
 * Arc_Prod File Role: XH Design System — Navbar component (tenant runtime).
 * File: public_html/assets/xhelpers/css/navbar.css
 *
 * Rôle : .navbar-modern — composant navbar complet (styles + states + responsive).
 * À nettoyer en Phase 3 (dead code ~5%).
 */

/* === NAVBAR MODERNE === */
.navbar-modern {
    background: var(--navbar-bg);
    border-bottom: 1px solid var(--navbar-border);
    box-shadow: var(--navbar-shadow);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1200;
    height: var(--navbar-height);
    backdrop-filter: blur(12px);
    transition: all 0.4s cubic-bezier(0.4,0,0.2,1);
}

/* Hauteur réduite sur mobile pour plus d'espace */
@media (max-width: 767.98px) {
    .navbar-modern {
        height: 56px;
    }
    
    body {
        padding-top: 56px !important;
    }
}

@media (max-width: 479.98px) {
    .navbar-modern {
        height: 52px;
    }
    
    body {
        padding-top: 52px !important;
    }
}

/* États de la navbar au scroll */
.navbar-modern.navbar-hidden {
    transform: translateY(-100%);
    opacity: 0.95;
}

.navbar-modern.navbar-visible {
    transform: translateY(0);
    opacity: 1;
}

.navbar-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding: 0 1.5rem;
    position: relative;
    z-index: 1201;
}

.navbar-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.navbar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
}

body.arcprod-tenant .navbar-modern .navbar-theme-toggle {
    color: var(--token-text-secondary, #6b7280) !important;
}

/* Uniformisation taille icônes navbar droite */
body.arcprod-tenant .navbar-right .global-search-icon,
body.arcprod-tenant .navbar-right .notif-bell-container #notifBellBtn i,
body.arcprod-tenant .navbar-right .navbar-theme-toggle i {
    font-size: 1rem !important;
}

body.arcprod-tenant .navbar-modern .navbar-theme-toggle:hover,
body.arcprod-tenant .navbar-modern .navbar-theme-toggle:focus-visible {
    color: var(--token-text-primary, #111827) !important;
}

/* === MENU TOGGLE BUTTON === */
.menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: none;
    background: transparent;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    z-index: 1070;
}

.menu-toggle:hover {
    background: var(--primary-green-light);
    transform: translateY(-1px);
}

.menu-toggle:active {
    transform: translateY(0);
}

.menu-toggle.sidebar-closed {
    background: var(--primary-green-light);
}

.menu-toggle.sidebar-closed:hover {
    background: rgba(16,185,129,0.2);
}

/* === ICONE MENU TOGGLE === */
.menu-toggle .bi {
    font-size: 1.45rem;
    color: var(--brand-text);
    line-height: 1;
}

/* === BRAND CONTAINER AVEC LOGO ULB PRINCIPAL === */
.brand-container-text {
    display: flex;
    align-items: center;
    text-decoration: none;
    transition: opacity 0.15s ease;
    margin-left: 0.5rem;
    height: 60px;
    padding: 0 0.5rem;
    gap: 10px;
    background: transparent;
    border: none;
    box-shadow: none;
}

.brand-container-text:hover {
    opacity: 0.78;
    text-decoration: none;
    background: transparent;
    border: none;
    box-shadow: none;
    transform: none;
}

.brand-logo-stack {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
}

.ulb-logo-brand {
    height: 52px;
    width: auto;
    max-width: 200px;
    flex-shrink: 0;
    display: block;
    /* Logo fourni par le demandeur : dimensions arbitraires. object-fit garde le ratio
       si le plafond max-width s'applique (logo large), au lieu d'écraser l'image. */
    object-fit: contain;
}

.brand-container-text:hover .ulb-logo-brand {
    transform: none;
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.brand-primary {
    font-size: 0.95rem;
    font-weight: 600;
    /* --brand-text-color n'etait defini nulle part (token fantome, le repli
       s'appliquait toujours) : --brand-text remplit le meme role et garantit AA. */
    color: var(--brand-text);
    margin: 0;
    white-space: nowrap;
    letter-spacing: -0.02em;
}

.k-kosmos {
    color: inherit;
    font-weight: 700;
}

.brand-secondary {
    font-size: 0.68rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    white-space: nowrap;
    opacity: 0.65;
}

.brand-container-text:hover .brand-primary,
.brand-container-text:hover .brand-secondary {
    transform: none;
    text-shadow: none;
}

.brand-container,
.brand-logo {
    display: none !important;
}

/* === ULB PARTNER SUPPRIMÉ - LOGO ULB MAINTENANT DANS LE BRANDING === */
.ulb-partner {
    display: none !important;
}

.ulb-logo-svg {
    display: none !important;
}

.ulb-text {
    display: none !important;
}

/* === USER DROPDOWN === */
.user-dropdown {
    position: relative;
    z-index: 1220;
}

.user-dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 3px 6px 3px 3px;
    background: transparent;
    border: none;
    border-radius: 9px;
    text-decoration: none;
    color: var(--dark-text) !important;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    min-width: auto;
    justify-content: center;
    position: relative;
    overflow: visible;
    box-shadow: none;
}

.user-dropdown-toggle::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(74, 144, 217, 0.02), rgba(74, 144, 217, 0.04));
    opacity: 0;
    transition: opacity 0.15s ease;
    border-radius: 9px;
}

.user-dropdown-toggle:hover {
    background: rgba(0, 0, 0, 0.04);
    border-color: transparent;
    color: var(--dark-text) !important;
    transform: none;
    box-shadow: none;
    text-decoration: none;
}

.user-dropdown-toggle:hover::before {
    opacity: 1;
}

.user-dropdown-toggle:focus {
    outline: none;
    box-shadow: none;
}

.user-dropdown-toggle[aria-expanded="true"] {
    background: rgba(0, 0, 0, 0.04);
    box-shadow: none;
}

.user-avatar {
    width: 30px;
    height: 30px;
    background: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    /* Couleur de marque arbitraire (admin tenant) : blanc fixe illisible sur
       un vert/jaune clair (ex. #14ae5c donne 2,9:1). --text-on-primary est
       calcule cote serveur (_layout_header.php) selon le contraste reel. */
    color: var(--text-on-primary, white) !important;
    font-weight: 600;
    font-size: 0.75rem;
    flex-shrink: 0;
    text-transform: uppercase;
    transition: all 0.2s cubic-bezier(0.4,0,0.2,1);
    position: relative;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.user-avatar::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.2), transparent);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.user-dropdown-toggle:hover .user-avatar {
    transform: scale(1.05);
    box-shadow: 0 4px 8px color-mix(in srgb, var(--primary-color) 25%, transparent);
}

.user-dropdown-toggle:hover .user-avatar::before {
    opacity: 1;
}

.user-dropdown-toggle[aria-expanded="true"] .user-avatar {
    transform: scale(1.05);
    box-shadow: 0 4px 8px color-mix(in srgb, var(--primary-color) 25%, transparent);
}

/* Icône de rôle : masquée — trop verbeux visuellement */
.user-role-icon {
    display: none !important;
}

.user-info {
    flex-grow: 1;
    min-width: 0;
}

.user-name {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--dark-text) !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}

.user-role {
    font-size: 0.7rem;
    font-weight: 400;
    /* Le dropdown utilisateur passe a #1c1c1e en sombre (dark-mode.css) : #6b7280
       n'y offrait que 3,52:1, sous le seuil AA. --text-secondary donne 5,95:1. */
    color: var(--text-secondary) !important;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    line-height: 1;
}

.dropdown-arrow {
    font-size: 0.6rem;
    color: var(--xh-min-text-muted) !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    opacity: 0.7;
}

.user-dropdown-toggle:hover .dropdown-arrow {
    color: var(--brand-text) !important;
    opacity: 1;
}

/* Animation native CSS pour la flèche */
.user-dropdown-toggle[aria-expanded="true"] .dropdown-arrow {
    transform: rotate(180deg);
    color: var(--brand-text) !important;
    opacity: 1;
}

/* === DROPDOWN MENU === */
.user-dropdown .dropdown-menu {
    min-width: 280px;
    max-width: 300px;
    width: 280px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1),
                0 10px 10px -5px rgba(0, 0, 0, 0.04),
                0 0 0 1px rgba(0, 0, 0, 0.05);
    padding: 0.5rem;
    background-color: white;
    overflow: hidden;
    margin-top: 8px;
    position: absolute !important;
    top: calc(100% + 8px) !important;
    right: 0 !important;
    left: auto !important;
    z-index: 1060 !important;
    transform-origin: top right;
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.user-dropdown .dropdown-menu.dropdown-menu-end {
    right: 0 !important;
    left: auto !important;
}

.user-dropdown .dropdown-menu:not(.show) {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    display: none !important;
}

.user-dropdown .dropdown-menu.show {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    display: block !important;
}

.dropdown-header-modern {
    padding: 12px;
    background-color: #f9fafb;
    border-bottom: none;
    margin: 0 0 0.5rem 0;
    border-radius: 8px;
}

.dropdown-user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.dropdown-user-avatar {
    width: 32px;
    height: 32px;
    background: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-on-primary, white);
    font-weight: 600;
    font-size: 0.9rem;
    flex-shrink: 0;
    text-transform: uppercase;
}

.dropdown-user-details {
    flex-grow: 1;
    min-width: 0;
}

.dropdown-user-name {
    font-weight: 600;
    color: var(--text-primary) !important;
    margin: 0;
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dropdown-user-role {
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin: 2px 0 0 0;
}

.dropdown-user-role .badge {
    font-size: 0.65rem;
    padding: 3px 8px;
    border-radius: 6px;
    background-color: var(--ulb-blue) !important;
    color: var(--text-on-primary, white);
    margin-left: 0;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.dropdown-item {
    color: #1f2937;
    padding: 6px 16px;
    font-size: 0.85rem;
}

.dropdown-item:hover {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
}

.dropdown-item-modern {
    padding: 10px 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #374151 !important;
    text-decoration: none;
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 8px;
    position: relative;
}

.dropdown-item-modern:hover,
.dropdown-item-modern:focus {
    background-color: #e5e7eb;
    color: #111827 !important;
    text-decoration: none;
    font-weight: 600;
}

.dropdown-item-modern i {
    color: #6b7280;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 1rem;
    flex-shrink: 0;
    transition: all 0.15s ease;
}

.dropdown-item-modern:hover i {
    color: var(--brand-text);
    transform: scale(1.1);
}

.dropdown-item-modern.active {
    background-color: rgba(74, 144, 217, 0.08);
    color: var(--brand-text) !important;
    font-weight: 600;
}

.dropdown-item-modern.active i {
    color: var(--brand-text);
}

.dropdown-header {
    padding: 8px 12px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 0.5rem;
}

/* Emojis drapeaux dans le menu langue */
.dropdown-item-modern span[style*="font-size: 1.25rem"] {
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.dropdown-divider-modern {
    height: 1px;
    background: var(--xh-min-border);
    margin: 0.5rem 0;
    border: none;
}

.dropdown-submenu {
    background-color: var(--bg-secondary);
    margin: 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.dropdown-submenu .dropdown-item-modern {
    padding-left: 45px;
    font-size: 0.85rem;
    color: var(--text-primary) !important;
    font-weight: 500;
    opacity: 1 !important;
    visibility: visible !important;
}

.dropdown-submenu .dropdown-item-modern:hover {
    background-color: var(--bg-muted) !important;
    color: var(--text-primary) !important;
}

.dropdown-submenu .dropdown-item-modern i {
    color: var(--text-secondary) !important;
    font-size: 0.9rem;
}

.dropdown-submenu .dropdown-item-modern:hover i {
    color: var(--brand-text) !important;
}

.dropdown-item-modern .ms-auto {
    margin-left: auto;
    transition: transform 0.3s ease;
    color: var(--text-secondary) !important;
    opacity: 1 !important;
    visibility: visible !important;
}

.modern-login-btn {
    border-radius: var(--border-radius);
    padding: 0.625rem 1.25rem;
    font-weight: 600;
    border-color: var(--primary-green);
    color: var(--brand-text);
    transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
    box-shadow: var(--shadow-soft);
}

.modern-login-btn:hover {
    background: var(--sidebar-active);
    border-color: var(--primary-green-dark);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

/* === RESPONSIVE NAVBAR === */
@media (max-width: 991.98px) {
    .navbar-container { 
        padding: 0 0.75rem; 
        gap: 0.5rem; 
    }
    
    .navbar-left { 
        gap: 0.25rem; 
        flex: 1;
        min-width: 0;
    }
    
    .navbar-right {
        flex-shrink: 0;
    }
    
    .brand-secondary { 
        display: none; 
    }
    
    .brand-container-text {
        padding: 0.4rem 0.6rem;
        gap: 8px;
    }
    
    .ulb-logo-brand {
        height: 28px;
        max-width: 100px;
    }
    
    .brand-primary {
        font-size: 0.9rem;
    }
    
    .user-dropdown-toggle { 
        min-width: auto; 
        padding: 6px 8px; 
        gap: 6px; 
    }
    
    .user-avatar { 
        width: 24px; 
        height: 24px; 
        font-size: 0.7rem; 
    }
    
    .user-dropdown .dropdown-menu { 
        min-width: 200px; 
        max-width: 220px; 
        width: 200px; 
        margin-top: 4px; 
        right: 0px !important; 
    }
}

@media (max-width: 575.98px) {
    .navbar-container { 
        padding: 0 0.5rem; 
        gap: 0.25rem;
    }
    
    .navbar-left { 
        gap: 0.125rem; 
        overflow: hidden;
    }
    
    .brand-container-text { 
        margin-left: 0;
        padding: 0.3rem 0.5rem;
        gap: 6px;
        max-width: calc(100vw - 120px);
    }
    
    .ulb-logo-brand {
        height: 24px;
        max-width: 80px;
        flex-shrink: 0;
    }
    
    .brand-primary { 
        font-size: 0.85rem; 
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .brand-secondary { 
        display: none;
    }
    
    .user-dropdown-toggle {
        padding: 5px 7px;
        gap: 5px;
    }
    
    .user-avatar {
        width: 22px;
        height: 22px;
        font-size: 0.65rem;
    }
}

@media (max-width: 479.98px) {
    .navbar-container {
        padding: 0 0.375rem;
        gap: 0.125rem;
    }
    
    .brand-container-text { 
        margin-left: 0;
        padding: 0.25rem 0.375rem;
        gap: 4px;
        max-width: calc(100vw - 100px);
    }
    
    .ulb-logo-brand {
        height: 20px;
        max-width: 60px;
    }
    
    .brand-primary { 
        font-size: 0.8rem;
        max-width: 120px;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .brand-text {
        max-width: 120px;
        overflow: hidden;
    }
    
    .user-dropdown-toggle { 
        min-width: 70px; 
        padding: 4px 6px; 
        gap: 4px; 
    }
    
    .user-info { 
        display: none; 
    }
    
    .user-avatar { 
        width: 24px; 
        height: 24px; 
        font-size: 0.7rem; 
    }
    
    .user-dropdown .dropdown-menu { 
        min-width: 240px !important; 
        max-width: 240px !important; 
        width: 240px !important; 
        margin-top: 6px !important; 
        right: 0px !important;
    }
}

@media (max-width: 380px) { 
    .ulb-text { 
        display: none; 
    } 
}

@media (max-width: 380px) {
    .brand-container-text {
        max-width: calc(100vw - 90px);
    }
    
    .ulb-logo-brand {
        height: 18px;
        max-width: 50px;
    }
    
    .brand-primary {
        font-size: 0.75rem;
        max-width: 100px;
    }
    
    .brand-text {
        max-width: 100px;
    }
    
    .user-dropdown-toggle {
        min-width: 60px;
        padding: 3px 5px;
    }
    
    .user-avatar {
        width: 22px;
        height: 22px;
        font-size: 0.65rem;
    }
}

@media (max-width: 320px) {
    .navbar-container {
        padding: 0 0.25rem;
    }
    
    .brand-container-text {
        max-width: calc(100vw - 80px);
        padding: 0.2rem 0.3rem;
    }
    
    .ulb-logo-brand {
        height: 16px;
        max-width: 40px;
    }
    
    .brand-primary { 
        font-size: 0.7rem;
        max-width: 80px;
    }
    
    .brand-text { 
        max-width: 80px; 
    }
    
    .user-dropdown-toggle {
        min-width: 50px;
        padding: 2px 4px;
    }
    
    .user-avatar {
        width: 20px;
        height: 20px;
        font-size: 0.6rem;
    }
}

/* === ACCESSIBILITY === */
.menu-toggle:focus-visible,
.brand-container-text:focus-visible,
.ulb-partner:focus-visible,
.user-dropdown-toggle:focus-visible {
    outline: 2px solid var(--ulb-blue);
    outline-offset: 2px;
    border-radius: 12px;
}

.dropdown-item-modern:focus-visible {
    outline: 2px solid var(--ulb-blue);
    outline-offset: -2px;
}

/* === NAVBAR UTILITIES === */
.navbar:not(.navbar-modern) { 
    display: none !important; 
}

.navbar-modern * { 
    box-sizing: border-box; 
}

.navbar-modern .container-fluid { 
    all: unset; 
    display: flex; 
    align-items: center; 
    justify-content: space-between; 
    height: 100%; 
    width: 100%; 
    padding: 0 1.5rem; 
}

.navbar-modern.loading { 
    opacity: 0.8; 
    pointer-events: none; 
}

.navbar-modern.loading::after { 
    content: ''; 
    position: absolute; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 2px; 
    background: linear-gradient(90deg, transparent, var(--primary-green), transparent); 
    animation: loading 1.5s infinite; 
}


/* === REDUCED MOTION === */
@media (prefers-reduced-motion: reduce) {
    .navbar-modern, 
    .menu-toggle, 
    .brand-container-text, 
    .ulb-partner, 
    .user-dropdown-toggle, 
    .dropdown-item-modern, 
    .hamburger, 
    .hamburger span { 
        transition: none !important; 
        animation: none !important; 
    }
}

/* === HIGH CONTRAST === */
@media (prefers-contrast: high) {
    .navbar-modern { 
        border-bottom: 2px solid #000; 
    }
    
    .user-avatar, 
    .dropdown-user-avatar { 
        border: 2px solid #000; 
    }
    
    .user-dropdown-toggle, 
    .ulb-partner { 
        border: 2px solid #000; 
    }
}

/* === PRINT === */
@media print {
    .navbar-modern { 
        display: none !important; 
    }
}

/* === PERFORMANCE === */
.menu-toggle, 
.hamburger, 
.hamburger span, 
.brand-container-text { 
    will-change: transform; 
}

.hamburger span { 
    transform: translateZ(0); 
}

@supports (backdrop-filter: blur(8px)) {
    .navbar-modern { 
        backdrop-filter: blur(8px); 
    }
}

@supports not (backdrop-filter: blur(8px)) {
    .navbar-modern { 
        background: #ffffff; 
    }
}

/* =========================================================
   DROPDOWN UX: edition toggle + langue active
   ========================================================= */
.edition-toggle-item {
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

.edition-toggle-item .edition-toggle-pill {
    margin-left: auto;
    width: 34px;
    height: 18px;
    border-radius: 999px;
    position: relative;
    background: #cbd5e1;
    transition: all 0.2s ease;
}

.edition-toggle-item .edition-toggle-pill::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--color-white);
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
    transition: all 0.2s ease;
}

.edition-toggle-item.is-on .edition-toggle-pill,
.edition-toggle-item .edition-toggle-pill.is-on {
    background: var(--ulb-blue);
}

.edition-toggle-item.is-on .edition-toggle-pill::after,
.edition-toggle-item .edition-toggle-pill.is-on::after {
    transform: translateX(16px);
}

.language-item.active {
    font-weight: 700;
    background: rgba(0, 63, 127, 0.08);
    color: var(--brand-text) !important;
}

.language-item.active i.bi-check2 {
    color: var(--brand-text);
    font-weight: 800;
}

/* Quick visual shortcuts in user dropdown (favorites) */
.favorite-shortcut-icon {
    width: 1.35rem;
    height: 1.35rem;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.55rem;
    flex-shrink: 0;
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.favorite-shortcut-icon i {
    font-size: 0.72rem;
    margin: 0;
    line-height: 1;
}

.favorite-shortcut-icon-video {
    background: rgba(37, 99, 235, 0.14);
}

.favorite-shortcut-icon-tutorial {
    background: rgba(5, 150, 105, 0.14);
}

.dropdown-item-modern:hover .favorite-shortcut-icon-video {
    background: rgba(37, 99, 235, 0.24);
}

.dropdown-item-modern:hover .favorite-shortcut-icon-tutorial {
    background: rgba(5, 150, 105, 0.24);
}

.favorite-shortcut-icon-calendar {
    background: rgba(59, 130, 246, 0.14);
}

.dropdown-item-modern:hover .favorite-shortcut-icon-calendar {
    background: rgba(59, 130, 246, 0.24);
}

/* =========================================================
   USER DROPDOWN UX POLISH
   ========================================================= */

.user-dropdown .dropdown-menu {
    min-width: 280px;
    width: 280px;
    max-width: min(90vw, 320px);
    padding: 0.45rem;
    border-radius: 14px;
}

.dropdown-header-modern {
    background: linear-gradient(135deg, #f8fbff 0%, #eef5ff 100%);
    border: 1px solid rgba(0, 63, 127, 0.12);
    border-radius: 12px;
    padding: 0.6rem;
    margin-bottom: 0.42rem;
}

.dropdown-user-info {
    gap: 0.75rem;
}

.dropdown-user-avatar {
    width: 34px;
    height: 34px;
    font-size: 0.84rem;
    box-shadow: 0 2px 8px rgba(0, 63, 127, 0.22);
}

.dropdown-user-name {
    font-size: 0.93rem;
    font-weight: 700;
}

.dropdown-user-role {
    margin-top: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.dropdown-user-role .dropdown-role-inline {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.68rem;
    color: var(--text-secondary);
}

.dropdown-user-role .role-badge {
    font-size: 0.62rem;
    border-radius: 999px;
    padding: 0.16rem 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}


.dropdown-user-role .role-badge.role-editeur {
    background: linear-gradient(135deg, #12b981 0%, #0b9d72 100%) !important;
    color: #ffffff !important;
}

.dropdown-user-role .role-badge.role-user {
    background: linear-gradient(135deg, #64748b 0%, #475569 100%) !important;
    color: #ffffff !important;
}

.dropdown-section-title {
    padding: 0.42rem 0.6rem 0.28rem;
    font-size: 0.67rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #6b7280;
}

.dropdown-divider-modern {
    margin: 0.42rem 0;
}

.dropdown-item-modern {
    border: 1px solid transparent;
    border-radius: 10px;
    padding: 0.46rem 0.58rem;
    font-size: 0.9rem;
    font-weight: 600;
    gap: 0.52rem;
}

.dropdown-item-modern .dropdown-item-label {
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dropdown-item-modern .dropdown-item-icon {
    width: 1.5rem;
    height: 1.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    /* Etait #64748b en dur : 4,44:1 sur le fond de page clair et 3,58:1 sur
       une carte sombre. --text-secondary est defini dans les DEUX themes. */
    color: var(--text-secondary);
    border: none;
    flex-shrink: 0;
}

.dropdown-item-modern .dropdown-item-icon i {
    width: auto;
    height: auto;
    font-size: 0.84rem;
    color: inherit;
    transform: none;
}

.dropdown-item-modern:hover,
.dropdown-item-modern:focus {
    background-color: #f8fbff;
    border-color: rgba(0, 63, 127, 0.18);
    color: #0f172a !important;
}

.dropdown-item-modern:hover .dropdown-item-icon,
.dropdown-item-modern:focus .dropdown-item-icon {
    background: transparent;
    color: var(--brand-text);
    border: none;
}

.favorite-shortcut-icon {
    width: 1.5rem;
    height: 1.5rem;
    margin-right: 0;
    border-radius: 10px;
}

.favorite-shortcut-icon i {
    font-size: 0.76rem;
}

.edition-toggle-item {
    gap: 0.6rem;
}

.edition-toggle-item .edition-toggle-pill {
    width: 34px;
    height: 18px;
}

.edition-toggle-item .edition-toggle-pill::after {
    width: 14px;
    height: 14px;
}

.edition-toggle-item.is-on .edition-toggle-pill::after,
.edition-toggle-item .edition-toggle-pill.is-on::after {
    transform: translateX(16px);
}

.language-item.active {
    background: rgba(0, 63, 127, 0.08);
    border-color: rgba(0, 63, 127, 0.2);
    color: var(--brand-text) !important;
}

.language-item .language-check {
    margin-left: auto;
    font-size: 0.95rem;
    color: var(--brand-text);
    font-weight: 800;
}

.logout-item {
    /* --token-danger n'est defini qu'en sombre (#ff453a, 4,99:1 sur le dropdown
       #1c1c1e) : le repli #b42318 preserve exactement le rendu clair actuel.
       Sans lui, #b42318 fixe ne donnait que 2,59:1 en sombre, sous le seuil AA. */
    color: var(--token-danger, #b42318) !important;
}

.logout-item .dropdown-item-icon {
    background: rgba(217, 45, 32, 0.12);
    border-color: rgba(217, 45, 32, 0.2);
    color: #b42318;
}

.logout-item:hover,
.logout-item:focus {
    background: rgba(217, 45, 32, 0.08);
    border-color: rgba(217, 45, 32, 0.2);
    /* Meme token qu'au repos : #901f12 fixe descendait a 1,94:1 en sombre, la
       distinction visuelle du survol reste portee par le fond rgba ci-dessus. */
    color: var(--token-danger, #901f12) !important;
}

.logout-item:hover .dropdown-item-icon,
.logout-item:focus .dropdown-item-icon {
    background: rgba(217, 45, 32, 0.16);
    border-color: rgba(217, 45, 32, 0.25);
    color: #901f12;
}

@media (max-width: 991.98px) {
    .user-dropdown .dropdown-menu {
        min-width: 260px;
        width: min(88vw, 300px);
    }
}

/* =====================================================================
   Notification Bell
   ===================================================================== */

.notif-bell-container {
    position: relative;
}

.notif-bell-container #notifBellBtn {
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: var(--text-primary, #1a202c);
    transition: opacity 150ms ease;
    text-decoration: none;
}

.notif-bell-container #notifBellBtn:hover {
    opacity: 0.60;
    background: transparent;
    color: var(--text-primary, #1a202c);
}

.notif-bell-container #notifBellBtn i {
    font-size: 1.1rem !important;
    line-height: 1;
}

#notifDropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 320px;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 0.6rem;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    z-index: 1065;
    overflow: hidden;
}

#notifDropdown .notif-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 0.85rem;
    border-bottom: 1px solid #f0f0f0;
    background: #fafafa;
}

#notifDropdown .notif-header strong {
    font-size: 0.85rem;
    font-weight: 600;
    color: #1a202c;
}

#notifDropdown #notifMarkAllRead {
    font-size: 0.75rem;
    color: var(--brand-text);
    text-decoration: none;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
}

#notifDropdown #notifMarkAllRead:hover {
    text-decoration: underline;
}

#notifDropdown #notifList {
    max-height: 280px;
    overflow-y: auto;
}

#notifDropdown .notif-empty {
    text-align: center;
    color: #6c757d;
    font-size: 0.84rem;
    padding: 1.25rem 0.75rem;
}

#notifDropdown .notif-item {
    padding: 0.55rem 0.85rem;
    border-bottom: 1px solid #f4f4f4;
    transition: background 0.15s;
}

#notifDropdown .notif-item:last-child {
    border-bottom: none;
}

#notifDropdown .notif-item.bg-light,
#notifDropdown .notif-item:not(.read) {
    background: #f0f6ff;
}

#notifDropdown .notif-item:hover {
    background: #e8f0fe;
}

#notifDropdown .notif-view-all {
    display: block;
    text-align: center;
    padding: 0.5rem;
    font-size: 0.8rem;
    color: var(--brand-text);
    text-decoration: none;
    border-top: 1px solid #dee2e6;
    background: #fafafa;
}

#notifDropdown .notif-view-all:hover {
    background: #f0f4ff;
    text-decoration: underline;
}

@media (max-width: 575.98px) {
    #notifDropdown {
        width: min(92vw, 320px);
        right: -8px;
    }
}

/* =====================================================================
   End notification bell
   ===================================================================== */

@media (max-width: 575.98px) {
    .user-dropdown .dropdown-menu {
        width: min(80vw, 260px) !important;
        min-width: min(80vw, 260px) !important;
        max-width: min(80vw, 260px) !important;
        padding: 0.36rem;
        border-radius: 12px;
    }

    .dropdown-header-modern {
        padding: 0.48rem;
        margin-bottom: 0.32rem;
    }

    .dropdown-user-avatar {
        width: 30px;
        height: 30px;
        font-size: 0.78rem;
    }

    .dropdown-user-name {
        font-size: 0.82rem;
    }

    .dropdown-item-modern {
        font-size: 0.81rem;
        padding: 0.34rem 0.44rem;
        border-radius: 8px;
        gap: 0.42rem;
    }

    .dropdown-item-modern .dropdown-item-icon {
        width: 1.3rem;
        height: 1.3rem;
        border-radius: 8px;
    }

    .dropdown-item-modern .dropdown-item-icon i {
        font-size: 0.72rem;
    }

    .dropdown-section-title {
        font-size: 0.62rem;
        padding: 0.34rem 0.44rem 0.2rem;
    }

    .dropdown-user-role .role-badge {
        font-size: 0.56rem;
        padding: 0.12rem 0.38rem;
    }

    #notifDropdown {
        width: min(80vw, 260px);
        right: 0;
        border-radius: 10px;
    }

    #notifDropdown .notif-header {
        padding: 0.46rem 0.56rem;
    }

    #notifDropdown .notif-header strong {
        font-size: 0.78rem;
    }

    #notifDropdown #notifMarkAllRead {
        font-size: 0.68rem;
    }

    #notifDropdown #notifList {
        max-height: 210px;
    }

    #notifDropdown .notif-item {
        padding: 0.4rem 0.56rem;
    }

    #notifDropdown .notif-item .notif-link {
        font-size: 0.76rem !important;
        line-height: 1.24;
    }

    #notifDropdown .notif-view-all {
        font-size: 0.74rem;
        padding: 0.4rem;
    }

    .notif-bell-container #notifBellBtn {
        width: 34px;
        height: 34px;
        border-radius: 9px;
    }

    .notif-bell-container #notifBellBtn i {
        font-size: 1rem !important;
    }
}

@media (max-width: 420px) {
    .user-dropdown .dropdown-menu {
        width: min(76vw, 236px) !important;
        min-width: min(76vw, 236px) !important;
        max-width: min(76vw, 236px) !important;
    }

    #notifDropdown {
        width: min(76vw, 236px);
    }
}

/* ===== MERGED: redesign/06-navbar-dropdown.css — user dropdown styles ===== */

/* --- Navbar user dropdown: minimalist pass --- */
body.arcprod-tenant .navbar-modern .user-dropdown-toggle {
    min-height: 34px !important;
    padding: 2px 4px 2px 2px !important;
    border: 0 !important;
    border-radius: 999px !important;
    background: transparent !important;
    box-shadow: none !important;
    gap: 0.32rem !important;
}

body.arcprod-tenant .navbar-modern .user-dropdown-toggle:hover,
body.arcprod-tenant .navbar-modern .user-dropdown-toggle:focus,
body.arcprod-tenant .navbar-modern .user-dropdown-toggle:focus-visible,
body.arcprod-tenant .navbar-modern .user-dropdown-toggle[aria-expanded="true"] {
    background: color-mix(in srgb, var(--rd-topbar-accent) 10%, #ffffff 90%) !important;
    border: 0 !important;
    outline: none !important;
    box-shadow: none !important;
}

body.arcprod-tenant .navbar-modern .user-dropdown-toggle .user-avatar {
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    border: 0 !important;
    box-shadow: none !important;
    font-size: 0.9rem !important;
}

body.arcprod-tenant .navbar-modern .user-dropdown-toggle .user-role-icon,
body.arcprod-tenant .navbar-modern .user-dropdown-toggle .dropdown-arrow {
    width: 16px !important;
    height: 16px !important;
    font-size: 0.84rem !important;
    color: var(--token-text-secondary, #64748b) !important;
    opacity: 1 !important;
}

body.arcprod-tenant .navbar-modern .user-dropdown .dropdown-menu {
    margin-top: 0.48rem !important;
    min-width: 320px !important;
    padding: 0.45rem !important;
    border: 1px solid #dbe3ef !important;
    border-radius: 14px !important;
    background: #ffffff !important;
    box-shadow: 0 18px 38px rgba(15, 23, 42, 0.14), 0 1px 3px rgba(15, 23, 42, 0.08) !important;
}

body.arcprod-tenant .navbar-modern .user-dropdown .dropdown-header-modern {
    margin: 0 !important;
    padding: 12px 16px !important;
    border: 0 !important;
    border-bottom: 1px solid var(--token-border, #e5e5e5) !important;
    border-radius: 0 !important;
    background: transparent !important;
}

body.arcprod-tenant .navbar-modern .user-dropdown .dropdown-user-info {
    gap: 0.58rem !important;
}

body.arcprod-tenant .navbar-modern .user-dropdown .dropdown-user-avatar {
    width: 46px !important;
    height: 46px !important;
    min-width: 46px !important;
    border: 0 !important;
    box-shadow: none !important;
    font-size: 1.18rem !important;
}

body.arcprod-tenant .navbar-modern .user-dropdown .dropdown-user-name {
    font-size: 1.12rem !important;
    line-height: 1.12 !important;
    font-weight: 700 !important;
    color: #111827 !important;
    margin-bottom: 0.22rem !important;
}

body.arcprod-tenant .navbar-modern .user-dropdown .dropdown-user-role .role-badge {
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.35rem !important;
    min-height: 25px !important;
    padding: 0.18rem 0.62rem !important;
    border-radius: 999px !important;
    border: 1px solid color-mix(in srgb, var(--rd-topbar-accent) 36%, #b6cae4 64%) !important;
    background: color-mix(in srgb, var(--rd-topbar-accent) 14%, #ffffff 86%) !important;
    color: color-mix(in srgb, var(--rd-topbar-accent) 88%, #1e293b 12%) !important;
    -webkit-text-fill-color: color-mix(in srgb, var(--rd-topbar-accent) 88%, #1e293b 12%) !important;
    opacity: 1 !important;
    letter-spacing: 0.01em !important;
    font-size: 0.75rem !important;
    font-weight: 800 !important;
    box-shadow: none !important;
    text-shadow: none !important;
}

body.arcprod-tenant .navbar-modern .user-dropdown .dropdown-user-role .role-badge::before {
    content: "" !important;
    width: 8px !important;
    height: 8px !important;
    border-radius: 999px !important;
    background: color-mix(in srgb, var(--rd-topbar-accent) 88%, #1e293b 12%) !important;
    flex: 0 0 auto !important;
}

body.arcprod-tenant .navbar-modern .user-dropdown .dropdown-section-title {
    margin: 0.38rem 0.1rem 0.22rem !important;
    padding: 0.18rem 0.2rem !important;
    color: #6b7280 !important;
    letter-spacing: 0.08em !important;
    font-size: 0.72rem !important;
    font-weight: 700 !important;
}

body.arcprod-tenant .navbar-modern .user-dropdown .dropdown-divider {
    margin: 0.42rem 0.18rem !important;
    border-top-color: #edf1f7 !important;
}

body.arcprod-tenant .navbar-modern .user-dropdown .dropdown-item-modern {
    display: flex !important;
    align-items: center !important;
    gap: 0.62rem !important;
    min-height: 30px !important;
    margin: 1px 4px !important;
    padding: 7px 12px !important;
    border-radius: 8px !important;
    border: 0 !important;
    background: transparent !important;
    color: #111827 !important;
    font-size: 0.875rem !important;
    font-weight: 400 !important;
}

body.arcprod-tenant .navbar-modern .user-dropdown .dropdown-item-modern:hover,
body.arcprod-tenant .navbar-modern .user-dropdown .dropdown-item-modern:focus {
    background: color-mix(in srgb, var(--rd-topbar-accent) 10%, #ffffff 90%) !important;
    color: color-mix(in srgb, var(--rd-topbar-accent) 70%, #1f2937 30%) !important;
}

body.arcprod-tenant .navbar-modern .user-dropdown .dropdown-item-modern.active {
    background: color-mix(in srgb, var(--rd-topbar-accent) 13%, #ffffff 87%) !important;
    color: color-mix(in srgb, var(--rd-topbar-accent) 78%, #1f2937 22%) !important;
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--rd-topbar-accent) 26%, #d8e3f3 74%) !important;
}

/* Langue active : fond très léger + font-weight, sans bordure gauche */
body.arcprod-tenant .navbar-modern .user-dropdown .dropdown-item-modern[href*="setLanguage"].active {
    background: rgba(0, 0, 0, 0.04) !important;
    color: var(--token-text-primary, #171717) !important;
    box-shadow: none !important;
    border-radius: 8px !important;
    padding: 7px 12px !important;
}

body.arcprod-tenant .navbar-modern .user-dropdown .dropdown-item-modern[href*="setLanguage"].active :is(.dropdown-item-icon, .favorite-shortcut-icon) {
    color: var(--token-text-secondary, #737373) !important;
}

body.arcprod-tenant .navbar-modern .user-dropdown .dropdown-item-modern[href*="setLanguage"].active .dropdown-item-label {
    font-weight: 600 !important;
}

body.arcprod-tenant .navbar-modern .user-dropdown .dropdown-item-modern :is(.dropdown-item-icon, .favorite-shortcut-icon) {
    width: 16px !important;
    height: 16px !important;
    min-width: 16px !important;
    border-radius: 0 !important;
    border: 0 !important;
    background: transparent !important;
    color: var(--token-text-secondary, #737373) !important;
    box-shadow: none !important;
}

body.arcprod-tenant .navbar-modern .user-dropdown .dropdown-item-modern :is(.dropdown-item-icon i, .favorite-shortcut-icon i) {
    font-size: 0.9rem !important;
    color: var(--token-text-secondary, #737373) !important;
}

body.arcprod-tenant .navbar-modern .user-dropdown .dropdown-item-modern .dropdown-item-label {
    line-height: 1.2 !important;
}

/* Force icônes items menu — SVG, img.icon, Bootstrap Icons */
body.arcprod-tenant .navbar-modern .user-dropdown .dropdown-menu svg,
body.arcprod-tenant .navbar-modern .user-dropdown .dropdown-menu img.icon,
body.arcprod-tenant .navbar-modern .user-dropdown .dropdown-menu i {
    width: 16px;
    height: 16px;
    color: var(--token-text-secondary) !important;
    fill: var(--token-text-secondary) !important;
    opacity: 0.6;
}
