/* ============================================================================
   KỸ THUẬT — xem trước phiếu biểu mẫu (PhieuBieuMauPreview, class ktp-*)
   Bố cục theo bản giấy A4 ngang: chữ Times New Roman, kẻ khung đen, nền trắng.
   ============================================================================ */
.ktp-wrap {
    background: #e9edf2;
    border-radius: 8px;
    padding: 16px;
    overflow: auto;
    flex: 1 1 auto;
    min-height: 0;
}

.ktp-sheet {
    width: 100%;              /* ~ A4 ngang (297 x 210 mm) */
    min-height: 778px;
    margin: 0 auto;
    padding: 28px 32px;
    box-sizing: border-box;
    background: #fff;
    color: #000;
    font-family: 'Times New Roman', Times, serif;
    font-size: 13px;
    box-shadow: 0 2px 10px rgba(16, 24, 40, .15);
}

/* Nhãn tỉ lệ in (ktpCoGian): dính góc trên khung xem, không in */
.ktp-tile {
    position: sticky;
    top: 0;
    left: 0;
    z-index: 2;
    width: fit-content;
    margin: -6px 0 8px;
    padding: 3px 10px;
    border-radius: 999px;
    background: #e8f0fb;
    border: 1px solid #c7d8ef;
    color: #2f5d8f;
    font-size: 12px;
    font-weight: 600;
    cursor: help;
}

    .ktp-tile.tran {
        background: #fdecec;
        border-color: #f3c2c2;
        color: #b42318;
    }

    .ktp-sheet table {
        border-collapse: collapse;
    }

/* Khung đầu: logo | tên công ty | ký hiệu | trang | lần ban hành | ngày ban hành */
.ktp-head {
    width: 80%;
    margin: 0 auto 14px;
    font-size: 12px;
    text-align: center;
}

    .ktp-head td {
        border: 1px solid #000;
        padding: 3px 6px;
        vertical-align: middle;
    }

.ktp-logo {
    width: 70px;
}

    .ktp-logo img {
        height: 34px;
        display: block;
        margin: 0 auto;
    }

.ktp-cty {
    width: 150px;
}

.ktp-trang {
    width: 50px;
}

.ktp-lbl {
    font-size: 11px;
}

.ktp-title {
    text-align: center;
    font-weight: 700;
    font-size: 18px;
    text-transform: uppercase;
}

