/* ==========================================================
   eBillSeva Business OS
   Application Sidebar
   ========================================================== */

.app-sidebar {
    position: fixed;

    top: 58px;
    left: 0;
    bottom: 0;

    z-index: 1040;

    display: flex;
    flex-direction: column;

    width: 230px;

    background: #ffffff;

    border-right: 1px solid #e8ecf1;

    overflow: hidden;

    transform: translateX(0);

    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease;
}


/* ==========================================================
   Sidebar Header
   ========================================================== */

.app-sidebar__header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    min-height: 58px;

    padding: 0 13px;

    border-bottom: 1px solid #edf0f3;
}

.app-sidebar__brand {
    display: flex;
    align-items: center;

    gap: 9px;

    min-width: 0;

    color: inherit;

    text-decoration: none;
}

.app-sidebar__brand:hover {
    color: inherit;
}

.app-sidebar__logo {
    width: 34px;
    height: 34px;

    flex: 0 0 34px;

    object-fit: contain;
}

.app-sidebar__brand-info {
    display: flex;
    flex-direction: column;

    min-width: 0;
}

.app-sidebar__brand-name {
    color: #172033;

    font-size: 0.9rem;
    font-weight: 700;

    line-height: 1.2;

    white-space: nowrap;
}

.app-sidebar__brand-subtitle {
    margin-top: 2px;

    color: #8992a0;

    font-size: 0.62rem;
    font-weight: 500;

    line-height: 1.2;

    white-space: nowrap;
}


/* ==========================================================
   Close
   ========================================================== */

.app-sidebar__close {
    display: none;

    align-items: center;
    justify-content: center;

    width: 34px;
    height: 34px;

    flex: 0 0 34px;

    padding: 0;

    border: 0;

    border-radius: 8px;

    background: transparent;

    color: #697386;

    cursor: pointer;
}

.app-sidebar__close:hover {
    background: #f3f5f7;

    color: #172033;
}

