/*
|--------------------------------------------------------------------------
| Admin Header — Public Theme
|--------------------------------------------------------------------------
| Header clair inspiré de la navigation publique :
| ivoire, vert profond, accents or et dropdowns lumineux.
*/

:root {
    --admin-header-height: 68px;
    --admin-header-bg: rgba(255, 253, 247, .96);
    --admin-header-surface: #fffdf8;
    --admin-header-surface-soft: #f9f3e8;
    --admin-header-green: #173f36;
    --admin-header-green-2: #245a4d;
    --admin-header-gold: #b9852f;
    --admin-header-gold-dark: #8f651f;
    --admin-header-text: #344640;
    --admin-header-muted: #7b817d;
    --admin-header-border: rgba(23, 63, 54, .13);
    --admin-header-shadow: 0 10px 30px rgba(58, 67, 58, .09);
    --admin-header-radius: 12px;
}

/* =========================================================================
   Layout
   ========================================================================= */

html,
body {
    margin: 0 !important;
}

body {
    padding-top: var(--admin-header-height) !important;
}

#header.admin-header,
.app-header.admin-header {
    position: fixed !important;
    inset: 0 0 auto 0;
    z-index: 5000;

    display: flex;
    align-items: center;

    width: 100%;
    min-height: var(--admin-header-height);
    padding: .45rem .75rem !important;

    color: var(--admin-header-text);
    background:
        radial-gradient(circle at 10% 0, rgba(196, 154, 74, .09), transparent 20rem),
        var(--admin-header-bg) !important;

    border-bottom: 1px solid var(--admin-header-border);
    box-shadow: var(--admin-header-shadow);

    backdrop-filter: blur(18px) saturate(135%);
    -webkit-backdrop-filter: blur(18px) saturate(135%);

    overflow: visible !important;
}

#header.admin-header::after {
    content: "";
    position: absolute;
    right: 4%;
    bottom: -1px;
    left: 4%;

    height: 1px;

    background: linear-gradient(
        90deg,
        transparent,
        rgba(185, 133, 47, .2),
        rgba(185, 133, 47, .58),
        rgba(185, 133, 47, .2),
        transparent
    );
}

#header,
#header .menu,
#header .menu-item,
#header .dropdown,
#header .hud-dropdown-wrap,
.app-header,
.app-header .menu {
    overflow: visible !important;
}

/* =========================================================================
   Sidebar togglers
   ========================================================================= */

#header .desktop-toggler,
#header .mobile-toggler {
    flex: 0 0 auto;
}

#header .menu-toggler {
    display: grid;
    place-content: center;
    gap: 4px;

    width: 40px;
    height: 40px;
    padding: 0;

    background: #fffaf2;
    border: 1px solid var(--admin-header-border);
    border-radius: 10px;
}

#header .menu-toggler .bar {
    display: block;
    width: 19px;
    height: 2px;

    background: var(--admin-header-green);
    border-radius: 999px;
}

#header .menu-toggler:hover {
    background: #f5ede0;
    border-color: rgba(185, 133, 47, .28);
}

/* =========================================================================
   Brand
   ========================================================================= */

#header .admin-header-brand,
#header .brand {
    flex: 0 1 auto;
    min-width: 0;
}

#header .brand-logo {
    display: inline-flex;
    align-items: center;
    gap: .65rem;

    min-width: 0;

    color: var(--admin-header-green) !important;
    text-decoration: none;
}

.move-image {
        position: relative;
        animation: slide 3s infinite alternate ease-in-out;
    }
    @keyframes slide {
        from {
            left: 0px;
        }
        to {
            left: 200px;
        }
    }

     /* Respecte "prefers-reduced-motion" */
    @media (prefers-reduced-motion: reduce) {
        .move-image { animation: none !important; left: 0 !important; }
    }

#header .brand-img {
    display: grid;
    place-items: center;

    width: 42px;
    height: 42px;

    background: rgba(185, 133, 47, .10);
    border: 1px solid rgba(185, 133, 47, .20);
    border-radius: 12px;
}

