:root {
  --red: #E3000B;
  --red-dark: #c00009;
  --ink: #1a1a1a;
  --muted: #8a8a8a;
  --line: #e8e8e8;
  --bg: #ffffff;
  --soft: #f6f6f6;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

/* ---------- header ---------- */
.site-header {
  border-bottom: 3px solid var(--ink);
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 20;
}
.header-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 18px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.logo { height: 34px; width: auto; display: block; }
.brand-text {
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.brand-sub {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  border-left: 1px solid var(--line);
  padding-left: 16px;
  margin-left: 2px;
}

.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}

/* ---------- headings ---------- */
.page-title {
  font-size: 40px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 4px;
  line-height: 1.05;
}
.page-title .accent { color: var(--red); }
.section-label {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 12px;
  font-weight: 700;
  color: var(--red);
  margin-bottom: 8px;
}
.crumbs {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 20px;
}
.crumbs a:hover { color: var(--red); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: none;
  background: var(--ink);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  padding: 12px 20px;
  cursor: pointer;
  letter-spacing: 0.02em;
  transition: background .15s ease;
  border-radius: 0;
}
.btn:hover { background: #000; }
.btn-red { background: var(--red); }
.btn-red:hover { background: var(--red-dark); }
.btn-ghost {
  background: #fff;
  color: var(--ink);
  border: 2px solid var(--ink);
  padding: 10px 18px;
}
.btn-ghost:hover { background: var(--ink); color: #fff; }
.btn-sm { padding: 7px 12px; font-size: 12px; }

.actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 22px 0 28px;
}

/* ---------- events grid ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
.event-card {
  background: #fff;
  padding: 24px;
  cursor: pointer;
  transition: background .15s ease;
  position: relative;
}
.event-card:hover { background: var(--soft); }
.event-card .date {
  color: var(--red);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.event-card h3 {
  margin: 8px 0 14px;
  font-size: 22px;
  font-weight: 800;
  line-height: 1.15;
}
.event-card .meta {
  font-size: 13px;
  color: var(--muted);
  display: flex;
  gap: 16px;
}
.event-card .meta b { color: var(--ink); }

/* ---------- search ---------- */
.search-box {
  position: relative;
  margin: 4px 0 18px;
}
.search-box input {
  width: 100%;
  border: 2px solid var(--ink);
  padding: 14px 16px;
  font-size: 16px;
  outline: none;
  font-family: inherit;
}
.search-box input:focus { border-color: var(--red); }

/* ---------- participants ---------- */
.list-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 10px 0 12px;
}
.list-head h2 { font-size: 20px; font-weight: 800; margin: 0; }
.count-pill {
  font-size: 13px;
  color: var(--muted);
}

.p-list { border-top: 1px solid var(--line); }
.p-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 8px;
  border-bottom: 1px solid var(--line);
  transition: background .12s ease;
}
.p-row:hover { background: var(--soft); }
.p-row.checked { background: #fbfff4; }

.check {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  border: 2px solid var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background: #fff;
  transition: all .12s ease;
}
.check.on { background: #2e7d32; border-color: #2e7d32; }
.check svg { width: 16px; height: 16px; display: none; }
.check.on svg { display: block; }

.p-info { flex: 1 1 auto; min-width: 0; }
.p-name { font-weight: 700; font-size: 16px; }
.p-name.struck { color: var(--muted); }
.p-company { font-size: 13px; color: var(--muted); }

.tag {
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 5px 10px;
  white-space: nowrap;
}
.tag-reg { background: #eef4ff; color: #1d4ed8; }
.tag-walk { background: #fff0e6; color: #d2691e; }

.del-btn {
  flex: 0 0 auto;
  border: none;
  background: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  padding: 4px 8px;
  border-radius: 4px;
}
.del-btn:hover { color: var(--red); background: #fbe9ea; }

.empty {
  padding: 50px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 15px;
}

/* ---------- modal ---------- */
.overlay {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,.55);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 50;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.overlay.open { display: flex; }
.modal {
  background: #fff;
  width: 100%;
  max-width: 460px;
  padding: 32px;
  border-top: 5px solid var(--red);
  animation: pop .18s ease;
}
@keyframes pop { from { transform: translateY(-8px); opacity: 0; } }
.modal h3 { margin: 0 0 20px; font-size: 24px; font-weight: 800; }
.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 6px;
}
.field label .req { color: var(--red); }
.field input {
  width: 100%;
  border: 2px solid var(--line);
  padding: 12px 14px;
  font-size: 15px;
  outline: none;
  font-family: inherit;
}
.field input:focus { border-color: var(--ink); }
.modal-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 24px;
}
.hint { font-size: 13px; color: var(--muted); margin: -6px 0 16px; line-height: 1.5; }

/* ---------- toast ---------- */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--ink);
  color: #fff;
  padding: 14px 22px;
  font-size: 14px;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: all .2s ease;
  z-index: 100;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { background: var(--red); }

.spin { display: inline-block; width: 14px; height: 14px; border: 2px solid #fff; border-top-color: transparent; border-radius: 50%; animation: r 0.7s linear infinite; }
@keyframes r { to { transform: rotate(360deg); } }

@media (max-width: 600px) {
  .page-title { font-size: 30px; }
  .brand-sub { display: none; }
  .tag { display: none; }
}
