/* ============================================================================
 * tradeStack — EMA Gate bot pages
 * ========================================================================= */

/* ── Clock strip (replaces old hero) ──────────────────────────────────── */
.eg-clockbar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  margin: -4px 0 14px;
  color: var(--text-tertiary);
  font-family: var(--font-mono);
  font-size: 12px;
}
.eg-clock-sep { opacity: 0.5; }
.eg-account-select {
  background: var(--bg-card, #1e1e2e);
  color: var(--text-primary, #c6d0f5);
  border: 1px solid var(--border-default, #363a4f);
  border-radius: 6px;
  padding: 2px 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  cursor: pointer;
}
.eg-account-select:focus { outline: 2px solid var(--accent-primary, #7c3aed); outline-offset: 1px; }
.eg-countdown {
  color: var(--accent-secondary);
  font-variant-numeric: tabular-nums;
  min-width: 36px;
  text-align: right;
}

/* ── Panels stack with consistent gap ─────────────────────────────────── */
.eg-panel { margin-bottom: 14px; }

/* ── Range-selector header ────────────────────────────────────────────── */
.eg-range-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.eg-range-select {
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 4px 8px;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 400;
  cursor: pointer;
}
.eg-range-select:hover { border-color: var(--border-strong); }
.eg-range-select:focus { outline: none; border-color: var(--accent); }

/* ── Chart mount points ───────────────────────────────────────────────── */
.eg-chart { min-height: 260px; width: 100%; }
.eg-skeleton {
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-tertiary);
  font-size: 13px;
  font-style: italic;
}
.eg-empty {
  padding: 20px;
  color: var(--text-tertiary);
  font-size: 13px;
  text-align: center;
}

/* ── Portfolio summary grid ───────────────────────────────────────────── */
.eg-summary { margin-bottom: 14px; }
.eg-summary__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

/* Stat widget (RunPod-style: icon row + value + two-toned foot) */
.eg-stat {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 14px 11px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 92px;
}
.eg-stat__head {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--text-tertiary);
}
.eg-stat__icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  opacity: 0.85;
  stroke-width: 1.75;
}
.eg-stat__label {
  font-size: 12px;
  font-weight: 400;
  color: var(--text-tertiary);
  line-height: 1;
}
.eg-stat__value {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 20px;
  font-weight: 500;
  line-height: 1.1;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
}
.eg-stat__value.up    { color: var(--up-bright); }
.eg-stat__value.down  { color: var(--down-bright); }
.eg-stat__value.warn  { color: var(--warning); }
.eg-stat__value.muted { color: var(--text-tertiary); }
.eg-stat__unit {
  font-size: 13px;
  font-weight: 400;
  opacity: 0.7;
  margin-left: 1px;
}
.eg-stat__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 11.5px;
  color: var(--text-secondary);
  line-height: 1.2;
  margin-top: auto;
}
.eg-stat__foot .sep { color: var(--text-muted); opacity: 0.55; }
.eg-stat__foot .muted { color: var(--text-tertiary); font-family: var(--font-sans); font-variant-numeric: normal; }
.eg-stat__foot .num { color: var(--text-primary); }
.eg-stat__foot .up    { color: var(--up-bright); }
.eg-stat__foot .down  { color: var(--down-bright); }
.eg-stat__foot .accent { color: var(--accent-secondary); }

/* Legacy .eg-kpi fallback (rendered by any non-live partial still using it) */
.eg-kpi {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.eg-kpi__label {
  font-size: 12px;
  color: var(--text-tertiary);
  font-weight: 400;
}
.eg-kpi__value {
  font-size: 18px;
  font-weight: 500;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
  line-height: 1.2;
  margin-top: 2px;
}
.eg-kpi__value.warn { color: var(--warning); }
.eg-kpi__sub {
  font-size: 11px;
  color: var(--text-tertiary);
  margin-top: 2px;
}

/* ── Symbol / direction pills in tables ───────────────────────────────── */
.eg-sym {
  font-family: var(--font-mono);
  font-weight: 450;
  color: var(--text-primary);
}
.eg-dir {
  font-family: var(--font-mono);
  font-weight: 450;
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-wide);
}

/* ── Last 24h ─────────────────────────────────────────────────────────── */
.eg-24h__stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.eg-24h__stat {
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 12px 9px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.eg-24h__label {
  font-size: 11px;
  color: var(--text-tertiary);
  line-height: 1;
}
.eg-24h__value {
  font-size: 17px;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.15;
}
.eg-24h__value.up   { color: var(--up-bright); }
.eg-24h__value.down { color: var(--down-bright); }
.eg-24h__sub {
  font-size: 11px;
  color: var(--text-tertiary);
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}
.eg-24h__sub.up   { color: var(--up-bright); }
.eg-24h__sub.down { color: var(--down-bright); }
.eg-inset-table { margin-bottom: var(--space-3); }
.eg-24h__blocks { margin-top: var(--space-4); }
.eg-24h__blocks-label {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  margin-bottom: var(--space-2);
}
.eg-24h__block-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));
  gap: var(--space-2);
  width: 100%;
}
.eg-24h__block {
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  font-family: var(--font-mono);
  font-size: 11px;
  text-align: center;
  background: transparent;
}
.eg-24h__block.up {
  border-color: rgba(38, 166, 154, 0.35);
  background: rgba(38, 166, 154, 0.06);
}
.eg-24h__block.down {
  border-color: rgba(239, 83, 80, 0.35);
  background: rgba(239, 83, 80, 0.06);
}
.eg-24h__block-r { font-weight: 500; }
.eg-24h__block-t {
  font-size: 10px;
  color: var(--text-tertiary);
  margin-top: 2px;
}
.eg-24h__block.up .eg-24h__block-r { color: var(--up-bright); }
.eg-24h__block.down .eg-24h__block-r { color: var(--down-bright); }

/* ── Total row in perf tables ─────────────────────────────────────────── */
.eg-total-row td {
  border-top: 1px solid var(--border-default) !important;
  font-weight: 500;
  background: var(--bg-surface-raised);
}

/* ── Paging footer ────────────────────────────────────────────────────── */
.eg-paging {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
}
.eg-paging__label {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-secondary);
}

/* ── Drawdown card ────────────────────────────────────────────────────── */
.eg-dd {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.eg-dd__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--border-faint);
}
.eg-dd__row:last-child { border-bottom: none; }
.eg-dd__label {
  font-size: var(--text-sm);
  color: var(--text-secondary);
}
.eg-dd__value {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: var(--text-md);
  font-weight: 500;
}
.eg-dd__value.warn { color: var(--warning); }

/* ── Decision log ─────────────────────────────────────────────────────── */
.eg-decisions {
  background: var(--bg-inset);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-secondary);
  max-height: 360px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
  margin: var(--space-4);
}
