/* index360 – design system (dark navy mặc định, có light theme) */
:root {
  --bg: #0a1626;
  --bg-2: #0d1d31;
  --panel: #10233a;
  --panel-2: #14304d;
  --panel-3: #183a5c;
  --border: #1f3d5e;
  --border-2: #2b5a86;
  --text: #e8eef8;
  --text-2: #b4c4da;
  --muted: #7f93ad;
  --brand: #36c5f0;
  --primary: #1677d2;
  --primary-2: #2493ed;
  --buy: #2fd38a;
  --buy-bg: rgba(47, 211, 138, .12);
  --watch: #ffc857;
  --watch-bg: rgba(255, 200, 87, .12);
  --sell: #ff6b78;
  --sell-bg: rgba(255, 107, 120, .12);
  --warn: #ff9f43;
  --warn-bg: rgba(255, 159, 67, .13);
  --shadow: 0 8px 28px rgba(0, 0, 0, .28);
  --radius: 14px;
  --radius-sm: 9px;
  --sidebar-w: 252px;
  --font: "Segoe UI", "Inter", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --mono: "Cascadia Mono", Consolas, "SFMono-Regular", monospace;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #eef3f9;
  --bg-2: #e6edf6;
  --panel: #ffffff;
  --panel-2: #f3f7fc;
  --panel-3: #e7eef8;
  --border: #d6e0ec;
  --border-2: #b7c8dd;
  --text: #13233a;
  --text-2: #3c5170;
  --muted: #6c7f99;
  --brand: #0a8fc2;
  --primary: #1268c4;
  --primary-2: #1a7fe0;
  --buy: #0f9d62;
  --buy-bg: rgba(15, 157, 98, .1);
  --watch: #b07d00;
  --watch-bg: rgba(255, 190, 40, .16);
  --sell: #d6334f;
  --sell-bg: rgba(214, 51, 79, .1);
  --warn: #c76a00;
  --warn-bg: rgba(255, 150, 40, .14);
  --shadow: 0 6px 22px rgba(20, 40, 80, .09);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -.01em; }
