/* Dashboard báo cáo dòng tiền tuần — Fina.
   Nội dung, nhãn, màu số liệu và thứ tự khối chép sheet DASHBOARD của Tài chính (dải xanh #0070C0,
   thẻ KPI #F5F5F5 viền #BFBFBF, màu từng biểu đồ). Phần khung (chữ, khoảng cách, trạng thái,
   chuyển động) theo kiểu "sổ cái": khung không màu, màu chỉ nằm trên số liệu.

   Lưới: khung tối đa 1440px, lề 24px, MỘT khoảng cách 16px cho mọi hàng/cột.
   4 thẻ KPI = 4 × w + 3 × 16; mỗi biểu đồ = 2 × w + 16 → mép biểu đồ trùng mép thẻ KPI. */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("phong/inter-vietnamese.woff2") format("woff2-variations");
  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: "Inter";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("phong/inter-latin-ext.woff2") format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("phong/inter-latin.woff2") format("woff2-variations");
  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;
}

:root {
  /* khung */
  --nen: #f2f4f7;          /* nền sổ cái xám xanh, một bậc dưới trắng */
  --mat: #ffffff;
  --vien: #e3e6ea;
  --vien-dk: #d1d5db;      /* viền ô chọn / nút */
  --chu: #0a0a0a;
  --chu-phu: #5f6368;      /* 6,1:1 trên trắng, 5,6:1 trên #F5F5F5 */
  --chinh: #1d1f20;        /* nút chính: gần đen */
  --vong: #0070c0;         /* vòng focus = xanh tiêu đề của Tài chính */

  /* màu của file Tài chính — chỉ trên số liệu */
  --tc-dai: #0070c0;
  --tc-the: #f5f5f5;
  --tc-the-vien: #bfbfbf;
  --tc-xanh: #2e7d32;
  --tc-do: #c00000;
  --tc-chip: #378add;
  --rr-an-toan: #e6f1fb;
  --rr-hmtd: #fff4d6;
  --rr-canh-bao: #fcebeb;

  --r-to: 12px;
  --r-the: 8px;
  --r-nut: 6px;
  --r-chip: 4px;
  --gap: 16px;
  --font: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --em-ra: cubic-bezier(0.23, 1, 0.32, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--nen);
  color: var(--chu);
  font: 400 14px/1.45 var(--font);
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
}
h1, h2, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }
img { display: block; }
[hidden] { display: none !important; }
.so-bang { font-variant-numeric: tabular-nums; }
.ma { font-weight: 600; }

:focus-visible { outline: 2px solid var(--vong); outline-offset: 2px; }

.bo-qua {
  position: absolute; left: 12px; top: -48px; z-index: 10;
  background: var(--chinh); color: #fff; padding: 8px 12px; border-radius: var(--r-nut);
  text-decoration: none; font-weight: 500;
}
.bo-qua:focus { top: 8px; }

.khung { max-width: 1440px; margin: 0 auto; padding: 0 24px; }

