/* ============================================================
   Design tokens
   ============================================================ */
:root {
  --primary: #c8395e;          /* CHS pink / crimson */
  --primary-dark: #a82e4e;
  --blue: #2e5c8c;             /* card titles */
  --gold: #f2c94c;             /* dividers, Next button */
  --gold-dark: #e0b53c;

  --bg: #fffcf6;              /* warm near-white page background */
  --navbar-bg: #f2f2f2;
  --card-bg: #efefef;
  --card-bg-hover: #e9e9e9;

  --text: #3a3a3a;
  --muted: #6b6b6b;
  --border: #e2e2e2;

  --radius: 14px;
  --radius-sm: 8px;
  --maxw: 1160px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

/* ============================================================
   Base
   ============================================================ */
*,
*::before,
*::after { box-sizing: border-box; }

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

h1, h2, h3 {
  font-family: "Poppins", "Mulish", system-ui, sans-serif;
  margin: 0;
}

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

/* ============================================================
   Navbar
   ============================================================ */
.navbar {
  background: var(--navbar-bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}

.navbar__inner {
  max-width: var(--maxw);
  margin-inline: auto;
  padding: 0.5rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.navbar__logo { display: block; height: 34px; width: auto; }

.navbar__nav {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  margin-inline: auto;
}

.navbar__nav a {
  color: #444;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.35rem 0;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: color 0.15s, border-color 0.15s;
}

.navbar__nav a:hover { color: var(--primary); }

.navbar__nav a.is-active {
  color: #222;
  border-bottom-color: var(--gold);
}

.navbar__right {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-inline-start: auto;
}

.lang-switcher { display: flex; gap: 0.35rem; }

.lang-switcher a {
  font-size: 0.78rem;
  font-weight: 700;
  color: #999;
  padding: 0.1rem 0.3rem;
  border-radius: 4px;
}
.lang-switcher a:hover { color: var(--primary); }
.lang-switcher a.is-active { color: #fff; background: var(--primary); }

.navbar__account {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: #6b7785;
  background: #fff;
  border: 1px solid var(--border);
}
.navbar__account:hover { color: var(--primary); }

/* Hamburger (mobile only) */
.navbar__toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  cursor: pointer;
  margin-inline-start: auto;
}
.navbar__toggle span {
  display: block;
  height: 2px;
  width: 22px;
  background: #444;
  border-radius: 2px;
}

/* ============================================================
   Layout
   ============================================================ */
.main {
  max-width: var(--maxw);
  margin-inline: auto;
  padding: 2.5rem 1.25rem 4rem;
}
.main--wide { max-width: min(1600px, 95vw); }

.divider {
  border: none;
  border-top: 2px solid var(--gold);
  margin: 2.5rem auto;
  max-width: var(--maxw);
}

/* ============================================================
   Hero
   ============================================================ */
.hero { text-align: center; }

.hero__title {
  color: var(--primary);
  font-size: clamp(1.6rem, 3.4vw, 2.4rem);
  font-weight: 700;
}

.hero__subtitle {
  color: var(--muted);
  font-family: "Poppins", sans-serif;
  font-weight: 600;
  font-size: 1.25rem;
  margin: 0.25rem 0 0;
}

.hero__intro {
  color: var(--muted);
  max-width: 760px;
  margin: 1.25rem auto 0;
}

/* ============================================================
   Cards
   ============================================================ */
.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 2rem 1.75rem;
  text-align: center;
  transition: background 0.15s, transform 0.15s;
}
.card:hover { background: var(--card-bg-hover); transform: translateY(-2px); }

.card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: var(--radius-sm);
  background: var(--primary);
  color: #fff;
  margin-bottom: 1.25rem;
}
.card__icon svg { width: 30px; height: 30px; }

.card__title {
  color: var(--blue);
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.6rem;
}

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

/* ============================================================
   Buttons & actions
   ============================================================ */
.actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 1.75rem;
  flex-wrap: wrap;
}
.actions--secondary { margin-top: 1rem; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: "Mulish", sans-serif;
  font-size: 0.92rem;
  font-weight: 700;
  padding: 0.6rem 1.1rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.btn__icon { width: 18px; height: 18px; flex: none; }

.btn--primary { background: var(--primary); color: #fff; }
.btn--primary:hover { background: var(--primary-dark); }

.btn--outline {
  background: #f7f7f7;
  color: #555;
  border-color: var(--border);
}
.btn--outline:hover { border-color: var(--primary); color: var(--primary); }

.btn--gold { background: var(--gold); color: #4a3c00; }
.btn--gold:hover { background: var(--gold-dark); }

/* ============================================================
   Feedback
   ============================================================ */
.feedback { max-width: 720px; margin-inline: auto; }

.feedback__head {
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.feedback__icon { color: var(--primary); flex: none; }
.feedback__icon svg { width: 56px; height: 56px; }

.feedback__intro { color: var(--text); margin: 0.25rem 0 0; }

.feedback__label {
  display: block;
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 0.4rem;
}

.feedback__textarea {
  width: 100%;
  font-family: inherit;
  font-size: 0.95rem;
  padding: 0.75rem;
  border: 1px solid #cfcfcf;
  border-radius: var(--radius-sm);
  resize: vertical;
  background: #fff;
}
.feedback__textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(200, 57, 94, 0.12);
}

.feedback__actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 1rem;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 900px) {
  .cards { grid-template-columns: 1fr; max-width: 480px; margin-inline: auto; }

  .navbar__toggle { display: flex; }

  .navbar__nav,
  .navbar__right {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    margin: 0;
  }

  body.nav-open .navbar__inner { flex-wrap: wrap; }
  body.nav-open .navbar__nav,
  body.nav-open .navbar__right {
    display: flex;
    padding-top: 0.75rem;
  }
  body.nav-open .navbar__nav { border-top: 1px solid var(--border); margin-top: 0.5rem; }
  body.nav-open .navbar__right { flex-direction: row; align-items: center; }
}

@media (max-width: 520px) {
  .actions--secondary { flex-direction: column; align-items: stretch; }
  .actions--secondary .btn { justify-content: center; }
  .feedback__head { flex-direction: column; align-items: center; text-align: center; }
}

/* ============================================================
   Incident wizard
   ============================================================ */
.page-head { text-align: center; margin-bottom: 1.5rem; }

.page-title {
  color: #3a3a3a;
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
}

.panel {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2rem 2.25rem;
}

.panel__lead { text-align: center; color: var(--muted); margin: 0 0 2rem; }

/* Incidents summary list */
.summary-actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}
.summary-intro {
  text-align: center;
  color: var(--muted);
  max-width: 950px;
  margin: 0 auto 2rem;
  line-height: 1.7;
}

/* Toolbar: filters (left) + CSV (right) */
.table-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}
.table-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  align-items: flex-end;
  flex: 1;
}
/* Compact controls so the filter bar fits on one line. */
.table-filters .field__input {
  font-size: 0.85rem;
  padding: 0.45rem 0.55rem;
}
.csv-btn { white-space: nowrap; }
.filter { display: flex; flex-direction: column; }
.filter__label { font-size: 0.82rem; color: var(--muted); margin-bottom: 0.35rem; }
.filter__range { display: flex; align-items: center; gap: 0.35rem; }
.filter__range span { font-size: 0.8rem; color: var(--muted); }
.filter__range .field__input { width: 130px; }
#f-search { min-width: 150px; }
#f-country, #f-donor { min-width: 170px; max-width: 200px; }

