:root {
  --bg-obsidian: #040712;
  --glass-bg: rgba(13, 19, 38, 0.52);
  --glass-bg-elevated: rgba(18, 26, 52, 0.66);
  --glass-border: rgba(148, 163, 184, 0.14);
  --glass-highlight: rgba(255, 255, 255, 0.13);
  --indigo: #6366f1;
  --indigo-bright: #818cf8;
  --cyan: #38bdf8;
  --emerald: #34d399;
  --amber: #fbbf24;
  --rose: #fb7185;
}

* {
  box-sizing: border-box;
}

html,
body {
  background: var(--bg-obsidian);
  color: #e2e8f0;
  font-family: 'Geist', -apple-system, BlinkMacSystemFont, sans-serif;
  letter-spacing: 0.005em;
  overflow-x: hidden;
  min-height: 100vh;
}

.tabular-nums {
  font-variant-numeric: tabular-nums;
}

/* ─── Scrollbar ─────────────────────────────────────────────── */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(99, 102, 241, 0.28);
  border-radius: 99px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(56, 189, 248, 0.45);
}

/* ─── Atmospheric Background Layers ─────────────────────────── */
#aurora-bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -20;
  pointer-events: none;
}

.bg-noise-grid {
  position: fixed;
  inset: 0;
  z-index: -10;
  pointer-events: none;
  background-image:
    radial-gradient(circle at 20% 15%, rgba(99, 102, 241, 0.11) 0%, transparent 45%),
    radial-gradient(circle at 82% 78%, rgba(56, 189, 248, 0.09) 0%, transparent 45%),
    linear-gradient(rgba(148, 163, 184, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.025) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 48px 48px, 48px 48px;
  mask-image: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.95) 40%, transparent 100%);
}

/* ─── Liquid Glass Surface System ───────────────────────────── */
.glass {
  background: linear-gradient(
    160deg,
    rgba(22, 31, 58, 0.56) 0%,
    rgba(11, 16, 33, 0.64) 55%,
    rgba(7, 11, 24, 0.74) 100%
  );
  backdrop-filter: blur(28px) saturate(185%);
  -webkit-backdrop-filter: blur(28px) saturate(185%);
  border: 1px solid var(--glass-border);
  box-shadow:
    0 12px 36px -10px rgba(0, 0, 0, 0.62),
    inset 0 1px 0 0 var(--glass-highlight),
    inset 0 0 28px rgba(99, 102, 241, 0.03);
}

.glass-bright {
  background: linear-gradient(
    155deg,
    rgba(28, 38, 72, 0.78) 0%,
    rgba(13, 19, 39, 0.86) 65%,
    rgba(8, 12, 26, 0.92) 100%
  );
  backdrop-filter: blur(36px) saturate(200%);
  -webkit-backdrop-filter: blur(36px) saturate(200%);
  border: 1px solid rgba(148, 163, 184, 0.2);
  box-shadow:
    0 24px 64px -12px rgba(0, 0, 0, 0.75),
    0 0 48px rgba(99, 102, 241, 0.12),
    inset 0 1px 0 0 rgba(255, 255, 255, 0.18);
}

.liquid-card {
  position: relative;
  overflow: hidden;
  background: linear-gradient(
    145deg,
    rgba(24, 34, 64, 0.46) 0%,
    rgba(12, 18, 36, 0.58) 52%,
    rgba(8, 12, 25, 0.68) 100%
  );
  backdrop-filter: blur(26px) saturate(180%);
  -webkit-backdrop-filter: blur(26px) saturate(180%);
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 24px;
  box-shadow:
    0 14px 40px -12px rgba(0, 0, 0, 0.6),
    inset 0 1px 0 0 rgba(255, 255, 255, 0.14),
    inset 0 -1px 0 0 rgba(255, 255, 255, 0.03);
  transition:
    transform 0.38s cubic-bezier(0.22, 1, 0.36, 1),
    border-color 0.3s ease,
    box-shadow 0.38s ease;
}

/* Specular cursor-tracking refraction sheen */
.liquid-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(
    420px circle at var(--mx, 50%) var(--my, 0%),
    rgba(129, 140, 248, 0.13),
    rgba(56, 189, 248, 0.06) 35%,
    transparent 70%
  );
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
  z-index: 0;
}

.liquid-card:hover::before {
  opacity: 1;
}

