.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 240px;
    height: 100vh;
    background: var(--sidebar);
    color: white;

    /* Smooth sidebar scrolling */
    overflow-y: auto;
    overflow-x: hidden;
    scroll-behavior: smooth;

    transition: width 0.3s ease, transform 0.3s ease;
    z-index: 1000;

    /* Better scrollbar behavior */
    scrollbar-width: thin;
}

/* =========================
   SIDEBAR HEADER
   ========================= */

.sidebar-header {
    padding: 18px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-logo {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: white;
    padding: 4px;
    flex-shrink: 0;
}

.sidebar-header h5 {
    margin: 0;
    font-weight: 700;
}

.sidebar-header small {
    color: #ddd;
}

/* =========================
   SIDEBAR USER
   ========================= */

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 10px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    flex-shrink: 0;
}

.sidebar-user small {
    color: #cfcfcf;
}

/* =========================
   MAIN MENU
   ========================= */

.sidebar-menu {
    padding: 6px 10px;
    margin: 0;
}

.sidebar-menu li {
    list-style: none;
    margin-bottom: 1px;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
    padding: 6px 12px;
    border-radius: 8px;

    text-decoration: none;

    transition:
        background 0.25s ease,
        color 0.25s ease,
        transform 0.2s ease;

    font-size: 14px;
}

/* Hover */

.sidebar-menu a:hover {
    background: var(--hover);
    color: white;
}

/* Active normal menu item */

.sidebar-menu a.active {
    background: var(--primary);
    color: white;
    font-weight: 600;
}

/* Small movement on hover */

.sidebar-menu > li > a:hover {
    transform: translateX(2px);
}

/* Icons */

.sidebar-menu i {
    width: 20px;
    min-width: 20px;
    text-align: center;
    font-size: 16px;
}

/* =========================
   DROPDOWN
   ========================= */

.sidebar-dropdown > a {
    cursor: pointer;
}

/*
   IMPORTANT:
   Dropdowns are CLOSED by default.
*/

.sidebar-dropdown .submenu {
    list-style: none;

    margin: 0;
    padding: 0 0 0 28px;

    display: none;

    overflow: hidden;
}

/*
   Only dropdown with .open is displayed.
*/

.sidebar-dropdown.open > .submenu {
    display: block;
}

/* Dropdown submenu items */

.sidebar-dropdown .submenu li {
    margin: 1px 0;
}

/* Submenu links */

.sidebar-dropdown .submenu a {
    font-size: 14px;
    color: inherit;
    text-decoration: none;
    padding: 5px 10px;
}

/* Submenu hover */

.sidebar-dropdown .submenu a:hover {
    background: var(--hover);
}

/* Active submenu */

.sidebar-dropdown .submenu a.active {
    background: var(--primary);
    color: white;
    font-weight: 600;
}

/* =========================
   DROPDOWN ARROW
   ========================= */

.sidebar-dropdown > a .fa-chevron-down {
    margin-left: auto;

    transition: transform 0.25s ease;
}

/*
   Rotate arrow when dropdown is open.
*/

.sidebar-dropdown.open > a .fa-chevron-down {
    transform: rotate(180deg);
}

/* =========================
   ACTIVE DROPDOWN PARENT
   =========================
   
   Parent remains highlighted when
   one of its submenu pages is active.
*/

.sidebar-dropdown.open > a {
    background: rgba(255, 255, 255, 0.08);
}
.sidebar-dropdown > a.active-parent {
    background: var(--primary);
    color: white;
    font-weight: 600;
}
/* =========================
   SIDEBAR SCROLLBAR
   ========================= */

.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.25);
    border-radius: 10px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.4);
}

/* =========================
   MOBILE SIDEBAR
   ========================= */

@media (max-width: 991px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.active {
        transform: translateX(0);
    }
}