:root {
  --bg: #070b10;
  --bg-elev: #0d141c;
  --surface: #121a24;
  --card: #161f2b;
  --line: #243142;
  --line-strong: #314359;
  --text: #e8eef4;
  --muted: #8b9aab;
  --faint: #6a7a8c;
  --accent: #3ee0c5;
  --accent-dim: rgba(62, 224, 197, 0.14);
  --accent-ink: #04241e;
  --warn: #f5b942;
  --warn-dim: rgba(245, 185, 66, 0.14);
  --danger: #ff6b6b;
  --danger-dim: rgba(255, 107, 107, 0.14);
  --ok: #4ade80;
  --ok-dim: rgba(74, 222, 128, 0.12);
  --info: #7aa2ff;
  --radius: 16px;
  --shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
  --font: system-ui, -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --max: 1120px;
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { color-scheme: dark; scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background:
    radial-gradient(1100px 500px at 8% -10%, rgba(62, 224, 197, 0.08), transparent 50%),
    radial-gradient(800px 420px at 100% 0%, rgba(122, 162, 255, 0.06), transparent 45%),
    var(--bg);
  color: var(--text);
  line-height: 1.55;
  min-height: 100vh;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -0.03em; font-weight: 700; }

.topbar {
  background: #1a1406;
  color: #f8e2a0;
  font-size: 0.8rem;
  font-weight: 600;
  text-align: center;
  padding: 0.45rem 1rem;
  border-bottom: 1px solid #3a3114;
}
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 1.25rem; }

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0;
  flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 0.7rem; color: var(--text); text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand-name { font-weight: 700; }
.brand-sub { color: var(--muted); font-size: 0.78rem; }
.nav-links { display: flex; align-items: center; gap: 0.4rem 1rem; flex-wrap: wrap; }
.nav-links a { color: var(--muted); font-weight: 600; font-size: 0.92rem; }
.nav-links a:hover { color: var(--text); text-decoration: none; }

.btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--text);
  border-radius: 12px;
  padding: 0.6rem 1rem;
  min-height: 44px;
  font-weight: 650;
  text-decoration: none;
}
.btn:hover { background: #1a2432; text-decoration: none; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.btn.primary:hover { filter: brightness(1.05); }
.btn.ok { background: #1d3d2d; border-color: #2a5a40; color: var(--ok); }
.btn.danger { background: #3a1c1c; border-color: #5a2a2a; color: var(--danger); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.ghost { background: transparent; }

.hero { padding: 2.2rem 0 3rem; }
.eyebrow {
  display: inline-block;
  background: var(--accent-dim);
  color: var(--accent);
  border-radius: 999px;
  padding: 0.2rem 0.7rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 0.9rem;
}
.hero h1 { font-size: clamp(2rem, 5vw, 3.2rem); max-width: 16ch; margin-bottom: 0.8rem; }
.hero .lead, .lead { color: var(--muted); font-size: 1.08rem; max-width: 58ch; }
.hero-actions { display: flex; gap: 0.7rem; flex-wrap: wrap; margin-top: 1.4rem; }
.sim-chip {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #f8e2a0;
  background: var(--warn-dim);
  border: 1px solid #3a3114;
  border-radius: 999px;
  padding: 0.12rem 0.5rem;
}

section.block { padding: 0.5rem 0 3rem; }
section.block h2 { font-size: 1.6rem; margin-bottom: 0.5rem; }
.grid-3, .grid-4, .grid-2 {
  display: grid;
  gap: 0.85rem;
  margin-top: 1.1rem;
}
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1.15rem;
  box-shadow: var(--shadow);
}
.card h3 { font-size: 1.05rem; margin-bottom: 0.4rem; }
.card p, .card li { color: var(--muted); }
.card .step {
  color: var(--accent);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 0.35rem;
}

.flow { text-align: center; }
.flow-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.6rem; }
.flow-box, .flow-core {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.85rem 0.6rem;
  font-size: 0.88rem;
  font-weight: 650;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
}
.flow-core {
  margin: 0.7rem auto;
  max-width: 420px;
  background: var(--accent-dim);
  border-color: #2a5a4c;
}
.flow-core span { font-weight: 500; color: var(--muted); font-size: 0.82rem; }
.flow-arrow { color: var(--muted); font-size: 0.8rem; }

.cta-band {
  background: linear-gradient(180deg, rgba(62, 224, 197, 0.1), rgba(62, 224, 197, 0.03));
  border: 1px solid #2a5a4c;
  border-radius: var(--radius);
  padding: 1.6rem 1.4rem;
  text-align: center;
  margin-bottom: 2rem;
}
.cta-band h2 { margin-bottom: 0.4rem; }
.cta-band p { color: var(--muted); margin-bottom: 1rem; }

.site-footer {
  border-top: 1px solid var(--line);
  padding: 1.4rem 0 2.2rem;
  color: var(--faint);
  font-size: 0.85rem;
}
.site-footer .wrap { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.site-footer strong { color: var(--muted); font-weight: 650; }

/* Forms */
.page-head { padding: 1.5rem 0 1rem; }
.page-head h1 { font-size: 1.8rem; margin: 0.3rem 0 0.4rem; }
.form-card { max-width: 640px; }
label { display: block; font-weight: 650; margin: 0.85rem 0 0.3rem; }
.req { color: var(--danger); }
input[type="text"], input[type="email"], input[type="password"], textarea, select {
  width: 100%;
  background: #0b1118;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.7rem 0.8rem;
  min-height: 44px;
}
textarea { min-height: 120px; resize: vertical; }
input:focus, textarea:focus, select:focus {
  outline: 2px solid rgba(62, 224, 197, 0.45);
  border-color: #2a5a4c;
}
.help { color: var(--faint); font-size: 0.82rem; margin-top: 0.35rem; }
.form-actions { margin-top: 1.1rem; display: flex; gap: 0.6rem; flex-wrap: wrap; }
.alert {
  border-radius: 12px;
  padding: 0.7rem 0.85rem;
  margin: 0.7rem 0;
  font-weight: 600;
}
.alert.error { background: var(--danger-dim); color: #ffb4b4; border: 1px solid #5a2a2a; }
.alert.ok { background: var(--ok-dim); color: var(--ok); border: 1px solid #1f4a32; }
.alert.warn { background: var(--warn-dim); color: #f8e2a0; border: 1px solid #3a3114; }

.narrow { max-width: 440px; margin: 1.5rem auto 3rem; }

.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 12px; }
table.data { width: 100%; border-collapse: collapse; font-size: 0.9rem; min-width: 640px; }
table.data th, table.data td { text-align: left; padding: 0.65rem 0.75rem; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data th { background: var(--surface); color: var(--muted); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; }
table.data tr:last-child td { border-bottom: 0; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.mono { font-family: var(--mono); }
.status { font-weight: 700; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; }
.status.pending { color: var(--warn); }
.status.approved { color: var(--ok); }
.status.rejected, .status.revoked, .status.used, .status.expired { color: var(--faint); }
.status.active { color: var(--accent); }

.toolbar { display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: center; margin: 0.7rem 0 1rem; }
.section-gap { margin-top: 2rem; }
.row-actions { display: flex; gap: 0.35rem; flex-wrap: wrap; }
.admin-grid { display: grid; gap: 1.2rem; }

.modal-back {
  position: fixed; inset: 0; background: rgba(0,0,0,0.6);
  display: flex; align-items: center; justify-content: center;
  padding: 1rem; z-index: 80;
}
.modal-back.hidden { display: none; }
.modal {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.2rem;
  max-width: 480px;
  width: 100%;
  box-shadow: var(--shadow);
}
.modal h3 { margin-bottom: 0.5rem; }
.code-box {
  font-family: var(--mono);
  font-size: 1.4rem;
  letter-spacing: 0.12em;
  background: #0b1118;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.8rem;
  text-align: center;
  margin: 0.8rem 0;
}
.hidden { display: none !important; }

@media (max-width: 900px) {
  .grid-3, .grid-4, .flow-row { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .grid-3, .grid-4, .grid-2, .flow-row { grid-template-columns: 1fr; }
  .hero { padding-top: 1.2rem; }
  .wrap { padding: 0 0.9rem; }
}
