/* ═══════════════════════════════════════════════
   AutoHeal Intel — Premium Award-Winning UI
   ═══════════════════════════════════════════════ */

/* ─── DESIGN TOKENS ─── */
:root {
  --bg: #06080d;
  --bg-raised: rgba(12, 17, 28, 0.85);
  --bg-surface: rgba(15, 23, 42, 0.65);
  --bg-hover: rgba(30, 41, 59, 0.5);
  --border: rgba(51, 65, 85, 0.45);
  --border-light: rgba(71, 85, 105, 0.3);

  --blue: #38bdf8;
  --blue-dim: rgba(56, 189, 248, 0.15);
  --cyan: #22d3ee;
  --purple: #a78bfa;
  --purple-dim: rgba(167, 139, 250, 0.15);
  --green: #34d399;
  --green-dim: rgba(52, 211, 153, 0.15);
  --amber: #fbbf24;
  --amber-dim: rgba(251, 191, 36, 0.15);
  --red: #f43f5e;
  --red-dim: rgba(244, 63, 94, 0.15);
  --emerald: #10b981;

  --text: #f1f5f9;
  --text-2: #cbd5e1;
  --text-3: #94a3b8;
  --text-4: #64748b;

  --sans: 'Inter', system-ui, -apple-system, sans-serif;
  --heading: 'Outfit', var(--sans);
  --mono: 'JetBrains Mono', 'Fira Code', monospace;

  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 28px;

  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

html { scroll-behavior: smooth; scroll-padding-top: 80px; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ─── PARTICLE CANVAS ─── */
#particle-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.6;
}

/* ─── AMBIENT GLOWS ─── */
.ambient-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(160px);
  pointer-events: none;
  z-index: 0;
  animation: drift 20s ease-in-out infinite alternate;
}
.glow-1 { top: -15%; left: 10%; width: 600px; height: 600px; background: rgba(56,189,248,0.07); }
.glow-2 { bottom: -10%; right: 5%; width: 700px; height: 700px; background: rgba(167,139,250,0.06); animation-delay: -7s; }
.glow-3 { top: 40%; left: 50%; width: 500px; height: 500px; background: rgba(52,211,153,0.04); animation-delay: -14s; }

@keyframes drift {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(40px, -30px) scale(1.1); }
}

/* ─── NAVBAR ─── */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(6, 8, 13, 0.7);
  backdrop-filter: blur(20px) saturate(1.2);
  border-bottom: 1px solid var(--border);
  transition: background 0.3s var(--ease);
}
.navbar.scrolled { background: rgba(6, 8, 13, 0.92); }

.nav-inner {
  max-width: 1360px;
  margin: 0 auto;
  padding: 0 28px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}

.logo-mark {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.logo-mark svg { width: 28px; height: 28px; }

.brand-name {
  font-family: var(--heading);
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.5px;
}
.brand-name .accent {
  background: linear-gradient(135deg, var(--blue), var(--purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.brand-tagline {
  display: block;
  font-family: var(--mono);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-4);
}

.nav-links {
  display: flex;
  gap: 4px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border-radius: var(--r-sm);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-3);
  transition: all 0.2s var(--ease);
  position: relative;
}
.nav-link i { width: 16px; height: 16px; }
.nav-link:hover { color: var(--text); background: var(--bg-hover); }
.nav-link.active { color: var(--blue); background: var(--blue-dim); }

.nav-end {
  display: flex;
  align-items: center;
  gap: 14px;
}

.status-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 100px;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-2);
  font-family: var(--mono);
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  position: relative;
}
.pulse-dot::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  animation: ping 2s cubic-bezier(0, 0, 0.2, 1) infinite;
}
.pulse-green { background: var(--green); }
.pulse-green::after { background: rgba(52, 211, 153, 0.4); }
.pulse-red { background: var(--red); }
.pulse-red::after { background: rgba(244, 63, 94, 0.4); }

@keyframes ping {
  0% { transform: scale(1); opacity: 0.8; }
  75%, 100% { transform: scale(2.5); opacity: 0; }
}

