/* ---------- design tokens ---------- */
:root {
  --bg: #07090c;
  --bg-elev: #0c1015;
  --panel: #0f141b;
  --panel-2: #131923;
  --border: #1a2230;
  --border-2: #232d3f;
  --text: #e7ecf2;
  --muted: #6b7689;
  --muted-2: #98a3b5;
  --accent: #5b8def;
  --accent-2: #7aa0ff;
  --success: #1fcf86;
  --success-2: #00ffa3;
  --danger: #ff5d5d;
  --warning: #ffb547;
  --violet: #b388ff;

  --radius: 12px;
  --radius-lg: 16px;
  --radius-sm: 8px;

  --shadow-1: 0 1px 0 rgba(255,255,255,0.04) inset, 0 1px 2px rgba(0,0,0,0.4);
  --shadow-glow-accent: 0 0 0 1px rgba(91,141,239,0.5), 0 8px 32px -8px rgba(91,141,239,0.6);
  --shadow-glow-success: 0 0 0 1px rgba(31,207,134,0.45), 0 8px 32px -8px rgba(31,207,134,0.55);
  --shadow-glow-danger: 0 0 0 1px rgba(255,93,93,0.4), 0 8px 32px -8px rgba(255,93,93,0.5);

  --font-sans: "Geist", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "JetBrains Mono", monospace;
}

* { box-sizing: border-box; }
html, body, #root { height: 100%; }
body {
  margin: 0;
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(91,141,239,0.06), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(31,207,134,0.04), transparent 60%),
    var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-feature-settings: "ss01", "ss02", "cv11";
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.01em;
  overflow-x: hidden;
}

.mono { font-family: var(--font-mono); font-feature-settings: "tnum", "zero"; }
.tabular { font-variant-numeric: tabular-nums; }

button { font-family: inherit; cursor: pointer; border: 0; background: transparent; color: inherit; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-2); }

/* ---------- layout ---------- */
.app {
  display: grid;
  grid-template-columns: 248px 1fr;
  min-height: 100vh;
}

.sidebar {
  position: sticky; top: 0;
  height: 100vh;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.02), transparent 60%),
    var(--bg-elev);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  padding: 18px 14px;
  gap: 14px;
  z-index: 5;
}

.brand {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 8px 14px;
  border-bottom: 1px solid var(--border);
}
.brand-mark {
  width: 32px; height: 32px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent) 0%, #00ffa3 100%);
  position: relative;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.06), 0 0 24px -6px rgba(91,141,239,0.7);
  overflow: hidden;
}
.brand-mark::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.4), transparent 50%);
}
.brand-mark svg { position: absolute; inset: 0; margin: auto; width: 18px; height: 18px; color: #0b0e12; }
.brand-name { font-size: 16px; font-weight: 600; letter-spacing: -0.02em; }
.brand-sub  { font-size: 11px; color: var(--muted); margin-top: -2px; }

.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-section { font-size: 10px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); padding: 14px 10px 6px; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px;
  border-radius: 9px;
  color: var(--muted-2);
  font-size: 13.5px;
  font-weight: 500;
  position: relative;
  transition: background .15s, color .15s;
}
.nav-item:hover { background: rgba(255,255,255,0.03); color: var(--text); }
.nav-item.active {
  background: linear-gradient(180deg, rgba(91,141,239,0.14), rgba(91,141,239,0.06));
  color: var(--text);
  box-shadow: inset 0 0 0 1px rgba(91,141,239,0.25);
}
.nav-item.active::before {
  content: ""; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 2px;
  background: var(--accent); border-radius: 2px;
  box-shadow: 0 0 12px var(--accent);
}
.nav-item .nav-icon { width: 16px; height: 16px; flex: 0 0 16px; opacity: 0.9; }
.nav-item .nav-count { margin-left: auto; font-size: 11px; color: var(--muted); background: rgba(255,255,255,0.05); padding: 1px 6px; border-radius: 999px; }
.nav-item.active .nav-count { background: rgba(91,141,239,0.2); color: var(--accent-2); }