button, input, select, textarea { font: inherit; color: inherit; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 10px; border: 2px solid var(--bg); }
::-webkit-scrollbar-track { background: transparent; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.mono { font-family: var(--mono); }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }
.grow { flex: 1; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.col { display: flex; flex-direction: column; gap: 10px; }
.mt { margin-top: 16px; }
.mt-s { margin-top: 8px; }
.up { color: var(--buy); }
.down { color: var(--sell); }
.flat { color: var(--watch); }

/* ---------- logo ---------- */
.logo { font-weight: 800; font-size: 28px; letter-spacing: -.03em; color: var(--text); user-select: none; line-height: 1; }
.logo b { color: var(--brand); font-weight: 800; }
.logo .pre { font-weight: 600; letter-spacing: -.01em; }
.sidebar .logo.has-pre { font-size: 20px; line-height: 1.1; }
.logo-row { display: flex; align-items: center; gap: 12px; min-width: 0; }
.logo-row .logo { min-width: 0; }
.logo .nm { white-space: nowrap; }
.logo-mark { flex: 0 0 auto; width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; overflow: hidden; box-shadow: 0 0 0 1px rgba(255,255,255,.08) inset; }
.logo-mark.img { background: transparent; box-shadow: none; }
.logo-mark img { width: 100%; height: 100%; object-fit: contain; }
.sidebar .logo { font-size: 24px; }
.login-hero .logo-mark { width: 72px; height: 72px; border-radius: 16px; }
.shell.collapsed .logo-row { justify-content: center; }
.shell.collapsed .logo-row:has(.logo-mark) .logo { display: none; }
.shell.collapsed .logo .pre { display: none; }
.brand-preview { border: 1px dashed var(--border); border-radius: 12px; padding: 18px; background: var(--panel-2, transparent); }
.brand-preview.dark { background: linear-gradient(160deg, #0b2036, #07111e); }
.brand-preview.dark .logo { color: #fff; } .brand-preview.dark .logo b { color: #36c5f0; }
.logo small { display: block; font-size: 10.5px; font-weight: 600; letter-spacing: .14em; color: var(--muted); margin-top: 6px; text-transform: uppercase; }

/* ---------- login ---------- */
.login-wrap { min-height: 100%; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-hero { background: radial-gradient(1200px 600px at 10% 10%, #17426b 0%, transparent 60%), linear-gradient(160deg, #0b2036, #07111e); color: #e8eef8; padding: 56px; display: flex; flex-direction: column; justify-content: space-between; }
.login-hero .logo { font-size: 54px; color: #fff; }
.login-hero .logo b { color: #36c5f0; }
.login-hero h2 { font-size: 30px; line-height: 1.25; margin-top: 40px; max-width: 520px; }
.login-hero p { color: #a8bfdb; max-width: 520px; }
.feature-list { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 28px; max-width: 560px; }
.feature-list div { background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .08); border-radius: 12px; padding: 12px 14px; font-size: 13px; color: #c9d8ec; }
.feature-list b { display: block; color: #fff; font-size: 13.5px; margin-bottom: 2px; }
.login-form { display: flex; align-items: center; justify-content: center; padding: 40px; }
.login-card { width: 100%; max-width: 380px; }
.login-card h3 { font-size: 24px; margin-bottom: 6px; }
@media (max-width: 900px) { .login-wrap { grid-template-columns: 1fr; } .login-hero { display: none; } }

/* ---------- shell ---------- */
.shell { display: flex; height: 100vh; overflow: hidden; }
.sidebar { width: var(--sidebar-w); flex: none; background: var(--bg-2); border-right: 1px solid var(--border); display: flex; flex-direction: column; transition: width .18s ease; }
.sidebar .brand { padding: 22px 22px 18px; border-bottom: 1px solid var(--border); }
.nav { flex: 1; overflow-y: auto; padding: 10px 12px 16px; }
.nav-group { font-size: 10.5px; font-weight: 700; letter-spacing: .12em; color: var(--muted); text-transform: uppercase; padding: 16px 12px 6px; }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 9px 12px; margin: 2px 0; border-radius: 10px; color: var(--text-2); cursor: pointer; font-weight: 550; position: relative; white-space: nowrap; user-select: none; }
.nav-item:hover { background: var(--panel); color: var(--text); text-decoration: none; }
.nav-item.active { background: linear-gradient(90deg, rgba(54, 197, 240, .16), rgba(54, 197, 240, .04)); color: var(--text); }
.nav-item.active::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 3px; background: var(--brand); }
.nav-item svg { width: 19px; height: 19px; flex: none; opacity: .9; }
.nav-item .tag { margin-left: auto; font-size: 10px; font-weight: 700; padding: 1px 7px; border-radius: 20px; background: var(--panel-3); color: var(--muted); }
.nav-item .tag.new { background: var(--buy-bg); color: var(--buy); }
.nav-item > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.nav-item .tag { flex: 0 0 auto; }
.nav-item .tag.alert { background: var(--warn); color: #1b1200; min-width: 20px; text-align: center; }
.nav-item .tag.alert.hit { background: var(--sell); color: #fff; animation: pulse-bg 1.6s ease-in-out infinite; }
.shell.collapsed .nav-item .tag.alert { display: block; position: absolute; top: 4px; right: 6px; font-size: 9px; padding: 0 5px; }
@keyframes pulse-bg { 0%, 100% { box-shadow: 0 0 0 0 rgba(255,107,120,.55); } 50% { box-shadow: 0 0 0 6px rgba(255,107,120,0); } }
.nav-item .dot { margin-left: auto; width: 8px; height: 8px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 4px rgba(54, 197, 240, .18); animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.user-card { border-top: 1px solid var(--border); padding: 14px 16px; display: flex; align-items: center; gap: 10px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; background: linear-gradient(135deg, var(--primary), var(--brand)); color: #fff; flex: none; }
.user-card .info { flex: 1; min-width: 0; }
.user-card .name { font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-card .role { font-size: 11.5px; color: var(--muted); }
.shell.collapsed .sidebar { width: 72px; }
.shell.collapsed .nav-item span, .shell.collapsed .nav-group, .shell.collapsed .nav-item .tag, .shell.collapsed .user-card .info, .shell.collapsed .logo small { display: none; }
.shell.collapsed .logo { font-size: 18px; }
.shell.collapsed .brand { padding: 22px 12px; text-align: center; }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar { height: 64px; flex: none; display: flex; align-items: center; gap: 14px; padding: 0 24px; border-bottom: 1px solid var(--border); background: var(--bg); }
.topbar h1 { font-size: 18px; }
.topbar .sub { color: var(--muted); font-size: 12.5px; }
.search { position: relative; width: 300px; }
.search input { padding-left: 36px; }
.search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--muted); }
.content { flex: 1; overflow-y: auto; padding: 22px 24px 40px; }
.content-inner { max-width: 1480px; margin: 0 auto; }

/* ---------- controls ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 16px; border-radius: var(--radius-sm); border: 1px solid transparent; background: var(--primary); color: #fff; font-weight: 650; cursor: pointer; white-space: nowrap; transition: background .12s, transform .05s; }
.btn:hover { background: var(--primary-2); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn svg { width: 16px; height: 16px; }
.btn.ghost { background: var(--panel-2); border-color: var(--border); color: var(--text); }
.btn.ghost:hover { background: var(--panel-3); }
.btn.success { background: #138a59; } .btn.success:hover { background: #17a56a; }
.btn.danger { background: transparent; border-color: var(--sell); color: var(--sell); }
.btn.danger:hover { background: var(--sell-bg); }
.btn.sm { height: 30px; padding: 0 11px; font-size: 12.5px; border-radius: 8px; }
.btn.icon { width: 38px; padding: 0; }
.btn.sm.icon { width: 30px; }
.input, select.input, textarea.input { width: 100%; height: 38px; padding: 0 12px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--panel); color: var(--text); outline: none; transition: border .12s, box-shadow .12s; }
textarea.input { height: auto; padding: 10px 12px; }
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(54, 197, 240, .18); }
.input.big { height: 46px; font-size: 16px; font-weight: 650; }
label.field { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; align-items: end; }
.check { display: inline-flex; gap: 8px; align-items: center; font-size: 13px; color: var(--text-2); cursor: pointer; }
.seg { display: inline-flex; background: var(--panel-2); border: 1px solid var(--border); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 6px 12px; border-radius: 7px; cursor: pointer; color: var(--text-2); font-weight: 600; font-size: 12.5px; }
.seg button.on { background: var(--panel); color: var(--text); box-shadow: var(--shadow); }

/* ---------- cards ---------- */
.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.card.flat { box-shadow: none; }
.card-h { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.card-h h3 { font-size: 15px; }
.card-h .muted { font-size: 12px; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-auto { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
@media (max-width: 1200px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 860px) { .g2, .g3, .g4 { grid-template-columns: 1fr; } }
.page-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head .desc { color: var(--muted); max-width: 820px; }
.section-title { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 700; margin: 22px 0 10px; display: flex; align-items: center; gap: 10px; }
.section-title::after { content: ""; flex: 1; height: 1px; background: var(--border); }

.stat { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.stat .k { font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.stat .v { font-size: 24px; font-weight: 750; margin-top: 4px; letter-spacing: -.02em; }
.stat .s { font-size: 12px; color: var(--muted); }

.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge.plain::before { display: none; }
.b-buy { color: var(--buy); background: var(--buy-bg); }
.b-watch { color: var(--watch); background: var(--watch-bg); }
.b-sell { color: var(--sell); background: var(--sell-bg); }
.b-warn { color: var(--warn); background: var(--warn-bg); }
.b-info { color: var(--brand); background: rgba(54, 197, 240, .12); }
.b-muted { color: var(--muted); background: var(--panel-3); }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 6px; background: var(--panel-3); color: var(--text-2); font-size: 11.5px; font-weight: 600; }

.alert { border-radius: 12px; padding: 12px 14px; border: 1px solid; font-size: 13px; display: flex; gap: 10px; align-items: flex-start; }
.alert.warn { background: var(--warn-bg); border-color: rgba(255, 159, 67, .35); color: var(--text); }
.alert.info { background: rgba(54, 197, 240, .08); border-color: rgba(54, 197, 240, .3); }
.alert.danger { background: var(--sell-bg); border-color: rgba(255, 107, 120, .35); }
.alert b { white-space: nowrap; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel); }
table.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 11.5px; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); font-weight: 700; padding: 11px 14px; background: var(--panel-2); border-bottom: 1px solid var(--border); position: sticky; top: 0; }
.tbl td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover td { background: rgba(54, 197, 240, .035); }
.tbl tr.group td { background: var(--panel-2); color: var(--brand); font-weight: 750; font-size: 12.5px; letter-spacing: .04em; padding: 9px 14px; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl tr.clickable { cursor: pointer; }

/* ---------- indicator cards ---------- */
.ind { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; position: relative; overflow: hidden; }
.ind::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--watch); }
.ind.s1::before { background: var(--buy); }
.ind.s-1::before { background: var(--sell); }
.ind .t { display: flex; align-items: flex-start; gap: 8px; }
.ind .lbl { font-weight: 650; color: var(--text-2); font-size: 13px; flex: 1; }
.ind .val { font-size: 25px; font-weight: 750; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.ind .val small { font-size: 12px; color: var(--muted); font-weight: 600; margin-left: 4px; }
.ind .chg { display: flex; gap: 6px; flex-wrap: wrap; font-size: 11.5px; }
.ind .chg span { background: var(--panel-2); padding: 1px 7px; border-radius: 6px; font-variant-numeric: tabular-nums; }
.ind .cmt { font-size: 12.5px; color: var(--text-2); }
.ind .src { font-size: 11px; color: var(--muted); border-top: 1px dashed var(--border); padding-top: 8px; display: flex; gap: 8px; align-items: center; }
.ind .src .grow { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ind .locked { font-size: 11.5px; color: var(--muted); }
.ind .locked b { color: var(--text); }
.spark { width: 100%; height: 38px; display: block; }

/* ---------- hero / verdict ---------- */
.hero { display: grid; grid-template-columns: 260px 1fr; gap: 18px; align-items: center; }
@media (max-width: 900px) { .hero { grid-template-columns: 1fr; } }
.gauge { width: 240px; height: 140px; }
.verdict { border-radius: var(--radius); padding: 18px 20px; border: 1px solid; }
.verdict.buy { background: var(--buy-bg); border-color: rgba(47, 211, 138, .4); }
.verdict.sell { background: var(--sell-bg); border-color: rgba(255, 107, 120, .4); }
.verdict.watch { background: var(--watch-bg); border-color: rgba(255, 200, 87, .4); }
.verdict.warn { background: var(--warn-bg); border-color: rgba(255, 159, 67, .45); }
.verdict .lbl { font-size: 11.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 700; }
.verdict .big { font-size: 23px; font-weight: 800; letter-spacing: -.01em; margin-top: 4px; }
.verdict.buy .big { color: var(--buy); } .verdict.sell .big { color: var(--sell); } .verdict.watch .big { color: var(--watch); } .verdict.warn .big { color: var(--warn); }
.meter { height: 8px; border-radius: 8px; background: var(--panel-3); overflow: hidden; }
.meter > div { height: 100%; border-radius: 8px; background: linear-gradient(90deg, var(--primary), var(--brand)); }

.chart-box { position: relative; width: 100%; height: 420px; }
.chart-box canvas { width: 100%; height: 100%; display: block; }
.chart-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 8px; }
.chart-legend i { display: inline-block; width: 14px; height: 3px; border-radius: 2px; vertical-align: middle; margin-right: 5px; }
.chart-tip { position: absolute; pointer-events: none; background: var(--panel-2); border: 1px solid var(--border-2); border-radius: 8px; padding: 8px 10px; font-size: 12px; box-shadow: var(--shadow); white-space: nowrap; font-variant-numeric: tabular-nums; }

.news-item { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.news-item:last-child { border-bottom: 0; }
.news-item .idx { width: 26px; height: 26px; flex: none; border-radius: 8px; background: var(--panel-3); display: grid; place-items: center; font-size: 12px; font-weight: 700; color: var(--muted); }
.news-item a { font-weight: 650; color: var(--text); }
.news-item a:hover { color: var(--brand); }
.news-item .meta { font-size: 12px; color: var(--muted); margin-top: 4px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.snap { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.snap .stat .v { font-size: 19px; }

.obs { display: grid; grid-template-columns: 150px 1fr; gap: 6px 16px; }
.obs dt { font-weight: 700; color: var(--text-2); }
.obs dd { margin: 0; color: var(--text); }
.scn { border-radius: 12px; padding: 14px; border: 1px solid var(--border); background: var(--panel-2); }
.scn h4 { font-size: 13px; margin-bottom: 6px; }
ul.clean { margin: 0; padding-left: 18px; }
ul.clean li { margin: 5px 0; }

.progress { height: 6px; background: var(--panel-3); border-radius: 6px; overflow: hidden; }
.progress > div { height: 100%; background: linear-gradient(90deg, var(--primary), var(--brand)); transition: width .25s; }
.job-bar { display: flex; align-items: center; gap: 12px; background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 10px 14px; margin-bottom: 16px; }
.job-bar .progress { flex: 1; }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--border-2); border-top-color: var(--brand); animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }

.empty { text-align: center; padding: 50px 20px; color: var(--muted); }
.empty svg { width: 46px; height: 46px; opacity: .5; margin-bottom: 10px; }
.empty h3 { color: var(--text); font-size: 16px; margin-bottom: 4px; }

/* ---------- toast / modal ---------- */
.toasts { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 100; }
.toast { background: var(--panel-2); border: 1px solid var(--border-2); border-left: 4px solid var(--brand); padding: 11px 14px; border-radius: 10px; box-shadow: var(--shadow); max-width: 420px; animation: slide .2s ease; font-size: 13px; }
.toast.ok { border-left-color: var(--buy); } .toast.err { border-left-color: var(--sell); }
@keyframes slide { from { transform: translateY(10px); opacity: 0; } }
.modal-bg { position: fixed; inset: 0; background: rgba(3, 10, 20, .6); display: grid; place-items: center; z-index: 90; padding: 20px; backdrop-filter: blur(2px); }
.modal { background: var(--panel); border: 1px solid var(--border-2); border-radius: 16px; width: 100%; max-width: 520px; max-height: 92vh; overflow: auto; box-shadow: var(--shadow); }
.modal.wide { max-width: 1200px; }
.modal-h { display: flex; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--panel); z-index: 2; }
.modal-h h3 { flex: 1; font-size: 16px; }
.modal-b { padding: 20px; }
.modal-f { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--border); }
.pop { position: absolute; right: 24px; top: 58px; width: 380px; background: var(--panel); border: 1px solid var(--border-2); border-radius: 14px; box-shadow: var(--shadow); z-index: 50; max-height: 70vh; overflow: auto; }
.pop .job { padding: 12px 14px; border-bottom: 1px solid var(--border); font-size: 13px; }
.disclaimer { font-size: 12.5px; color: var(--text-2); background: var(--warn-bg); border: 1px dashed rgba(255, 159, 67, .5); border-radius: 12px; padding: 12px 14px; }
kbd { font-family: var(--mono); font-size: 11px; padding: 1px 5px; border-radius: 4px; border: 1px solid var(--border-2); color: var(--muted); }

/* La bàn chu kỳ chính sách */
.phase-strip { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.phase-step { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel); opacity: .6; }
.phase-step .n { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; background: var(--panel-3); flex: none; }
.phase-step.on { opacity: 1; border-width: 2px; }
.phase-step.on.k-buy { border-color: var(--buy); } .phase-step.on.k-buy .n { background: var(--buy); color: #fff; }
.phase-step.on.k-warn { border-color: var(--warn); } .phase-step.on.k-warn .n { background: var(--warn); color: #fff; }
.phase-step.on.k-sell { border-color: var(--sell); } .phase-step.on.k-sell .n { background: var(--sell); color: #fff; }
.phase-step.on.k-info { border-color: var(--brand); } .phase-step.on.k-info .n { background: var(--brand); color: #fff; }
.r-verdict { margin-top: 12px; padding: 10px 12px; border-radius: 8px; background: var(--panel-3); }
.grp { border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; background: var(--panel); opacity: .7; }
.grp.on { opacity: 1; border-color: var(--buy); box-shadow: inset 3px 0 0 var(--buy); }
.compass-card .gauge { width: 200px; flex: none; }
@media (max-width: 1100px) { .phase-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .phase-strip { grid-template-columns: 1fr; } .compass-card .row { flex-wrap: wrap; } }
.g2 > .hero { grid-template-columns: 1fr; align-items: start; }
.g2 > .hero .gauge { max-width: 220px; margin: 0 auto; display: block; }

/* M7 Ngành & dòng tiền */
.mini-bar { height: 5px; border-radius: 3px; background: var(--panel-3); margin-top: 4px; overflow: hidden; }
.mini-bar i { display: block; height: 100%; background: var(--brand); }
.tbl tr.dim td { opacity: .55; }
.chip.clickable { cursor: pointer; }
.chip.clickable:hover { background: var(--border); }

/* Biểu đồ lịch sử vĩ mô */
.tchart { width: 100%; height: auto; display: block; }

/* Học nhanh • Thuật ngữ */
.help-q { display: inline-grid; place-items: center; width: 17px; height: 17px; border-radius: 50%; font-size: 11px; font-weight: 800; line-height: 1;
  background: var(--panel-3); color: var(--brand); border: 1px solid var(--border); text-decoration: none; vertical-align: middle; text-transform: none; letter-spacing: 0; }
.help-q:hover { background: var(--brand); color: #fff; }
.learn-grid { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 16px; align-items: start; }
.term-list { max-height: calc(100vh - 230px); overflow: auto; position: sticky; top: 0; padding: 10px 12px; }
.term-item { display: block; padding: 8px 10px; border-radius: 8px; cursor: pointer; color: var(--text); text-decoration: none; }
.term-item:hover { background: var(--panel-3); }
.term-item.on { background: var(--panel-3); box-shadow: inset 3px 0 0 var(--brand); }
.term-short { font-size: 15.5px; margin: 10px 0; padding: 10px 12px; border-left: 3px solid var(--brand); background: var(--panel-3); border-radius: 0 8px 8px 0; }
.term-detail p { line-height: 1.6; }
.live-box { margin-top: 12px; padding: 10px 12px; border: 1px dashed var(--buy); border-radius: 8px; }
.lv-wrap { margin: 12px 0 4px; }
.lv { width: 100%; height: auto; display: block; max-height: 260px; }
.chip.on { background: var(--brand); color: #fff; }
.path { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
.step-n { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; background: var(--brand); color: #fff; flex: none; }
.flash-wrap { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }
.flash { min-height: 220px; border-radius: 14px; border: 1px solid var(--border); background: var(--panel-3); display: flex; flex-direction: column;
  justify-content: center; align-items: center; text-align: center; gap: 10px; padding: 24px; cursor: pointer; transition: transform .15s; }
.flash:hover { transform: translateY(-2px); }
.flash.flipped { border-color: var(--brand); }
.flash-q { font-size: 24px; font-weight: 800; }
.flash-a { font-size: 17px; line-height: 1.5; }
@media (max-width: 1000px) { .learn-grid { grid-template-columns: 1fr; } .term-list { position: static; max-height: 320px; } .path { grid-template-columns: 1fr; } }

/* Mô hình đồ thị (M3/M6) */
.pat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 12px; }
.pat-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; background: var(--panel); }
.pat-card.on { border-color: var(--brand); box-shadow: inset 3px 0 0 var(--brand); }
.pat-top { display: flex; gap: 12px; align-items: flex-start; }
.pat-ref { width: 170px; flex: none; background: var(--panel-3); border-radius: 8px; padding: 4px; }
.pat-sketch { width: 100%; height: auto; display: block; }
@media (max-width: 640px) { .pat-grid { grid-template-columns: 1fr; } .pat-top { flex-direction: column; } .pat-ref { width: 100%; } }
.pat-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.pat-tile { display: flex; flex-direction: column; gap: 4px; padding: 10px; text-decoration: none; color: var(--text); cursor: pointer; }
.pat-tile:hover { border-color: var(--brand); }
.term-detail .pat-sketch { max-width: 460px; margin: 0 auto; }

/* My Card – tóm tắt so với mục tiêu */
.review-list { margin: 10px 0 6px; padding-left: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.review-list li { padding: 7px 10px; border-radius: 8px; background: var(--panel-3); border-left: 3px solid var(--border); }
.review-list li.lv-buy { border-left-color: var(--buy); } .review-list li.lv-sell { border-left-color: var(--sell); }
.review-list li.lv-warn { border-left-color: var(--warn); } .review-list li.lv-watch, .review-list li.lv-info { border-left-color: var(--brand); }
.plan-box { border: 1px dashed var(--border); border-radius: 10px; padding: 10px; }

/* My Card – bố cục cân đối form lệnh / biểu đồ */
.sim-main { display: grid; grid-template-columns: minmax(340px, 400px) minmax(0, 1fr); gap: 14px; align-items: stretch; }
.sim-side { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.sim-chart { flex: 1; display: flex; flex-direction: column; }
.sim-chart > :last-child { flex: 1; }
.sim-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center; min-height: 220px; color: var(--muted); }
.sim-empty svg { opacity: .55; }
.alloc-bar { display: flex; height: 14px; border-radius: 8px; overflow: hidden; background: var(--panel-3); }
.alloc-bar > div { height: 100%; }
.alloc-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 10px; font-size: 13px; }
.alloc-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.alloc-rows { margin-top: 12px; display: grid; gap: 8px; }
.alloc-row { display: grid; grid-template-columns: 56px minmax(0, 1fr) 54px 64px; gap: 10px; align-items: center; }
@media (max-width: 980px) { .sim-main { grid-template-columns: 1fr; } }

/* My Card – cảnh báo mục tiêu / cắt lỗ */
.plan-alerts { display: grid; gap: 8px; margin-bottom: 14px; }
.plan-alert { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-radius: 12px; border: 1px solid; border-left-width: 5px; }
.plan-alert .pa-t { letter-spacing: .06em; margin-right: 4px; }
.pa-sell { background: var(--sell-bg); border-color: var(--sell); } .pa-sell svg, .pa-sell .pa-t { color: var(--sell); }
.pa-buy { background: var(--buy-bg); border-color: var(--buy); } .pa-buy svg, .pa-buy .pa-t { color: var(--buy); }
.pa-warn { background: var(--warn-bg); border-color: var(--warn); } .pa-warn svg, .pa-warn .pa-t { color: var(--warn); }
.pa-info { background: rgba(54,197,240,.1); border-color: var(--brand); } .pa-info svg, .pa-info .pa-t { color: var(--brand); }
.pa-sell svg { animation: blink 1.2s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .35; } }
tr.row-hit-stop td { background: var(--sell-bg); } tr.row-hit-stop td:first-child { box-shadow: inset 4px 0 0 var(--sell); }
tr.row-hit-target td { background: var(--buy-bg); } tr.row-hit-target td:first-child { box-shadow: inset 4px 0 0 var(--buy); }
tr.row-near-stop td:first-child { box-shadow: inset 4px 0 0 var(--warn); }
tr.row-near-target td:first-child { box-shadow: inset 4px 0 0 var(--brand); }
.plan-range { position: relative; height: 18px; margin-top: 2px; }
.plan-range .pr-track { position: absolute; left: 0; right: 0; top: 7px; height: 4px; border-radius: 4px;
  background: linear-gradient(90deg, var(--sell) 0%, rgba(255,107,120,.35) 12%, var(--panel-3) 35%, var(--panel-3) 65%, rgba(47,211,138,.35) 88%, var(--buy) 100%); }
.plan-range .pr-avg { position: absolute; top: 2px; width: 2px; height: 14px; margin-left: -1px; background: var(--muted); border-radius: 2px; }
.plan-range .pr-now { position: absolute; top: 3px; width: 12px; height: 12px; margin-left: -6px; border-radius: 50%; background: var(--text); border: 2px solid var(--panel); box-shadow: 0 0 0 1px var(--text); }
.plan-range.al-hit-stop .pr-now, .plan-range.al-near-stop .pr-now { background: var(--sell); box-shadow: 0 0 0 1px var(--sell); }
.plan-range.al-hit-target .pr-now, .plan-range.al-near-target .pr-now { background: var(--buy); box-shadow: 0 0 0 1px var(--buy); }
.plan-range.al-hit-stop .pr-now, .plan-range.al-hit-target .pr-now { animation: pulse-bg 1.4s ease-in-out infinite; }
.pr-scale { display: flex; justify-content: space-between; gap: 6px; font-size: 11px; }
.pulse { width: 9px; height: 9px; border-radius: 50%; display: inline-block; animation: pulse-bg 1.4s ease-in-out infinite; }
.pulse.sell { background: var(--sell); } .pulse.buy { background: var(--buy); }

/* M3/M4 v2 – nhân tố, mục tiêu thực tế */
.rank-bars { display: grid; gap: 3px; font-size: 11px; }
.rank-bars > div { display: grid; grid-template-columns: 84px 1fr; align-items: center; gap: 6px; }
.rank-bars span { color: var(--muted); white-space: nowrap; }
.rank-bars i { display: block; height: 6px; border-radius: 4px; background: var(--panel-3); overflow: hidden; }
.rank-bars b { display: block; height: 100%; border-radius: 4px; }
tr.row-pri td:first-child { box-shadow: inset 4px 0 0 var(--buy); }
.lv-box { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; }
.lv-row { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: baseline; }
.m4-chip { border: 1px dashed var(--border); border-radius: 10px; padding: 8px 10px; }