/* ─── BUTTONS ─── */
.btn {
  font-family: var(--sans);
  font-weight: 600;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  transition: all 0.25s var(--ease);
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}
.btn i { width: 18px; height: 18px; pointer-events: none; }
.btn code { font-family: var(--mono); font-size: 0.72em; opacity: 0.7; background: rgba(0,0,0,0.2); padding: 2px 6px; border-radius: 4px; }

.btn-sm { font-size: 0.82rem; padding: 7px 14px; }
.btn-lg { font-size: 0.95rem; padding: 12px 24px; }

.btn-glow {
  background: linear-gradient(135deg, var(--blue), #0ea5e9);
  color: #0c1222;
  border-color: rgba(56, 189, 248, 0.3);
}
.btn-glow:hover {
  box-shadow: 0 0 28px rgba(56, 189, 248, 0.35), inset 0 0 20px rgba(255,255,255,0.1);
  transform: translateY(-1px);
}
.btn-glow:active { transform: translateY(0); }

.btn-primary {
  background: linear-gradient(135deg, var(--blue), #0284c7);
  color: #0c1222;
}
.btn-primary:hover { box-shadow: 0 0 24px rgba(56,189,248,0.3); transform: translateY(-1px); }

.btn-heal {
  background: linear-gradient(135deg, var(--green), var(--emerald));
  color: #052e16;
  border-color: rgba(52,211,153,0.3);
}
.btn-heal:hover { box-shadow: 0 0 24px rgba(52,211,153,0.35); transform: translateY(-1px); }

.btn-danger-outline {
  background: transparent;
  color: var(--red);
  border-color: rgba(244, 63, 94, 0.4);
}
.btn-danger-outline:hover {
  background: var(--red-dim);
  box-shadow: 0 0 20px rgba(244,63,94,0.2);
}

.btn-ghost {
  background: var(--bg-surface);
  color: var(--text-3);
  border-color: var(--border);
}
.btn-ghost:hover { color: var(--text); background: var(--bg-hover); }

.btn-ghost-sm {
  background: none;
  border: none;
  color: var(--text-4);
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  display: flex;
  align-items: center;
}
.btn-ghost-sm:hover { color: var(--text); background: rgba(255,255,255,0.06); }

.btn.loading { pointer-events: none; opacity: 0.7; }
.btn.loading::after {
  content: '';
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── HERO ─── */
.hero-section {
  position: relative;
  z-index: 1;
  max-width: 1360px;
  margin: 0 auto;
  padding: 60px 28px 40px;
}

.hero-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 48px;
}

.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-4);
  padding: 6px 16px;
  border: 1px solid var(--border);
  border-radius: 100px;
  background: var(--bg-surface);
  animation: fadeUp 0.6s var(--ease) both;
}
.kicker-dot {
  width: 6px;
  height: 6px;
  background: var(--green);
  border-radius: 50%;
  animation: blink 2s ease-in-out infinite;
}
@keyframes blink { 0%,100% { opacity:1; } 50% { opacity:0.3; } }

.hero-title {
  font-family: var(--heading);
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  font-weight: 900;
  letter-spacing: -1.5px;
  line-height: 1.1;
  max-width: 720px;
  animation: fadeUp 0.6s 0.1s var(--ease) both;
}

