.navbar .dropdown-menu {
    margin-top: 0.5rem;
    box-shadow: var(--crypto-shadow-lg) !important;
    background: var(--crypto-bg-dropdown) !important;
    border: 1px solid var(--crypto-border-glass) !important;
    border-radius: var(--crypto-radius-md) !important;
    padding: 0.5rem !important;
}

.page-wrapper:not(.no-effect) {
    padding-top: 7rem;
}

.zf-main-header {
    height: auto;
    position: fixed;
    flex: none;
    top: 1rem;
    left: 50%;
    transform: translateX(-50%);
}

.zf-main-navbar.no-effect {
    background: transparent;
    box-shadow: none;
    border: 1px solid transparent;
}

.zf-main-navbar.no-effect>div {
    background: transparent;
    backdrop-filter: none;
    box-shadow: none;
}

.zf-main-navbar {
    backdrop-filter: none;
    background-color: rgba(12, 18, 42, 0.05);
    border-radius: 20px;
    width: 100%;
    opacity: 1;
    flex-flow: row;
    place-content: center space-between;
    align-items: center;
    padding-block: 2.5rem;
    display: flex;
    position: relative;
    overflow: visible;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: background-color 0.3s ease, box-shadow 0.3s ease, border 0.3s ease;
}

.zf-main-navbar>div {
    backdrop-filter: blur(5px)
        /*saturate(180%)*/
    ;
    /*background-color: rgba(255, 255, 255, 0.1);*/
    border-radius: 20px;
    box-shadow: rgba(0, 0, 0, 0.07) 0px 0.241451px 0.241451px -0.75px inset, rgba(0, 0, 0, 0.14) 0px 2px 2px -1.5px inset;
    opacity: 1;
    height: 100%;
    display: flex;
    gap: 0.75rem;
    width: 100%;
    position: absolute;
    padding-inline: 0.5rem;
    transition: background 0.3s ease, backdrop-filter 0.3s ease, box-shadow 0.3s ease;
}

/* Border */
/*.zf-main-navbar > div:after {*/
/*    --border-bottom-width: 1px;*/
/*    --border-left-width: 1px;*/
/*    --border-right-width: 1px;*/
/*    --border-top-width: 1px;*/
/*    --border-color: rgba(255, 255, 255, 0.33);*/
/*    --border-style: solid;*/

/*    content: "";*/
/*    border-width: var(--border-top-width, 0) var(--border-right-width, 0) var(--border-bottom-width, 0) var(--border-left-width, 0);*/
/*    border-color: var(--border-color);*/
/*    border-style: var(--border-style);*/
/*    box-sizing: border-box;*/
/*    border-radius: inherit;*/
/*    pointer-events: none;*/
/*    width: 100%;*/
/*    height: 100%;*/
/*    position: absolute;*/
/*    top: 0;*/
/*    left: 0;*/
/*}*/

.zf-subnav {
    max-width: 100%;
}

.zf-subnav>.list-group-item-action:not(.active):focus,
.zf-subnav>.list-group-item-action:not(.active):hover {
    background-color: var(--tblr-list-group-action-hover-bg);
    border-radius: 2rem;
}

.zf-subnav.list-group-transparent .list-group-item.active:hover {
    text-decoration: none;
}

.zf-subnav.list-group-transparent .list-group-item.active {
    background: rgb(35 46 62 / 27%);
    border-radius: 2rem;
}

/* Light theme: softer lavender active state instead of dark gray blotch */
[data-bs-theme="light"] .zf-subnav.list-group-transparent .list-group-item.active {
    background: rgba(120, 121, 246, 0.10);
    color: var(--crypto-accent-600);
}

/* Light theme — override hardcoded text-white on nav links */
[data-bs-theme="light"] .zf-main-navbar .nav-link.text-white {
    color: var(--crypto-text-primary) !important;
}

[data-bs-theme="light"] .zf-main-navbar .nav-link {
    color: var(--crypto-text-secondary) !important;
}

[data-bs-theme="light"] .zf-main-navbar .nav-link:hover {
    color: var(--crypto-text-primary) !important;
}

[data-bs-theme="light"] .zf-main-navbar .nav-item.active .nav-link,
[data-bs-theme="light"] .zf-main-navbar .nav-item.active .nav-link.text-white {
    color: var(--crypto-text-primary) !important;
}

/* Light theme — navbar appearance */
[data-bs-theme="light"] .zf-main-navbar {
    background-color: rgba(100, 100, 160, 0.04);
    border-color: rgba(100, 100, 160, 0.10);
}