#header .brand-img img,
#header .brand-img .move-image {
    position: static !important;
    width: 28px !important;
    height: 28px !important;
    margin: 0 !important;
    padding: 0 !important;

    object-fit: contain;

    animation: none !important;
}

#header .brand-text {
    display: inline-block !important;

    color: var(--admin-header-green) !important;

    font-size: .9rem;
    font-weight: 850;
    letter-spacing: .035em;

    opacity: 1 !important;
    visibility: visible !important;
}

/* =========================================================================
   Right actions
   ========================================================================= */

#header .admin-header-actions,
#header .header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: .4rem;

    min-width: 0;
    margin-left: auto;
}

#header .menu-item {
    margin: 0 !important;
}

#header .menu-link,
#header .hud-dropdown-toggle,
#header .dropdown-toggle {
    position: relative;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-width: 40px;
    min-height: 40px;
    padding: .3rem .5rem !important;

    color: var(--admin-header-green) !important;
    background: rgba(255,255,255,.72);
    border: 1px solid var(--admin-header-border);
    border-radius: 11px;

    text-decoration: none;

    transition:
        color .18s ease,
        background-color .18s ease,
        border-color .18s ease,
        box-shadow .18s ease,
        transform .18s ease;
}

#header .menu-link:hover,
#header .menu-link:focus,
#header .hud-dropdown-toggle:hover,
#header .hud-dropdown-toggle:focus,
#header .show > .hud-dropdown-toggle {
    color: var(--admin-header-gold-dark) !important;
    background: #fff;
    border-color: rgba(185, 133, 47, .32);
    box-shadow: 0 7px 18px rgba(58, 67, 58, .09);
    transform: translateY(-1px);
}

#header .menu-link *,
#header .hud-dropdown-toggle *,
#header .dropdown-toggle * {
    color: inherit !important;
}

#header .menu-icon {
    display: grid;
    place-items: center;

    width: 30px;
    height: 30px;
}

#header .menu-icon i,
#header .nav-icon,
#header .bi,
#header .fas {
    color: var(--admin-header-green) !important;
    font-size: 1rem;
}

#header .menu-link:hover i,
#header .hud-dropdown-toggle:hover i {
    color: var(--admin-header-gold-dark) !important;
}

/* Notification badge */
#header .menu-badge {
    display: grid !important;
    place-items: center !important;

    min-width: 18px;
    height: 18px;
    padding: 0 4px;

    color: #fff !important;
    background: #ad625a !important;
    border: 2px solid var(--admin-header-surface);
    border-radius: 999px !important;

    font-size: .6rem !important;
    font-weight: 800;
}

/* =========================================================================
   Language
   ========================================================================= */

#header #langDropdown {
    padding: .25rem !important;
}

#header #langDropdown img,
#header .img-thumbnail {
    width: 30px !important;
    height: 22px !important;
    padding: 0 !important;

    object-fit: cover;

    background: #fff;
    border: 1px solid #dfd3bf;
    border-radius: 5px;
}

/* =========================================================================
   Auth user
   ========================================================================= */

#header .menu-link:has(.img-thumbnail.online) {
    min-width: auto;
    gap: .45rem;
    padding: .2rem .55rem .2rem .25rem !important;
    border-radius: 999px;
}

#header .img-thumbnail.online {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 38px !important;
    height: 38px !important;
    min-width: 38px;

    padding: 2px !important;

    background: #fff;
    border: 2px solid rgba(185, 133, 47, .30);
    border-radius: 50% !important;
    overflow: hidden;
}

#header .img-thumbnail.online img {
    width: 100% !important;
    height: 100% !important;

    object-fit: cover;

    border-radius: 50%;
}

#header .fw-bold.text-light {
    color: var(--admin-header-green) !important;
    font-size: .78rem;
}

#header .menu-link .badge {
    padding: .25rem .45rem;

    border-radius: 999px;

    font-size: .57rem;
    font-weight: 750;
}

/* =========================================================================
   Dropdown menus
   ========================================================================= */

#header .hud-dropdown-wrap {
    position: relative;
}

#header .hud-corner {
    display: none !important;
}

