/* The printable report. Always light, whatever the app theme, and laid out
   in A4 pages so the preview is what the PDF will be.

   .rpt.formatted   Ink: Archivo, highlighter accents, a masthead
   .rpt.simple      white label: plain type, black and grey, no branding   */

.rpt {
  --r-ink: #0A0A0A; --r-ink-2: #3B3B3E; --r-ink-3: #64646A; --r-rule: rgba(10,10,10,.14); --r-rule-soft: rgba(10,10,10,.07);
  --r-paper: #FFFFFF; --r-sunk: #F4F1E8; --r-accent: #FFE234; --r-pen: #D7261E;
  --series-1: #0A68A6; --series-2: #2A7322; --series-3: #6438C0; --series-4: #A04E00; --series-5: #B0206F; --series-6: #806300;
  --paper-2: #fff; --ink-2: #3B3B3E; --ink-3: #64646A; --ink-4: #A3A3A8; --rule: rgba(10,10,10,.12); --rule-soft: rgba(10,10,10,.07); --hl: #FFE234;
  color: var(--r-ink);
  font-family: 'Archivo', var(--font-sans), system-ui, sans-serif;
  font-size: 9.5pt;
  line-height: 1.4;
  -webkit-print-color-adjust: exact; print-color-adjust: exact;
}
.rpt.simple {
  --r-sunk: #F2F2F2; --r-accent: transparent; --r-pen: #0A0A0A;
  --series-1: #1F1F1F; --series-2: #8C8C8C; --series-3: #555; --series-4: #B5B5B5; --series-5: #333; --series-6: #CCC; --hl: #1F1F1F;
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

.rpt-page {
  width: 210mm; min-height: 297mm; padding: 15mm 16mm 20mm; margin: 0 auto 8mm; background: var(--r-paper);
  box-shadow: 0 2px 14px rgba(0,0,0,.14); position: relative; display: flex; flex-direction: column; box-sizing: border-box;
}
.rpt-page.landscape { width: 297mm; min-height: 210mm; padding: 12mm 13mm 18mm; }
.rpt-page > .rpt-body { flex: 1; }

.rpt-foot { position: absolute; left: 16mm; right: 16mm; bottom: 8mm; display: flex; justify-content: space-between; font-size: 7.5pt; color: var(--r-ink-3); border-top: 1px solid var(--r-rule); padding-top: 2.5mm; }
.rpt-page.landscape .rpt-foot { left: 13mm; right: 13mm; bottom: 7mm; }

/* masthead */
.rpt-mast { display: flex; justify-content: space-between; align-items: flex-end; gap: 8mm; padding-bottom: 5mm; margin-bottom: 7mm; border-bottom: 2px solid var(--r-ink); }
.rpt-mast .org { font-size: 9pt; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--r-ink-2); }
.rpt-mast h1 { font-size: 22pt; line-height: 1.1; margin: 1.5mm 0 0; font-weight: 800; letter-spacing: -.01em; }
.rpt-mast .meta { text-align: right; font-size: 8.5pt; color: var(--r-ink-3); }
.rpt.formatted .rpt-mast h1 span { background: linear-gradient(transparent 55%, var(--r-accent) 55%, var(--r-accent) 92%, transparent 92%); padding: 0 1mm; margin: 0 -1mm; }
.rpt.simple .rpt-mast { border-bottom-width: 1px; }
.rpt.simple .rpt-mast h1 { font-weight: 600; font-size: 20pt; }
.rpt.simple .rpt-mast .org { letter-spacing: 0; text-transform: none; font-weight: 600; }

.rpt h2 { font-size: 12pt; font-weight: 800; margin: 7mm 0 3mm; }
.rpt h2:first-child { margin-top: 0; }
.rpt.formatted h2::before { content: ''; display: inline-block; width: 3mm; height: 3mm; background: var(--r-accent); border: 1px solid var(--r-ink); border-radius: 1px; margin-right: 2mm; vertical-align: 0; }
.rpt.simple h2 { font-weight: 600; }
.rpt p { margin: 0 0 3mm; }
.rpt .lede { font-size: 10.5pt; color: var(--r-ink-2); }

/* KPIs */
.rpt-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; border: 1px solid var(--r-rule); border-radius: 2mm; overflow: hidden; margin-bottom: 6mm; }
.rpt-kpi { padding: 3.5mm 4mm; border-left: 1px solid var(--r-rule); }
.rpt-kpi:first-child { border-left: 0; }
.rpt-kpi .k { font-size: 7.5pt; text-transform: uppercase; letter-spacing: .06em; color: var(--r-ink-3); font-weight: 600; }
.rpt-kpi .v { font-size: 16pt; font-weight: 800; margin-top: 1mm; font-variant-numeric: tabular-nums; }
.rpt-kpi .s { font-size: 7.5pt; color: var(--r-ink-3); }
.rpt.simple .rpt-kpi .k { text-transform: none; letter-spacing: 0; }
.rpt.simple .rpt-kpi .v { font-weight: 600; }

.rpt-insights { margin: 0 0 4mm; padding-left: 5mm; }
.rpt-insights li { margin-bottom: 1.6mm; }

