:root {
  --bg: #0a1216;
  --bg-panel: #101c22;
  --border: #1d3540;
  --cyan: #45d0e8;
  --cyan-bright: #9be8f5;
  --cyan-dim: #1a7fa0;
  --text: #d7e6ea;
  --muted: #7d97a0;
  --error: #ff6b6b;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  background-image: radial-gradient(ellipse at 50% -20%, #12242c 0%, var(--bg) 60%);
  color: var(--text);
  font-family: "Inter", system-ui, sans-serif;
  line-height: 1.55;
}

/* subtle CRT scanlines */
.scanlines {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.14) 0 1px, transparent 1px 3px);
  z-index: 1;
}

.pixel {
  font-family: "Silkscreen", monospace;
  letter-spacing: 0.02em;
}

/* ---------- logo ---------- */
.logo { display: block; }
.logo.small { height: 56px; width: auto; }
.logo.hero { width: min(480px, 90vw); height: auto; }
.logo-wordmark {
  font-family: "Silkscreen", monospace;
  font-weight: 700;
  font-size: 58px;
  fill: var(--cyan);
  paint-order: stroke;
  stroke: #0b2a33;
  stroke-width: 5px;
}
.logo-tagline {
  font-family: "Permanent Marker", cursive;
  font-size: 26px;
  fill: #e8f4f6;
  opacity: 0.9;
}

/* ---------- layout ---------- */
.site-header {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 24px;
  border-bottom: 1px solid var(--border);
  background: rgba(10, 18, 22, 0.8);
}
.header-logo { text-decoration: none; }
.header-user { display: flex; align-items: center; gap: 12px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--border); }
.username { font-weight: 600; }

main { position: relative; z-index: 2; flex: 1; }
.container { width: min(960px, 100% - 48px); margin: 40px auto; }

.site-footer {
  position: relative;
  z-index: 2;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
}

/* ---------- splash ---------- */
.splash { display: flex; align-items: center; justify-content: center; }
.splash-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  text-align: center;
  padding: 48px 24px;
}
.splash-tag { color: var(--muted); font-size: 1.05rem; max-width: 34ch; margin: 0; }

/* ---------- panels ---------- */
.panel {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 28px 32px;
  box-shadow: 0 0 24px rgba(69, 208, 232, 0.05);
}
.panel h1 { margin-top: 0; color: var(--cyan-bright); font-size: 1.5rem; }
.panel h2 { margin-top: 0; color: var(--cyan-bright); font-size: 1.15rem; }

.page-title { font-size: 1.4rem; color: var(--cyan-bright); margin: 0 0 24px; }

.dash-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
}

/* ---------- events / finances ---------- */
.sample-note { font-size: 0.8rem; }
.event-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 16px; }
.event-list li { display: flex; align-items: center; gap: 16px; }
.event-date {
  flex: 0 0 auto;
  color: var(--cyan);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 0.8rem;
  background: rgba(69, 208, 232, 0.06);
}

.finance-table { width: 100%; border-collapse: collapse; }
.finance-table th, .finance-table td {
  text-align: left;
  padding: 8px 6px;
  border-bottom: 1px solid var(--border);
}
.finance-table th { color: var(--muted); font-weight: 600; font-size: 0.85rem; }

/* ---------- forms ---------- */
.two-ways { margin: 16px 0 24px; padding-left: 20px; }
.two-ways li { margin-bottom: 8px; }

.apply-form { display: flex; flex-direction: column; gap: 18px; max-width: 560px; }
.apply-form label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 0.95rem; }
.apply-form input, .apply-form textarea, .apply-form select {
  font: inherit;
  font-weight: 400;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 12px;
}
.apply-form input:focus, .apply-form textarea:focus, .apply-form select:focus {
  outline: none;
  border-color: var(--cyan-dim);
  box-shadow: 0 0 0 2px rgba(69, 208, 232, 0.15);
}

.muted { color: var(--muted); font-weight: 400; }
.error { color: var(--error); }

/* ---------- events ---------- */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head .page-title { margin: 0; }
.head-actions { display: flex; gap: 10px; align-items: center; }
.backlink { display: inline-block; margin-bottom: 14px; text-decoration: none; }
.backlink:hover { color: var(--text); }

