/* ==============================================================================
   CRYPTOBOT QUANTITATIVE TERMINAL — INSTITUTIONAL DESIGN SYSTEM
   Theme: Binance Cyber-Gold & Obsidian Glass (24/7 Digital Asset Alpha)
   Typography: Outfit + JetBrains Mono (Tabular Numerals)
   ============================================================================== */

:root {
  --bg-base: #06080d;
  --bg-surface: #0a0e16;
  --bg-card: #0e1420;
  --bg-card-hover: #131b2c;
  --bg-card-elevated: #192338;
  
  --border-subtle: rgba(255, 255, 255, 0.07);
  --border-medium: rgba(255, 255, 255, 0.12);
  --border-focus: #f0b90b;
  
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-dim: #475569;

  /* Quant Indicators */
  --color-gold: #f0b90b;
  --color-gold-glow: rgba(240, 185, 11, 0.25);
  --color-amber: #fbbf24;
  --color-emerald: #00f59b;
  --color-emerald-glow: rgba(0, 245, 155, 0.22);
  --color-rose: #ff2a6d;
  --color-rose-glow: rgba(255, 42, 109, 0.22);
  --color-cyan: #00d2ff;
  --color-purple: #a855f7;

  --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Roboto Mono', Menlo, Consolas, monospace;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-full: 9999px;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 8px 24px -4px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 16px 36px -6px rgba(0, 0, 0, 0.8);

  --transition-fast: 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-normal: 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

::-webkit-scrollbar { width: 7px; height: 7px; }
::-webkit-scrollbar-track { background: var(--bg-base); }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.15); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--color-gold); }

::selection { background: rgba(240, 185, 11, 0.3); color: #ffffff; }

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  background-color: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 13.5px;
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  background-image: 
    radial-gradient(ellipse at 15% 0%, rgba(240, 185, 11, 0.06) 0%, transparent 60%),
    radial-gradient(ellipse at 85% 0%, rgba(0, 245, 155, 0.04) 0%, transparent 60%);
  background-attachment: fixed;
}

.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

/* ==============================================================================
   MULTI-BOT ECOSYSTEM TOP NAVIGATION BAR
   ============================================================================== */
.ecosystem-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 10px 24px;
  background: rgba(10, 14, 22, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 100;
}

.eco-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.eco-badge {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.04);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

.eco-links {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.eco-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-decoration: none;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  transition: all var(--transition-fast);
}

.eco-link:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--border-medium);
  transform: translateY(-1px);
}

.eco-link.active {
  color: #ffffff;
  background: rgba(240, 185, 11, 0.16);
  border-color: var(--color-gold);
  box-shadow: 0 0 16px var(--color-gold-glow);
}

.eco-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
}

.dot-crypto { background: #f0b90b; box-shadow: 0 0 6px rgba(240, 185, 11, 0.6); }
.dot-forex { background: #00f59b; box-shadow: 0 0 6px rgba(0, 245, 155, 0.6); }
.dot-stock { background: #8b5cf6; box-shadow: 0 0 6px rgba(139, 92, 246, 0.6); }
.dot-commodity { background: #f59e0b; box-shadow: 0 0 6px rgba(245, 158, 11, 0.6); }
.dot-index { background: #a855f7; box-shadow: 0 0 6px rgba(168, 85, 247, 0.6); }

.eco-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.eco-strategy-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--color-gold);
  background: rgba(240, 185, 11, 0.08);
  border: 1px solid rgba(240, 185, 11, 0.25);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
}

.eco-status-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--color-emerald);
  background: rgba(0, 245, 155, 0.08);
  border: 1px solid rgba(0, 245, 155, 0.25);
  padding: 4px 10px;
  border-radius: var(--radius-full);
}

.pulse-dot {
  width: 6px;
  height: 6px;
  background: var(--color-emerald);
  border-radius: 50%;
  display: inline-block;
  animation: pulse-ring 2s infinite cubic-bezier(0.4, 0, 0.6, 1);
}

@keyframes pulse-ring {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(0.85); }
}

