/* Retriev Design System — SaaS Professional */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  /* Backgrounds */
  --bg: #09090b;
  --bg-2: #18181b;
  --bg-3: #27272a;
  
  /* Text */
  --text: #fafafa;
  --text-2: #a1a1aa;
  --text-3: #71717a;
  
  /* Brand */
  --brand: #6366f1;
  --brand-hover: #4f46e5;
  --brand-subtle: rgba(99, 102, 241, 0.08);
  
  /* Semantic */
  --success: #22c55e;
  --warning: #eab308;
  --error: #ef4444;
  
  /* Borders */
  --border: #27272a;
  --border-2: #3f3f46;
  
  /* Radius */
  --radius: 8px;
  --radius-lg: 12px;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.4);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.5);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.6);
  --shadow-glow: 0 0 40px rgba(99, 102, 241, 0.15);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Typography */
h1, h2, h3, h4, h5 { 
  font-weight: 700; 
  letter-spacing: -0.02em; 
  line-height: 1.1;
  color: var(--text);
}

h1 { font-size: clamp(2.5rem, 5vw, 3.5rem); font-weight: 800; }
h2 { font-size: clamp(1.75rem, 3vw, 2.25rem); }
h3 { font-size: 1.25rem; }
h4 { font-size: 1rem; font-weight: 600; }

p { color: var(--text-2); font-size: 1rem; }
.text-sm { font-size: 0.875rem; }
.text-lg { font-size: 1.125rem; }

a { color: var(--brand); text-decoration: none; transition: color 0.15s; }
a:hover { color: var(--brand-hover); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius);
  border: none;
  font-size: 0.9375rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--brand);
  color: white;
}
.btn-primary:hover {
  background: var(--brand-hover);
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.3);
}

.btn-ghost {
  background: transparent;
  color: var(--text-2);
  border: 1px solid var(--border-2);
}
.btn-ghost:hover {
  color: var(--text);
  border-color: var(--text-3);
  background: var(--bg-2);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 0.875rem;
}

.btn-lg {
  padding: 14px 28px;
  font-size: 1rem;
}

/* Icons (inline SVG system) */
.icon {
  display: inline-block;
  width: 20px;
  height: 20px;
  vertical-align: middle;
  stroke: currentColor;
  stroke-width: 1.5;
  fill: none;
}
.icon-sm { width: 16px; height: 16px; }
.icon-lg { width: 24px; height: 24px; }

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

/* Metrics */
.metric-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}
.metric-value {
  font-size: 2rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  line-height: 1;
}
.metric-change {
  font-size: 0.875rem;
  font-weight: 500;
  margin-top: 4px;
}
.metric-change.positive { color: var(--success); }
.metric-change.negative { color: var(--error); }

/* Layout */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}
.container-sm { max-width: 720px; }
.container-lg { max-width: 1400px; }

.section {
  padding: 80px 0;
}
.section-sm { padding: 48px 0; }
.section-lg { padding: 120px 0; }

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

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

/* Flex utilities */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-4 { gap: 16px; }
.gap-6 { gap: 24px; }
.gap-8 { gap: 32px; }

/* Dividers */
.divider {
  height: 1px;
  background: var(--border);
  margin: 48px 0;
}

/* Tables */
.table {
  width: 100%;
  border-collapse: collapse;
}
.table th {
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
.table td {
  padding: 16px;
  border-bottom: 1px solid var(--border);
  font-size: 0.9375rem;
}

/* Forms */
.input {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.15s;
}
.input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-subtle);
}
.input::placeholder { color: var(--text-3); }

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

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 9999px;
  background: var(--brand-subtle);
  color: var(--brand);
}
.badge-success { background: rgba(34, 197, 94, 0.1); color: var(--success); }
.badge-warning { background: rgba(234, 179, 8, 0.1); color: var(--warning); }
.badge-error { background: rgba(239, 68, 68, 0.1); color: var(--error); }

/* Animations */
@keyframes fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in {
  animation: fade-in 0.4s ease-out forwards;
}

/* Selection */
::selection {
  background: var(--brand);
  color: white;
}