/*
 * Report pages (fe-reports): dashboard, daily board, day drawer, timesheet, monthly matrix, corrections, leave,
 * holidays, events and the print pages. Tokens only: no raw colour literals (docs/ARCHITECTURE.md §11.7).
 */

/* ---------- shared page furniture ---------- */
.report-page { min-width: 0; }
.report-filters-row { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; }
.report-filters .filter-bar { flex: 1 1 auto; }
.filter-item { display: inline-flex; min-width: 0; }
.updated { font-size: var(--text-sm); white-space: nowrap; }
.report-page .region.is-stale, .rp-emp .region.is-stale { opacity: 0.6; transition: opacity var(--motion-base); }
.report-page .region-content[hidden], .report-page .region-status:empty, .rp-emp .region-content[hidden], .rp-emp .region-status:empty { display: none; }
.coverage-host:empty { display: none; }
.tone-label { display: inline-flex; align-items: center; gap: var(--space-2); min-width: 0; }
.count { color: var(--color-text-muted); font-weight: var(--weight-normal); font-variant-numeric: tabular-nums; }

/* ---------- daily board ---------- */
.stat-chips { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.stat-chip {
  display: inline-flex; align-items: baseline; gap: var(--space-2); padding: 7px 14px 7px 12px; min-height: var(--touch-target);
  background: var(--color-surface); border: 1px solid var(--color-border); border-left: 4px solid var(--tone); border-radius: var(--radius-md);
  font: inherit; color: var(--color-text); cursor: pointer;
  transition: background var(--motion-fast), border-color var(--motion-fast), box-shadow var(--motion-fast);
}
.stat-chip:hover { background: var(--tone-bg); }
.stat-chip:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.stat-chip.is-on { background: var(--tone-bg); border-color: var(--tone); box-shadow: inset 0 0 0 1px var(--tone); }
.stat-chip-count { font-size: var(--text-xl); font-weight: var(--weight-semibold); line-height: 1; }
.stat-chip-label { font-size: var(--text-md); font-weight: var(--weight-medium); }
.stat-chip-note { font-size: var(--text-xs); color: var(--tone-ink); font-weight: var(--weight-medium); }
.day-meta { min-height: 28px; }
.day-card { overflow: hidden; }
.day-employee { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-width: 0; }
.day-notenrolled { display: inline-flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
.day-out { display: inline-flex; flex-direction: column; align-items: flex-end; line-height: 1.2; }
.day-out-hint { font-size: var(--text-xs); color: var(--color-text-muted); }
.day-min { color: var(--tone-ink); font-weight: var(--weight-medium); }
.day-cams { white-space: nowrap; }
@media (max-width: 767px) { .table-cards .day-cams { white-space: normal; max-width: none; text-align: right; } }
@media (max-width: 767px) {
  .day-out { align-items: flex-end; }
  .stat-chip { padding: 6px 10px; }
}

/* ---------- day drawer ---------- */
.day-drawer { display: flex; flex-direction: column; gap: var(--space-5); min-width: 0; }
.day-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap; }
.day-head-status { display: flex; align-items: center; gap: var(--space-3); }
.day-shift { margin: 0; font-size: var(--text-sm); }
.day-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-2); }
.day-tile { padding: var(--space-3); background: var(--color-surface-2); border: 1px solid var(--color-border); border-radius: var(--radius-md); min-width: 0; }
.day-tile.tone-late, .day-tile.tone-early_leave, .day-tile.tone-primary { background: var(--tone-bg); border-color: transparent; }
.day-tile-label { font-size: var(--text-xs); color: var(--color-text-muted); font-weight: var(--weight-medium); }
.day-tile-value { font-size: var(--text-xl); font-weight: var(--weight-semibold); font-variant-numeric: tabular-nums; line-height: 1.3; }
.day-tile.tone-late .day-tile-value, .day-tile.tone-early_leave .day-tile-value, .day-tile.tone-primary .day-tile-value { color: var(--tone-ink); }
.day-tile-sub { font-size: var(--text-xs); color: var(--color-text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.day-section { display: flex; flex-direction: column; gap: var(--space-2); min-width: 0; }
.day-section-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
.day-h { margin: 0; font-size: var(--text-md); font-weight: var(--weight-semibold); }
.day-why { margin: 0; padding: var(--space-3) var(--space-4); background: var(--color-primary-bg); color: var(--color-primary-ink); border-radius: var(--radius-md); font-size: var(--text-md); }
.day-hint { margin: 0; font-size: var(--text-sm); }
.day-timeline { padding: var(--space-3) var(--space-2) var(--space-2); border: 1px solid var(--color-border); border-radius: var(--radius-md); background: var(--chart-surface); }
.day-evidence-table th, .day-evidence-table td { font-size: var(--text-sm); }
.day-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-1); }
.day-list li { display: flex; gap: var(--space-3); align-items: baseline; font-size: var(--text-sm); }
.day-list-text { color: var(--color-text-muted); }
.day-corrections { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-3); }
.day-correction { padding: var(--space-3) var(--space-4); border: 1px solid var(--color-border); border-radius: var(--radius-md); background: var(--color-surface); }
.day-correction.is-revoked { background: var(--color-surface-2); color: var(--color-text-muted); }
.day-correction.is-revoked strong { text-decoration: line-through; }
.day-correction-main { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
.day-correction-reason { margin: var(--space-1) 0; }
.day-correction-meta { margin: 0 0 var(--space-1); font-size: var(--text-xs); }
.day-correct { padding: var(--space-4); border: 1px solid var(--color-border-strong); border-radius: var(--radius-md); background: var(--color-surface-2); }
.day-actions { display: flex; gap: var(--space-2); flex-wrap: wrap; padding-top: var(--space-3); border-top: 1px solid var(--color-border); }
.cf-time { display: flex; flex-direction: column; gap: var(--space-1); }
.cf-time-row { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; }
.cf-time-row .input { width: auto; min-width: 130px; }
.cf-preview { font-size: var(--text-sm); color: var(--color-text-muted); }
.cf-preview.is-error { color: var(--color-danger-ink); }
.cf-statuses { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--space-2); border: 0; padding: 0; margin: 0; }

