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

/* ── Tokens ── */
:root {
  --void: #0a0a0a;
  --ardoise: #4B4B55;
  --stone: #6b665f;
  --fog: #9a958e;
  --light: #e8e4df;
  --accent: #e8e4df;

  --radius: 6px;
  --transition: 160ms ease;

  --font-ui: 'Inter', system-ui, sans-serif;
  --font-mkt: 'Nunito', 'Inter', sans-serif;
}

/* ── Base ── */
html { font-size: 16px; }
body {
  background: var(--void);
  color: var(--light);
  font-family: var(--font-ui);
  line-height: 1.55;
  min-height: 100vh;
}

a { color: var(--light); text-decoration: none; }
a:hover { color: #fff; }

/* ── Nav ── */
.nav {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 0 56px;
  height: 62px;
  border-bottom: 1px solid #1a1a1a;
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--void);
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -0.01em;
}
.nav-links { display: flex; gap: 8px; flex: 1; }
.nav-link {
  padding: 6px 12px;
  border-radius: var(--radius);
  font-size: 0.875rem;
  color: var(--fog);
  transition: color var(--transition), background var(--transition);
}
.nav-link:hover, .nav-link.active { color: var(--light); background: #161616; }
.nav-end { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.nav-email { font-size: 0.8125rem; color: var(--fog); }

/* ── Main ── */
.main { padding: 48px 56px; max-width: 1360px; margin: 0 auto; }

/* ── Page header ── */
.page-header { margin-bottom: 40px; }
.page-title { font-size: 2.25rem; font-weight: 700; letter-spacing: -0.03em; line-height: 1.15; }
.page-sub { color: var(--fog); font-size: 1rem; margin-top: 6px; }

/* ── Cards ── */
.card {
  background: #111111;
  border: 1px solid #1e1e1e;
  border-radius: var(--radius);
  padding: 28px;
}
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.card-title { font-size: 0.6875rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--fog); margin-bottom: 8px; font-weight: 600; }
.card-value { font-size: 2rem; font-weight: 700; letter-spacing: -0.03em; }
.card-sub { font-size: 0.8125rem; color: var(--fog); margin-top: 4px; }

/* ── Stats grid ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 40px;
}
.stat-card {
  background: #111;
  border: 1px solid #1e1e1e;
  border-radius: var(--radius);
  padding: 28px 24px;
}
.stat-label { font-size: 0.6875rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--fog); font-weight: 600; margin-bottom: 10px; }
.stat-value { font-size: 2.5rem; font-weight: 700; letter-spacing: -0.04em; line-height: 1; }

/* ── Table ── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
thead th {
  text-align: left;
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--fog);
  padding: 14px 20px;
  border-bottom: 1px solid #1e1e1e;
  font-weight: 600;
}
tbody td { padding: 16px 20px; border-bottom: 1px solid #161616; color: var(--light); }
tbody tr:hover td { background: #131313; }
tbody tr:last-child td { border-bottom: none; }
.monospace { font-family: 'Courier New', monospace; font-size: 0.8125rem; }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius);
  font-family: var(--font-ui);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: background var(--transition), color var(--transition), opacity var(--transition);
  text-decoration: none;
}
.btn-primary { background: var(--light); color: var(--void); }
.btn-primary:hover { background: #fff; color: var(--void); }
.btn-ghost { background: transparent; color: var(--fog); border: 1px solid #2a2a2a; }
.btn-ghost:hover { background: #161616; color: var(--light); }
.btn-danger { background: transparent; color: #c0392b; border: 1px solid #3d1a1a; }
.btn-danger:hover { background: #1e0d0d; }
.btn-sm { padding: 5px 10px; font-size: 0.8125rem; }

/* ── Forms ── */
.form-group { margin-bottom: 20px; }
label { display: block; font-size: 0.8125rem; font-weight: 500; color: var(--fog); margin-bottom: 6px; }
input[type="text"], input[type="email"], input[type="password"], input[type="url"],
textarea, select {
  width: 100%;
  background: #111;
  border: 1px solid #2a2a2a;
  border-radius: var(--radius);
  color: var(--light);
  font-family: var(--font-ui);
  font-size: 0.9375rem;
  padding: 10px 14px;
  outline: none;
  transition: border-color var(--transition);
}
input:focus, textarea:focus, select:focus { border-color: var(--fog); }
textarea { resize: vertical; min-height: 96px; }
.form-hint { font-size: 0.75rem; color: var(--fog); margin-top: 4px; }

/* ── Auth page ── */
.auth-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 32px;
}
.auth-card {
  width: 100%;
  max-width: 400px;
  background: #111;
  border: 1px solid #1e1e1e;
  border-radius: var(--radius);
  padding: 40px;
}
.auth-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 32px;
  letter-spacing: -0.01em;
}
.auth-title { font-size: 1.25rem; font-weight: 700; margin-bottom: 4px; }
.auth-sub { font-size: 0.875rem; color: var(--fog); margin-bottom: 28px; }

