/* ═══ Grid danh sách quyết toán ═══ */
#grid-quyettoan .grid-table tbody td {
    border-bottom: 1px solid #e2e8f0;
    padding-top: 8px;
    padding-bottom: 8px;
    font-size: 12px;
}
#grid-quyettoan .grid-table tbody tr:nth-child(even) td { background: rgba(248,250,252,.6); }
#grid-quyettoan .grid-table tbody tr:hover td { background: #f8fafc; }
#grid-quyettoan .grid-table tbody tr.ram-highlight-row td {
    background: var(--brand-soft) !important;
    border-top: 1px dashed #81C784 !important;
    border-bottom: 1px dashed #81C784 !important;
}
#grid-quyettoan .grid-table tbody tr.ram-highlight-row td:first-child { border-left: 3px solid #0f9d4f !important; }
#grid-quyettoan .grid-table tbody td.sticky-col,
#grid-quyettoan .grid-table tbody td.col-action { background: #fff; }
#grid-quyettoan .grid-table tbody tr:nth-child(even) td.sticky-col,
#grid-quyettoan .grid-table tbody tr:nth-child(even) td.col-action { background: rgba(248,250,252,.95); }

/* Cột Số QT — key chính, nổi bật */
.qt-sqt-cell {
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.qt-sqt-code {
    font-size: 13px;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -.3px;
    line-height: 1.2;
}
.qt-sqt-date {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 10px;
    font-weight: 500;
    color: #94a3b8;
    line-height: 1;
}
.qt-sqt-date i {
    font-size: 9px;
}

/* Cột tiền */
.qt-grid-money { font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -.2px; }
.qt-grid-thu { color: #15803d; }
.qt-grid-chi { color: #dc2626; }
.qt-grid-thuho { color: #1d4ed8; font-weight: 500; font-size: 11px; }
.qt-grid-chiho { color: #be185d; font-weight: 500; font-size: 11px; }
.qt-grid-profit { font-size: 13px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.3px; }
.qt-grid-profit.positive { color: #047857; }
.qt-grid-profit.negative { color: #dc2626; }

/* ═══ Form shell ═══ */
.qt-form-shell {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0px;
    height: 100%;
    min-height: 0;
}

.qt-loading-overlay {
    position: absolute;
    inset: 0;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(2px);
    color: #64748b;
    font-size: 13px;
}

.qt-loading-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid #e2e8f0;
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: qt-spin .7s linear infinite;
}

.qt-backdrop {
    position: fixed; inset: 0; z-index: 1700;
    background: rgba(15, 23, 42, .45);
    backdrop-filter: blur(6px);
    display: flex; align-items: center; justify-content: center;
    padding: 16px;
    animation: fadeIn .15s cubic-bezier(.22, 1, .36, 1) both;
}

.qt-panel {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 1580px;
    height: calc(100vh - 32px);
    max-height: calc(100vh - 32px);
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 24px 64px rgba(15, 23, 42, .28);
    overflow: hidden;
    animation: dialogPop .15s cubic-bezier(.22, 1, .36, 1) both;
}

.qt-close {
    position: absolute; top: 14px; right: 14px; z-index: 2;
    border: none; background: transparent; color: #94a3b8; cursor: pointer;
    font-size: 16px; padding: 4px 6px; border-radius: 6px;
}
.qt-close:hover { color: #334155; background: #f1f5f9; }

.qt-heading {
    display: flex; align-items: center; gap: 9px;
    padding: 6px 16px; padding-right: 52px;
    flex-shrink: 0;
    background: linear-gradient(180deg, rgba(255,255,255,.95), rgba(240, 249, 244, .95));
    border-bottom: 1px solid rgba(187, 225, 201, .88);
}
.qt-heading-icon {
    width: 28px; height: 28px; border-radius: 8px; flex-shrink: 0;
    background: linear-gradient(135deg, #0f9d4f, #0b8a42); color: #fff;
    display: flex; align-items: center; justify-content: center; font-size: 14px;
    box-shadow: 0 6px 14px rgba(15, 157, 79, .28), 0 2px 6px rgba(15, 157, 79, .16);
}
.qt-heading-title { font-size: 13.5px; font-weight: 800; color: #173824; }

.qt-body {
    flex: 1 1 auto;
    min-height: 0;
    height: auto;
    overflow: hidden;
}

.qt-footer {
    flex: 0 0 auto;
    position: relative;
    z-index: 5;
    user-select: none;
    padding: 8px 14px;
    border-top: 1px solid #eef2f7;
}

/* ── Header/footer thống nhất với dialog cập nhật bố trí xe ── */
.qt-btx-heading {
    padding: 6px 14px;
    margin-bottom: 0;
    border-bottom: 1px solid #eef2f7;
    flex-shrink: 0;
}
.qt-btx-heading .btx-heading-icon {
    background: linear-gradient(135deg, #0f9d4f, #0b8a42);
    box-shadow: 0 3px 8px rgba(15, 157, 79, .32);
}
/* Footer 2 tầng — chiều cao cố định dù danh sách công tắc nhiều hay ít:
   Tầng 1 (.qt-cards-tray): khay thẻ kết quả cuộn ngang full chiều rộng dialog.
   Tầng 2 (.qt-footer-bar): thanh tổng kết trái + nút hành động phải. */
.qt-btx-actions {
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    padding: 6px 12px 7px;
    margin-top: 0;
    gap: 6px;
}
/* Nút footer quyết toán thấp hơn chuẩn 32px — vừa tầm hàng tổng hợp */
.btx-actions.qt-btx-actions .btn {
    height: 28px;
    min-height: 28px;
}

.qt-top-strip {
    display: block;
    padding: 5px 2px;
    overflow: visible;
    flex-shrink: 0;
    position: relative;
    z-index: 10;
    background: #f8fafc;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    animation: qt-strip-in .35s cubic-bezier(.22, 1, .36, 1) both;
}

@keyframes qt-strip-in {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.qt-tab-header {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px;
    width: fit-content;
    max-width: 100%;
    background: rgba(255, 255, 255, .82);
    backdrop-filter: blur(8px);
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    box-shadow: 0 8px 20px rgba(15, 23, 42, .06);
    flex-shrink: 0;
    margin-bottom: 0;
}

.qt-top-fields {
    display: grid;
    grid-template-columns: 230px 155px 250px 180px auto minmax(220px, 1fr);
    gap: 8px;
    align-items: end;
    min-width: 0;
    flex: 1;
}

.qt-field {
    min-width: 0;
}

.qt-tab-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 32px;
    padding: 0 12px;
    border: 0;
    border-radius: 11px;
    background: transparent;
    color: #64748b;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
    transition: all .18s ease;
}

.qt-tab-btn i { font-size: 14px; }

.qt-tab-btn:hover {
    background: #f1f5f9;
    color: #0f172a;
}

.qt-tab-btn.active {
    background: linear-gradient(135deg, var(--qt-accent), color-mix(in srgb, var(--qt-accent) 76%, #ffffff));
    color: #fff;
    box-shadow: 0 8px 18px color-mix(in srgb, var(--qt-accent) 28%, transparent);
}

.qt-tab-count {
    min-width: 21px;
    height: 21px;
    padding: 0 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: rgba(15, 23, 42, .08);
    font-size: 11px;
    font-weight: 900;
}

.qt-tab-btn.active .qt-tab-count {
    background: rgba(255, 255, 255, .22);
    color: #fff;
}

.qt-compact-panel { padding: 8px 10px; }

.qt-sub-filter-panel {
    background: #ffffff;
    border: 1px solid #edf2f7;
    box-shadow: none;
}

.qt-form-grid {
    display: grid;
    grid-template-columns: 220px auto;
    gap: 10px;
    align-items: center;
    justify-content: start;
}

.qt-segment {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 2px;
    border-radius: 10px;
    background: rgba(37, 99, 235, .06);
    border: 0;
    user-select:none;
}

.qt-segment-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-width: 56px;
    height: 30px;
    padding: 0 12px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #64748b;
    font-size: 11.5px;
    font-weight: 700;
    cursor: pointer;
    transition: all .18s ease;
}

.qt-segment-btn i {
    font-size: 12px;
    transition: transform .18s ease;
}

.qt-segment-btn:hover {
    color: #1e40af;
    background: rgba(255, 255, 255, .7);
}

    .qt-segment-btn.active {
        color: #388E3C;
        background: #E8F5E9;
    }

.qt-segment-btn.active i {
    transform: scale(1.1);
}

.qt-form-grid .app-form-group,
.qt-compact-panel .app-form-group,
.qt-top-fields .app-form-group {
    margin-bottom: 0;
}

.qt-top-fields .form-control,
.qt-top-fields .cmbgt-shell,
.qt-top-fields .inputd-shell {
    height: 34px;
    min-height: 34px;
    border-radius: 8px;
    border: 1px solid #93c5fd !important;
    background: #fff !important;
}

.qt-top-fields .inputd-root {
    width: 100% !important;
}

.qt-top-fields .inputd-input {
    height: 32px;
}

.qt-mini-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 5px;
}

.qt-mini-title b {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
}

.qt-lohang-panel {
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    padding: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #ddd6fe;
    background:
        radial-gradient(circle at 0 0, rgba(124, 58, 237, .13), transparent 30%),
        linear-gradient(180deg, #ffffff 0%, #fbfaff 100%);
    box-shadow: 0 18px 38px rgba(88, 28, 135, .10), inset 0 1px 0 rgba(255, 255, 255, .9);
}

.qt-lohang-title {
    flex: 0 0 auto;
    margin: 0;
    padding: 12px 14px;
    border-bottom: 1px solid #ede9fe;
    background: rgba(255, 255, 255, .76);
    backdrop-filter: blur(8px);
    user-select:none;
}

.qt-lohang-title b {
    color: #4c1d95;
    font-size: 14px;
    letter-spacing: -.01em;
}

.qt-lohang-title b i {
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 11px;
    color: #fff;
    background: linear-gradient(135deg, #7c3aed, #2563eb);
    box-shadow: 0 10px 18px rgba(124, 58, 237, .25);
}

.qt-lohang-title span {
    color: #64748b;
    font-size: 12px;
    font-weight: 700;
}

.qt-lohang-scroll {
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    overflow: auto;
    background: #fff;
}

.qt-lohang-table {
    width: 100%;
    min-width: 1380px;
    table-layout: fixed;
    margin-bottom: 0;
}

.qt-lohang-table thead th {
    position: sticky;
    top: 0;
    z-index: 3;
    height: 34px;
    padding: 0 6px !important;
    color: #475569;
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    border-bottom: 1px solid #cbd5e1;
    border-right: 1px solid #e2e8f0;
    font-size: 10.5px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .04em;
    white-space: nowrap;
}

.qt-lohang-table tbody td {
    height: auto;
    padding: 4px 6px !important;
    border-bottom: 1px solid #eef2f7;
    border-right: 1px solid #f1f5f9;
    color: #334155;
    font-size: 11.5px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: normal;
    line-height: 1.3;
}

.qt-lohang-table thead th:last-child,
.qt-lohang-table tbody td:last-child {
    border-right: 0;
    text-align: center;
}

.qt-lohang-table tbody tr {
    transition: background-color .14s ease, box-shadow .14s ease;
}

.qt-lohang-table tbody tr:nth-child(even) {
    background: #fcfdff;
}

.qt-lohang-table tbody tr:hover {
    background: #f5f3ff;
    box-shadow: inset 4px 0 0 #7c3aed;
}

.qt-lohang-table thead th:nth-child(1) { width: 44px; text-align: center; }
.qt-lohang-table thead th:nth-child(2) { width: 120px; }
.qt-lohang-table thead th:nth-child(3) { width: 260px; }
.qt-lohang-table thead th:nth-child(4) { width: 70px; text-align: right; }
.qt-lohang-table thead th:nth-child(5) { width: 110px; text-align: center; }
.qt-lohang-table thead th:nth-child(6) { width: 155px; }
.qt-lohang-table thead th:nth-child(7) { width: 140px; }
.qt-lohang-table thead th:nth-child(8) { width: 200px; }
.qt-lohang-table thead th:nth-child(9) { width: 100px; }
.qt-lohang-table thead th:nth-child(10) { width: 125px; }
.qt-lohang-table thead th:nth-child(11) { width: 44px; }

.qt-cell-stack {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
    line-height: 1.25;
}

.qt-cell-stack span {
    display: block;
    min-width: 0;
    white-space: normal;
    word-break: break-word;
}

.qt-cell-stack i {
    margin-right: 3px;
    color: #64748b;
    font-size: 9px;
}

.qt-center-stack {
    align-items: center;
    text-align: center;
}

.qt-num-cell {
    text-align: right;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    color: #0f172a !important;
}

.qt-row-index {
    width: 22px;
    height: 22px;
    margin: 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #f1f5f9;
    color: #475569;
    font-size: 10px;
    font-weight: 900;
}

.qt-lohang-xe {
    font-weight: 900;
    color: #0f172a;
}

.qt-main-text {
    color: #0f172a;
    font-weight: 700;
}

.qt-note-text {
    padding-left: 7px;
    border-left: 2px solid #d1d5db;
    color: #6b7280;
    font-style: italic;
}

.qt-driver-text {
    color: #303f9f;
    font-weight: 700;
}

.qt-seal-text {
    color: #5d4037;
}

.qt-deadline-text {
    color: #880e4f;
}

.qt-procedure-text {
    color: #6a1b9a;
}

.qt-real-time {
    color: #166534;
    font-weight: 800;
}

.qt-lohang-delete {
    width: 26px;
    height: 26px;
    padding: 0;
    border-radius: 8px;
    opacity: .45;
    transition: all .14s ease;
}

.qt-lohang-table tbody tr:hover .qt-lohang-delete,
.qt-lohang-delete:focus-visible {
    opacity: 1;
    transform: scale(1.03);
}

.qt-compact-table.table > :not(caption) > * > * {
    padding: 4px 6px;
    vertical-align: middle;
}

.qt-money-grid {
    display: grid;
    grid-template-rows: minmax(0, 1fr) minmax(0, 1fr);
    gap: 0px;
    min-height: 0;
    flex: 1 1 auto;
    height: auto;
}

.qt-money-panel {
    min-height: 0;
    display: flex;
    flex-direction: column;
    border-radius: 0px;
    overflow: hidden;
}

.qt-money-panel:hover {
    box-shadow: none;
}

.qt-money-panel-thu {
    border: 1px solid #c8e6c9;
    background: #fff;
    padding: 0px;
}

.qt-money-panel-chi {
    border: 1px solid #ffcdd2;
    background: #fff;
    padding: 0px;
}

.qt-table-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    border: 0;
    background: #fff;
}

.qt-table-scroll .qt-compact-table {
    width: 100%;
    table-layout: fixed;
    margin-bottom: 0;
}

    .qt-table-scroll thead th {
        position: sticky;
        top: 0;
        z-index: 2;
        height: 28px;
        padding: 0 8px !important;
        color: #fff;
        font-size: 10.5px;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: .04em;
        white-space: nowrap;
        border-right: 1px solid rgba(0, 0, 0, .10);
        border-bottom: 0 !important;
    }

.qt-money-panel-thu .qt-table-scroll thead th {
    background: #f0fdf4;
    color: #15803d;
    border-bottom: 1px solid #bbf7d0 !important;
    box-shadow: none;
}
.qt-money-panel-thu .qt-table-scroll thead th:first-child {
    color: #15803d;
    font-weight: 800;
    font-size: 11px;
}
    .qt-money-panel-thu .qt-table-scroll thead th:nth-child(1),
    .qt-money-panel-chi .qt-table-scroll thead th:nth-child(1) {
        text-align: left;
    }
    .qt-money-panel-thu .qt-table-scroll thead th i,
    .qt-money-panel-chi .qt-table-scroll thead th i{
       margin-right:5px;
    }

    .qt-money-panel-chi .qt-table-scroll thead th {
        background: #fff1f2;
        color: #e11d48;
        border-bottom: 1px solid #fecdd3 !important;
        box-shadow: none;
    }
.qt-money-panel-chi .qt-table-scroll thead th:first-child {
    color: #e11d48;
    font-weight: 800;
    font-size: 11px;
}

.qt-table-scroll thead th:last-child,
.qt-flat-table tbody td:last-child {
    border-right: 0;
}

.qt-flat-table td:nth-child(3) input {
    font-weight: 700 !important;
    font-variant-numeric: tabular-nums;
    color: #1e40af !important;
}
.qt-flat-table td:nth-child(4) input {
    font-weight: 700 !important;
    font-variant-numeric: tabular-nums;
}
.qt-th-count {
    display: inline-flex;
    margin-top: -2px;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    margin-left: 5px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .2);
    font-size: 10px;
    font-weight: 900;
    line-height: 1;
    vertical-align: middle;
    color: rgba(255,255,255,.9);
}

.qt-money-panel-thu .qt-th-count { background: rgba(21, 128, 61, .12); color: #15803d; }
.qt-money-panel-chi .qt-th-count { background: rgba(225, 29, 72, .12); color: #e11d48; }

.qt-table-scroll .col-resize-handle:hover,
.qt-table-scroll .col-resize-handle.active {
    background: rgba(15, 23, 42, .15);
}

.qt-flat-table tbody td:nth-child(3) {
    text-align: right;
}

.qt-flat-table tbody td:nth-child(3) .inputn-root,
.qt-flat-table tbody td:nth-child(3) .inputn-shell {
    width: 100%;
}

.qt-flat-table tbody td:nth-child(3) .inputn-input {
    text-align: right;
    padding-right: 18px;
    font-variant-numeric: tabular-nums;
}

/* Ô Thành tiền / Tổng tiền (readonly, tính toán tự động) */
.qt-flat-table tbody td.qt-money-cell {
    text-align: right;
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    color: #475569;
    padding-right: 8px !important;
    white-space: nowrap;
}
.qt-flat-table tbody td.qt-money-cell-total {
    color: #0f172a;
    font-weight: 800;
}

/* ═══ Cột chỉ đọc (Khoản, Thành tiền, Tổng tiền) — nền xám nhạt để phân biệt với ô nhập ═══ */
.qt-flat-table tbody td.qt-ro-col {
    background: #f1f5f9;
}
.qt-flat-table tbody tr:hover td.qt-ro-col,
.qt-flat-table tbody td.qt-ro-col:focus-within {
    background: #f1f5f9;
}

/* Ô VAT (input) — tím đậm, căn giữa */
.qt-flat-table td:nth-child(6) .inputn-input {
    color: #7c3aed !important;
    font-weight: 700 !important;
    text-align: center;
}

.qt-flat-table.table > tbody > tr > td {
    border-bottom: 1px dashed #d1d5db;
    border-right: 1px dashed #e5e7eb;
}

.qt-flat-table tbody tr {
    transition: background-color .08s ease;
}

.qt-flat-table tbody tr:nth-child(even) {
    background: transparent;
}

.qt-flat-table tbody tr:hover {
    background: transparent;
}

/* Highlight ô đang focus edit — nền nhạt, không glow */
.qt-flat-table tbody td:focus-within {
    background: #eff6ff !important;
}
.qt-flat-table tbody td:focus-within .form-control,
.qt-flat-table tbody td:focus-within .inputn-shell,
.qt-flat-table tbody td:focus-within .inputn-root,
.qt-flat-table tbody td:focus-within .inputd-shell {
    background: transparent !important;
}

.qt-flat-table tbody td {
    overflow: visible;
    font-size: 11px;
    color: #334155;
    vertical-align: middle;
    padding: 0 !important;
    height: auto;
    min-height: 24px;
    line-height: 1.25;
}

.qt-flat-table .form-control,
.qt-flat-table .inputn-input {
    height: 22px !important;
    min-height: 22px !important;
    padding: 0 6px !important;
    font-size: 11px !important;
    padding-right: 16px !important;
}
.qt-flat-table .inputn-shell.no-spin .inputn-icon-btn.clear {
    right: 0px;
    font-size: 9px;
    width: 14px !important;
}

.qt-flat-table .cmbgt-shell {
    height: auto !important;
    min-height: 22px;
}

.qt-flat-table .cmbgt-shell-main {
    padding: 0 0 0 4px !important;
}

.qt-flat-table .cmbgt-shell-label {
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
    word-break: break-word;
    line-height: 1.25;
    font-size: 11px;
}

.qt-flat-table .cmbgt-icon-btn {
    width: 20px !important;
    min-width: 20px !important;
    height: 22px !important;
}

.qt-flat-table .inputd-shell {
    height: 22px !important;
    min-height: 22px !important;
}

.qt-flat-table .inputd-input {
    height: 20px !important;
    font-size: 11px !important;
    padding-right: 20px !important;
}

.qt-flat-table .inputd-icon-btn {
    width: 20px !important;
    min-width: 20px !important;
    height: 22px !important;
}

.qt-flat-table .inputn-shell {
    height: 22px !important;
    min-height: 22px !important;
}

.qt-flat-table .form-control,
.qt-flat-table .cmbgt-shell,
.qt-flat-table .inputn-shell,
.qt-flat-table .inputd-shell {
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    border-radius: 2px !important;
    transition: background .12s ease;
}

.qt-flat-table tbody tr:hover .form-control,
.qt-flat-table tbody tr:hover .cmbgt-shell,
.qt-flat-table tbody tr:hover .inputn-shell,
.qt-flat-table tbody tr:hover .inputd-shell {
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

.qt-flat-table .form-control:focus,
.qt-flat-table .cmbgt-shell:focus-within,
.qt-flat-table .inputn-shell:focus-within,
.qt-flat-table .inputd-shell:focus-within {
    border: 0 !important;
    background: #eff6ff !important;
    box-shadow: none !important;
    outline: none !important;
    border-radius: 2px !important;
}

/* inputD clear: ẩn mặc định, hiện khi hover */
.qt-flat-table .inputd-icon-btn.clear {
    opacity: 0;
    pointer-events: none;
    transition: opacity .12s ease;
}
.qt-flat-table .inputd-shell:hover .inputd-icon-btn.clear,
.qt-flat-table .inputd-shell:focus-within .inputd-icon-btn.clear {
    opacity: 1;
    pointer-events: auto;
}

.qt-check-cell {
    text-align: center;
    width: 48px;
}

.qt-check-only {
    justify-content: center;
    margin: 0;
    padding: 0 !important;
    background: transparent !important;
    border: 0 !important;
    cursor: pointer;
}

.qt-check-only .app-check-box {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    border: 2px solid #cbd5e1;
    background: #fff;
    box-shadow: none;
    transition: all .15s ease;
}

.qt-check-only:hover .app-check-box {
    border-color: #93c5fd;
    background: #eff6ff;
}

.qt-check-only input:checked + .app-check-box {
    background: #eff6ff;
    border-color: var(--brand, #0f9d4f);
    color: var(--brand, #0f9d4f);
    box-shadow: 0 0 0 3px rgba(15, 157, 79, .12);
}

.qt-check-only .app-check-box i {
    font-size: 12px;
}

.qt-check-only .app-check-text {
    display: none;
}

.qt-action-th {
    width: 42px;
    text-align: center;
}

.qt-row-action {
    width: 42px;
    text-align: center;
}

.qt-file-cell {
    width: 48px;
    text-align: center;
}

.qt-file-btn {
    min-width: 32px;
    height: 24px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    color: #64748b;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: 14px;
    font-weight: 900;
    transition: all .15s ease;
    cursor:pointer;
}

.qt-file-btn:hover,
.qt-file-btn.has-file {
    color: #2563eb;
    border-color: #93c5fd;
    background: #eff6ff;
    box-shadow: 0 1px 3px rgba(37, 99, 235, .12);
}

.qt-file-btn span {
    min-width: 18px;
    height: 18px;
    border-radius: 999px;
    background: #2563eb;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
}

.qt-delete-row-btn {
    opacity: 0;
    transform: scale(.92);
    transition: all .14s ease;
}

.qt-flat-table tbody tr:hover .qt-delete-row-btn,
.qt-delete-row-btn:focus-visible {
    opacity: 1;
    transform: scale(1);
}

.qt-add-row-btn {
    min-width: 28px;
    height: 26px;
    padding: 0 7px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.qt-add-row-btn-mini {
    width: 22px;
    height: 22px;
    padding: 0;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #fff;
    color: #64748b;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all .15s ease;
}

.qt-add-row-btn-mini:hover {
    border-color: var(--brand, #0f9d4f);
    color: var(--brand, #0f9d4f);
    background: rgba(15, 157, 79, .06);
}

.qt-dialog-footer {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

/* ── Tầng 1: KHAY thẻ công tắc — khung nền riêng nên ít thẻ vẫn không trống trải, 1 hàng cuộn ngang ── */
.qt-cards-tray {
    position: relative;
    width: 100%;
    min-width: 0;
    background: linear-gradient(180deg, #fbfdff 0%, #f4f7fb 100%);
    border: 1px solid #e5eaf1;
    border-radius: 10px;
    padding: 4px 5px 5px;
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, .04);
}

/* Fade mép phải — gợi ý còn thẻ cuộn tiếp mà không cần nhìn scrollbar */
.qt-cards-tray::after {
    content: "";
    position: absolute;
    top: 2px;
    bottom: 2px;
    right: 2px;
    width: 26px;
    border-radius: 0 9px 9px 0;
    background: linear-gradient(90deg, transparent, rgba(244, 247, 251, .92));
    pointer-events: none;
}

.qt-summary-cards {
    display: flex;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 5px;
    width: 100%;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0 1px 4px;
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

/* Scrollbar mỏng — affordance cho biết còn thẻ cuộn được, không làm tăng chiều cao footer */
.qt-summary-cards::-webkit-scrollbar { height: 4px; }
.qt-summary-cards::-webkit-scrollbar-track { background: transparent; }
.qt-summary-cards::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 99px; }
.qt-summary-cards::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

.qt-summary-card {
    flex: 0 0 auto;
    width: 152px;
    padding: 4px 7px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 5px;
    border: 1px solid #fecdd3;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .05);
}

.qt-sc-icon {
    width: 21px;
    height: 21px;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    flex-shrink: 0;
}

.qt-sc-body {
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
}

.qt-sc-body span {
    font-size: 8.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .03em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}

.qt-sc-body b {
    font-size: 12px;
    font-weight: 900;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    line-height: 1.15;
}

.qt-summary-card.is-thu { background: #f0fdf4; }
.qt-summary-card.is-thu .qt-sc-icon { background: #bbf7d0; color: #15803d; }
.qt-summary-card.is-thu .qt-sc-body span { color: #16a34a; }
.qt-summary-card.is-thu .qt-sc-body b { color: #15803d; }

.qt-summary-card.is-chi { background: #fff1f2; }
.qt-summary-card.is-chi .qt-sc-icon { background: #fecdd3; color: #e11d48; }
.qt-summary-card.is-chi .qt-sc-body span { color: #f43f5e; }
.qt-summary-card.is-chi .qt-sc-body b { color: #e11d48; }

.qt-summary-card.is-thuho { background: #eff6ff; }
.qt-summary-card.is-thuho .qt-sc-icon { background: #bfdbfe; color: #1d4ed8; }
.qt-summary-card.is-thuho .qt-sc-body span { color: #3b82f6; }
.qt-summary-card.is-thuho .qt-sc-body b { color: #1d4ed8; }

.qt-summary-card.is-chiho { background: #fdf2f8; }
.qt-summary-card.is-chiho .qt-sc-icon { background: #fbcfe8; color: #be185d; }
.qt-summary-card.is-chiho .qt-sc-body span { color: #ec4899; }
.qt-summary-card.is-chiho .qt-sc-body b { color: #be185d; }

.qt-summary-card.is-profit.positive { background: #ecfdf5; }
.qt-summary-card.is-profit.positive .qt-sc-icon { background: #a7f3d0; color: #047857; }
.qt-summary-card.is-profit.positive .qt-sc-body span { color: #059669; }
.qt-summary-card.is-profit.positive .qt-sc-body b { color: #047857; font-size: 12.5px; }
.qt-summary-card.is-profit.negative { background: #fef2f2; }
.qt-summary-card.is-profit.negative .qt-sc-icon { background: #fecaca; color: #dc2626; }
.qt-summary-card.is-profit.negative .qt-sc-body span { color: #ef4444; }
.qt-summary-card.is-profit.negative .qt-sc-body b { color: #dc2626; font-size: 12.5px; }

/* ── Công tắc gạt Tính/Bỏ trên thẻ kết quả quyết toán (quyền: quyettoan.congtac.edit) ── */
.qt-tinh-switch {
    margin-left: auto;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 0;
    padding: 1px 2px;
    border: 0;
    background: transparent;
    cursor: pointer;
    line-height: 1;
    border-radius: 6px;
    transition: background .15s;
}

.qt-tinh-switch:not(.is-locked):hover { background: #f1f5f9; }

.qt-tinh-track {
    position: relative;
    width: 28px;
    height: 16px;
    flex: 0 0 auto;
    box-sizing: border-box;
    border-radius: 999px;
    background: #cbd5e1;
    border: 1px solid #b6c2d1;
    box-shadow: inset 0 1px 3px rgba(15, 23, 42, .18);
    transition: background .2s ease, border-color .2s ease, box-shadow .2s ease, transform .12s ease;
}

.qt-tinh-switch:not(.is-locked):active .qt-tinh-track { transform: scale(.95); }

.qt-tinh-knob {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(15, 23, 42, .35);
    transition: transform .2s cubic-bezier(.4, 0, .2, 1);
}

.qt-tinh-knob i {
    font-size: 8px;
    font-weight: 800;
    color: #16a34a;
    line-height: 1;
    opacity: 0;
    transform: scale(.4);
    transition: opacity .18s ease, transform .18s ease;
}

.qt-tinh-switch.is-on .qt-tinh-track {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    border-color: #15803d;
    box-shadow: inset 0 1px 3px rgba(5, 46, 22, .25), 0 0 0 2px rgba(34, 197, 94, .16);
}

.qt-tinh-switch.is-on .qt-tinh-knob { transform: translateX(12px); }
.qt-tinh-switch.is-on .qt-tinh-knob i { opacity: 1; transform: scale(1); }

.qt-tinh-switch.is-locked { cursor: not-allowed; }
.qt-tinh-switch.is-locked .qt-tinh-track { filter: grayscale(.35); opacity: .72; }
.qt-tinh-switch:focus-visible { outline: 2px solid #3b82f6; outline-offset: 2px; }

/* Dòng ẨN công tắc (HienThiCongTac=false) — hiển thị ổ khóa nhỏ thay cho công tắc */
.qt-tinh-fixed {
    margin-left: auto;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 21px;
    height: 21px;
    border-radius: 5px;
    color: #64748b;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    font-size: 11px;
    cursor: default;
}

/* Thẻ đang "Bỏ" — xỉn màu, giá trị hiển thị "-" (đặt sau các zone để ghi màu nền) */
.qt-summary-card.is-off {
    background: #f8fafc;
    border-color: #e2e8f0;
}

.qt-summary-card.is-off .qt-sc-icon { background: #e2e8f0; color: #94a3b8; }
.qt-summary-card.is-off .qt-sc-body span { color: #94a3b8; }
.qt-summary-card.is-off .qt-sc-body b { color: #94a3b8; }

/* Vạch ngăn cách khi đổi nhóm trên hàng cuộn (Thu │ Chi │ Lãi/Lỗ) */
.qt-sc-zone-sep {
    flex: 0 0 auto;
    width: 1px;
    align-self: stretch;
    margin: 3px 2px;
    background: repeating-linear-gradient(180deg, #cbd5e1 0 3px, transparent 3px 6px);
}

/* ── Tầng 2: thanh Tổng kết — khối nền riêng, phân biệt rõ với khay thẻ bên trên ──
   Khối tổng hợp mới thêm về sau cứ chèn vào .qt-tonghop — hàng này tự giãn, tầng thẻ không đổi. */
.qt-footer-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    min-width: 0;
    padding: 5px 8px;
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid #e5eaf1;
    border-radius: 10px;
}

/* Nhãn "Tổng kết" — định danh khối số liệu, lấp góc trái cho cân đối */
.qt-th-title {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 9px 4px 3px;
    margin-right: 2px;
    border-right: 1px solid #dbe3ec;
    font-size: 9.5px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: #64748b;
    white-space: nowrap;
    line-height: 1;
}

.qt-th-title i { font-size: 13px; color: #334155; }

.qt-tonghop {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
    min-width: 0;
}

.qt-th-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 9px;
    border-radius: 7px;
    border: 1px solid;
    font-size: 10px;
    font-weight: 700;
    white-space: nowrap;
    line-height: 1;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .05);
}

.qt-th-chip i { font-size: 12px; }
.qt-th-chip b { font-size: 12px; font-weight: 900; font-variant-numeric: tabular-nums; }

.qt-th-chip.thu { background: #f0fdf4; border-color: #bbf7d0; color: #15803d; }
.qt-th-chip.chi { background: #fff1f2; border-color: #fecdd3; color: #e11d48; }
.qt-th-chip.lai.pos { background: #ecfdf5; border-color: #a7f3d0; color: #047857; }
.qt-th-chip.lai.neg { background: #fef2f2; border-color: #fecaca; color: #dc2626; }

/* Nhóm nút Đóng / Copy QT — ghim ngoài cùng bên phải */
.qt-footer-btns {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.qt-footer-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.qt-footer-actions .btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 34px;
    padding-top: 0;
    padding-bottom: 0;
}

.qt-file-dialog {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.qt-file-upload {
    position: relative;
    min-height: 56px;
    border: 1px dashed #cbd5e1;
    border-radius: 10px;
    background: #f8fafc;
    color: #64748b;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 700;
    font-size: 12px;
    transition: border-color .15s ease, color .15s ease;
}

.qt-file-upload:hover {
    border-color: #93c5fd;
    color: #2563eb;
}

.qt-file-upload input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.qt-file-upload i { font-size: 18px; }

.qt-file-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 360px;
    overflow: auto;
}

.qt-file-empty {
    padding: 24px;
    color: #94a3b8;
    text-align: center;
    font-size: 12px;
}

.qt-file-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-bottom: 1px solid #e2e8f0;
    background: transparent;
    transition: background .12s ease;
}

.qt-file-item:last-child { border-bottom: 0; }

.qt-file-item:hover { background: #f8fafc; }

.qt-file-item > i {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: #f1f5f9;
    color: #475569;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    flex-shrink: 0;
}

.qt-file-item > div:first-of-type {
    flex: 1;
    min-width: 0;
}

.qt-file-item b {
    display: block;
    font-size: 12px;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #0f172a;
}

.qt-file-item span {
    display: block;
    font-size: 10px;
    color: #94a3b8;
}

.qt-file-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.qt-file-actions .btn {
    width: 26px;
    height: 26px;
    min-width: 26px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    font-size: 12px;
}

.qt-file-footer { display: flex; justify-content: flex-end; padding-top: 4px; }

/* Preview loading */
.qt-preview-loading {
    position: absolute;
    inset: 0;
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    background: rgba(255, 255, 255, .9);
}

.qt-preview-loading span {
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
    animation: qt-pulse 1.5s ease-in-out infinite;
}

.qt-preview-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid #e2e8f0;
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: qt-spin .7s linear infinite;
}

@keyframes qt-spin {
    to { transform: rotate(360deg); }
}

@keyframes qt-pulse {
    0%, 100% { opacity: .5; }
    50% { opacity: 1; }
}

.qt-compact-table .cmbgt-shell,
.qt-compact-table .form-control,
.qt-form-grid .cmbgt-shell,
.qt-form-grid .form-control {
    min-height: 28px;
}

/* ═══ Ô đơn giá có gợi ý giá mặc định (chưa áp dụng) ═══ */
.qt-dongia-wrap {
    position: relative;
    display: flex;
    align-items: center;
}
.qt-dongia-wrap .inputn-root {
    flex: 1 1 auto;
    min-width: 0;
}
.qt-apply-gia {
    position: absolute;
    right: 2px;
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    padding: 0;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: #d97706;
    font-size: 12px;
    line-height: 1;
    cursor: pointer;
    z-index: 1; /* < z-index:2 của thead sticky → không đè lên header khi cuộn */
    transition: color .12s ease, transform .12s ease;
}
.qt-apply-gia:hover {
    color: #b45309;
    transform: translateY(-50%) scale(1.2);
}
.qt-dongia-cell.has-suggestion .inputn-shell {
    border-color: #fcd34d;
    background-color: #fffbeb;
}
.qt-dongia-cell.has-suggestion input {
    color: #b45309;
    font-style: italic;
    /* !important để thắng padding-right:16px của .qt-flat-table .inputn-input; chừa chỗ nút ⚡ (2px→18px) */
    padding-right: 24px !important;
}

/* ═══ Tooltip hiện đại (giao diện sáng, compact) cho nút ⚡ áp dụng giá gợi ý ═══ */
.smart-tooltip.smart-tooltip--rich {
    max-width: min(300px, calc(100vw - 24px)) !important;
    padding: 0 !important;
    background: #ffffff !important;
    color: #1e293b !important;
    text-align: left !important;
    font-size: 12px !important;
    font-weight: 400 !important;
    line-height: 1.4 !important;
    border: 1px solid rgba(15, 23, 42, .08) !important;
    border-radius: 12px !important;
    box-shadow: 0 16px 40px rgba(15, 23, 42, .20), 0 4px 12px rgba(15, 23, 42, .10) !important;
}
.smart-tooltip.smart-tooltip--rich::after {
    background: #ffffff !important;
    border: 0 !important;
    box-shadow: none !important;
}

.qt-giatip { display: flex; flex-direction: column; min-width: 220px; }

.qt-giatip-head {
    display: flex; align-items: center; gap: 8px;
    padding: 9px 12px 8px;
    border-bottom: 1px solid #f1f5f9;
    background: linear-gradient(135deg, #fffbeb 0%, #fff7ed 100%);
    border-radius: 12px 12px 0 0;
}
.qt-giatip-ico {
    display: inline-flex; align-items: center; justify-content: center;
    width: 26px; height: 26px; flex: 0 0 auto;
    border-radius: 7px;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #fff; font-size: 13px;
    box-shadow: 0 3px 8px rgba(245, 158, 11, .35);
}
.qt-giatip-head-main { display: flex; flex-direction: column; min-width: 0; }
.qt-giatip-title { font-size: 10px; font-weight: 700; letter-spacing: .2px; color: #92400e; text-transform: uppercase; line-height: 1.2; }
.qt-giatip-price { font-size: 16px; font-weight: 800; color: #1f2937; line-height: 1.15; font-variant-numeric: tabular-nums; }

.qt-giatip-body { display: flex; flex-direction: column; padding: 5px 12px; }
.qt-giatip-row {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: 3px 0;
}
.qt-giatip-row + .qt-giatip-row { border-top: 1px dashed #eef2f7; }
.qt-giatip-label {
    flex: 0 0 auto; display: inline-flex; align-items: center; gap: 5px;
    font-size: 11px; color: #94a3b8; font-weight: 600;
}
.qt-giatip-label i { font-size: 12px; color: #cbd5e1; }
.qt-giatip-val { font-size: 12px; color: #334155; font-weight: 600; text-align: right; word-break: break-word; }

.qt-giatip-note {
    margin: 2px 12px 8px;
    padding: 6px 8px;
    background: #f8fafc;
    border: 1px solid #eef2f7;
    border-radius: 8px;
    display: flex; flex-direction: column; gap: 2px;
}
.qt-giatip-note-label {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 10px; color: #94a3b8; font-weight: 700; text-transform: uppercase; letter-spacing: .3px;
}
.qt-giatip-note-label i { font-size: 11px; color: #cbd5e1; }
.qt-giatip-note-text { font-size: 11.5px; color: #475569; line-height: 1.4; }

.qt-giatip-foot {
    display: flex; align-items: center; justify-content: center; gap: 5px;
    padding: 6px 12px;
    border-top: 1px solid #f1f5f9;
    font-size: 11px; font-weight: 700; color: #b45309;
    background: #fffbeb;
    border-radius: 0 0 12px 12px;
}

/* ═══ Tooltip phân rã quyết toán (cột "Quyết toán" trang Bố trí xe) ═══ */
.qt-tip { display: flex; flex-direction: column; min-width: 288px; max-width: 380px; }
/* Nới cap của khung tooltip .smart-tooltip--rich riêng cho tooltip thu/chi (.qt-tip) để nó rộng hơn. */
.smart-tooltip.smart-tooltip--rich:has(.qt-tip) {
    max-width: min(400px, calc(100vw - 24px)) !important;
}
/* ── Ghi chú quyền trên tooltip công tắc gạt (hiển thị dưới khối phân rã .qt-tip) ── */
.qt-switchtip-note {
    display: flex; align-items: center; gap: 6px;
    margin-top: 4px;
    padding: 7px 12px;
    border: 1px dashed #fde68a;
    border-radius: 10px;
    background: #fffbeb;
    font-size: 11px; font-weight: 600; color: #b45309;
}
.qt-switchtip-note i { font-size: 12px; }
.qt-tip-head {
    display: flex; align-items: center; gap: 8px;
    padding: 9px 12px 8px;
    border-bottom: 1px solid #f1f5f9;
    border-radius: 12px 12px 0 0;
}
.qt-tip-head.thu { background: linear-gradient(135deg, #ecfdf5 0%, #f0fdfa 100%); }
.qt-tip-head.chi { background: linear-gradient(135deg, #fef2f2 0%, #fff7ed 100%); }
.qt-tip-head.lai { background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%); }
.qt-tip-ico {
    display: inline-flex; align-items: center; justify-content: center;
    width: 26px; height: 26px; flex: 0 0 auto;
    border-radius: 7px; color: #fff; font-size: 13px;
}
.qt-tip-ico.thu { background: linear-gradient(135deg, #14b8a6, #0d9488); box-shadow: 0 3px 8px rgba(13, 148, 136, .35); }
.qt-tip-ico.chi { background: linear-gradient(135deg, #f87171, #dc2626); box-shadow: 0 3px 8px rgba(220, 38, 38, .35); }
.qt-tip-ico.lai { background: linear-gradient(135deg, #34d399, #16a34a); box-shadow: 0 3px 8px rgba(22, 163, 74, .35); }
.qt-tip-title {
    flex: 1; min-width: 0;
    font-size: 10px; font-weight: 800; letter-spacing: .3px;
    color: #334155; text-transform: uppercase; line-height: 1.2;
}
.qt-tip-val { font-size: 15px; font-weight: 800; font-variant-numeric: tabular-nums; }
.qt-tip-val.thu { color: #0d9488; }
.qt-tip-val.chi { color: #dc2626; }
.qt-tip-val.lai { color: #16a34a; }

.qt-tip-body { display: flex; flex-direction: column; padding: 6px 12px; }
.qt-tip-line { display: flex; align-items: baseline; gap: 6px; padding: 1px 0; }
.qt-tip-sign { flex: 0 0 12px; color: #94a3b8; font-weight: 700; text-align: center; }
.qt-tip-line.neg .qt-tip-sign { color: #dc2626; }
.qt-tip-lbl { flex: 1; min-width: 0; font-size: 11.5px; color: #475569; font-weight: 600; }
.qt-tip-amt { flex: 0 0 auto; font-size: 12px; font-weight: 700; color: #1e293b; font-variant-numeric: tabular-nums; }
.qt-tip-line.neg .qt-tip-amt { color: #dc2626; }

.qt-tip-subs {
    display: flex; flex-direction: column;
    margin: 2px 0 6px 18px;
}
.qt-tip-subrow {
    display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
    padding: 1px 0;
    border-top: 1px dashed #f1f5f9;
    font-size: 10.5px;
}
.qt-tip-subname { flex: 1; min-width: 0; color: #64748b; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qt-tip-subval { flex: 0 0 auto; font-weight: 600; color: #475569; font-variant-numeric: tabular-nums; }
.qt-tip-submore { font-size: 10px; color: #94a3b8; font-style: italic; padding-top: 1px; }

.qt-tip-foot {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    padding: 7px 12px;
    border-top: 1px solid #f1f5f9;
    background: #f8fafc;
    border-radius: 0 0 12px 12px;
    font-size: 11px; color: #64748b; font-weight: 600;
}
.qt-tip-foot .qt-tip-val { font-size: 13px; }
.qt-tip-foot-label { display: inline-flex; align-items: center; gap: 5px; }
.qt-tip-foot-label i { font-size: 12px; color: #94a3b8; }

/* ── Tooltip phân rã (bản mới): kết quả trên head + 3 section Công thức / Tính toán / Chi tiết ── */
.qt-tip-head .qt-tip-val { font-size: 14px; flex: 0 0 auto; }
.qt-tip-section { display: flex; flex-direction: column; gap: 3px; padding: 6px 0; border-top: 1px dashed #e2e8f0; }
.qt-tip-section:first-child { border-top: 0; }
.qt-tip-sec-label {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: 9.5px; font-weight: 800; letter-spacing: .4px;
    text-transform: uppercase; color: #94a3b8;
}
.qt-tip-sec-label i { font-size: 11px; }
.qt-tip-formula-human { font-size: 12px; font-weight: 700; color: #1e293b; line-height: 1.5; word-break: break-word; }
.qt-tip-calc {
    font-size: 12px; font-weight: 700; color: #0f172a; line-height: 1.5;
    font-variant-numeric: tabular-nums; word-break: break-word;
    background: #f8fafc; border: 1px solid #f1f5f9; border-radius: 8px; padding: 6px 8px;
}
.qt-tip-result { display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; color: #64748b; margin-top: 2px; }
.qt-tip-result i { font-size: 12px; color: #94a3b8; }
.qt-tip-result .qt-tip-val { font-size: 14px; }

/* ═══ Cột TG.YC — 3 mốc YC / Thực tế / Hoàn thành (Bố trí xe) ═══ */
.btx-tg {
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    line-height: 1.3; cursor: pointer; padding: 2px 0; border-radius: 6px;
    transition: background .15s;
}
.btx-tg:hover { background: #eff6ff; }
.btx-tg-item {
    display: inline-flex; align-items: center; gap: 3px;
    font-size: 10px; font-weight: 500; font-variant-numeric: tabular-nums; white-space: nowrap;
}
.btx-tg-item i { font-size: 9px; }
/* Khung giờ cố định width (5ch ≈ "HH:mm" tabular-nums) — ô trống dùng "—" làm placeholder
   giữ đúng độ dài TG yêu cầu để 3 icon thẳng hàng (cột align-items:center) */
.btx-tg-val { display: inline-block; width: 5ch; text-align: center; }
.btx-tg-item.is-yc { color: #0369a1; }
.btx-tg-item.is-tt { color: #0d9488; }
.btx-tg-item.is-ht { color: #16a34a; }
.btx-tg-item.is-tre {
    color: #dc2626; font-weight: 800;
    background: #fef2f2; border: 1px solid #fecaca;
    border-radius: 999px; padding: 0 5px;
}

/* ═══ Tooltip timeline tình trạng lô hàng (.tgl-tip) ═══ */
.smart-tooltip.smart-tooltip--rich:has(.tgl-tip) {
    max-width: min(360px, calc(100vw - 24px)) !important;
}
.tgl-tip { display: flex; flex-direction: column; min-width: 270px; max-width: 340px; }
.tgl-tip-head {
    display: flex; align-items: center; gap: 8px;
    padding: 9px 12px 8px;
    border-bottom: 1px solid #f1f5f9;
    border-radius: 12px 12px 0 0;
    background: linear-gradient(135deg, #eef2ff 0%, #f8fafc 100%);
}
.tgl-tip-ico {
    display: inline-flex; align-items: center; justify-content: center;
    width: 26px; height: 26px; flex: 0 0 auto;
    border-radius: 7px; color: #fff; font-size: 13px;
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    box-shadow: 0 3px 8px rgba(79, 70, 229, .35);
}
.tgl-tip-title {
    flex: 1; min-width: 0;
    font-size: 10px; font-weight: 800; letter-spacing: .3px;
    color: #334155; text-transform: uppercase; line-height: 1.2;
}
.tgl-tip-late {
    display: inline-flex; align-items: center; gap: 4px; flex: 0 0 auto;
    font-size: 9.5px; font-weight: 800; color: #b91c1c;
    background: #fee2e2; border: 1px solid #fecaca;
    border-radius: 999px; padding: 1px 7px;
}
.tgl-tip-timeline { display: flex; flex-direction: column; padding: 10px 12px 8px; }
.tgl-tip-node { position: relative; display: flex; align-items: flex-start; gap: 9px; padding-bottom: 12px; }
.tgl-tip-node:last-child { padding-bottom: 2px; }
/* Đường nối timeline giữa các mốc */
.tgl-tip-node:not(:last-child)::before {
    content: ""; position: absolute; left: 10px; top: 22px; bottom: 0;
    width: 2px; background: linear-gradient(180deg, #e2e8f0, #f1f5f9); border-radius: 1px;
}
.tgl-tip-dot {
    display: inline-flex; align-items: center; justify-content: center;
    width: 21px; height: 21px; flex: 0 0 auto;
    border-radius: 50%; font-size: 10px; color: #fff; z-index: 1;
}
.tgl-tip-node.is-yc .tgl-tip-dot { background: linear-gradient(135deg, #38bdf8, #0284c7); box-shadow: 0 0 0 3px #e0f2fe; }
.tgl-tip-node.is-tt .tgl-tip-dot { background: linear-gradient(135deg, #14b8a6, #0d9488); box-shadow: 0 0 0 3px #f0fdfa; }
.tgl-tip-node.is-tt.is-late .tgl-tip-dot { background: linear-gradient(135deg, #f87171, #dc2626); box-shadow: 0 0 0 3px #fef2f2; }
.tgl-tip-node.is-ht .tgl-tip-dot { background: linear-gradient(135deg, #34d399, #16a34a); box-shadow: 0 0 0 3px #f0fdf4; }
.tgl-tip-main { flex: 1; min-width: 0; }
.tgl-tip-label {
    font-size: 9.5px; font-weight: 800; letter-spacing: .3px;
    text-transform: uppercase; color: #94a3b8; line-height: 1.3;
}
.tgl-tip-node.is-tt.is-late .tgl-tip-label { color: #dc2626; }
.tgl-tip-time { font-size: 12.5px; font-weight: 800; color: #1e293b; font-variant-numeric: tabular-nums; line-height: 1.35; }
.tgl-tip-note {
    display: flex; align-items: flex-start; gap: 5px;
    margin-top: 3px; padding: 4px 7px;
    background: #fffbeb; border: 1px solid #fde68a; border-radius: 6px;
    font-size: 10.5px; color: #92400e; line-height: 1.4; font-weight: 500;
    word-break: break-word;
}
.tgl-tip-note i { flex: 0 0 auto; margin-top: 1px; font-size: 10px; }
.tgl-tip-foot {
    display: flex; align-items: center; gap: 5px;
    padding: 7px 12px;
    border-top: 1px solid #f1f5f9;
    background: #f8fafc;
    border-radius: 0 0 12px 12px;
    font-size: 10.5px; color: #94a3b8; font-weight: 600;
}
.tgl-tip-foot i { font-size: 10px; }

/* ═══ Dialog "Tình trạng lô hàng" (.ttlh-*) — vỏ srt-* giống dialog Bộ lọc dữ liệu + timeline compact ═══ */
/* Chặn bôi đen / sao chép nội dung dialog (input vẫn gõ, paste bình thường) */
.ttlh-dialog { user-select: none; -webkit-user-select: none; }
.ttlh-dialog input, .ttlh-dialog textarea { user-select: text; -webkit-user-select: text; }
.ttlh-dialog .srt-title { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.ttlh-dialog .srt-sub.sub-chips { margin-top: 5px; }
.ttlh-timeline { padding: 14px 4px 4px; position: relative; }
.ttlh-step { position: relative; padding: 0 0 12px 38px; }
.ttlh-step:last-child { padding-bottom: 2px; }
.ttlh-connector { position: absolute; left: 14px; top: 30px; bottom: -2px; width: 2px; background: linear-gradient(180deg, #e2e8f0, #dbeafe); border-radius: 2px; }
.ttlh-step:last-child .ttlh-connector { display: none; }
.ttlh-step-icon { position: absolute; left: 2px; top: 2px; width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; color: #fff; z-index: 1; box-shadow: 0 0 0 3px #fff, 0 3px 8px rgba(15, 23, 42, .18); }
.ttlh-step-icon.is-yc { background: linear-gradient(135deg, #38bdf8, #0284c7); }
.ttlh-step-icon.is-tt { background: linear-gradient(135deg, #14b8a6, #0d9488); }
.ttlh-step-icon.is-tt.is-late { background: linear-gradient(135deg, #f59e0b, #d97706); }
.ttlh-step-icon.is-ht { background: linear-gradient(135deg, #34d399, #16a34a); }
.ttlh-step-card { position: relative; background: linear-gradient(180deg, #ffffff, #fbfdff); border: 1px solid #e8eef5; border-radius: 12px; padding: 10px 14px 12px; box-shadow: 0 1px 4px rgba(15, 23, 42, .04); transition: border-color .18s cubic-bezier(.4,0,.2,1), box-shadow .18s; overflow: hidden; }
.ttlh-step-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: linear-gradient(180deg, #94a3b8, #64748b); }
.ttlh-step-card.is-yc { background: linear-gradient(180deg, #ffffff, #f5fbff); }
.ttlh-step-card.is-yc::before { background: linear-gradient(180deg, #7dd3fc, #0ea5e9); }
.ttlh-step-card.is-tt::before { background: linear-gradient(180deg, #2dd4bf, #14b8a6); }
.ttlh-step-card.is-ht::before { background: linear-gradient(180deg, #4ade80, #22c55e); }
.ttlh-step-card:hover { border-color: #bfdbfe; box-shadow: 0 4px 14px rgba(15, 23, 42, .07); }
.ttlh-step-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-height: 28px; }
.ttlh-step-name { font-size: 12.5px; font-weight: 700; color: #0f172a; letter-spacing: -.01em; }
.ttlh-badge { display: inline-flex; align-items: center; gap: 4px; font-size: 10px; font-weight: 700; padding: 3px 10px; border-radius: 99px; flex-shrink: 0; letter-spacing: .2px; box-shadow: 0 1px 2px rgba(15, 23, 42, .08); }
.ttlh-badge-yc { background: linear-gradient(135deg, #e0f2fe, #bae6fd); color: #0369a1; border: 1px solid #7dd3fc; }
.ttlh-badge-late { background: linear-gradient(135deg, #fee2e2, #fecaca); color: #b91c1c; border: 1px solid #fca5a5; }
.ttlh-ro { display: inline-flex; align-items: center; gap: 7px; margin-left: auto; font-size: 13px; font-weight: 800; color: #0369a1; background: linear-gradient(135deg, #f0f9ff, #e0f2fe); border: 1px solid #bae6fd; border-radius: 8px; padding: 4px 11px; font-variant-numeric: tabular-nums; }
.ttlh-ro i { font-size: 10px; color: #38bdf8; }
/* Thời gian + ghi chú cùng 1 hàng — ô thời gian vừa đủ hiển thị "HH:mm dd/MM/yyyy"; ghi chú cao bằng ô thời gian (34px) */
.ttlh-inrow { display: flex; gap: 8px; margin-top: 8px; align-items: flex-start; }
.ttlh-inrow input.form-control { height: 34px; min-height: 34px; }
.ttlh-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1; }
.ttlh-field-tg { flex: 0 0 172px; width: 172px; }
.ttlh-field label { font-size: 10px; font-weight: 800; color: #475569; text-transform: uppercase; letter-spacing: .5px; display: flex; align-items: center; gap: 5px; }
.ttlh-field label i { font-size: 11px; opacity: .75; }
.ttlh-step-card.is-tt .ttlh-field label { color: #0f766e; }
.ttlh-step-card.is-ht .ttlh-field label { color: #15803d; }
/* Hàng phát sinh: thông tin +Xh Yp so với YC và segment chọn nguyên nhân (KH / Lái xe) */
.ttlh-psrow { display: flex; align-items: center; gap: 10px; margin-top: 8px; padding: 6px 10px; background: #fffbeb; border: 1px solid #fde68a; border-radius: 9px; }
.ttlh-pslabel { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600; color: #92400e; flex-shrink: 0; }
.ttlh-pslabel i { color: #d97706; }
.ttlh-pslabel b { font-weight: 800; color: #b45309; font-variant-numeric: tabular-nums; }
.ttlh-seg { display: flex; background: #fff; border: 1px solid #fde68a; border-radius: 7px; padding: 2px; gap: 2px; margin-left: auto; }
.ttlh-seg-btn { display: inline-flex; align-items: center; justify-content: center; gap: 5px; border: none; background: transparent; border-radius: 5px; padding: 4px 11px; font-size: 11px; font-weight: 600; color: #92400e; cursor: pointer; transition: all .15s; white-space: nowrap; }
.ttlh-seg-btn i { font-size: 11px; }
.ttlh-seg-btn:hover { background: #fef3c7; }
.ttlh-seg-btn.active { color: #fff; background: linear-gradient(135deg, #f59e0b, #d97706); box-shadow: 0 1px 3px rgba(0, 0, 0, .15); }

/* ═══ Tooltip hiện đại cho tab trạng thái & nút toolbar (.btx-tip) — Bố trí xe ═══ */
.btx-tip { display: flex; flex-direction: column; min-width: 224px; max-width: 300px; }
.btx-tip-head {
    display: flex; align-items: center; gap: 9px;
    padding: 10px 12px;
    border-bottom: 1px solid #f1f5f9;
    border-radius: 12px 12px 0 0;
    background: #f8fafc;
}
.btx-tip-ico {
    display: inline-flex; align-items: center; justify-content: center;
    width: 28px; height: 28px; flex: 0 0 auto;
    border-radius: 8px; color: #fff; font-size: 14px;
    box-shadow: 0 3px 8px rgba(15, 23, 42, .18);
}
.btx-tip-head-text { flex: 1; min-width: 0; }
.btx-tip-title {
    font-size: 12.5px; font-weight: 800; color: #1e293b; line-height: 1.3;
}
.btx-tip-desc {
    padding: 8px 12px 10px;
    font-size: 11.5px; color: #64748b; line-height: 1.5; font-weight: 500;
}

/* ═══ Tooltip số quyết toán (.sqt-tip) — Bố trí xe ═══ */
.sqt-tip { display: flex; flex-direction: column; min-width: 260px; max-width: 340px; }
.sqt-tip-head {
    display: flex; align-items: center; gap: 9px;
    padding: 10px 12px;
    border-bottom: 1px solid #f1f5f9;
    border-radius: 12px 12px 0 0;
    background: linear-gradient(135deg, #eff6ff 0%, #f8fafc 100%);
}
.sqt-tip-ico {
    display: inline-flex; align-items: center; justify-content: center;
    width: 30px; height: 30px; flex: 0 0 auto;
    border-radius: 8px; color: #fff; font-size: 15px;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    box-shadow: 0 3px 8px rgba(37, 99, 235, .35);
}
.sqt-tip-head-text { flex: 1; min-width: 0; }
.sqt-tip-head-label {
    font-size: 9.5px; font-weight: 800; letter-spacing: .4px;
    color: #94a3b8; text-transform: uppercase; line-height: 1.2;
}
.sqt-tip-name {
    font-size: 13px; font-weight: 800; color: #1e293b; line-height: 1.3;
    margin-top: 1px;
}
.sqt-tip-full {
    font-size: 11px; font-weight: 500; color: #64748b; line-height: 1.35;
    margin-top: 1px;
}
.sqt-tip-body { display: flex; flex-direction: column; padding: 6px 12px 8px; gap: 2px; }
.sqt-tip-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 3px 0; }
.sqt-tip-label {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: 11px; color: #94a3b8; font-weight: 600; flex: 0 0 auto;
}
.sqt-tip-label i { font-size: 11px; }
.sqt-tip-val {
    font-size: 12px; color: #1e293b; font-weight: 700; text-align: right;
    font-variant-numeric: tabular-nums; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* Badge loại hàng (Nhập/Xuất/Lẻ) */
.sqt-tip-lh {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 2px 8px;
    border-radius: 999px;
    border: 1px solid;
    font-size: 11px; font-weight: 700;
    background: #fff;
}
.sqt-tip-lh i { font-size: 11px; }
/* Ghi chú yêu cầu KH */
.sqt-tip-note {
    display: flex; flex-direction: column; gap: 3px;
    margin-top: 4px; padding: 7px 9px;
    border-radius: 8px;
    background: #fffbeb;
    border: 1px solid #fde68a;
}
.sqt-tip-note-label {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: 10px; font-weight: 800; letter-spacing: .3px;
    color: #b45309; text-transform: uppercase;
}
.sqt-tip-note-label i { font-size: 11px; }
.sqt-tip-note-text {
    font-size: 11.5px; color: #78350f; line-height: 1.45; font-weight: 500;
    word-break: break-word; white-space: normal;
}
/* Footer tooltip: QLKH · chốt gửi kế hoạch */
.sqt-tip-foot {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    margin-top: 6px; padding-top: 6px;
    border-top: 1px dashed #e2e8f0;
    font-size: 10.5px; color: #94a3b8;
}
.sqt-tip-foot-item { display: inline-flex; align-items: center; gap: 4px; min-width: 0; }
.sqt-tip-foot-item i { font-size: 10.5px; }
.sqt-tip-foot-item:last-child { flex-shrink: 0; }
.sqt-tip-foot-item:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sqt-tip-foot-dot { color: #cbd5e1; flex: 0 0 auto; }

@media (max-width: 1280px) {
    .qt-form-grid {
        grid-template-columns: 210px auto;
    }

    .qt-top-strip {
        padding: 9px;
    }

    .qt-top-fields {
        grid-template-columns: 1fr 150px 1fr 1fr auto;
        min-width: 0;
        width: 100%;
    }

    .qt-top-fields .qt-field:last-child {
        grid-column: 1 / -1;
    }

    /* Màn nhỏ: giữ hàng công tắc 1 hàng cuộn ngang (không wrap làm tăng chiều cao footer) —
       ẩn nhãn chữ của khối tổng kết, chừa icon + số tiền */
    .qt-tonghop .qt-th-label { display: none; }
    .qt-th-title { display: none; }
}

/* Số QT bold + word wrap trong cả 2 bảng */
.qt-lohang-table tbody td:nth-child(2) {
    font-weight: 800;
    color: #0f172a;
    white-space: normal;
    word-break: break-word;
}

/* Ô Số QT input có icon */
.qt-sqt-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.qt-sqt-input-wrap > i {
    position: absolute;
    left: 10px;
    z-index: 1;
    font-size: 14px;
    color: #2563eb;
    pointer-events: none;
}

.qt-sqt-input {
    padding-left: 32px !important;
    font-weight: 700 !important;
    font-size: 13px !important;
    color: #283593 !important;
    letter-spacing: .01em;
}
.qt-money-panel thead tr{
    user-select:none;
}
/* Header icon trong bảng thu/chi */
.qt-money-panel-thu .qt-flat-table thead th:first-child i,
.qt-money-panel-chi .qt-flat-table thead th:first-child i {
    margin-right: 4px;
    font-size: 11px;
}

/* Dropdown gợi ý số quyết toán */
.qt-sqt-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    width: 480px;
    max-height: 340px;
    overflow: auto;
    z-index: 10000;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, .10);
    padding: 4px;
    animation: qt-dropdown-in .15s ease both;
}

@keyframes qt-dropdown-in {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

.qt-sqt-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    width: 100%;
    padding: 7px 10px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    text-align: left;
    cursor: pointer;
    transition: background .12s ease;
}

.qt-sqt-item:hover {
    background: #f1f5f9;
}

.qt-sqt-item + .qt-sqt-item {
    border-top: 1px solid #f8fafc;
}

.qt-sqt-item-head {
    display: flex;
    align-items: center;
    gap: 6px;
}

.qt-sqt-item-head > i {
    color: #2563eb;
    font-size: 12px;
    flex-shrink: 0;
}

.qt-sqt-item-code {
    font-weight: 800;
    font-size: 12px;
    color: #0f172a;
    flex: 1;
    min-width: 0;
    word-break: break-word;
}

.qt-sqt-item-count {
    flex-shrink: 0;
    padding: 1px 6px;
    border-radius: 999px;
    background: #f1f5f9;
    color: #64748b;
    font-size: 9px;
    font-weight: 800;
}

.qt-sqt-item-time {
    flex-shrink: 0;
    font-size: 9px;
    color: #94a3b8;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.qt-sqt-item-time i { font-size: 9px; }

.qt-sqt-item-subs {
    display: flex;
    flex-wrap: wrap;
    gap: 0 12px;
    padding-left: 18px;
}

.qt-sqt-sub {
    display: inline-flex;
    align-items: baseline;
    gap: 3px;
    font-size: 10px;
    line-height: 1.5;
}

.qt-sqt-sub-label {
    flex-shrink: 0;
    font-size: 9px;
    font-weight: 700;
    color: #b0bec5;
}

.qt-sqt-sub-val {
    color: #78909c;
    word-break: break-word;
    min-width: 0;
}

/* ═══ Tên khoản thu/chi — hiển thị text readonly ═══ */
.qt-khoan-name {
    font-size: 11px;
    font-weight: 600;
    color: #1e293b;
    line-height: 1.25;
    padding: 0 5px;
    white-space: normal;
    word-break: break-word;
    min-height: 22px;
    display: flex;
    align-items: center;
    gap: 2px;
}
.qt-khoan-name i {
    font-size: 14px;
    color: #94a3b8;
    flex-shrink: 0;
}
.qt-khoan-stt {
    flex-shrink: 0;
    color: #94a3b8;
    font-size: 10.5px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    min-width: 18px;
    user-select: none;
}

/* ═══ Cột Khoản thu / Khoản chi — CHẶN copy (không cho bôi đen chọn text trong cell) ═══ */
.qt-money-panel .qt-flat-table tbody td:first-child {
    user-select: none;
    -webkit-user-select: none;
    cursor: default;
}

/* ═══ Dòng chưa lưu (pending) ═══ */
.qt-row-pending td {
    opacity: .78;
    transition: opacity .15s ease;
}
.qt-row-pending .qt-khoan-name {
    color: #6b7280;
    font-weight: 500;
}
.qt-row-pending:hover td,
.qt-row-pending:focus-within td {
    opacity: .95;
}
.qt-row-pending:has(.inputn-input:not(:placeholder-shown)) td,
.qt-row-pending:has(.form-control:not(:placeholder-shown)) td {
    opacity: 1;
}
.qt-row-pending:has(.inputn-input:not(:placeholder-shown)) .qt-khoan-name {
    color: #1e293b;
    font-weight: 600;
}

.qt-row-pending textarea {
   
}
/* ═══ Row đã có giá trị Thành tiền ≠ 0 ═══ */
.qt-has-value td {
    border-bottom-color: #bbf7d0 !important;
}
.qt-money-panel-chi .qt-has-value td {
    border-bottom-color: #fecdd3 !important;
}
.qt-has-value td:nth-child(3) input {
    color: #1e40af !important;
    font-weight: 700 !important;
}
.qt-has-value .qt-khoan-name {
    color: #0f172a;
    font-weight: 700;
}

/* ═══ Badge trạng thái Tạo mới / Cập nhật ═══ */
.qt-mode-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 34px;
    padding: 0 14px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: -.01em;
    white-space: nowrap;
    flex-shrink: 0;
    user-select: none;
    animation: qt-badge-in .3s ease both;
}
@keyframes qt-badge-in {
    from { opacity: 0; transform: scale(.9); }
    to   { opacity: 1; transform: scale(1); }
}
.qt-mode-badge i { font-size: 14px; }

.qt-mode-badge.is-new {
    background: linear-gradient(135deg, #dbeafe, #eff6ff);
    color: #1d4ed8;
    border: 1px solid #93c5fd;
    box-shadow: 0 2px 8px rgba(29, 78, 216, .12);
}
.qt-mode-badge.is-edit {
    background: linear-gradient(135deg, #fef3c7, #fffbeb);
    color: #92400e;
    border: 1px solid #fcd34d;
    box-shadow: 0 2px 8px rgba(146, 64, 14, .10);
}

/* ═══ Row đã lưu trong CSDL ═══ */
.qt-row-saved td {
    transition: background .15s ease, border-color .15s ease;
}

/* Icon trạng thái trước tên khoản */
.qt-row-icon-saved {
    color: #22c55e;
    font-size: 10px !important;
    margin-right: 3px;
    flex-shrink: 0;
}
.qt-row-icon-changed {
    color: #f59e0b;
    font-size: 9px !important;
    margin-right: 3px;
    flex-shrink: 0;
    animation: qt-changed-pulse 1.5s ease-in-out infinite;
}
@keyframes qt-changed-pulse {
    0%, 100% { opacity: .6; }
    50% { opacity: 1; }
}

/* ═══ Row đã thay đổi so với CSDL ═══ */
.qt-row-changed td {
    border-bottom-color: #fde68a !important;
}
.qt-row-changed .qt-khoan-name {
    color: #92400e !important;
    font-weight: 700 !important;
}
/* Viền trái amber cho row đã thay đổi */
.qt-row-changed td:first-child {
    box-shadow: inset 3px 0 0 #f59e0b;
}

/* ═══ Row đã lưu + có giá trị — viền trái xanh nhẹ ═══ */
.qt-row-saved.qt-has-value td:first-child {
    box-shadow: inset 3px 0 0 #22c55e;
}
.qt-money-panel-chi .qt-row-saved.qt-has-value td:first-child {
    box-shadow: inset 3px 0 0 #ef4444;
}
/* Override: row changed luôn ưu tiên amber */
.qt-row-changed.qt-has-value td:first-child {
    box-shadow: inset 3px 0 0 #f59e0b !important;
}

/* ═══ Nút nhập thu chi từ quyết toán khác ═══ */
.qt-btx-actions .qt-import-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 28px;
    padding: 0 12px;
    border-radius: 6px !important;
    font-size: 12px;
    font-weight: 700;
    background: #16a34a;
    color: #fff;
    border: 0;
    box-shadow: 0 4px 12px rgba(22, 163, 74, .38), 0 2px 5px rgba(15, 23, 42, .14) !important;
    transition: box-shadow .18s ease, background .18s ease, transform .18s ease;
}
.qt-btx-actions .qt-import-btn:hover {
    background: #15803d;
    color: #fff;
    box-shadow: 0 8px 18px rgba(22, 163, 74, .46), 0 3px 8px rgba(15, 23, 42, .18) !important;
    transform: translateY(-1px);
}
.qt-btx-actions .qt-import-btn:active {
    transform: translateY(0);
    box-shadow: 0 3px 8px rgba(22, 163, 74, .35) !important;
}
.qt-btx-actions .qt-import-btn i { font-size: 12px; }

.qt-btx-actions .btn-danger {
    border-radius: 6px;
    box-shadow: 0 6px 16px rgba(220, 38, 38, .42), 0 3px 6px rgba(15, 23, 42, .16);
    transition: box-shadow .18s ease, transform .18s ease;
}
.qt-btx-actions .btn-danger:hover {
    box-shadow: 0 10px 24px rgba(220, 38, 38, .5), 0 4px 10px rgba(15, 23, 42, .2);
    transform: translateY(-1px);
}
.qt-btx-actions .btn-danger:active {
    transform: translateY(0);
    box-shadow: 0 3px 8px rgba(220, 38, 38, .35);
}

/* ═══ Dialog nhập thu chi từ quyết toán khác ═══ */
.qt-copydlg {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 4px 2px;
}
.qt-copydlg-source {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.qt-copydlg-source-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12.5px;
    font-weight: 700;
    color: #475569;
}
.qt-copydlg-source-label i { color: #16a34a; font-size: 14px; }
.qt-source-list {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    overflow-y: auto;
    overflow-x: auto;
    max-height: 260px;
}
.qt-source-head,
.qt-source-item {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.55fr) minmax(0, 0.95fr) minmax(0, 0.9fr) minmax(0, 0.85fr) minmax(0, 0.85fr) minmax(0, 0.9fr) minmax(0, 0.9fr);
    gap: 8px;
    align-items: center;
    padding: 8px 14px;
    text-align: left;
    white-space: nowrap;
}
.qt-source-head > span,
.qt-source-item > span {
    min-width: 0;
}
.qt-source-item > span {
    overflow: hidden;
    text-overflow: ellipsis;
}
.qt-source-head {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #f8fafc;
    color: #64748b;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .4px;
    text-transform: uppercase;
    border-bottom: 1px solid #e2e8f0;
}
.qt-source-item {
    width: 100%;
    border: 0;
    border-bottom: 1px solid #f1f5f9;
    background: #fff;
    font-size: 12.5px;
    color: #0f172a;
    cursor: pointer;
    transition: background .12s;
}
.qt-source-item:last-child { border-bottom: 0; }
.qt-source-item:hover {
    background: #f0fdf4;
}
.qt-source-item.active {
    background: #dcfce7;
    box-shadow: inset 3px 0 0 #16a34a;
}
.qt-source-item > span:first-child { font-weight: 700; color: #0f172a; }
.qt-source-item .is-right { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.qt-source-head .is-right { text-align: right; }
.qt-source-item .is-thu { color: #15803d; }
.qt-source-item .is-chi { color: #dc2626; }
.qt-source-empty {
    padding: 20px;
    text-align: center;
    color: #64748b;
    font-size: 13px;
    font-weight: 600;
}
.qt-copydlg-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.qt-copydlg-col {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}
.qt-copydlg-col-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
    row-gap: 5px;
}
.qt-copydlg-col-head span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 700;
}
.qt-copydlg-col-head.is-thu span { color: #16a34a; }
.qt-copydlg-col-head.is-chi span { color: #dc2626; }

.qt-col-actions {
    display: inline-flex;
    align-items: center;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
}
.qt-sel-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 9px;
    background: #fff;
    border: none;
    color: #64748b;
    font-size: 11.5px;
    font-weight: 600;
    cursor: pointer;
    transition: background .13s, color .13s;
    white-space: nowrap;
}
.qt-sel-btn i { font-size: 13px; }
.qt-sel-btn + .qt-sel-btn { border-left: 1px solid #e2e8f0; }
.qt-sel-btn:hover { background: #f1f5f9; color: #334155; }

.qt-sel-all:hover { background: #f0fdf4; color: #16a34a; }
.qt-copydlg-col-head.is-chi .qt-sel-all:hover { background: #fef2f2; color: #dc2626; }
.qt-sel-none:hover { background: #fafafa; color: #94a3b8; }
.qt-copydlg-list {
    max-height: 240px;
    overflow: auto;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 4px;
    background: #fff;
}

/* ── Table layout ── */
.qt-tbl-wrap {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
}
.qt-tbl {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    table-layout: fixed;
}
.qt-tbl thead tr { background: #f8fafc; }
.qt-tbl thead th {
    padding: 6px 8px;
    font-size: 10.5px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: .3px;
    border-bottom: 1px solid #e2e8f0;
    white-space: nowrap;
    user-select: none;
}
.qt-th-chk  { width: 28px; text-align: center; }
.qt-th-name { text-align: left; }
.qt-th-num  { width: 68px; text-align: right; }
.qt-th-truoc { width: 84px; }
.qt-th-sau   { width: 84px; }
.qt-th-truoc.is-thu { color: #16a34a; }
.qt-th-sau.is-thu   { color: #166534; font-weight: 800; }
.qt-th-truoc.is-chi { color: #dc2626; }
.qt-th-sau.is-chi   { color: #991b1b; font-weight: 800; }

/* ── Table body ── */
.qt-tbl-wrap tbody { display: block; max-height: 220px; overflow-y: auto; }
.qt-tbl thead, .qt-tbl tbody tr { display: table; width: 100%; table-layout: fixed; }

.qt-tbl-row {
    cursor: pointer;
    transition: background .11s;
}
.qt-tbl-row:hover { background: #f8fafc; }
.qt-tbl-row.is-checked.is-thu { background: #f0fdf4; }
.qt-tbl-row.is-checked.is-chi { background: #fef2f2; }
.qt-tbl-row.is-checked.is-thu:hover { background: #dcfce7; }
.qt-tbl-row.is-checked.is-chi:hover { background: #fee2e2; }
.qt-tbl-name-row td { border-bottom: 0; padding-bottom: 1px; }
.qt-tbl-num-row td  { border-bottom: 1px solid #f1f5f9; padding-top: 1px; }
.qt-tbl-num-row:last-child td { border-bottom: 0; }

.qt-td-chk {
    width: 28px;
    text-align: center;
    vertical-align: middle;
    padding: 4px 4px;
    border-right: 1px solid #f1f5f9;
}
.qt-td-name {
    padding: 5px 8px 1px;
    color: #1e293b;
    font-size: 12.5px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: bottom;
    max-width: 0;
}
.qt-td-num {
    padding: 1px 8px 4px;
    text-align: right;
    color: #64748b;
    font-size: 11px;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    vertical-align: top;
}
.qt-td-truoc { font-weight: 600; }
.qt-td-truoc.is-thu { color: #15803d; }
.qt-td-truoc.is-chi { color: #dc2626; }
.qt-td-sau { font-weight: 700; font-size: 12px; }
.qt-td-sau.is-thu { color: #166534; }
.qt-td-sau.is-chi { color: #991b1b; }

/* ── Checkbox inside table ── */
.qt-chk {
    appearance: none;
    -webkit-appearance: none;
    width: 15px;
    height: 15px;
    border: 1.5px solid #cbd5e1;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    position: relative;
    vertical-align: middle;
    transition: border-color .13s, background .13s;
    flex-shrink: 0;
}
.qt-chk:hover { border-color: #94a3b8; }
.qt-chk:checked { background: #16a34a; border-color: #16a34a; }
.qt-tbl-row.is-chi .qt-chk:checked { background: #dc2626; border-color: #dc2626; }
.qt-chk:checked::after {
    content: "";
    position: absolute;
    left: 4px; top: 1px;
    width: 3px; height: 7px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}
.qt-copydlg-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-bottom: 1px solid #eef2f6;
    cursor: pointer;
    font-size: 12px;
    transition: background .12s;
    min-height: 32px;
}
.qt-copydlg-item:hover { background: #f8fafc; }
.qt-copydlg-item:has(input:checked) {
    background: #f0fdf4;
    border-bottom-color: #bbf7d0;
}
.qt-copydlg-col.is-chi-col .qt-copydlg-item:has(input:checked) {
    background: #fef2f2;
    border-bottom-color: #fecaca;
}
.qt-copydlg-item:last-child { border-bottom: 0; }
.qt-copydlg-item input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 15px;
    height: 15px;
    flex-shrink: 0;
    border: 1.5px solid #cbd5e1;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    position: relative;
    transition: border-color .15s, background .15s, box-shadow .15s;
}
.qt-copydlg-item input[type="checkbox"]:hover { border-color: #94a3b8; }
.qt-copydlg-item input[type="checkbox"]:checked {
    background: #16a34a;
    border-color: #16a34a;
    box-shadow: 0 1px 4px rgba(22, 163, 74, .3);
}
.qt-copydlg-item input[type="checkbox"]:checked::after {
    content: "";
    position: absolute;
    left: 4px;
    top: 1px;
    width: 3px;
    height: 7px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}
.qt-copydlg-item-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0;
}
.qt-copydlg-name {
    flex: 1;
    min-width: 0;
    color: #1e293b;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-right: 8px;
    font-size: 12px;
}
.qt-copydlg-meta {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0;
    flex-shrink: 0;
}
.qt-num {
    text-align: right;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
    width: 64px;
    font-size: 11px;
    padding: 0 4px;
    border-left: 1px solid #f1f5f9;
}
.qt-num b {
    font-weight: 700;
    color: #334155;
    font-variant-numeric: tabular-nums;
}
.qt-num.qt-total { font-size: 11.5px; width: 76px; }
.qt-num.qt-total.is-thu b { color: #15803d; }
.qt-num.qt-total.is-chi b { color: #dc2626; }
.qt-num.qt-total-after { font-size: 11.5px; font-weight: 700; width: 76px; }
.qt-num.qt-total-after.is-thu b { color: #166534; }
.qt-num.qt-total-after.is-chi b { color: #b91c1c; }
.qt-copydlg-mode {
    display: flex;
    gap: 18px;
    align-items: center;
    padding: 6px 2px;
    border-top: 1px solid #f1f5f9;
}
.qt-copydlg-mode-label {
    font-size: 12px;
    font-weight: 600;
    color: #475569;
    white-space: nowrap;
}
.qt-copydlg-radio {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 13px;
    color: #334155;
    font-weight: 500;
}
.qt-copydlg-radio input[type="radio"] {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    border: 2px solid #cbd5e1;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    position: relative;
    transition: border-color .15s, box-shadow .15s;
}
.qt-copydlg-radio input[type="radio"]:hover { border-color: #94a3b8; }
.qt-copydlg-radio input[type="radio"]:checked {
    border-color: #16a34a;
    box-shadow: 0 2px 6px rgba(22, 163, 74, .35);
}
.qt-copydlg-radio input[type="radio"]:checked::after {
    content: "";
    position: absolute;
    inset: 3px;
    border-radius: 50%;
    background: #16a34a;
}

/* ═══ Dialog nhập thu chi từ quyết toán khác — header/footer kiểu bộ lọc (srt) ═══ */
@keyframes qtFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes qtPop {
    from { opacity: 0; transform: translateY(8px) scale(.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.srt-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1700;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: radial-gradient(circle at center, rgba(255,255,255,.14) 0%, rgba(15,23,42,.2) 45%, rgba(15,23,42,.34) 100%);
    backdrop-filter: blur(12px) saturate(1.1);
    animation: qtFadeIn .18s cubic-bezier(.22, 1, .36, 1) both;
}
.srt-dialog {
    position: relative;
    width: min(600px, 96vw);
    overflow: hidden;
    background: linear-gradient(180deg, rgba(255,255,255,.99), rgba(248,251,249,.99));
    border: 1px solid rgba(255,255,255,.8);
    border-radius: 22px;
    box-shadow: 0 36px 100px rgba(15, 23, 42, .28), 0 14px 42px rgba(15, 157, 79, .16), 0 1px 0 rgba(255,255,255,.85) inset;
    animation: qtPop .22s cubic-bezier(.22, 1, .36, 1) both;
}
.srt-dialog::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(circle at top left, rgba(15, 157, 79, .10), transparent 32%),
                radial-gradient(circle at bottom right, rgba(59, 130, 246, .08), transparent 28%);
}
.srt-close {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 3;
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 5px;
    background: rgba(15, 23, 42, .05);
    color: #64748b;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    cursor: pointer;
    transition: all .18s ease;
    box-shadow: 0 2px 6px rgba(15, 23, 42, .06);
}
.srt-close:hover {
    background: rgba(239, 68, 68, .12);
    color: #dc2626;
    transform: rotate(90deg);
    box-shadow: 0 6px 16px rgba(239, 68, 68, .22);
}
.srt-body {
    position: relative;
    z-index: 1;
    padding: 12px 14px 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.srt-head {
    display: flex;
    align-items: center;
    gap: 12px;
}
.srt-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #fff;
    background: linear-gradient(135deg, #0f9d4f 0%, #0b8a42 100%);
    box-shadow: 0 8px 18px rgba(15, 157, 79, .32), 0 3px 8px rgba(15, 157, 79, .18);
    flex-shrink: 0;
}
.srt-head-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.srt-title {
    font-size: 16px;
    font-weight: 800;
    color: #173824;
    letter-spacing: -.2px;
}
.srt-sub {
    font-size: 11.5px;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
}
.srt-sub-part {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 600;
}
.srt-sub-part i {
    font-size: 12px;
    color: #0f9d4f;
}
.srt-footer {
    position: relative;
    z-index: 1;
    padding: 8px 12px 10px;
    background: linear-gradient(180deg, rgba(255,255,255,.5), rgba(243,249,245,.9));
    border-top: 1px solid rgba(187, 225, 201, .6);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.srt-footer-left {
    display: flex;
    align-items: center;
    gap: 8px;
}
.srt-footer-actions {
    display: flex;
    gap: 8px;
}
.srt-btn {
    height: 32px;
    padding: 0 13px;
    border: none;
    border-radius: 5px;
    font-size: 12.5px;
    font-weight: 700;
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    white-space: nowrap;
    transition: all .18s ease;
}
.srt-btn:hover:not(:disabled) { transform: translateY(-1px); }
.srt-btn:active:not(:disabled) { transform: scale(.97); }
.srt-btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.srt-btn i { font-size: 14px; }
.srt-btn-apply {
    background: linear-gradient(135deg, #0f9d4f 0%, #0b8a42 100%);
    box-shadow: 0 8px 20px rgba(15, 157, 79, .40), 0 3px 8px rgba(15, 157, 79, .22);
}
.srt-btn-apply:hover:not(:disabled) {
    box-shadow: 0 12px 28px rgba(15, 157, 79, .50), 0 5px 12px rgba(15, 157, 79, .26);
}
.srt-btn-ghost {
    background: #fff;
    color: #475569;
    border: 1.5px solid #e2e8f0;
    box-shadow: 0 2px 6px rgba(15, 23, 42, .08);
}
.srt-btn-ghost:hover:not(:disabled) {
    background: #f8fafc;
    border-color: #cbd5e1;
    box-shadow: 0 6px 14px rgba(15, 23, 42, .12);
}
.qt-copydlg-selcount {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.qt-smr-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    font-weight: 500;
    padding: 3px 10px;
    border-radius: 6px;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}
.qt-smr-chip.is-thu { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.qt-smr-chip.is-chi { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.qt-smr-chip i { font-size: 11px; }
.qt-smr-chip b { font-weight: 700; }
.qt-smr-chip .qt-smr-main { font-size: 13px; font-weight: 800; }
.qt-smr-divider { width: 1px; height: 20px; background: #e2e8f0; flex-shrink: 0; }

/* Intro mô tả */
.qt-copydlg-intro {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 12.5px;
    color: #475569;
    line-height: 1.5;
    padding: 10px 12px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
}
.qt-copydlg-intro i { color: #3b82f6; font-size: 14px; margin-top: 1px; flex-shrink: 0; }
.qt-copydlg-intro b { color: #16a34a; font-weight: 800; }

/* Nguồn list */
.qt-copydlg-source-count {
    font-size: 11px;
    font-weight: 700;
    color: #16a34a;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    padding: 1px 8px;
    border-radius: 99px;
    margin-left: 2px;
}
.qt-source-head span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.qt-source-head i { font-size: 12px; opacity: .75; }
.qt-src-sqt {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}
.qt-src-sqt i { font-size: 13px; flex-shrink: 0; }
.qt-src-sqt i.has-qt { color: #16a34a; }
.qt-src-sqt i.no-qt { color: #cbd5e1; }
.qt-src-time { color: #475569; font-variant-numeric: tabular-nums; }
.qt-source-item.is-current {
    opacity: .5;
    cursor: not-allowed;
    background: #f8fafc;
    filter: grayscale(.35);
}
.qt-source-item.is-current:hover {
    background: #f8fafc;
}
.qt-source-item.is-current .qt-src-sqt i { color: #94a3b8; }
.qt-src-tag {
    font-style: normal;
    font-size: 9.5px;
    font-weight: 800;
    color: #475569;
    background: #e2e8f0;
    padding: 1px 6px;
    border-radius: 4px;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Badge loại hàng */
.qt-lh-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 26px;
    height: 20px;
    padding: 0 6px;
    border-radius: 6px;
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: .2px;
}
.qt-lh-badge.lh-N { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
.qt-lh-badge.lh-X { background: #fffbeb; color: #b45309; border: 1px solid #fde68a; }
.qt-lh-badge.lh-L { background: #faf5ff; color: #7c3aed; border: 1px solid #e9d5ff; }

/* Pagination nguồn */
.qt-source-pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}
.qt-pager-btn {
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: #fff;
    color: #475569;
    cursor: pointer;
    transition: border-color .15s, background .15s, color .15s, box-shadow .15s;
}
.qt-pager-btn:hover:not(:disabled) {
    border-color: #16a34a;
    color: #16a34a;
    background: #f0fdf4;
    box-shadow: 0 4px 12px rgba(22, 163, 74, .18);
}
.qt-pager-btn:disabled { opacity: .45; cursor: not-allowed; }
.qt-pager-info { font-size: 12.5px; color: #475569; }
.qt-pager-info b { color: #16a34a; }

/* Empty state */
.qt-copydlg-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 26px 12px;
    text-align: center;
    color: #64748b;
    border: 1px dashed #e2e8f0;
    border-radius: 10px;
    background: #f8fafc;
}
.qt-copydlg-empty i { font-size: 30px; color: #cbd5e1; }
.qt-copydlg-empty p { margin: 0; font-size: 13px; font-weight: 600; }

/* Thanh nguồn đã chọn */
.qt-copydlg-picked {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 12px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
}
.qt-copydlg-picked-info {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}
.qt-copydlg-picked-info > i { color: #16a34a; font-size: 20px; flex-shrink: 0; }
.qt-copydlg-picked-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.qt-copydlg-picked-text b { font-size: 13.5px; color: #0f172a; }
.qt-copydlg-picked-text span { font-size: 11.5px; color: #475569; }
.qt-copydlg-change {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #fff;
    color: #475569;
    font-size: 12px;
    font-weight: 700;
    padding: 5px 12px;
    cursor: pointer;
    transition: border-color .15s, color .15s, background .15s, box-shadow .15s;
}
.qt-copydlg-change:hover {
    border-color: #16a34a;
    color: #16a34a;
    background: #fff;
    box-shadow: 0 4px 12px rgba(22, 163, 74, .18);
}

/* Mode radio có icon */
.qt-copydlg-radio span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.qt-copydlg-radio span i { font-size: 13px; color: #94a3b8; }
.qt-copydlg-mode-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.qt-copydlg-mode-label i { font-size: 13px; color: #94a3b8; }
