/* Năng suất ĐTV Autocall – tông xanh VNPT */
:root {
  --navy: #003B7A;
  --blue: #0066B3;
  --sky: #7FB2E3;
  --pale: #DCE9F7;
  --bg: #F3F7FC;
  --ink: #0F1E33;
  --muted: #4A5A70;
  --line: #E3EDF8;
  --green: #1F6B3A;
  --red: #C62828;
  --red-bg: #FDECEC;
  --orange: #D9640A;
  --orange-bg: #FFF1E3;
  --radius: 16px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body { margin: 0; font-family: 'Be Vietnam Pro', system-ui, sans-serif; color: var(--ink); background: var(--bg); line-height: 1.5; }
a { color: var(--blue); }
small { font-weight: 500; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* Thanh đầu trang */
.topbar { position: sticky; top: 0; z-index: 10; background: var(--navy); color: #fff; }
.topbar-in { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 60px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 600; font-size: 15px; }
.logo { background: #fff; color: var(--navy); font-weight: 800; padding: 4px 10px; border-radius: 8px; letter-spacing: .5px; }
.topbar nav { display: flex; flex-wrap: wrap; gap: 18px; font-size: 14px; }
.topbar nav a { color: #fff; text-decoration: none; opacity: .9; }
.topbar nav a:hover { opacity: 1; text-decoration: underline; }

/* Hero */
.hero { background: linear-gradient(135deg, var(--navy) 0%, var(--blue) 100%); color: #fff; padding: 56px 0 64px; }
.hero h1 { margin: 10px 0 14px; font-size: 46px; line-height: 1.15; font-weight: 800; }
.hero .lead { max-width: 780px; font-size: 18px; color: var(--pale); margin: 0 0 32px; }
.eyebrow { display: inline-block; font-size: 13px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; color: var(--blue); }
.hero .eyebrow { color: #A9CDF0; }
.eyebrow.is-red { color: var(--red); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.stat { background: #fff; color: var(--ink); border-radius: var(--radius); padding: 20px 22px; display: flex; flex-direction: column; gap: 4px; }
.stat.is-key { box-shadow: 0 0 0 3px #A9CDF0; }
.stat .k { font-size: 14px; color: var(--muted); }
.stat .v { font-size: 34px; font-weight: 800; color: var(--navy); }
.stat .v small { font-size: 16px; margin-left: 6px; }
.stat .s { font-size: 14px; font-weight: 600; color: var(--green); }

/* Khung mục */
.sec { padding: 64px 0 0; display: flex; flex-direction: column; gap: 18px; }
.sec h2 { margin: 0; font-size: 32px; line-height: 1.2; font-weight: 800; color: var(--navy); }
.note { margin: 0; font-size: 14px; color: var(--muted); max-width: 900px; }
.card { background: #fff; border-radius: var(--radius); padding: 22px 24px; border: 1px solid var(--line); }
.card h3 { margin: 0 0 12px; font-size: 18px; font-weight: 700; }
.card h3 small { color: var(--muted); font-size: 14px; }
.big { margin: 0; font-size: 30px; font-weight: 800; color: var(--navy); }
.big small { font-size: 14px; color: var(--muted); font-weight: 500; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; }
.grid-warn { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.facts { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--muted); }
.facts b { color: var(--ink); }
.up, .facts b.up { color: var(--green); }
.down, .facts b.down { color: var(--red); }
.warn .big small { display: block; margin-top: 2px; }

/* Cột trước / sau */
.legend { display: flex; flex-wrap: wrap; gap: 16px; font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; background: var(--blue); margin-right: 6px; vertical-align: -1px; }
.legend i.is-muted { background: var(--sky); }
.legend b { color: var(--green); }
.vbars { display: flex; align-items: flex-end; justify-content: space-around; gap: 10px; border-bottom: 2px solid var(--pale); padding-top: 8px; }
.vb { display: flex; flex-direction: column; align-items: center; gap: 6px; flex: 1; }
.vb-tag { font-size: 14px; font-weight: 700; color: var(--green); }
.vb-pair { display: flex; align-items: flex-end; gap: 4px; }
.vb-bar { width: 26px; background: var(--blue); border-radius: 6px 6px 0 0; }
.vb-bar.is-muted { background: var(--sky); }
.vb-x { font-size: 14px; font-weight: 600; }
.vb-sub { font-size: 12px; color: var(--muted); text-align: center; margin-bottom: 8px; }

/* Điểm chính */
.points { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; font-size: 15px; }
.points li { padding: 10px 14px; border-radius: 10px; background: #EEF5FC; border-left: 4px solid var(--blue); }
.points li.is-warn { background: var(--orange-bg); border-left-color: var(--orange); }

/* Thẻ theo tập */
.tap header { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.tap h3 { margin: 0; }
.share { font-size: 12px; font-weight: 700; color: var(--blue); background: #EEF5FC; padding: 2px 8px; border-radius: 999px; }
.tap .big { margin-top: 8px; font-size: 26px; }
.mbars { display: flex; align-items: flex-end; gap: 10px; height: 140px; margin-top: 12px; border-bottom: 2px solid var(--pale); }
.mb { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; font-size: 12px; }
.mb span { font-weight: 700; color: var(--navy); }
.mb i { width: 100%; max-width: 38px; background: var(--blue); border-radius: 6px 6px 0 0; }
.mb:last-child i { background: var(--navy); }
.mb em { font-style: normal; color: var(--muted); margin-bottom: -22px; }
.trend { margin: 28px 0 0; font-size: 14px; font-weight: 700; }
.trend.is-up { color: var(--green); }
.trend.is-down { color: var(--red); }

/* Thanh ngang nghiệp vụ */
.hbars { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.hb { display: grid; grid-template-columns: 150px 1fr 90px; align-items: center; gap: 12px; font-size: 14px; }
.hb-k { font-weight: 600; display: flex; flex-direction: column; }
.hb-k small { color: var(--muted); font-size: 12px; }
.hb-track { height: 16px; background: var(--line); border-radius: 8px; overflow: hidden; }
.hb-bar { height: 100%; background: var(--blue); border-radius: 8px; }
.hb-v { font-weight: 700; color: var(--green); text-align: right; }
.hb.is-neg .hb-bar { background: var(--orange); }
.hb.is-neg .hb-v { color: var(--red); }

/* Vinh danh */
.hero-card { position: relative; border-top: 6px solid var(--blue); }
.hero-card.r1 { border-top-color: #C9A227; }
.hero-card.r2 { border-top-color: #8F9BAA; }
.hero-card.r3 { border-top-color: #B5763A; }
.medal { display: inline-block; font-size: 12px; font-weight: 700; color: #fff; background: var(--navy); padding: 3px 10px; border-radius: 999px; margin-bottom: 10px; }
.r1 .medal { background: #C9A227; }
.r2 .medal { background: #8F9BAA; }
.r3 .medal { background: #B5763A; }

/* Bảng xếp hạng */
.tools { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; }
.tools input { font: inherit; padding: 10px 14px; border: 1px solid var(--pale); border-radius: 10px; min-width: 260px; background: #fff; }
.key { font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.table-wrap { overflow-x: auto; background: #fff; border-radius: var(--radius); border: 1px solid var(--line); }
table { width: 100%; min-width: 1040px; border-collapse: collapse; font-size: 14px; }
th { background: var(--pale); color: var(--navy); text-align: right; padding: 12px 10px; font-weight: 700; white-space: nowrap; }
th small { font-weight: 500; }
td { padding: 9px 10px; text-align: right; border-bottom: 1px solid var(--line); white-space: nowrap; }
th:nth-child(2), td.name { text-align: left; }
.c { text-align: center; }
td.name { font-weight: 600; }
td.weak { color: var(--red); font-weight: 600; }
.bq { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.bq b { min-width: 40px; text-align: right; }
.bqbar { width: 110px; height: 8px; background: var(--line); border-radius: 4px; overflow: hidden; }
.bqbar i { display: block; height: 100%; background: var(--blue); }
tr.lv-top td:first-child { font-weight: 800; color: var(--navy); }
tr.lv-orange { background: var(--orange-bg); }
tr.lv-orange .bqbar i { background: var(--orange); }
tr.lv-red { background: var(--red-bg); }
tr.lv-red .bqbar i { background: var(--red); }
tr.lv-red td:first-child, tr.lv-red td.name { color: var(--red); }
.spark { width: 80px; height: 30px; }
.spark polyline { fill: none; stroke: var(--blue); stroke-width: 2; }
tr.lv-red .spark polyline { stroke: var(--red); }
tr.lv-orange .spark polyline { stroke: var(--orange); }
.badge { display: inline-block; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: var(--line); color: var(--muted); white-space: nowrap; }
.badge.is-top { background: var(--navy); color: #fff; }
.badge.is-ok { background: #E3F1E7; color: var(--green); }
.badge.is-orange { background: var(--orange); color: #fff; }
.badge.is-red { background: var(--red); color: #fff; }

/* Cảnh báo */
.warn { border-left: 6px solid var(--orange); background: linear-gradient(0deg, #fff 60%, var(--orange-bg)); }
.warn.is-red { border-left-color: var(--red); background: linear-gradient(0deg, #fff 60%, var(--red-bg)); }
.warn header { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; }
.warn .rk { font-size: 13px; font-weight: 700; color: var(--muted); }
.warn h3 { margin: 0 0 6px; }
.warn .big { font-size: 24px; color: var(--orange); }
.warn.is-red .big { color: var(--red); }
.advice { border-left: 6px solid var(--navy); }

/* Cách tính, chân trang */
.defs { margin: 0; padding: 22px 24px 22px 44px; display: flex; flex-direction: column; gap: 8px; font-size: 14px; color: var(--muted); }
.defs b { color: var(--ink); }
.foot { margin-top: 64px; background: var(--navy); color: var(--pale); padding: 28px 0; font-size: 13px; }
.foot .wrap { display: flex; flex-direction: column; gap: 6px; }
.foot b { color: #fff; font-size: 15px; }

@media (max-width: 640px) {
  .hero h1 { font-size: 30px; }
  .hero .lead { font-size: 16px; }
  .sec h2 { font-size: 24px; }
  .stat .v { font-size: 28px; }
  .topbar nav { gap: 12px; font-size: 13px; }
  .hb { grid-template-columns: 110px 1fr 70px; }
  .vb-bar { width: 18px; }
  .tools input { min-width: 0; width: 100%; }
  .grid-2, .grid-3, .grid-4, .grid-warn { grid-template-columns: 1fr; }
}
