:root {
  --bg: #f6f8fc;
  --card: #ffffff;
  --line: #dfe7f3;
  --text: #1d2433;
  --muted: #647089;
  --brand: #4f46e5;
  --brand-2: #7c3aed;
  --good: #0f9d58;
  --warn: #b7791f;
  --bad: #c53030;
  --shadow: 0 12px 30px rgba(34, 52, 99, 0.08);
  --radius: 18px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(124,58,237,0.12), transparent 30%),
    radial-gradient(circle at top right, rgba(79,70,229,0.12), transparent 28%),
    var(--bg);
  color: var(--text);
}

a { color: var(--brand); font-weight: 700; text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px 20px 48px;
}

.hero {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 22px;
  align-items: stretch;
  margin-bottom: 22px;
}

.hero-card, .card {
  background: var(--card);
  border: 1px solid rgba(223,231,243,0.9);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hero-card {
  padding: 28px;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.card { padding: 22px; }

.brand-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  margin-bottom: 14px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--brand);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: 0 0 0 6px rgba(79, 70, 229, 0.12);
}

.admin-link, .logout-link {
  padding: 8px 12px;
  border-radius: 999px;
  background: #eff3ff;
  color: #334155;
  font-size: 0.88rem;
}

h1 {
  margin: 0 0 10px;
  font-size: clamp(2rem, 4vw, 3.3rem);
  line-height: 1.03;
  letter-spacing: -0.04em;
}

h2 {
  margin: 0 0 6px;
  font-size: 1.3rem;
  letter-spacing: -0.03em;
}

.subtitle, .hint {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.hint {
  margin-bottom: 18px;
  font-size: 0.95rem;
}

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  margin-bottom: 22px;
}

.center-card {
  max-width: 520px;
  margin: 80px auto;
}

.stats {
  padding: 22px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.stat {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
  background: linear-gradient(180deg, #fff, #fafbff);
}

.stat .label {
  display: block;
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 8px;
}

.stat .value {
  display: block;
  font-weight: 800;
  font-size: 2rem;
  letter-spacing: -0.04em;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.full-width { grid-column: 1 / -1; }

label {
  display: block;
  font-size: 0.9rem;
  font-weight: 650;
  margin-bottom: 8px;
}

input, textarea, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  font: inherit;
  color: inherit;
  background: #fff;
  outline: none;
  transition: border-color .18s ease, box-shadow .18s ease;
}

input:focus, textarea:focus, select:focus {
  border-color: rgba(79,70,229,0.6);
  box-shadow: 0 0 0 4px rgba(79,70,229,0.12);
}

textarea {
  min-height: 104px;
  resize: vertical;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

button {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, opacity .2s ease;
}

button:hover { transform: translateY(-1px); }
button:active { transform: translateY(0); }

.primary {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
  box-shadow: 0 10px 22px rgba(79,70,229,0.28);
}

.secondary {
  background: #eff3ff;
  color: #334155;
}

.danger {
  background: #fff1f2;
  color: var(--bad);
}

.event-preview {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
  background: linear-gradient(180deg, #fff, #fafcff);
  margin-bottom: 18px;
}

.event-title {
  margin: 0 0 8px;
  font-size: 1.4rem;
  letter-spacing: -0.03em;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: #eef2ff;
  color: #3730a3;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 650;
}

.mini {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.5;
  margin: 0;
  white-space: pre-wrap;
}

.toolbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 16px;
}

.toolbar .left, .toolbar .right {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 18px;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  min-width: 820px;
}

th, td {
  padding: 14px 12px;
  border-bottom: 1px solid #edf1f7;
  text-align: left;
  vertical-align: top;
  font-size: 0.95rem;
}

th {
  position: sticky;
  top: 0;
  background: #f8faff;
  color: #475569;
  font-size: 0.84rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.status {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
}

.status.yes { background: #ecfdf3; color: var(--good); }
.status.maybe { background: #fff7e6; color: var(--warn); }
.status.no { background: #fff1f2; color: var(--bad); }

.empty, .success-box, .error-box, .warn-box {
  padding: 16px;
  border-radius: 14px;
  margin-bottom: 14px;
  font-weight: 650;
}

.empty {
  padding: 26px;
  border: 1px dashed var(--line);
  color: var(--muted);
  text-align: center;
  background: #fbfcff;
}

.success-box { border: 1px solid #bbf7d0; background: #f0fdf4; color: #166534; }
.error-box { border: 1px solid #fecdd3; background: #fff1f2; color: #9f1239; }
.warn-box { border: 1px solid #fde68a; background: #fffbeb; color: #92400e; }

.inline-note, .footnote {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.5;
  margin-top: 14px;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  background: #111827;
  color: #fff;
  padding: 12px 16px;
  border-radius: 999px;
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.22);
  font-weight: 700;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .2s ease, transform .2s ease;
  z-index: 9999;
}
.toast.show { opacity: 1; transform: translateY(0); }

@media (max-width: 980px) {
  .hero, .grid { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  .stats, .form-grid { grid-template-columns: 1fr; }
  .wrap { padding: 18px 14px 34px; }
  .card, .hero-card, .stats { padding: 18px; }
  .brand-row { align-items: flex-start; }
}
