:root {
  --void: #020010;
  --deep: #08041c;
  --nebula: #140a32;
  --panel: #0f0828;
  --border: #4a2f9e;
  --glow: #6b3fcf;
  --cyan: #00f5ff;
  --magenta: #ff2bd6;
  --purple: #b24bf3;
  --gold: #ffd166;
  --success: #00ff9f;
  --danger: #ff3366;
  --warning: #ffb347;
  --text: #e8ecff;
  --dim: #9aa8cc;
  --console-bg: #04011a;
  --console-text: #00ffcc;
}

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

body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: var(--void);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

/* Global shell (base.html — all SaaS pages) */
.global-stars {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.scanlines {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 245, 255, 0.015) 2px,
    rgba(0, 245, 255, 0.015) 4px
  );
  opacity: 0.4;
}

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(2, 0, 16, 0.75);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(74, 47, 158, 0.35);
}

.site-header .nav-wrap { padding: 0 24px; }
.site-header .nav { border: none; padding: 16px 0; }

.logo { display: flex; align-items: center; gap: 12px; }
.logo-img { width: 40px; height: 40px; border-radius: 10px; object-fit: contain; }
.logo span {
  font-size: 1.15rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--cyan), var(--magenta));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

main {
  position: relative;
  z-index: 2;
  padding-top: 72px;
}

.site-footer {
  position: relative;
  z-index: 2;
  border-top: 1px solid rgba(74, 47, 158, 0.4);
  background: rgba(2, 0, 16, 0.9);
  padding: 48px 0 32px;
}

.footer-grid {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 32px;
  margin-bottom: 32px;
}

.footer-tag { color: var(--dim); font-size: 0.9rem; max-width: 280px; }
.footer-links { display: flex; gap: 24px; flex-wrap: wrap; }
.footer-links a { color: var(--dim); font-size: 0.9rem; }
.footer-links a:hover { color: var(--cyan); text-decoration: none; }
.footer-copy { color: var(--dim); font-size: 0.8rem; opacity: 0.7; }

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 20%, rgba(107,63,207,.15) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(0,245,255,.08) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(255,43,214,.05) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; position: relative; z-index: 1; }

/* Nav */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 0;
  border-bottom: 1px solid rgba(74,47,158,.4);
}
.logo {
  font-size: 1.4rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--cyan), var(--magenta));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.nav-links { display: flex; gap: 24px; align-items: center; }
.nav-links a { color: var(--dim); font-size: .95rem; }
.nav-links a:hover { color: var(--cyan); text-decoration: none; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 28px;
  border-radius: 10px;
  font-weight: 700;
  font-size: .95rem;
  border: none;
  cursor: pointer;
  transition: all .25s;
  text-decoration: none;
}
.btn-primary {
  background: linear-gradient(135deg, var(--glow), var(--cyan));
  color: var(--void);
  box-shadow: 0 0 24px rgba(0,245,255,.3);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 0 36px rgba(0,245,255,.5); text-decoration: none; }
.btn-ghost {
  background: transparent;
  color: var(--cyan);
  border: 2px solid var(--cyan);
}
.btn-ghost:hover { background: rgba(0,245,255,.1); text-decoration: none; }
.btn-sm { padding: 8px 16px; font-size: .85rem; }

/* Hero */
.hero {
  text-align: center;
  padding: 80px 0 60px;
}
.hero h1 {
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 20px;
  background: linear-gradient(135deg, #fff 0%, var(--cyan) 50%, var(--magenta) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero p { font-size: 1.25rem; color: var(--dim); max-width: 640px; margin: 0 auto 36px; }
.pills { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-bottom: 40px; }
.pill {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: .8rem;
  font-weight: 700;
  background: var(--nebula);
  border: 1px solid var(--border);
  color: var(--cyan);
}

/* Features grid */
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; padding: 60px 0; }
.feature-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  transition: border-color .3s, transform .3s;
}
.feature-card:hover { border-color: var(--cyan); transform: translateY(-4px); }
.feature-card h3 { color: var(--gold); margin-bottom: 10px; font-size: 1.1rem; }
.feature-card p { color: var(--dim); font-size: .95rem; line-height: 1.6; }

/* Pricing */
.pricing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 28px; padding: 60px 0 80px; }
.price-card {
  background: var(--panel);
  border: 2px solid var(--border);
  border-radius: 20px;
  padding: 36px 28px;
  text-align: center;
  position: relative;
}
.price-card.featured { border-color: var(--cyan); box-shadow: 0 0 40px rgba(0,245,255,.2); }
.price-card h3 { font-size: 1.3rem; margin-bottom: 8px; }
.price-card .amount { font-size: 3rem; font-weight: 800; color: var(--cyan); }
.price-card .amount span { font-size: 1rem; color: var(--dim); }
.price-card ul { list-style: none; margin: 24px 0; text-align: left; }
.price-card li { padding: 8px 0; color: var(--dim); border-bottom: 1px solid rgba(74,47,158,.3); }
.price-card li::before { content: '✦ '; color: var(--success); }

