/* =================================
   Header / Brand / Navigation
================================= */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--nav-bg);
    color: var(--nav-text);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    transform: translateY(0);
    transition:
        transform 0.28s ease,
        box-shadow 0.22s ease,
        background 0.22s ease;
    will-change: transform;
}

.site-header.hidden {
    transform: translateY(-100%);
}
.site-header.compact {
    box-shadow:
        0 24px 60px rgba(15, 23, 42, 0.12),
        0 8px 24px rgba(15, 23, 42, 0.08);
}

.site-header-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: nowrap;
}

.site-header-left {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
    flex: 0 1 auto;
}

.site-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    height: 72px;
    overflow: hidden;
    flex: 0 0 auto;
}

.brand-logo {
    height: 56px;
    width: auto;
    display: block;
    margin: 0;
}

.site-team-name {
    font-size: 14px;
    font-weight: 600;
    color: #d1d5db;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 220px;
}

.desktop-nav {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: nowrap;
    flex: 0 0 auto;
}

.desktop-nav .nav-group,
.desktop-nav .nav-link {
    flex: 0 0 auto;
}
.nav-group {
    position: relative;
}
.nav-group::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    height: 10px;
}

.nav-link,
.nav-group-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    color: #f3f4f6;
    background: transparent;
    border: 0;
    cursor: pointer;
    transition:
        background 0.18s ease,
        color 0.18s ease;
}

.nav-link:hover,
.nav-group-toggle:hover {
    background: var(--primary-dark);
    color: #ffffff;
}

.nav-link.active,
.nav-group.active-group > .nav-group-toggle {
    background: var(--primary);
    color: #ffffff;
}

.nav-caret {
    font-size: 12px;
    line-height: 1;
    transition: transform 0.18s ease;
}
.nav-group:hover .nav-caret,
.nav-group:focus-within .nav-caret {
    transform: rotate(180deg);
}

.nav-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    min-width: 220px;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.14);
    padding: 8px;
    display: block;
    opacity: 0;
    visibility: hidden;
    transform: translateY(6px);
    pointer-events: none;
    transition:
        opacity 0.18s ease,
        transform 0.18s ease,
        visibility 0.18s ease;
    z-index: 1100;
}

.nav-dropdown .nav-link {
    display: flex;
    width: 100%;
    border-radius: 8px;
    padding: 10px 12px;
    background: transparent;
    color: var(--text);
}

.nav-dropdown .nav-link:hover {
    background: #f9fafb;
    color: var(--text);
}
.nav-dropdown .nav-link.active {
    background: #fff1f1;
    color: var(--primary-dark);
}

.nav-group:hover .nav-dropdown,
.nav-group:focus-within .nav-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.nav-toggle {
    display: none;
    width: 44px;
    height: 44px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.08);
    cursor: pointer;
    padding: 0;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
    flex-shrink: 0;
}

.nav-toggle:hover {
    background: rgba(255, 255, 255, 0.14);
}
.nav-toggle span {
    display: block;
    width: 18px;
    height: 2px;
    background: #fff;
    border-radius: 999px;
}

.mobile-nav-drawer {
    display: none;
    width: 100%;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: var(--nav-bg);
}

.mobile-nav-drawer.show {
    display: block;
}

.mobile-nav-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 12px 16px 16px;
    display: grid;
    gap: 8px;
}

.mobile-nav-user {
    font-size: 14px;
    font-weight: 700;
    color: #d1d5db;
    padding: 4px 2px 10px;
}

.mobile-nav-link,
.mobile-nav-group-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 12px 14px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    color: #f3f4f6;
    background: transparent;
    border: 0;
    cursor: pointer;
}

.mobile-nav-link:hover,
.mobile-nav-group-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}
.mobile-nav-link.active {
    background: var(--primary);
    color: #fff;
}
.mobile-nav-submenu {
    display: none;
    padding-left: 10px;
    margin-top: 4px;
}
.mobile-nav-group.open .mobile-nav-submenu {
    display: grid;
    gap: 6px;
}
.mobile-nav-group.open .mobile-nav-group-toggle {
    background: rgba(255, 255, 255, 0.1);
}

.benchboss-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
}

.benchboss-nav-link,
.benchboss-nav-trigger {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border: 0;
    background: transparent;
    color: var(--nav-text);
    text-decoration: none;
    font-size: 14px;
    font-weight: 850;
    padding: 12px 14px;
    border-radius: 10px;
    cursor: pointer;
    transition:
        background 0.18s ease,
        color 0.18s ease,
        transform 0.18s ease;
}