.app-container {
  max-width: 1480px;
  margin: 0 auto;
  padding: 16px 24px 60px;
}

/* Header */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0 20px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border-subtle);
  flex-wrap: wrap;
  row-gap: 14px;
  column-gap: 16px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}

.logo-badge {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, rgba(240, 185, 11, 0.2), rgba(251, 191, 36, 0.08));
  border: 1px solid rgba(240, 185, 11, 0.4);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 18px;
  color: var(--color-gold);
  box-shadow: 0 0 16px var(--color-gold-glow);
  flex-shrink: 0;
}

.title-group h1 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1.2;
}

.title-group p {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 3px;
  line-height: 1.3;
}

.tag-version {
  font-size: 10px;
  font-family: var(--font-mono);
  background: rgba(240, 185, 11, 0.12);
  color: var(--color-gold);
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(240, 185, 11, 0.3);
  font-weight: 600;
  letter-spacing: 0.04em;
}

.header-badges {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 5px 11px;
  border-radius: var(--radius-full);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  cursor: help;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.badge:hover {
  border-color: var(--border-medium);
  color: var(--text-primary);
}

.badge-paper {
  background: rgba(240, 185, 11, 0.08);
  border-color: rgba(240, 185, 11, 0.25);
  color: var(--color-gold);
}

.badge-broker {
  background: rgba(99, 102, 241, 0.08);
  border-color: rgba(99, 102, 241, 0.25);
  color: #818cf8;
}

.badge-open {
  background: rgba(0, 245, 155, 0.08);
  border-color: rgba(0, 245, 155, 0.25);
  color: var(--color-emerald);
}

.badge-closed {
  background: rgba(255, 42, 109, 0.08);
  border-color: rgba(255, 42, 109, 0.25);
  color: var(--color-rose);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  margin-left: auto;
}

.clock-panel {
  text-align: right;
  background: var(--bg-card);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 125px;
}

.local-time {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.utc-time {
  font-size: 10.5px;
  color: var(--text-muted);
  line-height: 1.2;
  margin-top: 2px;
}

.control-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.control-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-medium);
  color: var(--text-primary);
}

.control-btn.active {
  border-color: rgba(240, 185, 11, 0.35);
  color: var(--color-gold);
  background: rgba(240, 185, 11, 0.08);
}

@media (max-width: 1400px) {
  .header {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "left right"
      "badges badges";
    row-gap: 12px;
  }
  
  .header-left {
    grid-area: left;
  }
  
  .header-right {
    grid-area: right;
    margin-left: 0;
    justify-self: end;
  }
  
  .header-badges {
    grid-area: badges;
    width: 100%;
    padding-top: 2px;
  }
}

@media (max-width: 768px) {
  .header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }
  .header-right {
    width: 100%;
    justify-content: space-between;
    margin-left: 0;
  }
  .header-badges {
    width: 100%;
  }
}

/* Session Bar */
.session-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 16px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}

.session-bar-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  margin-right: 6px;
}

.session-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  cursor: help;
  transition: all var(--transition-fast);
}

.session-pill.active {
  background: rgba(240, 185, 11, 0.12);
  border-color: rgba(240, 185, 11, 0.35);
  color: #ffffff;
  box-shadow: 0 0 12px var(--color-gold-glow);
}

.session-pill .indicator-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-muted);
}

.session-pill.active .indicator-dot {
  background: var(--color-gold);
  box-shadow: 0 0 6px var(--color-gold);
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  position: relative;
  transition: all var(--transition-fast);
  cursor: pointer;
}

.stat-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-medium);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2.5px;
  border-top-left-radius: var(--radius-md);
  border-top-right-radius: var(--radius-md);
}

.stat-card.brand::before { background: var(--color-gold); }
.stat-card.emerald::before { background: var(--color-emerald); }
.stat-card.rose::before { background: var(--color-rose); }
.stat-card.amber::before { background: var(--color-amber); }
.stat-card.purple::before { background: var(--color-cyan); }

