/*
 * Bộ quy chuẩn giao diện 2026-11 (theo bản thiết kế "giao diện D2D" của C:\DUAN\Work_D2D):
 * chủ đạo xanh lục đậm #252D6D trên nền xám ấm, menu 2 tầng (cột phân hệ + bảng chức năng), lưới dữ liệu ở css/luoi.css + js/luoi.js.
 * Quy ước: chữ nội dung 14px, chữ bảng 13px, nhãn nhỏ nhất 12px, tiêu đề trang 20px; bo góc ô nhập/nút 6px, thẻ 8px.
 */
:root {
  /* Bảng màu theo bản thiết kế "giao diện D2D" (11/2026): xanh lục đậm #252D6D trên nền xám ấm #F5F6F8, font Inter (cùng Work_D2D, tự lưu ở wwwroot/fonts/inter).
     Giữ tên biến --pti-* để các trang đang dùng không phải sửa. */
  --pti-primary: #252D6D; --pti-primary-dam: #1B2253; --pti-primary-chu: #1B2253; --pti-primary-nen: #EEF0FA; --pti-primary-vien: #CCD1EA;
  --pti-sidebar: #FFFFFF; --pti-ink: #121826; --pti-ink-2: #3D4552;
  --pti-nen: #F5F6F8; --pti-be-mat: #FFFFFF; --pti-vien: #E3E6EB; --pti-vien-2: #EEF0F3; --pti-ctl: #CDD2DA; --pti-hover: #F0F2F5; --pti-phu: #5B6474;
  --pti-thanh-cong: #1F7A55; --pti-canh-bao: #B45309; --pti-loi: #B42318; --pti-tong-dai: #0EA5A4;
  --pti-ray: #252D6D; --pti-ray-chon: #353F86; --pti-ray-chu: #DCE0F4; --pti-ray-logo: #AAB4F0;
  --pti-bong: 0 12px 32px rgba(18, 24, 38, .14);
  --bs-primary: #252D6D; --bs-primary-rgb: 37, 45, 109; --bs-primary-text-emphasis: #1B2253; --bs-primary-bg-subtle: #EEF0FA; --bs-primary-border-subtle: #CCD1EA;
  --bs-secondary: #5B6474; --bs-secondary-rgb: 91, 100, 116; --bs-secondary-color: #5B6474; --bs-tertiary-color: #8A93A3;
  --bs-success: #1F7A55; --bs-success-rgb: 31, 122, 85; --bs-success-text-emphasis: #1F7A55; --bs-success-bg-subtle: #E5F4EC; --bs-success-border-subtle: #BFE3CF;
  --bs-warning: #F59E0B; --bs-warning-rgb: 245, 158, 11; --bs-warning-text-emphasis: #7A4500; --bs-warning-bg-subtle: #FFF4E0; --bs-warning-border-subtle: #F5D9A8;
  --bs-danger: #B42318; --bs-danger-rgb: 180, 35, 24; --bs-danger-text-emphasis: #B42318; --bs-danger-bg-subtle: #FDECEC; --bs-danger-border-subtle: #F3B4AE;
  --bs-info-text-emphasis: #0B5ED7; --bs-info-bg-subtle: #E8F1FF; --bs-info-border-subtle: #C8DCFA;
  --bs-light: #F8F9FB; --bs-light-rgb: 248, 249, 251; --bs-secondary-bg: #E3E6EB; --bs-tertiary-bg: #F5F6F8;
  --bs-body-color: #121826; --bs-body-color-rgb: 18, 24, 38; --bs-emphasis-color: #121826;
  --bs-link-color: #252D6D; --bs-link-color-rgb: 37, 45, 109; --bs-link-hover-color: #1B2253; --bs-link-hover-color-rgb: 27, 34, 83;
  --bs-border-color: #E3E6EB; --bs-border-color-translucent: rgba(18, 24, 38, .1);
  --bs-border-radius: 8px; --bs-border-radius-sm: 6px; --bs-border-radius-lg: 12px;
  --bs-focus-ring-color: rgba(37, 45, 109, .2);
  --bs-body-font-size: 14px;
  --bs-font-sans-serif: "Inter", "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
}
html, body { font-size: 14px; }
body { background: var(--pti-nen); color: var(--pti-ink); -webkit-font-smoothing: antialiased; }
a { color: var(--pti-primary); }
a:hover { color: var(--pti-primary-dam); }
.mono, .ma-so { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.so { font-variant-numeric: tabular-nums; }
.tieu-de-trang { font-size: 20px; line-height: 28px; font-weight: 600; letter-spacing: 0; margin: 0; }
.tieu-de-khoi { font-size: 15px; line-height: 22px; font-weight: 600; }
.chu-thich { font-size: 13px; color: var(--pti-phu); }

/* Bootstrap theo bảng màu mới: nút, ô nhập, phân trang, tab, menu thả, huy hiệu */
.btn { --bs-btn-font-weight: 500; }
.btn-primary { --bs-btn-bg: var(--pti-primary); --bs-btn-border-color: var(--pti-primary); --bs-btn-hover-bg: var(--pti-primary-dam); --bs-btn-hover-border-color: var(--pti-primary-dam);
  --bs-btn-active-bg: var(--pti-primary-dam); --bs-btn-active-border-color: var(--pti-primary-dam); --bs-btn-disabled-bg: var(--pti-primary); --bs-btn-disabled-border-color: var(--pti-primary); --bs-btn-focus-shadow-rgb: 37, 45, 109; }
.btn-outline-primary { --bs-btn-color: var(--pti-primary); --bs-btn-border-color: var(--pti-primary); --bs-btn-hover-bg: var(--pti-primary); --bs-btn-hover-border-color: var(--pti-primary);
  --bs-btn-active-bg: var(--pti-primary); --bs-btn-active-border-color: var(--pti-primary); --bs-btn-disabled-color: var(--pti-primary); --bs-btn-disabled-border-color: var(--pti-primary); --bs-btn-focus-shadow-rgb: 37, 45, 109; }
.btn-light { --bs-btn-bg: var(--pti-be-mat); --bs-btn-border-color: var(--pti-ctl); --bs-btn-color: var(--pti-ink); --bs-btn-hover-bg: var(--pti-hover); --bs-btn-hover-border-color: var(--pti-ctl); --bs-btn-hover-color: var(--pti-ink);
  --bs-btn-active-bg: var(--pti-vien); --bs-btn-active-border-color: var(--pti-ctl); --bs-btn-disabled-bg: var(--pti-be-mat); --bs-btn-disabled-border-color: var(--pti-vien); }
.btn-light.border { border-color: var(--pti-ctl) !important; }
.btn-link { --bs-btn-font-weight: 500; text-decoration: none; }
.btn-link:hover { text-decoration: underline; }
.form-control, .form-select, .input-group-text { border-color: var(--pti-ctl); }
.form-control::placeholder { color: var(--pti-phu); }
.form-control:focus, .form-select:focus { border-color: var(--pti-primary); box-shadow: 0 0 0 .2rem rgba(37, 45, 109, .16); }
.form-check-input { border-color: var(--pti-ctl); }
.form-check-input:checked { background-color: var(--pti-primary); border-color: var(--pti-primary); }
.form-check-input:focus { border-color: #7CC7B2; box-shadow: 0 0 0 .2rem rgba(37, 45, 109, .16); }
.form-label { font-size: 12px; line-height: 16px; font-weight: 500; color: var(--pti-ink-2); margin-bottom: 3px; }
/* Mật độ form theo mẫu: ô nhập / nút cao 32px (cỡ nhỏ 28px), các trường cách nhau 10–12px thay vì 14–16px của Bootstrap */
.btn { --bs-btn-padding-y: .3rem; }
.btn-sm { --bs-btn-padding-y: .2rem; }
.form-control, .form-select, .input-group-text { padding-top: .3rem; padding-bottom: .3rem; }
.form-control, .form-select { min-height: 32px; }
.form-control-sm, .form-select-sm, .input-group-sm > .form-control, .input-group-sm > .form-select, .input-group-sm > .input-group-text { min-height: 28px; padding-top: .2rem; padding-bottom: .2rem; }
.row.g-3:has(> [class*="col"] > .form-label), .row.g-3:has(> [class*="col"] > .form-check) { --bs-gutter-x: 12px; --bs-gutter-y: 10px; }
.mb-3:has(> .form-label) { margin-bottom: 10px !important; }
.modal-header { padding: 12px 16px; }
.modal-body { padding: 14px 16px; }
.modal-footer { padding: 8px 12px; }
.modal-title { font-size: 15px; line-height: 22px; font-weight: 600; }
.offcanvas-title { font-size: 15px; line-height: 22px; font-weight: 600; }
.form-range::-webkit-slider-thumb { background: var(--pti-primary); }
.pagination { --bs-pagination-active-bg: var(--pti-primary); --bs-pagination-active-border-color: var(--pti-primary); --bs-pagination-focus-box-shadow: 0 0 0 .2rem rgba(37, 45, 109, .16); --bs-pagination-hover-bg: var(--pti-hover); --bs-pagination-focus-bg: var(--pti-hover); }
.nav-pills { --bs-nav-pills-link-active-bg: var(--pti-primary); }
/* Tab kiểu gạch chân như .ax-tabs của mẫu */
.nav-tabs { --bs-nav-tabs-border-color: var(--pti-vien); --bs-nav-tabs-link-active-color: var(--pti-primary-chu); --bs-nav-tabs-link-active-bg: transparent; }
.nav-tabs .nav-link { border: 0; border-bottom: 2px solid transparent; border-radius: 0; margin-bottom: -1px; color: var(--pti-ink-2); font-weight: 500; }
.nav-tabs .nav-link:hover { color: var(--pti-ink); border-bottom-color: var(--pti-ctl); }
.nav-tabs .nav-link.active { color: var(--pti-primary-chu); border-bottom-color: var(--pti-primary); font-weight: 600; }
.dropdown-menu { --bs-dropdown-border-color: var(--pti-vien); --bs-dropdown-border-radius: 8px; --bs-dropdown-link-hover-bg: var(--pti-hover); --bs-dropdown-link-active-bg: var(--pti-primary-nen); --bs-dropdown-link-active-color: var(--pti-primary-chu); box-shadow: var(--pti-bong); }
.list-group { --bs-list-group-active-bg: var(--pti-primary); --bs-list-group-active-border-color: var(--pti-primary); --bs-list-group-action-hover-bg: var(--pti-hover); }
.progress, .progress-stacked { --bs-progress-bar-bg: var(--pti-primary); --bs-progress-bg: var(--pti-vien-2); }
.modal-content { border-color: var(--pti-vien); border-radius: 8px; box-shadow: var(--pti-bong); }
.offcanvas { --bs-offcanvas-border-color: var(--pti-vien); }
.badge { font-weight: 500; }
.alert { --bs-alert-border-radius: 8px; }

/* Thành phần theo bản thiết kế "giao diện D2D": nút bo 10px, bảng tiêu đề xám nhạt, nhãn dạng viên thuốc nền nhạt */
.tieu-de-trang { font-size: 22px; line-height: 30px; font-weight: 700; letter-spacing: -.01em; }
.btn { --bs-btn-font-weight: 600; --bs-btn-border-radius: 10px; }
.btn-sm { --bs-btn-border-radius: 8px; }
.form-control, .form-select { border-radius: 8px; }
.table { --bs-table-hover-bg: #F8FAF9; }
.table > thead > tr > th, thead.table-light th { background: #F8F9FB !important; color: var(--pti-phu); font-size: 12px; font-weight: 600; border-bottom: 1px solid var(--pti-vien); white-space: nowrap; }
.table > tbody > tr > td { border-color: var(--pti-vien-2); }
.badge { border-radius: 999px; font-weight: 600; padding: .38em .75em; }
.text-bg-success { background: #E5F4EC !important; color: #1F7A55 !important; }
.text-bg-warning { background: #FFF4E0 !important; color: #7A4500 !important; }
.text-bg-danger { background: #FDECEC !important; color: #B42318 !important; }
.text-bg-info { background: #E8F1FF !important; color: #0B5ED7 !important; }
.text-bg-primary { background: #EEF0FA !important; color: #1B2253 !important; }
.text-bg-secondary { background: #EEF1F4 !important; color: #4A5763 !important; }
.list-group { --bs-list-group-active-bg: var(--pti-primary-nen); --bs-list-group-active-color: var(--pti-primary-chu); --bs-list-group-active-border-color: var(--pti-vien-2); }
.alert-warning { --bs-alert-bg: #FFF4E0; --bs-alert-border-color: #F5D9A8; --bs-alert-color: #7A4500; }
.alert-info { --bs-alert-bg: #E8F1FF; --bs-alert-border-color: #C8DCFA; --bs-alert-color: #0B5ED7; }
.alert-success { --bs-alert-bg: #E5F4EC; --bs-alert-border-color: #BFE3CF; --bs-alert-color: #1F7A55; }

/* Khung ứng dụng (MH-HT-02) — menu 2 tầng theo bản thiết kế "giao diện D2D":
   cột phân hệ 72px nền xanh đậm + bảng chức năng 236px của phân hệ đang chọn; thanh trên 64px. */
.app { display: flex; min-height: 100vh; }
.sidebar { width: 308px; flex: 0 0 308px; background: var(--pti-sidebar); color: var(--pti-ink-2); border-right: 1px solid var(--pti-vien); display: flex; flex-direction: column; position: sticky; top: 0; height: 100dvh; overflow: hidden; }
.menu-2-tang { display: flex; flex: 1; min-height: 0; }
.ray-phan-he { flex: none; width: 72px; background: var(--pti-ray); display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 0; overflow-y: auto; scrollbar-width: none; }
.ray-phan-he .logo-ray { width: 40px; height: 40px; border-radius: 10px; background: var(--pti-ray-logo); color: var(--pti-ray); display: flex; align-items: center; justify-content: center; font-size: 20px; margin-bottom: 8px; text-decoration: none; flex: none; }
.ray-phan-he .logo-ray img { width: 100%; height: 100%; object-fit: contain; border-radius: 9px; background: #fff; }
.ray-phan-he .logo-ray span { font-size: 11px; font-weight: 800; letter-spacing: .02em; line-height: 1; }
.ray-phan-he .nut-phan-he { width: 60px; padding: 8px 2px 6px; border-radius: 12px; display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--pti-ray-chu); text-decoration: none; flex: none; }
.ray-phan-he .nut-phan-he .bi { font-size: 20px; line-height: 1; }
.ray-phan-he .nut-phan-he span { font-size: 10.5px; line-height: 1.3; text-align: center; text-wrap: balance; }
.ray-phan-he .nut-phan-he:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.ray-phan-he .nut-phan-he.dang-chon, .ray-phan-he .nut-phan-he.dang-xem { background: var(--pti-ray-logo); color: var(--pti-ray); font-weight: 600; }
.ray-phan-he .nut-phan-he:focus-visible, .ray-phan-he .logo-ray:focus-visible { outline: 2px solid #fff; outline-offset: 1px; }
.bang-chuc-nang { width: 236px; flex: none; display: flex; flex-direction: column; min-height: 0; overflow-y: auto; }
.tim-menu { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; gap: 8px; margin: 0 12px; padding: 16px 0 8px; background: var(--pti-sidebar); color: var(--pti-phu); }
.tim-menu > .bi { position: absolute; left: 10px; pointer-events: none; font-size: 14px; }
.tim-menu input { width: 100%; min-width: 0; height: 36px; padding: 6px 8px 6px 32px; border: 1px solid var(--pti-vien); border-radius: 8px; background: var(--pti-sidebar); color: var(--pti-ink); font: inherit; font-size: 13px; }
.tim-menu input:focus-visible { outline: 2px solid var(--pti-primary); outline-offset: 1px; }
.menu-khong-ket-qua { margin: 8px 20px; font-size: 13px; color: var(--pti-phu); }
.menu a.muc[hidden], .menu li[hidden], .tieu-de-muc[hidden], .menu-khong-ket-qua[hidden] { display: none; }
.nut-menu-may-tinh { width: 40px; height: 40px; flex: none; display: inline-flex; align-items: center; justify-content: center; padding: 0; }
@media (max-width: 767px) { .nut-menu-may-tinh { display: none; } }
.bang-phan-he { padding: 16px 12px 20px; display: flex; flex-direction: column; gap: 2px; }
.bang-phan-he[hidden] { display: none; }
.bang-phan-he .dau-bang { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 6px 12px; }
.bang-phan-he .dau-bang h2 { margin: 0; font-size: 16px; font-weight: 700; color: var(--pti-ink); }
.nut-thu-gon { width: 30px; height: 30px; border: 0; border-radius: 8px; background: var(--pti-hover); color: var(--pti-ink-2); flex: none; }
.nut-thu-gon:hover { background: var(--pti-vien); }
.bang-phan-he .tieu-de-muc { margin: 14px 0 4px; padding: 0 8px; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--pti-phu); }
.menu { list-style: none; padding: 0; margin: 0; }
.menu li + li { margin-top: 1px; }
.menu .menu-con { list-style: none; padding: 1px 0 2px 14px; margin: 0; }
.menu a.muc { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 8px; color: var(--pti-ink); border-radius: 8px; text-decoration: none; line-height: 20px; transition: background-color .15s, color .15s; }
.menu a.muc > .bi { flex: none; width: 18px; font-size: 16px; text-align: center; color: var(--pti-phu); }
.menu a.muc > span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.menu a.muc:hover { background: var(--pti-nen); color: var(--pti-ink); }
.menu a.muc:hover > .bi { color: var(--pti-primary); }
.menu a.muc.dang-chon { background: var(--pti-primary-nen); color: var(--pti-primary-chu); font-weight: 600; }
.menu a.muc.dang-chon > .bi { color: var(--pti-primary); }
.menu a.muc:focus-visible, .nut-thu-gon:focus-visible { outline: 2px solid var(--pti-primary); outline-offset: 1px; }
/* Thu gọn: chỉ còn cột phân hệ; bấm một phân hệ thì bảng chức năng nổi lên trên nội dung */
body.menu-gon .sidebar { width: 72px; flex-basis: 72px; overflow: visible; }
body.menu-gon .bang-chuc-nang { display: none; position: absolute; left: 72px; top: 0; bottom: 0; background: #fff; border-right: 1px solid var(--pti-vien); box-shadow: var(--pti-bong); z-index: 55; }
body.menu-gon .sidebar.bang-mo .bang-chuc-nang { display: flex; }
.noi-dung { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.thanh-tren { height: 64px; flex: none; background: var(--pti-be-mat); border-bottom: 1px solid var(--pti-vien); display: flex; align-items: center; gap: 16px; padding: 0 24px; position: sticky; top: 0; z-index: 20; }
.thanh-tren .tim { flex: 1; max-width: 460px; }
.thanh-tren .tim .input-group-text, .thanh-tren .tim .form-control { background: var(--pti-nen); }
.thanh-tren .tim .input-group-text { border-radius: 10px 0 0 10px; border-right: 0; color: var(--pti-phu); }
.thanh-tren .tim .form-control { border-radius: 0 10px 10px 0; border-left: 0; min-height: 38px; }
.thanh-tren .btn, .thanh-tren .form-control, .thanh-tren .input-group-text { --bs-btn-padding-y: .35rem; padding-top: .35rem; padding-bottom: .35rem; }
.thanh-tren .btn.border { border-radius: 10px; }
.vung-chinh { padding: 20px 24px 32px; width: 100%; }   /* dùng hết bề ngang màn hình lớn (13/11/2026: bỏ giới hạn 1480px để không dư khoảng trống bên phải) */
.the { background: var(--pti-be-mat); border: 1px solid var(--pti-vien); border-radius: 12px; }
.the-dau { padding: 14px 18px; border-bottom: 1px solid var(--pti-vien-2); display: flex; align-items: center; gap: 8px; font-weight: 600; }
.the-than { padding: 16px 18px; }
.chuong { position: relative; }
.chuong .badge-so { position: absolute; top: -4px; right: -6px; font-size: 10px; }
.thong-bao-moi { max-height: 420px; overflow-y: auto; width: 360px; }
.thong-bao-moi .chua-doc::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--pti-primary); margin-right: 6px; }
.banner-ho-tro { background: var(--pti-loi); color: #fff; padding: 8px 20px; font-weight: 600; display: flex; align-items: center; gap: 12px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--pti-ray); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 600; font-size: 12px; }
/* Màn vừa (768–1279px): tự thu về cột phân hệ, bảng chức năng nổi khi bấm */
@media (min-width: 768px) and (max-width: 1279px) {
  .sidebar { width: 72px; flex-basis: 72px; overflow: visible; }
  .bang-chuc-nang { display: none; position: absolute; left: 72px; top: 0; bottom: 0; background: #fff; border-right: 1px solid var(--pti-vien); box-shadow: var(--pti-bong); z-index: 55; }
  .sidebar.bang-mo .bang-chuc-nang { display: flex; }
}
@media (max-width: 767px) { .vung-chinh { padding: 16px; } }

/* Trang xác thực (MH-HT-01) */
.the-cong-ty { display: flex; gap: 14px; align-items: center; padding: 14px 16px; border: 1px solid var(--pti-vien); border-radius: 8px; background: #fff; width: 100%; text-align: left; }
.the-cong-ty:hover:not(:disabled) { border-color: var(--pti-primary); box-shadow: 0 0 0 3px rgba(37, 45, 109,.12); }
.the-cong-ty:disabled { opacity: .55; cursor: not-allowed; }
.the-cong-ty .chu-cai { width: 44px; height: 44px; border-radius: 8px; background: var(--pti-primary-nen); color: var(--pti-primary-chu); font-weight: 700; display: flex; align-items: center; justify-content: center; }

/* Ô lỗi theo chiTiet[] (00 §4.6) */
.is-invalid + .invalid-feedback, .invalid-feedback.d-block { display: block; }
.toast-container { z-index: 1090; }
.bang-quyen td, .bang-quyen th { padding: 6px 8px; vertical-align: middle; }
.bang-quyen .ghi-de { outline: 2px solid var(--pti-canh-bao); outline-offset: -2px; }

/* KH — MH-KH-01/02/03 (thietke CRM-PTI-01) */
.pill-tt { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--pti-vien); background: #fff; font-size: 13px; color: var(--pti-ink); white-space: nowrap; }
.pill-tt .cham { width: 8px; height: 8px; border-radius: 50%; }
.pill-tt .dem { color: var(--pti-phu); font-variant-numeric: tabular-nums; }
.pill-tt.dang-chon { border-color: var(--pti-primary); background: var(--pti-primary-nen); color: var(--pti-primary-chu); font-weight: 600; }
.badge-mau { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 500; border: 1px solid transparent; }
.av-kh { width: 26px; height: 26px; border-radius: 50%; background: var(--pti-primary-nen); color: var(--pti-primary-chu); display: inline-flex; align-items: center; justify-content: center; font-weight: 600; font-size: 11px; flex: 0 0 26px; }
.av-kh.to-chuc { border-radius: 6px; background: #fff4e5; color: #b45309; }
.sdt-chung::after { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--pti-canh-bao); margin-left: 6px; vertical-align: middle; }
.bang-kh td { white-space: nowrap; }
.bang-kh tbody tr { cursor: pointer; }
.thanh-chon { background: var(--pti-primary-nen); border-bottom: 1px solid var(--pti-vien); padding: 8px 16px; display: flex; gap: 8px; align-items: center; }
.o-trung-vang { border-color: var(--pti-canh-bao) !important; box-shadow: 0 0 0 3px rgba(232,163,23,.15); }
.o-trung-do { border-color: var(--pti-loi) !important; box-shadow: 0 0 0 3px rgba(229,72,77,.15); }
.khoi-form { background: #fff; border: 1px solid var(--pti-vien); border-radius: 8px; padding: 14px 16px; margin-bottom: 12px; }
.khoi-form h6 { font-weight: 600; margin-bottom: 10px; }
.chon-nhieu { border: 1px solid var(--pti-vien); border-radius: 8px; padding: 6px; min-height: 38px; max-height: 160px; overflow: auto; background: #fff; }
.chon-nhieu .form-check { margin: 2px 4px; }
.dong-pt { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-bottom: 1px dashed var(--pti-vien); }
.dong-pt:last-child { border-bottom: 0; }

/* TD — thẻ "Cuộc gọi đến" nổi ở tab chính (04 TN-TD-09 / TN-TD-52): từ popup softphone hoặc từ webhook tổng đài */
@keyframes the-cuoc-den-rung { 0%, 100% { transform: rotate(0); } 20% { transform: rotate(-14deg); } 40% { transform: rotate(12deg); } 60% { transform: rotate(-8deg); } 80% { transform: rotate(6deg); } }
@keyframes the-cuoc-den-hien { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.the-cuoc-den { position: fixed; right: 16px; bottom: 16px; z-index: 2000; width: min(360px, calc(100vw - 32px)); background: #fff; border: 1px solid var(--pti-primary); border-radius: 14px; box-shadow: 0 12px 32px rgba(15, 23, 42, .22); padding: 14px 16px; animation: the-cuoc-den-hien .2s ease-out; }
.the-cuoc-den-dau { display: flex; align-items: center; gap: 12px; }
.the-cuoc-den-o { width: 42px; height: 42px; border-radius: 50%; background: var(--pti-primary-nen); color: var(--pti-primary-chu); display: inline-flex; align-items: center; justify-content: center; font-size: 20px; flex: 0 0 42px; }
.the-cuoc-den-o i { animation: the-cuoc-den-rung 1.2s infinite; transform-origin: 50% 60%; }
.the-cuoc-den-nhan { font-size: 12px; color: var(--pti-phu); text-transform: uppercase; letter-spacing: .3px; }
.the-cuoc-den-so { font-size: 22px; font-weight: 700; letter-spacing: .5px; font-variant-numeric: tabular-nums; }
.the-cuoc-den-khach { margin-top: 10px; font-weight: 600; }
.the-cuoc-den-phu { font-size: 13px; color: var(--pti-phu); }
.the-cuoc-den-nut { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.the-cuoc-den-nut .btn { flex: 1 1 auto; font-weight: 600; }
body.m .the-cuoc-den { bottom: calc(var(--m-tab, 64px) + 12px + env(safe-area-inset-bottom)); }
@media (prefers-reduced-motion: reduce) { .the-cuoc-den, .the-cuoc-den-o i { animation: none; } }

/* Chọn nhiều người dạng chip (CS.chonNhieuNguoi) */
.crm-chon-nhieu__hop { min-height: calc(1.5em + .75rem + 2px); padding: .25rem .5rem; cursor: text; }
.crm-chon-nhieu__hop:focus-within { border-color: var(--bs-primary); box-shadow: 0 0 0 .2rem rgba(var(--bs-primary-rgb), .15); }
.crm-chon-nhieu__tim { outline: 0; min-width: 9rem; padding: .125rem 0; background: transparent; color: inherit; }
.crm-chon-nhieu__kq { z-index: 1070; max-height: 240px; overflow: auto; top: 100%; }
.crm-chon-nhieu__kq .list-group-item.active .text-muted { color: inherit !important; }
.crm-chip { display: inline-flex; align-items: center; gap: .35rem; padding: .125rem .25rem .125rem .125rem; border-radius: 999px; background: rgba(var(--bs-primary-rgb), .1); font-size: .8125rem; line-height: 1.4; max-width: 100%; }
.crm-chip__ten { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crm-chip__avt { flex: 0 0 auto; display: inline-grid; place-items: center; width: 1.375rem; height: 1.375rem; border-radius: 50%; background: var(--bs-primary); color: #fff; font-size: .625rem; font-weight: 600; }
.crm-chip__bo { border: 0; background: transparent; color: inherit; opacity: .6; padding: 0 .25rem; line-height: 1; font-size: 1rem; }
.crm-chip__bo:hover, .crm-chip__bo:focus-visible { opacity: 1; }

/* KH/CongViec — bố cục học từ Work_D2D (thiết kế 13) */
.cv-thanh { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; background: var(--bs-body-bg); border: 1px solid var(--bs-border-color); border-bottom: 0; border-radius: .75rem .75rem 0 0; padding: 8px 12px; }
.cv-thanh.cv-thanh--roi { border-bottom: 1px solid var(--bs-border-color); border-radius: .75rem; }
.cv-thanh > select, .cv-thanh label > select { height: 34px; padding: 0 4px; border: 0; background: transparent; color: var(--bs-secondary-color); cursor: pointer; }
.cv-thanh select.is-dam { color: var(--bs-body-color); font-weight: 600; }
.cv-thanh > label { display: flex; align-items: center; gap: 4px; color: var(--bs-secondary-color); margin: 0; font-size: .875rem; }
.cv-thanh__them { display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 10px; border: 0; background: transparent; color: var(--bs-primary); font-weight: 700; }
.cv-thanh__them span { width: 22px; height: 22px; border-radius: 50%; background: var(--bs-primary); color: #fff; display: grid; place-items: center; font-size: 16px; line-height: 1; }
.cv-thanh__vach { width: 1px; height: 22px; background: var(--bs-border-color); margin: 0 6px; }
.cv-thanh__gian { flex: 1; }
.cv-thanh__tim { height: 32px; padding: 0 10px; border: 1px solid var(--bs-border-color); border-radius: .5rem; min-width: 200px; background: var(--bs-body-bg); color: inherit; }
.cv-thanh__them-loc { flex-wrap: wrap; gap: 10px; align-items: flex-end; padding: 10px 0 4px; border-top: 1px dashed var(--bs-border-color); margin-top: 6px; }
.cv-bang { background: var(--bs-body-bg); border: 1px solid var(--bs-border-color); border-radius: 0 0 .75rem .75rem; min-width: 0; }
.cv-bang__cuon { overflow-x: auto; }
.cv-bang__bang { width: max-content; min-width: 100%; border-collapse: collapse; table-layout: fixed; }
.cv-bang__bang thead th { height: 42px; padding: 0 12px; font-size: 12px; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; color: var(--bs-secondary-color); border-top: 1px solid var(--bs-border-color); border-bottom: 1px solid var(--bs-border-color); text-align: left; background: var(--bs-body-bg); }
.cv-bang__bang td { padding: 0 12px; height: 44px; border-bottom: 1px solid var(--bs-border-color-translucent); white-space: nowrap; font-size: 14px; vertical-align: middle; }
.cv-bang__co-dinh { position: sticky; left: 0; z-index: 1; background: var(--bs-body-bg); border-right: 2px solid var(--bs-border-color); }
.cv-bang__o { display: flex; align-items: center; gap: 10px; min-width: 0; height: 100%; }
.cv-bang__dau-nhom > * { height: 40px; background: var(--bs-tertiary-bg) !important; border-bottom: 1px solid var(--bs-border-color); }
.cv-bang__dau-nhom th { padding: 0 14px 0 6px; font-weight: 400; vertical-align: middle; }
.cv-bang__dau-nhom h2 { margin: 0; font-size: 15px; font-weight: 700; }
.cv-bang__dau-nhom h2.is-tre { color: var(--bs-danger); }
.cv-bang__mo { width: 28px; height: 28px; border: 0; background: transparent; color: var(--bs-secondary-color); }
.cv-bang__nhom.is-dong > tr:not(.cv-bang__dau-nhom) { display: none; }
.cv-bang__dong { cursor: pointer; }
.cv-bang__dong:hover > td { background: var(--bs-tertiary-bg); }
.cv-bang__ten { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--bs-body-color); text-decoration: none; }
.cv-bang__ten:hover { color: var(--bs-primary); text-decoration: underline; }
.cv-bang__phu { flex: none; font-size: 12px; color: var(--bs-secondary-color); }
.cv-bang__dong.is-xong .cv-bang__ten { color: var(--bs-success); text-decoration: line-through; }
.cv-bang__dong.is-huy .cv-bang__ten { color: var(--bs-secondary-color); text-decoration: line-through; }
.cv-bang__cat { overflow: hidden; text-overflow: ellipsis; }
.cv-bang__nhan { display: flex; gap: 4px; align-items: center; overflow: hidden; }
.cv-bang__bang td.is-tre { color: var(--bs-danger); font-weight: 700; }
.cv-bang__bang td.is-sap { color: var(--bs-warning-text-emphasis); font-weight: 600; }
.cv-bang__tao td { height: 38px; }
.cv-bang__tao-o { display: flex; align-items: center; gap: 14px; flex: 1; }
.cv-bang__tao-o span { color: var(--bs-secondary-color); font-size: 18px; }
.cv-bang__tao-o input { flex: 1; height: 30px; border: 0; outline: none; background: transparent; color: inherit; }
.cv-vong { flex: none; width: 22px; height: 22px; border-radius: 50%; padding: 0; border: 2px solid var(--bs-secondary-color); background: var(--bs-body-bg); color: transparent; font-size: 12px; display: grid; place-items: center; }
.cv-vong:not(:disabled):hover, .cv-vong:not(:disabled):focus-visible { border-color: var(--bs-success); color: var(--bs-success); }
.cv-vong.is-xong { border: 0; background: var(--bs-success); color: #fff; opacity: 1; }
.cv-pill { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.cv-pill--tre { background: var(--bs-danger-bg-subtle); color: var(--bs-danger-text-emphasis); }
.cv-pill--sap { background: var(--bs-warning-bg-subtle); color: var(--bs-warning-text-emphasis); }
.cv-pill--ut { background: var(--bs-primary-bg-subtle); color: var(--bs-primary-text-emphasis); }
.cv-pill--xam { background: var(--bs-secondary-bg); color: var(--bs-secondary-color); }
.cv-noi { margin-top: 0; }
.an-c2 tr > :nth-child(2), .an-c2 col:nth-child(2), .an-c3 tr > :nth-child(3), .an-c3 col:nth-child(3), .an-c4 tr > :nth-child(4), .an-c4 col:nth-child(4),
.an-c5 tr > :nth-child(5), .an-c5 col:nth-child(5), .an-c6 tr > :nth-child(6), .an-c6 col:nth-child(6), .an-c7 tr > :nth-child(7), .an-c7 col:nth-child(7),
.an-c8 tr > :nth-child(8), .an-c8 col:nth-child(8) { display: none; }
