﻿.wrapper {
    display: flex;
}

.main {
    min-height: 100vh;
    width: 100%;
    overflow: hidden;
    transition: all 0.35s ease-in-out;
    background-color: #fafbfe;
}

#sidebar {
    width: 80px;
    min-width: 80px;
    z-index: 1000;
    transition: all .25s ease-in-out;
    background-color: #0B5ACF;
    display: flex;
    flex-direction: column;
}

#sidebar.expand {
    width: 260px;
    min-width: 260px;
}

/* header */
#header {
    display: flex;
    align-items: center;
}

.mobile-btn-logo {
    display: flex;
    align-items: center;
    background-color: #0D6DFB;
    width: 100%;
}

.toggle-btn {
    background-color: transparent;
    cursor: pointer;
    border-left: 4px solid;
    border-color: transparent;
    padding: .75rem 1.5rem;
}

.toggle-btn i {
    font-size: 1.5rem;
    color: #FFF;
}

.sidebar-logo {
    margin: auto 0;
    width: 100%;
    background-color: transparent;
}

.sidebar-logo a {
    color: #FFF;
    text-decoration: none;
    font-size: 1.15rem;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
}
.bussiness-unitUnder {
    align-items: baseline;
    padding: .25rem 1rem;
    background-color: #0C63E4;
    width: 100%;
    white-space: nowrap;
}

/* Business unit */
.bussiness-unit {
    display: flex;
    align-items: baseline;
    padding: .25rem 1rem;
    background-color: #0C63E4;
    width: 100%;
    white-space: nowrap;
}

.bussiness-unit .icon {
    color: #B6D7FF;
    background-color: transparent;
    text-decoration: none;
    font-size: 1.25rem;
    font-weight: 600;
    margin-left: 0.75rem;
    margin-right: .65rem;
}

.bussiness-unit .dash {
    color: #B6D7FF;
    text-decoration: none;
    background-color: transparent;
    font-size: 1rem;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
    margin-right: 0.65rem;
}

.bussiness-unit .text {
    color: #B6D7FF;
    text-decoration: none;
    background-color: transparent;
    font-size: 1rem;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
}

.sidebar-nav {
    padding: 2rem 0;
    flex: 1 1 auto;
}

a.sidebar-link {
    padding: .625rem 1.625rem;
    color: #fff;
    text-decoration: none;
    display: flex;
    align-items: center;
    font-size: 0.9rem;
    white-space: nowrap;
    border-left: 4px solid transparent;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
}

.sidebar-link i {
    font-size: 1.2rem;
    margin-right: .75rem;
}

a.sidebar-link:hover {
    background-color: rgba(255, 255, 255, .075);
    border-left: 4px solid #4D86FF;
}

.sidebar-item {
    position: relative;
}

/* Footer */
.sidebar-footer {
    background-color: #0C63E4;
}

.footer-link {
    padding: .75rem .5rem;
    display: flex;
    margin-left: 0.75rem;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
}

.avatar {
    width: 2rem;
    height: 2rem;
    font-size: 1.2rem;
    background-color: #007bff;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.initials-avatar {
    color: #fff;
    font-size: 1rem;
}

.user-info {
    display: flex;
    justify-content: center;
    flex-direction: column;
    margin-left: 0.75rem;
}

.user-name {
    font-size: 0.75rem;
    font-weight: 500;
    color: #fff;
}

.user-role {
    font-size: 0.6rem;
    color: #B6D7FF;
}

.avatar-mobile {
    display: none;
}

/* Sidebar not expanded */
#sidebar:not(.expand) .sidebar-logo,
#sidebar:not(.expand) a.sidebar-link span,
#sidebar:not(.expand) .user-info,
#sidebar:not(.expand) .bussiness-unit .dash,
#sidebar:not(.expand) .bussiness-unit .text {
    display: none;
}

#sidebar:not(.expand) .sidebar-item .sidebar-dropdown {
    position: absolute;
    top: 0;
    left: 80px;
    background-color: #0B5ACF;
    padding: 0;
    min-width: 15rem;
    display: none;
}

#sidebar:not(.expand) .sidebar-item:hover .has-dropdown + .sidebar-dropdown {
    display: block;
    width: 100%;
    opacity: 1;
}

#sidebar.expand .sidebar-link[data-bs-toggle="collapse"]::after {
    border: solid;
    border-width: 0 .075rem .075rem 0;
    content: "";
    display: inline-block;
    padding: 2px;
    position: absolute;
    right: 1.5rem;
    top: 1.4rem;
    transform: rotate(-135deg);
    transition: all .2s ease-out;
}

#sidebar.expand .sidebar-link[data-bs-toggle="collapse"].collapsed::after {
    transform: rotate(45deg);
    transition: all .2s ease-out;
}

/* ---------- Mobile ---------- */
@media only screen and (max-width: 768px) {

    .wrapper {
        flex-direction: column;
    }

    #sidebar {
        position: fixed;
        overflow-y: hidden;
        overflow-x: hidden;
        width: 100%;
        min-width: 100%;
        height: 60px;
        z-index: 1000;
        transition: all .25s ease-in-out;
        background-color: #0B5ACF;
        display: flex;
        flex-direction: column;
    }

    #sidebar.expand {
        width: 100%;
        height: 100vh;
    }

    #header {
        justify-content: space-between;
        align-items: center;
        padding-right: 1.5rem;
        background-color: #0D6DFB;
    }

    .mobile-btn-logo {
        display: flex;
        align-items: center;
    }

    .toggle-btn {
        padding: .5rem 0.5rem .5rem 1.5rem;
    }

    .toggle-btn i {
        font-size: 1.5rem;
        color: #FFF;
    }

    .sidebar-logo a {
        color: #FFF;
        text-decoration: none;
        font-size: 1.15rem;
        font-weight: 600;
    }
    
    /* Avatar */
    .avatar {
        width: 2.1rem;
        height: 2.1rem;
        font-size: 1.2rem;
        background-color: #007bff;
        border-radius: 50%;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .avatar-mobile {
        display: block;
    }

    /* Footer */
    .sidebar-footer {
        display: none;
    }

    #sidebar:not(.expand) .sidebar-logo{
        display: block;
    }

    #sidebar:not(.expand) a.sidebar-link i,
    #sidebar:not(.expand) a.sidebar-link span,
    #sidebar:not(.expand) .user-info,
    #sidebar:not(.expand) .bussiness-unit .dash,
    #sidebar:not(.expand) .bussiness-unit .text {
        display: block;
    }
}
