:root {
  --bg-app: #09090b;
  --bg-card: #18181b;
  --bg-input: #27272a;
  --border-color: #3f3f46;
  --text-main: #fafafa;
  --text-muted: #a1a1aa;
  --primary: #10b981;
  --primary-hover: #059669;
  --accent: #06b6d4;
  --primary-gradient: linear-gradient(135deg, #10b981 0%, #06b6d4 100%);
  --danger: #ef4444;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-glow: 0 0 20px rgba(16, 185, 129, 0.3);
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  background-color: var(--bg-app);
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  margin: 0 0 0.5em 0;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--text-main);
}

p {
  margin: 0 0 1em 0;
  color: var(--text-muted);
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--accent);
}

/* Utilities */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
}

.container-sm {
  max-width: 480px;
}

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-gradient {
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.font-bold { font-weight: 700; }

.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-2 { gap: 0.5rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }

.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-8 { margin-top: 2rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-8 { margin-bottom: 2rem; }

/* Components */
.card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-lg);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  font-size: 1rem;
}

.btn-primary {
  background: var(--primary-gradient);
  color: white;
  box-shadow: var(--shadow-glow);
}

.btn-primary:hover {
  opacity: 0.9;
  transform: translateY(-2px);
  box-shadow: 0 0 30px rgba(16, 185, 129, 0.4);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-main);
}

.btn-outline:hover {
  border-color: var(--text-muted);
  background: rgba(255,255,255,0.05);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
}

.btn-ghost:hover {
  color: var(--text-main);
  background: rgba(255,255,255,0.05);
}

.btn-block {
  width: 100%;
}

.input-group {
  margin-bottom: 16px;
}

.label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
}

.input {
  width: 100%;
  padding: 12px 16px;
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 1rem;
  transition: border-color 0.2s;
}

.input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}

/* Nav */
.navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(9, 9, 11, 0.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  padding: 16px 0;
}

.nav-link {
  color: var(--text-muted);
  font-weight: 500;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
}

.nav-link:hover, .nav-link.active {
  color: var(--primary);
  background: rgba(16, 185, 129, 0.1);
}

/* Grid & Layouts */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

.grid-3 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

.grid-feed {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}

@media (min-width: 768px) {
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-primary {
  background: rgba(16, 185, 129, 0.1);
  color: var(--primary);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

/* Stats */
.stat-card {
  text-align: center;
  padding: 24px;
}

.stat-value {
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-label {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Progress */
.progress-bar-bg {
  width: 100%;
  height: 8px;
  background: var(--bg-input);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: var(--primary-gradient);
  border-radius: var(--radius-full);
}

/* Workflow Diagram */
.flow-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 0;
  position: relative;
}

.flow-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 600px;
}

.flow-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  width: 100%;
  position: relative;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-md);
}

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

.flow-connector {
  height: 40px;
  width: 2px;
  background: var(--border-color);
  position: relative;
}

.flow-connector::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 8px;
  height: 8px;
  background: var(--border-color);
  border-radius: 50%;
}

.flow-card.active {
  border-color: var(--primary);
  background: rgba(16, 185, 129, 0.05);
}

.flow-icon {
  width: 48px;
  height: 48px;
  background: var(--bg-input);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 16px;
  color: var(--primary);
  border: 1px solid var(--border-color);
}

.tech-badge {
  font-family: monospace;
  font-size: 0.75rem;
  background: rgba(255,255,255,0.05);
  padding: 4px 8px;
  border-radius: 4px;
  color: var(--text-muted);
  border: 1px solid var(--border-color);
}

/* Placeholders */
.placeholder-avatar {
  width: 48px;
  height: 48px;
  background: var(--bg-input);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  color: var(--text-muted);
  border: 1px solid var(--border-color);
}

.placeholder-avatar.lg {
  width: 80px;
  height: 80px;
  font-size: 1.5rem;
}

.placeholder-image {
  width: 100%;
  background-color: var(--bg-input);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.placeholder-image.square {
  aspect-ratio: 1 / 1;
}

.placeholder-image.wide {
  aspect-ratio: 16 / 9;
}

.placeholder-icon {
  width: 24px;
  height: 24px;
  background: var(--border-color);
  border-radius: 4px;
  display: inline-block;
}

/* Bottom Tab Bar (Mobile) */
.mobile-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(24, 24, 27, 0.95);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-around;
  padding: 12px;
  z-index: 100;
}

@media (min-width: 768px) {
  .mobile-nav { display: none; }
}

.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--text-muted);
  font-size: 0.75rem;
}

.mobile-nav-item.active {
  color: var(--primary);
}

.icon-box {
  width: 24px;
  height: 24px;
  border: 2px solid currentColor;
  border-radius: 6px;
}

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

.spinner {
  width: 24px; 
  height: 24px; 
  border: 2px solid var(--primary); 
  border-radius: 50%; 
  border-top-color: transparent; 
  animation: spin 1s linear infinite;
}
