html,
body {
    font-family: var(--ds-font-sans);
}

.nav-loading-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 0;
    height: 4px;
    background-color: var(--ds-color-accent);
    z-index: 2000;
    transition: width 0.3s ease, opacity 0.2s ease;
    opacity: 0;
}

.nav-loading-bar.active {
    opacity: 1;
}

.navbar.app-navbar {
    background-color: #131f33 !important;
    min-height: 64px;
    padding: 10px 0;
}

.navbar-brand {
    line-height: 1.1;
}

.navbar-brand-title {
    font-weight: 600;
    font-size: 1.05rem;
}

.navbar-brand-subtitle {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.72);
    margin-top: 2px;
}

.navbar .navbar-brand,
.navbar .nav-link {
    font-weight: 400;
}

.navbar .nav-link {
    color: rgba(255, 255, 255, 0.9);
    transition: color 0.2s ease, background-color 0.2s ease;
    min-height: 44px;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    border-radius: 10px;
    padding: 0.45rem 0.75rem;
}

.navbar .nav-link:hover,
.navbar .nav-link:focus {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.06);
}

.navbar .nav-link.active {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
    border-bottom: 2px solid var(--ds-color-accent);
}

.mobile-nav-link.active {
    color: #ffffff;
    background: rgba(181, 141, 74, 0.25);
    border-color: rgba(181, 141, 74, 0.5);
}

.navbar .nav-link:focus-visible,
.navbar .dropdown-item:focus-visible,
.mobile-nav-link:focus-visible,
.mobile-logout-btn:focus-visible,
.navbar-toggler:focus-visible {
    outline: 2px solid var(--ds-color-accent);
    outline-offset: 2px;
    box-shadow: none;
}

.navbar-toggler {
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 10px;
    padding: 0.5rem 0.65rem;
    min-width: 44px;
    min-height: 44px;
}

.navbar-toggler:focus {
    box-shadow: none;
}

.navbar-search-wrapper {
    flex: 1 1 auto;
    max-width: 520px;
    position: relative;
}

.navbar-search-wrapper .input-group {
    background: #fff;
    border-radius: 999px;
    overflow: hidden;
}

.navbar-search-wrapper .input-group-text,
.navbar-search-wrapper .form-control {
    border: none;
}

.navbar-search-wrapper .form-control {
    box-shadow: none !important;
    min-height: 42px;
}

.navbar-search-results {
    border-radius: 10px;
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.2);
    left: 0;
    max-height: 320px;
    overflow-y: auto;
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    z-index: 1200;
}

.navbar-search-results .list-group-item {
    padding: 0.75rem 0.875rem;
}

.navbar-search-results .search-item-type {
    color: #64748b;
    font-size: 0.75rem;
    text-transform: uppercase;
}

.navbar .dropdown-menu {
    display: none;
    background-color: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
    opacity: 1;
    visibility: visible;
    transform: none;
}

.navbar .dropdown-item {
    color: var(--ds-color-text);
    font-weight: 400;
    min-height: 44px;
    display: flex;
    align-items: center;
}

.navbar .dropdown-item:hover,
.navbar .dropdown-item:focus {
    background-color: var(--ds-color-surface-muted);
    color: var(--ds-color-text);
}

.navbar .dropdown-toggle::after {
    transform: none;
}

.navbar .dropdown-menu.show {
    display: block;
}

.offcanvas-mobile-nav {
    --bs-offcanvas-width: min(92vw, 380px);
    background: linear-gradient(180deg, #0f172a 0%, #111827 100%);
    color: #f8fafc;
    border-left: 1px solid rgba(148, 163, 184, 0.35);
    transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
}

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

.mobile-offcanvas-subtitle {
    color: rgba(241, 245, 249, 0.7);
    font-size: 0.85rem;
}

.mobile-search-block {
    background: rgba(255, 255, 255, 0.04);
}

.mobile-search-block .form-label {
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(241, 245, 249, 0.78);
}

.navbar-search-wrapper-mobile {
    max-width: 100%;
}

.navbar-search-wrapper-mobile .input-group {
    border-radius: 14px;
    box-shadow: 0 10px 24px rgba(2, 6, 23, 0.45);
}

.navbar-search-wrapper-mobile .form-control {
    min-height: 46px;
    font-size: 1rem;
}

.navbar-search-wrapper-mobile .navbar-search-results {
    top: calc(100% + 10px);
    max-height: 260px;
    border-radius: 12px;
    z-index: 1300;
}

.mobile-nav-sections {
    display: grid;
    gap: 1rem;
}

.mobile-nav-section-title {
    font-size: 0.76rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(203, 213, 225, 0.76);
    margin-bottom: 0.6rem;
    padding-inline: 0.2rem;
}

.mobile-nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    min-height: 48px;
    padding: 0.72rem 0.85rem;
    border-radius: 12px;
    text-decoration: none;
    color: rgba(248, 250, 252, 0.96);
    font-weight: 500;
    background: rgba(148, 163, 184, 0.08);
    border: 1px solid rgba(148, 163, 184, 0.14);
    transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.mobile-nav-link .bi {
    font-size: 1.05rem;
    color: rgba(248, 250, 252, 0.86);
}

.mobile-nav-link:hover,
.mobile-nav-link:focus {
    color: #ffffff;
    background: rgba(181, 141, 74, 0.25);
    border-color: rgba(181, 141, 74, 0.5);
    transform: translateY(-1px);
}

.mobile-nav-link:active {
    transform: translateY(0);
}

.mobile-nav-footer {
    background: rgba(2, 6, 23, 0.42);
}

.mobile-logout-btn {
    min-height: 48px;
    font-weight: 600;
}

@media (min-width: 992px) {
    .navbar .dropdown:hover > .dropdown-menu {
        display: block;
        margin-top: 0;
    }

    .navbar .dropdown-menu {
        margin-top: 0;
    }
}

@media (max-width: 991px) {
    .navbar.app-navbar {
        min-height: 58px;
        padding: 8px 0;
    }

    .navbar-search-wrapper {
        max-width: 100%;
        width: 100%;
    }
}
