/* ============================================
   AutoPilot IA — Design System
   Dark mode, violet tech branding
   ============================================ */

/* --- Google Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

/* --- CSS Custom Properties --- */
:root {
  --bg: #0a0a12;
  --bg-alt: #12121e;
  --surface: rgba(18, 18, 35, 0.8);
  --surface-hover: rgba(25, 25, 50, 0.9);
  --border: rgba(139, 92, 246, 0.12);
  --border-hover: rgba(139, 92, 246, 0.3);
  --text: #d0d0e0;
  --text-muted: #8888a0;
  --accent: #8b5cf6;
  --accent2: #667eea;
  --accent-rgb: 139, 92, 246;
  --accent-glow: rgba(139, 92, 246, 0.15);
  --white: #ffffff;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', 'Fira Code', monospace;
  --h1: clamp(2.5rem, 5vw, 3.5rem);
  --h2: clamp(1.75rem, 3vw, 2.5rem);
  --h3: clamp(1.25rem, 2vw, 1.5rem);
  --body: 1rem;
  --small: 0.875rem;
  --xs: 0.75rem;
  --section-pad: 100px;
  --container-max: 1200px;
  --radius: 16px;
  --radius-sm: 8px;
  --radius-xs: 6px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 30px rgba(139, 92, 246, 0.15);
}

/* --- Reset --- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  font-size: var(--body);
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img, svg {
  display: block;
  max-width: 100%;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--accent2);
}

ul, ol {
  list-style: none;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  border: none;
  outline: none;
  background: none;
  color: inherit;
}

button {
  cursor: pointer;
}

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
  color: var(--white);
  line-height: 1.2;
  font-weight: 700;
}

h1 { font-size: var(--h1); }
h2 { font-size: var(--h2); }
h3 { font-size: var(--h3); }

.text-gradient {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }
.text-mono { font-family: var(--mono); }

/* --- Layout --- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding: var(--section-pad) 0;
}

.section-header {
  text-align: center;
  margin-bottom: 60px;
}

.section-header h2 {
  margin-bottom: 16px;
}

.section-header p {
  color: var(--text-muted);
  font-size: 1.125rem;
  max-width: 600px;
  margin: 0 auto;
}

.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); }

/* --- Navigation --- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 16px 0;
  transition: all var(--transition);
  background: transparent;
}

.nav.scrolled {
  background: rgba(10, 10, 18, 0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 10px 0;
}

.nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--white);
  text-decoration: none;
}

.nav-logo svg {
  width: 32px;
  height: 32px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-links a {
  color: var(--text-muted);
  font-size: var(--small);
  font-weight: 500;
  transition: color var(--transition);
  text-decoration: none;
}

.nav-links a:hover {
  color: var(--white);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
  cursor: pointer;
  background: none;
  border: none;
}

.nav-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all var(--transition);
}

.nav-mobile {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(10, 10, 18, 0.98);
  backdrop-filter: blur(20px);
  z-index: 999;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 32px;
}

.nav-mobile.active {
  display: flex;
}

.nav-mobile a {
  color: var(--white);
  font-size: 1.25rem;
  font-weight: 500;
  text-decoration: none;
}

.nav-mobile-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: var(--small);
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.btn svg {
  width: 18px;
  height: 18px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: var(--white);
  box-shadow: 0 4px 16px rgba(var(--accent-rgb), 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(var(--accent-rgb), 0.45);
  color: var(--white);
}

.btn-secondary {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--border-hover);
}

.btn-secondary:hover {
  background: var(--accent-glow);
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  padding: 8px 16px;
}

.btn-ghost:hover {
  color: var(--white);
  background: rgba(255, 255, 255, 0.05);
}

.btn-lg {
  padding: 16px 36px;
  font-size: var(--body);
  border-radius: 12px;
}

.btn-sm {
  padding: 8px 16px;
  font-size: var(--xs);
}

.btn-full {
  width: 100%;
}

.btn-google {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  width: 100%;
  padding: 12px 24px;
}

.btn-google:hover {
  background: var(--surface-hover);
  border-color: var(--border-hover);
  color: var(--text);
}

.btn-google svg {
  width: 20px;
  height: 20px;
}

/* --- Cards --- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  transition: all var(--transition);
  backdrop-filter: blur(10px);
}

.card:hover {
  border-color: var(--border-hover);
  background: var(--surface-hover);
  transform: translateY(-4px);
  box-shadow: var(--shadow-glow);
}

.card-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--accent-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

.card-icon svg {
  width: 24px;
  height: 24px;
  color: var(--accent);
}

.card h3 {
  margin-bottom: 12px;
  font-size: 1.125rem;
}

.card p {
  color: var(--text-muted);
  font-size: var(--small);
  line-height: 1.6;
}

/* --- Hero --- */
.hero {
  padding: 160px 0 var(--section-pad);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -200px;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 800px;
  background: radial-gradient(circle, rgba(var(--accent-rgb), 0.08) 0%, transparent 70%);
  pointer-events: none;
}

