/* R17 HR & payroll – RP – HR reports & dashboard. Every class of this file starts with "rp-". Owned by that slice only. */

/* layout helpers */
.rp-filters { align-items: flex-end; }
.rp-note { font-size: 12px; color: var(--muted); margin: 8px 0 0; line-height: 1.5; }
.rp-notes { margin: 12px 0 0; padding-inline-start: 18px; font-size: 12px; color: var(--muted); line-height: 1.6; }
.rp-sub { display: block; font-size: 12px; color: var(--muted); font-weight: 400; }
.rp-cur { font-size: 12px; color: var(--muted); margin-inline-start: 4px; font-weight: 400; }
.rp-card-pad { padding: 0 14px 12px; }
.rp-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; margin: 4px 0 8px; }
.rp-toolbar.pad { margin: 0; padding: 10px 14px; border-bottom: 1px solid var(--row-line); }
.rp-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 16px; }
.rp-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 16px; align-items: start; }
.rp-grid-side { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.rp-grid-2 > .card, .rp-grid-3 > .card, .rp-grid-side > .card { margin: 0; }
.rp-kpis-2 { margin-top: 16px; }

/* banners */
.rp-banner { padding: 12px 16px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--blue-bg); color: var(--blue-fg); margin: 12px 0; line-height: 1.5; }
.rp-banner.warn { background: var(--amber-bg); color: var(--amber-fg); }
.rp-banner.bad { background: var(--red-bg); color: var(--red-fg); }

/* KPI cards that link to a list */
a.rp-kpi-link { text-decoration: none; color: inherit; }
a.rp-kpi-link:hover, a.rp-kpi-link:focus-visible, button.rp-kpi-link:hover, button.rp-kpi-link:focus-visible { border-color: var(--primary); }
button.rp-kpi-link { font: inherit; color: inherit; text-align: start; cursor: pointer; width: 100%; }

/* meters and flags */
.rp-meter { display: inline-block; width: 64px; height: 6px; border-radius: 3px; background: var(--gray-bg); vertical-align: middle; margin-inline-end: 6px; overflow: hidden; }
.rp-meter > span { display: block; height: 100%; background: var(--series-1); }
.rp-meter.warn > span { background: var(--amber-fg); }
.rp-meter.bad > span { background: var(--red-fg); }
.rp-flag { display: inline-block; font-size: 11px; padding: 0 6px; border-radius: 999px; background: var(--amber-bg); color: var(--amber-fg); margin-inline-start: 6px; font-weight: 400; }
.rp-swatch { display: inline-block; width: 10px; height: 10px; border-radius: 2px; background: var(--sw); margin-inline-end: 6px; vertical-align: middle; }

/* wide tables (register, months as columns): the first column stays visible while scrolling */
.rp-wide table { min-width: max-content; }
.rp-wide .rp-sticky { position: sticky; inset-inline-start: 0; background: var(--surface); z-index: 1; min-width: 200px; }
.rp-wide thead .rp-sticky, .rp-wide tfoot .rp-sticky { z-index: 2; }
.rp-register th.rp-col-deduction { color: var(--red-fg); }
.rp-register th.rp-col-employercontribution { color: var(--blue-fg); }
.rp-register tfoot th, .rp-wide tfoot th { background: var(--gray-bg); }

/* breakdown tables */
.rp-breakdown table { width: 100%; }
.rp-share-col { white-space: nowrap; }

/* dashboard */
.rp-attention { margin-bottom: 16px; }
.rp-attention h2 { display: inline-flex; align-items: center; gap: 6px; }
.rp-attention .list-row { color: var(--text); }
.rp-attention .list-row:hover { background: var(--gray-bg); }
.rp-attention .list-main { flex: 1; }
.rp-report-links { margin-top: 16px; }
.rp-report-links h2 { margin: 0 0 10px; }
.rp-links { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.rp-link { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text); text-decoration: none; }
.rp-link:hover, .rp-link:focus-visible { border-color: var(--primary); color: var(--primary); }

/* column chart */
.rp-chart-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-bottom: 6px; }
.rp-chart-title { font-weight: 600; }
.rp-svg-wrap { width: 100%; overflow: hidden; }
.rp-svg { width: 100%; display: block; }
.rp-axis { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.rp-grid { stroke: var(--row-line); stroke-width: 1; }
.rp-zero { stroke: var(--border); stroke-width: 1.5; }
.rp-ref { stroke: var(--text); stroke-width: 1.2; stroke-dasharray: 8 4; opacity: .6; }
.rp-bar.rp-s1 { fill: var(--series-1); }
.rp-bar.rp-s2 { fill: var(--series-2); }
.rp-bar.rp-s3 { fill: var(--blue-fg); }
.rp-bar:hover { opacity: .8; }
.rp-legend { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.rp-legend-ref { display: inline-block; width: 22px; border-top: 2px dashed var(--text); opacity: .6; }

/* 9-box */
.rp-ninebox { display: grid; grid-template-columns: 22px repeat(3, minmax(0, 1fr)); grid-template-rows: repeat(3, minmax(64px, auto)) 22px; gap: 4px; padding: 0 14px 12px; }
.rp-nb-y { grid-column: 1; grid-row: 1 / span 3; writing-mode: vertical-rl; transform: rotate(180deg); text-align: center; }
.rp-nb-x { grid-column: 2 / span 3; grid-row: 4; text-align: center; }
.rp-nb-axis { font-size: 11px; color: var(--muted); }
.rp-nb-cell { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border-radius: var(--radius-sm); background: var(--gray-bg); color: var(--text); padding: 6px; text-align: center; }
.rp-nb-cell strong { font-family: var(--mono); font-size: 20px; }
.rp-nb-cell span { font-size: 11px; color: var(--muted); }
.rp-nb-cell.rp-nb-5, .rp-nb-cell.rp-nb-6 { background: var(--green-bg); }
.rp-nb-cell.rp-nb-2 { background: var(--red-bg); }
.rp-nb-cell.rp-nb-3 { background: var(--amber-bg); }

/* phones & tablets */
@media (max-width: 1100px) {
    .rp-grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 800px) {
    .rp-grid-2, .rp-grid-3, .rp-grid-side { grid-template-columns: minmax(0, 1fr); }
    .rp-wide .rp-sticky { min-width: 150px; }
    .rp-meter { width: 40px; }
}

/* print: charts and tables on paper */
@media print {
    .rp-grid-2, .rp-grid-3, .rp-grid-side { display: block; }
    .rp-grid-2 > *, .rp-grid-3 > *, .rp-grid-side > * { margin-bottom: 12px; break-inside: avoid; }
    .rp-wide .rp-sticky { position: static; }
    .rp-report-links, .rp-attention { display: none; }
}

/* total rows inside a paged table body */
tr.rp-total th { background: var(--gray-bg); font-weight: 600; }
