:root {
  --bg-primary: #020617;
  --bg-sidebar: #0f172a;
  --bg-card: #1e293b;
  --accent: #fbbf24;
  --gain: #10b981;
  --loss: #f43f5e;
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --border: rgba(148, 163, 184, 0.1);
  --font-sans: 'Plus Jakarta Sans', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --radius: 16px;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-sans);
}

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

.sidebar {
  background-color: #0f172a !important; /* Force dark sidebar background */
  border-right: 1px solid var(--border);
  padding: 32px 20px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 100;
}

.main-column {
  display: flex;
  flex-direction: column;
  width: 100%;
  overflow-x: hidden;
}

.topbar {
  background: rgba(2, 6, 23, 0.8);
  backdrop-filter: blur(12px);
  padding: 16px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}

.content-wrap {
  padding: 32px;
  max-width: 1600px;
  margin: 0 auto;
  width: 100%;
}

/* BRAND */
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 40px;
  color: #fff !important;
}
.brand-title {
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -0.02em;
}
.brand-subtitle {
  font-size: 12px;
  color: var(--text-secondary);
}

/* NAV LINKS - FIXING VISIBILITY */
.nav-links {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nav-links a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 12px;
  color: #94a3b8 !important; /* Brighter grey for inactive tabs */
  font-weight: 600;
  font-size: 14px;
  transition: all 0.2s ease;
  text-decoration: none;
}

.nav-links a:hover {
  color: #f8fafc !important;
  background: rgba(255, 255, 255, 0.05);
}

.nav-links a.is-active {
  background-color: #fbbf24 !important; /* Amber highlight */
  color: #020617 !important; /* Black text for high contrast */
  box-shadow: 0 4px 12px rgba(251, 191, 36, 0.2);
}

.nav-links a span {
  font-size: 18px;
}

/* CARDS & METRICS */
.card, .panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.metric-label {
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
}

.metric-value {
  font-size: 28px;
  font-weight: 800;
  margin: 10px 0;
  font-family: var(--font-mono);
}

.up { color: var(--gain) !important; }
.down { color: var(--loss) !important; }

/* SEARCH FIX */
.topbar-search-input {
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 18px;
  color: #fff;
  width: 100%;
  max-width: 500px;
  outline: none;
  transition: border-color 0.2s;
}

.topbar-search-input:focus {
  border-color: var(--accent);
  background: rgba(30, 41, 59, 0.8);
}

/* TICKER */
.ticker-tape-wrap {
  background: #000;
  height: 40px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--border);
}

.ticker-tape {
  display: flex;
  gap: 40px;
  animation: tickerScroll 50s linear infinite;
  white-space: nowrap;
}

@keyframes tickerScroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

@media (max-width: 1024px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
}
