/* PAY NEW — the New view of Pay ▸ Settlements (payRun.js) and its Classic | New bar (payLayout.js). Classic's markup is
 * untouched: under #panel-settlements.pay-new every Classic child is hidden and the New root shows; otherwise the New
 * root is hidden. The run pieces come from work-run.css. Skin B: tokens only, square corners, gold only as a marker. */

#panel-settlements > .pay-new-root { display: none; }
#panel-settlements.pay-new > :not(.pay-view-bar):not(.pay-new-root) { display: none !important; }
#panel-settlements.pay-new > .pay-new-root { display: block; }

.pay-view-bar { display: inline-flex; align-items: center; }   /* no row of its own: Classic's ⚙ SETTINGS row / New's pay-date row (Ed 10-03) */
.pay-view-bar.is-waiting { display: flex; justify-content: flex-end; padding: 4px 12px 0; }   /* only until a view's row is drawn */
.pay-new-root .pay-run-viewslot { margin-left: auto; display: inline-flex; align-items: center; }

/* ── Head: the one pay-date box + the run's totals ── */
.pay-run-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 8px 12px; border-bottom: 1px solid var(--border); background: var(--bg); }
.pay-date-box { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text3); }
.pay-run-sum { margin-left: auto; font-size: 12px; color: var(--text2); }
.pay-run-sum b { color: var(--text); font-family: var(--emr-font-mono, var(--mono)); }
.pay-loading { padding: 18px 12px; }

/* ── Inputs in the head and the band ── */
.pay-in { font: inherit; font-size: 12px; color: var(--text); background: var(--bg); border: 1px solid var(--border2); border-radius: 0; padding: 3px 6px; min-height: 26px; }
.pay-in:focus-visible { outline: 2px solid var(--ink-info); outline-offset: 0; }
.pay-in:disabled { background: var(--bg2); color: var(--text3); }
textarea.pay-in { width: 100%; resize: vertical; }

/* ── Pay's stage tones on the shared status-ink map (work-run.css, d6 10-04): the stage tile, the row's chip and its next
 *    step take one ink per stage. Hold (gold) and Paid (green) come from the shared map; these three are Pay's own. ── */
:is(.run-stage, .run-chip, .run-next).tone-draft { --run-ink: var(--text2); }
:is(.run-stage, .run-chip, .run-next).tone-finalized { --run-ink: var(--ink-info); }
:is(.run-stage, .run-chip, .run-next).tone-sent { --run-ink: var(--ink-violet, var(--ink-info)); }
.run-chip.tone-finalized::before, .run-chip.tone-sent::before { background: var(--run-ink); }

/* ── Money columns · the band's forms ── */
.pay-new-root .run-money { font-family: var(--emr-font-mono, var(--mono)); white-space: nowrap; }
.pay-new-root tr.run-row { cursor: pointer; }
.pay-new-root tr.run-row:focus-visible { outline: 2px solid var(--ink-info); outline-offset: -2px; }
.pay-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 6px 8px; align-items: end; }
.pay-form label { display: grid; gap: 2px; font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text3); }
.pay-form .run-next { justify-self: start; }
.pay-form .run-sm { grid-column: 1 / -1; }
.pay-over { grid-column: 1 / -1; display: grid; gap: 6px; }

/* ── P1b: the next step a little slimmer (Ed 2026-10-03, "on all of the new surfaces" — d6's values, the same as Orders /
 *    Manifests / Billing New); it hugs its label and keeps the 24 px WCAG 2.2 target. The shared work-run.css is untouched. */
#panel-settlements.pay-new .pay-new-root .run-next { min-height: var(--run-next-h, 24px); min-width: 0; padding: 0 var(--run-next-px, 6px); font-size: var(--run-next-fs, 11px); font-weight: var(--run-next-fw, 600); line-height: calc(var(--run-next-h, 24px) - 2px); letter-spacing: .01em; white-space: nowrap; }
#panel-settlements.pay-new .pay-new-root .pay-step { min-width: 24px; padding: 0 6px; font-size: 14px; line-height: 22px; }

/* ── P1b: the period line, the search row, the flag filters ── */
.pay-run-period { font-size: 12px; color: var(--text2); }
.pay-run-find { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; padding: 6px 12px; border-bottom: 1px solid var(--border); }
.pay-search { display: inline-flex; align-items: center; gap: 6px; flex: 1 1 260px; }
.pay-search .pay-in { flex: 1; min-width: 0; }
.pay-new-root .pay-fchip[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }
.pay-new-root .run-table { min-width: 1100px; }
.pay-new-root { overflow-x: auto; }
.pay-new-root tr.run-row.is-sel > td { background: var(--bg2); }

/* ── P1b: the whole statement in the band (the PDF's model) ── */
.pay-st { display: grid; gap: 4px; }
.pay-ld { border: 1px solid var(--border); background: var(--bg); padding: 4px 8px; display: grid; gap: 2px; }
.pay-ld-h { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; font-size: 12px; }
.pay-ld-h .pay-amt { margin-left: auto; font-family: var(--emr-font-mono, var(--mono)); }
.pay-sl { display: flex; gap: 8px; justify-content: space-between; font-size: 12px; color: var(--text2); }
.pay-sl i { font-style: normal; color: var(--text3); font-family: var(--emr-font-mono, var(--mono)); font-size: 11px; }
.pay-sl b { font-family: var(--emr-font-mono, var(--mono)); font-weight: 600; color: var(--text); }
.pay-st-tot { border-top: 2px solid var(--text); padding-top: 4px; display: grid; gap: 2px; }
/* The band stays in view while the wide run scrolls sideways (a phone sees the whole statement, not a slice). */
.pay-new-root tr.run-band > td > .run-band-in { position: sticky; left: 0; max-width: calc(100vw - 32px); }

/* ── FILTERS (Ed 2026-10-04: "same filter + the pay date as in classic"): Cycle · Period from–to · Quick range ── */
.pay-run-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; padding: 6px 12px; border-bottom: 1px solid var(--border); background: var(--bg); }
.pay-run-filters.is-period { box-shadow: inset 3px 0 0 var(--text); }   /* a whole period is showing, not one pay date */
.pay-flt { display: inline-flex; align-items: center; gap: 6px; }
.pay-flt > span:first-child { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text3); }
.pay-flt-period .pay-in[type="date"] { width: 132px; }
.pay-run-mode { flex: 1 1 260px; }
.pay-run-mode a { color: var(--text); }
.pay-new-root td.pay-td-period { white-space: nowrap; }