.day-head-who { min-width: 0; font-size: var(--text-md); }
.day-card .table th, .day-card .table td { padding-left: 8px; padding-right: 8px; }
.day-card .table td { font-size: var(--text-sm); }
.day-card .time.is-empty { color: var(--color-text-subtle); font-weight: var(--weight-normal); }
.day-cams { display: inline-block; max-width: 170px; overflow: hidden; text-overflow: ellipsis; vertical-align: bottom; }

/* ---------- dashboard ---------- */
.rp-kpis { --rp-kpi-cols: 6; display: grid; grid-template-columns: repeat(var(--rp-kpi-cols), minmax(0, 1fr)); gap: var(--space-3); }
@media (max-width: 1099px) { .rp-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.rp-kpi-unit { font-size: var(--text-xl); margin-left: 2px; color: var(--color-text-muted); }
.rp-row { display: grid; gap: var(--space-4); align-items: start; }
.rp-row-charts { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
.rp-row-lists { grid-template-columns: minmax(0, 4fr) minmax(0, 4fr) minmax(0, 4fr); }
.rp-small { font-size: var(--text-sm); margin: 0; }
.rp-rank, .rp-feed, .rp-strip, .rp-seglegend, .rp-setup-list { list-style: none; margin: 0; padding: 0; }
.rp-rank { display: flex; flex-direction: column; gap: var(--space-1); }
.rp-rank-item { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: var(--space-3); align-items: center; padding: 6px 0; border-bottom: 1px solid var(--color-border); }
.rp-rank-item:last-child { border-bottom: 0; }
.rp-rank-n { color: var(--color-text-subtle); font-weight: var(--weight-semibold); text-align: center; }
.rp-rank-val { display: flex; flex-direction: column; align-items: flex-end; font-size: var(--text-sm); line-height: 1.3; }
.rp-feed { display: flex; flex-direction: column; max-height: 360px; overflow-y: auto; }
.rp-feed-item { flex: none; display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: 6px 0; border-bottom: 1px solid var(--color-border); }
.rp-feed-item:last-child { border-bottom: 0; }
.rp-feed-meta { display: inline-flex; align-items: center; gap: var(--space-2); font-size: var(--text-xs); color: var(--color-text-muted); white-space: nowrap; }
.rp-strip { display: flex; flex-direction: column; gap: var(--space-3); }
.rp-strip li { display: flex; align-items: center; gap: var(--space-3); font-size: var(--text-md); }
.rp-review { display: flex; align-items: center; gap: var(--space-4); }
.rp-review-n { font-size: var(--text-3xl); font-weight: var(--weight-semibold); line-height: 1; }
.rp-review-text { display: flex; flex-direction: column; font-size: var(--text-sm); }
.rp-segbar { display: flex; gap: 2px; height: 12px; border-radius: var(--radius-pill); overflow: hidden; background: var(--color-surface-3); }
.rp-seg { background: var(--tone); min-width: 6px; }
.rp-seglegend { display: flex; flex-direction: column; gap: var(--space-1); font-size: var(--text-sm); }
.rp-seglegend li { display: grid; grid-template-columns: 10px 1fr auto; gap: var(--space-2); align-items: center; }
.rp-setup { border-left: 4px solid var(--color-primary); }
.rp-setup-list { display: flex; flex-direction: column; }
.rp-setup-step { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; gap: var(--space-3); align-items: center; padding: var(--space-2) 0; border-bottom: 1px solid var(--color-border); }
.rp-setup-step:last-child { border-bottom: 0; }
.rp-setup-mark { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--color-border-strong); display: inline-flex; align-items: center; justify-content: center; }
.rp-setup-step.is-done .rp-setup-mark { background: var(--color-success); border-color: var(--color-success); color: var(--color-primary-contrast); }
.rp-setup-text { display: flex; flex-direction: column; font-size: var(--text-sm); }
.rp-setup-text strong { font-size: var(--text-md); }
.rp-setup-step.is-done .rp-setup-text strong { color: var(--color-text-muted); }

@media (max-width: 1199px) {
  .rp-row-charts, .rp-row-lists { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 599px) {
  .rp-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-2); }
  .rp-kpis .kpi { padding: var(--space-3); }
  .rp-kpis .kpi-value { font-size: var(--text-2xl); }
}

