/* Payroll Forecaster. Written for this service on the shell's tokens, in the Contract Income Forecaster's layout:
 * no width cap of its own (the shell's `.content-inner` caps and centres the page), an eyebrow and title header,
 * card sections, KPI cards. Every width and colour is a class; there is no script. */
:root {
  --pf-border: var(--hs-border, #dfe4ec);
  --pf-ink: var(--hs-ink, #1f2937);
  --pf-mut: var(--hs-ink-muted, #55637a);
  --pf-surface: var(--hs-surface, #fff);
  --pf-accent: var(--hs-aqua, #0d5bb8);
  --pf-tint: #f0f4ff;
  --pf-bad: #991b1b;
  --pf-bad-bg: #fee2e2;
  --pf-radius: 10px;
}
.pf-wrap { max-width: none; margin: 0; padding: 0 0 48px; color: var(--pf-ink); }
.pf-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.pf-eyebrow { font-size: 11px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; color: var(--pf-accent); margin: 0 0 3px; }
.pf-title { font-size: 1.75rem; font-weight: 800; margin: 0 0 8px; line-height: 1.2; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
.pf-year { font-size: .8rem; font-weight: 800; letter-spacing: .04em; color: #1c3461; background: var(--pf-tint); border: 1px solid #c7d6f5; border-radius: 999px; padding: 3px 12px; }
.pf-lead { color: var(--pf-mut); font-size: 15px; margin: 0 0 18px; max-width: 80ch; line-height: 1.5; }
.pf-quiet, .pf-hint { color: var(--pf-mut); font-size: 13px; margin: 6px 0 0; line-height: 1.45; }
.pf-opt { font-weight: 400; color: var(--pf-mut); }

/* Rates strip */
.pf-rates { margin: 0 0 18px; }
.pf-tiles { list-style: none; margin: 0 0 8px; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.pf-tile { background: var(--pf-surface); border: 1px solid var(--pf-border); border-top: 3px solid var(--pf-accent); border-radius: 8px; padding: 8px 12px; display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.pf-tile-l { font-size: 11px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: #1c3461; }
.pf-tile-v { font-size: 1.25rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.pf-tile-n { font-size: 12px; color: var(--pf-mut); }
.pf-open { font-size: 13px; background: var(--pf-tint); border-left: 4px solid var(--pf-accent); border-radius: 0 8px 8px 0; padding: 4px 16px; }
.pf-open summary { cursor: pointer; font-weight: 700; padding: 8px 0; min-height: 24px; }
.pf-open-body { padding: 0 0 10px; line-height: 1.55; color: #374151; }
.pf-open-body ul { margin: 4px 0 8px; padding-left: 20px; }
.pf-open a { color: #0a4a96; font-weight: 700; }

.pf-error { background: var(--pf-bad-bg); color: var(--pf-bad); border: 1px solid #f1a9a9; border-radius: 8px; padding: 10px 14px; font-size: 14px; margin: 0 0 16px; }
.pf-error ul, .pf-row-errors { margin: 0; padding-left: 20px; }
.pf-row-errors { color: var(--pf-bad); font-size: 14px; margin: 0 0 10px; }

/* Cards and headings */
.pf-card { background: var(--pf-surface); border: 1px solid var(--pf-border); border-radius: var(--pf-radius); box-shadow: 0 1px 6px rgba(0,0,0,.06); padding: 16px 20px; margin: 0 0 18px; }
.pf-head { font-size: 13px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: #1c3461; margin: 0 0 10px; }
.pf-head-plain { margin: 0 0 10px; }
.pf-fields { display: grid; gap: 12px 20px; align-items: start; }
.pf-fields-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.pf-field { min-width: 0; }
.pf-label { display: block; font-size: 13px; font-weight: 700; margin: 0 0 4px; }
.pf-input { width: 100%; box-sizing: border-box; font: inherit; min-height: 40px; padding: 6px 10px; border: 1px solid var(--pf-border); border-radius: 8px; background: var(--pf-surface); color: var(--pf-ink); }
.pf-input:focus-visible, .pf-button:focus-visible { outline: 3px solid #f59e0b; outline-offset: 2px; }

/* Staff cards: five distinguishable cards, grouped Pay / Pay rise / Pension */
.pf-staffgrid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; margin: 0 0 16px; }
.pf-staff { --pf-c: #0d5bb8; margin: 0; min-width: 0; background: var(--pf-surface); border: 1px solid var(--pf-border); border-top: 4px solid var(--pf-c); border-radius: var(--pf-radius); box-shadow: 0 1px 6px rgba(0,0,0,.06); padding: 8px 16px 14px; }
.pf-staff-bad { border-color: #f1a9a9; border-top-color: var(--pf-bad); }
.pf-s1 { --pf-c: #0d5bb8; } .pf-s2 { --pf-c: #0f766e; } .pf-s3 { --pf-c: #b45309; } .pf-s4 { --pf-c: #7c3aed; } .pf-s5 { --pf-c: #be185d; }
.pf-legend { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 14px; padding: 0 6px; }
.pf-badge { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%; background: var(--pf-c, #0d5bb8); color: #fff; font-size: 13px; font-weight: 800; flex: none; }
.pf-group { padding: 8px 0 4px; border-top: 1px solid #e8edf2; display: grid; gap: 8px; }
.pf-legend + .pf-group, .pf-row-errors + .pf-group { border-top: 0; }
.pf-group-h { margin: 0; font-size: 11px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--pf-mut); }
.pf-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.pf-check { display: flex; gap: 8px; align-items: center; font-size: 14px; min-height: 40px; }
.pf-check input { width: 18px; height: 18px; }
.pf-actions { margin: 0 0 20px; }
.pf-button { font: inherit; font-weight: 800; min-height: 44px; padding: 8px 28px; border: 0; border-radius: 8px; background: var(--pf-accent); color: #fff; cursor: pointer; }

/* Results */
.pf-kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin: 0 0 16px; }
.pf-kpi { background: #f8fafc; border: 1px solid var(--pf-border); border-radius: 8px; padding: 8px 12px; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pf-kpi-main { background: var(--pf-tint); border-color: #c7d6f5; }
.pf-kpi-up { border-left: 4px solid var(--pf-accent); }
.pf-kpi-l { font-size: 12px; color: var(--pf-mut); font-weight: 700; }
.pf-kpi-v { font-size: 1.2rem; font-weight: 800; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.pf-kpi-n { font-size: 12px; color: var(--pf-mut); }
.pf-warn { background: #fef3c7; color: #5c3a05; border: 1px solid #e6c34a; border-radius: 8px; padding: 10px 14px; font-size: 13px; margin: 0 0 16px; }
.pf-tables { display: grid; grid-template-columns: repeat(auto-fill, minmax(520px, 1fr)); gap: 16px; align-items: start; margin: 0 0 12px; }
.pf-scroll { --pf-c: #1c3461; position: relative; overflow-x: auto; min-width: 0; background: var(--pf-surface); border: 1px solid var(--pf-border); border-top: 4px solid var(--pf-c); border-radius: var(--pf-radius); }
.pf-table { border-collapse: collapse; width: 100%; font-size: 14px; }
.pf-table caption { text-align: left; font-weight: 800; padding: 10px 12px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.pf-table th, .pf-table td { padding: 7px 12px; border-top: 1px solid var(--pf-border); text-align: left; white-space: nowrap; }
.pf-table th[scope="row"] { font-weight: 600; }
.pf-total-row th, .pf-total-row td { font-weight: 800; background: #f8fafc; }
.pf-num { text-align: right !important; font-variant-numeric: tabular-nums; }
.pf-flag { background: var(--pf-bad-bg); color: var(--pf-bad); border-radius: 6px; padding: 2px 8px; font-size: 12px; }
.pf-tag { background: #e5e7eb; border-radius: 6px; padding: 2px 8px; font-size: 12px; font-weight: 600; }

@media (max-width: 1799px) { .pf-staffgrid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1100px) { .pf-staffgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 1100px) { .pf-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } .pf-fields-3 { grid-template-columns: minmax(0, 1fr); } .pf-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) { .pf-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .pf-card { padding: 14px; } }
@media (max-width: 620px) { .pf-staffgrid, .pf-tables { grid-template-columns: minmax(0, 1fr); } .pf-tiles, .pf-kpis { grid-template-columns: minmax(0, 1fr); } .pf-title { font-size: 1.5rem; } }
