/* ============================================================
   cong-viec-health.css — Dashboard Công việc (Health Score)
   Port 1-1 từ design HealthDashboard.css (prefix hd-). Khung điều
   chỉnh cho app shell: header DÍNH (sticky) trong trang cuộn thường
   (KHÔNG phụ thuộc .shell .content full-height như prototype).
   Triết lý: HỖ TRỢ, không chấm điểm — nhấn độ tin cậy & CI.
   ============================================================ */

/* ---- Bù token thiết kế còn thiếu trong app.css (KHÔNG đụng nhóm --brand, -bg, -fg, -border đã có) ----
   LƯU Ý: KHÔNG viết dấu sao liền dấu gạch chéo trong comment CSS — nó đóng comment sớm, làm khối
   token :root bên dưới bị parser DROP (đây từng là bug thật khiến 3 chiều Chất lượng/Sản lượng/Chủ động mất màu).
   ĐẶT Ở :root (KHÔNG chỉ .hd-screen): thanh "5 chiều" ở hero + inline color-mix tiêu thụ các token
   này qua style động; nếu chỉ scoped .hd-screen thì element không kế thừa được biến (DevTools báo
   "--success-600 is not defined") → color-mix invalid → fill trong suốt. Token màu là design token
   dùng chung (như --brand vốn ở :root), nên để :root là đúng bản chất. CHỈ --success-500 (ghi đè
   #16A34A của app.css bằng #22c55e tươi hơn cho dashboard) mới giữ scoped để không đổi màu toàn app. */
:root {
  --success-600: #16a34a; --success-700: #15803d;
  --warning-600: #d97706; --warning-700: #b45309; --warning-100: #fcd9a5;
  --error-600: #dc2626;
  --info-100: #bfdbfe; --info-600: #0284c7;
  --purple-600: #9333ea;
  --status-warning-bg: #fffbeb; --status-success-bg: #f0fdf4; --status-info-bg: #f0f9ff;
  --bg-overlay: rgba(15, 23, 42, .32);
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, .05);
  --dur-base: .2s; --dur-slow: .28s;
}
.hd-screen { --success-500: #22c55e; }

/* ---- Khung: header dính, thân cuộn theo trang ---- */
.hd-screen { display: flex; flex-direction: column; gap: 16px; min-height: 0; }
.hd-stickyhead { position: sticky; top: 0; z-index: 6; background: var(--bg-app, var(--bg-surface)); padding: 4px 2px 12px; border-bottom: 1px solid var(--border-1); margin: -4px -2px 0; }
.hd-stickyhead > *:last-child { margin-bottom: 0; }
.hd-screen-body { display: flex; flex-direction: column; gap: 16px; }
.hd-screen-body > * { flex: 0 0 auto; }

/* ---- Header ---- */
.hd-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 12px; }
/* Tiêu đề + dòng "Phạm vi…" trên CÙNG 1 hàng (canh baseline); wrap xuống dòng khi màn hẹp */
.hd-head-l { display: flex; align-items: baseline; gap: 4px 14px; flex-wrap: wrap; min-width: 0; }
.hd-title { margin: 0; font-size: 24px; font-weight: 700; color: var(--fg-1); letter-spacing: -0.01em; display: inline-flex; align-items: center; gap: 12px; }
.hd-title-badge { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; color: var(--brand); background: var(--brand-soft); padding: 4px 10px; border-radius: 999px; cursor: help; }
.hd-title-badge:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.hd-title-badge svg { width: 1em; height: 1em; }
.hd-sub { font-size: 13px; color: var(--fg-3); margin-top: 0; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.hd-sub b { color: var(--fg-2); font-weight: 600; }
.hd-dot { color: var(--fg-4); }
.hd-real-tag { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 600; color: var(--success-700); background: var(--status-success-bg); padding: 2px 8px; border-radius: 999px; }
.hd-head-r { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ---- Toolbar ---- */
.hd-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.hd-toolbar-sp { flex: 1 1 auto; }
.hd-layout-switch { display: inline-flex; align-items: center; gap: 8px; }
.hd-layout-lbl { font-size: 11.5px; font-weight: 700; color: var(--fg-3); text-transform: uppercase; letter-spacing: 0.05em; }

/* ---- Select (native, fallback nếu app chưa style) ---- */
.hd-screen .select { height: 34px; font-size: 12.5px; min-width: 150px; padding: 0 10px; border: 1px solid var(--border-2); border-radius: 9px; background: var(--bg-surface); color: var(--fg-1); font-family: inherit; font-weight: 600; cursor: pointer; }
.hd-screen .select-sm { height: 30px; font-size: 12px; min-width: 132px; }

/* ---- Badge tổng cảnh báo ---- */
.hd-screen .badge { display: inline-flex; align-items: center; font-size: 12px; font-weight: 800; padding: 2px 9px; border-radius: 999px; font-variant-numeric: tabular-nums; }
.hd-screen .badge-neutral { background: var(--bg-sunken); color: var(--fg-2); }

/* ---- Segmented ---- */
.hd-seg { display: inline-flex; gap: 3px; padding: 3px; background: var(--bg-sunken); border: 1px solid var(--border-1); border-radius: 10px; }
.hd-seg-opt { display: inline-flex; align-items: center; gap: 5px; border: 0; background: transparent; color: var(--fg-2); font-family: inherit; font-size: 13px; font-weight: 600; padding: 6px 14px; border-radius: 7px; cursor: pointer; white-space: nowrap; transition: background var(--dur-fast), color var(--dur-fast); }
.hd-seg[data-size="sm"] .hd-seg-opt { padding: 5px 11px; font-size: 12.5px; }
.hd-seg-opt:hover { color: var(--fg-1); }
.hd-seg-opt.on { background: var(--bg-surface); color: var(--brand); box-shadow: var(--shadow-xs); }
.hd-seg-opt svg { width: 13px; height: 13px; }
/* Chữ-cái mnemonic A/B/C/D: đậm nét, làm nhạt để không lấn text mô tả bên cạnh */
.hd-seg-key { font-weight: 800; opacity: 0.5; margin-right: -2px; }
.hd-seg-opt.on .hd-seg-key { opacity: 0.75; }

/* ---- Range ---- */
.hd-range { display: flex; flex-direction: column; gap: 7px; margin-bottom: 14px; }
.hd-range-top { display: flex; align-items: baseline; justify-content: space-between; }
.hd-range-lbl { font-size: 13px; font-weight: 600; color: var(--fg-2); display: inline-flex; align-items: center; gap: 5px; }
.hd-range-hint { color: var(--fg-4); cursor: help; display: inline-flex; }
.hd-range-val { font-size: 14px; font-weight: 700; color: var(--brand); font-variant-numeric: tabular-nums; }
.hd-range input[type="range"] { width: 100%; accent-color: var(--brand); height: 4px; }

/* ---- Layout wrappers ---- */
.hd-layout { display: flex; flex-direction: column; gap: 16px; }
.hd-row-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.hd-sec-head { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; color: var(--fg-1); margin-top: 4px; flex-wrap: wrap; }
.hd-sec-head svg { color: var(--brand); }
.hd-sec-note { font-size: 12px; font-weight: 500; color: var(--fg-3); margin-left: 2px; }
.hd-sec-sp { flex: 1 1 auto; }

/* ---- Card chung (nếu app chưa có .card thì style tối thiểu) ---- */
.hd-screen .card { background: var(--bg-surface); border: 1px solid var(--border-1); border-radius: var(--radius-card); box-shadow: var(--shadow-card); }
.hd-screen .card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--border-1); }
.hd-screen .card-head h3 { margin: 0; font-size: 14.5px; font-weight: 700; color: var(--fg-1); }
.hd-screen .card-head .sub { font-size: 12px; color: var(--fg-3); margin-top: 3px; }