.bot-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  background: linear-gradient(180deg, rgba(255,255,255,0.02), transparent);
}
.bot-panel .row { display: flex; justify-content: space-between; align-items: center; }
.bot-panel .status {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 600;
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); position: relative; }
.dot.live { background: var(--success); box-shadow: 0 0 0 0 var(--success); animation: pulse 1.8s infinite; }
.dot.paused { background: var(--warning); }
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(31,207,134,0.7); }
  70%  { box-shadow: 0 0 0 10px rgba(31,207,134,0); }
  100% { box-shadow: 0 0 0 0 rgba(31,207,134,0); }
}
.bot-panel .meta { font-size: 11px; color: var(--muted); margin-top: 6px; }
.bot-panel .uptime { font-family: var(--font-mono); font-size: 11px; color: var(--muted-2); }

.user-pill {
  display: flex; align-items: center; gap: 10px;
  padding: 8px;
  border-radius: 10px;
  background: rgba(255,255,255,0.02);
}
.avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: linear-gradient(135deg, #b388ff 0%, #5b8def 100%);
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 11px; font-weight: 600;
}
.user-pill .who { font-size: 12.5px; font-weight: 500; }
.user-pill .role { font-size: 10.5px; color: var(--muted); }
.user-pill .logout {
  margin-left: auto;
  color: var(--muted);
  padding: 4px;
  border-radius: 6px;
}
.user-pill .logout:hover { color: var(--text); background: rgba(255,255,255,0.04); }

/* ---------- main ---------- */
.main {
  display: flex; flex-direction: column;
  min-width: 0;
}

.topbar {
  position: sticky; top: 0; z-index: 4;
  display: flex; align-items: center; gap: 12px;
  padding: 14px 28px;
  border-bottom: 1px solid var(--border);
  background: rgba(7,9,12,0.7);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.topbar h1 { font-size: 18px; font-weight: 600; margin: 0; letter-spacing: -0.02em; }
.crumb-sub { font-size: 12px; color: var(--muted); margin-left: 8px; }
.spacer { flex: 1; }
.search {
  display: flex; align-items: center; gap: 8px;
  width: 280px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 7px 10px;
  font-size: 13px;
  color: var(--muted-2);
}
.search input { border: 0; background: transparent; color: var(--text); outline: none; flex: 1; font-size: 13px; }
.search .kbd { font-family: var(--font-mono); font-size: 10.5px; background: rgba(255,255,255,0.05); padding: 1px 6px; border-radius: 5px; color: var(--muted); border: 1px solid var(--border); }

.mode-switch {
  display: inline-flex;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 3px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.05em;
}
.mode-switch button {
  padding: 6px 11px;
  border-radius: 7px;
  color: var(--muted-2);
  transition: all .15s;
}
.mode-switch button:hover { color: var(--text); }
.mode-switch button.active.dry      { background: rgba(255,181,71,0.14); color: var(--warning); box-shadow: inset 0 0 0 1px rgba(255,181,71,0.3); }
.mode-switch button.active.paper    { background: rgba(91,141,239,0.16); color: var(--accent-2); box-shadow: inset 0 0 0 1px rgba(91,141,239,0.35); }
.mode-switch button.active.live     { background: rgba(255,93,93,0.16);  color: var(--danger);   box-shadow: inset 0 0 0 1px rgba(255,93,93,0.35); }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 13px; font-weight: 600;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  transition: all .15s;
}
.btn:hover { border-color: var(--border-2); background: var(--panel-2); }
.btn.primary { background: linear-gradient(180deg, #6b9cff, #5b8def); color: white; border-color: transparent; box-shadow: 0 0 0 1px rgba(91,141,239,0.5), 0 6px 24px -8px rgba(91,141,239,0.7); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.success { background: linear-gradient(180deg, #25e094, #1fcf86); color: #002616; border-color: transparent; box-shadow: var(--shadow-glow-success); }
.btn.success:hover { filter: brightness(1.05); }
.btn.danger  { background: linear-gradient(180deg, #ff7575, #ff5d5d); color: #2b0000; border-color: transparent; box-shadow: var(--shadow-glow-danger); }
.btn.danger:hover { filter: brightness(1.05); }
.btn.ghost { background: transparent; }
.btn.sm { padding: 5px 10px; font-size: 12px; }
.btn.icon-only { padding: 8px; }

/* ---------- content ---------- */
.content { padding: 24px 28px 64px; display: flex; flex-direction: column; gap: 20px; }

.section-title { font-size: 13px; font-weight: 600; color: var(--muted-2); letter-spacing: 0.02em; display: flex; align-items: center; gap: 10px; margin: 0; }
.section-title .count { font-size: 11px; color: var(--muted); background: rgba(255,255,255,0.04); padding: 2px 8px; border-radius: 999px; font-weight: 500; }

.card {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.015), transparent 40%),
    var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  position: relative;
}
.card-pad { padding: 18px; }

/* KPI grid */
.kpi-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
@media (max-width: 1280px) { .kpi-row { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 820px)  { .kpi-row { grid-template-columns: repeat(2, 1fr); } }

.kpi {
  position: relative;
  padding: 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.015), transparent 50%),
    var(--panel);
  overflow: hidden;
}
.kpi .label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); display:flex; gap:6px; align-items:center; }
.kpi .label .tag { padding: 1px 6px; font-size: 9.5px; background: rgba(91,141,239,0.12); color: var(--accent-2); border-radius: 999px; text-transform: none; letter-spacing: 0; }
.kpi .value { font-family: var(--font-mono); font-size: 24px; font-weight: 600; margin-top: 6px; letter-spacing: -0.02em; }
.kpi .delta { font-size: 11px; margin-top: 4px; display: inline-flex; align-items: center; gap: 4px; font-family: var(--font-mono); }
.kpi .delta.pos { color: var(--success-2); }
.kpi .delta.neg { color: var(--danger); }
.kpi .spark { position: absolute; right: 12px; bottom: 12px; opacity: 0.85; pointer-events:none; }
.kpi.featured {
  background:
    radial-gradient(80% 120% at 100% 0%, rgba(31,207,134,0.10), transparent 60%),
    linear-gradient(180deg, rgba(31,207,134,0.06), transparent 50%),
    var(--panel);
  border-color: rgba(31,207,134,0.25);
}
.kpi.featured .value { color: var(--success-2); }