.table-empty-filtered { color: var(--muted); text-align: center; padding: 1.5rem; margin: 0; }

.table-wrap { overflow-x: auto; }

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}
.data-table th,
.data-table td {
  text-align: start;
  padding: 0.75rem 0.9rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.data-table thead th {
  color: #555;
  font-weight: 700;
  font-size: 0.82rem;
  white-space: nowrap;
  border-bottom: 2px solid var(--border);
}
.data-table tbody tr:hover { background: #fafafa; }
.data-table th.sortable { cursor: pointer; user-select: none; }
.data-table th.sortable:hover { color: var(--primary); }
.data-table th[data-dir="asc"]::after { content: " ▲"; font-size: 0.7em; }
.data-table th[data-dir="desc"]::after { content: " ▼"; font-size: 0.7em; }
.data-table .num { text-align: end; white-space: nowrap; }
.data-table .nowrap { white-space: nowrap; }
.empty-row { text-align: center; color: var(--muted); padding: 2rem; }

.badge {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
}
/* Help — Glossary (searchable field reference) */
.glossary-search { margin-bottom: 1.25rem; }
.glossary-search input {
  width: 100%;
  max-width: 28rem;
  padding: 0.55rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
}
.glossary-item {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin-bottom: 0.9rem;
}
.glossary-stage {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--primary);
  margin-bottom: 0.25rem;
}
.glossary-field { font-size: 1.05rem; font-weight: 700; margin: 0 0 0.4rem; }
.glossary-item p { margin: 0.4rem 0; line-height: 1.55; color: #333; }
.glossary-item h4 {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
  margin: 0 0 0.2rem;
}
.glossary-meta { font-size: 0.92rem; }
.glossary-options { margin-top: 0.8rem; border-top: 1px solid var(--border); padding-top: 0.7rem; }
.glossary-options p strong { color: #1a1a1a; }
.glossary-options ul { margin: 0.3rem 0 0 1.1rem; line-height: 1.5; }
.glossary-options li { margin: 0.15rem 0; }
.glossary-empty { color: var(--muted); font-style: italic; }
@media (max-width: 760px) {
  .glossary-item { grid-template-columns: 1fr; gap: 0.75rem; }
}

/* Profile / organisation settings */
.profile-org { background: var(--card-bg); }
.profile-org__name {
  font-size: 1.4rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--border);
}
.profile-org__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  margin-top: 1.25rem;
}
.profile-section-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 0 0 1rem;
}
.profile-country-add__row { display: flex; gap: 0.6rem; align-items: stretch; max-width: 30rem; }
.profile-select {
  flex: 1;
  padding: 0.5rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  font: inherit;
}
.profile-country-help { color: var(--muted); margin: 0.9rem 0; line-height: 1.5; font-weight: 600; }
.profile-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.profile-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.3rem 0.5rem 0.3rem 0.7rem;
  font-size: 0.92rem;
}
.profile-tag__remove { display: inline-flex; margin: 0; }
.profile-tag__remove button {
  border: none;
  background: none;
  cursor: pointer;
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1;
  padding: 0 0.1rem;
}
.profile-tag__remove button:hover { color: var(--primary); }
.profile-tags__empty { color: var(--muted); font-style: italic; }
.profile-round__title { font-weight: 700; text-decoration: underline; margin: 0 0 0.6rem; }
.profile-round__meta { margin: 0.3rem 0; }
.profile-round__text { margin: 0.9rem 0; line-height: 1.55; font-weight: 600; }
.profile-round__actions { display: flex; flex-direction: column; gap: 0.7rem; align-items: flex-start; margin-top: 1rem; }
.profile-round__btn:disabled { opacity: 0.85; cursor: not-allowed; }

