@import url('https://fonts.googleapis.com/css2?family=Kanit:wght@300;400;500;600;700&display=swap');

:root {
  --pink: #e6017f;
  --plum: #84195c;
  --pink-bg: #fdf4f9;
  --ink: #2a1220;
  --ink-soft: #6b5563;
  --line: #f0d9e6;
  --ok: #1c8a5a;
  --warn: #b8790a;
  --danger: #c62b4a;
  --white: #ffffff;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 8px 28px rgba(132, 25, 92, 0.10);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--pink-bg);
  color: var(--ink);
  font-family: 'Kanit', system-ui, sans-serif;
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--pink); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { font-weight: 600; margin: 0 0 8px; color: var(--ink); }
p { margin: 0 0 12px; color: var(--ink-soft); line-height: 1.7; }

.topbar {
  background: var(--white);
  border-bottom: 1px solid var(--line);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar img { height: 40px; display: block; }
.topbar .brandtext { font-weight: 600; font-size: 17px; color: var(--plum); }
.topbar .brandtext small { display: block; font-weight: 300; font-size: 12px; color: var(--ink-soft); }
.topbar nav { margin-left: auto; display: flex; gap: 18px; font-size: 14px; }
.topbar nav a { color: var(--ink-soft); font-weight: 400; }
.topbar nav a.active { color: var(--pink); font-weight: 600; }

main { flex: 1; width: 100%; max-width: 980px; margin: 0 auto; padding: 32px 20px 60px; }
main.wide { max-width: 1200px; }

.page-head { margin-bottom: 28px; }
.page-head h1 { font-size: 26px; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.14em; font-size: 11px; color: var(--pink); font-weight: 600; margin-bottom: 6px; }

.card {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 22px;
  margin-bottom: 18px;
}

.event-card { display: flex; flex-direction: column; gap: 10px; }
.event-card .row-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.event-card h3 { font-size: 19px; margin: 0; }
.event-meta { font-size: 13px; color: var(--ink-soft); display: flex; flex-wrap: wrap; gap: 14px; }
.event-meta span { display: inline-flex; align-items: center; gap: 5px; }

.badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}
.badge.open { background: #e9f8f1; color: var(--ok); }
.badge.closed { background: #f4f0f0; color: #8a7f83; }
.badge.full { background: #fdeee9; color: var(--warn); }
.badge.waitlist { background: #fdeef6; color: var(--pink); }
.badge.registered { background: #e9f8f1; color: var(--ok); }
.badge.cancelled { background: #f4f0f0; color: #8a7f83; }
.badge.checkedin { background: #e9f2fd; color: #1c5a8a; }

.positions-list { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.position-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: var(--pink-bg);
  border-radius: var(--radius-sm);
  font-size: 14px;
}
.position-row .pname { font-weight: 500; }
.position-row .pcount { color: var(--ink-soft); font-size: 13px; }
.position-row button { flex-shrink: 0; }

button, .btn {
  font-family: inherit;
  font-weight: 500;
  font-size: 14px;
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px 18px;
  cursor: pointer;
  background: var(--pink);
  color: white;
  transition: transform 0.08s ease, opacity 0.15s ease;
}
button:hover, .btn:hover { opacity: 0.9; text-decoration: none; }
button:active { transform: scale(0.97); }
button:disabled { background: #ddd; color: #999; cursor: not-allowed; }
button.secondary { background: var(--white); color: var(--plum); border: 1px solid var(--line); }
button.secondary:hover { background: var(--pink-bg); }
button.danger { background: var(--danger); }
button.small { padding: 6px 12px; font-size: 13px; }
button.ghost { background: transparent; color: var(--pink); padding: 6px 10px; }

.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 500; color: var(--ink); margin-bottom: 6px; }
.form-group .hint { font-size: 12px; color: var(--ink-soft); margin-top: 4px; }
input[type=text], input[type=tel], input[type=email], input[type=number], input[type=datetime-local], input[type=date], input[type=password], select, textarea {
  width: 100%;
  font-family: inherit;
  font-size: 15px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--pink-bg);
  color: var(--ink);
  color-scheme: light;
}
input[type=date], input[type=datetime-local] {
  font-family: inherit;
}
input[type=date]::-webkit-calendar-picker-indicator,
input[type=datetime-local]::-webkit-calendar-picker-indicator {
  filter: invert(24%) sepia(80%) saturate(3000%) hue-rotate(300deg) brightness(90%);
  cursor: pointer;
  opacity: 0.75;
}
input[type=date]::-webkit-calendar-picker-indicator:hover,
input[type=datetime-local]::-webkit-calendar-picker-indicator:hover {
  opacity: 1;
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--pink);
  outline-offset: 1px;
  background: var(--white);
}
textarea { resize: vertical; min-height: 80px; }

.alert { padding: 12px 16px; border-radius: var(--radius-sm); font-size: 14px; margin-bottom: 16px; }
.alert.error { background: #fdeceb; color: var(--danger); }
.alert.success { background: #e9f8f1; color: var(--ok); }
.alert.info { background: #eef4fd; color: #1c5a8a; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); }
th { color: var(--ink-soft); font-weight: 500; font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; }
tr:last-child td { border-bottom: none; }

.footer {
  text-align: center;
  padding: 40px 20px 30px;
  color: var(--ink-soft);
  font-size: 12.5px;
  border-top: 1px solid var(--line);
  background: var(--white);
  margin-top: auto;
}
.footer img { height: 30px; margin-bottom: 10px; opacity: 0.9; }
.footer .line1 { color: var(--plum); font-weight: 500; margin-bottom: 2px; }
.footer .line2 { margin-bottom: 2px; }

.empty-state { text-align: center; padding: 60px 20px; color: var(--ink-soft); }
.empty-state .icon { font-size: 42px; margin-bottom: 10px; }

details summary { list-style: none; }
details summary::-webkit-details-marker { display: none; }
details summary::before { content: "▸ "; }
details[open] summary::before { content: "▾ "; }

.modal-overlay {
  position: fixed; inset: 0; background: rgba(42,18,32,0.45);
  display: flex; align-items: center; justify-content: center;
  z-index: 100; padding: 20px;
}
.modal {
  background: white; border-radius: var(--radius); padding: 26px;
  max-width: 440px; width: 100%; box-shadow: var(--shadow);
}
.modal h3 { margin-bottom: 14px; }
.modal .actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }

.spinner {
  border: 3px solid var(--line); border-top-color: var(--pink);
  border-radius: 50%; width: 22px; height: 22px;
  animation: spin 0.7s linear infinite; margin: 20px auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

.tag-row { display: flex; gap: 8px; flex-wrap: wrap; }

@media (max-width: 640px) {
  .topbar nav { gap: 10px; font-size: 13px; }
  .topbar .brandtext small { display: none; }
  .row-top { flex-direction: column; }
  main { padding: 20px 14px 50px; }
}

@media print {
  .topbar, .footer, .no-print { display: none !important; }
  body { background: white; }
  main { max-width: 100%; padding: 0; }
}
