/* =====================================================================
 *  district-reports.css — the main site's "District Association Reports"
 *
 *  Loaded only by /district-reports.  Everything is namespaced .rpt-* so
 *  it can never bleed into the rest of style.css, and it reuses the site's
 *  own tokens (--navy, --gold, --radius …) so the page reads as one site.
 *
 *  The print block at the end is what turns "Print → Save as PDF" into a
 *  clean report sheet: navigation, filter bar and buttons disappear, the
 *  report itself keeps its colours.
 * ===================================================================== */

.rpt-intro {
  max-width: 780px;
  margin: 14px auto 0;
  text-align: center;
  color: rgba(255, 255, 255, 0.86);
  font-size: 15.5px;
}

/* ---------------- toolbar ---------------- */

.rpt-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: end;
  background: #fff;
  border: 1px solid var(--line, #e4e9f1);
  border-radius: var(--radius, 14px);
  box-shadow: var(--card-shadow, 0 10px 30px rgba(20, 40, 80, 0.08));
  padding: 16px 18px;
  margin-bottom: 26px;
}

.rpt-field { display: flex; flex-direction: column; gap: 6px; min-width: 210px; flex: 1 1 210px; }
.rpt-field > span {
  font-size: 12.5px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--navy-soft, #24406f);
}
.rpt-field select,
.rpt-field input {
  width: 100%; padding: 10px 12px; font: inherit; font-size: 15px;
  border: 1.5px solid var(--line, #dce3ee); border-radius: 10px;
  background: #fff; color: var(--navy);
}
.rpt-field select:focus, .rpt-field input:focus {
  outline: none; border-color: var(--gold, #ffc72c);
  box-shadow: 0 0 0 3px rgba(255, 199, 44, 0.25);
}
.rpt-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.rpt-count { font-size: 14px; color: var(--navy-soft, #24406f); padding-bottom: 10px; }
.rpt-count b { color: var(--navy); }

/* ---------------- status chips ---------------- */

.rpt-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 11px; border-radius: 999px;
  font-size: 12.5px; font-weight: 700; letter-spacing: .02em;
  border: 1.5px solid transparent; white-space: nowrap;
}
.rpt-chip--ok { background: #e8f7ec; color: #12693a; border-color: #b7e6c6; }
.rpt-chip--wait { background: #fff6e0; color: #8a5b00; border-color: #f6dfab; }
.rpt-chip--none { background: #f1f4f9; color: #5b6b86; border-color: #dde4ee; }
.rpt-chip--live { background: var(--navy); color: var(--gold); border-color: var(--navy); }

/* ---------------- grid of district cards ---------------- */

.rpt-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.rpt-card {
  display: flex; flex-direction: column; gap: 12px;
  background: #fff; border: 1px solid var(--line, #e4e9f1);
  border-radius: var(--radius, 14px); padding: 20px;
  box-shadow: var(--card-shadow, 0 10px 30px rgba(20, 40, 80, 0.07));
  transition: transform .18s ease, box-shadow .18s ease;
}
.rpt-card:hover { transform: translateY(-3px); box-shadow: 0 16px 34px rgba(20, 40, 80, 0.13); }

.rpt-card__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.rpt-card__head h3 { font-size: 19px; line-height: 1.3; color: var(--navy); margin: 0; }
.rpt-card__title { font-size: 13.5px; color: var(--navy-soft, #24406f); margin-top: 3px; }

.rpt-nums { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.rpt-nums div { background: #f7f9fc; border: 1px solid #eef2f8; border-radius: 10px; padding: 9px 8px; text-align: center; }
.rpt-nums b { display: block; font-family: var(--font-head, inherit); font-size: 21px; color: var(--navy); line-height: 1.1; }
.rpt-nums span { font-size: 11.5px; color: var(--navy-soft, #24406f); }

.rpt-card__meta { font-size: 13px; color: #6b7a94; display: flex; flex-direction: column; gap: 3px; }
.rpt-card__foot { margin-top: auto; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.rpt-empty {
  grid-column: 1 / -1; text-align: center; padding: 44px 20px;
  background: #fff; border: 1.5px dashed var(--line, #dce3ee);
  border-radius: var(--radius, 14px); color: var(--navy-soft, #24406f);
}

/* ---------------- full report card ---------------- */

.rpt-sheet {
  background: #fff; border: 1px solid var(--line, #e4e9f1);
  border-radius: var(--radius, 14px); overflow: hidden;
  box-shadow: var(--card-shadow, 0 10px 30px rgba(20, 40, 80, 0.08));
}

.rpt-sheet__head {
  background: var(--navy); color: #fff; padding: 24px 26px;
  display: flex; justify-content: space-between; align-items: center; gap: 18px; flex-wrap: wrap;
}
.rpt-sheet__head h1 { font-size: 27px; margin: 0 0 4px; line-height: 1.25; }
.rpt-sheet__head p { margin: 0; color: rgba(255, 255, 255, 0.76); font-size: 14.5px; }
.rpt-sheet__badges { display: flex; gap: 8px; flex-wrap: wrap; }

.rpt-sheet__body { padding: 24px 26px 30px; }

.rpt-statgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 26px; }
.rpt-stat {
  background: #f7f9fc; border: 1px solid #eef2f8; border-left: 4px solid var(--gold);
  border-radius: 12px; padding: 14px 16px;
}
.rpt-stat b { display: block; font-family: var(--font-head, inherit); font-size: 27px; color: var(--navy); line-height: 1.15; }
.rpt-stat span { font-size: 12.5px; color: var(--navy-soft, #24406f); font-weight: 600; }

.rpt-block { border-top: 1px solid #eef2f8; padding: 22px 0; }
.rpt-block:first-of-type { border-top: 0; padding-top: 0; }
.rpt-block > h2 {
  font-size: 18px; color: var(--navy); margin: 0 0 4px;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.rpt-block > .rpt-note { font-size: 13.5px; color: #6b7a94; margin: 0 0 14px; }

.rpt-kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; }
.rpt-kv div { background: #fff; border: 1px solid #eef2f8; border-radius: 10px; padding: 12px 14px; }
.rpt-kv dt { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: #6b7a94; font-weight: 700; }
.rpt-kv dd { margin: 4px 0 0; font-size: 16px; color: var(--navy); font-weight: 600; word-break: break-word; }
.rpt-kv dd.is-empty { color: #93a0b6; font-weight: 500; font-style: italic; }

.rpt-table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.rpt-table th, .rpt-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid #eef2f8; vertical-align: top; }
.rpt-table th { background: #f7f9fc; color: var(--navy); font-size: 12.5px; text-transform: uppercase; letter-spacing: .05em; }
.rpt-table tbody tr:last-child td { border-bottom: 0; }
.rpt-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.rpt-table .muted { color: #6b7a94; }

.rpt-legend { font-size: 13px; color: #6b7a94; margin-top: 10px; }

/* A heading over one group INSIDE a section — Workshops, Social Activities
   — so the two read as two things rather than one list with a Type column. */
.rpt-subhead {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--navy);
  margin: 22px 0 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid #e8edf5;
}

.rpt-subhead:first-child { margin-top: 0; }

.rpt-pending {
  background: #fff6e0; border: 1px solid #f6dfab; border-radius: 12px;
  padding: 14px 16px; font-size: 14.5px; color: #7a5200; margin-bottom: 22px;
}
.rpt-pending strong { display: block; margin-bottom: 3px; color: #5f3f00; }

/* ---------------- SVG charts ---------------- */

.rpt-charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.rpt-chart { background: #fff; border: 1px solid #eef2f8; border-radius: 12px; padding: 16px 18px; }
.rpt-chart h3 { font-size: 15.5px; color: var(--navy); margin: 0 0 12px; }
.rpt-chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.rpt-chart .axis { font-size: 11px; fill: #6b7a94; }
.rpt-chart .bar-label { font-size: 11.5px; fill: var(--navy); }
.rpt-chart .bar-value { font-size: 11.5px; font-weight: 700; fill: var(--navy); }
.rpt-legend-row { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-top: 12px; font-size: 12.5px; color: var(--navy-soft); }
.rpt-legend-row i { display: inline-block; width: 11px; height: 11px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

/* ---------------- back link ---------------- */

.rpt-back { margin-bottom: 18px; }
.rpt-back a { color: var(--navy-soft, #24406f); font-weight: 600; font-size: 14.5px; text-decoration: none; }
.rpt-back a:hover { color: var(--gold-dark, #e8b31d); }

/* ---------------- print: this IS the "PDF export" ---------------- */

@media print {
  .topbar, .site-header, .site-footer, .whatsapp-fab,
  .rpt-toolbar, .rpt-back, .rpt-actions, .rpt-print { display: none !important; }

  body { background: #fff !important; }
  main { padding: 0 !important; }

  .page-hero { background: var(--navy) !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }

  .rpt-sheet, .rpt-card { box-shadow: none !important; border-color: #cfd7e5 !important; break-inside: avoid; }
  .rpt-sheet__head { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .rpt-stat, .rpt-kv div, .rpt-table th { -webkit-print-color-adjust: exact; print-color-adjust: exact; }

  .rpt-grid { grid-template-columns: repeat(2, 1fr); }
  .rpt-block { break-inside: avoid; }

  a[href]::after { content: ""; }
}