.benchboss-nav-link:hover,
.benchboss-nav-trigger:hover,
.benchboss-nav-item.is-open .benchboss-nav-trigger,
.benchboss-nav-link.active {
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    transform: translateY(-1px);
}

.benchboss-nav-arrow {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    stroke-width: 2.2;
    fill: none;
    opacity: 0.72;
    margin-top: 1px;
    transform-origin: center;
    transition:
        transform 0.18s ease,
        opacity 0.18s ease;
}

.benchboss-nav-item.is-open .benchboss-nav-arrow {
    transform: rotate(180deg);
    opacity: 1;
}

.benchboss-nav-item {
    position: static;
}

.benchboss-full-menu {
    position: fixed;
    top: 92px;
    left: 0;
    right: 0;
    width: 100%;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(10px);
    z-index: 999;
    transition:
        opacity 0.22s ease,
        transform 0.22s ease,
        visibility 0.22s ease;
    will-change: opacity, transform;
    height: auto;
    min-height: unset;
}

.benchboss-nav-item.is-open .benchboss-full-menu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}

.benchboss-menu-grid {
    max-width: 1180px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 280px repeat(3, minmax(0, 1fr));
    gap: 28px;
    padding: 34px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 0 0 28px 28px;
    box-shadow:
        0 24px 60px rgba(15, 23, 42, 0.12),
        0 8px 24px rgba(15, 23, 42, 0.08);
}

.benchboss-menu-feature {
    padding: 24px;
    border-radius: 24px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
}

.benchboss-menu-feature h3 {
    margin: 0 0 12px;
    font-size: 28px;
    font-weight: 950;
    letter-spacing: -0.04em;
}

.benchboss-menu-feature p {
    margin: 0;
    color: rgba(255, 255, 255, 0.86);
    line-height: 1.55;
}

.benchboss-feature-link {
    display: inline-block;
    margin-top: 20px;
    color: #fff;
    text-decoration: none;
    font-weight: 900;
}

.benchboss-menu-heading {
    margin: 0 0 12px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #64748b;
    font-weight: 900;
}

.benchboss-menu-column a {
    display: block;
    padding: 16px;
    border-radius: 18px;
    text-decoration: none;
    color: #0f172a;
    transition:
        background 0.18s ease,
        transform 0.18s ease,
        box-shadow 0.18s ease;
}

.benchboss-menu-column a::before {
    content: "";
    display: block;
    width: 36px;
    height: 3px;
    border-radius: 999px;
    background: var(--primary);
    margin-bottom: 12px;
    opacity: 0;
    transition: opacity 0.18s ease;
}

