/* ═══════════════════════════════════════════════════════════
   APEX ELITE — Premium Trading Design System
   ═══════════════════════════════════════════════════════════ */
:root {
  --bg: #050505;
  --bg2: #0c0c0c;
  --bg3: #111111;
  --panel: rgba(18, 18, 18, 0.92);
  --panel2: rgba(24, 24, 24, 0.95);
  --glass: rgba(255, 255, 255, 0.03);
  --line: rgba(255, 255, 255, 0.06);
  --line2: rgba(255, 255, 255, 0.1);
  --ink: #f0f0f0;
  --ink2: #c8c8c8;
  --mute: #6b6b6b;
  --brand: #26a69a;
  --brand2: #1e8a80;
  --brand-glow: rgba(38, 166, 154, 0.35);
  --brand-dim: #1e8a80;
  --buy: #26a69a;
  --buy-glow: rgba(38, 166, 154, 0.25);
  --sell: #f87171;
  --sell-glow: rgba(248, 113, 113, 0.25);
  --ok: #34d399;
  --bad: #f87171;
  --warn: #fbbf24;
  --nav-h: 52px;
  --account-h: 40px;
  --font: 'Inter', system-ui, -apple-system, sans-serif;
  --mono: 'JetBrains Mono', 'SF Mono', Consolas, monospace;
  --radius: 10px;
  --radius-lg: 16px;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
  --shadow-glow: 0 0 40px var(--brand-glow);
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="light"] {
  --bg: #f8fafc;
  --bg2: #f1f5f9;
  --bg3: #e2e8f0;
  --panel: rgba(255, 255, 255, 0.95);
  --panel2: #fff;
  --glass: rgba(0, 0, 0, 0.02);
  --line: rgba(0, 0, 0, 0.08);
  --line2: rgba(0, 0, 0, 0.12);
  --ink: #0f172a;
  --ink2: #334155;
  --mute: #64748b;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
html, body { height: 100%; font-family: var(--font); background: var(--bg); color: var(--ink); }
body { background: var(--bg); }
a { color: var(--brand); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--brand2); }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select, textarea { font-family: inherit; font-size: inherit; }
.hidden { display: none !important; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }

::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 18px; border-radius: var(--radius); font-weight: 600; font-size: 13px;
  transition: all var(--transition); white-space: nowrap; position: relative; overflow: hidden;
}
.btn::after {
  content: ''; position: absolute; inset: 0; background: linear-gradient(135deg, rgba(255,255,255,0.12), transparent);
  opacity: 0; transition: opacity var(--transition);
}
.btn:hover::after { opacity: 1; }
.btn-brand {
  background: linear-gradient(135deg, var(--brand), var(--brand-dim));
  color: #000; font-weight: 700; box-shadow: 0 4px 20px var(--brand-glow);
}
.btn-brand:hover { transform: translateY(-1px); box-shadow: 0 8px 28px var(--brand-glow); }
.btn-ghost { background: var(--glass); border: 1px solid var(--line); color: var(--ink2); backdrop-filter: blur(8px); }
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); background: rgba(45,212,191,0.06); }
.btn-buy { background: linear-gradient(135deg, var(--buy), var(--brand-dim)); color: #000; font-weight: 700; box-shadow: 0 4px 16px var(--buy-glow); }
.btn-sell { background: linear-gradient(135deg, var(--sell), #dc2626); color: #fff; font-weight: 700; box-shadow: 0 4px 16px var(--sell-glow); }
.btn-sm { padding: 5px 12px; font-size: 11px; border-radius: 8px; }
.btn-lg { padding: 14px 28px; font-size: 15px; font-weight: 700; border-radius: 12px; }
.btn-icon { width: 36px; height: 36px; padding: 0; border-radius: 10px; }

/* ── Forms ── */
.field {
  background: var(--panel2); border: 1px solid var(--line); color: var(--ink);
  border-radius: var(--radius); padding: 10px 14px; width: 100%; outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.field:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-glow); }
.label { font-size: 10px; color: var(--mute); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 6px; display: block; font-weight: 600; }

/* ── Tables ── */
.table { width: 100%; border-collapse: collapse; font-size: 12px; }
.table th { text-align: left; padding: 10px 12px; color: var(--mute); font-weight: 600; font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em; border-bottom: 1px solid var(--line); background: var(--glass); position: sticky; top: 0; z-index: 1; }
.table td { padding: 10px 12px; border-bottom: 1px solid var(--line); font-family: var(--mono); font-size: 11px; }
.table tr { transition: background var(--transition); }
.table tr:hover td { background: rgba(45, 212, 191, 0.04); }
.pos { color: var(--ok); }
.neg { color: var(--bad); }

/* ── Toast ── */
.toast-wrap { position: fixed; top: 20px; right: 20px; z-index: 99999; display: flex; flex-direction: column; gap: 10px; pointer-events: none; }
.toast {
  background: var(--panel2); border: 1px solid var(--line2); border-radius: 12px;
  padding: 14px 18px; font-size: 13px; box-shadow: var(--shadow); pointer-events: auto;
  animation: toastIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1); max-width: 360px; backdrop-filter: blur(20px);
}
.toast.ok { border-left: 3px solid var(--ok); }
.toast.err { border-left: 3px solid var(--bad); }
@keyframes toastIn { from { transform: translateX(120%) scale(0.9); opacity: 0; } to { transform: translateX(0) scale(1); opacity: 1; } }

/* ── Shared app shell (portal + pages) ── */
.apex-shell-nav {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 12px 20px; border-bottom: 1px solid var(--line);
  background: var(--bg2); position: sticky; top: 0; z-index: 40;
}
.apex-shell-brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 800; font-size: 15px; color: var(--ink); text-decoration: none; margin-right: 12px;
}
.apex-shell-link {
  padding: 6px 12px; border-radius: 8px; font-size: 13px; font-weight: 600;
  color: var(--mute); text-decoration: none; transition: all var(--transition);
}
.apex-shell-link:hover, .apex-shell-link.active { color: var(--brand); background: rgba(38,166,154,0.08); }
.apex-shell-end { margin-left: auto; }