.gradient-text {
  background: linear-gradient(135deg, var(--blue), var(--cyan), var(--purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-desc {
  max-width: 620px;
  font-size: 1.05rem;
  color: var(--text-3);
  line-height: 1.7;
  animation: fadeUp 0.6s 0.2s var(--ease) both;
}

.drift-alert-banner {
  margin-top: 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  border-radius: var(--r-md);
  background: rgba(244, 63, 94, 0.12);
  border: 1px solid rgba(244, 63, 94, 0.4);
  color: #fecdd3;
  font-size: 0.88rem;
  max-width: 680px;
  animation: pulse-red-bg 2s infinite alternate, fadeUp 0.4s var(--ease) both;
}
.drift-alert-banner i { color: var(--red); width: 22px; height: 22px; flex-shrink: 0; }

@keyframes pulse-red-bg {
  0% { border-color: rgba(244, 63, 94, 0.4); box-shadow: 0 0 10px rgba(244, 63, 94, 0.1); }
  100% { border-color: rgba(244, 63, 94, 0.8); box-shadow: 0 0 24px rgba(244, 63, 94, 0.25); }
}

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

/* ─── PIPELINE VISUALIZATION ─── */
.pipeline-visual {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 20px 0;
  animation: fadeUp 0.6s 0.3s var(--ease) both;
}

.pipeline-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
  border-radius: var(--r-md);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  min-width: 110px;
  position: relative;
  transition: all 0.4s var(--ease);
}

.pipeline-step.active {
  border-color: var(--blue);
  box-shadow: 0 0 24px rgba(56,189,248,0.15);
}
.pipeline-step.success {
  border-color: var(--green);
  box-shadow: 0 0 24px rgba(52,211,153,0.15);
}
.pipeline-step.error {
  border-color: var(--red);
  box-shadow: 0 0 24px rgba(244,63,94,0.15);
  animation: shake 0.4s var(--ease);
}
.pipeline-step.healed {
  border-color: var(--purple);
  box-shadow: 0 0 24px rgba(167,139,250,0.15);
}

@keyframes shake {
  0%,100% { transform: translateX(0); }
  20% { transform: translateX(-4px); }
  40% { transform: translateX(4px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(3px); }
}

.step-icon-wrap {
  position: relative;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-3);
}
.pipeline-step.active .step-icon-wrap { color: var(--blue); }
.pipeline-step.success .step-icon-wrap { color: var(--green); }
.pipeline-step.error .step-icon-wrap { color: var(--red); }
.pipeline-step.healed .step-icon-wrap { color: var(--purple); }

.step-icon-wrap i { width: 22px; height: 22px; position: relative; z-index: 1; }

.step-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid var(--border);
  transition: border-color 0.4s var(--ease), box-shadow 0.4s var(--ease);
}
.pipeline-step.active .step-ring { border-color: var(--blue); box-shadow: inset 0 0 10px rgba(56,189,248,0.15); }
.pipeline-step.success .step-ring { border-color: var(--green); box-shadow: inset 0 0 10px rgba(52,211,153,0.15); }
.pipeline-step.error .step-ring { border-color: var(--red); box-shadow: inset 0 0 10px rgba(244,63,94,0.15); }
.pipeline-step.healed .step-ring { border-color: var(--purple); box-shadow: inset 0 0 10px rgba(167,139,250,0.15); }

.step-label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-3);
}

.step-status {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--text-4);
  background: rgba(0,0,0,0.3);
  padding: 2px 8px;
  border-radius: 100px;
  transition: all 0.3s var(--ease);
}
.pipeline-step.error .step-status { color: var(--red); background: var(--red-dim); }
.pipeline-step.success .step-status { color: var(--green); background: var(--green-dim); }
.pipeline-step.healed .step-status { color: var(--purple); background: var(--purple-dim); }

.pipeline-connector {
  width: 48px;
  height: 2px;
  background: var(--border);
  position: relative;
  overflow: hidden;
}
.connector-pulse {
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(90deg, transparent, var(--blue), transparent);
  opacity: 0;
  transition: opacity 0.3s;
}
.pipeline-connector.flowing .connector-pulse {
  opacity: 1;
  animation: flowPulse 0.8s linear infinite;
}
.pipeline-connector.error-flow .connector-pulse {
  opacity: 1;
  background: linear-gradient(90deg, transparent, var(--red), transparent);
  animation: flowPulse 0.5s linear 1;
}
.pipeline-connector.heal-flow .connector-pulse {
  opacity: 1;
  background: linear-gradient(90deg, transparent, var(--purple), transparent);
  animation: flowPulse 0.8s linear infinite;
}
@keyframes flowPulse {
  from { left: -50%; }
  to { left: 100%; }
}

/* ─── HERO ACTIONS ─── */
.hero-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 8px 28px 0;
  animation: fadeUp 0.6s 0.4s var(--ease) both;
}

