:root {
  color-scheme: dark;
  --stage: #08070e;
  --surface: #131120;
  --surface-2: #1a1726;
  --field: rgba(255, 255, 255, 0.04);
  --field-strong: rgba(255, 255, 255, 0.07);
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.16);
  --ink: #f5f3fb;
  --ink-soft: #cbc6da;
  --muted: #918ba4;
  --purple: #c01fd6;
  --violet: #7b2bd6;
  --teal: #18c8c4;
  --green: #2adf8c;
  --danger: #ff6a9a;
  --success: #34e0a1;
  --grad: linear-gradient(100deg, #c01fd6 0%, #7b2bd6 26%, #18bfc6 62%, #2adf8c 100%);
  --grad-soft: linear-gradient(100deg, rgba(192, 31, 214, 0.16), rgba(123, 43, 214, 0.12) 32%, rgba(24, 191, 198, 0.12) 64%, rgba(42, 223, 140, 0.16));
  --shadow: 0 28px 64px -30px rgba(0, 0, 0, 0.85);
  --radius: 16px;
  --radius-sm: 11px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(120% 80% at 50% -10%, #100c1c 0%, var(--stage) 55%) fixed,
    var(--stage);
  color: var(--ink);
  font-family: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(46% 40% at 10% -6%, rgba(192, 31, 214, 0.26), transparent 70%),
    radial-gradient(42% 38% at 92% 4%, rgba(42, 223, 140, 0.16), transparent 70%),
    radial-gradient(55% 48% at 78% 116%, rgba(24, 191, 198, 0.15), transparent 72%);
}
body.admin-body::before { opacity: 0.76; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.62; }
.is-hidden { display: none !important; }
.muted { color: var(--muted); }
.grad-text {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.page {
  position: relative;
  z-index: 1;
  width: min(1080px, calc(100% - 40px));
  margin: 0 auto;
  padding: 30px 0 60px;
}
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  gap: 26px;
  align-items: stretch;
  margin-bottom: 28px;
}
.hero-main {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 20px;
  min-height: 330px;
}
.eyebrow {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink-soft);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.26em;
  text-transform: uppercase;
}
.eyebrow::before {
  content: "";
  width: 30px;
  height: 2px;
  border-radius: 2px;
  background: var(--grad);
}
.brand-logo {
  display: block;
  width: min(420px, 92%);
  height: auto;
  filter: drop-shadow(0 22px 46px rgba(123, 25, 148, 0.45));
}
h1 {
  margin: 0;
  max-width: 24ch;
  font-family: "Fraunces", Georgia, "Times New Roman", serif;
  font-weight: 600;
  font-size: clamp(2rem, 4.4vw, 3.45rem);
  line-height: 1.02;
  text-transform: uppercase;
}
.hero-copy {
  margin: 0;
  max-width: 78ch;
  color: var(--ink-soft);
  font-size: 1.02rem;
}
.hero-copy strong { color: var(--ink); }
.form-intro { margin-bottom: 20px; }
.form-intro .section-body { gap: 20px; }
.intro-copy {
  display: grid;
  gap: 14px;
  max-width: 84ch;
  color: var(--ink-soft);
  font-size: 1rem;
}
.intro-copy p,
.intro-copy ul {
  margin: 0;
}
.intro-copy ul {
  padding-left: 32px;
}
.intro-copy strong {
  color: var(--ink);
}
.info-card, .section, .login-card, .stat-card {
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.info-card {
  position: relative;
  display: grid;
  gap: 18px;
  padding: 26px;
  overflow: hidden;
}
.info-card::before, .login-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: var(--grad);
}
.info-item {
  display: grid;
  gap: 6px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.info-item:last-child { padding-bottom: 0; border-bottom: 0; }
.info-label {
  color: var(--teal);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.info-value { color: var(--ink); font-weight: 600; }
form { display: grid; gap: 20px; }
.section {
  position: relative;
  overflow: hidden;
  scroll-margin-top: 24px;
}
form > .section {
  border-color: transparent;
  background: linear-gradient(180deg, rgba(26, 23, 38, 0.74), rgba(19, 17, 32, 0.7));
}
.section-header {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 22px 26px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.015);
}
.section-num {
  flex: 0 0 auto;
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.65rem;
  font-weight: 600;
}
.section-kicker {
  display: block;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}
h2 {
  margin: 5px 0 0;
  font-size: clamp(1.12rem, 1.8vw, 1.42rem);
  line-height: 1.14;
  text-transform: uppercase;
}
.section-body {
  display: grid;
  gap: 18px;
  padding: 24px 26px 26px;
}
.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
.field {
  display: grid;
  gap: 8px;
}
fieldset.field {
  min-width: 0;
  margin: 0;
  border: 0;
  padding: 0;
}
.field.full { grid-column: 1 / -1; }
.honeypot { position: absolute; left: -100vw; width: 1px; height: 1px; overflow: hidden; }
label, .label {
  color: var(--ink);
  font-size: 0.93rem;
  font-weight: 700;
}
.hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.89rem;
}
.control, textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--field);
  padding: 12px 14px;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}
