/* ═════════════════════════════════════════════════════════════════════════════
   inventory.css — CSS CẤP MODULE cho MỌI màn Kho hàng (/pms/inventory/**)
   Nạp bằng <link> TAY trong Ezibee.Web/Components/App.razor:
       _content/Ezibee.PMS.Web/css/inventory.css?v=...
   ⚠️ Sửa file này thì PHẢI bump `?v=` ở App.razor — không thì trình duyệt giữ bản CŨ.

   KHUÔN: trang Arrival / Departure (Reports/PmsArrivalDeparture.razor.css) — chủ dự án chốt
   2026-09-19 "thiết kế chuẩn lại theo cấu hình chung của platform":
     • thân trang TRẢI HẾT bề rộng — ⛔ khung 1280px căn giữa + thẻ be bọc ngoài như bản cũ
       (trang bị "co lại nhỏ", hai bên trống cả mảng);
     • băng tiêu đề ◆ + phụ đề, nút thao tác bên phải;
     • thẻ số liệu: vạch màu 3px ở ĐỈNH (⛔ cạnh trái — chủ dự án cấm) · ô icon nhuộm màu ·
       nhãn chữ hoa · số lớn;
     • danh sách là THẺ có đầu mục (chấm · tiêu đề · ô tìm · số bản ghi) + bảng tiêu đề chữ hoa.

   Vì sao CSS cấp module, ⛔ `.razor.css` từng màn: 14 màn trước đây là BẢN CHÉP của nhau
   (mỗi file 400–770 dòng, đã lệch nhau dần) — sửa một chỗ phải sửa mười bốn chỗ.

   🔴 MỌI class mang tiền tố `inv-`. Bản cũ đặt tên trùng CSS toàn cục và trả giá hai lần:
     • `.row` cho dòng phiếu ⇒ Bootstrap `.row > * { width:100%; padding-inline:.75rem }` bóp
       cột số phiếu còn ~68px ⇒ "PO-260916-012" bị bẻ BA dòng;
     • `.toast` ⇒ Bootstrap `.toast:not(.show) { display:none }` GIẤU mọi thông báo lưu / lỗi
       ("Vui lòng chọn Nhà cung cấp"…) — người dùng bấm Lưu mà ⛔ thấy gì.
   ⛔ Đừng đặt lại: row · toast · card · badge · table · panel · table-wrap · h1 …

   Token khai trên `.inv-page` bằng GIÁ TRỊ THẬT (giống hệt `.ar-page`). ⛔ Đừng viết
   `--brand: var(--brand, …)`: tự tham chiếu cùng tên là vòng lặp ⇒ token invalid (xem accounting.css).
   Nền trang đi qua `--ez-bg` (② Nền trang của màn Cấu hình giao diện).
   Chữ đi qua `--rpt-*` (pms-report-type.css) — ⛔ gõ px cho tiêu đề / nhãn / số liệu.
   ═════════════════════════════════════════════════════════════════════════════ */

