/* ==========================================================================
    Barre de navigation (extrait de admin.css)
    Palette branchée sur variables globales (privacy)
   ========================================================================== */

.topnav {
    background:
        linear-gradient(180deg, rgba(0, 0, 0, 0.02), transparent),
        var(--surface);
    padding: 0.25rem 0.75rem;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow:
        0 6px 16px -10px var(--shadow-color),
        0 1px 0 rgba(255, 255, 255, 0.04) inset;
    -webkit-backdrop-filter: saturate(150%) blur(6px);
    backdrop-filter: saturate(150%) blur(6px);
    border-bottom: 1px solid var(--border);
}

.topnav .nav-inner {
    display: flex;
    align-items: center;
    gap: 1rem;
    height: var(--nav-height);
}

.nav-brand {
    display: flex;
    align-items: center;
}

.nav-brand a {
    color: var(--accent);
    font-weight: 700;
    font-size: 1.1rem;
    text-decoration: none;
}

.brand-logo {
    height: 32px;
    width: auto;
    display: block;
    color: var(--surface);
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--fg);
}

.hamburger {
    width: 22px;
    height: 2px;
    background: var(--fg);
    display: block;
    position: relative;
}

.hamburger::before,
.hamburger::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--fg);
}

.hamburger::before {
    top: -6px;
}

.hamburger::after {
    bottom: -6px;
}

.nav-links > ul {
    list-style: none;
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.nav-links a {
    padding: 0.2rem 0.6rem 0.4rem 0.6rem;
    color: var(--fg);
    display: inline-block;
    margin: 0 5px;
    line-height: 1.6;
    text-decoration: none;
    border-radius: var(--radius);
}

.nav-links > ul > li > a:hover {
    background-color: var(--menu-bg-h);
    text-decoration: none;
}

.topnav button {
    color: var(--fg);
    background: transparent;
    border-radius: var(--radius);
}

.topnav button:hover {
    background-color: var(--menu-bg-h);
}

.nav-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-actions i {
    width: 20px;
    height: 20px;
    stroke: var(--fg);
}

.theme-toggle {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    color: var(--fg);
}

/* Dropdowns */
.dropdown {
    position: relative;
}

.dropbtn {
    background: transparent;
    border: none;
    color: var(--fg);
    cursor: pointer;
    padding: 0.5rem 0.6rem;
    border-radius: var(--radius);
}

.dropbtn:hover {
    background: var(--menu-bg-h);
}

.dropdown-menu {
    position: absolute;
    top: calc(var(--nav-height) - 10px);
    left: 0;
    min-width: 180px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: var(--shadow);
    display: none;
    flex-direction: column;
    padding: 0.4rem 0;
    z-index: 50;
}

.dropdown.open .dropdown-menu {
    display: flex;
    list-style: none;
}

.dropdown-menu a {
    padding: 0.5rem 0.5rem;
    color: var(--fg);
    text-decoration: none;
    border-radius: 6px;
}

.dropdown-menu a:hover {
    color: var(--accent);
    text-decoration: none;
}

.nav-links {
    width: 100%;
}

.space-between {
    flex: 1;
}

.mobile-tap-only { display: none; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
    .nav-toggle {
        display: block;
        width: auto !important;
        padding: 15px 7px;
        border-radius: 6px;
    }

    .mobile-tap-only { display: inline-flex; }

    .nav-links {
        display: none;
    }

    .nav-links.open {
        display: block;
        position: absolute;
        top: calc(var(--nav-height) + 12px);
        left: 8px;
        border: 1px solid var(--menu-bg-h);
        box-shadow: 0 6px 20px -10px rgba(0, 0, 0, 0.51), 1px 1px 0 rgba(255, 255, 255, 0.04) inset;
        -webkit-backdrop-filter: saturate(150%) blur(6px);
        backdrop-filter: saturate(150%) blur(6px);
        background: var(--surface);
        border-radius: 10px;
        overflow: hidden;
        width: calc(100% - 16px);
    }

    .nav-links a,
    .topnav button {
        display: flex;
        width: 100%;
        justify-content: space-between;
        margin: 0;
    }

    .topnav button.nav-toggle {
        margin-left: auto;
    }

    .nav-actions {
        margin-left: unset;
    }

    .nav-links > ul {
        flex-direction: column;
        gap: 0;
        padding: 0.6rem 0;
    }

    .nav-links > ul > li {
        width: 100%;
        text-align: center;
        padding: 0 10px;
    }

    .dropdown-menu {
        position: static;
        box-shadow: none;
        padding-left: 0.5rem;
        background: transparent;
        border: 0;
    }
}