:root {
  --ink: #1b1f24;
  --muted: #5b6470;
  --line: #dde2e8;
  --bg: #f7f8fa;
  --card: #ffffff;
  --accent: #b3261e;
  --accent-ink: #ffffff;
  --focus: #2563eb;
  --success-bg: #eaf6ec;
  --success-ink: #1e6b34;
  --error-bg: #fdecec;
  --error-ink: #a3231b;
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
}

.wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: 32px 20px 80px;
}

.wrap.wide {
  max-width: 1080px;
}

header.site {
  text-align: center;
  margin-bottom: 28px;
}

header.site h1 {
  font-size: 1.6rem;
  margin: 0 0 4px;
  letter-spacing: 0.01em;
}

header.site p {
  color: var(--muted);
  margin: 0;
  font-size: 0.95rem;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
}

fieldset {
  border: none;
  padding: 0;
  margin: 0 0 22px;
}

legend {
  font-weight: 600;
  font-size: 1.02rem;
  margin-bottom: 10px;
  padding: 0;
}

.hint {
  color: var(--muted);
  font-size: 0.85rem;
  margin: -6px 0 12px;
}

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

input[type="text"],
input[type="number"],
input[type="password"],
input[type="time"],
textarea,
select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: inherit;
  background: #fff;
  color: var(--ink);
}

input:focus, textarea:focus, select:focus {
  outline: 2px solid var(--focus);
  outline-offset: 1px;
}

.field {
  margin-bottom: 16px;
}

.row2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 560px) {
  .row2 { grid-template-columns: 1fr; }
}

.event-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.event-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  cursor: pointer;
}

.event-option:has(input:checked) {
  border-color: var(--accent);
  background: #fbf1f0;
}

.event-option input[type="checkbox"] {
  margin-top: 3px;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.event-option .ev-label {
  font-weight: 600;
}

.event-option .ev-detail {
  color: var(--muted);
  font-size: 0.85rem;
}

.fee-note {
  background: #fff7e6;
  border: 1px solid #f0dca6;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 0.88rem;
  margin-bottom: 18px;
}

button, .btn {
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 11px 18px;
  cursor: pointer;
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
}

.btn-primary:hover { opacity: 0.92; }

.btn-secondary {
  background: #fff;
  border-color: var(--line);
  color: var(--ink);
}

.btn-secondary:hover { background: #f2f3f5; }

.btn-danger {
  background: #fff;
  border-color: #e3b5b2;
  color: var(--accent);
}

.btn-sm { padding: 6px 10px; font-size: 0.82rem; }

.msg {
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 0.9rem;
  margin-bottom: 16px;
}

.msg.success { background: var(--success-bg); color: var(--success-ink); }
.msg.error { background: var(--error-bg); color: var(--error-ink); }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

th, td {
  text-align: left;
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

th {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

tr:hover td { background: #fafbfc; }

.tag {
  display: inline-block;
  background: #eef1f5;
  border-radius: 999px;
  padding: 2px 9px;
  font-size: 0.76rem;
  margin: 1px 3px 1px 0;
  color: #3c4450;
}

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

.topbar .actions { display: flex; gap: 8px; flex-wrap: wrap; }

.small { font-size: 0.82rem; color: var(--muted); }

.login-box {
  max-width: 360px;
  margin: 80px auto;
}

.event-group {
  margin-bottom: 26px;
}

.event-group h3 {
  margin: 0 0 4px;
  font-size: 1.05rem;
}

.event-group .meta {
  color: var(--muted);
  font-size: 0.82rem;
  margin-bottom: 10px;
}

.order-input {
  width: 60px;
  padding: 4px 6px;
}

.nav-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.nav-tabs a {
  padding: 9px 14px;
  text-decoration: none;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
  border-bottom: 2px solid transparent;
}

.nav-tabs a.active {
  color: var(--ink);
  border-bottom-color: var(--accent);
}

input[type="checkbox"].small-check {
  width: 16px;
  height: 16px;
}

@media print {
  .no-print { display: none !important; }
  body { background: #fff; }
  .card { border: none; padding: 0; }
}