.hero h1 {
  margin-bottom: 24px;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.hero p {
  font-size: 1.125rem;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto 40px;
  line-height: 1.8;
}

.hero-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

/* --- Features Grid --- */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

/* --- Pricing --- */
.pricing-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 60px;
}

.pricing-toggle span {
  font-size: var(--small);
  color: var(--text-muted);
  font-weight: 500;
}

.pricing-toggle span.active {
  color: var(--white);
}

.toggle-switch {
  position: relative;
  width: 52px;
  height: 28px;
  cursor: pointer;
}

.toggle-switch input {
  display: none;
}

.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  transition: all var(--transition);
}

.toggle-slider::before {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  transition: all var(--transition);
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(24px);
}

.pricing-badge {
  display: inline-block;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: var(--white);
  font-size: var(--xs);
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 20px;
  margin-left: 8px;
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  align-items: start;
}

.pricing-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px 32px;
  text-align: center;
  transition: all var(--transition);
  position: relative;
}

.pricing-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-4px);
}

.pricing-card.featured {
  border-color: var(--accent);
  background: linear-gradient(180deg, rgba(139, 92, 246, 0.08) 0%, var(--surface) 100%);
  box-shadow: var(--shadow-glow);
  transform: scale(1.04);
}

.pricing-card.featured:hover {
  transform: scale(1.04) translateY(-4px);
}

.pricing-card-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: var(--white);
  font-size: var(--xs);
  font-weight: 600;
  padding: 4px 16px;
  border-radius: 20px;
}

.pricing-card h3 {
  margin-bottom: 8px;
}

.pricing-card .price {
  font-size: 3rem;
  font-weight: 800;
  color: var(--white);
  line-height: 1;
  margin: 20px 0 8px;
}

.pricing-card .price-period {
  color: var(--text-muted);
  font-size: var(--small);
  margin-bottom: 32px;
}

.pricing-card .price span.currency {
  font-size: 1.5rem;
  vertical-align: top;
  margin-right: 2px;
}

.pricing-features {
  text-align: left;
  margin-bottom: 32px;
}

.pricing-features li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  font-size: var(--small);
  color: var(--text);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.pricing-features li:last-child {
  border-bottom: none;
}

.pricing-features li svg {
  width: 18px;
  height: 18px;
  color: var(--success);
  flex-shrink: 0;
}

/* --- Testimonials --- */
.testimonials-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.testimonial-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  transition: all var(--transition);
}

.testimonial-card:hover {
  border-color: var(--border-hover);
}

.testimonial-stars {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
}

.testimonial-stars svg {
  width: 16px;
  height: 16px;
  color: var(--warning);
  fill: var(--warning);
}

.testimonial-card blockquote {
  font-size: var(--small);
  color: var(--text);
  line-height: 1.7;
  margin-bottom: 20px;
  font-style: italic;
}

