/* 新功能样式：分页、材料文件、业绩看板 */
.pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; font-size: 14px; color: var(--muted); padding-top: 8px; }
.pager .btn[disabled] { opacity: .45; cursor: default; }
.files { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.file-chip { display: inline-flex; align-items: center; gap: 4px; background: var(--bg); border: 1px solid var(--line-soft); border-radius: 999px; padding: 2px 4px 2px 10px; font-size: 12px; max-width: 100%; }
.file-chip a { color: inherit; text-decoration: underline; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; }
.file-chip button { border: 0; background: none; cursor: pointer; color: var(--muted); font-size: 14px; line-height: 1; padding: 2px 6px; border-radius: 999px; }
.file-chip button:hover { background: var(--line-soft); }
/* 流程节点：紧凑方框 + 勾选框；点方框或勾选框都切换完成，完成后两者一起亮起 */
ol.nodes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
ol.nodes .node { display: flex; align-items: stretch; gap: 6px; }
.node-box { flex: 1; min-width: 0; display: grid; grid-template-columns: 22px 1fr; column-gap: 10px; row-gap: 1px; align-items: center; text-align: start;
  padding: 7px 10px; border: 1px solid var(--line); border-radius: var(--r-md); background: #fff; color: var(--ink); font: inherit; cursor: pointer; }
.node-box:disabled { cursor: default; opacity: .7; }
.node-check { grid-row: span 2; width: 20px; height: 20px; border: 2px solid var(--input); border-radius: 5px; display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: #fff; background: #fff; }
.node-name { font-size: 14px; line-height: 1.35; overflow-wrap: anywhere; }
.node-meta { font-size: 12px; color: var(--muted); min-height: 0; }
.node-meta:empty { display: none; }
.node.now .node-box { border-color: var(--primary); box-shadow: var(--ring); }
.node.now .node-name { font-weight: 600; }
.node.done .node-box { background: var(--ok-soft); border-color: var(--ok); }
.node.done .node-check { background: var(--ok); border-color: var(--ok); }
.node.done .node-meta { color: var(--ok); }
.node-up { position: relative; flex: none; width: 36px; border: 1px solid var(--line); border-radius: var(--r-md); background: #fff; }
.node-up .badge { position: absolute; top: -6px; right: -6px; min-width: 16px; height: 16px; padding: 0 4px; font-size: 11px; background: var(--primary-soft); color: var(--primary); }
@media (hover: hover) { .node-box:hover:not(:disabled) { border-color: var(--muted); } .node.done .node-box:hover { border-color: var(--ok); } }
/* 超期（红）、不适用（灰）、“不适用”小按钮 */
.danger-text { color: var(--danger); }
.node.late .node-box { border-color: var(--danger); }
.node.late .node-meta { color: var(--danger); }
.node.skipped .node-box { background: var(--line-soft); border-style: dashed; color: var(--muted); }
.node.skipped .node-check { background: var(--muted-2); border-color: var(--muted-2); }
.node.skipped .node-name { text-decoration: line-through; }
.node-skip { flex: none; align-self: center; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--muted); font: inherit; font-size: 12px;
  padding: 3px 8px; cursor: pointer; white-space: nowrap; }
.node-skip:hover { border-color: var(--muted); color: var(--ink); }
/* 流程图按阶段（大框）分组：阶段标题一行（名称 · 工作日 · 应完成日 / 完成日 · 超期），阶段内步骤并列（够宽时两列） */
.flow { display: flex; flex-direction: column; gap: 10px; }
.stage { border: 1px solid var(--line); border-radius: var(--r-md); padding: 8px; background: var(--surface-2, #fafbfc); }
.stage.now { border-color: var(--primary); }
.stage .node.now .node-box { box-shadow: none; }
.stage.done { border-color: var(--ok); background: var(--ok-soft); }
.stage.late { border-color: var(--danger); }
.stage-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; padding: 0 2px 6px; }
.stage-name { font-size: 14px; font-weight: 600; }
.stage-meta { font-size: 12px; color: var(--muted); }
.stage-late { font-size: 12px; font-weight: 600; color: var(--danger); }
.stage-ok { font-size: 12px; font-weight: 700; color: var(--ok); }
.stage.todo .stage-name { color: var(--muted); }
ol.nodes.stage-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 6px; }
.stage-group { border: 1px dashed var(--muted-2); border-radius: var(--r-md); padding: 8px; display: flex; flex-direction: column; gap: 8px; }
.stage-group-title { font-size: 13px; font-weight: 600; color: var(--ink-2); padding: 0 2px; }
.flow-help { display: flex; flex-direction: column; gap: 4px; }
/* 表头排序按钮 */
.th-sort { border: 0; background: none; padding: 0; font: inherit; color: inherit; cursor: pointer; white-space: nowrap; }
.th-sort:hover { color: var(--primary); }
.funnel { display: flex; flex-direction: column; gap: 10px; }
.funnel .bar-row { display: grid; grid-template-columns: 72px 1fr 120px; gap: 12px; align-items: center; font-size: 14px; }
.funnel .bar { height: 22px; background: var(--line-soft); border-radius: 6px; overflow: hidden; }
.funnel .bar span { display: block; height: 100%; background: var(--primary); border-radius: 6px; min-width: 2px; }
.funnel .bar-row .sub { text-align: right; }
@media (max-width: 560px) { .funnel .bar-row { grid-template-columns: 56px 1fr 88px; gap: 8px; } }
/* 阿拉伯文（从右到左）：靠边的角标、数字列、文件标签内边距左右对调 */
[dir="rtl"] .node-up .badge { right: auto; left: -6px; }
[dir="rtl"] .funnel .bar-row .sub { text-align: left; }
[dir="rtl"] .file-chip { padding: 2px 10px 2px 4px; }
/* 工资核算弹窗（payroll.js）：宽屏四栏，平板两栏，手机单栏 */
@media (min-width: 561px) {
  dialog.wide:not(.fallback) { width: min(1280px, calc(100vw - 32px)); }
  dialog.wide.fallback { width: min(1280px, calc(100vw - 16px)); }
}
.pc-top { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: flex-end; justify-content: space-between; }
.pc-who { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.pc-who .row { gap: 6px; }
.pc-meta { display: flex; gap: 12px; }
.pc-meta .field { width: 150px; }
.pc-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.pc-col { background: var(--surface-2); border: 1px solid var(--line-soft); border-radius: var(--r-md); padding: 12px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.pc-col h3 { font-size: 15px; margin: 4px 0 2px; }
.pc-item { display: flex; align-items: center; gap: 6px; min-height: 36px; }
.pc-item .lbl { flex: 1; min-width: 0; font-size: 13px; color: var(--ink); overflow-wrap: anywhere; }
.pc-item input.lbl { font-size: 13px; }
.pc-item input.inp { min-height: 36px; padding: 0 8px; font-size: 14px; }
.pc-item .amt { width: 112px; flex: none; text-align: end; }
.pc-item .rate { width: 64px; flex: none; }
.pc-item input[type=checkbox] { width: 18px; height: 18px; flex: none; accent-color: var(--primary); }
.pc-item input[readonly] { background: var(--surface-2); color: var(--muted); }
.pc-tag { display: inline-block; margin-inline-start: 6px; font-size: 11px; color: var(--muted); }
.pc-del { border: 0; background: none; cursor: pointer; color: var(--muted); font-size: 18px; line-height: 1; padding: 4px 6px; border-radius: 6px; flex: none; }
.pc-del:hover { background: var(--line-soft); }
.pc-col .link-btn { align-self: flex-start; }
.pc-col textarea { min-height: 56px; }
dl.pc-sum { margin: 0; display: flex; flex-direction: column; gap: 6px; }
dl.pc-sum > div { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; }
dl.pc-sum dt { color: var(--muted); }
dl.pc-sum dd { margin: 0; text-align: end; }
dl.pc-sum .net { border-top: 1px solid var(--line); padding-top: 8px; font-size: 16px; font-weight: 700; }
dl.pc-sum .net dt { color: var(--ink); }
.pc-foot { line-height: 1.6; }
@media (max-width: 1100px) { .pc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) {
  .pc-grid { grid-template-columns: 1fr; }
  .pc-meta { width: 100%; }
  .pc-meta .field { flex: 1; width: auto; }
  .pc-nav { width: 100%; justify-content: space-between; }
}
