/* Biểu đồ dùng chung (shared/charts.js) — Trung Tâm (index.html) và các module (server/routes/apps.js chèn thẳng vào <style>).
   Thanh / cột mảnh bo 4px đầu dữ liệu, lưới mảnh nhạt, chữ dùng màu chữ (không dùng màu dãy), số thẳng cột (tabular-nums) chỉ ở trục / bảng. */
.hc-root, .hc-card, .hc-stats {
  /* In / lưu PDF: giữ màu thanh, cột (trình duyệt mặc định bỏ màu nền khi in). */
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
  --hc-surface: #fff;
  --hc-ink: #0b0b0b;
  --hc-ink-2: #52514e;
  --hc-muted: #6f6d67;
  --hc-grid: #e9e8e2;
  --hc-axis: #c3c2b7;
  --hc-ghost: #c3c2b7;
  --hc-good-t: #006300;
  --hc-bad-t: #b91c1c;
}
.hc-card { margin: 0; padding: 16px 18px 12px; background: var(--hc-surface); border: 1px solid rgba(11, 11, 11, .09); border-radius: 14px; min-width: 0; display: flex; flex-direction: column; gap: 10px; font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif; color: var(--hc-ink); }
.hc-card figcaption { display: flex; flex-direction: column; gap: 2px; }
.hc-card figcaption b { font-size: 15px; font-weight: 700; }
.hc-card figcaption span { font-size: 12.5px; color: var(--hc-muted); line-height: 1.4; }
.hc-gridcards { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 14px; margin: 0 0 16px; align-items: start; }
.hc-gridcards > .hc-wide { grid-column: 1 / -1; }
.hc-empty { padding: 18px 4px; color: var(--hc-muted); font-size: 13px; font-style: italic; }
.hc-muted { color: var(--hc-muted); font-weight: 400; }
.hc-more { font-size: 12px; color: var(--hc-muted); margin-top: 4px; }

