:root {
  --bg0: #0a0c0f;
  --bg1: #12161c;
  --bg2: #1a212b;
  --line: rgba(232, 220, 196, 0.12);
  --ink: #f3efe6;
  --muted: #9aa3ae;
  --accent: #d4a017;
  --accent-2: #3dd6c6;
  --danger: #e4572e;
  --ok: #5dbe8a;
  --font-display: "Bebas Neue", sans-serif;
  --font: "Manrope", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(1200px 700px at 10% -10%, rgba(212, 160, 23, 0.18), transparent 55%),
    radial-gradient(900px 600px at 90% 0%, rgba(61, 214, 198, 0.12), transparent 50%),
    linear-gradient(165deg, #0a0c0f 0%, #10151c 45%, #0b1016 100%);
}

.noise {
  pointer-events: none;
  position: fixed;
  inset: 0;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  z-index: 0;
}

.top, .hero, .layout, .gate, footer { position: relative; z-index: 1; }

.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.75rem;
  border-bottom: 1px solid var(--line);
}

.brand {
  font-family: var(--font-display);
  letter-spacing: 0.12em;
  font-size: 1.6rem;
  color: var(--ink);
  text-decoration: none;
}

.top-meta { display: flex; gap: 1rem; align-items: center; color: var(--muted); font-size: 0.9rem; }

.landing .hero {
  min-height: calc(100vh - 8rem);
  display: grid;
  align-content: center;
  padding: 2rem 1.75rem 4rem;
  max-width: 920px;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 0.72rem;
  color: var(--accent-2);
  margin: 0 0 1rem;
}

h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(4rem, 14vw, 8.5rem);
  line-height: 0.9;
  letter-spacing: 0.04em;
  margin: 0;
}
h1 span { color: var(--accent); }

.lede {
  max-width: 34rem;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.55;
  margin: 1.25rem 0 1.75rem;
}

.cta { display: flex; flex-wrap: wrap; gap: 0.85rem; align-items: center; }

.btn {
  appearance: none;
  border: 0;
  background: var(--accent);
  color: #14110a;
  font-family: var(--font);
  font-weight: 700;
  padding: 0.85rem 1.25rem;
  border-radius: 2px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 160ms ease, filter 160ms ease;
}
.btn:hover { transform: translateY(-1px); filter: brightness(1.05); }
.btn.danger { background: var(--danger); color: #fff; }

.ghost {
  appearance: none;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink);
  padding: 0.55rem 0.9rem;
  border-radius: 2px;
  text-decoration: none;
  cursor: pointer;
  font: inherit;
}

.pill, .code, code.pill {
  font-family: var(--mono);
  font-size: 0.82rem;
  background: var(--bg2);
  border: 1px solid var(--line);
  padding: 0.55rem 0.8rem;
  border-radius: 2px;
  color: var(--accent-2);
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1rem 1.75rem 1.5rem;
  color: var(--muted);
  font-size: 0.82rem;
  border-top: 1px solid var(--line);
}

.gate {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
}
.gate[hidden] {
  display: none !important;
}
.gate-card {
  width: min(420px, 100%);
  background: rgba(18, 22, 28, 0.92);
  border: 1px solid var(--line);
  padding: 1.75rem;
  backdrop-filter: blur(10px);
}
.gate-card h1 {
  font-size: 3rem;
  margin-bottom: 0.5rem;
}
.gate-card label {
  display: block;
  margin: 1rem 0 0.4rem;
  font-size: 0.85rem;
  color: var(--muted);
}
.gate-card input, .form input {
  width: 100%;
  background: var(--bg0);
  border: 1px solid var(--line);
  color: var(--ink);
  padding: 0.75rem 0.85rem;
  border-radius: 2px;
  font: inherit;
}
.gate-card .btn { width: 100%; margin-top: 1rem; }

.err { color: #ff8f75; margin-top: 0.85rem; }
.msg { color: var(--ok); margin-top: 0.75rem; font-size: 0.9rem; }
.msg.bad { color: #ff8f75; }

.layout {
  display: grid;
  grid-template-columns: 1.4fr 0.9fr;
  gap: 1rem;
  padding: 1rem 1.25rem 2rem;
}
@media (max-width: 980px) {
  .layout { grid-template-columns: 1fr; }
}

.panel {
  background: rgba(16, 20, 26, 0.85);
  border: 1px solid var(--line);
  padding: 1rem 1.1rem 1.2rem;
  margin-bottom: 1rem;
}
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}
.panel h2 {
  font-family: var(--font-display);
  letter-spacing: 0.08em;
  font-size: 1.55rem;
  font-weight: 400;
  margin: 0 0 0.85rem;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.6rem;
  margin-bottom: 1rem;
}
@media (max-width: 700px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.stat {
  background: var(--bg0);
  border: 1px solid var(--line);
  padding: 0.75rem;
}
.stat b {
  display: block;
  font-family: var(--font-display);
  font-size: 1.8rem;
  letter-spacing: 0.04em;
}
.stat span { color: var(--muted); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; }

.table { display: grid; gap: 0.65rem; }
.card-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.75rem;
  padding: 0.9rem;
  background: var(--bg0);
  border: 1px solid var(--line);
}
.card-row h3 {
  margin: 0 0 0.25rem;
  font-size: 1rem;
}
.meta {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--muted);
  word-break: break-all;
}
.badge {
  display: inline-block;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.25rem 0.45rem;
  border-radius: 2px;
  margin-bottom: 0.45rem;
}
.badge.active { background: rgba(93, 190, 138, 0.18); color: var(--ok); }
.badge.suspended { background: rgba(228, 87, 46, 0.18); color: #ff8f75; }
.badge.revoked, .badge.expired { background: rgba(154, 163, 174, 0.18); color: var(--muted); }

.actions { display: flex; flex-direction: column; gap: 0.4rem; }
.actions button { white-space: nowrap; }

.form { display: grid; gap: 0.65rem; }
.form label { display: grid; gap: 0.35rem; font-size: 0.85rem; color: var(--muted); }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.55rem; }

.code {
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.45;
  color: var(--ink);
  max-height: 220px;
  overflow: auto;
}

.audit {
  display: grid;
  gap: 0.45rem;
  max-height: 280px;
  overflow: auto;
}
.audit div {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.35rem;
}