/* ─── METRICS BAR ─── */
.metrics-bar {
  position: relative;
  z-index: 1;
  max-width: 1360px;
  margin: 0 auto;
  padding: 0 28px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 48px;
}

.metric {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  border-radius: var(--r-md);
  background: var(--bg-raised);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  transition: all 0.25s var(--ease);
}
.metric:hover {
  border-color: rgba(56,189,248,0.3);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

.metric-icon-box {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.metric-icon-box i { width: 20px; height: 20px; }
.c-blue { background: var(--blue-dim); color: var(--blue); }
.c-green { background: var(--green-dim); color: var(--green); }
.c-amber { background: var(--amber-dim); color: var(--amber); }
.c-purple { background: var(--purple-dim); color: var(--purple); }
.c-emerald { background: rgba(16,185,129,0.15); color: var(--emerald); }

.metric-num {
  font-family: var(--heading);
  font-size: 1.6rem;
  font-weight: 800;
  line-height: 1;
  display: block;
}

.metric-lbl {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-4);
}

/* ─── TERMINAL ─── */
.terminal-section {
  position: relative;
  z-index: 1;
  max-width: 1360px;
  margin: 0 auto 48px;
  padding: 0 28px;
}

.terminal-frame {
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  overflow: hidden;
  background: #020409;
  box-shadow: 0 16px 48px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.03);
}

.terminal-chrome {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  background: rgba(15, 23, 42, 0.8);
  border-bottom: 1px solid var(--border);
}

.chrome-dots {
  display: flex;
  gap: 6px;
}
.chrome-dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.chrome-dots span:nth-child(1) { background: #ef4444; }
.chrome-dots span:nth-child(2) { background: #fbbf24; }
.chrome-dots span:nth-child(3) { background: #22c55e; }

.chrome-title {
  flex: 1;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--text-4);
  display: flex;
  align-items: center;
  gap: 6px;
}
.chrome-title i { width: 14px; height: 14px; }

.terminal-body {
  padding: 20px;
  font-family: var(--mono);
  font-size: 0.82rem;
  line-height: 1.7;
  height: 260px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.t-line {
  display: flex;
  gap: 8px;
  animation: termIn 0.25s var(--ease) both;
}
@keyframes termIn {
  from { opacity: 0; transform: translateX(-8px); }
  to { opacity: 1; transform: translateX(0); }
}

.t-prompt { color: var(--text-4); font-weight: 700; flex-shrink: 0; }
.t-muted { color: var(--text-4); }
.t-cmd { color: var(--blue); }
.t-ok { color: var(--green); }
.t-warn { color: var(--amber); }
.t-err { color: var(--red); font-weight: 600; }

/* ─── CONTENT SECTIONS ─── */
.content-section {
  position: relative;
  z-index: 1;
  max-width: 1360px;
  margin: 0 auto 56px;
  padding: 0 28px;
}

.section-head {
  margin-bottom: 24px;
}

.section-tag {
  font-family: var(--mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--blue);
  margin-bottom: 8px;
}

.sec-title {
  font-family: var(--heading);
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 6px;
}

.sec-desc {
  color: var(--text-3);
  font-size: 0.92rem;
  max-width: 600px;
}
.sec-desc code {
  font-family: var(--mono);
  font-size: 0.82em;
  background: rgba(56,189,248,0.1);
  color: var(--blue);
  padding: 1px 6px;
  border-radius: 4px;
}

/* ─── COLLECTORS ─── */
.collectors-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 18px;
}

.collector-card {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 24px;
  backdrop-filter: blur(12px);
  transition: all 0.25s var(--ease);
  position: relative;
  overflow: hidden;
}
.collector-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--blue), var(--purple));
  opacity: 0;
  transition: opacity 0.3s;
}
.collector-card:hover::before { opacity: 1; }
.collector-card:hover { border-color: rgba(56,189,248,0.3); transform: translateY(-2px); }

.collector-card .c-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.c-id {
  font-family: var(--mono);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--blue);
  background: var(--blue-dim);
  padding: 3px 10px;
  border-radius: 100px;
}