/* Equity + Activity row */
.two-col { display: grid; grid-template-columns: 1.6fr 1fr; gap: 12px; }
@media (max-width: 1100px) { .two-col { grid-template-columns: 1fr; } }

.chart-card .head, .table-card .head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px 8px;
}
.chart-card .head h3, .table-card .head h3 { margin:0; font-size: 14px; font-weight: 600; letter-spacing: -0.01em; }
.chart-card .head .meta { font-size: 11.5px; color: var(--muted); display: flex; gap: 12px; }
.range-tabs { display: inline-flex; gap: 2px; background: rgba(255,255,255,0.03); border: 1px solid var(--border); border-radius: 8px; padding: 2px; }
.range-tabs button { padding: 4px 8px; font-size: 11px; color: var(--muted-2); border-radius: 6px; font-weight: 500; }
.range-tabs button.active { background: rgba(91,141,239,0.18); color: var(--accent-2); }

.chart-area { padding: 0 8px 18px; }

.activity {
  display: flex; flex-direction: column;
  min-height: 0;
  max-height: 420px;
}
.activity-list {
  flex: 1;
  overflow-y: auto;
  padding: 4px 8px 12px;
  display: flex; flex-direction: column; gap: 2px;
  scrollbar-width: thin; scrollbar-color: var(--border-2) transparent;
}
.activity-list::-webkit-scrollbar { width: 8px; }
.activity-list::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 4px; }
.activity-item {
  display: grid; grid-template-columns: 28px 1fr auto; gap: 10px;
  align-items: start;
  padding: 9px 10px;
  border-radius: 9px;
  font-size: 12.5px;
  transition: background .15s;
  animation: slidein 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.activity-item:hover { background: rgba(255,255,255,0.03); }
.activity-item .ico {
  width: 24px; height: 24px; border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
}
.activity-item .ico.success { background: rgba(31,207,134,0.12); border-color: rgba(31,207,134,0.3); color: var(--success-2); }
.activity-item .ico.danger  { background: rgba(255,93,93,0.12);  border-color: rgba(255,93,93,0.3);  color: var(--danger); }
.activity-item .ico.warning { background: rgba(255,181,71,0.12); border-color: rgba(255,181,71,0.3); color: var(--warning); }
.activity-item .ico.accent  { background: rgba(91,141,239,0.12); border-color: rgba(91,141,239,0.3); color: var(--accent-2); }
.activity-item .body .title { color: var(--text); font-weight: 500; }
.activity-item .body .sub   { color: var(--muted); font-size: 11.5px; margin-top: 1px; }
.activity-item .time { font-family: var(--font-mono); font-size: 10.5px; color: var(--muted); }

@keyframes slidein {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Tables / list */
.market-row, .position-row {
  display: grid; align-items: center;
  padding: 12px 18px;
  border-top: 1px solid var(--border);
  cursor: pointer;
  transition: background .15s;
  position: relative;
}
.market-row:hover, .position-row:hover { background: rgba(91,141,239,0.04); }
.market-row::after, .position-row::after {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 2px;
  background: var(--accent); transform: scaleY(0); transform-origin: center;
  transition: transform .15s;
}
.market-row:hover::after, .position-row:hover::after { transform: scaleY(1); }

.position-row { grid-template-columns: minmax(0, 2.3fr) 110px 110px 130px 130px 100px 36px; gap: 14px; }
.market-cell { display: flex; align-items: center; gap: 12px; min-width: 0; }
.market-thumb {
  width: 36px; height: 36px; border-radius: 9px; flex: 0 0 36px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 700;
  background: var(--panel-2);
  border: 1px solid var(--border-2);
  color: var(--muted-2);
  position: relative; overflow: hidden;
}
.market-info { min-width: 0; }
.market-title {
  font-size: 13.5px; font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 100%;
}
.market-meta { font-size: 11.5px; color: var(--muted); margin-top: 2px; display: flex; gap: 8px; align-items: center; }

.side-pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px; font-weight: 600;
  font-family: var(--font-mono);
}
.side-pill.yes { background: rgba(31,207,134,0.14); color: var(--success-2); }
.side-pill.no  { background: rgba(255,93,93,0.14); color: var(--danger); }
.side-pill.buy { background: rgba(91,141,239,0.16); color: var(--accent-2); }
.side-pill.sell{ background: rgba(255,181,71,0.16); color: var(--warning); }

.status-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px; font-weight: 600;
  background: rgba(255,255,255,0.04);
}
.status-pill.open    { background: rgba(91,141,239,0.14);  color: var(--accent-2); }
.status-pill.win     { background: rgba(31,207,134,0.14);  color: var(--success-2); }
.status-pill.loss    { background: rgba(255,93,93,0.14);   color: var(--danger); }
.status-pill.skipped { background: rgba(255,181,71,0.14);  color: var(--warning); }
.status-pill.failed  { background: rgba(255,93,93,0.14);   color: var(--danger); }
.status-pill.pending { background: rgba(255,255,255,0.06); color: var(--muted-2); }

