/* Monthly reports. Uses the variables and components of style.css. The report itself is report-view.css
   (shared with the portal); here are its colours in the console, the list of organizations, the bar above an
   open report, and what is left out when a report is printed. */

.rp-doc {
  --rp-ink: var(--text); --rp-ink-2: var(--text); --rp-muted: var(--muted); --rp-line: var(--line); --rp-line-strong: var(--line-strong);
  --rp-surface: var(--panel); --rp-soft: var(--panel-2); --rp-accent: var(--accent);
  --rp-good: var(--ok); --rp-look: var(--warn); --rp-bad: var(--bad); --rp-away: var(--off);
}

/* ---- the list */
.rp-filters select { min-width: 200px; }
.rp-tiles { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.rp-row { display: grid; grid-template-columns: minmax(200px, 1.5fr) minmax(170px, 1.1fr) minmax(150px, 1fr) 110px minmax(120px, auto); align-items: center; gap: 16px; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.rp-row:last-child { border-bottom: 0; }
.rp-row:not(.rp-rowhead):hover { background: var(--panel-2); }
.rp-rowhead { padding-top: 10px; padding-bottom: 10px; font-size: 11.5px; font-weight: 650; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.rp-row.quiet .rp-org b { color: var(--muted); font-weight: 550; }
.rp-org { display: flex; align-items: center; gap: 12px; min-width: 0; color: inherit; text-decoration: none; border-radius: 9px; }
.rp-org:hover b { color: var(--accent); }
.rp-orgname { min-width: 0; }
.rp-orgname b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rp-row .sub { display: block; font-size: 12.5px; color: var(--muted); }
.rp-cell { min-width: 0; }
.rp-cell .pill + .sub { margin-top: 3px; }
.rp-row .rp-warn { color: var(--warn); }
.rp-rowactions { display: flex; justify-content: flex-end; align-items: center; gap: 8px; }
.rp-link { border-color: var(--line-strong); background: var(--panel-2); color: var(--text); }
.rp-link:hover { border-color: var(--accent); background: var(--raised); }
.rp-link .icon { color: var(--muted); }
.rp-listfoot { margin-top: 12px; }

/* ---- one report */
.rp-bar { margin-bottom: 16px; }
.rp-bar-top { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding: 12px 16px; }
.rp-bar-top select { max-width: 260px; }
.rp-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.rp-status:empty { display: none; }
.rp-status { border-top: 1px solid var(--line); }
.rp-status .toolnote:last-child { border-bottom: 0; border-radius: 0 0 var(--radius) var(--radius); }
.rp-status .rp-flag { color: var(--warn); }
.rp-status .rp-flag .icon { color: var(--warn); }
.rp-status a, .rp-paper .empty a { color: var(--accent); }
.rp-paper .empty b { color: var(--text); }
.rp-paper .empty span { max-width: 60ch; }

/* ---- dialogs */
#rp-dialog.rp-notedialog, #rp-dialog.rp-settings { width: min(600px, calc(100vw - 32px)); }
#rp-dialog textarea { width: 100%; min-height: 150px; line-height: 1.5; }
#rp-dialog .rp-switch { align-items: flex-start; margin-top: 16px; }
#rp-dialog .rp-switch .track { margin-top: 2px; }
#rp-dialog .rp-switch .grow { flex: 1; min-width: 0; }
#rp-dialog .rp-switch b { display: block; }
#rp-dialog .rp-switch .sub { display: block; font-size: 12.5px; color: var(--muted); }
#rp-dialog .rp-switch.moot { opacity: .55; cursor: default; }
#rp-dialog [role="status"] { margin-top: 16px; min-height: 1.5em; }
#rp-dialog .rp-saved { color: var(--ok); }
#rp-ask p + p { margin-top: 10px; }

@media (max-width: 1100px) {
  .rp-row { grid-template-columns: minmax(180px, 1.4fr) minmax(150px, 1fr) minmax(130px, 1fr) minmax(110px, auto); }
  .rp-row > :nth-child(4) { display: none; }
}
@media (max-width: 760px) {
  .rp-rowhead { display: none; }
  .rp-row { grid-template-columns: 1fr 1fr; gap: 8px 14px; }
  .rp-org, .rp-rowactions { grid-column: 1 / -1; }
  .rp-rowactions { justify-content: flex-start; }
  .rp-actions { justify-content: flex-start; width: 100%; }
}

/* ---- printing a report: only the report, on white, whatever theme the console is in */
@media print {
  html, body { height: auto; }
  body { background: #fff !important; }
  .rail, .pagehead, #agent-banner, .rp-bar, dialog, #rp-listview { display: none !important; }
  .app { display: block !important; }
  .main { padding: 0 !important; }
  .rp-paper .panel { border: 0; }
}
