/*
  Driver pay area: the driver statements list, the statement page, its sheets and dialogs, the supporting paperwork sheet
  and the print sheet (boards: canvas-payables Main, StatementAddLine, StatementReturnEscrow, StatementMarkPaid,
  StatementRemoveLine, StatementPaperwork, StatementShare, StatementsList, StatementsGenerate, StatementsShare,
  StatementsEmail, StatementsDelete, PrintStatement; canvas-receivables SupportingPaperworkSheet). The pages carry .pui-ld
  too, so the list card, the cards and the dialog frame come from fid-loads-detail.css; everything here is the
  statement-specific part and uses the pui-pay1- / pui-pstl- prefixes.
*/

/* ── Shared small type ────────────────────────────────────────────────────────────────────── */

.pui-pay1 .pui-pay1-small { font-size: 13px; }
.pui-pay1 .pui-pay1-danger { color: var(--tone-danger-fg); }
.pui-pay1 .pui-pay1-plain { color: inherit; }
.pui-pay1-danger { color: var(--tone-danger-fg); }

/* ── Progress strip (board: ol.step) ──────────────────────────────────────────────────────── */

.pui-pay1-steps { display: flex; gap: 6px; overflow-x: auto; }
.pui-pay1-step { flex: 1 1 0; min-width: 72px; }
.pui-pay1-step-bar { height: 4px; border-radius: 999px; background: var(--muted); }
.pui-pay1-step-done .pui-pay1-step-bar { background: var(--primary); }
.pui-pay1-step-now .pui-pay1-step-bar { background: var(--tone-info-fg); }
.pui-pay1-step-label { font-size: 12px; color: var(--muted-foreground); white-space: nowrap; }
.pui-pay1-step-now .pui-pay1-step-label { color: var(--foreground); font-weight: 600; }

/* ── Cards with edge-to-edge tables ───────────────────────────────────────────────────────── */

.pui-pay1-card.cn-card { overflow: hidden; gap: 0; padding: 0; border-radius: 12px; }
.pui-pay1-card > [data-slot="card-header"] { padding: 16px 20px 6px; }
.pui-pay1-flush { display: block; }
.pui-pay1-table { overflow-x: auto; }
.pui-pay1-table table { width: 100%; min-width: 640px; border-collapse: collapse; font-size: 13px; }
.pui-pay1-table-deductions table { min-width: 720px; }
.pui-pay1-table th {
    text-align: left; font-weight: 500; font-size: 12px; color: var(--muted-foreground); padding: 0 12px; height: 38px;
    border-bottom: 1px solid var(--border); white-space: nowrap; background: var(--card);
}
.pui-pay1-table thead { border-top: 0; }
.pui-pay1-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; font-size: 13px; }
.pui-pay1-table tbody tr:last-child td { border-bottom: 0; }
.pui-pay1-table tbody tr:hover td { background: oklch(0.98 0.004 250); }
.pui-pay1-table tbody tr { cursor: default; }
.pui-pay1-table th.pui-pay1-col-actions, .pui-pay1-table td.pui-pay1-col-actions { width: 40px; padding-left: 0; text-align: right; }
.pui-pay1-table th.pui-pay1-col-paper, .pui-pay1-table td.pui-pay1-col-paper { width: 64px; padding-left: 0; padding-right: 4px; }
.pui-pay1-table td.pui-pay1-col-type { width: 120px; }
.pui-pay1-table td.pui-pay1-col-amount { width: 140px; }
.pui-pay1-table tr.pui-pay1-group td {
    background: var(--muted); font-size: 12px; font-weight: 600; color: var(--muted-foreground); height: 30px; padding: 6px 12px;
}
.pui-pay1-table tr.pui-pay1-group:hover td { background: var(--muted); }
.pui-pay1-empty { padding: 14px 20px; font-size: 13px; color: var(--muted-foreground); }
.pui-pay1-tot {
    justify-content: flex-end; gap: 32px; padding: 10px 12px 14px; font-size: 13px; border-top: 1px solid var(--border);
    padding-right: 20px;
}
.pui-pay1-sub {
    align-items: center; gap: 12px; padding: 12px 20px; border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border); background: var(--muted);
}
.pui-pay1-sub-title { font-size: 13px; font-weight: 600; }

/* ── The rail ─────────────────────────────────────────────────────────────────────────────── */

.pui-pay1-money { font-size: 13px; align-items: baseline; }
.pui-pay1-money-strong { font-weight: 600; }
.pui-pay1-money-rule { padding-top: 8px; border-top: 1px solid var(--border); }
.pui-pay1-net {
    justify-content: space-between; align-items: baseline; gap: 12px; padding: 12px 14px; margin-top: 6px;
    border-radius: 10px; background: var(--tone-info-bg);
}
.pui-pay1-kpi { font-size: 26px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.1; }
.pui-pay1-balance { margin-top: 6px; padding: 12px 14px; border-radius: 10px; background: var(--muted); }