.testimonial-author {
  display: flex;
  align-items: center;
  gap: 12px;
}

.testimonial-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: var(--small);
  color: var(--white);
}

.testimonial-author-info strong {
  display: block;
  color: var(--white);
  font-size: var(--small);
}

.testimonial-author-info span {
  color: var(--text-muted);
  font-size: var(--xs);
}

/* --- FAQ Accordion --- */
.faq-list {
  max-width: 720px;
  margin: 0 auto;
}

.faq-item {
  border-bottom: 1px solid var(--border);
}

.faq-item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 0;
  cursor: pointer;
  font-weight: 600;
  color: var(--white);
  list-style: none;
  transition: color var(--transition);
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: '';
  width: 20px;
  height: 20px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%238888a0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  transition: transform var(--transition);
  flex-shrink: 0;
}

.faq-item[open] summary::after {
  transform: rotate(180deg);
}

.faq-item summary:hover {
  color: var(--accent);
}

.faq-item .faq-answer {
  padding: 0 0 20px;
  color: var(--text-muted);
  font-size: var(--small);
  line-height: 1.7;
}

/* --- Auth Pages --- */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  position: relative;
}

.auth-page::before {
  content: '';
  position: absolute;
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(var(--accent-rgb), 0.06) 0%, transparent 70%);
  pointer-events: none;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px;
  position: relative;
  backdrop-filter: blur(10px);
}

.auth-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 32px;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--white);
  text-decoration: none;
}

.auth-logo svg {
  width: 32px;
  height: 32px;
}

.auth-card h2 {
  text-align: center;
  margin-bottom: 8px;
  font-size: 1.5rem;
}

.auth-card .auth-subtitle {
  text-align: center;
  color: var(--text-muted);
  margin-bottom: 32px;
  font-size: var(--small);
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 24px 0;
  color: var(--text-muted);
  font-size: var(--xs);
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.auth-footer {
  text-align: center;
  margin-top: 24px;
  font-size: var(--small);
  color: var(--text-muted);
}

.auth-footer a {
  color: var(--accent);
  font-weight: 500;
}

.auth-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: var(--small);
}

/* --- Form Elements --- */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: var(--small);
  font-weight: 500;
  color: var(--text);
  margin-bottom: 8px;
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--white);
  font-size: var(--body);
  transition: all var(--transition);
}

.form-input::placeholder {
  color: var(--text-muted);
}

.form-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.15);
}

.form-input:hover {
  border-color: var(--border-hover);
}

.form-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--small);
  color: var(--text-muted);
  cursor: pointer;
}

.form-checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  cursor: pointer;
}

select.form-input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238888a0' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 40px;
}

textarea.form-input {
  resize: vertical;
  min-height: 100px;
}

.form-error {
  font-size: var(--xs);
  color: var(--danger);
  margin-top: 6px;
}

/* --- Dashboard Layout --- */
.dashboard {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 260px;
  background: var(--bg-alt);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  transition: transform var(--transition);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 24px;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--white);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
}

.sidebar-logo svg {
  width: 28px;
  height: 28px;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: var(--small);
  font-weight: 500;
  text-decoration: none;
  transition: all var(--transition);
  margin-bottom: 4px;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
  color: var(--white);
  background: var(--accent-glow);
}

.sidebar-nav a.active {
  color: var(--accent);
}

.sidebar-nav a svg {
  width: 20px;
  height: 20px;
}

.sidebar-user {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: var(--small);
  color: var(--white);
  flex-shrink: 0;
}

.sidebar-user-info {
  flex: 1;
  min-width: 0;
}

