/* =====================================================================
   Bộ chọn tháng (09/2026) và trang chủ kiểu bảng điều hành
   ===================================================================== */

/* ============================================================ BỘ CHỌN THÁNG */
.ct { position: relative; display: flex; align-items: stretch; border: 1px solid var(--line); border-radius: 10px;
  background: var(--paper); transition: border-color .25s, box-shadow .25s; }
.ct:hover, .ct:focus-within { border-color: var(--brand); background: #fff; box-shadow: 0 0 0 4px rgba(33, 73, 230, .1); }
.ct button { border: 0; background: none; cursor: pointer; }
.ct-lui, .ct-toi { width: 34px; flex: none; font-size: 1.25rem; line-height: 1; color: var(--muted); border-radius: 9px; }
.ct-lui:hover, .ct-toi:hover { color: var(--brand); background: var(--brand-soft); }
.ct-nut { flex: 1; display: flex; align-items: center; justify-content: center; gap: 9px; padding: 10px 6px; min-width: 0; }
.ct-nut b { font-size: 1rem; font-weight: 700; letter-spacing: .02em; color: var(--ink); white-space: nowrap; }
.ct-nut svg { color: var(--brand); }
.ct.rong .ct-nut b { font-weight: 600; color: var(--muted); }
.ct-bang { position: absolute; top: calc(100% + 8px); left: 0; z-index: 80; width: 264px; padding: 14px;
  background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
.ct-nam { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.ct-nam b { font-size: 1rem; color: var(--ink); }
.ct-nam button { width: 32px; height: 32px; border-radius: 9px; font-size: 1.2rem; color: var(--muted); }
.ct-nam button:hover { background: var(--brand-soft); color: var(--brand); }
.ct-luoi { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.ct-luoi button { position: relative; padding: 10px 0; border-radius: 9px; font-weight: 600; color: var(--text); background: var(--paper); }
.ct-luoi button:hover { background: var(--brand-soft); color: var(--brand); }
.ct-luoi button.nay { box-shadow: inset 0 0 0 1px var(--brand-2); }
.ct-luoi button.chon { background: var(--brand); color: #fff; }
.ct-luoi button i, .ct-ghi i { position: absolute; left: 50%; bottom: 4px; width: 5px; height: 5px; margin-left: -2.5px;
  border-radius: 50%; background: var(--s4); }
.ct-luoi button.chon i { background: #fff; }
.ct-tatca { width: 100%; margin-top: 8px; padding: 9px; border-radius: 9px; font-weight: 600; background: var(--ivory) !important; }
.ct-tatca.chon { background: var(--ink) !important; color: #fff; }
.ct-ghi { position: relative; margin: 10px 0 0; padding-left: 12px; font-size: .74rem; color: var(--muted); }
.ct-ghi i { left: 3px; top: 50%; bottom: auto; margin: -2.5px 0 0; }

/* ============================================================ TRANG CHỦ */
.tc-thanh { display: flex; flex-wrap: wrap; align-items: end; gap: 14px; margin-bottom: 18px; }
.tc-thanh .field { width: 230px; }
.tc-thanh .sp { flex: 1; }
.tc-cap { font-size: .8rem; color: var(--muted); padding-bottom: 12px; }

/* số lớn: một số duy nhất trên trang, phông không chân, chữ số tỉ lệ */
.tc-hero { display: grid; grid-template-columns: minmax(230px, 1.1fr) 2fr minmax(220px, 1fr); gap: 26px; align-items: center;
  padding: 26px 28px; margin-bottom: 16px; border-radius: 20px; color: #fff; position: relative; overflow: hidden;
  background: radial-gradient(120% 140% at 0% 0%, #1d3a8a 0%, var(--ink) 55%), var(--ink); box-shadow: var(--shadow); }
.tc-hero::after { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image: linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 28px 28px; -webkit-mask-image: linear-gradient(90deg, transparent, #000 60%); mask-image: linear-gradient(90deg, transparent, #000 60%); }
.tc-hero small { display: block; font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: rgba(255,255,255,.58); }
.hero-trai { position: relative; z-index: 1; }
.hero-so { margin-top: 6px; font-size: 3.3rem; font-weight: 700; line-height: 1; letter-spacing: -.035em; }
.hero-so small, .mang-so small, .phan b small, .hero-o b small, .phu-o b small {
  display: inline; font-size: .45em; font-weight: 600; letter-spacing: 0; text-transform: none; color: inherit; opacity: .6; }
.hero-so.am { color: #ff8a8a; }
.hero-du { margin-top: 6px; font-size: .82rem; color: rgba(255,255,255,.6); font-variant-numeric: tabular-nums; }
.hero-ss { margin-top: 12px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.hero-giua { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; position: relative; z-index: 1; }
.hero-o { padding: 12px 14px; border-radius: 13px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.09); }
.hero-o b { display: block; margin-top: 4px; font-size: 1.35rem; font-weight: 700; letter-spacing: -.02em; }
.hero-o i { display: block; margin-top: 2px; font-style: normal; font-size: .74rem; color: rgba(255,255,255,.55); }
.hero-phai { position: relative; z-index: 1; }
.hero-phai .spark { margin-top: 10px; height: 76px; }
.hero-phai .spark-nhan { color: rgba(255,255,255,.55); }

/* so với tháng trước: mũi tên + chữ, không chỉ dựa vào màu */
.ss { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; font-size: .78rem; font-weight: 700;
  font-variant-numeric: tabular-nums; }
.ss.len { background: var(--ok-soft); color: var(--ok); }
.ss.xuong { background: var(--err-soft); color: var(--err); }
.ss.bang { background: var(--ivory); color: var(--muted); }
.ss-ky { font-size: .76rem; color: var(--muted); }
.tc-hero .ss.len { background: rgba(52, 199, 120, .16); color: #6fe3a4; }
.tc-hero .ss.xuong { background: rgba(255, 110, 110, .16); color: #ff9c9c; }
.tc-hero .ss-ky { color: rgba(255,255,255,.55); }

/* đường xu hướng */
.spark { display: block; width: 100%; height: 56px; overflow: visible; }
.spark.trong { height: auto; padding: 16px 0; font-size: .76rem; color: var(--muted); text-align: center; }
.tc-hero .spark.trong { color: rgba(255,255,255,.5); }
.spark-nhan { display: flex; justify-content: space-between; margin-top: 3px; font-size: .7rem; color: var(--muted); }

/* hai khung mảng */
.tc-mang { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 16px; margin-bottom: 16px; }
.mang-the { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 20px 22px; position: relative; overflow: hidden;
  box-shadow: var(--shadow-sm); --m: var(--s1); --m-soft: #e7f0fc; }
.mang-the.tau { --m: var(--s2); --m-soft: #fdeee6; }
.mang-the::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: var(--m); }
.mang-the header { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.mang-the header p { margin: 2px 0 0; font-size: .78rem; color: var(--muted); }
.mang-ico { width: 38px; height: 38px; flex: none; display: grid; place-items: center; border-radius: 11px; background: var(--m-soft); color: var(--m); }
.mang-ico svg { width: 20px; height: 20px; }
.mang-mo { margin-left: auto; font-size: .8rem; font-weight: 600; color: var(--brand); cursor: pointer; white-space: nowrap; }
.mang-mo:hover { text-decoration: underline; }
.mang-dau { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: end; padding-bottom: 16px;
  margin-bottom: 14px; border-bottom: 1px dashed var(--line); }
.mang-dau small { display: block; font-size: .72rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.mang-so { margin-top: 4px; font-size: 2.15rem; font-weight: 700; line-height: 1.05; letter-spacing: -.03em; color: var(--ink); }
.mang-so.am { color: var(--err); }
.mang-ss { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.phan-dau { display: flex; justify-content: space-between; margin-bottom: 6px; font-size: .74rem; font-weight: 700;
  letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.phan-dau span + span { font-weight: 500; letter-spacing: 0; text-transform: none; }
.phan { display: grid; grid-template-columns: minmax(120px, 1.25fr) 1fr 92px 52px; gap: 12px; align-items: center; padding: 7px 0; font-size: .86rem; }
.phan-ten { color: var(--text); }
.phan-thanh { height: 8px; border-radius: 99px; background: var(--ivory); overflow: hidden; }
.phan-thanh i { display: block; height: 100%; border-radius: 99px; background: #b9c1d0; }
.phan b { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink); }
.phan em { text-align: right; font-style: normal; font-size: .78rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.phan.thu .phan-thanh i { background: var(--m); opacity: .45; }
.phan.lai { margin-top: 4px; padding-top: 10px; border-top: 1px solid var(--line); font-weight: 600; }
.phan.lai .phan-thanh i { background: var(--m); }
.phan.lai b { color: var(--ok); }
.phan.lai.am b { color: var(--err); }
.phan.lai.am .phan-thanh i { background: var(--err); }
.mang-ghi { margin: 8px 0 0; font-size: .76rem; color: var(--muted); }

/* dải kho & công nợ */
.tc-phu { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-bottom: 16px; }
.phu-o { position: relative; display: block; padding: 16px 18px 16px 34px; background: #fff; border: 1px solid var(--line); border-radius: 14px;
  cursor: pointer; transition: transform .25s var(--ease), border-color .25s, box-shadow .25s; }
.phu-o:hover { transform: translateY(-2px); border-color: var(--brand-2); box-shadow: var(--shadow-sm); }
.phu-cham { position: absolute; left: 16px; top: 21px; width: 8px; height: 8px; border-radius: 50%; }
.phu-o small { display: block; font-size: .72rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.phu-o b { display: block; margin-top: 4px; font-size: 1.5rem; font-weight: 700; letter-spacing: -.02em; color: var(--ink); }
.phu-o span { display: block; margin-top: 2px; font-size: .76rem; color: var(--muted); }

/* đơn vị (tr, tỷ, m³, %) đứng ngay sau số, cùng dòng */
.mang-dau .mang-so small { display: inline; font-size: .5em; font-weight: 600; letter-spacing: 0; text-transform: none; color: inherit; opacity: .6; }
.tc-hero .hero-o b small { font-size: .62em; margin-left: 1px; }
.phu-o b small { font-size: .6em; }
.phan b small { font-size: .78em; font-weight: 600; }

@media (max-width: 1180px) {
  .tc-hero { grid-template-columns: 1fr 1fr; }
  .hero-giua { grid-column: 1 / -1; grid-row: 2; grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .tc-hero { grid-template-columns: 1fr; padding: 22px 18px; }
  .hero-giua { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-row: auto; }
  .hero-so { font-size: 2.6rem; }
  .tc-mang { grid-template-columns: 1fr; }
  .mang-dau { grid-template-columns: 1fr; }
  .phan { grid-template-columns: minmax(0, 1fr) 70px 84px 46px; gap: 8px; }
  .tc-thanh .field { width: 100%; }
}