.ktp-title2 {
    text-align: center;
    font-weight: 700;
    font-style: italic;
    font-size: 16px;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.ktp-yc {
    font-size: 13px;
    line-height: 1.45;
}

/* Bảng dữ liệu */
.ktp-grid {
    width: 100%;
    margin-top: 2px;
}

    .ktp-grid th,
    .ktp-grid td {
        border: 1px solid #000;
        padding: 2px 4px;
        overflow-wrap: normal;   /* không bẻ giữa chữ: bảng giãn rồi cả tờ thu theo tỉ lệ (ktpCoGian) */
        word-break: normal;
    }

    .ktp-grid th {
        font-weight: 400;
        text-align: center;
        vertical-align: top;
        line-height: 1.25;
    }

    /* Giá trị căn giữa như bản giấy (kể cả số) */
    .ktp-grid td {
        height: 22px;
        text-align: center;
    }

    /* Checklist: nhãn hạng mục căn trái, dòng nhóm trải ngang in đậm */
    .ktp-grid td.ktp-nhan {
        text-align: left;
        vertical-align: middle;
    }

    .ktp-grid td.ktp-nhom {
        text-align: left;
        font-weight: 700;
    }

/* Khổ dọc (KT_BieuMau.IsKhoDoc): ~ A4 dọc 210 x 297 mm */
.ktp-sheet.ktp-doc {
    max-width: 794px;
    min-height: 1123px;
}

    .ktp-sheet.ktp-doc .ktp-head {
        width: 100%;
    }

/* Ô đầu phiếu: Ngày (Date): ... Khu vực (Area): ... */
.ktp-tt {
    display: flex;
    flex-wrap: wrap;
    gap: 2px 28px;
    line-height: 1.6;
    margin-bottom: 2px;
}

    .ktp-tt b {
        font-weight: 400;
    }

/* Chân phiếu: ô cuối phiếu, rồi hàng ký: ô ký thêm bên trái, thẩm tra bên phải */
.ktp-foot {
    margin-top: 12px;
    line-height: 1.6;
}

.ktp-cuoi {
    white-space: pre-wrap;
}

.ktp-ky {
    display: flex;
    align-items: flex-start;
    gap: 24px;
    margin-top: 6px;
}

.ktp-ky-o {
    min-width: 170px;
    text-align: center;
    padding-bottom: 56px;   /* chỗ ký tay */
}

.ktp-tt-ky {
    margin-left: auto;
    width: 440px;
    font-style: italic;
    line-height: 1.8;
}

/* ============================================================================
   KỸ THUẬT — khai báo cột biểu mẫu kéo thả (KT_BieuMau_ChiTieu, class ktbm-*)
   3 cột: Biểu mẫu | kho Chỉ tiêu | Cột trên biểu mẫu, mỗi cột tự cuộn.
   ============================================================================ */
.ktbm-board {
    flex: 1 1 auto;
    min-height: 0;
    display: grid;
    grid-template-columns: 260px minmax(260px, 1fr) minmax(340px, 1.3fr);
    gap: 14px;
}

    .ktbm-board > .it-panel {
        margin: 0;
    }

    /* Tab "Dòng in sẵn": ẩn kho chỉ tiêu, bảng dòng chiếm chỗ */
    .ktbm-board.dong {
        grid-template-columns: 260px minmax(0, 1fr);
    }

        .ktbm-board.dong > .ktbm-kho {
            display: none;
        }

.ktbm-col {
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

/* Tab Cột / Dòng ở đầu cột phải */
.ktbm-tabs {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 8px;
}

    .ktbm-tabs .it-tab {
        padding: 5px 12px;
    }

.ktbm-dong-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.ktbm-dong-sep {
    width: 1px;
    height: 20px;
    background: #dde3ea;
    margin: 0 4px;
}

/* Bảng soạn dòng in sẵn: cấp thụt lề ở cột Tên */
.ktbm-dong {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    border: 1px solid #dde3ea;
    border-radius: 8px;
}

    .ktbm-dong table {
        width: 100%;
        border-collapse: collapse;
        font-size: 13px;
    }

    .ktbm-dong th {
        position: sticky;
        top: 0;
        z-index: 1;
        background: #2f6fb2;
        color: #fff;
        font-weight: 600;
        padding: 6px;
        text-align: left;
    }

    .ktbm-dong td {
        border-top: 1px solid #edf1f5;
        padding: 2px 4px;
    }

        .ktbm-dong td.stt {
            text-align: center;
            color: #90a0b3;
        }

        .ktbm-dong td input:not([type=checkbox]) {
            width: 100%;
            border: 1px solid transparent;
            border-radius: 4px;
            padding: 3px 6px;
            font: inherit;
            background: transparent;
        }

            .ktbm-dong td input:not([type=checkbox]):focus,
            .ktbm-dong tr.sel td input:not([type=checkbox]) {
                border-color: #cfd8e3;
                background: #fff;
                outline: none;
            }

    .ktbm-dong tr.sel td {
        background: #eaf2fb;
    }

    .ktbm-dong tr.nhom td input {
        font-weight: 600;
    }

    .ktbm-dong tr.td td {
        background: #f4f6f9;
    }

        .ktbm-dong tr.td td input {
            font-weight: 700;
        }

    .ktbm-dong tr.moi td.stt {
        color: #2f6fb2;
        font-weight: 700;
    }

.ktbm-list {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding-right: 2px;
}

.ktbm-grp {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: #8a93a0;
    margin: 8px 2px 4px;
}

.ktbm-search {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid #dde3ea;
    border-radius: 6px;
    font: inherit;
    font-size: 13px;
    margin-bottom: 8px;
}

    .ktbm-search:focus {
        outline: none;
        border-color: #2f6fb2;
    }

.ktbm-chk {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 400;
    cursor: pointer;
}

.ktbm-item {
    border: 1px solid #dde3ea;
    border-radius: 6px;
    background: #fff;
    padding: 6px 8px;
    margin-bottom: 6px;
    font-size: 13px;
    cursor: pointer;
    user-select: none;
}

    .ktbm-item:hover {
        border-color: #9dbbe0;
    }

    .ktbm-item.sel {
        border-color: #2f6fb2;
        background: #e8f0f9;
    }

    .ktbm-item.used {
        opacity: .5;
        cursor: default;
    }

    .ktbm-item.doi {
        border-left: 3px solid #f0a020; /* cột mới / đã sửa chi tiết, chưa lưu */
    }

    .ktbm-item.moi {
        border-left: 3px solid #1aa37a; /* chỉ tiêu vừa Thêm nhanh */
        background: #f2fbf7;
    }

    /* Vạch xanh = chỗ sẽ chèn khi thả */
    .ktbm-item.drop-before,
    .ktbm-end.drop-before {
        box-shadow: inset 0 3px 0 #1aa37a;
    }

.ktbm-drag {
    cursor: grab;
}

    .ktbm-drag:active {
        cursor: grabbing;
    }

.ktbm-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ktbm-main {
    flex: 1 1 auto;
    min-width: 0;
}

.ktbm-sub {
    font-size: 11.5px;
    color: #6b7a8a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ktbm-stt {
    flex: 0 0 auto;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #2f6fb2;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.ktbm-tag {
    flex: 0 0 auto;
    font-size: 11px;
    padding: 1px 7px;
    border-radius: 10px;
    background: #eef3f9;
    color: #2f6fb2;
}

    .ktbm-tag.tc {
        background: #e6f6ef;
        color: #178048;
    }

.ktbm-req {
    color: #d93025;
    font-weight: 700;
}

.ktbm-ok {
    color: #1aa37a;
    margin-left: 4px;
}

.ktbm-end {
    border: 1px dashed #c3c9d1;
    border-radius: 6px;
    padding: 10px;
    text-align: center;
    font-size: 12px;
    color: #90a0b3;
}

    .ktbm-tag.nhom {
        background: #fff4e0;
        color: #a86400;
    }

    .ktbm-tag.vitri {
        background: #eaf6ee;
        color: #23804a;
    }

/* Nút icon trong danh sách / bảng (✎ sửa, ✕ bỏ). KHÔNG dùng .it-icobtn: class đó chữ trắng, không nền
   (bên IT luôn kèm màu nền riêng) nên đứng một mình là trắng trên trắng. */
.kt-icobtn {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    color: #6b7683;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
}

    .kt-icobtn:hover {
        background: #eef3f9;
        border-color: #cfd8e3;
        color: #2f6fb2;
    }

    .kt-icobtn.xoa:hover {
        background: #fdecec;
        border-color: #f3c1c1;
        color: #d93025;
    }

/* Ô check trong lưới form (hộp sửa cột): canh đáy cho thẳng hàng ô nhập bên cạnh, chữ sát ô check */
/* .it-grid2 chia 6 track, chỉ .it-fld được span 3 -> phải tự span 3, không thì ô bị bóp còn 1/6 */
.ktbm-fld-chk {
    grid-column: span 3;
    display: flex;
    align-items: flex-end;
    padding-bottom: 9px;
}

    .ktbm-fld-chk .ktbm-chk {
        white-space: nowrap;
    }

    .ktbm-fld-chk .ktbm-chk {
        font-size: 13px;
        color: #1f2733;
    }

    .ktbm-fld-chk input[type=checkbox] {
        width: 16px;
        height: 16px;
        margin: 0;
        cursor: pointer;
    }

/* Form chỉ tiêu (KT_ChiTieu_FormDialog, kiểu it-modal): lưới Danh sách chọn */
.ktct-ds-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 13px;
}

    .ktct-ds-head .it-spacer {
        flex: 1 1 auto;
    }

.ktct-ds-input {
    width: 100%;
    padding: 5px 8px;
    border: 1px solid #cfd8e3;
    border-radius: 6px;
    font: inherit;
    font-size: 13px;
}

    .ktct-ds-input:focus {
        outline: none;
        border-color: #2f6fb2;
    }

.kt-icobtn:disabled {
    opacity: .35;
    cursor: default;
    background: transparent;
    border-color: transparent;
}

/* Dialog viết riêng kiểu it-modal nhưng mở qua MudDialog (KT_ChiTieu_FormDialog, CotChiTietDialog):
   bỏ khung giấy / padding của MudDialog, khung nhìn thấy là .it-modal bên trong. */
.mud-dialog.kt-mud-dialog {
    background: transparent;
    box-shadow: none;
    overflow: visible;
    max-width: 95vw;
}

    .mud-dialog.kt-mud-dialog .kt-mud-content {
        padding: 0 !important;
        margin: 0;
        overflow: visible;
    }

    /* Thay phần .it-modal-back vẫn lo (box-sizing, font, màu chữ) vì giờ không còn lớp nền đó */
    .mud-dialog.kt-mud-dialog .it-modal {
        max-width: 95vw;
        font-family: 'Segoe UI', Roboto, Arial, sans-serif;
        color: #1f2733;
    }

        .mud-dialog.kt-mud-dialog .it-modal * {
            box-sizing: border-box;
        }

/* ============================================================================
   KỸ THUẬT — màn Đánh giá chỉ tiêu: dải phiếu của biểu mẫu + dòng thông tin phiếu
   ============================================================================ */
.kt-phieu-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    padding: 6px 0 10px;
    border-bottom: 1px dashed #dde3ea;
    margin-bottom: 8px;
}