.benchboss-menu-column a:hover {
    background: #f8fafc;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}
.benchboss-menu-column a.active-subnav {
    background: #f8fafc;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

.benchboss-menu-column a.active-subnav::before {
    opacity: 1;
}

.benchboss-menu-column a.active-subnav strong {
    color: var(--primary);
}
.benchboss-menu-column a:hover::before {
    opacity: 1;
}

.benchboss-menu-column strong {
    display: block;
    margin-bottom: 4px;
    font-size: 15px;
    font-weight: 900;
}

.benchboss-menu-column span {
    display: block;
    font-size: 13px;
    line-height: 1.45;
    color: #64748b;
}

.benchboss-mobile-toggle {
    display: none;
}

.benchboss-mobile-backdrop,
.benchboss-mobile-nav {
    display: none;
}

@media (max-width: 960px) {
    .benchboss-nav {
        display: none;
    }

    .benchboss-mobile-toggle {
        display: flex;
        flex-direction: column;
        gap: 5px;
        margin-left: auto;
        border: 0;
        background: transparent;
        cursor: pointer;
    }

    .benchboss-mobile-toggle span {
        width: 26px;
        height: 2px;
        background: var(--nav-text);
    }

    .benchboss-mobile-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, 0.65);
        opacity: 0;
        visibility: hidden;
        transition: 0.2s ease;
        z-index: 999;
        width: 100vw;
        height: 100vh;
    }

    .benchboss-mobile-nav {
        display: block;
        position: fixed;
        top: 0;
        right: -100%;
        width: min(430px, 100%);
        height: 100vh;
        background: var(--bg);
        z-index: 1000;
        transition: right 0.24s ease;
        overflow-y: auto;
        color: var(--text);
    }

    .benchboss-mobile-nav {
        height: 100dvh;
        max-height: 100dvh;
        overflow: hidden;
    }

    .benchboss-mobile-sections {
        height: calc(100dvh - 140px);
        overflow-y: auto;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 120px;
    }
    body.benchboss-mobile-open {
        overflow: hidden;
    }

    body.benchboss-mobile-open .benchboss-mobile-nav {
        right: 0;
    }

    body.benchboss-mobile-open .benchboss-mobile-backdrop {
        opacity: 1;
        visibility: visible;
    }

    .benchboss-mobile-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0px 24px;
        border-bottom: 1px solid #e5e7eb;
    }

    .benchboss-mobile-user {
        margin-top: 4px;
        font-size: 13px;
        color: #64748b;
    }

    .benchboss-mobile-close {
        border: 0;
        background: transparent;
        font-size: 34px;
        cursor: pointer;
        color: var(--primary);
    }
    .benchboss-mobile-close:hover {
        color: #fff;
        background: var(--primary);
    }
    .benchboss-mobile-sections {
        padding: 20px;
    }

    .benchboss-mobile-sections a.dashboard_link {
        cursor: pointer;
        font-weight: 900;
        list-style: none;
        font-size: 18px;
        color: var(--primary);
        padding: 15px 0;
        display: block;
        text-decoration: none;
    }
    .benchboss-mobile-link,
    .benchboss-mobile-sections details a {
        display: block;
        padding: 8px 23px;
        text-decoration: none;
        color: #0f172a;
    }

    .benchboss-mobile-sections details a.active-subnav {
        color: var(--primary);
    }
    .benchboss-mobile-sections details {
        border-top: 1px solid #e5e7eb;
        padding: 14px 0;
    }

    .benchboss-mobile-sections summary {
        cursor: pointer;
        font-weight: 900;
        list-style: none;
        font-size: 18px;
        color: var(--text);
    }

    .benchboss-mobile-sections summary::-webkit-details-marker {
        display: none;
    }
}

.benchboss-public-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0 18px;
    border-radius: 8px;
    background: #ffffff;
    color: var(--primary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 900;
    white-space: nowrap;
}

.benchboss-public-cta:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.12);
}
.mega-nav-link-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mega-nav-link-title svg {
    width: 18px;
    height: 18px;
    stroke-width: 1.75;
    flex-shrink: 0;
    color: var(--primary);
    margin: 0px 10px 0px 0px;
}

.benchboss-menu-column a.active-subnav svg {
    color: var(--nav-bg);
}

.benchboss-mobile-sections a,
.benchboss-mobile-sections summary {
    display: flex;
    align-items: center;
    gap: 10px;
}

.benchboss-mobile-sections svg {
    width: 18px;
    height: 18px;
    stroke-width: 1.75;
    flex-shrink: 0;
    margin: 0px 10px -2px 0px;
    color: var(--primary);
}

.benchboss-mobile-sections a.active-subnav svg {
    color: var(--nav-bg);
    font-weight: 800;
}
.benchboss-mobile-sections a.active-subnav:before {
    content: "";
    display: block;
}

/* =========================================================
   Mobile Nav / Mega Menu Scroll Fix
========================================================= */

@media (max-width: 900px) {
    body.mobile-menu-open,
    body.nav-open,
    body.menu-open {
        overflow: hidden;
    }

    .mobile-menu,
    .mobile-nav,
    .site-mobile-nav,
    .mega-menu,
    .nav-mega,
    .nav-drawer {
        max-height: calc(100dvh - 72px);
        overflow-y: auto;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
        padding-bottom: calc(32px + env(safe-area-inset-bottom));
    }

    .mobile-menu.is-open,
    .mobile-nav.is-open,
    .site-mobile-nav.is-open,
    .mega-menu.is-open,
    .nav-mega.is-open,
    .nav-drawer.is-open {
        display: block;
    }
}

@media (max-width: 900px) {
    details[open] .mega-menu,
    details[open] .nav-mega,
    details[open] .mobile-menu-panel {
        max-height: calc(100dvh - 96px);

        overflow-y: auto;

        -webkit-overflow-scrolling: touch;

        padding-bottom: calc(48px + env(safe-area-inset-bottom));
    }
}
@media (max-width: 900px) {
    .nav-menu details[open] {
        max-height: calc(100dvh - 80px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: calc(48px + env(safe-area-inset-bottom));
    }

    .nav-menu details[open] > div,
    .nav-menu details[open] .mega-menu {
        max-height: none;
    }
}
