/* Bản tin Tài chính — giao diện theo nhận diện chuyencuabach.com */
:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #f1f3f6;
  --text: #111827;
  --muted: #5b6475;
  --line: #e5e7eb;
  --accent: #c8102e;
  --accent-hover: #a70d26;
  --accent-soft: #fdecee;
  --navy: #1f2a44;
  --navy-2: #2a3758;
  --good: #047857; --good-soft: #dcfce7;
  --warn: #92400e; --warn-soft: #fef3c7;
  --bad: #b91c1c;  --bad-soft: #fee2e2;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(17, 24, 39, .04), 0 4px 16px rgba(17, 24, 39, .05);
  --mono: ui-monospace, "Cascadia Code", Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0c1222; --surface: #121a2d; --surface-2: #18223a; --text: #e8ecf4; --muted: #97a1b6;
    --line: #232d45; --accent: #ff4d5e; --accent-hover: #ff6b79; --accent-soft: #2a1820;
    --navy: #0a1020; --navy-2: #1a2440;
    --good: #6ee7b7; --good-soft: #0b3b2e; --warn: #fcd34d; --warn-soft: #3b2f10;
    --bad: #fca5a5; --bad-soft: #3d1a1d; --shadow: none; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0c1222; --surface: #121a2d; --surface-2: #18223a; --text: #e8ecf4; --muted: #97a1b6;
  --line: #232d45; --accent: #ff4d5e; --accent-hover: #ff6b79; --accent-soft: #2a1820;
  --navy: #0a1020; --navy-2: #1a2440;
  --good: #6ee7b7; --good-soft: #0b3b2e; --warn: #fcd34d; --warn-soft: #3b2f10;
  --bad: #fca5a5; --bad-soft: #3d1a1d; --shadow: none; color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.6 "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.6rem; line-height: 1.25; letter-spacing: -.02em; margin: 28px 0 16px; }
h2 { font-size: 1.08rem; letter-spacing: -.01em; margin: 0 0 14px; }
h3 { font-size: .98rem; margin: 18px 0 8px; }
code { font-family: var(--mono); font-size: .88em; background: var(--surface-2); padding: 1px 6px; border-radius: 6px; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
main.wrap { padding-bottom: 64px; }
.mono { font-family: var(--mono); }

/* ---------- logo ---------- */
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none !important; }
.brand img { width: 34px; height: 34px; border-radius: 9px; flex-shrink: 0; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-weight: 700; font-size: 17px; letter-spacing: -.01em; }
.brand-name b { color: var(--accent); font-weight: 700; }
.brand-sub { font-family: var(--mono); font-size: 11.5px; color: var(--muted); }

