/* [PAGE-CHROME] Khung màn hình dùng chung EasyInvoice - chuẩn hóa theo phong cách V-Assets.
   Dùng biến theme PixInvent (--bs-*), sửa 1 nơi áp mọi màn. Nạp ở Sections/_Styles.cshtml. */

.btn {
    text-transform: none !important
}

/* ===== Page header (màn danh sách/chức năng) ===== */
.page-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: .75rem 1.15rem;
    background: var(--bs-card-bg);
    border: 1px solid var(--bs-border-color);
    border-left: 3px solid var(--bs-primary);
    border-radius: .5rem;
    box-shadow: 0 2px 6px rgba(20, 30, 60, .04);
}

.page-head-left {
    display: flex;
    align-items: center;
    gap: .75rem;
    min-width: 0;
}

.page-head-ico {
    width: 38px;
    height: 38px;
    border-radius: .55rem;
    background: var(--bs-primary-bg-subtle);
    color: var(--bs-primary);
    display: grid;
    place-items: center;
    font-size: 1.2rem;
    flex: 0 0 auto;
}

.page-head-title {
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.2;
    margin: 0;
}

.page-head-sub {
    font-size: .8rem;
    color: var(--bs-secondary-color);
    margin-top: 1px;
}

.page-head-actions {
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-shrink: 0;
    flex-wrap: wrap;
}

/* ===== Page footer (3 thẻ tri thức) ===== */
.page-foot {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr;
    gap: 1rem;
    margin-top: 1rem;
}

.page-foot .card-body {
    padding: .9rem 1.1rem;
}

.page-foot-h {
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--bs-secondary-color);
    font-weight: 700;
    margin-bottom: .6rem;
    display: flex;
    align-items: center;
    gap: .4rem;
}

.page-foot-about {
    font-size: .85rem;
    color: var(--bs-body-color);
    line-height: 1.55;
    margin: 0;
}

.page-foot-links {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: .45rem;
}

.page-foot-links a {
    color: var(--bs-primary);
    text-decoration: none;
    font-size: .85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: .4rem;
}

.page-foot-links a:hover {
    text-decoration: underline;
}

.page-foot-stats {
    display: flex;
    flex-direction: column;
}

.page-foot-stat {
    display: flex;
    justify-content: space-between;
    font-size: .85rem;
    padding: .32rem 0;
    border-bottom: 1px dashed var(--bs-border-color);
}

.page-foot-stat:last-child {
    border-bottom: 0;
}

.page-foot-stat b {
    font-variant-numeric: tabular-nums;
}

/* ===== Flow rail (dải quy trình nghiệp vụ) ===== */
.flow-rail .card-body {
    display: block;
}

.flow-rail-label {
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--bs-secondary-color);
    margin-bottom: .4rem;
}

.flow-rail-steps {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .25rem;
}

.flow-rail-step {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .35rem .7rem;
    border-radius: 2rem;
    font-size: .82rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    border: 1px solid transparent;
    transition: background-color .15s, border-color .15s, color .15s;
}

.flow-rail-step>i {
    font-size: 1rem;
}

.flow-rail-step.is-done {
    background: var(--bs-primary-bg-subtle);
    color: var(--bs-primary);
}

.flow-rail-step.is-done:hover {
    border-color: var(--bs-primary);
}

.flow-rail-step.is-current {
    background: var(--bs-primary);
    color: #fff;
}

.flow-rail-step.is-todo {
    background: transparent;
    color: var(--bs-secondary-color);
    border: 1px dashed var(--bs-border-color);
}

.flow-rail-step.is-todo:hover {
    color: var(--bs-primary);
    border-color: var(--bs-primary);
}

.flow-rail-sep {
    color: var(--bs-secondary-color);
    font-size: 1rem;
    flex: none;
}

/* ===== Related functions (biến thể ngang) ===== */
.related-inline-label {
    font-size: .78rem;
    font-weight: 700;
    color: var(--bs-secondary-color);
    white-space: nowrap;
}

.related-inline-item {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .3rem .65rem;
    border-radius: .4rem;
    font-size: .82rem;
    font-weight: 600;
    text-decoration: none;
    color: var(--bs-primary);
    background: rgba(var(--bs-primary-rgb), .09);
    border: 1px solid transparent;
    transition: border-color .15s, background-color .15s;
}

.related-inline-item:hover {
    border-color: var(--bs-primary);
}

.related-inline-item>i {
    font-size: 1rem;
}

/* ===== Tiện ích nhỏ ===== */
.mono {
    font-family: ui-monospace, "Roboto Mono", SFMono-Regular, Menlo, monospace;
    font-variant-numeric: tabular-nums;
}

.hx-loading {
    cursor: progress;
}

