/* Header utilisateur — rendu premium (partagé espace user + lecture invité) */
    :root {
        --user-header-height: 76px;
        --user-h-accent: #C9A13B;
        --user-h-accent-glow: rgba(201, 161, 59, 0.45);
        --user-h-accent-soft: rgba(201, 161, 59, 0.35);
        --user-h-glass: rgba(255, 255, 255, 0.09);
        --user-h-glass-strong: rgba(255, 255, 255, 0.16);
        --user-h-border: rgba(255, 255, 255, 0.14);
        --user-h-ease: cubic-bezier(0.22, 1, 0.36, 1);
        --user-h-ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    }

    .user-header {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: var(--user-header-height);
        z-index: 1000;
        font-family: 'Poppins', 'Inter', system-ui, sans-serif;
        isolation: isolate;
        background:
            linear-gradient(180deg, rgba(255, 255, 255, 0.1) 0%, transparent 38%),
            radial-gradient(ellipse 90% 140% at 0% -30%, rgba(255, 255, 255, 0.2), transparent 52%),
            radial-gradient(ellipse 70% 120% at 100% -10%, rgba(26, 140, 220, 0.38), transparent 48%),
            radial-gradient(ellipse 80% 100% at 50% 120%, rgba(0, 35, 75, 0.55), transparent 50%),
            linear-gradient(135deg, #002a52 0%, #004a8c 22%, #0060bd 48%, #0d4d8c 78%, #082f52 100%);
        border-bottom: 1px solid rgba(255, 255, 255, 0.11);
        box-shadow:
            0 0 0 1px rgba(255, 255, 255, 0.06) inset,
            0 1px 0 rgba(255, 255, 255, 0.1) inset,
            0 6px 12px -4px rgba(0, 15, 45, 0.35),
            0 28px 56px -20px rgba(0, 30, 75, 0.6);
        backdrop-filter: blur(20px) saturate(1.15);
        -webkit-backdrop-filter: blur(20px) saturate(1.15);
    }

    .user-header-bg {
        position: absolute;
        inset: 0;
        z-index: 0;
        overflow: hidden;
        pointer-events: none;
    }

    .user-header-bg::before {
        content: '';
        position: absolute;
        width: 180%;
        height: 100%;
        left: -40%;
        top: 0;
        background: linear-gradient(
            100deg,
            transparent 0%,
            rgba(255, 255, 255, 0) 38%,
            rgba(255, 255, 255, 0.06) 49.5%,
            rgba(255, 255, 255, 0.11) 50.5%,
            rgba(255, 255, 255, 0.06) 52%,
            transparent 65%
        );
        transform: skewX(-14deg) translateX(-20%);
        animation: userHeaderLightSweep 9s ease-in-out infinite;
    }

    .user-header-bg::after {
        content: '';
        position: absolute;
        right: -15%;
        top: -80%;
        width: 55%;
        height: 220%;
        background: radial-gradient(ellipse at 40% 30%, rgba(255, 255, 255, 0.09) 0%, transparent 58%);
        animation: userHeaderOrb 14s ease-in-out infinite alternate;
    }

    @keyframes userHeaderLightSweep {
        0%, 100% { transform: skewX(-14deg) translateX(-28%); opacity: 0.35; }
        50% { transform: skewX(-14deg) translateX(18%); opacity: 0.75; }
    }

    @keyframes userHeaderOrb {
        0% { transform: translate(0, 0) scale(1); opacity: 0.55; }
        100% { transform: translate(-4%, 3%) scale(1.05); opacity: 0.85; }
    }

    .user-header::before {
        content: '';
        position: absolute;
        left: 0;
        right: 0;
        top: 0;
        height: 3px;
        z-index: 2;
        background: linear-gradient(90deg,
            transparent 0%,
            rgba(201, 161, 59, 0.2) 12%,
            var(--user-h-accent) 48%,
            rgba(255, 220, 150, 0.85) 50%,
            var(--user-h-accent) 52%,
            rgba(201, 161, 59, 0.2) 88%,
            transparent 100%);
        background-size: 200% 100%;
        animation: userHeaderGoldSheen 6s ease-in-out infinite;
        pointer-events: none;
    }

    @keyframes userHeaderGoldSheen {
        0%, 100% { background-position: 0% 50%; }
        50% { background-position: 100% 50%; }
    }

    /* Réinitialisation forte vs Bootstrap Reboot (ul padding, etc.) */
    body.user-dashboard {
        padding-top: var(--user-header-height) !important;
    }

    .user-navbar {
        position: relative;
        z-index: 1;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding: 0 24px;
        max-width: 1440px;
        margin: 0 auto;
        height: var(--user-header-height);
        min-width: 0;
        box-sizing: border-box;
    }

    .user-logo {
        display: flex;
        align-items: center;
        gap: 14px;
        text-decoration: none;
        color: #fff;
        transition: transform 0.4s var(--user-h-ease-out);
        flex-shrink: 0;
    }

    .user-logo:hover {
        transform: translateY(-2px);
    }

    .user-logo-frame {
        position: relative;
        flex-shrink: 0;
        padding: 2px;
        border-radius: 16px;
        background: linear-gradient(145deg,
            rgba(255, 255, 255, 0.55) 0%,
            var(--user-h-accent) 38%,
            rgba(255, 255, 255, 0.35) 62%,
            rgba(0, 85, 164, 0.4) 100%);
        box-shadow:
            0 0 0 1px rgba(255, 255, 255, 0.25) inset,
            0 6px 20px rgba(0, 25, 70, 0.45),
            0 0 24px var(--user-h-accent-glow);
        transition: transform 0.45s var(--user-h-ease-out), box-shadow 0.4s ease;
    }

    .user-logo:hover .user-logo-frame {
        transform: scale(1.04) rotate(-1deg);
        box-shadow:
            0 0 0 1px rgba(255, 255, 255, 0.35) inset,
            0 12px 36px rgba(0, 35, 90, 0.55),
            0 0 36px var(--user-h-accent-glow);
    }

    .user-logo-frame img {
        display: block;
        width: 48px;
        height: 48px;
        border-radius: 14px;
        object-fit: contain;
        padding: 7px;
        background: linear-gradient(155deg, #ffffff 0%, #e4ebf4 100%);
        box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8) inset;
    }

    .user-logo-text {
        display: flex;
        flex-direction: column;
        gap: 1px;
    }

    .user-logo-name {
        font-weight: 800;
        font-size: 1.05rem;
        line-height: 1.18;
        letter-spacing: -0.03em;
        text-shadow:
            0 1px 2px rgba(0, 0, 0, 0.25),
            0 0 24px rgba(255, 255, 255, 0.12);
    }

    .user-logo-subtitle {
        font-size: 0.65rem;
        font-weight: 700;
        letter-spacing: 0.14em;
        text-transform: uppercase;
        color: rgba(255, 255, 255, 0.65);
        text-shadow: 0 1px 1px rgba(0, 0, 0, 0.15);
    }

    .user-nav-menu {
        display: flex;
        align-items: center;
        gap: 4px;
        list-style: none;
        margin: 0 !important;
        padding: 0 !important;
        padding-left: 0 !important;
        flex: 1 1 auto;
        min-width: 0;
        justify-content: flex-end;
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
        box-sizing: border-box;
    }

    .user-nav-menu > li {
        list-style: none;
        flex-shrink: 0;
    }

    .user-nav-link {
        display: flex;
        align-items: center;
        gap: 7px;
        padding: 10px 14px;
        color: rgba(255, 255, 255, 0.88);
        text-decoration: none;
        font-weight: 500;
        font-size: 0.88rem;
        letter-spacing: 0.02em;
        border-radius: 999px;
        border: 1px solid transparent;
        transition:
            background 0.3s var(--user-h-ease),
            border-color 0.3s var(--user-h-ease),
            color 0.25s ease,
            box-shadow 0.3s var(--user-h-ease),
            transform 0.3s var(--user-h-ease);
        white-space: nowrap;
        position: relative;
        overflow: visible;
    }

    .user-nav-link::before {
        content: '';
        position: absolute;
        inset: 0;
        border-radius: inherit;
        background: radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.22), transparent 65%);
        opacity: 0;
        transition: opacity 0.3s var(--user-h-ease);
        pointer-events: none;
    }

    .user-nav-link:hover {
        background: rgba(255, 255, 255, 0.11);
        border-color: rgba(255, 255, 255, 0.2);
        color: #fff;
        transform: translateY(-2px);
        box-shadow:
            0 10px 28px rgba(0, 15, 50, 0.35),
            0 0 0 1px rgba(255, 255, 255, 0.06) inset;
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
    }

    .user-nav-link:hover::before {
        opacity: 1;
    }

    .user-nav-link:focus-visible {
        outline: 2px solid var(--user-h-accent);
        outline-offset: 2px;
    }

    .user-nav-link.active {
        background: linear-gradient(165deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0.05) 100%);
        border-color: rgba(255, 255, 255, 0.28);
        color: #fff;
        font-weight: 600;
        box-shadow:
            0 6px 24px rgba(0, 15, 45, 0.4),
            inset 0 1px 0 rgba(255, 255, 255, 0.22),
            0 0 20px rgba(201, 161, 59, 0.12);
    }

    .user-nav-link.active::after {
        content: '';
        position: absolute;
        bottom: 5px;
        left: 50%;
        transform: translateX(-50%);
        width: 22px;
        height: 2px;
        border-radius: 2px;
        background: linear-gradient(90deg, transparent, var(--user-h-accent), transparent);
        opacity: 0.95;
    }

    .user-nav-link svg {
        width: 18px;
        height: 18px;
        flex-shrink: 0;
        opacity: 0.92;
        filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.15));
        transition: transform 0.35s var(--user-h-ease-out), opacity 0.25s ease;
    }

    .user-nav-link:hover svg {
        transform: scale(1.08);
        opacity: 1;
    }

    .user-nav-link.active svg {
        opacity: 1;
        filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.35));
    }

    @media (min-width: 901px) {
        .user-nav-menu {
            gap: 3px;
        }
        .user-nav-link {
            padding: 7px 11px;
            font-size: 0.78rem;
            gap: 5px;
        }
        .user-nav-link svg {
            width: 15px;
            height: 15px;
        }
        .user-profile {
            padding: 7px 13px;
            gap: 9px;
        }
        .user-avatar {
            width: 30px;
            height: 30px;
            font-size: 0.76rem;
        }
        .user-info-name {
            font-size: 0.8rem;
        }
        .user-info-level {
            font-size: 0.64rem;
        }
        .user-logout {
            padding: 7px 12px;
            font-size: 0.78rem;
        }
        .user-logout svg {
            width: 14px;
            height: 14px;
        }

        .user-nav-right {
            margin-left: 12px;
            padding-left: 20px;
            border-left: 1px solid rgba(255, 255, 255, 0.13);
            box-shadow: -1px 0 0 rgba(0, 0, 0, 0.12);
        }
    }

    .user-nav-right {
        display: flex;
        align-items: center;
        gap: 12px;
    }

    .user-profile {
        position: relative;
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 8px 16px 8px 10px;
        border-radius: 999px;
        color: #fff;
        text-decoration: none;
        overflow: hidden;
        background: linear-gradient(145deg, rgba(20, 35, 60, 0.55) 0%, rgba(15, 23, 42, 0.38) 50%, rgba(12, 20, 38, 0.48) 100%);
        border: 1px solid rgba(255, 255, 255, 0.16);
        box-shadow:
            inset 0 1px 0 rgba(255, 255, 255, 0.12),
            inset 0 -1px 0 rgba(0, 0, 0, 0.12),
            0 4px 18px rgba(0, 0, 0, 0.22);
        backdrop-filter: blur(14px) saturate(1.2);
        -webkit-backdrop-filter: blur(14px) saturate(1.2);
        transition: transform 0.35s var(--user-h-ease-out), box-shadow 0.35s var(--user-h-ease-out), border-color 0.3s ease, background 0.3s ease;
    }

    .user-profile::after {
        content: '';
        position: absolute;
        top: 0;
        left: -40%;
        width: 60%;
        height: 100%;
        background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.09), transparent);
        transform: skewX(-18deg);
        opacity: 0;
        transition: opacity 0.4s ease, left 0.5s var(--user-h-ease-out);
        pointer-events: none;
    }

    .user-profile:hover {
        background: linear-gradient(145deg, rgba(28, 45, 72, 0.65) 0%, rgba(15, 23, 42, 0.52) 100%);
        border-color: rgba(255, 255, 255, 0.26);
        transform: translateY(-2px);
        box-shadow:
            inset 0 1px 0 rgba(255, 255, 255, 0.14),
            0 12px 32px rgba(0, 0, 0, 0.38);
    }

    .user-profile:hover::after {
        opacity: 1;
        left: 120%;
    }

    .user-profile .user-avatar,
    .user-profile .user-info {
        position: relative;
        z-index: 1;
    }

    .user-profile.active {
        border-color: var(--user-h-accent-soft);
        box-shadow:
            inset 0 1px 0 rgba(255, 255, 255, 0.1),
            0 0 0 1px var(--user-h-accent-soft);
    }

    .user-avatar {
        width: 34px;
        height: 34px;
        background: linear-gradient(145deg, #d4b05f 0%, #C9A13B 45%, #a67c2a 100%);
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-weight: 800;
        font-size: 0.84rem;
        color: #0f172a;
        box-shadow:
            0 0 0 2px rgba(255, 255, 255, 0.35),
            0 4px 12px rgba(0, 0, 0, 0.35);
    }

    .user-info {
        display: flex;
        flex-direction: column;
        line-height: 1.25;
    }

    .user-info-name {
        font-weight: 600;
        font-size: 0.9rem;
        letter-spacing: -0.01em;
    }

    .user-info-level {
        font-size: 0.69rem;
        font-weight: 500;
        color: rgba(226, 232, 240, 0.82);
        font-variant-numeric: tabular-nums;
    }

    .user-logout {
        position: relative;
        display: flex;
        align-items: center;
        gap: 7px;
        padding: 8px 16px;
        color: #fff;
        text-decoration: none;
        border-radius: 999px;
        font-size: 0.84rem;
        font-weight: 600;
        letter-spacing: 0.03em;
        overflow: hidden;
        background: linear-gradient(168deg, #ff5f54 0%, #EF4135 38%, #d32a1f 72%, #9a1f18 100%);
        border: 1px solid rgba(255, 255, 255, 0.28);
        box-shadow:
            inset 0 1px 0 rgba(255, 255, 255, 0.28),
            inset 0 -1px 0 rgba(0, 0, 0, 0.12),
            0 4px 18px rgba(180, 40, 30, 0.5);
        transition: transform 0.3s var(--user-h-ease-out), filter 0.25s ease, box-shadow 0.35s var(--user-h-ease-out);
    }

    .user-logout::before {
        content: '';
        position: absolute;
        top: 0;
        left: -50%;
        width: 45%;
        height: 100%;
        background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.22), transparent);
        transform: skewX(-16deg);
        opacity: 0;
        transition: opacity 0.35s ease, left 0.55s var(--user-h-ease-out);
        pointer-events: none;
    }

    .user-logout:hover {
        filter: brightness(1.06);
        transform: translateY(-2px);
        box-shadow:
            inset 0 1px 0 rgba(255, 255, 255, 0.32),
            0 10px 28px rgba(200, 50, 40, 0.55);
    }

    .user-logout:hover::before {
        opacity: 1;
        left: 130%;
    }

    .user-logout svg {
        position: relative;
        z-index: 1;
        width: 16px;
        height: 16px;
        flex-shrink: 0;
    }

    .user-logout:focus-visible {
        outline: 2px solid #fff;
        outline-offset: 2px;
    }

    .user-mobile-toggle {
        display: none;
        flex-shrink: 0;
        flex-direction: column;
        justify-content: center;
        gap: 6px;
        width: 46px;
        height: 46px;
        background: linear-gradient(165deg, rgba(255, 255, 255, 0.14) 0%, rgba(255, 255, 255, 0.05) 100%);
        border: 1px solid rgba(255, 255, 255, 0.2);
        border-radius: 14px;
        cursor: pointer;
        padding: 0;
        box-shadow:
            inset 0 1px 0 rgba(255, 255, 255, 0.15),
            0 4px 14px rgba(0, 20, 55, 0.35);
        transition: background 0.3s var(--user-h-ease-out), border-color 0.3s ease, transform 0.25s ease, box-shadow 0.3s ease;
    }

    .user-mobile-toggle:hover {
        background: linear-gradient(165deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0.08) 100%);
        border-color: rgba(255, 255, 255, 0.3);
        box-shadow:
            inset 0 1px 0 rgba(255, 255, 255, 0.2),
            0 6px 20px rgba(0, 25, 60, 0.45);
    }

    .user-mobile-toggle:active {
        transform: scale(0.97);
    }

    .user-mobile-toggle span {
        display: block;
        width: 20px;
        height: 2px;
        margin: 0 auto;
        background: #fff;
        border-radius: 2px;
        transition: transform 0.35s var(--user-h-ease), opacity 0.25s ease;
    }

    .user-mobile-toggle.is-open span:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }

    .user-mobile-toggle.is-open span:nth-child(2) {
        opacity: 0;
        transform: scaleX(0);
    }

    .user-mobile-toggle.is-open span:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    @keyframes userNavReveal {
        from {
            opacity: 0;
            transform: translateX(16px);
        }
        to {
            opacity: 1;
            transform: translateX(0);
        }
    }

    @media (prefers-reduced-motion: reduce) {
        .user-header-bg::before,
        .user-header-bg::after {
            animation: none !important;
            opacity: 0.4;
        }

        .user-header::before {
            animation: none !important;
            background: linear-gradient(90deg,
                transparent 0%,
                rgba(201, 161, 59, 0.25) 15%,
                var(--user-h-accent) 50%,
                rgba(201, 161, 59, 0.25) 85%,
                transparent 100%);
            background-size: 100% 100%;
        }

        .user-logo:hover .user-logo-frame {
            transform: none;
        }

        .user-nav-link:hover svg {
            transform: none;
        }

        .user-profile::after,
        .user-logout::before {
            display: none !important;
        }
    }
    
    @media (max-width: 1100px) {
        .user-nav-link.active::after {
            display: none;
        }

        .user-nav-link span {
            display: none;
        }

        .user-nav-link {
            padding: 10px 12px;
        }
    }

    @media (max-width: 900px) {
        .user-mobile-toggle {
            display: flex;
        }

        .user-nav-menu {
            display: none;
            position: absolute;
            top: var(--user-header-height);
            left: 0;
            right: 0;
            flex: none;
            flex-direction: column;
            align-items: stretch;
            justify-content: flex-start;
            min-width: 0;
            overflow-x: hidden;
            overflow-y: visible;
            padding: 18px 18px 22px;
            gap: 6px;
            background:
                linear-gradient(180deg, rgba(255, 255, 255, 0.06) 0%, transparent 30%),
                linear-gradient(165deg, #024080 0%, #0055A4 45%, #063a66 100%);
            border-bottom: 1px solid rgba(255, 255, 255, 0.1);
            box-shadow:
                0 16px 40px rgba(0, 25, 60, 0.45),
                inset 0 1px 0 rgba(255, 255, 255, 0.06);
            backdrop-filter: blur(20px);
            -webkit-backdrop-filter: blur(20px);
        }

        .user-nav-menu.active {
            display: flex;
        }

        .user-nav-menu.active > li {
            animation: userNavReveal 0.48s var(--user-h-ease-out) backwards;
        }

        .user-nav-menu.active > li:nth-child(1) { animation-delay: 0.04s; }
        .user-nav-menu.active > li:nth-child(2) { animation-delay: 0.07s; }
        .user-nav-menu.active > li:nth-child(3) { animation-delay: 0.1s; }
        .user-nav-menu.active > li:nth-child(4) { animation-delay: 0.13s; }
        .user-nav-menu.active > li:nth-child(5) { animation-delay: 0.16s; }
        .user-nav-menu.active > li:nth-child(6) { animation-delay: 0.19s; }
        .user-nav-menu.active > li:nth-child(7) { animation-delay: 0.22s; }
        .user-nav-menu.active > li:nth-child(8) { animation-delay: 0.25s; }
        .user-nav-menu.active > li:nth-child(9) { animation-delay: 0.28s; }
        .user-nav-menu.active > li:nth-child(10) { animation-delay: 0.31s; }

        .user-nav-menu.active > li.user-nav-right {
            animation: userNavReveal 0.48s var(--user-h-ease-out) 0.34s backwards;
        }

        .user-nav-link {
            width: 100%;
            justify-content: flex-start;
            padding: 13px 16px;
            border-radius: 12px;
        }

        .user-nav-link.active::after {
            display: none;
        }

        .user-nav-link span {
            display: inline;
        }

        .user-nav-right {
            flex-direction: column;
            width: 100%;
            gap: 12px;
            margin-top: 8px;
            margin-left: 0;
            padding-left: 0;
            padding-top: 18px;
            border-left: none;
            box-shadow: none;
            border-top: 1px solid rgba(255, 255, 255, 0.14);
        }

        .user-profile,
        .user-logout {
            width: 100%;
            justify-content: center;
        }
    }

    @media (max-width: 900px) and (prefers-reduced-motion: reduce) {
        .user-nav-menu.active > li,
        .user-nav-menu.active > li.user-nav-right {
            animation: none !important;
        }
    }
    
    @media (max-width: 480px) {
        .user-navbar {
            position: relative;
            justify-content: space-between;
        }
        
        .user-logo {
            flex: 0 0 auto;
        }
        
        .user-logo-frame img {
            width: 40px;
            height: 40px;
        }

        .user-logo-frame {
            padding: 2px;
        }
        
        .user-logo-text {
            display: flex !important;
            position: absolute;
            left: 50%;
            transform: translateX(-50%);
            flex-direction: column;
            align-items: center;
            gap: 2px;
        }
        
        .user-logo-name {
            font-size: 0.95rem;
            white-space: nowrap;
        }
        
        .user-logo-subtitle {
            font-size: 0.7rem;
            white-space: nowrap;
        }
        
        .user-mobile-toggle {
            flex: 0 0 auto;
            order: 3;
        }
        
        .user-info-name {
            max-width: 100px;
            overflow: hidden;
            text-overflow: ellipsis;
        }
    }
    
    @media (max-width: 900px) and (min-width: 481px) {
        .user-logo-text {
            display: flex !important;
            position: absolute;
            left: 50%;
            transform: translateX(-50%);
            flex-direction: column;
            align-items: center;
            gap: 2px;
        }
        
        .user-logo-name {
            font-size: 1rem;
            white-space: nowrap;
        }
        
        .user-logo-subtitle {
            font-size: 0.7rem;
            white-space: nowrap;
        }
        
        .user-navbar {
            position: relative;
        }
        
        .user-logo {
            flex: 0 0 auto;
        }
        
        .user-mobile-toggle {
            flex: 0 0 auto;
            order: 3;
        }
    }
    
    /* Footer : même style que la page login */
    .user-footer-login-style {
        background: transparent;
        padding: 2rem 1rem 1.5rem;
        text-align: center;
        margin-top: auto;
    }
    .user-footer-copyright {
        margin: 0;
        color: #5a6c7d;
        font-size: 0.75rem;
        max-width: 100%;
        padding: 0 0.5rem;
        word-wrap: break-word;
    }
    .user-footer-links {
        margin-top: 0.25rem;
        font-size: 0.78rem;
    }
    .user-footer-links a {
        color: #0055A4;
        font-weight: 600;
        text-decoration: none;
    }
    .user-footer-links a:hover {
        color: #EF4135;
        text-decoration: underline;
    }
