@import url('https://fonts.googleapis.com/css2?family=Be+Vietnam+Pro:wght@500;600;700;800&family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@400;500;700&display=swap');

:root {
  --bg: #0a0e16;
  --panel: #10151f;
  --panel-2: #151b28;
  --border: #202836;
  --text: #e7ebf3;
  --text-muted: #8892a4;
  --bull: #34d399;
  --bear: #f66d6d;
  --accent: #f5a623;
  --accent-dim: #7a5518;

  --font-display: 'Be Vietnam Pro', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

body.has-bg-image {
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
}

.company-footer {
  text-align: center;
  padding: 14px 16px 22px;
  font-size: 11.5px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}
.company-footer .sep { margin: 0 8px; opacity: .5; }

.social-footer {
  text-align: center;
  padding: 0 16px 20px;
  display: flex;
  justify-content: center;
  gap: 14px;
}
.social-footer a {
  font-size: 18px;
  opacity: 0.7;
  transition: opacity .15s ease, transform .15s ease;
  text-decoration: none;
}
.social-footer a:hover { opacity: 1; transform: translateY(-2px); }

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Top bar ---------- */
.topbar {
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  max-width: 1180px;
  margin: 0 auto;
}
.logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 8px;
}
.logo .dot { color: var(--accent); }
.nav-links {
  display: flex;
  gap: 28px;
  align-items: center;
}
.nav-links a {
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  transition: color .15s ease;
}
.nav-links a:hover { color: var(--text); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: 8px;
  padding: 10px 18px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: transform .1s ease, background .15s ease, opacity .15s ease;
}
.btn:active { transform: scale(0.97); }
.btn-accent { background: var(--accent); color: #1a1000; }
.btn-accent:hover { background: #ffb547; }
.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn-ghost:hover { border-color: #3a4457; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- Ticker strip (signature element) ---------- */
.ticker-strip {
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
  white-space: nowrap;
}
.ticker-track {
  display: inline-flex;
  gap: 36px;
  padding: 9px 24px;
  animation: scroll-left 28s linear infinite;
  font-family: var(--font-mono);
  font-size: 13px;
}
.ticker-track span.up { color: var(--bull); }
.ticker-track span.down { color: var(--bear); }
@keyframes scroll-left {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* ---------- Hero ---------- */
.hero {
  padding: 90px 0 70px;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: center;
}
.hero-eyebrow {
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 16px;
}
.hero h1 {
  font-family: var(--font-display);
  font-size: 46px;
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin: 0 0 20px;
}
.hero p {
  color: var(--text-muted);
  font-size: 16px;
  line-height: 1.6;
  max-width: 480px;
  margin-bottom: 28px;
}
.hero-actions { display: flex; gap: 12px; }

.hero-chart-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
}
.hero-chart-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
}
.hero-chart-head .sym { font-family: var(--font-mono); font-weight: 700; }
.hero-chart-head .price { font-family: var(--font-mono); font-size: 20px; }

/* ---------- Auth card ---------- */
.auth-wrap {
  min-height: calc(100vh - 60px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}
.auth-card {
  width: 100%;
  max-width: 380px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 32px;
}
.auth-card h2 {
  font-family: var(--font-display);
  margin: 0 0 6px;
  font-size: 24px;
}
.auth-card .sub {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 24px;
}
.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.field input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 11px 12px;
  color: var(--text);
  font-size: 14px;
  font-family: var(--font-body);
}
.field input:focus {
  outline: none;
  border-color: var(--accent);
}
.form-msg {
  font-size: 13px;
  margin-bottom: 14px;
  padding: 10px 12px;
  border-radius: 8px;
  display: none;
}
.form-msg.error { display: block; background: rgba(246,109,109,.12); color: var(--bear); }
.form-msg.ok { display: block; background: rgba(52,211,153,.12); color: var(--bull); }
.auth-foot {
  margin-top: 18px;
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
}

/* ---------- Dashboard ---------- */
.dash-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: calc(100vh - 60px);
}
.sidebar {
  border-right: 1px solid var(--border);
  padding: 20px 14px;
}
.plan-badge {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 4px 8px;
  border-radius: 6px;
  display: inline-block;
  margin-bottom: 4px;
}
.plan-badge.free { background: #232a38; color: var(--text-muted); }
.plan-badge.pro { background: rgba(52,211,153,.14); color: var(--bull); }
.plan-badge.premium { background: rgba(245,166,35,.15); color: var(--accent); }
.plan-expiry { font-size: 12px; color: var(--text-muted); margin-bottom: 18px; }

.symbol-list { list-style: none; padding: 0; margin: 0; }
.symbol-list li {
  padding: 9px 10px;
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 13px;
  cursor: pointer;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
}
.symbol-list li:hover { background: var(--panel-2); }
.symbol-list li.active { background: var(--panel-2); color: var(--text); }
.symbol-list li.locked { opacity: .45; cursor: not-allowed; }
.symbol-list li .lock { font-size: 11px; }

.color-settings {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}
.color-settings-title {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.color-presets {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}
.preset-swatch {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  border: 1px solid var(--border);
  cursor: pointer;
  padding: 0;
  overflow: hidden;
  display: flex;
}
.preset-swatch:hover { border-color: #3a4457; }
.preset-swatch span { flex: 1; }
.color-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.color-row label {
  font-size: 13px;
  color: var(--text-muted);
}
.color-row input[type="color"] {
  width: 40px;
  height: 28px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  padding: 2px;
  cursor: pointer;
}
.color-row input[type="checkbox"] {
  width: 17px;
  height: 17px;
  accent-color: var(--accent);
  cursor: pointer;
}
.color-reset-btn { margin-top: 4px; font-size: 12.5px; padding: 8px 12px; }

.main-panel { padding: 20px 24px; }
.chart-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.chart-head h2 { font-family: var(--font-display); margin: 0; font-size: 20px; }
.chart-head .price-line { font-family: var(--font-mono); font-size: 14px; color: var(--text-muted); }
.data-badge {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 4px 9px;
  border-radius: 6px;
}
.data-badge.live { background: rgba(52,211,153,.12); color: var(--bull); }
.data-badge.fallback { background: rgba(246,109,109,.12); color: var(--bear); }

#chart-container {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px;
}

.timeframe-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 14px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 4px;
  width: fit-content;
  max-width: 100%;
}
.tf-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 12.5px;
  padding: 7px 13px;
  border-radius: 6px;
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.tf-btn:hover { color: var(--text); }
.tf-btn.active { background: var(--accent); color: #1a1000; }

.contract-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.contract-tab {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  display: flex;
  align-items: center;
  gap: 6px;
}
.contract-tab:hover { color: var(--text); }
.contract-tab.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.contract-tab .count {
  background: var(--panel-2);
  color: var(--text-muted);
  font-size: 11px;
  padding: 1px 7px;
  border-radius: 10px;
  font-family: var(--font-mono);
}
.contract-tab.active .count { background: rgba(245,166,35,.15); color: var(--accent); }

.signal-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 10px;
  margin-bottom: 14px;
  font-family: var(--font-mono);
  font-size: 13px;
  border: 1px solid var(--border);
}
.signal-banner.buy { background: rgba(52,211,153,.12); border-color: rgba(52,211,153,.4); color: var(--bull); }
.signal-banner.sell { background: rgba(246,109,109,.12); border-color: rgba(246,109,109,.4); color: var(--bear); }
.signal-banner button { font-family: var(--font-body); }

.timeframe-bar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  flex-wrap: wrap;
  gap: 10px;
}
.timeframe-bar { margin-bottom: 0; }

.indicator-dropdown-wrap { position: relative; }
.indicator-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  width: 230px;
  z-index: 30;
  box-shadow: 0 10px 30px rgba(0,0,0,.4);
}
.indicator-check {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
  color: var(--text);
  padding: 7px 2px;
  cursor: pointer;
}
.indicator-check input { accent-color: var(--accent); cursor: pointer; }
.indicator-sep { height: 1px; background: var(--border); margin: 6px 0; }

