/* Styles for src/routes/process.tsx pages (stages 4 and 5, payslips). Same tokens as app.css and finance.css. */

.proc-kpis { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.proc-kpis .kpi-value { font-size: 1.15rem; overflow-wrap: anywhere; }
.pic-note { display: block; margin: -.25rem 0 .5rem; }
.alert.info-alert { background: color-mix(in srgb, var(--accent) 10%, transparent); color: var(--text); }
.section-title .actions { margin: 0; flex-wrap: wrap; justify-content: flex-end; }
.section-title form { margin: 0; }
.section-title h2 { margin: 0; }
.sep { border: 0; border-top: 1px solid var(--border); margin: 1.1rem 0; }

/* Payroll register: scrolls sideways inside its panel, name column stays put */
.reg-wrap { overflow-x: auto; max-width: 100%; margin: .5rem -.25rem 0; border-radius: 12px; scrollbar-width: thin; overscroll-behavior-x: contain; }
.reg-wrap:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.table.reg { font-size: .84rem; min-width: 100%; }
.table.reg th, .table.reg td { white-space: nowrap; padding: .45rem .55rem; }
.table.reg th.r { white-space: normal; min-width: 5.5rem; vertical-align: bottom; line-height: 1.2; }
.table.reg .sticky { position: sticky; left: 0; z-index: 1; background: var(--surface); min-width: 11rem; max-width: 14rem; overflow: hidden; text-overflow: ellipsis; box-shadow: 1px 0 0 var(--border); }
.table.reg thead .sticky, .table.reg tfoot .sticky { z-index: 2; }
.table.reg tr.flag td { background: var(--warn-bg); }
.table.reg tr.flag td.sticky { background: color-mix(in srgb, var(--warn) 10%, var(--surface)); }
.table.reg td.strong { font-weight: 650; }
.table.reg tfoot th { background: var(--surface-2); font-variant-numeric: tabular-nums; }
.table.reg tfoot th.sticky { background: var(--surface-2); }
.breakdown { max-width: 640px; }
.breakdown td, .breakdown th { white-space: nowrap; }
.breakdown td + td, .breakdown th + th { padding-left: 14px; }

/* Stage 5 */
.review-cols { align-items: start; }
.review-checks label.check { align-items: flex-start; margin-bottom: .6rem; font-size: .92rem; }
.review-checks label.check input { margin-top: .2rem; flex: none; }
.review-checks .actions { margin: .25rem 0 .5rem; }
.facts { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; gap: 8px; }
.facts li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); }
.facts li > span:first-child { color: var(--text-2); font-size: .85rem; min-width: 9rem; }
.facts li b { font-variant-numeric: tabular-nums; }
.trail { list-style: none; padding: 0; margin: .4rem 0 0; display: grid; gap: 10px; }
.trail li { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 8px; align-items: start; font-size: .9rem; }
.trail .dot { width: 26px; height: 26px; border-radius: 999px; display: grid; place-items: center; font-size: .8rem; font-weight: 700; background: var(--surface-2); color: var(--text-2); }
.trail .t-approve .dot { background: var(--ok-bg); color: var(--ok); }
.trail .t-return .dot { background: var(--warn-bg); color: var(--warn); }
.trail .t-submit .dot { background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); }
.trail .note { margin: .3rem 0 0; padding: 6px 10px; border-radius: 10px; background: var(--surface-2); white-space: pre-wrap; overflow-wrap: anywhere; }

/* Payslip: laid out like a printed slip; follows the theme on screen, black on white when printed */
.slips { display: grid; gap: 1.25rem; justify-items: center; }
.payslip { position: relative; width: 100%; max-width: 800px; padding: 28px 30px 22px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); color: var(--text);
  box-shadow: var(--shadow, 0 1px 3px rgba(0, 0, 0, .08)); overflow: hidden; font-size: .9rem; }