[data-bs-theme="light"] .zf-main-navbar > div {
    /*box-shadow: rgba(100, 100, 160, 0.06) 0px 0.241451px 0.241451px -0.75px inset, rgba(100, 100, 160, 0.10) 0px 2px 2px -1.5px inset;*/
}

[data-bs-theme="light"] .zf-main-navbar:not(.no-effect) {
    border-color: rgba(100, 100, 160, 0.14);
}

[data-bs-theme="light"] .zf-main-navbar.no-effect {
    border-color: transparent;
    background-color: transparent;
}

/* Active navbar item - modern gradient underline */
.navbar-expand-md .nav-item.active:after {
    display: none;
}

.zf-main-navbar .navbar-nav .nav-item.active .nav-link {
    margin-inline-end: 0.25rem;
    position: relative;
}

/* Gradient underline for active non-dropdown nav items */
.zf-main-navbar .navbar-nav .nav-item.active:not(.dropdown) .nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg,
            rgba(120, 119, 246, 0.8) 0%,
            rgba(6, 182, 212, 0.8) 100%);
    border-radius: 2px;
    box-shadow: 0 0 8px rgba(120, 119, 246, 0.4);
}

/* =========================================
   MOBILE NAVIGATION
   ========================================= */

/* Mobile top bar adjustments */
@media (max-width: 767.98px) {
    .zf-main-navbar {
        padding-block: 0;
        border-radius: 14px;
    }

    .zf-main-navbar>div {
        padding-block: 0.625rem;
        padding-inline: 1rem;
    }
}

/* Offcanvas panel */
#mobile-nav {
    --bs-offcanvas-width: 85%;
    background: var(--crypto-bg-elevated);
    border-left: 1px solid var(--crypto-border-glass);
}

#mobile-nav .offcanvas-header {
    padding: 1rem 1.25rem;
}

/* Offcanvas header */
.mobile-nav-header {
    border-bottom: 1px solid var(--crypto-border-glass);
}

.mobile-nav-username {
    color: var(--crypto-text-primary);
}

.mobile-nav-handle {
    color: var(--crypto-text-muted);
}

/* Workspace dropdown button */
.mobile-nav-workspace-btn {
    background: var(--crypto-bg-hover);
    border: 1px solid var(--crypto-border-glass);
    color: var(--crypto-text-primary);
    padding: 0.5rem 0.75rem;
    border-radius: var(--crypto-radius-md, 0.5rem);
    font-size: 0.875rem;
}

.mobile-nav-workspace-btn:hover,
.mobile-nav-workspace-btn:focus {
    background: var(--crypto-bg-elevated-hover);
    color: var(--crypto-text-primary);
    border-color: var(--crypto-border-glass-strong);
}

.mobile-nav-workspace-btn .dropdown-toggle::after {
    margin-left: auto;
}

.mobile-nav-ws-label {
    font-size: 0.6rem;
    font-weight: 700;
    color: var(--crypto-text-muted);
    letter-spacing: 0.05em;
    line-height: 1;
    margin-bottom: 0.125rem;
}

/* Dividers */
.mobile-nav-divider {
    border-color: var(--crypto-border-glass);
}

/* Mobile nav links */
.mobile-nav-link {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.75rem 0.75rem;
    border-radius: var(--crypto-radius-md, 0.5rem);
    color: var(--crypto-text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background 0.15s ease, color 0.15s ease;
    position: relative;
}

.mobile-nav-link:hover {
    background: var(--crypto-bg-hover);
    color: var(--crypto-text-primary);
    text-decoration: none;
}

.mobile-nav-link.active {
    color: rgb(120, 119, 246);
    font-weight: 600;
}

/* Active state: gradient left-border indicator */
.mobile-nav-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.375rem;
    bottom: 0.375rem;
    width: 3px;
    background: linear-gradient(180deg,
            rgba(120, 119, 246, 0.8) 0%,
            rgba(6, 182, 212, 0.8) 100%);
    border-radius: 2px;
    box-shadow: 0 0 6px rgba(120, 119, 246, 0.3);
}

.mobile-nav-link .icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
}

/* Mobile nav group labels (Source, Evidence) */
.mobile-nav-group-label {
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--crypto-text-muted);
    padding: 0.75rem 0.75rem 0.25rem;
}

/* Desktop nav dropdown active item */
.navbar .dropdown-menu .dropdown-item.active {
    background: var(--crypto-bg-hover);
    color: var(--crypto-text-primary);
    font-weight: 600;
}

/* Desktop nav dropdown: underline on parent when child is active (uses ::before to avoid conflicting with Bootstrap's ::after chevron) */
.zf-main-navbar .navbar-nav .nav-item.dropdown.active > .nav-link {
    position: relative;
}

