/* Phần riêng của dashboard So sánh đơn vị; style nền (header, tab, thẻ, bảng) dùng lại ../DashboardTongQuanDauTu/style.css */

/* 4 thẻ KPI: mỗi đơn vị 1 thẻ */
.ss-kpis { grid-template-columns: repeat(4, 1fr); }

/* Hàng biểu đồ: mặc định 2 thẻ cạnh nhau; thẻ ss-span-2 chiếm cả hàng */
.ss-row { flex: 1; min-height: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; }
.ss-row:last-child { margin-bottom: 0; }
.ss-span-2 { grid-column: 1 / -1; }

/* Bảng so sánh: ô có giá trị lớn nhất mỗi dòng được tô nền */
.kh-table td.ss-max { font-weight: 700; color: #0b5cad; background: #eaf2fb; }
.kh-table th { white-space: nowrap; text-align: center; }
/* Cột Chỉ tiêu + Đơn vị tính rộng cố định, phần còn lại chia đều cho các cột đơn vị */
.kh-table { table-layout: fixed; width: 100%; }
.kh-table th:nth-child(1) { width: 210px; }
.kh-table th:nth-child(2) { width: 100px; }
.kh-table td:nth-child(-n+2) { white-space: nowrap; }

/* Heatmap so sánh theo hạng mục (nguồn vốn...) */
.ss-heat-wrap { max-height: 100%; overflow: auto; }
.ss-heat { width: 100%; border-collapse: separate; border-spacing: 3px; font-size: 12px; }
.ss-heat th { padding: 6px 8px; color: #3c4a5c; font-weight: 600; text-align: center; }
.ss-heat th:first-child, .ss-heat .ss-heat-name { text-align: left; color: #3c4a5c; white-space: nowrap; }
.ss-heat-cell { text-align: center; padding: 10px 6px; border-radius: 4px; font-weight: 700; color: #111c2b; }
.ss-heat-total { text-align: center; font-weight: 700; color: #0b5cad; }
.ss-heat tfoot td { border-top: 1px solid #cfd6df; padding-top: 8px; }

/* Tiêu đề thẻ đơn vị ở tab Dự án: thanh màu đơn vị bên trái */
.ss-unit-title { border-left: 4px solid #1a6fb5; padding-left: 8px; font-size: 13px; }

/* Heatmap dạng lưới: hàng = hạng mục, cột = đơn vị; ô lấp đầy khung biểu đồ */
.ss-hm { width: 100%; height: 100%; border-collapse: collapse; table-layout: fixed; font-size: 13px; }
.ss-hm thead th { height: 34px; font-weight: 600; color: #3c4a5c; text-align: center; vertical-align: bottom; }
.ss-hm thead th span { display: inline-block; padding-bottom: 2px; }
.ss-hm .ss-hm-row { width: 13%; text-align: right; font-weight: 500; color: #3c4a5c; padding-right: 10px; }
.ss-hm td { text-align: center; font-size: 14px; font-weight: 600; color: #3c2a1a; border: 1px solid #fff; }

/* Bảng có dòng nhóm, dòng con thụt lề và cột Tổng (bảng so sánh đấu thầu) */
.kh-table tr.ss-sec td { background: #f3f6fa; font-weight: 700; color: #111c2b; text-align: left; }
.kh-table td.ss-indent { padding-left: 28px; color: #3c4a5c; }
.kh-table td.ss-total, .kh-table th:last-child { font-weight: 700; }
.kh-table td.ss-total { background: #f7f8fa; }

/* Bảng so sánh đấu thầu: giãn đều các dòng cho đầy khung (height 100%), không cuộn; tiêu đề cột được xuống dòng */
.kh-table.ss-compact { table-layout: fixed; font-size: 12px; height: 100%; }
.kh-table.ss-compact th, .kh-table.ss-compact td { padding: 2px 6px; line-height: 1.2; }
.kh-table.ss-compact th { white-space: normal; text-align: center; font-size: 11px; }
.kh-table.ss-compact td:nth-child(2) { text-align: center; }
.kh-table.ss-compact th:nth-child(1) { width: 30%; text-align: left; }
.kh-table.ss-compact th:nth-child(2) { width: 9%; }
.kh-table.ss-compact th:nth-child(n+3):nth-child(-n+6) { width: 13%; }
.kh-table.ss-compact th:nth-child(7) { width: 9%; }
.kh-table.ss-compact td.ss-indent { padding-left: 18px; }

.kh-table td.ss-min { font-weight: 700; color: #b45f06; background: #fdeedd; }

/* Bảng chiếm cả hàng (bảng so sánh vốn): cột Chỉ tiêu hẹp lại, các cột số rộng hơn */
.kh-table.ss-compact.ss-label-narrow th:nth-child(1) { width: 20%; }