.profile-account { margin-top: 2.5rem; }
.profile-account__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 1rem;
  margin-bottom: 1.5rem;
}
.profile-account__title { font-size: 1.8rem; font-weight: 700; margin: 0; }
.profile-account__actions { display: flex; align-items: center; gap: 1rem; }
.profile-required { color: var(--muted); font-size: 0.9rem; }
.profile-account__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2.5rem; }
.profile-account__field { display: flex; flex-direction: column; gap: 0.3rem; }
.profile-account__field .field-label { margin-top: 0.6rem; }
.profile-account__field .field-label:first-child { margin-top: 0; }
.profile-readonly { margin: 0; color: var(--text); }
.profile-account__field input {
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font: inherit;
}
.profile-error { color: #c0392b; margin: 0 0 1rem; font-weight: 600; }
.req { color: var(--primary); }
.profile-divider { border: none; border-top: 1px solid var(--border); margin: 2rem 0; }
.profile-account__foot {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 1rem;
  border-top: 1px solid var(--border);
  padding-top: 1.25rem;
  margin-top: 1.5rem;
}

/* Site footer */
.site-footer {
  background: var(--card-bg);
  border-top: 1px solid var(--border);
  margin-top: 3rem;
  padding: 1.75rem 1rem;
  text-align: center;
  color: var(--muted);
  line-height: 1.7;
}
.site-footer p { margin: 0.15rem 0; }
.site-footer a { color: var(--primary); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }

/* Incidents list — server-side filter/sort/pagination */
.filter--actions { flex-direction: row; align-items: flex-end; gap: 0.5rem; }
.sortable .sort-link {
  color: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  cursor: pointer;
}
.sortable .sort-link:hover { color: var(--primary); }
.sort-ind { font-size: 0.7rem; color: var(--primary); }
.table-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}
.table-count { color: var(--muted); font-size: 0.9rem; }
.pagination { display: inline-flex; align-items: center; gap: 0.75rem; }
.pagination__btn {
  padding: 0.4rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  text-decoration: none;
  font-size: 0.9rem;
  background: #fff;
}
.pagination__btn:hover { border-color: var(--primary); color: var(--primary); }
.pagination__btn.is-disabled { opacity: 0.45; pointer-events: none; }
.pagination__info { color: var(--muted); font-size: 0.9rem; }