.chart-context-menu {
  position: absolute;
  z-index: 50;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 6px;
  min-width: 240px;
  max-height: calc(100vh - 30px);
  overflow-y: auto;
  box-shadow: 0 12px 32px rgba(0,0,0,.5);
}
.chart-context-menu button {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 13px;
  padding: 9px 10px;
  border-radius: 6px;
  cursor: pointer;
}
.chart-context-menu button:hover { background: var(--panel-2); }
.chart-context-menu .ctx-sep { height: 1px; background: var(--border); margin: 4px 4px; }

.alert-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-top: 1px solid var(--border);
}
.alert-row:first-child { border-top: none; }
.alert-row button { background: transparent; border: none; color: var(--text-muted); cursor: pointer; font-size: 13px; }
.alert-row button:hover { color: var(--bear); }

.multiview-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}
.multiview-grid.count-1 { grid-template-columns: 1fr; }
.multiview-grid.count-3 { grid-template-columns: 1fr 1fr; }
.multiview-panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px;
}
.multiview-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2px 4px 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
}
.multiview-panel-head .tf-label { color: var(--accent); font-weight: 700; }
.multiview-chart { height: 260px; }
.multiview-exit-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.chart-stage {
  position: relative;
}
.chart-stage.is-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: var(--bg);
  padding: 12px;
}
.chart-stage.is-fullscreen #chart-container {
  height: calc(100vh - 24px) !important;
}

.floating-toolbar {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 8;
  display: flex;
  flex-direction: column;
  gap: 3px;
  background: rgba(16,21,31,0.92);
  backdrop-filter: blur(4px);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 6px;
  box-shadow: 0 6px 18px rgba(0,0,0,.35);
  overflow: visible;
}
.draw-btn {
  width: 30px;
  height: 30px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  border-radius: 7px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s ease, color .15s ease;
}
.draw-btn:hover { background: var(--panel-2); color: var(--text); }
.draw-btn.active { background: var(--accent); color: #1a1000; }
.draw-sep { height: 1px; background: var(--border); margin: 4px 2px; }

.floating-toolbar.tools-locked {
  position: absolute;
  opacity: 0.45;
  filter: grayscale(0.6);
}
.floating-toolbar.tools-locked::after {
  content: '🔒';
  position: absolute;
  top: -10px;
  right: -10px;
  font-size: 13px;
  background: var(--bear);
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}
#indicator-btn.tools-locked {
  opacity: 0.45;
  cursor: not-allowed;
  filter: grayscale(0.6);
}