.c-badge {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 3px 10px;
  border-radius: 100px;
}
.c-badge.healed { color: var(--green); background: var(--green-dim); border: 1px solid rgba(52,211,153,0.3); }
.c-badge.standard { color: var(--text-4); background: rgba(100,116,139,0.1); border: 1px solid var(--border); }

.c-name {
  font-family: var(--heading);
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.c-url {
  font-size: 0.78rem;
  color: var(--text-4);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-bottom: 14px;
}

.c-prompt {
  background: rgba(0,0,0,0.3);
  border: 1px solid rgba(255,255,255,0.04);
  border-radius: var(--r-sm);
  padding: 10px 12px;
  font-size: 0.78rem;
  color: var(--text-3);
  margin-bottom: 16px;
  line-height: 1.5;
}

.c-actions { display: flex; gap: 8px; }

/* ─── TIMELINE ─── */
.timeline-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.tl-item {
  display: flex;
  gap: 16px;
  padding: 20px;
  border-radius: var(--r-md);
  background: var(--bg-raised);
  border: 1px solid var(--border);
  backdrop-filter: blur(12px);
  transition: all 0.25s var(--ease);
  animation: fadeUp 0.4s var(--ease) both;
}
.tl-item:hover { border-color: rgba(52,211,153,0.3); }

.tl-dot {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--green-dim);
  color: var(--green);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.tl-dot i { width: 18px; height: 18px; }

.tl-body { flex: 1; min-width: 0; }

.tl-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.tl-title { font-weight: 700; font-size: 0.92rem; }

.tl-time {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--text-4);
}

.tl-reason {
  font-size: 0.82rem;
  color: var(--text-3);
  margin-bottom: 8px;
}

.tl-prompt-box {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--blue);
  background: rgba(0,0,0,0.3);
  padding: 8px 12px;
  border-radius: var(--r-sm);
  border-left: 3px solid var(--blue);
}

.tl-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-4);
  border: 1px dashed var(--border);
  border-radius: var(--r-md);
  font-size: 0.9rem;
}

/* ─── DATA TABLE ─── */
.data-controls {
  display: flex;
  gap: 12px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 0 14px;
  flex: 1;
  min-width: 240px;
  transition: border-color 0.2s;
}
.search-box:focus-within { border-color: var(--blue); box-shadow: 0 0 12px rgba(56,189,248,0.1); }
.search-box i { width: 16px; height: 16px; color: var(--text-4); flex-shrink: 0; }
.search-box input {
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 0.88rem;
  padding: 10px 0;
  outline: none;
  width: 100%;
  font-family: var(--sans);
}

.select-input {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  color: var(--text-2);
  padding: 10px 14px;
  border-radius: var(--r-sm);
  font-size: 0.88rem;
  font-family: var(--sans);
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s;
}
.select-input:focus { border-color: var(--blue); }

.table-wrap {
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  overflow: hidden;
  background: var(--bg-raised);
}

.data-table { width: 100%; border-collapse: collapse; }

.data-table th {
  text-align: left;
  padding: 14px 18px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-4);
  background: rgba(0,0,0,0.3);
  border-bottom: 1px solid var(--border);
}

.data-table td {
  padding: 14px 18px;
  font-size: 0.88rem;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  transition: background 0.15s;
}
.data-table tr:hover td { background: rgba(56,189,248,0.03); }
.data-table tr:last-child td { border-bottom: none; }

.td-title { font-weight: 600; }
.td-price { font-family: var(--mono); font-weight: 700; color: var(--green); }
.td-stock { color: var(--green); }
.td-stock.low { color: var(--amber); }
.td-stock.pre { color: var(--blue); }
.td-rating { color: var(--amber); font-weight: 700; }

.td-cat {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 3px 10px;
  border-radius: 100px;
  display: inline-block;
  color: var(--purple);
  background: var(--purple-dim);
}

.td-cid {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--blue);
  background: var(--blue-dim);
  padding: 2px 8px;
  border-radius: 4px;
}

.td-empty {
  text-align: center;
  padding: 40px !important;
  color: var(--text-4);
}