/* ───── thanh trên (không có sidebar: trang báo cáo, ít đích đến) ───── */
.thanh__trong { display: flex; align-items: center; gap: 16px; height: 52px; }
.thuong-hieu { display: flex; align-items: center; gap: 10px; color: var(--chu); text-decoration: none; min-width: 0; }
.thuong-hieu__dau { width: 22px; height: 22px; }
.thuong-hieu__ten { font-size: 16px; font-weight: 700; letter-spacing: -0.01em; }
.thuong-hieu__phu { color: var(--chu-phu); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tai-khoan { margin-left: auto; display: flex; align-items: center; gap: 8px; min-width: 0; }
.tai-khoan__ten { color: var(--chu-phu); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
.tai-khoan form { display: contents; }

/* ───── nút ───── */
.nut {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 36px; padding: 0 14px; border-radius: var(--r-nut);
  font: 500 14px/1 var(--font); text-decoration: none; cursor: pointer;
  border: 1px solid transparent; white-space: nowrap;
  transition: transform 120ms var(--em-ra), background-color 150ms ease, border-color 150ms ease;
}
.nut:active { transform: scale(0.97); }
.nut--chinh { background: var(--chinh); color: #fff; }
.nut--vien { background: var(--mat); color: var(--chu); border-color: var(--vien-dk); }
.nut--chu { background: transparent; color: var(--chu-phu); height: 32px; padding: 0 8px; }
/* Không bấm được (chưa nối sheet / đang chờ Fina): vẫn đọc rõ, vẫn focus được để nghe lý do. */
.nut[aria-disabled="true"] { color: var(--chu-phu); background-color: #f7f8fa; cursor: not-allowed; }
.nut[aria-disabled="true"]:active { transform: none; }
.nut[aria-busy="true"] { cursor: progress; }
.nut--chinh[aria-disabled="true"] { background: #6b7075; color: #fff; }
@keyframes quay { to { transform: rotate(360deg); } }
.nut[aria-busy="true"] .bt--lam-moi { animation: quay 900ms linear infinite; }
@media (hover: hover) and (pointer: fine) {
  .nut--chinh:not([aria-disabled="true"]):hover { background: #000; }
  .nut--vien:not([aria-disabled="true"]):hover { border-color: #9ca3af; }
  .nut--chu:hover { color: var(--chu); }
}

/* Nút chữ nhỏ trong thẻ KPI ("Nhập hạn mức"): gạch chân nhạt, không đổi chiều cao dòng nhãn. */
.nut-nho {
  appearance: none; border: 0; background: transparent; cursor: pointer; flex: none;
  margin: -3px -5px -3px 0; padding: 3px 5px; border-radius: var(--r-chip);
  font: 500 12px/1.3 var(--font); color: #262626;
  text-decoration: underline; text-decoration-color: #b8bcc2; text-underline-offset: 3px;
  transition: transform 120ms var(--em-ra), text-decoration-color 150ms ease;
}
.nut-nho:active { transform: scale(0.97); }
@media (hover: hover) and (pointer: fine) { .nut-nho:hover { text-decoration-color: currentColor; } }
.bt { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

.the-nho {
  display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 999px;
  font-size: 12px; font-weight: 500; white-space: nowrap; flex: none;
}
.the-nho--canh { background: #fffbeb; color: #92400e; box-shadow: inset 0 0 0 1px #fde68a; }

/* ───── thanh chọn bản báo cáo ───── */
.chon { display: flex; align-items: flex-end; gap: var(--gap); flex-wrap: wrap; padding: 4px 0 var(--gap); }
.chon__o { display: grid; gap: 6px; min-width: 0; }
.chon__o label { font-size: 12px; font-weight: 500; color: var(--chu-phu); }
.chon__o--ban { flex: 0 1 412px; }
.chon__o--ban select { width: 100%; }
.chon__o--brand select { width: 200px; }
.chon__trang-thai { color: var(--chu-phu); font-size: 13px; min-height: 36px; display: flex; align-items: center; }
/* Nối sheet: câu trạng thái + nút "Làm mới từ sheet", dồn phải cùng nút mở file. Câu dài thêm
   thì mọc sang trái trong cùng hàng — không đẩy gì xuống dòng dưới. */
.chon__sheet { margin-left: auto; display: flex; align-items: center; gap: 12px; min-width: 0; }
.chon__tin {
  color: var(--chu-phu); font-size: 13px; line-height: 1.35; text-align: right; max-width: 380px;
  font-variant-numeric: tabular-nums;
}
.chon__tin:empty { display: none; }
.chon__tin--xong { color: var(--chu); }
.chon__tin--loi { color: var(--tc-do); }
select {
  appearance: none; -webkit-appearance: none;
  height: 36px; padding: 0 34px 0 12px; border-radius: var(--r-nut);
  border: 1px solid var(--vien-dk); background-color: var(--mat); color: var(--chu);
  font: 500 14px/1 var(--font); font-variant-numeric: tabular-nums; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M3 4.5 6 7.5 9 4.5' fill='none' stroke='%235f6368' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
  text-overflow: ellipsis;
}
select:disabled { color: var(--chu-phu); background-color: #f7f8fa; cursor: not-allowed; }
@media (hover: hover) and (pointer: fine) { select:not(:disabled):hover { border-color: #9ca3af; } }

.thong-bao {
  margin: 0 0 var(--gap); padding: 8px 12px; border-radius: var(--r-nut);
  background: #fffbeb; box-shadow: inset 0 0 0 1px #fde68a; color: #92400e; font-size: 13px;
}

/* ───── tờ báo cáo (= sheet DASHBOARD) ───── */
.to {
  background: var(--mat); border: 1px solid var(--vien); border-radius: var(--r-to);
  overflow: hidden; margin-bottom: 32px;
}
.dai {
  display: flex; align-items: center; gap: 14px;
  background: var(--tc-dai); color: #fff; padding: 12px 20px; min-height: 64px;
}
.dai__logo { width: 30px; height: 30px; flex: none; filter: brightness(0) invert(1); }
.dai__ten { font-size: 22px; line-height: 1.25; font-weight: 700; letter-spacing: -0.01em; }
.dai__phu { margin-left: auto; font-size: 13px; font-weight: 500; white-space: nowrap; text-align: right; }
/* Nguồn số: trắng gần đủ (≥ 4,5:1 trên #0070C0), nhẹ hơn nhãn bản một bậc. */
.dai__nguon { font-size: 12px; font-weight: 400; color: rgba(255, 255, 255, 0.94); }
.dai__nguon:empty { display: none; }

.vung-so { display: grid; gap: var(--gap); padding: 20px; }
/* Đổi bản / brand: số mờ nhẹ rồi hiện lại (≤ 180ms, chỉ opacity) — báo "số đã đổi" mà không làm
   chậm người xem. Đang tải: giữ số cũ, mờ đi, không nhảy bố cục. */
.vung-so { transition: opacity 180ms var(--em-ra); }
.to[aria-busy="true"] .vung-so { opacity: 0.5; transition-duration: 120ms; }
.vung-so.dang-doi { opacity: 0.35; transition: none; }

/* KPI: 4 thẻ một hàng như file Tài chính */
.kpi { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--gap); }
.the-kpi {
  background: var(--tc-the); border: 1px solid var(--tc-the-vien); border-radius: var(--r-the);
  padding: 12px 16px 14px; min-width: 0;
}
.the-kpi__nhan { font-size: 13px; font-weight: 500; color: #262626; line-height: 1.3; }
.the-kpi__dau { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; min-width: 0; }
.the-kpi__so {
  margin: 6px 0 4px; font-size: 24px; line-height: 1.15; font-weight: 700; letter-spacing: -0.01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.the-kpi--chinh .the-kpi__so { font-size: 32px; line-height: 1.05; }
.the-kpi__so--trong { color: var(--chu-phu); font-weight: 500; }
.the-kpi__phu { font-size: 12px; color: var(--chu-phu); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.am { color: var(--tc-do); }
.vk--tang { color: var(--tc-xanh); }
.vk--giam { color: var(--tc-do); }
.vk--bang, .vk--trong { color: var(--chu-phu); }

/* 4 biểu đồ 2×2 */
.luoi-bd { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); }
.bd { border: 1px solid var(--vien); border-radius: var(--r-the); padding: 14px 16px 12px; min-width: 0; display: flex; flex-direction: column; }
.bd__dau { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.bd__ten { font-size: 14px; line-height: 1.35; font-weight: 600; }
.bd__ve { height: 240px; margin-top: 6px; }
.bd__ve--co-chip { height: 212px; }
.bd__ve--cao { height: 262px; }

.chu-giai { display: flex; gap: 14px; font-size: 12px; color: var(--chu-phu); }
.chu-giai li { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.mau { display: inline-block; width: 18px; height: 0; }
.mau--kh { border-top: 2px dashed #888780; }
.mau--fc { border-top: 2px solid #1d9e75; position: relative; }
.mau--fc::after {
  content: ""; position: absolute; left: 5px; top: -5.5px; width: 7px; height: 7px;
  border-radius: 50%; background: #1d9e75;
}

/* % đạt theo kênh dưới biểu đồ thu (file Tài chính: chữ đậm nhỏ #378ADD) */
.ty-le { display: flex; justify-content: space-around; gap: 8px; flex-wrap: wrap; padding: 6px 0 2px; }
.ty-le li { color: var(--tc-chip); font-size: 12px; font-weight: 700; white-space: nowrap; }

/* Rủi ro thanh khoản: nền theo trạng thái như định dạng có điều kiện của file */
.rui-ro { border-radius: var(--r-the); padding: 14px 18px 16px; border: 1px solid transparent; }
.rui-ro--an-toan { background: var(--rr-an-toan); border-color: #cfe2f5; }
.rui-ro--hmtd { background: var(--rr-hmtd); border-color: #f0dfa6; }
.rui-ro--canh-bao { background: var(--rr-canh-bao); border-color: #f1c8c8; }
.rui-ro--trong { background: #f7f8fa; border-color: var(--vien); }
.rui-ro__dau { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.rui-ro__ten { font-size: 15px; font-weight: 700; }
.rui-ro__the {
  display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 999px;
  font-size: 12px; font-weight: 600; background: rgba(255, 255, 255, 0.75); white-space: nowrap;
}
.rui-ro--an-toan .rui-ro__the { color: #0b4f8a; }
.rui-ro--hmtd .rui-ro__the { color: #7a4b00; }
.rui-ro--canh-bao .rui-ro__the { color: #a11212; }
.rui-ro__cau { margin-top: 6px; font-size: 14px; line-height: 1.55; max-width: 120ch; }

/* Lịch sử cập nhật: gập sẵn, dưới ô rủi ro; 5 dòng mới nhất. */
.lich-su { border: 1px solid var(--vien); border-radius: var(--r-the); }
.lich-su__dau {
  display: flex; align-items: center; gap: 6px; list-style: none; cursor: pointer;
  padding: 10px 14px; font-size: 13px; font-weight: 600; border-radius: var(--r-the);
}
.lich-su__dau::-webkit-details-marker { display: none; }
.lich-su__mui { color: var(--chu-phu); transition: transform 150ms var(--em-ra); }
.lich-su[open] .lich-su__mui { transform: rotate(90deg); }
.lich-su__ds { display: grid; gap: 6px; padding: 0 14px 12px; font-size: 13px; }
.lich-su__ds li { display: grid; grid-template-columns: 88px minmax(0, 1fr) auto; gap: 12px; align-items: baseline; }
.lich-su__gio { color: var(--chu-phu); }
.lich-su__ai { color: var(--chu-phu); text-align: right; overflow-wrap: anywhere; }

/* Hộp hạn mức (<dialog> modal): thứ duy nhất nổi trên trang nên có bóng; hiện ra 180ms
   (mờ + co 0.97 → 1, giữa màn hình), đóng ngay. */
.hop {
  width: min(620px, calc(100vw - 32px)); max-height: calc(100vh - 32px); padding: 0; border: 0;
  border-radius: var(--r-to); background: var(--mat); color: var(--chu);
  box-shadow: 0 24px 64px rgba(15, 17, 20, 0.18), 0 2px 8px rgba(15, 17, 20, 0.08);
  opacity: 1; transform: scale(1);
  transition: opacity 180ms var(--em-ra), transform 180ms var(--em-ra);
}
.hop::backdrop { background: rgba(15, 17, 20, 0.32); transition: opacity 180ms var(--em-ra); }
@starting-style {
  .hop[open] { opacity: 0; transform: scale(0.97); }
  .hop[open]::backdrop { opacity: 0; }
}
.hop__than { display: grid; gap: 16px; padding: 20px 24px 20px; }
.hop__dau { display: grid; gap: 6px; }
.hop__ten { font-size: 17px; line-height: 1.3; font-weight: 700; }
.hop__phu { font-size: 13px; line-height: 1.5; color: var(--chu-phu); }
.hop__tin { flex: 1; min-width: 0; font-size: 13px; line-height: 1.4; color: var(--chu-phu); }
.hop__tin--loi { color: var(--tc-do); }
.hop__nut { display: flex; align-items: center; justify-content: flex-end; gap: 8px; min-height: 36px; padding-top: 4px; }

.luoi-hm { width: 100%; border-collapse: collapse; table-layout: fixed; font-variant-numeric: tabular-nums; }
.luoi-hm th, .luoi-hm td { padding: 4px 0 4px 8px; }
.luoi-hm thead th { font-size: 12px; font-weight: 500; color: var(--chu-phu); text-align: right; padding-right: 11px; }
.luoi-hm thead td { width: 35%; padding: 0; }
.luoi-hm th[scope="row"] { padding-left: 0; text-align: left; font-size: 13px; font-weight: 500; color: #262626; line-height: 1.3; }
.luoi-hm tfoot th, .luoi-hm tfoot td { border-top: 1px solid var(--vien); padding-top: 10px; }
.luoi-hm tfoot th[scope="row"] { font-weight: 600; color: var(--chu); }
.luoi-hm__cong { display: block; font-size: 12px; font-weight: 400; color: var(--chu-phu); }
.luoi-hm output { display: block; text-align: right; padding-right: 11px; font-size: 15px; font-weight: 600; }
.o-so {
  width: 100%; height: 38px; padding: 0 10px; border: 1px solid var(--vien-dk); border-radius: var(--r-nut);
  background: var(--mat); color: var(--chu); font: 500 14px/1 var(--font); font-variant-numeric: tabular-nums;
  text-align: right; transition: border-color 150ms ease, background-color 150ms ease;
}
.o-so:focus-visible { outline-offset: -1px; }
.o-so[aria-invalid="true"] { border-color: var(--tc-do); background: #fff7f7; }
.o-so:read-only { background: #f7f8fa; color: var(--chu-phu); }
@media (hover: hover) and (pointer: fine) { .o-so:not(:focus):not([aria-invalid="true"]):hover { border-color: #9ca3af; } }
.o-doc { display: block; height: 38px; line-height: 38px; text-align: right; padding-right: 11px; font-size: 14px; font-weight: 500; }

/* trống / lỗi: giữ khung và tiêu đề, một câu trong khung */
.o-trong {
  margin: 20px; padding: 40px 24px; border: 1px dashed #c3c9d1; border-radius: var(--r-the);
  display: grid; justify-items: center; gap: 14px; text-align: center;
}
.o-trong__chu { font-size: 15px; max-width: 60ch; }
.o-trong__nut { display: flex; gap: 8px; }
.o-trong__nut:not(:has(:not([hidden]))) { display: none; }

/* tooltip ECharts (chữ đi qua textContent trong bao_cao.js) */
.bd-tip { font: 400 12px/1.45 var(--font); color: var(--chu); }
.bd-tip__dau { font-weight: 600; margin-bottom: 4px; }
.bd-tip__dong { display: flex; align-items: center; gap: 8px; }
.bd-tip__dong span:last-child { margin-left: auto; padding-left: 16px; font-variant-numeric: tabular-nums; font-weight: 500; }
.bd-tip__mau { width: 8px; height: 8px; border-radius: 2px; flex: none; }

/* đăng nhập / lỗi */
.hop-giua { display: grid; place-items: center; min-height: calc(100vh - 140px); }
.hop-giua__than {
  width: 100%; max-width: 440px; background: var(--mat); border: 1px solid var(--vien);
  border-radius: var(--r-to); padding: 28px; display: grid; gap: 14px;
}
.hop-giua h1 { font-size: 20px; line-height: 1.3; font-weight: 700; }
.phu { color: var(--chu-phu); }
.ghi-chu { color: var(--chu-phu); font-size: 12px; }
.ghi-chu--giua { text-align: center; padding: 0 20px 20px; }

/* ───── vai trò: thanh trên ───── */
.dieu-huong { display: flex; align-items: center; gap: 4px; margin-left: 12px; }
.dieu-huong__muc {
  display: inline-flex; align-items: center; height: 32px; padding: 0 10px; border-radius: var(--r-nut);
  color: var(--chu-phu); font-size: 14px; font-weight: 500; text-decoration: none;
  transition: background-color 150ms ease, color 150ms ease;
}
.dieu-huong__muc[aria-current="page"] { color: var(--chu); background: #e6e9ee; }
@media (hover: hover) and (pointer: fine) { .dieu-huong__muc:not([aria-current="page"]):hover { color: var(--chu); } }
.tai-khoan__vai { color: var(--chu-phu); font-size: 12px; white-space: nowrap; padding-left: 8px; border-left: 1px solid var(--vien-dk); }

/* ───── bộ lọc như sheet (Tháng · Tuần · Brand) ───── */
.chon__cung { display: flex; gap: 8px; min-width: 0; }
.chon__cung select { flex: 1 1 auto; min-width: 0; }
.chon__o--thang select { width: 168px; }
.chon__o--tuan select { width: 112px; }
/* Ô lọc đang chọn trên sheet: dòng luôn có mặt (giữ chỗ) — chỉ hiện chữ khi kỳ đang xem khác sheet. */
.chon__loc-sheet {
  flex: 1 1 100%; display: flex; align-items: center; gap: 10px; min-height: 20px; margin-top: -6px;
  font-size: 13px; color: var(--chu-phu);
}
.chon__loc-sheet [id="loc-sheet-chu"] { color: var(--chu); font-weight: 500; }
.chon__loc-sheet[data-trong] { visibility: hidden; }

/* Nút vuông chỉ có biểu tượng ("⋯") — cùng cao 36px với ô chọn. */
.nut--vuong { width: 36px; padding: 0; flex: none; }
.bt--day { fill: currentColor; stroke: none; }
.nut--nho { height: 32px; padding: 0 12px; font-size: 13px; }
.nut--nguy { background: var(--tc-do); color: #fff; }
.nut--nguy[aria-disabled="true"] { background: #d9a3a3; color: #fff; }
@media (hover: hover) and (pointer: fine) { .nut--nguy:not([aria-disabled="true"]):hover { background: #9e0000; } }

/* Menu "⋯": thứ nổi duy nhất trên thanh nên có bóng; mọc từ nút (góc trên trái), 150ms, đóng ngay. */
.menu { position: relative; flex: none; }
.menu__ds {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 20; min-width: 196px; padding: 4px;
  background: var(--mat); border: 1px solid var(--vien); border-radius: var(--r-the);
  box-shadow: 0 12px 32px rgba(15, 17, 20, 0.12), 0 1px 3px rgba(15, 17, 20, 0.06);
  transform-origin: top left; opacity: 1; transform: none;
  transition: opacity 150ms var(--em-ra), transform 150ms var(--em-ra);
}
@starting-style { .menu__ds { opacity: 0; transform: scale(0.97) translateY(-2px); } }
.menu__muc {
  appearance: none; display: flex; align-items: center; gap: 8px; width: 100%; height: 34px;
  padding: 0 10px; border: 0; border-radius: var(--r-nut); background: transparent; cursor: pointer;
  font: 500 14px/1 var(--font); color: var(--chu); text-align: left; white-space: nowrap;
}
.menu__muc:focus-visible { outline-offset: -2px; }
.menu__muc--nguy { color: var(--tc-do); }
@media (hover: hover) and (pointer: fine) { .menu__muc:hover { background: #f3f4f6; } }

.hop--hep { width: min(460px, calc(100vw - 32px)); }
.hop__ban { font-size: 14px; font-weight: 600; color: var(--chu); }
.hop__doan { display: grid; gap: 8px; }
.hop__doan strong, .hop__phu strong { color: var(--chu); font-weight: 600; }

/* ───── trang quản trị ───── */
.an-chu {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.qt { padding: 8px 0 40px; }
.qt__dau { display: grid; gap: 4px; margin-bottom: 16px; }
.qt__ten { font-size: 24px; line-height: 1.25; font-weight: 700; letter-spacing: -0.01em; }
.qt__phu { color: var(--chu-phu); }
/* Tab gạch chân trên một vạch toàn bề rộng; số đếm xám cạnh nhãn. */
.tab { display: flex; gap: 24px; box-shadow: inset 0 -1px 0 var(--vien-dk); overflow-x: auto; overflow-y: hidden; }
.tab__muc {
  position: relative; display: inline-flex; align-items: center; gap: 6px; padding: 10px 0 11px;
  color: var(--chu-phu); font-size: 14px; font-weight: 500; text-decoration: none; white-space: nowrap;
}
.tab__muc[aria-current="page"] { color: var(--chu); }
.tab__muc[aria-current="page"]::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--chu); border-radius: 1px;
}
@media (hover: hover) and (pointer: fine) { .tab__muc:not([aria-current="page"]):hover { color: var(--chu); } }
.tab__so { font-size: 12px; font-weight: 500; color: var(--chu-phu); background: #e6e9ee; border-radius: 999px; padding: 1px 7px; }
/* Câu trạng thái: giữ chỗ một dòng (thêm / xoá xong không đẩy bảng xuống). */
.qt__tin { min-height: 20px; margin: 8px 0; font-size: 13px; color: var(--chu-phu); }
.qt__tin--loi { color: var(--tc-do); }
.qt__tin--xong { color: var(--chu); }
.qt__tin a { color: var(--chu); font-weight: 500; text-underline-offset: 3px; }

.khoi { background: var(--mat); border: 1px solid var(--vien); border-radius: var(--r-to); padding: 20px 24px 24px; }
.khoi__dau { margin-bottom: 16px; }
.khoi__ten { font-size: 17px; line-height: 1.3; font-weight: 700; }
.khoi__phu { margin-top: 4px; font-size: 13px; color: var(--chu-phu); max-width: 90ch; }
.vai-tro-giai { display: flex; flex-wrap: wrap; gap: 4px 24px; margin: 6px 0 0; font-size: 13px; }
.vai-tro-giai div { display: flex; gap: 6px; }
.vai-tro-giai dt { font-weight: 600; }
.vai-tro-giai dd { margin: 0; color: var(--chu-phu); }

.them, .loc { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.truong { display: grid; gap: 6px; min-width: 0; }
.truong label { font-size: 12px; font-weight: 500; color: var(--chu-phu); }
.truong--email .o-chu { width: 300px; max-width: 100%; }
.them__goi-y { flex: 1 1 100%; font-size: 12px; color: var(--chu-phu); margin-top: -4px; }
.o-chu {
  height: 36px; padding: 0 12px; border: 1px solid var(--vien-dk); border-radius: var(--r-nut);
  background: var(--mat); color: var(--chu); font: 500 14px/1 var(--font);
  transition: border-color 150ms ease;
}
.o-chu::placeholder { color: #8a9099; font-weight: 400; }
.o-chu:focus-visible { outline-offset: -1px; }
.o-chu[aria-invalid="true"] { border-color: var(--tc-do); background: #fff7f7; }
.o-chu--ngay { width: 160px; }
@media (hover: hover) and (pointer: fine) { .o-chu:not(:focus):not([aria-invalid="true"]):hover { border-color: #9ca3af; } }
.loc__dem { margin-left: auto; align-self: flex-end; line-height: 36px; font-size: 13px; color: var(--chu-phu); }

/* Bảng: vạch dòng nhạt, tiêu đề xám chữ thường, không sọc, không dải nền. */
.bang-cuon { position: relative; overflow-x: auto; margin: 0 -8px; }   /* relative: giữ <caption> ẩn trong khung cuộn */
.bang { width: 100%; border-collapse: collapse; font-size: 14px; }
.bang thead th {
  padding: 0 8px 8px; font-size: 12px; font-weight: 500; color: var(--chu-phu); text-align: left;
  white-space: nowrap; border-bottom: 1px solid var(--vien);
}
.bang td, .bang tbody th { padding: 10px 8px; text-align: left; vertical-align: middle; border-top: 1px solid #f0f1f4; }
.bang tbody tr:first-child td, .bang tbody tr:first-child th { border-top: 0; }
.bang tbody th { font-weight: 500; }
.bang__email { min-width: 220px; }
.bang__ten { overflow-wrap: anywhere; }
.bang__phu { color: var(--chu-phu); }
.bang__luc { white-space: nowrap; }
.bang__so { text-align: right !important; white-space: nowrap; }
.bang__so--gan { color: var(--chu); font-weight: 600; }
.bang__tac { width: 1%; text-align: right !important; white-space: nowrap; }
.bang__vai { width: 200px; }
.bang__dong2 { display: block; margin-top: 2px; font-size: 12px; color: var(--chu-phu); overflow-wrap: anywhere; }
.bang__trong { color: var(--chu-phu); }
.bang__chi-tiet { min-width: 220px; overflow-wrap: anywhere; }
.bang__ban a { color: var(--chu); text-decoration: none; white-space: nowrap; }
.bang__ban a:hover { text-decoration: underline; text-underline-offset: 3px; }
.bang--nk td { padding-top: 9px; padding-bottom: 9px; vertical-align: top; }
.bang__kq { min-width: 140px; }
.chon-vai { height: 32px; font-size: 13px; padding-right: 30px; background-position: right 10px center; }
.khoa { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; color: var(--chu-phu); font-size: 13px; }
.the-nho--xam { background: #eceef1; color: #3f4650; height: 20px; padding: 0 7px; }
.the-tt {
  display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: 999px;
  font-size: 12px; font-weight: 500; background: #eceef1; color: #3f4650; white-space: nowrap;
}
.the-tt--xong { background: #dcfae5; color: #04250e; }
.the-tt--loi { background: #ffedea; color: #831c1e; }
.nut-chu {
  appearance: none; border: 0; background: transparent; cursor: pointer; padding: 4px 6px; margin: -4px -6px;
  border-radius: var(--r-chip); font: 500 14px/1.2 var(--font); color: var(--chu);
  text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 3px;
  transition: text-decoration-color 150ms ease, transform 120ms var(--em-ra);
}
.nut-chu:active { transform: scale(0.97); }
.nut-chu--nguy { color: var(--tc-do); }
@media (hover: hover) and (pointer: fine) { .nut-chu:hover { text-decoration-color: currentColor; } }
.trang-so { display: flex; justify-content: flex-end; align-items: center; gap: 12px; margin-top: 16px; }
.trang-so__chu { font-size: 13px; color: var(--chu-phu); }
.o-trong-nho {
  padding: 18px 16px; border: 1px dashed #c3c9d1; border-radius: var(--r-the);
  text-align: center; color: var(--chu-phu); font-size: 14px;
}

/* ───── màn hẹp ───── */
@media (max-width: 960px) {
  .luoi-bd { grid-template-columns: minmax(0, 1fr); }
  .kpi { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .khung { padding: 0 16px; }
  .thuong-hieu__phu { display: none; }
  .chon { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .chon > * { grid-column: 1 / -1; }
  .chon > .chon__o--thang, .chon > .chon__o--tuan { grid-column: auto; }
  .chon__o--ban select, .chon__o--brand select, .chon__o--thang select, .chon__o--tuan select { width: 100%; }
  .chon__loc-sheet { margin-top: -4px; flex-wrap: wrap; row-gap: 2px; }
  .dieu-huong { margin-left: 0; }
  .dieu-huong__muc { padding: 0 8px; }
  .tai-khoan__ten, .tai-khoan__vai { display: none; }
  .khoi { padding: 16px; }
  .them, .loc { display: grid; grid-template-columns: minmax(0, 1fr); }
  .truong--email .o-chu, .o-chu--ngay { width: 100%; }
  .loc__dem { margin-left: 0; }
  .vai-tro-giai { display: grid; }
  .chon__trang-thai { min-height: 0; }
  .chon__sheet { margin-left: 0; flex-wrap: wrap; gap: 8px; }
  .the-kpi__dau { flex-wrap: wrap; row-gap: 2px; }
  .nut-nho { margin-left: -5px; }
  .chon__tin { text-align: left; max-width: none; flex: 1 1 100%; order: 2; }
  .lich-su__ds li { grid-template-columns: 72px minmax(0, 1fr); row-gap: 0; }
  .lich-su__ai { grid-column: 2; text-align: left; font-size: 12px; }
  .hop__than { padding: 16px; gap: 14px; }
  .luoi-hm th, .luoi-hm td { padding-left: 6px; }
  .luoi-hm thead td { width: 28%; }
  .luoi-hm th[scope="row"] { font-size: 12px; }
  .luoi-hm thead th, .luoi-hm output, .o-doc { padding-right: 7px; }
  .o-so { padding: 0 6px; height: 44px; }
  .hop__nut { flex-wrap: wrap; }
  .hop__tin { flex-basis: 100%; }
  .hop__nut .nut { height: 44px; flex: 1; }
  .dai { flex-wrap: wrap; padding: 12px 16px; gap: 10px 12px; }
  .dai__logo { width: 24px; height: 24px; }
  .dai__ten { font-size: 18px; flex: 1 1 200px; }
  .dai__phu { margin-left: 0; flex-basis: 100%; white-space: normal; text-align: left; }
  .vung-so { padding: 16px; gap: 12px; }
  .kpi, .luoi-bd { gap: 12px; }
  .the-kpi { padding: 10px 12px 12px; }
  .the-kpi__so { font-size: 20px; }
  .the-kpi--chinh .the-kpi__so { font-size: 24px; }
  .the-kpi__phu { white-space: normal; }
  .bd { padding: 12px 12px 10px; }
  .bd__ve { height: 220px; }
  .bd__ve--cao { height: 250px; }
  .o-trong { margin: 16px; padding: 28px 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0ms !important; animation-duration: 0ms !important; }
  .nut:active { transform: none; }
}

/* ───── in: A4 ngang một trang, như thiết lập in của file Tài chính ───── */
@page { size: A4 landscape; margin: 8mm; }
@media print {
  body { background: #fff; font-size: 12px; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .thanh, .chon, .bo-qua, .thong-bao, noscript, .nut-nho, .lich-su, .hop, .menu { display: none !important; }
  .khung { max-width: none; padding: 0; }
  .to { border: 0; border-radius: 0; margin: 0; }
  .dai { min-height: 0; padding: 8px 14px; }
  .dai__logo { width: 22px; height: 22px; }
  .dai__ten { font-size: 18px; }
  .vung-so { padding: 10px 0 0; gap: 10px; opacity: 1 !important; }
  .kpi, .luoi-bd { gap: 10px; }
  .the-kpi { padding: 8px 12px; break-inside: avoid; }
  .the-kpi__so { font-size: 18px; margin: 3px 0 2px; }
  .the-kpi--chinh .the-kpi__so { font-size: 20px; }
  .kpi { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .luoi-bd { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bd { padding: 8px 10px 6px; break-inside: avoid; }
  .bd__ve { overflow: hidden; }   /* bao_cao.js vẽ lại 504px × cao dưới đây khi in */
  .bd__ten { font-size: 12px; }
  .bd__ve { height: 172px; }
  .bd__ve--co-chip { height: 150px; }
  .bd__ve--cao { height: 178px; }
  .ty-le li { font-size: 10px; }
  .rui-ro { padding: 8px 12px; break-inside: avoid; }
  .rui-ro__cau { font-size: 12px; }
}