.inv-page {
    --bg: var(--ez-bg, #faf6f0);
    --surface: #ffffff;
    --surface-2: #fbf8f3;
    --ink: #2a2520;
    --ink-soft: #6b6158;
    --ink-mute: #a39a90;
    --line: #ece5db;
    --line-strong: #ddd2c3;
    --brand: #b8742a;
    --brand-deep: #8f5618;
    --brand-light: #d4984a;
    --brand-soft: #fbeedc;
    --brand-softer: #fdf5e9;
    --success: #2f9e6b;
    --success-deep: #1f7a50;
    --success-soft: #e8f5ec;
    --danger: #d63d54;
    --danger-deep: #b3263c;
    --danger-soft: #fde8eb;
    --warn: #e8912a;
    --warn-deep: #b56506;
    --warn-soft: #fdecd4;
    --info: #3b82f6;
    --info-deep: #1e5bb8;
    --info-soft: #e4eefd;
    --purple: #7a4ed6;
    --purple-deep: #6a3fbf;
    --purple-soft: #efe8fb;
    --teal: #0ea5a0;
    --teal-deep: #0b7d79;
    --teal-soft: #dff5f3;
    --radius: 14px;
    --radius-sm: 10px;
    --shadow-sm: 0 1px 2px rgba(60,40,20,.04), 0 2px 6px rgba(60,40,20,.03);
    --shadow-md: 0 4px 14px rgba(60,40,20,.08), 0 1px 3px rgba(60,40,20,.04);
    font-family: var(--rpt-font-ui);
    font-size: 13px;
    line-height: 1.45;
    color: var(--ink);
    background: var(--bg);
    display: block;
    min-height: 100%;
    max-width: 100%;
    padding-bottom: 32px;
}

    .inv-page *,
    .inv-page *::before,
    .inv-page *::after {
        box-sizing: border-box;
    }

    .inv-page button,
    .inv-page input,
    .inv-page select,
    .inv-page textarea {
        font-family: inherit;
    }

    .inv-page a {
        color: var(--brand-deep);
        text-decoration: none;
    }

        .inv-page a:hover {
            color: var(--brand);
            text-decoration: underline;
        }

    .inv-page code {
        font-family: var(--rpt-font-mono);
        font-size: .92em;
        background: rgba(60, 40, 20, .06);
        color: inherit;
        padding: 0 5px;
        border-radius: 4px;
    }

    .inv-page kbd {
        font-family: var(--rpt-font-mono);
        font-size: 11px;
        background: #f1ebe0;
        color: var(--ink-soft);
        border: 1px solid var(--line-strong);
        border-radius: 4px;
        padding: 0 5px;
        box-shadow: none;
    }

/* ═════════ BĂNG TIÊU ĐỀ ═════════ */
.inv-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px 16px;
    padding: 14px 16px 12px;
    border-bottom: 1px solid var(--line);
    background: linear-gradient(180deg, #fffaf2 0%, var(--bg) 100%);
}

@media (min-width: 640px) {
    .inv-head {
        padding: 16px 20px 14px;
    }
}

@media (min-width: 960px) {
    .inv-head {
        padding: 16px 24px;
    }
}

@media (min-width: 1280px) {
    .inv-head {
        padding: 20px 32px;
    }
}

.inv-head-l {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 1 1 340px;
}

.inv-title-wrap {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.inv-page .inv-title {
    font-family: var(--rpt-font-display);
    font-size: var(--rpt-title);
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -.01em;
    margin: 0;
    color: var(--ink);
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

    .inv-page .inv-title .dia {
        color: var(--brand);
        font-size: var(--rpt-title-dia);
        flex-shrink: 0;
    }

    .inv-page .inv-title .txt {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
    }

/* Phụ đề là CÂU VĂN (chữ đậm nằm giữa câu) ⇒ chảy inline bình thường. ⛔ đừng cho nó `display:flex`:
   mỗi thẻ con thành một flex item, chữ đậm tách khỏi dấu câu ngay sau nó ("Xuất . Tồn cuối…").
   Dòng thông tin phiếu ở màn chi tiết (mã · giờ · huy hiệu) mới dàn hàng — dùng `.inv-sub.meta`. */
.inv-sub {
    font-size: var(--rpt-sub);
    color: var(--ink-mute);
    font-weight: 500;
    line-height: 1.55;
    margin: 0;
}

    .inv-sub.meta {
        display: flex;
        align-items: center;
        flex-wrap: wrap;
        gap: 4px 8px;
    }

    .inv-sub b {
        color: var(--ink-soft);
        font-weight: 600;
    }

    .inv-sub .sep {
        color: var(--line-strong);
    }

.inv-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

/* ═════════ THÂN TRANG ═════════ */
.inv-body {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 14px 16px 0;
    min-width: 0;
}

@media (min-width: 640px) {
    .inv-body {
        padding: 14px 20px 0;
    }
}

@media (min-width: 960px) {
    .inv-body {
        padding: 16px 24px 0;
        gap: 16px;
    }
}

@media (min-width: 1280px) {
    .inv-body {
        padding: 18px 32px 0;
    }
}

/* ═════════ NÚT ═════════ */
.inv-btn {
    height: 38px;
    padding: 0 14px;
    border-radius: 12px;
    border: 1px solid var(--line-strong);
    background: var(--surface);
    color: var(--ink);
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    cursor: pointer;
    white-space: nowrap;
    text-decoration: none;
    transition: background .15s, border-color .15s, color .15s, box-shadow .15s;
}

    .inv-page a.inv-btn:hover {
        text-decoration: none;
    }

    .inv-btn:hover:not(:disabled) {
        background: var(--brand-softer);
        border-color: #e8cfa6;
    }

    .inv-btn:disabled {
        opacity: .5;
        cursor: not-allowed;
    }

    .inv-btn.primary {
        background: linear-gradient(180deg, var(--brand-light) 0%, var(--brand) 100%);
        border-color: var(--brand);
        color: #fff;
        box-shadow: 0 2px 6px rgba(184,116,42,.28);
    }

        .inv-btn.primary:hover:not(:disabled) {
            background: linear-gradient(180deg, var(--brand) 0%, var(--brand-deep) 100%);
            border-color: var(--brand-deep);
        }

    .inv-btn.ok {
        background: linear-gradient(180deg, #3fb07b 0%, var(--success) 100%);
        border-color: var(--success);
        color: #fff;
        box-shadow: 0 2px 6px rgba(47,158,107,.26);
    }

        .inv-btn.ok:hover:not(:disabled) {
            background: linear-gradient(180deg, var(--success) 0%, var(--success-deep) 100%);
            border-color: var(--success-deep);
        }

    .inv-btn.danger {
        color: var(--danger-deep);
        border-color: #f3c3cb;
    }

        .inv-btn.danger:hover:not(:disabled) {
            background: var(--danger-soft);
            border-color: #eea4b0;
        }

    .inv-btn.sm {
        height: 32px;
        padding: 0 11px;
        border-radius: 10px;
        font-size: 12.5px;
    }

    .inv-btn.lg {
        height: 42px;
        padding: 0 20px;
        font-size: 13.5px;
    }

    .inv-btn.icon {
        width: 38px;
        padding: 0;
    }

/* Nút vuông ‹ › (quay lại · kỳ trước / kỳ sau) — khuôn `.date-nav` của Arrival. */
.inv-nav {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    border: 1px solid var(--line-strong);
    background: var(--surface);
    color: var(--ink-soft);
    display: grid;
    place-items: center;
    flex-shrink: 0;
    cursor: pointer;
    padding: 0;
    transition: background .15s, border-color .15s, color .15s;
}

    .inv-nav:hover:not(:disabled) {
        background: var(--brand-soft);
        border-color: #e8cfa6;
        color: var(--brand-deep);
    }

    .inv-nav:disabled {
        opacity: .45;
        cursor: not-allowed;
    }

/* ═════════ THANH LỌC (thẻ trắng, trường có nhãn — khuôn `.ar-filter-panel`) ═════════ */
.inv-filter {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 12px 14px;
    padding: 12px 14px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.inv-fg {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
}

    .inv-fg.grow {
        flex: 1 1 auto;
    }

.inv-fl {
    font-size: 10px;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--ink-mute);
    font-weight: 700;
    line-height: 1.3;
    padding-left: 2px;
    display: flex;
    align-items: center;
    gap: 4px;
}

    .inv-fl .req {
        color: var(--danger);
    }

.inv-range-arrow {
    color: var(--ink-mute);
    height: 38px;
    display: inline-flex;
    align-items: center;
}

.inv-period {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.inv-hint {
    font-size: 12px;
    color: var(--ink-mute);
    font-weight: 500;
    white-space: nowrap;
    height: 38px;
    display: inline-flex;
    align-items: center;
}

/* ═════════ Ô NHẬP ═════════ */
.inv-ctrl {
    height: 38px;
    width: 100%;
    padding: 0 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line-strong);
    background-color: var(--surface);
    color: var(--ink);
    font-size: 13px;
    outline: none;
    transition: border-color .12s, box-shadow .12s;
}

    .inv-ctrl:focus {
        border-color: var(--brand);
        box-shadow: 0 0 0 3px var(--brand-soft);
    }

    .inv-ctrl:disabled,
    .inv-ctrl[readonly] {
        background-color: var(--surface-2);
        color: var(--ink-mute);
        cursor: not-allowed;
    }

select.inv-ctrl {
    -webkit-appearance: none;
    appearance: none;
    padding-right: 32px;
    cursor: pointer;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23a39a90' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}

textarea.inv-ctrl {
    height: auto;
    min-height: 64px;
    padding: 9px 12px;
    line-height: 1.5;
    resize: vertical;
}

.inv-filter .inv-ctrl {
    width: auto;
}

.inv-ctrl.date {
    width: 150px;
}

.inv-ctrl.sel {
    min-width: 170px;
    max-width: 240px;
}

.inv-ctrl.period {
    min-width: 150px;
}

/* ═════════ CHIP LỌC (bấm được, có số đếm) ═════════ */
.inv-chips {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

    /* Trong thanh lọc, hàng chip cao BẰNG ô nhập (38px) — thanh lọc căn đáy nên thiếu 4px là nhãn của
       nhóm chip tụt thấp hơn nhãn các ô bên cạnh. */
    .inv-fg > .inv-chips {
        min-height: 38px;
    }

.inv-chip {
    height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid var(--line-strong);
    background: var(--surface);
    color: var(--ink-soft);
    font-size: 12.5px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    white-space: nowrap;
    user-select: none;
    transition: background .12s, border-color .12s, color .12s;
}

    .inv-chip:hover {
        background: var(--brand-softer);
        border-color: #e8cfa6;
    }

    .inv-chip.on {
        background: var(--brand-soft);
        border-color: #e0bd8a;
        color: var(--brand-deep);
    }

    .inv-chip .n {
        font-family: var(--rpt-font-mono);
        font-size: 11px;
        font-weight: 700;
        min-width: 20px;
        text-align: center;
        padding: 1px 7px;
        border-radius: 999px;
        background: #f1ece3;
        color: var(--ink-soft);
    }

    .inv-chip.on .n {
        background: var(--brand);
        color: #fff;
    }

    .inv-chip .d {
        width: 7px;
        height: 7px;
        border-radius: 50%;
        background: var(--ink-mute);
        flex-shrink: 0;
    }

        .inv-chip .d.draft {
            background: #b0a595;
        }

        .inv-chip .d.confirm {
            background: var(--info);
        }

        .inv-chip .d.done {
            background: var(--success);
        }

        .inv-chip .d.cancel {
            background: var(--danger);
        }

        .inv-chip .d.open {
            background: var(--warn);
        }

        .inv-chip .d.over {
            background: var(--purple);
        }

/* ═════════ THẺ SỐ LIỆU (khuôn `.stat-card` của Arrival) ═════════ */
.inv-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

@media (min-width: 640px) {
    .inv-stats {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (min-width: 960px) {
    .inv-stats {
        gap: 12px;
    }
}

.inv-stat {
    --c: var(--brand);
    --c-soft: var(--brand-soft);
    --c-ink: var(--brand-deep);
    position: relative;
    overflow: hidden;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 14px 14px 12px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    transition: box-shadow .15s, transform .15s;
}

    .inv-stat:hover {
        box-shadow: var(--shadow-md);
        transform: translateY(-1px);
    }

    /* Vạch màu ở ĐỈNH — ⛔ cạnh trái (chủ dự án chốt 18/09/2026). */
    .inv-stat::before {
        content: "";
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 3px;
        background: var(--c);
    }

    .inv-stat.t-ok {
        --c: var(--success);
        --c-soft: var(--success-soft);
        --c-ink: var(--success-deep);
    }

    .inv-stat.t-bad {
        --c: var(--danger);
        --c-soft: var(--danger-soft);
        --c-ink: var(--danger-deep);
    }

    .inv-stat.t-warn {
        --c: var(--warn);
        --c-soft: var(--warn-soft);
        --c-ink: var(--warn-deep);
    }

    .inv-stat.t-info {
        --c: var(--info);
        --c-soft: var(--info-soft);
        --c-ink: var(--info-deep);
    }

    .inv-stat.t-purple {
        --c: var(--purple);
        --c-soft: var(--purple-soft);
        --c-ink: var(--purple-deep);
    }

    .inv-stat.t-teal {
        --c: var(--teal);
        --c-soft: var(--teal-soft);
        --c-ink: var(--teal-deep);
    }

    .inv-stat.t-mute {
        --c: #b8ada0;
        --c-soft: #f1efe9;
        --c-ink: var(--ink-soft);
    }

.inv-stat-head {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.inv-stat-ico {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    background: var(--c-soft);
    color: var(--c-ink);
}

.inv-stat-label {
    font-size: var(--rpt-sum-label);
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--ink-mute);
    font-weight: 600;
    line-height: 1.3;
    min-width: 0;
}

.inv-stat-value {
    font-family: var(--rpt-font-mono);
    font-size: var(--rpt-sum-value);
    font-weight: 700;
    line-height: 1;
    color: var(--ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

    .inv-stat-value .unit {
        font-family: var(--rpt-font-ui);
        font-size: 14px;
        font-weight: 500;
        color: var(--ink-mute);
        margin-left: 3px;
    }

    .inv-stat-value.v-ok {
        color: var(--success-deep);
    }

    .inv-stat-value.v-bad {
        color: var(--danger);
    }

    .inv-stat-value.v-warn {
        color: var(--warn-deep);
    }

    .inv-stat-value.v-info {
        color: var(--info-deep);
    }

    .inv-stat-value.v-purple {
        color: var(--purple-deep);
    }

.inv-stat-sub {
    font-size: 11.5px;
    color: var(--ink-mute);
    line-height: 1.4;
}

@media (min-width: 960px) {
    .inv-stat {
        padding: 16px 18px 14px;
    }

    .inv-stat-ico {
        width: 38px;
        height: 38px;
    }
}

/* ═════════ THẺ KHỐI (khuôn `.section-card` của Arrival) ═════════ */
.inv-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    min-width: 0;
}

    /* Thẻ có ô chọn thả xuống (combo NCC): ⛔ cắt phần tràn, nếu không danh sách xổ bị giấu. */
    .inv-card.open {
        overflow: visible;
    }

.inv-card-head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 10px;
    padding: 13px 16px;
    border-bottom: 1px solid var(--line);
    border-radius: var(--radius) var(--radius) 0 0;
    background: linear-gradient(180deg, var(--surface-2) 0%, var(--surface) 100%);
}

    .inv-card-head .dot {
        width: 8px;
        height: 8px;
        border-radius: 50%;
        background: var(--brand);
        flex-shrink: 0;
    }

    .inv-card-head .dot.ok {
        background: var(--success);
    }

    .inv-card-head .dot.info {
        background: var(--info);
    }

    .inv-page .inv-card-head h2 {
        font-family: var(--rpt-font-display);
        font-size: 15.5px;
        font-weight: 600;
        line-height: 1.3;
        margin: 0;
        color: var(--ink);
        /* basis 0 (⛔ auto): tiêu đề có chú thích dài thì nó tự xuống dòng BÊN TRONG, ⛔ nhảy cả khối
           xuống hàng dưới để lại cái chấm đứng một mình (đo ở 390px). */
        flex: 1 1 0;
        min-width: 0;
        display: flex;
        align-items: baseline;
        flex-wrap: wrap;
        gap: 2px 8px;
    }

        .inv-page .inv-card-head h2 .note {
            font-family: var(--rpt-font-ui);
            font-size: 12px;
            font-weight: 500;
            color: var(--ink-mute);
        }

            .inv-page .inv-card-head h2 .note b {
                color: var(--ink-soft);
                font-weight: 600;
            }

.inv-card-body {
    padding: 14px 16px;
}

    .inv-card-body.tight {
        padding: 12px 16px;
    }

.inv-card-foot {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 12px;
    padding: 12px 16px;
    border-top: 1px solid var(--line);
    background: var(--surface-2);
    border-radius: 0 0 var(--radius) var(--radius);
}

    .inv-card-foot .sp {
        flex: 1 1 auto;
    }

.inv-count {
    font-family: var(--rpt-font-mono);
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
    padding: 3px 9px;
    border-radius: 999px;
    background: var(--brand-soft);
    color: var(--brand-deep);
}

/* Ô tìm trong đầu thẻ danh sách — khuôn `.search-box` của Arrival. */
.inv-search {
    display: flex;
    align-items: center;
    gap: 6px;
    height: 34px;
    padding: 0 10px;
    flex: 0 1 320px;
    min-width: 200px;
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    background: var(--surface);
    color: var(--ink-mute);
    transition: border-color .12s, box-shadow .12s;
}

    .inv-search:focus-within {
        border-color: var(--brand);
        box-shadow: 0 0 0 3px var(--brand-soft);
    }

    .inv-search input {
        border: 0;
        outline: 0;
        background: transparent;
        font-size: 12.5px;
        color: var(--ink);
        width: 100%;
        min-width: 0;
        height: 100%;
        padding: 0;
    }

@media (max-width: 639px) {
    .inv-search {
        flex: 1 1 100%;
        order: 10;
    }

    /* Nút ở đầu thẻ (Thêm món…) xuống hàng riêng, trọn bề ngang — để chung hàng thì tiêu đề bị bóp
       còn ~180px và chú thích gãy thành ba dòng. */
    .inv-card-head > .inv-btn {
        flex: 1 1 100%;
        order: 11;
        justify-content: center;
    }
}

/* ═════════ BẢNG ═════════ */
.inv-tbl-wrap {
    width: 100%;
    overflow-x: auto;
}

.inv-tbl {
    width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
    font-size: var(--rpt-td);
}

    .inv-tbl th {
        text-align: left;
        font-size: var(--rpt-th);
        letter-spacing: .1em;
        text-transform: uppercase;
        color: var(--ink-soft);
        font-weight: 700;
        padding: 11px 12px;
        background: var(--surface-2);
        box-shadow: inset 0 -1px 0 var(--line);
        border: 0;
        white-space: nowrap;
        vertical-align: middle;
    }

    .inv-tbl td {
        padding: 12px 12px;
        box-shadow: inset 0 -1px 0 var(--line);
        border: 0;
        vertical-align: middle;
        color: var(--ink);
    }

        .inv-tbl th:first-child,
        .inv-tbl td:first-child {
            padding-left: 16px;
        }

        .inv-tbl th:last-child,
        .inv-tbl td:last-child {
            padding-right: 16px;
        }

    .inv-tbl tbody tr:last-child > td {
        box-shadow: none;
    }

    .inv-tbl th.r,
    .inv-tbl td.r {
        text-align: right;
    }

    .inv-tbl th.c,
    .inv-tbl td.c {
        text-align: center;
    }

    .inv-tbl td.num {
        font-family: var(--rpt-font-mono);
        font-size: var(--rpt-td-num);
        font-variant-numeric: tabular-nums;
        text-align: right;
        white-space: nowrap;
    }

    .inv-tbl td.strong {
        font-weight: 700;
    }

    .inv-tbl td.chev {
        width: 32px;
        text-align: center;
        color: var(--ink-mute);
        font-size: 15px;
    }

    .inv-tbl td.top {
        vertical-align: top;
    }

    /* Độ rộng cột cố định cho bảng NHẬP (số lượng · đơn giá · nút xoá). */
    .inv-tbl .inv-w48 {
        width: 48px;
    }

    .inv-tbl .inv-w90 {
        width: 90px;
    }

    .inv-tbl .inv-w120 {
        width: 120px;
    }

    .inv-tbl .inv-w140 {
        width: 140px;
    }

    .inv-tbl .inv-w160 {
        width: 160px;
    }

    .inv-tbl .inv-w200 {
        width: 200px;
    }

    /* ③ SỌC CHẴN/LẺ — theo đúng cấu hình giao diện (`--ez-row-alt`, màn Cấu hình › Giao diện:
       "Dòng chẵn của các bảng. Chưa lưu ⇒ không sọc").
       Luật toàn hệ thống `.page table tbody tr:nth-child(even)` đếm MỌI `tr` trong tbody, kể cả
       dòng TIÊU ĐỀ NHÓM (ngày / tháng) ⇒ sọc nhảy lung tung: hai phiếu liền nhau cùng màu, phiếu
       đầu nhóm lúc sọc lúc không (đo 19/09 trên danh sách nhập kho). Ở đây đếm LẠI chỉ trên dòng
       DỮ LIỆU (`of :not(.inv-grp)`), liên tục qua các nhóm — phiếu thứ 2 · 4 · 6… của danh sách
       mang màu sọc, y như một bảng không chia nhóm.
       ⚠️ Chưa cấu hình ⇒ token vắng ⇒ `transparent` ⇒ KHÔNG sọc — đúng lời màn cấu hình.
       ⚠️ Specificity: dòng dọn `.inv-page .inv-tbl tbody tr:nth-child(n)` là (0,3,2), thắng luật
       toàn hệ thống (0,2,3) dù luật đó phát SAU (khối style trong layout); dòng tô là (0,4,2).
       ⚠️ Nền sọc nằm trên `tr` — ⛔ tô nền `td` mặc định, nếu không sọc biến mất. */
    .inv-page .inv-tbl tbody tr:nth-child(n) {
        background-color: transparent;
    }

    .inv-page .inv-tbl tbody tr:nth-child(even of :not(.inv-grp)) {
        background-color: var(--ez-row-alt, transparent);
    }

    /* Dòng bấm được (mở chi tiết). */
    .inv-tbl tr.inv-row {
        cursor: pointer;
    }

        .inv-tbl tr.inv-row:hover > td {
            background: var(--brand-softer);
        }

    .inv-tbl tr.is-off > td {
        color: var(--ink-mute);
    }

    .inv-tbl tfoot td {
        background: var(--surface-2);
        font-weight: 700;
        box-shadow: inset 0 1px 0 var(--line-strong);
    }

    /* Dòng TIÊU ĐỀ NHÓM (ngày / tháng) — gộp hết cột.
       Nền SUY từ màu sọc đã cấu hình, ĐẬM hơn nó một bậc. Bản trước ghim #f6efe3 — trùng gần tuyệt
       đối màu sọc site đang dùng (#f6f0e4, đo 19/09) ⇒ dòng tiêu đề và phiếu sọc ngay dưới nhập làm
       MỘT mảng, không nhìn ra đâu là nhóm. Suy từ token thì site chọn màu sọc nào dải nhóm cũng
       đậm hơn nó; chưa cấu hình ⇒ rơi về tông be mặc định. */
    .inv-tbl tr.inv-grp > td {
        background: color-mix(in srgb, var(--ez-row-alt, #f6f0e4) 88%, var(--brand-deep));
        padding-top: 8px;
        padding-bottom: 8px;
        box-shadow: inset 0 1px 0 var(--line), inset 0 -1px 0 var(--line);
    }

.inv-grp-in {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 4px 16px;
}

    .inv-grp-in .gl {
        font-size: 12.5px;
        font-weight: 700;
        color: var(--ink);
    }

        .inv-grp-in .gl .hl {
            color: var(--brand-deep);
        }

    .inv-grp-in .gr {
        display: flex;
        flex-wrap: wrap;
        gap: 4px 14px;
        font-size: 12px;
        color: var(--ink-soft);     /* ⛔ --ink-mute: trên dải nhóm đậm hơn nó chỉ còn ~2:1, khó đọc */
        font-weight: 500;
    }

        .inv-grp-in .gr b {
            font-family: var(--rpt-font-mono);
            color: var(--ink);
            font-weight: 700;
        }

/* Nội dung ô */
.inv-code {
    font-family: var(--rpt-font-mono);
    font-size: 12.5px;
    font-weight: 700;
    color: var(--ink);
    white-space: nowrap;
    letter-spacing: .01em;
}

.inv-time {
    display: block;
    margin-top: 2px;
    font-family: var(--rpt-font-mono);
    font-size: 11px;
    color: var(--ink-mute);
    white-space: nowrap;
}

.inv-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--ink);
}

.inv-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 3px 8px;
    margin-top: 3px;
    font-size: 11.5px;
    color: var(--ink-mute);
}

    .inv-meta b {
        color: var(--ink-soft);
        font-weight: 600;
    }

.inv-clip {
    display: block;
    max-width: 340px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--ink-soft);
    font-size: 12px;
}

.inv-tags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 5px;
}

.inv-route-arrow {
    color: var(--ink-mute);
    font-weight: 700;
}

.inv-pos {
    color: var(--success-deep) !important;
}

.inv-neg {
    color: var(--danger-deep) !important;
}

.inv-mute {
    color: var(--ink-mute) !important;
}

.inv-over {
    color: var(--purple-deep) !important;
}

.inv-warn {
    color: var(--warn-deep) !important;
}

.inv-strike {
    text-decoration: line-through;
    color: var(--ink-mute) !important;
}

.inv-m-only {
    display: none;
}

.inv-mt {
    margin-top: 12px;
}

.inv-full {
    width: 100%;
}

/* ═════════ NHÃN (kho · NCC · loại phiếu · danh mục) ═════════ */
.inv-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    max-width: 100%;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 11.5px;
    font-weight: 600;
    line-height: 1.55;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    background: #f4f1ec;
    color: var(--ink-soft);
}

    .inv-tag.tg-blue {
        background: var(--info-soft);
        color: #2c5aa0;
    }

    .inv-tag.tg-amber {
        background: var(--brand-soft);
        color: var(--brand-deep);
    }

    .inv-tag.tg-rose {
        background: var(--danger-soft);
        color: #a3344a;
    }

    .inv-tag.tg-purple {
        background: var(--purple-soft);
        color: #5a36a8;
    }

    .inv-tag.tg-teal {
        background: var(--teal-soft);
        color: #0b6b67;
    }

    .inv-tag.tg-green {
        background: var(--success-soft);
        color: var(--success-deep);
    }

    .inv-tag.tg-gray {
        background: #f1efe9;
        color: var(--ink-soft);
    }

    .inv-tag.xs {
        font-size: 10px;
        letter-spacing: .04em;
        padding: 1px 6px;
    }

/* ═════════ TRẠNG THÁI (khuôn `.status` của Arrival) ═════════ */
.inv-st {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .02em;
    line-height: 1.5;
    white-space: nowrap;
    background: #f1efe9;
    color: var(--ink-soft);
}

    .inv-st::before {
        content: "";
        width: 6px;
        height: 6px;
        border-radius: 50%;
        background: currentColor;
        flex-shrink: 0;
    }

    .inv-st.inv-st-draft {
        background: #f1efe9;
        color: var(--ink-soft);
    }

    .inv-st.inv-st-confirm {
        background: var(--info-soft);
        color: var(--info-deep);
    }

    .inv-st.inv-st-done {
        background: var(--success-soft);
        color: var(--success-deep);
    }

    .inv-st.inv-st-cancel {
        background: var(--danger-soft);
        color: var(--danger-deep);
    }

    .inv-st.inv-st-open {
        background: var(--warn-soft);
        color: var(--warn-deep);
    }

    .inv-st.inv-st-none {
        background: #f4f1ec;
        color: var(--ink-mute);
    }

    .inv-st.inv-st-purple {
        background: var(--purple-soft);
        color: var(--purple-deep);
    }

/* Nhãn chữ hoa nhỏ bên cạnh tiêu đề trang (NHÁP · ĐÃ NHẬN …). */
.inv-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
    line-height: 1.6;
    white-space: nowrap;
    background: #f1efe9;
    color: var(--ink-soft);
}

    .inv-badge.b-confirm {
        background: var(--info-soft);
        color: var(--info-deep);
    }

    .inv-badge.b-done {
        background: var(--success-soft);
        color: var(--success-deep);
    }

    .inv-badge.b-cancel {
        background: var(--danger-soft);
        color: var(--danger-deep);
    }

    .inv-badge.b-open {
        background: var(--warn-soft);
        color: var(--warn-deep);
    }

/* Huy hiệu mini trong ô số (HẾT · ⚠ · ↑). */
.inv-mini {
    display: inline-block;
    margin-left: 6px;
    padding: 0 6px;
    border-radius: 5px;
    font-family: var(--rpt-font-ui);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .04em;
    line-height: 1.6;
    vertical-align: 1px;
}

    .inv-mini.bad {
        background: var(--danger-soft);
        color: var(--danger-deep);
    }

    .inv-mini.warn {
        background: var(--warn-soft);
        color: var(--warn-deep);
    }

    .inv-mini.over {
        background: var(--purple-soft);
        color: var(--purple-deep);
    }

/* ═════════ TRƯỜNG THÔNG TIN (màn chi tiết) ═════════ */
.inv-fields {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 16px 20px;
}

.inv-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
}

    /* Giá trị CHỈ ĐỌC đứng cạnh ô nhập 38px ⇒ cao bằng ô nhập để chữ nằm ngang hàng giữa ô bên cạnh.
       Chỉ khi lưới có ≥2 cột — điện thoại xếp một cột, cao thêm chỉ sinh khoảng trống. */
    @media (min-width: 640px) {
        .inv-fields .inv-field > .inv-fv {
            min-height: 38px;
        }
    }

.inv-fv {
    font-size: 13.5px;
    color: var(--ink);
    line-height: 1.45;
    min-height: 20px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 8px;
}

    .inv-fv b {
        font-weight: 600;
    }

    .inv-fv .dim {
        color: var(--ink-mute);
        font-style: italic;
    }

.inv-fmeta {
    font-size: 11.5px;
    color: var(--ink-mute);
    line-height: 1.4;
}

    .inv-fmeta b {
        color: var(--ink-soft);
        font-weight: 600;
    }

/* Tuyến chuyển kho: Từ kho → Đến kho. */
.inv-route {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: end;
    gap: 14px;
}

    .inv-route .arrow {
        height: 38px;
        display: grid;
        place-items: center;
        color: var(--brand);
    }

@media (max-width: 639px) {
    .inv-route {
        grid-template-columns: minmax(0, 1fr);
        gap: 8px;
    }

        .inv-route .arrow {
            height: auto;
            transform: rotate(90deg);
            justify-self: center;
        }
}

/* Ô chọn NCC gõ-để-tìm. */
.inv-combo {
    position: relative;
}

.inv-combo-drop {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 60;
    max-height: 300px;
    overflow-y: auto;
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
}

.inv-combo-item {
    padding: 9px 12px;
    font-size: 13px;
    color: var(--ink);
    cursor: pointer;
    box-shadow: inset 0 -1px 0 var(--line);
}

    .inv-combo-item:last-child {
        box-shadow: none;
    }

    .inv-combo-item:hover {
        background: var(--brand-softer);
    }

    .inv-combo-item b {
        font-weight: 600;
    }

    .inv-combo-item .m {
        display: block;
        margin-top: 2px;
        font-size: 11.5px;
        color: var(--ink-mute);
    }

/* ═════════ Ô NHẬP TRONG BẢNG (số lượng · đơn giá · ghi chú dòng) ═════════ */
.inv-in {
    height: 34px;
    width: 100%;
    padding: 0 10px;
    border-radius: 8px;
    border: 1px solid var(--line-strong);
    background: var(--surface);
    color: var(--ink);
    font-size: 13px;
    outline: none;
    transition: border-color .12s, box-shadow .12s;
}

    .inv-in:focus {
        border-color: var(--brand);
        box-shadow: 0 0 0 3px var(--brand-soft);
    }

    .inv-in.num {
        text-align: right;
        font-family: var(--rpt-font-mono);
        font-variant-numeric: tabular-nums;
    }

    .inv-in.req {
        border-color: #efa6b2;
        background: #fff7f8;
    }

    .inv-in.filled {
        border-color: #bfe3cd;
    }

    .inv-in:disabled {
        background: var(--surface-2);
        color: var(--ink-mute);
        cursor: not-allowed;
    }

select.inv-in {
    -webkit-appearance: none;
    appearance: none;
    padding-right: 30px;
    cursor: pointer;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23a39a90' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
}

.inv-qty {
    display: flex;
    align-items: center;
    gap: 6px;
}

    .inv-qty .inv-in {
        flex: 1 1 auto;
        min-width: 0;
    }

    .inv-qty .u {
        font-size: 12px;
        color: var(--ink-mute);
        white-space: nowrap;
    }

.inv-qpill {
    display: inline-block;
    padding: 3px 9px;
    border-radius: 7px;
    background: var(--brand-softer);
    border: 1px solid #f0dcc0;
    color: var(--brand-deep);
    font-family: var(--rpt-font-mono);
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.inv-del {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    border: 1px solid #f3c3cb;
    background: var(--surface);
    color: var(--danger-deep);
    display: inline-grid;
    place-items: center;
    padding: 0;
    cursor: pointer;
    transition: background .12s;
}

    .inv-del:hover {
        background: var(--danger-soft);
    }

/* Dòng "+ thêm" nét đứt ở cuối bảng nhập. */
.inv-addrow {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    height: 40px;
    border: 0;
    border-top: 1px dashed var(--line-strong);
    background: var(--surface);
    color: var(--brand-deep);
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
}

    .inv-addrow:hover {
        background: var(--brand-softer);
    }

/* ═════════ TỔNG TIỀN + THANH NÚT ═════════ */
/* Khoảng cách NGANG đặt bằng padding của cột số, ⛔ bằng column-gap: gap cắt đôi đường kẻ trên dòng Tổng cộng. */
.inv-sum {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: baseline;
    gap: 8px 0;
}

    .inv-sum .l {
        font-size: 13px;
        color: var(--ink-soft);
    }

        .inv-sum .l .t {
            margin-left: 4px;
            font-size: 11px;
            color: var(--ink-mute);
        }

    .inv-sum .v {
        padding-left: 24px;
        text-align: right;
        font-family: var(--rpt-font-mono);
        font-variant-numeric: tabular-nums;
        font-size: 13.5px;
        color: var(--ink);
        white-space: nowrap;
    }

    /* Dòng TỔNG: hai ô giãn trọn chiều cao hàng (stretch) để đường kẻ trên cùng một độ cao — lưới căn
       baseline nên ô chữ to (20px) và ô chữ nhỏ (14px) có mép trên LỆCH nhau, kẻ theo mép ô là đường gãy. */
    .inv-sum .big {
        align-self: stretch;
        display: flex;
        align-items: flex-end;
        padding-top: 10px;
        margin-top: 4px;
        border-top: 1px solid var(--line);
    }

    .inv-sum .v.big {
        justify-content: flex-end;
    }

    .inv-sum .l.big {
        font-size: 14px;
        font-weight: 600;
        color: var(--ink);
    }

    .inv-sum .v.big {
        font-size: 20px;
        font-weight: 700;
    }

.inv-actbar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
}

    .inv-actbar .sp {
        flex: 1 1 auto;
    }

    /* Hàng nút ở CHÂN thẻ tổng (cột phải hẹp): nút chia đều bề rộng, xuống dòng thì mỗi nút trọn hàng.
       Bỏ khoảng đệm `.sp` (ở cột hẹp nó chỉ đẩy nút rời khỏi nhau). */
    .inv-card-foot > .inv-actbar.inv-full > .inv-btn {
        flex: 1 1 auto;
        justify-content: center;
    }

    .inv-card-foot > .inv-actbar.inv-full > .sp {
        display: none;
    }

@media (max-width: 639px) {
    .inv-actbar .inv-btn {
        flex: 1 1 100%;
    }

    .inv-actbar .sp {
        display: none;
    }
}

/* Hai cột: nội dung chính + cột phải (tổng tiền / thao tác). */
.inv-split {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
    align-items: start;
}

@media (min-width: 1100px) {
    .inv-split {
        grid-template-columns: minmax(0, 1fr) minmax(340px, 420px);
        gap: 16px;
    }
}

/* Cột xếp dọc (nhiều thẻ / hộp nhắc chồng nhau trong một ô của .inv-split). */
.inv-stack {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 0;
}

/* Hai nửa bằng nhau (lịch sử nhập | lịch sử thanh toán). */
.inv-halves {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
    align-items: start;
}

@media (min-width: 1100px) {
    .inv-halves {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 16px;
    }
}

/* Dải số liệu ngang (tổng kết kiểm kê). */
.inv-kvs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 32px;
}

.inv-kv {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

    .inv-kv .k {
        font-size: 10px;
        letter-spacing: .12em;
        text-transform: uppercase;
        color: var(--ink-mute);
        font-weight: 700;
    }

    .inv-kv .v {
        font-family: var(--rpt-font-mono);
        font-size: 17px;
        font-weight: 700;
        color: var(--ink);
        white-space: nowrap;
    }

    .inv-kv.push {
        margin-left: auto;
        text-align: right;
    }

/* ═════════ HỘP NHẮC — nền nhạt + viền ĐỦ 4 cạnh cùng tông (khuôn `.rn-cell`), ⛔ vạch trái ═════════ */
.inv-note {
    padding: 10px 14px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    color: var(--ink-soft);
    font-size: 12.5px;
    line-height: 1.6;
}

    .inv-note b {
        color: var(--ink);
        font-weight: 600;
    }

    .inv-note ul {
        margin: 6px 0 0;
        padding-left: 18px;
    }

    .inv-note li + li {
        margin-top: 2px;
    }

    .inv-note.brand {
        background: var(--brand-softer);
        border-color: #eed9b8;
        color: #7a4c16;
    }

        .inv-note.brand b {
            color: var(--brand-deep);
        }

    .inv-note.ok {
        background: var(--success-soft);
        border-color: #bfe3cd;
        color: #1f6b46;
    }

        .inv-note.ok b {
            color: #15573a;
        }

    .inv-note.bad {
        background: var(--danger-soft);
        border-color: #f3c3cb;
        color: #a3344a;
    }

        .inv-note.bad b {
            color: #8a1f33;
        }

    .inv-note.warn {
        background: var(--warn-soft);
        border-color: #f1d2a5;
        color: #8f5618;
    }

        .inv-note.warn b {
            color: #6e3f08;
        }

    /* ⛔ đặt tên `.row` — trùng Bootstrap (xem đầu file). */
    .inv-note.split {
        display: flex;
        align-items: center;
        justify-content: space-between;
        flex-wrap: wrap;
        gap: 6px 16px;
    }

/* ═════════ DANH SÁCH ĐIỀU KIỆN (đóng kỳ) ═════════ */
.inv-check-row {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    box-shadow: inset 0 -1px 0 var(--line);
}

    .inv-check-row:last-child {
        box-shadow: none;
    }

.inv-check-ico {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    font-size: 14px;
    font-weight: 700;
    background: #f1efe9;
    color: var(--ink-soft);
}

.inv-check-row.ck-ok .inv-check-ico {
    background: var(--success-soft);
    color: var(--success-deep);
}

.inv-check-row.ck-warn .inv-check-ico {
    background: var(--warn-soft);
    color: var(--warn-deep);
}

.inv-check-row.ck-block .inv-check-ico {
    background: var(--danger-soft);
    color: var(--danger-deep);
}

/* Việc người vận hành TỰ đánh dấu (sao lưu CSDL…) — tông thông tin, khác xám của dòng chưa rõ trạng thái. */
.inv-check-row.ck-manual .inv-check-ico {
    background: var(--info-soft);
    color: var(--info-deep);
}

.inv-check-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--ink);
}