.row-mono { font-family: var(--font-mono); font-size: 12.5px; }
.pnl-pos { color: var(--success-2); }
.pnl-neg { color: var(--danger); }

.col-head {
  display: grid; align-items: center;
  padding: 8px 18px;
  font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--muted); font-weight: 600;
  border-top: 1px solid var(--border);
}

/* Probability bar */
.probbar {
  display: flex; align-items: center; gap: 6px;
  font-family: var(--font-mono); font-size: 12px;
}
.probbar-track {
  position: relative; flex: 1;
  height: 6px;
  border-radius: 999px;
  background: rgba(255,93,93,0.18);
  overflow: hidden;
}
.probbar-fill {
  position: absolute; left: 0; top: 0; bottom: 0;
  background: linear-gradient(90deg, #1fcf86, #00ffa3);
  border-radius: 999px;
}

/* Whale chips */
.whale-chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 3px 8px 3px 4px;
  border-radius: 999px;
  background: rgba(255,255,255,0.04);
  font-size: 11.5px;
}
.whale-chip .pp {
  width: 18px; height: 18px; border-radius: 50%; flex: 0 0 18px;
  font-size: 9px; font-weight: 700; color: white;
  display: flex; align-items: center; justify-content: center;
}

/* ---------- drawer ---------- */
.drawer-backdrop {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  animation: fade-in 0.25s ease;
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

.drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: min(620px, 92vw);
  background: var(--bg-elev);
  border-left: 1px solid var(--border);
  z-index: 51;
  display: flex; flex-direction: column;
  animation: slide-in 0.32s cubic-bezier(0.2, 0.8, 0.2, 1);
  box-shadow: -32px 0 80px -20px rgba(0,0,0,0.6);
}
@keyframes slide-in {
  from { transform: translateX(100%); }
  to   { transform: translateX(0); }
}

