:root {
  --bg: #0a0a0f;
  --surface: #12121a;
  --surface2: #1c1c28;
  --border: #2a2a3a;
  --text: #e8e8f0;
  --muted: #888899;
  --accent: #7c6af7;
  --accent-hover: #9585ff;
  --green: #22c55e;
  --red: #ef4444;
  --yellow: #f59e0b;
  --radius: 8px;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

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

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

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

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

/* Layout */
.container { max-width: 1100px; margin: 0 auto; padding: 0 24px; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius);
  border: none;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s, background 0.15s;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); }
.btn-outline { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn-outline:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.btn-lg { padding: 14px 28px; font-size: 1rem; }

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

/* Forms */
input[type="email"], input[type="text"], input[type="number"], select {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 1rem;
  padding: 10px 14px;
  outline: none;
  transition: border-color 0.15s;
}
input:focus, select:focus { border-color: var(--accent); }
label { display: block; margin-bottom: 6px; font-size: 0.875rem; color: var(--muted); }
.form-group { margin-bottom: 16px; }

/* Nav */
nav.top-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
}
.logo { font-size: 1.25rem; font-weight: 700; color: var(--text); }
.logo span { color: var(--accent); }
.nav-links { display: flex; gap: 24px; align-items: center; }
.nav-links a { color: var(--muted); font-size: 0.9375rem; }
.nav-links a:hover { color: var(--text); }

/* Landing hero */
.hero {
  text-align: center;
  padding: 100px 0 80px;
}
.hero h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 20px;
}
.hero h1 em { color: var(--accent); font-style: normal; }
.hero p {
  font-size: 1.2rem;
  color: var(--muted);
  max-width: 560px;
  margin: 0 auto 36px;
}
.hero-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* Features */
.features {
  padding: 80px 0;
  border-top: 1px solid var(--border);
}
.features h2 { text-align: center; font-size: 2rem; font-weight: 700; margin-bottom: 48px; }
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
}
.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
}
.feature-icon { font-size: 1.75rem; margin-bottom: 12px; }
.feature-card h3 { font-size: 1.0625rem; font-weight: 600; margin-bottom: 8px; }
.feature-card p { color: var(--muted); font-size: 0.9375rem; line-height: 1.5; }

/* Pricing */
.pricing {
  padding: 80px 0;
  border-top: 1px solid var(--border);
}
.pricing h2 { text-align: center; font-size: 2rem; font-weight: 700; margin-bottom: 48px; }
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  max-width: 700px;
  margin: 0 auto;
}
.pricing-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 28px;
}
.pricing-card.featured { border-color: var(--accent); }
.price { font-size: 2.5rem; font-weight: 800; margin: 12px 0; }
.price span { font-size: 1rem; color: var(--muted); font-weight: 400; }
.price-plan { font-size: 0.875rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent); }
.price-desc { color: var(--muted); font-size: 0.9375rem; margin-bottom: 20px; }
.price-features { list-style: none; margin-bottom: 28px; }
.price-features li { padding: 6px 0; font-size: 0.9375rem; color: var(--muted); }
.price-features li::before { content: '+ '; color: var(--green); font-weight: 700; }

/* FAQ */
.faq { padding: 80px 0; border-top: 1px solid var(--border); }
.faq h2 { text-align: center; font-size: 2rem; font-weight: 700; margin-bottom: 48px; }
.faq-list { max-width: 680px; margin: 0 auto; }
.faq-item { border-bottom: 1px solid var(--border); padding: 24px 0; }
.faq-item h3 { font-size: 1rem; font-weight: 600; margin-bottom: 10px; }
.faq-item p { color: var(--muted); font-size: 0.9375rem; }

/* Footer */
footer {
  border-top: 1px solid var(--border);
  padding: 40px 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.875rem;
}

/* Login page */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-box {
  width: 100%;
  max-width: 420px;
  padding: 0 24px;
}
.login-box .logo { display: block; text-align: center; font-size: 1.5rem; margin-bottom: 32px; }
.login-box h1 { font-size: 1.5rem; font-weight: 700; margin-bottom: 8px; }
.login-box p { color: var(--muted); margin-bottom: 28px; }
.login-confirm {
  display: none;
  text-align: center;
  padding: 32px 0;
}
.login-confirm .icon { font-size: 2.5rem; margin-bottom: 12px; }
.login-confirm h2 { font-size: 1.25rem; font-weight: 600; margin-bottom: 8px; }
.login-confirm p { color: var(--muted); }
.error-msg { color: var(--red); font-size: 0.875rem; margin-top: 8px; display: none; }

/* App shell */
.app-shell {
  display: flex;
  min-height: 100vh;
}
.sidebar {
  width: 220px;
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 24px 0;
}
.sidebar .logo { padding: 0 20px; margin-bottom: 32px; font-size: 1.1rem; }
.sidebar-nav { flex: 1; }
.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  color: var(--muted);
  font-size: 0.9375rem;
  border-radius: 0;
  transition: background 0.1s, color 0.1s;
}
.sidebar-nav a:hover, .sidebar-nav a.active {
  background: var(--surface2);
  color: var(--text);
}
.sidebar-nav a .icon { font-size: 1rem; }
.sidebar-footer { padding: 20px; }
.main-content { flex: 1; overflow-y: auto; padding: 32px; }
.page-title { font-size: 1.5rem; font-weight: 700; margin-bottom: 24px; }
.page { display: none; }
.page.active { display: block; }

/* Stat cards */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
}
.stat-label { font-size: 0.8125rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 6px; }
.stat-value { font-size: 1.875rem; font-weight: 700; }
.stat-sub { font-size: 0.8125rem; color: var(--muted); margin-top: 4px; }

/* Table */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.9375rem; }
th { text-align: left; padding: 10px 16px; color: var(--muted); font-size: 0.8125rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; border-bottom: 1px solid var(--border); }
td { padding: 12px 16px; border-bottom: 1px solid var(--border); }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--surface2); }

/* Badges */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
}
.badge-green { background: rgba(34,197,94,0.15); color: var(--green); }
.badge-yellow { background: rgba(245,158,11,0.15); color: var(--yellow); }
.badge-red { background: rgba(239,68,68,0.15); color: var(--red); }

/* Loading */
.loading { color: var(--muted); text-align: center; padding: 40px; font-size: 0.9375rem; }
.error { color: var(--red); padding: 16px; background: rgba(239,68,68,0.1); border-radius: var(--radius); margin-bottom: 16px; }
