/* Trang công khai — giao diện SÁNG: nền xám rất nhạt, thẻ trắng bóng nhẹ, dải tiêu đề đỏ theo màu logo phường.
   Đọc tốt trên TV phòng họp lẫn điện thoại; màu lĩnh vực chỉ dùng làm điểm nhấn (viền, chấm, số). */
:root {
  --nen: #F3F5F9; --mat: #FFFFFF; --mat-2: #F8FAFC; --vien: #E3E8EF; --chu: #0F172A; --phu: #5B6678; --nhat: #8A94A6;
  --do: #C8102E; --do-dam: #8C0A1F; --vang: #FFCD00;
  --tot: #15803D; --tot-nen: #DCFCE7; --vua: #B45309; --vua-nen: #FEF3C7; --xau: #B91C1C; --xau-nen: #FEE2E2;
  --xam: #475569; --xam-nen: #E2E8F0; --xanh: #0369A1; --xanh-nen: #E0F2FE;
  --bong: 0 1px 2px rgb(15 23 42 / .04), 0 6px 20px rgb(15 23 42 / .06);
  --font: 'Be Vietnam Pro', 'Segoe UI', system-ui, sans-serif; --so: 'JetBrains Mono', ui-monospace, monospace;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--nen); color: var(--chu); font: 400 15px/1.55 var(--font); display: flex; flex-direction: column; }
h1, h2, h3, p, figure, ul { margin: 0; }
a { color: var(--xanh); }
:focus-visible { outline: 3px solid var(--vang); outline-offset: 2px; border-radius: 6px; }

/* Dải tiêu đề */
.dau {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 14px 28px; color: #fff;
  background: linear-gradient(110deg, var(--do-dam) 0%, var(--do) 55%, #E0263F 100%);
  box-shadow: 0 2px 12px rgb(140 10 31 / .25);
}
.dau-trai { display: flex; align-items: center; gap: 14px; min-width: 0; }
.huy-hieu { width: 58px; height: 58px; object-fit: contain; background: #fff; border-radius: 50%; padding: 3px; box-shadow: 0 0 0 3px rgb(255 205 0 / .8); }
.ten-don-vi { font-size: 12.5px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; opacity: .9; }
.tieu-de { font-size: clamp(19px, 2.2vw, 28px); font-weight: 800; letter-spacing: -.01em; line-height: 1.2; }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; padding: 6px 12px; border-radius: 999px; background: rgb(255 255 255 / .16); border: 1px solid rgb(255 255 255 / .28); }
.chip::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #4ADE80; box-shadow: 0 0 0 3px rgb(74 222 128 / .3); }
.dau-phai { text-align: right; }
.dong-ho { font: 700 clamp(24px, 2.6vw, 36px)/1 var(--so); letter-spacing: .02em; }
.ngay { font-size: 13px; opacity: .9; margin-top: 4px; text-transform: capitalize; }

/* Tab lĩnh vực */
.thanh-tab { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 12px; padding: 12px 28px; background: rgb(243 245 249 / .92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--vien); }
.ds-tab { display: flex; gap: 8px; flex-wrap: wrap; flex: 1; }
.ds-tab button, .nut-dung {
  font: 600 14px var(--font); color: var(--phu); background: var(--mat); border: 1px solid var(--vien);
  border-radius: 999px; padding: 9px 16px; min-height: 42px; cursor: pointer; display: inline-flex; align-items: center; gap: 8px;
  transition: background .15s, color .15s, border-color .15s, box-shadow .15s;
}
.ds-tab button:hover { border-color: var(--mau); color: var(--chu); }
.ds-tab .cham { width: 9px; height: 9px; border-radius: 50%; background: var(--mau); }
.ds-tab button[aria-selected="true"] { background: var(--mau); border-color: var(--mau); color: #fff; box-shadow: 0 4px 14px color-mix(in srgb, var(--mau) 35%, transparent); }
.ds-tab button[aria-selected="true"] .cham { background: #fff; }
.nut-dung[aria-pressed="true"] { border-color: var(--vua); color: var(--vua); background: var(--vua-nen); }

main { flex: 1; padding: 20px 28px 28px; }
.bang-lv { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 560px), 1fr)); gap: 18px; align-items: start; }
.bang-lv[hidden] { display: none; }   /* display:grid ở trên đè thuộc tính hidden — thiếu dòng này thì mọi tab hiện cùng lúc */

/* Thẻ một bảng */
.the-bang { background: var(--mat); border: 1px solid var(--vien); border-radius: 16px; box-shadow: var(--bong); padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; min-width: 0; position: relative; overflow: hidden; }
.the-bang::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--mau); }
.the-bang.rong { grid-column: 1 / -1; }
.dau-the { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.the-bang h2 { font-size: 17px; font-weight: 800; letter-spacing: -.005em; }
.mo-ta { font-size: 13px; color: var(--phu); }
.chon-ky { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--phu); }
.chon-ky select { font: 600 14px var(--font); color: var(--chu); background: var(--mat-2); border: 1px solid var(--vien); border-radius: 10px; padding: 7px 30px 7px 12px; min-height: 38px; }
.chon-ky button { font: 600 13px var(--font); border: 1px solid var(--vien); background: var(--mat); border-radius: 10px; padding: 7px 12px; cursor: pointer; }

