:root {
  --raven-bg: #0a0a0f;
  --raven-card: #12121a;
  --raven-accent: #6C3AED;
  --raven-success: #10b981;
  --raven-muted: #64748b;
}
body {
  background: radial-gradient(ellipse at 20% 0%, rgba(108, 58, 237, 0.08) 0%, transparent 50%),
              radial-gradient(ellipse at 80% 100%, rgba(108, 58, 237, 0.05) 0%, transparent 40%),
              var(--raven-bg);
  color: #e2e8f0;
}

/* --- Glass cards --- */
.glass {
  background: rgba(18, 18, 26, 0.72);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 1px rgba(108, 58, 237, 0.04),
              0 4px 24px rgba(0, 0, 0, 0.3);
}

/* Glossy 3D stat card */
.glass-glossy {
  background: linear-gradient(135deg, rgba(18, 18, 26, 0.85) 0%, rgba(30, 25, 50, 0.72) 100%);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(108, 58, 237, 0.15);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06),
              0 8px 32px rgba(0, 0, 0, 0.4),
              0 0 0 1px rgba(108, 58, 237, 0.08);
  position: relative;
}
.glass-glossy::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04) 0%, transparent 40%);
  pointer-events: none;
}

/* --- Sidebar --- */
.glass-sidebar {
  background: rgba(10, 10, 15, 0.94);
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}
.nav-item.active {
  color: var(--raven-accent);
  background: rgba(108, 58, 237, 0.12);
  border-left: 3px solid var(--raven-accent);
}
.sidebar-zone-header {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #475569;
  padding: 0 1.5rem;
  margin-top: 1rem;
  margin-bottom: 0.25rem;
}

/* --- Animations --- */
@keyframes pulse-soft { 0%,100%{opacity:1} 50%{opacity:0.5} }
.animate-pulse-soft { animation: pulse-soft 1.5s ease-in-out infinite; }

@keyframes pulse-breathe {
  0%, 100% { opacity: 1; box-shadow: 0 0 6px var(--raven-accent); }
  50% { opacity: 0.5; box-shadow: 0 0 12px var(--raven-accent), 0 0 24px rgba(108, 58, 237, 0.3); }
}
.pulse-active {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--raven-accent);
  box-shadow: 0 0 6px var(--raven-accent);
  animation: pulse-breathe 2s ease-in-out infinite;
  vertical-align: middle;
}

/* --- Live feed slide-in --- */
@keyframes slide-in-glow {
  0% { opacity: 0; transform: translateY(-12px); box-shadow: 0 0 20px rgba(108, 58, 237, 0.4); }
  60% { opacity: 1; transform: translateY(0); box-shadow: 0 0 12px rgba(108, 58, 237, 0.2); }
  100% { opacity: 1; transform: translateY(0); box-shadow: none; }
}
.slide-in-row { animation: slide-in-glow 0.6s ease-out; }

/* --- Scanning laser for intake --- */
@keyframes scan-laser {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(200%); }
}
.scan-laser-wrap {
  position: relative;
  overflow: hidden;
}
.scan-laser-wrap::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 50%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--raven-accent), transparent);
  animation: scan-laser 2s ease-in-out infinite;
}

/* --- Fullscreen chart toggle --- */
.chart-fullscreen-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 20;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(18, 18, 26, 0.8);
  color: #64748b;
  cursor: pointer;
  font-size: 14px;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.chart-fullscreen-btn:hover {
  color: white;
  border-color: var(--raven-accent);
  background: rgba(108, 58, 237, 0.15);
}
.chart-container-fs {
  position: fixed !important;
  inset: 0 !important;
  z-index: 9000 !important;
  width: 100vw !important;
  height: 100vh !important;
  background: var(--raven-bg) !important;
  border-radius: 0 !important;
  padding: 24px !important;
}

