/* 汇款文件（/#pay-batch）。颜色只用 tokens.css 变量（UI 门禁）。规则由 /api/payables/batch 随数据返回（app/pay_batch.py）。 */
[hidden] { display: none !important; }
body { background: var(--canvas); color: var(--text-primary); margin: 0; }
.pb-app { margin: 0 auto; padding: 20px 16px 48px; max-width: 1440px; }
.pb-head h1 { margin: 0 0 4px; font-size: 22px; }
.pb-head p { margin: 0 0 6px; color: var(--text-muted); font-size: 13px; line-height: 1.6; max-width: 860px; }
.pb-links { margin: 0 0 10px; font-size: 12px; }
.pb-links a { color: var(--accent); text-decoration: none; }
.pb-links a:hover { text-decoration: underline; }
.pb-empty { padding: 24px; color: var(--text-muted); text-align: center; }
.pb-dim { color: var(--text-muted); font-size: 12px; }
.pb-bad { color: var(--danger-fg); }
.pb-ok { color: var(--success-fg); }

.pb-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.pb-seg { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.pb-seg button { font: inherit; font-size: 12px; border: 0; border-left: 1px solid var(--border); background: var(--surface); color: var(--text-secondary);
  padding: 5px 10px; cursor: pointer; white-space: nowrap; }
.pb-seg button:first-child { border-left: 0; }
.pb-seg button.on { background: var(--accent); color: var(--text-on-accent); }
.pb-sync { margin-left: auto; color: var(--text-muted); font-size: 12px; white-space: nowrap; }
.pb-btn { font: inherit; font-size: 12px; padding: 4px 10px; border-radius: 6px; border: 1px solid var(--accent); background: var(--surface); color: var(--accent);
  cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; }
.pb-btn:hover { background: var(--accent); color: var(--text-on-accent); }
.pb-btn.sm { padding: 2px 8px; font-size: 11px; }
.pb-total { font-size: 14px; color: var(--text-secondary); margin: 4px 0 12px; }
.pb-total b { color: var(--text-primary); font-variant-numeric: tabular-nums; }

.pb-ent { margin: 14px 0 26px; }
.pb-ent-h { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.pb-ent-h h2 { font-size: 16px; margin: 0; white-space: nowrap; }
.pb-ent-h h2 small { font-size: 12px; font-weight: 400; color: var(--text-muted); margin-left: 4px; }
.pb-sum { color: var(--text-secondary); font-size: 13px; white-space: nowrap; }
.pb-sum b { color: var(--text-primary); font-variant-numeric: tabular-nums; }
.pb-dl { font: inherit; font-size: 13px; font-weight: 600; padding: 6px 14px; border-radius: 8px; border: 1px solid var(--accent); background: var(--accent);
  color: var(--text-on-accent); cursor: pointer; white-space: nowrap; margin-left: auto; }
.pb-dl:hover { background: var(--accent-hover); }
.pb-dl:disabled { opacity: 0.45; cursor: default; }
.pb-dl[aria-busy="true"] { opacity: 0.7; cursor: progress; }

.pb-note { padding: 8px 12px; border-radius: 8px; margin: 0 0 8px; font-size: 13px; border: 1px solid var(--border); display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.pb-note ul { margin: 4px 0 0; padding-left: 18px; width: 100%; font-size: 12px; }
.pb-note.good { background: var(--success-bg); border-color: var(--success-border); color: var(--success-fg); }
.pb-note.warn { background: var(--warning-bg); border-color: var(--warning-border); color: var(--warning-fg); }
.pb-note.muted { background: var(--surface-sunken); color: var(--text-secondary); }
/* 补一批（10-16）：下载之后的变化，一类一小块 */
.pb-ex { display: block; }
.pb-ex > b { display: block; margin-bottom: 6px; }
.pb-dl-extra { margin: 2px 0 6px; }
.pb-ex-b { margin-top: 6px; font-size: 12px; }
.pb-ex-b ul { margin: 2px 0 0; padding-left: 18px; }
.pb-ex-b.bad b { color: var(--danger-fg); }
.pb-ex-b.muted { color: var(--text-secondary); }
.pb-ups { display: flex; flex-direction: column; gap: 4px; margin: 0 0 8px; }
.pb-up-item { font: inherit; font-size: 12px; text-align: left; padding: 6px 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; }
.pb-up-item.good { color: var(--success-fg); border-color: var(--success-border); }
.pb-up-item.warn { color: var(--warning-fg); border-color: var(--warning-border); }
.pb-up-item.bad { color: var(--danger-fg); border-color: var(--danger-border); background: var(--danger-bg); }

/* 表：不包横向滚动框（包了表头就钉不住）；列宽定死，一格一行 */
.pb-wrap { border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.pb-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; table-layout: fixed; }
.pb-table thead th { position: sticky; top: 0; z-index: 2; background: var(--surface-sunken); color: var(--text-secondary); font-weight: 600;
  font-size: 12px; text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--border); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pb-table thead th:first-child { border-top-left-radius: 10px; }
.pb-table thead th:last-child { border-top-right-radius: 10px; }
.pb-table td { padding: 6px 8px; border-bottom: 1px solid var(--border-subtle); vertical-align: top; overflow: hidden; }
.pb-table tbody tr:last-child td { border-bottom: 0; }
.pb-table tbody tr:hover td { background: var(--surface-hover); }
.pb-table tbody tr.warn td:first-child { box-shadow: inset 3px 0 0 var(--warning-fg); }
.pb-table th.c-num, .pb-table td.num { text-align: right; }
.pb-table td.num b { font-variant-numeric: tabular-nums; white-space: nowrap; }
.pb-table td small { display: block; color: var(--text-secondary); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pb-table td small.in { display: inline; }
col.c-n { width: 34px; } col.c-holder { width: 20%; } col.c-acct { width: 172px; } col.c-bank { width: 15%; } col.c-flag { width: 58px; }
col.c-amt { width: 108px; } col.c-why { width: 58px; } col.c-from { width: 26%; } col.c-rev { width: 56px; }
.pb-holder, .pb-bank { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pb-acct { font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pb-flag { font-size: 11px; padding: 1px 6px; border-radius: 6px; white-space: nowrap; background: var(--surface-sunken); color: var(--text-secondary); }
.pb-flag.f1 { background: var(--info-bg); color: var(--info-fg); }
.pb-warn { color: var(--warning-fg); font-size: 11px; line-height: 1.4; white-space: normal; }
.pb-parts { line-height: 1.5; }
.pb-part { display: inline-flex; align-items: baseline; gap: 3px; margin: 0 8px 2px 0; white-space: nowrap; }
.pb-part a { color: var(--accent); text-decoration: none; font-weight: 600; font-size: 12px; }
.pb-part a:hover { text-decoration: underline; }
.pb-table td .pb-part small { display: inline; }
.pb-x { font: inherit; font-size: 11px; line-height: 1; border: 0; background: transparent; color: var(--text-muted); cursor: pointer; padding: 1px 3px; border-radius: 4px; }
.pb-x:hover { background: var(--danger-bg); color: var(--danger-fg); }
.pb-rev { text-decoration: none; font-size: 14px; }
.pb-revc small, .pb-revc b { display: block; font-size: 11px; white-space: nowrap; }

.pb-left { margin: 8px 0 0; border: 1px dashed var(--border); border-radius: 8px; padding: 6px 12px; background: var(--surface); }
.pb-left summary { cursor: pointer; font-size: 13px; color: var(--text-secondary); }
.pb-left ul { margin: 6px 0 2px; padding-left: 0; list-style: none; }
.pb-left li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; font-size: 12px; padding: 4px 0; border-top: 1px solid var(--border-subtle); }
.pb-left li:first-child { border-top: 0; }
.pb-left li a { color: var(--accent); text-decoration: none; font-weight: 600; }
.pb-left li b { font-variant-numeric: tabular-nums; }
.pb-left li small { color: var(--text-muted); }
.pb-l-why { color: var(--text-secondary); }
.pb-left li.bad .pb-l-why { color: var(--danger-fg); }
.pb-left li.marked .pb-l-why { color: var(--info-fg); }
.pb-others li { display: block; }
.pb-others li small { display: block; margin-top: 2px; white-space: normal; }

/* 右边详情 */
.pb-panel { position: fixed; top: 0; right: 0; bottom: 0; width: min(520px, 92vw); background: var(--surface); border-left: 1px solid var(--border);
  box-shadow: var(--shadow-3); z-index: 30; overflow-y: auto; }
.pb-panel-h { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; padding: 10px 14px;
  background: var(--surface); border-bottom: 1px solid var(--border); }
.pb-close { font: inherit; font-size: 20px; line-height: 1; border: 0; background: transparent; color: var(--text-secondary); cursor: pointer; padding: 2px 6px; }
.pb-panel-b { padding: 4px 16px 24px; font-size: 13px; }
.pb-panel-b h3 { font-size: 15px; margin: 12px 0 4px; }
.pb-panel-b h4 { font-size: 13px; margin: 14px 0 4px; }
.pb-panel-b h4.bad { color: var(--danger-fg); }
.pb-panel-b h4.warn { color: var(--warning-fg); }
.pb-panel-b h4.good { color: var(--success-fg); }
.pb-plist { margin: 0; padding-left: 18px; }
.pb-plist li { margin: 3px 0; line-height: 1.5; }
.pb-plist li small { color: var(--text-muted); }
.pb-panel-b a { color: var(--accent); }

@media (max-width: 1100px) {
  .pb-wrap { overflow-x: auto; }
  .pb-table { min-width: 980px; }
}
.pb-left li.held .pb-l-why { color: var(--warning-fg); }