/* Thẻ số */
.ds-the-so { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.the-so { background: var(--mat-2); border: 1px solid var(--vien); border-radius: 12px; padding: 12px 14px; }
.the-so .nhan-so { font-size: 12.5px; font-weight: 600; color: var(--phu); }
.the-so .gia-tri { font: 800 clamp(24px, 2.4vw, 32px)/1.15 var(--font); color: color-mix(in srgb, var(--mau) 82%, black); font-variant-numeric: tabular-nums; margin-top: 4px; }
.the-so .gia-tri small { font-size: 14px; font-weight: 600; color: var(--phu); margin-left: 3px; }
.the-so.mau-tot { border-color: #BBF7D0; background: #F0FDF4; } .the-so.mau-tot .gia-tri { color: var(--tot); }
.the-so.mau-vua { border-color: #FDE68A; background: #FFFBEB; } .the-so.mau-vua .gia-tri { color: var(--vua); }
.the-so.mau-xau { border-color: #FECACA; background: #FEF2F2; } .the-so.mau-xau .gia-tri { color: var(--xau); }
.the-so.mau-xam .gia-tri { color: var(--xam); }

/* Biểu đồ */
.ds-bieu-do { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 14px; }
.bieu-do { border: 1px solid var(--vien); border-radius: 12px; padding: 12px 14px; background: var(--mat); }
.bieu-do figcaption { font-size: 13.5px; font-weight: 700; margin-bottom: 6px; }
.bieu-do svg { width: 100%; height: auto; display: block; }
.bd-luoi { stroke: #EEF1F5; stroke-width: 1; }
.bd-truc { fill: var(--nhat); font: 500 11px var(--font); }
.bd-so { fill: var(--chu); font: 700 11.5px var(--font); }
.bd-tron-khung { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.bd-tron { width: 150px; flex: none; }
.bd-giua { fill: var(--chu); font: 800 20px var(--font); }
.bd-giua-nho { fill: var(--nhat); font: 500 10px var(--font); }
.chu-giai { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; flex: 1; min-width: 160px; }
.chu-giai .cham { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 8px; vertical-align: -1px; }
.chu-giai li { display: flex; align-items: baseline; gap: 4px; }
.chu-giai .ten-cg { flex: 1; min-width: 0; }
.chu-giai.ngang { flex-direction: row; flex-wrap: wrap; gap: 6px 16px; margin-top: 8px; font-size: 12.5px; color: var(--phu); }
.bd-truc-0 { stroke: #CBD5E1; stroke-width: 1; }
.bd-nen-thanh { fill: #F1F5F9; }
.bd-nhan-ngang { font-size: 12px; fill: var(--phu); }
.bd-dong-ho-khung { display: flex; justify-content: center; }
.bd-dong-ho { width: 100%; max-width: 280px; }

/* Bảng */
.cuon { overflow: auto; max-height: 62vh; border: 1px solid var(--vien); border-radius: 12px; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th { position: sticky; top: 0; z-index: 1; background: var(--mat-2); text-align: left; font-size: 12px; font-weight: 700; color: var(--phu); padding: 10px 12px; border-bottom: 1px solid var(--vien); white-space: nowrap; }
td { padding: 9px 12px; border-bottom: 1px solid #EEF1F5; vertical-align: top; }
tbody tr:nth-child(even) td { background: #FBFCFE; }
tbody tr:hover td { background: color-mix(in srgb, var(--mau) 7%, white); }
tbody tr:last-child td { border-bottom: 0; }
.so { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td.so { font-weight: 600; }
.nhan { display: inline-block; font-size: 12.5px; font-weight: 700; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.nhan-tot { background: var(--tot-nen); color: var(--tot); } .nhan-vua { background: var(--vua-nen); color: var(--vua); }
.nhan-xau { background: var(--xau-nen); color: var(--xau); } .nhan-xam { background: var(--xam-nen); color: var(--xam); }
.nhan-xanh { background: var(--xanh-nen); color: var(--xanh); }
.o-thanh { min-width: 150px; white-space: nowrap; }
.o-thanh b { font-size: 12.5px; margin-left: 8px; font-variant-numeric: tabular-nums; }
.thanh { display: inline-block; width: 90px; height: 8px; border-radius: 99px; background: #EEF1F5; overflow: hidden; vertical-align: middle; }
.thanh-dac { display: block; height: 100%; border-radius: 99px; }
.thanh-tot { background: #22C55E; } .thanh-vua { background: #F59E0B; } .thanh-xau { background: #EF4444; }
.chan-the { font-size: 12px; color: var(--nhat); }
.trong { max-width: 640px; margin: 60px auto; padding: 28px; text-align: center; background: var(--mat); border: 1px solid var(--vien); border-radius: 16px; box-shadow: var(--bong); color: var(--phu); }

.chan { display: flex; justify-content: space-between; gap: 12px; padding: 12px 28px; font-size: 12.5px; color: var(--nhat); border-top: 1px solid var(--vien); background: var(--mat); }
.chan a { color: var(--phu); }

@media (max-width: 640px) {
  .dau, .thanh-tab, main, .chan { padding-inline: 16px; }
  .dau-phai { text-align: left; }
  .the-bang { padding: 14px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
@media print { .thanh-tab, .chan, .chon-ky { display: none; } .bang-lv[hidden] { display: grid !important; } .the-bang { box-shadow: none; break-inside: avoid; } }
