/* ===============================
   SIDEBAR
================================= */

.sidebar {
    position: fixed;
    top: var(--header-height);
    left: 0;
    width: var(--sidebar-width);
    height: calc(100vh - var(--header-height));
    z-index: 2000;
    padding: 16px 14px;
    box-sizing: border-box;
    color: #edf4ff;
    background: linear-gradient(180deg, #17212b 0%, #111a23 100%);
    border-right: 1px solid rgba(255,255,255,0.06);
    box-shadow: 10px 0 28px rgba(10, 24, 48, 0.12);
    overflow-y: auto;
    transition: width 0.28s ease, transform 0.28s ease;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.18) transparent;
}

    .sidebar::-webkit-scrollbar {
        width: 8px;
    }

    .sidebar::-webkit-scrollbar-track {
        background: transparent;
    }

    .sidebar::-webkit-scrollbar-thumb {
        background: rgba(255,255,255,0.18);
        border-radius: 999px;
    }

        .sidebar::-webkit-scrollbar-thumb:hover {
            background: rgba(255,255,255,0.28);
        }

    /* collapsed */
    .sidebar.collapsed {
        width: var(--sidebar-collapsed-width);
    }

        .sidebar.collapsed .nav-item {
            display: block !important;
        }

        .sidebar.collapsed .nav-item-text {
            display: none !important;
        }

.sidebar-backdrop {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(8, 15, 28, 0.38);
    backdrop-filter: blur(2px);
    z-index: 3000;
}

/* nav structure */
.navmenu .nav {
    gap: 4px;
}

.navmenu .nav-item {
    margin: 0;
}

    .navmenu .nav-item.fw-bold,
    .navmenu .nav-item > .nav-item-text {
        margin-top: 14px;
        margin-bottom: 6px;
        padding: 0 10px;
        font-size: 0.72rem;
        font-weight: 800 !important;
        letter-spacing: 0.08em;
        text-transform: uppercase;
        color: rgba(237,244,255,0.46);
    }

.navmenu .nav-link {
    display: flex;
    align-items: center;
    min-height: 42px;
    padding: 10px 12px;
    border-radius: 12px;
    color: rgba(237,244,255,0.88);
    text-decoration: none;
    font-weight: 600;
    transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

    .navmenu .nav-link:hover {
        background: rgba(255,255,255,0.08);
        color: #ffffff;
        transform: translateX(2px);
    }

    .navmenu .nav-link.active {
        background: linear-gradient(180deg, rgba(22,119,255,0.92), rgba(16,104,216,0.92));
        color: #ffffff;
        box-shadow: inset 0 0 0 1px rgba(255,255,255,0.10), 0 10px 20px rgba(22,119,255,0.22);
    }

.navmenu .ms-3 {
    margin-left: 0 !important;
}

.navmenu .nav-item-text {
    display: inline !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ===============================
   TOGGLE BUTTON
================================= */

.header .toggle-btn {
    width: 48px;
    height: 48px;
    border: none;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    line-height: 1;
    color: #fff;
    cursor: pointer;
    background: rgba(255,255,255,0.12);
    box-shadow: 0 8px 18px rgba(0,0,0,0.18);
    backdrop-filter: blur(8px);
    transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}

    .header .toggle-btn:hover {
        background: rgba(255,255,255,0.20);
        transform: translateY(-1px);
        box-shadow: 0 10px 22px rgba(0,0,0,0.22);
    }

    .header .toggle-btn:active {
        transform: scale(0.95);
    }

/* ===============================
   MOBILE
================================= */

@media (max-width: 900px) {
    .sidebar {
        display: none !important;
    }

        .sidebar.mobile-open {
            display: block !important;
            width: min(86vw, 280px);
            height: calc(100vh - var(--header-height));
            top: var(--header-height);
            left: 0;
            z-index: 5000;
            padding: 14px;
        }
            .sidebar.mobile-open::after {
                content: "";
                display: block;
                height: 10vh;
            }

        .sidebar.collapsed {
            display: none !important;
            width: 0 !important;
        }

        .sidebar .nav-item-text {
            display: inline !important;
        }

    .navmenu .nav-link {
        min-height: 44px;
    }
}
