/*
 * Medipulse report dashboards (Reports menu): partner leaderboard, hospital scorecard, marketing, team.
 * Builds on the tokens and the .mp-compare, .mp-pill, .mp-bar and .mp-num classes in medipulse.css.
 */

.mp-report { display: grid; gap: 24px; }
/* Let wide tables scroll inside their section instead of widening the page. */
.mp-report > *, .mp-report-pair > * { min-width: 0; }

/* Period choice */
.mp-report-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.mp-report-period { display: inline-flex; align-items: center; gap: 8px; font-size: var(--mp-text-md); font-weight: 400; color: var(--mp-ink-muted); }
.mp-report-period .fi-input-wrp { min-width: 240px; }
.mp-report-range { font-size: var(--mp-text-sm); color: var(--mp-ink-muted); font-variant-numeric: tabular-nums; }
.mp-report-loading { font-size: var(--mp-text-sm); color: var(--mp-brand); }

/* Headline figures: the same card as the stat cards on Today (label, figure, what it compares to). */
.mp-report-tiles { display: grid; gap: 24px; grid-template-columns: repeat(auto-fit, minmax(192px, 1fr)); }
.mp-report-tile {
  display: grid; gap: 8px; align-content: start; padding: 24px;
  border: 1px solid var(--mp-line); border-radius: var(--mp-radius-lg);
  background: var(--mp-surface); box-shadow: var(--mp-shadow-card);
}
.mp-report-tile-label { font-size: var(--mp-text-md); font-weight: 400; color: var(--mp-ink-muted); }
.mp-report-tile-value { font-size: 30px; line-height: 36px; font-weight: 700; letter-spacing: -0.01em; color: var(--mp-ink); font-variant-numeric: tabular-nums; }
.mp-report-tile-note { font-size: var(--mp-text-md); color: var(--mp-ink-muted); font-variant-numeric: tabular-nums; }
.mp-report-tile.is-warn .mp-report-tile-note { color: var(--mp-warn); }
.mp-report-tile.is-bad .mp-report-tile-note { color: var(--mp-negative); }

/* Two sections side by side on wide screens */
.mp-report-pair { display: grid; gap: 24px; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); align-items: start; }

/* Tables: numbers right-aligned, a totals row, small second lines */
.mp-report-table th, .mp-report-table td { padding: 12px; }
.mp-report-table thead th { font-size: var(--mp-text-sm); font-weight: 700; color: var(--mp-ink-muted); white-space: nowrap; }
.mp-report-table th.mp-num, .mp-report-table td.mp-num { text-align: right; white-space: nowrap; }
.mp-report-table tbody tr:hover td { background: var(--mp-surface-sunk); }
.mp-report-table tfoot td { font-weight: 700; color: var(--mp-ink); background: var(--mp-surface-sunk); border-bottom: 0; }
.mp-report-table td .mp-cc { margin-left: 8px; vertical-align: 1px; }
.mp-report-table td .mp-pill { margin-left: 8px; }
.mp-report-table td.mp-num .mp-pill { display: flex; width: max-content; margin: 4px 0 0 auto; }
.mp-report-table td.mp-report-name { min-width: 192px; }
.mp-report-sub { display: block; margin-top: 4px; font-size: var(--mp-text-xs); font-weight: 400; color: var(--mp-ink-muted); white-space: nowrap; }
.mp-report-muted-row td { color: var(--mp-ink-muted); }

/* Rank: quiet figures, the leader in brand */
.mp-report-rank {
  display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px;
  border-radius: 50%; background: var(--mp-surface-sunk); color: var(--mp-ink-muted);
  font-size: var(--mp-text-xs); font-weight: 700; font-variant-numeric: tabular-nums;
}
.mp-report-rank.is-top { background: var(--mp-brand-soft); color: var(--mp-brand); }

/* Bars: referrals by area, share of commission with the cap marked */
.mp-report-area-bar { display: block; margin-top: 8px; max-width: 240px; }
.mp-report-share { display: grid; grid-template-columns: minmax(80px, 1fr) auto; align-items: center; gap: 8px; min-width: 152px; }
.mp-report-share .mp-bar > span.is-over { background: var(--mp-negative); }
.mp-report-cap { position: absolute; top: -4px; bottom: -4px; width: 2px; margin-left: -1px; border-radius: 1px; background: var(--mp-line-strong); }

.mp-report-alert {
  padding: 12px 16px; border-radius: var(--mp-radius-md); border: 1px solid #f3c9c9;
  background: #fcebeb; color: #8f1d1d; font-size: var(--mp-text-md); line-height: 1.5;
}
.dark .mp-report-alert { border-color: #5c2020; background: #3b1616; color: #fca5a5; }

.mp-report-note { margin-top: 12px; max-width: 90ch; font-size: var(--mp-text-sm); line-height: 1.5; color: var(--mp-ink-muted); }

.mp-report-sr {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
