/* ═══════════════════════════════════════════
   Agent Forge - Custom Design System
   Dark theme, no frameworks
   ═══════════════════════════════════════════ */

/* ── Reset & Variables ── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg-900: #0a0b0f;
  --bg-800: #0f1117;
  --bg-700: #151720;
  --bg-600: #1c1e2b;
  --bg-500: #252836;

  --text-100: #f0f1f5;
  --text-200: #c4c7d4;
  --text-300: #8e92a4;
  --text-400: #5c6078;

  --primary-500: #6c5ce7;
  --primary-400: #8577ed;
  --primary-600: #5340d9;
  --primary-glow: rgba(108, 92, 231, 0.25);

  --accent-green: #00d68f;
  --accent-red: #ff4757;
  --accent-yellow: #ffc048;
  --accent-blue: #4dabf7;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.5);

  --transition: 0.2s ease;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--bg-900);
  color: var(--text-200);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary-400); text-decoration: none; }
a:hover { color: var(--primary-500); }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: var(--font);
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.btn-primary {
  background: var(--primary-500);
  color: #fff;
}
.btn-primary:hover {
  background: var(--primary-600);
  box-shadow: 0 0 20px var(--primary-glow);
}

.btn-ghost {
  background: transparent;
  color: var(--text-200);
  border: 1px solid var(--bg-500);
}
.btn-ghost:hover {
  background: var(--bg-600);
  border-color: var(--text-400);
}

.btn-danger {
  background: var(--accent-red);
  color: #fff;
}
.btn-danger:hover { opacity: 0.85; }

.btn-sm { padding: 6px 14px; font-size: 0.8rem; }
.btn-lg { padding: 14px 28px; font-size: 1rem; }
.btn-full { width: 100%; }

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ── Form Elements ── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-300);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-group input,
.form-group select,
.form-group textarea {
  padding: 12px 14px;
  background: var(--bg-700);
  border: 1px solid var(--bg-500);
  border-radius: var(--radius-sm);
  color: var(--text-100);
  font-size: 0.95rem;
  font-family: var(--font);
  transition: border-color var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.form-group textarea { resize: vertical; }

.form-row {
  display: flex;
  gap: 16px;
}

.form-card {
  background: var(--bg-800);
  border: 1px solid var(--bg-600);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-bottom: 20px;
}

.form-card h3 {
  font-size: 1.1rem;
  color: var(--text-100);
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--bg-600);
}

/* ── Tag Input ── */
.tag-input-container {
  background: var(--bg-700);
  border: 1px solid var(--bg-500);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  transition: border-color var(--transition);
}

.tag-input-container:focus-within {
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.tag-input-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: var(--primary-glow);
  color: var(--primary-400);
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
}

.tag-remove {
  cursor: pointer;
  opacity: 0.7;
  font-size: 1rem;
  line-height: 1;
}
.tag-remove:hover { opacity: 1; }

.tag-input {
  border: none !important;
  background: transparent !important;
  padding: 4px !important;
  font-size: 0.9rem !important;
  flex: 1;
  min-width: 120px;
  box-shadow: none !important;
}

/* ── Alerts ── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  margin-bottom: 16px;
}

.alert-error {
  background: rgba(255, 71, 87, 0.1);
  border: 1px solid rgba(255, 71, 87, 0.3);
  color: var(--accent-red);
}

.alert-success {
  background: rgba(0, 214, 143, 0.1);
  border: 1px solid rgba(0, 214, 143, 0.3);
  color: var(--accent-green);
}

/* ═══════════════════════════════════════════
   Landing Page
   ═══════════════════════════════════════════ */
.landing {
  min-height: 100vh;
}

.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 48px;
  max-width: 1280px;
  margin: 0 auto;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text-100);
}

.nav-logo {
  width: 36px;
  height: 36px;
  background: var(--primary-500);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.85rem;
  color: #fff;
}

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

/* Hero */
.hero {
  text-align: center;
  padding: 80px 48px 60px;
  max-width: 900px;
  margin: 0 auto;
}

.hero-badge {
  display: inline-block;
  padding: 6px 16px;
  background: var(--primary-glow);
  color: var(--primary-400);
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 24px;
}

.hero h1 {
  font-size: 3.5rem;
  font-weight: 800;
  color: var(--text-100);
  line-height: 1.15;
  margin-bottom: 20px;
}

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

.hero-sub {
  font-size: 1.15rem;
  color: var(--text-300);
  max-width: 600px;
  margin: 0 auto 32px;
}