/* ── Alerts ── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 0.875rem;
  margin-bottom: 20px;
}
.alert-error { background: #1e0d0d; border: 1px solid #3d1a1a; color: #e07070; }
.alert-success { background: #0d1e10; border: 1px solid #1a3d22; color: #70e090; }

/* ── Badges ── */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.badge-muted { background: #1a1a1a; color: var(--fog); }
.badge-accent { background: #1e1e14; color: #d4cf84; }
.badge-bot { background: #1e1010; color: #d47070; }

/* ── Plan badges ── */
.badge-free { background: #1a1a1a; color: var(--fog); border: 1px solid #2a2a2a; }
.badge-orbit { background: #0d1a2e; color: #7ab3e8; border: 1px solid #1a3a5c; }
.badge-pulsar { background: #1a0d2e; color: #b07ae8; border: 1px solid #3a1a5c; }
.badge-supernova { background: #2e1a0d; color: #e8a87a; border: 1px solid #5c3a1a; }
.badge-galaxy { background: linear-gradient(135deg, #2d1657, #0f2a60); color: #c4a8f8; border: 1px solid #4a2a9a; }
.badge-superadmin { background: #1e1e14; color: #d4cf84; border: 1px solid #3a3a1a; }

/* ── Chips / breakdown bars ── */
.breakdown-list { display: flex; flex-direction: column; gap: 8px; }
.breakdown-item { display: flex; align-items: center; gap: 10px; font-size: 0.875rem; }
.breakdown-label { min-width: 120px; color: var(--fog); }
.breakdown-bar-wrap { flex: 1; height: 6px; background: #1e1e1e; border-radius: 99px; overflow: hidden; }
.breakdown-bar { height: 100%; background: var(--fog); border-radius: 99px; transition: width 0.4s ease; }
.breakdown-bar.accent { background: var(--light); }
.breakdown-count { min-width: 40px; text-align: right; color: var(--fog); font-size: 0.8125rem; }

/* ── Section divider ── */
.section { margin-bottom: 48px; }
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.section-title { font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.12em; color: var(--fog); }

/* ── Copy box ── */
.copy-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #0d0d0d;
  border: 1px solid #1e1e1e;
  border-radius: var(--radius);
  padding: 10px 14px;
  font-size: 0.875rem;
}
.copy-box code { flex: 1; font-family: 'Courier New', monospace; color: var(--light); word-break: break-all; }
.copy-btn { background: none; border: none; color: var(--fog); cursor: pointer; font-size: 0.8125rem; padding: 2px 6px; }
.copy-btn:hover { color: var(--light); }

/* ── Chart container ── */
.chart-container { position: relative; height: 180px; }

/* ── Divider ── */
.divider { height: 1px; background: #1a1a1a; margin: 32px 0; }

/* ── Empty state ── */
.empty {
  text-align: center;
  padding: 80px 32px;
  color: var(--fog);
}
.empty-icon {
  font-size: 1.5rem;
  margin-bottom: 20px;
  color: var(--stone);
  letter-spacing: .15em;
}
.empty-title { font-size: 1.1rem; font-weight: 600; color: var(--light); margin-bottom: 8px; letter-spacing: -.01em; }
.empty-sub { font-size: 0.9rem; margin-bottom: 28px; }

/* ── Responsive ── */
@media (max-width: 1100px) {
  .main { padding: 40px 32px; }
}
@media (max-width: 768px) {
  .main { padding: 24px 20px; }
  .nav { padding: 0 16px; gap: 12px; }
  .nav-email { display: none; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .card-grid { grid-template-columns: 1fr; }
}
