:root {
  --bg: #0a0a0f;
  --surface: #14141c;
  --surface-2: #1b1b26;
  --border: #262632;
  --text: #f2f2f5;
  --text-muted: #8f8fa0;
  --cyan: #00f2ea;
  --pink: #fe2c55;
  --green: #21e6a1;
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, sans-serif;
  line-height: 1.5;
}

h1, h2, h3 {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  margin: 0;
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  padding: 64px 24px 56px;
  background:
    radial-gradient(circle at 18% 0%, rgba(0,242,234,0.16), transparent 45%),
    radial-gradient(circle at 82% 20%, rgba(254,44,85,0.16), transparent 45%);
  border-bottom: 1px solid var(--border);
}

.hero-inner {
  max-width: 720px;
  margin: 0 auto;
  text-align: left;
}

.hero-title {
  font-size: 40px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
  text-shadow: 2px 0 0 rgba(0,242,234,0.5), -2px 0 0 rgba(254,44,85,0.4);
}

.hero-title .dot { color: var(--pink); text-shadow: none; }

.hero-sub {
  margin-top: 14px;
  max-width: 46ch;
  color: var(--text-muted);
  font-size: 16px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 24px;
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid var(--border);
  background: var(--surface);
}

.pill-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.pill-on .pill-dot { background: var(--green); box-shadow: 0 0 8px var(--green); }
.pill-off .pill-dot { background: var(--text-muted); }
.pill-on { color: var(--green); }
.pill-off { color: var(--text-muted); }

/* ---------- Layout ---------- */

.wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 40px 24px 80px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
}

.panel h2 {
  font-size: 20px;
  font-weight: 600;
}

.panel-hint {
  margin: 8px 0 24px;
  color: var(--text-muted);
  font-size: 14px;
}

.sub-heading {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.divider {
  grid-column: 1 / -1;
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}

/* ---------- Forms ---------- */

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}

.field-note {
  font-size: 12px;
  color: var(--text-muted);
}

input[type="text"],
input[type="number"] {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
}

input[type="text"]:focus,
input[type="number"]:focus {
  outline: 2px solid var(--cyan);
  outline-offset: 1px;
}

.color-field { flex-direction: row; align-items: center; justify-content: space-between; }
input[type="color"] {
  width: 44px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
}

.switch-field {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
}

.switch { position: relative; display: inline-block; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch-track {
  display: block;
  width: 42px;
  height: 24px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  position: relative;
  transition: background 0.15s ease;
}
.switch-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: transform 0.15s ease, background 0.15s ease;
}
.switch input:checked + .switch-track { background: rgba(0,242,234,0.15); border-color: var(--cyan); }
.switch input:checked + .switch-track .switch-thumb { transform: translateX(18px); background: var(--cyan); }

button {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 600;
  border-radius: 8px;
  padding: 11px 20px;
  cursor: pointer;
  border: none;
}

.btn-primary {
  grid-column: 1 / -1;
  justify-self: start;
  background: var(--cyan);
  color: #04191a;
}
.btn-primary:hover { filter: brightness(1.08); }

.btn-secondary {
  grid-column: 1 / -1;
  justify-self: start;
  background: var(--pink);
  color: #2a0410;
}
.btn-secondary:hover { filter: brightness(1.08); }

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 6px 12px;
  font-size: 13px;
}
.btn-ghost:hover { border-color: var(--pink); color: var(--pink); }

/* ---------- Table ---------- */

.table-wrap { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th {
  text-align: left;
  color: var(--text-muted);
  font-weight: 500;
  font-size: 12px;
  padding: 0 12px 10px;
  border-bottom: 1px solid var(--border);
}
td {
  padding: 12px;
  border-bottom: 1px solid var(--border);
}
tr:last-child td { border-bottom: none; }
.mono { font-family: 'SFMono-Regular', Consolas, monospace; color: var(--text-muted); font-size: 13px; }

.empty { color: var(--text-muted); font-size: 14px; }

.add-user-form { margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--border); }

code {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 13px;
}

/* ---------- Flash messages ---------- */

.flashes { display: flex; flex-direction: column; gap: 10px; }
.flash {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
  border: 1px solid var(--border);
}
.flash-success { border-color: var(--green); color: var(--green); }
.flash-error { border-color: var(--pink); color: var(--pink); }

/* ---------- Footer ---------- */

.foot {
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  padding: 24px;
}

/* ---------- Responsive ---------- */

@media (max-width: 640px) {
  .grid { grid-template-columns: 1fr; }
  .hero-title { font-size: 32px; }
}