/* ── Loader ── */
.apex-loader { position: fixed; inset: 0; background: var(--bg); z-index: 99998; display: grid; place-items: center; transition: opacity 0.4s; }
.apex-loader.done { opacity: 0; pointer-events: none; }
.apex-spinner { width: 40px; height: 40px; border: 2px solid var(--line); border-top-color: var(--brand); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Status dot ── */
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 8px var(--ok); animation: pulse 2s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }

/* ── Toggle ── */
.toggle { width: 40px; height: 22px; background: var(--line2); border-radius: 11px; position: relative; cursor: pointer; transition: background var(--transition); flex-shrink: 0; }
.toggle.on { background: var(--brand); box-shadow: 0 0 12px var(--brand-glow); }
.toggle::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; background: #fff; border-radius: 50%; transition: left var(--transition); box-shadow: 0 2px 4px rgba(0,0,0,0.3); }
.toggle.on::after { left: 21px; }

/* ── Dropdown ── */
.dropdown { position: relative; }
.dropdown-menu {
  position: absolute; top: calc(100% + 6px); right: 0;
  background: var(--panel2); border: 1px solid var(--line2); border-radius: 12px;
  min-width: 220px; z-index: 1000; box-shadow: var(--shadow); display: none;
  backdrop-filter: blur(24px); overflow: hidden; animation: dropIn 0.2s ease;
}
.dropdown.open .dropdown-menu { display: block; }
@keyframes dropIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
.dropdown-menu a, .dropdown-menu button {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  padding: 11px 16px; font-size: 13px; color: var(--ink2); border-bottom: 1px solid var(--line); transition: all var(--transition);
}
.dropdown-menu a:hover, .dropdown-menu button:hover { background: rgba(45,212,191,0.08); color: var(--brand); padding-left: 20px; }
.dropdown-menu a:last-child, .dropdown-menu button:last-child { border-bottom: none; color: var(--bad); }

/* ═══ LANDING ═══ */
.landing-nav {
  position: sticky; top: 0; z-index: 200;
  background: rgba(5, 5, 5, 0.8); backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--line);
}
.nav-inner { max-width: 1280px; margin: 0 auto; padding: 14px 28px; display: flex; align-items: center; gap: 32px; }
.nav-links { display: flex; gap: 28px; font-size: 14px; font-weight: 500; }
.nav-links a { color: var(--mute); text-decoration: none; transition: color var(--transition); }
.nav-links a:hover { color: var(--ink); }

.ticker-strip { overflow: hidden; border-block: 1px solid var(--line); background: var(--bg2); padding: 12px 0; }
.ticker-track { display: flex; gap: 40px; animation: marquee 50s linear infinite; white-space: nowrap; }
.ticker-item { display: inline-flex; align-items: center; gap: 10px; font-size: 13px; font-family: var(--mono); }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }

.landing-hero {
  min-height: 92vh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 80px 28px; position: relative; overflow: hidden;
}
.landing-hero::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle 600px at 50% 40%, rgba(45,212,191,0.08), transparent 70%);
  pointer-events: none;
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 16px;
  background: rgba(45,212,191,0.1); border: 1px solid rgba(45,212,191,0.25);
  border-radius: 99px; font-size: 12px; font-weight: 600; color: var(--brand);
  letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 28px;
}
.hero-title { font-size: clamp(40px, 7vw, 72px); font-weight: 800; line-height: 1.05; margin-bottom: 24px; max-width: 900px; letter-spacing: -0.02em; }
.hero-title .gradient { background: linear-gradient(135deg, var(--brand), #6ee7b7, var(--brand)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.hero-sub { font-size: 19px; color: var(--mute); max-width: 580px; margin-bottom: 40px; line-height: 1.7; }
.hero-stats { display: flex; gap: 48px; flex-wrap: wrap; justify-content: center; margin-top: 56px; }
.hero-stat .num { font-size: 32px; font-weight: 800; font-family: var(--mono); color: var(--brand); }
.hero-stat .lbl { font-size: 13px; color: var(--mute); margin-top: 4px; }

.section { padding: 100px 28px; max-width: 1280px; margin: 0 auto; width: 100%; box-sizing: border-box; }
.section-panel {
  background: var(--panel);
  border-radius: 24px;
  border: 1px solid var(--line);
  max-width: 1280px;
  margin-inline: auto;
  box-sizing: border-box;
}
.section-head { text-align: center; margin-bottom: 56px; }
.section-head h2 { font-size: clamp(28px, 4vw, 42px); font-weight: 800; letter-spacing: -0.02em; margin-bottom: 16px; }
.section-head p { color: var(--mute); max-width: 520px; margin: 0 auto; font-size: 16px; line-height: 1.6; }

.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }
.feature-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 28px; transition: all var(--transition); position: relative; overflow: hidden;
}
.feature-card::before { content: ''; position: absolute; inset: 0; background: linear-gradient(135deg, rgba(45,212,191,0.05), transparent); opacity: 0; transition: opacity var(--transition); }
.feature-card:hover { border-color: rgba(45,212,191,0.3); transform: translateY(-4px); box-shadow: var(--shadow-glow); }
.feature-card:hover::before { opacity: 1; }
.feature-icon { width: 48px; height: 48px; border-radius: 12px; background: rgba(45,212,191,0.12); display: grid; place-items: center; font-size: 22px; margin-bottom: 16px; }
.feature-card h3 { font-weight: 700; font-size: 17px; margin-bottom: 10px; }
.feature-card p { color: var(--mute); font-size: 14px; line-height: 1.65; }