.kt-phieu {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid #cfd8e3;
    background: #fff;
    border-radius: 14px;
    padding: 3px 10px 3px 8px;
    font: inherit;
    font-size: 12.5px;
    color: #2b3a4a;
    cursor: pointer;
}

    .kt-phieu:hover {
        border-color: #2f6fb2;
    }

    .kt-phieu.sel {
        border-color: #2f6fb2;
        background: #eaf1f8;
        font-weight: 600;
    }

    .kt-phieu .dot {
        width: 8px;
        height: 8px;
        border-radius: 50%;
        background: #e0a200; /* Đang nhập */
    }

    .kt-phieu.done .dot {
        background: #2f6fb2; /* Đã kết thúc = chờ QA thẩm tra */
    }

    .kt-phieu.tt .dot {
        background: #1f7a3d; /* Đã thẩm tra */
    }

    .kt-phieu.tl .dot {
        background: #c62828; /* Bị QA trả lại */
    }

    .kt-phieu .n {
        font-size: 11px;
        color: #7a8a9a;
        font-weight: 400;
    }

.kt-phieu-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    font-size: 13px;
    margin-bottom: 8px;
}

    .kt-phieu-info .kt-mo {
        font-size: 12px;
        color: #5a6b7b;
    }

.it-btn.kt-btn-done {
    background: #1f7a3d;
    border-color: #1f7a3d;
}

