:root {
  /* ---- 设计令牌：现代商务风（冷灰底 + 深蓝主色 + 克制点缀） ---- */
  --bg: #f4f6fa;
  --panel: #ffffff;
  --line: #e4e8f0;
  --line-soft: #edf0f6;
  --text: #1a2233;
  --text-2: #55617a;
  --text-3: #8a94a8;
  --primary: #2f54eb;
  --primary-hover: #2444c9;
  --primary-soft: #eef2ff;
  --ok: #12996b;
  --ok-soft: #e7f6f0;
  --warn: #c77a08;
  --warn-soft: #fdf4e3;
  --danger: #d4403c;
  --danger-soft: #fdeeed;
  --brand: #2f54eb;
  --brand-soft: #eef2ff;
  --radius: 10px;
  --radius-sm: 7px;
  --shadow: 0 1px 2px rgba(22, 32, 58, .04), 0 3px 12px rgba(22, 32, 58, .05);
  --shadow-md: 0 6px 24px rgba(22, 32, 58, .10);
  --shadow-lg: 0 18px 50px rgba(15, 25, 45, .18);
  --nav-bg: #131c2e;
  --nav-bg-2: #1a2438;
  --nav-text: #9aa7bd;
  --nav-text-hi: #f2f5fa;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 13.5px;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font-family: inherit; font-size: 13.5px; color: var(--text); }

.app { display: flex; min-height: 100vh; }

/* ---------------- 侧边栏（深色商务风） ---------------- */
.sidebar {
  width: 218px;
  flex: 0 0 218px;
  background: linear-gradient(180deg, var(--nav-bg) 0%, var(--nav-bg-2) 100%);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
}

.brand {
  padding: 18px 16px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, .07);
}
.brand h1 {
  margin: 0;
  font-size: 15px;
  font-weight: 650;
  letter-spacing: .3px;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 9px;
}
.brand h1::before {
  content: "";
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: linear-gradient(135deg, #4f7cff, #2f54eb);
  box-shadow: 0 2px 8px rgba(47, 84, 235, .45);
  flex: none;
}
.brand p {
  margin: 6px 0 0;
  font-size: 11px;
  color: rgba(255, 255, 255, .42);
  letter-spacing: .4px;
}

.nav { padding: 8px 10px; flex: 1; overflow-y: auto; }
.nav::-webkit-scrollbar { width: 5px; }
.nav::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .14); border-radius: 3px; }
.nav-group {
  font-size: 10.5px;
  color: rgba(255, 255, 255, .34);
  padding: 14px 10px 6px;
  letter-spacing: 1.2px;
}
.nav a {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--nav-text);
  text-decoration: none;
  font-size: 13px;
  cursor: pointer;
  user-select: none;
  margin: 1px 0;
  position: relative;
  transition: background .13s, color .13s;
}
.nav a:hover { background: rgba(255, 255, 255, .07); color: var(--nav-text-hi); }
.nav a.active {
  background: linear-gradient(90deg, rgba(79, 124, 255, .22), rgba(79, 124, 255, .10));
  color: #fff;
  font-weight: 600;
}
.nav a.active::before {
  content: "";
  position: absolute;
  left: -10px;
  top: 7px;
  bottom: 7px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: #5b85ff;
}
.nav a .ico {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  border-radius: 6px;
  background: rgba(255, 255, 255, .07);
  color: inherit;
  opacity: .92;
}
.nav a.active .ico { background: rgba(91, 133, 255, .30); }