textarea {
  min-height: 118px;
  resize: vertical;
}
.control::placeholder, textarea::placeholder { color: var(--muted); }
.control:hover, textarea:hover { background: var(--field-strong); }
.control:focus, textarea:focus {
  border-color: var(--teal);
  background: var(--field-strong);
  box-shadow: 0 0 0 3px rgba(24, 200, 196, 0.18), 0 0 28px -10px rgba(24, 200, 196, 0.4);
  outline: none;
}
.options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
}
.choice {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 50px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--field);
  padding: 11px 14px;
  font-weight: 600;
  transition: border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}
.choice input {
  width: 18px;
  height: 18px;
  accent-color: var(--teal);
}
.choice:hover {
  border-color: rgba(24, 200, 196, 0.55);
  background: var(--field-strong);
}
.choice:has(input:checked) {
  border-color: rgba(24, 200, 196, 0.65);
  background: var(--grad-soft);
  box-shadow: 0 0 0 1px rgba(24, 200, 196, 0.35);
}
.upload-box {
  display: grid;
  gap: 10px;
  border: 1px dashed rgba(24, 200, 196, 0.45);
  border-radius: var(--radius-sm);
  background: rgba(24, 200, 196, 0.05);
  padding: 12px;
  transition: border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}
.upload-box.is-dragging {
  border-color: rgba(42, 223, 140, 0.72);
  background: rgba(42, 223, 140, 0.08);
  box-shadow: 0 0 0 3px rgba(42, 223, 140, 0.12);
}
.upload-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}
.file-name {
  color: var(--ink-soft);
  font-size: 0.92rem;
  overflow-wrap: anywhere;
}
.file-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.file-list li {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.03);
  padding: 9px 11px;
  color: var(--ink-soft);
}
.file-remove {
  border: 0;
  background: transparent;
  color: var(--danger);
  font-weight: 800;
}
.progress {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}
.progress-track {
  height: 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}
