body {
    overflow-x: hidden;
}

.sidebar {
    position: relative;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    padding: 48px 0 0;
    box-shadow: inset -1px 0 0 rgba(0, 0, 0, .1);
    background-color: #1976D2;
    transition: all 0.3s ease;
    width: 250px;
    overflow-x: hidden;
}

.sidebar.collapsed {
    width: 60px;
}

.sidebar-sticky {
    position: relative;
    top: 0;
    height: calc(100vh - 48px);
    padding-top: .5rem;
    overflow-x: hidden;
    overflow-y: auto;
}

.sidebar .nav-link {
    font-weight: 500;
    color: rgba(255, 255, 255, 0.85);
    padding: 1rem;
    display: flex;
    align-items: center;
    transition: all 0.3s;
    white-space: nowrap;
    overflow: hidden;
}

.sidebar.collapsed .nav-link {
    padding: 1rem 0;
    justify-content: center;
}

.sidebar .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    text-decoration: none;
}

.sidebar .nav-link.active {
    background-color: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.sidebar .nav-link i {
    margin-right: 0.5rem;
    width: 20px;
    text-align: center;
    font-size: 1.1rem;
}

.sidebar .fas,
.sidebar .bi,
.sidebar .fas::before,
.sidebar .bi::before {
    color: white !important;
    opacity: 1 !important;
}

.sidebar.collapsed .nav-link i {
    margin-right: 0;
}

.sidebar.collapsed .nav-link span {
    display: none;
}

.sidebar-profile {
    padding: 1.5rem;
    text-align: center;
    color: #ffffff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 1rem;
    transition: all 0.3s;
}

.sidebar.collapsed .sidebar-profile {
    padding: 0.5rem;
}

.sidebar-profile img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin-bottom: 0.5rem;
    background-color: rgba(255, 255, 255, 0.1);
    padding: 0.5rem;
    transition: all 0.3s;
}

.sidebar.collapsed .sidebar-profile img {
    width: 40px;
    height: 40px;
}

.sidebar.collapsed .sidebar-profile h6,
.sidebar.collapsed .sidebar-profile small {
    display: none;
}

#sidebarToggle {
    position: absolute;
    left: 250px;
    top: 10px;
    z-index: 99;
    background-color: #1976D2;
    border: none;
    color: #ffffff;
    padding: 8px;
    border-radius: 0 4px 4px 0;
    transition: all 0.3s ease;
    cursor: pointer;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar.collapsed #sidebarToggle {
    left: 60px;
}

#sidebarToggle i {
    transition: transform 0.3s;
}

.sidebar.collapsed #sidebarToggle i {
    transform: rotate(180deg);
}

.main-content {
    margin-left: 250px;
    transition: all 0.3s;
    padding: 1rem;
    min-height: 100vh;
    background-color: #f8f9fa;
}

.sidebar.collapsed ~ .main-content {
    margin-left: 60px;
}

@media screen and (max-width: 768px) {
    .sidebar {
        margin-left: -250px;
    }

    .sidebar.collapsed {
        margin-left: -60px;
    }

    .sidebar.show {
        margin-left: 0;
    }

    .main-content {
        margin-left: 0;
    }

    #sidebarToggle {
        left: 0;
        border-radius: 0 4px 4px 0;
        z-index: 101;
    }

    .sidebar.show #sidebarToggle {
        left: 250px;
    }

    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 98;
    }

    .sidebar-overlay.show {
        display: block;
    }

    #sidebarToggle i {
        transform: rotate(180deg);
    }

    .sidebar.show + #sidebarToggle i {
        transform: rotate(0deg);
    }
}