.zf-main-navbar .navbar-nav .nav-item.dropdown.active > .nav-link::before {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg,
            rgba(120, 119, 246, 0.8) 0%,
            rgba(6, 182, 212, 0.8) 100%);
    border-radius: 2px;
    box-shadow: 0 0 8px rgba(120, 119, 246, 0.4);
}

/* Force-hide offcanvas on desktop */
@media (min-width: 768px) {
    #mobile-nav {
        display: none !important;
    }
}

/* Dark theme: close button visibility */
/* [data-bs-theme="dark"] #mobile-nav .btn-close {
    filter: invert(1);
} */

/* =========================================
   SECTION SIDEBAR
   Sticky sidebar on desktop, fixed bottom
   bar on mobile. Used for in-page navigation.
   ========================================= */

.section-sidebar {
    position: sticky;
    top: 8rem;
    padding-right: var(--crypto-spacing-lg);
    max-height: calc(100vh - 9rem);
    overflow-y: auto;
}

.section-sidebar .list-group-transparent {
    margin-left: 0;
    margin-right: 0;
}

.section-sidebar .list-group-item {
    margin-block: 0.125rem;
}

/* ---- Section Sidebar: Mobile Bottom Bar ---- */
@media (max-width: 767.98px) {

    /* Fixed bottom navigation bar */
    .section-sidebar {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        top: auto;
        z-index: 1030;
        max-height: none;
        padding: 0.5rem 0.75rem;
        padding-bottom: calc(0.5rem + env(safe-area-inset-bottom));
        display: flex;
        align-items: center;
        gap: 0.25rem;
        overflow-x: auto;
        overflow-y: hidden;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }

    .section-sidebar::-webkit-scrollbar {
        display: none;
    }

    /* Dark theme bottom bar */
    [data-bs-theme="dark"] .section-sidebar {
        background: rgba(12, 11, 20, 0.85);
        backdrop-filter: blur(12px);
        border-top: 1px solid var(--crypto-accent-alpha-30, rgba(120, 121, 246, 0.3));
    }

    /* Light theme bottom bar */
    [data-bs-theme="light"] .section-sidebar {
        background: rgba(255, 255, 255, 0.9);
        backdrop-filter: blur(12px);
        border-top: 1px solid var(--crypto-accent-alpha-30, rgba(120, 121, 246, 0.3));
    }

    /* Hide section headers on mobile */
    .section-sidebar .subheader {
        display: none;
    }

    /* Flatten list-group wrappers so items flow horizontally */
    .section-sidebar .list-group-transparent {
        display: contents;
    }


    /* Compact icon+label pills */
    .section-sidebar .list-group-item {
        position: relative;
        flex: 0 0 auto;
        width: auto;
        flex-direction: column;
        gap: 0.125rem;
        padding: 0.375rem 0.625rem;
        font-size: var(--crypto-font-size-xs);
        white-space: nowrap;
        border-radius: var(--crypto-radius-sm) !important;
        text-align: center;
        min-width: 5rem;
    }

    .zf-subnav.list-group-transparent .list-group-item.active {
        font-weight: normal;
    }

    /* Icon above label */
    .section-sidebar .list-group-item i {
        margin-right: 0 !important;
        font-size: 1.125rem;
    }

    /* Notification-style badge pill */
    .section-sidebar .list-group-item .badge {
        position: absolute;
        top: 0;
        right: 0;
        transform: translate(25%, -25%);
        margin: 0;
        padding: 0.125rem 0.3rem;
        font-size: 0.5625rem;
        line-height: 1;
        min-width: 1rem;
        border-radius: 999px;
    }

    /* Prevent content/footer from hiding behind the bottom bar */
    .section-anchor:last-child,
    .section-sidebar+.footer,
    .page-body:has(.section-sidebar)~.footer {
        padding-bottom: 6rem;
    }
}

/* ── Settings Tabs ──────────────────────────────────────────── */
.settings-tabs {
    border-bottom: none;
    gap: 0.25rem;
    align-items: stretch;
}
.settings-tabs .nav-link {
    border: none;
    border-radius: var(--crypto-radius-sm, 8px);
    padding: 0.5rem 1rem;
    color: var(--tblr-secondary-color);
    font-weight: 500;
    font-size: 0.875rem;
    transition: background 0.15s ease, color 0.15s ease;
    height: 100%;
}
.settings-tabs .nav-link:hover,
.settings-tabs .nav-link:focus {
    background: rgba(128, 128, 128, 0.08);
    color: var(--tblr-body-color);
    border: none;
}
.settings-tabs .nav-link.active,
.settings-tabs .nav-link.active:hover {
    background: rgba(128, 128, 128, 0.15);
    color: var(--tblr-body-color);
    border: none;
}