/* Thanh tiến trình tải trang (SPA/htmx) - kiểu NProgress, không chặn thao tác. */
#hx-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    width: 0;
    background: var(--bs-primary, #696cff);
    box-shadow: 0 0 8px rgba(105, 108, 255, .55), 0 0 4px rgba(105, 108, 255, .5);
    border-radius: 0 3px 3px 0;
    z-index: 2000;
    opacity: 1;
    pointer-events: none;
}

#hx-progress.done {
    opacity: 0;
    transition: width .2s ease-out, opacity .3s ease .12s;
}

@media (max-width: 991.98px) {
    .page-foot {
        grid-template-columns: 1fr;
    }
}

/* ===== Trợ lý AI (chat) ===== */
.asst-messages {
    display: flex;
    flex-direction: column;
    gap: .6rem;
    overflow-y: auto;
    padding: 1rem;
}

.asst-row {
    display: flex;
    flex-direction: column;
    max-width: 85%;
}

.asst-row.asst-user {
    align-self: flex-end;
    align-items: flex-end;
}

.asst-row.asst-bot {
    align-self: flex-start;
    align-items: flex-start;
}

.asst-bubble {
    padding: .55rem .85rem;
    border-radius: .85rem;
    font-size: .9rem;
    line-height: 1.5;
    white-space: normal;
    word-break: break-word;
}

.asst-user .asst-bubble {
    background: var(--bs-primary);
    color: #fff;
    border-bottom-right-radius: .2rem;
}

.asst-bot .asst-bubble {
    background: var(--bs-secondary-bg);
    color: var(--bs-body-color);
    border-bottom-left-radius: .2rem;
}

.asst-chips {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
    margin-top: .4rem;
}

.asst-chip {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    font-size: .78rem;
    font-weight: 600;
    text-decoration: none;
    padding: .25rem .6rem;
    border-radius: 2rem;
    color: var(--bs-primary);
    background: rgba(var(--bs-primary-rgb), .1);
    border: 1px solid transparent;
}

.asst-chip:hover {
    border-color: var(--bs-primary);
}

.asst-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    margin: 0 1px;
    border-radius: 50%;
    background: var(--bs-secondary-color);
    animation: asstb 1s infinite;
}

.asst-dot:nth-child(2) {
    animation-delay: .2s;
}

.asst-dot:nth-child(3) {
    animation-delay: .4s;
}

@keyframes asstb {

    0%,
    60%,
    100% {
        opacity: .3;
    }

    30% {
        opacity: 1;
    }
}

.asst-input-row {
    display: flex;
    gap: .5rem;
    padding: .6rem;
    border-top: 1px solid var(--bs-border-color);
}

.asst-input-row textarea {
    flex: 1;
    resize: none;
    border: 1px solid var(--bs-border-color);
    border-radius: .5rem;
    padding: .5rem .7rem;
    font-size: .9rem;
    background: var(--bs-body-bg);
    color: var(--bs-body-color);
}

/* FAB + panel nổi */
.asst-fab {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 1085;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 0;
    background: var(--bs-primary);
    color: #fff;
    box-shadow: 0 6px 18px rgba(20, 30, 60, .28);
    display: grid;
    place-items: center;
    font-size: 1.5rem;
    cursor: pointer;
}

.asst-panel {
    position: fixed;
    right: 24px;
    bottom: 92px;
    z-index: 1086;
    width: 380px;
    max-width: calc(100vw - 32px);
    height: 520px;
    max-height: calc(100vh - 130px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.asst-panel[hidden] {
    display: none;
}

.asst-panel .asst-messages {
    flex: 1;
}

.asst-head {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .7rem 1rem;
    border-bottom: 1px solid var(--bs-border-color);
}
/* Mục menu chức năng CHƯA làm (badge "Sắp có") — hiện mờ, không bấm được */
#layout-menu .menu-link.disabled {
    opacity: .5;
    pointer-events: none;
    cursor: default;
}
#layout-menu .menu-link.disabled .badge {
    font-weight: 500;
    font-size: .65rem;
}

/* Dropdown chọn hàng hóa (line-items typeahead): mở khi focus, cuộn khi danh sách dài */
.ei-ta-menu { max-height: 20rem; overflow-y: auto; z-index: 1056; }
.ei-ta-menu .list-group-item-action { cursor: pointer; }

/* Select2 ô chọn hàng hóa: khớp cỡ form-select-sm + nổi trên bảng/modal */
.li-name-sel + .select2-container .select2-selection--single { height: calc(1.5em + 0.5rem + 2px); border-color: var(--bs-border-color, #d1d0d4); }
.li-name-sel + .select2-container .select2-selection--single .select2-selection__rendered { line-height: calc(1.5em + 0.4rem); padding-left: 0.65rem; font-size: 0.8125rem; }
.li-name-sel + .select2-container .select2-selection--single .select2-selection__arrow { height: 100%; }
.select2-dropdown { z-index: 1060; border-color: var(--bs-border-color, #d1d0d4); }
.select2-container--open { z-index: 1060; }
.select2-results__option small { font-size: 0.75rem; }