/* ---------- header ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
}
.topbar-inner { display: flex; align-items: center; gap: 24px; min-height: 64px; }
.nav { display: flex; gap: 4px; flex: 1; }
.nav a, .subnav a {
  padding: 7px 12px; border-radius: 8px; color: var(--muted); font-weight: 500; font-size: .93rem;
  text-decoration: none; white-space: nowrap;
}
.nav a:hover, .subnav a:hover { color: var(--text); background: var(--surface-2); }
.nav a.active, .subnav a.active { color: var(--text); background: var(--surface-2); font-weight: 600; }
.nav a.active { box-shadow: inset 0 -2px 0 var(--accent); border-radius: 8px 8px 0 0; background: none; }
.userbox { display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; background: var(--navy); color: #fff;
  display: grid; place-items: center; font-weight: 700; font-size: .85rem; text-decoration: none !important;
}
.icon-btn {
  width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface);
  color: var(--muted); cursor: pointer; display: grid; place-items: center; padding: 0;
}
.icon-btn:hover { color: var(--text); }
.icon-btn svg { width: 17px; height: 17px; }
.subnav { border-top: 1px solid var(--line); }
.subnav .wrap { display: flex; gap: 4px; padding-top: 8px; padding-bottom: 8px; overflow-x: auto; }
.subnav a { font-size: .88rem; }
.subnav-label { font-family: var(--mono); font-size: .78rem; color: var(--accent); align-self: center; margin-right: 8px; white-space: nowrap; }

/* ---------- khối ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; margin: 0 0 16px; box-shadow: var(--shadow);
}
.card > h2:first-child { display: flex; align-items: center; gap: 8px; }
.narrow { max-width: 440px; margin: 48px auto; }
.center { text-align: center; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.grid-name-pos { display: grid; grid-template-columns: 1fr 120px; gap: 12px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.head-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.head-row > div:last-child:not(:first-child) { display: flex; gap: 8px; flex-wrap: wrap; }
.page-head { margin: 28px 0 18px; }
.page-head h1 { margin: 0 0 4px; }
.page-head p { margin: 0; color: var(--muted); }
.eyebrow { font-family: var(--mono); font-size: .8rem; color: var(--accent); margin-bottom: 4px; }

/* ---------- form ---------- */
label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: .88rem; }
label.check { flex-direction: row; align-items: center; gap: 10px; font-weight: 400; font-size: .93rem; cursor: pointer; }
input, select, textarea {
  font: inherit; font-weight: 400; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); min-width: 0; transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
input[type=checkbox] { width: 17px; height: 17px; accent-color: var(--accent); padding: 0; }
input:disabled { background: var(--surface-2); color: var(--muted); }
.row input[type=email], .row input[type=search], .row input[type=password] { flex: 1 1 220px; }
.w-num { width: 84px; }
.input-wrap { position: relative; display: flex; }
.input-wrap input { flex: 1; padding-right: 44px; }
.input-wrap .reveal {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: none;
  color: var(--muted); cursor: pointer; padding: 6px; display: grid; place-items: center;
}
.input-wrap .reveal svg { width: 18px; height: 18px; }