/* ── Dialogs and sheets ───────────────────────────────────────────────────────────────────── */

.pui-pay1-dialog .cn-dialog { width: min(440px, calc(100vw - 32px)); max-width: calc(100vw - 32px); }
.pui-pay1-dialog.pui-pay1-dialog-wide .cn-dialog { width: min(760px, calc(100vw - 32px)); max-width: calc(100vw - 32px); max-height: calc(100vh - 48px); overflow: auto; }
.pui-pay1-boxed td { overflow-wrap: anywhere; }
.pui-pay1-dialog [data-slot="dialog-footer"] { border-top: 1px solid var(--border); margin: 6px -24px -24px; padding: 16px 24px; }
.pui-pay1-dialog-body { margin-bottom: 6px; }
.pui-pay1-boxed { border: 1px solid var(--border); border-radius: 10px; overflow: auto; max-height: 320px; }
.pui-pay1-boxed table { width: 100%; border-collapse: collapse; font-size: 13px; }
.pui-pay1-boxed th { text-align: left; font-weight: 500; font-size: 12px; color: var(--muted-foreground); padding: 0 12px; height: 36px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.pui-pay1-boxed td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.pui-pay1-boxed tbody tr:last-child td { border-bottom: 0; }

.pui-pay1-sheet .cn-label { font-size: 13px; font-weight: 500; color: var(--foreground); }
.pui-pay1-sheet .cn-field-description { font-size: 12px; color: var(--muted-foreground); }
.pui-pay1-sheet .pui-sheet-section-title { font-size: 14px; }
.pui-pay1-sheet input[type="number"]::-webkit-outer-spin-button, .pui-pay1-sheet input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.pui-pay1-sheet input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
.pui-pay1-effect { padding: 12px 14px; border-radius: 10px; background: var(--muted); }
.pui-pay1-info { align-items: center; padding: 12px 14px; border-radius: 10px; background: var(--tone-info-bg); color: var(--tone-info-fg); }
.pui-pay1-info-label { font-size: 12px; color: var(--tone-info-fg); }
.pui-pay1-info-value { font-size: 18px; font-weight: 600; color: var(--foreground); }

.pui-pay1-files { gap: 0; }
.pui-pay1-file { align-items: center; padding: 12px 0; border-bottom: 1px solid var(--border); }
.pui-pay1-file:last-child { border-bottom: 0; }
.pui-pay1-file-icon {
    width: 36px; height: 36px; border-radius: 9px; background: var(--muted); display: flex; align-items: center;
    justify-content: center; color: var(--muted-foreground); flex: none;
}

/* ── Send card: the buttons span the card ─────────────────────────────────────────────────── */

[data-testid="settlement-send-card"] .cn-button { width: 100%; justify-content: center; }

/* ── The list ─────────────────────────────────────────────────────────────────────────────── */

.pui-pay1-list .pui-filter-bar .cn-select-root { flex: 0 0 auto; width: auto; }
.pui-pay1-list .pui-filter-bar .cn-select.pui-pay1-filter { height: 32px; min-height: 32px; width: 150px; font-size: 13px; padding-block: 0; }
.pui-pay1-list .pui-ld-count { background: var(--background); border-radius: 999px; padding: 1px 6px; font-size: 11px; }
.pui-pay1-list .pui-filter-bar .pui-pay1-truck { flex: 0 0 auto; width: 130px; height: 32px; font-size: 13px; }
.pui-pay1-list .pui-pay1-date { width: 150px; height: 32px; font-size: 13px; }
.pui-pay1-list table { min-width: 940px; }
.pui-pay1-list th.pui-pay1-check, .pui-pay1-list td.pui-pay1-check { width: 36px; padding-right: 0; }
.pui-pay1-list th.pui-pay1-actions, .pui-pay1-list td.pui-pay1-actions { width: 40px; padding-left: 0; text-align: right; }
.pui-pay1-list td a.pui-mono { color: var(--primary); text-decoration: none; }
.pui-pay1-list td a.pui-mono:hover { text-decoration: underline; }
.pui-pay1-list tbody tr[data-selected="true"] td { background: var(--tone-info-bg); }
.pui-pay1-list tfoot td { background: var(--muted); padding: 10px 12px; font-size: 13px; border-top: 1px solid var(--border); }
.pui-pay1-flag { font-size: 12px; font-weight: 500; color: var(--tone-warning-fg); align-items: center; }
.pui-pay1-bulk {
    padding: 12px 16px; background: var(--tone-info-bg); border-top: 1px solid var(--border); gap: 10px; font-size: 13px;
}

/* ── Generate sheet ───────────────────────────────────────────────────────────────────────── */

.pui-pay1-stepper { align-items: center; justify-content: space-between; padding: 10px 12px; border: 1px solid var(--input); border-radius: 10px; }
.pui-pay1-driver { align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--border); }
.pui-pay1-driver:last-child { border-bottom: 0; }
.pui-pay1-driver .cn-checkbox, .pui-pay1-driver [role="checkbox"] { margin-top: 3px; }