/* ─── RAG ─── */
.rag-panel {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 28px;
  backdrop-filter: blur(12px);
}

.rag-input-row {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

.rag-field {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 0 16px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.rag-field:focus-within {
  border-color: var(--purple);
  box-shadow: 0 0 16px rgba(167,139,250,0.12);
}
.rag-field i { width: 18px; height: 18px; color: var(--purple); flex-shrink: 0; }
.rag-field input {
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 0.92rem;
  padding: 14px 0;
  outline: none;
  width: 100%;
  font-family: var(--sans);
}

.rag-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.chip {
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--purple);
  background: var(--purple-dim);
  border: 1px solid rgba(167,139,250,0.2);
  padding: 5px 14px;
  border-radius: 100px;
  cursor: pointer;
  transition: all 0.2s var(--ease);
}
.chip:hover {
  background: rgba(167,139,250,0.25);
  border-color: rgba(167,139,250,0.4);
  transform: translateY(-1px);
}

.rag-answer-box {
  background: rgba(167,139,250,0.05);
  border: 1px solid rgba(167,139,250,0.2);
  border-radius: var(--r-md);
  overflow: hidden;
  animation: fadeUp 0.3s var(--ease) both;
}

.rag-answer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: rgba(167,139,250,0.08);
  border-bottom: 1px solid rgba(167,139,250,0.15);
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--purple);
}
.rag-answer-head i { width: 18px; height: 18px; }
.rag-answer-head span { display: flex; align-items: center; gap: 8px; }

.rag-badge {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--text-4);
  background: rgba(0,0,0,0.3);
  padding: 3px 10px;
  border-radius: 100px;
}

.rag-answer-body {
  padding: 18px;
  font-family: var(--sans);
  font-size: 0.92rem;
  line-height: 1.7;
  color: var(--text-2);
  white-space: pre-wrap;
}

/* ─── MODAL ─── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(10px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: modalIn 0.25s var(--ease) both;
}
@keyframes modalIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-panel {
  background: #0c111b;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  width: 100%;
  max-width: 480px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.5);
  animation: modalSlide 0.3s var(--spring) both;
}
@keyframes modalSlide {
  from { opacity: 0; transform: scale(0.95) translateY(16px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}
.modal-top h3 {
  font-family: var(--heading);
  font-size: 1.1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-form {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.modal-form label span {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.modal-form input, .modal-form textarea {
  background: rgba(0,0,0,0.4);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 14px;
  border-radius: var(--r-sm);
  font-size: 0.9rem;
  font-family: var(--sans);
  outline: none;
  transition: border-color 0.2s;
}
.modal-form input:focus, .modal-form textarea:focus { border-color: var(--blue); }
.modal-form textarea { resize: vertical; min-height: 70px; }

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 8px;
}

.hidden { display: none !important; }

/* ─── FOOTER ─── */
.site-footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--border);
  padding: 32px 28px;
  text-align: center;
  color: var(--text-4);
  font-size: 0.85rem;
  max-width: 1360px;
  margin: 60px auto 0;
}
.footer-sub {
  margin-top: 4px;
  font-size: 0.75rem;
}
.footer-sub code {
  font-family: var(--mono);
  color: var(--blue);
}

/* ─── RESPONSIVE ─── */
@media (max-width: 900px) {
  .nav-links { display: none; }
  .pipeline-visual { flex-wrap: wrap; justify-content: center; }
  .pipeline-connector { width: 24px; }
  .hero-actions { flex-direction: column; }
  .hero-actions .btn { width: 100%; }
  .collectors-grid { grid-template-columns: 1fr; }
  .metrics-bar { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
  .nav-inner { padding: 0 16px; }
  .hero-section { padding: 40px 16px 24px; }
  .metrics-bar { grid-template-columns: 1fr; padding: 0 16px; }
  .content-section { padding: 0 16px; }
  .terminal-section { padding: 0 16px; }
  .pipeline-visual { gap: 6px; }
  .pipeline-step { min-width: 80px; padding: 12px 10px; }
  .pipeline-connector { width: 16px; }
  .brand-tagline { display: none; }
}