.progress-fill {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: var(--grad);
}
.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}
.btn, .button {
  border: 0;
  border-radius: var(--radius-sm);
  padding: 12px 18px;
  font-weight: 800;
  letter-spacing: 0.01em;
  transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease, background 0.16s ease;
}
.btn:focus-visible, .button:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 3px;
}
.btn-primary, .button-primary {
  color: #fff;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.22), rgba(0, 0, 0, 0.22)), var(--grad);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
  box-shadow: 0 16px 38px -16px rgba(42, 223, 140, 0.5);
}
.btn-primary:hover, .button-primary:hover { transform: translateY(-1px); filter: brightness(1.08); }
.btn-ghost {
  background: var(--field-strong);
  color: var(--ink-soft);
  border: 1px solid var(--line-strong);
}
.btn-ghost:hover { color: #fff; border-color: rgba(24, 200, 196, 0.55); }
.btn-danger {
  background: rgba(255, 106, 154, 0.1);
  color: var(--danger);
  border: 1px solid rgba(255, 106, 154, 0.35);
}
.status {
  margin: 0;
  min-height: 24px;
  color: var(--muted);
  font-weight: 700;
}
.status.success { color: var(--success); }
.status.error { color: var(--danger); }
.success-panel {
  display: none;
  margin-top: 20px;
  border: 1px solid rgba(52, 224, 161, 0.42);
  border-radius: var(--radius);
  background: rgba(52, 224, 161, 0.08);
  padding: 22px 26px;
}
.success-panel.show { display: block; }
.success-panel h2 { margin: 0 0 8px; }

/* Admin */
.admin-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
}
.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.login-card {
  position: relative;
  width: min(400px, 100%);
  padding: 34px 30px;
  overflow: hidden;
}
.login-logo {
  display: block;
  width: 200px;
  max-width: 70%;
  height: auto;
  margin-bottom: 18px;
}
.login-card h1 {
  margin: 0 0 22px;
  font-size: 1.6rem;
}
.login-card .control { margin-bottom: 16px; }
.admin {
  display: flex;
  flex-direction: column;
  height: 100vh;
}
.topbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 12px 22px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(26, 23, 38, 0.96), rgba(19, 17, 32, 0.92));
}
.topbar-logo { height: 34px; width: auto; }
.topbar-title {
  margin-right: auto;
  color: var(--ink-soft);
  font-size: 0.86rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.view {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
}
.roster {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.015);
}
.roster-head {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}
.roster-actions {
  display: flex;
  gap: 10px;
}
.roster-actions .control { flex: 1 1 auto; min-width: 0; }
.roster-count {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
}
.roster-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 8px;
}
.roster-item {
  width: 100%;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--ink-soft);
  padding: 11px 12px;
  text-align: left;
}
.roster-item strong, .roster-item span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.roster-item span {
  color: var(--muted);
  font-size: 0.82rem;
}
.roster-item:hover, .roster-item.active {
  background: var(--grad-soft);
  border-color: rgba(24, 200, 196, 0.28);
  color: #fff;
}
.detail {
  min-width: 0;
  overflow-y: auto;
  padding: 24px;
}
.empty-state {
  margin: 0;
  padding: 40px 24px;
  color: var(--muted);
  text-align: center;
}
.detail-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.detail-header h2 {
  margin: 0 0 6px;
  font-family: "Fraunces", Georgia, serif;
  font-size: clamp(1.6rem, 3vw, 2.25rem);
  text-transform: none;
}
.detail-sub {
  margin: 0;
  color: var(--ink-soft);
}
.detail-date {
  display: block;
  color: var(--muted);
  font-weight: 700;
  margin-bottom: 10px;
  text-align: right;
}
.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.detail-block {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.025);
  padding: 16px;
}
.detail-block.full { grid-column: 1 / -1; }
.detail-block h3 {
  margin: 0 0 8px;
  color: var(--teal);
  font-size: 0.74rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.detail-text {
  margin: 0;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--field);
  padding: 3px 10px;
  color: var(--ink-soft);
  font-size: 0.86rem;
  font-weight: 700;
}
.receipt-link { color: var(--teal); font-weight: 800; overflow-wrap: anywhere; }
.receipt-list {
  display: grid;
  gap: 14px;
}
.receipt-item {
  display: grid;
  gap: 6px;
}
.receipt-preview-link {
  display: block;
  width: min(520px, 100%);
}
.receipt-preview {
  display: block;
  width: 100%;
  max-height: 520px;
  object-fit: contain;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
}
.stats-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}
.stat-card {
  padding: 18px;
}
.stat-num {
  display: block;
  font-family: "Fraunces", Georgia, serif;
  font-size: 2.4rem;
  line-height: 1;
  font-weight: 600;
}
.stat-label {
  color: var(--muted);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
}

@media (max-width: 820px) {
  .page { width: min(100% - 28px, 1080px); padding-top: 18px; }
  .hero { grid-template-columns: 1fr; }
  .hero-main { min-height: auto; padding: 16px 0; }
  .grid, .detail-grid, .stats-row { grid-template-columns: 1fr; }
  .section-header, .section-body { padding-left: 18px; padding-right: 18px; }
  .view { grid-template-columns: 1fr; grid-template-rows: minmax(210px, 36vh) minmax(0, 1fr); }
  .roster { border-right: 0; border-bottom: 1px solid var(--line); }
  .topbar { gap: 12px; padding: 10px 14px; }
  .topbar-title { font-size: 0.72rem; }
  .detail { padding: 18px 14px; }
}
