:root {
  --bg: #0e1013;
  --panel: #16191e;
  --panel-2: #1b1f26;
  --line: #262b33;
  --ink: #e8eaed;
  --dim: #8b94a3;
  --accent: #6ea8fe;
  --hot: #ff7438;
  --warm: #f2b544;
  --cold: #4d5c72;
}

/* Nhãn chỉ dành cho trình đọc màn hình: vẫn đọc được nhưng không chiếm chỗ.
   Cần cho các select, vì chúng không có text node để làm accessible name. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.6 "Be Vietnam Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.shell { width: min(1180px, 100% - 40px); margin-inline: auto; }

/* ---------- header ---------- */

.top {
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #13161b, var(--bg));
  padding: 30px 0 20px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.brandline { display: flex; align-items: flex-start; gap: 14px; }

.mark {
  width: 30px; height: 30px; flex: none; margin-top: 4px;


  background: var(--hot);
  border-radius: 8px;
  transform: rotate(45deg);
  position: relative;
}
.mark::after {
  content: ""; position: absolute; inset: 9px;
  border: 3px solid #fff; border-radius: 50%;
}

h1 { margin: 0; font-size: 24px; letter-spacing: -0.02em; font-weight: 700; }
.sub { margin: 2px 0 0; color: var(--dim); font-size: 14px; }

.counts { margin-left: auto; display: flex; gap: 18px; text-align: right; }
.counts div { line-height: 1.25; }
.counts b { display: block; font-size: 20px; font-weight: 700; }
.counts span { color: var(--dim); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }

/* ---------- search ---------- */

.search {
  margin-top: 20px;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
  gap: 10px;
  align-items: end;
}
.field.grow { grid-column: 1 / -1; display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.btn-export {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #193153;
  color: #7ab3ff;
  border: 1px solid #2b4c7e;
  border-radius: 8px;
  padding: 6px 14px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all .15s ease;
}
.btn-export:hover {
  background: #234575;
  color: #ffffff;
  border-color: var(--accent);
}

input[type="search"], select {
  width: 100%;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--ink);
  border-radius: 9px;
  padding: 9px 12px;
  font: inherit;
  font-size: 14px;
}
input[type="search"]:focus, select:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(110, 168, 254, .14);
}

.check { color: var(--dim); font-size: 13px; display: flex; align-items: center; gap: 6px; cursor: pointer; }
.check input { accent-color: var(--accent); }

.legend { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font-size: 12px; color: var(--dim);
  border: 1px solid var(--line); border-radius: 999px;
  padding: 3px 10px; cursor: pointer; background: var(--panel);
  transition: border-color .15s, color .15s;
}
.chip:hover { border-color: var(--accent); color: var(--ink); }
.chip b { color: var(--ink); font-weight: 600; }

/* ---------- rows ---------- */

main { padding: 20px 0 50px; }
.result-line { color: var(--dim); font-size: 14px; margin: 0 0 14px; }

