/* ==========================================================================
   tvp.css — Giao diện hệ thống Sale B2B, Trí Việt Phát Food
   Nạp SAU bootstrap.min.css. Quy ước đầy đủ: design-system/sale-b2b/MASTER.md
   Mọi màu, cỡ chữ, khoảng cách lấy từ biến --tvp-* ở đầu file. Không viết mã màu
   thô trong template hay trong style inline.
   ========================================================================== */

/* ---------- 1. Font: Be Vietnam Pro (thiết kế cho chữ Việt, dấu rõ, không dính dòng), bốn độ đậm 400, 500, 600, 700, tự lưu trong repo (OFL-1.1, xem LICENSE.txt) ---------- */
@font-face {
  font-family: "Be Vietnam Pro";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../vendor/fonts/be-vietnam-pro/be-vietnam-pro-vietnamese-400-normal.woff2") format("woff2");
  unicode-range: U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB;
}
@font-face {
  font-family: "Be Vietnam Pro";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../vendor/fonts/be-vietnam-pro/be-vietnam-pro-latin-400-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
  font-family: "Be Vietnam Pro";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../vendor/fonts/be-vietnam-pro/be-vietnam-pro-vietnamese-500-normal.woff2") format("woff2");
  unicode-range: U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB;
}
@font-face {
  font-family: "Be Vietnam Pro";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../vendor/fonts/be-vietnam-pro/be-vietnam-pro-latin-500-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
  font-family: "Be Vietnam Pro";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../vendor/fonts/be-vietnam-pro/be-vietnam-pro-vietnamese-600-normal.woff2") format("woff2");
  unicode-range: U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB;
}
@font-face {
  font-family: "Be Vietnam Pro";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../vendor/fonts/be-vietnam-pro/be-vietnam-pro-latin-600-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
  font-family: "Be Vietnam Pro";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../vendor/fonts/be-vietnam-pro/be-vietnam-pro-vietnamese-700-normal.woff2") format("woff2");
  unicode-range: U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB;
}
@font-face {
  font-family: "Be Vietnam Pro";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../vendor/fonts/be-vietnam-pro/be-vietnam-pro-latin-700-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}

/* ---------- 2. Biến thiết kế (token) ---------- */
/* T-18: bộ màu theo canvas "Màn mẫu Sale B2B" bản 93 (docs/11-ban-giao-thiet-ke.md mục 5) và D-113.
   BRAND #186207, DEEP #0F4505, TINT #E8F2E4, GOLD #FDB000, WARN #7A5200, DANGER #B42318, INK #1F2A1C, MUTED #5B6B57, LINE #DCE3D8 */
:root {
  /* Thương hiệu */
  --tvp-green-900: #0f4505;           /* DEEP: nền menu trái, nhãn ô nhập, chữ trên nền xanh nhạt */
  --tvp-green-800: #134f06;           /* rê chuột nút chính */
  --tvp-green-700: #186207;           /* BRAND: màu chính */
  --tvp-green-300: #86bc70;
  --tvp-green-200: #c5dcba;
  --tvp-green-150: #d6e8cd;           /* dòng đang chọn */
  --tvp-green-100: #e8f2e4;           /* TINT: rê chuột, thẻ số liệu thường (D-113) */
  --tvp-green-50:  #f1f6ee;           /* nền nhạt của ô, nhãn */
  --tvp-orange:    #ff3700;           /* chỉ ở logo và vạch trang trí cuối menu. KHÔNG dùng cho chữ, trạng thái, lỗi */
  --tvp-yellow:    #fdb000;           /* GOLD: viền focus, vạch trang trí menu; chữ trên nền vàng dùng --tvp-ink (mục menu đang chọn xanh từ D-143) */
  --tvp-nav-bg:     #0b3305;          /* D-143: nền menu trái (bản mẫu làm mới) */
  --tvp-nav-active: #2c7d1b;          /* D-143: mục menu đang chọn, chữ trắng 5,2:1 */

  /* Trung tính */
  --tvp-ink:       #1f2a1c;           /* chữ chính, 14,9:1 trên trắng */
  --tvp-ink-soft:  #3d4b39;           /* nhãn thẻ, chữ trục (D-143), 8,3:1 trên nền thẻ nhạt */
  --tvp-muted:     #5b6b57;           /* chữ phụ, 5,7:1 trên trắng */
  --tvp-subtle:    #5b6b57;           /* nhãn phụ, gợi ý: 5,3:1 trên nền trang */
  --tvp-border:    #dce3d8;           /* LINE: viền thẻ, đường kẻ */
  --tvp-border-soft: #e9ede6;         /* D-143: viền khối Dashboard, kẻ dòng danh sách, lưới biểu đồ */
  --tvp-border-input: #8a9786;        /* viền ô nhập: 3,07:1 trên trắng, vẫn đạt WCAG 1.4.11 (D-147, trước là #7a8977) */
  --tvp-bg:        #f5f7f4;           /* nền trang, đầu bảng */
  --tvp-surface:   #ffffff;           /* thẻ, bảng, ô nhập */

  /* Ngữ nghĩa */
  --tvp-danger:        #b42318;       /* lỗi, Thua, việc quá hạn */
  --tvp-danger-emph:   #8a1a12;
  --tvp-danger-tint:   #fdecea;
  --tvp-danger-border: #f3b8b1;
  --tvp-warn:          #7a5200;       /* chữ cảnh báo */
  --tvp-warn-tint:     #fff4d6;
  --tvp-warn-border:   #f6cf6a;
  --tvp-info:          #0f4505;       /* canvas không dùng xanh dương: thông tin dùng xanh lá đậm */
  --tvp-info-tint:     #e8f2e4;
  --tvp-info-border:   #c5dcba;

  /* Thẻ số liệu theo ý nghĩa (D-113): đỏ chỉ cho việc quá hạn, vàng cho việc cần chú ý, còn lại xanh nhạt; số bằng 0 thì về xanh nhạt */
  --tvp-metric-danger-bg: #c92c00; --tvp-metric-danger-text: #ffffff;
  --tvp-metric-warn-bg:   #fdb000; --tvp-metric-warn-text:   #1f2a1c;
  --tvp-metric-bg:        #e8f2e4; --tvp-metric-text:        #0f4505;

  /* D-143: thẻ số liệu nền nhạt viền cùng màu (bản mẫu làm mới). Mỗi sắc: nền, viền, ô biểu tượng, màu chính (biểu tượng, đường nhỏ),
     chữ (≥ 4,5:1 trên nền). Họ xanh lá cho dữ liệu; vàng cảnh báo; đỏ quá hạn, Thua. D-145: nền, viền 3 sắc la, vàng, đỏ đậm hơn một chút;
     chỉ dải 3 ô các màn (trừ Dashboard) dùng 2 biến này, nên không đụng các chỗ khác */
  --tvp-tint-la-bg:   #e0f2d8; --tvp-tint-la-border:   #c8e6b8; --tvp-tint-la-ico:   #d4ecc6; --tvp-tint-la-fg:   #2e7d1b;
  --tvp-tint-ngoc-bg: #e9f6f1; --tvp-tint-ngoc-border: #cdeadf; --tvp-tint-ngoc-ico: #c7e8da; --tvp-tint-ngoc-fg: #11795a;
  --tvp-tint-ma-bg:   #f3f8e5; --tvp-tint-ma-border:   #e0ebc1; --tvp-tint-ma-ico:   #e1eebf; --tvp-tint-ma-fg:   #5c7a0e;
  --tvp-tint-reu-bg:  #edf3ec; --tvp-tint-reu-border:  #d4e3d3; --tvp-tint-reu-ico:  #cfe2ce; --tvp-tint-reu-fg:  #2f6a39;
  --tvp-tint-vang-bg: #ffe9b3; --tvp-tint-vang-border: #f2d68c; --tvp-tint-vang-ico: #fdebbd; --tvp-tint-vang-fg: var(--tvp-warn);
  --tvp-tint-do-bg:   #fbdad6; --tvp-tint-do-border:   #f2bcb5; --tvp-tint-do-ico:   #fbdcd6; --tvp-tint-do-fg:   var(--tvp-danger);
  --tvp-tint-vang-icon: #d99a00;   /* biểu tượng cảnh báo trang trí (aria-hidden) trên nền trắng */
  /* Xanh dương nhạt của thẻ cũ, còn dùng cho nhãn ICP và nhãn "cần chốt"; màu ô số liệu nay theo vị trí (D-208, cạnh .tvp-kpis--lon) */
  --tvp-kpi-xd-bg:  #eef3fe; --tvp-kpi-xd-border:  #dce6fb; --tvp-kpi-xd-ico:  #dbe6fd; --tvp-kpi-xd-fg:  #3a6ee0; --tvp-kpi-xd-chu:  #3163d0;
  /* Ô số đầu trang theo vị trí (D-208): xanh dương, xanh ngọc, đỏ, vàng đậm. Mỗi màu: chính, chữ, nền, nền 2, viền (GD-29: đổi một chỗ ở đây) */
  --tvp-kpi-1: #2563eb; --tvp-kpi-1-chu: #1d4ed8; --tvp-kpi-1-bg: #eff5ff; --tvp-kpi-1-bg2: #dbe8ff; --tvp-kpi-1-vien: #c3d7fe;
  --tvp-kpi-2: #059669; --tvp-kpi-2-chu: #047857; --tvp-kpi-2-bg: #ecfdf5; --tvp-kpi-2-bg2: #d1fae5; --tvp-kpi-2-vien: #a7f3d0;
  --tvp-kpi-3: #dc2626; --tvp-kpi-3-chu: #b91c1c; --tvp-kpi-3-bg: #fef2f2; --tvp-kpi-3-bg2: #fee2e2; --tvp-kpi-3-vien: #fecaca;
  --tvp-kpi-4: #d97706; --tvp-kpi-4-chu: #b45309; --tvp-kpi-4-bg: #fffbeb; --tvp-kpi-4-bg2: #fef3c7; --tvp-kpi-4-vien: #fde68a;
  /* Màu chữ trạng thái riêng của đơn hàng, dự báo (GD-29) */
  --tvp-cam: #b45309;                                   /* Chờ CSKH nhận */
  --tvp-ngoc: #0f766e; --tvp-ngoc-tint: #e6f6f4;        /* Đã giao: xanh ngọc, khác xanh lá "CSKH đã nhận" */
  --tvp-vang-nhat: #fff1cc;                             /* nền nhãn, vòng chữ vàng nhạt (chữ --tvp-warn) */
  /* Logo chữ cái của khách chưa có logo: 5 màu xoay vòng theo mã khách */
  --tvp-logo-1: #0b5f5a; --tvp-logo-2: #c92c00; --tvp-logo-3: #8a5a00; --tvp-logo-4: #8b2e5a; --tvp-logo-5: #1f4e8c;

  /* Năm bước của cơ hội (D-95): dải xanh lá đậm dần. Màu chỉ gợi ý; mỗi nhãn luôn có số thứ tự và tên bước */
  --tvp-stage-1-fill: #86bc70; --tvp-stage-1-tint: #eef6ea; --tvp-stage-1-text: #0f4505;  /* 1. Tiếp cận */
  --tvp-stage-2-fill: #5f9f48; --tvp-stage-2-tint: #e5f0df; --tvp-stage-2-text: #0f4505;  /* 2. Tư vấn */
  --tvp-stage-3-fill: #3f8a2b; --tvp-stage-3-tint: #dcebd5; --tvp-stage-3-text: #0f4505;  /* 3. Báo giá */
  --tvp-stage-4-fill: #2f7a1d; --tvp-stage-4-tint: #d3e6ca; --tvp-stage-4-text: #0f4505;  /* 4. Đàm phán */
  --tvp-stage-5-fill: #186207; --tvp-stage-5-tint: #c9e0be; --tvp-stage-5-text: #0f4505;  /* 5. Chốt sale */
  --tvp-stage-6-fill: #186207; --tvp-stage-6-tint: #c9e0be; --tvp-stage-6-text: #0f4505;  /* dự phòng: chỉ còn 5 bước (D-95) */
  --tvp-stage-7-fill: #186207; --tvp-stage-7-tint: #c9e0be; --tvp-stage-7-text: #0f4505;
  --tvp-stage-won-fill:  var(--tvp-green-700); --tvp-stage-won-tint:  var(--tvp-green-100); --tvp-stage-won-text:  var(--tvp-green-900);
  --tvp-stage-lost-fill: var(--tvp-danger);    --tvp-stage-lost-tint: var(--tvp-danger-tint); --tvp-stage-lost-text: var(--tvp-danger);

  /* Chữ */
  --tvp-font: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --tvp-text-xs: 0.78125rem;   /* 12,5 px: chú thích, nhãn nhỏ (tối thiểu) */
  --tvp-text-sm: 0.875rem;     /* 14 px: bảng, nhãn form */
  --tvp-text-base: 1rem;       /* 16 px: ô nhập, nút và tên mục dạng thẻ trên điện thoại (không dùng cho chữ thường) */
  --tvp-text-lg: 1.125rem;     /* 18 px: tiêu đề khối, thẻ, hộp thoại */
  --tvp-text-title: 1.125rem;  /* 18 px đậm: tiêu đề khung h2, một cỡ ở mọi màn (D-241 (4), thay 16 px ngày 02/11); mục của form giữ 16 px */
  --tvp-text-xl: 1.25rem;      /* 20 px: con số nổi bật vừa (tiêu đề khối, thẻ, hộp thoại dùng 18 px) */
  --tvp-text-2xl: 1.5rem;      /* tiêu đề trang */
  --tvp-leading: 1.55;

  /* Khoảng cách: lưới 4 px (trùng thang spacer của Bootstrap: 1=4, 2=8, 3=16, 4=24, 5=48) */
  --tvp-gutter: 1rem;          /* lề trang: 16 px điện thoại, 24 px máy tính như canvas */
  --tvp-gap: 1rem;
  --tvp-section-gap: 1.5rem;
  /* Thang giãn cách một bộ (D-241 (6)): chỉ dùng 4, 8, 12, 16, 24 px */
  --tvp-space-1: 0.25rem; --tvp-space-2: 0.5rem; --tvp-space-3: 0.75rem; --tvp-space-4: 1rem; --tvp-space-5: 1.5rem;
  --tvp-h-control: 2.75rem;    /* 44 px: hàng đầu trang (tab, nút gạt, ô kỳ, nút), ô nhập */
  --tvp-h-filter: 2.25rem;     /* 36 px: hàng lọc (ô tìm, viên lọc, nút gạt lọc nhanh); điện thoại lên 44 px (--tvp-touch) */
  --tvp-h-th: 2.625rem;        /* 42 px: đầu bảng */

  /* Kích thước */
  --tvp-sidebar-w: 14.5rem;    /* 232 px (D-96), bằng canvas */
  --tvp-topbar-h: 3.75rem;     /* 60 px */
  --tvp-touch: 2.75rem;        /* 44 px: vùng chạm tối thiểu, chiều cao nút như canvas */
  --tvp-radius: 0.75rem;       /* thẻ: 12 px */
  --tvp-radius-sm: 0.5rem;     /* ô nhập, nút, mục menu: 8 px */
  --tvp-radius-lg: 1rem;       /* D-143: thẻ số liệu, khối Dashboard: 16 px */
  --tvp-shadow-sm: none;       /* canvas: thẻ chỉ có viền, không đổ bóng */
  --tvp-shadow-md: 0 8px 24px rgba(15, 69, 5, 0.16);
  --tvp-shadow-soft: 0 1px 2px rgba(16, 40, 10, 0.04), 0 4px 16px rgba(16, 40, 10, 0.05);   /* D-143: khối Dashboard */
  --tvp-focus: 0 0 0 2px #fff, 0 0 0 5px var(--tvp-yellow);   /* viền focus vàng 3 px như canvas, thấy được trên nền trắng và nền xanh đậm */
}
@media (min-width: 768px)  { :root { --tvp-gutter: 1.5rem; } }

/* ---------- 3. Ghi đè Bootstrap ---------- */
:root, [data-bs-theme="light"] {
  --bs-font-sans-serif: var(--tvp-font);
  --bs-body-font-family: var(--tvp-font);
  --bs-body-font-size: var(--tvp-text-sm);   /* 14 px: chữ thường mọi cỡ màn hình, theo MH-20 (bảng, nhãn, chữ dưới tiêu đề) */
  --bs-body-line-height: var(--tvp-leading);
  --bs-body-color: var(--tvp-ink);
  --bs-body-color-rgb: 31, 42, 28;
  --bs-body-bg: var(--tvp-bg);
  --bs-body-bg-rgb: 245, 247, 244;
  --bs-secondary-color: var(--tvp-muted);
  --bs-border-color: var(--tvp-border);
  --bs-border-radius: var(--tvp-radius-sm);
  --bs-border-radius-lg: var(--tvp-radius);
  --bs-heading-color: var(--tvp-ink);
  --bs-emphasis-color: var(--tvp-ink); --bs-emphasis-color-rgb: 31, 42, 28;   /* chữ ô bảng: Bootstrap 5.3 lấy màu này (đen #000), về màu chữ chính (GD-15) */

  --bs-primary: #186207;       --bs-primary-rgb: 24, 98, 7;
  --bs-primary-text-emphasis: var(--tvp-green-900);
  --bs-primary-bg-subtle: var(--tvp-green-100);
  --bs-primary-border-subtle: var(--tvp-green-200);
  --bs-success: #186207;       --bs-success-rgb: 24, 98, 7;
  --bs-success-bg-subtle: var(--tvp-stage-won-tint);
  --bs-success-border-subtle: var(--tvp-green-200);
  --bs-success-text-emphasis: var(--tvp-green-900);
  --bs-danger: #b42318;        --bs-danger-rgb: 180, 35, 24;
  --bs-danger-bg-subtle: var(--tvp-danger-tint);
  --bs-danger-border-subtle: var(--tvp-danger-border);
  --bs-danger-text-emphasis: var(--tvp-danger-emph);
  --bs-warning: #fdb000;       --bs-warning-rgb: 253, 176, 0;
  --bs-warning-bg-subtle: var(--tvp-warn-tint);
  --bs-warning-border-subtle: var(--tvp-warn-border);
  --bs-warning-text-emphasis: var(--tvp-warn);
  --bs-info: #0f4505;          --bs-info-rgb: 15, 69, 5;
  --bs-info-bg-subtle: var(--tvp-info-tint);
  --bs-info-border-subtle: var(--tvp-info-border);
  --bs-info-text-emphasis: var(--tvp-info);

  --bs-link-color: var(--tvp-green-700);        --bs-link-color-rgb: 24, 98, 7;
  --bs-link-hover-color: var(--tvp-green-900);  --bs-link-hover-color-rgb: 15, 69, 5;
  --bs-focus-ring-color: rgba(253, 176, 0, 0.6);
}

html { scroll-padding-top: calc(var(--tvp-topbar-h) + 1rem); scroll-padding-bottom: 6rem; }
body { background: var(--tvp-bg); color: var(--tvp-ink); -webkit-text-size-adjust: 100%; }
b, strong { font-weight: 700; }   /* Bootstrap để "bolder": <b> trong chữ đã đậm 600, 700 thành 900 (GD-28) */

h1, .h1, h2, .h2, h3, .h3, h4, .h4, h5, .h5, h6, .h6 { font-weight: 600; line-height: 1.3; letter-spacing: -0.005em; }
h5, .h5, .modal-title { font-size: var(--tvp-text-lg); }   /* tiêu đề thẻ: cùng cỡ 18 px với các thẻ ở hồ sơ khách; Bootstrap mặc định 20 px, chữ nhạt */
h1, h2, h3, .h1, .h2, .h3 { text-wrap: balance; }   /* tên dài không để lại một chữ lẻ ở dòng cuối */
h1, .h1 { font-size: var(--tvp-text-2xl); font-weight: 700; line-height: 1.25; }
h2, .h2 { font-size: var(--tvp-text-title); }   /* thang chữ: 24 tiêu đề trang · 18 tiêu đề khung (D-241) · 14 chữ thường · 12,5 chú thích */
h3, .h3, h4, .h4 { font-size: var(--tvp-text-sm); }
.tvp-table td.num { font-variant-numeric: tabular-nums; }  /* số tiền, sản lượng thẳng hàng */
.text-muted { color: var(--tvp-muted) !important; }
.small, small { font-size: var(--tvp-text-xs); }
a { text-underline-offset: 0.15em; }
code { --bs-code-color: var(--tvp-ink); font-size: 0.875em; }

/* Focus: vòng hai lớp, thấy được trên nền trắng, xanh nhạt và nền xanh đậm */
:focus { outline: none; }
:focus-visible,
.btn:focus-visible, .form-control:focus, .form-select:focus, .form-check-input:focus,
.nav-link:focus-visible, .page-link:focus, .dropdown-item:focus-visible, .btn-close:focus-visible {
  outline: none;
  box-shadow: var(--tvp-focus);
}
/* Ô đang nhập: viền xanh và quầng xanh nhạt như canvas (Trang-thai "Đang nhập"); bàn phím vẫn thấy rõ ô đang chọn */
.form-control:focus, .form-select:focus { border-color: var(--tvp-green-700); background-color: var(--tvp-surface); color: var(--tvp-ink); box-shadow: 0 0 0 3px rgba(24, 98, 7, 0.18); }
.form-control:focus-visible, .form-select:focus-visible { box-shadow: 0 0 0 3px rgba(24, 98, 7, 0.18), 0 0 0 5px var(--tvp-yellow); }

/* Nút */
.btn {
  --bs-btn-border-radius: var(--tvp-radius-sm);
  --bs-btn-font-weight: 600;
  --bs-btn-padding-y: 0.5rem;
  --bs-btn-padding-x: 1rem;
  --bs-btn-font-size: var(--tvp-text-sm);
  min-height: var(--tvp-touch);
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
}
@media (max-width: 767.98px) { .btn { min-height: var(--tvp-touch); --bs-btn-font-size: var(--tvp-text-base); } }
.btn-lg { min-height: var(--tvp-touch); --bs-btn-font-size: var(--tvp-text-sm); }
@media (max-width: 767.98px) { .btn-lg { --bs-btn-font-size: var(--tvp-text-base); } }
.btn-sm { min-height: 2rem; --bs-btn-padding-y: 0.25rem; --bs-btn-padding-x: 0.75rem; --bs-btn-font-size: var(--tvp-text-xs); }
@media (max-width: 767.98px) { .btn-sm { min-height: var(--tvp-touch); } }

.btn-primary {
  --bs-btn-color: #fff; --bs-btn-bg: var(--tvp-green-700); --bs-btn-border-color: var(--tvp-green-700);
  --bs-btn-hover-color: #fff; --bs-btn-hover-bg: var(--tvp-green-800); --bs-btn-hover-border-color: var(--tvp-green-800);
  --bs-btn-active-color: #fff; --bs-btn-active-bg: var(--tvp-green-900); --bs-btn-active-border-color: var(--tvp-green-900);
  --bs-btn-disabled-color: #fff; --bs-btn-disabled-bg: var(--tvp-green-700); --bs-btn-disabled-border-color: var(--tvp-green-700);
  --bs-btn-focus-shadow-rgb: 253, 176, 0;
}
.btn-outline-primary {
  --bs-btn-color: var(--tvp-green-700); --bs-btn-border-color: var(--tvp-green-700);
  --bs-btn-hover-color: var(--tvp-green-900); --bs-btn-hover-bg: var(--tvp-green-100); --bs-btn-hover-border-color: var(--tvp-green-700);
  --bs-btn-active-color: var(--tvp-green-900); --bs-btn-active-bg: var(--tvp-green-150); --bs-btn-active-border-color: var(--tvp-green-800);
  --bs-btn-disabled-color: var(--tvp-green-700); --bs-btn-disabled-border-color: var(--tvp-green-700);
  background: var(--tvp-surface);
}
.btn-outline-secondary {
  --bs-btn-color: var(--tvp-ink); --bs-btn-border-color: var(--tvp-border-input);
  --bs-btn-hover-color: var(--tvp-ink); --bs-btn-hover-bg: #e9ede7; --bs-btn-hover-border-color: var(--tvp-border-input);
  --bs-btn-active-color: var(--tvp-ink); --bs-btn-active-bg: #dfe5dc; --bs-btn-active-border-color: var(--tvp-ink);
  --bs-btn-disabled-color: var(--tvp-muted); --bs-btn-disabled-border-color: var(--tvp-border);
  background: var(--tvp-surface);
}
.btn-danger {
  --bs-btn-color: #fff; --bs-btn-bg: var(--tvp-danger); --bs-btn-border-color: var(--tvp-danger);
  --bs-btn-hover-color: #fff; --bs-btn-hover-bg: var(--tvp-danger-emph); --bs-btn-hover-border-color: var(--tvp-danger-emph);
  --bs-btn-active-color: #fff; --bs-btn-active-bg: #5e130e; --bs-btn-active-border-color: #5e130e;
}
.btn-outline-danger {
  --bs-btn-color: var(--tvp-danger); --bs-btn-border-color: var(--tvp-danger);
  --bs-btn-hover-color: var(--tvp-danger-emph); --bs-btn-hover-bg: var(--tvp-danger-tint); --bs-btn-hover-border-color: var(--tvp-danger);
  --bs-btn-active-color: #fff; --bs-btn-active-bg: var(--tvp-danger-emph); --bs-btn-active-border-color: var(--tvp-danger-emph);
  background: var(--tvp-surface);
}
.btn-link { --bs-btn-color: var(--tvp-green-700); --bs-btn-hover-color: var(--tvp-green-800); font-weight: 600; }
/* Nút bị khóa (thiếu ô bắt buộc, D-85): nền xám nhạt, chữ xám, không mờ cả nút như canvas Trang-thai */
.btn:disabled, .btn.disabled { opacity: 1; --bs-btn-disabled-bg: #e3e8e0; --bs-btn-disabled-border-color: #e3e8e0; --bs-btn-disabled-color: var(--tvp-muted); }
/* Nút chỉ có icon: bắt buộc có aria-label; vùng chạm 44 px trên điện thoại */
.btn-icon { padding: 0; width: var(--tvp-touch); min-width: var(--tvp-touch); }
@media (max-width: 767.98px) { .btn-icon { width: var(--tvp-touch); min-width: var(--tvp-touch); } }

/* Ô nhập */
.form-label { font-size: 0.8125rem; font-weight: 600; color: var(--tvp-ink-soft); margin-bottom: 0.375rem; }   /* D-147: nhãn 13 px chữ phụ đậm (trước 14 px xanh đậm in đậm) */
.form-label .tvp-req { color: var(--tvp-danger); margin-left: 0.125rem; }
.form-control, .form-select {
  border-color: var(--tvp-border-input);
  border-radius: var(--tvp-radius-sm);
  background-color: var(--tvp-surface);
  min-height: var(--tvp-touch);
  font-size: var(--tvp-text-base);          /* 16 px: iOS không tự phóng to khi chạm */
}
@media (max-width: 767.98px) { .form-control, .form-select { min-height: var(--tvp-touch); } }
.form-control, .form-select { transition: border-color 0.15s, box-shadow 0.15s; }
.form-control:hover:not(:focus):not([readonly]):not(:disabled):not(.is-invalid), .form-select:hover:not(:focus):not(:disabled):not(.is-invalid) { border-color: var(--tvp-ink-soft); }   /* D-147 */
.form-control::placeholder { color: var(--tvp-muted); opacity: 1; }
.form-control:disabled, .form-select:disabled { background: var(--tvp-bg); color: var(--tvp-muted); }
.form-text { font-size: var(--tvp-text-xs); color: var(--tvp-muted); }
.form-check-input { width: 1.25rem; height: 1.25rem; margin-top: 0.125rem; border-color: var(--tvp-border-input); }
.form-check-input:checked, .form-check-input[type="checkbox"]:indeterminate { background-color: var(--tvp-green-700); border-color: var(--tvp-green-700); }
.form-check-input:focus { border-color: var(--tvp-green-700); }
/* Lỗi: viền đỏ + biểu tượng + câu chữ gắn với ô (aria-describedby), không chỉ đổi màu */
.form-control.is-invalid, .form-select.is-invalid { border-color: var(--tvp-danger); }
.invalid-feedback { display: block; color: var(--tvp-danger); font-size: var(--tvp-text-sm); font-weight: 500; margin-top: 0.25rem; }
.invalid-feedback::before { content: "\f33b"; font-family: "bootstrap-icons"; margin-right: 0.375rem; vertical-align: -0.1em; }  /* bi-exclamation-triangle như canvas */

/* Thông báo trong trang */
.alert { border-radius: var(--tvp-radius); --bs-alert-padding-y: 0.75rem; --bs-alert-padding-x: 1rem; font-size: var(--tvp-text-sm); display: flex; gap: 0.75rem; align-items: flex-start; }
.alert > .bi { font-size: 1.125rem; line-height: 1.4; flex: none; }
.alert-primary, .alert-success { --bs-alert-color: var(--tvp-green-900); --bs-alert-bg: var(--tvp-stage-won-tint); --bs-alert-border-color: var(--tvp-green-200); }
.alert-danger  { --bs-alert-color: var(--tvp-danger-emph); --bs-alert-bg: var(--tvp-danger-tint); --bs-alert-border-color: var(--tvp-danger-border); }
.alert-warning { --bs-alert-color: var(--tvp-warn); --bs-alert-bg: var(--tvp-warn-tint); --bs-alert-border-color: var(--tvp-warn-border); }
.alert-info    { --bs-alert-color: var(--tvp-info); --bs-alert-bg: var(--tvp-info-tint); --bs-alert-border-color: var(--tvp-info-border); }

/* Tab, phân trang, dropdown, tiến độ */
.nav-tabs { --bs-nav-tabs-border-color: var(--tvp-border); --bs-nav-tabs-link-active-color: var(--tvp-green-700); --bs-nav-tabs-link-active-border-color: var(--tvp-border) var(--tvp-border) var(--tvp-surface); --bs-nav-tabs-link-hover-border-color: transparent transparent var(--tvp-border); flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; white-space: nowrap; }
/* C-2: hàng tab cuộn ngang, mép còn tab bị khuất mờ dần (tvp.js bật lớp theo vị trí cuộn) */
.tvp-cuon--phai { -webkit-mask-image: linear-gradient(to right, black calc(100% - 3rem), transparent); mask-image: linear-gradient(to right, black calc(100% - 3rem), transparent); }
.tvp-cuon--trai { -webkit-mask-image: linear-gradient(to left, black calc(100% - 3rem), transparent); mask-image: linear-gradient(to left, black calc(100% - 3rem), transparent); }
.tvp-cuon--trai.tvp-cuon--phai { -webkit-mask-image: linear-gradient(to right, transparent, black 3rem, black calc(100% - 3rem), transparent); mask-image: linear-gradient(to right, transparent, black 3rem, black calc(100% - 3rem), transparent); }
.nav-tabs .nav-link { color: var(--tvp-muted); font-weight: 600; font-size: var(--tvp-text-sm); min-height: 2.75rem; display: inline-flex; align-items: center; }
.nav-tabs .nav-link:hover { color: var(--tvp-ink); }
.nav-tabs .nav-link.active { color: var(--tvp-green-700); box-shadow: inset 0 -3px 0 var(--tvp-green-700); border-bottom-color: transparent; }
.pagination { --bs-pagination-color: var(--tvp-green-700); --bs-pagination-hover-color: var(--tvp-green-800); --bs-pagination-hover-bg: var(--tvp-green-100); --bs-pagination-active-bg: var(--tvp-green-700); --bs-pagination-active-border-color: var(--tvp-green-700); --bs-pagination-focus-color: var(--tvp-green-800); --bs-pagination-focus-bg: var(--tvp-green-100); --bs-pagination-border-color: var(--tvp-border); }
.page-link { min-width: 2.5rem; min-height: 2.5rem; display: inline-flex; align-items: center; justify-content: center; }
.dropdown-menu { --bs-dropdown-bg: var(--tvp-surface); --bs-dropdown-link-active-bg: var(--tvp-green-700); --bs-dropdown-link-hover-bg: var(--tvp-green-100); --bs-dropdown-border-color: var(--tvp-border); --bs-dropdown-border-radius: var(--tvp-radius); --bs-dropdown-box-shadow: var(--tvp-shadow-md); font-size: var(--tvp-text-sm); }
.dropdown-item { min-height: 2.5rem; display: flex; align-items: center; gap: 0.5rem; }
.progress { --bs-progress-bar-bg: var(--tvp-green-700); }
.list-group { --bs-list-group-active-bg: var(--tvp-green-700); --bs-list-group-active-border-color: var(--tvp-green-700); }

/* Thẻ (card) */
.card { --bs-card-border-color: var(--tvp-border); --bs-card-border-radius: var(--tvp-radius); --bs-card-inner-border-radius: calc(var(--tvp-radius) - 1px); --bs-card-cap-bg: var(--tvp-surface); --bs-card-bg: var(--tvp-surface); --bs-card-spacer-x: 1rem; --bs-card-spacer-y: 1rem; box-shadow: var(--tvp-shadow-sm); }
.card-header { font-weight: 700; font-size: var(--tvp-text-title); background: var(--tvp-surface); border-bottom: 0; padding-bottom: 0; }
@media (min-width: 768px) { .card { --bs-card-spacer-x: 1.25rem; --bs-card-spacer-y: 1.25rem; } }

/* Bảng */
.table { --bs-table-bg: transparent; --bs-table-hover-bg: var(--tvp-bg); --bs-table-border-color: var(--tvp-border); font-size: var(--tvp-text-sm); margin-bottom: 0; }
.table > thead > tr > th { font-size: var(--tvp-text-sm); font-weight: 600; color: var(--tvp-ink); background: var(--tvp-bg); border-bottom: 1px solid var(--tvp-border); white-space: nowrap; padding: 0.625rem 0.75rem; }
.table > tbody > tr > td { padding: 0.75rem; vertical-align: middle; }
td.num, th.num { text-align: right; }
/* Tên trong bảng (khách, sản phẩm) là liên kết: chữ đậm màu chữ chính, gạch chân khi rê chuột (canvas) */
.table td a.tvp-rowlink { color: var(--tvp-ink); font-weight: 600; text-decoration: none; }
.table td a.tvp-rowlink:hover { color: var(--tvp-green-700); text-decoration: underline; }

/* Modal, ngăn kéo */
.modal-content { border-radius: var(--tvp-radius); border-color: var(--tvp-border); }
.modal-header { border-bottom: 1px solid var(--tvp-border); }
.modal-footer { border-top: 1px solid var(--tvp-border); gap: 0.75rem; }
.modal-footer > * { margin: 0; }   /* GD-49 (D-249): hai nút cách 12 px như form, trước 8 (Bootstrap thêm lề 4 px mỗi nút) */
.modal { --bs-modal-width: 32.5rem; }   /* GD-51 (D-249): mọi hộp thoại rộng 520 px như .tvp-ocmodal (D-241), trước 500 */
.modal-header > div { flex: 1 1 auto; min-width: 0; }
.modal-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }   /* N-5 (D-249): tiêu đề hộp thoại một dòng, dài thì "…" kèm title */
.offcanvas { --bs-offcanvas-border-color: var(--tvp-border); --bs-offcanvas-box-shadow: var(--tvp-shadow-md); }
.btn-close { width: var(--tvp-touch); height: var(--tvp-touch); padding: 0; margin: 0; background-size: 0.875rem; }

/* ---------- 4. Khung ứng dụng ---------- */
.tvp-skip { position: absolute; left: -999px; top: 0; z-index: 2000; background: var(--tvp-green-700); color: #fff; padding: 0.75rem 1rem; border-radius: 0 0 var(--tvp-radius-sm) 0; }
.tvp-skip:focus { left: 0; color: #fff; }

.tvp-shell { min-height: 100vh; }
@media (min-width: 992px) {
  /* Nền cột menu kéo hết chiều cao trang (menu dính đầu màn hình cao 100vh, trang dài hơn thì phần dưới vẫn xanh đậm) */
  .tvp-shell { display: grid; grid-template-columns: var(--tvp-sidebar-w) minmax(0, 1fr); background: linear-gradient(to right, var(--tvp-nav-bg) var(--tvp-sidebar-w), transparent var(--tvp-sidebar-w)); }
}
.tvp-body { min-width: 0; display: flex; flex-direction: column; min-height: 100vh; }

/* Menu trái (canvas bản 93; D-143: nền xanh rất đậm, mục đang chọn khối xanh chữ trắng có bóng thay khối vàng): logo trên thẻ trắng
   bo 12 px, hai vạch vàng, cam trang trí ở chân menu. Từ 992 px là cột cố định cao bằng màn hình; dưới đó là ngăn kéo (offcanvas) */
.tvp-sidebar { --bs-offcanvas-width: min(19rem, 86vw); --bs-offcanvas-bg: var(--tvp-nav-bg); --bs-offcanvas-color: var(--tvp-green-100); background: var(--tvp-nav-bg); color: var(--tvp-green-100); border-right: 0; }
.tvp-sidebar .offcanvas-header { padding: 0 1rem; min-height: var(--tvp-topbar-h); border-bottom: 1px solid rgba(255, 255, 255, 0.14); color: #fff; }
.tvp-sidebar .btn-close { filter: invert(1) grayscale(1) brightness(2); }
@media (min-width: 992px) {
  .tvp-sidebar { --bs-offcanvas-width: var(--tvp-sidebar-w); position: sticky; top: 0; height: 100vh; width: var(--tvp-sidebar-w); max-width: none; z-index: auto; visibility: visible !important; transform: none !important; transition: none; border-right: 0; }
  .tvp-sidebar .offcanvas-header { display: none; }
}
.tvp-brand { display: flex; align-items: center; justify-content: center; margin: 1rem 0.75rem 0; padding: 0.75rem 0.75rem; border-radius: var(--tvp-radius); background: var(--tvp-surface); text-decoration: none; }
.tvp-brand img { height: 3.75rem; width: auto; display: block; }
.tvp-brand:focus-visible { box-shadow: var(--tvp-focus); }
@media (max-width: 991.98px) { .tvp-sidebar > .tvp-brand { display: none; } }
.tvp-sidebar > .tvp-brand { flex: none; }
.tvp-sidebar .offcanvas-body { display: flex; flex-direction: column; padding: 1rem 0.75rem 1.25rem; overflow-y: auto; min-height: 0; scrollbar-width: thin; scrollbar-color: var(--tvp-green-700) transparent; }
.tvp-sidebar .offcanvas-body::-webkit-scrollbar { display: none; }
/* Hai vạch vàng, cam ở chân menu: chỉ trang trí (canvas), nằm cuối cột khi menu ngắn */
.tvp-sidebar__deco { margin-top: auto; padding-top: 1.5rem; display: flex; flex-direction: column; gap: 6px; }
.tvp-sidebar__deco span { display: block; height: 10px; clip-path: polygon(0 0, 100% 0, calc(100% - 10px) 100%, 0 100%); }
.tvp-sidebar__deco span:first-child { width: 72%; background: var(--tvp-yellow); }
.tvp-sidebar__deco span:last-child { width: 52%; background: var(--tvp-orange); }

.tvp-nav { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.tvp-nav__group { margin: 0.75rem 0.75rem 0.125rem; font-size: var(--tvp-text-xs); font-weight: 600; color: var(--tvp-green-300); letter-spacing: 0.02em; }
.tvp-nav a {
  display: flex; align-items: center; gap: 0.75rem;
  min-height: var(--tvp-touch); padding: 0.5rem 0.75rem;
  border-radius: var(--tvp-radius-sm); color: var(--tvp-green-100); text-decoration: none;
  font-size: var(--tvp-text-sm); font-weight: 500; position: relative;
}
.tvp-nav a > .bi { font-size: 1.125rem; color: currentColor; flex: none; width: 1.25rem; text-align: center; }
.tvp-nav a:hover { background: rgba(255, 255, 255, 0.10); color: #fff; }
.tvp-nav a[aria-current="page"] { background: var(--tvp-nav-active); color: #fff; font-weight: 700; box-shadow: 0 6px 18px rgba(44, 125, 27, 0.45); }  /* D-143 */
.tvp-nav a:focus-visible { box-shadow: 0 0 0 3px var(--tvp-yellow); }
.tvp-nav a[aria-current="page"]:focus-visible { box-shadow: 0 0 0 2px var(--tvp-nav-bg), 0 0 0 5px #fff; }
/* Màn hình chưa làm: vẫn đọc được trên nền xanh đậm (7,4:1), không bấm được */
.tvp-nav a.is-todo { color: #b9cdb1; cursor: default; }
.tvp-nav a.is-todo:hover { background: transparent; color: #b9cdb1; }
.tvp-nav .tvp-count { margin-left: auto; }

/* Thanh trên: nền trắng, đường kẻ dưới, ngày bên trái (D-74), chuông và tên người dùng bên phải */
.tvp-topbar { position: sticky; top: 0; z-index: 1020; background: var(--tvp-surface); border-bottom: 1px solid var(--tvp-border); }
.tvp-topbar__row { display: flex; align-items: center; gap: 0.5rem; min-height: var(--tvp-topbar-h); padding: 0.375rem var(--tvp-gutter); }
.tvp-topbar__logo { display: flex; align-items: center; }
.tvp-topbar__logo img { height: 2.5rem; width: auto; display: block; }
@media (min-width: 992px) { .tvp-topbar__logo, .tvp-topbar .tvp-menu-toggle { display: none; } }
/* D-230 (3) Tìm nhanh: máy tính là ô sau ngày; dưới 992 px là nút kính lúp (trang MH-39 có ô riêng) */
.tvp-topbar__tim { display: none; flex: 0 1 25rem; min-width: 0; margin-left: 1rem; }
.tvp-topbar__tim .tvp-searchbox { flex: 1 1 auto; }
@media (min-width: 992px) { .tvp-topbar__tim { display: flex; } .tvp-topbar .tvp-topbar__kinh { display: none; } }
.tvp-topbar__actions { margin-left: auto; display: flex; align-items: center; gap: 0.5rem; }
.tvp-date { font-size: var(--tvp-text-xs); font-weight: 600; line-height: 1.2; color: var(--tvp-ink); white-space: nowrap; font-variant-numeric: tabular-nums; }
@media (min-width: 576px) { .tvp-date { font-size: var(--tvp-text-sm); } }
.tvp-topbar__man { min-width: 0; font-size: var(--tvp-text-sm); font-weight: 700; line-height: 1.2; color: var(--tvp-green-900); }
@media (max-width: 359.98px) { .tvp-topbar__row { gap: 0.25rem; } }
.tvp-iconbtn { position: relative; display: inline-flex; align-items: center; justify-content: center; width: var(--tvp-touch); height: var(--tvp-touch); border: 0; border-radius: var(--tvp-radius-sm); background: transparent; color: var(--tvp-ink); font-size: 1.25rem; }
.tvp-iconbtn:hover { background: var(--tvp-bg); }
.tvp-user { display: flex; align-items: center; gap: 0.5rem; border: 0; background: transparent; padding: 0.25rem 0.5rem; border-radius: var(--tvp-radius-sm); min-height: var(--tvp-touch); color: var(--tvp-ink); text-align: right; }
.tvp-user:hover { background: var(--tvp-bg); }
.tvp-avatar { width: 2.25rem; height: 2.25rem; border-radius: 50%; background: var(--tvp-green-150); color: var(--tvp-green-900); display: inline-flex; align-items: center; justify-content: center; font-weight: 600; font-size: var(--tvp-text-sm); flex: none; }
.tvp-user__text { min-width: 0; max-width: 12rem; }
.tvp-user__name, .tvp-user__role { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }   /* một dòng ở mọi khổ (GD-57), dài thì "…", rê chuột xem đủ */
.tvp-user__name { display: block; font-size: var(--tvp-text-sm); font-weight: 600; line-height: 1.3; }
.tvp-user__role { display: block; font-size: var(--tvp-text-sm); color: var(--tvp-muted); line-height: 1.3; }
/* Máy tính: vòng chữ cái đầu, tên và vai trò (D-143, bản mẫu làm mới). Điện thoại: chỉ chữ cái đầu trong vòng tròn */
@media (min-width: 768px) { .tvp-user .tvp-avatar { width: 2.5rem; height: 2.5rem; font-weight: 700; } }
@media (max-width: 767.98px) { .tvp-user__text { display: none; } }

/* Chấm và số đếm thông báo (kèm chữ cho trình đọc màn hình, không dùng màu cam) */
.tvp-count { display: inline-flex; align-items: center; justify-content: center; min-width: 1.25rem; height: 1.25rem; padding: 0 0.375rem; border-radius: 999px; background: var(--tvp-green-700); color: #fff; font-size: var(--tvp-text-xs); font-weight: 600; line-height: 1; font-variant-numeric: tabular-nums; }
.tvp-count--danger { background: var(--tvp-danger); }

.tvp-bell-menu { width: min(22rem, calc(100vw - 1.5rem)); padding: 0; }
.tvp-bell-menu__head { display: flex; justify-content: space-between; align-items: center; padding: 0.75rem 1rem; border-bottom: 1px solid var(--tvp-border); font-weight: 600; }
.tvp-bell-item { display: flex; gap: 0.75rem; padding: 0.75rem 1rem; border-bottom: 1px solid var(--tvp-border); color: var(--tvp-ink); text-decoration: none; font-size: var(--tvp-text-sm); }
.tvp-bell-item:hover { background: var(--tvp-green-50); color: var(--tvp-ink); }
.tvp-bell-item.is-unread { background: var(--tvp-green-50); }
.tvp-bell-item.is-unread .tvp-bell-item__title { font-weight: 600; }
.tvp-bell-item__time { font-size: var(--tvp-text-xs); color: var(--tvp-muted); }

/* Nội dung chính */
.tvp-main { flex: 1 1 auto; padding: var(--tvp-gutter); padding-bottom: calc(var(--tvp-gutter) + 1rem); width: 100%; min-width: 0; }  /* không giới hạn bề rộng: màn rộng (1920 px) dùng hết chiều ngang, không chừa khoảng trắng bên phải */
/* Liên kết quay lại đầu trang ("← Khách hàng"): chữ xanh, không gạch chân như canvas */
.tvp-main.has-sticky-actions { padding-bottom: 6rem; }
@media (min-width: 768px) { .tvp-main.has-sticky-actions { padding-bottom: calc(var(--tvp-gutter) + 1rem); } }
.tvp-page-header { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 0.75rem 1rem; margin-bottom: var(--tvp-section-gap); }
.tvp-page-header h1 { margin: 0; }
.tvp-khlist > .tvp-page-header, .tvp-doi > .tvp-page-header { margin-bottom: 0; }  /* khung đã có gap */
.tvp-page-header__sub { margin: 0.25rem 0 0; color: var(--tvp-muted); font-size: var(--tvp-text-sm); }
.tvp-page-header__actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-left: auto; }   /* màn trong menu tiêu đề ẩn (D-137): nút vẫn nằm bên phải */
@media (max-width: 575.98px) { .tvp-page-header__actions { width: 100%; } .tvp-page-header__actions .btn { flex: 1 1 auto; } }
.tvp-section { margin-bottom: var(--tvp-section-gap); }

/* Thanh lọc (mọi màn hình danh sách): một thanh gọn, các ô nằm cùng hàng và tự xuống dòng khi hết chỗ.
   Ô tìm và ô chọn (lớp --bare) không hiện nhãn phía trên, nhãn vẫn có cho trình đọc màn hình; dòng đầu của ô chọn ghi rõ tiêu chí ("Tất cả ngành").
   Ô chọn đang lọc (khác dòng đầu) đổi viền và nền xanh nhạt. Đổi tiêu chí là lọc ngay (HTMX change) nên không có nút Lọc; "Xóa lọc" nằm cuối thanh. */

/* Khung hai cột (MH-26, canvas bản 93): cột trái là danh sách mục (tvp-sidenav), cột phải là nội dung. Dưới 992 px: danh sách thành hàng tab cuộn ngang */
.tvp-split { display: grid; gap: 1rem 1.5rem; grid-template-columns: minmax(0, 1fr); align-items: start; }
.tvp-split__main { min-width: 0; }
.tvp-sidenav ul { list-style: none; margin: 0; padding: 0.5rem; display: flex; gap: 0.25rem; overflow-x: auto; background: var(--tvp-surface); border: 1px solid var(--tvp-border); border-radius: var(--tvp-radius); }
.tvp-sidenav a { display: flex; align-items: center; min-height: var(--tvp-touch); padding: 0 0.75rem; border-radius: var(--tvp-radius-sm); color: var(--tvp-ink); text-decoration: none; white-space: nowrap; }
.tvp-sidenav a:hover { background: var(--tvp-bg); }
.tvp-sidenav a[aria-current="page"] { background: var(--tvp-green-100); color: var(--tvp-green-900); font-weight: 700; }
@media (min-width: 992px) {
  .tvp-split { grid-template-columns: 15rem minmax(0, 1fr); }
  .tvp-sidenav ul { flex-direction: column; overflow: visible; }
}

/* Nút hành động cố định cuối màn hình điện thoại (form một cột) */
.tvp-form-actions { display: flex; gap: 0.75rem; justify-content: flex-end; }
@media (max-width: 767.98px) {
  .tvp-form-actions--sticky { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1010; padding: 0.75rem var(--tvp-gutter) calc(0.75rem + env(safe-area-inset-bottom)); background: var(--tvp-surface); border-top: 1px solid var(--tvp-border); box-shadow: 0 -4px 12px rgba(31, 41, 51, 0.08); }
  .tvp-form-actions--sticky .btn { flex: 1 1 0; }
}

/* Thanh "Còn thiếu N mục" đầu form và ghi chú cạnh nút Lưu (D-85) */
.tvp-missing { border: 1px solid var(--tvp-yellow); background: var(--tvp-warn-tint); color: var(--tvp-warn); border-radius: var(--tvp-radius); padding: 0.875rem 1rem; margin-bottom: 1.5rem; }
.tvp-missing[hidden] { display: none; }
.tvp-missing__title { margin: 0; font-weight: 600; display: flex; align-items: center; gap: 0.5rem; }
/* canvas Form-khach: tên các mục nối bằng dấu phẩy, sau đó là câu nhắc; bấm tên mục thì nhảy tới ô */
.tvp-missing__body { margin: 0.125rem 0 0 1.75rem; font-size: var(--tvp-text-sm); }
.tvp-missing__list { display: inline; list-style: none; margin: 0; padding: 0; }
.tvp-missing__list[hidden] { display: none; }
.tvp-missing__list li { display: inline; }
.tvp-missing__list li:not(:last-child)::after { content: ", "; }
.tvp-missing__list li:last-child::after { content: ". "; }
.tvp-missing__list a { color: inherit; text-decoration: none; }
.tvp-missing__list a:hover, .tvp-missing__list a:focus-visible { text-decoration: underline; }
.tvp-missing__ok, .tvp-missing--ok .tvp-missing__warn, .tvp-missing--ok .tvp-missing__body { display: none; }
.tvp-missing--ok .tvp-missing__ok { display: inline-block; }
.tvp-missing--ok { border-color: var(--tvp-green-200); background: var(--tvp-stage-won-tint); color: var(--tvp-green-900); }
.tvp-form-actions__note { margin-right: auto; align-self: center; font-size: var(--tvp-text-sm); color: var(--tvp-warn); font-weight: 600; }
.tvp-form-actions__note:empty { display: none; }
.tvp-form-actions__note--nhac { color: var(--tvp-muted); font-weight: 400; }   /* D-136: form còn trống, chưa phải lỗi */
@media (max-width: 767.98px) {
  .tvp-form-actions--sticky { flex-wrap: wrap; }
  .tvp-form-actions--sticky .tvp-form-actions__note { flex: 1 1 100%; margin: 0; text-align: center; }
}

/* ---------- 5. Thành phần dùng chung ---------- */

/* 5.1 Nhãn bước. Luôn có chữ; 7 bước mở có số thứ tự; Thắng / Thua có dấu ✓ / ✕ */
.tvp-stage { --_fill: var(--tvp-stage-1-fill); --_tint: var(--tvp-stage-1-tint); --_text: var(--tvp-stage-1-text);
  display: inline-flex; align-items: center; gap: 0.375rem; padding: 0.125rem 0.625rem 0.125rem 0.375rem; border-radius: 999px; background: var(--_tint); color: var(--_text);
  font-size: var(--tvp-text-xs); font-weight: 600; line-height: 1.5; white-space: nowrap; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--_fill) 35%, transparent); }
.tvp-stage__no { display: inline-flex; align-items: center; justify-content: center; width: 1.125rem; height: 1.125rem; border-radius: 50%; background: var(--_fill); color: #fff; font-size: var(--tvp-text-xs); font-weight: 700; font-variant-numeric: tabular-nums; }
.tvp-stage > .bi { font-size: 0.875rem; margin-left: 0.125rem; }
.tvp-stage--1 { --_fill: var(--tvp-stage-1-fill); --_tint: var(--tvp-stage-1-tint); --_text: var(--tvp-stage-1-text); }
.tvp-stage--2 { --_fill: var(--tvp-stage-2-fill); --_tint: var(--tvp-stage-2-tint); --_text: var(--tvp-stage-2-text); }
.tvp-stage--3 { --_fill: var(--tvp-stage-3-fill); --_tint: var(--tvp-stage-3-tint); --_text: var(--tvp-stage-3-text); }
.tvp-stage--4 { --_fill: var(--tvp-stage-4-fill); --_tint: var(--tvp-stage-4-tint); --_text: var(--tvp-stage-4-text); }
.tvp-stage--5 { --_fill: var(--tvp-stage-5-fill); --_tint: var(--tvp-stage-5-tint); --_text: var(--tvp-stage-5-text); }
/* Chữ số trắng trên nền bước 1–3 chỉ 2,2–4,3 : 1 (D-141 (9), WCAG 1.4.3): ba bước đầu dùng vòng trắng viền màu bước, chữ xanh đậm */
.tvp-stage--1 .tvp-stage__no, .tvp-stage--2 .tvp-stage__no, .tvp-stage--3 .tvp-stage__no { background: var(--tvp-surface); color: var(--tvp-green-900); box-shadow: inset 0 0 0 1.5px var(--_fill); }
.tvp-stage--6 { --_fill: var(--tvp-stage-6-fill); --_tint: var(--tvp-stage-6-tint); --_text: var(--tvp-stage-6-text); }
.tvp-stage--7 { --_fill: var(--tvp-stage-7-fill); --_tint: var(--tvp-stage-7-tint); --_text: var(--tvp-stage-7-text); }
.tvp-stage--won  { --_fill: var(--tvp-stage-won-fill);  --_tint: var(--tvp-stage-won-tint);  --_text: var(--tvp-stage-won-text); padding-left: 0.5rem; }
.tvp-stage--lost { --_fill: var(--tvp-stage-lost-fill); --_tint: var(--tvp-stage-lost-tint); --_text: var(--tvp-stage-lost-text); padding-left: 0.5rem; }

/* 5.3 Nhãn trạng thái chung (tài khoản, kết quả đăng nhập) */
.tvp-pill { display: inline-flex; align-items: center; gap: 0.375rem; padding: 0.125rem 0.625rem; border-radius: 999px; font-size: var(--tvp-text-xs); font-weight: 600; line-height: 1.5; white-space: nowrap; }
.tvp-pill > .bi { font-size: 0.8125rem; }
.tvp-pill--ok      { background: var(--tvp-stage-won-tint); color: var(--tvp-green-900); }
.tvp-pill--off     { background: #e8ebe6; color: #3e4a54; }
.tvp-pill--danger  { background: var(--tvp-danger-tint); color: var(--tvp-danger-emph); }
.tvp-pill--warn    { background: var(--tvp-warn-tint); color: var(--tvp-warn); }
.tvp-pill--info    { background: var(--tvp-info-tint); color: var(--tvp-info); }
.tvp-pill--role    { background: var(--tvp-green-100); color: var(--tvp-green-900); }   /* Mới, ICP (canvas): nền xanh nhạt */
.tvp-pill--solid   { background: var(--tvp-green-700); color: #fff; }   /* Hiện hữu (canvas): nhãn đặc */
.tvp-pill--gold    { background: var(--tvp-warn-tint); color: var(--tvp-warn); }

/* Máy tính: cột hành động căn phải để các nút thẳng hàng giữa các dòng (dòng có thêm nút Mở khóa không làm lệch nút Sửa) */
@media (min-width: 768px) {
  .tvp-rtable td.tvp-rt-actions { text-align: right; }
  .tvp-rtable .tvp-rt-note { padding-left: 3.5rem; }   /* cột chữ liền sau cột số căn phải: chừa khoảng cho khỏi dính nhau (Huy 02/11: 2rem vẫn dính) */
}
/* 5.4 Bảng → thẻ trên điện thoại. Mỗi <td> có data-label; ô đầu (.tvp-rt-title) làm tiêu đề thẻ; ô cuối (.tvp-rt-actions) là hành động */
/* position: relative để chữ .visually-hidden trong ô của bảng cuộn ngang không thoát ra làm rộng trang (C-5) */
.tvp-table-wrap { position: relative; background: var(--tvp-surface); border: 1px solid var(--tvp-border); border-radius: var(--tvp-radius); box-shadow: var(--tvp-shadow-sm); overflow: hidden; }
@media (max-width: 767.98px) {
  .tvp-rtable thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }   /* ẩn nhưng vẫn cho trình đọc màn hình */
  .tvp-rtable, .tvp-rtable tbody, .tvp-rtable tr, .tvp-rtable td { display: block; width: 100%; }
  .tvp-rtable tr { padding: 0.75rem 1rem; border-bottom: 1px solid var(--tvp-border); }
  .tvp-rtable tr:last-child { border-bottom: 0; }
  .tvp-rtable td { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 0.25rem 0; border: 0; text-align: right; }
  .tvp-rtable td::before { content: attr(data-label); flex: none; color: var(--tvp-muted); font-size: var(--tvp-text-xs); font-weight: 600; text-align: left; }
  .tvp-rtable td.tvp-rt-title { display: block; text-align: left; padding-bottom: 0.5rem; font-size: var(--tvp-text-base); }
  .tvp-rtable td.tvp-rt-title::before { content: none; }
  .tvp-rtable td.tvp-rt-actions { justify-content: flex-start; padding-top: 0.5rem; flex-wrap: wrap; }
  .tvp-rtable td.tvp-rt-actions::before { content: none; }
  .tvp-rtable td.tvp-rt-actions:empty { display: none; }
  .tvp-rtable td.num { text-align: right; }
}

/* Biến thể .tvp-rtable--wide: bảng danh sách (khuôn K1) chuyển thành thẻ dưới 1200 px, không cuộn ngang, không mất cột (D-241 (7), Q121 A) */
@media (max-width: 1199.98px) {
  .tvp-rtable--wide thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }   /* ẩn nhưng vẫn cho trình đọc màn hình */
  .tvp-rtable--wide, .tvp-rtable--wide tbody, .tvp-rtable--wide tr, .tvp-rtable--wide td { display: block; width: 100%; }
  .tvp-rtable--wide tr { padding: 0.75rem 1rem; border-bottom: 1px solid var(--tvp-border); }
  .tvp-rtable--wide tr:last-child { border-bottom: 0; }
  .tvp-rtable--wide td { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 0.25rem 0; border: 0; text-align: right; }
  .tvp-rtable--wide td::before { content: attr(data-label); flex: none; color: var(--tvp-muted); font-size: var(--tvp-text-xs); font-weight: 600; text-align: left; }
  .tvp-rtable--wide td.tvp-rt-title { display: block; text-align: left; padding-bottom: 0.5rem; font-size: var(--tvp-text-base); }
  .tvp-rtable--wide td.tvp-rt-title::before { content: none; }
  .tvp-rtable--wide td.tvp-rt-actions { justify-content: flex-start; padding-top: 0.5rem; flex-wrap: wrap; }
  .tvp-rtable--wide td.tvp-rt-actions::before { content: none; }
  .tvp-rtable--wide td.tvp-rt-actions:empty { display: none; }
  .tvp-rtable--wide td.num { text-align: right; }
}

/* 5.5 Tóm tắt lỗi form (đặt đầu form, chuyển focus tới đây sau khi gửi lỗi) */
.tvp-error-summary { border: 1px solid var(--tvp-danger-border); background: var(--tvp-danger-tint); color: var(--tvp-danger-emph); border-radius: var(--tvp-radius); padding: 0.75rem 1rem; margin-bottom: 1rem; }
.tvp-error-summary h2 { font-size: var(--tvp-text-sm); margin: 0 0 0.25rem; color: inherit; }
.tvp-error-summary ul { margin: 0; padding-left: 1.25rem; font-size: var(--tvp-text-sm); }
.tvp-error-summary a { color: inherit; font-weight: 600; display: inline-block; padding: 0.125rem 0; }

/* 5.6 Trạng thái trống và lỗi trang */
.tvp-empty { text-align: center; padding: 3rem 1.5rem; color: var(--tvp-muted); background: var(--tvp-surface); border: 1px dashed var(--tvp-border-input); border-radius: var(--tvp-radius); }
.tvp-empty > .bi { font-size: 2.25rem; color: var(--tvp-green-700); display: block; margin-bottom: 0.5rem; }
.tvp-empty h2 { font-size: var(--tvp-text-title); color: var(--tvp-ink); margin-bottom: 0.25rem; }
.tvp-empty p { max-width: 28rem; margin: 0 auto 1rem; font-size: var(--tvp-text-sm); }
/* D-245 (GD-61): trang 404, 403 một khuôn; tên trang cỡ h1 như mọi trang (K1); trong thẻ của người chưa đăng nhập thì bỏ khung nét đứt */
.tvp-loi h1 { color: var(--tvp-ink); margin-bottom: 0.25rem; }
.tvp-auth__card .tvp-loi { border: 0; padding: 0; background: none; }

/* 5.8 Dòng nhật ký, mã đầu cuối */
.tvp-code { color: var(--tvp-muted); font-size: var(--tvp-text-sm); white-space: nowrap; }   /* mã (sản phẩm, MST): chữ phụ, không khung như canvas */

/* 5.9 Trang đăng nhập (MH-01) */
.tvp-auth { min-height: 100vh; display: flex; flex-direction: column; background: var(--tvp-bg); }
.tvp-auth__main { flex: 1; display: flex; align-items: center; justify-content: center; padding: 1.5rem var(--tvp-gutter); }
.tvp-auth__card { width: 100%; max-width: 26rem; background: var(--tvp-surface); border: 1px solid var(--tvp-border); border-radius: 0.75rem; box-shadow: var(--tvp-shadow-md); padding: 1.5rem; }
@media (min-width: 576px) { .tvp-auth__card { padding: 2rem; } }
.tvp-auth__logo { display: block; width: 9rem; height: auto; margin: 0 auto 1.25rem; }
.tvp-auth h1 { font-size: var(--tvp-text-2xl); text-align: center; margin-bottom: 0.25rem; }
.tvp-auth__lead { text-align: center; color: var(--tvp-muted); font-size: var(--tvp-text-sm); margin-bottom: 1.5rem; }
.tvp-auth__icon { display: block; text-align: center; font-size: 2.5rem; line-height: 1; color: var(--tvp-muted); margin-bottom: 0.75rem; }
.tvp-auth__foot { text-align: center; padding: 1rem; font-size: var(--tvp-text-xs); color: var(--tvp-muted); }
/* MH-01 hai nửa (canvas bản 93): mảng thương hiệu xanh bên trái, form trên nền trắng bên phải; dưới 900 px chỉ còn form */
.tvp-login { min-height: 100vh; display: flex; flex-wrap: wrap; background: var(--tvp-surface); }
.tvp-login__brand { flex: 1 1 35rem; min-width: 0; overflow: hidden; background: var(--tvp-green-700); }  /* cùng màu nền ảnh: phần dưới ảnh liền một khối */
@media (max-width: 899.98px) { .tvp-login__brand { display: none; } }
.tvp-login__photo { display: block; width: 100%; height: auto; max-height: 100vh; object-fit: contain; object-position: center top; }
.tvp-login__main { flex: 1 1 26rem; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2rem; padding: 3rem 2rem; }
.tvp-login__logo { display: block; width: 13rem; height: auto; }
.tvp-login__form { width: 100%; max-width: 23.75rem; }
.tvp-login__form h1 { font-size: 1.75rem; text-align: center; margin-bottom: 2rem; }
.tvp-login__form .form-control { min-height: 3rem; }
.tvp-login__form .btn-lg { min-height: 3rem; font-size: var(--tvp-text-base); }
.tvp-login__form .tvp-auth__lead { margin-top: -1.25rem; }
.tvp-login__help { margin: 2rem 0 0; font-size: var(--tvp-text-sm); color: var(--tvp-muted); }
.tvp-login__foot { font-size: var(--tvp-text-sm); color: var(--tvp-muted); text-align: center; }
.tvp-pwd { position: relative; }
.tvp-pwd .form-control { padding-right: 3rem; }
.tvp-pwd .form-control.is-invalid { background-image: none; }   /* tránh biểu tượng lỗi của Bootstrap đè lên nút hiện mật khẩu */
.tvp-pwd .tvp-pwd__toggle { position: absolute; right: 0.125rem; top: 50%; transform: translateY(-50%); width: var(--tvp-touch); height: var(--tvp-touch); border: 0; background: transparent; color: var(--tvp-muted); border-radius: var(--tvp-radius-sm); }
.tvp-pwd .tvp-pwd__toggle:hover { color: var(--tvp-ink); background: var(--tvp-green-100); }

/* 5.11 Danh sách file đính kèm (US-37). Loại file luôn có chữ (PDF, Word…) cạnh biểu tượng */
.tvp-files { list-style: none; margin: 0; padding: 0; }
.tvp-file { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; padding: 0.75rem 1rem; border-bottom: 1px solid var(--tvp-border); }
.tvp-file:last-child { border-bottom: 0; }
.tvp-file__icon { flex: none; width: 2.25rem; height: 2.25rem; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--tvp-radius-sm); background: var(--tvp-green-50); color: var(--tvp-green-800); font-size: 1.25rem; box-shadow: inset 0 0 0 1px var(--tvp-green-200); }
.tvp-file__main { flex: 1 1 12rem; min-width: 0; }
.tvp-file__name { display: block; font-weight: 600; overflow-wrap: anywhere; }
.tvp-file__meta { display: block; font-size: var(--tvp-text-sm); color: var(--tvp-muted); }
.tvp-file > .btn { flex: none; }

/* 5.13 Nhóm nút thao tác trên dòng danh sách (đổi thứ tự, sửa, khác): các nút kề nhau cách ≥ 8 px */
.tvp-rowactions { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }

/* 5.14 Ảnh sản phẩm (US-07-AC3, ảnh đại diện [ĐỀ XUẤT]): ô ảnh nhỏ trong danh sách, thư viện ảnh ở trang chi tiết, danh sách ảnh trong form.
   Ảnh nền sáng, object-fit: contain để thấy trọn bao bì; mọi <img> có width và height để không nhảy bố cục khi tải. */
.tvp-thumb { flex: none; width: 4rem; height: 4rem; display: inline-flex; align-items: center; justify-content: center; overflow: hidden; border-radius: var(--tvp-radius-sm); background: var(--tvp-bg); box-shadow: inset 0 0 0 1px var(--tvp-border); color: var(--tvp-subtle); font-size: 1.5rem; }
.tvp-thumb img { display: block; width: 100%; height: 100%; object-fit: contain; }
.tvp-thumb--sm { width: 3rem; height: 3rem; font-size: 1.25rem; }
.tvp-prodcell { display: flex; align-items: center; gap: 0.75rem; }
.tvp-prodcell__text { min-width: 0; }
.tvp-logo { flex: none; width: 2.5rem; height: 2.5rem; display: inline-flex; align-items: center; justify-content: center; overflow: hidden; border-radius: var(--tvp-radius-sm); background: #fff; box-shadow: inset 0 0 0 1px var(--tvp-border); color: var(--tvp-green-700); font-weight: 600; }
.tvp-logo img { display: block; width: 100%; height: 100%; object-fit: contain; }
.tvp-logo--md { width: 2.5rem; height: 2.5rem; font-size: 1rem; }
/* Khách chưa có logo: ô chữ cái đầu nền xanh đậm, vạch vàng ở đáy (canvas) */
.tvp-logo--letter { background: var(--tvp-green-900); color: #fff; font-weight: 700; box-shadow: inset 0 -3px 0 var(--tvp-yellow); }
/* Dòng phụ dưới tên trong bảng: nhãn + chữ phụ */
.tvp-cellsub { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.5rem; margin-top: 0.125rem; font-size: var(--tvp-text-sm); color: var(--tvp-muted); }
/* Người phụ trách: vòng tròn chữ cái đầu + tên */

.tvp-gallery__thumb:focus-visible { outline: none; box-shadow: var(--tvp-focus); }
.tvp-gallery__thumbs { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.tvp-gallery__thumb { display: block; width: 4rem; height: 4rem; padding: 0; border: 0; overflow: hidden; border-radius: var(--tvp-radius-sm); background: var(--tvp-bg); box-shadow: inset 0 0 0 1px var(--tvp-border); cursor: pointer; }
.tvp-gallery__thumb img { display: block; width: 100%; height: 100%; object-fit: contain; }
.tvp-gallery__thumb[aria-current="true"] { box-shadow: 0 0 0 2px var(--tvp-green-700); }
.tvp-lightbox__img { display: block; margin: 0 auto; max-width: 100%; max-height: 65vh; object-fit: contain; background: var(--tvp-bg); }
.tvp-lightbox__thumbs { justify-content: center; padding: 0.75rem 1rem 0; }

/* Danh sách ảnh trong form sản phẩm: mỗi ảnh một dòng, có nút chọn ảnh đại diện (cao tối thiểu 44 px) */
.tvp-imgs { list-style: none; margin: 0 0 1rem; padding: 0; border: 1px solid var(--tvp-border); border-radius: var(--tvp-radius); }
.tvp-img { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; padding: 0.75rem 1rem; border-bottom: 1px solid var(--tvp-border); }
.tvp-img:last-child { border-bottom: 0; }
.tvp-img__main { flex: 1 1 10rem; min-width: 0; }
.tvp-img__name { display: block; font-weight: 600; overflow-wrap: anywhere; }
.tvp-img__meta { display: block; font-size: var(--tvp-text-sm); color: var(--tvp-muted); }

/* 5.16 Việc và thông báo (MH-18, MH-19): thanh công cụ, nhóm việc, dòng việc, dòng thông báo */
.tvp-toolbar { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 0.75rem; margin-bottom: 1rem; }
.tvp-toolbar .nav-tabs { flex: 1 1 auto; flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; }
.tvp-toolbar .nav-tabs .nav-link { white-space: nowrap; gap: 0.375rem; }
.tvp-toolbar__right { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.tvp-toolbar__right .form-select { min-width: 11rem; }
.tvp-toolbar__right { align-items: center; }
.tvp-toolbar__right .form-select { width: auto; max-width: 16rem; }
@media (max-width: 575.98px) { .tvp-toolbar__right, .tvp-toolbar__right .form-select { flex: 1 1 100%; max-width: none; } }
.tvp-tasks__group { margin-bottom: 1.5rem; }
.tvp-tasks__title { display: flex; align-items: center; gap: 0.5rem; font-size: var(--tvp-text-title); margin: 0 0 0.5rem; }
.tvp-tasks { margin: 0; padding: 0; list-style: none; background: var(--tvp-surface); border: 1px solid var(--tvp-border); border-radius: var(--tvp-radius); box-shadow: var(--tvp-shadow-sm); overflow: hidden; }
.tvp-task { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 0.75rem; padding: 0.75rem 1rem; border-bottom: 1px solid var(--tvp-border); }
.tvp-task:last-child { border-bottom: 0; }
.tvp-task.is-overdue { background: var(--tvp-danger-tint); }
.tvp-task.is-done .tvp-task__title { color: var(--tvp-muted); text-decoration: line-through; }
.tvp-task__check { display: inline-flex; align-items: center; justify-content: center; width: var(--tvp-touch); height: var(--tvp-touch); margin: -0.5rem; padding: 0; background: none; border: 0; border-radius: 50%; color: var(--tvp-muted); font-size: 1.5rem; }
.tvp-task__check:hover { color: var(--tvp-green-700); background: var(--tvp-green-100); }
.tvp-task__check--done { color: var(--tvp-green-700); }
/* D-158 (4): cả trang không có việc nào tích được (CEO, trưởng phòng xem việc của người khác) và không có việc đã xong thì bỏ ô trống giữ chỗ bên trái */
.tvp-main:not(:has(.tvp-task__check:is(button, .tvp-task__check--done))) .tvp-task__check { width: 0; margin: 0 -0.75rem 0 0; overflow: hidden; }   /* giữ ô trong lưới (ô Hạn trên điện thoại đặt theo cột 2), chỉ thu bề rộng và bù khoảng cách cột */
.tvp-task__main { min-width: 0; display: flex; flex-direction: column; }
.tvp-task__title { font-weight: 600; color: var(--tvp-ink); overflow-wrap: anywhere; }
.tvp-task__meta { font-size: var(--tvp-text-sm); color: var(--tvp-muted); }
.tvp-task__due { display: flex; flex-direction: column; align-items: flex-end; gap: 0.25rem; font-size: var(--tvp-text-sm); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tvp-task__date { display: inline-flex; align-items: center; gap: 0.375rem; color: var(--tvp-muted); }
.tvp-task.is-overdue .tvp-task__date { color: var(--tvp-danger-emph); font-weight: 600; }
.tvp-task__who { color: var(--tvp-ink); font-weight: 500; }
.tvp-task__act { display: flex; align-items: center; gap: 0.25rem; }
.tvp-task__meta a { color: inherit; }
.tvp-task__result { font-size: var(--tvp-text-sm); color: var(--tvp-ink); overflow-wrap: anywhere; }
/* Ô Kết quả khi hoàn thành (US-15-AC14). Chỉ một class cho display để .collapse:not(.show) của Bootstrap vẫn ẩn được */
.tvp-done-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.5rem; }
.tvp-done-form__field { flex: 1 1 16rem; min-width: 0; }
.tvp-done-form__field .form-label { margin-bottom: 0.25rem; font-size: var(--tvp-text-sm); font-weight: 600; }
.tvp-task > .tvp-done-form { grid-column: 1 / -1; }
.tvp-taskbar > .tvp-done-form { flex: 1 1 100%; padding: 0 0.375rem 0.25rem 0; }
@media (max-width: 767.98px) {
  .tvp-task { grid-template-columns: auto minmax(0, 1fr); row-gap: 0.5rem; }
  .tvp-task__due { grid-column: 2; flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: flex-start; }
  .tvp-task__reopen { grid-column: 2; justify-self: start; }
}
.tvp-notifs { margin: 0; padding: 0; }
.tvp-notifs > li { border-bottom: 1px solid var(--tvp-border); }
.tvp-notifs > li:last-child { border-bottom: 0; }
.tvp-notif { display: flex; align-items: flex-start; gap: 0.75rem; padding: 0.875rem 1rem; color: var(--tvp-ink); text-decoration: none; min-height: var(--tvp-touch); }
.tvp-notif:hover { background: var(--tvp-green-50); color: var(--tvp-ink); }
.tvp-notif.is-unread { background: var(--tvp-green-50); }
.tvp-notif.is-unread .tvp-notif__msg { font-weight: 600; }
.tvp-notif > .bi { font-size: 1.25rem; flex: none; margin-top: 0.125rem; }
.tvp-notif__text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 0.125rem; }
.tvp-notif__msg { overflow-wrap: anywhere; }
.tvp-notif__time { font-size: var(--tvp-text-xs); color: var(--tvp-muted); font-variant-numeric: tabular-nums; }
.tvp-notif__dot { flex: none; width: 0.625rem; height: 0.625rem; margin-top: 0.375rem; border-radius: 50%; background: var(--tvp-green-700); }
/* Thông báo là nút trong form POST (đánh dấu đã đọc rồi mở link, US-16-AC4) */
button.tvp-notif, button.tvp-bell-item { width: 100%; border: 0; border-radius: 0; background: transparent; text-align: left; font: inherit; }
.tvp-notifs__group { padding: 0.5rem 1rem; font-size: var(--tvp-text-sm); font-weight: 700; color: var(--tvp-muted); background: var(--tvp-bg); }
.tvp-bell-item { align-items: flex-start; }
.tvp-bell-item__text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 0.125rem; overflow-wrap: anywhere; }
.tvp-bell-menu__list { max-height: min(24rem, 60vh); overflow-y: auto; margin: 0; padding: 0; list-style: none; }
.tvp-bell-menu__foot { display: block; padding: 0.625rem 1rem; text-align: center; font-weight: 600; font-size: var(--tvp-text-sm); }
.tvp-iconbtn .tvp-count { position: absolute; top: 0.125rem; right: 0; }

/* 5.17 Pipeline (MH-09): chuyển dạng, bảng 9 cột (7 bước, Thắng, Thua), thẻ cơ hội. Thẻ không kéo thả; màu bước chỉ ở dải mỏng trên thẻ, luôn kèm chữ ở tiêu đề cột */
.tvp-seg { display: inline-flex; border: 1px solid var(--tvp-border-input); border-radius: var(--tvp-radius-sm); overflow: hidden; background: var(--tvp-surface); }
.tvp-seg a { display: inline-flex; align-items: center; gap: 0.375rem; padding: 0 0.875rem; color: var(--tvp-ink); text-decoration: none; font-weight: 600; }
.tvp-seg a + a { border-left: 1px solid var(--tvp-border-input); }
.tvp-seg a:hover { background: var(--tvp-green-100); }
.tvp-seg a[aria-current] { background: var(--tvp-green-700); color: var(--tvp-surface); }
@media (max-width: 575.98px) { .tvp-seg { flex: 1 1 100%; } .tvp-seg a { flex: 1 1 50%; justify-content: center; } }
@media (max-width: 575.98px) { .tvp-seg--4 a { flex: 1 1 auto; padding: 0 0.5rem; white-space: nowrap; } }
/* Bảng cột theo canvas Pipeline (D-96, US-20-AC7, AC8): bố cục theo bề rộng vùng nội dung (`.tvp-pipewrap`), không theo màn hình.
   Vùng nội dung từ 59 rem (944 px): một hàng 7 cột rộng bằng nhau, cách 6 px. Hẹp hơn: nhiều hàng, cột tối thiểu 180 px (dưới 768 px còn một cột).
   Chữ trong đầu cột và thẻ xuống dòng, không cắt bằng ba chấm. */
.tvp-pipewrap { container: tvpboard / inline-size; display: flex; flex-direction: column; gap: 1.5rem; }
.tvp-pipe { display: grid; grid-template-columns: repeat(auto-fill, minmax(11.25rem, 1fr)); gap: 0.375rem; align-items: start; }
@container tvpboard (min-width: 59rem) { .tvp-pipe { grid-template-columns: repeat(7, minmax(0, 1fr)); } }
.tvp-pcol { min-width: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.tvp-pcol__head { box-sizing: border-box; min-height: 5.75rem; padding: 0.625rem; border-radius: 0.625rem; background: var(--tvp-green-100); color: var(--tvp-green-900); display: flex; flex-direction: column; justify-content: space-between; gap: 0.375rem; }
.tvp-pcol__head--won { background: var(--tvp-green-700); color: var(--tvp-surface); }
.tvp-pcol__head--lost { background: var(--tvp-danger-tint); color: var(--tvp-danger); }
.tvp-pcol__title { display: flex; align-items: flex-start; gap: 0.375rem; margin: 0; padding-top: 2px; font-size: var(--tvp-text-sm); font-weight: 700; line-height: 1.3; color: inherit; overflow-wrap: anywhere; }
.tvp-pcol__no { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 1.375rem; height: 1.375rem; margin-top: -2px; border-radius: 999px; background: var(--tvp-green-700); color: var(--tvp-surface); font-size: var(--tvp-text-xs); font-weight: 700; }
.tvp-pcol__meta { display: flex; flex-direction: column; gap: 0.375rem; }
.tvp-pcol__nums { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 0.5rem; margin: 0; line-height: 1.3; font-variant-numeric: tabular-nums; }
.tvp-pcol__nums > span:first-child { font-size: var(--tvp-text-xs); font-weight: 600; }
.tvp-pcol__nums > span:last-child { font-size: var(--tvp-text-base); font-weight: 700; }
.tvp-pcol__bar { height: 6px; border-radius: 999px; background: var(--tvp-surface); overflow: hidden; }
.tvp-pcol__bar > span { display: block; height: 100%; border-radius: 999px; background: var(--tvp-green-700); }
.tvp-pcol__bar--none { background: transparent; }
.tvp-pcol__none { margin: 0; padding: 0.75rem; border: 1px dashed var(--tvp-border-input); border-radius: var(--tvp-radius); font-size: var(--tvp-text-sm); line-height: 1.4; color: var(--tvp-muted); }
.tvp-pcard { box-sizing: border-box; display: flex; flex-direction: column; gap: 0.375rem; min-width: 0; padding: 0.625rem; background: var(--tvp-surface); border: 1px solid var(--tvp-border); border-radius: 0.625rem; color: inherit; text-decoration: none; transition: box-shadow .15s, transform .15s; }
.tvp-pcard:hover { color: inherit; box-shadow: 0 6px 16px rgba(15, 69, 5, .16); transform: translateY(-1px); }
.tvp-pcard--warn { padding: 0.5625rem; border: 2px solid var(--tvp-yellow); }
.tvp-pcard__cust { font-size: var(--tvp-text-sm); font-weight: 700; line-height: 1.3; overflow-wrap: break-word; text-wrap: balance; }  /* R-9: đọc đủ tên (AC7), dòng chia đều, không gãy lẻ một chữ */
.tvp-pcard__opp { margin-top: -0.25rem; font-size: var(--tvp-text-xs); line-height: 1.35; color: var(--tvp-muted); overflow-wrap: anywhere; }
.tvp-pcard__foot { display: flex; align-items: center; justify-content: space-between; gap: 0.375rem; }
.tvp-pcard__value { font-size: var(--tvp-text-sm); font-weight: 700; line-height: 1.3; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tvp-pcard__none { font-size: var(--tvp-text-xs); color: var(--tvp-muted); }
.tvp-ini { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 1.5rem; height: 1.5rem; border-radius: 999px; background: var(--tvp-vang-nhat); color: var(--tvp-warn); font-size: var(--tvp-text-xs); font-weight: 700; }
.tvp-ini--alt { background: var(--tvp-green-100); color: var(--tvp-green-900); }
.tvp-chip { align-self: flex-start; display: inline-flex; align-items: center; gap: 0.25rem; max-width: 100%; padding: 2px 0.5rem; border-radius: 999px; background: var(--tvp-bg); color: var(--tvp-ink); font-size: var(--tvp-text-xs); font-weight: 600; line-height: 1.125rem; overflow-wrap: anywhere; }
.tvp-chip--warn { background: var(--tvp-vang-nhat); color: var(--tvp-warn); }
.tvp-chip > .bi { flex: none; }
@media (max-width: 767.98px) { .tvp-pipe { grid-template-columns: minmax(0, 1fr); } .tvp-pcol__head { min-height: 0; } }
.tvp-rtable td.num { white-space: nowrap; }

/* 5.18 Chi tiết cơ hội (MH-10): thông tin đầu trang, thanh 7 bước, dòng thời gian bước, việc trong thẻ */
/* Thanh bước theo canvas Co-hoi-sale: 5 ô liền nhau trong thẻ đầu trang. Đã qua: nền xanh nhạt, dấu tích; hiện tại: nền xanh đậm;
   còn lại: nền xám; dừng (Thua): nền đỏ nhạt, dấu X. Điện thoại: ô số ở trên, tên bước nhỏ ở dưới. */
.tvp-steps__list { display: grid; grid-template-columns: repeat(var(--n, 5), minmax(0, 1fr)); gap: 0.375rem; margin: 0; padding: 0; list-style: none; }
.tvp-step { display: flex; align-items: center; gap: 0.5rem; min-height: 3rem; min-width: 0; padding: 0.375rem 0.625rem; border-radius: 0.625rem; background: var(--tvp-bg); color: var(--tvp-muted); }
.tvp-step__no { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 1.5rem; height: 1.5rem; border-radius: 999px; border: 1px solid var(--tvp-border); background: var(--tvp-surface); color: var(--tvp-muted); font-size: var(--tvp-text-xs); font-weight: 700; }
.tvp-step__name { min-width: 0; font-size: var(--tvp-text-sm); font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.tvp-step.is-done { background: var(--tvp-green-100); color: var(--tvp-green-900); }
.tvp-step.is-done .tvp-step__no { background: var(--tvp-green-700); border-color: var(--tvp-green-700); color: var(--tvp-surface); }
.tvp-step.is-current { background: var(--tvp-green-700); color: var(--tvp-surface); }
.tvp-step.is-current .tvp-step__no { border-color: var(--tvp-surface); color: var(--tvp-green-700); }
.tvp-step.is-stopped { background: var(--tvp-danger-tint); color: var(--tvp-danger); }
.tvp-step.is-stopped .tvp-step__no { background: var(--tvp-danger); border-color: var(--tvp-danger); color: var(--tvp-surface); }
@media (max-width: 575.98px) {
  .tvp-step { flex-direction: column; justify-content: center; gap: 0.25rem; padding: 0.375rem 0.125rem; text-align: center; }
  .tvp-step__name { font-size: var(--tvp-text-xs); }
}
.tvp-tasks--flat { border: 0; border-radius: 0; box-shadow: none; }
.tvp-tasks--flat .tvp-task:last-child { border-bottom: 0; }
.tvp-card__none { margin: 0; padding: 1rem; color: var(--tvp-muted); }

/* Tôn trọng người dùng tắt hiệu ứng chuyển động */
/* 5.20a Chi tiết khách MH-06 theo canvas bản 93 (T-18, D-103, D-107): thẻ đầu trang, thanh tab gạch chân, khung trắng bo 12 px */
.tvp-custhead { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.25rem; margin-bottom: 1.5rem; padding: 1.25rem; background: var(--tvp-surface); border: 1px solid var(--tvp-border); border-radius: var(--tvp-radius); }
.tvp-custhead__who { flex: 1 1 22rem; min-width: 0; }
.tvp-custhead h1 { margin: 0; overflow-wrap: anywhere; }
.tvp-custhead__title { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.75rem; }
.tvp-custhead__sum { margin: 0.5rem 0 0; color: var(--tvp-muted); }
.tvp-custhead__sum strong { color: var(--tvp-ink); font-variant-numeric: tabular-nums; }
.tvp-custhead__actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }   /* GD-49 (D-249): 12 px như form */
@media (max-width: 575.98px) { .tvp-custhead__actions { flex: 1 1 100%; } .tvp-custhead__actions .btn { flex: 1 1 auto; } }
.tvp-logo--xl { width: 4rem; height: 4rem; font-size: 1.75rem; }
/* Thanh việc ở đầu MH-06 (US-15-AC7 → AC13, D-107): một dòng, đỏ khi có việc quá hạn, xám khi không; nút Hoàn thành bên phải */
.tvp-taskbar { flex: 1 1 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.625rem; padding: 0.375rem 0.375rem 0.375rem 0.875rem; min-height: 2.75rem; border-radius: 0.625rem; background: var(--tvp-bg); color: var(--tvp-ink); font-size: var(--tvp-text-sm); line-height: 1.4; }
.tvp-taskbar > .bi { flex: none; align-self: flex-start; margin-top: 0.125rem; font-size: 1.125rem; color: var(--tvp-muted); }
.tvp-taskbar--danger { background: var(--tvp-danger-tint); color: var(--tvp-danger-emph); }
.tvp-taskbar--danger > .bi { color: var(--tvp-danger-emph); }
.tvp-taskbar__text { flex: 1 1 0; min-width: 12rem; overflow-wrap: anywhere; }
.tvp-taskbar__sep { color: var(--tvp-subtle); }
.tvp-taskbar__next { color: var(--tvp-ink); }
.tvp-taskbar__more { color: inherit; font-weight: 600; }
.tvp-taskbar__act { margin-left: auto; }
.tvp-taskbar__act.btn { background: var(--tvp-surface); }
/* Hỏi tạo việc tiếp theo (US-15-AC3): khung vàng nhạt, form một hàng khi đủ rộng */
.tvp-asknext { flex: 1 1 100%; margin: 0 0 1rem; padding: 0.75rem 1rem; border: 1px solid var(--tvp-warn-border); border-radius: var(--tvp-radius-sm); background: var(--tvp-warn-tint); color: var(--tvp-ink); }
.tvp-taskbar .tvp-asknext { margin: 0.25rem 0.375rem 0.375rem -0.5rem; }
.tvp-asknext__q { display: flex; gap: 0.5rem; margin: 0 0 0.5rem; }
.tvp-asknext__q > .bi { color: var(--tvp-warn); font-size: 1.125rem; }
.tvp-asknext__form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.5rem 0.75rem; }
.tvp-asknext__form .form-label { margin-bottom: 0.25rem; }   /* GD-26 (D-249): nhãn 13/600 như mọi form (D-147), trước 14 */
.tvp-asknext__title { flex: 1 1 16rem; }
.tvp-asknext__due { flex: 0 1 11rem; }
.tvp-asknext__btns { display: flex; gap: 0.5rem; }
.tvp-logo--xl.tvp-logo--letter { box-shadow: inset 0 -4px 0 var(--tvp-yellow); }

/* Thanh tab kiểu canvas: không khung, tab đang mở chữ xanh đậm và gạch chân 3 px; số đếm nhạt sau tên */
.tvp-tabs { --bs-nav-tabs-border-width: 0; border-bottom: 1px solid var(--tvp-border); gap: 0.25rem; }
.tvp-tabs .nav-link { display: inline-flex; align-items: center; min-height: 2.75rem; border: 0; border-radius: 0; padding: 0 0.875rem; color: var(--tvp-ink); font-weight: 500; font-size: var(--tvp-text-sm); background: transparent; }
.tvp-tabs .nav-link:hover { color: var(--tvp-green-700); box-shadow: inset 0 -3px 0 var(--tvp-border); }
.tvp-tabs .nav-link.active { color: var(--tvp-green-900); font-weight: 700; background: transparent; box-shadow: inset 0 -3px 0 var(--tvp-green-700); }
.tvp-tabcount { margin-left: 0.375rem; font-size: var(--tvp-text-xs); font-weight: 600; color: var(--tvp-muted); font-variant-numeric: tabular-nums; }

/* Khung nội dung trong tab: nền trắng, viền, bo 12 px, tiêu đề 18 px */
.tvp-panel { min-width: 0; padding: 1.25rem; background: var(--tvp-surface); border: 1px solid var(--tvp-border); border-radius: var(--tvp-radius); }
.tvp-panel__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1rem; margin-bottom: 0.75rem; }
.tvp-panel__head .tvp-panel__title { margin: 0; }
.tvp-panel__title { margin: 0 0 0.75rem; font-size: var(--tvp-text-title); font-weight: 700; }
.tvp-panel__note { margin: 0 0 0.75rem; color: var(--tvp-muted); }

/* US-56: "Sản phẩm nên chào" (canvas Chi-tiet-khach: thẻ 3 cột có ảnh nhỏ, mã, tên, ứng dụng) và "Khách nên chào" (canvas CEO-Chi-tiet-san-pham) */
.tvp-panel__head .tvp-pill { flex: none; }
.tvp-nenchao { display: grid; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); gap: 0.75rem; margin: 0; padding: 0; list-style: none; }
.tvp-nenchao__the { display: flex; align-items: center; gap: 0.75rem; height: 100%; padding: 1rem 0.75rem; border: 1px solid var(--tvp-border); border-radius: var(--tvp-radius); color: var(--tvp-ink); text-decoration: none; }
.tvp-nenchao__the:hover { border-color: var(--tvp-border-input); background: var(--tvp-green-50); }
.tvp-nenchao__anh { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 3rem; height: 3rem; border-radius: var(--tvp-radius-sm); background: var(--tvp-bg); color: var(--tvp-muted); overflow: hidden; }
.tvp-nenchao__anh img { width: 100%; height: 100%; object-fit: cover; }
.tvp-nenchao__chu { min-width: 0; display: flex; flex-direction: column; }
.tvp-nenchao__ma { white-space: nowrap; color: var(--tvp-green-700); font-size: var(--tvp-text-xs); font-weight: 700; }
.tvp-nenchao__ten { font-weight: 600; line-height: 1.35; }
.tvp-nenchao__ud { color: var(--tvp-muted); font-size: var(--tvp-text-sm); line-height: 1.4; }

/* Luật này đè lên thẻ cơ hội của Pipeline (5.x .tvp-pcard ở trên); giữ nguyên để Pipeline không đổi khi bỏ bố cục cũ của MH-20 */
.tvp-pcard { padding: 1rem 1.125rem; border-radius: 0.75rem; background: var(--tvp-bg); box-shadow: inset 0 0 0 1px var(--tvp-border); }

/* 5.20b Chi tiết sản phẩm MH-20 (D-163, Huy 08/11): đầu trang mã + nhãn + nút, tên, nhóm và ngành; tab Thông tin từ 1200 px:
   khung ảnh 340 px trái kéo cao bằng khung thông tin, ảnh và dải ảnh nhỏ dính khi cuộn; Khách nên chào rộng hết bên dưới. Dưới 1200 px một cột. */
/* Đầu trang Chi tiết sản phẩm giữ kiểu D-163 (Huy 16/11/2026: "chi tiết sản phẩm trước tôi thấy đẹp, có thể giữ nguyên"); tên một dòng, dài thì "…" kèm title */
.tvp-sphead { display: flex; gap: 1.25rem; align-items: center; margin-bottom: 1rem; background: linear-gradient(135deg, var(--tvp-green-50), var(--tvp-surface) 70%); }
.tvp-sphead > .tvp-sphead__ic { width: 4.5rem; height: 4.5rem; }
.tvp-sphead__chu { flex: 1 1 auto; min-width: 0; }
.tvp-sphead__hang { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; }
.tvp-sphead__ma { margin: 0; font-weight: 700; color: var(--tvp-green-900); white-space: nowrap; }
.tvp-sphead__nut { flex: none; display: flex; gap: 0.5rem; }
.tvp-sphead__them { min-width: var(--tvp-touch); justify-content: center; }
.tvp-sphead h1 { margin: 0.25rem 0 0.5rem; font-size: 2rem; font-weight: 700; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tvp-sphead__phu { display: flex; flex-wrap: wrap; gap: 0.375rem 1.5rem; margin: 0; color: var(--tvp-ink); }
.tvp-sphead__phu > span { display: inline-flex; align-items: baseline; gap: 0.375rem; }
.tvp-sphead__phu i { color: var(--tvp-green-700); }
.tvp-sphead__phu b { font-weight: 700; color: var(--tvp-green-900); white-space: nowrap; }
/* K2 (D-244): ô biểu tượng thay logo ở đầu trang chi tiết cơ hội, báo giá; cùng cỡ logo khách 80 px (điện thoại 56) */
.tvp-sphead__ic { flex: none; display: flex; align-items: center; justify-content: center; width: 5rem; height: 5rem; border-radius: 1rem; background: var(--tvp-green-700); color: #fff; font-size: 2rem; }
.tvp-spanh__chinh { display: block; width: 100%; max-width: 360px; aspect-ratio: 1 / 1; padding: 0; border: 0; overflow: hidden; border-radius: 16px; background: var(--tvp-bg); box-shadow: inset 0 0 0 1px var(--tvp-border); cursor: zoom-in; }
.tvp-spanh__chinh img { display: block; width: 100%; height: 100%; object-fit: contain; }
.tvp-spanh__nho { list-style: none; margin: 0.75rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.5rem; max-width: 360px; }
.tvp-spanh__nho button { position: relative; display: block; width: 100%; aspect-ratio: 1 / 1; padding: 0; border: 0; overflow: hidden; border-radius: var(--tvp-radius-sm); background: var(--tvp-bg); box-shadow: inset 0 0 0 1px var(--tvp-border); cursor: zoom-in; }
.tvp-spanh__nho img { display: block; width: 100%; height: 100%; object-fit: contain; }
.tvp-spanh__con { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgb(0 0 0 / 0.55); color: #fff; font-size: var(--tvp-text-lg); font-weight: 700; }
.tvp-spanh__chinh:focus-visible, .tvp-spanh__nho button:focus-visible { outline: none; box-shadow: var(--tvp-focus); }
.tvp-spanh__trong { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.25rem; max-width: 360px; aspect-ratio: 1 / 1; padding: 0.75rem; border-radius: 16px; background: var(--tvp-bg); text-align: center; color: var(--tvp-muted); }
.tvp-spanh__trong > i { font-size: 2.5rem; color: var(--tvp-subtle); }
.tvp-spanh__trong a { display: inline-flex; align-items: center; gap: 0.25rem; min-height: var(--tvp-touch); font-weight: 600; }
.tvp-spinfo { display: grid; gap: 18px; align-items: start; grid-template-columns: minmax(0, 1fr); }
.tvp-spinfo > .tvp-spchao { grid-column: 1 / -1; }
@media (min-width: 1200px) {
  .tvp-spinfo { grid-template-columns: 340px minmax(0, 1fr); align-items: stretch; }
  .tvp-spinfo > .tvp-spchao { align-self: start; }
  .tvp-spanh__dinh { position: sticky; top: calc(var(--tvp-topbar-h) + 1rem); }
}
.tvp-sptitle { display: flex; align-items: center; gap: 0.5rem; margin: 0 0 0.75rem; font-size: var(--tvp-text-title); font-weight: 700; }
.tvp-sptitle > i { color: var(--tvp-green-700); }
.tvp-sptitle__so { display: inline-flex; align-items: center; justify-content: center; min-width: 1.5rem; height: 1.5rem; padding: 0 0.5rem; border-radius: 999px; background: var(--tvp-green-100); color: var(--tvp-green-900); font-size: var(--tvp-text-xs); font-weight: 700; }
.tvp-spdl { margin: 0; }
.tvp-spdl > div { display: grid; grid-template-columns: 11.25rem minmax(0, 1fr); gap: 0.25rem 1rem; padding: 0.75rem 0; border-top: 1px solid var(--tvp-border); }
.tvp-spdl > div:last-child { padding-bottom: 0; }
.tvp-spdl dt { min-width: 0; font-weight: 700; color: var(--tvp-green-900); }   /* nhãn đậm như Hồ sơ khách (Huy, 08/11); cột nhãn 180 px mọi màn (GD-46, D-249; trước 104, 170, 190) */
.tvp-spdl dt[title] { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }   /* GD-21 (D-249): nhãn dài (nhu cầu khách) một dòng, rê chuột xem đủ */
.tvp-spdl dd { margin: 0; white-space: pre-line; overflow-wrap: anywhere; line-height: 1.55; }
.tvp-spdl dd.is-empty { color: var(--tvp-subtle); }
/* 5.22 Chi tiết cơ hội MH-10 (D-187, D-244): đầu trang khuôn K2 (.tvp-custhead--khach như Chi tiết đơn), thanh bước và thanh việc rộng hết bên dưới;
   tab Thông tin: hai khối Nhu cầu khách, Thông tin cơ hội từ 1200 px luôn rộng bằng nhau và cao bằng nhau */
.tvp-ochd .tvp-khmeta a { color: var(--tvp-green-900); }
.tvp-ochd__viec { display: flex; flex-direction: column; gap: 0.5rem; }
.tvp-ochd__viec .tvp-taskbar { flex: none; }
.tvp-ochd__viec .tvp-asknext__form { flex: 1 1 100%; margin: 0.25rem 0.375rem 0.375rem 1.75rem; }
.tvp-taskbar__ai { color: var(--tvp-muted); }
.tvp-taskbar--danger .tvp-taskbar__ai { color: inherit; }
.tvp-ocinfo { display: grid; gap: 1rem; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1200px) { .tvp-ocinfo { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: stretch; } }
.tvp-ocinfo__dau { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 0.75rem; margin-bottom: 0.75rem; }
.tvp-ocinfo__dau .tvp-sptitle { margin: 0; }
.tvp-spkhach { margin: 0; padding: 0; list-style: none; }
.tvp-spkhach a { display: flex; align-items: center; gap: 0.75rem; padding: 0.625rem 0; border-top: 1px solid var(--tvp-border); color: var(--tvp-ink); text-decoration: none; }
.tvp-spkhach li:first-child a { border-top: 0; padding-top: 0; }
.tvp-spkhach a:hover .tvp-spkhach__ten { text-decoration: underline; }
.tvp-spkhach .tvp-logo { flex: none; width: 2.5rem; height: 2.5rem; border-radius: 999px; font-size: 1rem; }
.tvp-spkhach__chu { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.tvp-spkhach__ten { font-weight: 700; overflow-wrap: anywhere; }
.tvp-spkhach__phu { font-size: var(--tvp-text-sm); color: var(--tvp-muted); }
.tvp-spkhach__phu b { font-weight: 600; color: var(--tvp-ink); }
.tvp-spkhach__icp { flex: none; padding: 0.125rem 0.5rem; border-radius: 999px; background: var(--tvp-kpi-xd-bg); color: var(--tvp-kpi-xd-chu); font-size: var(--tvp-text-xs); font-weight: 700; white-space: nowrap; }
.tvp-spkhach__icp.is-empty { background: transparent; color: var(--tvp-muted); }
.tvp-spngan__tim { flex: none; margin-bottom: 0.75rem; border-radius: 999px; }
.tvp-spngan__loc { display: flex; flex-wrap: wrap; gap: 0.375rem; margin-bottom: 1rem; }
.tvp-spngan__loc button { display: inline-flex; align-items: center; gap: 0.375rem; min-height: 2.25rem; padding: 0 0.75rem; border: 1px solid var(--tvp-border-input); border-radius: 999px; background: var(--tvp-surface); color: var(--tvp-ink); font-size: var(--tvp-text-sm); font-weight: 500; }
.tvp-spngan__loc button span { color: var(--tvp-muted); }
.tvp-spngan__loc button[aria-pressed="true"] { border-color: var(--tvp-green-700); background: var(--tvp-green-700); color: var(--tvp-surface); }
.tvp-spngan__loc button[aria-pressed="true"] span { color: inherit; }
.tvp-spngan__loc button:focus-visible { outline: none; box-shadow: var(--tvp-focus); }
@media (max-width: 575.98px) {
  .tvp-sphead__ic { width: 3.5rem; height: 3.5rem; border-radius: 0.75rem; font-size: 1.5rem; }
  .tvp-sphead > .tvp-sphead__ic { width: 3rem; height: 3rem; font-size: 1.375rem; }
  .tvp-sphead { flex-wrap: wrap; gap: 1rem; }
  .tvp-sphead { align-items: flex-start; }
  .tvp-sphead__chu { flex-basis: calc(100% - 3rem - 1rem); }
  .tvp-sphead__phu > span { display: block; }
  .tvp-sphead__phu i { margin-right: 0.375rem; }  /* chữ ngành chảy xuống dưới nhãn, không bó thành cột hẹp */
  .tvp-sphead__nut { flex: 1 1 100%; }
  .tvp-sphead__nut > .btn { flex: 1 1 auto; white-space: nowrap; }
  .tvp-sphead h1 { font-size: 1.25rem; }
  .tvp-spdl > div, .tvp-ocinfo .tvp-spdl > div { grid-template-columns: minmax(0, 1fr); }
  .tvp-ochd__viec .tvp-asknext__form { margin-left: 0; }
  .tvp-spkhach__phu > span:not(.tvp-spkhach__cham) { display: block; }  /* Ngành, Phụ trách mỗi mục một dòng cho khỏi gãy chữ */
  .tvp-spkhach__cham { display: none; }
}

/* 5.20 Hồ sơ khách (MH-06). Một cột: thẻ đầu trang (tên, tag, hành động), thanh tab, nội dung tab.
   Thông tin khách nằm ở tab "Thông tin". Vùng nội dung là vùng chứa "cust": bảng đơn hàng đổi sang thẻ và tab Thông tin chia hai cột theo bề rộng của chính vùng này,
   không theo viewport (menu trái chiếm 232 px sau D-96, trước đó 264 px). */

/* 5.21 Tab Cơ hội của MH-06 (US-18, canvas Chi-tiet-khach-co-hoi, Tao-co-hoi): thẻ cơ hội đang mở có thanh 5 bước gọn */
.tvp-panel__link { display: inline-flex; align-items: center; gap: 0.25rem; padding: 0; font-weight: 600; text-decoration: none; }
.tvp-opps { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 24rem), 1fr)); gap: 0.75rem; margin: 0; padding: 0; list-style: none; }
.tvp-opp { position: relative; display: flex; flex-direction: column; gap: 0.625rem; min-width: 0; padding: 0.875rem 1rem; border: 1px solid var(--tvp-border); border-radius: var(--tvp-radius); background: var(--tvp-surface); }
.tvp-opp:has(.tvp-opp__open:hover) { border-color: var(--tvp-green-700); }
.tvp-opp:has(.tvp-opp__open:focus-visible) { outline: 2px solid var(--tvp-green-700); outline-offset: 2px; }
.tvp-opp__open { color: inherit; text-decoration: none; }
.tvp-opp__open::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.tvp-opp__open:focus-visible { outline: none; }
.tvp-opp:hover .tvp-opp__open { text-decoration: underline; }
.tvp-opp__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.75rem; }
.tvp-opp__who { min-width: 0; }
.tvp-opp__code { white-space: nowrap; display: inline-block; font-size: var(--tvp-text-xs); font-weight: 700; color: var(--tvp-green-700); font-variant-numeric: tabular-nums; }
.tvp-opp__title { margin: 0; font-size: var(--tvp-text-base); font-weight: 600; line-height: 1.4; overflow-wrap: anywhere; }
.tvp-opp__money { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 0.25rem; text-align: right; }
.tvp-opp__value { font-size: var(--tvp-text-xl); font-weight: 700; line-height: 1.3; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tvp-opp__none { font-size: var(--tvp-text-sm); font-weight: 400; color: var(--tvp-muted); }
.tvp-opp__pills { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0.375rem; }
.tvp-opp__pills:empty { display: none; }
.tvp-opp__progress { display: flex; flex-direction: column; gap: 0.375rem; }
.tvp-ministeps { display: flex; gap: 0.25rem; }
.tvp-ministeps > span { flex: 1 1 0; height: 0.5rem; border-radius: 999px; background: var(--tvp-bg); box-shadow: inset 0 0 0 1px var(--tvp-border); }
.tvp-ministeps > .is-da-qua { background: var(--tvp-green-700); box-shadow: none; }
.tvp-ministeps > .is-hien-tai { background: var(--tvp-yellow); box-shadow: none; }
.tvp-opp__step { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.25rem 0.5rem; margin: 0; font-size: var(--tvp-text-sm); color: var(--tvp-muted); }
.tvp-opp__step b { color: var(--tvp-ink); }
.tvp-custhead__sum { display: flex; flex-wrap: wrap; gap: 0.5rem 2rem; margin: 0.75rem 0 0; }
/* Đầu trang khách MH-06 (D-164, Huy chọn kiểu A 08/11/2026): hàng trên logo, tên + nhãn, ba ô Ngành / Khu vực / Phụ trách, nút Ghi buổi làm việc và ⋯;
   dưới là 4 ô số liệu nền xám nhạt có dòng phụ; cuối là thanh việc. Lớp riêng để không đổi đầu trang Chi tiết sale. */
.tvp-custhead.tvp-custhead--khach { display: flex; flex-direction: column; flex-wrap: nowrap; align-items: stretch; gap: 1.25rem; padding: 1.5rem; }   /* nowrap: khung xếp dọc nhiều dòng thì dòng rộng theo nội dung dài nhất, tên dài làm tràn trang (D-244) */
.tvp-khhead { display: flex; align-items: flex-start; gap: 1.25rem; min-width: 0; }   /* min-width 0: tên dài không kéo rộng khung (D-244) */
.tvp-custhead--khach > .tvp-taskbar { flex: none; }   /* thanh việc mang flex-basis 100% cho hàng ngang; khung đầu xếp dọc nên bỏ */
.tvp-khhead > .tvp-logo--xl { width: 5rem; height: 5rem; font-size: 2rem; }
.tvp-custhead--khach .tvp-custhead__who { display: block; flex: 1 1 auto; min-width: 0; }   /* bỏ display: contents của khuôn đầu trang chung ≥ 992 px */
.tvp-custhead--khach h1 { max-width: 100%; font-size: 1.75rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }   /* D-244: tên một dòng, dài thì "…" kèm title */
@media (max-width: 1099.98px) { .tvp-custhead--khach .tvp-custhead__title { flex-direction: column; align-items: flex-start; } }   /* D-169: dưới 1100 px cụm nhãn dòng riêng dưới tên, thiếu chỗ thì nhãn xuống dòng trong cột tên, không đè nút; từ 1100 px giữ R-14 (cụm cạnh tên, thiếu chỗ thì cả cụm xuống dòng) */
.tvp-custhead__pills { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.75rem; min-width: 0; }  /* R-14: nhãn cạnh tên đi cùng nhau */
.tvp-khmeta { display: flex; flex-wrap: wrap; gap: 0.75rem 2.5rem; margin: 0.75rem 0 0; }
.tvp-khmeta dt { font-size: var(--tvp-text-xs); font-weight: 500; color: var(--tvp-muted); }
.tvp-khmeta dd { display: flex; align-items: center; gap: 0.375rem; margin: 0.125rem 0 0; font-size: var(--tvp-text-base); font-weight: 600; }
.tvp-custhead--khach .tvp-custhead__actions { flex: none; flex-wrap: nowrap; }
.tvp-khhead__them { min-width: var(--tvp-touch); justify-content: center; }
.tvp-custhead--khach .tvp-custhead__sum { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 0.75rem; margin: 0; }   /* 2 đến 4 ô chia đều; auto-fit làm Chrome tính cao theo một cột trong khung xếp dọc */
.tvp-custhead--khach .tvp-custhead__sum > div { display: flex; flex-direction: column; gap: 0.25rem; min-width: 0; padding: 0.875rem 1rem; background: var(--tvp-bg); border-radius: 10px; }
.tvp-custhead--khach .tvp-custhead__sum dt { font-size: var(--tvp-text-sm); }
.tvp-custhead--khach .tvp-custhead__sum dd { margin: 0; font-size: var(--tvp-text-2xl); line-height: 1.25; }
.tvp-custhead--khach .tvp-custhead__sum dd.is-empty { font-size: var(--tvp-text-base); color: var(--tvp-subtle); }
.tvp-custhead--khach .tvp-custhead__sum .tvp-stagepill { font-size: var(--tvp-text-base); line-height: 1.75rem; padding: 0 0.75rem; }
.tvp-custhead--khach .tvp-custhead__sum dd.tvp-custhead__phu { font-size: var(--tvp-text-xs); font-weight: 400; color: var(--tvp-muted); }
@media (max-width: 575.98px) {
  .tvp-custhead.tvp-custhead--khach { gap: 1rem; padding: 1rem; }
  .tvp-khhead { flex-wrap: wrap; gap: 0.75rem 1rem; }
  .tvp-khhead > .tvp-logo--xl { width: 3.5rem; height: 3.5rem; font-size: 1.5rem; }
  .tvp-custhead--khach .tvp-custhead__who { flex: 1 1 0; }
  .tvp-custhead--khach h1 { font-size: 1.25rem; }
  .tvp-khmeta { flex-direction: column; gap: 0.25rem; margin-top: 0.5rem; }
  .tvp-khmeta > div { display: flex; align-items: center; gap: 0.375rem; }
  .tvp-khmeta dt { font-size: var(--tvp-text-sm); }
  .tvp-khmeta dt::after { content: ":"; }
  .tvp-khmeta dd { margin: 0; font-size: var(--tvp-text-sm); }
  .tvp-custhead--khach .tvp-custhead__actions { flex: 1 1 100%; }
  .tvp-custhead--khach .tvp-custhead__actions > .btn, .tvp-custhead--khach .tvp-custhead__actions > form { flex: 1 1 auto; }
  .tvp-custhead--khach .tvp-custhead__actions > form .btn { width: 100%; }
  .tvp-custhead--khach .tvp-custhead__sum { grid-auto-flow: row; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
  .tvp-custhead--khach .tvp-custhead__sum dd { font-size: var(--tvp-text-xl); }
}
.tvp-custhead__sum dt { font-size: var(--tvp-text-xs); font-weight: 500; color: var(--tvp-muted); }
.tvp-custhead__sum dd { margin: 0.125rem 0 0; font-weight: 700; color: var(--tvp-ink); font-variant-numeric: tabular-nums; }
@media (max-width: 575.98px) { .tvp-opp__top { flex-direction: column; } .tvp-opp__money { align-items: flex-start; text-align: left; } .tvp-opp__pills { justify-content: flex-start; } }

/* Tab Cơ hội (MH-06) và ngăn kéo Tạo cơ hội theo canvas Chi-tiet-khach-co-hoi, Tao-co-hoi */
.tvp-panel--ch, .tab-pane > .tvp-cpanel { padding: 1.25rem; }   /* MH-06: lề trong các tab bằng khung Hồ sơ khách (D-164) */
.tvp-panel--ch .tvp-panel__title { font-size: var(--tvp-text-title); font-weight: 700; }
.tvp-closed__code { display: block; font-weight: 600; color: var(--tvp-ink); text-decoration: none; }
.tvp-closed__code:hover { color: var(--tvp-green-700); text-decoration: underline; }
.tvp-closed__title { display: block; font-size: var(--tvp-text-sm); color: var(--tvp-muted); }
/* D-245 (GD-59, T-20 bấm tab ẩn): tab Cơ hội, Đơn hàng của Chi tiết khách mỗi ô một dòng, dài thì "…" kèm title */
.tvp-closed__title, .tvp-donhang__ten { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tvp-donhang .tvp-closed__code { display: inline; }   /* mã đơn và loại đơn (Đặt lại) cùng một dòng */
@media (min-width: 768px) { .tvp-dongtab td.tvp-rt-title { max-width: 0; } .tvp-dongtab td.tvp-rt-note { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } }
.tvp-result { display: inline-flex; align-items: center; padding: 2px 0.5rem; border-radius: 999px; font-size: var(--tvp-text-xs); font-weight: 700; line-height: 1.125rem; }
.tvp-result--won { background: var(--tvp-green-700); color: var(--tvp-surface); }
.tvp-result--lost { background: var(--tvp-danger); color: var(--tvp-surface); }
.tvp-optional { font-weight: 400; color: var(--tvp-muted); }
.tvp-ngan-ch .form-control[readonly] { background: var(--tvp-bg); }
.tvp-ngan-ch__note { display: flex; gap: 0.625rem; margin: 0; padding: 0.75rem 1rem; border-radius: var(--tvp-radius-sm); background: var(--tvp-green-100); color: var(--tvp-green-900); font-size: var(--tvp-text-sm); line-height: 1.5; }
.tvp-ngan-ch__note > .bi { flex: none; margin-top: 0.125rem; }

/* Trang form của cơ hội (Đóng, Sửa PO) và trang báo giá */
.tvp-ocpage { display: flex; flex-direction: column; gap: 1.5rem; }
.tvp-ocpage > .tvp-custhead { margin-bottom: 0; }   /* khung xếp dọc đã cách 24 px (D-244) */
.tvp-oclayout { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 1rem; }
.tvp-oclayout__main { flex: 999 1 35rem; min-width: 0; display: flex; flex-direction: column; gap: 1rem; }
.tvp-oclayout__side { flex: 1 1 21.25rem; min-width: 0; }
.tvp-ocard { min-width: 0; display: flex; flex-direction: column; gap: 0.875rem; padding: 1rem; background: var(--tvp-surface); border: 1px solid var(--tvp-border); border-radius: var(--tvp-radius); }
.tvp-ocard__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 0.75rem; }
.tvp-ocard__head h2 { margin: 0; font-size: var(--tvp-text-title); font-weight: 700; line-height: 1.25; }
.tvp-ocard__none { margin: 0; font-size: var(--tvp-text-sm); color: var(--tvp-muted); }
.tvp-panel__note, .tvp-dash-trong { font-size: var(--tvp-text-sm); }   /* dòng trống trong khung một kiểu: xám 14 px (GD-19) */
.tvp-chip--ok { background: var(--tvp-green-100); color: var(--tvp-green-900); }
.tvp-chip--danger { background: var(--tvp-danger-tint); color: var(--tvp-danger); }
.tvp-tabs--sm { flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; }
.tvp-tabs--sm .nav-link { white-space: nowrap; }
.tvp-tabs--sm .nav-link { min-height: var(--tvp-touch); padding: 0 0.75rem; font-size: var(--tvp-text-sm); }
.tvp-tabs--sm + .tab-content { padding-top: 0.25rem; }
.tvp-octl { display: flex; flex-direction: column; gap: 0; margin: 0; padding: 0; list-style: none; }
/* D-188 (Huy 10/11): dòng thẳng cột, kẻ mảnh giữa các dòng, cột phải cố định (nhãn 8,5 rem + nút) để mọi dòng thẳng hàng */
.tvp-octl > li { display: grid; grid-template-columns: 3.5rem 2.25rem minmax(0, 1fr) auto; align-items: center; gap: 0 0.75rem; padding: 0.875rem 0; border-bottom: 1px solid var(--tvp-border); }
.tvp-octl > li:last-child { border-bottom: 0; padding-bottom: 0; }
.tvp-octl__side { grid-column: 4; display: grid; grid-template-columns: 8.5rem auto; align-items: center; gap: 0.75rem; }
.tvp-octl__nhan { display: flex; flex-wrap: wrap; gap: 0.25rem; justify-content: flex-end; }
.tvp-octl__nut { display: flex; justify-content: flex-end; gap: 0.5rem; min-width: 12.5rem; }
.tvp-octl__nut:empty { display: none; }
.tvp-octl__act { display: inline-flex; align-items: center; gap: 0.375rem; min-height: 2rem; padding: 0 0.75rem; border: 1px solid var(--tvp-border-input); border-radius: 0.5rem; background: var(--tvp-surface); color: var(--tvp-ink); font-size: var(--tvp-text-sm); font-weight: 600; text-decoration: none; white-space: nowrap; }   /* nút viền nhỏ của dòng (D-188) */
.tvp-octl__act:hover, .tvp-octl__act:focus-visible { background: var(--tvp-green-50); border-color: var(--tvp-green-700); color: var(--tvp-ink); text-decoration: none; }
.tvp-octl__act:focus-visible { outline: none; box-shadow: var(--tvp-focus); }
.tvp-octl__act--chinh { border-color: var(--tvp-green-700); color: var(--tvp-green-800); }
.tvp-octl__date { font-size: var(--tvp-text-sm); font-weight: 600; line-height: 1.4; color: var(--tvp-muted); font-variant-numeric: tabular-nums; }
.tvp-octl__icon { display: inline-flex; align-items: center; justify-content: center; width: 2.25rem; height: 2.25rem; border-radius: 999px; background: var(--tvp-green-100); color: var(--tvp-green-900); }
.tvp-octl__icon--back { background: var(--tvp-vang-nhat); color: var(--tvp-warn); }
.tvp-octl__body { min-width: 0; }
.tvp-octl__body p { margin: 0.125rem 0 0; font-size: var(--tvp-text-sm); line-height: 1.45; color: var(--tvp-muted); overflow-wrap: anywhere; }
.tvp-octl__body .tvp-octl__what { margin: 0; font-size: var(--tvp-text-base); font-weight: 600; color: var(--tvp-ink); }
.tvp-octl__body .tvp-octl__meta { color: var(--tvp-muted); }
@media (max-width: 575.98px) {
  /* điện thoại: biểu tượng trái chiếm hai hàng; ngày, nội dung, nhãn + nút xếp dọc bên phải */
  .tvp-octl > li { grid-template-columns: 2.25rem minmax(0, 1fr); align-items: start; gap: 0.125rem 0.75rem; }
  .tvp-octl__icon { grid-column: 1; grid-row: 1 / 3; }
  .tvp-octl__date { grid-column: 2; grid-row: 1; font-size: var(--tvp-text-xs); }
  .tvp-octl__body { grid-column: 2; grid-row: 2; }
  .tvp-octl__side { grid-column: 2; grid-row: 3; display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; margin-top: 0.5rem; }
  .tvp-octl__nut { min-width: 0; justify-content: flex-start; }
}
.tvp-opp-next { padding-bottom: 0.25rem; }
/* Hộp "Còn thiếu" và hộp lùi bước theo canvas Co-hoi-con-thieu: rộng 520 px, bo 16 px, mỗi mục một dòng có vòng X đỏ */
.tvp-ocmodal .modal-dialog { max-width: 32.5rem; }   /* K4 (D-244): giữa màn như mọi hộp thoại */
.tvp-ocmodal .modal-content { border: 0; border-radius: 1rem; padding: 1.5rem; gap: 1rem; }
.tvp-ocmodal .modal-header, .tvp-ocmodal .modal-body, .tvp-ocmodal .modal-footer { padding: 0; border: 0; }
.tvp-ocmodal .modal-header { align-items: flex-start; gap: 0.75rem; }
.tvp-ocmodal .modal-title { margin: 0; font-size: var(--tvp-text-lg); font-weight: 600; line-height: 1.3; }
.tvp-ocmodal__sub { margin: 0.25rem 0 0; font-size: var(--tvp-text-sm); color: var(--tvp-muted); }
/* Hộp chuyển bước kiểu A (Huy, 03/11): huy hiệu tròn, dải bước, mục thiếu gom thành thẻ nền nhạt, liên kết dạng viên */
.tvp-ocmodal__dau { flex: 1 1 auto; min-width: 0; }
.tvp-ocmodal__ico { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 2.5rem; height: 2.5rem; border-radius: 999px; background: var(--tvp-green-100); color: var(--tvp-green-800); font-size: 1.125rem; }
.tvp-ocmodal__ico--warn { background: var(--tvp-warn-tint); color: var(--tvp-warn); box-shadow: 0 0 0 4px color-mix(in srgb, var(--tvp-warn-tint) 50%, transparent); font-size: 1.375rem; }
.tvp-ocmodal__buoc { display: flex; flex-wrap: wrap; align-items: center; gap: 0.375rem; margin: 0.5rem 0 0; color: var(--tvp-subtle); font-size: var(--tvp-text-xs); }
.tvp-ocmodal__b { display: inline-flex; align-items: center; height: 1.5rem; padding: 0 0.625rem; border-radius: 999px; background: var(--b-nen, var(--tvp-green-100)); color: var(--b-chu, var(--tvp-green-900)); font-weight: 600; white-space: nowrap; }
.tvp-ocmodal__b--toi { background: transparent; color: var(--tvp-muted); box-shadow: inset 0 0 0 1px var(--tvp-border-input); border: 0; }
.tvp-thieu { display: flex; flex-direction: column; gap: 0.625rem; margin: 0; padding: 0; list-style: none; }
.tvp-thieu > li { padding: 0.875rem 1rem; border-radius: 0.75rem; background: var(--tvp-bg); box-shadow: inset 0 0 0 1px var(--tvp-border); }
.tvp-thieu__dau { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 0.75rem; }
.tvp-thieu__dau h3 { margin: 0; font-size: var(--tvp-text-sm); font-weight: 600; color: var(--tvp-ink); }
.tvp-thieu__nut { display: inline-flex; align-items: center; gap: 0.375rem; min-height: 2rem; padding: 0.25rem 0.875rem; border-radius: 999px; background: var(--tvp-green-700); color: var(--tvp-surface); font-size: var(--tvp-text-xs); font-weight: 600; text-decoration: none; transition: background-color 0.15s; }
.tvp-thieu__nut:hover { background: var(--tvp-green-800); color: var(--tvp-surface); }
.tvp-thieu__nut:focus-visible { outline: 3px solid var(--tvp-yellow); outline-offset: 2px; }
.tvp-thieu ul { margin: 0.5rem 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 0.25rem; }
.tvp-thieu ul li { position: relative; padding-left: 1rem; font-size: var(--tvp-text-sm); line-height: 1.45; color: var(--tvp-muted); }
.tvp-thieu ul li::before { content: ""; position: absolute; left: 0.125rem; top: 0.55em; width: 0.375rem; height: 0.375rem; border-radius: 999px; background: var(--tvp-orange); }
@media (max-width: 575.98px) {   /* điện thoại: tiêu đề, danh sách, rồi nút rộng hết thẻ ở cuối, đủ 44 px để chạm */
  .tvp-thieu > li { display: flex; flex-direction: column; }
  .tvp-thieu__dau { display: contents; }
  .tvp-thieu__nut { order: 1; justify-content: center; min-height: 2.75rem; margin-top: 0.75rem; }
}

/* 5.23 Pipeline MH-09 (US-20, canvas Pipeline): dải số liệu đầu trang, thanh lọc.
   D-143 (mọi màn): thẻ nền nhạt viền cùng màu, không còn dải nền xanh đậm. D-159: mọi dải 3 ô dùng thẻ Dashboard (.tvp-kpis--lon
   .tvp-kpis--3 .tvp-kpis--gon, mục 5.35), màu theo vị trí (nay D-208: ô 1 xanh dương, ô 2 xanh ngọc, ô 3 đỏ, ô 4 vàng đậm, đặt cạnh .tvp-kpis--lon); thay màu xanh, vàng, đỏ của D-113, D-145 */
.tvp-kpis { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.tvp-kpi { --k-bg: var(--tvp-tint-la-bg); --k-border: var(--tvp-tint-la-border); --k-ico: var(--tvp-tint-la-ico); --k-fg: var(--tvp-tint-la-fg); --k-chu: var(--tvp-tint-la-fg);
  flex: 1 1 12.5rem; min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 0.125rem; min-height: 3.75rem; padding: 0.375rem 1.25rem;
  border: 1px solid var(--k-border); border-radius: var(--tvp-radius-lg); background: var(--k-bg); color: var(--tvp-ink); }
.tvp-kpi__label { font-size: var(--tvp-text-sm); font-weight: 500; line-height: 1.4; color: var(--tvp-ink-soft); }   /* --tvp-muted chỉ 4,37:1 trên nền đỏ D-145 */
.tvp-kpi__value { font-size: var(--tvp-text-2xl); font-weight: 700; line-height: 1.15; font-variant-numeric: tabular-nums; }
@media (max-width: 575.98px) {   /* C-3: 3 ô một hàng, không đẩy danh sách xuống dưới màn đầu */
  .tvp-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.375rem; }
  .tvp-kpi { min-height: 0; justify-content: space-between; padding: 0.5rem 0.625rem; }
  .tvp-kpi__label { font-size: var(--tvp-text-xs); line-height: 1.3; }
  .tvp-kpi__value { font-size: var(--tvp-text-xl); }
}
.tvp-pipebar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.tvp-pipebar > .tvp-seg { margin-left: auto; }   /* Cột / Danh sách, Kỳ, Sắp xếp dồn sang phải như hàng tìm kiếm của Khách (Huy, 01/11) */
.tvp-pipebar .form-select { width: auto; padding-top: 0; padding-bottom: 0; font-size: var(--tvp-text-sm); }
.tvp-pipebar .tvp-kybtn { border-color: var(--tvp-green-700); background-color: var(--tvp-green-100); color: var(--tvp-green-900); font-weight: 600; }
@media (max-width: 575.98px) { .tvp-pipebar .tvp-seg { flex: 1 1 100%; } .tvp-pipebar .tvp-kybtn { flex: 1 1 auto; } }

/* 5.24 Danh sách khách MH-05 (canvas Danh-sach-khach): dải số liệu, khung tìm, bảng 6 cột, chân bảng có phân trang */
.tvp-khlist { display: flex; flex-direction: column; gap: 1.5rem; }
.tvp-searchbox { flex: 1 1 17.5rem; min-width: 0; display: flex; align-items: center; gap: 0.5rem; padding: 0 0.75rem; border: 1px solid var(--tvp-border-input); border-radius: var(--tvp-radius-sm); background: var(--tvp-surface); color: var(--tvp-muted); }
.tvp-searchbox:focus-within { border-color: var(--tvp-green-700); box-shadow: 0 0 0 0.2rem rgba(24, 98, 7, 0.2); }
.tvp-searchbox input { flex: 1 1 auto; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--tvp-ink); font-size: var(--tvp-text-sm); }
.tvp-searchbox input::placeholder { color: var(--tvp-muted); }
.tvp-khtable { display: flex; flex-direction: column; gap: 0.75rem; padding: 1rem; }
.tvp-khtable .tvp-table-wrap { border: 0; border-radius: 0; box-shadow: none; }
.tvp-khtable__t { table-layout: fixed; min-width: 65rem; margin: 0; font-size: var(--tvp-text-sm); }
.tvp-khtable__t thead th { padding: 0.625rem 0.5rem; background: var(--tvp-bg); font-weight: 600; white-space: nowrap; border-bottom: 1px solid var(--tvp-border); }
.tvp-khtable__t td { padding: 0.625rem 0.5rem; border-top: 1px solid var(--tvp-border); border-bottom: 0; }
.tvp-khtable__t td[data-label="Liên hệ gần nhất"] { white-space: nowrap; }
.tvp-khtable__tien { width: 13rem; } .tvp-khtable__viec { width: 15.5%; } .tvp-khtable__t:not(:has(.tvp-khtable__nguoi)) .tvp-khtable__viec { width: 30%; }   /* D-249 (8): Tiến độ vừa thanh 12rem; bảng của sale (không cột Phụ trách): Việc tiếp theo nhận phần đó thay cột Khách */
 .tvp-khtable__hd { width: 14.5%; } .tvp-khtable__nguoi { width: 15%; }   /* US-12-AC8: tiêu đề có mũi tên sắp xếp, cột Liên hệ rộng thêm 1 % */
@media (min-width: 1200px) and (max-width: 1359.98px) {   /* khung hẹp hơn 65rem: bảng theo khung; ô dài cắt "…" một dòng (D-241 (7) thay ngoại lệ xuống dòng của D-150 (6)) */
  .tvp-khtable__t { min-width: 0; }
  .tvp-khtable__viec { width: 15%; } .tvp-khtable__hd { width: 16.5%; }   /* đủ cho tiêu đề một dòng kèm mũi tên sắp xếp (US-12-AC8) */
}
.table td a.tvp-khtable__name { display: block; font-size: var(--tvp-text-base); line-height: 1.35; font-weight: 600; }
.tvp-khtable__task { display: block; font-weight: 500; }
/* D-168: cột Tiến độ cơ hội (thanh 5 đoạn + tên bước + "bước n/5"); ô trống ghi chữ nhạt thay "—" */
.tvp-tiendo { display: flex; flex-direction: column; gap: 0.375rem; max-width: 12rem; }
.tvp-tiendo .tvp-ministeps > span { height: 0.4375rem; }
.tvp-tiendo__chu b { font-weight: 600; color: var(--tvp-ink); }
.tvp-tiendo__chu span { color: var(--tvp-muted); }
.tvp-trong { color: var(--tvp-muted); }
.tvp-khtable .tvp-chip { margin-top: 0.125rem; }
.tvp-khtable__foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem; padding-top: 0.25rem; font-size: var(--tvp-text-sm); }
.tvp-khtable__foot nav { margin-top: 0 !important; }
.tvp-owner { display: inline-flex; align-items: center; gap: 0.375rem; max-width: 100%; min-width: 0; vertical-align: middle; white-space: nowrap; }
.tvp-owner__ten { min-width: 0; overflow: hidden; text-overflow: ellipsis; }   /* tên dài không làm tràn bảng, thẻ (GD-65); title ở .tvp-owner */
.tvp-logo--bar { position: relative; }
.tvp-logo--bar::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--tvp-yellow); }
.tvp-logo--letter.tvp-logo--c1, .tvp-logo--letter.tvp-logo--c6 { background: var(--tvp-logo-1); }
.tvp-logo--letter.tvp-logo--c2, .tvp-logo--letter.tvp-logo--c7 { background: var(--tvp-logo-2); }
.tvp-logo--letter.tvp-logo--c3, .tvp-logo--letter.tvp-logo--c8 { background: var(--tvp-logo-3); }
.tvp-logo--letter.tvp-logo--c4, .tvp-logo--letter.tvp-logo--c9 { background: var(--tvp-logo-4); }
.tvp-logo--letter.tvp-logo--c5, .tvp-logo--letter.tvp-logo--c0 { background: var(--tvp-logo-5); }
@media (max-width: 1199.98px) {   /* bảng danh sách thành thẻ tới 1199 px (D-241 (7), Q121 A) */
  .tvp-khtable__t { min-width: 0; table-layout: auto; }
  .tvp-khtable__t > tbody > tr > td { border-top: 0; padding: 0.125rem 0; }   /* đủ mạnh để thắng .table > tbody > tr > td */
  .tvp-khtable__t > tbody > tr > td.tvp-rt-title { padding: 0 0 0.25rem; }
  .tvp-khtable__cell { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; }
  .tvp-khtable .tvp-chip { align-self: flex-start; }
  /* R-13: thẻ gọn, hai cột nhãn trên giá trị dưới; tên chiếm cả hàng. Bảng sản phẩm (MH-20) giữ kiểu này */
  .tvp-khtable__t tr { padding: 0.75rem 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.375rem 1rem; }
  .tvp-khtable__t td { flex-direction: column; align-items: flex-start; justify-content: flex-start; gap: 0.125rem; text-align: left; }
  .tvp-khtable__t td.num { text-align: left; }
  .tvp-khtable__t td.tvp-rt-title { grid-column: 1 / -1; }
  /* D-158 (3), D-168, thay R-13 chỉ ở bảng khách (MH-05): thẻ khách gọn, không nhãn lặp. Dòng 1 tên khách (ICP là nhãn cạnh quan hệ);
     dòng 2 tiến độ cơ hội · người phụ trách (ghim phải); dòng 3 việc tiếp theo. Bỏ "Liên hệ gần nhất" trên điện thoại.
     :not(.tvp-sptable): bảng sản phẩm dùng chung lớp tvp-khtable__t nhưng cột khác, lưới 2 cột làm viên trạng thái tràn */
  .tvp-khtable__t:not(.tvp-sptable) tr { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: 0.25rem 0.75rem; }
  .tvp-khtable__t:not(.tvp-sptable) td { width: auto; }
  .tvp-khtable__t:not(.tvp-sptable) td::before { content: none; }
  .tvp-khtable__t:not(.tvp-sptable) td.tvp-rt-title { grid-row: 1; }
  .tvp-khtable__t td[data-label="Tiến độ cơ hội"] { grid-row: 2; grid-column: 1; }
  .tvp-khtable__t td[data-label="Người phụ trách"] { grid-row: 2; grid-column: 2; justify-self: end; align-items: flex-end; font-size: var(--tvp-text-sm); }
  .tvp-tiendo { flex-direction: row; align-items: center; gap: 0.5rem; max-width: none; }
  .tvp-tiendo .tvp-ministeps { width: 4.5rem; flex: none; }
  .tvp-tiendo__chu { white-space: nowrap; }
  .tvp-tiendo__chu span { display: none; }   /* điện thoại chỉ hiện tên bước */
  .tvp-khtable__t td[data-label="Việc tiếp theo"] { grid-row: 3; grid-column: 1 / -1; font-size: var(--tvp-text-sm); }
  .tvp-khtable__t td[data-label="Liên hệ gần nhất"] { display: none; }
  .tvp-seg--xem { display: none; }   /* màn hẹp bảng đã thành thẻ, nút Bảng / Thẻ không đổi gì */
}

/* 5.24b Bộ lọc MH-05 (US-12, canvas Danh-sach-khach): hàng 1 tìm, sắp xếp, Bảng / Thẻ, thêm khách; hàng 2 sáu ô lọc + "Chưa tiếp cận" */
.tvp-loc { display: flex; flex-direction: column; gap: 0.75rem; min-width: 0; }
.tvp-loc__row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; }
.tvp-seg--xem label { display: inline-flex; align-items: center; gap: 0.375rem; padding: 0 0.75rem; margin: 0; color: var(--tvp-ink); font-weight: 500; font-size: var(--tvp-text-sm); cursor: pointer; }
.tvp-seg--xem label + input + label { border-left: 1px solid var(--tvp-border-input); }
.tvp-seg--xem .btn-check:checked + label { background: var(--tvp-green-700); color: var(--tvp-surface); }
.tvp-seg--xem .btn-check:focus-visible + label { outline: 3px solid var(--tvp-yellow); outline-offset: -3px; }
.tvp-seg--xem label:hover { background: var(--tvp-green-100); }
.tvp-loc__xoa { display: inline-flex; align-items: center; gap: 0.375rem; padding: 0 0.5rem; font-size: var(--tvp-text-sm); font-weight: 600; color: var(--tvp-green-700); text-decoration: none; }
.tvp-loc__xoa:hover { text-decoration: underline; }
.tvp-loc__xoa[hidden] { display: none; }
/* Mẫu bộ lọc chung (Huy chọn 29/10/2026, kiểu Jira, GitHub): hàng 1 tìm | dạng xem, nút chính; hàng 2 các viên lọc hiện sẵn,
   "Xóa lọc", sắp xếp sát phải. Viên = nhãn + ô chọn gốc của trình duyệt (điện thoại mở bảng chọn sẵn có); đang lọc thì nền xanh.
   Điện thoại: hàng viên vuốt ngang, không xuống dòng. */
.tvp-loc .tvp-searchbox { flex: 1 1 18rem; }
.tvp-loc__phai { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; margin-left: auto; }
.tvp-loc__vien { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.tvp-vien { position: relative; display: inline-flex; align-items: center; gap: 0; padding: 0 0.75rem 0 0.875rem; margin: 0; border: 1px solid var(--tvp-border-input); border-radius: 999px; background: var(--tvp-surface); color: var(--tvp-ink); font-size: var(--tvp-text-sm); white-space: nowrap; cursor: pointer; }
.tvp-vien, .tvp-vien:hover { text-decoration: none; }
.tvp-vien:hover { border-color: var(--tvp-green-700); }
/* Chrome coi ô chọn bấm bằng chuột cũng là :focus-visible; viền vàng chỉ khi đang dùng bàn phím (tvp.js đặt data-ban-phim) */
html[data-ban-phim] .tvp-vien:has(:focus-visible) { outline: 3px solid var(--tvp-yellow); outline-offset: 1px; }
.tvp-vien__gt { max-width: 14rem; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.tvp-vien > .bi-chevron-down { font-size: 0.75rem; margin-left: 0.25rem; }
/* Ô chọn gốc phủ kín viên, trong suốt: bấm đâu trên viên cũng mở, danh sách thả từ mép trái viên; chữ hiện là [data-gt] */
.tvp-vien__chon { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; font-size: var(--tvp-text-sm); }
.tvp-vien--bat:has(:checked) { border-color: var(--tvp-green-700); background: var(--tvp-green-50); color: var(--tvp-green-900); }
.tvp-vien--bat { padding: 0 0.875rem; font-weight: 600; }
.tvp-vien--bat input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }  /* phủ kín viên: vùng bấm bằng cả viên (WCAG 2.5.8) */
.tvp-vien--bat .bi { display: none; margin-right: 0.25rem; }
.tvp-vien--bat:has(:checked) .bi { display: inline; }
@media (max-width: 575.98px) {
  .tvp-loc__vien { flex-wrap: nowrap; overflow-x: auto; margin: 0 -1rem; padding: 0.125rem 1rem 0.25rem; scrollbar-width: none; }
}
.tvp-khcards { display: flex; flex-direction: column; gap: 0.75rem; padding: 1rem; }   /* lề bằng dạng Bảng (.tvp-khtable) */
.tvp-khcards__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr)); gap: 0.75rem; margin: 0; padding: 0; list-style: none; }
.tvp-khcard { display: flex; flex-direction: column; gap: 0.75rem; padding: 1rem; margin: 0; }
.tvp-khcard__facts { display: grid; gap: 0.375rem; margin: 0; font-size: var(--tvp-text-sm); }
.tvp-khcard__facts > div { display: flex; justify-content: space-between; gap: 0.75rem; padding-top: 0.375rem; border-top: 1px solid var(--tvp-border); }
.tvp-khcard__facts dt { flex: 0 0 auto; color: var(--tvp-muted); font-weight: 500; }
.tvp-khcard__facts dd { margin: 0; text-align: right; min-width: 0; }
.tvp-khcard__facts .tvp-khtable__cell { align-items: flex-end; display: flex; flex-direction: column; }
.tvp-khcard a.tvp-khtable__name { display: block; font-size: var(--tvp-text-base); line-height: 1.35; font-weight: 600; text-decoration: none; }
.tvp-khcard a.tvp-khtable__name:hover { text-decoration: underline; }
@media (max-width: 575.98px) { .tvp-loc .tvp-searchbox { flex: 1 1 100%; } .tvp-loc__phai { flex: 1 1 100%; } .tvp-loc__phai > .btn { flex: 1 1 100%; } }   /* nút chính ở hàng công cụ rộng hết hàng trên điện thoại */

/* 5.25 Chi tiết khách MH-06 (canvas Chi-tiet-khach): nhãn bước cao nhất nền đặc, lưới ảnh thương hiệu 3 cột */
.tvp-chuyen__dang { margin: 0 0 1rem; font-size: var(--tvp-text-sm); }
.tvp-chuyen__nhac { display: flex; gap: 0.5rem; align-items: flex-start; font-size: var(--tvp-text-sm); }
.tvp-stagepill { display: inline-flex; align-items: center; padding: 2px 0.625rem; border-radius: 999px; background: var(--tvp-stage-4-fill); color: #fff; font-weight: 700; font-size: var(--tvp-text-sm); line-height: 1.25rem; white-space: nowrap; }
.tvp-pill--muted { background: var(--tvp-bg); color: var(--tvp-ink); }
.tvp-ini--md { width: 2rem; height: 2rem; font-size: var(--tvp-text-xs); }
/* Khung bảng gọn (canvas Chi-tiet-khach-lien-he, -file): tiêu đề và nút ở đầu khung, bảng chữ 14 px; ô chữ đầu tên, nút biểu tượng có viền */
.tvp-cpanel { display: flex; flex-direction: column; gap: 0.75rem; padding: 1rem; }
.tvp-cpanel__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 0.75rem; }
.tvp-cpanel .tvp-table-wrap { border: 0; border-radius: 0; box-shadow: none; }
.tvp-ctable { margin: 0; font-size: var(--tvp-text-sm); }
.tvp-ctable thead th { padding: 0.625rem 0.5rem; background: var(--tvp-bg); font-weight: 600; white-space: nowrap; border-bottom: 1px solid var(--tvp-border); }
.tvp-ctable td { padding: 0.625rem 0.5rem; border-top: 1px solid var(--tvp-border); border-bottom: 0; }
.tvp-lhwho { display: flex; align-items: center; gap: 0.625rem; min-width: 0; }
.tvp-lhwho__name { display: block; font-weight: 600; font-size: var(--tvp-text-base); color: var(--tvp-ink); }
.tvp-lhwho__sub { display: block; color: var(--tvp-muted); }
.tvp-lhcontact { display: flex; flex-direction: column; }
.tvp-lhcontact a { padding-block: 0.25rem; color: var(--tvp-ink); text-decoration: none; white-space: nowrap; }   /* vùng bấm ≥ 24 px (R-12) */
.tvp-lhcontact a:hover { color: var(--tvp-green-700); text-decoration: underline; }
.tvp-ctable .tvp-rowactions { flex-wrap: nowrap; }
.tvp-sqbtn { display: inline-flex; align-items: center; justify-content: center; width: 2.25rem; height: 2.25rem; padding: 0; border: 1px solid var(--tvp-border-input); border-radius: var(--tvp-radius-sm); background: var(--tvp-surface); color: var(--tvp-ink); }
.tvp-sqbtn:hover { border-color: var(--tvp-green-700); color: var(--tvp-green-700); background: var(--tvp-surface); }
.tvp-sqbtn--danger { color: var(--tvp-danger); }
.tvp-sqbtn--danger:hover { border-color: var(--tvp-danger); color: var(--tvp-danger); }
.tvp-empty--flat { border: 0; padding: 2rem 1rem; }
.tvp-dl { display: inline-flex; align-items: center; gap: 0.25rem; font-weight: 600; color: var(--tvp-green-700); text-decoration: none; }
.tvp-dl:hover { text-decoration: underline; }
.tvp-chipset { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.tvp-chipbtn { display: inline-flex; align-items: center; gap: 0.375rem; min-height: 2.5rem; padding: 0 0.875rem; border: 1px solid var(--tvp-border-input); border-radius: var(--tvp-radius-sm); background: var(--tvp-surface); color: var(--tvp-ink); font-size: var(--tvp-text-sm); font-weight: 500; cursor: pointer; }
.tvp-chipbtn:hover { border-color: var(--tvp-green-700); background: var(--tvp-green-50); }
.btn-check:checked + .tvp-chipbtn { border-color: var(--tvp-green-700); background: var(--tvp-green-700); color: #fff; font-weight: 600; }   /* D-147: đã chọn tô xanh đặc */
.btn-check:checked + .tvp-chipbtn::before { content: "\2713"; font-weight: 700; }
.btn-check:focus-visible + .tvp-chipbtn { outline: 3px solid var(--tvp-green-700); outline-offset: 2px; }
@media (max-width: 767.98px) {
  .tvp-ctable > tbody > tr > td { border-top: 0; padding: 0.25rem 0; } .tvp-lhcontact { align-items: flex-end; }
  .tvp-ctable .tvp-sqbtn { width: var(--tvp-touch); height: var(--tvp-touch); }   /* R-12: sửa, xóa cỡ 44 px, cách nhau 8 px để khỏi bấm nhầm */
}
@media (max-width: 1199.98px) { .tvp-rtable--wide.tvp-ctable > tbody > tr > td { border-top: 0; padding: 0.25rem 0; } }   /* GD-59 (D-249): thẻ ở khổ giữa như điện thoại */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
@media print { .tvp-sidebar, .tvp-topbar, .tvp-form-actions--sticky { display: none !important; } .tvp-shell { display: block; } }

/* 5.26 Form khách MH-07 theo canvas Form-khach: khối trắng có tiêu đề, chữ "tùy chọn" sau nhãn, đơn vị nằm trong ô,
   thẻ chọn nguồn, nút chọn file thay ô file mặc định của trình duyệt, ô xem trước logo viền đứt */
.tvp-fsec { margin-bottom: 1.5rem; }
.tvp-fsec__title { margin: 0 0 1rem; font-size: var(--tvp-text-base); font-weight: 700; }   /* mục của form: 16 px (D-241 (4)) */
.tvp-fsec .mb-3 { margin-bottom: 0 !important; }
.tvp-fsec__trung:empty { display: none; }
.tvp-fsec__note { display: flex; gap: 0.5rem; margin: 0; color: var(--tvp-muted); font-size: var(--tvp-text-sm); }
.tvp-opt { font-weight: 400; color: var(--tvp-muted); }
.tvp-affix { position: relative; }
.tvp-affix .form-control { padding-right: 6rem; }
/* Ô số có đơn vị (đ, %): ẩn mũi tên tăng giảm của trình duyệt, nếu không nó nằm giữa ô vì chừa chỗ cho chữ đơn vị */
.tvp-affix input[type=number] { appearance: textfield; -moz-appearance: textfield; }
.tvp-affix input[type=number]::-webkit-inner-spin-button, .tvp-affix input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.tvp-affix__text { position: absolute; top: 0; right: 0.875rem; height: 2.75rem; display: flex; align-items: center; color: var(--tvp-muted); font-size: var(--tvp-text-sm); pointer-events: none; }
.tvp-readbox { display: flex; align-items: center; min-height: 2.75rem; padding: 0 0.875rem; border: 1px solid var(--tvp-border); border-radius: var(--tvp-radius-sm); background: var(--tvp-bg); }

/* 5.26a D-147: form trang đầy đủ kiểu CRM (.tvp-fpage: Ghi buổi làm việc MH-08, Thêm / Sửa khách MH-07, Thêm / Sửa sản phẩm).
   Thanh trên dính (đường dẫn, tiêu đề, nút Hủy / Lưu); cột trái dính: thẻ bản ghi và mục lục các khối (tvp.js điền "Thiếu N", tô mục đang xem);
   cột phải các khối có đầu khối. Điện thoại, máy tính bảng: một cột, không mục lục, thanh nút dính đáy như cũ (--sticky).
   Viền ô nhập #8a9786 = 3,07:1 trên trắng, vẫn đủ WCAG 1.4.11 */
.tvp-fpage {   /* biến D-143 (bản Dashboard mới) có thì dùng; chưa có thì giá trị dự phòng bằng nhau */
  --_fp-w: 80rem;
  --_fp-line: var(--tvp-border-soft);
  --_fp-bong: var(--tvp-shadow-soft, 0 1px 2px rgba(16, 40, 10, 0.04), 0 4px 16px rgba(16, 40, 10, 0.05));
  --_fp-r: var(--tvp-radius-lg, 1rem);
  --_fp-o-nen: var(--tvp-tint-la-bg);
  --_fp-o-chu: var(--tvp-tint-la-fg);
  --_fp-nhan: var(--tvp-ink-soft);
}
.tvp-fpage__top { margin: calc(-1 * var(--tvp-gutter)) calc(-1 * var(--tvp-gutter)) 1.5rem; padding: 0.875rem var(--tvp-gutter); border-bottom: 1px solid var(--_fp-line); background: color-mix(in srgb, var(--tvp-bg) 92%, transparent); }
.tvp-fpage__top-in { max-width: var(--_fp-w); margin-inline: auto; display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.5rem; }
.tvp-fpage__heading { min-width: 0; flex: 1 1 20rem; }
.tvp-fpage__heading h1 { margin: 0; font-size: var(--tvp-text-2xl); overflow-wrap: anywhere; }   /* GD-01 (D-249): tên trang form 24 px như D-241 (4), trước 22 */
.tvp-fpage__heading .tvp-page-header__sub { margin-top: 0.125rem; }
.tvp-fpage__top .tvp-form-actions .btn { min-width: 6rem; }
.tvp-crumb { display: flex; flex-wrap: wrap; margin: 0 0 0.125rem; padding: 0; list-style: none; font-size: var(--tvp-text-xs); color: var(--tvp-muted); }
.tvp-crumb li { min-width: 0; overflow-wrap: anywhere; }
.tvp-crumb li + li::before { content: "\203A"; margin: 0 0.375rem; }
.tvp-crumb a { display: inline-block; margin-block: -0.1875rem; padding-block: 0.1875rem; color: var(--tvp-muted); text-decoration: none; }   /* vùng bấm 25 px (L-10), chữ không đổi chỗ */
.tvp-crumb a:hover { color: var(--tvp-green-800); text-decoration: underline; }
.tvp-fpage__grid { max-width: var(--_fp-w); margin-inline: auto; display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.5rem; align-items: start; }
.tvp-fpage__aside { display: grid; gap: 1rem; min-width: 0; }
.tvp-fpage__main { min-width: 0; }
.tvp-fnav { display: none; }
@media (min-width: 992px) {
  html:has(.tvp-fpage) { scroll-padding-top: calc(var(--tvp-topbar-h) + 7rem); }   /* nhảy tới khối, tới ô lỗi: không bị thanh trên dính che */
  .tvp-fpage__top { position: sticky; top: var(--tvp-topbar-h); z-index: 1000; backdrop-filter: blur(8px); }
  .tvp-fpage__grid { grid-template-columns: 19rem minmax(0, 1fr); }
  .tvp-fpage__aside { position: sticky; top: calc(var(--tvp-topbar-h) + 6.5rem); }
  .tvp-fnav { display: block; }
}
@media (max-width: 767.98px) { .tvp-fpage { padding-bottom: 5rem; } }   /* chừa chỗ cho thanh nút dính đáy */

/* Thẻ bản ghi */
.tvp-rec { min-width: 0; display: flex; align-items: center; gap: 0.875rem; padding: 1rem 1.25rem; background: var(--tvp-surface); border: 1px solid var(--_fp-line); border-radius: var(--_fp-r); box-shadow: var(--_fp-bong); }
.tvp-rec .tvp-rec__logo { width: 3rem; height: 3rem; font-size: 1.25rem; border-radius: 0.75rem; }
.tvp-rec__logo--moi { background: var(--_fp-o-nen); color: var(--_fp-o-chu); box-shadow: none; font-size: 1.375rem; }
.tvp-rec__name { margin: 0; font-weight: 700; line-height: 1.35; overflow-wrap: anywhere; }
.tvp-rec__sub { margin: 0.125rem 0 0; color: var(--tvp-muted); font-size: var(--tvp-text-sm); }
@media (min-width: 992px) {
  .tvp-rec { flex-direction: column; align-items: flex-start; padding: 1.25rem; }
  .tvp-rec .tvp-rec__logo { width: 3.5rem; height: 3.5rem; border-radius: 0.875rem; }
}

/* Mục lục */
.tvp-fnav { padding: 0.5rem; background: var(--tvp-surface); border: 1px solid var(--_fp-line); border-radius: var(--_fp-r); box-shadow: var(--_fp-bong); }
.tvp-fnav__head { margin: 0.5rem 0.75rem; font-size: var(--tvp-text-sm); font-weight: 600; color: var(--tvp-ink); }   /* D-179 (V1): nhãn nhóm chữ thường, bỏ chữ in hoa nhỏ */
.tvp-fnav ol { margin: 0; padding: 0; list-style: none; }
.tvp-fnav__link { display: flex; align-items: center; gap: 0.625rem; min-height: var(--tvp-touch); padding: 0.375rem 0.75rem; line-height: 1.35; border-radius: 0.625rem; color: var(--tvp-ink); text-decoration: none; font-size: var(--tvp-text-sm); font-weight: 500; }
.tvp-fnav__link:hover { background: var(--tvp-green-50); color: var(--tvp-ink); }
.tvp-fnav__link > .bi { font-size: 1rem; color: var(--tvp-muted); }
.tvp-fnav__link[aria-current] { background: var(--tvp-green-100); color: var(--tvp-green-900); font-weight: 600; }
.tvp-fnav__link[aria-current] > .bi { color: var(--tvp-green-700); }
.tvp-fnav__ten { min-width: 0; }
.tvp-fnav__st { margin-left: auto; flex: none; font-size: var(--tvp-text-xs); font-weight: 600; }
.tvp-fnav__st:empty { display: none; }
.tvp-fnav__st--du { color: var(--tvp-green-700); font-size: 1rem; }
.tvp-fnav__st--thieu { padding: 0.0625rem 0.5rem; border-radius: 999px; background: var(--tvp-warn-tint); color: var(--tvp-warn); }

/* Khối: đầu khối có ô biểu tượng, thân khối tách bằng đường kẻ */
.tvp-fpage .tvp-fsec { padding: 0; margin-bottom: 1.25rem; border-color: var(--_fp-line); border-radius: var(--_fp-r); box-shadow: var(--_fp-bong); }
.tvp-fsec__head { display: flex; align-items: center; gap: 0.75rem; padding: 1rem 1.5rem; border-bottom: 1px solid var(--_fp-line); }
.tvp-fsec__ico { display: grid; place-items: center; flex: none; width: 2.25rem; height: 2.25rem; border-radius: 0.625rem; background: var(--_fp-o-nen); color: var(--_fp-o-chu); font-size: 1.0625rem; }
.tvp-fpage .tvp-fsec__title { margin: 0; font-size: var(--tvp-text-base); font-weight: 700; }
.tvp-fsec__body { padding: 1.25rem 1.5rem 1.5rem; }
.tvp-fsec__body > .row { --bs-gutter-y: 1rem; --bs-gutter-x: 1rem; }   /* GD-48 (D-249): hai ô cách 16 px dọc và ngang như form cũ, hộp thoại (trước 18, 20) */
@media (max-width: 575.98px) { .tvp-fsec__head { padding: 0.875rem 1rem; } .tvp-fsec__body { padding: 1rem; } }
.tvp-fpage .tvp-missing { border-radius: var(--_fp-r); }

/* Form trang riêng có thanh trên nhưng không có cột trái (Báo giá MH-16, Đóng cơ hội MH-17, Sửa PO): khối .tvp-ocard cùng kiểu .tvp-fsec */
.tvp-fpage--rong .tvp-ocard { padding: 0 0 1.25rem; gap: 1rem; border-color: var(--_fp-line); border-radius: var(--_fp-r); box-shadow: var(--_fp-bong); }
.tvp-fpage--rong .tvp-ocard > * { margin-inline: 1.5rem; }
.tvp-fpage--rong .tvp-ocard > .tvp-ocard__head { margin: 0; padding: 1rem 1.5rem; border-bottom: 1px solid var(--_fp-line); justify-content: flex-start; }
.tvp-fpage--rong .tvp-ocard__head h2 { font-size: var(--tvp-text-base); font-weight: 700; }
.tvp-fpage--rong .tvp-ocard__head > :last-child:not(h2) { margin-left: auto; }
@media (max-width: 575.98px) { .tvp-fpage--rong .tvp-ocard > * { margin-inline: 1rem; } .tvp-fpage--rong .tvp-ocard > .tvp-ocard__head { padding: 0.875rem 1rem; } }

/* Ngăn kéo, hộp thoại theo cùng kiểu (D-147): đầu có đường kẻ nhạt, chữ đậm; thân rộng hơn; chân có bóng nhẹ */
.modal-content { border: 0; border-radius: 1rem; box-shadow: 0 16px 48px rgba(16, 40, 10, 0.18); }
.modal-header, .modal-footer { border-color: var(--tvp-border-soft); }
.tvp-formcard { border-color: var(--tvp-border-soft); border-radius: 1rem; box-shadow: 0 1px 2px rgba(16, 40, 10, 0.04), 0 4px 16px rgba(16, 40, 10, 0.05); }
.tvp-radiocards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.75rem; }
.tvp-radiocard { display: flex; align-items: flex-start; gap: 0.75rem; padding: 0.875rem 1rem; border: 1px solid var(--tvp-border-input); border-radius: 0.625rem; background: var(--tvp-surface); cursor: pointer; }
.tvp-radiocard:hover { border-color: var(--tvp-green-700); }
.tvp-radiocard .form-check-input { flex: none; margin: 0.125rem 0 0; width: 1.25rem; height: 1.25rem; }
.tvp-radiocard:has(input:checked) { border: 2px solid var(--tvp-green-700); padding: calc(0.875rem - 1px) calc(1rem - 1px); background: var(--tvp-green-100); }
.tvp-radiocard:has(input:focus-visible) { box-shadow: var(--tvp-focus); }
.tvp-radiocard__title { display: block; font-weight: 600; }
.tvp-radiocard__sub { display: block; color: var(--tvp-muted); font-size: var(--tvp-text-sm); }
.tvp-fileinput { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.tvp-filepick { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; }
.tvp-filepick__btn { display: inline-flex; align-items: center; gap: 0.5rem; min-height: 2.75rem; }
.tvp-fileinput:focus-visible + .tvp-filepick__btn { box-shadow: var(--tvp-focus); }
.tvp-filepick__name { min-width: 0; color: var(--tvp-muted); font-size: var(--tvp-text-sm); overflow-wrap: anywhere; }
.tvp-logopick { display: flex; align-items: flex-start; gap: 1rem; }
.tvp-logopick__box { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 5.5rem; height: 5.5rem; overflow: hidden; border: 1px dashed var(--tvp-border-input); border-radius: var(--tvp-radius-sm); background: var(--tvp-bg); color: var(--tvp-muted); font-size: 1.5rem; }
.tvp-logopick__box.is-invalid { border-color: var(--tvp-danger); }
.tvp-logopick__box img { display: block; width: 100%; height: 100%; object-fit: contain; }
.tvp-logopick__main { min-width: 0; flex: 1; }
.tvp-save-lock { display: none; }
[data-save]:disabled .tvp-save-lock { display: inline-block; }
@media (max-width: 767.98px) { .tvp-radiocards { grid-template-columns: minmax(0, 1fr); } }

/* 5.27 MH-18 Việc theo canvas Viec, Viec-nhom: thanh công cụ gọn, mọi nhóm trong một khung, tên nhóm in hoa nhỏ,
   dòng quá hạn chỉ tô chữ hạn màu đỏ, nhãn "Được giao bởi" nằm cạnh tên việc */
.tvp-vtool { gap: 0.5rem; align-items: center; }
.tvp-seg--sm a { padding: 0 0.625rem; font-size: var(--tvp-text-sm); font-weight: 500; }
.tvp-seg--sm a[aria-current] { font-weight: 600; }
.tvp-vtool .tvp-toolbar__right { align-items: center; gap: 0.5rem; }
.tvp-kpis--viec { margin-bottom: 1rem; }
.tvp-vtool > .tvp-loc__vien { order: 2; flex: 0 1 auto; }   /* K1 (D-241 (1)): viên lọc trái; lọc theo hạn, kiểu xem phải; tôi / phòng và Giao việc ở đầu trang */
.tvp-vtool > .tvp-toolbar__right { order: 3; margin-left: auto; }
.tvp-vtool > .tvp-lich-nav { order: 4; flex: 1 1 100%; padding-top: 0.25rem; }   /* dạng lịch: Hôm nay ‹ › ngày, hàng riêng sát trên lịch */
.tvp-pipebar > .tvp-loc__vien { order: -1; flex: 1 1 auto; }   /* viên lọc bên trái cùng hàng với Cột / Danh sách, Kỳ (Huy, 01/11); hẹp thì tự xuống dòng */
@media (max-width: 575.98px) { .tvp-pipebar > .tvp-loc__vien { order: 0; flex: 1 1 100%; } }
.tvp-vlist { padding: 0; overflow: hidden; }
.tvp-vlist .tvp-tasks__group { margin: 0; }
.tvp-vlist .tvp-tasks__title { margin: 0; padding: 0.625rem 1rem 0.375rem; font-size: var(--tvp-text-sm); font-weight: 600; color: var(--tvp-ink); border-top: 1px solid var(--tvp-border); }   /* D-179 (V1) */
.tvp-vlist .tvp-tasks__group:first-child .tvp-tasks__title { border-top: 0; }
.tvp-vlist .tvp-count { background: none; color: inherit; padding: 0; min-width: 0; font-size: inherit; }
.tvp-vlist .tvp-tasks { border-top: 1px solid var(--tvp-border); }
.tvp-vlist .tvp-task.is-overdue { background: none; }
.tvp-vlist__note { margin: 0; padding: 0.5rem 1rem 0.75rem; color: var(--tvp-muted); font-size: var(--tvp-text-sm); }
.tvp-task__line { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.5rem; }
.tvp-task__meta a { text-decoration: none; }
.tvp-task__meta a:hover { text-decoration: underline; }
@media (max-width: 575.98px) { .tvp-vtool .tvp-toolbar__right, .tvp-vtool .tvp-toolbar__right > .tvp-seg { width: 100%; } .tvp-vtool .tvp-toolbar__right > .tvp-seg a { flex: 1 1 0; justify-content: center; } }

/* 5.27b MH-18 dạng lịch Tuần / Tháng (D-123, canvas Viec-lich): thanh "cả ngày" theo màu quá hạn / hôm nay / sắp tới / đã xong,
   bấm thanh mở khung nhỏ (dropdown). Khung lịch không đặt overflow: hidden để khung nhỏ không bị cắt */
.tvp-lich-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
/* Điều hướng lịch (Huy, 02/11): ‹ Hôm nay › chung một viên bo tròn, cùng kiểu bộ chuyển kiểu xem (.tvp-seg) */
.tvp-lich-nav { gap: 0.75rem; }
.tvp-lich-nav__nhom { display: inline-flex; align-items: center; gap: 2px; padding: 3px; border-radius: 999px; background: var(--tvp-green-50); box-shadow: inset 0 0 0 1px var(--tvp-border); }
.tvp-lich-nav__btn, .tvp-lich-nav__nay { display: inline-flex; align-items: center; justify-content: center; height: 2rem; border-radius: 999px; color: var(--tvp-ink); text-decoration: none; }
.tvp-lich-nav__btn { width: 2rem; }
.tvp-lich-nav__nay { padding: 0 0.875rem; font-size: var(--tvp-text-sm); font-weight: 600; }
.tvp-lich-nav__btn:hover, .tvp-lich-nav__nay:hover { background: var(--tvp-green-100); color: var(--tvp-green-900); }
.tvp-lich-nav__btn:focus-visible, .tvp-lich-nav__nay:focus-visible { outline: 3px solid var(--tvp-yellow); outline-offset: 0; }
.tvp-lich-nav__title { margin: 0; font-size: var(--tvp-text-title); font-weight: 700; }
/* D-248 (Huy chọn kiểu C, 17/11): mỗi ngày một ô thẻ rời, thẻ việc bo tròn, ô hôm nay khung xanh */
.tvp-lich__thu, .tvp-lich__hang { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.tvp-lich__thu, .tvp-lich__hang { gap: 0.5rem; }
.tvp-lich__thu span { padding: 0 0.5rem 0.375rem; font-size: var(--tvp-text-xs); font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--tvp-ink-soft); }
.tvp-lich__hang + .tvp-lich__hang { margin-top: 0.5rem; }
.tvp-lich__o, .tvp-lich__cot { display: flex; flex-direction: column; gap: 0.25rem; min-width: 0; padding: 0.5rem; background: var(--tvp-surface); border: 1px solid var(--tvp-border); border-radius: var(--tvp-radius); }
.tvp-lich__o { min-height: 7.5rem; }
.tvp-lich__cot { min-height: 22rem; }
.tvp-lich__o.is-ngoai { background: transparent; border-style: dashed; }
.tvp-lich__o.is-hom-nay, .tvp-lich__cot.is-hom-nay { border: 2px solid var(--tvp-green-700); box-shadow: 0 4px 14px rgba(15, 69, 5, 0.12); }
.tvp-lich__o-dau { display: flex; align-items: center; justify-content: space-between; gap: 0.25rem; min-width: 0; }
.tvp-lich__nay { font-size: var(--tvp-text-xs); font-weight: 700; color: var(--tvp-green-700); white-space: nowrap; }
.tvp-lich__so .tvp-lich__thg { margin-left: 0.25em; }   /* inline-flex bỏ khoảng trắng đầu span: "1 Th12" */
.tvp-lich__so { align-self: flex-start; display: inline-flex; align-items: center; justify-content: center; min-width: 1.75rem; height: 1.75rem; padding: 0 0.375rem; border-radius: 999px; color: var(--tvp-ink); font-size: var(--tvp-text-sm); font-weight: 600; text-decoration: none; }
a.tvp-lich__so:hover { background: var(--tvp-green-100); color: var(--tvp-ink); }
.tvp-lich__o.is-ngoai .tvp-lich__so { color: var(--tvp-muted); font-weight: 400; }
.is-hom-nay .tvp-lich__so { background: var(--tvp-green-700); color: var(--tvp-surface); }
.tvp-lich__dau { display: flex; flex-direction: column; align-items: center; gap: 0.125rem; padding: 0.25rem 0 0.5rem; border-radius: var(--tvp-radius-sm); text-decoration: none; }
.tvp-lich__dau:hover { background: var(--tvp-green-100); }
.tvp-lich__dau .tvp-lich__so { align-self: center; min-width: 2.25rem; height: 2.25rem; font-size: var(--tvp-text-lg); }
.tvp-lich__thu-ngan { font-size: var(--tvp-text-xs); font-weight: 700; text-transform: uppercase; color: var(--tvp-muted); }
.tvp-lich__viec { min-width: 0; }
.tvp-lich__chip { display: flex; align-items: center; gap: 0.375rem; width: 100%; min-width: 0; padding: 0.25rem 0.625rem; border: 0; border-radius: 999px; font-size: var(--tvp-text-xs); font-weight: 600; line-height: 1.3; text-align: left; }
.tvp-lich__chip:hover { filter: brightness(0.95); }
.tvp-lich__txt { display: flex; flex-direction: column; gap: 0.125rem; min-width: 0; }
.tvp-lich__ten { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.tvp-lich--tuan .tvp-lich__chip { align-items: flex-start; padding: 0.375rem 0.5rem; border-radius: 0.625rem; }
.tvp-lich--tuan .tvp-lich__chip .tvp-lich__dot { margin-top: 0.3rem; }
.tvp-lich__khach { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-weight: 400; }   /* chữ một dòng, đủ chữ ở title (Huy 14/11) */
.tvp-lich__chip--tre { background: var(--tvp-danger-tint); color: var(--tvp-danger-emph); }
.tvp-lich__chip--nay { background: var(--tvp-warn-tint); color: var(--tvp-warn); }
.tvp-lich__chip--sau { background: var(--tvp-tint-la-bg); color: var(--tvp-green-900); }
.tvp-lich__chip--xong { background: var(--tvp-bg); color: var(--tvp-muted); font-weight: 500; text-decoration: line-through; }
.tvp-lich__dot { display: inline-block; flex: none; width: 0.5rem; height: 0.5rem; border-radius: 50%; }
.tvp-lich__dot--tre { background: var(--tvp-danger); }
.tvp-lich__dot--nay { background: var(--tvp-yellow); }
.tvp-lich__dot--sau { background: var(--tvp-green-700); }
.tvp-lich__dot--xong { background: var(--tvp-border-input); }
/* việc quá hạn trên lịch: dấu ! (bi-exclamation-circle-fill) thay chấm đỏ, để không chỉ dựa vào màu */
.tvp-lich__chip .tvp-lich__dot--tre, .tvp-lich__chu .tvp-lich__dot--tre { width: auto; height: auto; background: none; font-family: bootstrap-icons; font-size: 0.75rem; line-height: 1; }
.tvp-lich__chip .tvp-lich__dot--tre::before, .tvp-lich__chu .tvp-lich__dot--tre::before { content: "\f332"; }
.tvp-lich__chu .tvp-lich__dot--tre { color: var(--tvp-danger); }
.tvp-lich__them { padding: 0.125rem 0.4375rem; font-size: var(--tvp-text-xs); font-weight: 600; text-decoration: none; }
.tvp-lich__them:hover { text-decoration: underline; }
.tvp-lich__trong { padding-top: 0.5rem; color: var(--tvp-muted); font-size: var(--tvp-text-xs); text-align: center; }
.tvp-lich__pop { width: 19rem; max-width: calc(100vw - 2rem); padding: 0.875rem; border-color: var(--tvp-border); border-radius: var(--tvp-radius); box-shadow: var(--tvp-shadow-md); font-size: var(--tvp-text-sm); }
.tvp-lich__pop p { margin: 0 0 0.375rem; color: var(--tvp-muted); }
.tvp-lich__pop p a { text-decoration: none; }
.tvp-lich__pop-dau { display: flex; align-items: flex-start; gap: 0.5rem; margin-bottom: 0.375rem; font-size: var(--tvp-text-base); }
.tvp-lich__pop-dau strong { flex: 1 1 auto; min-width: 0; line-height: 1.35; }
.tvp-lich__pop-dau .tvp-lich__dot { margin-top: 0.45rem; }
.tvp-lich__pop-nut { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.5rem; }
.tvp-lich__pop .tvp-done-form { margin-top: 0.5rem; }
.tvp-lich__chu { display: flex; flex-wrap: wrap; gap: 0.875rem; margin-top: 0.5rem; color: var(--tvp-muted); font-size: var(--tvp-text-xs); }
.tvp-lich__chu span { display: inline-flex; align-items: center; gap: 0.375rem; }
@media (max-width: 767.98px) {
  .tvp-lich__thu, .tvp-lich__hang { gap: 0.1875rem; }
  .tvp-lich__hang + .tvp-lich__hang { margin-top: 0.1875rem; }
  .tvp-lich__o { min-height: 4.5rem; padding: 0.25rem 0.125rem; border-radius: 0.5rem; }
  .tvp-lich__o-dau { justify-content: center; }
  .tvp-lich__nay, .tvp-lich__thg { display: none; }
  .tvp-lich__them { padding: 0; text-align: center; }
  .tvp-lich--thang .tvp-lich__chip { justify-content: center; padding: 0.25rem; }
  .tvp-lich--thang .tvp-lich__txt { display: none; }
  .tvp-lich--tuan .tvp-lich__hang { grid-template-columns: minmax(0, 1fr); gap: 0.5rem; }
  .tvp-lich__cot { min-height: 0; }
  .tvp-lich__dau { flex-direction: row; justify-content: flex-start; gap: 0.625rem; }
}

/* 5.28 MH-19 Thông báo theo canvas CEO-Thong-bao: một khung, tên nhóm in hoa nhỏ, giờ và chấm chưa đọc bên phải.
   Ô chữ đầu tên người và nhãn mã cơ hội của canvas cần lưu người, cơ hội trên thông báo: chưa làm */
.tvp-nlist { padding: 0; overflow: hidden; }
.tvp-nlist .tvp-panel__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem; margin: 0; padding: 0.75rem 1rem; border-bottom: 1px solid var(--tvp-border); }
.tvp-nlist .tvp-notifs__group { padding: 0.5rem 1rem; font-size: var(--tvp-text-sm); font-weight: 600; color: var(--tvp-ink); background: var(--tvp-bg); }   /* D-179 (V1) */
.tvp-nlist .tvp-notif { align-items: center; }
.tvp-nlist .tvp-notif.is-unread { background: transparent; }
.tvp-nlist .tvp-notif:hover { background: var(--tvp-green-50); }
.tvp-nlist .tvp-notif.is-unread .tvp-notif__msg { font-weight: 500; }
.tvp-notif__ico { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 2rem; height: 2rem; border-radius: 50%; background: var(--tvp-green-100); color: var(--tvp-green-900); font-size: 0.9375rem; }
.tvp-nlist .tvp-notif__text { flex-direction: row; align-items: center; gap: 1rem; }
.tvp-nlist .tvp-notif__msg { flex: 1 1 auto; min-width: 0; font-size: var(--tvp-text-sm); }
.tvp-nlist .tvp-notif__time { flex: none; font-size: var(--tvp-text-sm); }
.tvp-nlist .tvp-notif__dot { margin-top: 0; background: var(--tvp-danger); }
.tvp-nlist .pagination { margin: 0.75rem 1rem; }

/* 5.29 MH-20 danh sách sản phẩm theo canvas CEO-San-pham: thanh công cụ có ô tìm và 2 ô chọn, bảng bấm cả dòng */
.tvp-rowclick { position: relative; cursor: pointer; }
.tvp-rowclick:hover > td { background: var(--tvp-green-50); }
.tvp-rowclick .tvp-rowlink::after { content: ""; position: absolute; inset: 0; }
.tvp-rowclick.is-off td:not(:first-child) { color: var(--tvp-muted); }
.tvp-sptable__nhom { width: 14%; } .tvp-sptable__nganh { width: 30%; } .tvp-sptable__tt { width: 12%; } .tvp-sptable__ngay { width: 11%; }

/* 5.30 MH-21 form sản phẩm theo canvas CEO-Sua-san-pham: ô ảnh vuông có nhãn Ảnh đại diện, ô Tải ảnh viền đứt */
.tvp-fsec__sub { margin: 0 0 0.75rem; font-size: 0.8125rem; font-weight: 600; color: var(--tvp-ink-soft); }   /* D-147: như nhãn ô */
.tvp-chipset--sm .tvp-chipbtn { min-height: 2.25rem; padding: 0 0.75rem; }
.tvp-imgtiles { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 0; padding: 0; list-style: none; }
.tvp-imgtile { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; width: 7.5rem; height: 7.5rem; overflow: hidden; border: 1px solid var(--tvp-border); border-radius: var(--tvp-radius-sm); background: var(--tvp-bg); }
.tvp-imgtile > img { width: 100%; height: 100%; object-fit: contain; }
.tvp-imgtile:has(input:checked) { border: 2px solid var(--tvp-green-700); }
.tvp-imgtile__cover { position: absolute; left: 0.375rem; right: 0.375rem; bottom: 0.375rem; display: flex; align-items: center; justify-content: center; gap: 0.25rem; padding: 0.125rem 0.375rem; border-radius: 999px; background: rgba(255, 255, 255, 0.92); font-size: var(--tvp-text-xs); font-weight: 600; cursor: pointer; }
.tvp-imgtile__cover .form-check-input { width: 0.875rem; height: 0.875rem; margin: 0; }
.tvp-imgtile__cover:has(input:checked) { background: var(--tvp-green-700); color: #fff; }
.tvp-imgtile__del { position: absolute; top: 0.25rem; right: 0.25rem; display: inline-flex; align-items: center; justify-content: center; width: 1.75rem; height: 1.75rem; padding: 0; border: 1px solid var(--tvp-border); border-radius: 0.375rem; background: #fff; color: var(--tvp-danger); }
.tvp-imgtile__del:hover { border-color: var(--tvp-danger); }
.tvp-imgtile--add { gap: 0.375rem; border: 1px dashed var(--tvp-border-input); background: var(--tvp-surface); color: var(--tvp-green-700); font-size: var(--tvp-text-sm); font-weight: 600; cursor: pointer; }
.tvp-imgtile--add .bi { font-size: 1.25rem; }
.tvp-imgtile--add:hover { border-color: var(--tvp-green-700); background: var(--tvp-green-50); }
.tvp-fileinput:focus-visible + .tvp-imgtile--add { box-shadow: var(--tvp-focus); }

/* 5.31 MH-26 Danh mục, tham số theo canvas Danh-muc, Tham-so: số mục ở cột trái, mỗi mục một dòng, ô thêm cuối khung,
   tham số mỗi dòng một ô bên phải */
.tvp-sidenav__n { margin-left: auto; padding-left: 0.5rem; color: var(--tvp-muted); font-size: var(--tvp-text-sm); font-weight: 500; }
.tvp-catpanel .tvp-cpanel__head { margin-bottom: 0.25rem; }
.tvp-catlist { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--tvp-border); }
.tvp-catrow { display: grid; grid-template-columns: auto minmax(0, 1fr) auto 6.5rem auto; align-items: center; gap: 0.5rem 1rem; padding: 0.625rem 0; border-bottom: 1px solid var(--tvp-border); font-size: var(--tvp-text-sm); }
.tvp-catrow__move, .tvp-catrow__act { display: flex; align-items: center; gap: 0.375rem; }
.tvp-catrow__move form, .tvp-catrow__act form { margin: 0; }
.tvp-catrow__name { font-weight: 600; overflow-wrap: anywhere; }
.tvp-catrow__sub { display: block; font-weight: 400; color: var(--tvp-muted); }
.tvp-catrow.is-off .tvp-catrow__name { font-weight: 500; color: var(--tvp-muted); }
.tvp-catrow__use { color: var(--tvp-muted); white-space: nowrap; }
.tvp-catrow__btn { min-width: 6.5rem; }
.tvp-sqbtn--sm { width: 2rem; height: 2rem; font-size: 0.875rem; }
.tvp-sqbtn:disabled { opacity: 0.45; cursor: not-allowed; }
.tvp-catadd { display: flex; gap: 0.5rem; margin-top: 1rem; }
.tvp-catadd .form-control { flex: 1 1 auto; }
.tvp-paramlist { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--tvp-border); }
.tvp-param { display: grid; grid-template-columns: minmax(0, 1fr) 14rem; align-items: center; gap: 0.75rem 1.5rem; padding: 1rem 0; border-bottom: 1px solid var(--tvp-border); }
.tvp-param:last-child { border-bottom: 0; }
.tvp-param--nhom { display: block; padding-top: 1.5rem; }
.tvp-param__label { display: block; font-weight: 700; color: var(--tvp-green-900); font-size: var(--tvp-text-sm); }
.tvp-param__help { color: var(--tvp-muted); font-size: var(--tvp-text-sm); }
.tvp-param__ctl .tvp-affix .form-control { padding-right: 4rem; }
.tvp-param:has(textarea) { grid-template-columns: minmax(0, 1fr); }  /* chữ nhiều dòng (điều khoản báo giá, D-190): ô rộng hết dưới nhãn */
.tvp-sw-on, input:checked ~ .tvp-sw-off { display: none; }
input:checked ~ .tvp-sw-on { display: inline; }
@media (min-width: 768px) and (max-width: 1399.98px) {   /* khung hẹp (1024 px): "Dùng ở N bản ghi" xuống dưới tên, tên đủ chỗ một dòng (GD-57) */
  .tvp-catrow { grid-template-columns: auto minmax(0, 1fr) 6.5rem auto; }
  .tvp-catrow__move { grid-row: 1 / span 2; }
  .tvp-catrow__use { grid-column: 2; grid-row: 2; font-size: var(--tvp-text-xs); }
  .tvp-catrow__name, .tvp-catrow__st, .tvp-catrow__act { grid-row: 1; }
  .tvp-catrow__st, .tvp-catrow__act { grid-row: 1 / span 2; }
}
.tvp-catrow__name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; overflow-wrap: normal; }   /* một dòng, dài thì "…" kèm title */
@media (max-width: 767.98px) {
  .tvp-catrow { grid-template-columns: auto minmax(0, 1fr); }
  .tvp-catrow__use, .tvp-catrow__st, .tvp-catrow__act { grid-column: 2; }
  .tvp-param { grid-template-columns: minmax(0, 1fr); }
}

/* 5.32 MH-25 Quản trị tài khoản theo canvas Quan-tri-tai-khoan, Tao-tai-khoan: thanh tìm không viền khung, bảng sát mép khung,
   nút biểu tượng trên dòng, mật khẩu tạm có nút Tạo lại */
.tvp-tktable .tvp-rowactions { display: flex; justify-content: flex-start; gap: 0.375rem; }  /* chiếm cả ô, căn trái: hàng ít nút không lệch cột (C-6) */
.tvp-sqbtn--trong { visibility: hidden; }  /* giữ chỗ nút không có, để cột thẳng hàng */
.tvp-tktable .tvp-rowactions form { margin: 0; }
.tvp-sqbtn--ok { color: var(--tvp-green-700); }
.tvp-tknote { margin: -0.75rem 0 0; color: var(--tvp-muted); font-size: var(--tvp-text-sm); }
.tvp-regen { display: flex; gap: 0.5rem; }
.tvp-regen .form-control { flex: 1 1 auto; min-width: 0; }
.tvp-regen .form-control[readonly], .tvp-regen .form-control[readonly]:focus { background: var(--tvp-bg); }
.tvp-regen .btn { flex: none; }
@media (min-width: 1200px) {   /* dưới 1200 px bảng thành thẻ (D-241 (7)) */
  .tvp-tktable thead th, .tvp-tktable td { padding: 0.625rem 0.75rem; }
  .tvp-tktable { table-layout: fixed; min-width: 55rem; }
  .tvp-tktable__email { width: 14.375rem; }
  .tvp-tktable__role { width: 12.5rem; }   /* "Trưởng phòng sale B2B" đủ một dòng (N-11) */
  .tvp-tktable__tt { width: 11.875rem; }
  .tvp-tktable__act { width: 10.5rem; }   /* 3 nút 44 px */
}

/* 5.33 MH-01b Đổi mật khẩu theo canvas Doi-mat-khau: hộp 520 px, điều kiện mật khẩu tự tích khi gõ */
.tvp-hop { max-width: 32.5rem; }
.tvp-hop .modal-content { min-height: 4rem; }
.tvp-hop__head { align-items: flex-start; padding: 1.5rem 1.5rem 0.5rem; border-bottom: 0; background: none; }
.tvp-hop__sub { margin: 0.125rem 0 0; font-size: var(--tvp-text-sm); color: var(--tvp-muted); }
/* K4 hộp thoại có form (D-244, thay ngăn kéo theo Q119): form bọc đầu, thân, chân; nội dung dài thì chỉ thân cuộn */
.modal-dialog-scrollable .modal-content > form { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.modal-dialog-scrollable .modal-content > form > .modal-body { overflow-y: auto; }
.tvp-hop .modal-body > :last-child { margin-bottom: 0; }
.tvp-hop .modal-body, .tvp-hopcard .card-body { padding: 0.5rem 1.5rem; }
.tvp-hop .modal-footer, .tvp-hopcard .card-footer { padding: 0 1.5rem 1.5rem; border-top: 0; background: none; }
.tvp-hopcard { max-width: 32.5rem; margin: 0 auto; }
.tvp-pwfield > .mb-3 { margin-bottom: 0.5rem !important; }
.tvp-pwcheck { display: flex; flex-direction: column; gap: 0.25rem; margin: 0; padding: 0; list-style: none; font-size: var(--tvp-text-sm); color: var(--tvp-muted); }
.tvp-pwcheck li { display: flex; align-items: center; gap: 0.5rem; }
.tvp-pwcheck li::before { content: ""; flex: none; width: 1.125rem; height: 1.125rem; border-radius: 50%; background: var(--tvp-border); }
.tvp-pwcheck li.is-ok { color: var(--tvp-ink); }
.tvp-pwcheck li.is-ok::before { background: var(--tvp-green-700) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23fff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round' d='M4 8.5l2.5 2.5L12 5.5'/%3E%3C/svg%3E") center / 0.75rem no-repeat; }

/* 5.34 MH-29 Nhật ký hệ thống theo canvas Nhat-ky-he-thong: tab, bộ lọc gọn, bảng chung một khung; ô đang lọc tô xanh */
.tvp-nkpanel { display: flex; flex-direction: column; gap: 0.75rem; padding: 1rem; }
.tvp-nkpanel .tvp-tabs { margin: 0; }
.tvp-nkpanel .tvp-table-wrap { border: 0; border-radius: 0; box-shadow: none; }
.tvp-nkloc__o { min-width: 0; }
.tvp-nkloc__ctl .form-control, .tvp-nkloc__ctl .form-select { width: auto; min-width: 9rem; height: 2.5rem; min-height: 2.5rem; font-size: var(--tvp-text-sm); }
.tvp-nkloc__ctl.is-set .form-control, .tvp-nkloc__ctl.is-set .form-select { border-color: var(--tvp-green-700); background-color: var(--tvp-green-100); color: var(--tvp-green-900); font-weight: 600; }
.tvp-nkloc__o--nhan .form-label { margin-bottom: 0.25rem; font-size: var(--tvp-text-sm); }
.tvp-nkloc__btn { height: 2.5rem; }
.js-tu-loc .tvp-nkloc__btn--js { display: none; }
@media (max-width: 575.98px) { .tvp-nkloc__o { flex: 1 1 100%; } .tvp-nkloc__ctl .form-control, .tvp-nkloc__ctl .form-select { width: 100%; } }
.tvp-nkpanel .tvp-pill--ok { background: var(--tvp-green-700); color: #fff; }
.tvp-nkpanel .tvp-pill--ok .bi { display: none; }

/* MH-08 Ghi buổi làm việc (US-14, canvas Ghi-buoi-lam-viec): thẻ khách, nút chọn Đã chốt / Chưa chốt / Chưa rõ, khối việc */
.tvp-buoi__task { padding: 1rem; border: 1px solid var(--tvp-border); border-radius: var(--tvp-radius); background: var(--tvp-bg); }
.tvp-buoi__task[hidden] { display: none; }
.tvp-buoi__task .tvp-readbox { color: var(--tvp-ink); }

/* MH-06 tab Hoạt động (US-14, canvas Chi-tiet-khach-hoat-dong): ô lọc, nhóm theo tháng, đường nối các buổi trong tháng */
.tvp-acts { padding: 1rem; }
.tvp-acts__loc { display: flex; flex-wrap: wrap; gap: 0.5rem; }   /* nằm ở góc phải hàng tiêu đề (Huy, 02/11) */
.js-tu-loc .tvp-acts__btn { display: none; }
.tvp-acts__month { margin: 0 0 0.75rem; font-size: var(--tvp-text-sm); font-weight: 700; color: var(--tvp-green-900); }
.tvp-acts__month span { font-weight: 400; color: var(--tvp-muted); }
.tvp-acts .tvp-btls + .tvp-acts__month { margin-top: 1.25rem; }
/* Buổi làm việc mỗi buổi một thẻ trên dòng thời gian (D-165): tab Hoạt động MH-06, tab Buổi làm việc MH-10 */
.tvp-btls { display: flex; flex-direction: column; gap: 0.75rem; margin: 0; padding: 0; list-style: none; }
.tvp-bthe { position: relative; display: grid; grid-template-columns: 2rem minmax(0, 1fr); gap: 0.75rem; }
.tvp-bthe:not(:last-child)::after { content: ""; position: absolute; top: 2.25rem; bottom: -0.75rem; left: calc(1rem - 1px); width: 2px; background: var(--tvp-border); }
.tvp-bthe__khung { min-width: 0; padding: 0.875rem 1rem; border: 1px solid var(--tvp-border); border-radius: 10px; background: var(--tvp-surface); }
.tvp-bthe__dau { display: flex; flex-wrap: wrap; align-items: center; gap: 0.375rem 0.75rem; }
.tvp-bthe__loai { font-weight: 700; color: var(--tvp-green-900); }
.tvp-bthe__ngay { font-size: var(--tvp-text-sm); color: var(--tvp-muted); font-variant-numeric: tabular-nums; }
.tvp-bthe__ch { margin-left: auto; padding: 0.125rem 0.625rem; border-radius: 999px; background: var(--tvp-bg); color: var(--tvp-ink); font-size: var(--tvp-text-sm); text-decoration: none; overflow-wrap: anywhere; }
.tvp-bthe__ch:hover, .tvp-bthe__ch:focus-visible { text-decoration: underline; }
.tvp-bthe__nd { margin: 0.5rem 0 0; font-size: var(--tvp-text-base); line-height: 1.5; overflow-wrap: anywhere; }
.tvp-bthe__phu { margin: 0.25rem 0 0; font-size: var(--tvp-text-sm); line-height: 1.5; overflow-wrap: anywhere; }
.tvp-bthe__phu b { color: var(--tvp-green-900); }
.tvp-bthe__chan { display: flex; flex-wrap: wrap; align-items: center; gap: 0.375rem 0.75rem; margin-top: 0.625rem; padding-top: 0.625rem; border-top: 1px solid var(--tvp-border); font-size: var(--tvp-text-sm); color: var(--tvp-muted); }
.tvp-bthe__chan b { font-weight: 600; color: var(--tvp-ink); }
.tvp-bthe__buoc { display: inline-flex; padding: 0.125rem 0.625rem; border-radius: 999px; background: var(--tvp-vang-nhat); color: var(--tvp-warn); font-size: var(--tvp-text-xs); font-weight: 700; }
.tvp-bthe__buoc.is-ok { background: var(--tvp-green-100); color: var(--tvp-green-900); }
@media (max-width: 575.98px) { .tvp-bthe__ch { margin-left: 0; } }
/* Thanh đầu tab của MH-10 (D-137, Huy 01/11): chỉ nút, bên phải; tab không có nút thì không có thanh */
/* Đầu khung mỗi tab MH-10 (D-188): tên danh sách + số bên trái, nút bên phải, kẻ mảnh dưới */
.tvp-octab__bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1rem; padding-bottom: 0.875rem; border-bottom: 1px solid var(--tvp-border); }
.tvp-octab__bar + * { margin-top: 0.875rem; }
.tvp-octab__ten { display: flex; align-items: center; gap: 0.5rem; margin: 0; font-size: var(--tvp-text-title); font-weight: 700; }
.tvp-octab__ten > .bi { color: var(--tvp-green-700); }   /* biểu tượng trước tên danh sách, như khối tab Thông tin (Huy 10/11) */
.tvp-octab__so { margin-left: 0.25rem; font-weight: 600; color: var(--tvp-muted); }
.tvp-octab__acts .btn { min-height: 2.25rem; --bs-btn-padding-y: 0.25rem; --bs-btn-padding-x: 0.75rem; font-size: var(--tvp-text-sm); }   /* nút đầu tab nhỏ hơn nút trang (Huy, 01/11) */
.tvp-octab__acts { flex: none; display: flex; flex-wrap: wrap; gap: 0.5rem; margin-left: auto; }
@media (max-width: 575.98px) { .tvp-octab__acts, .tvp-octab__acts > .btn { width: 100%; } }

/* US-21: nhãn cảnh báo trên thẻ Pipeline (canvas Pipeline: chip vàng "9 ngày", đủ chữ khi rê chuột) */
.tvp-pcard__flags { display: flex; flex-wrap: wrap; gap: 0.25rem; }
.tvp-pcard__flags .tvp-chip { align-self: flex-start; }
.tvp-octl__what a { color: inherit; text-decoration: none; }
.tvp-octl__what a:hover { text-decoration: underline; }

/* MH-10 tab Thông tin (US-58, US-39): chip và nút Sửa ở đầu khối */
.tvp-ocinfo__cong { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.tvp-ocinfo__cong .tvp-chip { align-self: center; }

/* MH-15 tab Mẫu (US-59, canvas Co-hoi-mau-sale, Co-hoi-mau-them, Co-hoi-mau-phan-hoi) */
.tvp-samples__no { margin-bottom: 0.75rem; }
.tvp-sample-ref { display: flex; flex-direction: column; gap: 0.125rem; margin-bottom: 1rem; padding: 0.75rem 0.875rem; border-radius: var(--tvp-radius-sm); background: var(--tvp-bg); font-size: var(--tvp-text-sm); }
.tvp-sample-ref span { color: var(--tvp-muted); }
.tvp-ngan-ch__note--muted { background: var(--tvp-bg); color: var(--tvp-ink); }
.tvp-radiocards--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tvp-filebox { display: flex; align-items: center; gap: 0.75rem; padding: 0.75rem 1rem; border: 1px dashed var(--tvp-border-input); border-radius: var(--tvp-radius-sm); color: var(--tvp-green-700); cursor: pointer; }
.tvp-filebox:hover { background: var(--tvp-green-50); }
.tvp-fileinput:focus-visible + .tvp-filebox { box-shadow: var(--tvp-focus); }
.tvp-filebox__title { display: block; font-weight: 700; color: var(--tvp-green-700); }
.tvp-filebox__sub { display: block; font-size: var(--tvp-text-sm); color: var(--tvp-muted); overflow-wrap: anywhere; }
/* Nút trong đầu khối tab Thông tin cao 36 px như canvas; điện thoại giữ cỡ chạm 44 px */
.tvp-ocinfo__cong .btn { display: inline-flex; align-items: center; gap: 0.5rem; }
@media (min-width: 768px) { .tvp-ocinfo__cong .btn { min-height: 2.25rem; --bs-btn-padding-y: 0.25rem; } }
/* Ngăn kéo nền trắng như canvas (Tao-co-hoi, Co-hoi-nhu-cau, Co-hoi-mau-them: background #FFFFFF) */
.tvp-ngan-ch .form-check { display: flex; align-items: center; gap: 0.5rem; padding-left: 0; }
.tvp-ngan-ch .form-check .form-check-input { float: none; margin: 0; flex: none; }
/* Hộp thoại MH-10 nền trắng như canvas; form bọc đầu, thân, chân hộp nên tự giãn cách */
.tvp-ocmodal { --bs-modal-bg: var(--tvp-surface); }
.tvp-ocmodal .modal-content > form { display: flex; flex-direction: column; gap: 1rem; }

/* ---------- MH-16 Báo giá (US-32, US-33; canvas Bao-gia-form, Bao-gia-xem-truoc, Bao-gia-da-gui, CEO-Bao-gia, CEO-Co-hoi) ---------- */
.tvp-bgstt { display: inline-flex; align-items: center; padding: 2px 0.5rem; border-radius: 999px; background: var(--tvp-bg); color: var(--tvp-ink); font-size: var(--tvp-text-xs); font-weight: 600; line-height: 1.125rem; vertical-align: middle; white-space: nowrap; }
.tvp-bgstt--sent { background: var(--tvp-green-100); color: var(--tvp-green-900); }
.tvp-bgstt--accepted { background: var(--tvp-green-700); color: #fff; }
.tvp-bgstt--rejected { background: var(--tvp-danger-tint); color: var(--tvp-danger); }
.tvp-bgstt--superseded { background: var(--tvp-bg); color: var(--tvp-muted); }
.tvp-bglink { display: inline-flex; align-items: center; gap: 0.375rem; padding: 0; font-weight: 600; text-decoration: none; }
@media (min-width: 768px) { .tvp-bglink { min-height: 1.75rem; } }  /* liên kết chữ trong thẻ như canvas; điện thoại giữ 44 px */
.tvp-bggrid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1.25rem; }
.tvp-bgrd { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1rem; padding: 0.625rem 0.875rem; background: var(--tvp-bg); border: 1px solid var(--tvp-border); border-radius: var(--tvp-radius-sm); font-size: var(--tvp-text-sm); }
.tvp-bgline__act { display: flex; align-items: center; min-height: 2.75rem; }
.tvp-bgline__xoa { width: 2.25rem; height: 2.25rem; min-height: 0; padding: 0; color: var(--tvp-danger); }
@media (max-width: 767.98px) { .tvp-bgline__xoa { width: var(--tvp-touch); height: var(--tvp-touch); } }   /* GD-69 (D-249): vùng chạm 44 px trên điện thoại */
/* D-192 (Huy duyệt 11/11): form báo giá theo khuôn form nhập CRM (D-147). Mỗi dòng sản phẩm là một thẻ lưới 3 hàng, nhãn luôn hiện trên ô:
   sản phẩm (số thứ tự) + nút xóa; số lượng, đơn vị, đơn giá, thành tiền; qui cách, công ty sản xuất, MOQ, đơn vị MOQ */
.tvp-bgform .tvp-fsec__head .tvp-bglink { margin-left: auto; }
.tvp-bgform__note { margin: 0 0.25rem; font-size: var(--tvp-text-xs); }
.tvp-fnav__phu { margin-left: 0.25rem; color: var(--tvp-muted); font-weight: 400; font-size: var(--tvp-text-xs); }
.tvp-bglines { display: grid; gap: 0.875rem; margin-top: 1rem; }
.tvp-bgline { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr) minmax(0, 1.15fr) minmax(0, 1.15fr) 2.75rem;
  grid-template-areas: "sp sp sp sp act" "sl dv dg tt ." "qc sx moq dvm ."; gap: 0.875rem 1rem; min-width: 0;
  padding: 1rem 1.125rem 1.125rem; border: 1px solid var(--tvp-border-soft); border-radius: 0.875rem; background: #fbfcfa; }
.tvp-bgline > * { min-width: 0; }
.tvp-bgline__sp { grid-area: sp; } .tvp-bgline__dv { grid-area: dv; } .tvp-bgline__sl { grid-area: sl; } .tvp-bgline__dg { grid-area: dg; }
.tvp-bgline__moq { grid-area: moq; } .tvp-bgline__dvm { grid-area: dvm; } .tvp-bgline__tt { grid-area: tt; } .tvp-bgline__qc { grid-area: qc; }
.tvp-bgline__sx { grid-area: sx; }
.tvp-bgform .tvp-bgline__act { grid-area: act; align-self: end; }
.tvp-bgform .tvp-bgline__act .btn { width: 2.75rem; height: 2.75rem; }
.tvp-bgline__lbl { display: flex; align-items: center; margin-bottom: 0.375rem; font-size: 0.8125rem; font-weight: 600; color: var(--tvp-ink-soft); white-space: nowrap; }
.tvp-bgline__stt { display: inline-grid; place-items: center; flex: none; width: 1.375rem; height: 1.375rem; margin-right: 0.375rem; border-radius: 999px;
  background: var(--tvp-green-100); color: var(--tvp-green-900); font-size: 0.75rem; font-weight: 700; }
.tvp-bgline .tvp-so { text-align: right; }
.tvp-bgline__tt [data-tt] { display: flex; align-items: center; justify-content: flex-end; min-height: 2.75rem; padding: 0 0.75rem; border-radius: 0.5rem;
  background: var(--tvp-green-50); font-weight: 700; font-variant-numeric: tabular-nums; }
.tvp-bgline__tt [data-tt]:not(:empty)::after { content: " đ"; white-space: pre; }
.tvp-bgline .is-khac { border-color: var(--tvp-danger); }  /* đơn vị MOQ khác đơn vị bán: cảnh báo (US-32-AC2), không phải lỗi */
.tvp-bgform .tvp-bgwarn { margin: 0.875rem 0 0; }
.tvp-bgform .tvp-bgdk > div:first-child { display: grid; gap: 1rem; }
@media (max-width: 767.98px) {
  .tvp-bgform .tvp-form-actions .btn { white-space: nowrap; padding-inline: 0.625rem; font-size: var(--tvp-text-sm); }
  .tvp-bgform .tvp-form-actions > a { flex: 0 0 auto; }
  .tvp-bgform .tvp-form-actions .bi-eye { display: none; }
}
/* điện thoại: 2 cột cho dễ nhập */
@media (max-width: 575.98px) {
  .tvp-bgline { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: "sp sp" "sl dv" "dg dg" "tt act" "qc qc" "sx sx" "moq dvm";
    gap: 0.75rem; padding: 0.875rem; }
  .tvp-bgform .tvp-bgline__act { justify-self: end; }
}
.tvp-bgwarn { display: flex; gap: 0.5rem; align-items: flex-start; margin: 0; padding: 0.625rem 0.875rem; border-radius: var(--tvp-radius-sm); background: var(--tvp-warn-tint); color: var(--tvp-warn); font-size: var(--tvp-text-sm); }
.tvp-bgdk { display: grid; grid-template-columns: minmax(0, 1fr) 20.75rem; gap: 1.25rem; align-items: start; }
.tvp-bgtong { margin: 0; padding: 1rem; background: var(--tvp-bg); border: 1px solid var(--tvp-border); border-radius: var(--tvp-radius); font-variant-numeric: tabular-nums; }
.tvp-bgtong dl { margin: 0; }
.tvp-bgtong dl > div { display: flex; justify-content: space-between; gap: 1rem; padding: 0.375rem 0; font-size: var(--tvp-text-sm); }
.tvp-bgtong dt { font-weight: 400; color: var(--tvp-muted); }
.tvp-bgtong dd { margin: 0; font-weight: 600; text-align: right; }
.tvp-bgtong .is-dam { border-top: 1px solid var(--tvp-border); }
.tvp-bgtong .is-dam dt { font-weight: 700; color: var(--tvp-ink); }
.tvp-bgtong .is-dam dd { font-weight: 700; }
.tvp-bgtong p { margin: 0.25rem 0 0; font-size: var(--tvp-text-sm); color: var(--tvp-muted); }
.tvp-bggiaybox .bg-giay { width: 794px; margin: 0; padding: 53px 45px; box-sizing: border-box;  /* khổ A4, lề như @page của bao-gia.css; tvp.js thu nhỏ cho vừa khung (D-190) */ border: 0; border-radius: 0.5rem; box-shadow: 0 1px 2px rgb(0 0 0 / 0.06), 0 8px 24px rgb(0 0 0 / 0.08); }   /* tờ giấy không khung, bóng nhẹ (D-189) */
.tvp-bggiaybox .bg-giay { overflow: hidden; }   /* PR 4 (N-2): báo giá ngắn, hình chim mờ (đặt cố định từ 300 px) không lòi ra ngoài tờ giấy */
.tvp-bgside { display: flex; flex-direction: column; gap: 1rem; }
/* MH-16 Chi tiết báo giá làm mới (D-189, Huy 10/11): nút quay lại cơ hội, đầu trang kiểu MH-10 (.tvp-ochd), tờ giấy không khung, khối việc tiếp theo bên phải */
.tvp-bghd__khoa { display: inline-flex; align-items: center; gap: 0.25rem; color: var(--tvp-muted); font-size: var(--tvp-text-sm); }
.tvp-bgpage .tvp-oclayout__main { flex: 0 1 42rem; }
.tvp-bgpage .tvp-oclayout__side { flex: 1 1 22rem; }
/* D-191: màn rộng, cột giấy lấy hết phần còn lại, cột phải cố định 26rem; tờ giấy ở giữa, tvp.js phóng tới 120% */
@media (min-width: 992px) {
  .tvp-bgpage .tvp-oclayout { display: grid; grid-template-columns: minmax(0, 1fr) 26rem; align-items: start; gap: 1rem; }
  .tvp-bggiaybox { display: flex; justify-content: center; }
}
/* D-191: khối cột phải bản v2: tiêu đề có biểu tượng, nhãn trạng thái phản hồi, hai ô số Giá R&D */
.tvp-bgside .tvp-ocard { padding: 1.25rem; gap: 1rem; }
.tvp-bgpage .tvp-ocard__head .tvp-sptitle { margin: 0; }
.tvp-bgtt { padding: 0.125rem 0.625rem; border-radius: 999px; font-size: var(--tvp-text-xs); font-weight: 700; white-space: nowrap; }
.tvp-bgtt--sent { background: var(--tvp-warn-tint); color: var(--tvp-warn); }
.tvp-bgtt--accepted { background: var(--tvp-green-100); color: var(--tvp-green-900); }
.tvp-bgtt--rejected { background: var(--tvp-danger-tint); color: var(--tvp-danger); }
.tvp-bgbuoc__kq { margin: 0; color: var(--tvp-muted); font-size: var(--tvp-text-sm); }
.tvp-bgbuoc .tvp-bgph .btn { min-height: 2.75rem; }
.tvp-bgso { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0.75rem; }
.tvp-bgso__o { display: flex; flex-direction: column; gap: 0.125rem; padding: 0.875rem 1rem; border-radius: 0.75rem; background: var(--tvp-bg); }
.tvp-bgso__nhan, .tvp-bgso__phu { color: var(--tvp-muted); font-size: var(--tvp-text-xs); }
.tvp-bgso__so { font-size: 1.375rem; font-weight: 700; line-height: 1.25; white-space: nowrap; color: var(--tvp-ink); }
.tvp-bgso__o--cao { background: var(--tvp-green-50); }
.tvp-bgso__o--cao .tvp-bgso__so { color: var(--tvp-green-800); }
.tvp-bgso__o--thap { background: var(--tvp-danger-tint); }
.tvp-bgso__o--thap .tvp-bgso__so { color: var(--tvp-danger); }
.tvp-bgpb li > div > span b { color: var(--tvp-ink); }
@media (max-width: 575.98px) {
  .tvp-bgside .tvp-ocard { padding: 1rem; }
  .tvp-bgso { gap: 0.5rem; }
  .tvp-bgso__o { padding: 0.75rem; }
  .tvp-bgso__so { font-size: 1.125rem; white-space: normal; }
}
.tvp-bgbuoc .tvp-bgph { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tvp-bgbuoc .tvp-bgph .btn { justify-content: center; }
.tvp-bgpb li[aria-current] { padding-inline: 0.625rem; border-top-color: transparent; border-radius: 0.5rem; background: var(--tvp-green-50); }
.tvp-bgpb li[aria-current] + li { border-top-color: transparent; }
@media (max-width: 767.98px) {
  /* điện thoại: việc tiếp theo ngay dưới đầu trang, rồi tóm tắt, giá R&D, phiên bản */
  .tvp-bgpage .tvp-oclayout { flex-direction: column; flex-wrap: nowrap; align-items: stretch; }
  .tvp-bgpage .tvp-oclayout__main, .tvp-bgpage .tvp-oclayout__side { display: contents; }
  .tvp-bgbuoc { order: 1; } .tvp-bgtom { order: 2; } .tvp-bgrdk { order: 3; } .tvp-bgpbk { order: 4; }
  .tvp-bgbuoc .tvp-bgph { grid-template-columns: minmax(0, 1fr); }
}
.tvp-bgph { display: flex; flex-direction: column; align-items: flex-start; gap: 0.75rem; }
.tvp-bgph form { margin: 0; }
.tvp-bghint { margin: 0; color: var(--tvp-muted); font-size: var(--tvp-text-sm); line-height: 1.5; }
.tvp-bgpb { margin: 0; padding: 0; list-style: none; }
.tvp-bgpb li { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 0.625rem 0; border-top: 1px solid var(--tvp-border); font-size: var(--tvp-text-sm); }
.tvp-bgpb li > div { display: flex; flex-direction: column; }
.tvp-bgpb a { font-weight: 600; color: var(--tvp-ink); text-decoration: none; }
.tvp-bgpb [aria-current] a { color: var(--tvp-green-700); }
.tvp-bgpb li > div > span { color: var(--tvp-muted); }  /* chỉ dòng ngày · tổng; viên trạng thái giữ màu của viên (R-20, WCAG 1.4.3) */
.tvp-bgrd-ls { font-size: var(--tvp-text-sm); }
.tvp-bgrd-ls ul { margin: 0.5rem 0 0; padding-left: 1.25rem; color: var(--tvp-muted); }
@media (max-width: 767.98px) {
  .tvp-bgdk { grid-template-columns: minmax(0, 1fr); }
  .tvp-bggiaybox { display: none; }   /* R-10: thay bằng .tvp-bgtom */
}

/* MH-17 Đóng cơ hội (US-34, US-35; canvas Dong-co-hoi-thang, Dong-co-hoi-thua) và trang Sửa PO (D-121 (4)) */
.tvp-radiocard.is-disabled { cursor: not-allowed; background: var(--tvp-bg); }
.tvp-radiocard.is-disabled:hover { border-color: var(--tvp-border-input); }
.tvp-dongnote { display: flex; gap: 0.75rem; align-items: flex-start; margin: 0; }
.tvp-bgtom__dong { list-style: none; margin: 0; padding: 0; }
.tvp-bgtom__dong li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 0.75rem; padding: 0.5rem 0; border-top: 1px solid var(--tvp-border); }
.tvp-bgtom__sp { grid-column: 1 / -1; font-weight: 600; }
.tvp-bgtom__sl { color: var(--tvp-muted); font-size: var(--tvp-text-sm); }
.tvp-bgtom__dong b, .tvp-bgtom__tong dd { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tvp-bgtom__tong { margin: 0; border-top: 1px solid var(--tvp-border); padding-top: 0.5rem; }
.tvp-bgtom__tong > div { display: flex; justify-content: space-between; gap: 0.75rem; padding: 0.25rem 0; }
.tvp-bgtom__tong dt { font-weight: 500; } .tvp-bgtom__tong dd { margin: 0; }
.tvp-chidoc { margin: 0; min-height: var(--tvp-touch); display: flex; align-items: center; font-weight: 600; }
@media (max-width: 575.98px) {   /* R-11: form một cột, nút chính rộng hết hàng và đứng trước nút Hủy */
  .tvp-bggrid2 { grid-template-columns: minmax(0, 1fr); }
}
.tvp-poline { display: grid; grid-template-columns: minmax(12.5rem, 1fr) 10rem 12.5rem 2.25rem; gap: 0.5rem; align-items: start; padding: 0.5rem 0; border-top: 1px solid var(--tvp-border); }
.tvp-poline--head { padding: 0 0 0.25rem; border-top: 0; font-size: 0.8125rem; font-weight: 600; color: var(--tvp-ink-soft); }   /* D-147: như nhãn ô */
.tvp-poline .so, .tvp-poline .tvp-so { text-align: right; }
.tvp-poline__lbl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }  /* như .tvp-bgline__lbl (L-05) */
/* Ghi đơn, Sửa đơn, dòng PO: khung chứa hẹp hơn 620 px (form ở màn 768 → 1229 px) thì xếp như điện thoại, không tràn ngang (GD-56).
   Đo khung chứa chứ không đo màn vì cột form hẹp đi theo menu trái, cột tóm tắt */
:has(> .tvp-poline--head:not(.tvp-poline--db)) { container: poline / inline-size; }
@container poline (max-width: 38.74rem) {
  .tvp-poline { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 2.25rem; }
  .tvp-poline > :first-child { grid-column: 1 / -1; }
  .tvp-poline--head { display: none; }
  .tvp-poline__lbl { position: static; width: auto; height: auto; overflow: visible; clip: auto; white-space: normal; display: block; margin-bottom: 0.25rem; font-size: 0.8125rem; font-weight: 600; color: var(--tvp-ink-soft); }
}
.tvp-pofoot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem; padding-top: 0.625rem; border-top: 1px solid var(--tvp-border); }
.tvp-pofoot__k { color: var(--tvp-muted); }
.tvp-pofoot b { font-size: var(--tvp-text-xl); font-variant-numeric: tabular-nums; }
.tvp-ochint { margin: 0; color: var(--tvp-muted); font-size: var(--tvp-text-sm); line-height: 1.45; }
.tvp-ocpo { margin: 0; padding: 0; list-style: none; }
.tvp-ocpo li { display: flex; flex-direction: column; padding: 0.25rem 0; }
.tvp-ocpo li span:last-child { color: var(--tvp-muted); font-size: var(--tvp-text-sm); }
.tvp-ocfields__note { color: var(--tvp-muted); font-size: var(--tvp-text-sm); font-weight: 400; }
@media (max-width: 767.98px) {
  .tvp-poline { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 2.25rem; }
  .tvp-poline > :first-child { grid-column: 1 / -1; }
  .tvp-poline--head { display: none; }
  .tvp-poline__lbl { position: static; width: auto; height: auto; overflow: visible; clip: auto; white-space: normal; display: block; margin-bottom: 0.25rem; font-size: 0.8125rem; font-weight: 600; color: var(--tvp-ink-soft); }
}

/* MH-06 tab Đơn hàng (US-57, D-98; canvas Chi-tiet-khach-don-hang): chỉ đọc, dòng PO của cơ hội Thắng */
.tvp-donhang__ma { white-space: nowrap; display: block; font-weight: 600; }
.tvp-donhang__ten { display: block; color: var(--tvp-muted); }
.tvp-donhang__more { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem; padding-top: 0.75rem; color: var(--tvp-muted); font-size: var(--tvp-text-sm); }
.tvp-donhang__foot { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0.375rem 1.75rem; margin-top: 0.75rem; padding-top: 0.75rem; border-top: 2px solid var(--tvp-border); color: var(--tvp-muted); font-size: var(--tvp-text-sm); }
.tvp-donhang__foot b { color: var(--tvp-ink); font-variant-numeric: tabular-nums; }

/* 5.35 MH-04b Đội sale, MH-04c Chi tiết sale theo canvas CEO-Doi-sale, CEO-Chi-tiet-sale (US-47-AC10 → AC16, D-124) */
.tvp-doi { display: flex; flex-direction: column; gap: var(--tvp-space-5); }   /* các khối cấp một cách 24 px như mọi màn (D-241 (6), GD-39) */
.tvp-doi > .tvp-custhead { margin: 0; }
.tvp-doi__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem; }
.tvp-doi__head--dau { justify-content: flex-end; }   /* D-162: chọn kỳ ở đầu trang Đội sale, canh phải */
.tvp-doi__title { margin: 0; font-size: var(--tvp-text-2xl); font-weight: 700; line-height: 1.25; }
.tvp-doi__sub { display: block; color: var(--tvp-muted); font-size: var(--tvp-text-sm); }
.tvp-doi__sub b { color: var(--tvp-ink); }
.tvp-doi__h2, .tvp-doi__ph h2 { margin: 0; font-size: var(--tvp-text-title); font-weight: 700; line-height: 1.25; }
.tvp-doi__panel { display: flex; flex-direction: column; gap: 0.75rem; padding: 1rem; }
.tvp-doi__ph { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 0.75rem; }
.tvp-doi__ph > span, .tvp-doi__ph > div > span { color: var(--tvp-muted); font-size: var(--tvp-text-sm); }
.tvp-doi__ph--split { justify-content: space-between; }
.tvp-doi__ph--trai { justify-content: flex-start; }   /* PR 4 (N-4): Mục tiêu năm, nút tháng và "Chép từ tháng trước" sát tiêu đề, không nằm dưới nút Trợ lý nổi ở góc phải */
.tvp-doi__loc { margin-left: auto; align-self: center; }   /* nút lọc Tất cả / Cần hỗ trợ bên phải tiêu đề (D-208) */
.tvp-doi__ph--split > div { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 0.75rem; }
.tvp-doitable { min-width: 53.75rem; margin: 0; table-layout: fixed; font-size: var(--tvp-text-sm); }
.tvp-doitable--6 { min-width: 47.5rem; }
.tvp-doitable--khach { min-width: 40rem; table-layout: auto; }
.tvp-doitable > thead > tr > th { padding: 0.625rem 1rem; background: var(--tvp-bg); color: var(--tvp-ink); font-size: var(--tvp-text-sm); font-weight: 600; white-space: nowrap; border-bottom: 1px solid var(--tvp-border); }
.tvp-doitable > thead > tr > th.is-now { color: var(--tvp-green-700); }   /* đầu bảng chữ chính 14/600 như mọi bảng (GD-14); tháng đang chạy xanh */
.tvp-doitable > tbody > tr > td { padding: 0.875rem 1rem; vertical-align: middle; border-top: 1px solid var(--tvp-border); border-bottom: 0; }
.tvp-doitable--6 > tbody > tr > td { padding: 0.5rem 1rem; }
.tvp-doitable--6 > tbody > tr > td.tvp-doi__o6 { padding: 0.375rem; }
.tvp-doitable--khach > thead > tr > th { padding: 0.5rem 0.75rem; }
.tvp-doitable--khach > tbody > tr > td { padding: 0.625rem 0.75rem; }
.tvp-doitable--khach td:nth-child(2) { font-weight: 600; }
.tvp-doitable--khach th:first-child, .tvp-doitable--khach td:first-child { width: 2rem; }
.tvp-doitable tbody tr:hover > td { background: var(--tvp-bg); }
.tvp-doi__who { display: flex; align-items: center; gap: 0.75rem; }
.tvp-doi__who > div { min-width: 0; }
.tvp-doi__name { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; font-weight: 600; }
.tvp-doi__name .tvp-rowlink { color: var(--tvp-ink); font-weight: 600; text-decoration: none; }
.tvp-doi__role { color: var(--tvp-muted); font-size: var(--tvp-text-xs); }
.tvp-doi__why { color: var(--tvp-danger); font-size: var(--tvp-text-xs); }
.tvp-av { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 2.5rem; height: 2.5rem; border-radius: 999px; font-size: var(--tvp-text-xs); font-weight: 700; }
.tvp-av--sm { width: 2rem; height: 2rem; }
.tvp-av--a { background: #fde7df; color: #8a2a0a; }
.tvp-av--b { background: var(--tvp-green-100); color: var(--tvp-green-900); }
.tvp-av--c { background: var(--tvp-vang-nhat); color: var(--tvp-warn); }
.tvp-doi__goal { display: flex; align-items: baseline; justify-content: space-between; gap: 0.5rem; }
.tvp-doi__goal b { font-size: var(--tvp-text-lg); }
.tvp-doi__goal span { color: var(--tvp-muted); font-size: var(--tvp-text-xs); }
.tvp-doi__goal .tvp-doi__none { color: var(--tvp-ink); font-size: var(--tvp-text-sm); font-weight: 600; }
.tvp-doi__bar { height: 0.5rem; margin-top: 0.375rem; border-radius: 999px; background: var(--tvp-green-100); overflow: hidden; }
.tvp-doi__bar > span { display: block; height: 100%; }
.tvp-doi__bar .is-ok { background: var(--tvp-green-700); }
.tvp-doi__bar .is-slow { background: var(--tvp-yellow); }
.tvp-doi__bar .is-bad { background: var(--tvp-metric-danger-bg); }
.tvp-doi__n { font-size: var(--tvp-text-base); font-weight: 700; font-variant-numeric: tabular-nums; }
.tvp-doi__n.is-bad { color: var(--tvp-danger); }
.tvp-doi__n.is-warn { color: var(--tvp-warn); }
.tvp-doi__go { color: var(--tvp-green-700); font-size: 1.125rem; }
.tvp-doi__note { margin: 0; color: var(--tvp-muted); font-size: var(--tvp-text-xs); }
.tvp-doi__legend { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 0; padding: 0; list-style: none; }
.tvp-doi__legend li { display: inline-flex; align-items: center; gap: 0.375rem; color: var(--tvp-muted); font-size: var(--tvp-text-xs); }
.tvp-doi__legend .tvp-o6 { width: 0.875rem; height: 0.875rem; border-radius: 0.25rem; }
.tvp-o6 { display: flex; align-items: center; justify-content: center; height: 2.5rem; border-radius: var(--tvp-radius-sm); background: var(--tvp-bg); font-weight: 700; font-variant-numeric: tabular-nums; }
.tvp-o6.is-now { outline: 2px dashed var(--tvp-border); outline-offset: -2px; }
.tvp-o6--dat { background: var(--tvp-green-700); color: #fff; }
.tvp-o6--gan { background: var(--tvp-stage-3-tint); color: var(--tvp-green-900); }
.tvp-o6--vua { background: var(--tvp-vang-nhat); color: var(--tvp-warn); }
.tvp-o6--thap { background: var(--tvp-danger-tint); color: var(--tvp-danger); }
.tvp-doi__more { align-self: flex-start; color: var(--tvp-green-700); font-weight: 700; text-decoration: none; }
.tvp-doi__more:hover { text-decoration: underline; }
/* Chi tiết sale: khung đầu như MH-06 */
.tvp-sale4 { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.tvp-sale4__the { flex: 1 1 13.75rem; min-width: 0; display: flex; align-items: center; gap: 0.875rem; padding: 1rem; background: var(--tvp-surface); border: 1px solid var(--tvp-border); border-radius: var(--tvp-radius); }
.tvp-sale4__icon { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 2.75rem; height: 2.75rem; border-radius: var(--tvp-radius); background: var(--tvp-green-100); color: var(--tvp-green-700); font-size: 1.25rem; }
.tvp-sale4__chu { min-width: 0; display: flex; flex-direction: column; gap: 0.25rem; }
.tvp-sale4__ten { color: var(--tvp-muted); font-weight: 600; line-height: 1.4; }
.tvp-sale4__so { color: var(--tvp-green-900); font-size: 1.75rem; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.tvp-sale4__so-sanh { color: var(--tvp-green-700); font-weight: 600; line-height: 1.4; }
.tvp-sale4__so-sanh.is-down { color: var(--tvp-danger); }
.tvp-sale4__so-sanh.is-flat { color: var(--tvp-muted); }
.tvp-sale2 { display: flex; flex-wrap: wrap; gap: 1rem; align-items: stretch; }
.tvp-sale2 > .tvp-panel { flex: 1 1 26.25rem; gap: 0.25rem; }
.tvp-sale2 .tvp-doi__h2, .tvp-sale2 .tvp-doi__ph { margin-bottom: 0.25rem; }
.tvp-sale2__ds { margin: 0; }
.tvp-sale2__ds > div, .tvp-sale2__thua li { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 0.625rem 0; border-top: 1px solid var(--tvp-border); line-height: 1.3; }
.tvp-sale2__ds dt, .tvp-sale2__thua span { color: var(--tvp-green-900); font-weight: 600; }
.tvp-sale2__ds dd { margin: 0; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tvp-sale2__thua { margin: 0; padding: 0; list-style: none; }
.tvp-sale2__thua li { display: block; }
.tvp-sale2__thua li > div:first-child { display: flex; justify-content: space-between; gap: 0.75rem; }
.tvp-sale5 { display: flex; align-items: stretch; margin: 0; padding: 0; list-style: none; }
.tvp-sale5__b { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 0.125rem; min-height: 4.5rem; margin-left: -0.625rem; padding: 0.5rem 1.75rem; color: var(--tvp-green-900); line-height: 1.3; white-space: nowrap;
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 50%, calc(100% - 14px) 100%, 0 100%, 14px 50%); }
.tvp-sale5__b:first-child { margin-left: 0; padding-left: 0.875rem; clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 50%, calc(100% - 14px) 100%, 0 100%); }
.tvp-sale5__b--1 { background: var(--tvp-stage-3-tint); }
.tvp-sale5__b--2 { background: #b9d9ab; }
.tvp-sale5__b--3 { background: var(--tvp-stage-1-fill); }
.tvp-sale5__b--4 { background: var(--tvp-stage-4-fill); color: #fff; }
.tvp-sale5__b--5 { background: var(--tvp-green-700); color: #fff; }
.tvp-sale5__ten { font-weight: 700; }
.tvp-sale5__so b { font-size: var(--tvp-text-xl); }
.tvp-sale5__phong { font-size: var(--tvp-text-xs); }  /* không opacity: ô bước 3, 4 tụt dưới tương phản 4,5:1 (axe, WCAG AA) */
.tvp-sale5__cham { margin-left: 0.375rem; padding: 0.0625rem 0.375rem; border-radius: 999px; background: var(--tvp-danger-tint); color: var(--tvp-danger); font-size: var(--tvp-text-xs); font-weight: 700; }
@media (max-width: 767.98px) {
  .tvp-sale5 { flex-direction: column; gap: 0.375rem; }
  .tvp-sale5__b, .tvp-sale5__b:first-child { margin-left: 0; padding: 0.5rem 0.875rem; border-radius: var(--tvp-radius-sm); clip-path: none; }
}

/* MH-22 Mục tiêu (US-38): khung Đội sale, ô nhập số gọn trong bảng (D-126 (8)) */
.tvp-mt__ct { display: grid; grid-template-columns: 1.4fr repeat(4, 1fr); gap: 0.75rem; margin: 1rem 0 0; }
@media (max-width: 767.98px) { .tvp-mt__ct { grid-template-columns: repeat(2, 1fr); } .tvp-mt__ct-nam { grid-column: 1 / -1; } }
.tvp-mt__ct > div { display: flex; flex-direction: column; gap: 0.125rem; padding: 0.75rem 1rem; border-radius: var(--tvp-radius); background: var(--tvp-bg); border: 1px solid var(--tvp-border); }
.tvp-mt__ct dt { color: var(--tvp-muted); font-size: var(--tvp-text-xs); font-weight: 600; }
.tvp-mt__ct dd { margin: 0; font-size: var(--tvp-text-xl); font-weight: 700; font-variant-numeric: tabular-nums; }
.tvp-mt__ct > .tvp-mt__ct-nam { background: var(--tvp-green-100); color: var(--tvp-green-900); }
.tvp-mt__ct-nam dd { font-size: var(--tvp-text-2xl); }
.tvp-mt__o { display: inline-block; width: 4.75rem; min-height: var(--tvp-touch); height: var(--tvp-touch); padding: 0 0.5rem; text-align: right; font-variant-numeric: tabular-nums; }
.tvp-mt__bang { min-width: 60rem; }   /* D-249 (8): 12 ô tháng 52 px cách nhau 6 px, cột người 176 px: vừa khung 1280 px không cuộn; trước ô chồng nhau 3 px, cột Cả năm bị cắt */
.tvp-mt__bang .tvp-mt__o { width: 3.25rem; padding: 0 0.25rem; }
.tvp-mt__kh { min-width: 0; max-width: 46rem; table-layout: auto; }
.tvp-mt__bang > thead > tr > th, .tvp-mt__bang > tbody > tr > td, .tvp-mt__bang > tfoot > tr > td { padding-inline: 0.1875rem; }
.tvp-mt__bang > thead > tr > th:last-child, .tvp-mt__bang > tbody > tr > td:last-child, .tvp-mt__bang > tfoot > tr > td:last-child { width: 5.5rem; padding-inline: 0.75rem 1rem; }
.tvp-mt__bang .tvp-mt__ten { width: 11rem; }
@media (min-width: 1440px) { .tvp-mt__bang .tvp-mt__ten { width: 12.5rem; } }
.tvp-mt__ten { text-align: left; font-weight: 400; }
.tvp-mt__bang > tbody > tr > th, .tvp-mt__kh > tbody > tr > th { padding: 0.625rem 1rem; vertical-align: middle; border-top: 1px solid var(--tvp-border); border-bottom: 0; }
.tvp-mt__bang > tfoot > tr > * { padding-block: 0.625rem; border-top: 1px solid var(--tvp-border); font-weight: 600; font-variant-numeric: tabular-nums; }
.tvp-mt__bang > tfoot > tr > th { padding-left: 1rem; }
.tvp-mt__bang tr:target > * { background: var(--tvp-green-100); }
.tvp-mt__trong { color: var(--tvp-muted); }
@media (max-width: 767.98px) {   /* R-17 */
  .tvp-mt__bang--mot { min-width: 0; }
  .tvp-mt__bang--mot .tvp-mt__ten { display: none; }
  .tvp-mt__bang--mot > tbody > tr { padding: 0 1rem; }
  .tvp-mt__bang--mot > tbody > tr > td, .tvp-mt__bang--mot > tbody > tr > td:last-child { width: 100%; padding: 0.5rem 0; border-top: 1px solid var(--tvp-border); }
  .tvp-mt__bang--mot > tbody > tr > td:first-of-type { border-top: 0; }
}
.tvp-mt__chan { margin-top: 0.75rem; }   /* D-244: nút Lưu mục tiêu lên đầu trang; chân chỉ còn dòng ghi chú, không dính đáy */
.tvp-doi__ct { color: var(--tvp-muted); font-weight: 400; }
.tvp-sale4__ct { color: var(--tvp-muted); font-size: var(--tvp-text-sm); font-weight: 400; }

/* MH-10 ngăn kéo Sửa dự báo (US-39), ô giá trị, ngày khi tạo Bán thêm */
.tvp-ngan-db__goi-y { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem; margin-top: 0.5rem; padding: 0.5rem 0.75rem; border-radius: var(--tvp-radius); background: var(--tvp-green-100); color: var(--tvp-green-900); font-size: var(--tvp-text-sm); }
.tvp-ngan-db__phu { color: var(--tvp-muted); }
.tvp-ngan-db__hang { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1rem; }
@media (max-width: 575.98px) { .tvp-ngan-db__hang { grid-template-columns: 1fr; } }
.tvp-radiocard.is-disabled { cursor: not-allowed; background: var(--tvp-bg); }
.tvp-radiocard.is-disabled .tvp-radiocard__title { color: var(--tvp-muted); }
.tvp-radiocard.is-disabled .tvp-radiocard__sub { color: var(--tvp-warn); }

/* MH-23 Mục tiêu doanh thu, Dự báo doanh thu (US-41, US-40, D-148), làm mới theo bản mẫu design-system/sale-b2b/ban-mau-mh23/ hướng B (D-144; thay bố cục màn mẫu
   CEO-Du-bao của D-130 (2), (3)). Dùng lại thẻ .tvp-kpis--lon, lưới .tvp-dash-luoi, danh sách .tvp-dash-ds của Dashboard (D-143).
   Bốn mức dự báo đậm dần theo độ chắc, giãn đều độ sáng (kiểm bằng validate_palette của skill dataviz: cặp kề ΔE ≥ 15 mắt thường,
   ≥ 14 mù màu; màu nhạt có số bằng chữ và chú giải bên cạnh); khe 2 px giữa các đoạn. Mua lại / Mua lần đầu: xanh đậm / xanh nhạt. */
.tvp-db { --db-thang: #0e3d0a; --db-ck: #2f7d1f; --db-knc: #78bb5c; --db-td: #c2e3ad; --db-hh: var(--tvp-green-700); --db-moi: #a7d58f;
  display: grid; gap: 1.5rem; }
.tvp-db__o { display: inline-block; width: 0.75rem; height: 0.75rem; border-radius: 0.1875rem; }
.tvp-db__o--con { background: var(--tvp-border-soft); }
/* D-245 (GD-37): bề rộng cột của bảng Đội sale, Dự báo sản lượng (trước viết thẳng style="" trong template) */
.tvp-cot-doi > col:nth-child(1), .tvp-cot-dau26 > col:first-child { width: 26%; }
.tvp-cot-doi > col:nth-child(2) { width: 30%; }
.tvp-cot-doi > col:nth-child(n+3):nth-child(-n+5) { width: 13%; }
.tvp-cot-doi > col:nth-child(6) { width: 5%; }
/* D-249 (8): cột số, ngày, nút rộng vừa chữ (rem); cột tên lấy phần còn lại (trước theo %: ở 1280 px tiêu đề "Q1/2027" cụt, số cách nhau 3 px) */
.tvp-cot-dbsp > col:first-child { width: 10rem; }
.tvp-cot-dbsp > col:last-child { width: 6rem; }
.tvp-cot-dbkh > col:nth-child(2) { width: 8.5rem; }
.tvp-cot-dbkh > col:nth-child(3) { width: 5rem; }
.tvp-cot-dbkh > col:nth-child(4) { width: 9rem; }
.tvp-cot-dbkh > col:nth-child(5) { width: 6.5rem; }
.tvp-cot-dbsua > col:nth-child(2) { width: 11rem; }
.tvp-cot-dbsua > col:nth-child(3) { width: 12%; }
.tvp-cao-0 { min-height: 0; }  /* form trong hộp thoại cuộn được (modal-dialog-scrollable) */
.tvp-db__o--thang { background: var(--db-thang); } .tvp-db__o--ck { background: var(--db-ck); } .tvp-db__o--knc { background: var(--db-knc); } .tvp-db__o--td { background: var(--db-td); }
.tvp-db__moi { padding: 0 0.375rem; border-radius: 999px; background: var(--tvp-warn-tint); color: var(--tvp-ink); font-weight: 600; }
.tvp-db__moi.is-lai { background: var(--tvp-tint-la-ico); }
.tvp-tabcount.is-do { padding: 0 0.375rem; border-radius: 999px; background: var(--tvp-danger-tint); color: var(--tvp-danger-emph); }

/* Hàng tab đầu trang (không có khối tiêu đề, D-137): trái hai tab và Cả phòng / Của tôi; phải chọn kỳ và nút Mục tiêu */
.tvp-db-thanh { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem; }
.tvp-db-thanh__nhom { display: flex; flex-wrap: wrap; align-items: center; gap: 0.625rem; }
.tvp-db-thanh__phai { margin-left: auto; justify-content: flex-end; }
.tvp-db-thanh .tvp-pipebar { flex-wrap: nowrap; }
.tvp-dash-luoi > .c-12 { grid-column: 1 / -1; }   /* khối rộng hết hàng (lưới Dashboard chưa có) */

/* 3 thẻ hai trang Mục tiêu, Dự báo: cùng khuôn, 3 cột, không dòng phụ (D-208) */
.tvp-kpis--lon.tvp-kpis--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (min-width: 992px) and (max-width: 1199.98px) {   /* 3 cột bên menu trái: thẻ hẹp, bỏ ô biểu tượng để chữ không chạm mép */
  .tvp-kpis--lon.tvp-kpis--3 > .tvp-kpi { min-height: 0; }
  .tvp-kpis--lon.tvp-kpis--3 .tvp-kpi__ico { display: none; }
  .tvp-kpis--lon.tvp-kpis--3 .tvp-kpi__chu { margin-left: 0; max-width: 100%; padding-bottom: 0; }
}
/* D-159: dải 3 ô của các màn danh sách (Khách hàng, Pipeline, Việc, Sản phẩm, Đội sale) dùng thẻ trên nhưng thấp hơn, không có dòng phụ.
   Từ 991 px trở xuống vẫn 3 ô một hàng (C-3: không đẩy danh sách xuống dưới màn đầu); điện thoại bỏ ô biểu tượng */
.tvp-kpis--lon.tvp-kpis--gon > .tvp-kpi, .tvp-kpis--lon.tvp-kpis--3 > .tvp-kpi, .tvp-hn .tvp-kpis--lon > .tvp-kpi { min-height: 6.75rem; padding: 1.25rem 1.25rem 1rem; }
.tvp-kpis--lon.tvp-kpis--gon .tvp-kpi__ico, .tvp-kpis--lon.tvp-kpis--3 .tvp-kpi__ico, .tvp-hn .tvp-kpis--lon .tvp-kpi__ico { top: 1.25rem; }
.tvp-kpis--lon.tvp-kpis--gon .tvp-kpi__value { margin-bottom: 0; }
@media (max-width: 991.98px) { .tvp-kpis--lon.tvp-kpis--3.tvp-kpis--gon { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 767.98px) {
  .tvp-kpis--lon.tvp-kpis--3.tvp-kpis--gon { gap: 0.375rem; }
  .tvp-kpis--lon.tvp-kpis--3.tvp-kpis--gon > .tvp-kpi { min-height: 0; padding: 0.625rem 0.75rem; }
  .tvp-kpis--lon.tvp-kpis--gon .tvp-kpi__ico { display: none; }
  .tvp-kpis--lon.tvp-kpis--gon .tvp-kpi__chu { margin-left: 0; max-width: 100%; }
  .tvp-kpis--lon.tvp-kpis--gon .tvp-kpi__label { font-size: var(--tvp-text-xs); }
  .tvp-kpis--lon.tvp-kpis--gon .tvp-kpi__value { font-size: var(--tvp-text-xl); }
}

/* Tab Doanh thu: hai vành Mua lại / Mua lần đầu; danh sách xếp hạng; số đếm cạnh tiêu đề khối */
.tvp-db-vanh-ds { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.tvp-db-vanh-ds.tvp-db-vanh-ds--thang { grid-template-columns: repeat(var(--so), minmax(0, 1fr)); margin: 0; padding: 0; list-style: none; }
.tvp-db-vanh-ds--thang.is-doc .tvp-db-vanh { grid-template-columns: minmax(0, 1fr); justify-items: center; text-align: center; padding: 1rem 0.5rem; }
.tvp-db-vanh-ds--thang.is-doc .tvp-db-vanh__hinh { grid-row: auto; width: 7rem; }
.tvp-db-vanh-ds--thang.is-doc .tvp-db-vanh__so { justify-items: center; }
@media (min-width: 1400px) { .tvp-db-vanh-ds--thang.is-mot .tvp-db-vanh { grid-template-columns: auto auto; justify-content: center; } }
.tvp-db-vanh__so { align-self: start; display: grid; justify-items: start; gap: 0.375rem; }
.tvp-db-vanh-ds--thang .tvp-db-vanh__hinh b { font-size: var(--tvp-text-xl); }
.tvp-db-vanh-ds--thang .tvp-pill--muted { background: var(--tvp-surface); }
.tvp-pill.tvp-db-can-chot { background: var(--tvp-kpi-xd-ico); color: var(--tvp-ink); }
@media (max-width: 1399.98px) {   /* 3 cột bên menu trái, 6 tháng thành 2 hàng 3: thẻ hẹp nên vành nằm trên chữ */
  .tvp-db-vanh-ds.tvp-db-vanh-ds--thang { grid-template-columns: repeat(min(var(--so), 3), minmax(0, 1fr)); }
  .tvp-db-vanh-ds--thang .tvp-db-vanh { grid-template-columns: minmax(0, 1fr); justify-items: center; text-align: center; padding: 1rem 0.5rem; }
  .tvp-db-vanh-ds--thang .tvp-db-vanh__hinh { grid-row: auto; width: 7rem; }
  .tvp-db-vanh-ds--thang .tvp-db-vanh__so { justify-items: center; }
}
@media (max-width: 767.98px) {
  .tvp-db-vanh-ds.tvp-db-vanh-ds--thang { grid-template-columns: minmax(0, 1fr); }
}
.tvp-db-vanh { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 0.375rem 1.5rem; padding: 1rem 1.25rem; border-radius: 0.75rem; background: var(--tvp-bg); }
.tvp-db-vanh__hinh { position: relative; grid-row: span 2; width: 8.75rem; aspect-ratio: 1; border-radius: 50%; }
.tvp-db-vanh__hinh > span { position: absolute; inset: 13%; display: flex; flex-direction: column; align-items: center; justify-content: center; border-radius: 50%;
  background: var(--tvp-bg); font-size: var(--tvp-text-xs); color: var(--tvp-muted); }
.tvp-db-vanh__hinh b { font-size: 0.9375rem; color: var(--tvp-ink); white-space: nowrap; font-variant-numeric: tabular-nums; }
.tvp-db-vanh h3 { align-self: end; margin: 0; font-size: var(--tvp-text-base); font-weight: 700; }
.tvp-db-vanh p { align-self: start; margin: 0; font-size: var(--tvp-text-sm); line-height: 1.6; color: var(--tvp-ink-soft); }
.tvp-db-vanh p b { color: var(--tvp-ink); }
.tvp-db-cham { display: inline-block; width: 0.625rem; height: 0.625rem; margin-right: 0.375rem; border-radius: 50%; background: var(--db-hh); }
.tvp-db-cham.is-moi { background: var(--db-moi); }
.tvp-db-dem { flex: none; padding: 0.1875rem 0.625rem; border-radius: 0.5rem; background: var(--tvp-tint-la-ico); color: var(--tvp-green-900); font-size: var(--tvp-text-xs); font-weight: 600; }
.tvp-db-hang { display: grid; margin: 0; padding: 0; list-style: none; }
.tvp-db-hang > li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 0.25rem 0.875rem; padding: 0.75rem 0; }
.tvp-db-hang > li + li { border-top: 1px solid var(--tvp-border-soft); }
.tvp-db-hang__so { display: inline-flex; align-items: center; justify-content: center; width: 2.25rem; height: 2.25rem; border-radius: 50%;
  background: var(--tvp-tint-la-ico); color: var(--tvp-tint-la-fg); font-size: var(--tvp-text-sm); font-weight: 700; }
.tvp-db-hang__ten { min-width: 0; font-size: var(--tvp-text-sm); line-height: 1.35; }
.tvp-db-hang__ten > a, .tvp-db-hang__ten > b { font-weight: 700; color: var(--tvp-ink); text-decoration: none; }
.tvp-db-hang__ten > a { display: inline-block; min-height: 1.5rem; padding-top: 0.125rem; }   /* vùng bấm ≥ 24 px (WCAG 2.5.8, L-10) */
.tvp-db-hang__ten > a:hover { color: var(--tvp-green-700); text-decoration: underline; }
.tvp-db-hang__ten small { display: block; font-size: var(--tvp-text-xs); color: var(--tvp-muted); }
.tvp-db-hang__gt, .tvp-db-gt { flex: none; text-align: right; font-size: var(--tvp-text-xs); color: var(--tvp-muted); white-space: nowrap; }
.tvp-db-hang__gt b, .tvp-db-gt b { display: block; font-size: var(--tvp-text-sm); color: var(--tvp-ink); font-variant-numeric: tabular-nums; }
.tvp-db-hang__thanh { grid-column: 2 / -1; display: flex; gap: 2px; height: 0.5rem; border-radius: 999px; background: var(--tvp-green-50); overflow: hidden; }
.tvp-db-hang__thanh > span { height: 100%; background: var(--tvp-tint-la-fg); }
.tvp-db-hang__thanh.is-chong > span { background: none; }
.tvp-db-hang__thanh.is-chong > .tvp-db__o--ck { background: var(--db-ck); } .tvp-db-hang__thanh.is-chong > .tvp-db__o--knc { background: var(--db-knc); } .tvp-db-hang__thanh.is-chong > .tvp-db__o--td { background: var(--db-td); }
.tvp-dash-ds__ico.is-commit { background: var(--tvp-tint-la-ico); color: var(--tvp-tint-la-fg); }
.tvp-dash-ds__ico.is-best_case, .tvp-dash-ds__ico.is-pipeline { background: var(--tvp-tint-ngoc-ico); color: var(--tvp-tint-ngoc-fg); }

/* Trang Dự báo: Dự báo từng tháng, mỗi tháng một vành như Mua lại và mua lần đầu (D-152) */
.tvp-db-chu { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; margin: 0; padding: 0; list-style: none; font-size: var(--tvp-text-xs); color: var(--tvp-ink-soft); }
.tvp-db-chu li { display: inline-flex; align-items: center; gap: 0.5rem; }
.tvp-db-thang__so { font-size: var(--tvp-text-sm); color: var(--tvp-muted); white-space: nowrap; cursor: help; border-bottom: 1px dotted #b8c2b3; }
.tvp-db-thang__so b { font-size: 1.0625rem; color: var(--tvp-ink); font-variant-numeric: tabular-nums; }
.tvp-db-thang__so:focus-visible { outline: none; box-shadow: var(--tvp-focus); border-radius: 0.25rem; }

@media (max-width: 991.98px) {
  .tvp-kpis--lon.tvp-kpis--3 { grid-template-columns: minmax(0, 1fr); gap: 0.75rem; }
  .tvp-db-vanh-ds { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 767.98px) {
  .tvp-db { gap: 1.125rem; }
  .tvp-db-thanh__nhom, .tvp-db-thanh .tvp-pipebar { width: 100%; flex-wrap: wrap; }
  .tvp-db-thanh__nhom > .tvp-seg { flex: 1 1 100%; }
  .tvp-db-thanh__nhom > .tvp-seg a { flex: 1 1 0; justify-content: center; }
  .tvp-db-thanh__phai > .btn { flex: 1 1 100%; justify-content: center; }
  .tvp-kpis--lon.tvp-kpis--3 > .tvp-kpi { min-height: 0; padding: 1rem; }
  .tvp-db-vanh__hinh { width: 7rem; } .tvp-db-vanh__hinh b { font-size: var(--tvp-text-sm); }
}

/* Màn hẹp (đợt sửa lỗi giao diện 28/10/2026, PR 2). L-03, L-06: bảng Đội sale, Chi tiết sale, MH-23 thành thẻ (D-20, mẫu .tvp-rtable), không vuốt ngang;
   tới 1199 px như .tvp-rtable--wide (bảng 860 px không vừa máy tính bảng, laptop nhỏ có menu trái). L-10: liên kết đứng riêng (không nằm
   trong câu) và ô chọn cao ít nhất 24 px (WCAG 2.2, 2.5.8). */
.table-responsive { position: relative; }  /* chữ ẩn (visually-hidden, absolute) trong bảng không thoát khung cuộn mà kéo giãn cả trang */
@media (max-width: 1199.98px) {
  .tvp-doitable.tvp-rtable thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .tvp-doitable.tvp-rtable, .tvp-doitable.tvp-rtable tbody, .tvp-doitable.tvp-rtable tr, .tvp-doitable.tvp-rtable td { display: block; width: 100%; }
  .tvp-doitable.tvp-rtable td { display: flex; justify-content: space-between; align-items: center; gap: 1rem; text-align: right; }
  .tvp-doitable.tvp-rtable td::before { content: attr(data-label); flex: none; color: var(--tvp-muted); font-size: var(--tvp-text-xs); font-weight: 600; text-align: left; }
  .tvp-doitable.tvp-rtable td.tvp-rt-title { display: block; text-align: left; padding-bottom: 0.5rem; font-size: var(--tvp-text-base); }
  .tvp-doitable.tvp-rtable td.tvp-rt-title::before, .tvp-doitable.tvp-rtable td.tvp-rt-actions::before { content: none; }
  .tvp-doitable.tvp-rtable, .tvp-doitable--6 { min-width: 0; table-layout: auto; }
  .tvp-doitable.tvp-rtable > tbody > tr { padding: 0.75rem 0; border-top: 1px solid var(--tvp-border); }
  .tvp-doitable.tvp-rtable > tbody > tr:first-child { border-top: 0; padding-top: 0; }
  .tvp-doitable.tvp-rtable > tbody > tr > td { padding: 0.25rem 0; border: 0; }
  .tvp-doitable.tvp-rtable tbody tr:hover > td { background: none; }
  .tvp-doitable.tvp-rtable td.tvp-doi__muc { display: block; text-align: left; }  /* thanh tiến độ cần cả bề rộng */
  .tvp-doitable.tvp-rtable td.tvp-doi__muc::before { display: block; margin-bottom: 0.25rem; }
  .tvp-doitable.tvp-rtable td.tvp-doi__go-o { display: none; }  /* cả thẻ bấm được */
  .tvp-doitable--khach.tvp-rtable > tbody > tr { position: relative; padding-left: 2.25rem; }  /* R-1: ngang độ ưu tiên dòng .tvp-doitable.tvp-rtable > tbody > tr để không bị padding: 0.75rem 0 đè */
  .tvp-doitable--khach.tvp-rtable td.tvp-doi__chon { position: absolute; left: 0; width: auto; padding: 0; }  /* top để tự (vị trí tĩnh): ngang dòng tên ở cả hàng đầu không có padding trên */
  .tvp-doitable--khach td.tvp-doi__chon::before { content: none; }
  .tvp-doitable--khach > tbody > tr:first-child > td.tvp-doi__chon { top: 0; }
  .tvp-doitable--khach th:first-child, .tvp-doitable--khach td:first-child { width: auto; }
  /* 6 tháng: tên một hàng, 6 ô một hàng, tên tháng trên mỗi ô */
  .tvp-doitable--6 thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .tvp-doitable--6, .tvp-doitable--6 tbody { display: block; width: 100%; }
  .tvp-doitable--6 > tbody > tr { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0.25rem; padding: 0.625rem 0; border-top: 1px solid var(--tvp-border); }
  .tvp-doitable--6 > tbody > tr:first-child { border-top: 0; padding-top: 0; }
  .tvp-doitable--6 > tbody > tr > td, .tvp-doitable--6 > tbody > tr > td.tvp-doi__o6 { display: block; padding: 0; border: 0; }
  .tvp-doitable--6 > tbody > tr > td:first-child { grid-column: 1 / -1; padding-bottom: 0.25rem; }
  .tvp-doitable--6 td.tvp-doi__o6::before { content: attr(data-label); display: block; color: var(--tvp-muted); font-size: var(--tvp-text-xs); text-align: center; }
  .tvp-doitable--6 .tvp-o6 { height: 2.25rem; font-size: var(--tvp-text-xs); }
  .tvp-doitable--6 tbody tr:hover > td { background: none; }
  .tvp-rowlink, .tvp-doi__more, .tvp-taskbar__more, dd > a, .tvp-bgpb a { display: inline-block; padding-block: 0.25rem; }
  .tvp-doitable .form-check-input { width: 1.5rem; height: 1.5rem; margin: 0; }
  .tvp-searchbox input { align-self: stretch; }  /* ô gõ cao bằng khung 40 px */
}

/* Bộ chuyển kiểu xem dạng viên (Huy, 02/11): rãnh xanh nhạt bo tròn, không vạch ngăn, mục đang chọn là viên xanh đậm.
   Áp chung cho .tvp-seg, .tvp-seg--xem, .tvp-segr; đặt cuối file để thắng các luật kích thước riêng ở trên. */
.tvp-seg { gap: 2px; padding: 3px; border: 0; border-radius: 999px; background: var(--tvp-green-50); box-shadow: inset 0 0 0 1px var(--tvp-border); }
.tvp-seg a, .tvp-seg--xem label { border-radius: 999px; }
.tvp-seg a + a, .tvp-seg--xem label + input + label { border-left: 0; }
.tvp-seg a:hover, .tvp-seg--xem label:hover { background: var(--tvp-green-100); }
.tvp-seg a[aria-current], .tvp-seg--xem .btn-check:checked + label { background: var(--tvp-green-700); color: var(--tvp-surface); box-shadow: 0 1px 2px rgba(15, 69, 5, 0.2); }
.tvp-seg a:focus-visible { outline: 3px solid var(--tvp-yellow); outline-offset: 0; }

/* Hàng tìm một dòng (Huy, 02/11): màn ít bộ lọc (Sản phẩm, Tài khoản) gom ô tìm, viên lọc, nút chính vào một hàng:
   tìm (khoảng 1/3) → viên lọc → nút bên phải. Hẹp thì tự xuống dòng; điện thoại xếp dọc như cũ. */
@media (min-width: 576px) {
  .tvp-loc--mot-hang { flex-direction: row; flex-wrap: wrap; align-items: center; }
  .tvp-loc--mot-hang > .tvp-loc__row { display: contents; }
  .tvp-loc--mot-hang .tvp-searchbox { flex: 1 1 12rem; max-width: 24rem; }
  .tvp-loc--mot-hang > .tvp-loc__vien { order: 1; flex: 0 1 auto; }
  .tvp-loc--mot-hang .tvp-loc__phai { order: 2; margin-left: auto; }
}

/* MH-05 (Huy, 02/11): bên trái tìm + viên lọc, bên phải sắp xếp, Bảng / Thẻ, Thêm khách */

/* MH-05 thanh lọc không khung (Huy, 02/11): bỏ hộp quanh phần lọc để màn chỉ còn hai khối (số liệu, bảng).
   Ô tìm và viên lọc chảy liền nhau, tự xuống dòng; Thêm khách ghim góc phải. Điện thoại xếp dọc. */
.tvp-locbar #locKhach { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 0.75rem 1rem; }
.tvp-loc__dong { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; min-width: 0; }
.tvp-loc__dong > .tvp-loc__vien { display: contents; }
.tvp-loc__dong > .tvp-searchbox { flex: 0 1 16rem; background: var(--tvp-surface); }
.tvp-locbar .tvp-searchbox { background: var(--tvp-surface); }   /* thanh lọc không khung: ô và viên nền trắng trên nền trang (Khách hàng, Sản phẩm, Tài khoản) */
@media (max-width: 575.98px) {
  .tvp-locbar #locKhach { grid-template-columns: minmax(0, 1fr); }
  .tvp-loc__dong > .tvp-searchbox { flex: 1 1 100%; }
  .tvp-loc__dong > .tvp-loc__vien { display: flex; width: 100%; }   /* điện thoại: viên lọc một hàng riêng, vuốt ngang như cũ */
  .tvp-locbar .tvp-loc__phai, .tvp-locbar .tvp-loc__phai > .btn { width: 100%; }
}
@media (min-width: 576px) {   /* máy tính (Huy, 02/11): Bảng/Thẻ dưới Thêm khách; ô tìm và viên lọc cùng hàng với Thêm khách,
                                  thiếu chỗ (viên đang lọc dài ra) thì xuống dòng 2 cạnh Bảng/Thẻ, không viên nào bị khuất */
  .tvp-loc__dong { row-gap: 1rem; }   /* dòng 1 thẳng tâm Bảng/Thẻ, dòng 2 thẳng tâm Thêm khách */
  .tvp-loc__dong > .tvp-searchbox { flex: 0 1 15rem; min-width: 10.75rem; }
  .tvp-locbar .tvp-loc__phai { flex-direction: column; align-items: stretch; gap: 0.5rem; }
  .tvp-locbar .tvp-loc__phai > .tvp-seg--xem label { flex: 1 1 0; justify-content: center; }
}
@media (max-width: 575.98px) {   /* điện thoại: tìm, viên lọc, rồi nút, cùng thứ tự với Khách hàng */
  .tvp-locbar.tvp-loc--mot-hang > .tvp-loc__row, .tvp-locbar .tvp-loc--mot-hang > .tvp-loc__row { display: contents; }
  .tvp-loc--mot-hang .tvp-loc__phai { order: 2; }
}

/* Viên lọc kiểu A (Huy chọn 02/11, kiểu Linear / Notion): nền xanh rất nhạt, không viền, thấp 32 px.
   Đang lọc: nền xanh đậm, chữ trắng, hiện × bỏ riêng bộ lọc (thay mũi tên). Đặt cuối file để thắng luật cũ ở trên. */
.tvp-vien { padding: 0 0.75rem; border: 0; background: var(--tvp-green-100); color: var(--tvp-green-900); font-weight: 500; transition: background-color 0.15s; }
.tvp-vien:hover { background: var(--tvp-green-150); }
.tvp-vien--bat:has(:checked) { background: var(--tvp-green-700); color: var(--tvp-surface); }
.tvp-vien--bat:has(:checked):hover { background: var(--tvp-green-800); }
.tvp-vien__bo { display: none; position: relative; z-index: 1; align-items: center; justify-content: center; width: 1.25rem; height: 1.25rem; margin: 0 -0.25rem 0 0.375rem; padding: 0; border: 0; border-radius: 999px; background: rgba(255, 255, 255, 0.2); color: inherit; font-size: 0.625rem; cursor: pointer; }
.tvp-vien__bo:hover { background: rgba(255, 255, 255, 0.35); }

/* Ô tìm (Huy, 02/11): bo tròn như viên lọc, viền mảnh nhạt, cao 36 px; đang gõ thì viền xanh và quầng xanh mờ ở khung ngoài.
   Ô chữ bên trong không có viền tiêu điểm riêng (khung vàng trùng lớp); khung ngoài :focus-within đã báo đang gõ. */
.tvp-searchbox { padding: 0 0.875rem; border-color: var(--tvp-border); border-radius: 999px; background: var(--tvp-surface); transition: border-color 0.15s, box-shadow 0.15s; }
.tvp-searchbox:hover { border-color: var(--tvp-border-input); }
.tvp-searchbox:focus-within { border-color: var(--tvp-green-700); box-shadow: 0 0 0 3px rgba(24, 98, 7, 0.15); }
.tvp-searchbox > .bi-search { color: var(--tvp-muted); font-size: 0.875rem; }
.tvp-searchbox input, .tvp-searchbox input:focus, .tvp-searchbox input:focus-visible { outline: 0; box-shadow: none; }
.tvp-searchbox input::-webkit-search-cancel-button { cursor: pointer; }
@media (min-width: 768px) {   /* bảng cơ hội đã đóng (tab Cơ hội MH-06): chia cột theo nhịp bảng Đơn hàng đã mua (Huy, 02/11) */
  .tvp-dongtab { table-layout: fixed; }
  .tvp-dongtab th:nth-child(1) { width: 26%; } .tvp-dongtab th:nth-child(2) { width: 14%; } .tvp-dongtab th:nth-child(3) { width: 16%; }
  .tvp-dongtab th:nth-child(4) { width: 16%; } .tvp-dongtab th:nth-child(5) { width: 28%; }
  .tvp-dongtab th:nth-child(5), .tvp-dongtab td.tvp-rt-note { text-align: right; }   /* Ghi chú sát lề phải như cột Giá trị bảng Đơn hàng (Huy, 02/11) */
}

/* Ô Thời điểm (D-140 (3)): ô ngày + ô giờ gõ "HH:MM" kiểu 24 giờ */
.tvp-ngaygio { display: grid; grid-template-columns: minmax(0, 1fr) 6.5rem; gap: 0.5rem; }
.tvp-o-gio { font-variant-numeric: tabular-nums; }

/* ---------- MH-04 Dashboard CEO (US-47; bố cục, màu theo bản mẫu ban-mau-lam-moi/dashboard.html bản 3, D-143) ----------
   Đầu trang: tiêu đề hiện và dòng mô tả (chỉ Dashboard, ngoại lệ D-137), nút ngày mở hàng chọn kỳ dùng chung. 4 thẻ .tvp-kpis--lon
   cùng một kiểu, chỉ khác màu (màu bản mẫu). Khối .tvp-panel trắng bo 16 px, bóng nhẹ, tiêu đề có biểu tượng. Phễu dùng màu bước chung,
   vành khuyên màu ba mức dự báo của MH-23. Chú giải khi rê chuột: data-tip (tvp.js). Tọa độ SVG dựng ở service (dấu chấm thập phân). */
.tvp-dash { --tvp-dash-commit: var(--tvp-green-700); --tvp-dash-best_case: var(--tvp-green-300); --tvp-dash-pipeline: #d5dbd0;
  display: grid; gap: 1.5rem; }

/* Đầu trang */
.tvp-dash-dau { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.tvp-dash-dau > :first-child { flex: 1 1 20rem; min-width: 0; }
.tvp-dash-dau__tieu { margin: 0; font-size: 1.75rem; font-weight: 700; line-height: 1.25; letter-spacing: -0.01em; color: var(--tvp-ink); }
.tvp-dash-dau__mo { margin: 0.25rem 0 0; font-size: var(--tvp-text-base); color: var(--tvp-muted); }
.tvp-dash-dau__phai { margin-left: auto; }
.tvp-dash-ngay { display: inline-flex; align-items: center; gap: 0.5rem; min-height: var(--tvp-touch); padding: 0 1rem; border: 1px solid var(--tvp-border); border-radius: var(--tvp-radius);
  background: var(--tvp-surface); box-shadow: 0 1px 2px rgba(16, 40, 10, 0.04); color: var(--tvp-ink); font-size: var(--tvp-text-sm); font-weight: 600; font-variant-numeric: tabular-nums; }
.tvp-dash-ngay:hover { background: var(--tvp-green-50); }
.tvp-dash-ngay:focus-visible { outline: none; box-shadow: var(--tvp-focus); }
.tvp-dash-ngay > .bi { color: var(--tvp-ink-soft); }
.tvp-dash-ky { min-width: 21rem; max-width: calc(100vw - 2rem); padding: 0.75rem; border-color: var(--tvp-border); border-radius: var(--tvp-radius); box-shadow: var(--tvp-shadow-md); }
.tvp-dash-ky .tvp-pipebar { flex-direction: column; align-items: stretch; }
.tvp-dash-ky .tvp-pipebar > .tvp-seg { margin-left: 0; }
.tvp-dash-ky .tvp-seg a { flex: 1 1 0; justify-content: center; }

/* Ô số liệu đầu trang, một khuôn cho mọi màn (D-208): ô biểu tượng tròn 56 px bên trái, nhãn, số 28 px; chỉ Dashboard có dòng "↑ +x".
   Màu theo vị trí, không theo nội dung: 1 xanh dương, 2 xanh ngọc, 3 đỏ, 4 vàng đậm (Huy 12/11/2026 13:12). Họa tiết: biểu tượng của ô phóng to, mờ ở góc dưới phải (Huy chọn kiểu C 12/11/2026) */
.tvp-kpis--lon { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }   /* lưới 4 px (GD-41) */
.tvp-kpis--lon > .tvp-kpi { position: relative; display: block; min-height: 9rem; padding: 1.5rem 1.25rem 1.25rem; overflow: hidden; container-type: inline-size; }
.tvp-kpis--lon > .tvp-kpi:nth-child(4n + 1) { --k: var(--tvp-kpi-1); --k-chu: var(--tvp-kpi-1-chu); --k-bg: var(--tvp-kpi-1-bg); --k-bg2: var(--tvp-kpi-1-bg2); --k-border: var(--tvp-kpi-1-vien); }
.tvp-kpis--lon > .tvp-kpi:nth-child(4n + 2) { --k: var(--tvp-kpi-2); --k-chu: var(--tvp-kpi-2-chu); --k-bg: var(--tvp-kpi-2-bg); --k-bg2: var(--tvp-kpi-2-bg2); --k-border: var(--tvp-kpi-2-vien); }
.tvp-kpis--lon > .tvp-kpi:nth-child(4n + 3) { --k: var(--tvp-kpi-3); --k-chu: var(--tvp-kpi-3-chu); --k-bg: var(--tvp-kpi-3-bg); --k-bg2: var(--tvp-kpi-3-bg2); --k-border: var(--tvp-kpi-3-vien); }
.tvp-kpis--lon > .tvp-kpi:nth-child(4n + 4) { --k: var(--tvp-kpi-4); --k-chu: var(--tvp-kpi-4-chu); --k-bg: var(--tvp-kpi-4-bg); --k-bg2: var(--tvp-kpi-4-bg2); --k-border: var(--tvp-kpi-4-vien); }
.tvp-kpis--lon > .tvp-kpi { --k-fg: var(--k); background-image: linear-gradient(135deg, var(--k-bg) 0%, var(--k-bg2) 100%); }
.tvp-kpi__nen { position: absolute; right: -0.75rem; bottom: -1.5rem; font-size: 6.5rem; line-height: 1; color: var(--k); opacity: 0.1; transform: rotate(-12deg); pointer-events: none; }
@container (max-width: 16rem) { .tvp-kpi__nen { right: -0.5rem; bottom: -1rem; font-size: 4.25rem; } }   /* ô hẹp (2 cột điện thoại): hình mờ nhỏ lại */
@container (max-width: 9rem) { .tvp-kpi__nen { right: -0.375rem; bottom: -0.625rem; font-size: 2.75rem; } }   /* 3 ô một hàng trên điện thoại: không lấn chữ */
.tvp-kpi__ico { position: absolute; left: 1.25rem; top: 1.375rem; display: inline-flex; align-items: center; justify-content: center; width: 3.5rem; height: 3.5rem; border-radius: 50%;
  background: var(--k); color: #fff; font-size: 1.5rem; box-shadow: 0 6px 14px -6px var(--k); }
.tvp-kpi__chu { position: relative; z-index: 1; display: grid; justify-items: start; gap: 0.125rem; margin-left: 4.75rem; max-width: calc(100% - 4.75rem); }
.tvp-kpis--lon .tvp-kpi__label { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; max-width: 100%; overflow: hidden; font-size: var(--tvp-text-base); font-weight: 400; line-height: 1.35; color: var(--tvp-ink-soft); }   /* "Doanh thu tuần 02/11 – 08/11" xuống dòng, không cắt kỳ */
.tvp-kpis--lon .tvp-kpi__value { margin: 0.125rem 0 0.25rem; font-size: 1.75rem; letter-spacing: -0.01em; white-space: nowrap; }
.tvp-kpi__xu { display: inline-flex; align-items: center; gap: 0.25rem; min-height: 1.375rem; color: var(--k-chu); font-size: 0.9375rem; font-weight: 700; white-space: nowrap; }
.tvp-kpi__xu > .bi { font-size: 1rem; }
.tvp-kpi__xu--ghi { color: var(--tvp-muted); font-size: var(--tvp-text-xs); font-weight: 500; }

/* Lưới khối 12 cột: [7 | 5], [4 | 4 | 4], [4 | 4 | 4], [8 | 4] */
.tvp-dash-luoi { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 1.25rem; }
.tvp-dash-luoi > .c-4 { grid-column: span 4; } .tvp-dash-luoi > .c-5 { grid-column: span 5; } .tvp-dash-luoi > .c-7 { grid-column: span 7; } .tvp-dash-luoi > .c-8 { grid-column: span 8; }
.tvp-dash-luoi > .tvp-panel { display: flex; flex-direction: column; padding: 1.375rem 1.5rem; border-color: var(--tvp-border-soft); border-radius: var(--tvp-radius-lg); box-shadow: var(--tvp-shadow-soft); container-type: inline-size; }
.tvp-dash-luoi .tvp-panel__head { margin-bottom: 1.125rem; }
.tvp-dash-luoi .tvp-panel__title { display: flex; align-items: center; gap: 0.625rem; flex: 1 1 10rem; font-size: var(--tvp-text-lg); font-weight: 700; letter-spacing: -0.005em; }
.tvp-dash-luoi > .c-7 .tvp-panel__title, .tvp-dash-luoi > .c-5 .tvp-panel__title, .tvp-db .tvp-dash-luoi .tvp-panel__title { font-size: var(--tvp-text-xl); }
.tvp-dash-luoi .tvp-panel__title > .bi { flex: none; font-size: 1.25rem; color: var(--tvp-tint-la-fg); }
.tvp-dash-luoi .tvp-panel__title > .bi.is-vang { color: var(--tvp-tint-vang-icon); }
.tvp-dash-luoi .tvp-panel__link { flex: none; gap: 0.375rem; font-size: var(--tvp-text-sm); }
.tvp-dash-gon .tvp-panel__head { flex-wrap: nowrap; }   /* hàng 3: tiêu đề không xuống dòng */
.tvp-dash-gon .tvp-panel__title { flex: 1 1 auto; min-width: 0; white-space: nowrap; }
.tvp-dash-phu { margin: -0.5rem 0 0.75rem; font-size: var(--tvp-text-sm); color: var(--tvp-muted); }
.tvp-dash-phu b { color: var(--tvp-ink); font-weight: 600; }
.tvp-dash-tong { font-size: var(--tvp-text-sm); color: var(--tvp-muted); }
.tvp-dash-tong b { color: var(--tvp-ink); font-weight: 700; }
.tvp-dash-trong { margin: 0; color: var(--tvp-muted); }
.tvp-dash-xu { display: inline-flex; align-items: center; margin-left: 0.25rem; color: var(--tvp-tint-la-fg); font-size: var(--tvp-text-sm); font-weight: 700; vertical-align: middle; }

/* Doanh thu theo thời gian: đường cong vùng tô (thực tế), nét đứt mục tiêu từng tháng, điểm và ô chú giải ở tháng đang chạy;
   mỗi tháng một cột bấm sang MH-23 (chú giải khi rê chuột, focus) */
.tvp-dash-duong { display: grid; grid-template-columns: 4.5rem minmax(0, 1fr); flex: 1 1 auto; min-height: 15.5rem; max-height: 22rem; }
.tvp-dash-duong__truc { position: relative; margin-bottom: 1.75rem; font-size: var(--tvp-text-xs); color: var(--tvp-ink-soft); font-variant-numeric: tabular-nums; }
.tvp-dash-duong__truc span { position: absolute; right: 0.75rem; transform: translateY(50%); white-space: nowrap; }
.tvp-dash-duong__vung { position: relative; margin-bottom: 1.75rem; color: var(--tvp-tint-la-fg); }
.tvp-dash-duong__vung svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.tvp-dash-duong__luoi { stroke: var(--tvp-border-soft); stroke-width: 1; vector-effect: non-scaling-stroke; }
.tvp-dash-duong__muc { fill: none; stroke: #9aa695; stroke-width: 1.5; stroke-dasharray: 6 5; vector-effect: non-scaling-stroke; }
.tvp-dash-duong__net { fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.tvp-dash-duong__to { fill: url(#dashTo); }
.tvp-dash-duong__thang { position: absolute; inset: 0 0 -1.75rem; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); margin: 0; padding: 0; list-style: none; }
.tvp-dash-duong__thang li { display: flex; flex-direction: column; min-width: 0; }
.tvp-dash-duong__thang a { flex: 1 1 auto; border-radius: 4px; }
.tvp-dash-duong__thang a:hover { background: rgba(46, 125, 27, 0.06); }
.tvp-dash-duong__thang a:focus-visible { outline: none; box-shadow: var(--tvp-focus); }
.tvp-dash-duong__thang span { height: 1.75rem; line-height: 1.75rem; text-align: center; font-size: var(--tvp-text-xs); color: var(--tvp-ink-soft); }
.tvp-dash-duong__thang .is-nay span { color: var(--tvp-ink); font-weight: 700; }
.tvp-dash-duong__diem { position: absolute; z-index: 2; width: 0.75rem; height: 0.75rem; margin: -0.375rem 0 0 -0.375rem; border: 3px solid currentColor; border-radius: 50%;
  background: var(--tvp-surface); box-shadow: 0 0 0 4px rgba(46, 125, 27, 0.15); pointer-events: none; }
.tvp-dash-duong__nhan { position: absolute; z-index: 2; transform: translate(calc(-100% + 1.25rem), calc(-100% - 0.875rem)); padding: 0.5rem 0.75rem;   /* neo bên trái điểm: tháng cuối năm không thò ra mép phải */
  border: 1px solid var(--tvp-border-soft); border-radius: 0.625rem; background: var(--tvp-surface); box-shadow: 0 6px 18px rgba(16, 40, 10, 0.12);
  font-size: var(--tvp-text-xs); color: var(--tvp-ink-soft); white-space: nowrap; pointer-events: none; }
.tvp-dash-duong__nhan.is-phai { transform: translate(-1.25rem, calc(-100% - 0.875rem)); }   /* T1–T3: neo bên phải điểm */
.tvp-dash-duong__nhan.is-duoi { transform: translate(calc(-100% + 1.25rem), 0.875rem); }    /* điểm sát trần: ô chú giải dưới điểm */
.tvp-dash-duong__nhan.is-phai.is-duoi { transform: translate(-1.25rem, 0.875rem); }
.tvp-dash-duong__nhan b { display: flex; align-items: center; gap: 0.375rem; color: var(--tvp-ink); font-size: 0.9375rem; }
.tvp-dash-duong__nhan b::before { content: ""; width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--tvp-tint-la-fg); }
.tvp-dash-duong__chan { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1rem; margin-top: 0.75rem; font-size: var(--tvp-text-sm); color: var(--tvp-muted); }
.tvp-dash-duong__chan p { margin: 0; }
.tvp-dash-duong__chan b { color: var(--tvp-ink); font-weight: 600; }
.tvp-dash-chu { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; margin: 0; padding: 0; list-style: none; font-size: var(--tvp-text-xs); color: var(--tvp-ink-soft); }
.tvp-dash-chu li { display: inline-flex; align-items: center; gap: 0.5rem; }
.tvp-dash-chu__net { width: 1.25rem; border-top: 3px solid var(--tvp-tint-la-fg); border-radius: 2px; }
.tvp-dash-chu__muc { width: 1.25rem; border-top: 2px dashed #9aa695; }

/* Phễu cơ hội: tầng hình thang bề rộng cố định như bản mẫu (không theo số), màu bước chung; chú thích "Tên (số · giá trị)" bên phải.
   Hình thang cắt ở ::before để viền focus của liên kết (hình chữ nhật) vẫn hiện */
.tvp-dash-pheu { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); align-items: center; gap: 1.5rem; flex: 1 1 auto; }
.tvp-dash-pheu__hinh { display: grid; gap: 0.25rem; width: 100%; max-width: 24rem; margin: 0 auto; }
.tvp-dash-pheu__tang { --cat: 8.5%; --nen: var(--tvp-stage-1-fill); position: relative; display: block; width: 100%; height: 3.25rem; margin: 0 auto; border-radius: 2px; }
.tvp-dash-pheu__tang::before { content: ""; position: absolute; inset: 0; background: var(--nen); clip-path: polygon(0 0, 100% 0, calc(100% - var(--cat)) 100%, var(--cat) 100%); transition: filter .15s; }
.tvp-dash-pheu__tang:hover::before { filter: brightness(1.08); }
.tvp-dash-pheu__tang:focus-visible { outline: none; box-shadow: var(--tvp-focus); }
.tvp-dash-pheu__tang.is-2 { --cat: 10.2%; --nen: var(--tvp-stage-2-fill); width: 83%; }
.tvp-dash-pheu__tang.is-3 { --cat: 12.1%; --nen: var(--tvp-stage-3-fill); width: 66%; }
.tvp-dash-pheu__tang.is-4 { --cat: 14%; --nen: var(--tvp-stage-4-fill); width: 50%; }
.tvp-dash-pheu__tang.is-5 { --cat: 16.7%; --nen: var(--tvp-stage-5-fill); width: 36%; }
.tvp-dash-pheu__ds { display: grid; gap: 1.125rem; margin: 0; padding: 0; list-style: none; }
.tvp-dash-pheu__ds li { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 0 0.75rem; font-size: var(--tvp-text-base); color: var(--tvp-ink); }
.tvp-dash-pheu__ds small { grid-column: 2; font-size: var(--tvp-text-sm); color: var(--tvp-ink-soft); }
.tvp-dash-cham { flex: none; width: 0.75rem; height: 0.75rem; border-radius: 50%; }
.tvp-dash-cham.is-1 { background: var(--tvp-stage-1-fill); } .tvp-dash-cham.is-2 { background: var(--tvp-stage-2-fill); } .tvp-dash-cham.is-3 { background: var(--tvp-stage-3-fill); }
.tvp-dash-cham.is-4 { background: var(--tvp-stage-4-fill); } .tvp-dash-cham.is-5 { background: var(--tvp-stage-5-fill); }
.tvp-dash-cham.is-commit { background: var(--tvp-dash-commit); } .tvp-dash-cham.is-best_case { background: var(--tvp-dash-best_case); } .tvp-dash-cham.is-pipeline { background: var(--tvp-dash-pipeline); }
@container (max-width: 20rem) { .tvp-dash-pheu { grid-template-columns: minmax(0, 1fr); } }

/* Danh sách dòng (Hoạt động gần đây, Công việc sắp tới, Khách mới tạo, Cần chú ý, Pipeline theo sale, Bán chạy): cả dòng bấm được */
.tvp-dash-ds { display: grid; margin: 0; padding: 0; list-style: none; }
.tvp-dash-ds > li + li { border-top: 1px solid var(--tvp-border-soft); }
.tvp-dash-ds > .tvp-dash-ds__nhom, .tvp-dash-ds > li + .tvp-dash-ds__nhom { display: flex; justify-content: space-between; gap: 0.5rem; padding: 0.625rem 0 0.25rem; border-top: 0;
  font-size: var(--tvp-text-sm); font-weight: 600; color: var(--tvp-ink); }   /* D-179 (V1) */
.tvp-dash-ds > .tvp-dash-ds__nhom:first-child { padding-top: 0; }
.tvp-dash-ds__nhom span { font-weight: 500; color: var(--tvp-muted); }
.tvp-db .tvp-dash-ds > .tvp-dash-ds__nhom { margin: 0.75rem 0 0.25rem; padding: 0.625rem 0.75rem; border: 1px solid var(--tvp-border-soft); border-radius: 0.5rem; background: var(--tvp-green-50); }   /* đầu nhóm tháng trang Dự báo (D-152) */
.tvp-dash-ds a, .tvp-dash-ds__dong { display: flex; align-items: center; gap: 0.75rem; min-height: 3.5rem; margin: 0 -0.5rem; padding: 0.5rem; border-radius: 0.625rem;
  color: var(--tvp-ink); font-size: var(--tvp-text-sm); text-decoration: none; }
.tvp-dash-ds a:hover { background: var(--tvp-green-50); color: var(--tvp-ink); }
.tvp-dash-ds a:focus-visible { outline: none; box-shadow: var(--tvp-focus); }
.tvp-dash-ds__ten { flex: 1 1 auto; min-width: 0; line-height: 1.35; }
.tvp-dash-ds__ten small { display: block; font-size: var(--tvp-text-xs); color: var(--tvp-muted); }
.tvp-dash-ds__ico, .tvp-dash-ds__hang { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 2.25rem; height: 2.25rem; border-radius: 50%;
  background: var(--tvp-tint-la-ico); color: var(--tvp-tint-la-fg); font-size: 1rem; }
.tvp-dash-ds__ico.is-buoi { background: var(--tvp-tint-ngoc-ico); color: var(--tvp-tint-ngoc-fg); }
.tvp-dash-ds__ico.is-lui { background: var(--tvp-tint-reu-ico); color: var(--tvp-tint-reu-fg); }
.tvp-dash-ds__ico.is-thang { background: var(--tvp-tint-ma-ico); color: var(--tvp-tint-ma-fg); }
.tvp-dash-ds__ico.is-vang { background: var(--tvp-tint-vang-ico); color: var(--tvp-tint-vang-fg); }
.tvp-dash-ds__ico.is-do, .tvp-dash-ds__ico.is-thua { background: var(--tvp-tint-do-ico); color: var(--tvp-tint-do-fg); }
.tvp-dash-ds__hang { background: var(--tvp-green-100); color: var(--tvp-green-700); font-size: var(--tvp-text-sm); font-weight: 700; }
.tvp-dash-ds__o { flex: none; width: 1.375rem; height: 1.375rem; border: 2px solid #c9d1c5; border-radius: 50%; }
.tvp-dash-ds__logo { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 2.25rem; height: 2.25rem; border-radius: 0.625rem;
  background: var(--tvp-tint-la-ico); color: var(--tvp-green-900); font-size: 0.75rem; font-weight: 800; }   /* chữ 12 px trên nền -ico: xanh đậm (≥ 7 : 1), -fg chỉ đạt 4,0 */
.tvp-dash-ds__logo.is-2 { background: var(--tvp-tint-ngoc-ico); } .tvp-dash-ds__logo.is-3 { background: var(--tvp-tint-ma-ico); }
.tvp-dash-ds__logo.is-4 { background: var(--tvp-tint-reu-ico); }
.tvp-dash-ds__nganh { flex: none; max-width: 6.25rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--tvp-text-xs); color: var(--tvp-ink-soft); }
.tvp-dash-ds__phai { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 0.25rem; font-size: var(--tvp-text-xs); }   /* nhãn trên, hạn dưới: chừa chỗ cho tên khách (D-150 (2)) */
.tvp-dash-ds__phai b { font-weight: 500; color: var(--tvp-ink); }
.tvp-dash-ds > li.tvp-dash-ds__ghi { padding-bottom: 0.375rem; border-top: 0; font-size: var(--tvp-text-xs); color: var(--tvp-muted); }
.tvp-dash-hien { margin-left: 0.125rem; font-size: var(--tvp-text-sm); font-weight: 500; color: var(--tvp-muted); }   /* khối không theo kỳ khi xem kỳ khác (D-150 (5)) */
.tvp-dash-luoi .tvp-panel__title:has(.tvp-dash-hien) { flex: none; white-space: nowrap; }   /* tiêu đề giữ một dòng, chữ bên cạnh xuống hàng nếu thiếu chỗ */
.tvp-dash-ds__tg { flex: none; min-width: 4.75rem; text-align: right; font-size: var(--tvp-text-xs); line-height: 1.35; color: var(--tvp-muted); }
.tvp-dash-ds__tg b { display: block; font-weight: 500; color: var(--tvp-ink); }
.tvp-dash-ds__so { min-width: 2rem; text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }  /* "22 ngày" không gãy dòng trên điện thoại (MH-38) */
.tvp-dash-ds__so.is-do { color: var(--tvp-danger); }
/* MH-38 khối "Sale đã liên hệ khách chưa" (US-77-AC5, D-209): mỗi sale một dòng, thanh đã liên hệ */
.tvp-panel__thang { font-size: var(--tvp-text-sm); color: var(--tvp-muted); white-space: nowrap; }
.tvp-lh { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; }
.tvp-lh > li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0.75rem; align-items: center; }
.tvp-lh__dau { display: flex; justify-content: space-between; align-items: baseline; gap: 0.75rem; margin-bottom: 0.375rem; }
.tvp-lh__dau > span { white-space: nowrap; font-size: var(--tvp-text-xs); color: var(--tvp-muted); }
.tvp-lh__dau > span b { font-size: var(--tvp-text-lg); color: var(--tvp-ink); font-variant-numeric: tabular-nums; }
.tvp-lh__thanh { height: 0.625rem; border-radius: 999px; overflow: hidden; background: var(--tvp-bg); }
.tvp-lh__thanh > span { display: block; height: 100%; background: var(--tvp-green-700); }
.tvp-lh__phu { margin-top: 0.375rem; font-size: var(--tvp-text-xs); color: var(--tvp-muted); }
.tvp-lh__phu b { color: var(--tvp-ink); }
.tvp-lh__phu .is-do { color: var(--tvp-danger); font-weight: 700; }
.tvp-dash-ds__gt { min-width: 5rem; text-align: right; font-size: var(--tvp-text-xs); color: var(--tvp-muted); white-space: nowrap; }
.tvp-dash-ds__gt b { display: block; font-size: var(--tvp-text-sm); font-weight: 600; color: var(--tvp-ink); font-variant-numeric: tabular-nums; }
.tvp-dash-nhan { flex: none; display: inline-flex; align-items: center; padding: 0.1875rem 0.625rem; border-radius: var(--tvp-radius-sm); background: var(--tvp-bg);
  font-size: var(--tvp-text-xs); font-weight: 600; white-space: nowrap; color: var(--tvp-ink-soft); }
.tvp-dash-nhan.is-qua_han { background: var(--tvp-tint-do-ico); color: var(--tvp-danger-emph); }
.tvp-dash-nhan.is-hom_nay { background: var(--tvp-tint-vang-ico); color: var(--tvp-warn); }
.tvp-dash-nhan.is-trong_tuan { background: var(--tvp-tint-la-ico); color: var(--tvp-green-900); }
.tvp-dash-ai { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 2.25rem; height: 2.25rem; border-radius: 50%;
  background: var(--tvp-green-150); color: var(--tvp-green-900); font-size: 0.75rem; font-weight: 700; }   /* một màu cho mọi người (D-142 (5)) */
.tvp-dash-ai--sm { width: 1.875rem; height: 1.875rem; font-size: 0.6875rem; }
.tvp-dash-nguoi { display: inline-flex; align-items: center; gap: 0.625rem; white-space: nowrap; }
@container (max-width: 19rem) { .tvp-dash-ds__nganh { display: none; } }

/* Dự báo trong kỳ: vành khuyên màu ba mức như MH-23; chân: Tỷ lệ chốt có mũi tên so kỳ trước */
.tvp-dash-vanh { display: flex; align-items: center; gap: 1.5rem; margin-bottom: 1.25rem; }
.tvp-dash-vanh__hinh { position: relative; flex: none; width: 9.5rem; aspect-ratio: 1; border-radius: 50%; }
.tvp-dash-vanh__hinh > span { position: absolute; inset: 19%; display: flex; flex-direction: column; align-items: center; justify-content: center; border-radius: 50%;
  background: var(--tvp-surface); font-size: var(--tvp-text-xs); color: var(--tvp-muted); text-align: center; }
.tvp-dash-vanh__hinh b { font-size: var(--tvp-text-xl); color: var(--tvp-ink); font-weight: 700; line-height: 1.3; }
.tvp-dash-vanh__chu { flex: 1 1 auto; display: grid; gap: 0.25rem; min-width: 0; margin: 0; padding: 0; list-style: none; }
.tvp-dash-vanh__chu a { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 0 0.625rem; min-height: 2.75rem; padding: 0.25rem 0.375rem;
  border-radius: 0.5rem; color: var(--tvp-ink); font-size: var(--tvp-text-sm); text-decoration: none; }
.tvp-dash-vanh__chu a:hover { background: var(--tvp-green-50); }
.tvp-dash-vanh__chu a:focus-visible { outline: none; box-shadow: var(--tvp-focus); }
.tvp-dash-vanh__chu b { font-weight: 700; font-variant-numeric: tabular-nums; }
.tvp-dash-vanh__chu small { grid-column: 2 / -1; font-size: var(--tvp-text-xs); color: var(--tvp-muted); }
@container (max-width: 24rem) { .tvp-dash-vanh { flex-direction: column; gap: 0.75rem; } .tvp-dash-vanh__hinh { width: 8.5rem; } .tvp-dash-vanh__chu { width: 100%; } }
.tvp-dash-chan { display: flex; align-items: center; gap: 0.75rem; margin-top: auto; padding: 0.75rem 0.875rem; border-radius: var(--tvp-radius); background: var(--tvp-green-50);
  color: var(--tvp-ink); text-decoration: none; }
.tvp-dash-trong + .tvp-dash-chan { margin-top: 1.25rem; }
.tvp-dash-chan:hover { background: var(--tvp-green-100); color: var(--tvp-ink); }
.tvp-dash-chan:focus-visible { outline: none; box-shadow: var(--tvp-focus); }
.tvp-dash-chan > .bi { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 2.25rem; height: 2.25rem; border-radius: 50%;
  background: var(--tvp-tint-ngoc-ico); color: var(--tvp-tint-ngoc-fg); }
.tvp-dash-chan > span { display: flex; flex-wrap: wrap; align-items: center; gap: 0 0.5rem; }
.tvp-dash-chan__ten { flex-basis: 100%; font-size: var(--tvp-text-xs); font-weight: 500; color: var(--tvp-muted); }
.tvp-dash-chan b { font-weight: 700; }
.tvp-dash-chan .tvp-dash-xu { margin-left: 0; color: var(--tvp-green-700); }   /* đủ 4,5 : 1 cả trên nền khi rê chuột (green-100) */
.tvp-dash-chan small { font-size: var(--tvp-text-xs); color: var(--tvp-muted); }

/* Bảng 5 cơ hội lớn nhất: đầu bảng nền nhạt, dòng cao, số căn phải */
.tvp-dash-bang { width: 100%; border-collapse: separate; border-spacing: 0; font-size: var(--tvp-text-sm); }
.tvp-dash-bang th { padding: 0.75rem 0.625rem; border-bottom: 1px solid var(--tvp-border-soft); background: var(--tvp-bg); font-size: var(--tvp-text-xs); font-weight: 600; color: var(--tvp-ink-soft); text-align: left; white-space: nowrap; }
.tvp-dash-bang th:first-child { border-radius: 0.625rem 0 0 0; } .tvp-dash-bang th:last-child { border-radius: 0 0.625rem 0 0; }
.tvp-dash-bang td { padding: 0.875rem 0.625rem; border-bottom: 1px solid var(--tvp-border-soft); vertical-align: middle; }
.tvp-dash-bang tbody tr:last-child td { border-bottom: 0; }
.tvp-dash-bang tbody tr:hover td { background: var(--tvp-green-50); }
.tvp-dash-bang td:first-child a { font-weight: 700; text-decoration: none; white-space: nowrap; }
.tvp-dash-bang td:first-child a:hover { text-decoration: underline; }
.tvp-dash-bang td:first-child > span { display: block; font-size: var(--tvp-text-xs); color: var(--tvp-muted); }
.tvp-dash-bang .is-so { text-align: right; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tvp-dash-bang .tvp-chip, .tvp-dash-bang .tvp-stage { white-space: nowrap; }

@media (max-width: 1359.98px) { .tvp-kpis--lon { grid-template-columns: repeat(2, minmax(0, 1fr)); } }   /* 4 thẻ một hàng từ 1360 px để laptop 1366 không thành 2 hàng (D-241 (7)) */
@media (min-width: 1360px) and (max-width: 1399.98px) { .tvp-dash:not(.tvp-hn) .tvp-kpis--lon { grid-template-columns: repeat(2, minmax(0, 1fr)); } }   /* Dashboard (làm lại ở C4): thẻ có mũi tên, đường nhỏ cần rộng hơn */
@media (min-width: 1200px) and (max-width: 1399.98px) {   /* trang Dự báo: khối 4 phần quá hẹp, tab Sản phẩm bị cắt, giữ tỉ lệ 5 và 7 */
  .tvp-db .tvp-dash-luoi > .c-4 { grid-column: span 5; } .tvp-db .tvp-dash-luoi > .c-8 { grid-column: span 7; }
}
@media (max-width: 1199.98px) {
  .tvp-dash-luoi > .c-4 { grid-column: span 6; }
  .tvp-dash-luoi > .c-5, .tvp-dash-luoi > .c-7, .tvp-dash-luoi > .c-8, .tvp-dash-luoi > .c-8 + .c-4, .tvp-db .tvp-dash-luoi > .c-4 { grid-column: span 12; }
}
@media (max-width: 767.98px) {
  .tvp-dash { gap: 1.125rem; }
  .tvp-dash-dau__tieu { font-size: 1.375rem; }
  .tvp-dash-dau__mo { font-size: var(--tvp-text-sm); }
  .tvp-dash-luoi > .c-4 { grid-column: span 12; }
  .tvp-dash-luoi > .tvp-panel { padding: 1.125rem 1rem; }
  .tvp-dash-duong { grid-template-columns: 4rem minmax(0, 1fr); }
  .tvp-dash-duong__truc span { right: 0.5rem; }
  .tvp-dash-duong__thang li:nth-child(even) span { visibility: hidden; }
  .tvp-dash-bang thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .tvp-dash-bang tbody { display: block; }
  .tvp-dash-bang tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.375rem 0.5rem; padding: 0.75rem 0; border-top: 1px solid var(--tvp-border-soft); }
  .tvp-dash-bang tbody tr:first-child { border-top: 0; padding-top: 0; }
  .tvp-dash-bang td { display: flex; flex-wrap: wrap; align-items: center; gap: 0.375rem; padding: 0; border: 0; }
  .tvp-dash-bang td:first-child { display: block; }
  .tvp-dash-bang td.is-so { display: block; grid-column: 2; grid-row: 1; }
  .tvp-dash-bang td:nth-child(n+2):not(.is-so) { grid-column: 1 / -1; }
  .tvp-dash-bang tbody tr:hover td { background: none; }
}
@media (max-width: 575.98px) {
  .tvp-dash-dau__phai { margin-left: 0; }
  .tvp-kpis--lon { grid-template-columns: minmax(0, 1fr); gap: 0.75rem; }
  .tvp-kpis--lon > .tvp-kpi { min-height: 7.5rem; padding: 1rem; }
  .tvp-kpis--lon .tvp-kpi__ico { left: 1rem; top: 1rem; }
  .tvp-kpis--lon .tvp-kpi__value { font-size: 1.5rem; }
  .tvp-dash-duong__thang a { pointer-events: none; }   /* cột tháng hẹp hơn 24 px: chỉ là hình, số đọc ở MH-23 (L-10) */
}

/* Chú giải nổi */
.tvp-tip { position: fixed; z-index: 1080; max-width: 16rem; padding: 0.375rem 0.625rem; border-radius: 6px; background: var(--tvp-ink); color: var(--tvp-surface); font-size: var(--tvp-text-xs); line-height: 1.4; pointer-events: none; box-shadow: var(--tvp-shadow-md); }

/* ==========================================================================
   5.36 Hôm nay MH-02, MH-03 (US-45, US-46): bản mẫu design-system/sale-b2b/ban-mau-hom-nay/v5/ (Huy duyệt 07/11/2026, D-151).
   Dùng thẻ, khối, danh sách của Dashboard (5.35); ở đây chỉ phần riêng: tab Cả phòng / Của tôi, cột nhiều khối, dòng việc có nút
   hoàn thành và nút Ghi buổi làm việc, thẻ 2×2 trên điện thoại
   ========================================================================== */
.tvp-hn-tab { justify-self: start; width: fit-content; }
.tvp-hn-tab a { white-space: nowrap; }
.tvp-hn-cot { display: grid; gap: 1.25rem; align-content: start; }
.tvp-hn-cot > .tvp-panel { display: flex; flex-direction: column; padding: 1.375rem 1.5rem; border-color: var(--tvp-border-soft); border-radius: var(--tvp-radius-lg); box-shadow: var(--tvp-shadow-soft); }

/* Dòng việc: [vòng tròn hoàn thành] [tên, khách, ngày: bấm sang cơ hội] [nút Ghi buổi làm việc]; ô Kết quả mở bên dưới */
.tvp-hn-viec__dong { display: flex; align-items: center; gap: 0.5rem; }
.tvp-hn-viec__o { flex: none; width: 1.375rem; height: 1.375rem; padding: 0; border: 2px solid var(--tvp-muted); border-radius: 50%; background: var(--tvp-surface); position: relative; }   /* viền màu chữ phụ: tương phản ≥ 3:1 với nền trắng (WCAG 1.4.11) */
.tvp-hn-viec__o::before { content: ""; position: absolute; inset: -0.6875rem; }   /* vùng bấm 44 px */
.tvp-hn-viec__o:hover, .tvp-hn-viec__o[aria-expanded="true"] { border-color: var(--tvp-green-700); background: var(--tvp-green-50); }
.tvp-hn-viec__o:focus-visible { outline: none; box-shadow: var(--tvp-focus); }
.tvp-dash-ds .tvp-hn-viec__mo { flex: 1 1 auto; min-width: 0; margin: 0; }
.tvp-dash-ds a.tvp-hn-ghi { flex: none; display: inline-grid; place-items: center; width: 2.25rem; min-height: 2.25rem; margin: 0; padding: 0;
  border: 1px solid var(--tvp-border-soft); border-radius: var(--tvp-radius-sm); color: var(--tvp-ink-soft); background: var(--tvp-surface); }
.tvp-dash-ds a.tvp-hn-ghi:hover { color: var(--tvp-green-700); border-color: var(--tvp-green-700); background: var(--tvp-surface); }
.tvp-hn-viec > .tvp-done-form { margin: 0 0 0.75rem 1.875rem; }

@media (max-width: 575.98px) {   /* điện thoại: 4 thẻ 2×2 gọn, bỏ ô biểu tượng (Dashboard giữ 1 cột vì có đường xu hướng) */
  .tvp-hn .tvp-kpis--lon { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.5rem; }
  .tvp-hn .tvp-kpis--lon > .tvp-kpi { min-height: 0; padding: 0.75rem; }
  .tvp-hn .tvp-kpis--lon .tvp-kpi__ico { display: none; }
  .tvp-hn .tvp-kpis--lon .tvp-kpi__chu { margin-left: 0; max-width: none; padding-bottom: 0; }
  .tvp-hn .tvp-kpis--lon .tvp-kpi__label { font-size: 0.8125rem; }
  .tvp-hn .tvp-kpis--lon .tvp-kpi__value { font-size: 1.375rem; }
  .tvp-hn .tvp-kpis--lon .tvp-kpi__xu--ghi { white-space: normal; font-size: 0.75rem; }
  .tvp-hn-cot > .tvp-panel { padding: 1.125rem 1rem; }
  .tvp-hn-tab { width: 100%; }
  .tvp-hn-viec .tvp-dash-ds__tg { min-width: 0; }   /* tên việc rộng hơn trên điện thoại */
}
/* Danh sách kiểu Hôm nay mà mỗi dòng một hàng, chữ dài thì "…" (thẻ con có title): MH-39 Kết quả tìm (US-78), khối Khách đến kỳ đặt lại
   (US-70) (D-230, không xuống hai hàng) */
.tvp-ds-gon { grid-template-columns: minmax(0, 1fr); }
.tvp-ds-gon .tvp-dash-ds__ten > * { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tvp-ds-gon .tvp-dash-ds__tg { min-width: 0; white-space: nowrap; }
.tvp-ds-gon .tvp-panel__link { flex: none; white-space: nowrap; }   /* "Tạo cơ hội" của Có thể bán thêm (US-74) */
.tvp-tim__o { display: flex; margin-bottom: 1rem; }
@media (min-width: 992px) { .tvp-tim__o { display: none; } }

/* ===== MH-30 Trợ lý TVP (US-51; bản mẫu v2 Huy duyệt 08/11/2026): nút nổi viên thuôn, khung nổi bo 24 px, bong bóng chat ===== */
.ai-fab { position: fixed; right: 1.5rem; bottom: 1.5rem; z-index: 1040; display: flex; align-items: center; justify-content: center; width: 3.5rem; height: 3.5rem; padding: 0; border: 0; border-radius: 999px; background: linear-gradient(135deg, var(--tvp-nav-active), var(--tvp-green-700)); color: #fff; font: 600 0.95rem/1 var(--tvp-font); box-shadow: 0 10px 28px rgba(15, 69, 5, 0.28); }
.ai-fab i { font-size: 1.35rem; }   /* D-174 (F1): máy tính cũng là nút tròn chỉ biểu tượng; chữ "Trợ lý TVP" chỉ cho trình đọc màn hình */
.ai-fab:hover { filter: brightness(1.06); color: #fff; }
.ai-fab:focus-visible { outline: 3px solid var(--tvp-yellow); outline-offset: 2px; }
.ai-fab { transition: transform 0.2s, opacity 0.2s; }
.ai-fab--an { transform: translateY(5rem); opacity: 0; pointer-events: none; }   /* N-4: đang cuộn xuống đọc bảng, nút lánh đi */
@media (prefers-reduced-motion: reduce) { .ai-fab { transition: none; } }
.ai-fab--mo { right: 29rem; }  /* khung đang mở: nút thu thành tròn, nằm sát mép trái khung, bấm lại thì đóng (AC1) */
/* D-158 (1): trang có nút nổi thì chừa khoảng trống cuối trang để nút không che dòng cuối danh sách (nút cao 3,5 rem, cách đáy 1,5 rem) */
body:has(#ai-fab) .tvp-main { padding-bottom: 6.5rem; }
.ai-panel { position: fixed; top: 1rem; right: 1rem; bottom: 1rem; z-index: 1050; display: flex; flex-direction: column; width: 27rem; max-width: calc(100vw - 2rem); overflow: hidden; background: var(--tvp-surface); border-radius: 1.5rem; box-shadow: 0 24px 64px rgba(15, 69, 5, 0.22), 0 0 0 1px rgba(15, 69, 5, 0.06); font-size: var(--tvp-text-sm); }
.ai-panel[hidden] { display: none; }
.ai-head { display: flex; align-items: center; gap: 0.5rem; padding: 0.9rem 1rem 0.9rem 1.1rem; background: linear-gradient(180deg, var(--tvp-green-50), var(--tvp-surface)); }
.ai-head h2 { display: flex; align-items: center; gap: 0.6rem; margin: 0; font-size: 1rem; font-weight: 700; color: var(--tvp-green-900); white-space: nowrap; }
.ai-logo { display: inline-flex; align-items: center; justify-content: center; width: 2.1rem; height: 2.1rem; border-radius: 50%; background: linear-gradient(135deg, var(--tvp-nav-active), var(--tvp-green-700)); color: #fff; font-size: 1.05rem; box-shadow: 0 4px 12px rgba(15, 69, 5, 0.25); }
.ai-luot { display: block; margin-top: 0.1rem; color: var(--tvp-muted); font-size: 0.72rem; font-weight: 400; }
.ai-sp { flex: 1; }
.ai-icon { display: inline-flex; align-items: center; justify-content: center; width: 2.25rem; height: 2.25rem; border: 0; border-radius: 50%; background: transparent; color: var(--tvp-ink-soft); font-size: 1.05rem; }
.ai-icon:hover { background: var(--tvp-green-100); }
.ai-body { position: relative; display: flex; flex: 1; flex-direction: column; gap: 1rem; padding: 0.5rem 1.1rem 1rem; overflow: auto; }
.ai-q { align-self: flex-end; max-width: 85%; padding: 0.65rem 1rem; border-radius: 1.25rem 1.25rem 0.35rem 1.25rem; background: var(--tvp-green-700); color: #fff; white-space: pre-wrap; overflow-wrap: anywhere; }
.ai-a { max-width: 100%; padding: 0.85rem 1rem; border-radius: 1.25rem 1.25rem 1.25rem 0.35rem; background: var(--tvp-bg); line-height: 1.55; overflow-wrap: anywhere; }
.ai-a p { margin: 0 0 0.5rem; }
.ai-a p:last-child, .ai-a ul:last-child, .ai-a ol:last-child { margin-bottom: 0; }
.ai-a ul, .ai-a ol { margin: 0 0 0.5rem; padding-left: 1.1rem; }
.ai-a li { margin-bottom: 0.15rem; }
.ai-a a { color: var(--tvp-green-700); font-weight: 500; }
.ai-a h4 { margin: 0.85rem 0 0.3rem; font-size: var(--tvp-text-sm); font-weight: 700; color: var(--tvp-green-900); }
.ai-a h4:first-child { margin-top: 0; }
.ai-a code { font-size: 0.85em; color: var(--tvp-ink); }
.ai-bang { margin: 0.25rem 0 0.5rem; font-size: var(--tvp-text-xs); }
.ai-bang th, .ai-bang td { padding: 0.25rem 0.4rem; }
.ai-src { display: flex; align-items: center; gap: 0.35rem; margin-top: 0.6rem; color: var(--tvp-muted); font-size: 0.72rem; }
.ai-steps { margin: 0.25rem 0 0.5rem; }
.ai-step { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.4rem; padding: 0.6rem 0.5rem 0.6rem 0.8rem; border-radius: 1rem; background: var(--tvp-surface); box-shadow: 0 1px 2px rgba(16, 40, 10, 0.04), 0 4px 14px rgba(16, 40, 10, 0.05); }
.ai-step__n { flex: 1; }
.ai-step__n small { display: block; color: var(--tvp-muted); }
.ai-step .btn { padding: 0.3rem 0.8rem; border-radius: 999px; font-size: 0.8rem; white-space: nowrap; }
.ai-ext { margin: 0.6rem 0; padding: 0.6rem 0.85rem; border-radius: 1rem; background: var(--tvp-warn-tint); }
.ai-foot { padding: 0.5rem 1rem calc(0.9rem + env(safe-area-inset-bottom)); }
.ai-foot__box { display: flex; align-items: flex-end; gap: 0.5rem; padding: 0.4rem 0.4rem 0.4rem 1rem; border: 1px solid var(--tvp-border); border-radius: 1.5rem; background: var(--tvp-surface); box-shadow: 0 2px 10px rgba(16, 40, 10, 0.05); }
.ai-foot__box:focus-within { border-color: var(--tvp-green-700); box-shadow: 0 0 0 3px rgba(24, 98, 7, 0.12); }  /* Huy 08/11: bỏ viền vàng, chỉ viền xanh nhẹ */
.ai-foot textarea { flex: 1; min-height: 2.6rem; max-height: 8rem; padding-top: 0.6rem; border: 0; outline: 0; background: transparent; font: inherit; resize: none; }
.ai-foot textarea:focus, .ai-foot textarea:focus-visible { outline: none; box-shadow: none; }  /* vòng focus chung của site chuyển lên khung ngoài (focus-within) */
.ai-foot textarea:disabled { color: var(--tvp-muted); }
.ai-send { width: 2.6rem; height: 2.6rem; flex: 0 0 auto; border: 0; border-radius: 50%; background: var(--tvp-green-700); color: #fff; font-size: 1.05rem; }
.ai-send:hover { background: var(--tvp-green-800); }
.ai-send:disabled { background: var(--tvp-green-200); }
.ai-hint { margin: 0.4rem 0.5rem 0; color: var(--tvp-muted); font-size: 0.7rem; text-align: center; }
.ai-hint__luot { display: none; }
.ai-empty { display: flex; flex-direction: column; gap: 0.5rem; margin: auto 0; }
.ai-empty__hi { margin-bottom: 0.75rem; text-align: center; }
.ai-empty__hi .ai-logo { width: 3.25rem; height: 3.25rem; margin-bottom: 0.6rem; font-size: 1.6rem; }
.ai-empty__hi b { display: block; font-size: 1.05rem; color: var(--tvp-green-900); }
.ai-empty__hi p { margin: 0.25rem 0 0; color: var(--tvp-muted); }
.ai-chip { padding: 0.7rem 0.95rem; border: 1px solid var(--tvp-border); border-radius: 1rem; background: var(--tvp-surface); color: var(--tvp-ink); font: inherit; text-align: left; }
.ai-chip:hover { border-color: var(--tvp-green-300); background: var(--tvp-green-50); }
.ai-chip i { margin-right: 0.45rem; color: var(--tvp-green-700); }
.ai-think { display: flex; align-items: center; gap: 0.5rem; align-self: flex-start; padding: 0.65rem 1rem; border-radius: 1.25rem 1.25rem 1.25rem 0.35rem; background: var(--tvp-bg); color: var(--tvp-muted); font-size: 0.8rem; }
.ai-dot { width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--tvp-green-300); animation: ai-nhip 1s ease-in-out infinite; }
@keyframes ai-nhip { 0%, 100% { opacity: 0.4; } 50% { opacity: 1; } }
.ai-err { display: flex; align-items: center; gap: 0.75rem; padding: 0.7rem 0.9rem; border-radius: 1.25rem 1.25rem 1.25rem 0.35rem; background: var(--tvp-danger-tint); color: var(--tvp-danger-emph); }
.ai-err--nhe { background: var(--tvp-warn-tint); color: var(--tvp-warn); }
.ai-err .btn { padding: 0.3rem 0.8rem; border-radius: 999px; font-size: 0.8rem; white-space: nowrap; }
.ai-list { position: absolute; top: 3.9rem; right: 0.75rem; left: 0.75rem; z-index: 2; max-height: 60%; overflow: auto; padding: 0.5rem; border-radius: 1.25rem; background: var(--tvp-surface); box-shadow: 0 16px 40px rgba(16, 40, 10, 0.16); }
.ai-list[hidden] { display: none; }
.ai-list a { display: block; padding: 0.55rem 0.85rem; border-radius: 0.9rem; color: var(--tvp-ink); text-decoration: none; }
.ai-list a:hover, .ai-list a.on { background: var(--tvp-green-100); }
.ai-list a small { display: block; color: var(--tvp-muted); }
.ai-list__trong { margin: 0; padding: 0.55rem 0.85rem; color: var(--tvp-muted); }
@media (max-width: 767.98px) {
  .ai-panel { top: 0; right: 0; bottom: 0; left: 0; width: auto; max-width: none; border-radius: 0; }
  /* D-158 (2): điện thoại thu nút thành hình tròn chỉ có biểu tượng (tên vẫn đọc được bằng trình đọc màn hình), sát góc dưới phải;
     trang có thanh nút dính đáy của form thì nút nằm trên thanh đó */
  .ai-fab { right: 1rem; bottom: 1rem; width: 3.25rem; height: 3.25rem; }
  body:has(.tvp-form-actions--sticky) .ai-fab { bottom: 5.25rem; }
  body:has(#ai-fab) .tvp-main { padding-bottom: 5.5rem; }
  .ai-fab--mo { display: none; }  /* khung choán cả màn: đóng bằng nút X hoặc Esc */
  .ai-luot { display: none; }
  .ai-hint__luot { display: inline; }
}
/* Khối Trợ lý TVP ở MH-26 (US-51-AC18): tiêu đề nhóm và số liệu tháng này trên một dòng */
.ai-nhom { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; }
.ai-nhom__tk { display: flex; flex-wrap: wrap; gap: 1.25rem; margin-left: auto; color: var(--tvp-muted); font-size: 0.8rem; }
.ai-nhom__tk b { color: var(--tvp-ink); font-weight: 600; }

/* 5.40 Chỉnh giao diện và hiệu ứng 09/11/2026 (D-170 → D-182, Huy chọn qua ảnh trước/sau 09/11/2026). Chuyển động 0,1–0,2 s; máy bật
   "giảm chuyển động" thì không chạy (khối prefers-reduced-motion ở 5.x và các luật chuyển động dưới chỉ nằm trong no-preference). */

/* A1 (D-170): bấm nút gửi thì nút khóa, vòng xoay thay biểu tượng, nút Lưu đổi chữ "Đang lưu…" (tvp.js) */
.btn.is-dang-gui { cursor: progress; }
.btn.is-dang-gui > .bi { display: none; }
.btn.is-dang-gui::before { content: ""; flex: none; width: 1rem; height: 1rem; border: 2px solid currentColor; border-top-color: transparent; border-radius: 50%; animation: tvp-xoay 0.7s linear infinite; }
.btn-primary.is-dang-gui:disabled { --bs-btn-disabled-bg: var(--tvp-green-700); --bs-btn-disabled-border-color: var(--tvp-green-700); --bs-btn-disabled-color: #fff; }
@keyframes tvp-xoay { to { transform: rotate(360deg); } }

/* B2 (D-171): tiêu đề bảng Khách hàng, Sản phẩm, Nhật ký dính dưới thanh trên khi cuộn (máy tính; từ 1200 px bảng vừa khung, không cuộn ngang) */
@media (min-width: 1200px) {
  .tvp-khtable .tvp-table-wrap, .tvp-nkpanel .tvp-table-wrap { overflow: visible; }
  .tvp-khtable__t thead th, .tvp-nkpanel .tvp-ctable thead th { position: sticky; top: var(--tvp-topbar-h); z-index: 2; box-shadow: inset 0 -1px 0 var(--tvp-border); }
}

/* B5 (D-172): đang tải file lên: tên file, số MB đã gửi, vạch tiến độ dưới nút chọn file (tvp.js) */
.tvp-tai { display: grid; margin-top: 0.625rem; grid-template-columns: minmax(0, 1fr) auto; gap: 0.375rem 0.75rem; padding: 0.625rem 0.75rem; border: 1px solid var(--tvp-border); border-radius: var(--tvp-radius-sm); background: var(--tvp-surface); font-size: var(--tvp-text-sm); }
.tvp-tai__ten { min-width: 0; overflow-wrap: anywhere; }
.tvp-tai__so { color: var(--tvp-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tvp-tai progress { grid-column: 1 / -1; width: 100%; height: 0.375rem; border: 0; border-radius: 999px; background: var(--tvp-green-100); color: var(--tvp-green-700); accent-color: var(--tvp-green-700); appearance: none; overflow: hidden; }
.tvp-tai progress::-webkit-progress-bar { background: var(--tvp-green-100); }
.tvp-tai progress::-webkit-progress-value { background: var(--tvp-green-700); border-radius: 999px; transition: width 0.15s; }
.tvp-tai progress::-moz-progress-bar { background: var(--tvp-green-700); border-radius: 999px; }
.tvp-tai--loi { border-color: var(--tvp-danger); }
.tvp-tai--loi .tvp-tai__so { color: var(--tvp-danger-emph); white-space: normal; }

/* C1 (D-173): khi có viên Người phụ trách (CEO, trưởng phòng) ô tìm thu lại để hàng lọc gọn một dòng ở màn rộng */
@media (min-width: 576px) { .tvp-loc__dong:has(#f_nguoi) > .tvp-searchbox { flex: 0 1 9.5rem; min-width: 9rem; } }

@media (max-width: 575.98px) {
  /* M1 (D-175): thẻ số liệu 3 ô: nhãn luôn chiếm hai dòng để số nằm đáy thẻ, thẳng hàng giữa các thẻ */
  .tvp-kpis--3 .tvp-kpi__label { min-height: 2.7em; min-height: 2lh; }
}

/* S1 (D-177): phần chữ khớp từ đang tìm (bộ lọc to_sang) */
mark.tvp-khop { padding: 0 1px; border-radius: 3px; background: #fff3c4; color: inherit; }

/* V4 (D-180): thẻ Pipeline gọn hơn; tên khách, tên cơ hội vẫn đọc đủ (US-20-AC7) */
.tvp-pcol .tvp-pcard { padding: 0.75rem 0.875rem; gap: 0.25rem; }
.tvp-pcol .tvp-pcard__opp { margin-top: 0; font-size: 0.8125rem; }

/* H1, H4, H5 (D-181): rê chuột lên dòng bảng Khách hàng tô nền nhạt; gạch dưới tab chạy ra từ giữa; ô chọn đổi màu mượt */
@media (hover: hover) and (min-width: 768px) { .tvp-khtable__t:not(.tvp-sptable) tbody tr:hover > td { background: var(--tvp-green-50); } }
.tvp-tabs .nav-link { position: relative; }
.tvp-tabs .nav-link.active { box-shadow: none; }
.tvp-tabs .nav-link::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--tvp-green-700); transform: scaleX(0); }
.tvp-tabs .nav-link.active::after { transform: scaleX(1); }

@media (prefers-reduced-motion: no-preference) {
  .tvp-khtable__t tbody td { transition: background-color 0.15s; }
  /* H2: nút lún nhẹ khi nhấn */
  .btn { transition: color 0.15s, background-color 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.1s; }
  .btn:active:not(:disabled) { transform: scale(0.96); }
  /* H3: menu thả xuống hiện dần, trượt xuống nhẹ; dùng thuộc tính translate vì Popper giữ transform để đặt vị trí menu */
  .dropdown-menu.show { animation: tvp-tha 0.16s ease-out; }
  .tvp-tabs .nav-link::after { transition: transform 0.2s ease-out; }
  .tvp-chipbtn { transition: background-color 0.15s, border-color 0.15s, color 0.15s; }
  .btn-check:checked + .tvp-chipbtn::before { animation: tvp-dau 0.18s ease-out; }
  /* H6: kết quả lọc bằng HTMX hiện dần (htmx thêm lớp htmx-added cho phần mới rồi gỡ ngay sau khi gắn vào trang) */
  #danhSachKhach > *, #danhSachSanPham > *, #vungPipe, #vungViec { transition: opacity 0.2s ease-out; }
  #danhSachKhach > .htmx-added, #danhSachSanPham > .htmx-added, #vungPipe.htmx-added, #vungViec.htmx-added { opacity: 0; }
}
@keyframes tvp-tha { from { opacity: 0; translate: 0 -6px; } }
@keyframes tvp-dau { from { opacity: 0; transform: scale(0.4); } }

/* N1 (D-182): điện thoại có thanh điều hướng dưới đáy (4 màn hay dùng + "Thêm" mở menu ☰); nút Trợ lý nhích lên trên thanh.
   Trang form có thanh nút dính đáy thì ẩn thanh điều hướng để không che nút Lưu */
.tvp-bnav { display: none; }
@media (max-width: 767.98px) {
  .tvp-bnav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1030; display: grid; grid-template-columns: repeat(var(--n, 5), minmax(0, 1fr));
    padding: 0.25rem 0 calc(0.25rem + env(safe-area-inset-bottom)); background: var(--tvp-surface); border-top: 1px solid var(--tvp-border); }
  .tvp-bnav a, .tvp-bnav button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.125rem; min-height: 3.25rem; padding: 0 0.125rem;
    border: 0; background: none; color: var(--tvp-muted); font-size: 0.75rem; font-weight: 500; line-height: 1.2; text-decoration: none; text-align: center; }
  .tvp-bnav .bi { font-size: 1.25rem; line-height: 1; }
  .tvp-bnav [aria-current] { color: var(--tvp-green-800); font-weight: 700; }
  .tvp-bnav a:focus-visible, .tvp-bnav button:focus-visible { outline: 3px solid var(--tvp-yellow); outline-offset: -3px; }
  body:has(.tvp-bnav) .tvp-main { padding-bottom: calc(var(--tvp-gutter) + 4.5rem + env(safe-area-inset-bottom)); }
  body:has(.tvp-bnav) .ai-fab { bottom: calc(4.5rem + env(safe-area-inset-bottom)); }
  body:has(#ai-fab):has(.tvp-bnav) .tvp-main { padding-bottom: calc(8.5rem + env(safe-area-inset-bottom)); }
  body:has(.tvp-form-actions--sticky) .tvp-bnav { display: none; }
  body:has(.tvp-form-actions--sticky):has(.tvp-bnav) .tvp-main { padding-bottom: calc(var(--tvp-gutter) + 1rem); }
  body:has(.tvp-form-actions--sticky) .ai-fab { bottom: 5.25rem; }
}

/* 5.41 A3 (D-184, Huy duyệt 09/11/2026): thông báo thành công nổi góc dưới phải, cùng màu .alert-success, ngay trên nút Trợ lý;
   tvp.js tự ẩn sau 5 s. Dưới khung Trợ lý (1050) và hộp thoại (1055). D-245 (GD-73): câu báo lỗi cùng chỗ, .alert-danger, không tự ẩn */
.tvp-toasts { position: fixed; right: 1.5rem; bottom: 1.5rem; z-index: 1045; display: flex; flex-direction: column; gap: 0.5rem; width: 26rem; max-width: calc(100vw - 2rem); pointer-events: none; }
body:has(#ai-fab) .tvp-toasts { bottom: 5.75rem; }  /* 1,5 + 3,5 (nút Trợ lý) + 0,75 rem */
.tvp-toast { margin: 0; align-items: center; padding-right: 0.375rem; box-shadow: 0 8px 24px rgba(31, 41, 51, 0.12); pointer-events: auto; }
.tvp-toast > div { flex: 1 1 auto; min-width: 0; }
.tvp-toast__dong { display: inline-flex; flex: none; align-items: center; justify-content: center; width: 2.25rem; height: 2.25rem; padding: 0; border: 0; border-radius: var(--tvp-radius-sm); background: none; color: var(--tvp-ink); }
.tvp-toast__dong:hover { background: rgba(31, 41, 51, 0.06); }
.tvp-toast__dong:focus-visible { outline: 3px solid var(--tvp-yellow); outline-offset: 0; }
.tvp-toast.is-an { opacity: 0; translate: 0 0.5rem; }
@media (prefers-reduced-motion: no-preference) {
  .tvp-toast { transition: opacity 0.2s ease-out, translate 0.2s ease-out; animation: tvp-toast-vao 0.2s ease-out; }
}
@keyframes tvp-toast-vao { from { opacity: 0; translate: 0 0.5rem; } }
@media (max-width: 991.98px) { .tvp-toasts { left: 16px; right: 16px; width: auto; max-width: none; } }
@media (max-width: 767.98px) {
  /* nằm trên nút Trợ lý, thanh điều hướng đáy (N1) hoặc thanh nút Lưu dính đáy (khi có thanh này thì thanh điều hướng ẩn) */
  .tvp-toasts { bottom: calc(1rem + env(safe-area-inset-bottom)); }
  body:has(#ai-fab) .tvp-toasts { bottom: calc(5rem + env(safe-area-inset-bottom)); }
  body:has(.tvp-bnav) .tvp-toasts { bottom: calc(4.5rem + env(safe-area-inset-bottom)); }
  body:has(#ai-fab):has(.tvp-bnav) .tvp-toasts { bottom: calc(8.5rem + env(safe-area-inset-bottom)); }
  body:has(.tvp-form-actions--sticky) .tvp-toasts { bottom: calc(5.25rem + env(safe-area-inset-bottom)); }
  body:has(#ai-fab):has(.tvp-form-actions--sticky) .tvp-toasts { bottom: calc(9.25rem + env(safe-area-inset-bottom)); }
}

/* AU-12 (D-245): vạch đang tải 3 px sát mép trên khi có yêu cầu HTMX (htmx gắn lớp htmx-request cho phần tử đang gửi, gỡ khi xong hay hủy); hiện sau 0,3 s nên thao tác nhanh không nháy */
html:has(.htmx-request) body::after { content: ""; position: fixed; top: 0; left: 0; right: 0; z-index: 1100; height: 3px; background: linear-gradient(90deg, transparent, var(--tvp-green-700), transparent) 0 0 / 40% 100% no-repeat; opacity: 0; animation: tvp-hien 0s 0.3s forwards, tvp-chay 1.2s linear infinite; pointer-events: none; }
@keyframes tvp-hien { to { opacity: 1; } }
@keyframes tvp-chay { from { background-position: -70% 0; } to { background-position: 170% 0; } }
@media (prefers-reduced-motion: reduce) { html:has(.htmx-request) body::after { animation: tvp-hien 0s 0.3s forwards; background-size: 100% 100%; } }

/* US-12-AC8 (T1, D-185): tiêu đề cột bấm để sắp xếp ở bảng Khách hàng: mũi tên mờ khi cột chưa dùng, đậm theo chiều khi đang dùng */
.tvp-sapcot { display: inline-flex; align-items: center; gap: 0.25rem; min-height: 1.5rem; color: inherit; text-decoration: none; }   /* vùng bấm ít nhất 24 px (L-10) */
.tvp-sapcot:hover { color: var(--tvp-green-800); }
.tvp-sapcot .bi { font-size: 0.75rem; opacity: 0.45; }
[aria-sort] > .tvp-sapcot { color: var(--tvp-green-800); }
[aria-sort] > .tvp-sapcot .bi { opacity: 1; }

/* 5.42 D-186 (Huy duyệt bản mẫu 09/11/2026): máy tính thu gọn menu trái còn cột biểu tượng 72 px, bấm nút bi-list đầu thanh trên.
   Class tvp-ben-gon trên <html> (base.html gắn sẵn từ localStorage). Điện thoại giữ ngăn kéo cũ. Chữ mục ẩn kiểu visually-hidden
   để trình đọc màn hình vẫn đọc tên; rê chuột / focus hiện tên ở tooltip bên phải. */
@property --tvp-sidebar-w { syntax: "<length>"; inherits: true; initial-value: 232px; }  /* để chuyển động được: cột lưới, nền xanh và menu đổi cùng nhịp; initial-value phải là px (rem làm cả luật bị bỏ) */
.tvp-ben-toggle, .tvp-brand .tvp-brand__icon { display: none; }
@media (min-width: 992px) {
  .tvp-ben-toggle { display: inline-flex; }
  :root.tvp-ben-gon { --tvp-sidebar-w: 4.5rem; }
  .tvp-ben-gon .tvp-sidebar { z-index: 1025; }  /* tooltip nổi trên nội dung và thanh trên */
  .tvp-ben-gon .tvp-brand { position: relative; margin: 1rem 0.625rem 0; padding: 0.5rem; }
  .tvp-ben-gon .tvp-brand img:not(.tvp-brand__icon), .tvp-ben-gon .tvp-nav a > span {
    position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important;
    overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important;
  }
  .tvp-ben-gon .tvp-brand .tvp-brand__icon { display: block; height: 2.25rem; width: auto; }
  .tvp-ben-gon .tvp-sidebar .offcanvas-body { padding: 1rem 0.625rem 1.25rem; overflow: visible; }
  .tvp-ben-gon .tvp-nav__group { display: none; }
  .tvp-ben-gon .tvp-nav a { justify-content: center; padding: 0.5rem 0; }
  .tvp-ben-gon .tvp-sidebar__deco span:first-child { width: 100%; }
  .tvp-ben-gon .tvp-sidebar__deco span:last-child { width: 70%; }
  .tvp-ben-gon .tvp-nav a::before, .tvp-ben-gon .tvp-nav a::after { display: none; position: absolute; top: 50%; transform: translateY(-50%); pointer-events: none; z-index: 1; }
  .tvp-ben-gon .tvp-nav a::before { content: ""; left: calc(100% + 0.625rem - 5px); border: 5px solid transparent; border-left: 0; border-right-color: #1d2a1a; }
  .tvp-ben-gon .tvp-nav a::after {
    /* '/ ""': chữ tooltip không cộng vào tên đọc của link (span ẩn đã có tên), không thì trình đọc màn hình đọc hai lần khi focus */
    content: attr(data-ten); content: attr(data-ten) / ""; left: calc(100% + 0.625rem); padding: 0.375rem 0.625rem; border-radius: 6px;
    background: #1d2a1a; color: #fff; font-size: 13px; font-weight: 500; line-height: 1.3; white-space: nowrap; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
  }
  .tvp-ben-gon .tvp-nav a:is(:hover, :focus-visible)::before, .tvp-ben-gon .tvp-nav a:is(:hover, :focus-visible)::after { display: block; }
}
@media (min-width: 992px) and (prefers-reduced-motion: no-preference) { :root { transition: --tvp-sidebar-w 0.2s ease; } }

/* --- Mục Mẫu MH-35, phiếu yêu cầu mẫu, MH-10r (US-69, bản mẫu rnd-v3, phieu-rd-brief) --- */
.tvp-mau-dau { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; }
.tvp-mau-tabs { flex-wrap: nowrap; }
.tvp-mau-tabs .nav-link { gap: 0.375rem; }
.tvp-mau-loc { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.tvp-mau-loc .form-select { width: auto; min-width: 11rem; }
.tvp-mau-tt { display: flex; flex-direction: column; align-items: flex-start; gap: 0.375rem; }
.tvp-mau-chon { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.tvp-mau-chon li { display: flex; align-items: flex-start; gap: 0.625rem; padding: 0.625rem 0.75rem; border: 1px solid var(--tvp-border); border-radius: var(--tvp-radius-sm); }
.tvp-mau-chon li:has(input:checked) { border-color: var(--tvp-green-700); background: var(--tvp-green-50); }
.tvp-mau-chon label { display: flex; flex-direction: column; cursor: pointer; }
.tvp-mau-chon label span { font-size: var(--tvp-text-sm); color: var(--tvp-muted); }
.tvp-mau-goi { display: flex; gap: 0.5rem; margin: 1rem 0 0; font-size: var(--tvp-text-sm); color: var(--tvp-muted); }
.tvp-chipbtn--nhat { color: var(--tvp-muted); }
.tvp-mau-cot { display: grid; gap: 1rem; align-content: start; }
.tvp-mau-nhom { margin: 1rem 0 0.25rem; font-size: var(--tvp-text-sm); font-weight: 700; color: var(--tvp-ink); }
.tvp-sptitle .tvp-opt { font-size: var(--tvp-text-sm); font-weight: 400; color: var(--tvp-muted); }
.tvp-octl__nhan .tvp-chip { white-space: nowrap; }
.tvp-mau-cot .tvp-octl__nhan { display: flex; flex-direction: column; align-items: flex-end; gap: 0.25rem; }

/* Tab Mẫu (D-227): nút "…" xám của dòng, khối Phiếu yêu cầu R&D tách khỏi khối trên, liên kết Khách không cần mẫu trong hộp Còn thiếu */
.tvp-octl__nut--gon { min-width: 0; }
.tvp-octl__ba { display: inline-flex; align-items: center; justify-content: center; width: 2rem; height: 2rem; padding: 0; border: 0; border-radius: 0.5rem; background: transparent; color: var(--tvp-muted); }
.tvp-octl__ba:hover, .tvp-octl__ba[aria-expanded="true"] { background: var(--tvp-bg); color: var(--tvp-ink); }
.tvp-octl__ba:focus-visible { outline: none; box-shadow: var(--tvp-focus); }
.tvp-mau-tach { margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--tvp-border); }
.tvp-thieu__phu { margin: 0.5rem 0 0; font-size: var(--tvp-text-sm); color: var(--tvp-muted); }
.tvp-thieu__lk { padding: 0; border: 0; font-size: inherit; font-weight: 600; vertical-align: baseline; }

/* MH-31 Đơn hàng (US-66, bản mẫu don-hang v4): chọn kỳ và nút Ghi đơn canh phải; bảng một đơn một dòng, sản phẩm xếp chồng */
.tvp-don-dau { justify-content: flex-end; gap: 0.5rem; flex-wrap: wrap; }
@media (min-width: 576px) { .tvp-don .tvp-loc__dong > .tvp-searchbox, .tvp-don .tvp-loc__dong:has(#f_nguoi) > .tvp-searchbox { flex: 0 1 15rem; min-width: 12rem; } }   /* MH-31 chỉ 4 viên lọc: ô tìm đủ chỗ cho chữ gợi ý */
.tvp-don__t a.tvp-khtable__name { color: var(--tvp-ink); text-decoration: none; }   /* tên khách như MH-05 */
.tvp-don__t a.tvp-khtable__name:hover { text-decoration: underline; }
.tvp-don__sp + .tvp-don__sp { margin-top: 0.25rem; }
.tvp-don__sp b { font-weight: 600; }
.tvp-don__sp b, .tvp-don__sp > span { display: block; }   /* mã trên, tên dưới (Huy 13/11/2026) */
.tvp-don__sp > span:not(.text-nowrap) { color: var(--tvp-muted); }
.tvp-don__sp--so { display: flex; align-items: center; justify-content: flex-end; min-height: 2.75rem; }   /* số kg thẳng hàng với từng sản phẩm hai dòng */
.tvp-don__sp--so b { display: inline; }
/* Trạng thái đơn, phiếu khiếu nại: nhãn bo tròn như .tvp-pill ở Mẫu, Sản phẩm, Tài khoản (khuôn K1, GD-16, D-247; thay chấm màu + chữ) */
.tvp-don__tt { display: inline-flex; align-items: center; padding: 0.125rem 0.625rem; border-radius: 999px; font-size: var(--tvp-text-xs); font-weight: 600; line-height: 1.5; white-space: nowrap; }
.tvp-don__tt--cho { background: var(--tvp-warn-tint); color: var(--tvp-cam); }
.tvp-don__tt--ok { background: var(--tvp-stage-won-tint); color: var(--tvp-green-900); }
.tvp-don__t .btn { position: relative; z-index: 1; }   /* nút Nhận đơn bấm được trên dòng bấm-mở (.tvp-rowclick) */
.tvp-don-ct { display: grid; gap: 1rem; margin-top: 1rem; grid-template-columns: minmax(0, 1fr); }   /* Chi tiết đơn (D-211) */
@media (min-width: 992px) { .tvp-don-ct { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); align-items: stretch; } }   /* thông tin trái, sản phẩm phải, cao bằng nhau */
.tvp-don-ct > .tvp-panel { display: flex; flex-direction: column; margin: 0; }
.tvp-don-ct > .tvp-donhang .tvp-donhang__foot { margin-top: auto; }   /* tổng dính đáy khối khi khối bên cạnh cao hơn */
/* Ba nhãn đầu Chi tiết đơn khác màu nhau (Huy 13/11/2026): trạng thái vàng cam (warn) hoặc xanh lá đậm (solid), loại đơn xanh dương như ô số 1, mã đơn xám viền */
.tvp-pill--loai { background: #eff5ff; color: #1d4ed8; }
.tvp-pill--ma { background: var(--tvp-surface); color: var(--tvp-ink); border: 1px solid var(--tvp-border); }
/* Dải tóm tắt Chi tiết đơn (Huy 13/11/2026): trong thẻ đầu, nền trắng, vạch ngăn, ô biểu tượng nhỏ màu nhạt; khác ô số liệu đầu trang danh sách */
.tvp-donsum { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 1.25rem 0 0; padding-top: 1.25rem; border-top: 1px solid var(--tvp-border); }
.tvp-donsum > div { display: flex; align-items: flex-start; gap: 0.75rem; padding: 0 1.25rem; }
.tvp-donsum > div:first-child { padding-left: 0; }
.tvp-donsum > div + div { border-left: 1px solid var(--tvp-border); }
.tvp-donsum dt { font-size: var(--tvp-text-sm); font-weight: 500; color: var(--tvp-muted); }
.tvp-donsum dd { margin: 0.125rem 0 0; font-size: var(--tvp-text-xl, 1.25rem); font-weight: 700; color: var(--tvp-ink); line-height: 1.25; }
.tvp-donsum dd.tvp-donsum__phu { font-size: var(--tvp-text-sm); font-weight: 400; color: var(--tvp-muted); }
.tvp-donsum__ico { flex: 0 0 2.5rem; height: 2.5rem; border-radius: 0.75rem; display: grid; place-items: center; font-size: 1.125rem; }
.tvp-donsum__ico--1 { background: #eff5ff; color: #1d4ed8; }
.tvp-donsum__ico--2 { background: #e8f7ef; color: var(--tvp-kpi-2-chu); }
.tvp-donsum__ico--3 { background: #fdeeee; color: #c62828; }
.tvp-donsum__ico--4 { background: #fff4e0; color: var(--tvp-cam); }
@media (max-width: 991.98px) { .tvp-donsum { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 1rem; } .tvp-donsum > div:nth-child(3) { border-left: 0; padding-left: 0; } }
@media (max-width: 575.98px) { .tvp-donsum { grid-template-columns: minmax(0, 1fr); } .tvp-donsum > div { border-left: 0 !important; padding-left: 0; } }
/* Thông tin đơn: cột nhãn hẹp để tên khách nằm một dòng; dài quá thì ngắt theo từ, chia đều hai dòng (Huy 13/11/2026) */
.tvp-don-ct .tvp-spdl > div { grid-template-columns: 9rem minmax(0, 1fr); }   /* khung hẹp 144 px (GD-46): đủ "Lý do lệch dự báo" một dòng */
.tvp-don-ct .tvp-spdl dd { overflow-wrap: normal; text-wrap: balance; }

/* --- C2 Dự báo sản lượng MH-32 (US-64, US-65, US-66-AC11; bản mẫu Huy duyệt 14/11/2026) --- */
.tvp-don-dau .tvp-don-tabs { margin-right: auto; }   /* tab Đơn hàng | Dự báo bên trái, kỳ và nút bên phải */
.tvp-db__t th.so, .tvp-db__t td.so { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tvp-db__t thead th small { display: block; font-weight: 500; color: var(--tvp-muted); font-size: var(--tvp-text-xs); }
.tvp-db__t td.so a { color: var(--tvp-ink); font-weight: 600; text-decoration: none; }
.tvp-db__t td.so a:hover { text-decoration: underline; }
.tvp-db__t tfoot td { font-weight: 700; border-top: 2px solid var(--tvp-border); background: var(--tvp-bg); }
.tvp-db__t .tvp-db__cam { color: var(--tvp-warn); }
.tvp-db__goi-y { background: #fffaeb; }   /* dòng gợi ý từ cơ hội Cam kết: nền vàng nhạt cả dòng, kể cả thẻ trên điện thoại */
.tvp-db__goi-y > td { --bs-table-bg: transparent; background: transparent; }
.tvp-db__cap { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; color: var(--tvp-muted); font-size: var(--tvp-text-xs); white-space: nowrap; }   /* người sửa tên dài: "…" + title (GD-65) */
.tvp-db__in { min-width: 6.5rem; text-align: right; }
.tvp-fpage > .tvp-fpage__main { max-width: var(--_fp-w); margin-inline: auto; }   /* form không có cột trái (Cập nhật, Thêm dự báo) */
.tvp-lech { font-weight: 700; font-variant-numeric: tabular-nums; }
/* Màu lệch dự báo theo dấu (D-243, thay màu Huy 14/11/2026): − ít hơn đỏ, + nhiều hơn và đúng dự báo xanh lá, chưa có xám.
   span.: thắng `.tvp-don__sp > span:not(.text-nowrap)` (chữ xám) */
.tvp-lech { display: inline-flex; align-items: center; }
.tvp-lech > .bi { font-size: 1.125em; margin-right: -0.0625rem; }
.tvp-lech--duoi, .tvp-don__sp > span.tvp-lech--duoi { color: var(--tvp-danger); }
.tvp-lech--tren, .tvp-don__sp > span.tvp-lech--tren { color: var(--tvp-green-700); }
.tvp-lech--khop, .tvp-don__sp > span.tvp-lech--khop { color: var(--tvp-green-700); }
.tvp-lech--chua, .tvp-don__sp > span.tvp-lech--chua { color: var(--tvp-muted); font-weight: 500; }
.tvp-db__t a.tvp-khtable__name { color: var(--tvp-ink); text-decoration: none; font-weight: 600; }   /* tên khách như MH-05, MH-31 */
.tvp-db__t a.tvp-khtable__name:hover { text-decoration: underline; }
.tvp-sosanh { margin-top: 0.75rem; padding: 0.875rem 1rem; border-radius: var(--tvp-radius-sm); background: var(--tvp-bg); }
.tvp-sosanh__dong { display: flex; flex-wrap: wrap; gap: 0.25rem 0.75rem; align-items: baseline; }
.tvp-sosanh__dong + .tvp-sosanh__dong { margin-top: 0.375rem; }
.tvp-sosanh--do { background: var(--tvp-danger-tint); }
.tvp-poline--db { grid-template-columns: minmax(10rem, 1fr) repeat(4, minmax(0, 8rem)); }   /* khối dự báo ở trang Đóng Thắng, kiểu dòng PO (D-212) */
@media (max-width: 767.98px) { .tvp-poline--db { grid-template-columns: repeat(2, minmax(0, 1fr)); } }   /* điện thoại: tên sản phẩm cả hàng, 4 quý hai cột như dòng PO */
.tvp-fpage[hidden] { display: none; }   /* trang Đóng cơ hội: form Thắng / Thua ẩn hiện theo ô Kết quả */
.tvp-dong-the { min-width: 0; max-width: 100%; }
.tvp-dong-the > p { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }   /* mỗi dòng một ý, không xuống hàng (Huy 14/11) */
/* MH-31 khoảng cách giữa các cột gần đều (Huy 14/11/2026): bề rộng cột theo chữ dài nhất cộng phần dư chia đều; cột Giao ở giữa để phần dư
   chia hai bên (cột trước nó là số căn phải); tiêu đề luôn một dòng. Đo ở 1440 và 1800 px. */
@media (min-width: 1200px) {   /* dưới 1200 px bảng đã thành thẻ (D-241 (7)) */
  .tvp-don__t .tvp-don__giao { text-align: center; }
  .tvp-don__t th { white-space: nowrap; }   /* tiêu đề một dòng (Huy 14/11) */
  /* PR 4 (N-1): cột chữ không xuống hàng (số lượng, so với dự báo, giá trị, giao, trạng thái) rộng theo rem, đủ cho chữ dài nhất ở mọi khổ;
     cột Khách hàng không đặt bề rộng nên lấy phần còn lại. Trước đây đặt % nên ở 1280 → 1440 px "Chờ CSKH nhận" đè vòng chữ cột Phụ trách */
  .tvp-don__t col:nth-child(2) { width: 12%; } .tvp-don__t col:nth-child(3) { width: 5.5rem; } .tvp-don__t col:nth-child(4) { width: 7.5rem; } .tvp-don__t col:nth-child(5) { width: 8.25rem; } .tvp-don__t col:nth-child(6) { width: 4rem; } .tvp-don__t col:nth-child(7) { width: 9.25rem; } .tvp-don__t col:nth-child(8) { width: 14%; }
}
@media (min-width: 1200px) and (max-width: 1439.98px) { .tvp-don__t col:nth-child(2) { width: 10%; } .tvp-don__t col:nth-child(8) { width: 12%; } }   /* laptop 1280 → 1366: chừa chỗ cho tên khách, cột chính của bảng */
@media (min-width: 1600px) { .tvp-don__t col:nth-child(1) { width: 23%; } .tvp-don__t col:nth-child(2) { width: 11%; } .tvp-don__t col:nth-child(3) { width: 8%; } .tvp-don__t col:nth-child(4) { width: 10%; } .tvp-don__t col:nth-child(5) { width: 12%; } .tvp-don__t col:nth-child(6) { width: 7%; } .tvp-don__t col:nth-child(7) { width: 12%; } .tvp-don__t col:nth-child(8) { width: 17%; } }   /* màn rộng: phần dư không dồn vào cột Sản phẩm */
/* Huy 14/11/2026: không chỗ nào chia hai hàng. Bảng Đơn hàng, Dự báo: tên khách, dòng phụ, tên sản phẩm một dòng; dài quá thì "…" (rê chuột xem đủ) */
:is(.tvp-don__t, .tvp-db__t) .tvp-prodcell__text { min-width: 0; }   /* mọi khổ, cả thẻ trên điện thoại (D-241 (7)) */
:is(.tvp-don__t, .tvp-db__t) .tvp-prodcell__text > *, :is(.tvp-don__t, .tvp-db__t) .tvp-don__sp:not(.tvp-don__sp--so) > * { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tvp-db__t th { white-space: nowrap; }
/* Thẻ đơn hàng dưới 1200 px (D-241 (7), GD-68): 3 hàng thay 8 hàng nhãn. Hàng 1 khách · giá trị; hàng 2 sản phẩm · kg · so với dự báo;
   hàng 3 trạng thái · ngày giao · người phụ trách. Điện thoại: khách cả hàng, giá trị xuống hàng trạng thái. Phiếu khiếu nại (.kn-t) có thẻ riêng */
@media (max-width: 1199.98px) {
  .tvp-don__t:not(.kn-t) > tbody > tr { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 0.375rem 1.5rem; align-items: start; padding: 0.875rem 0; }
  .tvp-don__t:not(.kn-t) > tbody > tr > td { display: block; width: auto; min-width: 0; padding: 0; }
  .tvp-don__t:not(.kn-t) td::before { content: none; }
  .tvp-don__t:not(.kn-t) td[data-label="Khách hàng"] { grid-column: 1 / 3; grid-row: 1; }
  .tvp-don__t:not(.kn-t) td[data-label="Giá trị"] { grid-column: 3; grid-row: 1; align-self: center; text-align: right; white-space: nowrap; }
  .tvp-don__t:not(.kn-t) td[data-label="Sản phẩm"] { grid-column: 1; grid-row: 2; }
  .tvp-don__t:not(.kn-t) td[data-label="Số lượng"] { grid-column: 2; grid-row: 2; text-align: right; }
  .tvp-don__t:not(.kn-t) td[data-label="So với dự báo"] { grid-column: 3; grid-row: 2; text-align: right; }
  .tvp-don__t:not(.kn-t) td[data-label="Admin CSKH"] { grid-column: 1; grid-row: 3; }
  .tvp-don__t:not(.kn-t) td[data-label="Giao"] { grid-column: 2; grid-row: 3; text-align: right; white-space: nowrap; }
  .tvp-don__t:not(.kn-t) td[data-label="Giao"]::before { content: "Giao "; color: var(--tvp-muted); }
  .tvp-don__t:not(.kn-t) td[data-label="Phụ trách"] { grid-column: 3; grid-row: 3; justify-self: end; min-width: 0; max-width: 100%; }
  .tvp-don__t:not(.kn-t) .tvp-don__sp { display: flex; gap: 0.5rem; align-items: baseline; min-height: 1.5rem; min-width: 0; }
  .tvp-don__t:not(.kn-t) .tvp-don__sp > * { display: block; }
}
@media (max-width: 575.98px) {
  .tvp-don__t:not(.kn-t) > tbody > tr { gap: 0.375rem 0.75rem; }
  .tvp-don__t:not(.kn-t) td[data-label="Khách hàng"] { grid-column: 1 / -1; }
  .tvp-don__t:not(.kn-t) td[data-label="Admin CSKH"] { grid-column: 1; grid-row: 3; }
  .tvp-don__t:not(.kn-t) td[data-label="Giá trị"] { grid-column: 2 / -1; grid-row: 3; }
  .tvp-don__t:not(.kn-t) td[data-label="Phụ trách"] { grid-column: 1; grid-row: 4; justify-self: start; }
  .tvp-don__t:not(.kn-t) td[data-label="Giao"] { grid-column: 2 / -1; grid-row: 4; }
}
/* Câu giải thích ngắn trong hộp thoại (hộp theo khách MH-33, Xác nhận đã giao); bảng các tab Đơn hàng không có tên, câu riêng (D-218 (10)) */
.tvp-db__mota { margin: 0; color: var(--tvp-muted); font-size: var(--tvp-text-sm); }
.tvp-db__them { display: block; margin-top: 0.25rem; color: var(--tvp-warn); font-size: var(--tvp-text-sm); font-weight: 600; }   /* D-217: phần từ cơ hội Cam kết, một dòng dưới bảng tổng */

/* --- C3 So sánh MH-33 (US-67) và bước Đã giao (US-66-AC13, D-218) --- */
.tvp-don__tt--giao { background: var(--tvp-ngoc-tint); color: var(--tvp-ngoc); }   /* Đã giao: xanh ngọc, khác xanh lá "CSKH đã nhận" */
.tvp-pill--giao { background: var(--tvp-ngoc-tint); color: var(--tvp-ngoc); }
.tvp-ss__t a.tvp-ss__mo { color: inherit; text-decoration: none; }
.tvp-ss__t a.tvp-ss__mo:hover > * { text-decoration: underline; }
.tvp-ss__ten > a, .tvp-ss__ly-do > a { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }   /* một dòng, "…" kèm title (Huy 14/11) */
.tvp-ss__ten > a { max-width: 18rem; }
.tvp-ss__ly-do > a { max-width: 24rem; color: var(--tvp-ink); }
.tvp-giao__ngay > .form-control { max-width: 12rem; }   /* hộp Xác nhận đã giao: ô ngày, ô kg vừa số, không kéo hết hàng */
.tvp-giao__t .tvp-db__in { width: 8rem; }
@media (max-width: 575.98px) { .tvp-giao__t .tvp-db__in { width: 6rem; min-width: 0; } }   /* N-6 (D-249): bảng trong hộp Xác nhận đã giao vừa 390 px (trước 353 > 340) */
@media (max-width: 767.98px) { .tvp-ss__t > tfoot > tr > td { background: transparent; border: 0; padding: 0.125rem 0; } }   /* dòng Tổng thành thẻ như các dòng trên */
/* Rà 14/11 (PR C3), điện thoại: tên khách trong thẻ Dự báo / Cập nhật dự báo một dòng, "…" kèm title; nút khoảng thời gian MH-32 theo độ dài chữ, không xuống hàng */
@media (max-width: 767.98px) { .tvp-db__t .tvp-prodcell__text { min-width: 0; } .tvp-db__t .tvp-prodcell__text > a { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } }
@media (max-width: 575.98px) { .tvp-seg--tu-co a { flex: 1 1 auto; padding: 0 0.5rem; white-space: nowrap; } }   /* shortcut: dưới 360 px nút cuối bị cắt khoảng 20 px; màn hỗ trợ từ 375 px (D-42) không bị */
.tvp-giabao__ten { display: block; max-width: 26rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }   /* US-75: một dòng, “…” kèm title (Huy 14/11) */
@media (max-width: 767.98px) { .tvp-giabao__ten { max-width: none; } }

/* MH-36 Khiếu nại (US-76, D-232; bản mẫu ban-mau-khieu-nai Huy duyệt 15/11/2026): khuôn Đơn hàng / Chi tiết đơn, thêm vài luật riêng */
@media (min-width: 992px) { .tvp-don-ct.tvp-don-ct--phai { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); } }   /* chi tiết phiếu: nội dung trái rộng, Xử lý phải hẹp */
@media (min-width: 768px) {   /* bảng: nội dung một dòng, dài thì "…" (rê chuột xem đủ) */
  /* D-249 (8): cột ngắn rộng vừa chữ dài nhất (rem), Khách · sản phẩm và Nội dung chia phần còn lại (trước theo %: ở 1280 px nhãn "Quá hạn 2 ngày" đè cột Trạng thái) */
  .kn-t col.kn-c-phieu { width: 9rem; } .kn-t col.kn-c-nguoi { width: 11rem; } .kn-t col.kn-c-han { width: 9rem; } .kn-t col.kn-c-tt { width: 7.5rem; }
  .kn-t col:not([class]) { width: auto; }   /* không nhận bề rộng cột của bảng Đơn hàng (.tvp-don__t dùng chung) */
  .kn-t td.kn-nd { max-width: 0; }
  .kn-t td.kn-nd > b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
  .kn-t .kn-nguoi-ghi { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}
@media (min-width: 992px) { .kn-tk.tvp-don-ct { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; } }   /* thống kê: hai khối bằng nhau */
.kn-tk-khoi { margin-top: 1.5rem; }
.kn-tk-dau { margin-bottom: 0.75rem; }
.kn-noidung { margin: 0; font-size: var(--tvp-text-lg); font-weight: 600; line-height: 1.5; white-space: pre-line; overflow-wrap: anywhere; }   /* nội dung là thông tin chính */
@media (max-width: 1199.98px) {   /* bảng danh sách thành thẻ tới 1199 px (D-241 (7), Q121 A) */   /* điện thoại: thẻ phiếu như thẻ đơn. Hàng 1 khách, hàng 2 nội dung, hàng 3 mã phiếu | trạng thái, hàng 4 người | hạn */
  .tvp-khtable__t.kn-t tr { grid-template-columns: minmax(0, 1fr) auto; }
  .tvp-khtable__t.kn-t td, .kn-t .tvp-prodcell { min-width: 0; }   /* ô không nở theo chữ một dòng: dòng phụ dài thì "…" thay vì tràn khung */
  .kn-t .tvp-prodcell { align-self: stretch; }
  .tvp-khtable__t.kn-t td[data-label="Khách · sản phẩm"] { grid-column: 1 / -1; grid-row: 1; }
  .tvp-khtable__t.kn-t td.kn-nd { grid-column: 1 / -1; grid-row: 2; }
  .tvp-khtable__t.kn-t td.kn-nd > b { display: block; width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .tvp-khtable__t.kn-t td.tvp-rt-title { grid-column: 1; grid-row: 3; padding: 0; font-size: var(--tvp-text-sm); }
  .tvp-khtable__t.kn-t td[data-label="Trạng thái"] { grid-column: 2; grid-row: 3; justify-self: end; }
  .tvp-khtable__t.kn-t td[data-label="Người chịu trách nhiệm"] { grid-column: 1; grid-row: 4; }
  .tvp-khtable__t.kn-t td[data-label="Hạn xử lý"] { grid-column: 2; grid-row: 4; justify-self: end; align-items: flex-end; }
  .tvp-khtable__t.kn-t--rnd td[data-label="Hạn xử lý"] { grid-column: 1 / -1; justify-self: start; align-items: flex-start; }   /* R&D không có cột người */
  .kn-t .tvp-prodcell__text { min-width: 0; }
  .kn-t .tvp-prodcell__text > *, .kn-nguoi-ghi { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .tvp-kpis--lon.tvp-kpis--gon.kn-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.375rem; }   /* 4 ô 2 × 2 gọn như 3 ô Đơn hàng */
  .tvp-kpis--lon.tvp-kpis--gon.kn-kpis > .tvp-kpi { min-height: 0; padding: 0.625rem 0.75rem; }
}
.kn-tk__t { table-layout: fixed; }
.kn-tk__t th { white-space: nowrap; }
.kn-tk__t th:not(:first-child) { width: 6.5rem; }
.kn-tk__t th:nth-child(2) { width: 5rem; }   /* D-249 (8): "Phiếu" vừa số, tên khách, sản phẩm thêm chỗ */
.kn-tk__t .tvp-prodcell__text { min-width: 0; }
.kn-tk__t .tvp-prodcell__text > *, .kn-tk__t .tvp-don__sp > * { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kn-tk__t .tvp-don__sp > span { color: var(--tvp-muted); }
@media (max-width: 575.98px) {
  .kn-tk__t .tvp-logo { display: none; }
  .kn-tk__t th:nth-child(2) { width: 3.75rem; } .kn-tk__t th:nth-child(3) { width: 5.75rem; }
  /* tên ở thẻ đầu chi tiết phiếu một dòng, dài thì "…" kèm title (Huy 14/11: không xuống hai hàng) */
  :is(.kn-ct, .yc-ct) .tvp-custhead__title { min-width: 0; } :is(.kn-ct, .yc-ct) .tvp-custhead__title h1 { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}
/* WebKit (Safari) vẽ chữ của lựa chọn dài tràn ra ngoài ô chọn, làm trang cuộn ngang trên điện thoại (T-20: Sửa phiếu khiếu nại, Ghi buổi làm việc); cắt trong ô */
.form-select { overflow: hidden; }

/* Chi tiết phiếu yêu cầu mẫu (D-233, bản mẫu ban-mau-khieu-nai/yc-ct Huy duyệt 15/11/2026): khuôn Chi tiết đơn, thân trái rộng (.tvp-don-ct--phai) */
.tvp-ttdl { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem 1.5rem; margin: 0; }   /* nhãn xám nhỏ trên, giá trị đậm dưới (chỉ phiếu YC; .tvp-spdl nơi khác giữ nhãn đậm, Huy 08/11) */
@media (min-width: 576px) { .tvp-ttdl { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1200px) { .tvp-ttdl { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.tvp-ttdl.tvp-ttdl--1 { grid-template-columns: minmax(0, 1fr); }
.tvp-ttdl dt { font-size: var(--tvp-text-sm); font-weight: 500; color: var(--tvp-muted); }
.tvp-ttdl dd { margin: 0.125rem 0 0; font-size: var(--tvp-text-base); font-weight: 600; color: var(--tvp-ink); overflow-wrap: anywhere; }
.tvp-ttdl .tvp-ttdl__rong { grid-column: 1 / -1; }
.tvp-chuaxm { display: flex; gap: 0.375rem; margin: 1rem 0 0; padding-top: 0.75rem; border-top: 1px solid var(--tvp-border); font-size: var(--tvp-text-sm); color: var(--tvp-muted); }   /* ô "Chưa xác minh" của khối gom một dòng cuối khối */
.tvp-chuaxm.tvp-chuaxm--mot { margin-top: 0; padding-top: 0; border-top: 0; }   /* khối chỉ có ô chưa xác minh */
.tvp-chuaxm > .bi { flex: none; margin-top: 0.125rem; }
.yc-ct > *, .yc-ct .tvp-custhead__who, .yc-ct .tvp-khmeta, .yc-ct .tvp-khmeta > div { min-width: 0; max-width: 100%; }   /* dòng dài (nhiều việc cần R&D làm) cắt "…", không đẩy rộng thẻ đầu */
.yc-ct .tvp-khmeta dt { flex: none; white-space: nowrap; }
.yc-ct .tvp-khmeta dd { display: block; min-width: 0; max-width: 18rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }   /* một dòng, "…" kèm title */
.tvp-ttdl { grid-auto-flow: row dense; }   /* ô ngắn sau ô dài lấp chỗ trống hàng trên */
.yc-ct .tvp-donsum__phu { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.yc-ct .tvp-donsum > div > div { min-width: 0; }
.yc-lamlai { margin-bottom: 1rem; }

/* MH-35 danh sách phiếu (D-238): khuôn Khiếu nại / Đơn hàng, dòng nền trắng, chỉ nhãn có màu; điện thoại 4 ô số 2 × 2 gọn, mỗi phiếu một thẻ:
   hàng 1 khách · cơ hội, hàng 2 sản phẩm yêu cầu, hàng 3 mã phiếu | trạng thái, hàng 4 sale gửi | hạn */
.tvp-mau-bang .tvp-prodcell__text { min-width: 0; }
.tvp-mau-bang .tvp-prodcell__text > *, .tvp-mau-bang .yc-sp > * { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tvp-mau-bang .yc-gui { display: flex; margin-top: 0.25rem; color: var(--tvp-muted); }   /* sale gửi: vòng chữ + tên như cột người ở mọi bảng (GD-17), ngày theo sau */
.yc-gui__ngay { flex: none; }
@media (min-width: 768px) {
  .tvp-mau-bang { table-layout: fixed; }
  /* D-249 (8): Phiếu · sale gửi, Hạn trả mẫu, Trạng thái rộng vừa chữ (rem); Khách · cơ hội và Yêu cầu chia phần còn lại (trước theo %: tên khách cắt khi Trạng thái thừa 100 px) */
  .tvp-mau-bang col:nth-child(1) { width: 12rem; } .tvp-mau-bang col:nth-child(4) { width: 9.5rem; } .tvp-mau-bang col:nth-child(5) { width: 8.5rem; }
}
@media (max-width: 1199.98px) {   /* bảng danh sách thành thẻ tới 1199 px (D-241 (7), Q121 A) */
  .tvp-kpis--lon.tvp-kpis--gon.tvp-mau-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.375rem; }
  .tvp-kpis--lon.tvp-kpis--gon.tvp-mau-kpis > .tvp-kpi { min-height: 0; padding: 0.625rem 0.75rem; }
  .tvp-khtable__t.tvp-mau-bang tr { grid-template-columns: minmax(0, 1fr) auto; }
  .tvp-khtable__t.tvp-mau-bang td, .tvp-mau-bang .tvp-prodcell { min-width: 0; }
  .tvp-khtable__t.tvp-mau-bang td[data-label="Khách · cơ hội"] { grid-column: 1 / -1; grid-row: 1; }
  .tvp-khtable__t.tvp-mau-bang td[data-label="Yêu cầu"] { grid-column: 1 / -1; grid-row: 2; }
  .tvp-khtable__t.tvp-mau-bang td.tvp-rt-title { grid-column: 1 / -1; grid-row: 3; padding: 0; font-size: var(--tvp-text-sm); }   /* tên người gửi cả hàng, không cắt khi còn chỗ (N-12) */
  .tvp-khtable__t.tvp-mau-bang td[data-label="Trạng thái"] { grid-column: 2; grid-row: 4; justify-self: end; align-self: start; }
  .tvp-khtable__t.tvp-mau-bang td[data-label="Hạn trả mẫu"] { grid-column: 1; grid-row: 4; }
  .tvp-mau-bang .tvp-mau-tt { flex-direction: row; align-items: center; }
  .tvp-mau-seg { width: 100%; }   /* Chưa xong / Tất cả hết hàng như Khiếu nại, chữ không xuống dòng */
  .tvp-mau-seg a { flex: 1 1 0; justify-content: center; white-space: nowrap; }
}

/* 5.50 Chiều cao một thang (D-241 (6), audit giao diện mục 5.4): chiều cao hàng đầu trang và hàng lọc chỉ khai ở đây.
   Nút gạt có viền trong 3 px (.tvp-seg padding) nên mục bên trong thấp hơn cả khối 6 px. */
.tvp-seg a { min-height: calc(var(--tvp-h-control) - 6px); }                                    /* hàng đầu trang: khối 44 px */
.tvp-seg--sm a, .tvp-seg--xem label { min-height: calc(var(--tvp-h-filter) - 6px); }             /* hàng lọc: khối 36 px */
.tvp-dash-ky .tvp-seg--sm a { min-height: calc(var(--tvp-h-control) - 6px); }                   /* Tháng / Quý / Năm trong ô thả của nút kỳ */
.tvp-pipebar .form-select { height: var(--tvp-h-control); min-height: var(--tvp-h-control); }
.tvp-vien, .tvp-loc__xoa, .tvp-searchbox { height: var(--tvp-h-filter); }
/* Điện thoại: mọi thứ bấm được cao và rộng từ 44 px (--tvp-touch, GD-69) */
@media (max-width: 767.98px) {
  .tvp-seg a, .tvp-seg--sm a, .tvp-seg--xem label, .tvp-dash-ky .tvp-seg--sm a { min-height: var(--tvp-touch); }
  .tvp-vien, .tvp-loc__xoa, .tvp-searchbox, .tvp-pipebar .form-select { height: var(--tvp-touch); min-height: var(--tvp-touch); }
  .tvp-sqbtn, .tvp-sqbtn--sm, .tvp-iconbtn, .tvp-imgtile__del, .tvp-lich-nav__btn, .page-link { min-width: var(--tvp-touch); min-height: var(--tvp-touch); }
  .tvp-lich-nav__nay, .tvp-doi__more { display: inline-flex; align-items: center; min-height: var(--tvp-touch); }
  .tvp-vien__bo::after { content: ""; position: absolute; inset: -0.75rem; }   /* nút × 20 px trong viên: vùng bấm 44 px, hình không đổi */
}

/* 5.51 Pipeline kiểu Danh sách (GD-55, GD-67, GD-68, D-241 (7)). Máy tính: mỗi ô một dòng, dài thì "…" kèm title; cảnh báo mỗi nhãn một dòng.
   Dưới 1200 px: thẻ 4 hàng (cơ hội · giá trị; khách · bước; việc · người; cảnh báo · ICP) thay 8 hàng nhãn */
@media (min-width: 1200px) {
  .tvp-pltable { table-layout: fixed; }
  /* PR 4 (N-3): Bước, Giá trị, ICP rộng vừa chữ (rem); cột Cơ hội không đặt bề rộng nên lấy phần còn lại; phần dư trước đây nằm ở ba cột này */
  .tvp-pltable__buoc { width: 7.5rem; } .tvp-pltable__gt { width: 5.75rem; } .tvp-pltable__icp { width: 3.25rem; }   /* Bước 132 → 120 px vừa nhãn "4 Đàm phán" (D-249 (8): thừa 50 px khi Khách, Cảnh báo bị cắt) */
  .tvp-pltable__kh { width: 14%; } .tvp-pltable__viec { width: 13%; } .tvp-pltable__cb { width: 15%; } .tvp-pltable__nguoi { width: 12%; }
  .tvp-pltable th { white-space: nowrap; }
}
@media (min-width: 1440px) {   /* đủ chỗ: tên người phụ trách, nhãn cảnh báo không cắt */
  .tvp-pltable__kh { width: 14%; } .tvp-pltable__viec { width: 13.5%; } .tvp-pltable__cb { width: 16.5%; } .tvp-pltable__nguoi { width: 14.5%; }   /* PR 5: bảng có đệm 16 trong khung, Phụ trách rộng thêm 1 % */
}
.tvp-pltable .tvp-chip > .bi { margin-right: 0.25rem; }   /* nhãn ở đây là khối (cắt "…" được) nên mất khoảng cách gap của inline-flex */
.tvp-pltable td { min-width: 0; }
.tvp-pltable .tvp-chip, .tvp-pltable .tvp-stage { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tvp-pltable .tvp-chip { display: block; width: fit-content; }
.tvp-pltable .tvp-chip + .tvp-chip { margin-top: 0.25rem; }
@media (max-width: 1199.98px) {
  .tvp-pltable > tbody > tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.375rem 1rem; align-items: center; }
  .tvp-pltable > tbody > tr > td { display: block; min-width: 0; padding: 0; text-align: left; }
  .tvp-pltable td::before { content: none; }
  .tvp-pltable td[data-label="Cơ hội"] { grid-column: 1; grid-row: 1; padding: 0; }
  .tvp-pltable td[data-label="Giá trị"] { grid-column: 2; grid-row: 1; text-align: right; font-weight: 700; }
  .tvp-pltable td[data-label="Khách"] { grid-column: 1; grid-row: 2; }
  .tvp-pltable td[data-label="Bước"] { grid-column: 2; grid-row: 2; justify-self: end; }
  .tvp-pltable td[data-label="Việc tiếp theo"] { grid-column: 1; grid-row: 3; }
  .tvp-pltable td[data-label="Người phụ trách"] { grid-column: 2; grid-row: 3; justify-self: end; max-width: 12rem; }
  .tvp-pltable td[data-label="Cảnh báo"] { grid-column: 1; grid-row: 4; display: flex; flex-wrap: wrap; justify-content: flex-start; gap: 0.25rem; }
  .tvp-pltable td[data-label="Cảnh báo"] > .text-muted:only-child { display: none; }   /* thẻ: không cảnh báo thì bỏ trống, chữ "Không có" đứng một mình dễ hiểu nhầm */
  .tvp-pltable td[data-label="Cảnh báo"] .tvp-chip + .tvp-chip { margin-top: 0; }
  .tvp-pltable td[data-label="Điểm ICP"] { grid-column: 2; grid-row: 4; text-align: right; white-space: nowrap; }
  .tvp-pltable td[data-label="Điểm ICP"]::before { content: "ICP "; color: var(--tvp-muted); }
  .tvp-pltable td[data-label="Việc tiếp theo"] > .text-muted:only-child::before { content: "Việc tiếp theo: "; }
}

/* 5.52 Khuôn danh sách K1 (D-241 (1), (7); GD-21, GD-65 → GD-67): mọi bảng danh sách (.tvp-rtable--wide) và thẻ của nó giữ mỗi ý một dòng,
   dài thì "…" (title đặt ở phần tử chữ để rê chuột xem đủ). Dòng phụ dưới tên: nhãn giữ nguyên, phần chữ cuối co lại */
.tvp-rtable--wide .tvp-prodcell, .tvp-khcard .tvp-prodcell { min-width: 0; }
.tvp-rtable--wide .tvp-prodcell__text, .tvp-khcard .tvp-prodcell__text, .tvp-rtable--wide .tvp-khtable__cell, .tvp-khcard .tvp-khtable__cell { min-width: 0; max-width: 100%; }
.tvp-rtable--wide :is(.tvp-prodcell__text > a, .tvp-khtable__task), .tvp-khcard :is(.tvp-prodcell__text > a, .tvp-khtable__task),
.tvp-rtable--wide .tvp-cellsub > span:last-child:not(.tvp-chip, .tvp-pill), .tvp-khcard .tvp-cellsub > span:last-child:not(.tvp-chip, .tvp-pill) { display: block; min-width: 0; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tvp-rtable--wide .tvp-cellsub, .tvp-khcard .tvp-cellsub { flex-wrap: nowrap; min-width: 0; }
.tvp-rtable--wide .tvp-cellsub > .tvp-pill, .tvp-khcard .tvp-cellsub > .tvp-pill, .tvp-rtable--wide .tvp-chip, .tvp-khcard .tvp-chip, .tvp-rtable--wide .tvp-trong { flex: none; white-space: nowrap; }
.tvp-khcard { min-width: 0; }
.tvp-khcard__facts { grid-template-columns: minmax(0, 1fr); }   /* lưới không nở theo chữ một dòng dài (GD-66) */
.tvp-khcard__facts dd { overflow: hidden; }
@media (max-width: 1199.98px) { .tvp-khtable__t td[data-label="Người phụ trách"] { min-width: 0; max-width: 100%; } }   /* thẻ: hai cột bằng nhau, tên người dài cắt "…" không đè tiến độ (GD-65) */
/* Đội sale, Chi tiết sale, Mục tiêu năm: tên người một dòng, dài thì "…" (GD-65, D-241 (7)); title ở phần tử tên */
.tvp-doi__who { min-width: 0; }
.tvp-doi__name { flex-wrap: nowrap; min-width: 0; }
.tvp-doi__name > .tvp-rowlink, .tvp-doi__name:not(:has(> *)) { display: block; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tvp-doi__name > .tvp-pill { flex: none; }
@media (min-width: 768px) { .tvp-doitable--khach td.tvp-rt-title { width: 45%; max-width: 0; } }   /* bảng tự giãn: max-width 0 để tên khách dài cắt "…" thay vì đẩy bảng */
.tvp-rtable--wide .tvp-rowlink > b, :is(.tvp-don__t, .tvp-db__t) .tvp-don__sp:not(.tvp-don__sp--so) > b { flex: none; overflow: visible; white-space: nowrap; }   /* mã phiếu, mã sản phẩm không cắt, không gãy dòng */
/* Ô số từ 768 px: nhãn một dòng, dài thì "…" kèm title (D-241 (1), GD-30); điện thoại giữ tối đa 2 dòng (ô hẹp 3 cột) */
@media (min-width: 768px) { .tvp-kpis--lon .tvp-kpi__label { display: block; white-space: nowrap; text-overflow: ellipsis; -webkit-line-clamp: none; }
  .tvp-dash:not(.tvp-hn) .tvp-kpis--lon .tvp-kpi__label { display: -webkit-box; white-space: normal; -webkit-line-clamp: 2; } }   /* Dashboard giữ 2 dòng tới khi làm lại (C4, D-143) */
@media (min-width: 1200px) { .tvp-db__sua { table-layout: fixed; } }   /* Cập nhật dự báo: cột theo colgroup, tên dài cắt "…" thay vì làm bảng rộng 1784 px */
@media (max-width: 1199.98px) { .tvp-khtable__t > tbody > tr > td, .tvp-khtable__t > tbody > tr > td > * { min-width: 0; max-width: 100%; } }   /* thẻ: ô và khối trong ô không nở theo chữ một dòng dài (sản phẩm, dự báo, phiếu mẫu) */
.tvp-db__sua .tvp-db__in { min-width: 0; }   /* ô kg theo bề rộng cột (12 %), không lấn cột bên (GD-54) */
@media (max-width: 1199.98px) { .tvp-rtable--wide td > * { min-width: 0; max-width: 100%; } }   /* thẻ: khối trong ô co theo thẻ, chữ dài cắt "…" */
.tvp-loc__xoa { flex: none; white-space: nowrap; }   /* "Xóa lọc" một dòng cả trên điện thoại (T-20) */

/* Nhãn đầu trang Chi tiết khách (D-242, Huy chọn kiểu A 16/11/2026): mỗi loại một màu lấy từ bảng màu ô số, chữ 14 px cho dễ đọc.
   Khách mới, Hiện hữu giữ xanh lá; Quy mô xanh dương; ICP xanh ngọc; Chưa tiếp cận vàng cam (cảnh báo) */
.tvp-custhead__pills .tvp-pill { font-size: var(--tvp-text-sm); padding: 0.25rem 0.75rem; }
.tvp-pill--quymo { background: var(--tvp-kpi-1-bg2); color: var(--tvp-kpi-1-chu); }
.tvp-pill--icp { background: var(--tvp-kpi-2-bg2); color: var(--tvp-kpi-2-chu); }
.tvp-custhead__pills .tvp-pill--warn { background: var(--tvp-kpi-4-bg2); color: var(--tvp-kpi-4-chu); }   /* 4,5 : 1 */

/* 5.60 PR 2 đồng bộ giao diện (D-244): chi tiết K2, form K3, chữ một dòng.
   Đường dẫn đầu trang một dòng, mục dài thì "…" (mục có tên bản ghi mang title); nút lưu của form không xuống hàng trên điện thoại. */
.tvp-crumb { flex-wrap: nowrap; min-width: 0; }
.tvp-crumb li { flex: none; white-space: nowrap; overflow-wrap: normal; }
.tvp-crumb li[title] { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }   /* chỉ mục mang tên bản ghi (có title) co lại, "…" */
.tvp-custhead--khach > * { min-width: 0; max-width: 100%; }   /* tên, việc dài không kéo rộng khung đầu trang */
.tvp-crumb li[title] > a { max-width: 100%; overflow: hidden; text-overflow: ellipsis; vertical-align: bottom; }   /* liên kết giữ vùng bấm 25 px (L-10), tên dài "…" */
.tvp-fpage__top .tvp-form-actions .btn { white-space: nowrap; }
@media (max-width: 575.98px) { .tvp-form-actions--sticky .btn { min-width: 0; padding-inline: 0.75rem; } }
.tvp-motdong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }   /* một dòng, dài thì "…" kèm title */
.tvp-don-ct .tvp-don__sp > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }   /* D-244: tên sản phẩm một dòng, title có sẵn */
/* D-244: bảng Người liên hệ và bảng sản phẩm ở Chi tiết đơn mỗi ô một dòng, dài thì "…" kèm title (máy tính chia cột cố định) */
.tvp-lhtable .tvp-lhwho__name, .tvp-lhtable .tvp-lhwho__sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tvp-lhwho > div { min-width: 0; }   /* lớp min-w-0 trong template không có trong Bootstrap 5.3 */
@media (min-width: 768px) { .tvp-donhang .tvp-rt-title { width: 100%; max-width: 0; } }   /* bảng kiểu hóa đơn (Chi tiết đơn): cột sản phẩm lấy phần còn lại, tên dài "…", số căn phải thẳng dòng tổng */
@media (min-width: 1200px) {   /* GD-59 (D-249): dưới 1200 px các bảng ở tab Chi tiết khách là thẻ (.tvp-rtable--wide, 3 khổ Q121 A) */
  /* D-249 (8) (Huy 17/11/2026): cột vừa chữ dài nhất, tên tối đa 18rem; cột Quan tâm (chữ tự do) lấy phần thừa (trước: Họ tên 32 %, Liên lạc 24 % thừa chỗ, Quan tâm bị cắt) */
  .tvp-lhtable { width: 100%; }
  .tvp-lhtable > :is(thead, tbody) > tr > * { width: 1%; white-space: nowrap; }
  .tvp-lhtable > :is(thead, tbody) > tr > :nth-child(3) { width: auto; max-width: 0; }
  .tvp-lhtable .tvp-lhwho__name, .tvp-lhtable .tvp-lhwho__sub { max-width: 18rem; }
  /* D-249 (8): bảng chia đều (Giá đã báo, Đơn hàng đã mua): bảng giãn hết bề ngang, phần thừa chia đều cho mọi cột (Huy 17/11/2026: không để
     khoảng trắng cuối bảng, không để cột tên ăn hết chỗ đẩy Đơn giá ra mép phải); tên tối đa 26rem rồi "…" */
  .tvp-rtable--goi > :is(thead, tbody) > tr > * { width: 1%; white-space: nowrap; }
  .tvp-donhang .tvp-rtable--goi .tvp-rt-title { width: 1%; max-width: none; }
  .tvp-rtable--goi .tvp-rt-title > * { max-width: 18rem; }   /* 1200 → 1439 px: tên dài không đẩy bảng tràn khung */
}
.tvp-khmeta > div, .tvp-khmeta dd { min-width: 0; max-width: 100%; }
.tvp-khmeta dd > a { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }   /* D-244: tên khách ở hàng thông tin một dòng, title có sẵn */

/* 5.61 PR 5 danh sách, bộ lọc (D-247). Ô tìm một bề rộng 240 px ở mọi hàng lọc từ 576 px (GD-12; trước: 152, 240, 384);
   "Xóa lọc" cao bằng hàng lọc 36 px trên máy tính (GD-43; điện thoại giữ 44 px ở 5.50) */
@media (min-width: 576px) {
  .tvp-main .tvp-loc .tvp-searchbox, .tvp-main .tvp-loc__dong > .tvp-searchbox, .tvp-main .tvp-loc__dong:has(#f_nguoi) > .tvp-searchbox { flex: 0 1 15rem; min-width: 12rem; max-width: 15rem; }
}
@media (min-width: 768px) { .tvp-loc__xoa { min-height: 0; } }
/* Thẻ dưới 1200 px không nhãn lặp như Khách hàng, Đơn hàng, Mẫu (khuôn K1, GD-20): Sản phẩm, Tài khoản.
   Hàng 1 tên · trạng thái; hàng 2 nhóm (vai trò); hàng 3 ngành (email); Sản phẩm bỏ ngày cập nhật như Khách bỏ "Liên hệ gần nhất" */
@media (max-width: 1199.98px) {
  .tvp-sptable > tbody > tr, .tvp-tktable > tbody > tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 0.25rem 0.75rem; padding: 0.75rem 0; }
  .tvp-sptable td::before, .tvp-tktable td::before { content: none; }
  .tvp-sptable > tbody > tr > td, .tvp-tktable > tbody > tr > td { display: block; width: auto; min-width: 0; padding: 0; text-align: left; }
  .tvp-sptable td.tvp-rt-title, .tvp-tktable td.tvp-rt-title { grid-column: 1; grid-row: 1; padding: 0; }
  .tvp-sptable td[data-label="Trạng thái"], .tvp-tktable td[data-label="Trạng thái"] { grid-column: 2; grid-row: 1; justify-self: end; }
  .tvp-sptable td[data-label="Nhóm"], .tvp-tktable td[data-label="Vai trò"] { grid-column: 1 / -1; grid-row: 2; font-weight: 600; }
  .tvp-sptable td[data-label="Ngành khách phù hợp"], .tvp-tktable td[data-label="Email"] { grid-column: 1 / -1; grid-row: 3; color: var(--tvp-muted); }
  .tvp-sptable td[data-label="Cập nhật"] { display: none; }
  .tvp-tktable td.tvp-rt-actions { grid-column: 1 / -1; grid-row: 4; padding-top: 0.5rem; }
}
.tvp-vlist > .tvp-khtable__foot { padding: 0.75rem 1rem; border-top: 1px solid var(--tvp-border); }   /* chân danh sách Việc (GD-70): khung việc không đệm nên chân tự đệm */
.tvp-doitable--6 > thead > tr > th:not(:first-child) { padding-inline: 0.375rem; }   /* "T11 (đang chạy)" chữ 14 px đủ một dòng, thẳng mép ô màu bên dưới */
@media (max-width: 1199.98px) { .tvp-khtable .tvp-pltable > tbody > tr { padding-inline: 0; } }   /* Pipeline thẻ: khung đã đệm 16 (D-247), thẻ không đệm thêm như Đơn hàng */

/* 5.62 PR 6 chi tiết, form, hộp thoại (D-249). GD-21: tiêu đề khung ở Hôm nay, Mục tiêu doanh thu, Dự báo doanh thu trên điện thoại một dòng:
   tiêu đề chiếm cả hàng (liên kết, nhãn đếm xuống hàng dưới), cỡ 16 px (trước 20 px, gãy 2 hàng) */
@media (max-width: 575.98px) {
  .tvp-dash-luoi .tvp-panel__head > .tvp-panel__title { flex-basis: 100%; font-size: var(--tvp-text-base); }
}
@media (min-width: 576px) {   /* máy tính: tiêu đề một dòng, không đủ chỗ thì liên kết, nhãn đếm xuống hàng dưới thay vì chữ tiêu đề gãy */
  .tvp-dash-luoi .tvp-panel__head > .tvp-panel__title { flex: 0 1 auto; white-space: nowrap; }
}
@media (min-width: 1200px) { .yc-c-buoc { width: 8rem; } .yc-c-phieu { width: 6.5rem; } }   /* D-249 (8): Mẫu › Cơ hội đang mở (R&D), trước 5 cột bằng nhau, Bước, Phiếu thừa 100 → 150 px */
@media (max-width: 1199.98px) { .tvp-rtable--wide .tvp-rt-note { padding-left: 0; } }   /* thẻ dưới 1200 px: ô chữ sau cột số không thụt vào */
.tvp-page-header__ten { flex: 1 1 auto; min-width: 0; }   /* N-7 (D-249): tên trang dài (tên sản phẩm) một dòng "…" ở trang So sánh theo sản phẩm */
.tvp-mt__bang > tbody > tr > th { padding-inline: 0.75rem; }   /* D-249 (8): cột người 176 px (từ 1440 px 200) đủ họ tên, chức vụ một dòng */
.tvp-mt__bang .tvp-doi__who { gap: 0.5rem; }
.tvp-mt__bang .tvp-doi__who > div { min-width: 0; } .tvp-mt__bang .tvp-doi__who > div > * { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (min-width: 1440px) { .tvp-rtable--goi .tvp-rt-title > * { max-width: 26rem; } }