#header .dropdown-menu.hud-dropdown-menu,
#header .admin-header-dropdown {
    position: absolute;

    min-width: 235px;
    margin-top: .55rem !important;
    padding: .55rem;

    color: var(--admin-header-text) !important;

    background:
        linear-gradient(145deg, rgba(255,255,255,.99), rgba(249,245,232,.99)) !important;

    border: 1px solid var(--admin-header-border) !important;
    border-radius: 14px !important;

    box-shadow: 0 22px 52px rgba(39, 55, 43, .16) !important;

    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);

    overflow: hidden;
    z-index: 1085 !important;
}

#header .dropdown-menu.hud-dropdown-menu::before,
#header .dropdown-menu.hud-dropdown-menu::after {
    display: none !important;
}

#header .dropdown-menu.hud-dropdown-menu *,
#header .admin-header-dropdown * {
    color: inherit;
}

#header .dropdown-menu.hud-dropdown-menu .dropdown-header,
#header .admin-header-dropdown .dropdown-header,
#header .dropdown-menu.hud-dropdown-menu h6 {
    padding: .45rem .72rem;

    color: var(--admin-header-gold-dark) !important;

    font-size: .7rem;
    font-weight: 850;
    letter-spacing: .08em;
    text-transform: uppercase;
}

#header .dropdown-menu.hud-dropdown-menu .dropdown-item,
#header .admin-header-dropdown .dropdown-item {
    display: flex;
    align-items: center;
    gap: .55rem;

    min-height: 40px;
    padding: .58rem .7rem;

    color: var(--admin-header-text) !important;
    background: transparent;

    border: 0;
    border-radius: 9px;

    font-size: .8rem;
    font-weight: 650;
    white-space: normal;

    transition:
        color .18s ease,
        background-color .18s ease,
        transform .18s ease;
}

#header .dropdown-menu.hud-dropdown-menu .dropdown-item:hover,
#header .dropdown-menu.hud-dropdown-menu .dropdown-item:focus,
#header .admin-header-dropdown .dropdown-item:hover,
#header .admin-header-dropdown .dropdown-item:focus {
    color: var(--admin-header-green) !important;
    background: rgba(185, 133, 47, .10);
    box-shadow: none;
    transform: translateX(2px);
}

#header .dropdown-menu.hud-dropdown-menu .dropdown-item.active,
#header .dropdown-menu.hud-dropdown-menu .dropdown-item:active,
#header .admin-header-dropdown .dropdown-item.active {
    color: #25493f !important;
    background: #e8f0ec !important;
    box-shadow: none;
}

#header .dropdown-menu.hud-dropdown-menu .dropdown-divider,
#header .admin-header-dropdown .dropdown-divider,
#header .dropdown-menu.hud-dropdown-menu hr {
    margin: .45rem 0;

    border-top-color: var(--admin-header-border);
    opacity: 1;
}

#header .dropdown-menu.hud-dropdown-menu .small,
#header .dropdown-menu.hud-dropdown-menu .fw-semibold,
#header .dropdown-menu.hud-dropdown-menu .fw-bold,
#header .dropdown-menu.hud-dropdown-menu .text-reset,
#header .dropdown-menu.hud-dropdown-menu .text-inverse {
    color: var(--admin-header-text) !important;
}

#header .dropdown-menu.hud-dropdown-menu .text-white-50,
#header .dropdown-menu.hud-dropdown-menu .text-inverse.text-opacity-50,
#header .dropdown-menu.hud-dropdown-menu .small.text-inverse.text-opacity-50 {
    color: var(--admin-header-muted) !important;
}

#header .dropdown-menu.hud-dropdown-menu .text-neon {
    color: var(--admin-header-gold-dark) !important;
}

/* Form fields in login dropdown */
#header .login-dropdown-menu {
    width: 300px !important;
    min-width: 300px !important;
}

#header .login-dropdown-menu .form-control {
    min-height: 44px;

    color: var(--admin-header-text) !important;
    background: #fffdf8 !important;

    border: 1px solid #ddd2bf !important;
    border-radius: 10px;
}

#header .login-dropdown-menu .form-control::placeholder {
    color: #9c978f;
}