/* ---------- monthly matrix ---------- */
.rp-summary-body { display: flex; align-items: center; gap: var(--space-6); flex-wrap: wrap; }
.rp-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: var(--space-3) var(--space-5); margin: 0; flex: 1 1 280px; }
.rp-facts div { display: flex; flex-direction: column; gap: 2px; }
.rp-facts dt { font-size: var(--text-xs); color: var(--color-text-muted); font-weight: var(--weight-medium); }
.rp-facts dd { margin: 0; font-size: var(--text-lg); font-weight: var(--weight-semibold); }
.rp-matrix-card { overflow: hidden; }
.rp-matrix-scroll { max-height: 75vh; }
.rp-matrix { border-collapse: separate; border-spacing: 0; font-size: var(--text-sm); width: max-content; min-width: 100%; }
.rp-matrix th, .rp-matrix td { padding: 3px 1px; border-bottom: 1px solid var(--color-border); background: var(--color-surface); text-align: center; }
.rp-matrix thead th { position: sticky; top: 0; z-index: 3; background: var(--color-surface-2); padding: 6px 1px; font-weight: var(--weight-semibold); }
.rp-matrix .rp-m-name { position: sticky; left: 0; z-index: 2; text-align: left; min-width: 210px; max-width: 210px; padding: 5px var(--space-3); border-right: 1px solid var(--color-border); }
.rp-matrix thead .rp-m-name { z-index: 4; }
.rp-matrix tbody tr:hover th, .rp-matrix tbody tr:hover td { background: var(--color-surface-2); }
.rp-m-day { min-width: 30px; width: 30px; color: var(--color-text-muted); line-height: 1.15; }
.rp-m-day.is-weekend { background: var(--status-weekend-bg); }
.rp-m-day.is-holiday { background: var(--status-holiday-bg); color: var(--status-holiday-ink); }
.rp-m-dn { display: block; font-size: var(--text-xs); color: var(--color-text); }
.rp-m-wd { display: block; font-size: 10px; font-weight: var(--weight-medium); }
.rp-m-cell { padding: 2px; }
.rp-cell {
  display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 6px; border: 0; padding: 0;
  font: inherit; font-size: var(--text-xs); font-weight: var(--weight-bold); background: var(--tone-bg, transparent); color: var(--tone-ink, var(--color-text-subtle));
}
button.rp-cell { cursor: pointer; transition: box-shadow var(--motion-fast); }
button.rp-cell:hover { box-shadow: 0 0 0 2px var(--tone, var(--color-border-strong)); }
button.rp-cell:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 1px; }
.rp-cell.tone-present { background: transparent; box-shadow: inset 0 0 0 1px var(--status-present-bg); }
.rp-cell.is-static { color: var(--color-text-subtle); font-weight: var(--weight-normal); }
.rp-m-sum { min-width: 46px; padding: 3px var(--space-2); font-variant-numeric: tabular-nums; }
.rp-m-sum.is-first { border-left: 1px solid var(--color-border); }
.rp-m-sum.is-bad { color: var(--status-absent-ink); font-weight: var(--weight-semibold); }
.rp-matrix tfoot th, .rp-matrix tfoot td { position: sticky; bottom: 0; z-index: 2; background: var(--color-surface-2); font-weight: var(--weight-semibold); border-top: 1px solid var(--color-border-strong); }
.rp-matrix tfoot .rp-m-name { z-index: 4; }
.rp-matrix .employee-cell { max-width: 190px; }
.rp-lock-check { min-height: 40px; }