/* Glossary administration */
.glossary-admin-stage + .glossary-admin-stage { margin-top: 1.5rem; }
/* Utility: vertical gap above a stacked panel. */
.panel-spaced, .glossary-options-panel { margin-top: 1.5rem; }
.glossary-admin-table { width: 100%; border-collapse: collapse; }
.glossary-admin-table th, .glossary-admin-table td {
  text-align: start;
  padding: 0.55rem 0.6rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.glossary-admin-table th { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.03em; color: var(--muted); }
.glossary-admin-table td:first-child { font-weight: 600; }
.glossary-admin-table__actions { display: flex; gap: 1rem; align-items: center; white-space: nowrap; }
.glossary-admin-table__actions form { display: inline; margin: 0; }

.glossary-form__row { display: flex; flex-wrap: wrap; gap: 1.5rem; margin-bottom: 1rem; }
.glossary-form .field { display: flex; flex-direction: column; gap: 0.3rem; margin-bottom: 0.9rem; }
.glossary-form .field--check { justify-content: flex-end; }
.glossary-check { display: inline-flex; align-items: center; height: 2.3rem; }
.glossary-form input[type="text"], .glossary-form textarea {
  padding: 0.5rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font: inherit;
  width: 100%;
}
.glossary-form textarea { resize: vertical; }
.glossary-form__lang {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.6rem 1rem 0.2rem;
  margin: 0 0 1rem;
}
.glossary-form__lang legend {
  font-weight: 700;
  font-size: 0.8rem;
  color: var(--primary);
  padding: 0 0.4rem;
}
.glossary-form__foot { display: flex; justify-content: flex-end; gap: 1rem; margin-top: 0.5rem; }
.glossary-form__subtitle { margin: 1.5rem 0 0.75rem; font-size: 1.05rem; }
.glossary-opt-list { list-style: none; margin: 0 0 1rem; padding: 0; }
.glossary-opt-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--border);
}
.glossary-opt-list li form { margin: 0; }
.glossary-opt-list__name { font-weight: 600; }
.summary-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-bottom: 1.25rem; }
@media (max-width: 760px) {
  .profile-org__grid, .profile-account__grid { grid-template-columns: 1fr; gap: 1.5rem; }
}

