/* ==========================================================
   eBillSeva Business OS
   Application Header
   ========================================================== */

.app-header {
    position: fixed;

    top: 0;
    left: 0;
    right: 0;

    z-index: 1050;

    height: 58px;

    background: #ffffff;

    border-bottom: 1px solid #e7ebf0;
}


.app-header__wrapper {
    display: flex;
    align-items: center;

    width: 100%;
    height: 58px;

    padding: 0 14px;
}


/* ==========================================================
   Brand
   ========================================================== */

.app-header__brand {
    display: flex;
    align-items: center;

    gap: 9px;

    width: 128px;
    min-width: 128px;

    color: #172033;

    text-decoration: none;
}

.app-header__brand:hover {
    color: #172033;
}

.app-header__logo {
    width: 100px;
    height: 100px;

    flex: 0 0 34px;

    object-fit: contain;
}

.app-header__brand-text {
    color: #172033;

    font-size: 0.96rem;
    font-weight: 700;

    letter-spacing: -0.01em;

    white-space: nowrap;
}


/* ==========================================================
   Context
   ========================================================== */

.app-header__context {
    display: flex;
    align-items: center;

    gap: 12px;

    min-width: 0;

    flex: 1;
}

.app-header__context-item {
    display: flex;
    align-items: center;

    gap: 7px;

    min-width: 0;
}

.app-header__context-label {
    color: #8992a0;

    font-size: 0.62rem;
    font-weight: 700;

    letter-spacing: 0.08em;

    text-transform: uppercase;

    white-space: nowrap;
}


/* ==========================================================
   Context Button
   ========================================================== */

.app-header__context-button {
    display: inline-flex;
    align-items: center;

    gap: 7px;

    width: 190px;
    max-width: 240px;

    height: 36px;

    padding: 0 10px;

    border: 1px solid #dce2e8;
    border-radius: 8px;

    background: #ffffff;

    color: #273142;

    font-size: 0.77rem;
    font-weight: 500;

    box-shadow: none;

    white-space: nowrap;
}

.app-header__context-button:hover,
.app-header__context-button:focus,
.app-header__context-button:active,
.app-header__context-button.show {
    border-color: #c9d1da;

    background: #f8fafc;

    color: #172033;

    box-shadow: none;
}

.app-header__context-button i {
    flex: 0 0 auto;

    color: #657184;

    font-size: 0.9rem;
}

.app-header__context-button > span {
    min-width: 0;

    overflow: hidden;

    text-overflow: ellipsis;

    white-space: nowrap;
}


/* ==========================================================
   Context Dropdown
   ========================================================== */

.app-header__context .dropdown-menu {
    min-width: 250px;

    max-width: 320px;

    margin-top: 5px;

    padding: 6px;

    border: 1px solid #e3e8ee;

    border-radius: 10px;

    box-shadow:
        0 12px 35px rgba(15, 23, 42, 0.10);
}

.app-header__context-option {
    display: flex;
    align-items: center;

    gap: 9px;

    width: 100%;

    min-height: 38px;

    padding: 8px 10px;

    border: 0;

    border-radius: 7px;

    background: transparent;

    color: #3d4756;

    font-size: 0.76rem;

    text-align: left;
}

.app-header__context-option:hover {
    background: #f4f6f9;

    color: #172033;
}

.app-header__context-option i {
    flex: 0 0 auto;
}

.app-header__context-option span {
    min-width: 0;

    overflow: hidden;

    text-overflow: ellipsis;

    white-space: nowrap;
}


/* ==========================================================
   User
   ========================================================== */

.app-header__user {
    position: relative;

    display: flex;
    align-items: center;

    margin-left: auto;

    min-width: 0;
}

.app-header__user-button {
    display: flex;
    align-items: center;

    gap: 9px;

    min-height: 42px;

    padding: 3px 5px 3px 7px;

    border: 0;

    border-radius: 9px;

    background: transparent;

    color: #172033;

    box-shadow: none;
}

.app-header__user-button:hover,
.app-header__user-button:focus,
.app-header__user-button:active,
.app-header__user-button.show {
    background: #f5f7f9;

    color: #172033;

    border: 0;

    box-shadow: none;
}