/* ---------- timesheet ---------- */
.rp-more:empty { display: none; }
.rp-sheet-card { overflow: hidden; }
.rp-sheet th[scope="colgroup"] { padding: var(--space-3) var(--space-4); background: var(--color-surface-2); border-bottom: 1px solid var(--color-border); }
.rp-sheet thead th { font-weight: var(--weight-medium); }
.rp-sheet-who { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap; font-weight: var(--weight-normal); }
.rp-sheet-sums { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
.rp-sheet-date { white-space: nowrap; }
.rp-dayoff td { color: var(--color-text-muted); }
.rp-sheet td { font-size: var(--text-sm); }
.rp-sheet { table-layout: fixed; min-width: 680px; }
.rp-sheet thead th:nth-child(1) { width: 15%; }
.rp-sheet thead th:nth-child(2) { width: 17%; }
.rp-sheet thead th:nth-child(9) { width: 9%; }
.report-page .region, .report-page .region-content, .rp-sheet-card, .rp-sheet-card .table-wrap { min-width: 0; max-width: 100%; }

/* ---------- corrections, events ---------- */
.rp-struck { text-decoration: line-through; color: var(--color-text-muted); }
.rp-reason { max-width: 320px; }
.rp-nowrap { white-space: nowrap; }
.rp-time-abs { margin-left: var(--space-2); font-size: var(--text-xs); }
.rp-unknown { display: inline-flex; align-items: center; gap: var(--space-2); }
.rp-flagtext { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: var(--radius-pill); background: var(--tone-bg); color: var(--tone-ink); font-size: var(--text-xs); white-space: nowrap; }
.rp-flags { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.rp-payload { max-height: 260px; overflow: auto; margin: 0; padding: var(--space-3); background: var(--color-surface-2); border: 1px solid var(--color-border); border-radius: var(--radius-md); font-size: var(--text-xs); }

/* ---------- leave ---------- */
.rp-lv { min-width: 860px; }
.rp-lv-row { display: grid; grid-template-columns: 200px minmax(0, 1fr); align-items: center; border-bottom: 1px solid var(--color-border); }
.rp-lv-row:last-child { border-bottom: 0; }
.rp-lv-head { background: var(--color-surface-2); position: sticky; top: 0; z-index: 2; }
.rp-lv-name { padding: 6px var(--space-3); min-width: 0; }
.rp-lv-track { display: grid; position: relative; align-items: center; min-height: 40px; }
.rp-lv-head .rp-lv-track { min-height: 32px; }
.rp-lv-day { grid-row: 1; height: 100%; min-height: 40px; border-left: 1px solid var(--color-border); }
.rp-lv-day.is-weekend { background: var(--status-weekend-bg); }
.rp-lv-day.is-today { box-shadow: inset 2px 0 0 var(--color-primary); }
.rp-lv-dn { text-align: center; font-size: var(--text-xs); color: var(--color-text-muted); }
.rp-lv-dn.is-weekend { color: var(--color-text-subtle); }
.rp-lv-bar { grid-row: 1; z-index: 1; height: 26px; margin: 0 1px; border: 0; border-left: 5px solid var(--tone); border-radius: 6px; background: var(--color-surface-3); color: var(--color-text); padding: 0 8px; font: inherit; font-size: var(--text-xs); font-weight: var(--weight-medium); text-align: left; overflow: hidden; white-space: nowrap; display: flex; align-items: center; }
button.rp-lv-bar { cursor: pointer; }
button.rp-lv-bar:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 1px; }
.rp-lv-bar.is-clipped-start { border-top-left-radius: 0; border-bottom-left-radius: 0; border-left-width: 0; }
.rp-lv-bar.is-clipped-end { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.rp-lv-preview { margin: 0; min-height: 20px; font-size: var(--text-sm); }
.rp-lv-preview.is-error { color: var(--color-danger-ink); }

/* ---------- holidays ---------- */
.rp-yearbar { margin-bottom: var(--space-1); }
.rp-year { min-width: 64px; text-align: center; font-size: var(--text-xl); }
.rp-mini-grid-year { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: var(--space-3); }
.rp-mini { padding: var(--space-3); background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); }
.rp-mini-title { margin: 0 0 var(--space-2); font-size: var(--text-md); font-weight: var(--weight-semibold); }
.rp-mini-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
.rp-mini-wd { font-size: 10px; color: var(--color-text-subtle); font-weight: var(--weight-semibold); }
.rp-mini-d { font-size: var(--text-xs); line-height: 24px; border-radius: 6px; color: var(--color-text); }
.rp-mini-d.is-weekend { color: var(--color-text-subtle); }
.rp-mini-d.is-holiday { background: var(--tone-bg); color: var(--tone-ink); box-shadow: inset 0 0 0 1px var(--tone); font-weight: var(--weight-bold); }
.rp-mini-d.is-today { box-shadow: inset 0 0 0 2px var(--color-primary); }
.rp-hlist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.rp-hitem { display: grid; grid-template-columns: 110px minmax(0, 1fr) auto; gap: var(--space-3); align-items: center; padding: 6px 0; border-bottom: 1px solid var(--color-border); font-size: var(--text-md); }
.rp-hitem:last-child { border-bottom: 0; }
.rp-hdate { color: var(--color-text-muted); font-size: var(--text-sm); }
.rp-bulk-issues { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-1); font-size: var(--text-sm); }
.rp-hname { display: flex; flex-direction: column; min-width: 0; }