.inv-check-detail {
    display: block;
    margin-top: 2px;
    font-size: 11.5px;
    font-weight: 500;
    color: var(--ink-mute);
}

.inv-check-side {
    font-size: 12px;
    color: var(--ink-soft);
    white-space: nowrap;
}

.inv-check-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--ink-soft);
    cursor: pointer;
    white-space: nowrap;
}

    .inv-check-toggle input {
        width: 16px;
        height: 16px;
        accent-color: var(--brand);
    }

@media (max-width: 639px) {
    .inv-check-row {
        grid-template-columns: 28px minmax(0, 1fr);
    }

    /* Phần bên phải (chữ trạng thái · NÚT hành động · ô đánh dấu) xuống hàng dưới, thẳng cột chữ.
       Bắt theo VỊ TRÍ (⛔ theo tên lớp): bản đầu chỉ liệt kê .inv-check-side/.inv-check-toggle nên nút
       "Mở phiếu xuất" rơi vào cột icon 28px — bị bóp méo, chữ tràn ra mép trái (đo ở 390px). */
    .inv-check-row > :nth-child(n+3) {
        grid-column: 2;
        justify-self: start;
    }

    .inv-check-side,
    .inv-check-toggle {
        white-space: normal;
    }
}

/* ═════════ TRẠNG THÁI TRỐNG / ĐANG TẢI ═════════ */
.inv-empty {
    padding: 44px 20px;
    text-align: center;
    color: var(--ink-mute);
}

    .inv-empty .t {
        font-family: var(--rpt-font-display);
        font-size: 16px;
        font-weight: 600;
        color: var(--ink);
        margin-bottom: 4px;
    }

    .inv-empty .s {
        font-size: 12.5px;
        line-height: 1.6;
    }

        .inv-empty .s b {
            color: var(--ink-soft);
        }

    .inv-empty .inv-btn {
        margin-top: 14px;
    }

