:root {
  --bg-0: #06080d;
  --bg-1: #0a0e17;
  --bg-2: #11172240;
  --bg-3: #1a2333;
  --border: #1e2a3d;
  --border-2: #2a3a55;
  --accent: #00d9a3;
  --accent-2: #00b4d8;
  --accent-3: #ffb700;
  --danger: #ff4d6d;
  --warn: #ffa726;
  --success: #00d9a3;
  --text-dim: #7a8aa3;
  --text-2: #b4c2d5;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background:
    radial-gradient(ellipse at top left, rgba(0,217,163,0.05) 0%, transparent 50%),
    radial-gradient(ellipse at bottom right, rgba(0,180,216,0.04) 0%, transparent 50%),
    var(--bg-1);
  min-height: 100vh;
}
.mono { font-family: 'JetBrains Mono', monospace; }

.card {
  background: linear-gradient(180deg, rgba(26,35,51,0.6), rgba(17,23,34,0.6));
  border: 1px solid var(--border);
  border-radius: 14px;
  backdrop-filter: blur(10px);
}
.card-glow {
  box-shadow: 0 0 24px rgba(0, 217, 163, 0.08), 0 0 0 1px rgba(0,217,163,0.15);
}

.gradient-text {
  background: linear-gradient(135deg, #00d9a3 0%, #00b4d8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Verdict pills */
.verdict-pill {
  font-weight: 700;
  letter-spacing: 0.05em;
  font-size: 0.7rem;
  padding: 4px 10px;
  border-radius: 999px;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.v-strong-buy { background: rgba(0,217,163,0.15); color: #00d9a3; border: 1px solid #00d9a3; }
.v-buy { background: rgba(0,180,216,0.15); color: #00b4d8; border: 1px solid #00b4d8; }
.v-add { background: rgba(120,200,255,0.15); color: #78c8ff; border: 1px solid #78c8ff; }
.v-hold { background: rgba(180,194,213,0.15); color: #b4c2d5; border: 1px solid #b4c2d5; }
.v-reduce { background: rgba(255,167,38,0.15); color: #ffa726; border: 1px solid #ffa726; }
.v-sell, .v-avoid { background: rgba(255,77,109,0.15); color: #ff4d6d; border: 1px solid #ff4d6d; }

/* Phase tabs */
.phase-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text-dim);
  white-space: nowrap;
  transition: all 0.15s;
}
.phase-tab:hover { color: #fff; background: rgba(0,217,163,0.05); }
.phase-tab.active {
  background: rgba(0,217,163,0.1);
  color: #00d9a3;
  border-color: rgba(0,217,163,0.3);
}
.phase-tab .num {
  font-size: 0.7rem;
  background: rgba(255,255,255,0.05);
  padding: 2px 6px;
  border-radius: 4px;
}
.phase-tab.active .num { background: rgba(0,217,163,0.2); color: #00d9a3; }

/* Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* Pulse for live data */
@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}
.live-dot {
  width: 8px;
  height: 8px;
  background: #00d9a3;
  border-radius: 50%;
  animation: pulse-dot 2s infinite;
  display: inline-block;
}

/* Tables */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
.data-table th {
  text-align: left;
  font-weight: 500;
  color: var(--text-dim);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  background: rgba(0,0,0,0.2);
}
.data-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(30,42,61,0.5);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
}
.data-table tr:hover td { background: rgba(0,217,163,0.03); }
.pos { color: #00d9a3; }
.neg { color: #ff4d6d; }
.neu { color: var(--text-2); }

/* Score bar */
.score-bar {
  height: 8px;
  background: var(--bg-3);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}
.score-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}
.score-fill.high { background: linear-gradient(90deg, #00d9a3, #00b4d8); }
.score-fill.mid { background: linear-gradient(90deg, #ffa726, #ffb700); }
.score-fill.low { background: linear-gradient(90deg, #ff4d6d, #ff7a8a); }

/* Glass tooltip */
.tooltip {
  position: relative;
  cursor: help;
  border-bottom: 1px dotted var(--text-dim);
}
.tooltip:hover::after {
  content: attr(data-tip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-4px);
  background: var(--bg-3);
  color: #fff;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 0.75rem;
  white-space: nowrap;
  border: 1px solid var(--border-2);
  z-index: 100;
}

/* Search dropdown */
.search-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 4px;
  background: var(--bg-3);
  border: 1px solid var(--border-2);
  border-radius: 10px;
  max-height: 400px;
  overflow-y: auto;
  z-index: 50;
  box-shadow: 0 12px 40px rgba(0,0,0,0.5);
}
.search-item {
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background 0.1s;
}
.search-item:hover { background: rgba(0,217,163,0.1); }
.search-item:last-child { border-bottom: none; }

/* Loading spinner */
@keyframes spin { to { transform: rotate(360deg); } }
.spinner {
  width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,0.2);
  border-top-color: #00d9a3;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
}

/* Section header */
.section-h {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.section-h .icon {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px;
  background: rgba(0,217,163,0.1);
  color: #00d9a3;
}

/* Flag severity */
.flag-high { border-left: 3px solid #ff4d6d; background: rgba(255,77,109,0.05); }
.flag-medium { border-left: 3px solid #ffa726; background: rgba(255,167,38,0.05); }
.flag-low { border-left: 3px solid #00b4d8; background: rgba(0,180,216,0.05); }

/* Stat card */
.stat-card {
  padding: 14px 16px;
  background: rgba(17,23,34,0.4);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.stat-card .label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  margin-bottom: 4px;
}
.stat-card .val {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.3rem;
  font-weight: 600;
}
.stat-card .sub { font-size: 0.75rem; color: var(--text-dim); margin-top: 2px; }

/* Animations */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.fade-up { animation: fadeUp 0.4s ease-out; }

@keyframes slideIn {
  from { opacity: 0; transform: translateX(-8px); }
  to { opacity: 1; transform: translateX(0); }
}
.slide-in { animation: slideIn 0.3s ease-out; }

/* Moat radar bg */
.moat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}
.moat-item {
  padding: 12px;
  background: rgba(17,23,34,0.5);
  border: 1px solid var(--border);
  border-radius: 10px;
}

/* Risk dot */
.risk-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  margin-right: 6px;
}
.risk-dot.high { background: #ff4d6d; }
.risk-dot.medium { background: #ffa726; }
.risk-dot.low { background: #00b4d8; }