/* tables */
.rpt table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.rpt th, .rpt td { padding: 1.1mm 2mm; border-bottom: 1px solid var(--r-rule-soft); text-align: right; white-space: nowrap; }
.rpt th:first-child, .rpt td:first-child { text-align: left; white-space: normal; }
.rpt thead th { font-size: 7.5pt; color: var(--r-ink-3); font-weight: 700; border-bottom: 1px solid var(--r-ink); text-transform: uppercase; letter-spacing: .04em; }
.rpt.simple thead th { text-transform: none; letter-spacing: 0; font-weight: 600; }
.rpt .section td { font-weight: 800; padding-top: 3.5mm; border-bottom: 0; }
.rpt .total td { font-weight: 700; border-top: 1px solid var(--r-ink-3); }
.rpt .net td { font-weight: 800; border-top: 1.5px solid var(--r-ink); border-bottom: 3px double var(--r-ink); }
.rpt.formatted .net td:first-child span { background: var(--r-accent); padding: 0 1.5mm; margin-left: -1.5mm; }
.rpt .coltot { background: var(--r-sunk); font-weight: 700; }
.rpt .neg { color: var(--r-pen); }
.rpt .zero { color: #B5B5B5; }
.rpt table.monthly { font-size: 7.6pt; }
.rpt table.monthly th, .rpt table.monthly td { padding: 1.1mm 1.4mm; }
.rpt table.statement-r { max-width: 125mm; }

.rpt-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6mm; }
.rpt-chart { break-inside: avoid; }
.rpt-chart h3 { font-size: 9pt; font-weight: 700; margin: 0 0 2mm; }
.rpt-chart .ink-chart text { font-size: 9px; }
.rpt-chart .chart-legend { font-size: 8pt; }
.rpt .notes { white-space: pre-wrap; border-left: 3px solid var(--r-accent); padding: 1mm 0 1mm 4mm; }
.rpt.simple .notes { border-left-color: var(--r-ink-3); }
.rpt .small-print { font-size: 7.5pt; color: var(--r-ink-3); }

/* the screen preview scales pages to fit */
.report-stage .rpt { transform-origin: top center; }

@media print {
  @page { size: A4 portrait; margin: 0; }
  @page landscape { size: A4 landscape; margin: 0; }
  .rpt-page { box-shadow: none; margin: 0; break-after: page; height: 296.8mm; min-height: 0; overflow: hidden; }
  .rpt-page.landscape { page: landscape; height: 209.8mm; }
  .rpt-page:last-child { break-after: auto; }
}

/* groups, health and grants */
.rpt .group td { font-weight: 700; color: var(--r-ink-2); padding-top: 2.2mm; border-bottom: 0; }
.rpt .indent td:first-child { padding-left: 5mm; }
.rpt .subtotal td { font-weight: 700; border-top: 1px solid var(--r-rule); }
.rpt table.health-r td { vertical-align: top; white-space: normal; }
.rpt table.health-r td:nth-child(2), .rpt table.health-r td:nth-child(3) { white-space: nowrap; }
.rpt table.health-r .small-print { font-weight: 400; margin-top: .6mm; }
.rpt .st { white-space: nowrap; display: inline-block; padding: .3mm 2mm; border-radius: 3mm; font-size: 7.5pt; font-weight: 700; }
.rpt.formatted .st.good { background: #86EE78; } .rpt.formatted .st.warn { background: #FFAA4D; } .rpt.formatted .st.bad { background: #D7261E; color: #fff; }
.rpt.simple .st { border: 1px solid var(--r-ink-3); }
.rpt table.grants-r td:first-child { white-space: normal; }
.rpt table.grants-r th:nth-child(2), .rpt table.grants-r td:nth-child(2) { text-align: left; }

/* treasurer's notes */
.rpt ul.rpt-notes, .rpt ul.rpt-agenda { list-style: none; padding: 0; margin: 0 0 2mm; }
.rpt .rpt-notes li, .rpt .rpt-agenda li { display: grid; grid-template-columns: 5mm 1fr; gap: 2mm; padding: 1.4mm 0; border-bottom: 1px solid var(--r-rule-soft); }
.rpt .rpt-notes .mk { font-weight: 800; text-align: center; border-radius: 1mm; line-height: 1.5; }
.rpt.formatted .rpt-notes .good .mk { background: #86EE78; }
.rpt.formatted .rpt-notes .bad .mk { background: #D7261E; color: #fff; }
.rpt.formatted .rpt-notes .neutral .mk { background: var(--r-sunk); }
.rpt.simple .rpt-notes .mk { border: 1px solid var(--r-ink-3); }
.rpt .rpt-notes li.done > span:last-child { color: var(--r-ink-3); }
.rpt .meta { display: block; font-size: 7.5pt; color: var(--r-ink-3); }
.rpt .rpt-agenda .box { width: 3.6mm; height: 3.6mm; border: 1px solid var(--r-ink); border-radius: .6mm; margin-top: .6mm; font-size: 7pt; line-height: 3.4mm; text-align: center; }