/* Help (long-form prose content) */
.prose { max-width: 70ch; line-height: 1.65; color: #333; }
.prose h2 {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 1.75rem 0 0.6rem;
  color: #1a1a1a;
}
.prose h2:first-child { margin-top: 0.25rem; }
.prose h3 {
  font-size: 1.02rem;
  font-weight: 700;
  margin: 1.5rem 0 0.3rem;
  color: #1a1a1a;
}
.prose h3:first-child { margin-top: 0.25rem; }
.prose p { margin: 0.6rem 0; }
.prose ul, .prose ol { margin: 0.6rem 0 0.6rem 1.5rem; }
.prose li { margin: 0.35rem 0; }
.prose a { color: var(--primary); text-decoration: underline; }
.prose a:hover { text-decoration: none; }
.prose hr { border: none; border-top: 1px solid var(--border); margin: 1.75rem 0; }

/* SEAH Trends */
.trends-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.75rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.5rem;
}
.trends-tab {
  padding: 0.6rem 0.1rem;
  font-weight: 600;
  color: #555;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.trends-tab:hover { color: var(--primary); }
.trends-tab.is-active { color: var(--primary); border-bottom-color: var(--primary); }

.trends-subtabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  margin: -0.75rem 0 1.5rem;
}
.trends-subtab {
  padding: 0.5rem 0.1rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: #666;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.trends-subtab:hover { color: var(--primary); }
.trends-subtab.is-active { color: var(--primary); border-bottom-color: var(--primary); }

.trends-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}
.trends-grid + .trends-grid { margin-top: 1.75rem; }
.trends-grid.trends-grid--3 {
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 1.75rem;
}
.trends-donut { width: 100%; height: 230px; }
@media (max-width: 700px) {
  .trends-grid.trends-grid--3 { grid-template-columns: 1fr; }
}
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
.panel-title { font-size: 1.05rem; font-weight: 700; margin: 0; }
.panel-sub { color: var(--muted); font-size: 0.9rem; margin: 0.25rem 0 0; }
.btn--sm { padding: 0.35rem 0.7rem; font-size: 0.82rem; }

.trends-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  align-items: flex-end;
  margin: 1rem 0;
}
.trends-control { display: flex; flex-direction: column; gap: 0.35rem; }
.trends-map { width: 100%; height: 360px; }
.trends-chart { width: 100%; height: 380px; }
.trends-chart--tall { height: 540px; }
.trends-filters { margin: 1.75rem 0; }
#trends-evo .panel + .panel { margin-top: 1.75rem; }
.trends-note { color: var(--muted); font-size: 0.8rem; font-style: italic; margin: 0.5rem 0 0; }

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

