:root {
  --bg: #0b0b0d;
  --bg-elev: #131316;
  --bg-elev-2: #1a1a1f;
  --border: #25252b;
  --border-strong: #34343c;
  --text: #ededee;
  --text-dim: #a1a1a8;
  --text-mute: #6c6c75;
  --accent: oklch(0.62 0.20 25);
  --accent-soft: oklch(0.62 0.20 25 / 0.14);
  --accent-line: oklch(0.62 0.20 25 / 0.35);
  --ok: oklch(0.72 0.16 150);
  --warn: oklch(0.78 0.16 75);
  --danger: oklch(0.62 0.20 25);
  --radius: 6px;
  --radius-lg: 10px;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Geist', system-ui, -apple-system, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
body {
  min-height: 100vh;
  background:
    radial-gradient(ellipse at top, rgba(220, 38, 38, 0.04), transparent 60%),
    var(--bg);
}
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }
a { color: inherit; }

.mono { font-family: 'Geist Mono', ui-monospace, monospace; }
.ko { font-family: 'Noto Serif KR', serif; }

/* ---------- Layout ---------- */
.app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  padding: 0 20px;
  border-bottom: 1px solid var(--border);
  background: rgba(11,11,13,0.85);
  backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 50;
}
.brand {
  display: flex; align-items: center; gap: 12px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.brand-mark {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border-radius: 6px;
  background: linear-gradient(135deg, #1a1a1f, #0b0b0d);
  border: 1px solid var(--border-strong);
  position: relative;
  overflow: hidden;
}
.brand-mark::before {
  content: '';
  position: absolute; inset: 0;
  background: var(--accent);
  clip-path: polygon(50% 8%, 92% 92%, 8% 92%);
  opacity: 0.95;
  transform: scale(0.55);
}
.brand-mark::after {
  content: '';
  position: absolute;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--bg);
  top: 50%; left: 50%;
  transform: translate(-50%, 20%);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text strong { font-size: 13px; letter-spacing: 0.02em; }
.brand-text span { font-size: 11px; color: var(--text-mute); letter-spacing: 0.04em; text-transform: uppercase; }

.role-toggle {
  display: flex; align-items: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px;
  background: var(--bg-elev);
}
.role-toggle button {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 999px;
  letter-spacing: 0.01em;
}
.role-toggle button.active {
  background: var(--accent);
  color: white;
}

.shell { display: flex; flex: 1; min-height: 0; }
.sidebar {
  width: 220px;
  border-right: 1px solid var(--border);
  padding: 20px 12px;
  display: flex; flex-direction: column;
  gap: 2px;
  flex-shrink: 0;
}
.side-label {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-mute);
  padding: 8px 12px 6px;
}
.side-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius);
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 500;
  border: none; background: transparent; text-align: left;
  width: 100%;
  transition: background .15s, color .15s;
}
.side-item:hover { background: var(--bg-elev); color: var(--text); }
.side-item.active { background: var(--bg-elev); color: var(--text); }
.side-item.active::before {
  content: ''; width: 3px; height: 16px;
  background: var(--accent); border-radius: 2px;
  margin-left: -12px; margin-right: 7px;
}
.side-item .badge {
  margin-left: auto;
  font-size: 11px;
  padding: 1px 6px;
  background: var(--bg-elev-2);
  border-radius: 999px;
  color: var(--text-dim);
}

.main {
  flex: 1;
  overflow-y: auto;
  padding: 28px 32px 80px;
  min-width: 0;
}
.page-header {
  display: flex; align-items: flex-end; justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
  flex-wrap: wrap;
}
.page-title {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0;
}
.page-sub {
  color: var(--text-dim);
  font-size: 13px;
  margin-top: 4px;
}
.page-actions { display: flex; gap: 8px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 34px; padding: 0 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  transition: background .15s, border-color .15s;
}
.btn:hover { background: var(--bg-elev-2); border-color: var(--border-strong); }
.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; }
.btn.danger { background: transparent; border-color: var(--border); color: var(--accent); }
.btn.danger:hover { background: var(--accent-soft); }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12px; }
.btn.lg { height: 42px; padding: 0 20px; font-size: 14px; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.icon-btn {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--text-dim);
}
.icon-btn:hover { color: var(--text); }

/* ---------- Cards / panels ---------- */
.card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
}
.card.flush { padding: 0; overflow: hidden; }
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}
.card-head h3 { margin: 0; font-size: 14px; font-weight: 600; }
.card-head .sub { color: var(--text-dim); font-size: 12px; }

