:root {
  color-scheme: dark;
  --bg: #060609;
  --panel: #101017;
  --line: #2b2b36;
  --text: #fbfbff;
  --muted: #b8b8c9;
  --pink: #ff2d8b;
  --purple: #8f50ff;
  --green: #33e69a;
  --red: #ff6577;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 0%, rgba(255,45,139,.16), transparent 30rem),
    radial-gradient(circle at 100% 100%, rgba(143,80,255,.12), transparent 34rem),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button, input { font: inherit; }

.shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 36px 0 72px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 52px;
}

.wordmark {
  font-weight: 950;
  letter-spacing: .24em;
  font-size: .92rem;
}

.badge {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 9px;
  color: var(--muted);
  font-size: .68rem;
  font-weight: 900;
  letter-spacing: .16em;
}

h1, h2, p { margin-top: 0; }
h1 { font-size: clamp(2.7rem, 8vw, 5.4rem); line-height: .92; margin-bottom: 18px; letter-spacing: -.045em; }
h2 { margin-bottom: 0; font-size: 1.45rem; }

.eyebrow {
  color: var(--pink);
  font-size: .78rem;
  font-weight: 900;
  letter-spacing: .15em;
  margin-bottom: 18px;
}

.eyebrow.danger { color: var(--red); }
.muted { color: var(--muted); }
.hidden { display: none !important; }

.card {
  background: rgba(16,16,23,.94);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 24px 70px rgba(0,0,0,.25);
}

#login, #denied, .state-card {
  max-width: 560px;
  padding: 32px;
}

form { margin-top: 28px; }
label { display: block; margin: 18px 0 8px; font-weight: 800; }
input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #09090f;
  color: var(--text);
  padding: 14px 15px;
  outline: none;
}
input:focus { border-color: var(--purple); box-shadow: 0 0 0 3px rgba(143,80,255,.15); }

button {
  border: 0;
  border-radius: 12px;
  padding: 14px 18px;
  font-weight: 950;
  letter-spacing: .03em;
  cursor: pointer;
  color: white;
  background: linear-gradient(90deg, var(--pink), var(--purple));
}

form button { width: 100%; margin-top: 22px; }
button:disabled { opacity: .55; cursor: wait; }
button.secondary { background: #171720; border: 1px solid var(--line); }
button.compact { width: auto; white-space: nowrap; }

.error { color: #ffd5da; }
#login-error { margin: 14px 0 0; }
.notice { padding: 14px 16px; border: 1px solid #7a3340; background: #281016; border-radius: 12px; margin-bottom: 20px; }

.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 30px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 22px;
}

.metric { padding: 22px; min-height: 160px; display: flex; flex-direction: column; }
.metric-label { color: var(--muted); font-weight: 800; }
.metric strong { font-size: 3.2rem; line-height: 1; margin: 18px 0 12px; }

.table-card { padding: 24px; }
.section-heading { display: flex; justify-content: space-between; margin-bottom: 20px; }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: 14px 12px; border-top: 1px solid var(--line); }
th { color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; }
.status { display: inline-block; padding: 5px 9px; border-radius: 999px; font-size: .75rem; font-weight: 900; }
.status.active { background: rgba(51,230,154,.12); color: var(--green); }
.status.inactive { background: rgba(255,101,119,.12); color: var(--red); }

@media (max-width: 820px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-header { flex-direction: column; }
}

@media (max-width: 520px) {
  .shell { width: min(100% - 20px, 1120px); padding-top: 24px; }
  .brand { margin-bottom: 34px; }
  .grid { grid-template-columns: 1fr; }
  #login, #denied, .state-card { padding: 24px; }
}

select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #09090f;
  color: var(--text);
  padding: 14px 15px;
  outline: none;
  font: inherit;
}
select:focus { border-color: var(--purple); box-shadow: 0 0 0 3px rgba(143,80,255,.15); }
.success { color: #c9ffe8; border-color: #236447; background: #0c281d; }
.editor-card { padding: 24px; margin-bottom: 22px; }
.editor-form { margin-top: 0; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 0 16px; }
.field { min-width: 0; }
.field.span-2 { grid-column: span 2; }
.toggle-row { display: flex; gap: 24px; align-items: center; margin-top: 20px; }
.check { display: inline-flex; align-items: center; gap: 9px; margin: 0; }
.check input { width: auto; }
.actions { display: flex; justify-content: flex-end; gap: 8px; }
button.small { padding: 8px 11px; border-radius: 9px; font-size: .78rem; }
button.danger-button { background: #281016; border: 1px solid #7a3340; color: #ffd5da; }
tr.cancelled td { opacity: .68; }
@media (max-width: 680px) {
  .field-grid { grid-template-columns: 1fr; }
  .field.span-2 { grid-column: span 1; }
  .section-heading { gap: 12px; align-items: flex-start; }
}
.form-hint { margin: 14px 0 0; font-size: .9rem; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: #e8defe; }

.tiny { font-size: .72rem; margin-top: 5px; }
