/* ========== Sidebar Main Styles ========== */
.sidebar {
    transition: all 0.3s ease;
    border-right: 1px solid #e9e9ef;
    background-color: #fbfaff;
    z-index: 1001;
    top: 97px;
    height: calc(100vh - 97px);
    position: fixed;
    width: 250px;
    display: flex;
    flex-direction: column;
}

.sidebar-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.sidebar-menu {
    flex-grow: 1;
    overflow-y: auto;
    padding: 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(81, 86, 190, 0.2) transparent;
}

/* ========== Menu Items ========== */
#side-menu {
    padding-left: 0;
    margin-bottom: 0;
    list-style: none;
}

.nav-item {
    position: relative;
    margin: 2px 0;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: #545a6d;
    font-weight: 500;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
    text-decoration: none;
}

.nav-link:hover {
    color: #5156be;
    background-color: rgba(81, 86, 190, 0.05);
}

/* ========== Active States ========== */
.nav-link.active {
    color: #5156be;
    background-color: rgba(81, 86, 190, 0.1);
    border-left-color: #5156be;
    font-weight: 600;
}

.nav-link.active .menu-icon {
    color: inherit;
    stroke-width: 2;
}

.nav-link.menu-toggle.active {
    color: #5156be;
    background-color: rgba(81, 86, 190, 0.1);
}

.submenu .nav-link.active {
    color: #5156be;
    background-color: rgba(81, 86, 190, 0.1);
    font-weight: 500;
}

/* ========== Submenu Styles ========== */
.collapse {
    background-color: rgba(81, 86, 190, 0.03);
    transition: height 0.2s ease;
}

.submenu {
    padding-left: 0;
    list-style: none;
}

.submenu .nav-link {
    padding: 10px 20px 10px 56px;
    font-size: 0.9rem;
    color: #74788d;
}

.submenu .nav-link:hover {
    color: #5156be;
    background-color: rgba(81, 86, 190, 0.05);
}

/* ========== Icons & Arrows ========== */
.menu-icon {
    width: 18px;
    height: 18px;
    margin-right: 12px;
    color: #74788d;
    stroke-width: 1.5;
}

.submenu-icon {
    width: 15px;
    height: 15px;
    margin-right: 10px;
}

.menu-arrow {
    margin-left: auto;
    transition: transform 0.3s ease;
    color: #74788d;
    font-size: 14px;
}

.menu-toggle[aria-expanded="true"] .menu-arrow {
    transform: rotate(180deg);
}

/* ========== Scrollbar ========== */
.sidebar-menu::-webkit-scrollbar {
    width: 6px;
}

.sidebar-menu::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-menu::-webkit-scrollbar-thumb {
    background-color: rgba(81, 86, 190, 0.2);
    border-radius: 3px;
}

.sidebar-menu::-webkit-scrollbar-thumb:hover {
    background-color: rgba(81, 86, 190, 0.3);
}

/* Firefox scrollbar */
.sidebar-menu {
    scrollbar-width: thin;
    scrollbar-color: rgba(81, 86, 190, 0.2) transparent;
}

/* ========== Responsive ========== */
@media (max-width: 991.98px) {
    .sidebar {
        left: -280px;
        top: 70px;
        height: calc(100vh - 70px);
    }
    
    .sidebar.show {
        left: 0;
    }
}