.row {
  display: flex; gap: 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 15px 17px;
  margin-bottom: 9px;
  transition: border-color .15s;
}
.row:hover { border-color: #38404c; }
.row.hot { border-left: 3px solid var(--hot); }
.row.warm { border-left: 3px solid var(--warm); }
.row.cold { border-left: 3px solid var(--cold); }

.row-main { flex: 1; min-width: 0; }
.row-head { display: flex; align-items: baseline; gap: 10px; }
.name { margin: 0; font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }

.heat {
  font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px;
  background: rgba(110, 168, 254, .13); color: var(--accent); white-space: nowrap;
}
.heat.h3 { background: rgba(242, 181, 68, .15); color: var(--warm); }
.heat.h4 { background: rgba(255, 116, 56, .16); color: var(--hot); }

.meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 5px; }
.mst { font-size: 12px; color: var(--dim); background: var(--panel-2); padding: 1px 7px; border-radius: 5px; }
.prov {
  font-size: 11.5px;
  color: #a5d8ff;
  background: rgba(110, 168, 254, .12);
  border: 1px solid rgba(110, 168, 254, .25);
  padding: 1px 7px;
  border-radius: 5px;
  font-weight: 500;
}
.sectors { font-size: 12px; color: var(--dim); }
.shows { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.show {
  font-size: 11.5px; padding: 2px 9px; border-radius: 5px;
  background: #1f2530; color: #a8b3c4; border: 1px solid #2a313c;
}

.contacts { list-style: none; margin: 9px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 14px; }
.contacts a, .contacts li { font-size: 12.5px; color: #97a3b6; text-decoration: none; }
.contacts a:hover { color: var(--accent); text-decoration: underline; }
/* #5c6675 chỉ đạt 3.03:1 trên nền panel, dưới ngưỡng 4.5:1 của WCAG AA cho
   chữ 12.5px. Dùng --dim (5.76:1) và bỏ italic vì chữ nghiêng mờ thêm khó đọc. */
.contacts .none { color: var(--dim); }
/* Chuỗi liên hệ chưa xác minh: đọc được nhưng không giống hệt địa chỉ/điện
   thoại đã kiểm, để không ai bấm nhầm hoặc gửi thư cho sai người. */
.contacts .unverified { color: var(--warm); }

.row-side { width: 168px; flex: none; text-align: right; }
.years { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; }
.year {
  font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 4px;
  background: rgba(110, 168, 254, .1); color: #8fb6f5;
}
.src { display: inline-block; margin-top: 10px; font-size: 12px; color: var(--dim); text-decoration: none; }
.src:hover { color: var(--accent); }
/* Mỗi kỳ có một liên kết nguồn riêng, nên gom chúng thay vì một dòng dài. */
.srcs { display: flex; flex-wrap: wrap; gap: 4px 10px; justify-content: flex-end; margin-top: 8px; }
.srcs .src { margin-top: 0; }

.more {
  display: block; margin: 22px auto 0;
  background: var(--panel); color: var(--ink);
  border: 1px solid var(--line); border-radius: 9px;
  padding: 9px 22px; font: inherit; font-size: 14px; cursor: pointer;
}
.more:hover { border-color: var(--accent); }
.empty { color: var(--dim); text-align: center; padding: 50px 0; }

.foot { border-top: 1px solid var(--line); padding: 22px 0 40px; color: var(--dim); font-size: 13px; }
.foot p { margin: 0 0 6px; }

/* ---------- tab switcher ---------- */

.tabs { display: flex; gap: 6px; margin-top: 18px; }
.tab {
  background: transparent;
  border: 1px solid transparent;
  border-bottom: 2px solid transparent;
  color: var(--dim);
  font: inherit;
  font-size: 14px;
  padding: 7px 14px;
  cursor: pointer;
  border-radius: 7px 7px 0 0;
}
.tab:hover { color: var(--ink); }
.tab.active { color: var(--ink); border-bottom-color: var(--hot); }
.tab span {
  display: inline-block;
  margin-left: 6px;
  font-size: 11px;
  font-weight: 700;
  color: var(--dim);
  background: var(--panel-2);
  border-radius: 999px;
  padding: 1px 7px;
}

.row.pending { border-left: 3px solid var(--cold); }
.row.pending .heat { background: rgba(255, 255, 255, .06); color: var(--dim); }
.why { font-size: 12px; color: #8a94a3; margin-top: 6px; }

@media (max-width: 820px) {
  /* Grid 2 cột làm select bị cắt chữ ở 390px ("Tất cả ngành hàng" → "Tất cả
     ngành hạn"). Một cột cho mọi bộ lọc: chiều ngang đủ cho nhãn dài nhất. */
  .search { grid-template-columns: 1fr; }
  .row { flex-direction: column; }
  .row-side { width: auto; text-align: left; }
  .years { justify-content: flex-start; }
  .counts { display: none; }

  /* Header dính đỉnh chiếm 422px trên viewport 844px — hơn nửa màn hình, và vẫn
     che dòng đầu tiên sau khi cuộn 1100px. Ở mobile bộ lọc là thứ dùng nhiều
     nhất nhưng không cần ghim; chỉ giữ nó khi cuộn lên trên. */
  .top { position: static; }

  /* Ô tìm chiếm trọn hàng: ở 390px nó chỉ rộng 163px nên placeholder bị cắt. */
  .field.grow, .search > .field:first-child { grid-column: 1 / -1; }
}

@media (max-width: 420px) {
  /* Chuẩn chạm tối thiểu 44px; select/tab 40px và search 42px là hơi chật. */
  input[type="search"], select { min-height: 44px; }
  .tab { padding: 8px 10px; min-height: 44px; display: inline-flex; align-items: center; }
}

/* Khối chờ chiếm gần bằng 8 dòng đầu để nội dung không nhảy khi dữ liệu tới. */
.skeleton {
  height: 620px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: linear-gradient(90deg, var(--panel) 25%, var(--panel-2) 50%, var(--panel) 75%);
  background-size: 300% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
}
@keyframes shimmer {
  from { background-position: 150% 0; }
  to { background-position: -150% 0; }
}
/* Tôn trọng thiết lập giảm chuyển động của hệ điều hành. */
@media (prefers-reduced-motion: reduce) {
  .skeleton { animation: none; }
}
