/* Bảng xếp hạng thương hiệu (/bang-xep-hang).
   Bố cục lấy theo bảng xếp hạng ngành quen thuộc (huy hiệu hạng, logo, các cột
   điểm, cột biến động) nhưng dùng bảng màu sáng của Social Voice - cùng biến
   màu với pages.css, KHÔNG tự đặt màu mới ở đây ngoài mấy sắc thái huy hiệu. */

.bxh-head { padding-bottom: 18px; }

/* ── Chọn ngành ── */
.bxh-nganh { display: flex; gap: 8px; flex-wrap: wrap; margin: 30px 0 4px; }
.bxh-pill {
  padding: 8px 18px; border-radius: 980px; font-size: 13.5px; text-decoration: none;
  border: 1px solid var(--border-soft); background: var(--gray1); color: #424245;
  transition: background .2s, border-color .2s, color .2s;
}
.bxh-pill:hover { background: #eaf3fd; border-color: #cfe3fb; color: var(--accent-ink); }
.bxh-pill.on { background: var(--accent-ink); border-color: var(--accent-ink); color: #fff; font-weight: 600; }
/* Ngành chưa có dữ liệu: mờ và không bấm được, nhưng vẫn thấy để biết sắp có. */
.bxh-pill.off { opacity: .42; cursor: not-allowed; }

/* ── Thanh công cụ ── */
.bxh-thanh {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; padding: 30px 0 18px;
}
.bxh-toggle { display: inline-flex; background: var(--gray1); border-radius: 10px; padding: 3px; }
.bxh-toggle span { padding: 7px 18px; border-radius: 8px; font-size: 13.5px; color: #424245; }
.bxh-toggle .on { background: var(--white); font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.bxh-toggle .off { opacity: .45; cursor: not-allowed; }

.bxh-chon-ky { display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--gray3); }
.bxh-chon-ky select {
  font: inherit; color: var(--gray2); background: var(--white);
  border: 1px solid var(--border); border-radius: 10px; padding: 7px 12px; cursor: pointer;
}
.bxh-chon-ky select:focus { outline: 2px solid #cfe3fb; border-color: var(--accent); }

/* ── Bảng ──
   Bảng rộng hơn màn hình điện thoại là chắc chắn (8 cột). Cho cuộn ngang TRONG
   khung của nó, không để cả trang cuộn ngang. */
.bxh-bang-boc {
  overflow-x: auto; border: 1px solid var(--border-soft); border-radius: 16px;
  background: var(--white); margin-bottom: 34px;
}
.bxh-bang { width: 100%; border-collapse: collapse; min-width: 860px; }
.bxh-bang thead th {
  position: sticky; top: 0; z-index: 1;
  background: #f7f9fc; border-bottom: 1px solid var(--border-soft);
  font-size: 11.5px; font-weight: 600; letter-spacing: .6px; text-transform: uppercase;
  color: var(--gray3); text-align: right; padding: 14px 16px; white-space: nowrap;
}
.bxh-bang thead th.c-bien-dong, .bxh-bang thead th.c-hang { text-align: center; }
.bxh-bang thead th.c-th { text-align: left; }
.bxh-bang tbody td { padding: 14px 16px; border-bottom: 1px solid var(--border-soft); font-size: 14.5px; text-align: right; }
.bxh-bang tbody tr:last-child td { border-bottom: none; }
.bxh-bang tbody tr:hover { background: #fafbfd; }

.c-bien-dong { text-align: center !important; font-size: 12.5px; white-space: nowrap; }
.c-bien-dong .len { color: #1a8a3f; font-weight: 600; }
.c-bien-dong .xuong { color: #c0392b; font-weight: 600; }
.c-bien-dong .giu, .c-bien-dong .moi { color: #a1a1a6; }

.c-hang { text-align: center !important; width: 74px; }
.huy-hieu {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 10px;
  background: var(--gray1); color: var(--gray3);
  font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums;
}
/* Top 3: vàng/bạc/đồng ở sắc độ nhạt cho hợp nền sáng, không dùng gradient chói. */
.top1 .huy-hieu { background: #fdf0cd; color: #8a6a00; }
.top2 .huy-hieu { background: #eceff1; color: #5f6b74; }
.top3 .huy-hieu { background: #f7e6d6; color: #8a5a2b; }

.c-th { text-align: left !important; min-width: 240px; }
.c-th .logo {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 10px; margin-right: 12px;
  border: 1px solid var(--border-soft); background: var(--white);
  vertical-align: middle; overflow: hidden; flex: none;
}
.c-th .logo img { width: 100%; height: 100%; object-fit: contain; padding: 4px; }
/* Chưa có file logo thì img tự gỡ mình (onerror), còn lại ô chữ cái đầu. */
.c-th .logo::before {
  content: attr(data-chu); font-size: 15px; font-weight: 700; color: var(--gray3);
}
.c-th .logo:has(img)::before { content: none; }
.c-th .ten { display: inline-block; vertical-align: middle; font-weight: 600; color: var(--gray2); }
.c-th .ten small { display: block; font-weight: 400; font-size: 12px; color: #a1a1a6; margin-top: 2px; }

.c-diem { color: #424245; font-variant-numeric: tabular-nums; width: 104px; }
.c-diem .thieu { color: #c7c7cc; }
.c-tong {
  font-weight: 700; color: var(--gray2); font-variant-numeric: tabular-nums;
  width: 108px; font-size: 15.5px;
}

.bxh-vang-mat {
  font-size: 13.5px; color: var(--gray3); line-height: 1.6;
  margin: -18px 0 30px; padding: 12px 16px;
  background: var(--gray1); border-radius: 12px;
}
.bxh-vang-mat b { color: #424245; font-weight: 600; }

/* ── Cách tính ── */
.bxh-cach-do { padding-bottom: 80px; max-width: 780px; }
.bxh-cach-do h2 { font-size: 22px; font-weight: 600; letter-spacing: -.3px; margin-bottom: 18px; }
.bxh-so-lieu { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 22px; }
.bxh-so-lieu div {
  flex: 1 1 130px; background: var(--gray1); border-radius: 12px; padding: 14px 16px;
}
.bxh-so-lieu b { display: block; font-size: 20px; font-weight: 600; letter-spacing: -.4px; }
.bxh-so-lieu span { font-size: 12.5px; color: var(--gray3); }
.bxh-cach-do p { font-size: 15px; line-height: 1.7; color: #2c2c2e; margin-bottom: 12px; }
.bxh-cach-do ul { margin: 0 0 16px 18px; }
.bxh-cach-do li { font-size: 14.5px; line-height: 1.7; color: #424245; margin-bottom: 8px; }
.bxh-luu-y {
  background: #f4f8fd; border-left: 3px solid var(--accent); border-radius: 0 10px 10px 0;
  padding: 14px 16px; font-size: 14px !important; color: #2c2c2e;
}

@media (max-width: 700px) {
  .bxh-thanh { padding-top: 22px; }
  .bxh-bang tbody td, .bxh-bang thead th { padding: 12px 10px; }
  .c-th { min-width: 190px; }
  .c-th .logo { width: 34px; height: 34px; margin-right: 10px; }
  /* Màn hình hẹp phải cuộn ngang mới thấy hết cột, nên phần nhìn thấy đầu tiên
     phải là thứ quan trọng: hạng và tên. Tiêu đề "BIẾN ĐỘNG" chiếm gần một phần
     ba bề ngang chỉ để chứa "+4 ▲" nên rút lại thành dấu ±. */
  .bxh-bang thead th.c-bien-dong { font-size: 0; }
  .bxh-bang thead th.c-bien-dong::after { content: "±"; font-size: 12px; }
  .c-bien-dong { width: 52px; }
  .c-hang { width: 58px; }
  .c-diem, .c-tong { width: auto; }
}
