.navbar.sticky-top {
    padding-top: calc(0.5rem + var(--safe-top)) !important;
    padding-bottom: 0.5rem;
}

.zd-navbar {
    background: var(--zd-navbar-bg, linear-gradient(135deg, #1e3a8a 0%, #1e40af 55%, #1d4ed8 100%)) !important;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
}

.zd-navbar .navbar-brand {
    font-weight: 700;
    font-size: 0.94rem;
    letter-spacing: 0.2px;
    display: flex;
    align-items: center;
    flex-shrink: 0;
    padding-right: 6px;
}

.zd-navbar .navbar-brand img {
    height: 26px !important;
}

.zd-navbar .nav-link {
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    padding: 5px 9px !important;
    border-radius: 8px;
    transition: background 0.15s, color 0.15s;
    color: rgba(255, 255, 255, 0.88) !important;
    white-space: nowrap;
}

.zd-navbar .nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff !important;
}

.zd-navbar .nav-link.active {
    background: rgba(255, 255, 255, 0.18) !important;
    color: #fff !important;
    font-weight: 600;
}

.zd-navbar .dropdown-toggle.active {
    background: rgba(255, 255, 255, 0.18) !important;
    color: #fff !important;
}

.zd-navbar .navbar-nav {
    align-items: center;
    flex-wrap: nowrap;
}

.zd-navbar .navbar-text {
    font-size: 0.76rem;
    opacity: 0.88;
    font-weight: 500;
    max-width: 170px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.zd-navbar .btn-outline-light {
    border-width: 1.5px;
    font-size: 0.78rem;
    padding: 3px 10px;
    min-height: 28px;
    border-radius: 8px;
    font-weight: 500;
    white-space: nowrap;
}

.zd-navbar .navbar-toggler {
    border-color: rgba(255, 255, 255, 0.25);
    padding: 4px 8px;
}

.zd-navbar .navbar-toggler:focus {
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.2);
}

.nav-refresh-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    border: 1.5px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    min-height: unset;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, transform 0.15s;
    flex-shrink: 0;
    margin-left: 6px;
}

.nav-refresh-btn:hover {
    background: rgba(255, 255, 255, 0.26);
    border-color: rgba(255, 255, 255, 0.5);
}

.nav-refresh-btn:active {
    transform: scale(0.9);
}

.nav-refresh-btn i {
    font-size: 0.95rem;
    line-height: 1;
    display: inline-block;
}

.nav-refresh-btn.spinning i {
    animation: navRefreshSpin 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes navRefreshSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.dropdown-item:focus,
.dropdown-item:focus-visible {
    background-color: transparent !important;
    color: #212529 !important;
}

.dropdown-item:hover {
    background-color: #f8f9fa !important;
    color: #212529 !important;
}

.dropdown-item.active {
    background-color: #e7f1ff !important;
    color: #0d6efd !important;
    font-weight: 600 !important;
}

.dropdown-item.active:hover {
    background-color: #d0e2ff !important;
    color: #0d6efd !important;
}

.dropdown-menu {
    border: none;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
    padding: 6px;
    margin-top: 6px;
}

.dropdown-menu .dropdown-item {
    border-radius: 8px;
    font-size: 0.9rem;
    padding: 8px 12px;
}

.captain-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: #fff;
    box-shadow: 0 -2px 12px rgba(15, 23, 42, 0.08);
    z-index: 1050;
    border-top: 1px solid #eef1f5;
    padding-bottom: var(--safe-bottom);
}

.is-captain .captain-bottom-nav {
    display: flex;
}

.bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px 0 8px;
    border: none;
    background: transparent;
    color: #94a3b8;
    font-size: 0.82rem;
    font-weight: 500;
    transition: color 0.2s;
    position: relative;
}

.bottom-nav-item i {
    font-size: 1.7rem;
    margin-bottom: 2px;
}

.bottom-nav-item.active {
    color: var(--skin-primary, #0d6efd);
    font-weight: 700;
}

.bottom-nav-item.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 28px;
    height: 3px;
    border-radius: 0 0 3px 3px;
    background: var(--skin-primary, #0d6efd);
}

.is-captain #mainContainer {
    padding-bottom: 70px;
}

.is-captain .navbar-toggler {
    display: none !important;
}

.is-captain .navbar-nav {
    display: none !important;
}

.is-captain #currentUser {
    display: inline;
}

.is-captain .captain-hide {
    display: none !important;
}

.toast-container {
    padding-bottom: calc(0.75rem + var(--safe-bottom)) !important;
}

.is-captain .toast-container {
    bottom: calc(80px + var(--safe-bottom)) !important;
}

