:root {
  --bg: #f5f6f8;
  --card: #ffffff;
  --text: #1f2430;
  --muted: #667085;
  --border: #e2e5ea;
  --accent: #2563eb;
  --accent-dark: #1d4ed8;
  --good: #16a34a;
  --bad: #dc2626;
  --warn: #d97706;
}

* { box-sizing: border-box; }

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

header.site {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 20px;
}

a.brand {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}

header.site nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
}

header.site nav a {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.95rem;
}

/* Staff top bar: a visibly different "mode" from the public site, with an
   account indicator and real tab navigation instead of plain text links. */
.staff-topbar {
  background: #1e293b;
  border-bottom: none;
  padding: 0;
  display: block;
}
.staff-topbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 20px;
}
.staff-topbar .brand { color: #fff; }
.staff-tabs { display: flex; flex-wrap: wrap; gap: 2px; }
.staff-tabs a {
  color: #cbd5e1;
  text-decoration: none;
  font-size: 0.88rem;
  padding: 7px 14px;
  border-radius: 6px;
}
.staff-tabs a:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
.staff-tabs a.active { background: rgba(255, 255, 255, 0.16); color: #fff; font-weight: 600; }

.staff-account {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  color: #cbd5e1;
  white-space: nowrap;
}
.staff-role-badge {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.staff-logout {
  color: #cbd5e1;
  text-decoration: none;
  padding: 5px 10px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 6px;
  font-size: 0.82rem;
}
.staff-logout:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }

@media (max-width: 640px) {
  .staff-topbar-inner { flex-direction: column; align-items: flex-start; }
  .staff-tabs { width: 100%; }
  .staff-account { width: 100%; justify-content: space-between; }
}

main {
  max-width: 760px;
  margin: 0 auto;
  padding: 32px 20px 64px;
}
main.wide { max-width: 1200px; }
.narrow { max-width: 640px; margin: 0 auto; }

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

h1 { font-size: 1.75rem; margin-top: 0; letter-spacing: -0.01em; }
h2 { font-size: 1.2rem; }

.lead { color: var(--muted); font-size: 1.02rem; }

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

.btn {
  display: inline-block;
  padding: 10px 18px;
  border-radius: 8px;
  border: none;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  font-size: 0.95rem;
  cursor: pointer;
}
.btn:hover { background: var(--accent-dark); }
.btn.secondary { background: #fff; color: var(--accent); border: 1px solid var(--accent); }
.btn.small { padding: 6px 12px; font-size: 0.85rem; }
.btn.danger { background: var(--bad); }
.btn.outline-danger { background: #fff; color: var(--bad); border: 1px solid #fca5a5; }
.btn.outline-danger:hover { background: #fef2f2; }
.btn:disabled { background: #ccc; cursor: not-allowed; }

label { display: block; margin: 14px 0 6px; font-weight: 600; font-size: 0.9rem; }
input[type=text], input[type=email], input[type=password], input[type=number], select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 1rem;
  background: #fff;
}

.error { color: var(--bad); margin-top: 12px; }

.status-list { list-style: none; padding: 0; margin: 20px 0; }
.status-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.status-list li:last-child { border-bottom: none; }

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
}
.badge.ok { background: #dcfce7; color: var(--good); }
.badge.pending { background: #fef3c7; color: var(--warn); }
.badge.no { background: #fee2e2; color: var(--bad); }

table { width: 100%; border-collapse: collapse; margin-top: 16px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--border); font-size: 0.92rem; vertical-align: middle; }
th { color: var(--muted); font-weight: 600; font-size: 0.82rem; text-transform: uppercase; }

.quiz-question { margin-bottom: 22px; }
.quiz-question p.q-text { font-weight: 600; margin-bottom: 8px; }
.quiz-question label.option {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 400;
  margin: 4px 0;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
}
.quiz-question input[type=radio] { width: auto; }

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 16px 0;
  font-weight: 400;
}
.checkbox-row input[type=checkbox] { width: auto; }

.section { margin-bottom: 26px; }
.section + .section { border-top: 1px solid var(--border); padding-top: 22px; }
.section h2 { border-bottom: 2px solid var(--accent); display: inline-block; padding-bottom: 2px; margin-top: 0; }

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

form.inline { display: inline; }

.toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.toolbar input[type=search] {
  flex: 1 1 260px;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.95rem;
}
.toolbar select {
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.95rem;
  background: #fff;
}

.flash {
  background: #fef3c7;
  border-color: #fcd34d;
  color: #92400e;
  padding: 14px 20px;
}

.notice {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 0.88rem;
  color: #1e3a5f;
  margin: 18px 0;
}
.notice a { color: inherit; font-weight: 600; }

.footnote {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 0.88rem;
}

.inline-form {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}
.inline-form .field { display: flex; flex-direction: column; gap: 4px; }
.inline-form .field label { margin: 0; font-size: 0.78rem; color: var(--muted); font-weight: 600; }
.inline-form .field input, .inline-form .field select {
  padding: 8px 10px;
  font-size: 0.92rem;
  width: auto;
}

/* Multi-page info viewer */
.info-progress {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.info-progress span { color: var(--muted); font-size: 0.85rem; white-space: nowrap; }
.info-dots { display: flex; flex-wrap: wrap; gap: 6px; }
.info-dot {
  width: 9px;
  height: 9px;
  padding: 0;
  border-radius: 999px;
  border: none;
  background: var(--border);
  cursor: pointer;
}
.info-dot.active { background: var(--accent); }

.info-page { display: none; }
.info-page.active { display: block; animation: info-fade 0.2s ease; }
@keyframes info-fade {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.info-page h2 { margin-top: 0; }

.info-images {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin: 16px 0;
}
.info-images-2, .info-images-4 { grid-template-columns: 1fr 1fr; }
.info-images img {
  width: 100%;
  max-height: 380px;
  object-fit: contain;
  background: #f0f1f3;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.info-nav {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

@media (max-width: 520px) {
  .info-images-2, .info-images-4 { grid-template-columns: 1fr; }
}