/* ---- Hero ---- */
.hd-hero { display: grid; grid-template-columns: auto minmax(0, 1.3fr) minmax(0, 1fr); gap: 26px; align-items: center; padding: 22px 26px; }
.hd-hero.is-compact { padding: 18px 22px; gap: 20px; }
.hd-hero-score { display: flex; align-items: center; gap: 18px; }
.hd-hero-score-meta { display: flex; flex-direction: column; gap: 10px; }
.hd-hero-trend { display: flex; flex-direction: column; gap: 2px; }
.hd-hero-trend-lbl { font-size: 11.5px; color: var(--fg-3); font-weight: 600; }
.hd-hero-trend-row { display: flex; align-items: center; gap: 10px; }
.hd-hero-trend-foot { font-size: 10.5px; color: var(--fg-4); margin-top: 3px; }
.hd-hero-dims { min-width: 0; }
.hd-hero-dims-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.hd-hero-dims-head > span:first-child { font-size: 13px; font-weight: 700; color: var(--fg-1); }
.hd-hero-dims-note { font-size: 11px; color: var(--fg-4); }
.hd-hero-kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }

/* ---- KPI ---- */
.hd-kpi { display: flex; align-items: center; gap: 10px; min-width: 0; }
.hd-kpi-ic { width: 34px; height: 34px; border-radius: 9px; background: var(--bg-sunken); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.hd-kpi-ic svg { width: 15px; height: 15px; }
.hd-kpi-val { font-size: 19px; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.hd-kpi-lbl { font-size: 11.5px; font-weight: 600; color: var(--fg-3); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hd-kpi-sub { font-size: 11px; color: var(--fg-4); margin-top: 1px; }

/* ---- KPI strip (bố cục B) ---- */
.hd-kpistrip { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; background: var(--bg-surface); border: 1px solid var(--border-1); border-radius: var(--radius-card); box-shadow: var(--shadow-card); padding: 16px 18px; }

/* ---- 5 chiều (thanh) ---- */
.hd-dimbars { display: flex; flex-direction: column; }
.hd-dimrow { display: flex; align-items: center; gap: 10px; }
.hd-dimrow-lbl { flex-shrink: 0; display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--fg-2); }
.hd-dimrow-dot { width: 8px; height: 8px; border-radius: 2px; flex-shrink: 0; }
.hd-dimrow-name { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hd-dimrow-num { font-size: 13.5px; font-weight: 800; color: var(--fg-1); font-variant-numeric: tabular-nums; }
.hd-dimrow-num.low { color: var(--fg-4); }
.hd-dimrow-track { flex: 1; background: var(--bg-sunken); border: 1px solid var(--border-1); border-radius: 999px; overflow: hidden; min-width: 36px; box-sizing: border-box; }
.hd-dimrow-fill { display: block; height: 100%; border-radius: 999px 1px 1px 999px; box-sizing: border-box; transition: width 500ms var(--ease-out); }
.hd-dimrow-wt { font-size: 10.5px; font-weight: 700; color: var(--fg-4); width: 32px; text-align: right; font-variant-numeric: tabular-nums; }

/* ---- Chiều dạng viên (cho hàng bảng) ---- */
.hd-dimpills { display: inline-flex; gap: 5px; flex-wrap: wrap; }
.hd-dimpill { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 700; color: var(--fg-2); background: var(--bg-sunken); border-radius: 6px; padding: 2px 6px; font-variant-numeric: tabular-nums; border: 1px solid transparent; }
.hd-dimpill.low { color: var(--fg-4); opacity: .5; border: 1px dashed var(--border-2); }
.hd-dimpill-dot { width: 6px; height: 6px; border-radius: 2px; flex-shrink: 0; }

/* ---- Badges / chips ---- */
.hd-tier { display: inline-flex; align-items: center; gap: 5px; font-weight: 700; border-radius: 999px; white-space: nowrap; }
.hd-tier.md { font-size: 12.5px; padding: 4px 11px; }
.hd-tier.sm { font-size: 11.5px; padding: 2px 8px; }
.hd-tier svg { width: 12px; height: 12px; }
.hd-insuff { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; color: var(--fg-3); background: var(--slate-100); border: 1px dashed var(--border-strong); border-radius: 999px; white-space: nowrap; }
.hd-insuff.md { font-size: 11.5px; padding: 2px 9px; } .hd-insuff.sm { font-size: 11px; padding: 1px 7px; }
.hd-insuff svg { width: 11px; height: 11px; }
.hd-wl { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; border-radius: 999px; white-space: nowrap; border: 1px solid var(--border-2); color: var(--fg-3); background: var(--bg-sunken); }
.hd-wl.strong { color: var(--info-600); background: var(--status-info-bg); border-color: var(--info-100); }
.hd-wl.md { font-size: 11.5px; padding: 2px 8px; } .hd-wl.sm { font-size: 11px; padding: 1px 7px; }
.hd-wl svg { width: 11px; height: 11px; }
.hd-conf { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--fg-3); }
.hd-conf-dot { width: 7px; height: 7px; border-radius: 999px; flex-shrink: 0; }
.hd-flagchips { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.hd-flagchip { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; color: var(--warning-700); background: var(--status-warning-bg); border: 1px solid var(--warning-100); border-radius: 999px; white-space: nowrap; }
.hd-flagchip.md { font-size: 11.5px; padding: 2px 8px; } .hd-flagchip.sm { font-size: 11px; padding: 1px 7px; }
.hd-flagchip svg { width: 11px; height: 11px; }

/* ---- Xu hướng ---- */
.hd-trend { display: inline-flex; align-items: center; gap: 3px; font-weight: 700; font-variant-numeric: tabular-nums; }
.hd-trend.md { font-size: 13px; } .hd-trend.sm { font-size: 12px; }
.hd-trend svg { width: 13px; height: 13px; }
.hd-trend.small { color: var(--fg-4); font-weight: 600; gap: 4px; }

/* ---- Đèn tin cậy đúng hạn ---- */
.hd-reliab { display: inline-flex; align-items: center; gap: 7px; }
.hd-reliab-dot { width: 9px; height: 9px; border-radius: 999px; flex-shrink: 0; }
.hd-reliab b { font-size: 13px; font-weight: 700; color: var(--fg-1); font-variant-numeric: tabular-nums; }

/* ---- Avatar (fallback nếu app chưa có .avatar) ---- */
.hd-screen .avatar { display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; background: var(--brand-soft); color: var(--brand); font-weight: 700; flex-shrink: 0; }
.hd-screen .avatar-xs { width: 24px; height: 24px; font-size: 10px; }
.hd-screen .avatar-sm { width: 34px; height: 34px; font-size: 12.5px; }
.hd-screen .avatar-lg { width: 52px; height: 52px; font-size: 18px; }

/* ---- Ô tìm kiếm header bảng ---- */
.hd-emp-head-r { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }
.hd-search { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 10px; border: 1px solid var(--border-2); border-radius: 9px; background: var(--bg-surface); color: var(--fg-3); min-width: 200px; transition: border-color var(--dur-fast); }
.hd-search:focus-within { border-color: var(--brand); color: var(--brand); }
.hd-search input { border: 0; background: transparent; outline: none; font-family: inherit; font-size: 13px; color: var(--fg-1); flex: 1; min-width: 0; }
.hd-search-x { border: 0; background: var(--bg-sunken); width: 18px; height: 18px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; color: var(--fg-3); cursor: pointer; flex-shrink: 0; }
.hd-search-x:hover { background: var(--slate-200); color: var(--fg-1); }

/* ---- Nổi bật người dưới 70 ---- */
.hd-emp-row.is-under70 td:first-child { box-shadow: inset 3px 0 0 var(--error-500); }
.hd-emp-row.is-under70 { background: color-mix(in oklab, var(--error-500) 4%, transparent); }
.hd-emp-row.is-under70:hover { background: color-mix(in oklab, var(--error-500) 8%, transparent); }

/* ---- Side cards (support / cảnh báo) ---- */
.hd-side-card { display: flex; flex-direction: column; overflow: hidden; }
.hd-side-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 26px 16px; color: var(--fg-3); font-size: 13px; text-align: center; }
.hd-side-empty svg { color: var(--success-500); }
.hd-support-row { display: flex; align-items: center; gap: 11px; padding: 11px 18px; border: 0; background: transparent; width: 100%; text-align: left; cursor: pointer; border-bottom: 1px solid var(--border-1); font-family: inherit; }
.hd-support-row:last-child { border-bottom: 0; }
.hd-support-row:hover { background: var(--bg-sunken); }
.hd-support-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.hd-support-name { font-size: 13.5px; font-weight: 600; color: var(--fg-1); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hd-support-sub { font-size: 12px; color: var(--fg-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hd-support-score { font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; flex-shrink: 0; }

/* ---- Employee table ---- */
.hd-emp-card { overflow: hidden; }
.hd-emp-head { flex-wrap: wrap; gap: 10px; }
.hd-sort-row { display: inline-flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.hd-sort-lbl { font-size: 11.5px; font-weight: 700; color: var(--fg-3); text-transform: uppercase; letter-spacing: 0.04em; margin-right: 2px; }
.hd-sort { border: 1px solid var(--border-2); background: var(--bg-surface); color: var(--fg-2); font-family: inherit; font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 7px; cursor: pointer; }
.hd-sort:hover { border-color: var(--border-strong); }
.hd-sort.on { color: var(--brand); border-color: var(--brand); background: var(--brand-soft); }
.hd-emp-tablewrap { overflow-x: auto; }
.hd-emp-table { width: 100%; border-collapse: collapse; }
.hd-emp-table th { font-size: 11.5px; font-weight: 700; color: var(--fg-3); text-transform: uppercase; letter-spacing: 0.03em; padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--border-1); white-space: nowrap; background: var(--bg-sunken); }
.hd-emp-table td { padding: 11px 14px; border-bottom: 1px solid var(--border-1); vertical-align: middle; }
.hd-emp-table tr:last-child td { border-bottom: 0; }
.hd-emp-row { cursor: pointer; transition: background var(--dur-fast); }
.hd-emp-row:hover { background: var(--bg-sunken); }
.hd-emp-row.is-selected { background: var(--brand-soft); }
.hd-emp-name { font-size: 13.5px; font-weight: 600; color: var(--fg-1); display: flex; align-items: center; gap: 6px; }
.hd-emp-real { color: var(--success-500); font-size: 9px; }
.hd-emp-role { font-size: 11.5px; color: var(--fg-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 200px; }
.hd-muted { color: var(--fg-4); }
.hd-empty { text-align: center; color: var(--fg-3); padding: 32px; font-size: 13.5px; }

/* ---- Table grid (bố cục B) ---- */
.hd-table-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.hd-table-side { display: flex; flex-direction: column; gap: 16px; }

/* ---- Drawer chi tiết ---- */
.hd-drawer-scrim { position: fixed; inset: 0; background: var(--bg-overlay); z-index: 1300; animation: hdFade var(--dur-base) var(--ease-out); }
.hd-drawer { position: fixed; top: 0; right: 0; bottom: 0; width: 440px; max-width: calc(100vw - 24px); background: var(--bg-surface); z-index: 1301; display: flex; flex-direction: column; box-shadow: var(--shadow-pop); animation: hdSlide var(--dur-slow) var(--ease-out); }
@keyframes hdFade { from { opacity: 0; } }
@keyframes hdSlide { from { transform: translateX(28px); opacity: 0; } }
.hd-drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--border-1); }
.hd-drawer-name { font-size: 16px; font-weight: 700; color: var(--fg-1); }
.hd-drawer-role { font-size: 12.5px; color: var(--fg-3); margin-top: 2px; }
.hd-drawer .close { border: 0; background: var(--bg-sunken); width: 32px; height: 32px; border-radius: 8px; color: var(--fg-2); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.hd-drawer .close:hover { background: var(--slate-200); }
.hd-drawer-body { flex: 1; overflow-y: auto; padding: 18px 20px; display: flex; flex-direction: column; gap: 18px; }
.hd-drawer-score { display: flex; align-items: center; gap: 18px; }
.hd-drawer-score-side { display: flex; flex-direction: column; gap: 9px; }
.hd-drawer-trend { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--fg-3); font-weight: 600; }
.hd-drawer-sect-h { font-size: 12.5px; font-weight: 700; color: var(--fg-1); margin-bottom: 10px; }
.hd-drawer-ci { display: flex; flex-direction: column; gap: 8px; }
.hd-drawer-ci > div { display: flex; align-items: baseline; gap: 8px; font-size: 13px; }
.hd-drawer-ci b { color: var(--fg-1); margin-left: auto; }
.hd-drawer-ci .hd-ci-pm { margin-left: 0; font-size: 11.5px; color: var(--fg-3); font-weight: 600; }
.hd-flag-row { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--fg-2); background: var(--status-warning-bg); border-radius: 8px; padding: 8px 10px; }
.hd-flag-row svg { color: var(--warning-600); flex-shrink: 0; }
.hd-flag-row span { flex: 1; }
.hd-flag-row b { color: var(--warning-700); font-variant-numeric: tabular-nums; }
.hd-drawer-foot { display: flex; gap: 10px; justify-content: flex-end; padding: 14px 20px; border-top: 1px solid var(--border-1); }
.hd-note-soft { display: flex; align-items: flex-start; gap: 8px; font-size: 12.5px; color: var(--fg-2); background: var(--status-info-bg); border-radius: 9px; padding: 10px 12px; line-height: 1.45; }
.hd-note-soft svg { color: var(--info-600); flex-shrink: 0; margin-top: 1px; }

/* ---- Settings panel ---- */
.hd-settings { position: fixed; top: 0; right: 0; bottom: 0; width: 380px; max-width: calc(100vw - 24px); background: var(--bg-surface); z-index: 1301; display: flex; flex-direction: column; box-shadow: var(--shadow-pop); animation: hdSlide var(--dur-slow) var(--ease-out); }
.hd-settings-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--border-1); }
.hd-settings-head h3 { margin: 0; font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 9px; color: var(--fg-1); }
.hd-settings-head .close { border: 0; background: var(--bg-sunken); width: 32px; height: 32px; border-radius: 8px; color: var(--fg-2); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.hd-settings-body { flex: 1; overflow-y: auto; padding: 18px 20px; }
.hd-set-sect { padding-bottom: 18px; margin-bottom: 18px; border-bottom: 1px solid var(--border-1); }
.hd-set-sect:last-child { border-bottom: 0; margin-bottom: 0; }
.hd-set-sect-h { font-size: 13px; font-weight: 700; color: var(--fg-1); margin-bottom: 12px; display: flex; align-items: center; justify-content: space-between; }
.hd-set-reset { display: inline-flex; align-items: center; gap: 4px; border: 0; background: transparent; color: var(--brand); font-family: inherit; font-size: 12px; font-weight: 600; cursor: pointer; }
.hd-set-p { font-size: 12px; color: var(--fg-2); line-height: 1.55; margin: 8px 0 15px; border: 1px dotted var(--border-strong); background: var(--bg-sunken); border-radius: 8px; padding: 9px 11px; }
.hd-set-p:last-child { margin-bottom: 0; }
.hd-set-p b { color: var(--fg-1); }

/* ---- Method note ---- */
.hd-method { background: var(--bg-surface); border: 1px solid var(--border-1); border-radius: var(--radius-card); box-shadow: var(--shadow-card); overflow: hidden; }
.hd-method-toggle { display: flex; align-items: center; gap: 9px; width: 100%; border: 0; background: transparent; padding: 14px 18px; font-family: inherit; font-size: 13.5px; color: var(--fg-1); cursor: pointer; text-align: left; }
.hd-method-toggle svg:first-child { color: var(--brand); }
.hd-method-toggle b { font-weight: 700; }
.hd-method-hint { font-size: 12px; color: var(--fg-3); font-weight: 500; }
.hd-method-toggle > svg:last-child { margin-left: auto; color: var(--fg-3); }
.hd-method-body { padding: 0 18px 18px; font-size: 12.5px; color: var(--fg-2); line-height: 1.55; }
.hd-method-body p { margin: 0 0 12px; }
.hd-method-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px; }
.hd-method-grid > div { background: var(--bg-sunken); border-radius: 9px; padding: 10px; display: flex; flex-direction: column; gap: 2px; }
.hd-method-grid b { font-size: 17px; font-weight: 800; color: var(--brand); font-variant-numeric: tabular-nums; }
.hd-method-grid small { font-size: 10.5px; color: var(--fg-3); line-height: 1.3; }
.hd-method-list { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 5px; }
.hd-method-list b { color: var(--fg-1); }
/* Tiểu tiêu đề "Cách cải thiện từng chỉ số" trong ghi chú phương pháp (YC 2026-07-02) */
.hd-method-subh { display: flex; align-items: center; gap: 7px; margin: 14px 0 8px; font-weight: 700; font-size: 12.5px; color: var(--fg-1); }
.hd-method-subh svg { color: var(--brand); }

/* ---- Panel cảnh báo "Cần chú ý" (3 nhóm) ---- */
.hd-warn-card { display: flex; flex-direction: column; overflow: hidden; }
.hd-warn-groups { display: flex; flex-direction: column; }
.hd-warn-group { border-top: 1px solid var(--border-1); padding: 12px 16px 8px; }
.hd-warn-group:first-child { border-top: 0; }
.hd-warn-ghead { display: flex; align-items: center; gap: 8px; }
.hd-warn-gic { width: 24px; height: 24px; border-radius: 7px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.hd-warn-glabel { font-size: 13px; font-weight: 700; flex: 1; min-width: 0; }
.hd-warn-gcount { font-size: 12px; font-weight: 800; padding: 1px 8px; border-radius: 999px; font-variant-numeric: tabular-nums; }
.hd-warn-gsub { font-size: 11.5px; color: var(--fg-3); margin: 2px 0 6px 32px; }
.hd-warn-rows { display: flex; flex-direction: column; gap: 1px; }
.hd-warn-row { display: flex; align-items: center; gap: 10px; padding: 7px 4px; border: 0; background: transparent; width: 100%; text-align: left; cursor: pointer; border-radius: 8px; font-family: inherit; }
.hd-warn-row:hover { background: var(--bg-sunken); }
.hd-warn-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.hd-warn-more { font-size: 11.5px; color: var(--fg-3); padding: 4px 4px 2px 46px; }

/* ---- Sort phòng ban ---- */
.hd-dept-sort-wrap { display: inline-flex; align-items: center; gap: 6px; }
.hd-dept-sort-lbl { font-size: 11.5px; font-weight: 600; color: var(--fg-3); }
.hd-screen .select.hd-dept-sort { height: 30px; font-size: 12px; min-width: 140px; font-weight: 600; }

/* ---- Dept cards ---- */
.hd-dept-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.hd-dept-grid-lg { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.hd-dept-card { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.hd-dept-top { display: flex; align-items: center; gap: 12px; }
.hd-dept-name { font-size: 14.5px; font-weight: 700; color: var(--fg-1); }
.hd-dept-meta { font-size: 12px; color: var(--fg-3); margin-top: 1px; }
.hd-dept-dims { padding: 2px 0; }
.hd-dept-disp { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding-top: 10px; border-top: 1px dashed var(--border-2); }
.hd-disp-item { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; color: var(--fg-3); font-variant-numeric: tabular-nums; }
.hd-disp-item svg { color: var(--fg-4); }
.hd-disp-item.warn { color: var(--warning-700); }
.hd-disp-item.warn svg { color: var(--warning-600); }
.hd-dept-expand { display: inline-flex; align-items: center; gap: 6px; border: 0; background: transparent; color: var(--brand); font-family: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; padding: 2px 0; }
.hd-dept-members { display: flex; flex-direction: column; gap: 2px; border-top: 1px solid var(--border-1); padding-top: 8px; }
.hd-dept-member { display: flex; align-items: center; gap: 9px; padding: 7px 6px; border: 0; background: transparent; border-radius: 8px; cursor: pointer; width: 100%; text-align: left; font-family: inherit; }
.hd-dept-member:hover { background: var(--bg-sunken); }
.hd-dept-member-name { flex: 1; min-width: 0; font-size: 13px; font-weight: 600; color: var(--fg-1); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hd-dept-member-score { font-size: 15px; font-weight: 800; font-variant-numeric: tabular-nums; min-width: 28px; text-align: right; }

/* ---- Company cards ---- */
.hd-co-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.hd-co-card { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.hd-co-top { display: flex; align-items: center; gap: 12px; }
.hd-co-badge { width: 38px; height: 38px; border-radius: 10px; color: #fff; font-size: 13px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.hd-co-name { font-size: 14.5px; font-weight: 700; color: var(--fg-1); }
.hd-co-micro { padding: 2px 0; }
.hd-co-foot { display: flex; align-items: center; gap: 10px; padding-top: 10px; border-top: 1px dashed var(--border-2); }
.hd-co-warn { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 700; color: var(--error-600); margin-left: auto; }

/* ---- Chip 5 chiều (company/dept gọn) ---- */
.hd-dimchips { display: flex; flex-wrap: wrap; gap: 7px 14px; }
.hd-dimchip { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; white-space: nowrap; }
.hd-dimchip-dot { width: 8px; height: 8px; border-radius: 2px; flex-shrink: 0; }
.hd-dimchip-lbl { color: var(--fg-3); }
.hd-dimchip-val { font-weight: 800; color: var(--fg-1); font-variant-numeric: tabular-nums; }

/* ---- Bố cục C: dải phòng + sidebar cảnh báo ---- */
.hd-dept-side-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.hd-dept-main { display: flex; flex-direction: column; gap: 12px; min-width: 0; }

/* ---- Bố cục D: Phân tích (biểu đồ + bảng) ---- */
.hd-layout-analytics { display: flex; flex-direction: column; gap: 16px; }
.hd-chart-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: stretch; }
.hd-chart-card { display: flex; flex-direction: column; }
.hd-chart-wrap { padding: 6px 16px 16px; }
.hd-svg { width: 100%; height: auto; display: block; overflow: visible; }
.hd-svg-tick { font-size: 11px; fill: var(--fg-4); font-variant-numeric: tabular-nums; }
.hd-svg-barval { font-size: 13px; font-weight: 800; fill: var(--fg-1); font-variant-numeric: tabular-nums; }
.hd-svg-xlbl { font-size: 11.5px; font-weight: 700; fill: var(--fg-2); }
.hd-svg-xsub { font-size: 10px; fill: var(--fg-4); }
.hd-svg-axislbl { font-size: 10.5px; fill: var(--fg-4); font-weight: 600; }
.hd-svg-zone { font-size: 10px; fill: var(--fg-4); font-weight: 600; }
.hd-scatter-dot { cursor: pointer; transition: r var(--dur-fast); }
.hd-scatter-dot:hover { r: 7.5; }

/* Range chart (so sánh phòng ban) */
.hd-rc { padding: 8px 18px 16px; display: flex; flex-direction: column; gap: 2px; }
.hd-rc-axis { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--fg-4); font-variant-numeric: tabular-nums; padding: 0 64px 4px 124px; }
.hd-rc-row { display: flex; align-items: center; gap: 12px; padding: 7px 0; border: 0; background: transparent; width: 100%; cursor: pointer; font-family: inherit; text-align: left; border-radius: 7px; }
.hd-rc-row:hover { background: var(--bg-sunken); }
.hd-rc-name { width: 112px; flex-shrink: 0; font-size: 12.5px; font-weight: 600; color: var(--fg-1); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hd-rc-track { position: relative; flex: 1; height: 18px; min-width: 80px; }
.hd-rc-grid { position: absolute; inset: 0; border-radius: 5px; background: linear-gradient(90deg, var(--slate-100) 1px, transparent 1px) 0 0 / 25% 100%; opacity: 0.9; }
.hd-rc-bar { position: absolute; top: 5px; height: 8px; left: 0; border-radius: 999px; opacity: 0.85; transition: width 500ms var(--ease-out); }
.hd-rc-range { position: absolute; top: 8px; height: 2px; background: var(--fg-3); border-radius: 2px; opacity: 0.45; }
.hd-rc-marker { position: absolute; top: 1px; width: 3px; height: 16px; border-radius: 2px; transform: translateX(-1.5px); box-shadow: 0 0 0 2px var(--bg-surface); }
.hd-rc-val { width: 40px; flex-shrink: 0; text-align: right; font-size: 14px; font-weight: 800; font-variant-numeric: tabular-nums; }

/* Bảng số liệu đầy đủ */
.hd-dt { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.hd-dt-th { font-size: 11px; font-weight: 700; color: var(--fg-3); text-transform: uppercase; letter-spacing: 0.02em; padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--border-1); background: var(--bg-sunken); white-space: nowrap; cursor: pointer; user-select: none; }
.hd-dt-th.r { text-align: right; }
.hd-dt-th.r span { justify-content: flex-end; }
.hd-dt-th span { display: inline-flex; align-items: center; gap: 3px; }
.hd-dt-th:hover { color: var(--fg-1); }
.hd-dt-th.on { color: var(--brand); }
.hd-dt td { padding: 9px 12px; border-bottom: 1px solid var(--border-1); }
.hd-dt tr:last-child td { border-bottom: 0; }
.hd-dt-row { cursor: pointer; }
.hd-dt-row:hover { background: var(--bg-sunken); }
.hd-dt-row.is-under70 td:first-child { box-shadow: inset 3px 0 0 var(--error-500); }
.hd-dt-row.is-under70 { background: color-mix(in oklab, var(--error-500) 4%, transparent); }
.hd-dt-name { font-size: 13px; font-weight: 600; color: var(--fg-1); display: inline-flex; align-items: center; gap: 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 170px; }
.hd-dt-dept { font-size: 12px; color: var(--fg-3); white-space: nowrap; }
.hd-dt-num { text-align: right; font-size: 13px; color: var(--fg-1); white-space: nowrap; }
.hd-dt-num.low { color: var(--fg-4); }
.hd-dt-num.dim { color: var(--fg-4); opacity: 0.55; }
@media (max-width: 1024px) { .hd-chart-row { grid-template-columns: 1fr; } }
@media (max-width: 520px) { .hd-rc-axis { padding-left: 0; padding-right: 44px; } .hd-rc-name { width: 80px; } }

/* ============================================================ RESPONSIVE ============================================================ */
@media (max-width: 1280px) { .hd-dept-side-grid { grid-template-columns: minmax(0, 1fr) 300px; } }
@media (max-width: 1024px) {
  .hd-dept-grid, .hd-co-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hd-dept-side-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .hd-dept-grid, .hd-dept-grid-lg, .hd-co-grid { grid-template-columns: 1fr; }
}
@media (max-width: 1280px) {
  .hd-kpistrip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hd-table-grid { grid-template-columns: minmax(0, 1fr) 300px; }
}
@media (max-width: 1024px) {
  .hd-hero { grid-template-columns: 1fr; gap: 20px; }
  .hd-hero-score { justify-content: flex-start; }
  .hd-table-grid { grid-template-columns: 1fr; }
  .hd-table-side { flex-direction: row; }
  .hd-table-side > * { flex: 1; }
}
@media (max-width: 720px) {
  .hd-row-2 { grid-template-columns: 1fr; }
  .hd-kpistrip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hd-method-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hd-table-side { flex-direction: column; }
  .hd-emp-head-r { width: 100%; }
  .hd-search { flex: 1; min-width: 0; }
  .hd-head-r { width: 100%; }
}
@media (max-width: 520px) {
  .hd-hero-kpis { grid-template-columns: 1fr; }
  .hd-kpistrip { grid-template-columns: 1fr; }
  .hd-title { font-size: 21px; }
}

/* ─────────────────────────────────────────────────────────────────────────
   "Sức khỏe của TÔI" — dialog cá nhân mở từ /cong-viec (CongViecMyHealthDialog).
   Tái dùng bộ class hd-* ở trên; chỉ thêm phần vỏ dialog + avatar + nút đóng.
   ───────────────────────────────────────────────────────────────────────── */
.cvmh-dialog { max-width: 460px; width: 100%; }
.cvmh-root { display: flex; flex-direction: column; gap: 18px; }
.cvmh-head { display: flex; align-items: center; gap: 12px; }
.cvmh-head-txt { min-width: 0; flex: 1; }
.cvmh-head .avatar {
  width: 48px; height: 48px; border-radius: 999px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 17px; color: var(--brand);
  background: color-mix(in oklab, var(--brand) 12%, var(--bg-surface));
}
.cvmh-close {
  border: 1px solid var(--border-1); background: var(--bg-surface); border-radius: 9px;
  width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--fg-3); flex-shrink: 0;
}
.cvmh-close:hover { background: var(--bg-sunken); color: var(--fg-1); }
.cvmh-close svg { width: 20px; height: 20px; }
/* VmIcons (Components) là icon NÉT → ép fill:none;stroke trong dialog (đối xứng fix BUG-0068 ở drawer chi tiết). */
.cvmh-dialog .cvmh-ic, .cvmh-close svg { fill: none; stroke: currentColor; stroke-width: 1.6; }
.cvmh-loading { display: flex; align-items: center; gap: 10px; color: var(--fg-3); font-size: 13px; padding: 24px 0; justify-content: center; }
.cvmh-dimbars { display: flex; flex-direction: column; gap: 10px; }
.cvmh-flags { display: flex; flex-direction: column; gap: 8px; }
.cvmh-trend { display: inline-flex; align-items: center; gap: 2px; font-weight: 800; font-variant-numeric: tabular-nums; }
.cvmh-trend.small { font-weight: 600; color: var(--fg-4); font-size: 11.5px; }
.cvmh-trend-ico { width: 14px; height: 14px; }
/* Lối tắt "Xem báo cáo nhóm" cho quản lý (YC 2026-07-02) */
.cvmh-teamlink { display: flex; align-items: center; gap: 8px; width: 100%; border: 1px solid var(--brand); border-radius: 10px; background: var(--brand-soft); color: var(--brand); padding: 10px 14px; font-family: inherit; font-size: 13px; font-weight: 600; cursor: pointer; text-align: left; transition: background .15s; }
.cvmh-teamlink:hover { background: color-mix(in oklab, var(--brand) 16%, var(--bg-surface)); }
.cvmh-teamlink .cvmh-ic { width: 16px; height: 16px; flex-shrink: 0; }
/* Báo cáo CẢ NHÓM load inline trong modal (YC 2026-07-03) — roster gọn + điểm màu theo tier. */
.cvmh-team { display: flex; flex-direction: column; gap: 10px; border-top: 1px solid var(--border-1); padding-top: 14px; }
.cvmh-team-sum { display: flex; align-items: center; gap: 12px; }
.cvmh-team-sum-txt { display: flex; flex-direction: column; gap: 1px; min-width: 0; font-size: 13px; }
.cvmh-team-list { display: flex; flex-direction: column; gap: 2px; max-height: 220px; overflow-y: auto; }
/* Roster row = NÚT bấm xem chi tiết người đó (YC 2026-07-03) — reset style button. */
.cvmh-team-row { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 8px; width: 100%; border: 0; background: transparent; font-family: inherit; text-align: left; cursor: pointer; transition: background .12s; }
.cvmh-team-row:hover { background: var(--bg-sunken); }
.cvmh-team-row:hover .cvmh-team-chev { color: var(--brand); }
.cvmh-team-name { font-size: 13px; font-weight: 600; color: var(--fg-1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 46%; }
.cvmh-team-dept { font-size: 11.5px; color: var(--fg-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1 1 auto; }
.cvmh-team-lowdata { font-size: 11px; color: var(--fg-4); white-space: nowrap; flex-shrink: 0; }
.cvmh-team-score { margin-left: auto; flex-shrink: 0; min-width: 34px; text-align: center; font-size: 13px; font-weight: 800; font-variant-numeric: tabular-nums; padding: 2px 8px; border-radius: 999px; }
.cvmh-team-score.lg { margin-left: 0; font-size: 20px; min-width: 48px; padding: 6px 12px; }
.cvmh-team-chev { width: 16px; height: 16px; flex-shrink: 0; color: var(--fg-4); }
.cvmh-dialog .cvmh-team-chev { fill: none; stroke: currentColor; stroke-width: 1.6; }
/* Chi tiết 1 người trong nhóm — nút "Quay lại" + header người. */
.cvmh-back { display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; border: 0; background: transparent; color: var(--fg-3); font-family: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; padding: 2px 4px; border-radius: 7px; }
.cvmh-back:hover { background: var(--bg-sunken); color: var(--fg-1); }
.cvmh-back .cvmh-ic { width: 15px; height: 15px; }
.cvmh-emp-head { display: flex; align-items: center; gap: 12px; }

/* "Cách tính điểm" — mô tả chi tiết + ví dụ trong Báo cáo của tôi (YC 2026-07-09). Native <details> gấp/mở,
   gọn, theme-aware (dùng token thiết kế cong-viec-health). Nội dung khớp CongViecHealthCalc. */
.cvmh-guide { border: 1px solid var(--border-1); border-radius: 10px; background: var(--bg-sunken); overflow: hidden; }
.cvmh-guide > summary { display: flex; align-items: center; gap: 8px; padding: 10px 12px; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--fg-2); list-style: none; user-select: none; }
.cvmh-guide > summary::-webkit-details-marker { display: none; }
.cvmh-guide > summary::marker { content: ""; }
.cvmh-guide > summary:hover { color: var(--brand); }
.cvmh-guide[open] > summary { border-bottom: 1px solid var(--border-1); }
.cvmh-dialog .cvmh-guide-ic { width: 15px; height: 15px; flex-shrink: 0; }
.cvmh-guide-body { padding: 12px; display: flex; flex-direction: column; gap: 10px; font-size: 12.5px; line-height: 1.55; color: var(--fg-2); }
.cvmh-guide-p { margin: 0; }
.cvmh-guide-p b { color: var(--fg-1); }
.cvmh-guide-note { margin: 0; font-size: 11.5px; color: var(--fg-3); }
.cvmh-guide-formula { display: block; margin: 3px 0; font-weight: 700; color: var(--fg-1); }
.cvmh-guide-dims { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 5px; }
.cvmh-guide-dims li { padding-left: 2px; }
.cvmh-guide-dims b { color: var(--fg-1); }
.cvmh-guide-tbl { border-collapse: collapse; font-size: 12px; }
.cvmh-guide-tbl th, .cvmh-guide-tbl td { border: 1px solid var(--border-1); padding: 4px 8px; text-align: center; white-space: nowrap; }
.cvmh-guide-tbl th { background: var(--bg-surface); font-weight: 700; color: var(--fg-2); }
.cvmh-guide-tbl-ex { width: 100%; }
.cvmh-guide-tbl-ex td:nth-child(3), .cvmh-guide-tbl-ex th:nth-child(3) { text-align: left; white-space: normal; }
.cvmh-guide-ex { border: 1px dashed var(--border-1); border-radius: 8px; padding: 10px; display: flex; flex-direction: column; gap: 8px; background: var(--bg-surface); overflow-x: auto; }
.cvmh-guide-ex-h { font-weight: 700; color: var(--fg-1); font-size: 12.5px; }
.cvmh-guide-calc { margin: 0; padding-left: 16px; display: flex; flex-direction: column; gap: 3px; }
.cvmh-guide-calc b { color: var(--fg-1); }
.cvmh-guide-total { font-weight: 700; color: var(--brand); font-size: 13px; padding-top: 2px; }
/* Khối "Mẹo tăng điểm" — thẻ nhấn nhẹ sắc thương hiệu, mỗi mẹo gắn nhãn chiều KPI được nâng. */
.cvmh-guide-tips { border: 1px solid color-mix(in srgb, var(--brand) 22%, transparent); border-left: 3px solid var(--brand); border-radius: 8px; padding: 10px 12px; display: flex; flex-direction: column; gap: 7px; background: color-mix(in srgb, var(--brand) 5%, var(--bg-surface)); }
.cvmh-guide-tips-h { font-weight: 700; color: var(--fg-1); font-size: 12.5px; }
.cvmh-guide-tips-list { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; }
.cvmh-guide-tips-list li { padding-left: 2px; }
.cvmh-guide-tips-list b { color: var(--fg-1); }
.cvmh-guide-tip-dim { display: inline-block; margin-left: 4px; font-size: 11px; font-weight: 700; color: var(--brand); white-space: nowrap; }
/* Khối "Lưu ý — điều kéo điểm xuống" — thẻ nhấn sắc cảnh báo, mỗi mục gắn chiều KPI bị giảm (hoặc cờ cảnh báo). */
.cvmh-guide-warn { border: 1px solid color-mix(in srgb, var(--warning-600) 30%, transparent); border-left: 3px solid var(--warning-600); border-radius: 8px; padding: 10px 12px; display: flex; flex-direction: column; gap: 7px; background: color-mix(in srgb, var(--warning-600) 7%, var(--bg-surface)); }
.cvmh-guide-warn-h { font-weight: 700; color: var(--warning-600); font-size: 12.5px; }
.cvmh-guide-warn-list { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; }
.cvmh-guide-warn-list li { padding-left: 2px; }
.cvmh-guide-warn-list b { color: var(--fg-1); }
.cvmh-guide-warn-dim { display: inline-block; margin-left: 4px; font-size: 11px; font-weight: 700; color: var(--warning-600); white-space: nowrap; }

/* ── "Cách tính" — nút chip trên mỗi phần thống kê + modal xem cấu hình chấm điểm theo phạm vi (ADR-060) ── */
.hd-disp-sp { flex: 1 1 auto; }
.hd-cfg-btn { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; color: var(--fg-3); background: var(--bg-sunken); border: 1px solid var(--border-1); border-radius: 999px; padding: 3px 10px; cursor: pointer; font-family: inherit; white-space: nowrap; transition: background .12s, color .12s, border-color .12s; }
.hd-cfg-btn:hover { color: var(--brand); border-color: var(--brand); background: var(--brand-soft); }
.hd-cfg-btn svg { color: var(--fg-4); }
.hd-cfg-btn:hover svg { color: var(--brand); }

.hd-cfg-modal { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 1302; width: min(420px, calc(100vw - 24px)); max-height: 86vh; overflow-y: auto; padding: 0; display: flex; flex-direction: column; box-shadow: var(--shadow-pop); animation: hdFade var(--dur-base) var(--ease-out); }
.hd-cfg-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 16px 18px 12px; border-bottom: 1px solid var(--border-1); }
.hd-cfg-title { font-size: 15px; font-weight: 700; color: var(--fg-1); }
.hd-cfg-src { display: flex; align-items: center; gap: 8px; margin-top: 5px; font-size: 12px; color: var(--fg-3); flex-wrap: wrap; }
.hd-cfg-badge { display: inline-flex; align-items: center; font-size: 11px; font-weight: 700; padding: 2px 9px; border-radius: 999px; }
.hd-cfg-badge.dept { color: var(--brand); background: var(--brand-soft); }
.hd-cfg-badge.org { color: var(--fg-2); background: var(--bg-sunken); }
.hd-cfg-modal .close { border: 0; background: var(--bg-sunken); width: 32px; height: 32px; border-radius: 8px; color: var(--fg-2); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.hd-cfg-modal .close:hover { background: var(--border-1); color: var(--fg-1); }
.hd-cfg-body { padding: 14px 18px 18px; font-size: 12.5px; color: var(--fg-2); line-height: 1.55; }
.hd-cfg-lead { margin: 0 0 12px; }
/* Banner "Kỳ tính điểm" (YC 2026-07-13) — cho biết điểm tính trong khoảng thời gian nào. Nền brand nhạt cho nổi. */
.hd-cfg-period { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; padding: 9px 12px; border-radius: 9px;
  background: var(--brand-soft); color: var(--brand); font-size: 12.5px; line-height: 1.4; }
.hd-cfg-period b { font-weight: 800; font-variant-numeric: tabular-nums; }
/* VmIcons là icon NÉT → ép fill:none;stroke (rule .cvmh-ic không reach dialog riêng này). */
.hd-cfg-period svg { fill: none; stroke: currentColor; stroke-width: 1.6; width: 17px; height: 17px; flex-shrink: 0; }
.hd-cfg-weights { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.hd-cfg-weights > div { background: var(--bg-sunken); border-radius: 9px; padding: 9px 6px; display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; }
.hd-cfg-weights b { font-size: 16px; font-weight: 800; color: var(--brand); font-variant-numeric: tabular-nums; }
.hd-cfg-weights small { font-size: 10px; color: var(--fg-3); line-height: 1.25; }
.hd-cfg-params { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.hd-cfg-params li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 12px; background: var(--bg-sunken); border-radius: 8px; }
.hd-cfg-params span { color: var(--fg-3); }
.hd-cfg-params b { font-size: 14px; font-weight: 800; color: var(--fg-1); font-variant-numeric: tabular-nums; }
.hd-cfg-foot { font-size: 11.5px; color: var(--fg-4); line-height: 1.5; border-top: 1px dashed var(--border-2); padding-top: 12px; }

@media (max-width: 560px) {
  .hd-cfg-modal { width: calc(100vw - 16px); }
  .hd-cfg-weights { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