#broadcast-btn.live-active {
  background: var(--bear);
  color: #fff;
  animation: pulse-live 1.5s infinite;
}
@keyframes pulse-live {
  0%, 100% { box-shadow: 0 0 0 0 rgba(246,109,109,.5); }
  50% { box-shadow: 0 0 0 6px rgba(246,109,109,0); }
}

.fullscreen-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 8;
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  background: rgba(16,21,31,0.92);
  backdrop-filter: blur(4px);
  color: var(--text-muted);
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s ease, color .15s ease;
}
.fullscreen-btn:hover { background: var(--panel-2); color: var(--text); }

#draw-canvas {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 5;
  pointer-events: none;
}
#draw-canvas.tool-active { cursor: crosshair; pointer-events: auto; }
#draw-canvas.tool-cursor { pointer-events: none; }

#text-labels-layer {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 6;
  pointer-events: none;
}
.chart-text-label {
  position: absolute;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  background: rgba(10,14,22,.75);
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
  transform: translate(-2px, -100%);
  pointer-events: auto;
  cursor: pointer;
}
.text-input-inline {
  position: absolute;
  z-index: 7;
  background: var(--panel);
  border: 1px solid var(--accent);
  border-radius: 4px;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 3px 6px;
  outline: none;
}

.sub-chart-panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-top: none;
  height: 140px;
}

.content-grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 20px;
  align-items: start;
}

.trade-column {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.wallet-card, .order-card, .holdings-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px;
}

.wallet-label {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.wallet-balance {
  font-family: var(--font-mono);
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 14px;
}

.order-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
  background: var(--bg);
  border-radius: 8px;
  padding: 4px;
}
.order-tab {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 13px;
  padding: 8px 0;
  border-radius: 6px;
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.order-tab.active[data-side="buy"] { background: rgba(52,211,153,.15); color: var(--bull); }
.order-tab.active[data-side="sell"] { background: rgba(246,109,109,.15); color: var(--bear); }

.order-summary {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-muted);
  padding: 7px 0;
  border-top: 1px solid var(--border);
  font-family: var(--font-mono);
}
.order-summary span:last-child { color: var(--text); }

#order-submit { margin-top: 14px; }
#order-submit.side-sell { background: var(--bear); color: #2a0a0a; }
#order-submit.side-sell:hover { background: #ff8080; }

.sltp-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.sltp-row .field input {
  font-size: 13px;
  padding: 9px 10px;
}
.sltp-row .field label { font-size: 11.5px; }

.holding-sltp {
  display: flex;
  gap: 10px;
  font-size: 11px;
  font-family: var(--font-mono);
  margin-top: 4px;
}
.holding-sltp .sl { color: var(--bear); }
.holding-sltp .tp { color: var(--bull); }

.holdings-title {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.holdings-empty {
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
  padding: 12px 0;
}
.holding-row {
  padding: 10px 0;
  border-top: 1px solid var(--border);
}
.holding-row:first-child { border-top: none; padding-top: 0; }
.holding-row-head {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 4px;
}
.holding-row-sub {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

@media (max-width: 1050px) {
  .content-grid { grid-template-columns: 1fr; }
}

/* ---------- Modal nạp tiền ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 7, 12, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}
.modal-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 26px;
  width: 100%;
  max-width: 360px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
}
.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
  position: sticky;
  top: -26px;
  background: var(--panel);
  padding: 8px 0;
  z-index: 3;
}
.modal-head h3 {
  font-family: var(--font-display);
  margin: 0;
  font-size: 19px;
}
.modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 16px;
  cursor: pointer;
  padding: 4px;
}
.modal-close:hover { color: var(--text); }
.ind-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin: 10px 0 16px;
}
.ind-tab {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 8px 12px;
  cursor: pointer;
  font-size: 13px;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.ind-tab.active { color: var(--text); border-bottom-color: var(--accent); }
.ind-tab-body { min-height: 60px; }
.modal-sub {
  color: var(--text-muted);
  font-size: 13px;
  margin-bottom: 18px;
}
.quick-amounts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 18px;
}
.quick-amount-btn {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 13px;
  padding: 10px 0;
  border-radius: 8px;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.quick-amount-btn:hover { border-color: var(--accent); }
.quick-amount-btn.active { background: rgba(245,166,35,.15); border-color: var(--accent); color: var(--accent); }

.upsell-banner {
  margin-top: 16px;
  background: linear-gradient(90deg, rgba(245,166,35,.12), rgba(245,166,35,0));
  border: 1px solid var(--accent-dim);
  border-radius: 10px;
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.upsell-banner p { margin: 0; font-size: 14px; color: var(--text); }
.upsell-banner span { color: var(--text-muted); font-size: 13px; }

/* ---------- Pricing ---------- */
.pricing-head { text-align: center; padding: 60px 0 30px; }
.pricing-head h1 { font-family: var(--font-display); font-size: 34px; margin-bottom: 10px; }
.pricing-head p { color: var(--text-muted); }
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  padding-bottom: 80px;
}
.price-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
}
.price-card.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}
.price-card { cursor: pointer; }
.price-card .tag {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 10px;
}
.price-card h3 { font-family: var(--font-display); font-size: 22px; margin: 0 0 6px; }
.price-card .amount {
  font-family: var(--font-mono);
  font-size: 30px;
  margin: 10px 0 20px;
}
.price-card .amount span { font-size: 14px; color: var(--text-muted); font-weight: 400; }
.price-card ul { list-style: none; padding: 0; margin: 0 0 24px; flex: 1; }
.price-card li {
  font-size: 14px;
  color: var(--text-muted);
  padding: 7px 0;
  border-top: 1px solid var(--border);
}
.price-card li:first-child { border-top: none; }