.it-btn.ghost.kt-btn-xoa {
    color: #b32020;
    border-color: #e7b4b4;
}

/* ---- Thẩm tra (QA) ---- */
.it-pill.kt-cho {
    background: #e3eefa;
    color: #2f6fb2;
}

.kt-tralai {
    border: 1px solid #f0c2c2;
    background: #fff5f5;
    color: #8a1f1f;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 13px;
    margin-bottom: 8px;
}

    .kt-tralai.ok {
        border-color: #bfe3cb;
        background: #f2fbf5;
        color: #1f5a33;
    }

.kt-tt {
    display: flex;
    gap: 10px;
    flex: 1;
    min-height: 0;
}

    .kt-tt-list {
        flex: 0 0 520px;
        display: flex;
        flex-direction: column;
        min-height: 0;
    }

    .kt-tt-xem {
        flex: 1;
        min-width: 0;
        overflow: auto;
        border: 1px solid #dde3ea;
        border-radius: 8px;
        padding: 8px;
        background: #f6f8fa;
    }

.kt-tt-loc {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.kt-tt-dem {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

    .kt-tt-dem button {
        border: 1px solid #cfd8e3;
        background: #fff;
        border-radius: 14px;
        padding: 3px 12px;
        font-size: 12.5px;
        cursor: pointer;
    }

        .kt-tt-dem button.sel {
            border-color: #2f6fb2;
            background: #eaf1f8;
            font-weight: 600;
        }

        .kt-tt-dem button b {
            margin-left: 4px;
        }

.kt-tt-row {
    cursor: pointer;
}

    .kt-tt-row.sel td {
        background: #eaf1f8 !important;
    }

    .kt-tt-row .sub {
        font-size: 11px;
        color: #7a8a9a;
    }

    .kt-tt-list > .ctbl-scroll,
    .kt-tt-list > .ctbl-wrap {
        flex: 1 1 auto;
        min-height: 0;
        overflow: auto;
    }

.kt-tt-sel {
    padding: 4px 8px;
    border: 1px solid #cfd8e3;
    border-radius: 4px;
    font: inherit;
    font-size: 13px;
    background: #fff;
}

.it-btn.kt-btn-xoa-dam {
    background: #b32020;
    border-color: #b32020;
}

/* Bản in: cột tách đánh dấu (✓) */
.ktp-grid td.ktp-tick {
    font-size: 15px;
    padding: 0 2px;
}

/* Tiêu đề phụ (KT_BieuMau.TieuDePhu) */
.ktp-title3 {
    text-align: center;
    font-weight: 700;
    font-size: 13.5px;
    margin: -6px 0 8px;
}

/* Hộp sửa chi tiết cột (CotChiTietDialog): chia nhóm, lưới 2 / 3 cột, ô đánh dấu tự xuống dòng */
.ktcd .ktcd-nhom {
    border: 1px solid #e3e8ef;
    border-radius: 8px;
    padding: 10px 14px 12px;
    margin-bottom: 12px;
}

.ktcd .ktcd-tieude {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    color: #2f6fb2;
    margin-bottom: 8px;
}

    .ktcd .ktcd-tieude span {
        text-transform: none;
        font-weight: 400;
        color: #8a93a0;
        margin-left: 6px;
    }

.ktcd .ktcd-luoi {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 16px;
}

    .ktcd .ktcd-luoi.ba {
        grid-template-columns: 150px minmax(0, 1fr) minmax(0, 1.6fr);
    }

    .ktcd .ktcd-luoi .it-fld {
        display: flex;
        flex-direction: column;
        gap: 4px;
        min-width: 0;
    }

        .ktcd .ktcd-luoi .it-fld input,
        .ktcd .ktcd-luoi .it-fld select,
        .ktcd .ktcd-luoi .it-fld textarea {
            width: 100%;
            min-width: 0;   /* .it-fld input đặt min-width 140px -> tràn ô hẹp, đè sang ô bên cạnh */
            box-sizing: border-box;
            padding: 7px 10px;
        }

.ktcd .ktcd-chk {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 24px;
    margin-top: 10px;
}

    .ktcd .ktcd-chk .ktbm-chk {
        font-size: 13px;
        color: #1f2733;
    }

    .ktcd .ktcd-chk input[type=checkbox] {
        width: 16px;
        height: 16px;
        margin: 0;
    }

/* Danh sách biểu mẫu (Khai báo): tiêu đề cột không xuống dòng, nhóm loại bấm mở / thu gọn, ký hiệu ngắn + biến thể */
.ktbm-h3 {
    white-space: nowrap;
}

.ktbm-grp.mo-dong {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    user-select: none;
    padding: 6px 4px;
    margin: 6px 0 4px;
    border-radius: 6px;
    background: #f4f6f9;
    color: #5a6b7b;
}

    .ktbm-grp.mo-dong:hover {
        background: #eaf2fb;
        color: #2f6fb2;
    }

    .ktbm-grp.mo-dong .mui {
        width: 12px;
        font-size: 12px;
    }

.ktbm-bm {
    display: flex;
    align-items: baseline;
    gap: 6px;
    flex-wrap: wrap;
}

    .ktbm-bm .bt {
        font-size: 11.5px;
        color: #2f6fb2;
    }

.ktbm-2dong {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    white-space: normal;
}

/* Đánh giá: ô chọn biểu mẫu thay cho dải tab */
.kt-chon-bm {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1 1 auto;
    min-width: 0;
    max-width: 760px;
    font-size: 13px;
    font-weight: 600;
    color: #5a6b7b;
}

    .kt-chon-bm select {
        flex: 1 1 auto;
        min-width: 0;
        padding: 7px 10px;
        border: 1px solid #cfd8e3;
        border-radius: 6px;
        font: inherit;
        font-weight: 400;
        color: #1f2733;
        background: #fff;
    }

    .kt-chon-bm .kt-chon-bm-o {
        flex: 1 1 auto;
        min-width: 0;
        font-weight: 400;
    }

        .kt-chon-bm .kt-chon-bm-o .it-cbx {
            width: 100%;
        }

/* Bảng soạn dòng in sẵn: hiện như cây — vạch dọc mỗi cấp, ▾/▸ thu gọn nhóm, └ dòng con */
.ktbm-cay {
    display: flex;
    align-items: center;
    gap: 4px;
}

.ktbm-cay-le {
    flex: 0 0 auto;
    align-self: stretch;
    min-height: 26px;
    background-image: repeating-linear-gradient(to right, transparent 0 8px, #cfd8e3 8px 9px, transparent 9px 18px);
}

.ktbm-cay-mo {
    flex: 0 0 auto;
    width: 20px;
    height: 20px;
    padding: 0;
    border: 1px solid #cfd8e3;
    border-radius: 4px;
    background: #fff;
    color: #2f6fb2;
    font-size: 11px;
    line-height: 1;
    cursor: pointer;
}

    .ktbm-cay-mo:hover {
        background: #eaf2fb;
    }

.ktbm-cay-la {
    flex: 0 0 auto;
    width: 20px;
    text-align: center;
    color: #9aa8b8;
}

.ktbm-cay input {
    flex: 1 1 auto;
    min-width: 0;
}

/* Đánh giá — vùng nhập: đầu phiếu + bảng + cuối phiếu cuộn chung; bảng giãn hết chỗ còn lại, tối thiểu 360px */
.kt-nhap {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    display: flex;
    flex-direction: column;
}

    .kt-nhap > * {
        flex-shrink: 0;
    }

    .kt-nhap > .ctbl-wrap,
    .kt-nhap > .ctbl-scroll {
        flex: 1 1 0;
        min-height: 360px;
    }

/* Hộp thiết kế nhóm tiêu đề cột (NhomCotDialog): tiêu đề như bản in, ô cột kéo được, ô nhóm / ô cột là đích thả */
.knc-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

    .knc-bar .knc-ten {
        width: 220px;
        padding: 6px 10px;
        border: 1px solid #cfd8e3;
        border-radius: 6px;
        font: inherit;
        font-size: 13px;
    }

.knc-khung {
    overflow: auto;
    border: 1px solid #e3e8ef;
    border-radius: 8px;
    padding: 10px;
    background: #f8fafc;
}

.knc-bang {
    border-collapse: collapse;
    min-width: 100%;
    background: #fff;
}

    .knc-bang th {
        border: 1px solid #9aa8b8;
        padding: 6px 8px;
        font-size: 12.5px;
        font-weight: 600;
        text-align: center;
        vertical-align: middle;
        min-width: 70px;
        user-select: none;
    }

        .knc-bang th .t2 {
            font-weight: 400;
            font-style: italic;
            color: #6b7a8a;
            font-size: 11.5px;
        }

        .knc-bang th.nhom {
            background: #eef4fb;
            color: #2f6fb2;
            cursor: pointer;
        }

        .knc-bang th.la {
            background: #fff;
            cursor: grab;
        }

            .knc-bang th.la:hover,
            .knc-bang th.nhom:hover {
                outline: 2px solid #9cc0e6;
                outline-offset: -2px;
            }

        .knc-bang th.chon {
            background: #fff4d6;
            outline: 2px solid #e0a400;
            outline-offset: -2px;
        }

        .knc-bang th.keo {
            opacity: .45;
        }

        .knc-bang th.dich {
            box-shadow: inset 4px 0 0 #2f6fb2;
            background: #e2efff;
        }

        .knc-bang th.nhom.dich {
            box-shadow: inset 0 0 0 3px #2f6fb2;
        }

.knc-ngoai {
    margin-top: 10px;
    padding: 10px;
    border: 2px dashed #cfd8e3;
    border-radius: 8px;
    text-align: center;
    color: #8a96a3;
    font-size: 12.5px;
}

    .knc-ngoai.dich {
        border-color: #2f6fb2;
        color: #2f6fb2;
        background: #eef4fb;
    }

.ktcd .ktcd-nhomcot {
    margin-top: 10px;
    font-size: 12.5px;
    color: #5a6b7b;
}

    .ktcd .ktcd-nhomcot b {
        color: #a86400;
    }

    .ktcd .ktcd-nhomcot span {
        color: #8a96a3;
    }

/* Cột biểu mẫu dạng cây: tiêu chí nhóm (dòng nhóm), khe thả "đứng trước", thả "vào nhóm" */
.ktbm-list .ktbm-khe {
    height: 3px;
    border-radius: 2px;
    transition: height .1s;
}

.ktbm-list.dang-keo .ktbm-khe {
    height: 12px;
}

.ktbm-list .ktbm-khe.on {
    background: #2f6fb2;
}

.ktbm-item.ktbm-cotnhom {
    background: #f4f8fd;
    border-color: #c9dbf0;
}

    .ktbm-item.ktbm-cotnhom .ktbm-main > div:first-child {
        font-weight: 700;
        color: #2f6fb2;
    }

.ktbm-item.drop-vao {
    outline: 2px dashed #2f6fb2;
    outline-offset: -2px;
    background: #e2efff;
}

.ktbm-item .ktbm-cay-la {
    color: #9aa8b8;
    margin-right: 4px;
}

.ktbm-tag.nhom {
    background: #fff4e0;
    color: #a86400;
}

/* Hộp sửa cột: bảng nhãn từng lần lặp (mỗi lần 1 dòng) */
.ktcd .ktcd-lan {
    width: 100%;
    margin-top: 10px;
    border-collapse: collapse;
    border: 1px solid #dde3ea;
    border-radius: 8px;
    overflow: hidden;
    font-size: 13px;
}

    .ktcd .ktcd-lan th {
        background: #2f6fb2;
        color: #fff;
        font-weight: 600;
        text-align: left;
        padding: 7px 10px;
    }

    .ktcd .ktcd-lan td {
        border-top: 1px solid #edf1f5;
        padding: 4px 8px;
    }

        .ktcd .ktcd-lan td.stt {
            text-align: center;
            color: #5a6b7b;
        }

        .ktcd .ktcd-lan td input {
            width: 100%;
            box-sizing: border-box;
            padding: 6px 10px;
            border: 1px solid #cfd8e3;
            border-radius: 6px;
            font: inherit;
        }

/* Form biểu mẫu (BieuMauFormDialog): lưới 4 cột, ô rộng 2 / cả hàng, bảng cấp hạng mục + chữ ký */
.ktcd .ktcd-luoi.bon {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.ktcd .ktcd-luoi .it-fld.hai {
    grid-column: span 2;
}

.ktcd .ktcd-luoi .it-fld.full {
    grid-column: 1 / -1;
}

.ktcd .ktcd-luoi .it-fld textarea {
    resize: vertical;
    min-height: 60px;
    font-family: inherit;
    font-size: 13px;
}

.ktcd .ktcd-goiy {
    color: #8a93a0;
    font-weight: 400;
    margin-left: 4px;
}

.ktcd .ktcd-lan td.ktcd-trong {
    text-align: center;
    color: #8a93a0;
    padding: 10px;
}

.ktcd .ktcd-them {
    margin-top: 8px;
}

/* Đánh giá chỉ tiêu: thanh lọc + lưới phiếu (DanhGiaChiTieu.razor) */
.kt-dg-loc {
    gap: 8px;
    font-size: 13px;
    color: #5a6b7b;
}

    .kt-dg-loc .kt-chon-bm {
        flex: 1 1 420px;
        max-width: 620px;
    }

    .kt-dg-loc .it-spacer {
        flex: 1 1 auto;
    }

.kt-dg-row {
    cursor: pointer;
}

    .kt-dg-row .sub {
        font-size: 11px;
        color: #7a8a9a;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        max-width: 420px;
    }

/* Hộp đánh giá phiếu (PhieuDanhGiaDialog): gần toàn màn, phần trên cố định, thân tab cuộn */
.mud-dialog.kt-mud-dialog .it-modal.ktpd {
    width: 95vw;
    max-width: 95vw;
    height: 92vh;
    display: flex;
    flex-direction: column;
}

.ktpd .ktpd-bm {
    font-weight: 400;
    opacity: .85;
    margin-left: 10px;
    font-size: 13px;
}

.ktpd .ktpd-top {
    flex: 0 0 auto;
    padding: 10px 20px 0;
}

    .ktpd .ktpd-top .it-spacer {
        flex: 1 1 auto;
    }

.ktpd .ktpd-tabs {
    align-items: center;
    margin-bottom: 0;
}

.ktpd .ktpd-loi {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #d33;
    margin-left: 6px;
    vertical-align: middle;
}

.ktpd .ktpd-body {
    padding: 12px 20px 14px;
    flex: 1 1 auto;
    min-height: 0;
}

.ktpd .it-modal-head,
.ktpd .it-modal-foot {
    flex: 0 0 auto;
}

.ktpd .ktpd-khung {
    border: 1px solid #dde3ea;
    border-radius: 8px;
    padding: 12px 16px;
}

.ktpd .ktpd-bmct {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
    font-size: 12px;
    color: #5a6b7b;
}

.ktpd .ktpd-ten {
    text-align: center;
    font-weight: 700;
    font-size: 16px;
    text-transform: uppercase;
    margin-top: 6px;
}

.ktpd .ktpd-ten2 {
    text-align: center;
    font-weight: 600;
    font-size: 13px;
}

.ktpd .ktpd-oluoi {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 10px 20px;
    margin-top: 12px;
    font-size: 13px;
}

.ktpd .ktpd-onhan {
    color: #5a6b7b;
    margin-bottom: 3px;
}

.ktpd .ktpd-oinsan {
    padding: 6px 8px;
    background: #f4f6f9;
    border-radius: 4px;
    font-weight: 600;
}

.ktpd .ktpd-yc {
    font-size: 12.5px;
    margin-top: 10px;
}

.ktpd .ktpd-body > .ktp-wrap {
    flex: 1 1 auto;
}

/* Nút "Đ ↓" (điền Đ cả cột) trên tiêu đề xanh của bảng nhập: nền trong, chữ / viền trắng */
.kt-dien-cot {
    display: block;
    margin-top: 4px;
    padding: 1px 10px;
    border: 1px solid rgba(255, 255, 255, .7);
    border-radius: 5px;
    background: transparent;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

    .kt-dien-cot:hover {
        background: rgba(255, 255, 255, .18);
    }