/* ---------- print pages ---------- */
@page rp-portrait { size: A4 portrait; margin: 12mm; }
@page rp-landscape { size: A4 landscape; margin: 10mm; }
.rp-print { display: block; font-size: var(--text-sm); color: var(--color-text); }
.rp-print-head { border-bottom: 2px solid var(--color-text); padding-bottom: var(--space-2); }
.rp-print-site { font-size: var(--text-sm); font-weight: var(--weight-semibold); color: var(--color-text-muted); }
.rp-print-title { margin: 0; font-size: var(--text-2xl); }
.rp-print-period { margin: 2px 0 0; font-size: var(--text-lg); }
.rp-print-line { margin: 2px 0 0; color: var(--color-text-muted); }
.rp-ptable { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
.rp-ptable th, .rp-ptable td { padding: 3px 6px; border-bottom: 1px solid var(--color-border); text-align: left; vertical-align: middle; }
.rp-ptable thead th { background: var(--color-surface-3); font-weight: var(--weight-semibold); border-bottom: 1px solid var(--color-border-strong); }
.rp-ptable .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rp-ptable tfoot th, .rp-ptable tfoot td { font-weight: var(--weight-semibold); border-top: 1px solid var(--color-border-strong); }
.rp-pgroup-head th { background: var(--color-surface-2); font-size: var(--text-md); }
.rp-status { display: inline-flex; align-items: center; gap: 4px; color: var(--tone-ink); }
.rp-status b { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; border-radius: 4px; background: var(--tone-bg); font-size: 10px; }
.rp-remark { min-width: 90px; }
.rp-pmonth { table-layout: fixed; }
.rp-pmonth th, .rp-pmonth td { padding: 2px 1px; text-align: center; font-size: 10px; }
.rp-pmonth th:nth-child(1), .rp-pmonth td:nth-child(1) { width: 52px; text-align: left; padding-left: 4px; }
.rp-pmonth th:nth-child(2), .rp-pmonth td:nth-child(2) { width: 130px; text-align: left; }
.rp-pmonth .rp-pname { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rp-pmonth thead th.num, .rp-pmonth td.num { width: 34px; padding-right: 3px; }
.rp-pday.is-weekend { background: var(--status-weekend-bg); }
.rp-pday.is-holiday { background: var(--status-holiday-bg); }
.rp-pcell { font-weight: var(--weight-bold); background: var(--tone-bg); color: var(--tone-ink); }
.rp-pcell.tone-present { background: none; }
.rp-plegend { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; }
.rp-pemp { break-inside: avoid-page; display: flex; flex-direction: column; gap: var(--space-2); }
.rp-pemp-title { margin: 0; font-size: var(--text-md); }
.rp-psummary { margin: 0; font-weight: var(--weight-medium); }
.rp-sign { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--space-8); margin-top: var(--space-7); break-inside: avoid; }
.rp-sign-item { display: flex; flex-direction: column; gap: 4px; }
.rp-sign-line { border-bottom: 1px solid var(--color-text); height: 36px; }
.rp-sign-label, .rp-sign-date { font-size: var(--text-xs); color: var(--color-text-muted); }
.rp-print-foot { border-top: 1px solid var(--color-border-strong); padding-top: var(--space-2); color: var(--color-text-muted); font-size: var(--text-xs); }
.rp-print-foot p { margin: 2px 0; }
.rp-print-coverage { color: var(--color-warning-ink); }
@media print {
  .rp-print-portrait { page: rp-portrait; }
  .rp-print-landscape { page: rp-landscape; }
  .rp-print { font-size: 9.5pt; gap: 8pt; }
  .rp-ptable thead { display: table-header-group; }
  .rp-ptable tr { break-inside: avoid; }
  .rp-pgroup-head { break-after: avoid; }
}

.rp-print > * + * { margin-top: var(--space-4); }
@media print { .rp-print > * + * { margin-top: 8pt; } }

/* ---------- employee attendance tab ---------- */
.rp-emp-kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: var(--space-3); }
.rp-emp-kpis .kpi-value { font-size: var(--text-2xl); }
.rp-emp-grid { display: grid; grid-template-columns: minmax(280px, 400px) minmax(0, 1fr); gap: var(--space-4); align-items: start; }
@media (max-width: 1199px) { .rp-emp-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } .rp-emp-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 599px) { .rp-emp-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* coarse pointers: matrix cells and leave bars reach the 44 px touch target */
@media (pointer: coarse) {
  .rp-cell { width: 44px; height: 44px; font-size: var(--text-sm); }
  .rp-m-day { min-width: 48px; width: 48px; }
  .rp-m-sum { min-width: 56px; }
  .rp-lv-bar { height: 36px; }
  .rp-lv-track, .rp-lv-day { min-height: 48px; }
  .rp-lv { min-width: 1100px; }
  .rp-mini-d { line-height: 32px; }
}

/* UX-1/2: not-enrolled marks and the notes under the month summary */
.rp-summary-note { flex: 1 1 100%; margin: 0; }
.rp-fact-note { font-size: var(--text-xs); color: var(--color-text-muted); font-weight: var(--weight-regular); }
.rp-matrix .rp-m-name .badge { margin-top: 2px; font-size: var(--text-xs); padding-block: 0; }
.rp-who-cell { display: inline-flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; }


/* ---------- daily board (D24): toolbar, hours table, summary view ---------- */
.day-toolbar { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; }
.day-toolbar-spacer { flex: 1 1 auto; }
.day-viewby { display: inline-flex; align-items: center; gap: var(--space-2); }
.day-viewby-label { font-size: var(--text-sm); font-weight: var(--weight-medium); color: var(--color-text-muted); white-space: nowrap; }
.day-viewby .select { min-width: 176px; }

/* the table: sticky header against the page, numbers aligned on their right edge */
.day-card { overflow: visible; }
.day-card .table-wrap { overflow-x: auto; }
.day-card .table thead th { top: var(--topbar-height); box-shadow: 0 1px 0 var(--color-border-strong); border-bottom: 0; }
.day-card .table thead th:first-child { border-top-left-radius: var(--radius-lg); }
.day-card .table thead th:last-child { border-top-right-radius: var(--radius-lg); }
.day-card .table tbody tr:last-child td:first-child { border-bottom-left-radius: var(--radius-lg); }
.day-card .table tbody tr:last-child td:last-child { border-bottom-right-radius: var(--radius-lg); }
@media (min-width: 1360px) { .day-card .table-wrap { overflow-x: visible; } }
.day-card .table td { padding-top: 10px; padding-bottom: 10px; vertical-align: middle; }
.day-card .table .col-num { white-space: nowrap; width: 1%; font-variant-numeric: tabular-nums; }
.day-card .table .col-shift { width: 1%; white-space: nowrap; }
.day-card .table .col-actions { width: 1%; padding-left: 4px; padding-right: 8px; }
.day-card .table .col-exceptions { min-width: 130px; }
.day-card .table .col-employee { min-width: 170px; }
.num { font-variant-numeric: tabular-nums; }

.day-emp { display: flex; align-items: center; gap: 10px; min-width: 0; }
.day-emp-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.day-emp-text .employee-name { font-weight: var(--weight-semibold); color: var(--color-text); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.day-emp-text .employee-name:hover { color: var(--color-primary-ink); text-decoration: underline; }
.day-emp-title, .day-emp-code { font-size: var(--text-xs); color: var(--color-text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 190px; }

/* shift badge: tint of the shift's categorical slot, dark ink (AA on every slot), a solid edge in the slot colour */
.shift-badge {
  display: inline-flex; flex-direction: column; gap: 1px; padding: 4px 10px 4px 9px; line-height: 1.25;
  background: color-mix(in srgb, var(--tone) 15%, var(--color-surface)); border-left: 4px solid var(--tone);
  border-radius: var(--radius-sm); color: var(--color-text); max-width: 100%;
}
.shift-badge-name { font-size: var(--text-sm); font-weight: var(--weight-semibold); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shift-badge-time { font-size: var(--text-xs); color: var(--color-text-muted); white-space: nowrap; }

.day-pills { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.day-pill {
  display: inline-flex; align-items: center; padding: 2px 9px; border-radius: var(--radius-pill); white-space: nowrap;
  background: var(--tone-bg); color: var(--tone-ink); font-size: var(--text-xs); font-weight: var(--weight-semibold); line-height: 18px;
}
.day-diff.is-negative { color: var(--color-danger-ink); font-weight: var(--weight-semibold); }
.day-diff.is-positive { color: var(--status-present-ink); }
.day-running { display: inline-flex; flex-direction: column; align-items: flex-end; line-height: 1.2; }
.day-actions-cell { display: inline-flex; gap: 2px; }

/* summary view */
.day-summary { display: flex; flex-direction: column; gap: var(--space-4); }
.day-tiles-lg { display: grid; grid-template-columns: repeat(auto-fit, minmax(168px, 1fr)); gap: var(--space-3); }
.day-tile-lg { display: flex; flex-direction: column; gap: 2px; padding: var(--space-3) var(--space-4); background: var(--color-surface); border: 1px solid var(--color-border); border-left: 4px solid var(--tone, var(--color-border-strong)); border-radius: var(--radius-md); }
.day-tile-lg-label { font-size: var(--text-sm); font-weight: var(--weight-medium); color: var(--color-text-muted); }
.day-tile-lg-value { font-size: var(--text-2xl); font-weight: var(--weight-semibold); line-height: 1.2; color: var(--color-text); }
.day-tile-lg.tone-danger .day-tile-lg-value, .day-tile-lg.tone-late .day-tile-lg-value, .day-tile-lg.tone-early_leave .day-tile-lg-value { color: var(--tone-ink); }
.day-tile-lg-sub { font-size: var(--text-xs); color: var(--color-text-muted); }
.day-summary-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: var(--space-4); align-items: start; }
.day-arrivals { min-width: 0; }

@media (max-width: 767px) {
  .day-toolbar { gap: var(--space-2); }
  .day-toolbar-spacer { display: none; }
  .day-viewby { flex: 1 1 100%; }
  .day-viewby .select { flex: 1 1 auto; }
  .day-card .table-cards tbody tr { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 12px; padding: 14px 16px; }
  .day-card .table-cards td { flex-direction: column; align-items: flex-start; justify-content: flex-start; gap: 2px; padding: 0; text-align: left; min-width: 0; }
  .day-card .table-cards td.align-right { text-align: left; }
  .day-card .table-cards td[data-label]::before { font-size: var(--text-xs); }
  .day-card .table-cards td.cell-primary, .day-card .table-cards td.col-shift, .day-card .table-cards td.col-exceptions, .day-card .table-cards td.col-actions { grid-column: 1 / -1; }
  .day-card .table-cards td.col-shift::before, .day-card .table-cards td.col-exceptions::before { display: none; }
  .day-card .table-cards td.cell-primary { padding-right: 36px; }
  .day-card .table-cards td.col-actions { flex-direction: row; justify-content: flex-end; }
  .day-card .table-cards .col-num { width: auto; }
  .day-running, .day-out { align-items: flex-start; }
  .day-card .table-cards .shift-badge { flex-direction: row; gap: var(--space-2); align-items: baseline; }
  .day-tiles-lg { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .day-summary-grid { grid-template-columns: minmax(0, 1fr); }
}

.rp-ptable .rp-neg { color: var(--color-danger-ink); font-weight: var(--weight-semibold); }
.rp-ptable .rp-sub { color: var(--color-text-muted); font-size: var(--text-xs); }
.day-emp-text { max-width: 158px; }
.day-card .th-sort { gap: 2px; }
.day-card .table thead th { padding-left: 6px; padding-right: 6px; }
.day-card .table thead th.col-employee { padding-left: 8px; }
.day-actions-cell .btn { padding-left: 6px; padding-right: 6px; min-width: 30px; }
@media (max-width: 767px) { .day-emp-text { max-width: none; } }
.day-emp-text { max-width: 142px; }
.day-actions-cell .btn { min-width: 0; width: 30px; padding: 0; }
.day-card .table .col-actions { padding-left: 2px; padding-right: 6px; }
.day-card .table .col-exceptions { min-width: 112px; }
@media (max-width: 767px) {
  .day-card .table-cards .shift-badge-name { flex: none; overflow: visible; }
  .day-card .table-cards td.col-actions .day-actions-cell { margin-left: auto; }
  .day-card .table-cards td.col-actions { padding-top: 2px; }
}
@media (max-width: 767px) {
  .day-card .table.table-cards td.col-actions, .day-card .table.table-cards td.col-shift, .day-card .table.table-cards td.col-num { width: auto; }
  .day-card .table.table-cards td.col-actions { padding: 2px 0 0; }
  .day-card .table-cards td.col-actions .day-actions-cell { gap: 8px; }
}