/* ── Print sheet (board: PrintStatement) ──────────────────────────────────────────────────── */

.pui-pstl { background: oklch(0.96 0.004 250); min-height: 100%; }
.pui-pstl-stage { padding: 0 24px 40px; display: flex; justify-content: center; }
.pui-pstl-sheet {
    width: 816px; max-width: 100%; box-sizing: border-box; background: #fff; color: #111; padding: 40px 52px 30px;
    box-shadow: 0 1px 3px oklch(0.2 0.02 258 / .12); min-height: 1056px; display: flex; flex-direction: column;
    font-size: 11.5px;
}
.pui-pstl-company { font-size: 15px; font-weight: 700; letter-spacing: -0.01em; }
.pui-pstl-muted { color: #555; }
.pui-pstl-sheet .pui-pstl-muted { font-size: 11px; }
.pui-pstl-title { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; margin-top: 12px; line-height: 1.1; }
.pui-pstl-facts { font-size: 11px; line-height: 1.7; text-align: right; }
.pui-pstl-number { font-family: var(--font-mono); font-size: 18px; font-weight: 600; }
.pui-pstl-rule { height: 1.5px; background: #111; margin: 14px 0 12px; }
.pui-pstl-label { font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #555; }
.pui-pstl-driver { font-size: 14px; font-weight: 600; }
.pui-pstl-heading {
    font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #111; margin: 10px 0 3px;
}
.pui-pstl-dim { color: #777; }
.pui-pstl-table table { width: 100%; border-collapse: collapse; font-size: 11.5px; color: #111; }
.pui-pstl-table th {
    text-align: left; font-weight: 600; font-size: 10px; letter-spacing: .05em; text-transform: uppercase; color: #555;
    padding: 4px 6px; height: auto; border-bottom: 1.5px solid #111; background: transparent;
}
.pui-pstl-table td { padding: 3.5px 6px; border-bottom: 1px solid #ddd; vertical-align: top; color: #111; font-size: 11.5px; background: transparent; }
.pui-pstl-table tbody tr:hover td { background: transparent; }
.pui-pstl-table tr.pui-pstl-total td { border-bottom: 0; padding-top: 6px; font-weight: 600; text-align: right; }
.pui-pstl-table td.pui-pstl-col-n { width: 24px; }
.pui-pstl-table td.pui-pstl-col-type { width: 130px; }
.pui-pstl-table td.pui-pstl-col-amount { width: 80px; }
.pui-pstl-summary-wrap { margin-top: auto; padding-top: 16px; }
.pui-pstl-summary { width: 300px; font-size: 12px; }
.pui-pstl-sum-row { padding: 3px 0; font-size: 12px; }
.pui-pstl-sum-small { font-size: 11px; padding: 2px 0; }
.pui-pstl-net-row { align-items: baseline; padding: 8px 0 6px; margin-top: 4px; border-top: 1px solid #111; border-bottom: 3px double #111; }
.pui-pstl-net-label { font-size: 12px; font-weight: 700; letter-spacing: .06em; }
.pui-pstl-net { font-size: 20px; font-weight: 700; }
.pui-pstl-footer {
    margin-top: 14px; padding-top: 8px; border-top: 1px solid #ddd; display: flex; justify-content: space-between;
    font-size: 10.5px; color: #666;
}

@media print {
    .pui-sidebar, .pui-topbar, .pui-pstl-chrome { display: none !important; }
    *:has(.pui-pstl-sheet):not(.pui-pstl-sheet) {
        display: block !important; height: auto !important; min-height: 0 !important; max-height: none !important;
        overflow: visible !important; padding: 0 !important;
    }
    html, body { margin: 0 !important; padding: 0 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .pui-pstl, .pui-pstl-stage { background: none !important; padding: 0 !important; }
    .pui-pstl-sheet { width: auto !important; max-width: none !important; padding: 0 !important; box-shadow: none !important; min-height: 0 !important; }
}

[data-testid="settlement-share-dialog"] .cn-dialog { width: min(600px, calc(100vw - 32px)); max-width: calc(100vw - 32px); }
[data-testid="settlement-send-card"] .cn-card-content > * { display: flex; flex-direction: column; gap: 8px; }