.side-foot {
  padding: 12px 16px;
  border-top: 1px solid rgba(255, 255, 255, .07);
  font-size: 11px;
  color: rgba(255, 255, 255, .38);
  line-height: 1.8;
}
.dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #2fc47e; margin-right: 6px; box-shadow: 0 0 0 3px rgba(47, 196, 126, .16); }
.dot.off { background: #5b6577; box-shadow: none; }

/* ---------------- 主区域 ---------------- */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  height: 56px;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 22px;
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar h2 { margin: 0; font-size: 16px; font-weight: 650; letter-spacing: .2px; }
.topbar .sub { color: var(--text-3); font-size: 12px; margin-left: 10px; font-weight: 400; }
.topbar-actions { display: flex; gap: 8px; align-items: center; }

.content { padding: 18px 22px 40px; }

/* ---------------- 通用组件 ---------------- */
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card-h {
  padding: 13px 16px;
  border-bottom: 1px solid var(--line-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.card-h h3 { margin: 0; font-size: 13.5px; font-weight: 650; white-space: nowrap; flex: 0 0 auto; }
.card-h .hint {
  font-size: 11.5px; color: var(--text-3); font-weight: 400;
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.card-b { padding: 14px 16px; }

/* 概览 · 本月工程方量排行（前 15 名 方量 / 销售额） */
.ov-proj-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px 14px; margin-bottom: 6px; }
.ov-proj-item { display: flex; align-items: center; gap: 6px; font-size: 12px; padding: 3px 0;
  border-bottom: 1px dashed var(--line); min-width: 0; }
.ovp-rank { flex: 0 0 18px; color: var(--text-2); font-size: 11px; text-align: right; }
.ovp-name { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ovp-qty { flex: 0 0 auto; color: var(--text-2); font-variant-numeric: tabular-nums; }
.ovp-amt { flex: 0 0 auto; font-weight: 600; font-variant-numeric: tabular-nums; }
@media (max-width: 1200px) { .ov-proj-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 720px) { .ov-proj-list { grid-template-columns: 1fr; } }

.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.kpi {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 15px 17px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.kpi::after {
  content: "";
  position: absolute;
  left: 0; top: 14px; bottom: 14px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: #c9d4ea;
}
.kpi.accent::after { background: var(--primary); }
.kpi.ok::after { background: var(--ok); }
.kpi.warn::after { background: var(--warn); }
.kpi .lab { font-size: 12px; color: var(--text-2); display: flex; justify-content: space-between; }
.kpi .val {
  font-size: 23px;
  font-weight: 660;
  margin-top: 8px;
  letter-spacing: -.3px;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
.kpi .foot { font-size: 11.5px; color: var(--text-3); margin-top: 6px; }
.kpi.accent .val { color: var(--primary); }
.kpi.ok .val { color: var(--ok); }
.kpi.warn .val { color: var(--warn); }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
  transition: .15s;
  font-weight: 500;
}
.btn:hover { border-color: #c3ccdc; background: #f7f9fc; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(47, 84, 235, .22);
}
.btn.primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn.ghost { background: transparent; }
.btn.sm { padding: 4px 10px; font-size: 12.5px; border-radius: 6px; gap: 4px; }
.btn.danger { color: var(--danger); border-color: #f0cdcb; background: var(--panel); }
.btn.danger:hover { background: var(--danger-soft); border-color: #e8b5b2; }

input[type=text], input[type=password], input[type=number], input[type=date], select, textarea {
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  outline: none;
  transition: .15s;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(47, 84, 235, .12);
}
input::placeholder, textarea::placeholder { color: #a8b1c2; }
label.f { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--text-2); }

/* ---------------- 万能搜索框（标准组件 kwBox，2026-11-05） ----------------
   全站搜索框统一这套外观：放大镜 + 输入框 + 一键清空，提示语带「-词 排除」。 */
.kwbx {
  display: inline-flex; align-items: center; gap: 5px; min-width: 0; height: 32px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 7px;
  padding: 0 6px 0 9px; transition: border-color .15s, box-shadow .15s;
}
.kwbx:focus-within { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(47, 84, 235, .12); }
.kwbx-i { flex: 0 0 auto; font-size: 12px; opacity: .5; }
.kwbx-in {
  flex: 1 1 auto; width: 100%; min-width: 60px; height: 28px; border: 0; outline: 0;
  background: transparent; font-size: 13px; color: var(--text); font-family: inherit;
}
.kwbx-x {
  flex: 0 0 auto; width: 18px; height: 18px; line-height: 16px; text-align: center;
  border: 0; border-radius: 50%; background: transparent; color: var(--text-3);
  cursor: pointer; font-size: 14px; padding: 0; visibility: hidden;
}
.kwbx-in:not(:placeholder-shown) + .kwbx-x, .kwbx-x:focus { visibility: visible; }
.kwbx-x:hover { background: var(--line-soft); color: var(--text); }
.toolbar .f .kwbx { min-height: 32px; }
@media (max-width: 720px) {
  .toolbar .f .kwbx, .filters .kwbx { width: 100%; height: 38px; }
  .kwbx-in { height: 34px; }
}

.toolbar {
  display: flex;
  gap: 10px 12px;
  align-items: flex-end;
  flex-wrap: wrap;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line-soft);
  background: #fbfcfe;
  border-radius: var(--radius) var(--radius) 0 0;
}
.toolbar .f input, .toolbar .f select { min-height: 32px; }
/* 独立筛选区（人事 / 操作日志等不在卡片内的场景） */
.filters {
  display: flex;
  gap: 10px 12px;
  align-items: center;
  flex-wrap: wrap;
  padding: 12px 14px;
  margin-bottom: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.filters input, .filters select { min-height: 32px; }

/* ============ 列表统一规范 ============
   名称类：两行单元格（主信息 .l1 / 副信息 .l2）
   数字类：右对齐 + 等宽数字，不换行
   日期类：等宽小字，不换行
   状态类：tag 标签
   操作类：右侧链接式按钮
*/
table.tb { width: 100%; border-collapse: separate; border-spacing: 0; }
table.tb th {
  text-align: left;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-2);
  background: #f7f9fc;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 2;
  letter-spacing: .2px;
}
table.tb td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
}
table.tb tbody tr:hover > td { background: #f7faff; }
table.tb td.num, table.tb th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
table.tb td.num.mono, table.tb th.num.mono { font-family: "JetBrains Mono", Consolas, monospace; font-size: 12.5px; }
table.tb td.c, table.tb th.c { text-align: center; }
table.tb tfoot td {
  background: #f7f9fc;
  font-weight: 600;
  border-top: 1px solid var(--line);
  white-space: nowrap;
}

/* 两行单元格：行高固定整齐，超长省略 */
.tb td.tl2 { padding: 5px 12px; vertical-align: middle; }
.tb td.tl2 .l1 {
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tb td.tl2 .l2 {
  font-size: 11.5px;
  color: var(--text-3);
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tb td.tl2.num .l1, .tb td.tl2.num .l2 { text-align: right; }

/* 名称主行：客户 / 工程 / 供应商统一强调 */
.nm { font-weight: 600; color: var(--text); }

/* 日期列统一 */
td.dt, .dt {
  font-family: "JetBrains Mono", Consolas, monospace;
  font-size: 12px;
  color: var(--text-2);
  white-space: nowrap;
}

.tag {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 5px;
  font-size: 11px;
  line-height: 18px;
  white-space: nowrap;
  font-weight: 500;
}
.tag.g { background: var(--ok-soft); color: var(--ok); }
.tag.b { background: var(--primary-soft); color: var(--primary); }
.tag.y { background: var(--warn-soft); color: var(--warn); }
.tag.r { background: var(--danger-soft); color: var(--danger); }
.tag.n { background: #eef1f6; color: var(--text-3); }
.tag.i { background: #e8f1ff; color: #2b62d9; }
.tag.p { background: #f2ecff; color: #6d46c5; }

.muted { color: var(--text-3); }
.small { font-size: 11.5px; }
.mono { font-family: "JetBrains Mono", Consolas, monospace; font-size: 12px; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }

.empty {
  padding: 46px 20px;
  text-align: center;
  color: var(--text-3);
  font-size: 13px;
}
.empty b { display: block; color: var(--text-2); margin-bottom: 6px; font-size: 13.5px; }

.banner {
  display: block;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  line-height: 1.75;
  margin-bottom: 14px;
  border: 1px solid transparent;
}
.banner > div { display: block; }
.banner.info { background: var(--primary-soft); color: #2b4bab; border-color: #d9e3ff; }
.banner.warn { background: var(--warn-soft); color: #8a5600; border-color: #f2e3c2; }
.banner.err { background: var(--danger-soft); color: #a02b2b; border-color: #f3d2cf; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid3 { display: grid; grid-template-columns: 2fr 1fr; gap: 14px; }

.bars { display: flex; flex-direction: column; gap: 9px; }
.bar-row { display: grid; grid-template-columns: 92px 1fr 74px; gap: 10px; align-items: center; font-size: 12.5px; }
.bar-track { height: 7px; background: #e9edf5; border-radius: 4px; overflow: hidden; }
.bar-fill { height: 100%; background: linear-gradient(90deg, #5b85ff, #2f54eb); border-radius: 4px; }

/* 模态框 */
.mask {
  position: fixed;
  inset: 0;
  background: rgba(16, 24, 42, .45);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 48px 20px;
  z-index: 100;
  overflow-y: auto;
}
.modal {
  background: #fff;
  border-radius: 14px;
  width: 640px;
  max-width: 100%;
  box-shadow: var(--shadow-lg);
  animation: pop .16s ease-out;
}
.modal.wide { width: 900px; }
@keyframes pop { from { transform: translateY(-8px) scale(.99); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-h {
  padding: 15px 18px;
  border-bottom: 1px solid var(--line-soft);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.modal-h h3 { margin: 0; font-size: 14.5px; font-weight: 650; }
.modal-b { padding: 18px; max-height: 66vh; overflow-y: auto; }
.modal-f {
  padding: 12px 18px;
  border-top: 1px solid var(--line-soft);
  display: flex;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: wrap;
  row-gap: 8px;
  gap: 9px;
  background: #fafbfd;
  border-radius: 0 0 14px 14px;
}
.x { cursor: pointer; color: var(--text-3); font-size: 19px; line-height: 1; background: none; border: 0; }
.x:hover { color: var(--text); }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.form-grid .full { grid-column: 1 / -1; }
/* 防止单元格内的下拉（如长工程名下拉）撑爆列宽，导致两列比例失衡 / 出现横向滚动 */
.form-grid > .f { min-width: 0; }
.form-grid > .f > input,
.form-grid > .f > select,
.form-grid > .f > .f-range { width: 100%; min-width: 0; box-sizing: border-box; }

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  background: #1a2233;
  color: #fff;
  padding: 11px 16px;
  border-radius: 9px;
  font-size: 13px;
  box-shadow: 0 10px 30px rgba(15, 25, 45, .28);
  z-index: 200;
  animation: pop .18s;
}
.toast.ok { background: #0e7c54; }
.toast.err { background: #a92e2e; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.tabs button {
  padding: 9px 14px;
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  color: var(--text-2);
  cursor: pointer;
  margin-bottom: -1px;
  white-space: nowrap;      /* 窄屏别把「全部 / 草稿」压成竖排 */
  flex: 0 0 auto;
}
.tabs button.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
/* 卡片内的「勾选框 + 说明文字」一行：label.f 默认是纵向（说明在上、输入框在下），
   勾选项必须显式改回横向，否则方框会跑到文字上面去（2026-11-02 修正） */
.ck-row { display: flex; flex-direction: row; align-items: flex-start; gap: 8px;
          font-weight: normal; font-size: 13px; color: var(--text); cursor: pointer; }
.ck-row > input[type="checkbox"] { width: auto; margin: 2px 0 0; flex: none; }
.ck-row > span { min-width: 0; }
.spacer { flex: 1; }

.progress { height: 5px; background: #e9edf4; border-radius: 3px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--primary); width: 0; transition: width .3s; }

@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .grid2, .grid3 { grid-template-columns: 1fr; }
}

/* 可搜索下拉（工程 / 客户选择） */
input.combo {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5L6 8l3.5-3.5' fill='none' stroke='%238a94a8' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 9px center;
  padding-right: 26px;
}
.combo-pop {
  position: fixed;
  z-index: 150;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 9px;
  box-shadow: var(--shadow-md);
  overflow-y: auto;
  padding: 4px;
  font-size: 13px;
}
.cp-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 9px;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
}
.cp-item .cp-main { overflow: hidden; text-overflow: ellipsis; }
.cp-sub { color: var(--text-3); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; }
.cp-item:hover, .cp-item.on { background: var(--primary-soft); }
.cp-item.on .cp-main { color: var(--primary); font-weight: 600; }
.cp-item mark { background: #ffe9a8; color: inherit; border-radius: 2px; padding: 0 1px; }
.cp-empty { color: var(--text-2); }
.cp-none, .cp-more { padding: 8px 10px; color: var(--text-3); font-size: 12px; }
.cp-more { border-top: 1px solid var(--line-soft); margin-top: 3px; }

/* ---------------- 销售价格表 ---------------- */
.ps-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 14px; }
.ps-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); display: flex; flex-direction: column;
}
.ps-card.def { border-color: #b9ccf8; box-shadow: 0 0 0 1px #dfe8ff, var(--shadow); }
.ps-card-h {
  padding: 13px 14px; border-bottom: 1px solid var(--line-soft);
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.ps-card-h b { font-size: 13.5px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ps-badges { display: flex; gap: 5px; flex: 0 0 auto; }
.ps-card-b { padding: 11px 14px; display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; flex: 1; }
.ps-line { display: flex; gap: 10px; align-items: baseline; }
.ps-line > span:first-child { color: var(--text-3); width: 74px; flex: 0 0 74px; font-size: 12px; }
.ps-line > b, .ps-line > span:last-child { color: var(--text); word-break: break-all; }
.ps-card-f {
  padding: 10px 14px; border-top: 1px solid var(--line-soft);
  display: flex; gap: 6px; flex-wrap: wrap; background: #fafbfd;
  border-radius: 0 0 var(--radius) var(--radius);
}

.ps-groups { display: flex; flex-direction: column; gap: 14px; }
.ps-g { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.ps-g.dim { opacity: .42; }
.ps-g-h {
  padding: 10px 14px; border-bottom: 1px solid var(--line-soft);
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.ps-g-h h4 { margin: 0; font-size: 13px; font-weight: 650; }
.ps-g-h .hint { font-size: 11.5px; color: var(--text-3); font-weight: 400; }
.ps-tools { margin-left: auto; display: flex; gap: 6px; }
.ps-g-b { padding: 10px 14px 12px; }
/* --cw / --lw 由前端按本组最长名称算出（见 app.js psCellStyle）：格子贴着内容、组内输入框对齐 */
.ps-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(var(--cw, 248px), 1fr)); gap: 6px 12px; }
.ps-sub { font-size: 11.5px; color: var(--text-3); margin: 12px 0 7px; }
.ps-sub:first-child { margin-top: 0; }
/* 产品名（尤其水泥这类长名）必须完整显示，宁可换行也不截断 */
.pi { display: flex; align-items: flex-start; gap: 5px; min-width: 0; padding: 1px 0; }
.pi-l {
  flex: 0 0 auto; width: var(--lw, auto); min-width: 0; font-size: 12px; color: var(--text-2);
  white-space: normal; overflow-wrap: anywhere; word-break: break-word;
  line-height: 1.35;
}
.pi-i {
  width: 70px; flex: 0 0 70px; padding: 5px 7px !important; text-align: right;
  font-variant-numeric: tabular-nums; font-size: 12.5px;
  border-radius: 6px !important; margin-top: 1px;
}
.pi-u { flex: 0 0 42px; font-size: 10.5px; color: var(--text-3); font-style: normal; line-height: 1.35; padding-top: 4px; }

/* ============ 价格表浏览模式（只读） ============ */
.ro input[readonly], .ro select:disabled { background: var(--bg) !important; color: var(--text-2); cursor: not-allowed; }
.ro input.combo { pointer-events: none; background: var(--bg) !important; color: var(--text-2); }
.ro .pi-i[readonly] { border-color: transparent; box-shadow: none; }

/* ============ 信息价（按月录入） ============ */
.ip-grp { margin-bottom: 4px; }
.ip-grp-h { font-size: 11.5px; color: var(--text-3); margin: 12px 0 7px; }
.ip-grp:first-child .ip-grp-h { margin-top: 0; }
.ip-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 7px 16px; }
.ip-i {
  width: 86px; flex: 0 0 86px; padding: 5px 7px !important; text-align: right;
  font-variant-numeric: tabular-nums; font-size: 12.5px; border-radius: 6px !important;
}
.ip-i.ip-lock { background: #f1f3f8; color: var(--text-2); cursor: default; border-color: var(--line) !important; }
.ip-i.ip-lock:focus { box-shadow: none; border-color: var(--line) !important; }
#ip-note[readonly] { background: #f1f3f8; color: var(--text-2); cursor: default; }

/* 价格表：计价方式（固定价 / 信息价下浮） */
.mode-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 7px 0; }
.mode-row + .mode-row { border-top: 1px dashed var(--line-soft); }
.mode-lab { flex: 0 0 56px; font-size: 12.5px; color: var(--text-2); font-weight: 600; }
.mode-row select { min-width: 132px; font-size: 12.5px; padding: 6px 9px; }
.mode-row input[type=number] { width: 86px; padding: 6px 8px; text-align: right; font-size: 12.5px; }
.mode-row .mode-off { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--text-2); }
/* 信息价联动：取小数点后几位（0~2） */
.mode-row .mode-dec { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--text-2); }
.mode-row .mode-dec select { min-width: 76px; width: 76px; padding: 6px 4px; }
.mode-row .hint { font-size: 11.5px; color: var(--text-3); }
.mode-row.disabled { opacity: .5; }
.pi-lock .pi-ro {
  width: 76px; flex: 0 0 76px; text-align: right; font-size: 12.5px; font-variant-numeric: tabular-nums;
  color: var(--primary); font-weight: 600; padding: 4px 7px; background: var(--primary-soft);
  border-radius: 6px;
}
.pi-lock .pi-src { flex: 0 0 auto; font-size: 10px; color: var(--warn); white-space: nowrap; }
.pi-lock .pi-u { flex: 0 0 34px; }
.ip-hint-warn { color: var(--warn); font-weight: 600; }

.ps-modewrap { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); }
.ps-modehead { display: flex; align-items: baseline; gap: 10px; margin-bottom: 2px; }
.ps-modehead b { font-size: 12.5px; }
.ps-modehead .hint { font-size: 11.5px; color: var(--text-3); }

/* 结算单：信息价来源标记 */
.est-mark { color: var(--warn); font-size: 9px; font-weight: 700; margin-left: 1px; vertical-align: super; }
.info-mark { color: var(--primary); font-size: 9px; font-weight: 700; margin-left: 1px; vertical-align: super; }
.ps-kinhint { margin-top: 10px; font-size: 12px; color: var(--text-2); line-height: 1.7; }
.ps-vrow {
  margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line);
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.ps-vrow select { min-width: 320px; font-size: 12.5px; }
.ps-savebar {
  position: sticky; bottom: 0; margin-top: 16px; padding: 12px 16px;
  background: rgba(255, 255, 255, .96); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: 0 -4px 16px rgba(20, 30, 55, .07);
  display: flex; justify-content: flex-end; align-items: center; gap: 14px;
  backdrop-filter: blur(6px); z-index: 5;
}
.ps-out-h {
  display: flex; align-items: center; gap: 10px; font-size: 12.5px;
  padding: 10px 12px; background: #f7f9fc; border: 1px solid var(--line-soft);
  border-radius: 8px 8px 0 0; border-bottom: none;
}
.ps-out-h span { color: var(--text-3); }
.ps-total {
  margin-top: 10px; padding: 11px 14px; background: var(--primary-soft);
  border-radius: 8px; font-size: 13px; color: #2b4bab;
}
.ps-total b { font-size: 16px; font-variant-numeric: tabular-nums; }
.num.up { color: var(--danger); }
.num.down { color: var(--ok); }

/* ============ 结算单（纸质表格版式） ============ */
.modal.xwide { width: min(1660px, 93vw); }
.modal.xwide .modal-b { max-height: 78vh; }

.f-range { display: flex; align-items: center; gap: 6px; }
.f-range input[type=date] { padding: 7px 8px; }

.sdoc-meta { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.sdoc {
  background: #fff; border: 1px solid #d8dde8; border-radius: 8px;
  padding: 18px 20px 20px; color: #111;
  font-family: "FangSong", "仿宋", "STFangsong", "SimSun", serif;
  font-size: 11pt;
}
/* 标题 / 工程单位 / 工程名称 / 期间说明：字号与粗细照纸质样板 */
.sdoc h1 { text-align: center; font-size: 16pt; font-weight: 700; letter-spacing: 2px; margin: 2px 0 12px; }
.sdoc-row { font-size: 11pt; margin: 3px 0; }
.sdoc .sdoc-b { font-weight: 700; }
.sdoc-note { font-size: 11pt; margin: 8px 0 6px; line-height: 1.7; }

.sdoc-tb { width: 100%; border-collapse: collapse; font-size: 11pt; table-layout: fixed; }
.sdoc-tb th, .sdoc-tb td { border: 1px solid #000; padding: 2px 4px; vertical-align: middle; line-height: 1.35; overflow-wrap: anywhere; }
.sdoc-tb th { background: #fff; font-weight: 700; text-align: center; padding: 4px 3px; }
/* 列宽按纸质样板（A6.4 / B11.2 / C18.9 / D11 / E13 / F8.6 / G9.5 / H9.2 / I9.3 / J7.5 / K13.6 / L9.2）*/
/* 列宽由表格内 <colgroup> 指定（与样板一致，见 app.js 的 COLS），三张表共用同一套，
   明细 / 本次结算 / 累计信息才能严格对齐 */
.sdoc-tb td.c { text-align: center; }
.sdoc-tb td.r { text-align: right; font-variant-numeric: tabular-nums; }
.sdoc-tb td.sl-part { white-space: normal; }
.sdoc-tb tbody tr:nth-child(even) { background: #fff; }
.sdoc-tb tfoot td { background: #fff; font-weight: 700; }
/* 本次结算金额 + 大写：无边框，按列对齐（样板 A14:C14 / D14:E14 / F14:G14 / H14:L14）*/
.sdoc-sum-tb { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 11pt; font-weight: 700; }
.sdoc-sum-tb td { padding: 5px 4px; line-height: 1.4; border: 1px solid #000; }
.sdoc-sum-tb td.c { text-align: center; }
.sdoc-sum-tb td.v { font-variant-numeric: tabular-nums; }
.sdoc-sum-tb td.l { text-align: left; letter-spacing: 1px; padding-left: 6px; }
.sdoc-tb input.sl-i {
  width: 100%; min-width: 0; border: 1px solid #d5dbe7; border-radius: 4px;
  padding: 3px 5px; text-align: right; font-family: inherit; font-size: 12px; background: #fff;
}
.sdoc-tb input.sl-note {
  width: 100%; min-width: 0; border: 1px solid #d5dbe7; border-radius: 4px; padding: 3px 5px;
  font-family: inherit; font-size: 12px; background: #fff;
}
/* 「插入特殊情况」行：名称 + 金额手填，备注旁带删除按钮 */
.sdoc-tb input.sl-partname {
  width: 100%; min-width: 0; border: 1px solid #d5dbe7; border-radius: 4px; padding: 3px 5px;
  font-family: inherit; font-size: 12px; background: #fffdf5;
}
.sdoc-tb input.sl-fee {
  width: 100%; min-width: 0; border: 1px solid #d5dbe7; border-radius: 4px;
  padding: 3px 5px; text-align: right; font-family: inherit; font-size: 12px;
  background: #fffdf5; font-weight: 600;
}
.sdoc-tb .sl-notewrap { display: flex; align-items: center; gap: 4px; }
.sdoc-tb .sl-notewrap .sl-note { flex: 1; }
.sdoc-tb .sl-del {
  flex: 0 0 auto; width: 20px; height: 20px; line-height: 1; border-radius: 4px;
  border: 1px solid #f0cfcb; background: #fdf3f2; color: #c0392b; cursor: pointer; font-size: 13px;
}
.sdoc-tb .sl-del:hover { background: #f9e2df; }
.sdoc-tb tr[data-kind="fee"] td { background: #fffdf5; }
.sdoc-tb input:focus { outline: none; border-color: #4f7ce8; box-shadow: 0 0 0 2px rgba(79, 124, 232, .15); }

/* 「插入特殊情况」行整行可编辑（调虚量时像正常供货行一样填方量 / 单价）。
   必须显式 width:100%，否则浏览器给 number 输入框的默认宽度会溢出一格、把相邻列压住。 */
.sdoc-tb tr[data-kind="fee"] input {
  width: 100%; min-width: 0; border: 1px solid #d5dbe7; border-radius: 4px;
  padding: 3px 5px; font-family: inherit; font-size: 12px; background: #fffdf5;
}
.sdoc-tb tr[data-kind="fee"] input.sl-qty,
.sdoc-tb tr[data-kind="fee"] input.sl-price,
.sdoc-tb tr[data-kind="fee"] input.sl-trucks,
.sdoc-tb tr[data-kind="fee"] input.sl-empty,
.sdoc-tb tr[data-kind="fee"] input.sl-shift,
.sdoc-tb tr[data-kind="fee"] input.sl-fee { text-align: right; }
.sdoc-tb tr[data-kind="fee"] input.sl-date { font-size: 11.5px; padding: 3px 2px; }

/* 结算单「特殊情况说明」：手工插入行的必填说明，只在系统内留痕，不导出 */
.sp-note {
  margin: 10px 0 0; padding: 10px 14px; border: 1px solid var(--line);
  border-radius: var(--radius); background: #f7f9fc;
}
.sp-note.sp-note-warn { border-color: #f0c36d; background: #fffdf3; }
.sp-note-h { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; font-size: 13px; }
.sp-note-h .hint { color: var(--text-3); font-size: 12px; }
.sp-note textarea {
  width: 100%; box-sizing: border-box; min-height: 46px; resize: vertical;
  border: 1px solid #d5dbe7; border-radius: 6px; padding: 7px 9px;
  font-family: inherit; font-size: 12.5px; line-height: 1.6; background: #fff;
}
.sp-note textarea:focus { outline: none; border-color: #4f7ce8; box-shadow: 0 0 0 2px rgba(79, 124, 232, .15); }
.sp-note textarea[readonly] { background: #f3f5f9; color: var(--text-2); }
.sp-note textarea.sp-need { border-color: #d9534f; box-shadow: 0 0 0 2px rgba(217, 83, 79, .18); background: #fffafa; }

/* 列表结算金额旁的红色「特」标：悬浮看增减方量 / 金额与说明 */
.sp-flag {
  display: inline-block; margin-left: 4px; padding: 0 4px; height: 15px; line-height: 15px;
  font-size: 10.5px; font-weight: 700; color: #fff; background: #d9534f;
  border-radius: 3px; cursor: help; vertical-align: 1px;
}
.sp-flag-lb { display: inline-flex; align-items: center; gap: 4px; }
.sp-flag-lb .sp-flag { margin-left: 0; }

.sdoc-sign { display: flex; justify-content: space-between; gap: 20px; font-size: 11pt; margin-top: 16px; }
.sdoc-sign > div { flex: 1; }
/* 累计账务信息：一行标题 + 两行「标签 / 数值」，与明细表按列对齐（样板 A15:L15 起）*/
/* 累计信息区（2026-11-06 用户要求：边框全加、累计×××文字单元格居中）*/
.sdoc-ar { margin-top: 2px; }
.sdoc-ar-h { font-size: 12pt; padding: 5px 2px; }
.sdoc-ar-tb { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 12pt; }
.sdoc-ar-tb td { padding: 3px 4px; font-weight: 400; border: 1px solid #000; }
.sdoc-ar-tb td.l { text-align: left; }
.sdoc-ar-tb td.c { text-align: center; font-variant-numeric: tabular-nums; }

/* ---------- 结算单「镜子」弹窗（单价表 / 销售合同，原地看不跳页） ---------- */
.mrr-head { padding: 2px 0 10px; font-size: 13px; line-height: 1.9; }
.mrr-title {
  margin: 12px 0 6px; font-size: 12.5px; font-weight: 600; color: var(--text-2);
  border-left: 3px solid var(--primary); padding-left: 8px;
}
.mrr-wrap { max-height: 46vh; overflow: auto; border: 1px solid var(--line-soft); border-radius: 6px; padding: 8px; }
.mrr-grp { margin-bottom: 10px; }
.mrr-grp-h { font-size: 12px; font-weight: 600; color: var(--text-2); margin-bottom: 5px; }
.mrr-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 4px 10px; }
.mrr-item { display: flex; align-items: baseline; gap: 6px; font-size: 12px; padding: 2px 4px; border-radius: 4px; }
.mrr-item:nth-child(odd) { background: #f7f9fc; }
.mrr-lb { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mrr-vl { font-family: "JetBrains Mono", Consolas, monospace; font-weight: 600; }
.mrr-vl.miss { color: #c0392b; font-weight: 500; }
.mrr-un { color: var(--text-3); font-size: 11px; }
.mrr-vers th, .mrr-vers td { padding: 5px 8px; }
.mrr-vers td.small, .mrr-vers th { font-size: 11.5px; }
.mrr-logs { margin-top: 10px; font-size: 12px; }
.mrr-logs summary { cursor: pointer; color: var(--text-2); }
.mrr-kv th { width: 12%; text-align: left; font-weight: 500; color: var(--text-3); font-size: 11.5px; padding: 5px 8px; }
.mrr-kv td { padding: 5px 8px; font-size: 12.5px; }
.sdoc-bank {
  margin-top: 16px; font-size: 10pt; line-height: 1.85; color: #222;
}
.sdoc-note2 { margin-top: 10px; font-size: 9pt; color: #222; line-height: 1.7; }

/* 附件 */
.sdoc-side { margin-top: 8px; }
.files { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.fcard {
  display: flex; align-items: center; gap: 10px; width: 274px;
  border: 1px solid var(--line-soft); border-radius: 9px; padding: 8px 10px; background: #fafbfd;
}
.fthumb {
  width: 46px; height: 46px; object-fit: cover; border-radius: 6px; cursor: zoom-in;
  border: 1px solid var(--line-soft); background: #fff; flex: none;
}
.ficon {
  width: 46px; height: 46px; border-radius: 6px; flex: none;
  background: var(--primary-soft); color: var(--primary);
  display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700;
}
.fmeta { flex: 1; min-width: 0; }
.fname { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fops { display: flex; flex-direction: column; gap: 4px; }

.imgview {
  position: fixed; inset: 0; z-index: 300; padding: 32px; cursor: zoom-out;
  background: rgba(10, 14, 22, .82);
  display: flex; align-items: center; justify-content: center;
}
.imgview-in { position: relative; background: #fff; border-radius: 10px; padding: 10px; box-shadow: 0 20px 60px rgba(0, 0, 0, .5); }
.imgview-in img { display: block; max-width: 92vw; max-height: 80vh; margin: 0 auto; }
.imgview-t { text-align: center; font-size: 12.5px; color: #333; padding-top: 8px; }
/* 同一附件区多张图片：预览时左右箭头切换（也支持 ← → 键） */
.imgview-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 38px; height: 62px; border: 0; border-radius: 9px; cursor: pointer;
  background: rgba(18, 24, 38, .45); color: #fff; font-size: 30px; line-height: 1;
  display: flex; align-items: center; justify-content: center; padding: 0 0 4px;
  transition: background .12s ease;
}
.imgview-nav:hover { background: rgba(18, 24, 38, .78); }
.imgview-nav.prev { left: 14px; }
.imgview-nav.next { right: 14px; }
@media (max-width: 920px) {
  .imgview { padding: 14px; }
  .imgview-nav.prev { left: 6px; }
  .imgview-nav.next { right: 6px; }
  .imgview-nav { width: 32px; height: 52px; font-size: 24px; }
}

.tab-n {
  display: inline-block; margin-left: 4px; padding: 0 6px; border-radius: 8px;
  background: #e9edf5; color: #5a647a; font-size: 11px;
}

/* ============ 销售统计（核对） ============ */
.nav-badge {
  margin-left: auto; min-width: 18px; height: 17px; padding: 0 5px; border-radius: 9px;
  background: rgba(255, 193, 94, .18); color: #ffc15e; font-size: 11px; font-weight: 650;
  display: none; align-items: center; justify-content: center;
}
.nav-badge:not(:empty) { display: inline-flex; }
/* 待办角标：无待办也显示 0（灰色），有待办用警示色区分 */
.nav-badge.zero { background: rgba(138, 148, 168, .16); color: #9aa3b5; }

.ps-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 16px; border-bottom: 1px solid var(--line-soft); background: #fff;
}
.ps-pick { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-2); }
.ps-vline { width: 1px; height: 16px; background: var(--line); }
.ps-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 9px 16px 13px; font-size: 11.5px; color: var(--text-3); line-height: 1.6;
}
.ps-foot-r { display: flex; align-items: center; gap: 6px; }
.ps-foot-r .btn { padding: 3px 9px; font-size: 12px; }
.ps-foot-r .btn:disabled { opacity: .45; cursor: default; }
.ps-pageno { font-size: 12px; color: var(--text-2); padding: 0 2px; }
.ps-size {
  height: 26px; padding: 0 6px; font-size: 12px; border: 1px solid var(--line);
  border-radius: 6px; background: #fff; color: var(--text-2);
}

.ps-body { max-height: calc(100vh - 358px); overflow: auto; }

/* 筛选结果汇总条（总条数 / 总方量 / 总金额 / 已核对 · 未核对，全部按全量筛选结果算） */
.ps-sum {
  padding: 7px 16px 8px; font-size: 12px; color: var(--text-2); line-height: 1.9;
  background: #fbfcff; border-bottom: 1px solid var(--line-soft);
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.ps-sum b { color: var(--text-1); font-weight: 650; }
.ps-sum .tag { margin: 0 1px; }
.ps-miss {
  color: #d92d20; background: rgba(217, 45, 32, .07); border-radius: 4px;
  padding: 0 5px; font-size: 11px;
}

/* 「映」：做过映射（归口名 ≠ ERP 原名），红色小标签，仅系统内提示、导出不带 */
.ps-map {
  display: inline-block; margin-left: 4px; padding: 0 3px; border-radius: 3px;
  background: #e8362d; color: #fff; font-size: 10.5px; line-height: 15px;
  font-family: inherit; cursor: help; vertical-align: 1px;
}

/* 作废行：整行灰字 + 删除线（需求：作废单在列表里全部显示为灰色划删除线） */
.ps-tb tr.ps-void td,
.ps-tb tr.ps-void td .l1,
.ps-tb tr.ps-void td .l2 { color: #9aa3b5 !important; text-decoration: line-through; }
.ps-tb tr.ps-void td.ps-ops,
.ps-tb tr.ps-void td.ps-ops .lk,
.ps-tb tr.ps-void td.ps-st,
.ps-tb tr.ps-void td.ps-st .tag { text-decoration: none; }
.ps-tb tr.ps-void input.combo { color: #9aa3b5; }
.ps-voidtag { background: rgba(154, 163, 181, .16); color: #6b7280; }

/* 发货金额小字（发货方量下方）：缺价时红色 */
.ps-amt { font-size: 11px; color: #9aa3b5; white-space: nowrap; }
.ps-amt.miss { color: #d92d20; font-weight: 600; }

/* 车号 / 司机下拉：铺满单元格，不撑宽表格 */
.ps-tb td input.combo {
  width: 100%; min-width: 0; box-sizing: border-box; font-size: 11.5px;
  padding: 2px 4px; height: 24px; line-height: 20px; text-overflow: ellipsis;
}
/* 车号 / 司机格去掉多余内边距，把宽度全部给输入框 */
table.tb.ps-tb td.ps-cbt { padding: 3px 3px; }

/* 详情页作废横幅 */
.ps-voidbar {
  margin-bottom: 10px; padding: 8px 10px; border-radius: 8px; font-size: 12px; line-height: 1.7;
  background: rgba(217, 45, 32, .06); color: #a5251d; border: 1px solid rgba(217, 45, 32, .18);
}

/* 手工录入：录入要求提示（显著位置） */
.ps-req {
  margin-bottom: 12px; padding: 10px 12px 10px 0; border-radius: 10px;
  background: #fffaf0; border: 1px solid #f3d9a6;
}
.ps-req-h {
  font-size: 13px; font-weight: 650; color: #a8611a; margin: 0 0 4px 12px;
}
.ps-req ol { margin: 0; padding-left: 28px; font-size: 12px; line-height: 1.85; color: #6b4a20; }
.ps-req ol li { margin-bottom: 2px; }
.ps-req b { color: #a8611a; }
/* 录入框做大：输入框加高、两列更宽松 */
.ps-form-lg .f input, .ps-form-lg .f select { height: 34px; font-size: 13px; }
.ps-form-lg .f input.combo { height: 34px; }
.ps-form-lg { gap: 12px 14px; }

/* 固定列宽（可拖动） */
.ps-tb.ps-fixed { table-layout: fixed; }
.ps-tb.ps-fixed th { position: relative; }
.ps-tb .ps-ell, .ps-tb td.ps-ell { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ps-tb .l1 { line-height: 1.35; }
.ps-tb .l2 { font-size: 11.5px; color: var(--text-3); line-height: 1.35; }
.ps-tb td.ps-2l { font-size: 12px; line-height: 1.3; }
.ps-tb td.ps-2l .l1, .ps-tb td.ps-2l .l2 {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ps-tb td.ps-2l .l2 { font-size: 11px; }

/* 表头列宽拖拽手柄 */
.colrz {
  position: absolute; top: 0; right: 0; width: 7px; height: 100%;
  cursor: col-resize; z-index: 3;
}
.colrz:hover { background: rgba(47, 84, 235, .22); }
body.ps-colrz-on { cursor: col-resize; }
body.ps-colrz-on * { user-select: none !important; }

/* 全屏查看 */
body.ps-full .sidebar { display: none; }
body.ps-full .content { padding: 10px 12px 8px; }
body.ps-full .ps-body { max-height: calc(100vh - 304px); }
.main:fullscreen { background: var(--bg); overflow: auto; }
.main:fullscreen .content { padding: 10px 12px 8px; }
.main:fullscreen .ps-body { max-height: calc(100vh - 304px); }

/* 采购统计全屏 */
body.ps2-full .sidebar { display: none; }
body.ps2-full .content { padding: 10px 12px 8px; }
body.ps2-full .ps2-body { max-height: calc(100vh - 268px); }
.main:fullscreen .ps2-body { max-height: calc(100vh - 268px); }
.ps2-body { max-height: calc(100vh - 322px); }
.ps2-tb td { padding: 5px 8px; vertical-align: top; }
.ps2-tb .ps2-i { max-width: 100%; width: 100%; }

/* 固定列宽：内容再长也不把表格撑宽 */
.sa-tb.sa-fixed, .ps2-tb.ps2-fixed { table-layout: fixed; width: 100%; }
.sa-tb.sa-fixed td, .ps2-tb.ps2-fixed td { overflow: hidden; }
.sa-tb.sa-fixed .ps-ell, .ps2-tb.ps2-fixed .ps-ell {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* 注意：table.tb td 的 padding 优先级更高，这里必须用 table.tb.ps-tb 才能覆盖 */
table.tb.ps-tb td { padding: 5px 6px; }
table.tb.ps-tb th { padding: 7px 6px; }
/* 操作列压缩：确认/明细/改名等链接排得更紧，列宽收窄 */
table.tb.ps-tb td.ps-ops { padding: 5px 2px; }
table.tb.ps-tb td.ps-ops .op-btns { gap: 1px; }
table.tb.ps-tb td.ps-ops .op-btns .lk { padding: 2px 2px; font-size: 11px; white-space: nowrap; }
/* 采购统计同样只留一个「确认 / 取消确认」，操作列压到 66px */
table.tb.ps2-tb td.ps2-ops { padding: 5px 4px; }
table.tb.ps2-tb td.ps2-ops .op-btns { gap: 1px; justify-content: flex-end; }
table.tb.ps2-tb td.ps2-ops .op-btns .lk { padding: 2px 1px; font-size: 11px; }

/* 采购统计：列多，总宽会超出窗口。把「状态 + 操作」两列钉在右边，
   横向滚动看其他列时「确认」按钮始终在眼前（位置由 ps2PinCols() 打标记）。 */
.ps2-tb.ps2-fixed .ps2-pin1,
.ps2-tb.ps2-fixed .ps2-pin2 { position: sticky; z-index: 4; background: #fff; }
.ps2-tb.ps2-fixed .ps2-pin2 { right: 66px; }
.ps2-tb.ps2-fixed .ps2-pin1 { right: 0; box-shadow: -7px 0 8px -7px rgba(20, 30, 55, .16); }
/* 表头整体也吸顶；z-index 要高过表体的固定列，否则滚动时会被行盖住 */
.ps2-tb thead th { position: sticky; top: 0; z-index: 5; }
.ps2-tb.ps2-fixed thead .ps2-pin1,
.ps2-tb.ps2-fixed thead .ps2-pin2 { z-index: 7; background: #f7f9fc; }
.ps2-tb.ps2-fixed tbody tr.ps-ok > td.ps2-pin1,
.ps2-tb.ps2-fixed tbody tr.ps-ok > td.ps2-pin2 { background: #f6fcf9; }
.ps2-tb.ps2-fixed tbody tr:hover > td.ps2-pin1,
.ps2-tb.ps2-fixed tbody tr:hover > td.ps2-pin2 { background: #f7faff; }
.ps2-tb.ps2-fixed tbody tr.ps-hit > td.ps2-pin1,
.ps2-tb.ps2-fixed tbody tr.ps-hit > td.ps2-pin2 { background: var(--primary-soft); }
/* 列宽压紧后，左右内边距也收一点，给内容多留 4px */
table.tb.ps2-tb td, table.tb.ps2-tb th { padding-left: 6px; padding-right: 6px; }

/* 右侧两列固定（倒数第二=状态、最后=操作）：列可隐藏/重排，用渲染时打的 pin 类定位。
   选择器带 .ps-fixed 压过上面 th { position:relative }（拖拽手柄需要），否则 sticky 不生效 */
.ps-tb.ps-fixed .ps-pin2, .ps-tb.ps-fixed .ps-pin1 { position: sticky; z-index: 4; background: #fff; }
.ps-tb.ps-fixed .ps-pin2 { right: var(--ps-ops-w, 150px); }
.ps-tb.ps-fixed .ps-pin1 { right: 0; box-shadow: -7px 0 8px -7px rgba(20, 30, 55, .16); }
.ps-tb thead .ps-pin2, .ps-tb thead .ps-pin1 { z-index: 6; background: #f7f9fc; }
.ps-tb tbody tr:hover .ps-pin2, .ps-tb tbody tr:hover .ps-pin1 { background: #f7faff; }
.ps-tb tbody tr.ps-un .ps-pin2, .ps-tb tbody tr.ps-un .ps-pin1 { background: #fffdf6; }
.ps-tb tbody tr.ps-un:hover .ps-pin2, .ps-tb tbody tr.ps-un:hover .ps-pin1 { background: #fff8e9; }
.ps-tb tr.ps-hit .ps-pin2, .ps-tb tr.ps-hit .ps-pin1 { background: var(--primary-soft) !important; }
.ps-tb tr.ps-flash .ps-pin2, .ps-tb tr.ps-flash .ps-pin1 { background: var(--ok-soft) !important; }
.ps-tb tr.ps-un td { background: #fffdf6; }
.ps-tb tr.ps-un:hover td { background: #fff8e9; }
.ps-tb tr.ps-hit td { background: var(--primary-soft) !important; }
.ps-tb tr.ps-flash td { background: var(--ok-soft) !important; }
/* 采购统计：确认后跳到下一条时的高亮（无固定列，直接染整行） */
.ps2-tb tr.ps-hit td { background: var(--primary-soft) !important; }

.ps-i {
  width: 100%; min-width: 0; padding: 4px 6px !important; text-align: right; font-size: 12.5px;
  border-radius: 6px !important; font-variant-numeric: tabular-nums;
}
.ps-i.edit { border-color: #e0a336 !important; background: #fff8ec; font-weight: 600; }
.ps-n {
  width: 100%; min-width: 0; padding: 4px 7px !important;
  font-size: 12px; border-radius: 6px !important;
}
.un-mark { color: var(--warn); font-size: 9px; font-weight: 700; margin-left: 1px; vertical-align: super; }
.sdoc-tb td.un-chk { background: #fff8ec; }

/* ============ 销售结算列表 ============ */
#settle-list { overflow: auto; max-height: calc(100vh - 300px); }
table.tb.stl-tb { table-layout: fixed; min-width: 860px; }
table.tb.stl-tb th { padding: 8px; }
table.tb.stl-tb td { padding: 7px 10px; font-size: 12.5px; }
.stl-tb th.c, .stl-tb td.c { text-align: center; }
.stl-tb .stl-no { font-weight: 600; letter-spacing: -.3px; }
.stl-tb .stl-dt { margin-top: 1px; font-size: 11px; }
.stl-tb .stl-cli div { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stl-tb .stl-c1 { font-size: 13px; font-weight: 600; }
.stl-tb .stl-c2 { margin-top: 1px; font-size: 11.5px; }
.stl-tb .stl-amt { font-weight: 650; }
.stl-tb .stl-pay div { font-size: 11.5px; line-height: 1.5; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; }
/* 金额过长时宁可省略号，也不能溢出压到「状态」列上（窄屏必现） */
.stl-tb .stl-pay { overflow: hidden; }
.stl-tb .stl-bal { color: var(--danger); font-weight: 600; }
.stl-tb .stl-st .tag { font-size: 11px; line-height: 17px; }
/* 操作列收窄（2026-11-02 用户要求）：内边距与链接留白压到最小，导出/删除仍排一行 */
.stl-tb .stl-ops { vertical-align: top; padding-left: 6px; padding-right: 6px; }
.stl-tb .stl-ops .lk { padding: 2px 1px; }
.stl-tb .stl-ops .op-btns .sep { margin: 0 1px; }
.stl-tb .stl-ops-btns { white-space: nowrap; }
.stl-tb .stl-ops-att {
  margin-top: 3px; padding-top: 3px; border-top: 1px dashed var(--line-soft);
  font-size: 11px; white-space: nowrap;
}
.stl-tb .stl-att-lk { color: var(--primary); }
.stl-tb .stl-dl { color: var(--primary); margin-left: 3px; }
/* 窄屏（≤1000px）操作列被压到约 70px，附件那行改折行，避免「下载」被裁掉 */
@media (max-width: 1000px) {
  .stl-tb .stl-ops-att { white-space: normal; line-height: 1.45; }
}
.stl-tb .lk {
  background: none; border: 0; padding: 2px 3px; margin: 0; cursor: pointer;
  color: var(--primary); font-size: 12.5px; border-radius: 5px; text-decoration: none;
}
.stl-tb .lk:hover { background: var(--primary-soft); }
.stl-tb .lk.danger { color: var(--danger); }
.stl-tb .lk.danger:hover { background: var(--danger-soft); }
.stl-tb th:last-child, .stl-tb td:last-child {
  position: sticky; right: 0; z-index: 4; background: #fff;
  box-shadow: -7px 0 8px -7px rgba(20, 30, 55, .14);
}
.stl-tb thead th:last-child { z-index: 6; background: #f7f9fc; }
.stl-tb tbody tr:hover td:last-child { background: #f7faff; }
.stl-tb .stl-c1 { color: var(--text); }
.stl-tb .stl-c2 { color: var(--text-3); }
/* 单号里的年月段单独染色加粗：JS2026 09 0054，一眼看出是哪年哪月的单 */
.stl-tb .stl-ym {
  color: #b45309; background: #fff5e6; font-weight: 700;
  padding: 0 2px; border-radius: 3px;
}
.stl-tb a.link:hover .stl-ym { color: #92400e; background: #ffe9c7; }
/* 筛选项精简成「万能关键词 + 期间 + 状态」一行（原工程/客户两个下拉已合并） */
.stl-bar { gap: 8px 10px; padding: 10px 14px; }
.stl-bar .stl-kw { flex: 1 1 300px; min-width: 200px; }
.stl-bar .stl-kw input { width: 100%; }
/* 「结算单」标题行右侧直接挂「字段调整」，不再单独占一行 */
.stl-head .hint { margin-left: auto; }
.stl-head > .lk-bar { margin-left: 2px; padding: 0; flex: 0 0 auto; }
.stl-head > .lk-bar .lk-sp { display: none; }

/* ============ 销售发票 / 收票 ============ */
.inv-bar { gap: 10px 12px; }
/* 「字段调整」并入筛选栏右侧，不再单独占一行 */
.inv-bar > .lk-bar { margin-left: auto; padding: 0; align-self: flex-end; }
.inv-bar > .lk-bar .lk-sp { display: none; }
.inv-bar .f-range input[type=date] { width: 128px; }
table.tb.inv-tb { table-layout: fixed; min-width: 1180px; }
.inv-tb th, .inv-tb td { padding: 8px 10px; }
.inv-tb .neg { color: var(--danger); font-weight: 600; }
.inv-tb .tl2 .l1 { font-weight: 600; }
.inv-tb .tl2 .l2 { margin-top: 1px; font-size: 11.5px; color: var(--text-3); }

/* ============ 销售单价管理 / 缺价标识 ============ */
/* 「⚙ 字段调整」并入「价格表列表」标题行右侧，不再单独占一行 */
.ps-head { gap: 8px; }
.ps-head > .lk-bar { padding: 0; margin-left: 2px; flex: 0 0 auto; }
.ps-head > .lk-bar .lk-sp { display: none; }
/* 销售档案：缺价（没有关联价格表，结算 / 试算算不出价） */
.tag.sa-np { font-weight: 600; letter-spacing: .3px; }
.sa-np-c { color: var(--danger); font-weight: 600; }

/* ============ 回款管理 ============ */
.rc-bar { gap: 10px 12px; }
/* 「字段调整」挂在「回款记录」标题行右侧，别再单独占一行 */
.rc-head > .lk-bar { padding: 0; margin-left: 2px; flex: 0 0 auto; }
.rc-head > .lk-bar .lk-sp { display: none; }
.rc-bar .f-range input[type=date] { width: 128px; }
#rc-list { overflow: auto; max-height: calc(100vh - 320px); }
table.tb.rc-tb { table-layout: fixed; min-width: 800px; }
table.tb.rc-tb th { padding: 8px 10px; }
table.tb.rc-tb td { padding: 7px 10px; font-size: 12.5px; }
.rc-tb th.c, .rc-tb td.c { text-align: center; }
.rc-tb .rc-pc div { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rc-tb .rc-p1 { font-size: 13px; color: var(--text); font-weight: 600; }
.rc-tb .rc-p2 { margin-top: 1px; font-size: 11.5px; color: var(--text-3); }
.rc-tb .rc-amt { font-weight: 650; }
/* 回款明细：金额用黑体加粗（2026-11-05 需求：回款是最重要的数字，灰字看不清） */
.rc-amtbig { font-size: 15.5px; font-weight: 800; color: var(--text); letter-spacing: .2px; }
/* 回款明细：附件直接铺在「附件」字段处（图片点开大图、可下载），底部不再要附件按钮 */
.rc-att-full { margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line-soft); }
.rc-att-full::before {
  content: '附件'; display: block; font-size: 11.5px;
  color: var(--text-3); margin-bottom: 6px; letter-spacing: .5px;
}
.rc-tb .rc-note div { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rc-tb .lk {
  background: none; border: 0; padding: 2px 3px; margin: 0; cursor: pointer;
  color: var(--primary); font-size: 12.5px; border-radius: 5px;
}
.rc-tb .lk:hover { background: var(--primary-soft); }
.rc-tb .lk.danger { color: var(--danger); }
.rc-tb .lk.danger:hover { background: var(--danger-soft); }

.rc-tip {
  margin-top: 12px; padding: 9px 11px; border-radius: 7px; line-height: 1.7;
  background: #f5f7fb; border: 1px solid var(--line-soft); color: var(--text-2);
}
.rc-tip b { color: var(--text); }
.rc-tip .warnc { color: var(--warn); }
.rc-tip.ok { background: #eef8f3; border-color: #cdebd9; }
.rc-tip.warn { background: #fdf9ed; border-color: #f2e3bd; }
.rc-tip.muted { color: var(--text-3); }

.rc-bar2 {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-top: 10px; padding: 9px 11px; border-radius: 7px;
  background: #f7f9fc; border: 1px solid var(--line-soft);
}
.rc-bar2-l { display: flex; align-items: center; gap: 14px; font-size: 12px; }
.rc-bar2-l > span:first-child {
  font-size: 11px; color: var(--primary); background: var(--primary-soft);
  padding: 2px 7px; border-radius: 20px;
}
.rc-bar2-r { margin-left: auto; font-size: 11.5px; }

/* 应收台账：工程/客户切换 + 主辅两行 */
.seg {
  display: inline-flex; border: 1px solid var(--line); border-radius: 7px; overflow: hidden;
}
.seg button {
  border: 0; background: #fff; padding: 5px 12px; font-size: 12px; cursor: pointer;
  color: var(--text-2); font-family: inherit;
}
.seg button + button { border-left: 1px solid var(--line); }
.seg button.on { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.ar-pc { min-width: 230px; max-width: 330px; }
.ar-pc .ar-p1 {
  font-size: 13px; color: var(--text); font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 310px;
}
.ar-pc .ar-p2 {
  margin-top: 1px; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; max-width: 310px;
}
#fin-body .tb th.num, #fin-body .tb td.num { white-space: nowrap; font-size: 12px; }
#fin-body .tb th, #fin-body .tb td { padding: 8px 9px; }
#fin-body .tb th:first-child, #fin-body .tb td:first-child { padding-left: 12px; }
#fin-body .tb th.ar-op, #fin-body .tb td.ar-op {
  position: sticky; right: 0; z-index: 2; background: #fff;
  box-shadow: -7px 0 9px -8px rgba(15, 23, 42, .18);
}
#fin-body .tb th.ar-op { background: #f7f9fc; z-index: 3; }
#fin-body .tb tbody tr:hover td.ar-op { background: #f7faff; }

/* ============ 批量结算 ============ */
.b-bar { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; padding: 12px 0 4px; }
.b-sum { font-size: 12px; color: var(--text-2); padding: 6px 0 10px; line-height: 1.8; }
.b-body { max-height: 46vh; overflow: auto; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.b-tb { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.b-tb th {
  position: sticky; top: 0; z-index: 2; background: #f7f9fc; font-size: 11.5px; font-weight: 600;
  color: var(--text-2); text-align: left; padding: 8px 10px;
  border-bottom: 1px solid var(--line); white-space: nowrap;
}
.b-tb td { padding: 7px 10px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.b-tb th.num, .b-tb td.num { text-align: right; }
.b-tb th.c, .b-tb td.c { text-align: center; }
.b-tb tbody tr:hover td { background: #f7faff; }
.b-tb tr.b-dup td { background: #fffaf0; }
.b-tb tr.b-no td { background: #fbfbfd; color: var(--text-3); }
.b-proj, .b-cli { max-width: 330px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.b-res { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.kpi-mini {
  font-size: 12px; color: var(--text-2); background: #f5f8fd;
  border: 1px solid var(--line-soft); border-radius: 8px; padding: 7px 12px;
}
.kpi-mini b { color: var(--text); font-size: 13.5px; }
.kpi-mini.ok { background: var(--ok-soft); border-color: #cdeadb; }
.kpi-mini.ok b { color: var(--ok); }
.kpi-mini.warn { background: var(--warn-soft); border-color: #f3e0c2; }
.kpi-mini.warn b { color: var(--warn); }
.kpi-mini.danger { background: var(--danger-soft); border-color: #f2d5d5; }
.kpi-mini.danger b { color: var(--danger); }
.b-res-t { font-size: 12px; font-weight: 600; color: var(--text-2); margin: 14px 0 6px; }

/* =================================================================
   采购管理 / 报表（purchase.js）
   ================================================================= */
.tabs.sm { display: inline-flex; border: 0; padding: 0; gap: 4px; }
.tabs.sm button {
  padding: 5px 10px; font-size: 12.5px; border-radius: 6px;
  border: 1px solid var(--line-soft); background: #fff; color: var(--text-2);
}
.tabs.sm button.active { background: var(--brand-soft); color: var(--brand); border-color: #c3d3f8; font-weight: 600; }

.kindbox { display: flex; gap: 16px; flex-wrap: wrap; padding: 6px 2px; }
.kindbox .chk { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; color: var(--text-2); }
.kindbox .chk input { width: 15px; height: 15px; }

/* 表格里的行内编辑控件 */
.ps2-i, .pud-i, .pud-gn {
  width: 100%; box-sizing: border-box; border: 1px solid var(--line-soft);
  border-radius: 5px; padding: 3px 6px; font-size: 12.5px; background: #fff; color: var(--text);
}
.ps2-i:focus, .pud-i:focus, .pud-gn:focus { border-color: var(--brand); outline: none; }
tr.ps-ok td { background: #f6fcf9; }

/* 采购结算单详情 */
.pu-head { margin-bottom: 10px; }
.pu-sum {
  margin-top: 8px; padding: 8px 12px; background: #f5f8fd; border: 1px solid var(--line-soft);
  border-radius: 8px; font-size: 13px; color: var(--text-2);
}
.pu-sum b { color: var(--text); }
.pu-lines { margin-bottom: 12px; }

/* 附件区 */
.att-box { border-top: 1px solid var(--line-soft); padding-top: 10px; }
.att-box.att-form { margin-top: 14px; }
.att-box.att-form .card-h h3 { font-size: 13.5px; }
.att-up { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.att-list { display: flex; gap: 10px; flex-wrap: wrap; }
.att-saved { margin-top: 10px; }
.att-saved:not(:empty) { padding-top: 10px; border-top: 1px dashed var(--line-soft); }
.att-item {
  display: flex; gap: 8px; align-items: flex-start; width: 210px;
  border: 1px solid var(--line-soft); border-radius: 8px; padding: 7px; background: #fff;
}
.att-thumb {
  width: 56px; height: 56px; object-fit: cover; border-radius: 6px; cursor: zoom-in;
  border: 1px solid var(--line-soft); background: #f5f8fd;
}
.att-file { width: 56px; height: 56px; display: flex; align-items: center; justify-content: center;
  font-size: 24px; background: #f5f8fd; border-radius: 6px; border: 1px solid var(--line-soft); }
.att-meta { flex: 1; min-width: 0; }
.att-name { font-size: 12.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att-op { display: flex; gap: 6px; margin-top: 4px; }
.att-op .btn { padding: 2px 7px; font-size: 11.5px; text-decoration: none; }

/* ---- 附件悬浮预览小窗（全站标准组件，鼠标停在「附件(N)」上出现） ---- */
.att-hv {
  position: fixed; z-index: 1300; width: 344px; max-width: calc(100vw - 16px);
  background: var(--panel, #fff); border: 1px solid var(--line);
  border-radius: 10px; box-shadow: 0 14px 34px rgba(15, 25, 45, .20);
  padding: 8px 10px 6px;
}
.att-hv-h { font-size: 12px; font-weight: 650; color: var(--text); margin: 0 2px 7px; }
.att-hv-h b { color: var(--primary); }
.att-hv-h .muted { font-weight: 400; font-size: 11.5px; }
.att-hv-b {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
  max-height: 246px; overflow: auto; padding: 1px;
}
.att-hv-i { min-width: 0; }
.att-hv-img {
  width: 100%; height: 64px; object-fit: cover; border-radius: 6px; cursor: zoom-in;
  border: 1px solid var(--line-soft); background: #f5f8fd; display: block;
}
.att-hv-ico {
  width: 100%; height: 64px; display: flex; align-items: center; justify-content: center;
  font-size: 22px; background: #f5f8fd; border: 1px solid var(--line-soft);
  border-radius: 6px; text-decoration: none;
}
.att-hv-n {
  font-size: 11px; line-height: 1.25; margin-top: 3px; color: var(--text-2);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.att-hv-op { display: flex; gap: 8px; margin-top: 1px; }
.att-hv-op a { font-size: 11px; color: var(--primary); text-decoration: none; }
.att-hv-op a:hover { text-decoration: underline; }
.att-hv-f {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 7px; padding-top: 6px; border-top: 1px dashed var(--line-soft);
  font-size: 11.5px;
}
.att-hv-f a { color: var(--primary); text-decoration: none; }
.att-hv-f a:hover { text-decoration: underline; }

/* 比例条：宽度统一、数字固定位 */
.ratewrap { display: inline-flex; align-items: center; gap: 6px; justify-content: flex-end; }
.ratebar { width: 48px; height: 5px; background: #e8ecf4; border-radius: 3px; overflow: hidden; }
.ratebar i { display: block; height: 100%; background: #6b93f5; border-radius: 3px; }
.ratewrap b { font-size: 11.5px; min-width: 44px; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.ratewrap b.ok { color: var(--ok); }
.ratewrap b.warn { color: var(--warn); }

.tb td .warn, td b.warn { color: var(--warn); }
td b.ok { color: var(--ok); }
.tb-wrap { overflow: auto; }

/* ---- 项目应收报表：工程 / 客户两行内显示完 + 明细弹窗 ---- */
.ar-tb td.ar-pname, .ar-tb td.ar-cname {
  white-space: normal; line-height: 1.35; word-break: break-word;
}
.ar-tb td.ar-pname a { font-weight: 600; }
.ar-tb td.ar-pname a:hover { text-decoration: underline; }

.ar-dsum {
  display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 8px;
  padding: 10px 12px; background: #f5f8fd; border: 1px solid var(--line-soft); border-radius: 8px;
}
.ar-dsum-i {
  min-width: 118px; padding: 4px 10px; background: #fff; border: 1px solid var(--line-soft);
  border-radius: 6px; display: flex; flex-direction: column; gap: 2px;
}
.ar-dsum-i span { font-size: 11.5px; color: var(--text-3); }
.ar-dsum-i b { font-size: 14.5px; }
.ar-dmeta { margin-bottom: 4px; }
.ar-dage { margin-bottom: 10px; }
.ar-dage-i {
  display: inline-block; margin: 0 12px 4px 0; padding: 2px 8px; background: #fff;
  border: 1px solid var(--line-soft); border-radius: 5px;
}
.ar-dtabs { margin-bottom: 10px; }

/* ============ 档案详情表单（销售档案 / 供应商档案） ============ */
.link { color: var(--primary); cursor: pointer; }
.link:hover { text-decoration: underline; }

.sa-dgrid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 8px 14px; margin-bottom: 4px;
}
.sa-di {
  display: flex; flex-direction: column; gap: 3px; padding: 6px 10px;
  background: #fff; border: 1px solid var(--line-soft); border-radius: 6px; min-width: 0;
}
.sa-di span { font-size: 11.5px; color: var(--text-3); }
.sa-di b { font-size: 13px; font-weight: 600; overflow-wrap: anywhere; word-break: break-word; }
.sa-di.full { grid-column: 1 / -1; }

/* 应收明细 → 销售档案：字段点一下就能改（2026-11-03） */
.sa-ed { cursor: text; border-radius: 4px; padding: 1px 4px; margin: -1px -4px; transition: background .12s; }
.sa-ed:hover { background: #eef4ff; box-shadow: inset 0 0 0 1px #cfe0ff; }
.sa-ed:hover::after { content: ' ✎'; font-size: 10px; color: var(--text-3); font-weight: 400; }
.sa-di b.sa-ed:has(input), .sa-di b.sa-ed:has(select) { display: block; margin: 0; padding: 0; }
.sa-fin {
  width: 100%; min-width: 90px; height: 26px; padding: 2px 6px; font-size: 13px;
  border: 1px solid var(--brand); border-radius: 4px; background: #fff; color: var(--text-1);
}
.sa-fin:focus { outline: 2px solid #cfe0ff; outline-offset: 0; }
.ar-act {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 6px 0 10px; border-bottom: 1px dashed var(--line-soft); margin-bottom: 10px;
  overflow: hidden;
}
.ar-act > span { flex: 1 1 220px; min-width: 0; }
.ar-act .btn.warn { border-color: #f0c36b; color: #a9700a; }

/* ============ 结算核验 ============ */
.vf-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  padding: 10px 12px; background: #f5f8fd; border: 1px solid var(--line-soft);
  border-radius: 8px; margin-bottom: 10px;
}
.vf-sum { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.vf-sum-i {
  min-width: 108px; padding: 5px 10px; background: #fff; border: 1px solid var(--line-soft);
  border-radius: 6px; display: flex; flex-direction: column; gap: 2px;
}
.vf-sum-i span { font-size: 11.5px; color: var(--text-3); }
.vf-sum-i b { font-size: 15px; }
.vf-tb td { white-space: nowrap; }
.vf-tb td.vf-name { white-space: normal; min-width: 180px; }
.vf-dates { font-size: 11px; color: var(--text-3); white-space: normal; }

/* ============ 登录页 ============ */
body.logged-out .app { display: none; }
#login-root {
  position: fixed; inset: 0; z-index: 900;
  display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(1000px 500px at 12% -10%, rgba(47, 84, 235, .12), transparent 60%),
    radial-gradient(900px 480px at 95% 110%, rgba(20, 184, 166, .10), transparent 55%),
    linear-gradient(135deg, #eef1f8 0%, #e2e9f5 100%);
}
.login-card {
  width: 380px; background: #fff; border-radius: 16px; padding: 34px 34px 26px;
  box-shadow: 0 22px 60px rgba(15, 25, 45, .16);
  border: 1px solid rgba(255, 255, 255, .8);
}
.login-card h1 { font-size: 20px; margin: 0 0 2px; }
.login-card p { margin: 0 0 18px; }
.userbox { margin-left: 10px; }

/* ============ 组织管理 ============ */
.org-node {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px;
  border-radius: 7px; cursor: pointer; border: 1px solid transparent;
}
.org-node:hover { background: #f5f8fd; }
.org-node.sel { background: var(--primary-soft); border-color: #c8d8fb; }
.org-node b { font-size: 13.5px; }

/* ============ 登录页：密码可见 + 免登录勾选 ============ */
.pwd-wrap { position: relative; display: block; }
.pwd-wrap input { width: 100%; padding-right: 40px; }
.pwd-eye {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  border: none; background: none; cursor: pointer; font-size: 16px;
  padding: 4px 6px; line-height: 1; opacity: .55; border-radius: 4px;
}
.pwd-eye:hover { opacity: 1; background: #f0f3f8; }
.lg-remember { margin-top: 2px; }
.lg-remember input[type="checkbox"] { width: auto; margin: 0; }

/* ============ 列表操作按钮统一（链接式，替代厚重按钮） ============ */
.lk {
  background: none; border: 0; padding: 2px 4px; margin: 0; cursor: pointer;
  color: var(--primary); font-size: 12px; border-radius: 5px;
  font-family: inherit; text-decoration: none; white-space: nowrap;
}
.lk:hover { background: var(--primary-soft); }
.lk.danger { color: var(--danger); }
.lk.danger:hover { background: var(--danger-soft); }
.op-btns { display: inline-flex; gap: 2px; align-items: center; white-space: nowrap; }
.op-btns .lk:hover { background: var(--primary-soft); }
.op-btns .lk.danger { color: var(--danger); }
.op-btns .lk.danger:hover { background: var(--danger-soft); }
.op-btns .sep { width: 1px; height: 11px; background: var(--line); margin: 0 2px; }

/* ==================== 移动端适配（≤920px 抽屉式侧栏） ==================== */
.menu-btn {
  display: none;
  width: 36px; height: 36px;
  margin-right: 8px; flex: 0 0 36px;
  border: 0; background: none; border-radius: 8px;
  font-size: 19px; color: var(--text-2); cursor: pointer;
  align-items: center; justify-content: center;
}
.menu-btn:active { background: var(--primary-soft); }
.drawer-mask {
  display: none; position: fixed; inset: 0; z-index: 49;
  background: rgba(16, 24, 42, .45);
  opacity: 0; transition: opacity .22s;
}
body.nav-open .drawer-mask { display: block; opacity: 1; }

/* 表格自动横滚容器（app.js 包裹生成） */
.tb-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tb-wrap .tb { margin-bottom: 0; }

/* ---- 报表页（项目应收 / 采购应付）：表头筛选 + 表体内滚 + 底部翻页 同屏可见 ---- */
/* 用显式高度（而非 max-height）让纵向 flex 的 .rpt-scroll 真正撑满，中间表格区最大化 */
.rpt-card { display: flex; flex-direction: column; height: calc(100vh - 74px); }
/* 报表页收紧内容区上下留白，把空间让给表体（:has 精准作用于本页，其他页面不受影响） */
@media (min-width: 921px) {
  #view:has(> .rpt-card) { padding: 8px 22px 10px; }
}
/* 全选 / 已选 并入顶部工具栏右侧，不再单独占一行 */
.rpt-sel { display: inline-flex; align-items: center; gap: 10px; align-self: center; margin-right: 4px; }
.rpt-card > .toolbar { flex: 0 0 auto; }
.rpt-card > .rpt-scroll { flex: 1 1 auto; min-height: 160px; overflow: auto; }
/* 字段调整按钮并入顶部 toolbar（右对齐），不再单独占一行 */
.rpt-card > .toolbar .lk-bar { margin-left: auto; padding: 0; align-self: flex-end; }
/* 让 ListKit 套的内层 .lk-wrap 不当滚动容器：否则它会劫持 sticky 吸顶与横向滚动条，
   导致表头被滚走、横向滚动条藏到表格内容底部。滚动统一交给 .rpt-scroll。 */
.rpt-scroll .lk-wrap { overflow: visible; width: max-content; min-width: 100%; }
.rpt-card > .lk-pager,
.rpt-card > .ps-foot,
.rpt-card > .card-b { flex: 0 0 auto; }
/* 内部滚动时表头吸顶、合计吸底，三者同屏可见 */
.rpt-scroll table.tb thead th { position: sticky; top: 0; z-index: 3; background: #f7f9fc; }
.rpt-scroll table.tb tfoot td,
.rpt-scroll table.tb tfoot th { position: sticky; bottom: 0; z-index: 3; background: #f7f9fc; box-shadow: 0 -1px 0 var(--line); }

/* ---- 销售统计（.ps-card）：表头吸顶 + 卡片撑满一屏，中间表体最大化 ---- */
/* 表头吸顶：th 原为 position:relative（拖拽手柄需要定位上下文）；sticky 同样是定位元素，
   手柄仍以 th 为参照，故可安全改为 sticky（固定列 pin 的 right 规则不受影响，仍叠加 top:0）。 */
.ps-tb.ps-fixed thead th { position: sticky; top: 0; z-index: 3; background: #f7f9fc; }
@media (min-width: 921px) {
  /* 让 #view 成为定高纵向 flex：tabs 固定、卡片撑满、卡片内表体撑满 */
  #view:has(> .ps-card) {
    display: flex; flex-direction: column;
    height: calc(100vh - 56px); padding: 8px 22px 10px;
  }
  #view:has(> .ps-card) > .tabs { flex: 0 0 auto; margin-bottom: 8px; }
  #view:has(> .ps-card) > .ps-card { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
  .ps-card > .toolbar, .ps-card > .ps-bar, .ps-card > .ps-foot { flex: 0 0 auto; }
  /* 提高优先级压过 body.ps-full .ps-body / .main:fullscreen .ps-body 的 max-height */
  #view .ps-card > .ps-body { flex: 1 1 auto; min-height: 0; max-height: none; overflow: auto; }
  /* 万能关键词占满余量，日期/状态下移一行也放得下 */
  .ps-card .f-kw { flex: 1 1 320px; min-width: 220px; }
  .ps-card .f-kw input { width: 100%; }
}

@media (max-width: 920px) {
  /* ---- 布局骨架：侧栏变抽屉 ---- */
  .menu-btn { display: inline-flex; }
  .sidebar {
    position: fixed; left: 0; top: 0; z-index: 50;
    width: 272px; flex: 0 0 272px;
    transform: translateX(-105%);
    transition: transform .25s ease;
    box-shadow: 0 0 40px rgba(0, 0, 0, .25);
  }
  body.nav-open .sidebar { transform: none; }
  .main { flex: 1 1 auto; width: 100%; }

  /* ---- 顶栏 ---- */
  .topbar { padding: 0 12px; height: 52px; min-height: 52px; height: auto; min-height: 52px; flex-wrap: wrap; }
  .topbar h2 { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 40vw; }
  .topbar .sub { display: none; }
  .topbar-actions { flex-wrap: wrap; justify-content: flex-end; row-gap: 6px; }
  .topbar-actions .btn { min-height: 34px; }
  .content { padding: 12px 12px 90px; }
  /* 报表页（应收 / 应付）：不再给整张卡片锁高 —— 原来 max-height 把工具栏也算在内，
     手机上筛选栏一占，表体只剩很小一块且高度写死。改成卡片随页面滚动、只给滚动区定高，
     与结算报表一致：把筛选栏划到上方后表体铺满一屏，表头（sticky）不会跑。 */
  .rpt-card { height: auto; max-height: none; }
  .rpt-card > .rpt-scroll { flex: 0 0 auto; max-height: calc(100vh - 168px); }

  /* ---- 输入与触控目标（16px 防 iOS 聚焦缩放） ---- */
  input, select, textarea { font-size: 16px !important; }
  .toolbar .f { flex: 1 1 46%; min-width: 0; }
  .toolbar .f input, .toolbar .f select, .filters input, .filters select { width: 100%; min-height: 38px; }
  .toolbar, .filters { padding: 10px 12px; gap: 8px; }
  .btn { min-height: 36px; }
  .btn.sm { min-height: 30px; }
  .nav a { padding: 11px 12px; }
  .op-btns .lk { padding: 9px 7px; }

  /* ---- 卡片 / KPI / 栅格 ---- */
  .kpis { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .kpi { padding: 12px 14px; }
  .kpi .lab { gap: 6px; }
  .kpi .lab span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .kpi .lab span:last-child { white-space: nowrap; flex: 0 0 auto; }
  .kpi .val { font-size: 21px; overflow-wrap: anywhere; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .card { border-radius: 12px; }

  /* ---- 弹窗全屏化 ---- */
  .mask { padding: 0; align-items: stretch; }
  .modal, .modal.wide { width: 100%; max-width: 100%; height: 100%; border-radius: 0; display: flex; flex-direction: column; }
  .modal-b { flex: 1; max-height: none; padding: 14px; }
  .modal-f { padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); }
  .modal-f .btn { flex: 1; }
  .form-grid { grid-template-columns: 1fr; }

  /* ---- 表格：内滚动 + 表头吸顶 ---- */
  .tb-wrap { max-height: calc(100vh - 168px); overflow-y: auto; }
  .tb-wrap .tb thead th { position: sticky; top: 0; z-index: 2; box-shadow: 0 1px 0 var(--line); }

  .bar-row { grid-template-columns: 78px 1fr 64px; }
  .ps-list { grid-template-columns: 1fr; }
  .ps-items { grid-template-columns: 1fr 1fr; }
  .ip-items { grid-template-columns: 1fr 1fr; }
  .toast { left: 12px; right: 12px; transform: none; width: auto; max-width: none; text-align: center; }
}

@media (max-width: 560px) {
  .content { padding: 10px 10px 80px; }
  .card-h { padding: 10px 12px; }
  .card-b { padding: 12px; }
  .toolbar .f { flex: 1 1 100%; }
  .kpi { padding: 10px 12px; }
  .kpi .val { font-size: 19px; }
  .ps-items, .ip-items { grid-template-columns: 1fr; }
  .tb { font-size: 12px; }
  .tb td, .tb th { padding-left: 9px; padding-right: 9px; }
  .tb td.tl2 { padding: 5px 9px; }
  .mono { font-size: 11px; }
  .tabs { overflow-x: auto; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { height: 0; }
  .tabs button { padding: 8px 10px; font-size: 12.5px; }
  .card-h { gap: 6px; }
  .card-h .hint { display: none; }   /* 手机上一行放不下说明文字，标题优先 */
  .banner { font-size: 12px; padding: 9px 11px; }
  .empty { padding: 26px 12px; }
}

/* ================================================================
   列表增强（ListKit）：工具条 / 列宽拖动 / 窗口滚动 / 翻页条
   ================================================================ */
.lk-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 0 2px 6px; font-size: 12px; color: var(--text-3);
}
/* data-lkbar=".toolbar"：字段调整按钮并入筛选栏那一行（右对齐），不再单独占一行
   （生产数据 / 地磅进料等用 toolbar 做筛选栏的页面，2026-11-03） */
.toolbar > .lk-bar { margin-left: auto; padding: 0; align-self: flex-end; }
.toolbar > .lk-bar .lk-sp { display: none; }
/* 统计文字固定在筛选栏下方左侧一行（2026-11-05 用户要求）：
   原来和筛选条件挤在同一行、靠 .spacer 推到右端，条件一多就被换行甩到别处。
   现在 flex:0 0 100% 独占一行，永远在左上角同一位置；字段调整按钮挂在它右端。 */
.toolbar > .tb-sum {
  flex: 0 0 100%;
  display: flex; align-items: center; gap: 10px;
  margin-top: -2px; min-height: 18px;
}
.toolbar > .tb-sum > .lk-bar { margin-left: auto; padding: 0; }
.toolbar > .tb-sum > .lk-bar .lk-sp { display: none; }
/* 字段调整并入筛选栏最后一行（右端），不再单独占一行（2026-11-06 用户要求：
   供应商档案 / 采购结算 / 付款管理）。挂载点是一个空 span，被 ListKit 塞进 lk-bar 后靠右。 */
.toolbar > .tb-fields,
.toolbar > .tb-fields > .lk-bar {
  margin: 0 0 0 auto; padding: 0; align-self: flex-end;
  display: flex; align-items: center;
}
.toolbar > .tb-fields:empty { display: none; }
.toolbar > .tb-fields > .lk-bar .lk-sp { display: none; }
/* 供应商档案：按供货类型设置的票种 / 税率 */
.sup-tax { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px 2px; background: var(--bg-2, transparent); }
.sup-tax-h { font-size: 12px; color: var(--text-3); margin-bottom: 6px; }
.sup-tax table.tb { margin-bottom: 6px; }
.sup-tax select, .sup-tax input { width: 100%; min-width: 0; }
.lk-bar .lk-n b { color: var(--text-2); font-weight: 600; }
.lk-bar .lk-sp { flex: 1; }
.lk-fbtn { white-space: nowrap; }

/* 数据窗口：强制一屏（高度由 listkit.js fitHeights 设定），宽度撑满内容区，表头吸顶 */
.lk-wrap {
  position: relative;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 8px;
  width: 100%;
}
/* 用 :where 降权：这条只是「撑满容器」的兜底，不能让结算表 / 回款表自己的
   min-width（860 / 800px）失效——手机窄屏下那会让所有列被压成几十像素、文字重叠。 */
:where(.lk-wrap) > table.tb { margin-bottom: 0; min-width: 100%; }
.lk-wrap > table.tb thead th { position: sticky; top: 0; z-index: 3; }

/* 列宽拖动手柄 */
.lk-th { position: relative; }
.lk-grip {
  position: absolute; top: 0; right: -3px; width: 7px; height: 100%;
  cursor: col-resize; z-index: 5; touch-action: none;
}
.lk-grip::after {
  content: ""; position: absolute; left: 3px; top: 22%; height: 56%; width: 1px;
  background: transparent; transition: background .12s;
}
.lk-th:hover .lk-grip::after { background: var(--primary); }
body.lk-dragging { cursor: col-resize; user-select: none; }
body.lk-dragging .lk-th:hover .lk-grip::after { background: var(--primary); }

/* 翻页条（在数据窗口下方，与每页条数放在一起） */
.lk-pager {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 8px 2px 2px; font-size: 12px; color: var(--text-3);
}
.lk-pg-r { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.lk-size {
  padding: 4px 6px; border: 1px solid var(--line); border-radius: 6px;
  background: var(--panel); color: var(--text-2);
}
.lk-pageno { font-size: 12px; color: var(--text-2); white-space: nowrap; }

/* 字段调整弹窗 */
.lk-fields { max-height: 52vh; overflow: auto; border: 1px solid var(--line); border-radius: 8px; }
.lk-frow {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-bottom: 1px solid var(--line-soft);
  background: var(--panel); cursor: grab;
}
.lk-frow:last-child { border-bottom: 0; }
.lk-frow.drag { opacity: .35; }
.lk-frow.over { box-shadow: inset 0 2px 0 var(--primary); background: var(--primary-soft); }
.lk-fh { color: var(--text-3); letter-spacing: -2px; user-select: none; }
.lk-fname { flex: 1; font-size: 13px; }
.lk-fchk { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--text-2); }

/* ================================================================
   配色方案：管理员可切换（html[data-theme]）
   ================================================================ */
html[data-theme="blue"] {
  --bg: #f4f6fa; --panel: #fff; --line: #e4e8f0; --line-soft: #edf0f6;
  --text: #1a2233; --text-2: #55617a; --text-3: #8a94a8;
  --primary: #2f54eb; --primary-hover: #2444c9; --primary-soft: #eef2ff;
  --brand: #2f54eb; --brand-soft: #eef2ff;
  --nav-bg: #131c2e; --nav-bg-2: #1a2438; --nav-text: #9aa7bd; --nav-text-hi: #f2f5fa;
}
html[data-theme="graphite"] {
  --bg: #f3f4f6; --panel: #fff; --line: #e2e5ea; --line-soft: #eceef2;
  --text: #1b1f27; --text-2: #54606f; --text-3: #8b95a3;
  --primary: #3f5a78; --primary-hover: #334b64; --primary-soft: #eef1f5;
  --brand: #3f5a78; --brand-soft: #eef1f5;
  --nav-bg: #1b1f26; --nav-bg-2: #262b34; --nav-text: #a3adbb; --nav-text-hi: #f4f6f9;
  --ok: #2f7d5d; --warn: #a97516;
}
html[data-theme="emerald"] {
  --bg: #f3f8f6; --panel: #fff; --line: #dde9e4; --line-soft: #eaf2ee;
  --text: #14251f; --text-2: #4d635a; --text-3: #84988f;
  --primary: #0f8a5f; --primary-hover: #0b7350; --primary-soft: #e6f6ef;
  --brand: #0f8a5f; --brand-soft: #e6f6ef;
  --nav-bg: #0e2a22; --nav-bg-2: #15382d; --nav-text: #93b8a9; --nav-text-hi: #f0f7f4;
  --ok: #0f8a5f; --warn: #b4770c;
}
html[data-theme="wine"] {
  --bg: #f8f4f5; --panel: #fff; --line: #eee0e3; --line-soft: #f4ebed;
  --text: #26161a; --text-2: #67525a; --text-3: #a08d94;
  --primary: #a33a4d; --primary-hover: #8b2f40; --primary-soft: #fbeef0;
  --brand: #a33a4d; --brand-soft: #fbeef0;
  --nav-bg: #2a1418; --nav-bg-2: #3a1c22; --nav-text: #c2a1a8; --nav-text-hi: #fbf3f4;
  --ok: #2f7d5d; --warn: #ae6b12;
}
html[data-theme="indigo"] {
  --bg: #f4f4fb; --panel: #fff; --line: #e3e2f2; --line-soft: #eeedf8;
  --text: #1b1830; --text-2: #565073; --text-3: #8f8aa8;
  --primary: #5b46d6; --primary-hover: #4a37bd; --primary-soft: #eeebff;
  --brand: #5b46d6; --brand-soft: #eeebff;
  --nav-bg: #1a1730; --nav-bg-2: #241f42; --nav-text: #a7a1c9; --nav-text-hi: #f3f1fd;
  --ok: #17856b; --warn: #b4770c;
}
html[data-theme="amber"] {
  --bg: #fbf7f1; --panel: #fff; --line: #ede2d3; --line-soft: #f5ede2;
  --text: #261d12; --text-2: #6a5947; --text-3: #a08e7a;
  --primary: #b4700f; --primary-hover: #9a5f0c; --primary-soft: #fdf1e0;
  --brand: #b4700f; --brand-soft: #fdf1e0;
  --nav-bg: #241a10; --nav-bg-2: #332517; --nav-text: #c0a88c; --nav-text-hi: #fdf7ef;
  --ok: #2f7d5d; --warn: #b4700f;
}

/* 主题选择卡片 */
.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.theme-card {
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
  cursor: pointer; background: var(--panel); transition: box-shadow .15s, border-color .15s;
}
.theme-card:hover { box-shadow: var(--shadow); }
.theme-card.on { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-soft); }
.theme-card .tn { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; }
.theme-card .dots { display: flex; gap: 4px; margin-top: 8px; }
.theme-card .dots i { width: 22px; height: 12px; border-radius: 3px; display: block; }
.theme-card .tk { font-size: 11.5px; color: var(--text-3); margin-top: 6px; }

/* 已完结汇总条目（应收 / 应付主表最后一行） */
tr.ar-done-row > td, tr.ap-done-row > td {
  background: #f7f9fc; border-top: 1px solid var(--line); cursor: pointer;
}
tr.ar-done-row:hover > td, tr.ap-done-row:hover > td { background: var(--primary-soft); }
.done-lk { color: var(--primary); font-weight: 600; font-size: 12.5px; }
.done-lk b { font-size: 13px; }

/* 手机端：顶栏不撑破屏幕（标题副标题让步，操作按钮区可横滚） */
@media (max-width: 920px) {
  .topbar { gap: 6px; padding: 0 10px; }
  #page-title { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  #page-sub { display: none; }
  /* 标题和用户按钮同一行，操作按钮整体换到第二行横滚：
     否则按钮把用户框挤到第三行，顶栏占掉一大截屏幕。 */
  .topbar { flex-wrap: wrap; height: auto; min-height: 52px; padding: 5px 10px; row-gap: 4px; }
  .topbar > div:first-child { flex: 1 1 auto; min-width: 0; }
  .userbox { order: 2; flex: 0 0 auto; }
  .topbar-actions { order: 3; flex: 1 0 100%; min-width: 0; overflow-x: auto; flex-wrap: nowrap; }
  .topbar-actions .btn { flex: 0 0 auto; }
  #user-name { display: inline-block; max-width: 60px; overflow: hidden; text-overflow: ellipsis; vertical-align: bottom; }
  .lk-wrap { max-width: 100%; }
  /* 窄屏下操作列放不下一排按钮，允许换行，避免「删除」被裁掉半个字 */
  .stl-tb .stl-ops-btns, .rc-tb .op-btns { white-space: normal; flex-wrap: wrap; row-gap: 2px; }
}

/* ---------------- 特殊项目监控 ---------------- */
.sa-off-h { font-size: 12px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.sa-off-h .hint { font-weight: 400; margin-left: 6px; }
.chk-list {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 2px 10px; max-height: 168px; overflow: auto;
  border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; margin-top: 6px;
  background: var(--line-soft);
}
.chk { display: flex; align-items: center; gap: 6px; font-size: 12.5px; padding: 2px 0; cursor: pointer; }
.chk input { margin: 0; }
.chk span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.mon-tb td.num .tag { margin-left: 4px; font-size: 10px; padding: 1px 4px; }
.mon-tb tbody td { vertical-align: top; }
.mon-tb .tl2 .l2 { line-height: 1.45; }

.mon-note {
  border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin-bottom: 8px;
  background: var(--panel);
}
.mon-note-h { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.mon-note-h b { font-size: 13.5px; }

/* 监控表：内容自适应宽度，数字不换行；口径标签另起一行，避免挤压数字。
   注意 specificity：基础样式是 table.tb td，这里必须带上 table.tb.mon-tb 才盖得住。 */
table.tb.mon-tb { font-size: 12.5px; }
table.tb.mon-tb th, table.tb.mon-tb td { padding-left: 6px; padding-right: 6px; }
table.tb.mon-tb td.num { white-space: nowrap; }
table.tb.mon-tb td.tl2 { padding-left: 8px; padding-right: 8px; }
table.tb.mon-tb .mon-src { display: block; line-height: 1.3; }
table.tb.mon-tb .mon-src .tag { font-size: 10px; padding: 0 4px; }
table.tb.mon-tb td.mon-paytd { min-width: 196px; }
table.tb.mon-tb td.num .mon-pay, table.tb.mon-tb td.num .mon-prow { white-space: normal; }
table.tb.mon-tb .mon-pay { line-height: 1.45; width: 172px; margin-left: auto; }
table.tb.mon-tb .mon-prow { display: flex; align-items: baseline; gap: 6px; justify-content: space-between; }
table.tb.mon-tb .mon-prow span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 96px; }
table.tb.mon-tb .mon-prow b { font-weight: 600; flex: 0 0 auto; font-size: 11.5px; }
/* 同一相关方合并行：整行淡底，明细里的项目名允许更宽一些 */
table.tb.mon-tb tr.mon-grp td { background: rgba(47, 84, 235, .035); }
table.tb.mon-tb td.num .mon-pay .mon-prow span { max-width: 118px; }
table.tb.mon-tb td.mon-rel .l1 { max-width: 150px; }
table.tb.mon-tb td.tl2 .l1, table.tb.mon-tb td.tl2 .l2 { max-width: 210px; overflow-wrap: anywhere; }
table.tb.mon-tb .mon-bell { font-size: 14px; line-height: 1; padding: 2px 4px; }

/* ---- 字段调整 popover（挂在「字段调整」按钮旁） ---- */
.lk-pop {
  position: fixed;
  z-index: 130;
  width: 440px;
  max-width: calc(100vw - 24px);
  background: #fff;
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--line);
  animation: pop .14s ease-out;
}
.lk-pop-h { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px 0; }
.lk-pop-h h3 { margin: 0; font-size: 14.5px; font-weight: 650; }
.lk-pop-h .icon-btn { border: 0; background: none; cursor: pointer; font-size: 13px; color: var(--text-2); padding: 4px 6px; }
.lk-pop-b { padding: 10px 14px 0; }
.lk-pop-b .banner.info { font-size: 12px; padding: 8px 10px; }
.lk-pop-f { display: flex; gap: 8px; align-items: center; padding: 10px 14px 12px; }

/* ---- 费控管理（费用报销 / 付款申请） ---- */
.fk-stats { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.fk-st {
  flex: 1; min-width: 130px; background: #fff; border: 1px solid var(--line);
  border-radius: 10px; padding: 10px 14px; display: flex; flex-direction: column; gap: 2px;
}
.fk-st .l2 { font-size: 12px; color: var(--text-2); }
.fk-st b { font-size: 17px; }
.fk-st .c-r { color: #d4380d; }
.fk-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.fk-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.fk-tools .f { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); margin: 0; }
.fk-tools .f input, .fk-tools .f select { margin: 0; }
.fk-tb tr.fk-todo td { background: #fffbe6; }
.fk-tb td.tl .l1 { font-weight: 500; }
.lk.c-r { color: #d4380d; }
.lk.c-p { color: var(--primary); font-weight: 600; }
.fk-flows { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.fk-flowrow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.fk-cn { margin-top: 2px; }

/* ---------------- 费用报销 / 付款申请 · 新建表单美化 ---------------- */
.fk-form .fk-sec {
  display: flex; align-items: baseline; gap: 10px;
  margin: 16px 0 10px; padding-bottom: 6px;
  border-bottom: 1px solid var(--line-soft);
}
.fk-form .fk-sec:first-child { margin-top: 0; }
.fk-form .fk-sec-t {
  font-size: 13px; font-weight: 700; color: var(--text-1);
  position: relative; padding-left: 10px; line-height: 18px;
}
.fk-form .fk-sec-t::before {
  content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 4px; height: 14px; border-radius: 2px; background: var(--primary);
}
.fk-form .fk-items-tb th { background: var(--primary-soft); font-size: 12px; }
.fk-form .fk-items-tb td { padding: 6px 8px; }
.fk-form .fk-total {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  margin-top: 10px; padding: 10px 16px;
  background: linear-gradient(90deg, var(--primary-soft), rgba(238, 242, 255, .35));
  border: 1px solid rgba(47, 84, 235, .18); border-radius: 8px;
}
.fk-form .fk-total-l { font-size: 13px; font-weight: 650; color: var(--text-1); }
.fk-form .fk-total-v { font-size: 17px; color: var(--primary); }
.fk-form .fk-total-cn { font-size: 12.5px; color: var(--text-2); flex: 1; min-width: 200px; }
.fk-form input[disabled] { background: #f6f8fb; color: var(--text-2); cursor: not-allowed; }
.fk-form .fk-cn { margin-top: 4px; color: var(--text-2); }
.fk-form .fk-cn b { color: var(--primary); font-weight: 650; letter-spacing: .5px; }

/* ---------- 销售合同变更（contract_change.js）---------- */
/* 变更内容列：新值是这页最该看清的信息，允许折成两行，不能被省略号切掉 */
table.tb.cch-tb td.tl2 .l1 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: normal;
  text-overflow: clip;
  word-break: break-word;
  line-height: 1.45;
}
table.tb.cch-tb td.tl2 .l1 b { font-weight: 650; }

/* ---- 销售档案详情：标签页 + 单据原地展开（2026-11-03） ---- */
.sa-dtabs { margin-bottom: 12px; }
.sa-dtb { margin-top: 2px; }
.sa-dtb tbody tr { cursor: pointer; }
.sa-dtb tbody tr:hover { background: var(--primary-soft); }
.sa-dtb tbody tr.on { background: var(--primary-soft); }
.sa-expr > td { padding: 0 !important; background: var(--line-soft); }
.sa-exp { padding: 10px 14px 12px; border-top: 1px dashed var(--line); }
.sa-expf { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 8px 20px; }
.sa-expf > div { display: flex; gap: 8px; align-items: baseline; font-size: 12.5px; }
.sa-expf > div > span { color: var(--text-3); flex: 0 0 auto; }
.sa-expf > div > b { font-weight: 600; overflow-wrap: anywhere; }
.sa-exp .tb.mini { font-size: 12px; }
.sa-exp .tb.mini th, .sa-exp .tb.mini td { padding: 4px 8px; }

/* 合同编号小标签：同一个项目下多个独立合同时用来区分（2026-11-03） */
.sa-cno { display: inline-block; padding: 0 6px; border-radius: 4px;
  background: var(--primary-soft); color: var(--primary);
  font-size: 11.5px; line-height: 17px; white-space: nowrap; }

/* 结算单弹窗顶部「单价表 / 销售档案」传送门（2026-11-03） */
.sdoc-portal { display: flex; gap: 12px; align-items: center; }
.lk-portal { color: var(--primary); cursor: pointer; font-size: 12.5px; white-space: nowrap; }
.lk-portal:hover { text-decoration: underline; }
.portal-back { border-color: var(--primary); color: var(--primary); }

/* 采购结算单预览（与导出对账单同款，2026-11-03） */
.pu-info td { height: 30px; }
.pu-info .pu-l { background: #f2f4f7; font-weight: 600; width: 14%; }
.pu-cn { padding: 8px 10px !important; text-align: left; }
.pu-decl { text-align: center; font-size: 12.5px; margin: 10px 0 14px; }
.pu-sign { font-size: 13px; margin: 6px 0 4px; }
.pu-sign-r { display: flex; justify-content: space-between; margin: 14px 0; }

/* ---------- 价格表：调过价的起始日期配色（按调价次数轮换） ---------- */
.ps-adj { font-weight: 700; padding: 1px 4px; border-radius: 4px; }
.ps-adj1 { color: #b45309; background: #fef3c7; }
.ps-adj2 { color: #6d28d9; background: #ede9fe; }
.ps-adj3 { color: #0e7490; background: #cffafe; }
.ps-adj4 { color: #be123c; background: #ffe4e6; }
.ps-adj5 { color: #15803d; background: #dcfce7; }

/* 已归档价格表：整行淡化，一眼区分 */
tr.ps-arch td { opacity: .62; }
tr.ps-arch:hover td { opacity: .85; }

/* ---------- 批量调价 ---------- */
.ps-b-head { display: flex; align-items: center; gap: 12px; margin: 12px 0 6px; }
.ps-b-head input[type="text"] { flex: 1; min-width: 0; }
.ps-b-list { max-height: 300px; overflow: auto; border: 1px solid var(--line, #e3e6ec); border-radius: 8px; }
.ps-b-row { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-bottom: 1px solid var(--line, #eef0f4); cursor: pointer; }
.ps-b-row:last-child { border-bottom: none; }
.ps-b-row:hover { background: #f7f9fc; }
.ps-b-name { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ps-b-meta { width: 26%; min-width: 0; font-size: 12px; color: #6b7280; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ps-b-price { width: 96px; text-align: right; font-size: 12.5px; }

/* 当前版本列：上下两行（起 / 止），列宽收窄，和左侧两行单元格对齐 */
.tb td.ps-ver { padding: 5px 8px; line-height: 1.35; }
.tb td.ps-ver .v1 { font-size: 12px; }
.tb td.ps-ver .v2 { font-size: 11px; color: var(--text-3); }

/* ---------- 人事 · 合同到期提醒 ----------
   只露 6 行（表头 34px + 6×39px），人多时在框内滚动；表头吸顶。
   这张表带 lk-skip，不参与 ListKit 的字段调整 / 列宽拖动。 */
.hr-remind {
  max-height: 268px;
  overflow: auto;
  margin-top: 8px;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, .06);
  border-radius: 8px;
  -webkit-overflow-scrolling: touch;
}
.hr-remind .tb { margin: 0; }
.hr-remind .tb thead th {
  position: sticky; top: 0; z-index: 2;
  background: #fdf6e8;
  box-shadow: 0 1px 0 var(--line, #e4e8f0);
}
.hr-remind .tb td, .hr-remind .tb th { padding-top: 8px; padding-bottom: 8px; }

/* ---------- 项目超额监控 · 两张表各自的关键词搜索框 ---------- */
.mon-kw {
  margin-left: auto;
  flex: 0 1 340px;
  min-width: 180px;
  height: 30px;
  padding: 0 10px;
  font-size: 12.5px;
  color: var(--text);
  background: var(--panel, #fff);
  border: 1px solid var(--line, #e4e8f0);
  border-radius: 7px;
  outline: none;
}
.mon-kw:focus { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-soft); }
@media (max-width: 920px) {
  .card-h { flex-wrap: wrap; }
  .mon-kw { flex: 1 1 100%; margin-left: 0; min-width: 0; }
}

/* 系统设置：按合同主体分区（军泰 / 合泰的抬头与账号） */
.ent-block { margin-top: 14px; border: 1px solid var(--line-soft); border-radius: 8px; padding: 10px 12px 4px; }
.ent-h {
  font-size: 12.5px; font-weight: 600; color: var(--text-2); margin-bottom: 8px;
  border-left: 3px solid var(--primary); padding-left: 8px;
}

/* 单价管理页签角标 + 信息价一键调整（2026-11-05） */
.tabs .tab-n { font-size: 11px; color: var(--text-3); margin-left: 4px; font-weight: 400; }
.ip-adj { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.ip-adj .ip-adj-l { font-size: 12px; color: var(--text-2); }
.ip-adj input { width: 84px; height: 28px; padding: 0 8px; text-align: right; }
.tabs button.active .tab-n { color: var(--primary); }

/* 合同金额调整记录（档案详情，2026-11-05） */
.sa-amtlog { margin: 10px 0 4px; padding: 10px 12px; border: 1px solid var(--line-soft); border-radius: 8px; background: var(--bg-2); }
.sa-amtlog-h { font-size: 12.5px; font-weight: 700; color: var(--text); margin-bottom: 6px; display: flex; align-items: baseline; gap: 8px; }
.sa-amtlog-h .hint { font-weight: 400; }
.sa-amtlog table.tb { margin: 0; }

/* 表单记录（2026-11-05 需求第一条）：弹窗底部灰字留痕 */
.form-log {
  margin: 0 20px; padding: 10px 0 4px; border-top: 1px dashed var(--line);
  color: var(--text-3); font-size: 12px; line-height: 1.8;
}
.form-log-h { font-weight: 600; color: var(--text-3); font-size: 12px; margin-bottom: 2px; }
.form-log-b div { white-space: normal; word-break: break-all; }
.form-log-b { max-height: 132px; overflow: auto; }

/* 已删除页签（回收站入口，2026-11-05 需求第二条）：固定在页签最右，弱化显示 */
.tab-trash {
  margin-left: auto; color: var(--text-3) !important; font-size: 12.5px;
}
.tab-trash:hover { color: var(--danger) !important; }
.toolbar .tab-trash { align-self: center; }

/* ── 开票明细（2026-11-05 需求：自动按标号列明细 + 税额拆分 + 可编辑） ── */
.ipills { display: flex; flex-wrap: wrap; gap: 6px; }
.ipill { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; cursor: pointer; font-size: 12.5px; background: var(--bg-2); }
.ipill input { display: none; }
.ipill.on { border-color: var(--primary); color: var(--primary); background: var(--primary-weak, rgba(0, 110, 255, .08)); font-weight: 600; }

.inv-lines { margin-top: 10px; border: 1px solid var(--line-soft); border-radius: 8px; overflow: hidden; }
.inv-lines-hd { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 10px; background: var(--bg-2); border-bottom: 1px solid var(--line-soft); }
.inv-lines-hd .grow { flex: 1; }
.inv-lines-bd { max-height: 320px; overflow: auto; }
.inv-lines table.tb { margin: 0; min-width: 720px; }
.inv-lines table.tb th, .inv-lines table.tb td { padding: 4px 6px; font-size: 12.5px; white-space: nowrap; }
.inv-lines table.tb thead th { position: sticky; top: 0; background: var(--bg-2); z-index: 2; }
.ln-in { width: 96px; height: 26px; padding: 0 6px; border: 1px solid var(--line-soft); border-radius: 4px; background: var(--bg); }
.ln-num { width: 82px; height: 26px; padding: 0 6px; text-align: right; border: 1px solid var(--line-soft); border-radius: 4px; background: var(--bg); }
.ln-ro { color: var(--text-2); font-variant-numeric: tabular-nums; }
.inv-lines tfoot td { background: var(--bg-2); font-weight: 600; }
.inv-diff { padding: 6px 10px; font-size: 12px; border-top: 1px dashed var(--line-soft); }
.inv-diff.warn { color: var(--danger); }
.inv-diff.ok { color: var(--text-2); }
.inv-warn { margin-top: 6px; font-size: 12px; line-height: 1.7; color: var(--text-2); }
.inv-warn div::before { content: "· "; }
.inv-src { display: inline-block; padding: 0 5px; border-radius: 3px; font-size: 11px; border: 1px solid var(--line); color: var(--text-2); }
.inv-src.history { border-color: var(--success, #17a673); color: var(--success, #17a673); }
.inv-src.estimate { border-color: var(--warn, #d98500); color: var(--warn, #d98500); }
.inv-src.preopen { border-color: var(--danger); color: var(--danger); }
.inv-prof { margin-top: 12px; padding: 10px; border: 1px solid var(--line-soft); border-radius: 8px; background: var(--bg-2); }
.inv-prof-h { font-size: 12.5px; font-weight: 700; margin-bottom: 8px; display: flex; gap: 8px; align-items: baseline; }
.inv-prof-h .hint { font-weight: 400; }

/* 预开票偏差表（2026-11-05 第 5 步）：超 3 个月的行整行淡淡标红 */
.pre-tb th, .pre-tb td { white-space: nowrap; }
.pre-tb tbody tr.pre-warn td { background: var(--danger-soft); }
.pre-tb tbody tr.pre-warn:hover td { background: #fbdfdd; }

/* ================= 权限中心（2026-11-05 升级，参考氚云） ================= */
.pc-wrap { display: flex; height: calc(78vh - 40px); min-height: 440px; gap: 10px; }
.pc-col { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-sm);
  display: flex; flex-direction: column; min-width: 0; overflow: hidden; }
.pc-left { width: 190px; flex: 0 0 190px; }
.pc-mid { width: 340px; flex: 0 0 340px; }
.pc-right { flex: 1; }
.pc-col-h { padding: 10px 12px; font-weight: 650; font-size: 13px; display: flex; align-items: center;
  gap: 8px; background: var(--bg); border-bottom: 1px solid var(--line-soft); }
.pc-hint { font-weight: 400; color: var(--text-3); font-size: 11.5px; margin-left: auto; }
.pc-q { padding: 8px 10px; border-bottom: 1px solid var(--line-soft); }
.pc-q input { width: 100%; padding: 6px 9px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--panel); outline: none; }
.pc-q input:focus { border-color: var(--primary); }
.pc-list { flex: 1; overflow: auto; padding: 6px; }

.pc-role { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: var(--radius-sm);
  cursor: pointer; color: var(--text-2); }
.pc-role:hover { background: var(--bg); }
.pc-role.on { background: var(--primary-soft); color: var(--primary); font-weight: 650; }
.pc-role-n { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pc-role-t { font-size: 11px; color: var(--text-3); }
.pc-role.on .pc-role-t { color: var(--primary); }

.pc-grp { margin-bottom: 4px; }
.pc-grp-h { display: flex; align-items: center; gap: 7px; padding: 7px 8px; border-radius: var(--radius-sm);
  cursor: pointer; font-weight: 650; color: var(--text-2); }
.pc-grp-h:hover { background: var(--bg); }
.pc-grp-i { width: 16px; text-align: center; color: var(--text-3); }
.pc-grp-n { flex: 1; }
.pc-grp-a { display: flex; gap: 1px; flex: 0 0 auto; }
.pc-grp-a b { font-weight: 400; font-size: 11.5px; color: var(--primary); cursor: pointer;
  padding: 1px 6px; border-radius: 4px; white-space: nowrap; }
.pc-grp-a b:hover { background: var(--primary-soft); }
.pc-grp-a b.dim { color: var(--text-3); cursor: default; }
.pc-grp-a b.dim:hover { background: transparent; }
.pc-grp-c { font-size: 11px; color: var(--text-3); font-weight: 400; min-width: 34px; text-align: right; }
.pc-form { display: flex; align-items: center; gap: 8px; padding: 6px 8px 6px 14px;
  border-radius: var(--radius-sm); cursor: pointer; color: var(--text-2); }
.pc-form:hover { background: var(--bg); }
.pc-form.on { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.pc-form-n { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pc-form input[type=checkbox], .pc-chk input, .pc-radio input { accent-color: var(--primary); }
.pc-tag { font-size: 10.5px; padding: 1px 5px; border-radius: 4px; background: var(--line-soft);
  color: var(--text-3); font-weight: 400; white-space: nowrap; }
.pc-tag.b { background: var(--primary-soft); color: var(--primary); }
.pc-empty { color: var(--text-3); text-align: center; padding: 24px 10px; font-size: 12.5px; }

.pc-sec { padding: 12px 14px; border-bottom: 1px solid var(--line-soft); }
.pc-sec:last-child { border-bottom: 0; }
.pc-sec-h { display: flex; align-items: center; gap: 8px; font-weight: 650; margin-bottom: 9px; }
.pc-sec-h .lk, .pc-sec-h button.lk { margin-left: auto; }
.pc-sec-h .lk + .lk { margin-left: 4px; }
.pc-chks { display: flex; flex-wrap: wrap; gap: 7px; }
.pc-chk { display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px; border: 1px solid var(--line);
  border-radius: 20px; cursor: pointer; color: var(--text-2); background: var(--panel); font-size: 12.5px; }
.pc-chk.on { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.pc-radios { display: flex; flex-wrap: wrap; gap: 8px; }
.pc-radio { display: inline-flex; align-items: center; gap: 5px; padding: 5px 12px; border: 1px solid var(--line);
  border-radius: var(--radius-sm); cursor: pointer; color: var(--text-2); font-size: 12.5px; }
.pc-radio.on { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.pc-cfg { margin-top: 10px; display: grid; gap: 8px; }
.pc-cust-h { font-size: 12px; color: var(--text-2); margin-bottom: 5px; }
.pc-chips { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; padding: 5px 6px;
  border: 1px dashed var(--line); border-radius: var(--radius-sm); min-height: 32px; }
.pc-chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 7px; border-radius: 4px;
  background: var(--primary-soft); color: var(--primary); font-size: 12px; }
.pc-chip b { cursor: pointer; font-weight: 400; opacity: .7; }
.pc-chip b:hover { opacity: 1; color: var(--danger); }
.pc-chip-in { flex: 1; min-width: 140px; border: 0; outline: none; background: transparent; padding: 3px 2px; }

/* ===== 无销售单价查看权限：顶栏提示（金额 / 单价已全站隐藏） ===== */
.money-tip {
  display: inline-flex; align-items: center; gap: 4px;
  margin-right: 8px; padding: 3px 9px; border-radius: 999px;
  background: #fff7e6; color: #b45309; border: 1px solid #fde3b0;
  font-size: 12px; white-space: nowrap; cursor: default;
}
/* 价格表页底部的表单记录（谁·何时·改了什么） */
.ps-flog { margin: 14px 0 6px; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: 8px; background: #fafbfc; }
.ps-flog-h { font-weight: 600; font-size: 13px; color: #475569; margin-bottom: 6px; }
.ps-flog-b { font-size: 12px; color: #64748b; line-height: 1.85; max-height: 168px; overflow: auto; }
.ps-flog-b > div { padding: 1px 0; }

/* ===== 采购结算（第三批需求 2026-11-06） ===== */
/* 单号里的年月数字换色，一眼看出是哪个月的单 */
.no-dt { color: var(--primary); font-weight: 600; }
/* 手工插入的「特殊情况」行：淡黄底，和过磅行区分开 */
.pud-fee > td { background: #fffdf3; }
.pud-fee .pud-i[data-k="amount"] { color: var(--danger); font-weight: 600; }

/* ===== 现金日记账（原现金流量表，2026-11-06 重做） ===== */
/* 三大类小卡片：一眼看出军泰 / 合泰 / 其他各有多少钱 */
.cf-kpis { display: flex; gap: 12px; padding: 14px 16px 4px; flex-wrap: wrap; }
.cf-kpi {
  flex: 1 1 210px; min-width: 200px; padding: 12px 14px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--panel);
}
.cf-kpi.total { background: #f7f9ff; border-color: #d9e3ff; }
/* 「其中：重点账户余额」——从合计里拆出来的一小块，弱化边框，不抢合计的位置 */
.cf-kpi.mark { flex: 0 1 216px; background: #fffdf6; border-color: #eadfc6; }
.cf-kpi.mark .val { font-size: 19px; color: #8a6a24; }
.cf-kpi .lab { display: flex; align-items: baseline; justify-content: space-between;
  font-size: 12.5px; color: var(--text-2); font-weight: 600; }
.cf-kpi .val { font-size: 21px; font-weight: 700; margin: 6px 0 4px; letter-spacing: .2px;
  font-variant-numeric: tabular-nums; }
.cf-kpi .foot { font-size: 11.5px; color: var(--text-3); }

.cf-tbwrap { padding: 6px 16px 0; overflow-x: auto; }
.cf-tb tbody tr.cf-row { cursor: pointer; }
.cf-tb tbody tr.cf-row:hover > td { background: #f6f9ff; }
.cf-in { color: #c0392b; }          /* 收入：红（中式账表习惯，与 A 股涨红一致） */
.cf-out { color: #1f7a45; }         /* 支出：绿 */
.cf-dir { font-size: 11.5px; padding: 2px 7px; border-radius: 999px; }
.cf-dir.in { background: #fdecea; color: #c0392b; }
.cf-dir.out { background: #e9f7ef; color: #1f7a45; }

/* 手工录入 / 表格导入 / 去重（2026-11-06） */
.cf-rec-help { padding: 2px 2px 8px; line-height: 1.6; }
.cf-rec-tb td { padding: 3px 4px; }
.cf-rec-tb input, .cf-rec-tb select { height: 28px; font-size: 12.5px; width: 100%; box-sizing: border-box; }
.cf-rec-bar { display: flex; align-items: center; gap: 8px; padding: 8px 2px; flex-wrap: wrap; }
.cf-dup { margin-top: 10px; border: 1px solid #f0c9c4; background: #fff7f6; border-radius: 8px; padding: 10px 12px; }
.cf-dup-h { font-size: 13px; color: #a8322a; margin-bottom: 6px; }
.cf-dup-list { max-height: 190px; overflow: auto; }
.cf-dup-i { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; font-size: 12.5px;
  padding: 4px 0; border-bottom: 1px dashed #f3ddd9; }
.cf-dup-i:last-child { border-bottom: 0; }
.cf-dup-i .muted { color: var(--text-3); }
.cf-dup-tag { font-size: 11px; padding: 1px 7px; border-radius: 999px;
  background: #fdecea; color: #c0392b; white-space: nowrap; }
.cf-dup-tag.same { background: #c0392b; color: #fff; }
.cf-dup-btns { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.cf-imp-first { padding: 2px; line-height: 1.6; }
.cf-imp-pick { margin: 12px 0 6px; }
.cf-imp-sum { padding: 12px 2px 8px; font-size: 13px; }
.cf-imp-note { font-size: 12.5px; color: var(--text-2); background: #fffaf0;
  border: 1px solid #f0e0c0; border-radius: 8px; padding: 8px 10px; margin-bottom: 8px;
  display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; align-items: center; }
.cf-imp-tb td { padding: 3px 5px; }
.cf-imp-dup > td { background: #fffafa; }
.cf-imp-bad > td { background: #f7f7f7; color: var(--text-3); }
.cf-imp-bar { display: flex; align-items: center; gap: 10px; padding: 10px 2px 2px; flex-wrap: wrap; }
/* 已替代掉 N 条单据流水的标记 */
.cf-mgd { margin-left: 4px; font-size: 10.5px; padding: 0 4px; border-radius: 4px;
  background: #eef3ff; color: #3b5bdb; }

/* 重点账户：整行色底 + ★，账户名前色点 */
.cf-tb tbody tr.cf-mark > td { font-weight: 600; }
.cf-tb tbody tr.cf-mark:hover > td { background: transparent; }
.cf-tb tbody tr.cf-mark { transition: filter .12s; }
.cf-tb tbody tr.cf-mark:hover { filter: brightness(.955); }
.cf-star { color: #e6a700; font-size: 11px; margin-left: 4px; vertical-align: 1px; }
.cf-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, .18); margin-right: 5px; vertical-align: 0; }
.cf-mark { -webkit-print-color-adjust: exact; print-color-adjust: exact; }

/* 标记色选择条 */
.cf-mkbar { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.cf-mkbar input { width: 190px; }
.cf-mksw { display: inline-flex; align-items: center; gap: 4px; height: 26px; padding: 0 8px;
  border: 1px solid var(--line); border-radius: 6px; background: #fff; cursor: pointer;
  font-size: 11.5px; color: var(--text-2); }
.cf-mksw i { width: 12px; height: 12px; border-radius: 3px; border: 1px solid rgba(0, 0, 0, .16); }
.cf-mksw.on { border-color: #4874cb; box-shadow: 0 0 0 2px rgba(72, 116, 203, .16); color: #2f4f8f; }

.cf-pager { display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 10px 16px 6px; }
.cf-pager-r { display: flex; align-items: center; gap: 8px; }
.cf-other-bar { display: flex; align-items: center; gap: 10px; padding: 12px 16px 8px; flex-wrap: wrap; }
.cf-note { padding: 10px 16px 14px; line-height: 1.8; }

/* 两级账户选择：大类 + 账户并排 */
.cf-pick { display: inline-flex; gap: 6px; align-items: center; min-width: 0; }
.cf-pick select { min-width: 96px; }
.cf-pick select.cf-acct { min-width: 150px; }
.cf-pick-inline { display: inline-flex; align-items: center; }
.toolbar .cf-pick select { height: 30px; }
.form-grid .cf-pick { width: 100%; }
.form-grid .cf-pick select { flex: 1 1 0; min-width: 0; }

@media (max-width: 820px) {
  .cf-kpis { flex-direction: column; }
  .cf-kpi { min-width: 0; }
  /* 竖排时 flex-basis 会变成高度，必须还原 */
  .cf-kpi.mark { flex: 0 1 auto; }
  .cf-pick { flex-wrap: wrap; }
  .cf-pick select { flex: 1 1 140px; }
}
/* 期间快捷按钮整组不拆行（否则会被挤成两行） */
.toolbar > .cf-quick { display: inline-flex; gap: 6px; flex: 0 0 auto; white-space: nowrap; }
.cf-tb td:nth-child(1) { white-space: nowrap; }

/* ==================== 劳务：搅拌车租赁结算表（照用户纸质样张，2026-11-06） ====================
   版面与导出的 XLSX 一一对应：表头（标题/甲方乙方/结算周期）→ 按车明细 → 合计
   → 本期结算金额+大写 → 双盖章 → 核算口径说明。改这里记得同步 xlsx_export.labor_settle_workbook。 */
.lbd-sheet {
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px 16px 16px;
  font-family: "仿宋", "FangSong", "STFangsong", "SimSun", serif;
  overflow-x: auto;
}
.lbd-sheet .lbd-t {
  text-align: center;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 3px;
  padding: 2px 0 12px;
  white-space: nowrap;
}
.lbd-hd, .lbd-bd { width: 100%; border-collapse: collapse; table-layout: fixed; min-width: 860px; }
.lbd-hd th, .lbd-hd td, .lbd-bd th, .lbd-bd td {
  border: 1px solid rgba(122, 134, 160, .55);
  padding: 5px 6px;
  font-size: 13px;
  line-height: 1.35;
  vertical-align: middle;
  word-break: break-all;
}
.lbd-hd th { text-align: right; font-weight: 700; font-size: 14px; white-space: nowrap; }
.lbd-hd td.v { text-align: center; font-weight: 700; font-size: 14px; }
.lbd-hd td.p { text-align: center; padding: 2px 4px; }
.lbd-hd .pl { font-weight: 700; font-size: 14px; }
.lbd-hd .pv { font-weight: 700; font-size: 14px; margin-top: 2px; }
.lbd-bd thead th {
  text-align: center; font-weight: 700; background: var(--line-soft, #edf0f6); white-space: nowrap;
}
.lbd-bd tbody td { font-size: 12.5px; }
.lbd-bd td.c { text-align: center; }
.lbd-bd td.num { text-align: right; white-space: nowrap; }
.lbd-bd td.l { text-align: left; }
.lbd-bd tfoot td { font-weight: 700; background: var(--primary-soft); font-size: 12.5px; }
.lbd-bd tr.lbd-fee td { background: rgba(199, 122, 8, .07); }
.lbd-tot {
  display: flex; border: 1px solid rgba(122, 134, 160, .55); border-top: 0; font-size: 14px;
}
.lbd-tot > span { display: flex; align-items: center; padding: 6px 8px; font-weight: 700; }
.lbd-tot .lb { flex: 0 0 20%; justify-content: center; border-right: 1px solid rgba(122, 134, 160, .55); }
.lbd-tot .lv { flex: 0 0 24%; justify-content: center; border-right: 1px solid rgba(122, 134, 160, .55); }
.lbd-tot .cu { flex: 0 0 10%; justify-content: flex-end; border-right: 1px solid rgba(122, 134, 160, .55); }
.lbd-tot .cv { flex: 1 1 auto; justify-content: flex-start; font-weight: 700; }
.lbd-sig {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px 24px;
  margin-top: 14px; font-size: 14px; font-weight: 700;
}
.lbd-sig > div:nth-child(even) { padding-left: 16%; }
.lbd-notes { margin-top: 14px; font-size: 13px; line-height: 1.75; }
.lbd-notes .h { font-weight: 700; margin-bottom: 2px; }
.lbd-sheet .lbd-i {
  height: 22px; padding: 0 3px; border: 1px solid var(--line); border-radius: 4px;
  background: var(--panel); color: var(--text); font-size: 12px;
}
.lbd-sheet input[type=number]::-webkit-outer-spin-button,
.lbd-sheet input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.lbd-sheet input[type=number] { -moz-appearance: textfield; appearance: textfield; }
.lbd-sheet .lbd-num { width: 36px; text-align: center; }
.lbd-sheet .lbd-feeamt { width: 72px; text-align: right; }
.lbd-sheet .lbd-pr {
  display: flex; align-items: center; justify-content: flex-end; gap: 2px;
  flex-wrap: nowrap; margin-top: 1px; font-size: 10px; color: var(--text-3); line-height: 1.2;
}
.lbd-sheet .lbd-pr span { white-space: nowrap; }
.lbd-sheet .lbd-pr .lbd-i { width: 40px; height: 17px; font-size: 10.5px; text-align: center; }
.lbd-sheet .lbd-wv { margin-top: 1px; line-height: 1.2; }
.lbd-sheet .lbd-wv { font-size: 11px; color: var(--text-3); text-align: right; white-space: nowrap; }
@media (max-width: 820px) {
  .lbd-sheet { padding: 10px 10px 12px; }
  .lbd-sheet .lbd-t { font-size: 16px; letter-spacing: 1px; }
  .lbd-sig > div:nth-child(even) { padding-left: 6%; }
}

/* ---------- 附件在线预览弹窗（2026-11-06，全站统一） ---------- */
.att-pv { display: flex; flex-direction: column; gap: 8px; }
.att-pv-f {
  width: 100%; height: 68vh; min-height: 380px; border: 1px solid var(--line-soft);
  border-radius: 10px; background: #fff;
}
.att-pv-tip { line-height: 1.6; }
.att-file.link, .ficon.link { cursor: pointer; }
.att-file.link:hover, .ficon.link:hover { filter: brightness(0.92); text-decoration: none; }

/* 表单内的报错 / 必填提示（2026-11-06 出纳审批没反应：提示要看得见） */
.inp-err { display: block; margin-top: 4px; font-size: 12px; line-height: 1.5; color: #d4380d; }
.cf-pick.err select { border-color: #d4380d !important; box-shadow: 0 0 0 2px rgba(212, 56, 13, .12); }