/* Incident detail (read-only) */
.detail-top { margin-bottom: 1rem; }
.detail-step { padding: 1.5rem 0; border-bottom: 1px solid var(--border); }
.detail-step:last-child { border-bottom: none; padding-bottom: 0; }
.detail-step__title {
  font-family: "Poppins", sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--blue);
  margin: 0 0 1rem;
}
.detail-list {
  display: grid;
  grid-template-columns: minmax(180px, 280px) 1fr;
  gap: 0.5rem 1.5rem;
  margin: 0;
}
.detail-list dt { font-weight: 600; color: #555; }
.detail-list dd { margin: 0; color: var(--text); }
.detail-empty { color: var(--muted); font-style: italic; margin: 0; }
.detail-section { margin-top: 1.5rem; }
.detail-step .entry-card { margin-bottom: 1rem; }
@media (max-width: 600px) {
  .detail-list { grid-template-columns: 1fr; gap: 0.1rem 0; }
  .detail-list dd { margin-bottom: 0.6rem; }
}

.badge--draft { background: #f0ead6; color: #8a6d1b; }
.badge--submitted { background: #e3f1e6; color: #2e7d4f; }
.warn { color: #d32f2f; font-weight: 700; margin-inline-end: 0.2rem; }

/* Admin: organisations & focal points */
.alert {
  max-width: var(--maxw);
  margin: 0 auto 1.5rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
}
.alert--error { background: #fdecea; color: #c0392b; border: 1px solid #f5c6cb; }
.alert--info { background: #eef5fb; color: #2e5c8c; border: 1px solid #cfe0f0; word-break: break-all; }
.invite-link { color: var(--primary); font-weight: 600; }
.fp-actions { display: flex; gap: 0.75rem; align-items: center; }

/* Auth pages (login, MFA, set password) */
.auth-card {
  max-width: 420px;
  margin: 1rem auto;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2rem;
  text-align: center;
}
.auth-card--wide { max-width: 480px; }
.auth-card__title {
  color: var(--primary);
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 1rem;
}
.auth-card__text { color: var(--muted); margin: 0 0 1rem; line-height: 1.6; text-align: start; }
.auth-card__text--small { font-size: 0.85rem; }
.auth-form { text-align: start; }
.auth-form .field__label { display: block; margin: 0.75rem 0 0.35rem; }
.auth-form__submit { width: 100%; justify-content: center; margin-top: 1.25rem; }
.auth-code {
  text-align: center;
  letter-spacing: 0.4em;
  font-size: 1.3rem;
  font-weight: 700;
}
.mfa-qr { display: flex; justify-content: center; margin: 1rem 0; }
.mfa-qr img { border: 1px solid var(--border); border-radius: var(--radius-sm); }
.mfa-secret {
  display: inline-block;
  background: #f3f3f3;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-size: 0.85rem;
  word-break: break-all;
}

/* Navbar auth state */
.navbar__user { display: inline-flex; align-items: center; gap: 0.5rem; color: #555; }
.navbar__profile {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: inherit;
  text-decoration: none;
}
.navbar__profile:hover, .navbar__profile.is-active { color: var(--primary); }
.navbar__username { font-weight: 600; font-size: 0.9rem; }
.navbar__logout, .navbar__login {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--primary);
}
.navbar__logout:hover, .navbar__login:hover { text-decoration: underline; }

/* Submission confirmation */

.admin-section-title {
  font-family: "Poppins", sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--blue);
  margin: 0 0 1rem;
}
.admin-inline-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
}
.admin-inline-form .field__input { flex: 1; min-width: 180px; }
.admin-inline-form--fp { margin-top: 1rem; }

.org-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1.1rem 1.25rem;
  margin-bottom: 1rem;
}
.org-card__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.org-card__name { font-size: 1.1rem; font-weight: 700; margin: 0; }
.org-card__sub {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
  margin: 1rem 0 0.5rem;
}
.fp-list { list-style: none; margin: 0 0 0.75rem; padding: 0; }
.fp-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.4rem 0;
  border-bottom: 1px solid #f0f0f0;
}
.fp-email { color: var(--muted); font-size: 0.9rem; }
.btn-link--danger { color: #c0392b; }

/* Submission confirmation */
.done-bar {
  height: 10px;
  background: var(--gold);
  border-radius: 999px;
  margin-bottom: 1.5rem;
}
.done-text { color: var(--text); margin: 0 0 0.6rem; line-height: 1.6; }
.link { color: var(--primary); text-decoration: underline; }
.link:hover { color: var(--primary-dark); }

.panel__divider { border: none; border-top: 1px solid var(--border); margin: 1.75rem 0; }

.panel__actions { display: flex; justify-content: space-between; gap: 1rem; }
.panel__actions--end { justify-content: flex-end; }

/* Intro: the four stages */
.stage-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  text-align: center;
}
.stage-grid__num {
  font-size: 1.15rem;
  font-weight: 700;
  color: #3a3a3a;
  margin-bottom: 0.35rem;
}
.stage-grid__label { color: var(--muted); margin: 0; font-size: 0.95rem; }

/* Stage header + progress bar */
.stage-head { margin-bottom: 1rem; }
.stage-head__title {
  font-family: "Poppins", sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}
.progress {
  height: 8px;
  background: #ececec;
  border-radius: 999px;
  overflow: hidden;
}
.progress__bar {
  height: 100%;
  background: var(--gold);
  border-radius: 999px;
  transition: width 0.3s ease;
}

.stage-hint { color: var(--muted); font-size: 0.9rem; margin: 0 0 1.75rem; }

/* Section sub-group within a step (e.g. "Optional: donor tracking") */
.section { margin-top: 2.25rem; }
.section__heading {
  font-family: "Poppins", sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: #3a3a3a;
  margin: 0 0 0.5rem;
}
.section__text {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0 0 1.5rem;
  max-width: 75ch;
}

/* Field grid (6 columns, widths from question.config) */
.field-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 1.4rem 1.5rem;
  /* Backfill the gap left when a full-width conditional field appears
     next to a half-width one. */
  grid-auto-flow: dense;
}
.field--third { grid-column: span 2; }
.field--half { grid-column: span 3; }
.field--full { grid-column: span 6; }

.field { display: flex; flex-direction: column; }
.field[hidden] { display: none; }  /* conditional fields hidden by JS */

.field__label {
  font-size: 0.92rem;
  color: #444;
  font-weight: 600;
  margin-bottom: 0.45rem;
}
.field__req { color: var(--primary); margin-inline-end: 0.15rem; }

.field__info {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  margin-inline-start: 0.35rem;
  border-radius: 50%;
  background: #b9bfc7;
  color: #fff;
  font-size: 0.7rem;
  font-style: italic;
  font-weight: 700;
  cursor: help;
  vertical-align: middle;
}

.field__input {
  font-family: inherit;
  font-size: 0.95rem;
  padding: 0.6rem 0.7rem;
  border: 1px solid #cfcfcf;
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text);
  width: 100%;
}
.field__input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(200, 57, 94, 0.12);
}