.payslip > :not(.slip-stamp) { position: relative; z-index: 1; }
.slip-stamp { position: absolute; z-index: 0; top: 46%; left: 50%; transform: translate(-50%, -50%) rotate(-18deg); pointer-events: none; white-space: nowrap;
  font: 700 2.4rem/1 "Space Grotesk", "Inter", sans-serif; letter-spacing: .06em; color: color-mix(in srgb, var(--bad) 30%, transparent);
  border: 4px solid color-mix(in srgb, var(--bad) 28%, transparent); border-radius: 12px; padding: 10px 18px; }
.slip-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; padding-bottom: 12px; border-bottom: 2px solid var(--accent); }
.slip-co { font: 700 1.25rem/1.2 "Space Grotesk", "Inter", sans-serif; letter-spacing: -.01em; }
.slip-title { display: grid; text-align: right; gap: 2px; }
.slip-title b { letter-spacing: .14em; font-size: .8rem; color: var(--text-2); }
.slip-title span { font-weight: 650; font-size: 1.05rem; }
.slip-info { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 24px; margin: 14px 0; }
.slip-info div { display: grid; grid-template-columns: 8.5rem minmax(0, 1fr); gap: 8px; }
.slip-info dt { color: var(--text-2); }
.slip-info dd { margin: 0; font-weight: 550; overflow-wrap: anywhere; }
.slip-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 10px; }
.slip-t { width: 100%; border-collapse: collapse; font-size: .86rem; }
.slip-t th { text-align: left; font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; color: var(--text-2); padding: 6px 0; border-bottom: 1px solid var(--border); }
.slip-t td { padding: 5px 0; border-bottom: 1px dashed var(--border); vertical-align: top; }
.slip-t td + td, .slip-t th + th { padding-left: 10px; }
.slip-t .r { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.slip-t tfoot td { font-weight: 700; border-bottom: 0; border-top: 1px solid var(--text-2); }
.slip-net { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin: 16px 0; padding: 12px 16px; border-radius: 12px; background: var(--surface-2); }
.slip-net span { font-weight: 650; letter-spacing: .06em; text-transform: uppercase; font-size: .8rem; color: var(--text-2); }
.slip-net b { font: 700 1.5rem/1 "Space Grotesk", "Inter", sans-serif; letter-spacing: -.02em; }
.slip-foot { margin: 12px 0 0; font-size: .78rem; }

@media (max-width: 1100px) {
  .proc-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .proc-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .section-title { flex-direction: column; align-items: stretch; gap: .5rem; }
  .section-title .actions { justify-content: flex-start; }
  .table.reg .sticky { min-width: 8.5rem; max-width: 9.5rem; }
  .payslip { padding: 18px 16px; }
  .slip-head { flex-direction: column; }
  .slip-title { text-align: left; }
  .slip-info, .slip-cols { grid-template-columns: minmax(0, 1fr); }
  .slip-info div { grid-template-columns: 8rem minmax(0, 1fr); }
  .slip-stamp { font-size: 1.4rem; border-width: 3px; }
  .slip-er th:nth-child(4), .slip-er td:nth-child(4) { display: none; }
}

/* Print: only the slips, one per A4 page, black on white */
@media print {
  @page { size: A4; margin: 12mm; }
  body:has(.slips) .topbar, body:has(.slips) .sidebar, body:has(.slips) .nav-scrim, body:has(.slips) .hub-tabs, body:has(.slips) .no-print { display: none !important; }
  body:has(.slips) { display: block !important; background: #fff !important; }
  body:has(.slips) .page { padding: 0 !important; max-width: none !important; animation: none !important; }
  .slips { display: block; }
  .payslip { --surface: #fff; --surface-2: #f2f2f4; --border: #c9c9cf; --text: #111; --text-2: #555; --accent: #0a5bd8; --bad: #c0262d;
    max-width: none; border: 0; border-radius: 0; box-shadow: none; padding: 0; color: #111; background: #fff; break-after: page; page-break-after: always; break-inside: avoid; }
  .payslip:last-child { break-after: auto; page-break-after: auto; }
  .slip-net { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .slip-stamp { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