.liquid-card:hover {
  border-color: rgba(129, 140, 248, 0.28);
  box-shadow:
    0 20px 52px -12px rgba(0, 0, 0, 0.72),
    0 0 32px -6px rgba(99, 102, 241, 0.18),
    inset 0 1px 0 0 rgba(255, 255, 255, 0.22);
}

.liquid-card > * {
  position: relative;
  z-index: 1;
}

/* Interactive lift only for clickable cards */
.liquid-interactive:hover {
  transform: translateY(-2px);
}

/* Active agent states */
.agent-card-processing {
  border-color: rgba(56, 189, 248, 0.45) !important;
  box-shadow:
    0 18px 48px -10px rgba(56, 189, 248, 0.22),
    0 0 28px rgba(56, 189, 248, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.24) !important;
}

.agent-card-active {
  border-color: rgba(99, 102, 241, 0.42) !important;
  box-shadow:
    0 18px 48px -10px rgba(99, 102, 241, 0.22),
    0 0 28px rgba(99, 102, 241, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.24) !important;
}

.agent-card-complete {
  border-color: rgba(52, 211, 153, 0.4) !important;
  box-shadow:
    0 18px 48px -10px rgba(52, 211, 153, 0.18),
    0 0 24px rgba(52, 211, 153, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.22) !important;
}

/* ─── Buttons & Pills ───────────────────────────────────────── */
.btn-primary {
  background: linear-gradient(135deg, #4338ca 0%, #6366f1 55%, #0284c7 100%);
  background-size: 160% 160%;
  color: #ffffff;
  font-weight: 600;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow:
    0 6px 22px rgba(99, 102, 241, 0.38),
    inset 0 1px 0 rgba(255, 255, 255, 0.26);
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.btn-primary::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -60%;
  width: 45%;
  height: 200%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.22), transparent);
  transform: rotate(22deg);
  transition: left 0.55s ease;
  pointer-events: none;
}

.btn-primary:hover::after {
  left: 125%;
}

.btn-primary:hover {
  background-position: 100% 50%;
  transform: translateY(-1px) scale(1.015);
  box-shadow:
    0 10px 30px rgba(99, 102, 241, 0.52),
    0 0 20px rgba(56, 189, 248, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.32);
}

.btn-primary:active {
  transform: scale(0.985);
}

.btn-ghost {
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(148, 163, 184, 0.18);
  color: #cbd5e1;
  border-radius: 9999px;
  backdrop-filter: blur(12px);
  transition: all 0.22s ease;
  cursor: pointer;
}

.btn-ghost:hover {
  background: rgba(99, 102, 241, 0.16);
  border-color: rgba(129, 140, 248, 0.36);
  color: #ffffff;
}

.metric-pill {
  background: rgba(15, 23, 42, 0.52);
  border: 1px solid rgba(148, 163, 184, 0.16);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-radius: 9999px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transition: all 0.25s ease;
}

.metric-pill:hover {
  background: rgba(99, 102, 241, 0.14);
  border-color: rgba(129, 140, 248, 0.32);
}

/* ─── Status Badges ─────────────────────────────────────────── */
.badge-active {
  background: rgba(99, 102, 241, 0.16);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.38);
}

.badge-complete {
  background: rgba(16, 185, 129, 0.15);
  color: #6ee7b7;
  border: 1px solid rgba(52, 211, 153, 0.36);
}

.badge-process {
  background: rgba(56, 189, 248, 0.15);
  color: #7dd3fc;
  border: 1px solid rgba(56, 189, 248, 0.38);
}

.badge-standby {
  background: rgba(148, 163, 184, 0.08);
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.18);
}

.badge-warn {
  background: rgba(251, 191, 36, 0.14);
  color: #fde68a;
  border: 1px solid rgba(251, 191, 36, 0.32);
}

/* ─── Navigation ────────────────────────────────────────────── */
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 14px;
  color: #94a3b8;
  border: 1px solid transparent;
  transition: all 0.22s ease;
  cursor: pointer;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.045);
  color: #e2e8f0;
}

