/* =========================================================================
   UI v2 · 设计系统层（在 style.css 之后加载，统一尺寸 / 间距 / 视觉比例）
   - 字号阶梯：12 / 13 / 14 / 16 / 20 / 24
   - 控件高度：28（紧凑）/ 36（默认）/ 44（导航）
   - 间距基数 4：4 / 8 / 12 / 16 / 24 / 32
   - 圆角：6（标签）/ 8（控件）/ 10（卡片）/ 12（弹窗）
   ========================================================================= */

:root {
  /* 色板 */
  --bg: #f4f6f9;
  --surface: #ffffff;
  --surface-sub: #f8fafc;
  --border: #e4e8ee;
  --border-strong: #d3d9e2;
  --text: #1a1f27;
  --text-2: #566072;
  --text-3: #8a93a2;
  --primary: #1b4a72;
  --primary-dark: #143a5b;
  --primary-soft: #edf3f9;
  --ok: #17795c;
  --ok-soft: #e8f5ef;
  --warn: #98650f;
  --warn-soft: #fdf4e3;
  --danger: #b0302a;
  --danger-soft: #fcecea;

  /* 尺度 */
  --radius: 8px;
  --r-sm: 6px;
  --r-lg: 10px;
  --r-xl: 12px;
  --h-ctl: 36px;
  --h-sm: 28px;
  --h-nav: 44px;
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;
  --fs-xs: 12px;
  --fs-sm: 13px;
  --fs-md: 14px;
  --fs-lg: 16px;
  --fs-xl: 20px;
}

* { box-sizing: border-box; }

body {
  background: var(--bg);
  color: var(--text);
  font-size: var(--fs-md);
  line-height: 1.6;
  letter-spacing: .1px;
}

/* ---------- 布局骨架 ---------- */
.app-shell { display: flex; min-height: 100vh; }
.main-col { flex: 1; min-width: 0; }
main { padding: var(--sp-5) var(--sp-6) var(--sp-6); }

/* ---------- 侧边导航 ---------- */
.sidebar {
  width: 240px; flex: 0 0 240px;
  padding: var(--sp-5) var(--sp-3) var(--sp-4);
  gap: var(--sp-5);
  background: var(--surface);
  border-right: 1px solid var(--border);
}
.brand { padding: 0 var(--sp-2); gap: var(--sp-1); }
.brand-name { font-size: 17px; font-weight: 700; letter-spacing: .2px; }
.brand-name::before { height: 17px; width: 3px; border-radius: 2px; }
.brand-sub { font-size: var(--fs-xs); color: var(--text-3); }

.sidebar nav { gap: var(--sp-1); }
.nav-btn {
  height: var(--h-nav);
  font-size: var(--fs-lg);
  font-weight: 500;
  gap: var(--sp-3);
  padding: 0 var(--sp-3);
  border-radius: var(--r-md);
  color: var(--text-2);
}
.nav-btn .nav-ico {
  font-size: var(--fs-xs);
  flex: 0 0 20px; width: 20px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}
.nav-btn:hover { background: #f2f5f9; color: var(--text); }
.nav-btn.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.nav-btn.active .nav-ico { color: var(--primary); }
.sidebar-foot { font-size: var(--fs-xs); color: var(--text-3); padding: 0 var(--sp-2); margin-top: auto; }

/* ---------- 页面头（各视图统一） ---------- */
.page-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: var(--sp-4); margin-bottom: var(--sp-4); flex-wrap: wrap;
}
.page-head h1 { margin: 0; font-size: var(--fs-xl); font-weight: 650; letter-spacing: .2px; color: var(--text); }
.page-head .page-sub { margin: 2px 0 0; font-size: var(--fs-sm); color: var(--text-3); }
.page-head .page-actions { display: flex; align-items: center; gap: var(--sp-2); }

