/*
  Area "pay2" (Contractors, Contractor statements and their detail, Escrow, the contractor statement print sheet):
  fidelity styles for the boards of canvas-payables. Prefix pui-pay2-. The lists reuse the pui-maint-* list chrome
  (area-maint.css); this file only adds what is specific to these pages.
*/

/* ── Contractor sheet: city / state / ZIP ───────────────────────────────────────────────────── */
.pui-pay2-citygrid { display: grid; grid-template-columns: minmax(0, 1fr) 90px 120px; gap: 14px; }

/* ── Contractor statements list ─────────────────────────────────────────────────────────────── */
.pui-pay2-foot {
    padding: 12px 16px; background: var(--muted); border-top: 1px solid var(--border); font-size: 13px; width: 100%;
    box-sizing: border-box;
}
.pui-maint-list .pui-list-footer:has(.pui-pay2-foot) { width: 100%; }
.pui-maint-list .pui-list-footer:has(.pui-pay2-foot) > .pui-pay2-foot { flex: 1 1 100%; }
.pui-pay2-error { font-size: 12px; color: var(--tone-danger-fg); }

/* ── Generate sheet ─────────────────────────────────────────────────────────────────────────── */
.pui-pay2-stepper { padding: 10px 12px; border: 1px solid var(--input); border-radius: 10px; }
.pui-pay2-selectall { position: relative; height: 0; display: flex; justify-content: flex-end; z-index: 1; }
.pui-pay2-selectall > .cn-button { position: absolute; top: -40px; right: -10px; }
.pui-pay2-truckrow { padding: 12px 0; border-bottom: 1px solid var(--border); }
.pui-pay2-truckrow:last-child { border-bottom: 0; }
.pui-pay2-truckrow .cn-checkbox { margin-top: 2px; }
.pui-pay2-truckrow > .cn-badge { align-self: center; }

/* ── E-mail dialog ──────────────────────────────────────────────────────────────────────────── */
.pui-pay2-email .cn-dialog, .cn-dialog.pui-pay2-email { width: min(760px, calc(100vw - 32px)); max-width: calc(100vw - 32px); }
.pui-pay2-email .cn-dialog-footer { margin: 4px -24px -24px; padding: 14px 24px; border-top: 1px solid var(--border); }
.pui-pay2-email-body .cn-table { border: 1px solid var(--border); border-radius: 10px; }

/* ── Statement detail ───────────────────────────────────────────────────────────────────────── */
.pui-pay2-page { gap: 20px; }
.pui-pay2-stepper-bar { display: flex; gap: 6px; overflow-x: auto; width: 100%; }
.pui-pay2-step { flex: 1 1 0; min-width: 72px; display: flex; flex-direction: column; gap: 6px; }
.pui-pay2-step-bar { height: 4px; border-radius: 999px; background: var(--muted); }
.pui-pay2-step-reached.pui-pay2-step-past .pui-pay2-step-bar { background: var(--primary); }
.pui-pay2-step-now .pui-pay2-step-bar { background: var(--tone-info-fg); }
.pui-pay2-step-label { font-size: 12px; color: var(--muted-foreground); white-space: nowrap; }
.pui-pay2-step-now .pui-pay2-step-label { color: var(--foreground); font-weight: 600; }

.pui-pay2-card { overflow: hidden; }
.pui-pay2-card .cn-card-header { padding-bottom: 12px; align-items: flex-start; }
.pui-pay2-tablewrap { overflow-x: auto; width: 100%; padding: 0; }
.pui-pay2-tablewrap .cn-table-container { width: 100%; }
.pui-pay2-tablewrap table { width: 100%; border-collapse: collapse; font-size: 13px; }
.pui-pay2-tablewrap th.cn-table-head, .pui-pay2-tablewrap thead th {
    height: 38px; padding: 0 12px; font-size: 12px; font-weight: 500; color: var(--muted-foreground);
    border-bottom: 1px solid var(--border); white-space: nowrap; text-align: left;
}
.pui-pay2-tablewrap tbody td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.pui-pay2-tablewrap tbody tr:last-child td { border-bottom: 0; }
.pui-pay2-tablewrap tbody td .pui-num, .pui-pay2-tablewrap tbody td .pui-mono { white-space: nowrap; }
.pui-pay2-tablewrap .pui-tr-3 th:nth-child(3), .pui-pay2-tablewrap .pui-tr-3 td:nth-child(3) { text-align: right; }
.pui-pay2-subrow td { background: oklch(0.975 0.004 250); color: var(--muted-foreground); }
.pui-pay2-subrow td:nth-child(2) { padding-left: 24px; }
.pui-pay2-sub { color: var(--muted-foreground); }
.pui-pay2-empty { padding: 4px 20px 16px; font-size: 13px; color: var(--muted-foreground); }
.pui-pay2-total {
    padding: 10px 12px 14px; font-size: 13px; border-top: 1px solid var(--border); gap: 32px; justify-content: flex-end;
}
.pui-pay2-total > .sc-spacer { display: none; }
.pui-pay2-money { gap: 12px; font-size: 13px; width: 100%; }
.pui-pay2-check {
    padding: 12px 14px; margin-top: 6px; border-radius: 10px; background: var(--tone-info-bg); align-items: baseline;
    gap: 12px; width: 100%; box-sizing: border-box;
}
.pui-pay2-check > * { white-space: nowrap; }
.pui-pay2-kpi { font-size: 24px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.1; }
.pui-pay2-avatar {
    display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%;
    background: var(--secondary); color: var(--secondary-foreground); font-size: 12px; font-weight: 600; flex: none;
}