.hero-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin-bottom: 60px;
}

/* Pipeline Preview */
.hero-visual {
  padding: 32px;
  background: var(--bg-800);
  border: 1px solid var(--bg-600);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg), 0 0 60px var(--primary-glow);
}

.pipeline-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  flex-wrap: wrap;
}

.preview-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 20px;
  background: var(--bg-700);
  border: 1px solid var(--bg-500);
  border-radius: var(--radius-md);
  min-width: 120px;
  transition: all var(--transition);
}

.preview-node:hover {
  border-color: var(--primary-500);
  transform: translateY(-2px);
}

.node-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.75rem;
}

.node-input .node-icon { background: rgba(77, 171, 247, 0.2); color: var(--accent-blue); }
.node-agent .node-icon { background: var(--primary-glow); color: var(--primary-400); }
.node-output .node-icon { background: rgba(0, 214, 143, 0.2); color: var(--accent-green); }

.preview-node span {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-200);
}

.preview-arrow {
  width: 40px;
  height: 2px;
  background: var(--bg-500);
  position: relative;
}

.preview-arrow::after {
  content: '';
  position: absolute;
  right: 0;
  top: -4px;
  border: 5px solid transparent;
  border-left-color: var(--bg-500);
}

/* Sections */
.section {
  padding: 80px 48px;
  max-width: 1280px;
  margin: 0 auto;
}

.section-dark {
  background: var(--bg-800);
  max-width: 100%;
  margin: 0;
}

.section-dark > * {
  max-width: 1280px;
  margin-left: auto;
  margin-right: auto;
}

.section-title {
  text-align: center;
  font-size: 2rem;
  color: var(--text-100);
  margin-bottom: 48px;
}

/* Steps */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}

.step-card {
  padding: 32px;
  background: var(--bg-800);
  border: 1px solid var(--bg-600);
  border-radius: var(--radius-lg);
  transition: all var(--transition);
}

.step-card:hover {
  border-color: var(--primary-500);
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.step-num {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--primary-500);
  opacity: 0.5;
  margin-bottom: 12px;
}

.step-card h3 {
  font-size: 1.15rem;
  color: var(--text-100);
  margin-bottom: 8px;
}

/* Features */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.feature-card {
  padding: 28px;
  background: var(--bg-700);
  border: 1px solid var(--bg-600);
  border-radius: var(--radius-lg);
  transition: all var(--transition);
}

.feature-card:hover {
  border-color: var(--primary-500);
  transform: translateY(-2px);
}

.feature-icon {
  font-size: 1.8rem;
  margin-bottom: 16px;
  color: var(--primary-400);
}

.feature-card h3 {
  color: var(--text-100);
  margin-bottom: 8px;
}

/* Footer */
.footer {
  padding: 40px 48px;
  border-top: 1px solid var(--bg-600);
}

.footer-content {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-text { color: var(--text-400); font-size: 0.9rem; }

/* ═══════════════════════════════════════════
   Auth Page
   ═══════════════════════════════════════════ */
.auth-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text-100);
  margin-bottom: 40px;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-800);
  border: 1px solid var(--bg-600);
  border-radius: var(--radius-lg);
  padding: 36px;
}

.auth-card h2 {
  font-size: 1.5rem;
  color: var(--text-100);
  margin-bottom: 4px;
}

.auth-sub {
  color: var(--text-400);
  margin-bottom: 28px;
}

.auth-card .form-group { margin-bottom: 16px; }

.auth-card .btn { margin-top: 8px; }

.auth-switch {
  text-align: center;
  margin-top: 20px;
  font-size: 0.9rem;
  color: var(--text-400);
}

/* ═══════════════════════════════════════════
   App Layout (Dashboard, Analysis, Pipelines)
   ═══════════════════════════════════════════ */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 260px;
  background: var(--bg-800);
  border-right: 1px solid var(--bg-600);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text-100);
  padding: 20px 24px;
  border-bottom: 1px solid var(--bg-600);
}

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-300);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all var(--transition);
}

.sidebar-link:hover {
  background: var(--bg-600);
  color: var(--text-100);
}

.sidebar-link.active {
  background: var(--primary-glow);
  color: var(--primary-400);
}

.sidebar-icon { font-size: 1.1rem; }

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--bg-600);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary-500);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
}

.user-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.user-info span:first-child {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-100);
}