.sidebar-user-info strong {
  display: block;
  font-size: var(--small);
  color: var(--white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-info span {
  font-size: var(--xs);
  color: var(--text-muted);
}

/* --- Dashboard Main --- */
.dashboard-main {
  flex: 1;
  margin-left: 260px;
  min-height: 100vh;
}

.dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 32px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 50;
}

.dashboard-header-left h1 {
  font-size: 1.5rem;
  margin-bottom: 2px;
}

.dashboard-header-left span {
  color: var(--text-muted);
  font-size: var(--small);
}

.dashboard-header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.dashboard-search {
  position: relative;
}

.dashboard-search input {
  padding: 8px 16px 8px 38px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--white);
  font-size: var(--small);
  width: 240px;
  transition: all var(--transition);
}

.dashboard-search input:focus {
  border-color: var(--accent);
  width: 300px;
}

.dashboard-search svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-muted);
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: all var(--transition);
  position: relative;
  background: none;
  border: none;
  cursor: pointer;
}

.icon-btn:hover {
  color: var(--white);
  background: var(--surface);
}

.icon-btn svg {
  width: 20px;
  height: 20px;
}

.icon-btn .notification-dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 8px;
  height: 8px;
  background: var(--danger);
  border-radius: 50%;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: var(--small);
  color: var(--white);
  cursor: pointer;
}

.dashboard-content {
  padding: 32px;
}

/* --- KPI Cards --- */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 32px;
}

.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: all var(--transition);
}

.kpi-card:hover {
  border-color: var(--border-hover);
}

.kpi-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.kpi-card-header span {
  font-size: var(--small);
  color: var(--text-muted);
  font-weight: 500;
}

.kpi-card-header svg {
  width: 20px;
  height: 20px;
  color: var(--accent);
}

.kpi-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--white);
  line-height: 1;
  margin-bottom: 4px;
}

.kpi-change {
  font-size: var(--xs);
  font-weight: 500;
}

.kpi-change.positive { color: var(--success); }
.kpi-change.negative { color: var(--danger); }

/* --- Chart Cards --- */
.charts-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
  margin-bottom: 32px;
}

.chart-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.chart-card h3 {
  font-size: 1rem;
  margin-bottom: 20px;
}

.chart-card canvas {
  width: 100% !important;
}

/* --- Data Table --- */
.data-table-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 32px;
}

.data-table-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
}

.data-table-header h3 {
  font-size: 1rem;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table thead {
  background: rgba(255, 255, 255, 0.03);
}

.data-table th {
  padding: 12px 24px;
  text-align: left;
  font-size: var(--xs);
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border);
}

.data-table td {
  padding: 14px 24px;
  font-size: var(--small);
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.data-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.data-table tr:last-child td {
  border-bottom: none;
}

/* --- Badges --- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: var(--xs);
  font-weight: 600;
}

.badge-success {
  background: rgba(16, 185, 129, 0.12);
  color: var(--success);
}

.badge-warning {
  background: rgba(245, 158, 11, 0.12);
  color: var(--warning);
}

.badge-danger {
  background: rgba(239, 68, 68, 0.12);
  color: var(--danger);
}

.badge-info {
  background: rgba(102, 126, 234, 0.12);
  color: var(--accent2);
}

/* --- Activity Feed --- */
.activity-feed {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.activity-feed h3 {
  font-size: 1rem;
  margin-bottom: 20px;
}

.activity-item {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.activity-item:last-child {
  border-bottom: none;
}

.activity-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: 6px;
  flex-shrink: 0;
}

.activity-dot.green { background: var(--success); }
.activity-dot.blue { background: var(--accent2); }
.activity-dot.orange { background: var(--warning); }
.activity-dot.purple { background: var(--accent); }

.activity-text {
  flex: 1;
  font-size: var(--small);
  color: var(--text);
}

.activity-time {
  font-size: var(--xs);
  color: var(--text-muted);
  white-space: nowrap;
}

/* --- Footer --- */
.footer {
  border-top: 1px solid var(--border);
  padding: 60px 0 40px;
  background: var(--bg-alt);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}

.footer-brand p {
  color: var(--text-muted);
  font-size: var(--small);
  margin-top: 12px;
  max-width: 280px;
  line-height: 1.6;
}

.footer-col h4 {
  font-size: var(--small);
  margin-bottom: 16px;
  color: var(--white);
}

.footer-col a {
  display: block;
  color: var(--text-muted);
  font-size: var(--small);
  padding: 4px 0;
  transition: color var(--transition);
  text-decoration: none;
}

.footer-col a:hover {
  color: var(--accent);
}

.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text-muted);
  font-size: var(--xs);
}