.footer-note {
  text-align: center;
  color: var(--text-muted);
  font-size: 12px;
  padding: 20px 0 50px;
}

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; padding-top: 40px; }
  .dash-layout { grid-template-columns: 1fr; }
  .sidebar { border-right: none; border-bottom: 1px solid var(--border); }
  .pricing-grid { grid-template-columns: 1fr; }

  /* Menu điều hướng: không ẩn nữa, cho tự xuống dòng để vẫn bấm được trên điện thoại */
  .topbar-inner { flex-wrap: wrap; gap: 10px; padding: 12px 16px; }
  .nav-links { display: flex; flex-wrap: wrap; gap: 14px; font-size: 13px; order: 3; width: 100%; }

  .container { padding: 0 14px; }
  .main-panel { padding: 14px; }

  /* Thanh công cụ nổi: thu nhỏ nút, cho cuộn ngang nếu cần trên điện thoại */
  .floating-toolbar {
    flex-direction: row;
    flex-wrap: wrap;
    max-width: calc(100% - 20px);
    top: 8px;
    left: 8px;
  }
  .draw-btn { width: 30px; height: 30px; flex-shrink: 0; }
  .draw-sep { width: 1px; height: 20px; margin: 0 3px; }
  .fullscreen-btn { width: 30px; height: 30px; top: 8px; right: 8px; }

  #chart-container { height: 340px; }
  .chart-stage.is-fullscreen #chart-container { height: calc(100vh - 24px) !important; }

  .indicator-panel { right: -10px; width: 260px; max-width: calc(100vw - 40px); }
  .timeframe-bar-row { gap: 8px; }
  .timeframe-bar { max-width: 100%; overflow-x: auto; }
  .tf-btn { padding: 7px 10px; font-size: 12px; }

  .order-card, .wallet-card, .holdings-card { max-width: none; }
}

@media (max-width: 480px) {
  .hero h1 { font-size: 30px; }
  .price-card { padding: 22px 18px; }
  #chart-container { height: 280px; }
  .draw-btn { width: 34px; height: 34px; }
}

/* Thanh Phát lại (Bar Replay) */
#replay-bar {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 6px 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,.45);
}
#replay-bar button {
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 6px;
  width: 30px; height: 28px;
  cursor: pointer;
  font-size: 13px;
}
#replay-bar button:hover { background: var(--accent); color: #fff; }
#replay-bar select {
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 6px;
  height: 28px;
  font-size: 12px;
}
#replay-btn.is-active { background: var(--accent); color: #fff; }

/* Nhóm công cụ vẽ bung ra (flyout) */
.draw-group { position: relative; }
.group-trigger { position: relative; }
.group-caret {
  position: absolute;
  right: 1px;
  bottom: 0px;
  font-size: 7px;
  line-height: 1;
  opacity: 0.5;
  pointer-events: none;
}
.draw-flyout {
  position: absolute;
  left: calc(100% + 8px);
  top: 0;
  display: none;
  flex-direction: column;
  gap: 2px;
  background: rgba(16,21,31,0.98);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 6px;
  box-shadow: 0 10px 30px rgba(0,0,0,.55);
  z-index: 30;
  min-width: 200px;
  max-height: 70vh;
  overflow-y: auto;
}
.draw-group.open .draw-flyout { display: flex; }
.draw-flyout .draw-btn {
  width: 100%;
  height: auto;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 6px;
}
.draw-flyout .draw-btn svg { flex-shrink: 0; }
.draw-flyout .draw-btn .fly-label { font-size: 12.5px; white-space: nowrap; }