.stat-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}

.stat-value {
  font-size: 24px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.03em;
  margin-bottom: 6px;
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.stat-sub {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.text-profit { color: var(--color-emerald) !important; }
.text-loss { color: var(--color-rose) !important; }

/* Pairs Grid */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  margin-top: 8px;
}

.section-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.pairs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.pair-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  transition: all var(--transition-fast);
  cursor: pointer;
  position: relative;
}

.pair-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(240, 185, 11, 0.35);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5);
}

.pair-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.pair-symbol {
  font-size: 13.5px;
  font-weight: 700;
  color: #ffffff;
}

.pair-spread {
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(240, 185, 11, 0.08);
  color: var(--color-gold);
  border: 1px solid rgba(240, 185, 11, 0.2);
}

.pair-prices {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.pair-col { flex: 1; }

.price-type {
  font-size: 9.5px;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.04em;
  display: block;
}

.price-val {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.pair-footer {
  display: flex;
  justify-content: space-between;
  font-size: 10.5px;
  color: var(--text-muted);
  padding-top: 6px;
  border-top: 1px solid var(--border-subtle);
}

/* Tabs & Panel */
.panel {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.tabs-nav {
  display: flex;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  padding: 4px 8px;
  gap: 4px;
  overflow-x: auto;
}

.tab-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 12.5px;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.tab-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.04);
}

.tab-btn.active {
  color: #fff;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-sm);
}

.tab-btn .tab-count {
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

.tab-btn.active .tab-count {
  background: var(--color-gold);
  color: #000;
}

.tab-panel {
  padding: 16px 20px 24px;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

th {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-subtle);
  cursor: help;
  white-space: nowrap;
}

td {
  padding: 12px 14px;
  font-size: 12.5px;
  color: var(--text-primary);
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  white-space: nowrap;
}

tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.empty-state {
  text-align: center;
  padding: 36px 16px !important;
  color: var(--text-muted);
  font-size: 12.5px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.pill-buy {
  background: rgba(0, 245, 155, 0.12);
  color: var(--color-emerald);
  border: 1px solid rgba(0, 245, 155, 0.25);
}

.pill-sell {
  background: rgba(255, 42, 109, 0.12);
  color: var(--color-rose);
  border: 1px solid rgba(255, 42, 109, 0.25);
}

.footer {
  margin-top: 36px;
  padding-top: 20px;
  border-top: 1px solid var(--border-subtle);
  text-align: center;
  font-size: 11.5px;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.footer span {
  color: var(--text-secondary);
  font-weight: 500;
}

/* Tooltips */
.info-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: #94a3b8;
  font-size: 10px;
  font-weight: 700;
  margin-left: 5px;
  cursor: help;
  transition: all 0.2s ease;
  vertical-align: middle;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.info-icon:hover {
  background: var(--color-gold);
  color: #000;
  border-color: var(--color-gold);
  box-shadow: 0 0 10px var(--color-gold-glow);
  transform: scale(1.15);
}

#global-tooltip {
  position: fixed;
  z-index: 9999999;
  background: rgba(12, 15, 26, 0.98);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(240, 185, 11, 0.4);
  color: #f8fafc;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.45;
  max-width: 320px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(255, 255, 255, 0.08);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transform: scale(0.96) translateY(4px);
  transition: opacity 0.18s cubic-bezier(0.16, 1, 0.3, 1), transform 0.18s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.18s;
  transform-origin: top left;
}

#global-tooltip.visible {
  opacity: 1;
  visibility: visible;
  transform: scale(1) translateY(0);
}

#global-tooltip .tt-title {
  font-weight: 700;
  font-size: 11.5px;
  color: var(--color-gold);
  margin-bottom: 4px;
  display: block;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

#global-tooltip .tt-desc {
  color: #cbd5e1;
  font-weight: 400;
}
