/* =========================================================
   WECOSI Terminal — design system
   3 lớp chiều sâu: nền chìm (well) · thẻ nổi (card) · phần tử nổi cao (raised)
   ========================================================= */
:root {
  --bg: #04071a;
  --text: #e8ebf7;
  --muted: #8b94b8;
  --dim: #5b6489;
  --green: #22e39a;
  --red: #ff4d6d;
  --amber: #ffb547;
  --cyan: #3ad7ff;
  --violet: #8b5cf6;
  --blue: #4f7dff;
  --radius: 16px;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --card-bg: linear-gradient(180deg, rgba(27, 34, 74, 0.96) 0%, rgba(15, 20, 46, 0.97) 100%);
  --raised-bg: linear-gradient(180deg, #1c2454 0%, #131a3c 100%);
  --well-bg: #070b22;
  --shadow-card:
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    inset 0 -1px 0 rgba(0, 0, 0, 0.45),
    0 1px 2px rgba(0, 0, 0, 0.55),
    0 14px 30px -14px rgba(0, 0, 0, 0.85),
    0 34px 70px -34px rgba(24, 18, 96, 0.7);
  --shadow-raised:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 1px 1px rgba(0, 0, 0, 0.5),
    0 8px 18px -8px rgba(0, 0, 0, 0.8);
  --shadow-well: inset 0 2px 6px rgba(0, 0, 0, 0.65), inset 0 0 0 1px rgba(255, 255, 255, 0.035);
  --ring: rgba(150, 170, 255, 0.28);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  background:
    radial-gradient(1100px 620px at 88% -12%, rgba(139, 92, 246, 0.2), transparent 60%),
    radial-gradient(900px 520px at -8% 108%, rgba(58, 215, 255, 0.12), transparent 60%),
    radial-gradient(700px 400px at 50% 50%, rgba(79, 125, 255, 0.05), transparent 70%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font-size: 13px;
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image: linear-gradient(rgba(120, 140, 255, 0.035) 1px, transparent 1px), linear-gradient(90deg, rgba(120, 140, 255, 0.035) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(ellipse at 60% 30%, #000 20%, transparent 75%);
  mask-image: radial-gradient(ellipse at 60% 30%, #000 20%, transparent 75%);
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.up { color: var(--green); }
.down { color: var(--red); }
.flat, .muted { color: var(--muted); }

/* ---------- Layout ---------- */
.app { position: relative; z-index: 1; display: grid; grid-template-columns: 212px 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; z-index: 5;
  display: flex; flex-direction: column; gap: 12px; padding: 16px 12px;
  background: linear-gradient(180deg, rgba(14, 19, 46, 0.98), rgba(6, 9, 26, 0.98));
  border-right: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: 1px 0 0 rgba(0, 0, 0, 0.5), 12px 0 40px -20px rgba(0, 0, 0, 0.9);
}
.brand-block { padding: 2px 6px 14px; margin-bottom: 2px; border-bottom: 1px solid rgba(255, 255, 255, 0.05); }
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark { width: 40px; height: 40px; flex: none; filter: drop-shadow(0 6px 10px rgba(91, 61, 245, 0.55)); }
.brand-text { min-width: 0; }
.brand-word { display: block; height: 17px; width: auto; filter: drop-shadow(0 2px 6px rgba(139, 92, 246, 0.45)); }
.neon-engine { margin-top: 5px; font-size: 8.5px; font-weight: 700; letter-spacing: 2.6px; color: #c9f6ff; text-shadow: 0 0 6px rgba(127, 240, 255, 0.45); }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  position: relative; display: flex; align-items: center; gap: 10px;
  padding: 8px 11px; border-radius: 10px; color: #aeb6d6; text-align: left; font-size: 12.5px;
  transition: background .15s, color .15s, box-shadow .15s;
}
.nav-item svg { width: 16px; height: 16px; flex: none; opacity: .8; }
.nav-item:hover { background: rgba(255, 255, 255, 0.04); color: var(--text); }
.nav-item.active {
  color: #fff;
  background: linear-gradient(180deg, rgba(96, 112, 255, 0.38), rgba(79, 92, 230, 0.16));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), inset 0 0 0 1px rgba(130, 150, 255, 0.35), 0 8px 18px -8px rgba(79, 125, 255, 0.75);
}
.nav-item.active::before {
  content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0;
  background: linear-gradient(180deg, #8fa8ff, #b18cff); box-shadow: 0 0 10px #8b5cf6;
}
.nav-item.active svg { opacity: 1; filter: drop-shadow(0 0 4px rgba(143, 168, 255, 0.8)); }
.nav-item .soon { margin-left: auto; font-size: 9px; font-style: normal; color: var(--dim); border: 1px solid rgba(255, 255, 255, 0.07); padding: 1px 5px; border-radius: 5px; }

.side-card {
  margin-top: auto; padding: 12px; border-radius: 14px; position: relative;
  background: linear-gradient(160deg, rgba(139, 92, 246, 0.26), rgba(40, 32, 110, 0.25) 60%, rgba(79, 125, 255, 0.12));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), inset 0 0 0 1px rgba(139, 92, 246, 0.4), 0 12px 28px -12px rgba(91, 61, 245, 0.6);
}
.side-card h4 { font-size: 12px; margin-bottom: 3px; }
.side-card p { font-size: 11px; color: #a9b0d4; line-height: 1.45; }
.mode-pill { display: inline-flex; align-items: center; gap: 6px; margin-top: 9px; padding: 5px 9px; border-radius: 8px; font-size: 11px; font-weight: 600; background: rgba(34, 227, 154, 0.12); color: var(--green); box-shadow: inset 0 0 0 1px rgba(34, 227, 154, 0.35); }
.session { padding: 10px 12px; border-radius: 12px; background: var(--well-bg); box-shadow: var(--shadow-well); font-size: 11px; }
.session-row { display: flex; align-items: center; gap: 8px; }
.session-row + .session-row { margin-top: 5px; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 2px rgba(34, 227, 154, 0.18), 0 0 8px var(--green); flex: none; }
.dot.off { background: var(--dim); box-shadow: none; }

.main { min-width: 0; display: flex; flex-direction: column; }
.top-sticky { position: sticky; top: 0; z-index: 10; }
.topbar {
  position: relative; display: flex; align-items: center; gap: 10px; padding: 10px 20px;
  background: rgba(6, 9, 26, 0.85); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.05), 0 10px 30px -18px rgba(0, 0, 0, 0.9);
}
.search {
  flex: 1; max-width: 420px; min-width: 150px; display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 10px;
  background: var(--well-bg); box-shadow: var(--shadow-well); color: var(--muted);
}
.search:focus-within { box-shadow: var(--shadow-well), 0 0 0 1px rgba(139, 92, 246, 0.55), 0 0 18px -4px rgba(139, 92, 246, 0.6); }
.search svg { width: 14px; height: 14px; }
.search input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; color: var(--text); font: inherit; font-size: 12.5px; }
/* Dòng chữ chạy toàn chiều ngang: LIVE giá + HOT NEWS */
.ticker-bar { background: rgba(5, 8, 24, 0.92); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); box-shadow: 0 1px 0 rgba(255, 255, 255, 0.05), 0 12px 24px -16px rgba(0, 0, 0, 0.9); }
.ticker { display: flex; align-items: center; height: 30px; min-width: 0; overflow: hidden; }
.ticker + .ticker { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.045); }
.tk-label { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 100%; padding: 0 14px 0 20px; font-size: 10px; font-weight: 800; letter-spacing: 1.2px; }
.tk-label i { width: 6px; height: 6px; border-radius: 50%; animation: pulse 1.4s ease-in-out infinite; }
.tk-label.live { color: #9ff5cf; }
.tk-label em { font-style: normal; font-weight: 600; letter-spacing: .3px; font-size: 9px; color: var(--dim); margin-left: 2px; }
.tk-label.live i { background: var(--green); box-shadow: 0 0 8px var(--green); }
.tk-label.hot { color: #ffd38a; }
.tk-label.hot i { background: var(--amber); box-shadow: 0 0 8px var(--amber); }
.tk-track { flex: 1; min-width: 0; overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 40px, #000 calc(100% - 40px), transparent); mask-image: linear-gradient(90deg, transparent, #000 40px, #000 calc(100% - 40px), transparent); }
.tk-move { display: inline-flex; white-space: nowrap; animation: tk-scroll 90s linear infinite; will-change: transform; }
.tk-move.slow { animation-duration: 160s; }
.ticker:hover .tk-move { animation-play-state: paused; }
@keyframes tk-scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@keyframes pulse { 50% { opacity: .35; } }
.tk-item { display: inline-flex; align-items: center; gap: 7px; padding: 2px 18px; font-size: 12.5px; color: #c3c9e2; border-right: 1px solid rgba(255, 255, 255, 0.06); transition: background .4s; border-radius: 4px; }
.tk-item b { color: #e8ebf7; font-weight: 650; }
.tk-item .nm { color: var(--muted); font-size: 11px; }
.tk-item .num { color: var(--text); }
.tk-item em { font-style: normal; font-family: var(--mono); font-size: 12px; }
.tk-item.flash-up { background: rgba(34, 227, 154, 0.18); }
.tk-item.flash-down { background: rgba(255, 77, 109, 0.18); }
.tk-news { display: inline-flex; align-items: center; gap: 8px; padding: 0 22px; font-size: 12.5px; color: #e3e6f5; }
.tk-news .cat { padding: 2px 7px; border-radius: 5px; font-size: 10.5px; font-weight: 700; color: #ff8fa3; background: rgba(255, 77, 109, 0.14); box-shadow: inset 0 0 0 1px rgba(255, 77, 109, 0.3); }
.tk-news .cat.green { color: #7ff0c4; background: rgba(34, 227, 154, 0.12); box-shadow: inset 0 0 0 1px rgba(34, 227, 154, 0.3); }
.tk-news .cat.amber { color: #ffd38a; background: rgba(255, 181, 71, 0.12); box-shadow: inset 0 0 0 1px rgba(255, 181, 71, 0.3); }
.tk-news .cat.violet { color: #cdbaff; background: rgba(139, 92, 246, 0.14); box-shadow: inset 0 0 0 1px rgba(139, 92, 246, 0.35); }
.tk-news .src { font-size: 11px; color: var(--dim); }
.h-sub { font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: .02em; margin-left: 6px; }
.info-i { display: inline-grid; place-items: center; width: 13px; height: 13px; margin-left: 4px; border-radius: 50%; font-size: 8.5px; font-weight: 800; text-transform: none; color: #0a0d22; background: #8b94b8; vertical-align: 1px; cursor: help; }
.clock { margin-left: auto; font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.btn-copilot {
  display: inline-flex; align-items: center; gap: 7px; padding: 7px 13px; border-radius: 10px; font-weight: 600; font-size: 12px;
  background: linear-gradient(180deg, #6f62ff, #4f3bd8);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), inset 0 -2px 0 rgba(0, 0, 0, 0.25), 0 8px 20px -8px rgba(111, 98, 255, 0.85);
  transition: transform .1s, box-shadow .15s;
}
.btn-copilot:active, .btn-primary:active, .btn-kill:active { transform: translateY(1px); }
.btn-copilot svg { width: 14px; height: 14px; }
.icon-btn { position: relative; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 10px; color: #b5bcd8; background: var(--raised-bg); box-shadow: var(--shadow-raised); }
.icon-btn:hover { color: #fff; }
.icon-btn svg { width: 16px; height: 16px; }
.badge { position: absolute; top: -4px; right: -4px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: linear-gradient(180deg, #ff6b85, #e8264b); color: #fff; font-size: 9.5px; font-weight: 700; display: grid; place-items: center; box-shadow: 0 0 0 2px #070b22, 0 3px 8px rgba(255, 45, 85, 0.6); }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 11.5px; background: radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.45), transparent 45%), linear-gradient(135deg, #4f7dff, #8b5cf6); box-shadow: 0 0 0 2px #070b22, 0 0 0 3px rgba(139, 92, 246, 0.6), 0 6px 14px -4px rgba(139, 92, 246, 0.8); }

.view { display: none; padding: 16px 20px 36px; }
.view.active { display: block; animation: fade .2s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }
.view-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; margin-bottom: 14px; flex-wrap: wrap; }
.view-head h1 { font-size: 19px; font-weight: 750; letter-spacing: -.2px; }
.view-head p { color: var(--muted); margin-top: 4px; max-width: 760px; line-height: 1.5; font-size: 12.5px; }

/* ---------- Surfaces ---------- */
.card {
  position: relative; min-width: 0; padding: 14px; border-radius: var(--radius);
  background: var(--card-bg); box-shadow: var(--shadow-card);
}
.card::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none;
  background: linear-gradient(160deg, var(--ring), rgba(150, 170, 255, 0.05) 38%, rgba(139, 92, 246, 0.14) 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
}
.well { background: var(--well-bg); box-shadow: var(--shadow-well); border-radius: 12px; }

/* Nghiêng 3D khi rê chuột (JS đặt --rx --ry --mx --my) */
.tilt { transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(var(--ty, 0)); transition: transform .25s ease, box-shadow .25s ease; will-change: transform; }
.tilt::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .25s;
  background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 0%), rgba(255, 255, 255, 0.08), transparent 60%);
}
.tilt:hover { --ty: -2px; }
.tilt:hover::after { opacity: 1; }

.card-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 11px; }
.card-title h3 { font-size: 11.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: #b7bfe2; }
.card-title .sub { font-size: 11px; color: var(--dim); }
.link { color: #8fa8ff; font-size: 11.5px; }
.link:hover { color: #fff; }
.tag { display: inline-block; padding: 2px 7px; border-radius: 6px; font-size: 10px; font-weight: 650; letter-spacing: .2px; background: rgba(255, 255, 255, 0.05); color: var(--muted); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08); white-space: nowrap; }
.tag.green { color: var(--green); background: rgba(34, 227, 154, 0.1); box-shadow: inset 0 0 0 1px rgba(34, 227, 154, 0.32), 0 0 10px -4px rgba(34, 227, 154, 0.6); }
.tag.red { color: #ff7d93; background: rgba(255, 77, 109, 0.1); box-shadow: inset 0 0 0 1px rgba(255, 77, 109, 0.32), 0 0 10px -4px rgba(255, 77, 109, 0.6); }
.tag.amber { color: var(--amber); background: rgba(255, 181, 71, 0.1); box-shadow: inset 0 0 0 1px rgba(255, 181, 71, 0.32); }
.tag.violet { color: #c4b0ff; background: rgba(139, 92, 246, 0.13); box-shadow: inset 0 0 0 1px rgba(139, 92, 246, 0.38); }
.tag.cyan { color: var(--cyan); background: rgba(58, 215, 255, 0.1); box-shadow: inset 0 0 0 1px rgba(58, 215, 255, 0.32); }

/* Đồng xu 3D cho mã hàng — màu qua biến --c */
.sym-icon {
  --c: #8b5cf6; width: 34px; height: 34px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-weight: 800; font-size: 11px; color: rgba(10, 12, 30, 0.9);
  background: radial-gradient(circle at 32% 26%, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0) 42%), radial-gradient(circle at 50% 120%, rgba(0, 0, 0, 0.35), transparent 60%), var(--c);
  box-shadow: inset 0 -3px 5px rgba(0, 0, 0, 0.3), inset 0 2px 2px rgba(255, 255, 255, 0.35), 0 0 0 1px rgba(0, 0, 0, 0.35), 0 5px 12px -3px rgba(0, 0, 0, 0.75);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35);
}

/* ---------- Dashboard ---------- */
.dash { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 14px; align-items: stretch; }
.dash > .col > .card:last-child { flex: 1; }
.col { display: flex; flex-direction: column; gap: 14px; min-width: 0; }

/* Dải KPI gọn: 4 ô trong 1 thẻ */
.kpi-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 0; }
.kseg { position: relative; display: flex; align-items: center; gap: 10px; padding: 10px 14px; min-width: 0; }
.kseg + .kseg::before { content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 1px; background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.09), transparent); }
.kpi-ic { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex: none; background: var(--raised-bg); box-shadow: var(--shadow-raised); }
.kpi-ic svg { width: 15px; height: 15px; }
.kt { flex: 1; min-width: 0; }
.kseg .label { font-size: 9.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kseg .kv { display: flex; align-items: baseline; gap: 8px; margin-top: 3px; white-space: nowrap; min-width: 0; }
.kseg .value { font-family: var(--mono); font-size: 17px; font-weight: 700; letter-spacing: -.5px; }
.kseg .delta { font-size: 10.5px; overflow: hidden; text-overflow: ellipsis; }
.kspark { width: 64px; height: 26px; flex: none; }
.kspark svg { width: 100%; height: 100%; display: block; }
.kmeter { width: 70px; flex: none; text-align: right; font-size: 9.5px; color: var(--dim); }
.kmeter .trk { position: relative; height: 5px; border-radius: 4px; background: var(--well-bg); box-shadow: var(--shadow-well); margin-bottom: 4px; }
.kmeter .trk i { position: absolute; inset: 0 auto 0 0; border-radius: 4px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 0 8px -2px rgba(120, 150, 255, 0.8); }
.kmeter .trk b { position: absolute; top: -3px; bottom: -3px; width: 2px; border-radius: 2px; background: var(--red); box-shadow: 0 0 6px var(--red); }
/* Bằng chứng theo họ yếu tố */
.evid { display: flex; flex-wrap: wrap; gap: 5px; margin: -2px 0 10px; }
.evid .ev { display: inline-flex; align-items: center; gap: 4px; padding: 3px 7px; border-radius: 7px; font-size: 10.5px; font-weight: 600; background: var(--raised-bg); box-shadow: var(--shadow-raised); color: #c3c9e2; }
.evid .ev b { font-size: 10px; }
.evid .ev.veto { color: var(--amber); box-shadow: var(--shadow-raised), inset 0 0 0 1px rgba(255, 181, 71, 0.4); }
.comp-group { font-size: 9.5px; color: var(--dim); letter-spacing: .05em; text-transform: uppercase; margin: 2px 0 -2px; }

/* Phương án giao dịch */
.plan-card { margin-bottom: 14px; }
.plan-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.plan-head h3 { font-size: 11.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: #b7bfe2; }
.plan-head .title { font-size: 15px; font-weight: 750; }
.plan-head .asof { margin-left: auto; font-size: 10.5px; color: var(--dim); font-family: var(--mono); }
.plan-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1.25fr) minmax(0, 1fr); gap: 12px; }
.plan-box { padding: 11px 12px; border-radius: 12px; background: var(--well-bg); box-shadow: var(--shadow-well); min-width: 0; }
.plan-box h4 { font-size: 9.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.steps { display: flex; gap: 4px; margin-bottom: 10px; }
.steps span { flex: 1; text-align: center; font-size: 9.5px; padding: 5px 2px; border-radius: 6px; color: var(--dim); background: rgba(255, 255, 255, 0.03); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.steps span.done { color: #b9c6ff; background: rgba(95, 115, 255, 0.16); box-shadow: inset 0 0 0 1px rgba(110, 140, 255, 0.35); }
.steps span.now { color: #fff; background: linear-gradient(180deg, #5f73ff, #4555d8); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 4px 12px -4px rgba(79, 125, 255, 0.9); }
.steps.cancel span.now { background: linear-gradient(180deg, #ff6b85, #c9264a); }
.plan-cond { font-size: 11px; color: #c3c9e2; line-height: 1.5; }
.plan-cond b { color: var(--text); }
.plan-actions { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.plan-actions button { padding: 6px 10px; border-radius: 8px; font-size: 11px; font-weight: 650; background: var(--raised-bg); box-shadow: var(--shadow-raised); }
.plan-actions button.pri { background: linear-gradient(180deg, #7a6bff, #5a3ff0); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 6px 14px -6px rgba(91, 61, 245, 0.9); }
.plan-actions button.ghost { color: #ff8fa3; }
.plan-actions button:disabled { opacity: .45; cursor: not-allowed; }
.lv { display: grid; grid-template-columns: auto 1fr auto; gap: 6px 10px; align-items: center; font-size: 11.5px; }
.lv .k { color: var(--muted); }
.lv .v { font-family: var(--mono); text-align: right; font-weight: 650; }
.lv .s { font-size: 10px; color: var(--dim); text-align: right; }
.ladder { position: relative; height: 8px; border-radius: 5px; margin: 12px 0 4px; background: linear-gradient(90deg, rgba(255, 77, 109, 0.5), rgba(255, 77, 109, 0.15) 40%, rgba(34, 227, 154, 0.15) 60%, rgba(34, 227, 154, 0.5)); box-shadow: var(--shadow-well); }
.ladder i { position: absolute; top: -4px; width: 2px; height: 16px; border-radius: 2px; background: #fff; }
.ladder i.zone { height: 8px; top: 0; border-radius: 3px; background: rgba(110, 140, 255, 0.7); }
.ladder-l { display: flex; justify-content: space-between; font-size: 9.5px; color: var(--dim); font-family: var(--mono); }
.risk-big { font-family: var(--mono); font-size: 18px; font-weight: 700; color: #ff8fa3; }
.plan-list { list-style: none; display: flex; flex-direction: column; gap: 3px; font-size: 10.5px; color: #c3c9e2; margin-top: 6px; }
.plan-list li::before { content: "✕ "; color: #ff8fa3; }
.oos { margin-top: 8px; font-size: 10.5px; color: #c3c9e2; line-height: 1.5; }
.oos .warn { color: var(--amber); }
.audit { margin-top: 10px; display: flex; flex-direction: column; gap: 2px; font-family: var(--mono); font-size: 9.5px; color: var(--dim); max-height: 64px; overflow-y: auto; }
.audit b { color: #8fa8ff; font-weight: 500; }
.stand { display: flex; align-items: center; gap: 14px; padding: 6px 2px; }
.stand .big { font-size: 22px; font-weight: 800; color: var(--muted); letter-spacing: .5px; }

/* Dải bối cảnh vĩ mô */
.macro-strip { display: flex; align-items: stretch; padding: 0; margin-bottom: 14px; }
.ms-head { flex: none; display: flex; align-items: center; padding: 0 16px; font-size: 9.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; line-height: 1.35; color: #b7bfe2; box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.07); }
.ms-grid { flex: 1; min-width: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); }
.mseg { position: relative; padding: 10px 14px; min-width: 0; }
.mseg + .mseg::before { content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 1px; background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.09), transparent); }
.mseg .l { font-size: 9.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mseg .row { display: flex; align-items: baseline; gap: 6px; margin: 3px 0 4px; white-space: nowrap; }
.mseg .v { font-family: var(--mono); font-size: 14px; font-weight: 700; }
.mseg .d { font-family: var(--mono); font-size: 10px; }
.mkt-tools { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.board .nm { color: var(--text); font-weight: 600; }
.board tr.cur td { background: rgba(110, 140, 255, 0.08); }
.board tr.cur td:first-child { box-shadow: inset 3px 0 0 #6e8cff; }

/* Hàng 3 cột: Biểu đồ | Tín hiệu Quant | Trợ lý AI KAI */
.trio { display: grid; grid-template-columns: minmax(0, 1fr) 290px 330px; gap: 14px; margin: 12px 0 14px; }
.trio > .card { min-height: 0; }
.trio .copilot { display: flex; flex-direction: column; contain: size; }
.trio .chat { flex: 1; min-height: 0; max-height: none; }

.chart-card { padding: 14px 14px 12px; display: flex; flex-direction: column; }
.chart-head { display: flex; align-items: center; gap: 11px; flex-wrap: wrap; }
.chart-head .name { font-size: 15px; font-weight: 700; }
.chart-head .desc { font-size: 11px; color: var(--muted); }
.chart-head .px { font-size: 22px; font-weight: 700; font-family: var(--mono); letter-spacing: -.8px; margin-left: 6px; text-shadow: 0 2px 12px rgba(0, 0, 0, 0.6); }
.chart-head .chg { font-size: 12px; }
.tf { margin-left: auto; display: flex; gap: 2px; padding: 3px; border-radius: 10px; background: var(--well-bg); box-shadow: var(--shadow-well); }
.tf button { padding: 4px 10px; border-radius: 7px; font-size: 11px; color: var(--muted); font-weight: 600; }
.tf button.active { color: #fff; background: linear-gradient(180deg, #5f73ff, #4555d8); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 4px 10px -3px rgba(79, 125, 255, 0.8); }
.ohlc { display: flex; gap: 12px; align-items: center; font-size: 10.5px; color: var(--muted); margin: 10px 0 8px; white-space: nowrap; overflow: hidden; }
.ohlc b { color: var(--text); font-weight: 600; }
.ohlc .sep { width: 1px; height: 12px; background: rgba(255, 255, 255, 0.1); flex: none; }
.ohlc .lg { display: inline-flex; align-items: center; gap: 5px; }
.ohlc .lg i { display: inline-block; width: 12px; height: 2px; border-radius: 2px; }
.bs-dot { display: inline-grid; place-items: center; width: 14px; height: 14px; border-radius: 50%; font-size: 8.5px; font-weight: 800; color: #fff; margin-right: 1px; }
.bs-dot.b { background: #16c784; box-shadow: 0 0 6px #16c784; }
.bs-dot.s { background: #ea3943; box-shadow: 0 0 6px #ea3943; }
.bs-dot.x { background: #1a2142; color: #c3c9e2; box-shadow: inset 0 0 0 1.5px #8a93b5; font-size: 7.5px; }
#chart .bs { cursor: help; }
#chart .bs:hover .bs-core { r: 12; }
/* Nhấp nháy liên tục: Buy xanh · Sell đỏ */
#chart .bs-b .bs-core { animation: bs-blink-b 1.1s ease-in-out infinite; }
#chart .bs-s .bs-core { animation: bs-blink-s 1.1s ease-in-out infinite; }
#chart .bs-b text, #chart .bs-s text { animation: bs-blink-t 1.1s ease-in-out infinite; }
@keyframes bs-blink-b { 0%, 100% { opacity: 1; filter: drop-shadow(0 0 7px #16c784) drop-shadow(0 0 2px #16c784); } 50% { opacity: .35; filter: none; } }
@keyframes bs-blink-s { 0%, 100% { opacity: 1; filter: drop-shadow(0 0 7px #ea3943) drop-shadow(0 0 2px #ea3943); } 50% { opacity: .35; filter: none; } }
@keyframes bs-blink-t { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }
.bs-dot.b, .bs-dot.s { animation: bs-blink-t 1.1s ease-in-out infinite; }
.chart-well { position: relative; flex: 1; min-height: 320px; padding: 0; background: radial-gradient(120% 90% at 50% 0%, rgba(79, 125, 255, 0.08), transparent 60%), var(--well-bg); box-shadow: var(--shadow-well); border-radius: 12px; }
#chart { position: absolute; inset: 6px 4px 2px; width: calc(100% - 8px); height: calc(100% - 8px); display: block; }

.signal-card { display: flex; flex-direction: column; }
.gauge-wrap { display: flex; align-items: center; gap: 12px; margin: 0 0 10px; padding: 8px 10px; border-radius: 12px; background: var(--well-bg); box-shadow: var(--shadow-well); }
.gauge-wrap svg { width: 108px; height: 66px; flex: none; }
.bias { font-size: 21px; font-weight: 800; letter-spacing: .6px; text-shadow: 0 0 16px currentColor; }
.bias-sub { font-size: 11px; color: var(--muted); margin-top: 2px; }
.comp { display: flex; flex-direction: column; gap: 7px; margin-bottom: 10px; }
.comp-row { display: grid; grid-template-columns: 86px 1fr 30px; align-items: center; gap: 8px; font-size: 11px; color: #c3c9e2; }
.bar { position: relative; height: 6px; border-radius: 4px; background: var(--well-bg); box-shadow: var(--shadow-well); }
.bar::after { content: ""; position: absolute; left: 50%; top: -2px; bottom: -2px; width: 1px; background: rgba(255, 255, 255, 0.22); }
.bar i { position: absolute; top: 0; bottom: 0; border-radius: 4px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35); }
.kv { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; font-size: 11.5px; padding: 10px 0 8px; border-top: 1px solid rgba(255, 255, 255, 0.06); }
.kv dt { color: var(--muted); }
.kv dd { text-align: right; font-family: var(--mono); }
.note { font-size: 11px; color: var(--muted); line-height: 1.45; }
.note b { color: #c9b6ff; font-weight: 600; }
.btn-primary {
  margin-top: auto; width: 100%; padding: 9px; border-radius: 10px; font-weight: 650; font-size: 12px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  background: linear-gradient(180deg, #7a6bff 0%, #5a3ff0 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), inset 0 -2px 0 rgba(0, 0, 0, 0.25), 0 10px 22px -8px rgba(91, 61, 245, 0.9);
  transition: transform .1s, filter .15s;
}
.btn-primary:hover { filter: brightness(1.08); }
.btn-primary svg { width: 14px; height: 14px; }

.tabs { display: flex; gap: 2px; flex-wrap: wrap; padding: 3px; border-radius: 10px; background: var(--well-bg); box-shadow: var(--shadow-well); }
.tabs button { padding: 4px 10px; border-radius: 7px; font-size: 11.5px; font-weight: 600; color: var(--muted); }
.tabs button.active { color: #fff; background: var(--raised-bg); box-shadow: var(--shadow-raised), inset 0 0 0 1px rgba(150, 170, 255, 0.18); }
.markets { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.mkt { position: relative; padding: 11px 11px 8px; border-radius: 12px; text-align: left; background: var(--raised-bg); box-shadow: var(--shadow-raised), inset 0 0 0 1px rgba(255, 255, 255, 0.04); overflow: hidden; }
.mkt.sel { box-shadow: var(--shadow-raised), inset 0 0 0 1px rgba(110, 140, 255, 0.75), 0 0 22px -6px rgba(79, 125, 255, 0.7); }
.mkt-top { display: flex; align-items: center; gap: 8px; }
.mkt-top .sym-icon { width: 26px; height: 26px; font-size: 9px; }
.mkt-top .t { font-weight: 650; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mkt-top .s { font-size: 10px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mkt-top > div:last-child { min-width: 0; }
.mkt .p { font-family: var(--mono); font-size: 15px; font-weight: 700; margin-top: 8px; }
.mkt .c { font-size: 11px; display: flex; align-items: center; gap: 6px; }
.mkt svg { width: 100%; height: 30px; display: block; margin-top: 6px; }

/* Dữ liệu thị trường liên quan */
.rel { margin-top: 2px; padding-top: 10px; border-top: 1px solid rgba(255, 255, 255, 0.06); display: flex; flex-direction: column; gap: 8px; }
.rel-head { display: flex; justify-content: space-between; align-items: center; font-size: 10px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: #b7bfe2; }
.rel-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.rel-tile { padding: 7px 9px; border-radius: 9px; background: var(--well-bg); box-shadow: var(--shadow-well); min-width: 0; }
.rel-tile .k { font-size: 9.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rel-tile .v { font-family: var(--mono); font-size: 12.5px; font-weight: 700; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rel-tile .v.amber { color: var(--amber); }
.rel-tile .s { font-size: 9.5px; color: var(--dim); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rel-fund { display: flex; flex-direction: column; gap: 5px; }
.rel-fund .row { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; align-items: center; font-size: 10.5px; color: #c3c9e2; padding: 6px 8px; border-radius: 8px; background: var(--raised-bg); box-shadow: var(--shadow-raised); }
.rel-fund .row span:first-child { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rel-fund .row b { font-size: 11px; color: var(--text); }
.rel-risk { font-size: 10.5px; color: #c3c9e2; padding: 6px 9px; border-radius: 8px; background: rgba(255, 77, 109, 0.07); box-shadow: inset 0 0 0 1px rgba(255, 77, 109, 0.25); }
.rel-evt { display: flex; flex-direction: column; gap: 4px; font-size: 10.5px; color: #c3c9e2; }
.rel-evt .tag { margin-right: 4px; }

/* Copilot */
.copilot { --ring: rgba(177, 140, 255, 0.5); background: radial-gradient(120% 70% at 50% 0%, rgba(110, 70, 230, 0.45), transparent 70%), var(--card-bg); }
.copilot-head { display: flex; align-items: center; gap: 12px; }
.orb { width: 52px; height: 52px; border-radius: 50%; position: relative; display: grid; place-items: center; flex: none; }
.orb::before { content: ""; position: absolute; inset: 0; border-radius: 50%; background: conic-gradient(from 0deg, #8b5cf6, #3ad7ff, #4f7dff, #c084fc, #8b5cf6); animation: spin 6s linear infinite; box-shadow: 0 0 22px rgba(139, 92, 246, 0.7); }
.orb::after { content: ""; position: absolute; inset: 4px; border-radius: 50%; background: radial-gradient(circle at 40% 30%, #2b1f66, #0a0d22 70%); box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.7); }
.orb span { position: relative; z-index: 1; width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid #c4b0ff; box-shadow: 0 0 12px #8b5cf6, inset 0 0 6px #8b5cf6; }
@keyframes spin { to { transform: rotate(360deg); } }
.copilot-head h3 { font-size: 14.5px; font-weight: 750; background: linear-gradient(90deg, #d8caff, #8fb8ff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.copilot-head p { font-size: 11px; color: var(--muted); margin-top: 1px; }
.guard { display: flex; gap: 8px; align-items: flex-start; margin-top: 12px; font-size: 10.5px; color: #cbbcff; background: rgba(139, 92, 246, 0.1); box-shadow: inset 0 0 0 1px rgba(139, 92, 246, 0.3); border-radius: 9px; padding: 7px 9px; line-height: 1.45; }
.guard svg { width: 13px; height: 13px; flex: none; margin-top: 1px; }
.chat { display: flex; flex-direction: column; gap: 7px; margin: 10px 0; max-height: 230px; overflow-y: auto; padding: 8px; border-radius: 12px; background: var(--well-bg); box-shadow: var(--shadow-well); }
.msg { padding: 8px 10px; border-radius: 11px; font-size: 11.5px; line-height: 1.5; max-width: 94%; }
.msg.user { align-self: flex-end; background: linear-gradient(180deg, rgba(95, 115, 255, 0.4), rgba(79, 90, 220, 0.28)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12); border-bottom-right-radius: 4px; }
.msg.ai { align-self: flex-start; background: var(--raised-bg); box-shadow: var(--shadow-raised); color: #d7dbef; border-bottom-left-radius: 4px; }
.msg.ai b { color: #fff; }
.msg .src { display: block; margin-top: 5px; font-size: 10px; color: var(--dim); }
.quick { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.quick button { padding: 7px 9px; border-radius: 9px; font-size: 11px; text-align: left; color: #c3c9e2; background: var(--raised-bg); box-shadow: var(--shadow-raised); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.quick button:hover { color: #fff; box-shadow: var(--shadow-raised), inset 0 0 0 1px rgba(139, 92, 246, 0.5); }
.ask { display: flex; gap: 6px; margin-top: 8px; }
.ask input { flex: 1; min-width: 0; padding: 8px 11px; border-radius: 10px; background: var(--well-bg); box-shadow: var(--shadow-well); border: 0; color: var(--text); font: inherit; font-size: 12px; outline: 0; }
.ask input:focus { box-shadow: var(--shadow-well), 0 0 0 1px rgba(139, 92, 246, 0.6); }
.ask button { width: 36px; border-radius: 10px; display: grid; place-items: center; background: linear-gradient(180deg, #7a6bff, #5a3ff0); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 6px 14px -6px rgba(91, 61, 245, 0.9); }
.ask button svg { width: 14px; height: 14px; }


.events, .news { display: flex; flex-direction: column; gap: 7px; }
.event { display: grid; grid-template-columns: 42px 1fr auto; gap: 10px; align-items: center; padding: 7px; border-radius: 11px; background: var(--raised-bg); box-shadow: var(--shadow-raised); }
.event .d { text-align: center; font-size: 9.5px; color: var(--muted); line-height: 1.2; padding: 4px 0; border-radius: 8px; background: var(--well-bg); box-shadow: var(--shadow-well); }
.event .d b { display: block; font-size: 14px; color: var(--text); }
.event .t { font-size: 11.5px; font-weight: 600; }
.event .s { font-size: 10px; color: var(--muted); margin-top: 2px; }
.news-item { display: grid; grid-template-columns: 36px 1fr; gap: 10px; align-items: start; padding: 7px; border-radius: 11px; background: var(--raised-bg); box-shadow: var(--shadow-raised); }
.news-item .thumb { width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center; font-weight: 800; font-size: 10.5px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12); }
.news-item .h { font-size: 11.5px; line-height: 1.4; font-weight: 550; }
.news-item .m { display: flex; gap: 6px; align-items: center; margin-top: 4px; font-size: 10px; color: var(--dim); flex-wrap: wrap; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border-radius: 12px; background: var(--well-bg); box-shadow: var(--shadow-well); }
table { width: 100%; border-collapse: collapse; font-size: 11.5px; }
th { position: sticky; top: 0; text-align: left; font-weight: 700; font-size: 10px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 9px 10px; background: linear-gradient(180deg, #121836, #0d1230); box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.06); white-space: nowrap; }
td { padding: 9px 10px; border-bottom: 1px solid rgba(255, 255, 255, 0.035); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
tr:hover td { background: rgba(110, 130, 255, 0.05); }
td.r, th.r { text-align: right; }
.fc { display: flex; align-items: center; gap: 8px; min-width: 140px; }
.fc .bar { flex: 1; }
.fc .num { width: 28px; text-align: right; font-weight: 700; }
.sym-cell { display: flex; align-items: center; gap: 9px; }
.sym-cell .sym-icon { width: 26px; height: 26px; font-size: 9px; }
.sym-cell b { font-size: 12px; }
.sym-cell span { display: block; font-size: 10px; color: var(--muted); }
.legend-row { display: flex; gap: 12px; flex-wrap: wrap; font-size: 11px; color: var(--muted); }

/* ---------- Risk ---------- */
.risk-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.risk-gauge { text-align: center; padding-bottom: 12px; }
.risk-gauge svg { width: 140px; height: 86px; display: block; margin: 0 auto; }
.risk-gauge .v { font-size: 19px; font-weight: 700; font-family: var(--mono); margin-top: -8px; text-shadow: 0 2px 12px rgba(0, 0, 0, 0.6); }
.risk-gauge .l { font-size: 11.5px; color: #c3c9e2; margin-top: 3px; font-weight: 600; }
.risk-gauge .lim { font-size: 10.5px; color: var(--dim); margin-top: 2px; }
.two-col { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 14px; margin-bottom: 14px; }
.rules { display: flex; flex-direction: column; gap: 6px; }
.rule { display: grid; grid-template-columns: 1fr auto; gap: 3px 12px; padding: 9px 11px; border-radius: 11px; background: var(--raised-bg); box-shadow: var(--shadow-raised); }
.rule .n { font-weight: 600; font-size: 12px; }
.rule .d { font-size: 10.5px; color: var(--muted); grid-column: 1; }
.rule .tag { grid-row: 1 / span 2; grid-column: 2; align-self: center; }
.expo { display: flex; flex-direction: column; gap: 12px; }
.expo-row .top { display: flex; justify-content: space-between; font-size: 11.5px; margin-bottom: 6px; }
.expo-row .track { position: relative; height: 9px; border-radius: 5px; background: var(--well-bg); box-shadow: var(--shadow-well); }
.expo-row .track i { position: absolute; inset: 0 auto 0 0; border-radius: 5px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 0 12px -3px rgba(255, 255, 255, 0.4); }
.expo-row .track b { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--red); border-radius: 2px; box-shadow: 0 0 6px var(--red); }
.kill { margin-top: 14px; padding: 12px; border-radius: 12px; display: flex; align-items: center; gap: 12px; background: linear-gradient(180deg, rgba(255, 77, 109, 0.12), rgba(255, 77, 109, 0.04)); box-shadow: inset 0 0 0 1px rgba(255, 77, 109, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.05); }
.kill p { font-size: 11px; color: var(--muted); flex: 1; line-height: 1.45; }
.kill p b { color: var(--text); display: block; font-size: 12.5px; margin-bottom: 2px; }
.btn-kill { padding: 9px 15px; border-radius: 10px; font-weight: 750; font-size: 12px; letter-spacing: .4px; white-space: nowrap; background: linear-gradient(180deg, #ff6b85, #e3264a); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), inset 0 -2px 0 rgba(0, 0, 0, 0.25), 0 10px 22px -8px rgba(255, 45, 85, 0.9); transition: transform .1s; }
.btn-kill.on { background: var(--raised-bg); box-shadow: var(--shadow-raised); }
.halted { display: none; padding: 10px 14px; border-radius: 12px; margin-bottom: 14px; background: rgba(255, 77, 109, 0.14); box-shadow: inset 0 0 0 1px rgba(255, 77, 109, 0.5), 0 0 30px -10px rgba(255, 45, 85, 0.6); color: #ffc2cd; font-weight: 600; }
body.is-halted .halted { display: block; }

/* ---------- Pipeline ---------- */
.pipe-card { padding: 6px; overflow: hidden; background: radial-gradient(90% 70% at 50% 40%, rgba(79, 125, 255, 0.12), transparent 70%), linear-gradient(180deg, #121836, #080c24); }
#pipeline { width: 100%; height: auto; display: block; }
.flow { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.flow-base { stroke: rgba(79, 125, 255, 0.32); stroke-width: 14; }
.flow-glow { stroke: #4f7dff; stroke-width: 5; filter: url(#glow); }
.flow-dash { stroke: #ff9a4d; stroke-width: 3; stroke-dasharray: 10 22; animation: dash 1.4s linear infinite; }
.flow-ai { stroke: #b18cff; stroke-width: 3; stroke-dasharray: 6 8; animation: dash 1.8s linear infinite; }
@keyframes dash { to { stroke-dashoffset: -64; } }
.pipe-label { fill: #fff; font-size: 15px; font-weight: 800; letter-spacing: .4px; }
.pipe-sub { fill: #9aa3c7; font-size: 11.5px; }
.layers { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 14px; }
.layer h4 { display: flex; align-items: center; gap: 8px; font-size: 12.5px; margin-bottom: 4px; }
.layer h4 .no { width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center; font-size: 10.5px; flex: none; background: linear-gradient(180deg, #5f73ff, #3f4fc8); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 4px 10px -3px rgba(79, 125, 255, 0.8); }
.layer ul { list-style: none; display: flex; flex-direction: column; gap: 4px; font-size: 11px; color: #c3c9e2; margin: 8px 0; }
.layer li::before { content: "› "; color: var(--blue); }
.layer .foot { display: flex; justify-content: space-between; align-items: center; gap: 6px; font-size: 10px; color: var(--muted); border-top: 1px solid rgba(255, 255, 255, 0.06); padding-top: 8px; margin-top: 4px; flex-wrap: wrap; }
.layer.ai { --ring: rgba(177, 140, 255, 0.5); }
.layer.ai h4 .no { background: linear-gradient(180deg, #a07bff, #6e3fe0); }

/* ---------- Bảng giá, chiến lược, feed ---------- */
.board { font-size: 11px; }
.board td, .board th { padding: 6px 6px; }
.board td:first-child, .board th:first-child { padding-left: 10px; }
.board td:last-child, .board th:last-child { padding-right: 10px; }
.board .code { font-weight: 750; color: #ffd27a; text-shadow: 0 0 10px rgba(255, 210, 122, 0.35); }
.sel { background: var(--well-bg); box-shadow: var(--shadow-well); color: var(--text); border: 0; border-radius: 8px; padding: 6px 9px; font: inherit; font-size: 11px; outline: 0; }
.bot-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr); gap: 14px; margin-bottom: 14px; }
.strats { display: flex; flex-direction: column; gap: 8px; }
.strat { position: relative; text-align: left; padding: 10px 12px; border-radius: 12px; background: var(--raised-bg); box-shadow: var(--shadow-raised); display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; }
.strat.sel-s { box-shadow: var(--shadow-raised), inset 0 0 0 1px rgba(255, 181, 71, 0.65), 0 0 22px -8px rgba(255, 181, 71, 0.7); }
.strat .nm { font-weight: 700; font-size: 12.5px; }
.strat .mt { grid-column: 1 / -1; display: flex; gap: 12px; flex-wrap: wrap; font-size: 10.5px; color: var(--muted); }
.strat .mt b { color: var(--text); font-family: var(--mono); font-weight: 600; }
.strat .codes { grid-column: 1 / -1; display: flex; gap: 4px; flex-wrap: wrap; }
.strat-detail { margin-top: 12px; padding-top: 12px; border-top: 1px solid rgba(255, 255, 255, 0.06); }
.metric-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 10px 0; }
.metric { padding: 9px 10px; border-radius: 10px; background: var(--well-bg); box-shadow: var(--shadow-well); }
.metric .k { font-size: 10px; color: var(--muted); letter-spacing: .03em; }
.metric .v { font-family: var(--mono); font-size: 15px; font-weight: 700; margin-top: 3px; }
.filters { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.feed { display: flex; flex-direction: column; gap: 8px; max-height: 520px; overflow-y: auto; padding: 2px; }
.sig { position: relative; border-radius: 12px; padding: 10px 12px 10px 14px; background: var(--raised-bg); box-shadow: var(--shadow-raised); overflow: hidden; }
.sig::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: linear-gradient(180deg, #4dffb5, #16b97a); box-shadow: 0 0 12px rgba(34, 227, 154, 0.8); }
.sig.short::before { background: linear-gradient(180deg, #ff7d93, #d91f45); box-shadow: 0 0 12px rgba(255, 77, 109, 0.8); }
.sig-top { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.sig-top .code { font-weight: 800; font-size: 12.5px; }
.sig-top .nm { font-size: 10.5px; color: var(--muted); }
.sig-top .time { margin-left: auto; font-size: 10px; color: var(--dim); }
.sig-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; margin-top: 8px; padding: 7px 9px; border-radius: 9px; background: var(--well-bg); box-shadow: var(--shadow-well); font-size: 10px; color: var(--muted); }
.sig-grid b { display: block; color: var(--text); font-family: var(--mono); font-size: 11.5px; margin-top: 2px; }

.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%) translateY(20px); opacity: 0; pointer-events: none; padding: 10px 16px; border-radius: 11px; background: var(--raised-bg); box-shadow: var(--shadow-card), inset 0 0 0 1px rgba(139, 92, 246, 0.45); font-size: 12px; transition: all .2s; z-index: 50; }
.toast.show { opacity: 1; transform: translateX(-50%); }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: rgba(140, 150, 200, 0.22); border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- Responsive ---------- */
@media (max-width: 1360px) {
  .trio { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: auto; }
  .trio .chart-card { grid-column: 1 / -1; }
  .dash { grid-template-columns: minmax(0, 1fr); }
  .dash > .col.right { display: grid; grid-template-columns: minmax(0, 1fr); align-items: start; }
  .ms-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .mseg:nth-child(4)::before { display: none; }
  .mseg:nth-child(n+4) { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06); }
  .layers { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
  .risk-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kseg:nth-child(3)::before { display: none; }
  .kseg:nth-child(n+3) { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06); }
  .two-col, .bot-grid { grid-template-columns: minmax(0, 1fr); }
  .plan-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .plan-grid > .plan-box:last-child { grid-column: 1 / -1; }
  .sig-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .app { grid-template-columns: 62px 1fr; }
  .brand-text, .nav-item span, .nav-item .soon, .side-card, .session { display: none; }
  .brand-block { padding: 2px 0 12px; }
  .brand { justify-content: center; }
  .nav-item { justify-content: center; padding: 10px; }
  .clock { display: none; }
  .btn-copilot { margin-left: auto; }
  .dash > .col.right { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 700px) {
  .trio { grid-template-columns: minmax(0, 1fr); }
  .trio .copilot { contain: none; }
  .trio .chat { max-height: 320px; }
}
@media (max-width: 600px) {
  .plan-grid { grid-template-columns: minmax(0, 1fr); }
  .app { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .view { padding: 12px 16px 30px; }
  .topbar { padding: 10px 16px; }
  .risk-grid, .layers, .kpi-strip { grid-template-columns: minmax(0, 1fr); }
  .ms-head { display: none; }
  .ms-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kseg + .kseg::before { display: none; }
  .kseg + .kseg { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06); }
  .btn-copilot span { display: none; }
  .ticker-bar { display: none; }
  .ohlc { flex-wrap: wrap; white-space: normal; }
}
@media (prefers-reduced-motion: reduce) {
  .tilt { transform: none !important; transition: none; }
  .orb::before, .flow-dash, .flow-ai, .tk-label.live i, #chart .bs-core, #chart .bs text, .bs-dot { animation: none; }
  #chart .bs-ring { display: none; }
  .tk-move { animation: none; }
  .tk-track { overflow-x: auto; }
}

[hidden] { display: none !important; }