/* Checkbox groups (replacing the dual-listbox multi-selects) */
.checkbox-group {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.5rem 1.25rem;
  padding: 1rem 1.1rem;
  border: 1px solid #e0e0e0;
  border-radius: var(--radius-sm);
  background: #fafafa;
}
.checkbox {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.4rem 0.5rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.12s;
}
.checkbox:hover { background: #f0f0f0; }
.checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  flex: none;
  cursor: pointer;
}
.checkbox__label { font-size: 0.95rem; color: var(--text); }
.checkbox__other {
  margin-inline-start: 0.5rem;
  font-family: inherit;
  font-size: 0.9rem;
  padding: 0.3rem 0.5rem;
  border: 1px solid #cfcfcf;
  border-radius: 6px;
}

/* Stage subtitle (from the step's help text) */
.stage-subtitle {
  font-weight: 700;
  text-decoration: underline;
  color: #3a3a3a;
  margin: 0.25rem 0 1rem;
}

/* Yes/No segmented toggle (select_one with config.widget = "toggle") */
.toggle {
  display: inline-flex;
  border: 1px solid var(--gold);
  border-radius: var(--radius-sm);
  overflow: hidden;
  width: max-content;
}
.toggle__opt input { position: absolute; opacity: 0; pointer-events: none; }
.toggle__opt span {
  display: block;
  padding: 0.5rem 1.4rem;
  font-weight: 700;
  color: #b9933a;
  background: #fff;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
.toggle__opt input:checked + span { background: var(--gold); color: #4a3c00; }
.toggle__opt input:focus-visible + span { box-shadow: inset 0 0 0 2px var(--gold-dark); }

/* Boolean single checkbox + visible caption */
.field--boolean .checkbox--single {
  display: inline-flex;
  padding: 0;
  margin-top: 0.2rem;
}
.field--boolean .checkbox--single input[type="checkbox"] {
  width: 22px;
  height: 22px;
  accent-color: var(--primary);
  cursor: pointer;
}
.field__caption { color: var(--muted); font-size: 0.85rem; margin: 0.5rem 0 0; }

/* Required-field validation error */
.field--error .field__input,
.field--error .checkbox-group,
.field--error .toggle {
  border-color: #d32f2f;
}
.field--error .field__input:focus {
  box-shadow: 0 0 0 3px rgba(211, 47, 47, 0.15);
}
.field--error .field__label { color: #d32f2f; }
.field__error {
  color: #d32f2f;
  font-size: 0.85rem;
  font-weight: 600;
  margin: 0.35rem 0 0;
}

/* Repeatable entries (e.g. survivors / victims) */
.entries { margin-bottom: 1.5rem; }
.entries__heading,
.add-entry__heading {
  font-family: "Poppins", sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: #3a3a3a;
  margin: 0 0 0.75rem;
}
.entries__empty { color: var(--muted); margin: 0 0 1.5rem; }
.entry-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fafafa;
  padding: 0.9rem 1.1rem;
  margin-bottom: 0.75rem;
}
.entry-card__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.4rem;
}
.entry-card__list {
  margin: 0;
  padding-inline-start: 1.1rem;
  color: var(--muted);
  font-size: 0.9rem;
}
.entry-card__list li { margin: 0.1rem 0; }
.entry-card__label { color: #555; font-weight: 600; }
.add-entry__heading { margin-top: 0.5rem; }
.add-entry__action { display: flex; justify-content: flex-start; margin-top: 1.25rem; }

.btn-link {
  background: none;
  border: none;
  color: var(--primary);
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  padding: 0.2rem 0.3rem;
}
.btn-link:hover { text-decoration: underline; }

@media (max-width: 760px) {
  .panel { padding: 1.5rem 1.25rem; }
  .stage-grid { grid-template-columns: repeat(2, 1fr); gap: 1.25rem; }
  .field--third,
  .field--half,
  .field--full { grid-column: span 6; }
}