.drawer-head {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: flex-start; gap: 14px;
}
.drawer-head .market-thumb { width: 48px; height: 48px; font-size: 20px; flex: 0 0 48px; }
.drawer-head h2 { font-size: 18px; font-weight: 600; margin: 0; letter-spacing: -0.02em; line-height: 1.3; }
.drawer-head .sub { font-size: 11.5px; color: var(--muted); margin-top: 4px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.drawer-close {
  margin-left: auto; padding: 6px; border-radius: 8px; color: var(--muted);
}
.drawer-close:hover { color: var(--text); background: rgba(255,255,255,0.05); }

.drawer-body { flex: 1; overflow-y: auto; padding: 18px 22px 28px; display: flex; flex-direction: column; gap: 18px; }
.drawer-body::-webkit-scrollbar { width: 8px; }
.drawer-body::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 4px; }

.dwr-stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.dwr-stat {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
}
.dwr-stat .l { font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.dwr-stat .v { font-family: var(--font-mono); font-size: 16px; margin-top: 3px; font-weight: 600; }

.dwr-section { display: flex; flex-direction: column; gap: 10px; }
.dwr-section h4 { font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin: 0; font-weight: 600; }

.dwr-actions { display: flex; gap: 8px; padding-top: 4px; }

.whale-line {
  display: grid;
  grid-template-columns: 28px 1fr auto auto;
  gap: 10px; align-items: center;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  font-size: 12px;
}

/* ---------- toasts ---------- */
.toasts {
  position: fixed; bottom: 22px; right: 22px;
  display: flex; flex-direction: column-reverse; gap: 10px;
  z-index: 100;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  min-width: 320px;
  max-width: 380px;
  display: grid; grid-template-columns: 32px 1fr auto; gap: 10px; align-items: start;
  padding: 12px 14px;
  background: linear-gradient(180deg, rgba(255,255,255,0.025), transparent 50%), var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 12px 40px -10px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.02);
  position: relative;
  overflow: hidden;
  animation: toast-in 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.toast.exit { animation: toast-out 0.3s cubic-bezier(0.4, 0, 1, 1) forwards; }
@keyframes toast-in {
  from { transform: translateX(110%); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}
@keyframes toast-out {
  to { transform: translateX(110%); opacity: 0; }
}
.toast .ico {
  width: 28px; height: 28px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
}
.toast.success .ico { background: rgba(31,207,134,0.16); color: var(--success-2); border: 1px solid rgba(31,207,134,0.35); }
.toast.danger  .ico { background: rgba(255,93,93,0.16);  color: var(--danger);     border: 1px solid rgba(255,93,93,0.35); }
.toast.warning .ico { background: rgba(255,181,71,0.16); color: var(--warning);    border: 1px solid rgba(255,181,71,0.35); }
.toast.info    .ico { background: rgba(91,141,239,0.16); color: var(--accent-2);   border: 1px solid rgba(91,141,239,0.35); }
.toast .title { font-size: 13px; font-weight: 600; }
.toast .sub   { font-size: 12px; color: var(--muted-2); margin-top: 2px; line-height: 1.45; }
.toast .x     { padding: 4px; border-radius: 6px; color: var(--muted); }
.toast .x:hover { color: var(--text); background: rgba(255,255,255,0.05); }
.toast .progress {
  position: absolute; left: 0; bottom: 0; height: 2px; background: currentColor; opacity: 0.5;
  animation: toast-progress 5s linear forwards;
}
@keyframes toast-progress { from { width: 100%; } to { width: 0%; } }
.toast.success .progress { color: var(--success-2); }
.toast.danger  .progress { color: var(--danger); }
.toast.warning .progress { color: var(--warning); }
.toast.info    .progress { color: var(--accent-2); }

/* ---------- modal (confirmations) ---------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  animation: fade-in 0.2s ease;
}
.modal {
  width: 440px; max-width: 92vw;
  background: var(--bg-elev);
  border: 1px solid var(--border-2);
  border-radius: 14px;
  padding: 22px;
  animation: modal-in 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
}
@keyframes modal-in {
  from { opacity: 0; transform: scale(0.95) translateY(8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.modal h3 { margin: 0 0 6px; font-size: 16px; font-weight: 600; }
.modal .body { font-size: 13.5px; color: var(--muted-2); line-height: 1.55; }
.modal .actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; }

/* ---------- big toggle ---------- */
.bot-toggle {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 7px 7px 7px 14px;
  border-radius: 12px;
  background: var(--panel);
  border: 1px solid var(--border);
  font-size: 12.5px; font-weight: 600;
  color: var(--muted-2);
}
.bot-toggle .switch {
  width: 40px; height: 22px; border-radius: 999px;
  background: var(--border);
  position: relative; transition: background .2s;
}
.bot-toggle .switch::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 18px; height: 18px; border-radius: 50%;
  background: white; transition: transform .2s;
}
.bot-toggle.on { color: var(--success-2); border-color: rgba(31,207,134,0.4); background: rgba(31,207,134,0.08); }
.bot-toggle.on .switch { background: linear-gradient(180deg, #25e094, #1fcf86); box-shadow: 0 0 14px rgba(31,207,134,0.5); }
.bot-toggle.on .switch::after { transform: translateX(18px); }

.live-dot {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; color: var(--muted);
  font-family: var(--font-mono);
  letter-spacing: 0.05em;
}

/* ---------- whales table ---------- */
.whales-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
}
@media (max-width: 1100px) { .whales-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 700px)  { .whales-grid { grid-template-columns: 1fr; } }
.whale-card {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel);
  display: flex; flex-direction: column; gap: 10px;
  position: relative;
  transition: border-color .15s;
}
.whale-card:hover { border-color: var(--border-2); }
.whale-card .top { display: flex; align-items: center; gap: 10px; }
.whale-card .pp { width: 32px; height: 32px; border-radius: 9px; font-size: 12px; font-weight: 700; color: white; display: flex; align-items: center; justify-content: center; }
.whale-card .stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.whale-card .stat { background: rgba(255,255,255,0.02); border-radius: 8px; padding: 7px 9px; }
.whale-card .stat .l { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
.whale-card .stat .v { font-family: var(--font-mono); font-size: 13.5px; font-weight: 600; margin-top: 2px; }

/* utility */
.divider { height: 1px; background: var(--border); }
.flex { display: flex; }
.row { display: flex; align-items: center; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.muted { color: var(--muted); }
.muted-2 { color: var(--muted-2); }
.text-sm { font-size: 12.5px; }
.text-xs { font-size: 11.5px; }
.uppercase { text-transform: uppercase; letter-spacing: 0.08em; font-size: 10.5px; }

/* ---------- PolyScalp-specific additions ---------- */

/* Login screen */
.login-wrap {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.login-card {
  width: 360px; max-width: 100%;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  box-shadow: 0 24px 60px -20px rgba(0,0,0,0.5);
}
.login-card h1 { margin: 0 0 4px; font-size: 18px; font-weight: 600; letter-spacing: -0.02em; display:flex; align-items:center; gap:10px; }
.login-card p  { margin: 0 0 18px; font-size: 12.5px; color: var(--muted); }
.login-card input[type="password"] {
  width: 100%;
  background: var(--panel); border: 1px solid var(--border);
  color: var(--text); padding: 10px 12px; border-radius: 10px;
  font-size: 13px; font-family: var(--font-mono);
  outline: none; transition: border-color .15s;
}
.login-card input[type="password"]:focus { border-color: var(--accent); }
.login-card .err {
  margin-top: 10px; font-size: 12px; color: var(--danger);
  background: rgba(255,93,93,0.08); border: 1px solid rgba(255,93,93,0.25);
  border-radius: 8px; padding: 6px 10px;
}

/* Market card grid (Markets page) */
.market-card {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel);
  display: flex; flex-direction: column; gap: 10px;
  position: relative; cursor: pointer;
  transition: border-color .15s, transform .15s;
}
.market-card:hover { border-color: var(--border-2); transform: translateY(-1px); }
.market-card .head { display: flex; align-items: center; gap: 10px; }
.market-card .ttr {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted-2);
  background: rgba(255,255,255,0.04);
  padding: 2px 8px;
  border-radius: 999px;
}
.market-card .ttr.urgent { color: var(--warning); background: rgba(255,181,71,0.12); }
.market-card .stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.market-card .stat { background: rgba(255,255,255,0.02); border-radius: 8px; padding: 7px 9px; }
.market-card .stat .l { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
.market-card .stat .v { font-family: var(--font-mono); font-size: 13.5px; font-weight: 600; margin-top: 2px; }

/* Brain page */
.brain-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (max-width: 1100px) { .brain-grid { grid-template-columns: 1fr; } }
.brain-card { padding: 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--panel); }
.brain-card h4 { margin: 0 0 10px; font-size: 13px; font-weight: 600; letter-spacing: -0.01em; display: flex; align-items: center; gap: 8px; }
.brain-card h4 .tag { font-size: 10px; font-weight: 500; color: var(--muted); background: rgba(255,255,255,0.05); padding: 2px 7px; border-radius: 999px; text-transform: uppercase; letter-spacing: 0.06em; }
.brain-card h4 .tag.frozen { color: var(--warning); background: rgba(255,181,71,0.12); }
.brain-row { display: flex; justify-content: space-between; font-size: 12.5px; padding: 6px 0; border-top: 1px solid var(--border); }
.brain-row:first-of-type { border-top: 0; }
.brain-row .k { color: var(--muted-2); }
.brain-row .v { font-family: var(--font-mono); font-weight: 600; }
.brain-row .v.pos { color: var(--success-2); }
.brain-row .v.neg { color: var(--danger); }

.bandit-table { width: 100%; border-collapse: collapse; font-family: var(--font-mono); font-size: 12px; }
.bandit-table th { color: var(--muted); font-weight: 500; text-align: right; padding: 6px 8px; font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.08em; border-bottom: 1px solid var(--border); }
.bandit-table th:first-child { text-align: left; }
.bandit-table td { padding: 6px 8px; text-align: right; border-bottom: 1px solid var(--border); }
.bandit-table td:first-child { text-align: left; color: var(--muted-2); }
.bandit-table td.best { color: var(--success-2); font-weight: 600; }

.regime-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em;
}
.regime-pill.calm     { background: rgba(31,207,134,0.12); color: var(--success-2); }
.regime-pill.normal   { background: rgba(91,141,239,0.12); color: var(--accent-2); }
.regime-pill.volatile { background: rgba(255,93,93,0.12);  color: var(--danger); }

/* Settings page form rows */
.settings-form { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
@media (max-width: 900px) { .settings-form { grid-template-columns: 1fr; } }
.field {
  background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px;
}
.field label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); }
.field input {
  margin-top: 6px; width: 100%; background: var(--panel-2); border: 1px solid var(--border);
  color: var(--text); padding: 7px 10px; border-radius: 8px; font-size: 13px;
  font-family: var(--font-mono); outline: none;
}
.field input:focus { border-color: var(--accent); }
.field .hint { font-size: 11px; color: var(--muted); margin-top: 4px; }

/* Empty states */
.empty-state {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 40px 20px; color: var(--muted); text-align: center;
}
.empty-state .ico-wrap {
  width: 48px; height: 48px; border-radius: 12px;
  background: rgba(255,255,255,0.03); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center; color: var(--muted-2);
}
.empty-state .title { font-size: 14px; font-weight: 500; color: var(--muted-2); }
.empty-state .sub   { font-size: 12.5px; }