@media (max-width: 991.98px) {
    .zd-navbar .container-fluid {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        justify-content: space-between;
    }
    .zd-navbar .navbar-brand {
        margin-right: auto;
        max-width: calc(100% - 200px);
        overflow: hidden;
    }
    .zd-navbar .navbar-brand span {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .zd-navbar .navbar-toggler {
        order: 4;
        margin-left: 8px;
    }
    .nav-refresh-btn {
        order: 3;
        width: 34px;
        height: 34px;
        margin-left: 0;
    }
    .nav-mobile-user {
        order: 2;
        margin-left: 6px;
        margin-right: 0;
    }
    .zd-navbar .navbar-collapse {
        order: 5;
        flex-basis: 100%;
        width: 100%;
        margin-top: 8px;
        background: linear-gradient(180deg, #1e3a8a 0%, #1e40af 100%);
        border-radius: 14px;
        padding: 6px;
        max-height: calc(100vh - 130px);
        overflow-y: auto;
        overscroll-behavior: contain;
        box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
    }
    .zd-navbar .navbar-collapse .navbar-nav {
        flex-wrap: wrap;
        align-items: stretch;
        width: 100%;
    }
    .zd-navbar .navbar-collapse .nav-item {
        width: 100%;
    }
    .zd-navbar .navbar-collapse .nav-link {
        color: rgba(255, 255, 255, 0.9) !important;
        padding: 8px 12px !important;
        font-size: 0.88rem;
        font-weight: 600;
        border-radius: 8px;
        margin: 1px 0;
        white-space: normal;
        display: flex;
        align-items: center;
        line-height: 1.3;
    }
    .zd-navbar .navbar-collapse .nav-link:hover {
        background: rgba(255, 255, 255, 0.12);
        color: #fff !important;
    }
    .zd-navbar .navbar-collapse .nav-link.active {
        background: rgba(255, 255, 255, 0.2) !important;
        color: #fff !important;
    }
    .zd-navbar .navbar-collapse .dropdown-toggle {
        justify-content: space-between;
    }
    .zd-navbar .navbar-collapse .dropdown-toggle.active {
        background: rgba(255, 255, 255, 0.2) !important;
        color: #fff !important;
    }
    .zd-navbar .navbar-collapse .dropdown-menu {
        background: rgba(0, 0, 0, 0.18);
        border: 1px solid rgba(255, 255, 255, 0.12);
        box-shadow: none;
        margin: 2px 0 4px;
        padding: 4px;
    }
    .zd-navbar .navbar-collapse .dropdown-menu .dropdown-item {
        font-size: 0.82rem;
        padding: 7px 12px;
        color: rgba(255, 255, 255, 0.88) !important;
        line-height: 1.3;
    }
    .zd-navbar .navbar-collapse .dropdown-menu .dropdown-item:hover {
        background: rgba(255, 255, 255, 0.12) !important;
        color: #fff !important;
    }
    .zd-navbar .navbar-collapse .dropdown-menu .dropdown-item.active {
        background: rgba(255, 255, 255, 0.2) !important;
        color: #fff !important;
    }
    .zd-navbar .navbar-collapse .navbar-text {
        color: rgba(255, 255, 255, 0.75) !important;
        padding: 8px 12px;
        max-width: 100%;
        display: block;
        margin: 4px 0 6px;
        font-size: 0.8rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.15);
        padding-bottom: 8px;
    }
    .zd-navbar .navbar-collapse .btn-outline-light {
        border-color: rgba(255, 255, 255, 0.5) !important;
        color: #fff !important;
        background: transparent !important;
        margin: 4px 0 2px;
        width: 100%;
        padding: 7px;
        min-height: 34px;
        font-size: 0.84rem;
        font-weight: 600;
        display: block;
    }
    .zd-navbar .navbar-collapse .btn-outline-light:hover {
        background: rgba(255, 255, 255, 0.15) !important;
        border-color: rgba(255, 255, 255, 0.8) !important;
        color: #fff !important;
    }

    .is-captain .navbar-collapse {
        display: flex !important;
        flex-basis: auto !important;
        width: auto !important;
        margin-top: 0 !important;
        margin-left: 6px !important;
        background: transparent !important;
        border-radius: 0 !important;
        padding: 0 !important;
        max-height: none !important;
        overflow: visible !important;
        box-shadow: none !important;
        order: 5 !important;
        align-items: center;
        justify-content: flex-end;
        flex-grow: 0 !important;
    }

    .is-captain .navbar-collapse .btn-outline-light {
        border-color: rgba(255, 255, 255, 0.5) !important;
        color: #fff !important;
        background: transparent !important;
        margin: 0 !important;
        width: auto !important;
        padding: 4px 14px;
        min-height: 32px;
        font-size: 0.82rem;
        font-weight: 600;
        display: inline-flex;
        align-items: center;
    }

    .is-captain .navbar-collapse .btn-outline-light:hover {
        background: rgba(255, 255, 255, 0.15) !important;
        border-color: rgba(255, 255, 255, 0.8) !important;
        color: #fff !important;
    }
}

@media (max-width: 576px) {
    .container {
        padding-left: 12px;
        padding-right: 12px;
    }
    .zd-navbar .navbar-brand {
        font-size: 0.95rem;
        max-width: calc(100% - 190px);
    }
    .zd-navbar .navbar-brand img {
        height: 26px !important;
    }
    .zd-navbar .navbar-text {
        font-size: 0.78rem;
    }
    .nav-refresh-btn {
        width: 32px;
        height: 32px;
    }
    .nav-refresh-btn i {
        font-size: 0.95rem;
    }
    .is-captain .toast-container {
        bottom: calc(78px + var(--safe-bottom)) !important;
    }
    .is-captain .navbar-collapse .btn-outline-light {
        padding: 3px 10px;
        min-height: 30px;
        font-size: 0.76rem;
    }
}