/* --- Toast Notifications --- */
.toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: var(--small);
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.3s ease, toastOut 0.3s ease 3.7s forwards;
  min-width: 300px;
  max-width: 420px;
}

.toast.success { border-left: 3px solid var(--success); }
.toast.error { border-left: 3px solid var(--danger); }
.toast.warning { border-left: 3px solid var(--warning); }
.toast.info { border-left: 3px solid var(--accent2); }

.toast svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.toast.success svg { color: var(--success); }
.toast.error svg { color: var(--danger); }
.toast.warning svg { color: var(--warning); }
.toast.info svg { color: var(--accent2); }

.toast-close {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
}

@keyframes toastIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes toastOut {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(100%); opacity: 0; }
}

/* --- 404 Page --- */
.error-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 24px;
}

.error-code {
  font-size: clamp(6rem, 15vw, 12rem);
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
  margin-bottom: 16px;
}

.error-page h2 {
  margin-bottom: 12px;
}

.error-page p {
  color: var(--text-muted);
  margin-bottom: 32px;
  max-width: 400px;
}

/* --- Animations --- */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* --- Sidebar Toggle (Mobile) --- */
.sidebar-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
  padding: 8px;
}

.sidebar-toggle svg {
  width: 24px;
  height: 24px;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 90;
}

.sidebar-overlay.active {
  display: block;
}

/* --- Responsive: 1024px --- */
@media (max-width: 1024px) {
  :root {
    --section-pad: 80px;
  }

  .features-grid,
  .pricing-grid,
  .testimonials-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .pricing-card.featured {
    transform: none;
  }

  .pricing-card.featured:hover {
    transform: translateY(-4px);
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }

  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .charts-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-search input {
    width: 180px;
  }

  .dashboard-search input:focus {
    width: 220px;
  }
}

/* --- Responsive: 768px --- */
@media (max-width: 768px) {
  :root {
    --section-pad: 60px;
  }

  .nav-links,
  .nav-actions .btn-ghost {
    display: none;
  }

  .nav-hamburger {
    display: flex;
  }

  .features-grid,
  .testimonials-grid {
    grid-template-columns: 1fr;
  }

  .pricing-grid {
    grid-template-columns: 1fr;
    max-width: 420px;
    margin: 0 auto;
  }

  .hero {
    padding: 120px 0 60px;
  }

  .hero-actions {
    flex-direction: column;
  }

  .hero-actions .btn {
    width: 100%;
    max-width: 300px;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }

  /* Dashboard mobile */
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .dashboard-main {
    margin-left: 0;
  }

  .sidebar-toggle {
    display: block;
  }

  .dashboard-header {
    padding: 16px 20px;
  }

  .dashboard-content {
    padding: 20px;
  }

  .kpi-grid {
    grid-template-columns: 1fr 1fr;
  }

  .dashboard-search {
    display: none;
  }

  .data-table-card {
    overflow-x: auto;
  }

  .data-table {
    min-width: 600px;
  }
}

/* --- Responsive: 480px --- */
@media (max-width: 480px) {
  :root {
    --section-pad: 48px;
  }

  .container {
    padding: 0 16px;
  }

  .hero h1 {
    font-size: 2rem;
  }

  .kpi-grid {
    grid-template-columns: 1fr;
  }

  .auth-card {
    padding: 28px 20px;
  }

  .section-header {
    margin-bottom: 40px;
  }
}

/* --- Utility Classes --- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

.hidden { display: none !important; }
.flex { display: flex; }
.items-center { align-items: center; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