/* ── Escrow ─────────────────────────────────────────────────────────────────────────────────── */
.pui-pay2-escrow tbody tr { cursor: default; }
.pui-pay2-escrow tbody > tr.pui-pay2-row-open > td { background: var(--tone-info-bg); }
.pui-pay2-escrow tbody > tr.pui-pay2-ledgerrow > td { padding: 0; background: var(--muted); }
.pui-pay2-escrow tbody > tr.pui-pay2-ledgerrow:hover > td { background: var(--muted); }
.pui-pay2-ledger { padding: 16px 20px; align-items: stretch; width: 100%; box-sizing: border-box; }
.pui-pay2-ledger-table { border: 1px solid var(--border); border-radius: 10px; background: var(--card); overflow-x: auto; width: 100%; }
.pui-pay2-ledger-table table { width: 100%; }
.pui-pay2-ledger-table tbody tr:hover td { background: var(--card); }
.pui-pay2-escrow .pui-pay2-ledger .cn-input, .pui-pay2-escrow .pui-pay2-ledger .cn-select { height: 36px; }
.pui-pay2-target { min-width: 180px; }
.pui-pay2-progress { height: 6px; border-radius: 999px; }
.pui-pay2-attarget { font-size: 12px; color: var(--tone-success-fg); }

/* ── Print sheet (board: PrintContractorStatement) ──────────────────────────────────────────── */
.pui-pay2-sheet { padding: 40px 52px 30px; font-size: 11.5px; line-height: 1.45; }
.pui-pay2-p-company { font-size: 15px; font-weight: 700; letter-spacing: -0.01em; }
.pui-pay2-p-title { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; margin-top: 12px; line-height: 1.15; }
.pui-pay2-p-muted { color: #555; font-size: 11px; }
.pui-pay2-p-small { color: #777; font-size: 10px; }
.pui-pay2-p-number { font-family: var(--font-mono); font-size: 18px; font-weight: 600; }
.pui-pay2-p-meta { font-size: 11px; line-height: 1.7; }
.pui-pay2-rule { height: 1.5px; background: #111; margin: 14px 0 12px; }
.pui-pay2-parties { gap: 64px; font-size: 11.5px; margin-bottom: 6px; }
.pui-pay2-p-label { font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #555; }
.pui-pay2-p-party { font-size: 14px; font-weight: 600; }
.pui-pay2-p-section { font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #111; margin: 10px 0 3px; }
.pui-pay2-pt { width: 100%; border-collapse: collapse; font-size: 11.5px; color: #111; table-layout: auto; }
.pui-pay2-pt th.cn-table-head, .pui-pay2-pt thead th {
    height: auto; text-align: left; font-weight: 600; font-size: 10px; letter-spacing: .05em; text-transform: uppercase;
    color: #555; padding: 4px 6px; border-bottom: 1.5px solid #111; white-space: normal; background: transparent;
}
.pui-pay2-pt td { padding: 3.5px 6px; border-bottom: 1px solid #ddd; vertical-align: top; background: transparent; font-size: 11.5px; }
.pui-pay2-pt tbody tr:hover td { background: transparent; }
.pui-pay2-pt-trips th:nth-child(4), .pui-pay2-pt-trips td:nth-child(4),
.pui-pay2-pt-two th:nth-child(3), .pui-pay2-pt-two td:nth-child(3),
.pui-pay2-pt-sched th:nth-child(n+3), .pui-pay2-pt-sched td:nth-child(n+3) { text-align: right; white-space: nowrap; }
.pui-pay2-pt-trips th:nth-child(1) { width: 76px; }
.pui-pay2-pt-trips th:nth-child(3) { width: 100px; }
.pui-pay2-pt-trips th:nth-child(4) { width: 80px; }
.pui-pay2-p-subrow td { color: #555; border-bottom-color: #eee; }
.pui-pay2-p-subrow td:nth-child(2) { padding-left: 16px; }
.pui-pay2-p-totalrow { gap: 16px; padding: 6px 6px 8px; font-size: 11.5px; }
.pui-pay2-p-totals { width: 320px; font-size: 12px; border-top: 1.5px solid #111; padding-top: 8px; box-sizing: border-box; }
.pui-pay2-p-line { padding: 3px 0; width: 100%; }
.pui-pay2-p-checkrow {
    padding: 8px 0 6px; margin-top: 4px; border-top: 1px solid #111; border-bottom: 3px double #111; align-items: baseline;
    width: 100%;
}
.pui-pay2-p-checklabel { font-size: 12px; font-weight: 700; letter-spacing: .06em; }
.pui-pay2-p-check { font-size: 20px; font-weight: 700; }

@media print {
    .pui-pay2-sheet { padding: 0 !important; }
}

/* A free-standing muted note (not a two-line cell: the global two-line rule would collapse its stack gap). */
.pui-pay2-note { font-size: 12px; line-height: 1.45; color: var(--muted-foreground); }
.pui-pay2-contractors .pui-list-toolbar { padding: 10px 16px; }

/* Sheets: an untitled section (the Active switch) drops its heading, and the last section carries no rule (the board). */
.pui-pay2-fs .pui-sheet-section > .sc-vstack:first-child:has(> .pui-sheet-section-title:empty) { display: none; }
.pui-pay2-fs .pui-sheet-section:last-child { border-bottom: 0; }