.user-email-text {
  font-size: 0.75rem;
  color: var(--text-400);
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Main Content */
.main-content {
  flex: 1;
  margin-left: 260px;
  padding: 32px 40px;
  max-width: 1200px;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
}

.page-header h1 {
  font-size: 1.75rem;
  color: var(--text-100);
}

/* ── Stats Grid ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--bg-800);
  border: 1px solid var(--bg-600);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  transition: all var(--transition);
}

.stat-card:hover {
  border-color: var(--bg-500);
  transform: translateY(-2px);
}

.stat-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-100);
  margin-bottom: 4px;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-400);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-active .stat-value { color: var(--accent-blue); }
.stat-success .stat-value { color: var(--accent-green); }
.stat-error .stat-value { color: var(--accent-red); }

/* ── Content Section ── */
.content-section {
  margin-bottom: 32px;
}

.content-section h2 {
  font-size: 1.2rem;
  color: var(--text-100);
  margin-bottom: 16px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.section-header h2 { margin-bottom: 0; }

/* ── Data Table ── */
.table-container {
  background: var(--bg-800);
  border: 1px solid var(--bg-600);
  border-radius: var(--radius-md);
  overflow: hidden;
}

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

.data-table th {
  text-align: left;
  padding: 12px 16px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-400);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: var(--bg-700);
  border-bottom: 1px solid var(--bg-600);
}

.data-table td {
  padding: 12px 16px;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--bg-700);
}

.data-table tr:last-child td { border-bottom: none; }

.data-table tr:hover td { background: var(--bg-700); }

.table-empty {
  text-align: center;
  padding: 32px !important;
  color: var(--text-400);
}

/* ── Status Badges ── */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.badge-active, .badge-completed, .badge-running {
  background: rgba(0, 214, 143, 0.15);
  color: var(--accent-green);
}

.badge-draft, .badge-pending {
  background: rgba(142, 146, 164, 0.15);
  color: var(--text-300);
}

.badge-paused {
  background: rgba(255, 192, 72, 0.15);
  color: var(--accent-yellow);
}

.badge-error, .badge-failed {
  background: rgba(255, 71, 87, 0.15);
  color: var(--accent-red);
}

/* ── Pipeline Cards ── */
.pipeline-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.pipeline-card {
  background: var(--bg-800);
  border: 1px solid var(--bg-600);
  border-radius: var(--radius-md);
  padding: 24px;
  cursor: pointer;
  transition: all var(--transition);
}

.pipeline-card:hover {
  border-color: var(--primary-500);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.pipeline-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.pipeline-card-header h3 {
  font-size: 1rem;
  color: var(--text-100);
}

.pipeline-card p {
  font-size: 0.85rem;
  color: var(--text-400);
  margin-bottom: 16px;
}

.pipeline-card-meta {
  display: flex;
  gap: 16px;
  font-size: 0.8rem;
  color: var(--text-400);
}

.pipeline-card-meta span { display: flex; align-items: center; gap: 4px; }

/* ── Empty State ── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-400);
  font-size: 0.95rem;
}

/* ── Modal ── */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
}

.modal-content {
  position: relative;
  width: 90%;
  max-width: 700px;
  max-height: 80vh;
  background: var(--bg-800);
  border: 1px solid var(--bg-600);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--bg-600);
}

.modal-header h2 {
  font-size: 1.2rem;
  color: var(--text-100);
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-400);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0 4px;
}
.modal-close:hover { color: var(--text-100); }

.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--bg-600);
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

/* ═══════════════════════════════════════════
   Analysis Results
   ═══════════════════════════════════════════ */
.result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.result-summary {
  background: var(--bg-800);
  border: 1px solid var(--bg-600);
  border-left: 4px solid var(--primary-500);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-bottom: 32px;
  font-size: 0.95rem;
  line-height: 1.7;
}

.recommendations-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 40px;
}

.rec-card {
  background: var(--bg-800);
  border: 1px solid var(--bg-600);
  border-radius: var(--radius-md);
  padding: 20px;
}

.rec-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}

.rec-card h4 {
  color: var(--text-100);
  font-size: 0.95rem;
}

.rec-card .rec-role {
  font-size: 0.85rem;
  color: var(--primary-400);
  margin-bottom: 8px;
}

.rec-card p {
  font-size: 0.85rem;
  color: var(--text-300);
  margin-bottom: 12px;
}