/* ---------- nút ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: inherit; font-weight: 600;
  font-size: .9rem; padding: 9px 16px; border-radius: var(--radius-sm); border: 1px solid var(--line);
  background: var(--surface); color: var(--text); cursor: pointer; text-decoration: none !important;
  white-space: nowrap; transition: background .15s, border-color .15s, transform .1s;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.navy { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, var(--line)); }
.btn.danger:hover { background: var(--bad-soft); }
.btn.ghost { border-color: transparent; background: none; }
.btn.small { padding: 5px 11px; font-size: .82rem; }
.btn.block { width: 100%; padding: 12px 16px; font-size: .95rem; }
button.link { background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; font: inherit; }
form.inline { display: inline; }

/* ---------- thông báo, nhãn ---------- */
.flash { padding: 11px 14px; border-radius: var(--radius-sm); margin: 16px 0; font-size: .92rem; border: 1px solid transparent; }
.flash.success { background: var(--good-soft); color: var(--good); }
.flash.error { background: var(--bad-soft); color: var(--bad); }
.flash.warning { background: var(--warn-soft); color: var(--warn); }
.muted { color: var(--muted); }
.small { font-size: .84rem; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.bad-text { color: var(--bad); }
.ellipsis { max-width: 340px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dim { opacity: .55; }
.badge {
  display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .75rem; font-weight: 600;
  background: var(--surface-2); color: var(--muted); white-space: nowrap;
}
.badge.good { background: var(--good-soft); color: var(--good); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.tag {
  display: inline-block; background: var(--surface-2); color: var(--muted); border-radius: 6px;
  padding: 1px 8px; font-size: .75rem; font-weight: 500; margin-left: 4px;
}

/* ---------- bảng ---------- */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 16px; box-shadow: var(--shadow); }
.table-wrap .table { margin: 0; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 10px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.table th { font-size: .76rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; background: var(--surface-2); }
.table tr:last-child td { border-bottom: 0; }
.table tr:hover td { background: color-mix(in srgb, var(--surface-2) 50%, transparent); }

/* ---------- trang tin ---------- */
.feed-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 28px 0 14px; }
.feed-head h1 { margin: 0; }
.filters {
  display: flex; gap: 8px; flex-wrap: wrap; padding: 12px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 12px;
}
.filters input[type=search] { flex: 1 1 240px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 18px; }
.chip {
  padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface);
  color: var(--muted); font-size: .84rem; font-weight: 500; text-decoration: none !important; white-space: nowrap;
}
.chip:hover { color: var(--text); border-color: var(--muted); }
.chip.active { background: var(--navy); border-color: var(--navy); color: #fff; }
.articles { display: grid; gap: 12px; }
.article {
  display: grid; grid-template-columns: 1fr auto; gap: 18px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow);
  transition: border-color .15s;
}
.article:hover { border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }
.article img { width: 150px; height: 100px; object-fit: cover; border-radius: 10px; background: var(--surface-2); }
.article-src { font-family: var(--mono); font-size: .76rem; color: var(--accent); }
.article-title { display: block; font-weight: 650; font-size: 1.04rem; line-height: 1.4; color: var(--text); margin: 3px 0 6px; }
.article-title:hover { color: var(--accent); text-decoration: none; }
.article p { margin: 0 0 8px; color: var(--muted); font-size: .9rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.meta { font-size: .8rem; color: var(--muted); display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.meta .tag:first-of-type { margin-left: 6px; }
.pager { display: flex; justify-content: center; align-items: center; gap: 14px; margin: 24px 0; color: var(--muted); font-size: .9rem; }
.empty { text-align: center; padding: 48px 20px; color: var(--muted); }

/* ---------- thiết lập ---------- */
.checkgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 8px; margin-bottom: 18px; }
.checkgrid label.check {
  border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 9px 12px; background: var(--surface);
}
.checkgrid label.check:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.toolbar { font-size: .84rem; margin: -6px 0 10px; color: var(--muted); }
.section-title { display: flex; align-items: baseline; gap: 8px; margin: 22px 0 12px; font-size: 1rem; }
.section-title:first-of-type { margin-top: 0; }
.sticky-actions { position: sticky; bottom: 0; background: var(--surface); padding: 14px 0 2px; border-top: 1px solid var(--line); margin-top: 8px; }

/* ---------- quản trị ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px;
  display: flex; flex-direction: column; gap: 2px; box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.stat::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--accent); }
.stat b { font-size: 1.7rem; letter-spacing: -.02em; }
.stat span { color: var(--muted); font-size: .84rem; }
.preview li { margin-bottom: 10px; }
.danger-zone { border-color: color-mix(in srgb, var(--bad) 35%, var(--line)); }

/* ---------- trang đăng nhập / đăng ký ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); background: var(--surface); }
.auth-hero {
  position: relative; overflow: hidden; color: #e8ecf4; padding: 48px 56px;
  background: radial-gradient(circle at 85% 30%, rgba(255, 77, 94, .18), transparent 45%), #1f2a44;
  display: flex; flex-direction: column; justify-content: space-between; gap: 40px;
}
.auth-hero .net { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .55; pointer-events: none; }
.auth-hero > * { position: relative; }
.auth-hero .brand { color: #fff; }
.auth-hero .brand img { box-shadow: 0 0 0 1px rgba(255, 255, 255, .22), 0 6px 18px rgba(0, 0, 0, .35); }
.auth-hero .brand-name { font-size: 19px; }
.auth-hero .brand-name b { color: #ff4d5e; }
.auth-hero .brand-sub { color: #97a1b6; }
.auth-tag { font-family: var(--mono); color: #ff4d5e; font-size: .95rem; margin-bottom: 14px; }
.auth-hero h1 { font-size: clamp(2rem, 3.4vw, 2.9rem); line-height: 1.12; margin: 0 0 16px; color: #fff; letter-spacing: -.03em; }
.auth-hero .lead { font-size: 1.06rem; color: #c3cad8; max-width: 30em; margin: 0; }
.auth-bar { width: 72px; height: 4px; border-radius: 2px; background: #ff4d5e; margin: 22px 0 26px; }
.auth-points { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.auth-points li { display: flex; gap: 12px; align-items: flex-start; color: #d6dbe5; }
.auth-points svg { flex-shrink: 0; width: 20px; height: 20px; color: #ff4d5e; margin-top: 2px; }
.auth-sources { display: flex; gap: 8px; flex-wrap: wrap; }
.auth-sources span {
  border: 1px solid rgba(151, 161, 182, .45); border-radius: 999px; padding: 4px 12px; font-size: .8rem;
  color: #c3cad8; background: rgba(12, 18, 34, .35);
}
.auth-sources-label { font-family: var(--mono); font-size: .78rem; color: #97a1b6; margin-bottom: 10px; }
.auth-panel { display: flex; align-items: center; justify-content: center; padding: 48px 24px; position: relative; }
.auth-panel .theme-toggle { position: absolute; top: 20px; right: 20px; }
.auth-box { width: 100%; max-width: 400px; }
.auth-box .brand { display: none; margin-bottom: 28px; }
.auth-box h2 { font-size: 1.65rem; letter-spacing: -.02em; margin: 0 0 6px; }
.auth-box .sub { color: var(--muted); margin: 0 0 26px; }
.auth-box form { gap: 16px; }
.auth-foot { margin-top: 24px; text-align: center; color: var(--muted); font-size: .9rem; }
.auth-legal { margin-top: 36px; text-align: center; font-family: var(--mono); font-size: .76rem; color: var(--muted); }
.auth-legal a { color: var(--muted); }

/* ---------- di động ---------- */
@media (max-width: 900px) {
  .auth { grid-template-columns: 1fr; }
  .auth-hero { display: none; }
  .auth-box .brand { display: inline-flex; }
}
@media (max-width: 720px) {
  .topbar-inner { flex-wrap: wrap; gap: 8px 12px; padding-top: 10px; }
  .nav { order: 3; width: 100%; overflow-x: auto; padding-bottom: 6px; }
  .userbox { margin-left: auto; }
  .user-name { display: none; }
  .article { grid-template-columns: 1fr; }
  .article img { width: 100%; height: 170px; order: -1; }
  .grid-name-pos { grid-template-columns: 1fr; }
  .card { padding: 18px; }
}

/* ---------- sự kiện ---------- */
.tabs { display: flex; gap: 4px; align-items: center; border-bottom: 1px solid var(--line); margin: 0 0 16px; overflow-x: auto; }
.tabs a { padding: 10px 14px; color: var(--muted); font-weight: 600; font-size: .92rem; text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--text); }
.tabs a.active { color: var(--text); border-bottom-color: var(--accent); }
.tabs .tabs-spacer { flex: 1; }
.tabs a.sort { font-size: .84rem; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; margin: 0 0 6px 4px; }
.tabs a.sort.active { background: var(--navy); color: #fff; border-color: var(--navy); }
.section-label { margin: 4px 0 10px; }
.highlights { margin-bottom: 18px; }
.hl-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 12px; }
.hl-grid .event { border-top: 3px solid var(--accent); }
.hot-terms { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0 0 14px; }
.hot-terms .eyebrow { margin: 0 6px 0 0; }
.chip.hot { border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); color: var(--accent); background: var(--accent-soft); }
.event {
  display: grid; grid-template-columns: 1fr auto; gap: 18px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow);
}
.event.compact { grid-template-columns: 1fr; padding: 14px 16px; }
.event.compact .article-title { font-size: .98rem; }
.event img { width: 150px; height: 100px; object-fit: cover; border-radius: 10px; background: var(--surface-2); }
.event p { margin: 0 0 8px; color: var(--muted); font-size: .9rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.event-top { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.region-dot { font-size: .72rem; color: var(--muted); }
.region-dot::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 4px; background: #2f855a; vertical-align: 1px; }
.region-dot.intl::before { background: #2b6cb0; }
.badge.cover { background: var(--navy); color: #fff; }
.score { margin-left: auto; font-family: var(--mono); font-size: .78rem; font-weight: 700; color: var(--muted); background: var(--surface-2); border-radius: 6px; padding: 1px 7px; }
.score.hot { color: var(--accent); background: var(--accent-soft); }
.outlets { margin-top: 10px; background: var(--surface-2); border-radius: 10px; font-size: .86rem; }
.outlets summary { cursor: pointer; padding: 8px 12px; color: var(--muted); list-style: none; }
.outlets summary::-webkit-details-marker { display: none; }
.outlets summary::before { content: "▸ "; color: var(--accent); }
.outlets[open] summary::before { content: "▾ "; }
.outlets summary b { color: var(--text); font-weight: 600; }
.outlets ul { list-style: none; margin: 0; padding: 0 12px 8px; }
.outlets li { display: flex; gap: 8px; align-items: baseline; padding: 5px 0; border-top: 1px dashed var(--line); }
.outlets li a { flex: 1; color: var(--text); display: flex; gap: 8px; min-width: 0; }
.outlets li a:hover .outlet-title { color: var(--accent); }
.outlet-name { font-weight: 700; color: var(--accent); white-space: nowrap; min-width: 92px; }
.outlet-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.outlet-time { color: var(--muted); font-size: .76rem; white-space: nowrap; }
.outlets.locked { padding: 8px 12px; color: var(--muted); }
.lock-card { text-align: center; padding: 40px 24px; }
.lock-card h2 { font-size: 1.3rem; }
@media (max-width: 720px) {
  .event { grid-template-columns: 1fr; }
  .event img { width: 100%; height: 170px; order: -1; }
  .outlet-name { min-width: 0; }
  .outlets li { flex-wrap: wrap; }
}

/* ---------- gói người dùng ---------- */
.plan-badge { display: inline-block; padding: 2px 12px; border-radius: 999px; font-size: .82rem; font-weight: 700; letter-spacing: .02em; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.plan-badge.pro { background: #e8f0fe; color: #1d4ed8; border-color: #bfd3fb; }
.plan-badge.ultra { background: linear-gradient(135deg, #1f2a44, #3b2a5c); color: #ffd9de; border-color: #1f2a44; }
:root[data-theme="dark"] .plan-badge.pro { background: #172554; color: #93c5fd; border-color: #1e3a8a; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .plan-badge.pro { background: #172554; color: #93c5fd; border-color: #1e3a8a; } }
.plan-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.plan-card h2 { margin: 2px 0 4px; }
.limits { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; margin-top: 14px; }
.limits > div { background: var(--surface-2); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; }
.limits b { font-size: 1.2rem; }
.limits span { font-size: .78rem; color: var(--muted); }
.stars { color: #d97706; font-size: .8rem; letter-spacing: 1px; margin-left: auto; white-space: nowrap; }
.src-label { flex: 1; min-width: 0; }
label.check.locked { opacity: .55; cursor: not-allowed; }
label.check.pill { border: 1px solid var(--line); border-radius: 999px; padding: 7px 14px; }
label.check.pill:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.plans-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.plan-col { border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; background: var(--surface); position: relative; }
.plan-col.current { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.plan-col h3 { margin: 8px 0 4px; font-size: 1.15rem; }
.plan-col ul { list-style: none; padding: 0; margin: 12px 0 0; font-size: .88rem; }
.plan-col li { padding: 5px 0; border-top: 1px dashed var(--line); display: flex; justify-content: space-between; gap: 8px; }
.plan-col li span:last-child { font-weight: 600; text-align: right; }
.plan-col .cur-tag { position: absolute; top: 14px; right: 14px; }

/* ---------- quản lý người dùng ---------- */
.stat-link { text-decoration: none !important; color: var(--text); }
.stat-link:hover { border-color: var(--accent); }
.user-cell { display: flex; gap: 10px; align-items: center; }
.user-cell a { color: var(--text); }
.users-table td { vertical-align: middle; }
.row-link { cursor: pointer; }
.avatar.sm { width: 34px; height: 34px; font-size: .82rem; flex-shrink: 0; }
.avatar.lg { width: 72px; height: 72px; font-size: 1.6rem; flex-shrink: 0; }
.avatar.pro { background: #1d4ed8; }
.avatar.ultra { background: linear-gradient(135deg, #1f2a44, #c8102e); }
.profile-head { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.profile-info { flex: 1; min-width: 220px; }
.profile-info h1 { margin: 0 0 2px; font-size: 1.5rem; }
.profile-meta { display: grid; gap: 4px; text-align: right; }
.kv { display: grid; gap: 0; }
.kv > div { display: grid; grid-template-columns: 140px 1fr; gap: 12px; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: .9rem; }
.kv span { color: var(--muted); }
.kv b { font-weight: 500; }
dialog.modal { border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; width: min(520px, calc(100vw - 32px)); background: var(--surface); color: var(--text); box-shadow: 0 20px 60px rgba(0,0,0,.25); }
dialog.modal::backdrop { background: rgba(12, 18, 34, .55); }
.plans-table td, .plans-table th { vertical-align: middle; }
.plans-table input:not([type=checkbox]), .plans-table textarea { width: 100%; }
.plans-table .w-num { width: 100px; }
.switch { position: relative; display: inline-block; width: 42px; height: 24px; flex-direction: row; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; background: var(--line); border-radius: 999px; transition: background .15s; cursor: pointer; }
.switch span::before { content: ""; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: transform .15s; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::before { transform: translateX(18px); }
.switch input:focus-visible + span { box-shadow: 0 0 0 3px var(--accent-soft); }
.weight { color: #d97706; letter-spacing: 1px; white-space: nowrap; }
.score-parts { font-family: var(--mono); font-size: .74rem; color: var(--muted); }
@media (max-width: 720px) {
  .profile-meta { text-align: left; }
  .kv > div { grid-template-columns: 1fr; gap: 2px; }
}

.plans-section { margin: 0 0 20px; }
.plans-section .plans-grid { margin: 12px 0; }

/* ---------- chuyển khoản QR ---------- */
.qr-layout { display: grid; grid-template-columns: minmax(260px, 340px) 1fr; gap: 16px; align-items: start; }
.qr-card { text-align: center; }
.qr-box { background: #fff; border-radius: 12px; padding: 12px; margin: 10px auto; max-width: 300px; border: 1px solid var(--line); }
.qr-box svg, .qr-box img { width: 100%; height: auto; display: block; }
.copy-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.big { font-size: 1.2rem; font-weight: 800; }
.accent { color: var(--accent); }
@media (max-width: 720px) { .qr-layout { grid-template-columns: 1fr; } }

/* ---------- thanh toán, dùng thử ---------- */
.plan-banner { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 16px 0 0; padding: 10px 14px; border-radius: var(--radius-sm); background: var(--warn-soft); color: var(--warn); font-size: .92rem; }
.plan-banner.trial { background: var(--accent-soft); color: var(--text); border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--line)); }
.price { margin: 10px 0 4px; }
.price b { font-size: 1.5rem; letter-spacing: -.02em; }
.price span { color: var(--muted); font-size: .85rem; margin-left: 2px; }
.buy-form { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.pay-result h1 { margin-top: 8px; }
.pay-icon { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto; font-size: 2rem; font-weight: 800; color: #fff; }
.pay-icon.ok { background: #16a34a; }
.pay-icon.fail { background: var(--accent); }