/* ===== Chat trực tuyến ===== */
#chat-fab {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 60;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: #10151f;
  font-size: 22px;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0,0,0,.45);
  display: flex;
  align-items: center;
  justify-content: center;
}
#chat-fab:hover { filter: brightness(1.08); }
.chat-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 9px;
  background: var(--bear, #f66d6d);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  align-items: center;
  justify-content: center;
  display: flex;
}
#chat-panel {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 61;
  width: 340px;
  max-width: calc(100vw - 32px);
  height: 460px;
  max-height: calc(100vh - 40px);
  background: var(--panel, #141a24);
  border: 1px solid var(--border, #202836);
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(0,0,0,.55);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
#chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 14px;
  border-bottom: 1px solid var(--border, #202836);
  font-weight: 600;
  font-size: 14px;
}
#chat-head button {
  background: transparent;
  border: none;
  color: var(--text-muted, #8892a4);
  font-size: 15px;
  cursor: pointer;
}
#chat-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px 12px 4px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.chat-msg { max-width: 85%; align-self: flex-start; }
.chat-msg.mine { align-self: flex-end; }
.chat-meta { display: flex; gap: 8px; align-items: baseline; margin-bottom: 2px; padding: 0 2px; }
.chat-name { font-size: 12px; font-weight: 700; color: var(--text, #e8ecf4); }
.chat-name.chat-staff { color: var(--accent, #f5a623); }
.chat-time { font-size: 10px; color: var(--text-muted, #8892a4); }
.chat-bubble {
  position: relative;
  background: var(--panel-2, #1a2130);
  border: 1px solid var(--border, #202836);
  border-radius: 10px;
  padding: 7px 10px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text, #e8ecf4);
  word-break: break-word;
}
.chat-msg.mine .chat-bubble { background: rgba(245,166,35,0.14); border-color: rgba(245,166,35,0.35); }
.chat-del {
  position: absolute;
  top: 2px;
  right: 3px;
  background: transparent;
  border: none;
  color: var(--text-muted, #8892a4);
  font-size: 10px;
  cursor: pointer;
  opacity: 0;
}
.chat-bubble:hover .chat-del { opacity: 0.7; }
#chat-inputbar {
  display: flex;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid var(--border, #202836);
}
#chat-input {
  flex: 1;
  background: var(--bg, #0b0e14);
  border: 1px solid var(--border, #202836);
  border-radius: 8px;
  padding: 9px 11px;
  color: var(--text, #e8ecf4);
  font-size: 13px;
}
#chat-send {
  background: var(--accent, #f5a623);
  color: #10151f;
  border: none;
  border-radius: 8px;
  padding: 0 14px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
}

/* ===== Trợ lý AI ===== */
#ai-fab {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 60;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #4f8bff, #7c5cff);
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0,0,0,.45);
  display: flex;
  align-items: center;
  justify-content: center;
}
#ai-fab:hover { filter: brightness(1.08); }
#ai-panel {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 62;
  width: 350px;
  max-width: calc(100vw - 32px);
  height: 480px;
  max-height: calc(100vh - 40px);
  background: var(--panel, #141a24);
  border: 1px solid var(--border, #202836);
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(0,0,0,.55);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
#ai-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 14px;
  border-bottom: 1px solid var(--border, #202836);
  font-weight: 600;
  font-size: 14px;
  background: linear-gradient(135deg, rgba(79,139,255,0.14), rgba(124,92,255,0.14));
}
#ai-head button { background: transparent; border: none; color: var(--text-muted, #8892a4); font-size: 15px; cursor: pointer; }
#ai-list { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.ai-msg { max-width: 88%; }
.ai-msg.ai-user { align-self: flex-end; }
.ai-msg.ai-bot { align-self: flex-start; }
.ai-bubble {
  background: var(--panel-2, #1a2130);
  border: 1px solid var(--border, #202836);
  border-radius: 10px;
  padding: 8px 11px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text, #e8ecf4);
  word-break: break-word;
}
.ai-msg.ai-user .ai-bubble { background: rgba(79,139,255,0.16); border-color: rgba(79,139,255,0.4); }
.ai-typing { color: var(--text-muted, #8892a4); font-style: italic; }
.ai-cta {
  display: inline-block;
  background: var(--accent, #f5a623);
  color: #10151f;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}
#ai-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 12px 0; }
.ai-chip {
  background: var(--panel-2, #1a2130);
  border: 1px solid var(--border, #202836);
  color: var(--text, #e8ecf4);
  border-radius: 14px;
  padding: 5px 10px;
  font-size: 12px;
  cursor: pointer;
}
.ai-chip:hover { border-color: var(--accent, #f5a623); }
#ai-inputbar { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--border, #202836); }
#ai-input {
  flex: 1;
  background: var(--bg, #0b0e14);
  border: 1px solid var(--border, #202836);
  border-radius: 8px;
  padding: 9px 11px;
  color: var(--text, #e8ecf4);
  font-size: 13px;
}
#ai-send {
  background: #4f8bff;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0 14px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
}

/* Xếp chồng nút chat lớp học lên trên nút Trợ lý AI khi cùng xuất hiện */
#chat-fab { bottom: 84px; }

/* ===== Bảng giá khóa học (chuyên nghiệp) ===== */
.course-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(255px, 1fr)); gap: 20px; align-items: stretch; }
.course-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, rgba(26,33,48,0.9), var(--panel));
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 26px 22px 22px;
  cursor: pointer;
  transition: transform .16s, border-color .16s, box-shadow .16s;
}
.course-card:hover { transform: translateY(-3px); border-color: rgba(245,166,35,0.5); }
.course-card.selected { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), 0 12px 34px rgba(0,0,0,.45); }
.course-badge {
  position: absolute; top: -11px; left: 22px;
  background: var(--accent); color: #10151f;
  font-size: 10.5px; font-weight: 800; letter-spacing: .06em;
  padding: 4px 10px; border-radius: 20px; text-transform: uppercase;
}
.course-level { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); letter-spacing: .08em; text-transform: uppercase; margin-bottom: 6px; }
.course-name { font-family: var(--font-display); font-size: 23px; margin: 0 0 4px; }
.course-tagline { font-size: 12.5px; color: var(--text-muted); min-height: 34px; margin-bottom: 14px; line-height: 1.45; }
.course-price { font-family: var(--font-mono); font-size: 27px; font-weight: 700; color: var(--text); margin-bottom: 2px; }
.course-price small { font-size: 12px; color: var(--text-muted); font-weight: 400; font-family: var(--font-body); }
.course-feats { list-style: none; padding: 0; margin: 16px 0 20px; flex: 1; }
.course-feats li {
  font-size: 12.8px; color: var(--text); padding: 8px 0 8px 22px;
  border-top: 1px solid var(--border); position: relative; line-height: 1.45;
}
.course-feats li:first-child { border-top: none; }
.course-feats li::before { content: '✓'; position: absolute; left: 2px; color: var(--bull, #34d399); font-weight: 700; }
.course-cta { width: 100%; }
/* QR nhóm cộng đồng */
.community-box { background: var(--bg); border: 1px solid var(--accent); border-radius: 12px; padding: 18px; margin-top: 14px; text-align: center; }
.community-box img { width: 100%; max-width: 220px; border-radius: 10px; margin: 10px auto; display: block; background: #fff; padding: 6px; }

/* Thẻ gói đang chọn: viền vàng sáng rõ + nút đăng ký cũng vàng */
.course-card.selected,
.price-card.selected {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 2px var(--accent), 0 0 26px rgba(245,166,35,0.35) !important;
}
.course-card.selected .course-name,
.price-card.selected h3 { color: var(--accent); }
.course-card, .price-card { transition: box-shadow .18s, border-color .18s, transform .18s; }

/* Dòng quà tặng trong thẻ khóa học */
.course-feats li.feat-bonus {
  color: var(--accent);
  font-weight: 600;
  background: rgba(245,166,35,0.07);
  border-radius: 6px;
  margin-top: 4px;
}
.course-feats li.feat-bonus::before { content: '🎁'; font-size: 12px; left: 3px; }

/* ===== Canh đều thẻ khóa học (tên dài 2 dòng không làm lệch giá) ===== */
.course-name { min-height: 58px; display: flex; align-items: flex-end; }
.course-card .course-price { line-height: 1.15; word-break: keep-all; }
.course-card small { display: block; }

@media (max-width: 900px) {
  .course-grid { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; }
  .course-price { font-size: 24px; }
}
@media (max-width: 560px) {
  .course-name { min-height: 0; font-size: 21px; }
  .course-card { padding: 22px 18px 20px; }
  .course-price { font-size: 26px; }
  .course-tagline { min-height: 0; margin-bottom: 12px; }
  .pricing-head h1 { font-size: 24px; line-height: 1.25; }
  .pricing-head p { font-size: 13px; line-height: 1.6; }
  /* Bảng dài trên điện thoại: cho cuộn ngang thay vì vỡ khung */
  table { min-width: 0; }
}

/* Chân trang gọn trên điện thoại */
@media (max-width: 640px) {
  #site-footer > div { flex-direction: column; gap: 20px; }
}

/* Hộp thoại vừa màn hình điện thoại, không bị tràn */
.modal-card { max-height: 88vh; overflow-y: auto; }
@media (max-width: 480px) {
  .modal-card { width: calc(100vw - 24px); padding: 18px 16px; }
  .modal-card h3 { font-size: 17px; }
}

/* Ô ví tập luyện gắn trong khung biểu đồ — luôn nhìn thấy kể cả khi phóng to toàn màn hình */
.wallet-chip {
  position: absolute;
  top: 10px;
  right: 52px;
  z-index: 9;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 11px;
  box-shadow: 0 4px 14px rgba(0,0,0,.35);
}
.wallet-chip-label { font-size: 11px; color: var(--text-muted); }
.wallet-chip-value { font-family: var(--font-mono); font-size: 13px; font-weight: 700; color: var(--accent); }
@media (max-width: 860px) {
  .wallet-chip { right: 46px; padding: 5px 9px; }
  .wallet-chip-label { display: none; }
  .wallet-chip-value { font-size: 12px; }
}

/* ===== Chat lớp học nhúng trong buổi học trực tiếp ===== */
.live-layout { display: grid; grid-template-columns: 1fr 320px; gap: 16px; align-items: start; }
.live-chat {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  height: 520px;
  overflow: hidden;
}
.live-chat-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 11px 13px; border-bottom: 1px solid var(--border);
  font-size: 13px; font-weight: 600;
}
.live-chat-state { font-size: 11px; font-weight: 500; padding: 2px 8px; border-radius: 9px; }
.live-chat-state.on { color: var(--bull); border: 1px solid var(--bull); }
.live-chat-state.off { color: var(--text-muted); border: 1px solid var(--border); }
#live-chat-list { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 9px; }
.lc-msg { font-size: 12.5px; line-height: 1.5; }
.lc-msg .who { color: var(--accent); font-weight: 600; }
.lc-msg .who.teacher { color: #4f8bff; }
.lc-msg .when { color: var(--text-muted); font-size: 10.5px; margin-left: 5px; }
.lc-msg .body { color: var(--text); word-break: break-word; }
.lc-empty { color: var(--text-muted); font-size: 12.5px; text-align: center; margin: auto; }
#live-chat-bar { display: flex; gap: 7px; padding: 10px; border-top: 1px solid var(--border); }
#live-chat-bar input {
  flex: 1; background: var(--bg); border: 1px solid var(--border);
  border-radius: 8px; padding: 9px 11px; color: var(--text); font-size: 13px;
}
#live-chat-bar .btn { font-size: 12.5px; padding: 9px 15px; }
#live-chat-locked {
  display: none; padding: 12px; border-top: 1px solid var(--border);
  font-size: 12.5px; color: var(--text-muted); text-align: center;
}
@media (max-width: 1050px) {
  .live-layout { grid-template-columns: 1fr; }
  .live-chat { height: 380px; }
}

/* ===== Chốt chặn bố cục biểu đồ =====
   Sau khi thoát toàn màn hình, biểu đồ phải co lại vừa cột chứa nó,
   không được giữ bề ngang cũ làm lệch cả trang. */
.content-grid { min-width: 0; }
.chart-column { min-width: 0; overflow: hidden; }
.chart-stage { max-width: 100%; }
#chart-container { width: 100% !important; max-width: 100%; }
.chart-stage:not(.is-fullscreen) #chart-container { height: 460px; }
.chart-stage:not(.is-fullscreen) { position: relative; inset: auto; z-index: auto; }
body { overflow-x: hidden; }

/* ===== Dải chức vụ trong bảng học viên/nhân sự ===== */
.role-tabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 7px;
  padding: 3px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 9px;
}
.role-tab {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 11.5px;
  font-family: inherit;
  color: var(--text-muted);
  cursor: pointer;
  transition: all .15s ease;
  white-space: nowrap;
}
.role-tab:hover:not(:disabled) {
  background: var(--panel-2);
  color: var(--text);
  border-color: var(--border);
}
/* Chức vụ hiện tại: tô sáng + phát sáng */
.role-tab.is-active {
  background: color-mix(in srgb, var(--tab-color) 16%, transparent);
  border-color: var(--tab-color);
  color: var(--tab-color);
  font-weight: 700;
  cursor: default;
  box-shadow: 0 0 0 1px var(--tab-color), 0 0 12px -2px var(--tab-color);
  animation: tabGlow 2.4s ease-in-out infinite;
}
@keyframes tabGlow {
  0%, 100% { box-shadow: 0 0 0 1px var(--tab-color), 0 0 10px -3px var(--tab-color); }
  50%      { box-shadow: 0 0 0 1px var(--tab-color), 0 0 18px 0 var(--tab-color); }
}
.role-tab-extra { color: var(--text-muted); border-color: var(--border); }
.role-tab-extra:hover { color: var(--accent); border-color: var(--accent); }
@media (max-width: 860px) {
  .role-tabs { gap: 3px; padding: 2px; }
  .role-tab { padding: 4px 7px; font-size: 10.5px; }
}

/* ===== Thanh xổ xuống chọn cấp bậc ===== */
.rank-picker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 7px;
  flex-wrap: wrap;
}
.rank-select {
  background: color-mix(in srgb, var(--rank-color) 14%, var(--bg));
  border: 1.5px solid var(--rank-color);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 12.5px;
  font-weight: 700;
  font-family: inherit;
  color: var(--rank-color);
  cursor: pointer;
  min-width: 152px;
  box-shadow: 0 0 10px -3px var(--rank-color);
  transition: box-shadow .2s ease, transform .12s ease;
}
.rank-select:hover { box-shadow: 0 0 16px -2px var(--rank-color); }
.rank-select:focus { outline: none; box-shadow: 0 0 0 2px var(--rank-color), 0 0 18px -2px var(--rank-color); }
.rank-select option { background: var(--panel); color: var(--text); font-weight: 500; }
.rank-select:disabled { opacity: .55; cursor: wait; }
@media (max-width: 860px) {
  .rank-select { min-width: 128px; font-size: 11.5px; padding: 5px 8px; }
}

/* ===== Thanh xổ xuống chọn cấp bậc ===== */
.role-pick {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 6px 9px;
  font-size: 12px;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  min-width: 150px;
  transition: box-shadow .2s ease, background .2s ease;
}
.role-pick:hover { background: var(--panel-2); }
.role-pick:disabled { opacity: .55; cursor: wait; }

/* Vừa đổi cấp bậc: sáng lên để nhận biết vị trí mới */
.role-pick.just-changed {
  background: color-mix(in srgb, var(--role-color) 18%, transparent);
  box-shadow: 0 0 0 2px var(--role-color), 0 0 20px -2px var(--role-color);
  animation: rolePop 3.2s ease-out 1;
}
@keyframes rolePop {
  0%   { transform: scale(1.06); box-shadow: 0 0 0 3px var(--role-color), 0 0 26px 2px var(--role-color); }
  18%  { transform: scale(1); }
  70%  { box-shadow: 0 0 0 2px var(--role-color), 0 0 18px -2px var(--role-color); }
  100% { box-shadow: 0 0 0 1px var(--role-color), 0 0 0 0 transparent; }
}

/* Thanh xổ chọn cấp bậc */
.rank-select {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 5px 8px;
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 0 0 1px var(--rank-color), 0 0 10px -3px var(--rank-color);
  animation: tabGlow 2.4s ease-in-out infinite;
}
.rank-select:hover { filter: brightness(1.15); }

/* ===================== TRANG TUYỂN DỤNG ===================== */
.careers-hero {
  text-align: center;
  padding: 46px 20px 34px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 34px;
}
.careers-badge {
  display: inline-block;
  font-size: 11.5px;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 20px;
  padding: 4px 14px;
  margin-bottom: 14px;
}
.careers-hero h1 { font-size: 34px; margin: 0 0 12px; line-height: 1.25; }
.careers-hero p {
  color: var(--text-muted);
  font-size: 14.5px;
  line-height: 1.8;
  max-width: 680px;
  margin: 0 auto 22px;
}
.careers-section-title {
  font-size: 20px;
  margin: 34px 0 16px;
  padding-bottom: 9px;
  border-bottom: 1px solid var(--border);
}

/* Thẻ vị trí */
.job-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 12px;
  overflow: hidden;
  transition: border-color .15s ease;
}
.job-card[open] { border-color: var(--accent); }
.job-card summary { cursor: pointer; padding: 17px 20px; list-style: none; }
.job-card summary::-webkit-details-marker { display: none; }
.job-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.job-title { font-size: 17px; font-weight: 700; }
.job-summary { font-size: 13px; color: var(--text-muted); margin-top: 3px; }
.job-tag {
  margin-left: auto;
  font-size: 11.5px;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 20px;
  padding: 4px 12px;
  white-space: nowrap;
}
.job-body { padding: 0 20px 20px; border-top: 1px solid var(--border); }
.job-salary {
  background: var(--bg);
  border-left: 3px solid var(--bull);
  border-radius: 7px;
  padding: 11px 14px;
  font-size: 13.5px;
  margin: 16px 0;
  line-height: 1.6;
}
.job-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.job-col-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.job-cols ul { margin: 0; padding-left: 19px; }
.job-cols li { font-size: 13.5px; line-height: 1.85; color: var(--text); }
.job-apply { margin-top: 18px; font-size: 13px; padding: 9px 18px; }

/* Quyền lợi */
.benefits-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(255px, 1fr));
  gap: 14px;
}
.benefit-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
}
.benefit-icon { font-size: 26px; margin-bottom: 10px; }
.benefit-title { font-size: 15px; font-weight: 700; margin-bottom: 7px; }
.benefit-desc { font-size: 13px; color: var(--text-muted); line-height: 1.75; }

/* Biểu mẫu ứng tuyển */
.apply-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 28px;
  margin: 34px 0 50px;
  scroll-margin-top: 80px;
}
.apply-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.apply-grid .field-full { grid-column: 1 / -1; }
.apply-card .field label {
  display: block;
  font-size: 12.5px;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.apply-card input,
.apply-card select,
.apply-card textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 11px 12px;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
}
.apply-card textarea { resize: vertical; }
.apply-card input:focus,
.apply-card select:focus,
.apply-card textarea:focus { outline: none; border-color: var(--accent); }

@media (max-width: 720px) {
  .careers-hero h1 { font-size: 26px; }
  .job-cols { grid-template-columns: 1fr; gap: 16px; }
  .apply-grid { grid-template-columns: 1fr; }
  .apply-card { padding: 20px; }
  .job-tag { margin-left: 0; }
}

/* Nút bánh răng cài đặt chỉ báo chuyên sâu */
.indicator-check { position: relative; }
.pro-gear {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 13px;
  padding: 0 4px;
  margin-left: auto;
  opacity: .55;
  transition: opacity .15s ease, color .15s ease;
}
.pro-gear:hover { opacity: 1; color: var(--accent); }

/* ===== Nhiều đường cho một chỉ báo chuyên sâu ===== */
.pro-add {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--accent);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  margin-left: 4px;
  padding: 1px 6px 2px;
  transition: all .15s ease;
}
.pro-add:hover { background: var(--accent); border-color: var(--accent); color: #12141a; }

.pro-instances { margin: 2px 0 4px 22px; }
.pro-inst {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 3px 6px;
  margin-bottom: 3px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-left-width: 3px;
  border-radius: 6px;
  font-size: 11.5px;
}
.pro-inst-dot {
  width: 13px; height: 13px;
  border: none;
  border-radius: 3px;
  padding: 0;
  cursor: pointer;
  flex: none;
}
.pro-inst-name { flex: 1; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pro-inst-note { color: var(--accent); font-family: var(--font-mono); font-size: 10.5px; }
.pro-inst button.mini {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
  padding: 2px 3px;
}
.pro-inst button.mini:hover { color: var(--text); }
.pro-inst button.mini.del:hover { color: var(--bear); }
