/* --- STABLE SIDEBAR & HEADER COLLAPSE SYSTEM --- */
#main-wrapper {
    display: flex;
    flex-direction: column;
}

/* TOPBAR STYLING */
.topbar {
    background: linear-gradient(135deg, #2b5876 0%, #4e4376 100%) !important;
    position: fixed !important;
    top: 0;
    width: 100%;
    height: 70px;
    z-index: 1200 !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2) !important;
}

.navbar-header {
    background: #0f172a !important;
    width: 260px;
    height: 70px;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1210 !important;
    transition: all 0.3s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
}

/* LOGO Area adjustments on Collapse */
.mini-sidebar .navbar-header {
    width: 70px !important;
    padding: 0 !important;
    justify-content: center;
}

.mini-sidebar .navbar-header .logo-text,
.mini-sidebar .navbar-header .navbar-brand a:first-child {
    display: none !important;
}

/* SIDEBAR STYLING */
.left-sidebar {
    background: linear-gradient(180deg, #1a1c23 0%, #111217 100%) !important;
    position: fixed !important;
    height: calc(100vh - 70px) !important;
    width: 260px !important;
    top: 70px !important;
    left: 0;
    z-index: 1100 !important;
    transition: all 0.3s ease-in-out !important;
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.4) !important;
    border-right: 1px solid rgba(255, 255, 255, 0.05) !important;
}

#main-wrapper.mini-sidebar .left-sidebar {
    width: 70px !important;
}

/* MAIN CONTENT ADJUSTMENT */
#main-wrapper .page-wrapper {
    margin-left: 260px !important;
    margin-top: 70px !important;
    transition: all 0.3s ease-in-out !important;
    min-height: 100vh;
}

#main-wrapper.mini-sidebar .page-wrapper {
    margin-left: 70px !important;
}

/* SIDEBAR INTERNAL ELEMENTS */
.scroll-sidebar {
    height: 100% !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    overscroll-behavior: contain !important;
}

.sidebar-nav ul .sidebar-item .sidebar-link {
    color: #a0aec0 !important;
    padding: 12px 20px !important;
    margin: 4px 15px !important;
    border-radius: 12px !important;
    transition: 0.3s !important;
    display: flex;
    align-items: center;
}

.sidebar-nav ul .sidebar-item .sidebar-link i {
    font-size: 1.1rem;
    width: 30px;
}

/* Collapse behavior for menu items */
.mini-sidebar .sidebar-nav .sidebar-item .sidebar-link {
    justify-content: center !important;
    padding: 15px 0 !important;
    margin: 4px 5px !important;
}

.mini-sidebar .sidebar-nav .sidebar-item .sidebar-link span,
.mini-sidebar .nav-small-cap,
.mini-sidebar .user-panel .info {
    display: none !important;
}

.mini-sidebar .sidebar-nav .sidebar-item .sidebar-link i {
    margin-right: 0 !important;
    font-size: 1.3rem !important;
}

.mini-sidebar .user-panel {
    padding: 15px 5px !important;
    text-align: center;
}

.mini-sidebar .user-panel .image img {
    width: 45px !important;
    height: 45px !important;
    margin: 0 auto !important;
}

/* User Panel Styling */
.user-panel {
    padding: 15px !important;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.user-panel .image img {
    width: 60px;
    height: 60px;
    border: 3px solid rgba(255, 255, 255, 0.1);
}

/* Scrollbar Style */
.scroll-sidebar::-webkit-scrollbar {
    width: 5px;
}

.scroll-sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}