/* Ô số liệu */
.hc-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin: 0 0 16px; }
.hc-stat { position: relative; padding: 14px 16px 12px; background: var(--hc-surface); border: 1px solid rgba(11, 11, 11, .09); border-radius: 14px; min-width: 0; font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif; }
.hc-stat.warn { border-color: #f3c3c3; background: #fffafa; }
.hc-stat-l { font-size: 13px; color: var(--hc-ink-2); font-weight: 600; }
.hc-stat-v { font-size: 28px; font-weight: 700; line-height: 1.2; margin: 4px 0 6px; color: var(--hc-ink); overflow-wrap: anywhere; }
.hc-stat-d { display: flex; flex-direction: column; gap: 2px; }
.hc-stat-n { font-size: 12px; color: var(--hc-muted); margin-top: 4px; }
.hc-delta { font-size: 12.5px; color: var(--hc-ink-2); }
.hc-delta b { font-weight: 700; }
.hc-delta.good b { color: var(--hc-good-t); }
.hc-delta.bad b { color: var(--hc-bad-t); }
.hc-delta.none { color: var(--hc-muted); }
.hc-spark-w { position: relative; display: block; height: 28px; margin-top: 8px; }
.hc-spark { display: block; width: 100%; height: 28px; overflow: visible; }
.hc-spark-dot { position: absolute; width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 50%; background: #2a78d6; box-shadow: 0 0 0 2px var(--hc-surface); }

/* Chú thích */
.hc-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12.5px; color: var(--hc-ink-2); }
.hc-legend span { display: inline-flex; align-items: center; gap: 6px; }
.hc-legend b { color: var(--hc-ink); }
.hc-legend small { color: var(--hc-muted); }
.hc-key { display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--c); flex: none; }
.hc-key.line { height: 2px; width: 14px; border-radius: 1px; }
.hc-key.tick { width: 2px; height: 12px; border-radius: 1px; background: #0b0b0b; }

/* Cột theo kỳ */
.hc-cols { position: relative; padding: 18px 0 0 46px; }
.hc-grid { position: absolute; left: 46px; right: 0; top: 18px; height: var(--h); pointer-events: none; }
.hc-gl { position: absolute; left: 0; right: 0; border-top: 1px solid var(--hc-grid); }
.hc-gl.zero { border-top-color: var(--hc-axis); }
.hc-gl span { position: absolute; right: calc(100% + 6px); top: -8px; font-size: 11px; color: var(--hc-muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.hc-colrow { position: relative; display: flex; align-items: stretch; gap: 2px; }
.hc-colgrp { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; border-radius: 6px; outline: none; cursor: default; }
.hc-colgrp:hover .hc-colplot, .hc-colgrp:focus-visible .hc-colplot { background: rgba(42, 120, 214, .06); }
.hc-colplot { position: relative; width: 100%; height: var(--h); border-radius: 6px 6px 0 0; }
.hc-colset { position: absolute; inset: 0; display: flex; justify-content: center; gap: 2px; }
.hc-slot { position: relative; height: 100%; flex: 0 1 22px; min-width: 3px; }
.hc-colbar { position: absolute; left: 0; right: 0; background: var(--c); border-radius: 4px 4px 0 0; }
.hc-colbar.neg { border-radius: 0 0 4px 4px; }
.hc-cap { position: absolute; left: 0; right: 0; transform: translateY(-2px); margin-bottom: 2px; text-align: center; font-style: normal; font-size: 11.5px; font-weight: 700; color: var(--hc-ink); white-space: nowrap; pointer-events: none; }
.hc-x { margin-top: 6px; font-size: 11.5px; color: var(--hc-muted); white-space: nowrap; }
.hc-colgrp.cur .hc-x { color: var(--hc-ink); font-weight: 700; }
.hc-x.hide { visibility: hidden; }

/* Thanh ngang */
.hc-hbars { display: flex; flex-direction: column; gap: 4px; }
.hc-hrow, .hc-brow { display: grid; grid-template-columns: minmax(90px, 30%) 1fr minmax(84px, auto); align-items: center; gap: 10px; padding: 4px 6px; border-radius: 8px; outline: none; }
.hc-hrow:hover, .hc-hrow:focus-visible, .hc-brow:hover, .hc-brow:focus-visible { background: rgba(42, 120, 214, .06); }
.hc-hrow[data-click], .hc-brow[data-click] { cursor: pointer; }
.hc-hl { font-size: 13px; color: var(--hc-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hc-htrack, .hc-btrack { position: relative; display: block; height: 14px; }
.hc-htrack i, .hc-btrack i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--c); border-radius: 0 4px 4px 0; }
.hc-btrack { background: #f1f0eb; border-radius: 4px; }
.hc-btrack i { border-radius: 4px; }
.hc-btrack.big { height: 16px; }
.hc-ref { position: absolute; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; background: #0b0b0b; border-radius: 1px; }
.hc-target { position: absolute; top: -4px; bottom: -4px; width: 2px; margin-left: -1px; background: #52514e; border-radius: 1px; }
.hc-pace { position: absolute; top: -3px; bottom: -3px; width: 0; margin-left: -1px; border-left: 2px solid #2a78d6; }
.hc-hv { font-size: 13px; font-weight: 700; color: var(--hc-ink); white-space: nowrap; text-align: right; display: inline-flex; gap: 6px; justify-content: flex-end; align-items: baseline; font-variant-numeric: tabular-nums; }
.hc-d { font-size: 11.5px; font-weight: 600; color: var(--hc-muted); }
.hc-d.good { color: var(--hc-good-t); }
.hc-d.bad { color: var(--hc-bad-t); }
.hc-rate { font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 999px; }
.hc-rate.r-dat { background: #dcfce7; color: #166534; }
.hc-rate.r-gan { background: #fef3c7; color: #92400e; }
.hc-rate.r-khong { background: #fee2e2; color: #991b1b; }

/* Cơ cấu (xếp chồng) */
.hc-stack { display: flex; gap: 2px; height: 16px; border-radius: 4px; overflow: hidden; }
.hc-stack i { background: var(--c); min-width: 3px; outline: none; }
.hc-stack i:hover, .hc-stack i:focus-visible { filter: brightness(1.08); }
.hc-stack-l { gap: 4px 16px; }

/* Đồng hồ tiến độ */
.hc-meter { outline: none; }
.hc-meter-t { margin-top: 6px; font-size: 13px; color: var(--hc-ink-2); }
.hc-meter-t b { color: var(--hc-ink); }

/* Bảng số liệu */
.hc-tbl { font-size: 12.5px; }
.hc-tbl summary { cursor: pointer; color: var(--hc-muted); width: max-content; }
.hc-tbl-wrap { overflow-x: auto; margin-top: 6px; }
.hc-tbl table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.hc-tbl th, .hc-tbl td { padding: 5px 8px; border-bottom: 1px solid var(--hc-grid); text-align: left; white-space: nowrap; }
.hc-tbl th { color: var(--hc-ink-2); font-weight: 600; }
.hc-tbl .n { text-align: right; }

/* Chú giải khi rê chuột */
.hc-tipbox { position: fixed; z-index: 9999; display: none; min-width: 140px; max-width: 280px; padding: 8px 10px; background: #fff; border: 1px solid rgba(11, 11, 11, .12); border-radius: 10px; box-shadow: 0 8px 24px rgba(15, 23, 42, .14); font: 12.5px/1.45 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif; color: #0b0b0b; pointer-events: none; }
.hc-tip-t { font-weight: 600; color: #52514e; margin-bottom: 3px; }
.hc-tip-r { display: flex; align-items: center; gap: 6px; }
.hc-tip-r i { width: 12px; height: 2px; border-radius: 1px; flex: none; }
.hc-tip-r b { font-variant-numeric: tabular-nums; }
.hc-tip-r span { color: #52514e; }

@media (max-width: 700px) {
  .hc-gridcards { grid-template-columns: 1fr; }
  .hc-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .hc-stat { padding: 12px; }
  .hc-stat-v { font-size: 22px; }
  .hc-hrow, .hc-brow { grid-template-columns: minmax(70px, 34%) 1fr auto; gap: 6px; }
  .hc-cols { padding-left: 40px; }
  .hc-x { font-size: 10px; letter-spacing: -.2px; }
  .hc-grid { left: 40px; }
}
@media print {
  .hc-card, .hc-stat { break-inside: avoid; }
  .hc-tbl { display: none; }
  .hc-tipbox { display: none !important; }
}

/* Báo cáo tổng hợp › Tổng quan — "Bức tranh chung" (public/assets/overview.js) */
.ov { margin: 0 0 8px; }
.ov-filter { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 14px; }
.ov-chip { font: inherit; font-size: 13.5px; font-weight: 600; padding: 7px 14px; border-radius: 999px; border: 1px solid rgba(11, 11, 11, .12); background: #fff; color: #334155; cursor: pointer; }
.ov-chip.on { background: #1843ef; border-color: #1843ef; color: #fff; }
.ov-range { font-size: 13px; color: #6f6d67; margin-left: 6px; }
.ov-sec { margin: 6px 0 4px; }
.ov-h { font-size: 16px; font-weight: 700; color: #0f172a; margin: 18px 0 10px; }
.ov-h-detail { margin-top: 24px; }
.ov-subt { font-size: 12.5px; font-weight: 600; color: #52514e; margin: 12px 0 2px; }
.hc-flow > .hc-stats, .hc-flow > .hc-gridcards { margin-bottom: 0; }
.card.hc-flow { display: flex; flex-direction: column; gap: 14px; }
.card.hc-flow .hc-stat, .card.hc-flow .hc-card { background: #fff; }
.tm-steps-more > summary { cursor: pointer; font-size: 13px; color: #52514e; font-weight: 600; margin: 12px 0 6px; }