.rec-capabilities {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.rec-cap {
  padding: 3px 8px;
  background: var(--bg-600);
  border-radius: 4px;
  font-size: 0.75rem;
  color: var(--text-300);
}

/* Suggested Pipelines */
.suggested-pipelines {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.suggested-pipeline-card {
  background: var(--bg-800);
  border: 1px solid var(--bg-600);
  border-radius: var(--radius-md);
  padding: 24px;
}

.suggested-pipeline-card h4 {
  color: var(--text-100);
  margin-bottom: 8px;
}

.suggested-pipeline-card > p {
  color: var(--text-300);
  font-size: 0.9rem;
  margin-bottom: 16px;
}

.pipeline-flow {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 16px;
  background: var(--bg-700);
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  overflow-x: auto;
}

.flow-node {
  padding: 10px 16px;
  background: var(--bg-600);
  border: 1px solid var(--bg-500);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-200);
  white-space: nowrap;
}

.flow-arrow {
  width: 30px;
  height: 2px;
  background: var(--text-400);
  flex-shrink: 0;
  position: relative;
}

.flow-arrow::after {
  content: '';
  position: absolute;
  right: 0;
  top: -3px;
  border: 4px solid transparent;
  border-left-color: var(--text-400);
}

.suggested-pipeline-card .pipeline-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.pipeline-meta .savings {
  color: var(--accent-green);
  font-weight: 600;
  font-size: 0.9rem;
}

/* ── Agent Detail in Modal ── */
.agent-chain {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.agent-detail-card {
  background: var(--bg-700);
  border: 1px solid var(--bg-600);
  border-radius: var(--radius-sm);
  padding: 16px;
}

.agent-detail-card h4 {
  color: var(--text-100);
  margin-bottom: 4px;
}

.agent-detail-card .agent-role {
  color: var(--primary-400);
  font-size: 0.85rem;
  margin-bottom: 8px;
}

.agent-detail-card .agent-prompt {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-300);
  background: var(--bg-900);
  padding: 10px;
  border-radius: 4px;
  max-height: 100px;
  overflow-y: auto;
  white-space: pre-wrap;
}

/* ── Loading Spinner ── */
.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--bg-500);
  border-top-color: var(--primary-500);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(10, 11, 15, 0.8);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  z-index: 2000;
  color: var(--text-200);
}

.loading-overlay .spinner {
  width: 40px;
  height: 40px;
  border-width: 3px;
}

/* ═══════════════════════════════════════════
   Pipelines List Page
   ═══════════════════════════════════════════ */
.pipelines-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pipeline-list-item {
  background: var(--bg-800);
  border: 1px solid var(--bg-600);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all var(--transition);
  cursor: pointer;
}

.pipeline-list-item:hover {
  border-color: var(--primary-500);
}

.pipeline-list-info {
  flex: 1;
}

.pipeline-list-info h3 {
  color: var(--text-100);
  font-size: 1rem;
  margin-bottom: 4px;
}

.pipeline-list-info p {
  color: var(--text-400);
  font-size: 0.85rem;
}

.pipeline-list-info .meta {
  display: flex;
  gap: 16px;
  margin-top: 8px;
  font-size: 0.8rem;
  color: var(--text-400);
}

.pipeline-list-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* ═══════════════════════════════════════════
   Responsive
   ═══════════════════════════════════════════ */
@media (max-width: 1024px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .features-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .hero h1 { font-size: 2.2rem; }
  .steps-grid { grid-template-columns: 1fr; }
  .features-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr; }
  .form-row { flex-direction: column; }

  .sidebar {
    width: 100%;
    position: relative;
    flex-direction: row;
    align-items: center;
    padding: 12px;
    border-right: none;
    border-bottom: 1px solid var(--bg-600);
  }

  .sidebar-brand { display: none; }
  .sidebar-nav { flex-direction: row; padding: 0; flex: 1; }
  .sidebar-footer { display: none; }

  .main-content {
    margin-left: 0;
    padding: 20px;
  }

  .app-layout { flex-direction: column; }

  .nav { padding: 16px 20px; }
  .hero { padding: 40px 20px; }
  .section { padding: 40px 20px; }

  .pipeline-preview { flex-direction: column; gap: 0; }
  .preview-arrow {
    width: 2px;
    height: 30px;
  }
  .preview-arrow::after {
    right: -4px;
    top: auto;
    bottom: 0;
    border: 5px solid transparent;
    border-top-color: var(--bg-500);
    border-left-color: transparent;
  }

  .pipeline-list-item { flex-direction: column; align-items: flex-start; gap: 12px; }
}