.terminal-preview {
  background: var(--panel); border: 1px solid var(--line2); border-radius: 20px;
  overflow: hidden; box-shadow: 0 40px 100px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.04);
}
.preview-bar { background: var(--bg3); padding: 10px 16px; display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--line); font-size: 12px; }
.preview-dots { display: flex; gap: 6px; }
.preview-dots span { width: 10px; height: 10px; border-radius: 50%; }
.preview-dots span:nth-child(1) { background: #f87171; }
.preview-dots span:nth-child(2) { background: #fbbf24; }
.preview-dots span:nth-child(3) { background: #34d399; }

/* ═══ TERMINAL ═══ */
.terminal {
  display: grid; grid-template-rows: var(--nav-h) var(--account-h) 1fr auto auto;
  height: 100vh; overflow: hidden; background: var(--bg);
}

.term-nav {
  display: flex; align-items: center; gap: 6px; padding: 0 16px;
  background: var(--panel); border-bottom: 1px solid var(--line);
  height: var(--nav-h); backdrop-filter: blur(20px);
}
.term-nav .logo {
  display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 16px;
  margin-right: 20px; letter-spacing: -0.02em;
}
.term-nav .logo svg { width: 26px; height: 26px; filter: drop-shadow(0 0 8px var(--brand-glow)); }
.term-tabs { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.term-tabs::-webkit-scrollbar { display: none; }
.term-tab {
  padding: 7px 14px; font-size: 12px; font-weight: 500; color: var(--mute);
  border-radius: 8px; white-space: nowrap; transition: all var(--transition);
}
.term-tab.active { color: var(--brand); background: rgba(45,212,191,0.1); }
.term-tab:hover:not(.active) { color: var(--ink2); background: var(--glass); }
.term-nav-right { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.term-account-bar {
  display: flex; align-items: center; gap: 20px; padding: 0 16px;
  background: linear-gradient(180deg, var(--bg2), var(--bg));
  border-bottom: 1px solid var(--line); height: var(--account-h);
  font-size: 11px; overflow-x: auto; scrollbar-width: none;
}
.term-metric { display: flex; flex-direction: column; min-width: 72px; gap: 2px; }
.term-metric .val { font-weight: 700; font-size: 12px; font-family: var(--mono); transition: color 0.3s; }
.term-metric .lbl { color: var(--mute); font-size: 9px; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; }
.term-metric .val.flash-up { animation: flashUp 0.5s; }
.term-metric .val.flash-down { animation: flashDown 0.5s; }
@keyframes flashUp { 0%,100% { color: var(--ink); } 50% { color: var(--ok); } }
@keyframes flashDown { 0%,100% { color: var(--ink); } 50% { color: var(--bad); } }

.term-main { display: grid; grid-template-columns: 240px 1fr 280px; overflow: hidden; min-height: 0; }

.term-watchlist { background: var(--panel); border-right: 1px solid var(--line); display: flex; flex-direction: column; overflow: hidden; }
.term-watchlist-search { padding: 10px; border-bottom: 1px solid var(--line); }
.term-watchlist-list { flex: 1; overflow-y: auto; }
.wl-header { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; padding: 8px 12px; font-size: 9px; color: var(--mute); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; border-bottom: 1px solid var(--line); }
.wl-row {
  display: grid; grid-template-columns: auto 1fr auto auto; gap: 8px; padding: 9px 12px;
  font-size: 11px; cursor: pointer; border-bottom: 1px solid var(--line); align-items: center;
  transition: background var(--transition);
}
.wl-row:hover { background: rgba(45,212,191,0.04); }
.wl-row.active { background: rgba(45,212,191,0.08); border-left: 2px solid var(--brand); }
.wl-row .sym { font-weight: 600; font-size: 12px; }
.wl-row .price { text-align: right; font-family: var(--mono); }
.wl-row .chg { text-align: right; font-size: 10px; font-family: var(--mono); padding: 2px 6px; border-radius: 4px; }
.wl-row .chg.pos { background: rgba(52,211,153,0.12); }
.wl-row .chg.neg { background: rgba(248,113,113,0.12); }
.wl-star { opacity: 0.3; font-size: 14px; transition: opacity var(--transition); }
.wl-star.on { opacity: 1; color: var(--warn); }

.term-center { display: flex; flex-direction: column; overflow: hidden; min-height: 0; }
.term-chart-header {
  display: flex; align-items: center; gap: 8px; padding: 8px 14px;
  background: var(--panel); border-bottom: 1px solid var(--line); font-size: 11px; flex-wrap: wrap;
}
.chart-tab { padding: 5px 12px; border-radius: 6px; font-weight: 600; font-size: 11px; color: var(--mute); cursor: pointer; transition: all var(--transition); }
.chart-tab.active { color: var(--brand); background: rgba(45,212,191,0.1); }
.bid-ask-bar { display: flex; gap: 16px; margin-left: auto; font-family: var(--mono); font-size: 12px; }
.bid-ask-bar .bid { color: var(--sell); }
.bid-ask-bar .ask { color: var(--buy); }
.bid-ask-bar .spread { color: var(--mute); font-size: 10px; }
.tf-btn.active { background: rgba(45,212,191,0.15) !important; color: var(--brand) !important; border-color: rgba(45,212,191,0.3) !important; }

.term-chart-area { flex: 1; position: relative; min-height: 200px; background: var(--bg); }
.term-chart-area #chartContainer { width: 100% !important; height: 100% !important; }
.chart-info-panel { padding: 20px; display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 16px; height: 100%; overflow-y: auto; }
.info-cell { background: var(--panel2); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.info-cell .lbl { font-size: 10px; color: var(--mute); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 6px; }
.info-cell .val { font-family: var(--mono); font-weight: 600; font-size: 14px; }

.term-order-panel {
  background: var(--panel); border-top: 1px solid var(--line); padding: 14px 18px;
  display: grid; grid-template-columns: auto 1fr auto; gap: 20px; align-items: center;
  backdrop-filter: blur(12px);
}
.order-side-btns { display: flex; gap: 4px; background: var(--bg3); padding: 4px; border-radius: 10px; }
.order-side-btns button { padding: 11px 28px; font-weight: 700; border-radius: 8px; opacity: 0.45; font-size: 13px; transition: all var(--transition); }
.order-side-btns button.active-buy { background: var(--buy); color: #000; opacity: 1; box-shadow: 0 4px 16px var(--buy-glow); }
.order-side-btns button.active-sell { background: var(--sell); color: #fff; opacity: 1; box-shadow: 0 4px 16px var(--sell-glow); }
.order-fields { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.order-field { display: flex; flex-direction: column; gap: 4px; }
.qty-stepper { display: flex; align-items: center; gap: 4px; background: var(--bg3); border-radius: 8px; padding: 2px; }
.qty-stepper button { width: 32px; height: 32px; background: var(--panel2); border: 1px solid var(--line); border-radius: 6px; font-size: 16px; transition: all var(--transition); }
.qty-stepper button:hover { border-color: var(--brand); color: var(--brand); }
.toggle-row { display: flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 600; color: var(--mute); }

.term-sidebar { background: var(--panel); border-left: 1px solid var(--line); overflow-y: auto; display: flex; flex-direction: column; }
.sidebar-section { padding: 14px; border-bottom: 1px solid var(--line); }
.sidebar-section h4 { font-size: 10px; color: var(--mute); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 12px; font-weight: 700; }
.mover-card { display: flex; align-items: center; gap: 10px; padding: 8px 0; font-size: 11px; border-bottom: 1px solid var(--line); }
.mover-card:last-child { border-bottom: none; }
.mover-card .spark { width: 56px; height: 28px; }
.news-item { padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 12px; line-height: 1.5; }
.news-item a { color: var(--ink2); display: block; }
.news-item a:hover { color: var(--brand); text-decoration: none; }
.social-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; font-size: 11px; border-bottom: 1px solid var(--line); }
.social-row .avatar { width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, var(--brand-dim), var(--brand)); display: grid; place-items: center; font-weight: 800; color: #000; font-size: 13px; }
.social-row .roi-bar { height: 4px; border-radius: 2px; background: var(--line); margin-top: 4px; overflow: hidden; }
.social-row .roi-bar fill { height: 100%; background: var(--brand); border-radius: 2px; }

.term-positions { background: var(--panel); border-top: 1px solid var(--line); max-height: 200px; overflow: hidden; display: flex; flex-direction: column; }
.pos-tabs { display: flex; gap: 0; border-bottom: 1px solid var(--line); background: var(--bg2); }
.pos-tab { padding: 10px 20px; font-size: 12px; font-weight: 600; color: var(--mute); border-bottom: 2px solid transparent; transition: all var(--transition); }
.pos-tab.active { color: var(--brand); border-bottom-color: var(--brand); background: rgba(45,212,191,0.05); }
.pos-content { flex: 1; overflow: auto; }

/* ── Auth ── */
.auth-wrap {
  min-height: 100vh; display: grid; place-items: center; padding: 28px;
  background: radial-gradient(ellipse 80% 60% at 50% 0%, rgba(45,212,191,0.1), transparent 60%);
}
.auth-card {
  background: var(--panel); border: 1px solid var(--line2); border-radius: 20px;
  padding: 40px; width: 100%; max-width: 440px; box-shadow: var(--shadow);
  backdrop-filter: blur(24px);
}
.auth-card h1 { font-size: 26px; font-weight: 800; margin-bottom: 8px; letter-spacing: -0.02em; }
.auth-card p { color: var(--mute); font-size: 14px; margin-bottom: 28px; }
.form-group { margin-bottom: 18px; }

/* ── Portal ── */
.portal-wrap { max-width: 960px; margin: 0 auto; padding: 32px 24px; }
.portal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 28px; flex-wrap: wrap; gap: 16px; }
.portal-header h1 { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; }
.portal-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 28px; margin-bottom: 20px; }
.portal-nav {
  display: flex; align-items: center; gap: 12px; padding: 14px 24px;
  background: rgba(5,5,5,0.9); backdrop-filter: blur(20px); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 100; flex-wrap: wrap;
}

/* ── Admin ── */
.admin-wrap { max-width: 1280px; margin: 0 auto; padding: 28px 24px; }
.admin-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 28px; }
.stat-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 22px; transition: all var(--transition); position: relative; overflow: hidden;
}
.stat-card::after { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px; background: linear-gradient(90deg, var(--brand), transparent); }
.stat-card:hover { border-color: rgba(45,212,191,0.25); transform: translateY(-2px); }
.stat-card .num { font-size: 32px; font-weight: 800; font-family: var(--mono); color: var(--brand); }
.stat-card .lbl { font-size: 12px; color: var(--mute); margin-top: 4px; font-weight: 500; }

/* ── Keyboard hint ── */
.kbd-hint { position: fixed; bottom: 16px; left: 16px; font-size: 10px; color: var(--mute); background: var(--panel); border: 1px solid var(--line); padding: 8px 12px; border-radius: 8px; z-index: 50; opacity: 0.7; }
.kbd-hint kbd { background: var(--bg3); padding: 2px 6px; border-radius: 4px; font-family: var(--mono); border: 1px solid var(--line); }

/* ── Responsive ── */
@media (max-width: 1100px) {
  .term-main { grid-template-columns: 220px 1fr; }
  .term-sidebar { display: none; }
}
@media (max-width: 768px) {
  .term-main { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .term-watchlist { max-height: 180px; border-right: none; border-bottom: 1px solid var(--line); }
  .term-order-panel { grid-template-columns: 1fr; }
  .nav-links { display: none; }
  .term-tabs { display: none; }
  .kbd-hint { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ═══════════════════════════════════════════════════════════
   PORTAL v20 — upgraded account-area design system
   ═══════════════════════════════════════════════════════════ */
body.portal-page {
  background:
    radial-gradient(ellipse 70% 50% at 12% -5%, rgba(38,166,154,0.10), transparent 60%),
    radial-gradient(ellipse 60% 50% at 100% 0%, rgba(38,166,154,0.06), transparent 55%),
    var(--bg);
  min-height: 100vh;
}

/* Shell nav upgrades */
.apex-shell-nav { backdrop-filter: blur(20px); background: rgba(12,12,12,0.82); }
html[data-theme="light"] .apex-shell-nav { background: rgba(255,255,255,0.85); }
.apex-shell-link { position: relative; }
.apex-shell-link.active::after { content: ''; position: absolute; left: 12px; right: 12px; bottom: -13px; height: 2px; background: var(--brand); border-radius: 2px; }
.shell-chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 99px;
  background: var(--glass); border: 1px solid var(--line); font-size: 12px; font-weight: 600;
}
.shell-chip .sc-bal { color: var(--brand); font-variant-numeric: tabular-nums; }
.shell-bell { position: relative; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; color: var(--ink2); text-decoration: none; }
.shell-bell:hover { background: var(--glass); }
.shell-bell .dot { position: absolute; top: 7px; right: 8px; width: 7px; height: 7px; background: var(--bad); border-radius: 50%; border: 1px solid var(--bg2); }
.shell-avatar { width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(145deg, var(--brand), var(--brand2)); color: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 800; overflow: hidden; }
.shell-avatar-wrap { display: inline-flex; text-decoration: none; }

/* Page hero */
.portal-wrap { max-width: 1080px; }
.portal-hero { display: flex; align-items: center; gap: 16px; margin-bottom: 26px; flex-wrap: wrap; }
.portal-hero .ph-icon { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; font-size: 22px; background: rgba(38,166,154,0.12); border: 1px solid rgba(38,166,154,0.25); }
.portal-hero h1 { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; }
.portal-hero .ph-sub { color: var(--mute); font-size: 13px; margin-top: 3px; }
.portal-hero .ph-end { margin-left: auto; display: flex; gap: 10px; flex-wrap: wrap; }

/* Layout helpers */
.portal-2col { display: grid; grid-template-columns: 1.6fr 1fr; gap: 20px; align-items: start; }
@media (max-width: 820px) { .portal-2col { grid-template-columns: 1fr; } }

/* Section card */
.section-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 24px; margin-bottom: 20px; }
.section-card > .sc-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.section-card > .sc-head h3 { font-size: 15px; font-weight: 700; }
.section-card > .sc-head .sc-hint { font-size: 12px; color: var(--mute); }

/* KPI stat grid */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 22px; }
.kpi-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 18px 20px; position: relative; overflow: hidden; transition: all var(--transition); }
.kpi-card:hover { border-color: rgba(38,166,154,0.25); transform: translateY(-2px); }
.kpi-card .kc-lbl { font-size: 11px; color: var(--mute); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; }
.kpi-card .kc-val { font-size: 26px; font-weight: 800; margin-top: 8px; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.kpi-card .kc-ico { position: absolute; top: 16px; right: 16px; font-size: 18px; opacity: 0.5; }

/* Badges */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.badge.demo { color: #9ca3af; background: rgba(156,163,175,0.14); }
.badge.live { color: var(--brand); background: rgba(38,166,154,0.14); }
.badge.ok { color: var(--ok); background: rgba(52,211,153,0.14); }
.badge.warn { color: var(--warn); background: rgba(251,191,36,0.14); }
.badge.bad { color: var(--bad); background: rgba(248,113,113,0.14); }

/* Profile identity header */
.id-head { display: flex; align-items: center; gap: 18px; }
.id-avatar { width: 72px; height: 72px; border-radius: 22px; background: linear-gradient(145deg, var(--brand), var(--brand2)); color: #fff; display: grid; place-items: center; font-size: 28px; font-weight: 800; box-shadow: var(--shadow-glow); }
.id-name { font-size: 20px; font-weight: 800; }
.id-mail { color: var(--mute); font-size: 13px; margin-top: 2px; }
.id-tags { display: flex; gap: 8px; margin-top: 8px; }

/* Account / method / lead cards */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.acct-card { background: linear-gradient(150deg, var(--panel2), var(--panel)); border: 1px solid var(--line2); border-radius: var(--radius-lg); padding: 20px; position: relative; overflow: hidden; }
.acct-card .ac-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.acct-card .ac-name { font-weight: 700; }
.acct-card .ac-bal { font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; }
.acct-card .ac-meta { color: var(--mute); font-size: 12px; margin-top: 6px; display: flex; gap: 14px; }
.acct-card .ac-star { position: absolute; top: 16px; right: 16px; color: var(--warn); }

.method-card { display: flex; flex-direction: column; gap: 12px; }
.copy-row { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; }
.copy-row .cr-k { font-size: 11px; color: var(--mute); text-transform: uppercase; letter-spacing: 0.05em; min-width: 78px; }
.copy-row .cr-v { font-family: var(--mono); font-size: 12px; word-break: break-all; flex: 1; }
.copy-btn { background: var(--glass); border: 1px solid var(--line); color: var(--ink2); border-radius: 8px; padding: 6px 10px; font-size: 11px; font-weight: 700; cursor: pointer; transition: all var(--transition); }
.copy-btn:hover { border-color: var(--brand); color: var(--brand); }

/* Leaderboard */
.lead-row { display: flex; align-items: center; gap: 16px; padding: 14px 4px; border-bottom: 1px solid var(--line); }
.lead-row:last-child { border-bottom: none; }
.lead-rank { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; font-weight: 800; font-size: 12px; background: var(--glass); color: var(--mute); }
.lead-rank.top { background: linear-gradient(135deg, var(--brand), var(--brand2)); color: #fff; }
.lead-av { width: 42px; height: 42px; border-radius: 50%; background: var(--panel2); border: 1px solid var(--line2); display: grid; place-items: center; font-weight: 800; }

/* Timeline (transactions / notifications) */
.tl-item { display: flex; gap: 14px; padding: 14px 4px; border-bottom: 1px solid var(--line); }
.tl-item:last-child { border-bottom: none; }
.tl-ico { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; font-size: 16px; background: var(--glass); border: 1px solid var(--line); flex-shrink: 0; }
.tl-body { flex: 1; min-width: 0; }
.tl-title { font-weight: 600; font-size: 14px; }
.tl-sub { color: var(--mute); font-size: 12px; margin-top: 3px; }
.tl-amt { font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tl-unread { width: 8px; height: 8px; border-radius: 50%; background: var(--brand); flex-shrink: 0; align-self: center; }

/* Segmented control */
.seg { display: inline-flex; background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; padding: 3px; }
.seg button { padding: 7px 16px; border-radius: 8px; font-size: 12px; font-weight: 700; color: var(--mute); background: transparent; border: none; cursor: pointer; }
.seg button.active { background: var(--brand); color: #fff; }

/* KYC steps */
.kyc-banner { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-radius: var(--radius-lg); margin-bottom: 20px; }
.kyc-banner.pending { background: rgba(251,191,36,0.1); border: 1px solid rgba(251,191,36,0.25); }
.kyc-banner.verified { background: rgba(52,211,153,0.1); border: 1px solid rgba(52,211,153,0.25); }
.kyc-banner.rejected, .kyc-banner.unverified { background: rgba(248,113,113,0.08); border: 1px solid rgba(248,113,113,0.2); }

.empty-state { text-align: center; padding: 40px 20px; color: var(--mute); }
.empty-state .es-ico { font-size: 34px; opacity: 0.5; margin-bottom: 10px; }
.helper-note { font-size: 12px; color: var(--mute); margin-top: 10px; line-height: 1.5; }

/* ═══════════════════════════════════════════════════════════
   AUTH v20 — sign-in / sign-up split layout
   ═══════════════════════════════════════════════════════════ */
body.auth-page {
  min-height: 100vh;
  background:
    radial-gradient(ellipse 70% 50% at 12% -5%, rgba(38,166,154,0.10), transparent 60%),
    radial-gradient(ellipse 60% 50% at 100% 0%, rgba(38,166,154,0.06), transparent 55%),
    var(--bg);
}
.auth-layout { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; }
.auth-side {
  padding: 56px 48px; display: flex; flex-direction: column; justify-content: center; gap: 28px;
  border-right: 1px solid var(--line);
  background: linear-gradient(165deg, rgba(38,166,154,0.08), transparent 55%);
}
.auth-side-brand { display: flex; align-items: center; gap: 12px; font-size: 22px; font-weight: 800; }
.auth-side h2 { font-size: 34px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.15; max-width: 420px; }
.auth-side p { color: var(--mute); font-size: 15px; line-height: 1.6; max-width: 420px; }
.auth-feats { display: grid; gap: 14px; margin-top: 8px; max-width: 420px; }
.auth-feat { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; background: var(--glass); border: 1px solid var(--line); }
.auth-feat .af-ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: rgba(38,166,154,0.14); font-size: 16px; flex-shrink: 0; }
.auth-feat .af-t { font-weight: 700; font-size: 13px; }
.auth-feat .af-s { color: var(--mute); font-size: 12px; margin-top: 2px; }
.auth-main { display: grid; place-items: center; padding: 40px 24px; }
.auth-card-v20 {
  width: 100%; max-width: 420px; background: var(--panel); border: 1px solid var(--line2);
  border-radius: 22px; padding: 36px 34px; box-shadow: var(--shadow);
}
.auth-card-v20 .ac-top { margin-bottom: 24px; }
.auth-card-v20 h1 { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 6px; }
.auth-card-v20 .ac-sub { color: var(--mute); font-size: 14px; margin-bottom: 0; }
.auth-alert {
  color: var(--warn); font-size: 13px; margin-bottom: 16px; padding: 11px 13px;
  background: rgba(251,191,36,0.1); border-radius: 10px; border: 1px solid rgba(251,191,36,0.22);
}
.auth-alert.err { color: var(--bad); background: rgba(248,113,113,0.1); border-color: rgba(248,113,113,0.22); }
.auth-foot { margin-top: 22px; font-size: 13px; text-align: center; color: var(--mute); }
.auth-foot a { font-weight: 600; }
.auth-mini { margin-top: 14px; font-size: 11px; color: var(--mute); text-align: center; line-height: 1.5; }
.pw-toggle {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  background: none; border: none; color: var(--mute); cursor: pointer;
  font-size: 12px; padding: 4px 6px;
}
.pw-toggle:hover { color: var(--brand); }
@media (max-width: 920px) {
  .auth-layout { grid-template-columns: 1fr; }
  .auth-side { display: none; }
}

/* Avatar upload */
.id-avatar-wrap { position: relative; flex-shrink: 0; }
.id-avatar, .shell-avatar, .pro-avatar { overflow: hidden; }
.id-avatar.has-img, .shell-avatar.has-img, .pro-avatar.has-img { padding: 0; background: var(--panel2); }
.id-avatar img, .shell-avatar img, .pro-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.id-avatar-btn {
  position: absolute; inset: 0; border-radius: inherit; border: none; background: rgba(0,0,0,0.45);
  color: #fff; font-size: 11px; font-weight: 700; opacity: 0; cursor: pointer; transition: opacity var(--transition);
  display: grid; place-items: center;
}
.id-avatar-wrap:hover .id-avatar-btn, .id-avatar-wrap:focus-within .id-avatar-btn { opacity: 1; }

/* File drop zone */
.file-drop {
  border: 1px dashed var(--line2); border-radius: 14px; padding: 28px 20px; text-align: center;
  background: var(--bg2); cursor: pointer; transition: all var(--transition);
}
.file-drop:hover, .file-drop.drag { border-color: var(--brand); background: rgba(38,166,154,0.06); }
.file-drop .fd-ico { font-size: 28px; opacity: 0.6; margin-bottom: 8px; }
.file-drop .fd-t { font-weight: 700; font-size: 13px; }
.file-drop .fd-s { color: var(--mute); font-size: 12px; margin-top: 4px; }
.file-drop .fd-name { margin-top: 10px; font-size: 12px; color: var(--brand); font-weight: 600; word-break: break-all; }
.file-drop input[type=file] { display: none; }

/* ═══════════════════════════════════════════════════════════
   ADMIN v20
   ═══════════════════════════════════════════════════════════ */
body.admin-page {
  background:
    radial-gradient(ellipse 70% 50% at 12% -5%, rgba(38,166,154,0.10), transparent 60%),
    radial-gradient(ellipse 60% 50% at 100% 0%, rgba(38,166,154,0.06), transparent 55%),
    var(--bg);
  min-height: 100vh;
}
.admin-shell {
  display: flex; align-items: center; gap: 14px; padding: 14px 24px;
  background: rgba(12,12,12,0.82); backdrop-filter: blur(20px); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 100; flex-wrap: wrap;
}
html[data-theme="light"] .admin-shell { background: rgba(255,255,255,0.85); }
.admin-shell-brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 16px; text-decoration: none; color: inherit; }
.admin-shell-tag { font-size: 11px; color: var(--mute); padding: 4px 10px; border-radius: 99px; border: 1px solid var(--line); background: var(--glass); }
.admin-shell-end { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.admin-wrap-v20 { max-width: 1280px; margin: 0 auto; padding: 28px 24px 48px; }
.admin-layout { display: flex; min-height: calc(100vh - 56px); }
.admin-sidebar {
  width: 220px; flex-shrink: 0; border-right: 1px solid var(--line);
  background: var(--glass); padding: 16px 10px; position: sticky; top: 56px; height: calc(100vh - 56px); overflow-y: auto;
}
.admin-main { flex: 1; min-width: 0; padding: 20px 24px 48px; }
.admin-main-head { margin-bottom: 20px; }
.admin-main-head h1 { margin: 0 0 6px; font-size: 22px; }
.admin-main-head p { margin: 0; color: var(--mute); font-size: 13px; max-width: 640px; }
.admin-nav { display: flex; flex-direction: column; gap: 2px; }
.admin-nav-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--mute); padding: 14px 10px 6px; font-weight: 700; }
.admin-nav button {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  width: 100%; text-align: left; padding: 10px 12px; border: none; border-radius: 10px;
  background: transparent; color: var(--ink2); font-size: 13px; font-weight: 500; cursor: pointer;
}
.admin-nav button:hover { background: rgba(255,255,255,0.04); }
.admin-nav button.active { background: rgba(99,102,241,0.15); color: var(--brand); font-weight: 600; }
.nav-badge { font-style: normal; font-size: 11px; font-weight: 700; background: var(--brand); color: #fff; padding: 2px 7px; border-radius: 99px; min-width: 20px; text-align: center; }
.nav-badge.hidden { display: none; }
.admin-menu-btn { display: none; }
.kpi-strip { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.kpi-pill { display: flex; gap: 8px; align-items: center; padding: 6px 12px; border-radius: 99px; border: 1px solid var(--line); background: var(--glass); font-size: 12px; }
.kpi-pill span { color: var(--mute); }
.kpi-pill strong { font-weight: 700; }
.queue-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; margin-bottom: 20px; }
.queue-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.qc-type { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--brand); }
.qc-main { font-size: 14px; }
.qc-meta { font-size: 12px; color: var(--mute); word-break: break-word; }
.qc-actions { display: flex; gap: 8px; margin-top: 4px; }
.queue-empty { text-align: center; padding: 48px 20px; color: var(--mute); }
.queue-empty-ico { font-size: 32px; margin-bottom: 8px; opacity: 0.5; }
.admin-charts-fold { margin-top: 8px; padding: 12px 16px; }
.admin-charts-fold summary { cursor: pointer; font-weight: 600; font-size: 13px; color: var(--ink2); }
.admin-charts-fold .admin-charts-row { margin-top: 16px; margin-bottom: 0; padding: 0; border: none; background: none; }
.admin-drawer { position: fixed; inset: 0; z-index: 10001; }
.admin-drawer.hidden { display: none; }
.admin-drawer-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.45); }
.admin-drawer-panel {
  position: absolute; top: 0; right: 0; width: min(420px, 100%); height: 100%;
  background: var(--card); border-left: 1px solid var(--line); display: flex; flex-direction: column;
  box-shadow: -8px 0 32px rgba(0,0,0,0.25);
}
.admin-drawer-head { display: flex; justify-content: space-between; align-items: flex-start; padding: 20px; border-bottom: 1px solid var(--line); }
.admin-drawer-head h3 { margin: 0; font-size: 18px; }
.drawer-sub { margin: 4px 0 0; font-size: 12px; color: var(--mute); }
.admin-drawer-body { padding: 16px 20px 32px; overflow-y: auto; flex: 1; }
.drawer-section { margin-bottom: 24px; }
.drawer-section h4 { margin: 0 0 12px; font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--mute); }
.drawer-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }
.drawer-row .label { min-width: 100px; margin: 0; }
.drawer-actions { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.drawer-grid { gap: 10px; }
.admin-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.admin-form-span { grid-column: 1 / -1; }
.admin-subtabs { margin-bottom: 16px; }
.table-compact td, .table-compact th { padding: 10px 12px; font-size: 13px; }
.cell-sub { font-size: 11px; color: var(--mute); }
@media (max-width: 900px) {
  .admin-menu-btn { display: inline-flex; }
  .admin-sidebar {
    position: fixed; left: 0; top: 56px; z-index: 9998; transform: translateX(-100%);
    transition: transform 0.2s ease; box-shadow: 4px 0 24px rgba(0,0,0,0.2);
  }
  .admin-sidebar.open { transform: translateX(0); }
  .admin-main { padding: 16px; }
  .admin-charts-row { grid-template-columns: 1fr; }
}
.admin-tabs-row .seg button { padding: 8px 18px; }
.admin-table-wrap { overflow-x: auto; margin: 0 -4px; }
.admin-table-wrap .table { min-width: 640px; }
.admin-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.admin-credit { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.admin-credit .field { width: 90px; padding: 6px 8px; font-size: 12px; }
.admin-credit select.field { width: 110px; }
.admin-trade-open { background: var(--glass); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.admin-trade-open h4 { color: var(--ink2); }
.admin-tabs-scroll { overflow-x: auto; max-width: 100%; flex-wrap: nowrap; }
.admin-tabs-scroll button { white-space: nowrap; flex-shrink: 0; }
.admin-charts-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 20px; padding: 16px; }
.admin-chart-panel { min-height: 160px; }
.admin-chart-summary { display: flex; flex-direction: column; justify-content: center; gap: 12px; padding: 8px 12px; }
.chart-title { font-size: 12px; color: var(--mute); margin-bottom: 10px; font-weight: 600; }
.bar-chart { display: flex; align-items: flex-end; gap: 4px; height: 100px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; justify-content: flex-end; }
.bar-fill { width: 100%; max-width: 28px; background: linear-gradient(180deg, var(--brand), rgba(99,102,241,0.4)); border-radius: 4px 4px 0 0; min-height: 4px; }
.bar-lbl { font-size: 9px; color: var(--mute); margin-top: 4px; }
.chart-stat { display: flex; justify-content: space-between; font-size: 13px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.chart-stat:last-child { border-bottom: 0; }
.admin-modal { position: fixed; inset: 0; background: rgba(0,0,0,0.55); display: flex; align-items: center; justify-content: center; z-index: 9999; padding: 20px; }
.admin-modal.hidden { display: none; }
.admin-modal-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 24px; width: 100%; max-width: 420px; max-height: 90vh; overflow-y: auto; }
.admin-modal-card h3 { margin: 0 0 16px; font-size: 18px; }
.admin-modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }
.admin-check-row { display: flex; align-items: center; gap: 8px; font-size: 13px; margin: 8px 0; }
.admin-security-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.row-muted { opacity: 0.65; }
.payment-wallet-list { display: grid; gap: 10px; }
.payment-wallet-row {
  display: grid;
  grid-template-columns: 140px 1fr auto;
  gap: 10px;
  align-items: end;
}
.payment-wallet-row .pw-remove { margin-bottom: 6px; }
@media (max-width: 700px) {
  .payment-wallet-row { grid-template-columns: 1fr; }
}
.impersonate-bar {
  position: sticky; top: 0; z-index: 10000;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 10px 16px; background: rgba(234, 179, 8, 0.15); border-bottom: 1px solid rgba(234, 179, 8, 0.35);
  font-size: 13px;
}
.impersonate-bar strong { color: var(--ink); }
@media (max-width: 900px) {
  .admin-charts-row { grid-template-columns: 1fr; }
}
.kyc-view-link { font-size: 12px; font-weight: 700; color: var(--brand); text-decoration: none; }
.kyc-view-link:hover { text-decoration: underline; }