.app-sidebar__close:focus-visible {
    outline: 2px solid var(--bs-primary, #0d47a1);

    outline-offset: 2px;
}


/* ==========================================================
   Navigation
   ========================================================== */

.app-sidebar__nav {
    flex: 1;

    min-height: 0;

    padding: 14px 9px;

    overflow-x: hidden;
    overflow-y: auto;

    scrollbar-width: thin;
    scrollbar-color: #d8dde5 transparent;
}

.app-sidebar__nav::-webkit-scrollbar {
    width: 4px;
}

.app-sidebar__nav::-webkit-scrollbar-track {
    background: transparent;
}

.app-sidebar__nav::-webkit-scrollbar-thumb {
    background: #d8dde5;

    border-radius: 10px;
}


/* ==========================================================
   Section
   ========================================================== */

.app-sidebar__section {
    margin-bottom: 17px;
}

.app-sidebar__section:last-child {
    margin-bottom: 0;
}

.app-sidebar__section-title {
    display: block;

    padding: 0 8px;

    margin-bottom: 5px;

    color: #919aa8;

    font-size: 0.61rem;
    font-weight: 700;

    letter-spacing: 0.08em;

    line-height: 1.4;

    text-transform: uppercase;
}


/* ==========================================================
   Navigation Link
   ========================================================== */

.app-sidebar__link {
    position: relative;

    display: flex;
    align-items: center;

    gap: 10px;

    width: 100%;
    min-height: 38px;

    padding: 8px 9px;

    margin-bottom: 2px;

    border-radius: 8px;

    color: #526071;

    font-size: 0.77rem;
    font-weight: 500;

    text-decoration: none;

    transition:
        background-color 0.15s ease,
        color 0.15s ease;
}

.app-sidebar__link:hover {
    background: #f5f7f9;

    color: #172033;
}

.app-sidebar__link i {
    width: 19px;

    flex: 0 0 19px;

    color: #7d8999;

    font-size: 0.92rem;

    text-align: center;

    transition: color 0.15s ease;
}

.app-sidebar__link:hover i {
    color: var(--bs-primary, #0d47a1);
}


/* ==========================================================
   Active
   ========================================================== */

.app-sidebar__link.active {
    background: rgba(13, 71, 161, 0.09);

    color: var(--bs-primary, #0d47a1);

    font-weight: 600;
}

.app-sidebar__link.active i {
    color: var(--bs-primary, #0d47a1);
}

.app-sidebar__link.active::before {
    content: "";

    position: absolute;

    top: 50%;
    left: 0;

    width: 3px;
    height: 20px;

    border-radius: 0 4px 4px 0;

    background: var(--bs-primary, #0d47a1);

    transform: translateY(-50%);
}


/* ==========================================================
   Badge
   ========================================================== */

.app-sidebar__badge {
    display: inline-flex;

    align-items: center;
    justify-content: center;

    margin-left: auto;

    padding: 3px 6px;

    border-radius: 20px;

    background: #f1f3f5;

    color: #7a8494;

    font-size: 0.56rem;
    font-weight: 600;

    line-height: 1;

    white-space: nowrap;
}


/* ==========================================================
   Footer Context
   ========================================================== */

.app-sidebar__footer {
    flex-shrink: 0;

    padding: 9px;

    border-top: 1px solid #edf0f3;

    background: #ffffff;
}

.app-sidebar__business {
    display: flex;
    align-items: center;

    gap: 9px;

    min-width: 0;

    padding: 8px;

    border-radius: 9px;

    background: #f7f8fa;
}

.app-sidebar__business-icon {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 32px;
    height: 32px;

    flex: 0 0 32px;

    border-radius: 7px;

    background: rgba(13, 71, 161, 0.08);

    color: var(--bs-primary, #0d47a1);

    font-size: 0.8rem;
}

.app-sidebar__business-info {
    display: flex;
    flex-direction: column;

    min-width: 0;
}

.app-sidebar__business-info span {
    overflow: hidden;

    color: #273142;

    font-size: 0.7rem;
    font-weight: 600;

    line-height: 1.25;

    text-overflow: ellipsis;

    white-space: nowrap;
}

.app-sidebar__business-info small {
    margin-top: 2px;

    overflow: hidden;

    color: #8992a0;

    font-size: 0.6rem;

    line-height: 1.2;

    text-overflow: ellipsis;

    white-space: nowrap;
}


/* ==========================================================
   Mobile Overlay
   ========================================================== */

.app-sidebar-overlay {
    position: fixed;

    top: 58px;
    right: 0;
    bottom: 0;
    left: 0;

    z-index: 1030;

    background: rgba(15, 23, 42, 0.38);

    opacity: 0;

    visibility: hidden;

    pointer-events: none;

    transition:
        opacity 0.2s ease,
        visibility 0.2s ease;
}


/* ==========================================================
   App Body
   ========================================================== */

.app-body {
    display: flex;

    flex: 1;

    min-width: 0;
    min-height: 0;

    padding-top: 58px;
}

.app-body .main-content {
    min-width: 0;

    flex: 1;

    margin-left: 230px;
}


/* ==========================================================
   Mobile
   ========================================================== */

@media (max-width: 991.98px) {

    .app-sidebar {
        top: 58px;
        bottom: 0;

        width: 280px;

        transform: translateX(-100%);

        box-shadow: none;
    }

    .app-sidebar.is-open {
        transform: translateX(0);

        box-shadow:
            18px 0 45px rgba(0, 0, 0, 0.10);
    }

    .app-sidebar__close {
        display: inline-flex;
    }

    .app-sidebar-overlay {
        opacity: 0;

        visibility: hidden;

        pointer-events: none;
    }

    body.app-sidebar-open .app-sidebar-overlay {
        opacity: 1;

        visibility: visible;

        pointer-events: auto;
    }

    body.app-sidebar-open {
        overflow: hidden;
    }

    .app-body {
        padding-top: 58px;
    }

    .app-body .main-content {
        margin-left: 0;
    }
}


/* ==========================================================
   Small Mobile
   ========================================================== */

@media (max-width: 575.98px) {

    .app-sidebar {
        width: min(88vw, 300px);
    }

    .app-sidebar__header {
        min-height: 56px;
    }

    .app-sidebar__nav {
        padding: 13px 8px;
    }

    .app-sidebar__footer {
        padding: 8px;
    }

    .app-sidebar-overlay {
        top: 56px;
    }

}