/* ---------- Stats ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px,1fr)); gap: 12px; margin-bottom: 24px; }
.stat {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  position: relative;
}
.stat .label {
  font-size: 11px;
  color: var(--text-mute);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}
.stat .value { font-size: 28px; font-weight: 600; letter-spacing: -0.02em; }
.stat .delta { font-size: 12px; color: var(--text-dim); margin-top: 4px; }
.stat .delta.pos { color: var(--ok); }
.stat .accent-bar {
  position: absolute; left: 0; top: 16px; bottom: 16px;
  width: 3px; background: var(--accent); border-radius: 0 2px 2px 0;
}

/* ---------- Tables ---------- */
table.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.tbl th, .tbl td {
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
.tbl th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-mute);
  font-weight: 500;
  background: var(--bg-elev-2);
}
.tbl tr:last-child td { border-bottom: none; }
.tbl tr:hover td { background: rgba(255,255,255,0.015); }
.tbl td.num { font-family: 'Geist Mono', monospace; font-variant-numeric: tabular-nums; }

/* ---------- Pills / chips ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  border: 1px solid var(--border);
  background: var(--bg-elev-2);
  color: var(--text-dim);
}
.pill.ok { color: var(--ok); border-color: oklch(0.72 0.16 150 / 0.3); background: oklch(0.72 0.16 150 / 0.08); }
.pill.pending { color: var(--warn); border-color: oklch(0.78 0.16 75 / 0.3); background: oklch(0.78 0.16 75 / 0.08); }
.pill.danger { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); }
.dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label, .label-text { font-size: 12px; color: var(--text-dim); font-weight: 500; }
.input, .select, .textarea {
  height: 38px; padding: 0 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--text);
  font-size: 13px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.textarea { padding: 10px 12px; min-height: 80px; height: auto; resize: vertical; line-height: 1.5; }
.input-row { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
.input-row.three { grid-template-columns: 1fr 1fr 1fr; }
.field .hint { font-size: 11px; color: var(--text-mute); }

.checkbox {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elev);
  cursor: pointer;
  font-size: 13px;
  user-select: none;
  transition: border-color .15s, background .15s;
}
.checkbox:hover { border-color: var(--border-strong); }
.checkbox.on { border-color: var(--accent); background: var(--accent-soft); }
.checkbox input { display: none; }
.check-box {
  width: 16px; height: 16px;
  border-radius: 4px;
  border: 1.5px solid var(--border-strong);
  display: grid; place-items: center;
  flex-shrink: 0;
}
.checkbox.on .check-box { background: var(--accent); border-color: var(--accent); }
.checkbox.on .check-box::after {
  content: '';
  width: 4px; height: 8px;
  border-right: 2px solid white;
  border-bottom: 2px solid white;
  transform: rotate(45deg) translate(-1px, -1px);
}
.checkbox .price { margin-left: auto; color: var(--text-dim); font-family: 'Geist Mono', monospace; font-size: 12px; }

/* ---------- Tabs ---------- */
.tabs {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}
.tabs button {
  background: transparent;
  border: none;
  color: var(--text-dim);
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 500;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.tabs button:hover { color: var(--text); }
.tabs button.active { color: var(--text); border-color: var(--accent); }

/* ---------- Avatars ---------- */
.avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 11px;
  font-weight: 600;
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  color: var(--text-dim);
  flex-shrink: 0;
}
.avatar.lg { width: 44px; height: 44px; font-size: 14px; }

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: grid; place-items: center;
  padding: 20px;
  animation: fade .2s ease;
}
.modal {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 540px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  animation: pop .2s ease;
}
.modal.lg { max-width: 720px; }
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}
.modal-head h2 { margin: 0; font-size: 16px; font-weight: 600; }
.modal-body { padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.modal-foot {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: 8px;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(0.98); } to { opacity: 1; transform: none; } }

/* ---------- Participant flow ---------- */
.participant-shell {
  max-width: 560px;
  margin: 0 auto;
  padding: 32px 20px 80px;
}
.event-hero {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-elev);
  padding: 24px;
  position: relative;
  overflow: hidden;
}
.event-hero::before {
  content: '';
  position: absolute;
  top: -40px; right: -30px;
  width: 160px; height: 160px;
  background: radial-gradient(circle, var(--accent-soft), transparent 70%);
  pointer-events: none;
}
.event-hero .ko-watermark {
  position: absolute;
  bottom: -20px; right: 10px;
  font-family: 'Noto Serif KR', serif;
  font-size: 110px;
  font-weight: 700;
  color: var(--bg-elev-2);
  line-height: 1;
  pointer-events: none;
  user-select: none;
}
.event-hero h1 {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 8px 0 6px;
  position: relative;
}
.event-hero .meta {
  display: flex; flex-wrap: wrap; gap: 16px;
  color: var(--text-dim);
  font-size: 13px;
  margin-top: 14px;
  position: relative;
}
.event-hero .meta div { display: flex; align-items: center; gap: 8px; }