.inv-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 56px 20px;
    color: var(--ink-mute);
    font-size: 13.5px;
}

.inv-spin {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2.5px solid var(--line);
    border-top-color: var(--brand);
    animation: inv-spin .9s linear infinite;
}

@keyframes inv-spin {
    to {
        transform: rotate(360deg);
    }
}

/* ═════════ THÔNG BÁO NỔI ═════════ */
.inv-toast {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 1100;
    max-width: 380px;
    padding: 12px 16px;
    border-radius: 12px;
    border: 1px solid;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.5;
    box-shadow: 0 8px 24px rgba(60,40,20,.16);
    animation: inv-toast-in .2s ease-out;
}

    .inv-toast.ok {
        background: #eef8f1;
        border-color: #bfe3cd;
        color: #1f6b46;
    }

    .inv-toast.err {
        background: #fdf0f2;
        border-color: #f3c3cb;
        color: #a3344a;
    }

@keyframes inv-toast-in {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ═════════ ĐIỆN THOẠI / MÁY TÍNH BẢNG (≤959px — breakpoint layout thật) ═════════
   Bảng `resp` (danh sách) và `form` (dòng nhập) chuyển thành THẺ bằng CSS grid, ⛔ vẽ bản
   thứ hai: một markup, một nguồn dữ liệu — không có chuyện bản điện thoại lặng lẽ thiếu cột.
   Mỗi ô khai vai của nó bằng class `a-*`; ô `a-x` ẩn trên điện thoại. */
@media (max-width: 959px) {
    .inv-toast {
        left: 12px;
        right: 12px;
        max-width: none;
        bottom: calc(76px + env(safe-area-inset-bottom));
    }

    .inv-tbl.resp thead,
    .inv-tbl.form thead {
        display: none;
    }

    .inv-tbl.resp,
    .inv-tbl.resp tbody,
    .inv-tbl.resp tfoot,
    .inv-tbl.form,
    .inv-tbl.form tbody,
    .inv-tbl.form tfoot {
        display: block;
        width: 100%;
    }

        .inv-tbl.resp td,
        .inv-tbl.form td {
            display: block;
            padding: 0 !important;
            box-shadow: none !important;
            min-width: 0;
        }

        /* Danh sách:  số phiếu | trạng thái  /  dòng 1  /  dòng 2  /  phụ | số tiền */
        .inv-tbl.resp tr {
            display: grid;
            grid-template-columns: minmax(0, 1fr) auto;
            grid-template-areas:
                "id st"
                "m1 m1"
                "m2 m2"
                "s1 amt";
            column-gap: 10px;
            row-gap: 4px;
            padding: 12px 14px;
            box-shadow: inset 0 -1px 0 var(--line);
        }

            .inv-tbl.resp tr:last-child {
                box-shadow: none;
            }

        .inv-tbl.resp td.a-id {
            grid-area: id;
        }

        .inv-tbl.resp td.a-st {
            grid-area: st;
            justify-self: end;
            align-self: start;
            text-align: right;
        }

        .inv-tbl.resp td.a-m1 {
            grid-area: m1;
        }

        .inv-tbl.resp td.a-m2 {
            grid-area: m2;
        }

        .inv-tbl.resp td.a-s1 {
            grid-area: s1;
            align-self: center;
            text-align: left !important;
            color: var(--ink-mute);
            font-size: 12px;
        }

        .inv-tbl.resp td.a-amt {
            grid-area: amt;
            justify-self: end;
            align-self: center;
            text-align: right;
        }

        .inv-tbl.resp tr.inv-grp {
            display: block;
            padding: 0;
        }

            .inv-tbl.resp tr.inv-grp > td {
                padding: 8px 14px !important;
                box-shadow: inset 0 -1px 0 var(--line) !important;
            }

        .inv-tbl.resp tfoot tr {
            display: flex;
            justify-content: space-between;
            align-items: center;
            gap: 10px;
            background: var(--surface-2);
        }

        /* Dòng nhập:  tên | ×  /  ô 1 | ô 2 | thành tiền  /  ghi chú */
        .inv-tbl.form tr {
            display: grid;
            grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
            grid-template-areas:
                "id id del"
                "f1 f2 amt"
                "note note note";
            gap: 8px 10px;
            padding: 12px 14px;
            box-shadow: inset 0 -1px 0 var(--line);
        }

            .inv-tbl.form tr:last-child {
                box-shadow: none;
            }

        .inv-tbl.form td.a-id {
            grid-area: id;
        }

        .inv-tbl.form td.a-del {
            grid-area: del;
            justify-self: end;
        }

        .inv-tbl.form td.a-f1 {
            grid-area: f1;
            text-align: left !important;
        }

        .inv-tbl.form td.a-f2 {
            grid-area: f2;
            text-align: left !important;
        }

        .inv-tbl.form td.a-amt {
            grid-area: amt;
            align-self: end;
            text-align: right;
        }

        .inv-tbl.form td.a-note {
            grid-area: note;
        }

        .inv-tbl.form td[data-label]::before {
            content: attr(data-label);
            display: block;
            margin-bottom: 3px;
            font-family: var(--rpt-font-ui);
            font-size: 10px;
            font-weight: 700;
            letter-spacing: .1em;
            text-transform: uppercase;
            color: var(--ink-mute);
        }

        .inv-tbl.form tfoot tr {
            display: flex;
            justify-content: space-between;
        }

    .inv-tbl td.a-x {
        display: none !important;
    }

    .inv-tbl td.inv-m-only {
        display: block;
    }

    .inv-clip {
        max-width: 100%;
    }

    .inv-ctrl.date {
        width: 140px;
    }

    .inv-ctrl.sel {
        min-width: 150px;
    }

    .inv-kv.push {
        margin-left: 0;
        text-align: left;
    }
}

@media (max-width: 639px) {
    .inv-filter {
        gap: 10px 10px;
    }

    .inv-fg.grow {
        flex-basis: 100%;
    }

    .inv-ctrl.date {
        width: 132px;
    }
}

/* ═════════ IN (Ctrl+P từ màn hình) — trang IN chính thức nằm ở các route /print riêng ═════════ */
@media print {
    .inv-page {
        background: #fff;
    }

    .inv-actions,
    .inv-filter,
    .inv-search,
    .inv-toast,
    .inv-nav,
    .inv-btn,
    .inv-del,
    .inv-addrow {
        display: none !important;
    }

    .inv-card,
    .inv-stat {
        box-shadow: none;
        break-inside: auto;
    }

    .inv-stat:hover {
        transform: none;
    }
}