/* --- Awaiting entry state --- */
@keyframes target-pulse {
  0%, 100% { transform: scale(1); opacity: 0.6; }
  50% { transform: scale(1.15); opacity: 1; }
}
.awaiting-entry {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 100%;
  min-height: 200px;
}
.awaiting-entry-icon {
  width: 48px;
  height: 48px;
  border: 2px solid var(--raven-accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: target-pulse 2.5s ease-in-out infinite;
  box-shadow: 0 0 16px rgba(108, 58, 237, 0.2);
}
.awaiting-entry-icon::before {
  content: '';
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--raven-accent);
}

/* --- Alpha heatmap card --- */
.alpha-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(18, 18, 26, 0.6);
  transition: border-color 0.2s;
}
.alpha-card:hover { border-color: rgba(108, 58, 237, 0.3); }
.alpha-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(108, 58, 237, 0.3), rgba(16, 185, 129, 0.3));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}

/* --- Sparklines & Chart Legends --- */
.sparkline-container {
  width: 80px;
  height: 32px;
  flex-shrink: 0;
}
.raven-chart-legend {
  position: absolute;
  top: 8px;
  left: 12px;
  display: flex;
  gap: 12px;
  z-index: 10;
  pointer-events: none;
}
.raven-legend-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: #94a3b8;
}
.raven-legend-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

/* --- Scrollbar --- */
.scrollbar-thin::-webkit-scrollbar { width: 6px; }
.scrollbar-thin::-webkit-scrollbar-thumb { background: #334155; border-radius: 3px; }

/* --- Form fields --- */
.fld {
  width: 100%;
  border-radius: 0.5rem;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.5rem 1rem;
  color: white;
}
.fld::placeholder { color: var(--raven-muted); }
.fld:focus { outline: none; border-color: var(--raven-accent); }

/* --- Spinner --- */
@keyframes raven-spin { to { transform: rotate(360deg); } }
.raven-spinner {
  display: inline-block;
  width: 2rem;
  height: 2rem;
  border: 2px solid rgba(108, 58, 237, 0.25);
  border-top-color: var(--raven-accent);
  border-radius: 9999px;
  animation: raven-spin 0.7s linear infinite;
  vertical-align: middle;
}

/* --- Tooltip (frosted glass) --- */
.raven-tooltip {
  position: fixed;
  z-index: 9999;
  pointer-events: none;
  background: rgba(18, 18, 26, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(108, 58, 237, 0.2);
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 11px;
  line-height: 1.5;
  color: #cbd5e1;
  max-width: min(320px, 90vw);
  white-space: normal;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.2s, transform 0.2s;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4),
              0 0 0 1px rgba(108, 58, 237, 0.06);
}
.raven-tooltip.visible { opacity: 1; transform: translateY(0); }

/* --- Page descriptions --- */
.page-desc { margin-bottom: 1rem; overflow: hidden; max-height: 80px; transition: max-height 0.25s ease, opacity 0.2s, margin 0.2s; }
.page-desc.collapsed { max-height: 0 !important; opacity: 0; margin: 0; }
.page-desc-text { color: #64748b; font-size: 0.8rem; line-height: 1.5; }
.page-desc-toggle { cursor: pointer; color: #4a5568; font-size: 10px; margin-left: 6px; border: none; background: none; }
.page-desc-toggle:hover { color: #94a3b8; }

/* --- Help / FAQ --- */
.faq-arrow { transition: transform 0.2s; display: inline-block; }
.faq-toggle[aria-expanded="true"] .faq-arrow { transform: rotate(180deg); }
.help-stage-detail { overflow: hidden; max-height: 0; transition: max-height 0.3s ease, padding 0.3s; padding: 0 1.25rem; }
.help-stage-detail.open { max-height: 300px; padding: 0 1.25rem 1rem; }
.help-stage-card { cursor: pointer; transition: border-color 0.2s; }
.help-stage-card:hover { border-color: rgba(108, 58, 237, 0.4); }