/* Stepper */
.stepper {
  display: flex; align-items: center; gap: 6px;
  margin: 28px 0 20px;
  font-size: 12px;
}
.stepper .step {
  display: flex; align-items: center; gap: 8px;
  color: var(--text-mute);
}
.stepper .step.done { color: var(--text-dim); }
.stepper .step.active { color: var(--text); font-weight: 500; }
.stepper .num {
  width: 22px; height: 22px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  font-size: 11px;
  font-weight: 600;
}
.stepper .step.active .num { background: var(--accent); border-color: var(--accent); color: white; }
.stepper .step.done .num { background: var(--bg-elev-2); border-color: var(--accent-line); color: var(--accent); }
.stepper .bar { flex: 1; height: 1px; background: var(--border); }

/* QR */
.qr-box {
  background: white;
  padding: 16px;
  border-radius: var(--radius);
  display: grid; place-items: center;
  margin: 0 auto;
  width: fit-content;
}
.qr-box canvas { display: block; }
.amount-display {
  font-family: 'Geist Mono', monospace;
  font-variant-numeric: tabular-nums;
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

/* Misc */
.divider { height: 1px; background: var(--border); margin: 16px 0; }
.flex-row { display: flex; gap: 8px; align-items: center; }
.muted { color: var(--text-dim); }
.tiny { font-size: 11px; }
.spacer { flex: 1; }
.hr-thin { border: none; border-top: 1px solid var(--border); margin: 12px 0; }

/* Stripe pattern accent */
.stripe-accent {
  background-image: repeating-linear-gradient(
    -45deg,
    transparent 0,
    transparent 6px,
    var(--accent-line) 6px,
    var(--accent-line) 7px
  );
  height: 4px;
}

/* Empty states */
.empty {
  padding: 60px 20px;
  text-align: center;
  color: var(--text-dim);
}
.empty .icon { font-size: 32px; margin-bottom: 12px; opacity: 0.5; }

/* Responsive */
@media (max-width: 820px) {
  .sidebar { display: none; }
  .main { padding: 20px 16px 80px; }
  .topbar { padding: 0 14px; }
  .input-row, .input-row.three { grid-template-columns: 1fr; }
  .brand-text { display: none; }
}

/* Inline icons (stroke) */
.ic { width: 16px; height: 16px; flex-shrink: 0; stroke-width: 1.75; }
.ic.lg { width: 20px; height: 20px; }
.ic.xs { width: 14px; height: 14px; }

.copy-row {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px;
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: 'Geist Mono', monospace;
  font-size: 12px;
  word-break: break-all;
}
.copy-row .copy-btn {
  margin-left: auto; flex-shrink: 0;
  background: transparent; border: none; color: var(--text-dim);
  padding: 4px 8px; border-radius: 4px;
  font-family: inherit; font-size: 11px;
}
.copy-row .copy-btn:hover { color: var(--text); background: var(--bg-elev); }

/* Event card */
.event-card {
  text-align: left;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex; flex-direction: column; gap: 12px;
  color: inherit;
  transition: border-color .15s, transform .15s;
}
.event-card:hover { border-color: var(--border-strong); transform: translateY(-1px); }
.event-card-head { display: flex; align-items: flex-start; gap: 12px; }
.event-date {
  width: 48px; flex-shrink: 0;
  border: 1px solid var(--border); border-radius: 6px;
  background: var(--bg-elev-2);
  padding: 6px 4px; text-align: center; line-height: 1;
}
.event-date .month { display:block; font-size: 10px; color: var(--accent); font-weight: 600; letter-spacing: 0.06em; }
.event-date .day { display:block; font-size: 18px; font-weight: 600; margin-top: 2px; }
.event-title { font-weight: 500; font-size: 14px; line-height: 1.3; }
.event-card-meta { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--text-dim); }
.event-card-meta div { display: flex; align-items: center; gap: 6px; }
.event-card-cats { display: flex; flex-wrap: wrap; gap: 4px; }

/* Toast */
.toast {
  position: fixed;
  bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--bg-elev-2);
  border: 1px solid var(--border-strong);
  color: var(--text);
  padding: 10px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  z-index: 200;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  animation: pop .2s ease;
}