/* ---------- 工具栏 ---------- */
.toolbar {
  display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap;
  padding: var(--sp-3) var(--sp-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  margin-bottom: var(--sp-4);
}
.toolbar .muted { font-size: var(--fs-sm); }

/* ---------- 表单控件 ---------- */
input, select, textarea {
  height: var(--h-ctl);
  font-size: var(--fs-md);
  padding: 0 var(--sp-3);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
textarea { height: auto; padding: var(--sp-2) var(--sp-3); line-height: 1.6; }
input:focus, select:focus, textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(27, 74, 114, .1);
  outline: none;
}
input::placeholder, textarea::placeholder { color: #a7aeba; }
input[type="checkbox"], input[type="radio"] { height: auto; }

.form-grid { gap: var(--sp-3) var(--sp-4); }
.form-grid label { font-size: var(--fs-sm); color: var(--text-2); gap: var(--sp-1); }

/* ---------- 按钮 ---------- */
button {
  height: var(--h-ctl);
  font-size: var(--fs-md);
  font-weight: 500;
  padding: 0 var(--sp-4);
  border-radius: var(--r-md);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
  white-space: nowrap;
}
button:hover { background: #f4f7fa; border-color: var(--primary); color: var(--primary); }
button.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
button.primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; }
button.danger { color: var(--danger); border-color: #e6c3c0; background: #fff; }
button.danger:hover { background: var(--danger-soft); border-color: var(--danger); color: var(--danger); }
button:disabled { opacity: .55; cursor: not-allowed; }

td button, .table-wrap button, .toolbar button.sm {
  height: var(--h-sm);
  font-size: var(--fs-sm);
  padding: 0 var(--sp-3);
  border-radius: var(--r-sm);
}
.toolbar button, .tabs .tab-btn, .page-switch .ps-btn { height: var(--h-ctl); }

/* ---------- 卡片 ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--sp-4) var(--sp-5);
  margin-bottom: var(--sp-4);
  box-shadow: none;
}
.card h3 { font-size: var(--fs-lg); font-weight: 600; margin: 0 0 var(--sp-2); }

/* ---------- 表格 ---------- */
.table-wrap {
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
  margin-bottom: var(--sp-4);
}
table { font-size: var(--fs-sm); }
th {
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--text-2);
  background: var(--surface-sub);
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  letter-spacing: .2px;
}
td {
  padding: 12px 14px;
  border-bottom: 1px solid #f0f3f7;
  color: var(--text);
}
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #f9fbfd; }
.exp-table th { background: var(--surface-sub); }
td .muted, td div.muted { font-size: var(--fs-xs); color: var(--text-3); }
td.empty { font-size: var(--fs-sm); color: var(--text-3); }

/* ---------- 标签 ---------- */
.badge {
  display: inline-flex; align-items: center;
  height: 22px;
  font-size: var(--fs-xs);
  font-weight: 500;
  padding: 0 8px;
  border-radius: var(--r-sm);
  background: #eef1f6; color: var(--text-2);
}
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.doing { background: var(--warn-soft); color: var(--warn); }
.badge.rej { background: var(--danger-soft); color: var(--danger); }
.badge.no { background: #eef1f6; color: var(--text-2); }

/* ---------- 页签 ---------- */
.tabs { display: flex; gap: var(--sp-5); border-bottom: 1px solid var(--border); margin-bottom: var(--sp-4); }
.tab-btn {
  height: 40px; padding: 0 2px;
  border: 0; background: none; border-radius: 0;
  font-size: var(--fs-md); color: var(--text-2);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab-btn:hover { background: none; color: var(--primary); border-color: transparent; }
.tab-btn.active { color: var(--primary); font-weight: 600; border-bottom-color: var(--primary); }

.page-switch { gap: var(--sp-2); margin-bottom: var(--sp-4); }
.ps-btn { border-radius: var(--r-md); font-size: var(--fs-md); padding: 0 var(--sp-4); }
.ps-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ---------- 弹窗：一律上下左右居中，超高可滚动 ---------- */
.modal {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-5);
  overflow-y: auto;
  overflow-x: hidden;
}
.modal-box {
  margin: auto;                                  /* 内容超高时改为从顶部开始并可滚动，不会被裁掉 */
  height: auto;                                  /* 内容自适应，天然上下居中 */
  max-height: calc(100vh - 2 * var(--sp-5));
  border-radius: var(--r-xl);
  border: 1px solid var(--border);
  box-shadow: 0 16px 48px rgba(16, 24, 40, .2);
}
/* 弹窗统一宽度（2026-11-21 宽屏优化）：主内容区更宽松、减少拥挤；移动端 94vw 自适应不溢出 */
.modal .modal-box,
.modal-box.inv-box,
.modal-box.subpay-box,
.modal-box.ui-dialog-box { width: min(1220px, 94vw); }
/* 独立填报弹窗：多一列「事由」，加宽至 1480 */
#standalone-modal .modal-box { width: min(1480px, 96vw); }
/* 费用录入表：控件填满列宽，宽屏下均匀分布不失衡 */
.exp-table input:not([type="file"]):not([type="checkbox"]),
.exp-table select,
.exp-table textarea { width: 100%; }
.modal-body { overflow-x: auto; }
.modal-head { padding: var(--sp-3) var(--sp-5); background: var(--surface); border-bottom: 1px solid var(--border); flex-shrink: 0; cursor: move; }
.modal-head button, .modal-head a, .modal-head input, .modal-head select { cursor: pointer; }
.modal-title { font-size: var(--fs-lg); font-weight: 600; }
.modal-body { background: var(--surface-sub); padding: var(--sp-4) var(--sp-5); }
.modal-foot { padding: var(--sp-3) var(--sp-5); background: var(--surface); border-top: 1px solid var(--border); flex-shrink: 0; }

/* 需要占满高度的弹窗（附件预览 / 项目时间轴）显式撑高 */
#att-modal .modal-box { height: min(84vh, 920px); }
#track-modal .modal-box { height: min(86vh, 960px); }
/* 弹窗层级（2026-11-21 修复附件预览被单据弹窗遮挡）：
   基础弹窗 100（style.css）＜ 附件预览 120（可从任意弹窗内打开，必须居顶）＜ 提示对话框 130 */
#att-modal { z-index: 120; }
#ui-dialog { z-index: 130; }
/* 轻量弹窗：宽度固定、高度随内容 */
#inv-view-modal .modal-box,
#transfer-modal .modal-box,
#inv-modal .modal-box { height: auto; }

@media (max-height: 640px) {
  .modal { padding: var(--sp-2); }
  .modal-box { max-height: calc(100vh - 2 * var(--sp-2)); }
}

/* ---------- 看板 ---------- */
.dash-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r-lg);
  margin-bottom: var(--sp-4);
}
/* 口径切换（期间 / 时点）与档位按钮：全部直接可见可点 */
.seg { display: inline-flex; border: 1px solid var(--border, #d8dde6); border-radius: 6px; overflow: hidden; vertical-align: middle; }
.seg button { border: 0; background: var(--surface, #fff); padding: 6px 12px; cursor: pointer; font-size: 13px; color: var(--text, #333); border-radius: 0; white-space: nowrap; }
.seg button + button { border-left: 1px solid var(--border, #d8dde6); }
.seg button.on { background: var(--primary); color: #fff; font-weight: 600; }
.seg button:not(.on):hover { background: var(--primary-soft); color: var(--primary); }
.mini-btn { padding: 5px 10px; font-size: 12px; cursor: pointer; border-radius: 6px; }
#dash-step { margin-left: 2px; }
#dash-asof-note { flex-basis: 100%; }

/* 状态多选下拉（承接列表 / 项目列表共用） */
.ms { position: relative; display: inline-block; }
.ms-btn { min-width: 118px; text-align: left; }
.ms-btn::after { content: ' ▾'; color: #8a94a3; font-size: 11px; margin-left: 2px; }
.ms-panel {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 90;
  background: var(--surface, #fff); border: 1px solid var(--border, #d8dde6); border-radius: 10px;
  padding: 10px 12px; min-width: 232px;
  box-shadow: 0 12px 30px rgba(20, 40, 70, .16);
}
.ms-acts {
  display: flex; gap: 6px; margin-bottom: 8px; padding-bottom: 8px;
  border-bottom: 1px dashed var(--border, #e3e8ee);
}
.ms-acts .mini-btn { padding: 3px 12px; font-size: 12px; border-radius: 999px; color: var(--primary); }
.ms-list { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 6px; }
.ms-panel label {
  display: flex; align-items: center; gap: 7px;
  padding: 5px 8px; margin: 0; cursor: pointer;
  font-size: 13px; white-space: nowrap; border-radius: 6px;
}
.ms-panel label:hover { background: var(--primary-soft); }
.ms-panel input[type=checkbox] { width: 15px; height: 15px; margin: 0; flex: 0 0 auto; }
.ms-hint {
  margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--border, #e3e8ee);
  font-size: 11.5px; line-height: 1.5; color: var(--text-3, #8a94a3);
}

/* 履约保函申请参数面板 */
.g-wrap {
  background: var(--primary-soft, #edf3f9); border: 1px dashed var(--border, #c9d4e2);
  border-radius: 8px; padding: 12px 14px;
}
.g-title { font-size: 13px; font-weight: 600; margin-bottom: 10px; color: var(--primary); }
.g-fields { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px 14px; }
.g-fields label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.g-fields .span-2 { grid-column: span 2; }
.g-fields input, .g-fields select {
  padding: 6px 8px; border: 1px solid var(--border, #d8dde6); border-radius: 6px; font-size: 13px; background: #fff;
}
.g-tip { font-size: 11px; color: #8a94a3; }
.g-hint { grid-column: 1 / -1; font-size: 12px; line-height: 1.6; }
.g-row td { background: transparent; padding-top: 0; }
/* 保函办理反馈弹窗：申请信息摘要（财务据此开函） */
.gfb-sum {
  background: var(--primary-soft, #edf3f9); border-radius: 8px;
  padding: 10px 12px; margin-bottom: 12px; font-size: 13px; line-height: 1.7;
}
.dash-kpi { gap: var(--sp-3); margin-bottom: var(--sp-4); }
.kpi-card { border-radius: var(--r-lg); padding: var(--sp-3) var(--sp-4); border-left-width: 3px; }
.kpi-label { font-size: var(--fs-xs); }
.kpi-value { font-size: 21px; font-weight: 650; margin: var(--sp-1) 0 2px; }
.kpi-sub { font-size: var(--fs-xs); }
.dash-sec { border-radius: var(--r-lg); padding: var(--sp-4) var(--sp-5); margin-bottom: var(--sp-4); }
.dash-sec-head { margin-bottom: var(--sp-3); }
.dash-sec-head h3 { font-size: var(--fs-md); font-weight: 600; }
.dash-cols { gap: var(--sp-4); }
.dash-table th, .dash-table td { font-size: var(--fs-sm); }

/* ---------- 其它统一 ---------- */
.muted { font-size: var(--fs-sm); color: var(--text-3); }
.hidden { display: none !important; }
.fin-filters, .fin-summary, .recv-bar, .fin-row { font-size: var(--fs-md); }
.detail-back { height: var(--h-sm); font-size: var(--fs-sm); }
.org-item, .perm-panel-box, .tf-grid { border-radius: var(--r-md); }
.timeline .tl-title { font-size: var(--fs-md); }

/* ---------- 应收台账筛选区统一（日期区间等宽、控件同尺寸） ---------- */
.fin-filters { padding: var(--sp-4); gap: var(--sp-3); border-radius: var(--r-lg); }
.fin-row { gap: var(--sp-2); }
.fin-row > input:not([type="date"]),
.fin-row > select { width: 168px; flex: 0 0 168px; }
.fin-row > input[type="date"] { width: 150px; flex: 0 0 150px; }
.fin-ranges { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-2) var(--sp-5); }
.fin-range { gap: var(--sp-1); }
.fin-range > label { font-size: var(--fs-xs); }
.fin-range-ctl { gap: var(--sp-2); }
.fin-range-ctl > span { font-size: var(--fs-xs); }
.fin-range-ctl input[type="date"] { flex: 1 1 0; width: auto; min-width: 0; }
.fin-summary { gap: var(--sp-3); }
.fin-card { padding: var(--sp-3) var(--sp-4); border-radius: var(--r-lg); }
.fin-card .fin-num { font-size: 19px; margin: 2px 0 0; }
.fin-hint { font-size: var(--fs-xs); line-height: 1.7; }
.recv-bar { margin-bottom: var(--sp-3); gap: var(--sp-3); }
.recv-bar .muted, .recv-sel-count { font-size: var(--fs-sm); }

/* 空表格不出现横向滚动条 */
.table-wrap:has(td.empty) { overflow-x: hidden; }
td.empty { padding: var(--sp-6) var(--sp-4); }

/* 弹窗内表单统一 */
.modal-body .form-grid label { font-size: var(--fs-sm); }
.modal-actions button { height: var(--h-sm); font-size: var(--fs-sm); }

/* ---------- 表格内操作按钮间距 ---------- */
td button + button, td button + .badge, td .badge + button { margin-left: var(--sp-1); }

/* ---------- 看板空态 ---------- */
.chart-empty {
  height: 132px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; color: var(--text-3); font-size: var(--fs-sm);
  background: var(--surface-sub); border: 1px dashed var(--border); border-radius: var(--r-md);
}
.chart-empty .muted { font-size: var(--fs-xs); }
.kpi-card { padding: var(--sp-3) var(--sp-4); }
.dash-sec .table-wrap { margin-bottom: 0; }

/* ---------- 承接录入表单：一行五列（2026-11-21 俊强定稿）----------
   顺序：项目名称、业主、项目代码、项目投资概算（万元）、承接负责人；
   宽度比例 3.58 : 2 : 2 : 1.4 : 1.4（俊强 2026-11-21 定） */
.form-grid.row5 { grid-template-columns: minmax(0, 3.58fr) minmax(0, 2fr) minmax(0, 2fr) minmax(0, 1.4fr) minmax(0, 1.4fr); }
.sub-grid-5 { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.1fr) minmax(0, 1.1fr) minmax(0, 1fr) minmax(0, 1fr); }
#bid-new-box h3 { font-size: var(--fs-md); color: var(--text-2); font-weight: 600; margin: var(--sp-4) 0 var(--sp-2); }
.form-mode {
  display: inline-flex; align-items: center; gap: 6px;
  height: 26px; padding: 0 10px; margin-bottom: var(--sp-3);
  border-radius: var(--r-sm); background: var(--primary-soft);
  color: var(--primary); font-size: var(--fs-xs);
}
.form-mode strong { font-weight: 600; }

/* ---------- 站内对话框（替代浏览器原生 alert / confirm / prompt） ---------- */
.ui-dialog-box { width: min(460px, 92vw); }
.ui-dialog-box .modal-body { background: var(--surface); padding: var(--sp-4) var(--sp-5) var(--sp-3); }
.ui-dialog-msg { font-size: var(--fs-md); color: var(--text); line-height: 1.75; white-space: pre-line; word-break: break-word; }
.ui-dialog-input { width: 100%; margin-top: var(--sp-3); }
.ui-dialog-err { margin-top: var(--sp-2); font-size: var(--fs-xs); color: var(--danger); }
.ui-dialog-foot { gap: var(--sp-2); }

/* 承接单「文件」行：只上传招标文件 */
.doc-upload { margin-top: var(--sp-2); display: flex; gap: var(--sp-2); align-items: center; flex-wrap: wrap; }
.doc-upload .muted { font-size: var(--fs-sm); }
.doc-upload input[type="file"] { width: auto; max-width: 320px; height: var(--h-ctl); padding: 6px 10px; }


/* ---------- 导航徽标 ---------- */
.nav-btn .nav-badge {
  margin-left: auto;
  min-width: 20px; height: 20px; padding: 0 6px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 10px;
  background: var(--warn-soft); color: var(--warn);
  font-size: 11.5px; font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.nav-btn .nav-badge.overdue { background: var(--danger-soft); color: var(--danger); }

/* ---------- 通知中心页面 ---------- */
.notice-summary {
  display: flex; align-items: center; gap: var(--sp-5);
  padding: var(--sp-3) var(--sp-4);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  margin-bottom: var(--sp-3);
  font-size: var(--fs-sm); color: var(--text-2);
}
.notice-summary .ns-item b { color: var(--text); font-variant-numeric: tabular-nums; }
.notice-summary .ns-item.warn b { color: var(--warn); }
.notice-summary .ns-item.danger b { color: var(--danger); }

.notice-page-list { display: flex; flex-direction: column; gap: var(--sp-2); }
.notice-card {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  background: var(--surface); border: 1px solid var(--border);
  border-left: 3px solid var(--border-strong);
  border-radius: var(--r-lg);
  cursor: pointer;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.notice-card:hover { border-color: var(--primary); background: var(--primary-soft); }
.notice-tag {
  flex: 0 0 auto; height: 22px; padding: 0 8px;
  display: inline-flex; align-items: center;
  border-radius: var(--r-sm);
  background: var(--primary-soft); color: var(--primary);
  font-size: var(--fs-xs); font-weight: 500;
}
.notice-main { min-width: 0; flex: 1 1 auto; }
.notice-name { font-size: var(--fs-md); font-weight: 500; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notice-sub { font-size: var(--fs-xs); color: var(--text-3); margin-top: 2px; }
.notice-right { flex: 0 0 auto; text-align: right; }
.notice-days { font-size: var(--fs-md); font-weight: 600; color: var(--text-2); font-variant-numeric: tabular-nums; }
.notice-date { font-size: var(--fs-xs); color: var(--text-3); margin-top: 2px; font-variant-numeric: tabular-nums; }
.notice-go { flex: 0 0 auto; font-size: var(--fs-sm); color: var(--text-3); }

.notice-card.warn { border-left-color: #d9a227; }
.notice-card.warn .notice-days { color: var(--warn); }
.notice-card.urgent { border-left-color: var(--danger); background: #fffaf9; }
.notice-card.urgent .notice-days { color: var(--danger); }
.notice-card.over { border-left-color: var(--danger); background: var(--danger-soft); }
.notice-card.over .notice-days { color: var(--danger); }
.notice-card.over .notice-tag { background: #f6dcda; color: var(--danger); }

.notice-empty {
  padding: var(--sp-6) var(--sp-4); text-align: center;
  background: var(--surface); border: 1px dashed var(--border); border-radius: var(--r-lg);
  color: var(--text-2); font-size: var(--fs-md); line-height: 2;
}
.notice-empty .muted { font-size: var(--fs-xs); }

/* 分包成果文件补传（迷你上传按钮） */
.upload-mini {
  display: inline-flex; align-items: center;
  height: 24px; padding: 0 8px;
  border: 1px dashed var(--border-strong); border-radius: var(--r-sm);
  color: var(--primary); font-size: var(--fs-xs); cursor: pointer;
  white-space: nowrap;
}
.upload-mini:hover { border-color: var(--primary); background: var(--primary-soft); }
.upload-mini input[type="file"] { display: none; }

/* 工作分工 */
.task-head { display: flex; align-items: baseline; gap: var(--sp-2); margin-bottom: var(--sp-3); }
.task-head strong { font-size: var(--fs-md); }
.task-head .muted { font-size: var(--fs-xs); }
.form-actions { margin-top: var(--sp-3); display: flex; gap: var(--sp-2); }

/* ---------- 侧栏当前用户（已移至主区域右上角顶栏） ---------- */
.topbar {
  display: flex; align-items: center; justify-content: flex-end;
  height: 52px; padding: 0 var(--sp-6);
  background: var(--surface); border-bottom: 1px solid var(--border);
}
.sidebar-user {
  display: flex; align-items: center; gap: var(--sp-2);
}
.sidebar-user .su-name {
  flex: 1 1 auto; font-size: var(--fs-sm); color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sidebar-user .su-btn {
  height: 28px; padding: 0 10px; font-size: var(--fs-xs);
  border-radius: var(--r-sm);
}

.link-mini { color: var(--primary); cursor: pointer; font-size: var(--fs-xs); }
.link-mini:hover { text-decoration: underline; }

/* 数字列通用右对齐 */
th.num, td.num { text-align: right; font-variant-numeric: tabular-nums; }
/* 数字列居中（投资概算等） */
th.ctr, td.ctr { text-align: center; font-variant-numeric: tabular-nums; }
/* 承接列表合同金额：右对齐但略离右侧分隔线（数据微左移） */
#bid-table th.num, #bid-table td.num, #project-table th.num, #project-table td.num { padding-right: 16px; }

/* ---------- 分包付款弹窗 ---------- */
.subpay-box { width: min(880px, 94vw); }
.subpay-box .modal-body { background: var(--surface); padding: var(--sp-4) var(--sp-5) var(--sp-5); }
.subpay-sum { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-2) var(--sp-4);
  background: var(--surface-sub); border: 1px solid var(--border); border-radius: var(--r-md); padding: var(--sp-3) var(--sp-4); }
.subpay-sum .s-item { display: flex; flex-direction: column; gap: 2px; }
.subpay-sum .s-lb { font-size: var(--fs-xs); color: var(--text-3); }
.subpay-sum .s-vl { font-size: var(--fs-md); font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.subpay-sum .s-vl.ok { color: var(--ok); }
.subpay-sum .s-vl.warn { color: var(--danger); }
.subpay-h { display: flex; align-items: baseline; gap: var(--sp-2); margin: var(--sp-4) 0 var(--sp-2);
  font-size: var(--fs-md); font-weight: 600; color: var(--text); }
.subpay-h .muted { font-weight: 400; font-size: var(--fs-xs); }
.subpay-form { display: flex; gap: var(--sp-2); align-items: center; flex-wrap: wrap; margin-top: var(--sp-2); }
.subpay-form input:not([type="file"]) { width: 150px; }
.subpay-form input[type="file"] { width: auto; max-width: 190px; }
.subpay-list { display: flex; flex-direction: column; gap: 4px; }
.subpay-list .sp-row { display: flex; align-items: center; gap: var(--sp-3); padding: 6px 10px;
  background: var(--surface-sub); border-radius: var(--r-sm); font-size: var(--fs-sm); }
.subpay-list .sp-row .sp-no { font-variant-numeric: tabular-nums; color: var(--text); }
.subpay-list .sp-row .sp-amt { margin-left: auto; font-variant-numeric: tabular-nums; font-weight: 600; }
.subpay-list .sp-empty { font-size: var(--fs-sm); color: var(--text-3); padding: 4px 2px; }

/* 开票弹窗：本地发票预览入口 */
.inv-file-actions { margin-top: 2px; }
.inv-file-actions .link-mini { font-size: var(--fs-xs); }

/* ---------- 银行流水页签 ---------- */
.bank-bar { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: var(--sp-3) var(--sp-4); margin-bottom: var(--sp-3); }
.bank-bar input#bank-q { width: 240px; }
.bank-bar .muted { font-size: var(--fs-sm); }
.upload-btn { display: inline-flex; align-items: center; height: var(--h-ctl); padding: 0 var(--sp-4);
  border: 1px dashed var(--primary); border-radius: var(--r-md); color: var(--primary);
  font-size: var(--fs-md); cursor: pointer; background: var(--primary-soft); }
.upload-btn:hover { background: #e3eef8; }
.upload-btn input[type="file"] { display: none; }
#bank-table table { min-width: 1240px; table-layout: fixed; }
.bank-bar select { width: 150px; flex: 0 0 150px; }
.bank-bar input#bank-q { flex: 0 0 240px; }
.bank-links { font-size: var(--fs-xs); color: var(--text-3); line-height: 1.6; }
.bank-links .lk { display: flex; gap: var(--sp-2); align-items: center; }
.bank-links .lk + .lk { margin-top: 2px; }

/* 流水关联明细：一行一条，紧凑不换行 */
.bank-links .lk-r { color: var(--text-2); }
.bank-links .lk-i { color: var(--text-3); font-variant-numeric: tabular-nums; }
.bank-links .lk { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- 基础信息 · 审批流配置 ---------- */
.flow-card { margin-bottom: var(--sp-3); }
.flow-card-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); flex-wrap: wrap; }
.flow-card-head strong { font-size: var(--fs-md); }
.flow-card-head .badge { margin: 0 4px; }
.flow-card-head .muted { font-size: var(--fs-xs); }
.flow-scene { margin-top: 8px; font-size: var(--fs-sm); line-height: 1.7; }
.flow-steps { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.fl-step { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px;
  background: var(--primary-soft); border: 1px solid var(--border); border-radius: var(--r-md);
  font-size: var(--fs-sm); color: var(--text); }
.fl-step b { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px;
  border-radius: 50%; background: var(--primary); color: #fff; font-size: var(--fs-xs); font-weight: 600; }
.fl-step i { font-style: normal; color: var(--text-3); font-size: var(--fs-xs); }
.fl-step em { font-style: normal; color: var(--text-3); font-size: var(--fs-xs); padding-left: 4px;
  border-left: 1px solid var(--border); }
.fl-arrow { color: var(--text-3); font-size: var(--fs-sm); }
.flow-node-edit { margin-top: var(--sp-3); display: flex; flex-direction: column; gap: var(--sp-2); }
.fl-node { display: grid; grid-template-columns: 26px 1.2fr 1fr 1.2fr auto; gap: var(--sp-2); align-items: end;
  padding: var(--sp-2); border: 1px solid var(--border); border-radius: var(--r-md); background: #fafbfd; }
.fl-node label { display: flex; flex-direction: column; gap: 4px; font-size: var(--fs-xs); color: var(--text-2); }
.fl-node .fl-seq { align-self: center; text-align: center; font-variant-numeric: tabular-nums;
  color: var(--text-3); font-size: var(--fs-sm); }
.fl-node button { height: 28px; }
.flow-card-actions { margin-top: var(--sp-3); display: flex; gap: var(--sp-2); flex-wrap: wrap; }

/* ---------- 组织结构：部门-岗位成对列表 ---------- */
.pos-table tbody tr td:first-child { vertical-align: top; }
/* 部门-岗位表：紧凑列宽，避免岗位列被拉出大片空白 */
.pos-table { width: 100%; min-width: 720px; table-layout: auto; }
.pos-table th:nth-child(2), .pos-table td:nth-child(2) { min-width: 220px; }

/* 卡片标题行（标题 + 操作按钮 + 说明） */
.card-head-row { display: flex; align-items: baseline; gap: var(--sp-3); flex-wrap: wrap; margin-bottom: var(--sp-3); }
.card-head-row h3 { margin: 0; }
.card-head-row .muted { font-size: var(--fs-xs); }

/* 审批节点编辑：操作列（上移/下移/删除） */
.fl-node { grid-template-columns: 26px 1.05fr .85fr 1fr 156px !important; }
.fl-node-ops { display: flex; gap: 4px; align-items: center; justify-content: flex-end; }
.fl-node-ops button { width: 34px; padding: 0; height: 28px; font-size: 13px; }
.fl-node-ops button.danger { width: 52px; }

/* 审批节点编辑：两行布局 + 金额分档区块 */
.fl-node { grid-template-columns: 24px 1.05fr .78fr .46fr .9fr .9fr 146px !important; align-items: end; }
.flow-tier-box { margin-top: var(--sp-3); padding: var(--sp-3); border: 1px dashed var(--border); border-radius: var(--r-md); background: #fafbfd; }
.flow-tier-box .muted { font-size: var(--fs-xs); margin-bottom: 6px; }
.flow-tier-box textarea { font-family: var(--font-mono, monospace); font-size: var(--fs-xs); }

/* 生产流转：审批链横向排列 */
#flow-status { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
#flow-status .flow-step { white-space: nowrap; }
#flow-status .flow-arrow { flex: 0 0 auto; }

/* 打印/导出 PDF：只打印单据弹窗内容 */
@media print {
  body * { visibility: hidden !important; }
  #doc-modal .doc-print-area, #doc-modal .doc-print-area * { visibility: visible !important; }
  #doc-modal .doc-print-area { position: absolute; left: 0; top: 0; width: 100%; padding: 0; }
  #doc-modal .modal-actions, #doc-modal .modal-mask { display: none !important; }
}

/* 单据编号列：等宽、紧凑 */
.mono { font-family: var(--font-mono, monospace); font-size: var(--fs-xs); letter-spacing: .2px; }

/* 立即用车：加粗标红，体现着急 */
.vb-imm-hint { color: var(--danger); font-weight: 700; font-size: var(--fs-md); margin: 2px 0; }
.vb-imm-time { color: var(--danger); font-weight: 600; font-size: var(--fs-sm); }
.vb-time { color: var(--text); font-weight: 600; font-size: var(--fs-sm); }
.vb-tag-imm { background: var(--danger-soft, #fcecea); color: var(--danger); border-color: var(--danger); font-weight: 700; }
.form-grid label.vb-immediate-wrap,
label.vb-immediate-wrap { display: inline-flex; flex-direction: row; align-items: center; gap: 6px; justify-content: flex-start; font-size: var(--fs-sm); color: var(--text); font-weight: 500; min-height: var(--h-ctl); }
.form-grid label.vb-immediate-wrap input[type="checkbox"],
label.vb-immediate-wrap input[type="checkbox"] { width: 15px; height: 15px; min-height: 0; flex: 0 0 auto; padding: 0; }

/* 审批中心三表：固定列宽（表头定宽），项目名称过长换行；窄屏最小宽度保事项列 */
#flow-table, #flow-all-table, #flow-mine-table { table-layout: fixed; width: 100%; min-width: 1000px; }
#flow-table td, #flow-all-table td, #flow-mine-table td { white-space: normal; word-break: break-word; }
#flow-table td:first-child, #flow-all-table td:first-child, #flow-mine-table td:first-child { white-space: nowrap; }  /* 提交时间不折行 */
.flow-pname { line-height: 1.5; }
/* 事项列完整换行显示（不用省略号截断，悬停仍有全文） */
#flow-table .flow-proj, #flow-all-table .flow-proj, #flow-mine-table .flow-proj {
  white-space: normal; overflow: visible; text-overflow: clip;
}

/* 承接列表：固定列宽（项目名称加宽换行、业主与承接方式换序、含投资概算列） */
#bid-table { table-layout: fixed; }
#bid-table td span { word-break: break-word; }
/* 项目实施列表与承接列表同款式：长文本换行不截断、金额列右对齐微离分隔线 */
#project-table { table-layout: fixed; }
#project-table td { white-space: normal; overflow: visible; }
#project-table td span { word-break: break-word; white-space: normal; }

/* 单据轨迹（列表双击展开） */
.trace-row > td { background: var(--surface-2, #f7f9fc) !important; padding: 10px 14px !important; }
.trace-box { font-size: 12.5px; }
.trace-head { font-weight: 600; margin-bottom: 8px; color: var(--text); }
.trace-proj { display: flex; flex-wrap: wrap; gap: 4px 20px; margin: 0 0 10px; padding: 7px 12px; background: var(--surface, #fff); border: 1px solid var(--border, #d8dee6); border-radius: 6px; font-size: 12px; }
.trace-proj i { font-style: normal; color: var(--text-2, #6b7684); margin-right: 6px; }
.trace-proj b { font-weight: 600; color: var(--text, #1f2937); }
.trace-step { position: relative; padding: 3px 0 3px 18px; line-height: 1.7; }
.trace-step::before { content: ''; position: absolute; left: 5px; top: 11px; width: 7px; height: 7px; border-radius: 50%; background: var(--primary, #2563b0); }
.trace-step::after { content: ''; position: absolute; left: 8px; top: 18px; bottom: -3px; width: 1px; background: var(--border, #d8dee6); }
.trace-step.last::after { display: none; }
.trace-time { display: inline-block; width: 128px; color: var(--text-2, #6b7684); font-variant-numeric: tabular-nums; }
.trace-label { display: inline-block; min-width: 110px; font-weight: 600; }
.trace-detail { color: var(--text-2, #6b7684); }

/* 同行人多值联想下拉 */
.mate-suggest { position: absolute; z-index: 2000; background: var(--surface, #fff); border: 1px solid var(--border, #d8dee6); border-radius: 6px; box-shadow: 0 4px 14px rgba(0, 0, 0, .12); max-height: 220px; overflow-y: auto; }
.mate-opt { padding: 7px 12px; font-size: 13px; cursor: pointer; color: var(--text, #1f2937); }
.mate-opt:hover, .mate-opt.active { background: var(--primary-soft, #e8f0fb); }

/* 附件芯片：单行省略（长文件名不换行） */
.att-chip { max-width: 100%; }
.att-chip .att-name { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; }
.att-chip .att-dl { flex-shrink: 0; }

/* PDF 文本层：透明文字浮于画布，预览内可选中并 Ctrl+C 复制 */
.att-pdf-text { position: absolute; left: 0; top: 0; overflow: hidden; z-index: 1; user-select: text; -webkit-user-select: text; }
.att-pdf-text span {
  position: absolute; white-space: pre; line-height: 1;
  transform-origin: 0 0; color: transparent; cursor: text;
}
.att-copy-hint { font-size: 12px; }

/* 附件逐条换行（费用列表/单据弹窗，多条不重叠不遗漏） */
.att-line { margin: 3px 0; display: flex; align-items: center; }
.att-line .att-chip { margin: 0; }

/* 多行发票号（多张发票每张一行） */
textarea.ex-no, textarea#pe-invoice, textarea#tp-invoice, textarea#ee-invoice, textarea#toll-invoice {
  min-height: 44px; height: auto; resize: vertical; line-height: 1.5; padding: 6px 8px;
}

/* 文件管理器（费用编辑页多文件上传/管理） */
.fm-list { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-bottom: 6px; min-height: 22px; align-items: center; }
.fm-pending { border: 1px dashed var(--border, #d8dee6); border-radius: 12px; padding: 2px 6px; }
.fm-x { border: none; background: transparent; color: #c0392b; font-size: 15px; line-height: 1; cursor: pointer; padding: 0 2px; }
.fm-x:hover { color: #922b21; }
.fm-add { display: inline-block; cursor: pointer; color: var(--primary, #2563eb); font-size: 12.5px; }
.fm-add input { display: none; }
.fm-add:hover { text-decoration: underline; }

/* 行程费用弹窗：紧凑版式（表单 4 列、表格贴合宽度） */
#trip-modal .modal-body { padding: 14px 18px 16px; }
#trip-modal #trip-info { margin-bottom: 10px; font-size: 12.5px; line-height: 1.8; }
#trip-modal .card { margin-bottom: 12px; padding: 12px 14px; }
#trip-modal .card h3 { font-size: 13.5px; margin-bottom: 10px; }
#trip-modal .form-grid { grid-template-columns: repeat(4, 1fr); gap: 8px 12px; }
#trip-modal .form-grid label { font-size: 12px; gap: 3px; }
#trip-modal .form-grid input,
#trip-modal .form-grid select { height: 32px; min-height: 32px; font-size: 13px; padding: 0 8px; }
#trip-modal .form-grid .full { grid-column: 1 / -1; }
#trip-modal .trip-actions { display: flex; align-items: center; gap: 10px; }
#trip-modal .trip-actions .muted { font-size: 12px; }
#trip-exp-table { min-width: 0 !important; width: 100%; table-layout: fixed; }
#trip-exp-table th, #trip-exp-table td { padding: 6px 8px; font-size: 12px; overflow: hidden; text-overflow: ellipsis; }
#trip-exp-table td .mono { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