/* Auth */
.auth-wrap {
  min-height: calc(100vh - 80px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 0;
}
.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--panel);
  border: 2px solid var(--border);
  border-radius: 20px;
  padding: 40px 36px;
}
.auth-brand {
  text-align: center;
  margin-bottom: 28px;
}
.auth-brand a {
  display: inline-block;
  text-decoration: none;
}
.auth-logo {
  display: block;
  width: auto;
  height: 88px;
  max-width: 260px;
  margin: 0 auto 16px;
  object-fit: contain;
  filter: drop-shadow(0 0 24px rgba(0, 245, 255, 0.25));
}
.auth-brand h2 {
  text-align: center;
  margin: 0;
  color: var(--cyan);
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}
.auth-card h2 { text-align: center; margin-bottom: 28px; color: var(--cyan); }
.form-group { margin-bottom: 20px; }
.form-group label { display: block; margin-bottom: 8px; color: var(--dim); font-size: .9rem; }
.form-group input {
  width: 100%;
  padding: 14px 16px;
  background: var(--console-bg);
  border: 2px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 1rem;
}
.form-group input:focus { outline: none; border-color: var(--cyan); }
.flash { padding: 12px 16px; border-radius: 8px; margin-bottom: 20px; font-size: .9rem; }
.flash.error { background: rgba(255,51,102,.15); border: 1px solid var(--danger); color: var(--danger); }
.flash.success { background: rgba(0,255,159,.1); border: 1px solid var(--success); color: var(--success); }

/* Dashboard layout */
.dash-layout {
  display: grid;
  grid-template-columns: 340px 1fr 280px;
  gap: 16px;
  padding: 20px 0 40px;
  min-height: calc(100vh - 70px);
}
@media (max-width: 1100px) {
  .dash-layout { grid-template-columns: 1fr; }
}

.panel {
  background: var(--panel);
  border: 2px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
}
.panel-hdr {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  font-weight: 700;
  font-size: .85rem;
  color: var(--gold);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.panel-body { padding: 14px; }

/* Action cards */
.tabs { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px; border-bottom: 1px solid var(--border); }
.tab {
  padding: 6px 12px;
  border-radius: 8px;
  font-size: .75rem;
  font-weight: 700;
  background: var(--nebula);
  border: 1px solid transparent;
  color: var(--dim);
  cursor: pointer;
}
.tab.active { background: var(--glow); color: #fff; border-color: var(--cyan); }
.action-list { max-height: calc(100vh - 220px); overflow-y: auto; padding: 8px; }
.action-card {
  background: var(--nebula);
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: all .2s;
}
.action-card:hover { border-color: var(--cyan); transform: translateX(4px); }
.action-card h4 { font-size: .95rem; margin-bottom: 4px; }
.action-card p { font-size: .8rem; color: var(--dim); line-height: 1.4; }
.action-card .run-btn {
  margin-top: 10px;
  padding: 6px 14px;
  background: var(--glow);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: .75rem;
  font-weight: 700;
  cursor: pointer;
}
.action-card .run-btn:hover { background: var(--cyan); color: var(--void); }

/* Console */
.console {
  background: var(--console-bg);
  border: 1px solid var(--nebula);
  border-radius: 12px;
  padding: 16px;
  font-family: 'Consolas', monospace;
  font-size: .82rem;
  color: var(--console-text);
  height: calc(100vh - 280px);
  min-height: 300px;
  overflow-y: auto;
  white-space: pre-wrap;
  line-height: 1.5;
}
.cmd-bar {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}
.cmd-bar input {
  flex: 1;
  padding: 14px 18px;
  background: var(--console-bg);
  border: 2px solid var(--gold);
  border-radius: 12px;
  color: var(--text);
  font-size: 1rem;
}
.cmd-bar input:focus { outline: none; border-color: var(--cyan); }

/* Telemetry */
.metric-row { display: flex; gap: 10px; margin-bottom: 14px; }
.metric-ring {
  flex: 1;
  text-align: center;
  background: var(--deep);
  border-radius: 12px;
  padding: 14px 8px;
  border: 1px solid var(--border);
}
.metric-ring .val { font-size: 1.5rem; font-weight: 800; color: var(--cyan); }
.metric-ring .lbl { font-size: .65rem; color: var(--dim); text-transform: uppercase; letter-spacing: .05em; }
.bar-chart { margin: 12px 0; }
.bar-row { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; font-size: .72rem; }
.bar-label { width: 72px; color: var(--dim); text-overflow: ellipsis; overflow: hidden; white-space: nowrap; }
.bar-track { flex: 1; height: 10px; background: var(--deep); border-radius: 5px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 5px; transition: width .6s ease; }
.bar-val { width: 32px; text-align: right; color: var(--text); font-weight: 700; }
.insight-box {
  background: var(--console-bg);
  border-radius: 10px;
  padding: 12px;
  font-family: Consolas, monospace;
  font-size: .72rem;
  color: var(--console-text);
  max-height: 180px;
  overflow-y: auto;
  white-space: pre-wrap;
  line-height: 1.45;
}
.status-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: .7rem;
  font-weight: 700;
}
.status-badge.live { background: rgba(0,255,159,.15); color: var(--success); }
.status-badge.warn { background: rgba(255,179,71,.15); color: var(--warning); }

.job-row {
  padding: 8px 10px;
  border-bottom: 1px solid rgba(74,47,158,.3);
  font-size: .75rem;
  cursor: pointer;
}
.job-row:hover { background: var(--nebula); }
.job-row .status-completed { color: var(--success); }
.job-row .status-failed { color: var(--danger); }
.job-row .status-running { color: var(--warning); }

/* Legacy footer fallback */
footer:not(.site-footer) {
  text-align: center;
  padding: 40px 0;
  color: var(--dim);
  font-size: .85rem;
}