#header .login-dropdown-menu .form-control:focus {
    border-color: var(--admin-header-gold) !important;
    box-shadow: 0 0 0 .2rem rgba(185, 133, 47, .12) !important;
}

#header .login-dropdown-menu h6 {
    color: var(--admin-header-green) !important;
}

/* =========================================================================
   Clock
   ========================================================================= */

#horloge {
    flex: 0 0 auto;

    width: auto !important;
    min-width: 130px;

    margin-left: .65rem;
    padding: 0 .5rem;

    color: var(--admin-header-muted) !important;

    font-size: .68rem !important;
    font-variant-numeric: tabular-nums;
    font-weight: 650 !important;
    white-space: nowrap;
}

/* =========================================================================
   RTL
   ========================================================================= */

html[dir="rtl"] #header .admin-header-actions {
    margin-right: auto;
    margin-left: 0;
}

html[dir="rtl"] #header .user-dropdown .dropdown-item {
    flex-direction: row-reverse;
    justify-content: flex-end;
    text-align: right;
}

html[dir="rtl"] #header .user-dropdown .dropdown-item .ms-auto {
    margin-right: auto !important;
    margin-left: 0 !important;
}

/* =========================================================================
   Responsive
   ========================================================================= */

@media (max-width: 991.98px) {
    #horloge {
        display: none !important;
    }

    #header .brand-text {
        font-size: .78rem;
    }
}

@media (max-width: 575.98px) {
    :root {
        --admin-header-height: 58px;
    }

    body {
        padding-top: var(--admin-header-height) !important;
    }

    #header.admin-header,
    .app-header.admin-header {
        min-height: var(--admin-header-height);
        padding: .35rem .5rem !important;
        gap: .25rem;
    }

    #header .desktop-toggler {
        display: none !important;
    }

    #header .mobile-toggler {
        flex: 0 0 38px;
    }

    #header .brand {
        margin-right: auto;
    }

    #header .brand-img {
        width: 36px;
        height: 36px;
        border-radius: 10px;
    }

    #header .brand-img img,
    #header .brand-img .move-image {
        width: 24px !important;
        height: 24px !important;
    }

    #header .brand-text {
        display: none !important;
    }

    #header .admin-header-actions,
    #header .header-actions {
        flex: 0 0 auto;
        gap: .25rem;
    }

    #header .menu-link,
    #header .hud-dropdown-toggle,
    #header .dropdown-toggle {
        width: 36px !important;
        height: 36px !important;
        min-width: 36px !important;
        min-height: 36px !important;
        padding: .2rem !important;
        border-radius: 9px;
    }

    #header .menu-link:has(.img-thumbnail.online) {
        width: 38px !important;
        min-width: 38px !important;
        padding: 0 !important;
        border-radius: 50%;
    }

    #header .img-thumbnail.online {
        width: 36px !important;
        height: 36px !important;
        min-width: 36px !important;
    }

    #header .menu-link .d-flex.flex-column,
    #header .fw-bold.text-light,
    #header .menu-link .badge {
        display: none !important;
    }

    #header #langDropdown img,
    #header .img-thumbnail {
        width: 27px !important;
        height: 20px !important;
    }

    #header .dropdown-menu.hud-dropdown-menu,
    #header .admin-header-dropdown,
    #header .dropdown-menu.w-300px {
        position: fixed !important;
        top: 58px !important;
        right: .5rem !important;
        left: .5rem !important;

        width: auto !important;
        max-width: none !important;
        max-height: calc(100vh - 72px);

        margin-top: .35rem !important;

        overflow-y: auto !important;
    }

    #header #langDropdown + .dropdown-menu {
        right: .5rem !important;
        left: auto !important;
        width: 190px !important;
        min-width: 190px !important;
    }

    #header .user-dropdown {
        right: .5rem !important;
        left: auto !important;
        width: 270px !important;
        min-width: 270px !important;
    }

    #header .login-dropdown-menu {
        right: .5rem !important;
        left: .5rem !important;
        width: auto !important;
        min-width: 0 !important;
    }

    .move-image { animation: none !important; left: 0 !important; }
}

@media (prefers-reduced-motion: reduce) {
    #header *,
    #header *::before,
    #header *::after {
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
    }
}