.event-info { flex: 1; }
.event-title { color: var(--cyan-bright); font-weight: 600; text-decoration: none; }
.event-title:hover { text-decoration: underline; }

.event-head { display: flex; align-items: center; gap: 12px; }
.fact-list { list-style: none; padding: 0; margin: 12px 0; display: flex; flex-direction: column; gap: 6px; }
.event-desc { white-space: pre-line; }

.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}
.badge-paid { background: rgba(74, 222, 128, 0.15); color: #4ade80; border: 1px solid rgba(74, 222, 128, 0.4); }
.badge-owed { background: rgba(250, 204, 21, 0.12); color: #facc15; border: 1px solid rgba(250, 204, 21, 0.4); }
.badge-claimed { background: rgba(69, 208, 232, 0.12); color: var(--cyan); border: 1px solid rgba(69, 208, 232, 0.4); }
.badge-wait { background: rgba(125, 151, 160, 0.15); color: var(--muted); border: 1px solid var(--border); }
.badge-cancelled { background: rgba(255, 107, 107, 0.12); color: var(--error); border: 1px solid rgba(255, 107, 107, 0.4); }

.rsvp-box {
  margin-top: 20px;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(69, 208, 232, 0.04);
}
.rsvp-form { display: flex; flex-direction: column; gap: 10px; }
.radio { display: flex; align-items: center; gap: 8px; font-weight: 400; cursor: pointer; }
.radio.inline { display: inline-flex; }
.rsvp-box form { margin-top: 10px; }
.cancel-form { margin-top: 14px; }

.attendee-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.attendee-list li { display: flex; align-items: center; gap: 10px; }

.form-row { display: flex; gap: 16px; }
.form-row label { flex: 1; }
.sub-head { margin-top: 28px; font-size: 0.95rem; color: var(--cyan-bright); }
.add-attendee { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.add-attendee input[type="text"], .add-attendee select {
  font: inherit; color: var(--text); background: var(--bg);
  border: 1px solid var(--border); border-radius: 6px; padding: 8px 10px;
}
.row-actions { display: flex; gap: 6px; }
.row-actions form { display: inline; }
.btn-sm { padding: 4px 10px; font-size: 0.78rem; }
.danger-zone { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--border); }
.btn-danger { background: transparent; color: var(--error); border: 1px solid rgba(255, 107, 107, 0.4); }

/* ---------- finances ---------- */
.progress {
  margin-top: 5px;
  height: 6px;
  border-radius: 999px;
  background: rgba(69, 208, 232, 0.12);
  overflow: hidden;
  max-width: 220px;
}
.progress-fill { height: 100%; background: var(--cyan); border-radius: 999px; }
.fund-total { margin-top: 16px; color: var(--muted); }
.fund-total a { color: var(--cyan); }
.table-scroll { overflow-x: auto; }
.nowrap { white-space: nowrap; }
.ledger-panel { margin-top: 24px; }
.project-row { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; flex-wrap: wrap; }
.project-row input[type="text"], .project-row input[type="number"] {
  font: inherit; color: var(--text); background: var(--bg);
  border: 1px solid var(--border); border-radius: 6px; padding: 7px 10px;
}
.project-row input[type="text"] { flex: 1; min-width: 160px; }
.goal-input { width: 100px; }
.project-row.archived input[type="text"] { opacity: 0.55; }
.allocate-form select {
  font: inherit; font-size: 0.85rem; color: var(--text); background: var(--bg);
  border: 1px solid var(--border); border-radius: 6px; padding: 5px 8px;
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  font: 600 0.95rem "Inter", system-ui, sans-serif;
  text-decoration: none;
  cursor: pointer;
  transition: filter 0.15s, box-shadow 0.15s;
}
.btn:hover { filter: brightness(1.12); }

.btn-primary {
  background: var(--cyan);
  color: #06222b;
  align-self: flex-start;
  box-shadow: 0 0 18px rgba(69, 208, 232, 0.35);
}
.btn-discord {
  background: #5865f2;
  color: #fff;
  font-size: 1.05rem;
  padding: 14px 28px;
  box-shadow: 0 0 22px rgba(88, 101, 242, 0.4);
}
.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
  padding: 7px 14px;
  font-size: 0.85rem;
}
.btn-ghost:hover { color: var(--text); }