/* ==========================================================
   Avatar
   ========================================================== */

.app-header__avatar {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 34px;
    height: 34px;

    flex: 0 0 34px;

    border-radius: 50%;

    background: var(--bs-primary, #0d47a1);

    color: #ffffff;

    font-size: 0.77rem;
    font-weight: 700;
}


/* ==========================================================
   User Information
   ========================================================== */

.app-header__user-info {
    display: flex;
    flex-direction: column;

    min-width: 0;

    max-width: 145px;

    text-align: left;
}

.app-header__user-name {
    display: block;

    overflow: hidden;

    color: #172033;

    font-size: 0.76rem;
    font-weight: 700;

    line-height: 1.2;

    text-overflow: ellipsis;

    white-space: nowrap;
}

.app-header__user-role {
    display: block;

    margin-top: 2px;

    color: #8992a0;

    font-size: 0.62rem;
    font-weight: 500;

    line-height: 1.2;
}


/* ==========================================================
   User Dropdown
   ========================================================== */

.app-header__user-menu {
    min-width: 220px;

    margin-top: 5px;

    padding: 6px;

    border: 1px solid #e3e8ee;

    border-radius: 10px;

    box-shadow:
        0 12px 35px rgba(15, 23, 42, 0.10);
}

.app-header__user-menu .dropdown-item {
    display: flex;
    align-items: center;

    gap: 9px;

    min-height: 38px;

    padding: 8px 10px;

    border-radius: 7px;

    font-size: 0.76rem;
}

.app-header__user-menu .dropdown-item i {
    width: 18px;

    text-align: center;
}

.app-header__user-menu-header {
    padding: 9px 10px 10px;
}

.app-header__user-menu-name {
    display: block;

    overflow: hidden;

    color: #172033;

    font-size: 0.79rem;
    font-weight: 700;

    text-overflow: ellipsis;

    white-space: nowrap;
}

.app-header__user-menu-email {
    display: block;

    margin-top: 3px;

    overflow: hidden;

    color: #8992a0;

    font-size: 0.66rem;

    text-overflow: ellipsis;

    white-space: nowrap;
}


/* ==========================================================
   Mobile Sidebar Toggle
   ========================================================== */

.app-header__sidebar-toggle {
    display: none;

    align-items: center;
    justify-content: center;

    width: 36px;
    height: 36px;

    margin-right: 8px;

    padding: 0;

    border: 0;

    border-radius: 8px;

    background: #f4f6f9;

    color: #374151;

    font-size: 1.05rem;

    cursor: pointer;
}

.app-header__sidebar-toggle:hover {
    background: #e9edf2;
}

.app-header__sidebar-toggle:focus-visible {
    outline: 2px solid var(--bs-primary, #0d47a1);

    outline-offset: 2px;
}


/* ==========================================================
   Tablet
   ========================================================== */

@media (max-width: 1199.98px) {

    .app-header__brand {
        width: 118px;
        min-width: 118px;
    }

    .app-header__context-button {
        width: 160px;
    }

    .app-header__context-label {
        display: none;
    }

}


/* ==========================================================
   Mobile
   ========================================================== */

@media (max-width: 991.98px) {

    .app-header {
        height: 58px;
    }

    .app-header__wrapper {
        height: 58px;

        padding: 0 12px;
    }

    .app-header__sidebar-toggle {
        display: inline-flex;
    }

    .app-header__brand {
        width: auto;
        min-width: 0;
    }

    .app-header__context {
        display: none;
    }

    .app-header__user {
        margin-left: auto;
    }

    .app-header__user-info {
        display: none;
    }

    .app-header__user-button {
        padding: 3px;
    }

}


/* ==========================================================
   Small Mobile
   ========================================================== */

@media (max-width: 575.98px) {

    .app-header__brand-text {
        font-size: 0.9rem;
    }

    .app-header__logo {
        width: 80px;
        height: 70px;
    }

    .app-header__avatar {
        width: 32px;
        height: 32px;

        flex-basis: 32px;
    }

}