.nav-item.nav-active {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.22), rgba(56, 189, 248, 0.1));
  border: 1px solid rgba(129, 140, 248, 0.32);
  color: #e0e7ff;
  box-shadow:
    0 6px 18px rgba(99, 102, 241, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

/* ─── Progress Bars ─────────────────────────────────────────── */
.progress-bar {
  background: linear-gradient(90deg, #4338ca, #818cf8);
  border-radius: 9999px;
  transition: width 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.progress-bar-secondary {
  background: linear-gradient(90deg, #0284c7, #38bdf8);
  border-radius: 9999px;
  transition: width 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.progress-bar-tertiary {
  background: linear-gradient(90deg, #059669, #34d399);
  border-radius: 9999px;
  transition: width 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ─── Inputs ────────────────────────────────────────────────── */
.glass-input {
  background: rgba(6, 10, 22, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 14px;
  color: #f1f5f9;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.glass-input:focus {
  outline: none;
  border-color: rgba(56, 189, 248, 0.55);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.14);
}

/* ─── Neural Workflow Graph ─────────────────────────────────── */
.neural-line {
  stroke-dasharray: 7 5;
  animation: flow 18s linear infinite;
}

.neural-line-active {
  stroke-dasharray: 10 4;
  animation: flow 3.5s linear infinite;
  filter: drop-shadow(0 0 6px currentColor);
}

@keyframes flow {
  to {
    stroke-dashoffset: -400;
  }
}

.graph-node {
  cursor: pointer;
  transition: transform 0.25s ease, filter 0.25s ease;
}

.graph-node:hover {
  filter: drop-shadow(0 0 12px rgba(129, 140, 248, 0.65));
}

/* ─── Report Markdown Styling ───────────────────────────────── */
.report-prose {
  color: #cbd5e1;
  line-height: 1.72;
  font-size: 0.925rem;
}

.report-prose h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
  background: linear-gradient(120deg, #ffffff 30%, #a5b4fc 80%, #7dd3fc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.report-prose h2 {
  font-size: 1.125rem;
  font-weight: 600;
  color: #f8fafc;
  margin-top: 1.5rem;
  margin-bottom: 0.6rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
}

.report-prose h3 {
  font-size: 1rem;
  font-weight: 600;
  color: #c7d2fe;
  margin-top: 1.15rem;
  margin-bottom: 0.4rem;
}

.report-prose p {
  margin-bottom: 0.75rem;
}

.report-prose strong {
  color: #f8fafc;
  font-weight: 600;
}

.report-prose a {
  color: #38bdf8;
  text-decoration: underline;
  text-decoration-color: rgba(56, 189, 248, 0.4);
  text-underline-offset: 3px;
}

.report-prose a:hover {
  color: #7dd3fc;
}

.report-prose ul,
.report-prose ol {
  margin: 0.5rem 0 0.9rem 1.25rem;
}

.report-prose ul {
  list-style-type: disc;
}

.report-prose ol {
  list-style-type: decimal;
}

.report-prose li {
  margin-bottom: 0.35rem;
}

.report-prose blockquote {
  border-left: 3px solid #6366f1;
  background: rgba(99, 102, 241, 0.08);
  padding: 0.65rem 1rem;
  border-radius: 0 12px 12px 0;
  margin: 0.85rem 0;
  color: #cbd5e1;
  font-size: 0.86rem;
}

.report-prose code {
  font-family: 'Geist Mono', monospace;
  font-size: 0.8em;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.16);
  color: #a5b4fc;
  padding: 0.12rem 0.38rem;
  border-radius: 6px;
}

.report-prose pre {
  background: rgba(4, 7, 18, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 12px;
  padding: 0.9rem 1rem;
  overflow-x: auto;
  margin: 0.9rem 0;
}

.report-prose pre code {
  border: none;
  background: transparent;
  padding: 0;
}

.report-prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 0.84rem;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.16);
}

.report-prose th {
  background: rgba(99, 102, 241, 0.14);
  color: #e0e7ff;
  text-align: left;
  padding: 0.6rem 0.8rem;
  font-weight: 600;
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
}

.report-prose td {
  padding: 0.55rem 0.8rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.09);
  background: rgba(8, 12, 24, 0.45);
}

.report-prose tr:hover td {
  background: rgba(99, 102, 241, 0.06);
}

/* ─── Animations & Modals ───────────────────────────────────── */
.modal-overlay {
  background: rgba(3, 6, 15, 0.78);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}
.cursor {
  animation: blink 1s step-end infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}
.spinner-ring {
  animation: spin 0.85s linear infinite;
}

@keyframes fadeSlideUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.view-enter {
  animation: fadeSlideUp 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}
