
/* ===== 职务序列职级体系 ===== */
.sub-tabs { display: flex; gap: 4px; margin-bottom: 8px; border-bottom: 1px solid var(--border); }
.sub-tab { padding: 8px 18px; font-size: 14px; color: var(--text-muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color .15s, border-color .15s; white-space: nowrap; }
.sub-tab:hover { color: var(--text); }
.sub-tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

/* 职级矩阵表 */
.jf-matrix { width: 100%; border-collapse: collapse; table-layout: fixed; }
.jf-matrix th, .jf-matrix td { border: 1px solid var(--border); padding: 12px 16px; font-size: 14px; text-align: center; }
.jf-matrix thead th { background: var(--primary); color: #fff; font-weight: 600; position: sticky; top: 0; z-index: 2; }
.jf-matrix .row-head { background: var(--card-bg, #fff); font-weight: 600; color: var(--text-strong); white-space: nowrap; }
.jf-matrix .corner { background: var(--card-bg, #fff); }
.jf-matrix .cell-band { line-height: 1.5; }
.jf-matrix .band-mid { color: var(--text); }
.jf-matrix .band-over { color: #EA4335; font-weight: 700; background: rgba(234,67,53,.07); }
.jf-matrix .band-under { color: #1AA260; font-weight: 700; background: rgba(26,162,96,.07); }
.jf-matrix .band-empty { color: var(--text-faint); }
.jf-matrix .cap { font-size: 11px; color: var(--text-muted); }

/* 职位体系：面板滚动容器（修复无法下拉滚动） */
#view-org-jobframework .jf-pane { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0; min-width: 0; overflow: hidden; }
#view-org-jobframework .jf-pane > .card { min-height: 0; display: flex; flex-direction: column; }
/* 数据表滚动容器：flex:1 + min-height:0 撑满卡片并触发纵向滚动（#posTreeContainer 的 max-height 已移除，不再限高） */
#view-org-jobframework .jf-pane > .card > .table-wrap { flex: 1 1 0; min-height: 0; overflow: auto; }
/* 矩阵 / 地图卡片需自身可滚动（全局 .employee-page .card 为 overflow:hidden） */
#view-org-jobframework .jf-pane[data-pane="matrix"] .card,
#view-org-jobframework .jf-pane[data-pane="map"] .card { overflow: auto; }

/* 职位体系表格吸顶表头 */
#view-org-jobframework .jf-pane .data-table thead th { position: sticky; top: 0; z-index: 3; background: var(--primary); color: #fff; border-bottom-color: var(--primary); }

/* 职位体系：数据行默认白底，保留 hover 浅蓝反馈 */
#view-org-jobframework .jf-pane .data-table tbody tr > td { background: #fff; }
#view-org-jobframework .jf-pane .data-table tbody tr:hover > td { background: var(--primary-soft, #E8F0FE); }

/* 职级管理：任职资格/证书要求左对齐（按 data-col 定位，列设置拖拽排序后不错位） */
#view-org-jobframework .jf-pane[data-pane="level"] .data-table th[data-col="qualification"],
#view-org-jobframework .jf-pane[data-pane="level"] .data-table td[data-col="qualification"],
#view-org-jobframework .jf-pane[data-pane="level"] .data-table th[data-col="cert_required"],
#view-org-jobframework .jf-pane[data-pane="level"] .data-table td[data-col="cert_required"] { text-align: left; }

/* 职位管理（并入职位体系子tab）：扁平表格列宽与对齐（按 data-col 定位，列设置拖拽排序后不错位） */
#view-org-jobframework .jf-pane[data-pane="pos"] .pos-flat-table { width: 100%; min-width: max-content; table-layout: auto; }
#view-org-jobframework .jf-pane[data-pane="pos"] .pos-flat-table thead th { text-align: left; }
#view-org-jobframework .jf-pane[data-pane="pos"] .pos-flat-table thead th[data-col="grade"],
#view-org-jobframework .jf-pane[data-pane="pos"] .pos-flat-table thead th[data-col="code"],
#view-org-jobframework .jf-pane[data-pane="pos"] .pos-flat-table thead th[data-col="salary"],
#view-org-jobframework .jf-pane[data-pane="pos"] .pos-flat-table thead th[data-col="quota"],
#view-org-jobframework .jf-pane[data-pane="pos"] .pos-flat-table thead th[data-col="occupied"],
#view-org-jobframework .jf-pane[data-pane="pos"] .pos-flat-table thead th[data-col="vacant"] { text-align: right; }
#view-org-jobframework .jf-pane[data-pane="pos"] .pos-flat-table td { text-align: left; }
#view-org-jobframework .jf-pane[data-pane="pos"] .pos-flat-table td[data-col="grade"],
#view-org-jobframework .jf-pane[data-pane="pos"] .pos-flat-table td[data-col="code"],
#view-org-jobframework .jf-pane[data-pane="pos"] .pos-flat-table td[data-col="quota"],
#view-org-jobframework .jf-pane[data-pane="pos"] .pos-flat-table td[data-col="occupied"],
#view-org-jobframework .jf-pane[data-pane="pos"] .pos-flat-table td[data-col="vacant"] { text-align: right; }
#view-org-jobframework .jf-pane[data-pane="pos"] .pos-flat-table td.pos-sal { text-align: left; white-space: nowrap; }
/* 三档各占固定宽度、字母靠左固定、数字右对齐 → A/B/C 纵向逐列对齐 */
/* 网格方案：每档 = 字母固定列(24px) + 数字列(12ch，按字符宽自适应，容纳最长千位号) → 字母成列、数字右对齐成列、无多余空白 */
#view-org-jobframework .jf-pane[data-pane="pos"] .pos-flat-table td.pos-sal .seg {
  display: inline-grid; grid-template-columns: 24px 12ch; column-gap: 4px; align-items: center; vertical-align: middle;
  font-variant-numeric: tabular-nums; border: none; border-radius: 0; padding: 0; overflow: visible;
}
#view-org-jobframework .jf-pane[data-pane="pos"] .pos-flat-table td.pos-sal .seg > b { text-align: right; font-weight: 400; white-space: nowrap; }
#view-org-jobframework .jf-pane[data-pane="pos"] .pos-flat-table td.pos-sal .seg + .seg { margin-left: 6px; }
/* 档位字母彩色标签：A 红 / B 橙 / C 蓝 */
#view-org-jobframework .jf-pane[data-pane="pos"] .pos-flat-table td.pos-sal .seg > i {
  display: inline-block; font-style: normal; font-weight: 600; font-size: 12px; line-height: 16px;
  min-width: 16px; text-align: center; border-radius: 4px; padding: 0 2px; margin-right: 0; color: #fff;
}
#view-org-jobframework .jf-pane[data-pane="pos"] .pos-flat-table td.pos-sal .seg-a > i { background: #F56C6C; }
#view-org-jobframework .jf-pane[data-pane="pos"] .pos-flat-table td.pos-sal .seg-b > i { background: #E6A23C; }
#view-org-jobframework .jf-pane[data-pane="pos"] .pos-flat-table td.pos-sal .seg-c > i { background: #409EFF; }
/* 职级管理 A/B/C 子档彩色标签（对齐职位管理风格） */
#view-org-jobframework .jf-pane[data-pane="level"] .data-table td.jf-abc,
#jfLevelABCPreview { white-space: nowrap; }
#view-org-jobframework .jf-pane[data-pane="level"] .data-table td.jf-abc .seg,
#jfLevelABCPreview .seg { display: inline-grid; grid-template-columns: 24px 12ch; column-gap: 4px; align-items: center; vertical-align: middle; font-variant-numeric: tabular-nums; border: none; border-radius: 0; padding: 0; overflow: visible; }
#view-org-jobframework .jf-pane[data-pane="level"] .data-table td.jf-abc .seg > b,
#jfLevelABCPreview .seg > b { text-align: right; font-weight: 400; white-space: nowrap; }
#view-org-jobframework .jf-pane[data-pane="level"] .data-table td.jf-abc .seg + .seg,
#jfLevelABCPreview .seg + .seg { margin-left: 6px; }
#view-org-jobframework .jf-pane[data-pane="level"] .data-table td.jf-abc .seg > i,
#jfLevelABCPreview .seg > i { display: inline-block; font-style: normal; font-weight: 600; font-size: 12px; line-height: 16px; min-width: 16px; text-align: center; border-radius: 4px; padding: 0 2px; margin-right: 0; color: #fff; }
#view-org-jobframework .jf-pane[data-pane="level"] .data-table td.jf-abc .seg-a > i,
#jfLevelABCPreview .seg-a > i { background: #F56C6C; color: #fff; }
#view-org-jobframework .jf-pane[data-pane="level"] .data-table td.jf-abc .seg-b > i,
#jfLevelABCPreview .seg-b > i { background: #E6A23C; color: #fff; }
#view-org-jobframework .jf-pane[data-pane="level"] .data-table td.jf-abc .seg-c > i,
#jfLevelABCPreview .seg-c > i { background: #409EFF; color: #fff; }
/* 任职资格：换行列例外——三件套锁宽(width+min+max)，全量显示不截断，不参与内容撑宽。
   按 data-col 定位：列设置拖拽排序后仍锁定任职资格本身，不会错位到别的列。 */
#view-org-jobframework .jf-pane[data-pane="pos"] .pos-flat-table thead th[data-col="qualification"],
#view-org-jobframework .jf-pane[data-pane="pos"] .pos-flat-table tbody td[data-col="qualification"] {
  width: 360px; min-width: 360px; max-width: 360px; white-space: normal; word-break: break-word; text-align: left;
}




/* 职位名称：去掉浏览器对 <a> 的默认下划线（口径对齐 .dept-detail-pane .data-table td a.link） */
#view-org-jobframework .jf-pane[data-pane="pos"] .pos-flat-table td.pos-name-cell a.pos-name,
#view-org-jobframework .jf-pane[data-pane="pos"] .pos-flat-table td.pos-name-cell a.pos-name:hover { text-decoration: none; }

/* 职位体系子版块：tab 标签紧凑化（缩小文字与顶栏、与底部横线的间距） */
#view-org-jobframework .sub-tabs { margin-bottom: 6px; }
#view-org-jobframework .sub-tab { padding: 3px 16px; }

/* 职类弹窗：紧凑宽度；「所属职族」下拉与输入框同高同宽，职类编码为系统自动生成（只读灰字等宽） */
#jfCategoryModal .modal { max-width: 620px; }
#jfCategoryModal #jfCategoryCode {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: .3px;
}
/* 职类弹窗：适用通道多选控件（横向排列） */
#jfCategoryChannels { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; padding-top: 2px; }
#jfCategoryChannels .chk { white-space: nowrap; }

/* 职位体系四表统一走全局列宽策略（css_base.css .data-table：width:100% + min-width:max-content + table-layout:auto）
   —— 一屏放得下则列宽随屏幕自适应撑满，列多放不下则按内容撑开并横向滚动。
   2026-11-19 移除原 table-layout:fixed 百分比列宽 / 固定 min-width(1400/1880)，不再写死。
   各表的长文本列用 width+min-width+max-width 三件套单独锁宽（见下方 .jf-xxx 规则）。 */
/* A/B/C 子档拆分为 C/B/A 三列：每列一个带色字母标签+区间，锁宽单行显示 */
#view-org-jobframework .jf-pane[data-pane="level"] .data-table th.jf-abc,
#view-org-jobframework .jf-pane[data-pane="level"] .data-table td.jf-abc {
  width: 130px; min-width: 130px; max-width: 150px; white-space: nowrap; font-size: 12px; line-height: 1.55; color: #44505f; text-align: left;
}
/* 任职资格列：长文本允许换行 */
#view-org-jobframework .jf-pane[data-pane="level"] .data-table th.jf-qual,
#view-org-jobframework .jf-pane[data-pane="level"] .data-table td.jf-qual {
  width: 200px; min-width: 200px; max-width: 260px; white-space: normal; line-height: 1.45; text-align: left;
}
/* 职族管理描述列：换行列例外——三件套锁宽，长描述不撑爆 */
#view-org-jobframework .jf-pane[data-pane="family"] .data-table th.jf-family-desc,
#view-org-jobframework .jf-pane[data-pane="family"] .data-table td.jf-family-desc {
  width: 260px; min-width: 260px; max-width: 320px; white-space: normal; word-break: break-word; line-height: 1.5; text-align: left; vertical-align: middle;
}
/* 职类管理：描述列长文本换行显示（覆盖全局 td 的 nowrap），左对齐便于阅读 */
#view-org-jobframework .jf-pane[data-pane="category"] .data-table th.jf-cluster-desc,
#view-org-jobframework .jf-pane[data-pane="category"] .data-table td.jf-cluster-desc {
  width: 300px; min-width: 300px; max-width: 360px; white-space: normal; word-break: break-word; line-height: 1.5; text-align: left; vertical-align: middle;
}
/* 职类管理：通道列（多选胶囊标签），允许换行 */
#view-org-jobframework .jf-pane[data-pane="category"] .data-table th.jf-cluster-channels,
#view-org-jobframework .jf-pane[data-pane="category"] .data-table td.jf-cluster-channels {
  width: 150px; min-width: 150px; max-width: 180px; white-space: normal; text-align: left; vertical-align: middle; line-height: 1.6;
}
#view-org-jobframework .jf-pane[data-pane="category"] .data-table td.jf-cluster-channels .ch-tag {
  display: inline-block; margin: 1px 3px 1px 0; padding: 1px 7px; border-radius: 10px;
  font-size: 11px; line-height: 1.5; border: 1px solid transparent;
}
/* 发展通道胶囊基础形状（全局：职位体系/花名册共用） */
.ch-tag {
  display: inline-block; margin: 1px 3px 1px 0; padding: 1px 7px; border-radius: 10px;
  font-size: 11px; line-height: 1.5; border: 1px solid transparent;
}
/* 发展通道 4 通道（专业/技能/管理/业务）。
   2026-12-01：去掉各通道的 border-color 着色，统一为无边框胶囊——与职位管理/职类/职级三处作用域选择器的 `border:1px solid transparent` 口径一致，花名册不再是有边框的异类。
   工程E/技术已并入专业P（2026-11-19）。业务通道补齐配色，风格与其他三通道相同（紫色系，区别于专业蓝/技能橙/管理绿）。 */
.ch-tag.ch-专业 { background: rgba(59,130,246,.12); color: #2563eb; }
.ch-tag.ch-技能 { background: rgba(245,158,11,.12); color: #d97706; }
.ch-tag.ch-管理 { background: rgba(16,185,129,.12); color: #059669; }
.ch-tag.ch-业务 { background: rgba(139,92,246,.12); color: #7c3aed; }
/* 职级管理：发展通道列（胶囊标签，样式参考职类通道列；仅改职级，职类规则保持原样） */
#view-org-jobframework .jf-pane[data-pane="level"] .data-table th.jf-level-channel,
#view-org-jobframework .jf-pane[data-pane="level"] .data-table td.jf-level-channel {
  width: 96px; min-width: 96px; max-width: 120px; white-space: normal; text-align: left; vertical-align: middle; line-height: 1.6;
}
#view-org-jobframework .jf-pane[data-pane="level"] .data-table td.jf-level-channel .ch-tag {
  display: inline-block; margin: 1px 3px 1px 0; padding: 1px 7px; border-radius: 10px;
  font-size: 11px; line-height: 1.5; border: 1px solid transparent;
}
/* 职位管理：发展通道列（胶囊标签，样式参考职类通道列；配色复用全局 .ch-tag.ch-中文） */
#view-org-jobframework .jf-pane[data-pane="pos"] .pos-flat-table td[data-col="track"] .ch-tag {
  display: inline-block; margin: 1px 3px 1px 0; padding: 1px 7px; border-radius: 10px;
  font-size: 11px; line-height: 1.5; border: 1px solid transparent;
}
/* 职位体系「开始/结束/创建/修改日期」列：日期单行显示、统一宽度。
   按 data-col 定位（列设置拖拽排序后不错位）；:is() 合并四个日期 key 保持简洁。 */
#view-org-jobframework .jf-pane[data-pane="family"] .data-table :is(th,td):is([data-col="effective_date"],[data-col="end_date"],[data-col="created_at"],[data-col="updated_at"]),
#view-org-jobframework .jf-pane[data-pane="category"] .data-table :is(th,td):is([data-col="effective_date"],[data-col="end_date"],[data-col="created_at"],[data-col="updated_at"]) { width: 100px; white-space: nowrap; }
/* 职级管理列宽已改为 table-layout:auto 自适应（见上方 2026-09-21 修复注释），旧的固定列宽规则已删除 */
/* 职级管理日期列单行显示（按 data-col 定位，列排序后不错位） */
#view-org-jobframework .jf-pane[data-pane="level"] .data-table :is(th,td):is([data-col="effective_date"],[data-col="end_date"],[data-col="created_at"],[data-col="updated_at"]) { white-space: nowrap; }
/* 职级矩阵表同样满宽 */
#view-org-jobframework .jf-pane[data-pane="matrix"] .jf-matrix { width: 100%; }

/* 编码徽标 / 薪酬带徽标 / 证书标签 */
.jf-code { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 12px; font-weight: 600; background: #eef1f6; color: #44505f; border: 1px solid #e2e6ee; white-space: nowrap; }
.jf-code.ch-M { background: #E8EEF9; color: #1E40AF; border-color: #C7D6F2; }
.jf-code.ch-P { background: #E8F1FE; color: #1A73E8; border-color: #C5DBF8; }
.jf-code.ch-T { background: #F1EAFD; color: #7C3AED; border-color: #E0D2F8; }
.jf-code.ch-S { background: #FDF1E2; color: #B45309; border-color: #F6E0C2; }
.jf-code.ch-O { background: #E6F6FA; color: #0E7490; border-color: #C5E9F2; }
.jf-code.ch-E { background: #E9F7EE; color: #1A7F4B; border-color: #C8ECD6; }
.jf-code.ch-F { background: #F3EEF9; color: #6D28D9; border-color: #E2D6F4; }
.jf-band { display: inline-block; padding: 0 8px; border-radius: 10px; font-size: 12px; background: #F1F5F9; color: #334155; white-space: nowrap; line-height: 1.25; }
.jf-cert { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 12px; background: #FEF3F2; color: #B42318; border: 1px solid #FECDCA; white-space: nowrap; }

/* ===== 跨族类职级对比 ===== */
.cmp-viewtabs { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.cmp-view { border: 0; background: var(--card-bg, #fff); color: var(--text-secondary, #5f6368); padding: 0 14px; height: var(--ctrl-h); font-size: 13px; cursor: pointer; }
.cmp-view.active { background: var(--primary); color: #fff; }
.cmp-warn { margin: 0 0 12px; padding: 10px 14px; border-radius: 8px; background: #FEF3C7; border: 1px solid #FDE68A; color: #92400E; font-size: 13px; line-height: 1.6; }
.cmp-chart { display: flex; flex-direction: column; gap: 8px; }
.cmp-row { padding: 6px 6px; border-radius: 8px; cursor: pointer; transition: background .15s; }
.cmp-row:hover { background: var(--bg, #f6f8fa); }
.cmp-row.cmp-anom { background: rgba(234,67,53,.06); }
.cmp-row-head { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; }
.cmp-rank { font-size: 12px; font-weight: 700; color: var(--text-faint, #9aa0a6); min-width: 40px; text-align: right; }
.cmp-lvl-name { font-weight: 600; color: var(--text-strong, #202124); }
.cmp-fam { font-size: 12px; }
.cmp-score { margin-left: auto; font-weight: 700; color: var(--text-strong, #202124); font-variant-numeric: tabular-nums; }
.cmp-bar-track { height: 10px; background: #EEF1F6; border-radius: 6px; overflow: hidden; }
.cmp-bar { height: 100%; border-radius: 6px; background: var(--primary); opacity: .85; }
.cmp-bar.ch-M { background: #1E40AF; } .cmp-bar.ch-T { background: #7C3AED; } .cmp-bar.ch-P { background: #1A73E8; } .cmp-bar.ch-E { background: #1A7F4B; } .cmp-bar.ch-S { background: #B45309; } .cmp-bar.ch-O { background: #0E7490; } .cmp-bar.ch-F { background: #6D28D9; }
.cmp-matrix .cmp-cell { padding: 8px 6px; line-height: 1.35; }
.cmp-cell-code { font-weight: 700; font-size: 12px; }
.cmp-cell-name { font-size: 11px; opacity: .9; }
.cmp-cell-score { font-size: 11px; font-variant-numeric: tabular-nums; margin-top: 2px; }
/* 职级弹窗：因子栅格 + 预览 */
.factor-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px 14px; }
.factor-grid label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--text-secondary, #5f6368); }
.factor-grid label input { height: 32px; border: 1px solid var(--border); border-radius: 6px; padding: 0 9px; font-size: 13px; }
.factor-preview { display: flex; align-items: center; gap: 12px; margin-top: 10px; font-size: 13px; color: var(--text-secondary, #5f6368); }
.factor-preview b { color: var(--text-strong, #202124); font-size: 16px; }
.btn-mini { border: 1px solid var(--primary); background: #fff; color: var(--primary); border-radius: 6px; padding: 3px 10px; font-size: 12px; cursor: pointer; }
.btn-mini:hover { background: var(--primary); color: #fff; }
/* 对比明细弹窗 */
.cmp-detail-table { width: 100%; border-collapse: collapse; margin-top: 4px; }
.cmp-detail-table th, .cmp-detail-table td { border: 1px solid var(--border); padding: 7px 10px; font-size: 13px; text-align: left; }
.cmp-detail-table thead th { background: var(--bg, #f6f8fa); font-weight: 600; }
.cmp-detail-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.cmp-detail-table tfoot td { background: var(--bg, #f6f8fa); }
.cmp-detail-bar { width: 120px; }
.cmp-detail-bar span { display: inline-block; height: 8px; border-radius: 4px; background: var(--primary); opacity: .8; vertical-align: middle; }
.cmp-detail-foot { margin-top: 12px; font-size: 13px; color: var(--text-secondary, #5f6368); line-height: 1.8; }
.cmp-detail-foot b { color: var(--text-strong, #202124); }
.cmp-warn-inline { margin-top: 10px; padding: 8px 12px; border-radius: 8px; background: #FEF3C7; border: 1px solid #FDE68A; color: #92400E; font-size: 13px; }

/* ===== 待入职管理（员工关系 P0） ===== */
#obList { flex: 1; display: flex; flex-direction: column; min-height: 0; }
#obList > .card { flex: 1; display: flex; flex-direction: column; min-height: 0; }
#obList .table-wrap { flex: 1; overflow: auto; min-width: 0; }
#obList .pager { flex: 0 0 auto; }

.eb-subs { margin-top: 12px; display: flex; flex-direction: column; gap: 12px; }
.sub-block { border: 1px solid var(--border); border-radius: var(--radius, 8px); padding: 12px 16px 16px; background: var(--card-bg); }
.sub-title { font-size: 13px; font-weight: 600; color: var(--text-strong); margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.sub-title .sec-n {
  display: inline-flex; align-items: center; justify-content: center;
  flex: 0 0 auto;
  width: 18px; height: 18px; border-radius: 5px;
  background: var(--primary-soft, #E8F0FE); color: var(--primary);
  font-size: 10.5px; font-weight: 700;
}
.sub-title .btn { margin-left: auto; }
.eb-sub-row { display: flex; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.eb-sub-row input { flex: 1 1 120px; min-width: 0; height: 32px; padding: 0 9px; border: 1px solid var(--border); border-radius: 6px; background: var(--card-bg); color: var(--text); font-size: 13px; }
.eb-sub-row .btn { flex: 0 0 auto; }
.eb-subs textarea { width: 100%; min-height: 64px; resize: vertical; padding: 7px 9px; border: 1px solid var(--border); border-radius: 6px; background: var(--card-bg); color: var(--text); font-size: 13px; font-family: inherit; }

/* 培养计划任务行 */
.np-task-row {
  display: grid;
  grid-template-columns: 2fr 1.2fr 1.2fr auto auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 8px;
}
.np-task-row input {
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--card-bg);
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  min-width: 0;
}
.np-task-row input[type="date"] { padding: 0 26px 0 8px; }
.np-task-row .switch-sm {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
  cursor: pointer;
}
.np-task-row .switch-sm input { opacity: 0; width: 0; height: 0; padding: 0; border: 0; }
.np-task-row .switch-sm .switch-slider {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: #D1D5DB;
  border-radius: 10px;
  transition: background .2s;
}
.np-task-row .switch-sm .switch-slider::after {
  content: '';
  position: absolute;
  top: 2px; left: 2px;
  width: 16px; height: 16px;
  background: #fff;
  border-radius: 50%;
  transition: transform .2s;
}
.np-task-row .switch-sm input:checked + .switch-slider { background: var(--primary); }
.np-task-row .switch-sm input:checked + .switch-slider::after { transform: translateX(16px); }
.np-task-row .t-del { padding: 0 8px; height: 34px; line-height: 1; }
.readonly-text { white-space: pre-wrap; word-break: break-word; font-size: 13px; color: var(--text); background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; min-height: 40px; }
.badge.ok { background: #ECFDF5; color: #059669; }
.badge.warn { background: #FEF6E7; color: #B7791F; }
.badge.bad { background: #FEE2E2; color: #DC2626; }
/* 岗位状态 7 态配色（方案：空缺🔵/招聘中🟣/冻结⚫/已撤销🔴） */
.badge.info { background: #E7F0FE; color: #1A56C4; }
.badge.purple { background: #F3E8FD; color: #7627BB; }
.badge.dark { background: #E3E5E8; color: #3C4043; }
.badge.danger { background: #FEE2E2; color: #DC2626; }

/* 通用滑动开关（表单内、任务行共用） */
.switch-row { display: flex; flex-direction: column; gap: 6px; }
.switch-row .field-label { color: var(--text-muted); font-size: 13px; font-weight: 400; }
.switch-inline { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.switch-sm { position: relative; display: inline-block; width: 36px; height: 20px; cursor: pointer; }
.switch-sm input { opacity: 0; width: 0; height: 0; padding: 0; border: 0; }
.switch-sm .switch-slider { position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: #D1D5DB; border-radius: 10px; transition: background .2s; }
.switch-sm .switch-slider::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; background: #fff; border-radius: 50%; transition: transform .2s; }
.switch-sm input:checked + .switch-slider { background: var(--primary); }
.switch-sm input:checked + .switch-slider::after { transform: translateX(16px); }
.switch-inline .switch-label { font-size: 13px; color: var(--text); user-select: none; }

/* 工作交接/培养任务行统一栅格 */
.np-task-row, .handover-row { display: grid; grid-template-columns: 2fr 1.2fr 1.2fr auto auto; gap: 10px; align-items: center; margin-bottom: 8px; }
.np-task-row input, .handover-row input { height: 34px; padding: 0 10px; border: 1px solid var(--border); border-radius: 6px; background: var(--card-bg); color: var(--text); font-size: 13px; font-family: inherit; min-width: 0; }
.np-task-row input[type="date"], .handover-row input[type="date"] { padding: 0 26px 0 8px; }
.np-task-row .t-del, .handover-row .h-del { padding: 0 8px; height: 34px; line-height: 1; }

/* 合同弹窗等标签统一 */
.form-grid label .field-label .req-star { color: var(--danger); font-weight: 700; }

/* 表格行可交互提示（双击查看 / 右键操作） */
.data-table tbody tr { cursor: pointer; }
.data-table tbody tr:hover { background: var(--row-hover, #f6f9fc); }

/* 右键上下文菜单 */
.ctx-menu {
  position: fixed; z-index: 9999; min-width: 168px; max-width: 240px;
  background: #fff; border: 1px solid var(--border, #e3e8ef); border-radius: 10px;
  box-shadow: 0 10px 32px rgba(20, 30, 50, .18); padding: 6px; display: none;
  font-size: 13px; color: var(--text, #1f2733); user-select: none;
}
.ctx-item { display: flex; align-items: center; gap: 9px; padding: 8px 12px; border-radius: 7px; cursor: pointer; line-height: 1.2; }
.ctx-item:hover { background: #f1f5fb; }
.ctx-item.disabled { color: #b6bfca; cursor: not-allowed; }
.ctx-item.disabled:hover { background: transparent; }
.ctx-item.danger { color: #d93025; }
.ctx-item.danger:hover { background: #fdecec; }
/* 置灰项优于 danger：不可执行的项一律显示为灰色不可点（即便同时带 danger），避免"看着能点其实点不了" */
.ctx-item.disabled,
.ctx-item.disabled.danger { color: #b6bfca; cursor: not-allowed; }
.ctx-item.disabled:hover,
.ctx-item.disabled.danger:hover { background: transparent; }

.ctx-icon { width: 16px; text-align: center; opacity: .82; flex: none; }
.ctx-label { flex: 1; }
.ctx-sep { height: 1px; background: #eef1f5; margin: 5px 6px; }

/* 花名册编辑：职位带出的部门/职级只读展示框 */
.derived-dept {
  margin-top: 8px; padding: 10px 12px; background: #f6f9fc;
  border: 1px dashed #cdd8e6; border-radius: 8px;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px 14px;
}
@media (max-width: 1100px) {
  .derived-dept { grid-template-columns: repeat(2, 1fr); }
}
.derived-dept .dd-item { display: flex; align-items: baseline; gap: 8px; font-size: 13px; }
.derived-dept .dd-label { color: var(--text-muted, #6b7785); flex: none; min-width: 78px; }
.derived-dept .dd-val { color: var(--text, #1f2733); font-weight: 600; }
.derived-dept .dd-val:empty::before,
.derived-dept .dd-val:contains('—') { color: #aab3bf; }

/* 员工详情 · position 字段：PositionLinkage 三联联动在表单中的容器
   （在 .form-grid 整行铺满，三个字段各占 1/3） */
.emp-linkage-box { width: 100%; margin-top: 4px; }
.emp-linkage-box .pl-wrap { gap: 16px; }
@media (max-width: 900px) {
  .emp-linkage-box .pl-wrap { gap: 10px; }
  .emp-linkage-box .pl-field { flex: 1 1 100%; min-width: 0; }
}
/* 员工表单：职位/部门/职级 正常级联下拉（与 .form-grid 的 label 间距/字号统一） */
.emp-cascade { width: 100%; margin-top: 0; }
.emp-cascade .cascade-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 14px 16px;
  margin-bottom: 14px;
}
.emp-cascade .cascade-row:last-child {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  margin-bottom: 0;
}
.emp-cascade .cascade-cell {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 0;
}
.emp-cascade .cascade-cap {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 400;
  white-space: nowrap;
}
/* 级联下拉/输入统一高度与边框，避免职位/职级/直属上级等高矮不一 */
.emp-cascade .cascade-cell select,
.emp-cascade .cascade-cell input[type="text"] {
  width: 100%;
  height: 30px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  color: var(--text);
  background: #fff;
  box-sizing: border-box;
  font-family: inherit;
  transition: border-color .15s, box-shadow .15s;
}
.emp-cascade .cascade-cell select:focus,
.emp-cascade .cascade-cell input[type="text"]:focus {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.10);
}
.emp-cascade .cascade-cell select:disabled,
.emp-cascade .cascade-cell input[type="text"]:disabled,
.emp-cascade .cascade-cell select.locked-field,
.emp-cascade .cascade-cell input[type="text"].locked-field {
  background: #F8F9FA;
  cursor: not-allowed;
}
.emp-cascade .cascade-cell select.locked-field,
.emp-cascade .cascade-cell select:disabled {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: none;
}
@media (max-width: 900px) {
  .emp-cascade .cascade-row,
  .emp-cascade .cascade-row:last-child { grid-template-columns: 1fr; }
}

/* 员工详情 · position 字段只读视图（右侧纯查看面板）：
   把 6 个禁用空下拉换成 3×2 标签-值纯文本展示，保持与详情页其他字段一致 */
.emp-cascade-readonly .cascade-row,
.emp-cascade-readonly .cascade-row:last-child {
  grid-template-columns: repeat(3, 1fr);
  margin-bottom: 8px;
}
.emp-cascade-readonly .cascade-row:last-child { margin-bottom: 0; }
.emp-cascade-readonly .cascade-cell { gap: 2px; }
.emp-cascade-readonly .cascade-cap {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 400;
}
.emp-cascade-readonly .cascade-readonly-val {
  display: inline-block;
  min-height: 0;
  line-height: 1.45;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 0;
  font-size: 13px;
  color: var(--text, #1f2937);
  word-break: break-all;
}
.emp-cascade-readonly .cascade-readonly-val.is-empty::before {
  content: '—';
  color: #aab3bf;
}
@media (max-width: 980px) {
  .emp-cascade-readonly .cascade-row,
  .emp-cascade-readonly .cascade-row:last-child { grid-template-columns: 1fr; }
}

/* ===================== 花名册弹窗宽度 =====================
   新增/编辑员工弹窗必须保留足够宽度，让右侧表单区至少能放一列（含 112px 左侧导航）。
   用 !important 防止被后续 .modal-lg 规则覆盖；浮窗化前 offsetWidth 测的就是这个值。 */
#empModal .modal.modal-lg {
  width: min(960px, 94vw) !important;
  min-width: min(760px, 94vw) !important;
  max-width: none !important;
}
#empModal .modal.modal-lg .emp-content {
  min-width: 360px;
}

/* ===================== 办理离职弹窗：收窄为两列布局 =====================
   离职类型 / 离职日期 各占一列，离职原因文本域横跨两列，
   右边缘与「离职日期」输入框对齐，弹窗整体收窄去掉右侧空列。 */
#resignModal .modal {
  width: min(620px, 94vw);
}
#resignForm {
  grid-template-columns: repeat(2, 1fr);
}
#resignForm label.full {
  grid-column: 1 / -1;
}

/* ===================== 转正管理 · 花名册识别 + 临期提醒 ===================== */
.pr-due-alert {
  margin: 12px 0 0;
  padding: 9px 14px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.5;
  color: #5f6368;
  background: #f1f3f4;
  border: 1px solid transparent;
}
.pr-due-alert.show {
  color: #b06000;
  background: #fef7e0;
  border-color: #fde293;
  font-weight: 400;
}
.pr-due-alert b { color: #c5221d; font-size: 15px; padding: 0 2px; }
/* 临期行高亮 */
#prTableBody tr.due-soon { background: #fff8e1; }
#prTableBody tr.due-soon:hover { background: #fff3cd; }
/* 「仅看提醒」按钮激活态 */
#prOnlyDue.active {
  background: #fef7e0;
  border-color: #fde293;
  color: #b06000;
  font-weight: 600;
}

/* 转正管理表格：数据居中 */
#tf-pane-probation .data-table th,
#tf-pane-probation .data-table td {
  text-align: center;
}
#tf-pane-probation .data-table td:first-child,
#tf-pane-probation .data-table th:first-child { text-align: center; }

/* 表字段设置 - 类型列双行显示 */

/* 提醒阶段徽章（阶段提前：满1个月 / 满2个月 / 临期15天） */
.pr-stage { display: inline-block; padding: 2px 9px; border-radius: 11px; font-size: 12px; font-weight: 600; line-height: 1.7; white-space: nowrap; }
.pr-stage-m1 { background: #e8f0fe; color: #1a56db; }
.pr-stage-m2 { background: #fef0e0; color: #b06000; }
.pr-stage-d15 { background: #fce8e6; color: #c5221d; }
/* 临期15天（最紧急）行左侧红条强调 */
#prTableBody tr.due-soon { box-shadow: inset 3px 0 0 #f9ab00; }
#prTableBody tr.due-soon.stage-d15 { box-shadow: inset 3px 0 0 #c5221d; }

/* ============================================================
   HRMS · 设置中心（settings_modules.js 专用样式）
   ============================================================ */
.st-modal-mask { z-index: 2100; }
.req-star { color: var(--danger); }

/* 卡片 */
.st-card { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px; margin-bottom: 14px; }
.st-card > .st-h3:first-child { margin-bottom: 12px; }
.st-h3 { margin: 0; font-size: 15px; font-weight: 600; color: var(--text-strong); }
.st-content { padding: 2px; }

/* 标签页 */
.st-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 16px; flex-wrap: wrap; }
.st-tab { padding: 9px 14px; font-size: 13px; color: var(--text-muted); cursor: pointer; border-bottom: 2px solid transparent; user-select: none; white-space: nowrap; }
.st-tab:hover { color: var(--text); }
.st-tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.st-tab-badge { display: inline-block; min-width: 18px; text-align: center; font-size: 11px; padding: 0 5px; border-radius: 999px; background: var(--primary-soft); color: var(--primary); margin-left: 6px; }

/* 开关 */
.st-switch { position: relative; display: inline-block; width: 42px; height: 22px; cursor: pointer; flex-shrink: 0; }
.st-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.st-slider { position: absolute; inset: 0; background: var(--ring-base); border-radius: 999px; transition: .2s; }
.st-slider:before { content: ""; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; box-shadow: 0 1px 2px rgba(0,0,0,.25); }
.st-switch input:checked + .st-slider { background: var(--primary); }
.st-switch input:checked + .st-slider:before { transform: translateX(20px); }
.st-switch input:disabled + .st-slider { opacity: .5; cursor: not-allowed; }
.st-sws { display: flex; flex-wrap: wrap; gap: 10px 22px; }
.st-sw-item { display: flex; align-items: center; gap: 10px; }

/* 全局开关配置行 */
.st-cfg { display: flex; align-items: flex-start; gap: 16px; padding: 16px 2px; border-bottom: 1px solid var(--border); }
.st-cfg:last-child { border-bottom: none; }
.st-cfg-main { flex: 1; min-width: 0; }
.st-cfg-t { font-size: 14px; font-weight: 600; color: var(--text-strong); margin-bottom: 4px; }
.st-cfg-d { font-size: 12.5px; color: var(--text-faint); line-height: 1.6; }
.st-cfg-ctrl { flex-shrink: 0; padding-top: 2px; }
.st-cfg-m { font-size: 12px; color: var(--text-faint); margin-top: 6px; }

/* 复选组 */
.st-checks { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.st-chk { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text); cursor: pointer; }
.st-chk input { accent-color: var(--primary); width: 15px; height: 15px; }

/* 代码 / 条件 */
.st-code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: #F1F3F4; padding: 1px 6px; border-radius: 4px; font-size: 12px; color: #333; }
.st-cond { display: flex; align-items: center; gap: 8px; padding: 10px 12px; background: #FAFBFC; border: 1px dashed var(--border); border-radius: 8px; margin-bottom: 8px; flex-wrap: wrap; }

/* 确认框 */
.st-confirm { font-size: 14px; color: var(--text); line-height: 1.6; padding: 6px 2px; }
.st-confirm.danger { color: var(--danger); }

/* 差异展示 */
.st-diff { font-size: 14px; line-height: 1.9; }
.st-old { color: #B3261E; text-decoration: line-through; background: #FCE8E6; padding: 0 4px; border-radius: 3px; }
.st-new { color: #0D652D; background: #E6F4EA; padding: 0 4px; border-radius: 3px; }

.st-dim { color: var(--text-faint); }
.st-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: middle; background: var(--text-faint); }
.st-ellip { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-empty-node { padding: 18px; text-align: center; color: var(--text-faint); border: 1px dashed var(--border); border-radius: 8px; font-size: 13px; }
.st-err-list { margin: 8px 0 0; padding-left: 18px; color: var(--danger); font-size: 12.5px; line-height: 1.7; }

/* 错误态 */
.st-error { padding: 44px 20px; text-align: center; }
.st-error-t { font-size: 15px; font-weight: 600; color: var(--danger); margin-bottom: 8px; }
.st-error-m { font-size: 13px; color: var(--text-muted); margin-bottom: 14px; white-space: pre-wrap; }

/* 表单 */
.st-f { display: block; margin-bottom: 12px; }
.st-f .field-label { display: block; font-size: 13px; color: var(--text-muted); margin-bottom: 6px; }
.st-f textarea { min-height: 70px; resize: vertical; }
.st-inline { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.st-inline2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.st-inp-s {
  width: 130px; padding: 6px 24px 6px 8px; height: 32px;
  border: 1px solid var(--border, #E5E7EB); border-radius: 6px;
  font-size: 12.5px; background: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239CA3AF' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 6px center; background-size: 12px;
  color: var(--text); outline: none; cursor: pointer;
  appearance: none; -webkit-appearance: none; -moz-appearance: none;
  transition: border-color .15s, box-shadow .15s;
}
.st-inp-s:focus { border-color: var(--primary); box-shadow: 0 0 0 2.5px rgba(26,115,232,.10); }
.st-inp-n { width: 92px; }
.st-inp-t { width: 100%; }
.st-lb { font-size: 13px; color: var(--text-muted); }

/* 通用输入框（用于本模块内各类输入） */
.st-f input, .st-f select, .st-f textarea,
.st-inline input, .st-inline select,
.st-inline2 input, .st-inline2 select,
.st-range input, .st-range select,
.st-cfg input, .st-cond input, .st-cond select {
  height: 32px; border: 1px solid var(--border); border-radius: 6px; padding: 0 9px;
  font-size: 13px; background: var(--card-bg); color: var(--text); outline: none; line-height: 1.4;
}
.st-f input:focus, .st-f select:focus, .st-f textarea:focus,
.st-inline input:focus, .st-inline select:focus,
.st-inline2 input:focus, .st-inline2 select:focus,
.st-range input:focus, .st-range select:focus,
.st-cfg input:focus, .st-cond input:focus, .st-cond select:focus {
  border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft);
}

/* 分组 */
.st-grp { border: 1px solid var(--border); border-radius: 10px; margin-bottom: 12px; overflow: hidden; }
.st-grp-h { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; background: #FAFBFC; font-weight: 600; font-size: 13.5px; color: var(--text-strong); }
.st-grp-ops { display: flex; gap: 6px; }

.st-hint { font-size: 12px; color: var(--text-faint); line-height: 1.6; margin-top: 6px; }
.st-tip { font-size: 12px; color: var(--text-faint); margin-top: 8px; line-height: 1.6; }
.st-sub { font-size: 12.5px; color: var(--text-faint); }
.st-loading { padding: 40px; text-align: center; color: var(--text-faint); font-size: 13px; }
.st-scroll { overflow: auto; max-height: 62vh; }

/* 键值对 */
.st-kv { display: grid; grid-template-columns: 120px 1fr; gap: 8px 14px; font-size: 13px; }
.st-kv-i { color: var(--text-muted); }

/* 审批节点编辑器 */
.st-nodes { display: flex; flex-direction: column; gap: 0; }
.st-node { position: relative; border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; margin-bottom: 14px; background: #fff; }
.st-node:not(:last-child):after { content: ""; position: absolute; left: 24px; bottom: -14px; width: 2px; height: 14px; background: var(--border); }
.st-node-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.st-node-h { font-weight: 600; font-size: 14px; color: var(--text-strong); }
.st-node-ops { display: flex; gap: 6px; }

/* 分栏：默认纵向堆叠（工具栏在上，内容在下撑满） */
.st-pane { display: flex; flex-direction: column; gap: 12px; }
.st-pane > * { min-width: 0; }
.st-pane > .toolbar { flex-shrink: 0; }
.st-pane > .st-card,
.st-pane > .st-scroll { flex: 1; display: flex; flex-direction: column; min-height: 0; overflow: hidden; }

/* 设置中心一般页面：卡片自然高度，避免内容少时底部/中间大片空白 */
#view-settings-global .st-card,
#view-settings-profile .st-card,
#view-settings-approval .st-card,
#view-settings-data-auth .st-card,
#view-settings-blacklist .st-card,
#view-settings-notice .st-card {
  flex: none;
  overflow: visible;
  padding: 14px 16px;
  margin-bottom: 12px;
}
#view-settings-global .st-pane,
#view-settings-profile .st-pane,
#view-settings-approval .st-pane,
#view-settings-data-auth .st-pane,
#view-settings-blacklist .st-pane,
#view-settings-notice .st-pane,
#view-sys-users .st-pane {
  gap: 10px;
}

/* 权限分配 */
.st-perm-box { flex: 1; min-height: 0; overflow: auto; background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: 0 1px 3px rgba(16,24,40,.04); }
.st-perm-grp { border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; background: #fff; margin-bottom: 12px; }
.st-perm-h { font-weight: 600; font-size: 13.5px; color: var(--text-strong); margin-bottom: 10px; display: flex; align-items: center; justify-content: space-between; }
.st-perm-list { }
.st-perm-grp .st-chk { margin-bottom: 2px; }
.st-perm-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.st-perm-table th { background: #f8f9fa; padding: 8px 6px; text-align: left; font-weight: 600; color: var(--text-muted); border-bottom: 1px solid var(--border); }
.st-perm-table td { padding: 6px; border-bottom: 1px solid #f0f0f0; vertical-align: middle; }
.st-perm-table .perm-name { font-weight: 400; }
.st-perm-table .st-code { display: block; font-size: 11px; color: var(--text-faint); font-weight: 400; margin-top: 2px; }
.st-perm-table input[type="checkbox"] { width: 16px; height: 16px; cursor: pointer; }
/* 权限行：上下布局 */
.perm-row { display: flex; flex-direction: column; padding: 12px 0; border-bottom: 1px solid #f0f0f0; gap: 8px; }
.perm-row:last-child { border-bottom: none; }
.perm-row .perm-name { font-weight: 400; font-size: 13px; }
.perm-row .perm-name .st-code { display: block; font-size: 11px; color: var(--text-faint); font-weight: 400; margin-top: 2px; }
.perm-row .perm-chks { display: flex; flex-wrap: wrap; gap: 20px; }
.perm-row .perm-chk { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--text-muted); cursor: pointer; }
.perm-row .perm-chk input { width: 15px; height: 15px; cursor: pointer; }
.perm-row .perm-chk:hover { color: var(--text); }

/* 权限树状视图 */
.perm-tree { padding: 0; font-size: 13px; }
.perm-tree-header {
  position: sticky; top: 0; z-index: 2;
  display: flex; align-items: center;
  padding: 12px 16px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  font-size: 13px; font-weight: 600; color: var(--text-strong);
}
.perm-tree-header .pth-name { flex: 1; min-width: 0; }
.perm-tree-header .pth-chks {
  flex: 0 0 300px;
  display: flex;
  justify-content: space-between;
  text-align: center;
}
.perm-tree-header .pth-chks span { flex: 1; }
.perm-node.collapsed > .perm-children { display: none; }
.perm-children { padding-left: 20px; }
.perm-tree .perm-row {
  position: relative;
  display: flex; flex-direction: row; align-items: center;
  gap: 6px;
  padding: 8px 12px 8px 8px;
  border-bottom: 1px solid #f1f5f9;
  border-radius: 0;
}
.perm-tree .perm-row::before {
  content: "";
  position: absolute; left: 0; top: 3px; bottom: 3px;
  width: 3px; border-radius: 2px;
  background: transparent;
  transition: background .15s ease;
}
.perm-tree .perm-row:hover { background: #F5F9FF; }
.perm-tree .perm-row:hover::before { background: var(--primary); }
.perm-tree .perm-row:hover .perm-name.tw-name { color: var(--primary); }
.perm-tree .perm-row:last-child { border-bottom: none; }
.perm-tree .tw-toggle {
  flex: 0 0 18px; width: 18px; height: 18px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: #94a3b8; font-size: 10px; line-height: 1;
  user-select: none; border-radius: 4px;
  transition: transform .15s ease, background .15s ease, color .15s ease;
}
.perm-tree .tw-toggle:hover { background: var(--primary-soft); color: var(--primary); }
.perm-tree .perm-node.collapsed > .perm-row .tw-toggle { transform: rotate(-90deg); }
.perm-tree .tw-toggle.tw-empty { cursor: default; color: #cbd5e1; }
.perm-tree .tw-toggle.tw-empty::before { content: "•"; font-size: 9px; }
.perm-tree .perm-name.tw-name { flex: 1 1 auto; min-width: 0; font-weight: 400; color: #334155; display: flex; align-items: baseline; gap: 6px; }
.perm-tree .perm-row.leaf .perm-name.tw-name { color: #475569; }
.perm-tree .perm-name.tw-name .st-code {
  display: inline; font-size: 11px; font-weight: 400;
  color: transparent; margin-left: 2px;
  transition: color .15s ease;
}
.perm-tree .perm-row:hover .perm-name.tw-name .st-code { color: var(--text-faint); }
.perm-tree .perm-chks {
  flex: 0 0 300px;
  display: flex;
  justify-content: space-between;
  gap: 0;
  margin-left: auto;
}
.perm-tree .perm-chk {
  flex: 1;
  display: flex; justify-content: center; align-items: center;
  margin: 0; cursor: pointer;
}
.perm-tree .perm-chk input { width: 16px; height: 16px; cursor: pointer; }

/* 药丸 / 标签 */
.st-pill { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; font-size: 12px; background: var(--primary-soft); color: var(--primary); }
.st-pill.off { background: #F1F3F4; color: var(--text-faint); }

/* 预格式化 / 预览 */
.st-pre { white-space: pre-wrap; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; background: #F1F3F4; color: #1F2937; padding: 14px; border-radius: 8px; overflow: auto; max-height: 320px; }
.st-preview { border: 1px solid var(--border); border-radius: 10px; background: #fff; overflow: hidden; }
.st-preview-h { padding: 10px 14px; background: #FAFBFC; border-bottom: 1px solid var(--border); font-weight: 600; font-size: 13px; }
.st-preview-t { padding: 14px; font-size: 13.5px; line-height: 1.7; color: var(--text); }
.st-preview-c { padding: 14px; }

/* 区间（日期） */
.st-range { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.st-range input[type=date] { width: auto; }

/* 结果 / 关闭行 */
.st-res { font-size: 13px; color: var(--text); }
.st-res.ok { color: var(--success); }
.st-res.err { color: var(--danger); }
.st-row-off { opacity: .5; filter: grayscale(.3); }

/* 统计卡 */
.st-stat-row { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.st-stat { flex: 1; min-width: 130px; background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; }
.st-stat-t { font-size: 12.5px; color: var(--text-faint); margin-bottom: 6px; }
.st-stat-v { font-size: 22px; font-weight: 700; color: var(--text-strong); }

/* 模板变量 */
.st-vars { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.st-var { display: inline-block; padding: 3px 8px; border-radius: 6px; background: #F1F3F4; color: #374151; font-size: 12px; cursor: pointer; font-family: ui-monospace, Menlo, Consolas, monospace; }
.st-var:hover { background: var(--primary-soft); color: var(--primary); }

/* 设置中心 9 个页面：原 .employee-page 为 overflow:hidden 会裁切长内容，改为页面级滚动 */
#view-settings-global, #view-settings-profile, #view-settings-approval,
#view-settings-data-auth, #view-settings-blacklist, #view-settings-notice,
#view-sys-users, #view-table-field, #view-table-relation, #view-sys-log { overflow: auto; }
/* 以下页面内部已有滚动容器，使用内部滚动+固定表头 */
#view-table-field, #view-table-relation { overflow: hidden; }
/* 设置中心一般页面取消固定视口高度，内容少则底部无空白，内容多自然延伸 */
#view-settings-global, #view-settings-profile, #view-settings-approval,
#view-settings-data-auth, #view-settings-blacklist, #view-settings-notice,
#view-sys-users, #view-sys-log { height: auto; min-height: 0; align-self: flex-start; }
/* 设置中心自然高度页面：取消 .content 的 flex:1 撑满，让页面随内容结束，彻底消除底部空白 */
.content.settings-shrink { flex: none; }
.content.settings-shrink > section { align-self: flex-start; }
/* 角色管理 / 权限分配 / 用户账号 三个标签页统一用 .card.st-card.p0 > .table-wrap 容器：
   卡片 flex:1 撑满 section、table-wrap 内部滚动、底部不留空白（与角色管理一致） */
#view-sys-users { width: 100%; height: calc(100vh - var(--topbar-h) - 2 * var(--pad)); display: flex; flex-direction: column; overflow: hidden; }
#view-sys-users > .st-pane { flex: 1; min-height: 0; }   /* permPane 撑满 section 剩余高度 */
#view-sys-users .st-card { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-width: 0; }
#view-sys-users .st-card > .table-wrap { flex: 1; min-height: 0; overflow: auto; }
/* 防止 flex 列布局下卡片被压缩 */
#view-settings-global .st-card, #view-settings-profile .st-card, #view-settings-approval .st-card,
#view-settings-data-auth .st-card, #view-settings-blacklist .st-card, #view-settings-notice .st-card,
#view-table-field .st-card, #view-table-relation .st-card, #view-sys-log .st-card { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-width: 0; }
/* 个人信息展示的分组卡片需要自然高度堆叠，不能被 flex:1 + overflow:hidden 裁剪 */
#view-settings-profile .st-grp { flex: none; overflow: visible; }
/* 个人信息展示的滚动区域不强制最大高度，避免底部空白 */
#view-settings-profile .st-scroll { max-height: none; overflow: visible; }
/* 个人信息展示表格容器不裁剪溢出，确保 select 下拉菜单能正常弹出 */
#view-settings-profile .table-wrap { overflow: visible; }
/* 表字段设置卡片：减少内边距和底部间距 */
#view-table-field .st-card { padding: 12px 16px; margin-bottom: 10px; }
#view-table-field .table-wrap { overflow: auto; flex: 1; min-height: 0; }
#view-table-field .data-table thead { position: sticky; top: 0; z-index: 10; background: var(--card-bg, #fff); }
/* 设置页顶部工具栏不随内容收缩 */
#view-settings-global > .toolbar, #view-settings-profile > .toolbar, #view-settings-approval > .toolbar,
#view-settings-data-auth > .toolbar, #view-settings-blacklist > .toolbar, #view-settings-notice > .toolbar,
#view-sys-users > .toolbar, #view-table-field > .toolbar, #view-table-relation > .toolbar, #view-sys-log > .toolbar { flex-shrink: 0; }

/* 表字段设置：左侧表导航 + 右侧字段列表 */
.tf-layout { display: flex; gap: 10px; align-items: stretch; min-height: 0; flex: 1; overflow: hidden; }
.tf-nav { width: 220px; flex-shrink: 0; background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 8px 0; display: flex; flex-direction: column; min-height: 0; box-sizing: border-box; }
.tf-main { flex: 1; min-width: 0; display: flex; flex-direction: column; min-height: 0; }
.tf-nav-search { padding: 6px 10px 8px; }
.tf-nav-search input { width: 100%; box-sizing: border-box; height: 30px; padding: 0 10px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 12px; outline: none; background: var(--bg); color: var(--text); transition: border-color .2s; }
.tf-nav-search input:focus { border-color: var(--primary); }
.tf-nav-search input::placeholder { color: var(--text-faint); }
.tf-nav-list { flex: 1; overflow-y: auto; }
.tf-nav-item { display: flex; align-items: flex-start; justify-content: space-between; padding: 9px 14px; cursor: pointer; border-left: 3px solid transparent; flex-wrap: wrap; position: relative; }
.tf-nav-item .tf-nav-cn { font-size: 13px; color: var(--text); font-weight: 400; line-height: 1.3; display: block; width: 100%; margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tf-nav-item .tf-nav-en { font-size: 11px; color: var(--text-faint); line-height: 1.2; display: block; width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-family: Consolas, Monaco, monospace; }
.tf-nav-item:hover { background: var(--primary-soft); }
.tf-nav-item.active { background: var(--primary-soft); border-left-color: var(--primary); }
.tf-nav-item.active .tf-nav-cn { color: var(--primary); font-weight: 600; }
.tf-nav-count { font-size: 11px; color: var(--text-faint); background: #F1F3F4; padding: 1px 7px; border-radius: 999px; position: absolute; right: 10px; top: 9px; }
.tf-main { flex: 1; min-width: 0; display: flex; flex-direction: column; height: 100%; }
.tf-empty { padding: 50px 20px; text-align: center; color: var(--text-faint); }
.tf-hint { font-size: 12px; color: var(--text-faint); margin-left: 8px; }

/* 数据表关联设置页面 */
.st-page { padding: 16px 20px; }
.st-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; flex-shrink: 0; }
.st-header h3 { font-size: 16px; font-weight: 600; color: var(--text); margin: 0; }
.st-filter input, .st-filter select { width: 220px; height: var(--ctrl-h); padding: 0 12px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; outline: none; box-sizing: border-box; background: #fff; }
.st-filter input:focus { border-color: var(--primary); }
.st-body { flex: 1; min-height: 0; }
.st-loading { text-align: center; color: var(--text-faint); padding: 40px; }
.st-empty { text-align: center; color: var(--text-faint); padding: 40px; }
.rel-cards { display: flex; flex-direction: column; gap: 16px; }
.rel-card { background: var(--card-bg); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.rel-card-title { padding: 12px 16px; background: #FAFBFC; font-size: 14px; font-weight: 600; color: var(--text-strong); border-bottom: 1px solid var(--border); }
.rel-card-title .rel-count { font-weight: 400; color: var(--text-faint); font-size: 12px; }
.rel-table { width: 100%; border-collapse: collapse; }
.rel-table th, .rel-table td { padding: 10px 16px; text-align: left; font-size: 13px; border-bottom: 1px solid var(--border); }
.rel-table th { background: #FAFBFC; color: var(--text-muted); font-weight: 400; }
.rel-table tr:last-child td { border-bottom: none; }
.rel-table td:first-child { font-family: 'Roboto Mono', monospace; color: var(--primary); }
.rel-table td:nth-child(2) { font-family: 'Roboto Mono', monospace; color: #d97706; }
.rel-table td:nth-child(3) { font-family: 'Roboto Mono', monospace; color: #059669; }
.rel-table td:nth-child(4) { color: var(--text-faint); font-size: 12px; }
.rel-diagram { padding: 20px; background: #fafafa; border-radius: 8px; min-height: 400px; }
.rel-diagram svg { display: block; background: white; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
.rel-legend { display: flex; gap: 20px; margin-top: 16px; padding: 12px 16px; background: white; border-radius: 8px; justify-content: center; }
.rel-legend-item { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-muted); }
.rel-legend-item .dot { width: 12px; height: 12px; border-radius: 3px; }
.rel-legend-item .line { width: 24px; height: 3px; border-radius: 2px; }
/* 表格形式关联 */
.rel-card-body { padding: 8px 16px 16px; }
.rel-item { display: flex; align-items: center; gap: 8px; padding: 6px 0; font-size: 13px; border-bottom: 1px dashed #f0f0f0; }
.rel-item:last-child { border-bottom: none; }
.rel-from-field { font-family: 'Roboto Mono', monospace; color: var(--primary); background: #f0f5ff; padding: 2px 6px; border-radius: 4px; font-size: 12px; }
.rel-arrow { color: #94a3b8; font-weight: bold; }
.rel-to-table { color: #059669; font-weight: 400; }
.rel-to-field { color: #d97706; font-family: 'Roboto Mono', monospace; font-size: 12px; }

/* 简洁表格关联 */
.rel-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.rel-table th { background: #f8fafc; padding: 10px 12px; text-align: left; font-weight: 600; color: var(--text-strong); border-bottom: 2px solid #e2e8f0; }
.rel-table td { padding: 8px 12px; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
.rel-table tr:hover td { background: #f8fafc; }
.rel-table code { font-family: 'Roboto Mono', monospace; font-size: 12px; color: #6366f1; background: #f1f5f9; padding: 2px 6px; border-radius: 4px; }
.rel-table-name { font-weight: 400; color: #334155; }
.rel-table .rel-center { text-align: center; color: #94a3b8; font-weight: bold; }

/* 数据表关联 ER 图 */
.rel-view-btns { display: flex; gap: 8px; margin-bottom: 12px; }
.rel-view-btns button { padding: 6px 14px; border: 1px solid var(--border, #e2e8f0); background: #fff; border-radius: 6px; font-size: 13px; cursor: pointer; color: var(--text-faint); }
.rel-view-btns button:hover { border-color: var(--primary); color: var(--primary); }
.rel-view-btns button.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.rel-graph { width: 100%; overflow: auto; background: #fafbfc; border: 1px solid var(--border); border-radius: 8px; padding: 10px; }
.rel-svg { width: 100%; min-height: 500px; display: block; }
.rel-node { cursor: pointer; transition: transform 0.15s; }
.rel-node:hover rect { stroke-width: 2.5; filter: drop-shadow(0 2px 4px rgba(26,115,232,0.2)); }
.rel-node:hover text { fill: var(--primary); }

/* ===================== 数据库设计说明书 ===================== */
.doc-header { margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.doc-header h3 { margin: 0 0 8px; font-size: 18px; color: var(--text-strong); }
.doc-meta { margin: 0; font-size: 13px; color: var(--text-muted); }
.doc-meta span { margin-right: 20px; }
.doc-meta code { background: #f1f5f9; padding: 2px 6px; border-radius: 4px; font-size: 12px; color: var(--primary); }
.doc-table th { background: #f8fafc; }
.doc-table code { background: #f1f5f9; padding: 2px 6px; border-radius: 4px; font-size: 12px; }
.doc-table .tag { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 400; background: #fef3c7; color: #b45309; }
.doc-table td { vertical-align: middle; }

/* ===================== 公告模块 ===================== */
#view-announcements.employee-page { margin-top: -24px; transform: translate(-6px, 6px); height: calc(100vh - var(--topbar-h) - var(--pad)); }
/* 公告 tab 栏上提幅度回调一点点（仅当前视图） */
#view-announcements .recruit-pagetabs { margin-top: -2px; }
/* 招聘/异动/培训聚合页：tab 与顶栏的距离对齐公告（上移 24px，与公告一致）；高度同步补偿一个 pad，避免底部空白 */
#view-recruit, #view-training, #view-emp-transfer { margin-top: -24px; height: calc(100vh - var(--topbar-h) - var(--pad)); }
/* 招聘聚合页子标签栏：原受 .recruit-panes-wrap{margin-top:0!important} + 视图 margin-top:-24px 影响，整条被顶到顶栏下沿（约 8px 嵌入顶栏）。单独下压 10px，使其明显脱离顶栏、与下方内容留出呼吸间距，且不影响训练/异动。 */
#view-recruit .recruit-pagetabs { margin-top: 5px; }
.ann-wrap { width: 100%; padding: 0 14px 12px; margin: -4px 0 0 -6px; }
/* 公告 tab 已统一为全局 .recruit-pagetabs/.rpt（见 style.css 头部聚合页子标签样式），旧 .ann-tabs/.ann-tab 已废弃删除 */
.ann-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 4px; }
.ann-toolbar select, .ann-toolbar input[type=text], .ann-toolbar input[type=date], .ann-toolbar input[type=month] { height: var(--ctrl-h); border: 1px solid var(--border); border-radius: var(--radius); padding: 0 8px; font-size: 13px; background: #fff; box-sizing: border-box; }
.ann-toolbar .ann-tilde { color: var(--text-faint); }
.ann-batch { margin-left: auto; display: flex; gap: 6px; }
.ann-selinfo { color: var(--primary); font-size: 13px; }

.ann-tablewrap { overflow-x: auto; }
.ann-toolbar .btn { height: 30px; box-sizing: border-box; padding: 0 12px; font-size: 13px; border-radius: var(--radius); cursor: pointer; white-space: nowrap; }
.ann-toolbar .btn-primary, .ann-toolbar .btn.primary { background: var(--primary); color: #fff; border: 1px solid var(--primary); }
.ann-toolbar .btn-primary:hover, .ann-toolbar .btn.primary:hover { filter: brightness(1.05); }
.ann-toolbar .btn-secondary, .ann-toolbar .btn:not(.primary):not(.danger) { background: #fff; border: 1px solid var(--border); color: var(--text-strong); }
.ann-toolbar .btn-secondary:hover, .ann-toolbar .btn:not(.primary):not(.danger):hover { border-color: var(--primary); color: var(--primary); }
.ann-toolbar .btn.danger { background: #fff; border: 1px solid var(--border); color: var(--danger, #DC2626); }
.ann-toolbar .btn.danger:hover { border-color: var(--danger, #DC2626); background: rgba(220,38,38,.04); }
#annTable { width: 100%; min-width: 0; table-layout: auto; }
#annTable th, #annTable td { padding: 7px 10px; font-size: 13px; line-height: 1.3; border-bottom: 1px solid var(--border, #f0f0f0); }
#annTable .ann-title { max-width: 320px; }



.top-flag { background: #fff4e0; color: #c77700; font-size: 11px; padding: 1px 6px; border-radius: 4px; margin-left: 4px; }
.popup-flag { background: #e8f0ff; color: var(--primary, #2b6de5); font-size: 11px; padding: 1px 6px; border-radius: 4px; margin-left: 4px; }
.st-badge { font-size: 12px; padding: 2px 8px; border-radius: 999px; }
.st-draft { background: #eef0f2; color: #6b7280; }
.st-pub { background: #e6f7ec; color: #1a9d54; }
.st-arch { background: #f3eefb; color: #8b5cf6; }
.ann-acts .lnk { color: var(--primary, #2b6de5); cursor: pointer; margin-right: 8px; font-size: 13px; }
.ann-acts .lnk.danger { color: #e5484d; }
.ann-nodata { text-align: center; color: var(--text-faint); padding: 40px; }
.ann-pager { margin-top: 14px; display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-faint); }
/* 公告翻页器：去掉上分隔线（避免与表格底部 1px border 叠成"粗线"），并补回 ann-pager 被替换为 pagination 后丢失的 14px 间距；对齐招聘/培训 .pagination 的处理 */
#view-announcements .pagination { border-top: none; margin-top: 14px; }
/* 公告模块：纵向 flex 布局——表格区滚动、翻页器钉在面板底部（与花名册 .employee-page 一致） */
#view-announcements .ann-wrap { flex: 1; min-height: 0; display: flex; flex-direction: column; }
#view-announcements .recruit-pagetabs { flex: 0 0 auto; }
#view-announcements .ann-admin { flex: 1; min-height: 0; display: flex; flex-direction: column; }
#view-announcements .ann-board { flex: 1; min-height: 0; display: flex; flex-direction: column; }
#view-announcements .ann-toolbar { flex: 0 0 auto; }
#view-announcements .ann-tablewrap { flex: 1; min-height: 0; overflow: auto; }
#view-announcements .ann-board-body { flex: 1; min-height: 0; }
.btn.sm { height: 28px; padding: 0 12px; font-size: 12px; }
.btn.sm:disabled { opacity: .5; cursor: not-allowed; }

/* 编辑器弹窗（复用 .modal-mask，避免遮挡顶栏） */
.modal-mask.ann-editor-mask { position: fixed; top: var(--topbar-h); right: 0; bottom: 0; left: var(--sidebar-w); background: rgba(0,0,0,.4); display: none; align-items: flex-start; justify-content: center; z-index: 1000; padding: 16px 16px 0; overflow: auto; }
.modal-mask.ann-editor-mask.show { display: flex; }
.ann-editor-mask .modal-lg.ann-editor { max-height: calc(100vh - var(--topbar-h) - 32px); }
.modal-lg { background: #fff; border-radius: 8px; width: 880px; max-width: 100%; box-shadow: 0 12px 40px rgba(0,0,0,.2); }
.modal-sm { background: #fff; border-radius: 8px; width: 420px; max-width: 100%; box-shadow: 0 12px 40px rgba(0,0,0,.2); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 11px 18px; border-bottom: 1px solid var(--border, #eee); font-weight: 600; }
.modal-x { border: none; background: none; font-size: 22px; cursor: pointer; color: var(--text-faint); line-height: 1; }
.modal-body { padding: 18px; max-height: 70vh; overflow: auto; }
.modal-foot { padding: 8px 18px; border-top: 1px solid var(--border, #eee); display: flex; justify-content: flex-end; gap: 8px; }
.modal-foot .foot-left { margin-right: auto; display: flex; gap: 8px; align-items: center; }
/* 公告编辑器底部按钮栏：减小内边距和按钮最小高度，压缩纵向占用 */
.ann-editor .modal-foot { padding: 8px 18px; }
.ann-editor .modal-foot > button { min-height: 34px; }
.ann-form .ann-field { margin-bottom: 14px; }
.ann-form label { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--text-muted); margin-bottom: 0; font-weight: 400; }
.ann-form label i { color: var(--danger); font-style: normal; }
.ann-form input[type=text], .ann-form textarea, .ann-form input[type=datetime-local] { width: 100%; border: 1px solid var(--border); border-radius: 6px; padding: 0 9px; font-size: 13px; box-sizing: border-box; font-family: inherit; background: var(--card-bg); color: var(--text); height: 32px; }
.ann-form textarea { height: auto; min-height: 60px; padding: 7px 9px; resize: vertical; }
.ann-form input[type=text]:focus, .ann-form textarea:focus, .ann-form input[type=datetime-local]:focus { border-color: var(--primary); outline: none; box-shadow: none !important; }
.ann-form input::placeholder, .ann-form textarea::placeholder { color: var(--text-faint); }
.ann-form .ann-row2 { display: flex; gap: 16px; }
.ann-form .ann-row2 > div { flex: 1; }
.ann-checks { display: flex; gap: 20px; }
.ann-checks label { display: flex; align-items: center; gap: 6px; font-weight: 400; margin: 0; }
.rte-toolbar { display: flex; gap: 4px; margin-bottom: 6px; flex-wrap: wrap; align-items: center; }
.rte-toolbar > button, .rte-toolbar > label { display: inline-flex; align-items: center; justify-content: center; height: 26px; line-height: 1; padding: 0 9px; border: 1px solid var(--border, #d9dee5); background: #fafafa; border-radius: 5px; font-size: 12px; font-family: inherit; font-weight: 400; text-align: center; cursor: pointer; box-sizing: border-box; vertical-align: middle; user-select: none; }
.rte-toolbar > button:hover, .rte-toolbar > label:hover { background: #f0f3f7; }
.rte-toolbar > button:active, .rte-toolbar > label:active { background: #e6ebf2; }
.rte-toolbar > button:focus, .rte-toolbar > label:focus { outline: 1px solid var(--primary, #2b6de5); outline-offset: -1px; }
.rte-img { color: inherit; }
.rte-toolbar > label > input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.rte-content { border: 1px solid var(--border, #d9dee5); border-radius: 6px; padding: 10px; min-height: 180px; font-size: 13px; line-height: 1.7; outline: none; }
.rte-content:focus { border-color: var(--primary, #2b6de5); }
.rte-content img { max-width: 100%; }
.ann-cover-row { display: flex; align-items: center; gap: 10px; }
.ann-cover-row img { max-height: 60px; max-width: 120px; border-radius: 6px; border: 1px solid var(--border, #eee); }
.scope-box { border: 1px solid var(--border, #e3e8ef); border-radius: 8px; padding: 12px; background: #fcfcfd; }
.scope-all { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; font-weight: 600; font-size: 14px; line-height: 20px; min-height: 20px; }
.scope-all input[type=checkbox] { margin: 0; flex: 0 0 auto; }
.scope-cols { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.scope-col { border: 1px solid var(--border, #eef1f5); border-radius: 6px; padding: 8px; background: #fff; max-height: 200px; overflow: auto; }
.scope-h { font-size: 12px; color: var(--text-faint); margin-bottom: 6px; font-weight: 600; }
.scope-tree label, .scope-list label { display: flex; align-items: center; gap: 6px; font-size: 14px; margin: 3px 0; cursor: pointer; line-height: 20px; min-height: 20px; }
.scope-tree label input[type=checkbox], .scope-list label input[type=checkbox] { margin: 0; flex: 0 0 auto; }
.scope-tree label input[type=checkbox], .scope-list label input[type=checkbox], .scope-all input[type=checkbox] {
  -webkit-appearance: none; appearance: none; -moz-appearance: none;
  width: 13px; height: 13px; box-sizing: border-box;
  border: 1.5px solid #c4ccd6; border-radius: 3px; background: #fff; cursor: pointer;
  position: relative; transition: background .15s, border-color .15s;
}
.scope-tree label input[type=checkbox]:checked, .scope-list label input[type=checkbox]:checked, .scope-all input[type=checkbox]:checked {
  background: var(--primary, #2b6de5); border-color: var(--primary, #2b6de5);
}
.scope-tree label input[type=checkbox]:checked::after, .scope-list label input[type=checkbox]:checked::after, .scope-all input[type=checkbox]:checked::after {
  content: ''; position: absolute; left: 4px; top: 1px; width: 3.5px; height: 7px;
  border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.scope-emp { position: relative; margin-top: 10px; border: 1px solid var(--border, #eef1f5); border-radius: 6px; padding: 6px 10px; background: #fff; }
.scope-emp + .scope-emp { margin-top: 8px; }
.scope-emp .scope-h { margin-bottom: 4px; font-size: 12px; font-weight: 600; color: var(--text-faint); }
.scope-emp input[type=text] { margin-top: 0; }
.scope-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 4px; min-height: 4px; }
.chip { background: var(--primary-soft, #e8f0ff); color: var(--primary, #2b6de5); border-radius: 999px; padding: 3px 10px; font-size: 12px; display: inline-flex; align-items: center; gap: 5px; }
.chip i { cursor: pointer; font-style: normal; opacity: .7; }
.emp-hint { position: absolute; background: #fff; border: 1px solid var(--border, #e3e8ef); border-radius: 6px; box-shadow: 0 6px 18px rgba(0,0,0,.12); z-index: 30; max-height: 220px; overflow: auto; }
.emp-opt { padding: 7px 12px; font-size: 13px; cursor: pointer; display: flex; align-items: center; gap: 6px; }
.emp-opt:hover, .emp-opt.active { background: var(--primary-soft, #e8f0ff); }
.emp-opt small { color: var(--text-faint); margin-left: auto; }
.emp-opt .emp-no { color: var(--text-faint); font-size: 12px; }
.ann-attach-list { margin-bottom: 6px; }
.attach-item { font-size: 13px; padding: 4px 0; }
.attach-item .lnk { margin-left: 8px; }

/* 员工公告栏 */
.ann-board-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; font-size: 13px; }
.ann-board-head select { height: 32px; border: 1px solid var(--border, #e5e7eb); border-radius: 6px; padding: 0 8px; }
.ann-board-tip { color: var(--text-faint); }
.unread-badge { background: #ffe9e9; color: #e5484d; font-size: 12px; padding: 2px 10px; border-radius: 999px; }
.ann-board-body { display: flex; gap: 16px; align-items: flex-start; }
.ann-board-list { width: 360px; flex: none; max-height: 70vh; overflow: auto; border: 1px solid var(--border, #eef1f5); border-radius: 8px; }
.board-item { padding: 12px 14px; border-bottom: 1px solid var(--border, #f2f4f7); cursor: pointer; }
.board-item:hover { background: var(--primary-soft, #f5f8ff); }
.board-item.unread { background: #fffaf2; }
.bi-top { display: inline-block; background: #fff4e0; color: #c77700; font-size: 11px; padding: 1px 6px; border-radius: 4px; margin-right: 6px; line-height: 1.4; vertical-align: 2px; }
.bi-title { font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.bi-sum { font-size: 12px; color: #6b7280; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.bi-meta { font-size: 11px; color: var(--text-faint); margin-top: 6px; }
.bi-meta .red { color: #e5484d; }
.ann-board-detail { flex: 1; min-width: 0; border: 1px solid var(--border, #eef1f5); border-radius: 8px; padding: 20px; min-height: 200px; }
.bd-detail h2 { margin: 0 0 8px; font-size: 20px; }
.bd-meta { font-size: 12px; color: var(--text-faint); margin-bottom: 14px; }
.bd-cover { max-width: 100%; border-radius: 8px; margin-bottom: 14px; }
.bd-content { font-size: 14px; line-height: 1.8; }
.bd-content img { max-width: 100%; }
.bd-attach { margin-top: 16px; font-size: 13px; }
.bd-comments { margin-top: 22px; border-top: 1px solid var(--border, #eee); padding-top: 14px; }
.bd-comments h3 { font-size: 15px; margin: 0 0 10px; }
.cm-item { padding: 8px 0; border-bottom: 1px solid #f3f4f6; }
.cm-reply-item { margin-left: 24px; background: #fafbfc; border-radius: 6px; padding: 8px 10px; }
.cm-head { font-size: 12px; color: var(--text-faint); }
.cm-head b { color: #374151; }
.cm-body { font-size: 13px; margin: 4px 0; }
.cm-acts { font-size: 12px; color: var(--primary, #2b6de5); }
.cm-like, .cm-reply { cursor: pointer; margin-right: 12px; }
.cm-form { margin-top: 10px; display: flex; gap: 8px; align-items: flex-start; }
.cm-form textarea { flex: 1; border: 1px solid var(--border, #d9dee5); border-radius: 6px; padding: 8px; font-size: 13px; font-family: inherit; }
.cm-closed { color: var(--text-faint); font-size: 13px; }
.ann-empty { padding: 40px; text-align: center; color: var(--text-faint); }
.ann-popup .popup-item { padding: 10px 12px; border-bottom: 1px solid #f0f0f0; cursor: pointer; }
.ann-popup .popup-item:hover { background: var(--primary-soft, #f5f8ff); }
.ann-popup .popup-item b { font-size: 14px; }
.ann-popup .popup-item div { font-size: 12px; color: var(--text-faint); margin-top: 3px; }

/* 设置模块 - 表字段类型两行显示 */
.tf-type-db { color: var(--text-faint); font-size: 11px; }

/* ===================== 绩效管理模块 ===================== */
.perf-wrap { display: flex; flex-direction: column; gap: 14px; }
.perf-tabs { display: flex; flex-wrap: wrap; gap: 6px; border-bottom: 1px solid var(--border); padding-bottom: 8px; }
.perf-tabs button { border: 1px solid var(--border); background: var(--bg); color: var(--text); padding: 7px 14px; border-radius: var(--radius); font-size: 13px; cursor: pointer; transition: all .15s; }
.perf-tabs button:hover { border-color: var(--primary); }
.perf-tabs button.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.perf-body { min-height: 200px; }
.empty { padding: 40px; text-align: center; color: var(--text-faint); }
.loading { padding: 30px; text-align: center; color: var(--text-faint); }

/* 模板维度编辑器 */
.tpl-dim { border: 1px solid var(--border); border-radius: var(--radius); padding: 10px; margin-bottom: 10px; background: var(--bg-soft, #fafbfc); }
.tpl-dim-head { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; }
.tpl-dim-head .dim-name { flex: 1; }
.tpl-ind-list { margin: 6px 0; padding-left: 12px; border-left: 2px solid var(--border); }
.tpl-ind { display: flex; gap: 6px; align-items: center; margin-bottom: 6px; }
.tpl-ind input { flex: 1; min-width: 0; }
.tpl-ind .ind-target { flex: 1.4; }
.cal-dist-row { display: flex; align-items: center; gap: 10px; margin: 6px 0; }
.grade-pill { display: inline-flex; width: 28px; height: 28px; border-radius: 50%; align-items: center; justify-content: center; font-weight: 700; color: #fff; }
.grade-S { background: #7c3aed; } .grade-A { background: #1A73E8; } .grade-B { background: #1A73E8; }
.grade-C { background: #f59e0b; } .grade-D { background: #ef4444; }
.emp-pick-list .pick-item { display: block; padding: 5px 8px; border-radius: 6px; cursor: pointer; }
.emp-pick-list .pick-item:hover { background: var(--primary-soft, #f5f8ff); }

/* 通用模态框（performance 模块自建）—— 2026-10-08 统一改造：
   面板 .modal / 头部 / 底部 / 关闭钮 / 表单 .form-grid 全部走全局统一样式（与薪酬档案等弹窗同一套视觉：
   面板圆角 14px、宽 880px、表单自动适配列宽、标签左对齐同行、输入框 32px 同高、日历点击整框触发）。
   仅保留 mask 触发规则：perf 弹窗由 JS 动态 innerHTML 生成、无 .show 类，
   全局 .modal-mask 默认 display:none + pointer-events:none，故此处必须显式开启。 */
#perfModalRoot .modal-mask { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center; z-index: 1000; padding: 24px; overflow-y: auto; pointer-events: auto; }
#perfModalRoot .drawer-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ===================== 汇报关系 Reporting ===================== */
/* 已随部门管理/组织架构树等板块一起移入 <main class="content"> 内，
   现在与部门管理共用同一套 .employee-page 容器规则（含 .content 顶部 24px 留白 + -12px 上移），
   顶部留白与部门管理完全一致，无需额外覆盖。 */
#view-org-reporting.employee-page .toolbar { flex: 0 0 auto; }
.rp-layout { display: grid; grid-template-columns: 3fr 2fr; gap: 10px; flex: 1; min-height: 0; overflow: hidden; }
/* min-width:0 防爆列：架构图 canvas / 关系图 SVG 均为固定大宽度，不加会把 3fr 列
   的 min-content 顶爆、右栏详情被挤出屏幕（grid/flex 子项 min-width:auto 的经典坑） */
.rp-tree-pane { display: flex; flex-direction: column; min-height: 0; min-width: 0; gap: 12px; }
.rp-detail-pane { min-height: 0; min-width: 0; overflow-y: auto; padding-right: 4px; }

/* 统计卡片 */
.rp-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.rp-stat { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; text-align: center; }
.rp-stat-val { font-size: 22px; font-weight: 700; color: var(--primary); line-height: 1.1; }
.rp-stat-label { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* 左树卡片 */
.rp-tree-card { flex: 1; min-height: 0; min-width: 0; display: flex; flex-direction: column; overflow: hidden; }
.rp-tree-head { font-weight: 600; color: var(--text-strong); font-size: 14px; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.rp-tree-box { flex: 1; min-height: 0; overflow-y: auto; padding: 8px 6px 12px; }

/* 树节点 */
.rp-tree { list-style: none; margin: 0; padding: 0; }
.rp-node-item { margin: 0; }
.rp-node-row { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 8px; cursor: pointer; transition: background .12s; position: relative; }
.rp-node-row:hover { background: var(--bg); }
.rp-node-row.selected { background: var(--primary-soft); box-shadow: inset 3px 0 0 var(--primary); }
.rp-toggle { width: 16px; text-align: center; color: var(--text-muted); font-size: 11px; flex: 0 0 auto; user-select: none; }
.rp-toggle.leaf { color: #c4ccd6; }
.rp-avatar { width: 24px; height: 24px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; color: #fff; flex: 0 0 auto; font-weight: 600; }
.rp-avatar.lv0 { background: #1A73E8; }
.rp-avatar.lv1 { background: #8E24AA; }
.rp-avatar.lv2 { background: #2E7D32; }
.rp-avatar.lv3 { background: #E8830C; }
.rp-name { font-size: 13px; color: var(--text); font-weight: 400; }
.rp-pos { font-size: 12px; color: var(--text-muted); background: var(--bg); padding: 1px 7px; border-radius: 6px; }
.rp-status-dot { width: 8px; height: 8px; border-radius: 50%; margin-left: auto; flex: 0 0 auto; }
.rp-status-dot.rp-on { background: #2E7D32; }
.rp-status-dot.rp-off { background: #c0c4cc; }

/* 右详情 */
.rp-detail-card { min-height: 100%; }
.rp-detail-empty { color: var(--text-muted); padding: 40px 20px; text-align: center; font-size: 14px; }
.rp-detail-head { display: flex; align-items: center; gap: 12px; padding: 16px; border-bottom: 1px solid var(--border); }
.rp-detail-avatar { width: 48px; height: 48px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 20px; color: #fff; font-weight: 700; background: #1A73E8; flex: 0 0 auto; }
.rp-detail-title { flex: 1; min-width: 0; }
.rp-detail-name { font-size: 17px; font-weight: 700; color: var(--text-strong); }
.rp-detail-no { font-size: 12px; color: var(--text-muted); font-weight: 400; margin-left: 6px; }
.rp-detail-sub { font-size: 13px; color: var(--text-muted); margin-top: 3px; }
.rp-badge { font-size: 12px; padding: 3px 10px; border-radius: 12px; flex: 0 0 auto; }
.rp-badge.on { background: #E8F5E9; color: #2E7D32; }
.rp-badge.off { background: #EDEFF2; color: #9aa0a6; }

.rp-section-title { font-size: 13px; font-weight: 600; color: var(--text-strong); margin: 16px 16px 8px; padding-left: 8px; border-left: 3px solid var(--primary); }
.rp-muted { color: var(--text-muted); font-size: 13px; padding: 0 16px 4px; }

/* 汇报链 */
.rp-chain { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: 0 16px; }
.rp-chain-node { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; background: var(--bg); border-radius: 18px; cursor: pointer; transition: background .12s; }
.rp-chain-node:hover { background: var(--primary-soft); }
.rp-chain-node.self { background: var(--primary); color: #fff; }
.rp-chain-node.self .rp-chain-avatar { background: rgba(255,255,255,.25); }
.rp-chain-avatar { width: 20px; height: 20px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; color: #fff; font-weight: 600; }
.rp-chain-avatar.lv0 { background: #1A73E8; }
.rp-chain-avatar.lv1 { background: #8E24AA; }
.rp-chain-avatar.lv2 { background: #2E7D32; }
.rp-chain-avatar.lv3 { background: #E8830C; }
.rp-chain-name { font-size: 13px; font-weight: 400; }
.rp-chain-pos { font-size: 11px; opacity: .8; }
.rp-chain-arrow { color: var(--text-muted); font-size: 13px; }

/* 直接上级 mini 行 */
.rp-mini-row { display: flex; align-items: center; gap: 8px; padding: 6px 16px; cursor: pointer; border-radius: 8px; margin: 0 8px; }
.rp-mini-row:hover { background: var(--bg); }

/* 下级团队 */
.rp-sub-tree { padding: 0 8px 8px; }
.rp-sub-item { display: flex; align-items: center; gap: 8px; padding: 5px 8px; border-radius: 8px; cursor: pointer; transition: background .12s; }
.rp-sub-item:hover { background: var(--bg); }
.rp-sub-count { margin-left: auto; font-size: 11px; color: var(--text-muted); background: var(--bg); padding: 1px 7px; border-radius: 10px; }

/* 视图切换 segmented control */
.seg-control { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: #fff; }
.seg-btn { border: none; background: transparent; padding: 7px 14px; font-size: 13px; color: var(--text-muted); cursor: pointer; font-family: inherit; }
.seg-btn.active { background: var(--primary); color: #fff; }

/* 关系图容器 */
.rp-view-wrap { flex: 1; min-height: 0; min-width: 0; display: flex; flex-direction: column; overflow: hidden; }
.rp-graph-box { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.rp-graph-hint { font-size: 12px; color: var(--text-muted); padding: 8px 12px 4px; }
.rp-graph-scroll { flex: 1; min-height: 0; overflow: auto; display: flex; align-items: center; justify-content: center; background:
  repeating-linear-gradient(0deg, transparent, transparent 23px, #f4f6f9 23px, #f4f6f9 24px),
  repeating-linear-gradient(90deg, transparent, transparent 23px, #f4f6f9 23px, #f4f6f9 24px);
  background-color: #fafbfc;
}
#rpGraphSvg { display: block; cursor: grab; flex: 0 0 auto; }
.rp-edge { fill: none; stroke: #c4ccd6; stroke-width: 1.5; }
.rp-grect { fill: #fff; stroke-width: 1.5; filter: drop-shadow(0 1px 2px rgba(0,0,0,.08)); }
.rp-gnode { cursor: pointer; }
.rp-gnode:hover .rp-grect { fill: #f0f6ff; }
.rp-gnode.selected .rp-grect { fill: #e8f0fe; stroke-width: 2.5; }
.rp-gnode.off .rp-grect { fill: #f4f5f7; }
.rp-gnode.off .rp-gname { fill: #9aa0a6; }
.rp-gdot-t { fill: #fff; font-size: 11px; font-weight: 600; }
.rp-gname { fill: var(--text-strong); font-size: 13px; font-weight: 600; }
.rp-gpos { fill: var(--text-muted); font-size: 11px; }

/* ===================== 汇报关系 · 架构图（卡片式） ===================== */
/* 2026-10-23：由 modules/report_chart_modules.js 渲染。
   实线连线引擎自「集团矩阵组织架构图」移植（CSS 伪元素：父节点垂直下线 + T 型横线
   + 圆角分支 + 单节点直通 + 首尾半线清理）；虚线为 SVG 覆盖层（矩阵汇报，
   接口节点带 dotted 字段时自动出现，当前无数据源故默认不画）。 */
.rp-chart-box { flex: 1; min-height: 0; min-width: 0; display: flex; flex-direction: column; overflow: hidden; }
.rpc-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 12px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.rpc-hint { font-size: 12px; color: var(--text-muted); }
.rpc-bar-btns { display: flex; align-items: center; gap: 6px; }
.rpc-bar-btns .btn-secondary { padding: 4px 10px; font-size: 12px; }
.rpc-zoom-val { font-size: 12px; color: var(--text-muted); min-width: 40px; text-align: center; }
.rpc-scroll {
  flex: 1; min-height: 0; min-width: 0; overflow: auto;
  background:
    repeating-linear-gradient(0deg, transparent, transparent 23px, #f4f6f9 23px, #f4f6f9 24px),
    repeating-linear-gradient(90deg, transparent, transparent 23px, #f4f6f9 23px, #f4f6f9 24px);
  background-color: #fafbfc;
}
.rpc-canvas { position: relative; margin: 0 auto; }
.rpc-zoom { position: absolute; top: 0; left: 0; width: max-content; transform-origin: top left; }
.rpc-edges { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1; overflow: visible; }
.rpc-tree { position: relative; z-index: 2; padding: 26px 44px 84px; }

/* --- 树形骨架与连线 --- */
.rpc-node { display: flex; flex-direction: column; align-items: center; position: relative; padding: 0 14px; }
.rpc-children { display: flex; justify-content: center; position: relative; padding-top: 36px; }
/* 1. 父节点垂直向下的线（连到 T 型交点） */
.rpc-node.has-children::before {
  content: ''; position: absolute; top: 100%; left: 50%;
  width: 2px; height: 18px; background: #c9cdd4;
  transform: translateX(-50%); z-index: 1; transition: background-color .3s;
}
/* 2. 子节点顶部横向骨干线 */
.rpc-children::before {
  content: ''; position: absolute; top: 18px; left: 0; right: 0;
  height: 2px; background: #c9cdd4; z-index: 1;
}
/* 3. T 型交点微圆点 */
.rpc-children::after {
  content: ''; position: absolute; top: 15px; left: 50%;
  width: 8px; height: 8px; background: #fafbfc;
  border: 2px solid #c9cdd4; border-radius: 50%;
  transform: translateX(-50%); z-index: 2; transition: border-color .3s;
}
.rpc-children > .rpc-node { padding-top: 18px; }
/* 4. 子节点向上的分支线（带圆角） */
.rpc-children > .rpc-node::before {
  content: ''; position: absolute; top: 0; left: 50%;
  width: 50%; height: 18px;
  border-bottom: 2px solid #c9cdd4; border-left: 2px solid #c9cdd4;
  border-bottom-left-radius: 8px; z-index: 1; transition: border-color .3s;
}
.rpc-children > .rpc-node::after {
  content: ''; position: absolute; top: 0; right: 50%;
  width: 50%; height: 18px;
  border-bottom: 2px solid #c9cdd4; border-right: 2px solid #c9cdd4;
  border-bottom-right-radius: 8px; z-index: 1; transition: border-color .3s;
}
/* 首尾子节点清理多余的半截线 */
.rpc-children > .rpc-node:first-child::before { display: none; }
.rpc-children > .rpc-node:last-child::after { display: none; }
/* 独立单节点直通线 */
.rpc-children > .rpc-node:only-child::before,
.rpc-children > .rpc-node:only-child::after { display: none; }
.rpc-children:has(> .rpc-node:only-child)::before,
.rpc-children:has(> .rpc-node:only-child)::after { display: none; }
.rpc-children > .rpc-node:only-child::before {
  content: ''; position: absolute; top: 0; left: 50%;
  width: 2px; height: 18px; background: #c9cdd4;
  border: none; border-radius: 0; transform: translateX(-50%); display: block;
}
/* 汇报链高亮（置于基础连线规则之后） */
.rpc-node.on-path.has-children::before { background: var(--primary); }
.rpc-node.on-path > .rpc-children::before { background: var(--primary); }
.rpc-node.on-path > .rpc-children::after { border-color: var(--primary); }
.rpc-children > .rpc-node.on-path::before,
.rpc-children > .rpc-node.on-path::after { border-color: var(--primary); }
.rpc-children > .rpc-node:only-child.on-path::before { background: var(--primary); border: none; }

/* --- 人员卡片 --- */
.rpc-card {
  width: 220px; background: #fff;
  border: 1.5px solid #f2f3f5; border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,.04), 0 1px 3px rgba(0,0,0,.02);
  cursor: pointer; position: relative; z-index: 3;
  display: flex; flex-direction: column;
  transition: all .25s cubic-bezier(.25,.8,.25,1);
}
.rpc-card:hover { box-shadow: 0 12px 24px -8px rgba(0,0,0,.1), 0 4px 12px -4px rgba(0,0,0,.05); }
.rpc-card.is-active {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26,115,232,.12), 0 12px 24px -8px rgba(0,0,0,.1);
  transform: translateY(-2px);
}
.rpc-card.is-selected {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26,115,232,.16), 0 12px 24px -8px rgba(0,0,0,.1);
}
.rpc-card.is-off .rpc-cname { color: var(--text-muted); }
.rpc-chead { display: flex; align-items: center; gap: 9px; padding: 10px 12px; border-bottom: 1px solid #f2f3f5; }
.rpc-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; color: #fff; font-weight: 600; flex: 0 0 auto;
}
.rpc-avatar.lv0 { background: #1A73E8; }
.rpc-avatar.lv1 { background: #8E24AA; }
.rpc-avatar.lv2 { background: #2E7D32; }
.rpc-avatar.lv3 { background: #E8830C; }
.rpc-cmain { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.rpc-cname { font-size: 13.5px; font-weight: 600; color: var(--text-strong); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rpc-cpos { font-size: 11.5px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rpc-cside { display: flex; flex-direction: column; align-items: center; gap: 4px; flex: 0 0 auto; }
.rpc-lv { font-size: 10px; color: var(--text-muted); background: var(--bg); padding: 1px 6px; border-radius: 8px; }
.rpc-cbody { padding: 8px 12px 10px; display: flex; flex-direction: column; gap: 3px; }
.rpc-meta { font-size: 11.5px; color: var(--text-muted); line-height: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rpc-meta b { color: var(--text-secondary); font-weight: 600; }
/* 展开/收起按钮：压在连线上，白环断线 */
.rpc-toggle {
  position: absolute; bottom: -12px; left: 50%; transform: translateX(-50%);
  width: 22px; height: 22px; background: #fff;
  border: 2px solid #c9cdd4; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; z-index: 4; color: var(--text-muted);
  box-shadow: 0 0 0 4px #fafbfc; padding: 0; transition: all .2s;
}
.rpc-toggle:hover { border-color: var(--primary); color: var(--primary); }
.rpc-toggle.is-expanded svg { transform: rotate(180deg); }
.rpc-toggle svg { width: 11px; height: 11px; transition: transform .3s; }

/* --- 虚线（矩阵汇报，预留）：接口带 dotted 时渲染 --- */
.rpc-edge {
  fill: none; stroke: #fa8c16; stroke-width: 2;
  stroke-dasharray: 7 6; stroke-linecap: round;
  marker-end: url(#rpcArrow); transition: stroke .25s;
}
.edge-group.hl .rpc-edge { stroke: var(--primary); marker-end: url(#rpcArrowHl); }
.rpc-edge-label {
  font-size: 10px; fill: var(--text-muted); opacity: 0; transition: opacity .25s;
  paint-order: stroke; stroke: #fafbfc; stroke-width: 4px; stroke-linejoin: round;
}
.edge-group.hl .rpc-edge-label { opacity: 1; fill: var(--primary); }

/* ===================== 社保福利模块 ===================== */
/* 子tab栏间距与花名册 #empSubTabs 同一口径（2026-10-08 调优值实测对齐）：
   顶栏→tab栏 2px（上提 -2px）、tab 紧凑 padding 4px 16px（栏高 32px）、
   tab栏→数据列表 0px（pane 首元素 .toolbar 自带间距衔接，同花名册结构） */
#view-org-social .sub-tabs { margin: -2px 0 0; }
#view-org-social .sub-tab { padding: 4px 16px; }

/* 社保/公积金规则：两行分组表头（缴费基数→上限/下限，缴费比例→单位/个人） */
/* 全局 .data-table th 是逐格 sticky（top:0），两行表头会让第二行滚动时叠上第一行；
   这里关掉逐格 sticky，改由 thead 整块 sticky（Chromium 91+ 支持），两行作为整体吸顶 */
#view-org-social .ss-rule-thead th { position: static; }
#view-org-social .remit-pivot thead th { position: static; }
#view-org-social .remit-pivot thead tr:first-child th { border-bottom: 1px solid var(--border); }
#view-org-social .remit-pivot { min-width: 1400px; }

#view-org-social .ss-rule-thead .thead-sub th {
  font-weight: 500; color: var(--text-muted); font-size: 12px;
}
/* 全表默认只有横向分隔线（无竖线），两行分组表头沿用同一风格：
   第一行分组名下方、整个表头底部各一条横线；分组内部(上限/下限、单位/个人)不画竖线，靠第二行副表头名分隔，与 Excel 合并表头一致 */

.social-pane { animation: fadeIn .2s ease; }

/* 月度台账：纵向 flex 布局（与花名册 .employee-page 同一模式）——
   表格区在固定高度内滚动（thead 整块吸顶）、翻页器钉在表格下、说明卡「算薪与财务联动」置页面底部 */
#view-org-social .social-pane[data-pane="remit"] { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
#view-org-social .social-pane[data-pane="remit"] > .toolbar { flex: 0 0 auto; }
#view-org-social .remit-table-card { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
#view-org-social .remit-table-card > .table-wrap { flex: 1 1 auto; min-height: 0; overflow: auto; }
#view-org-social .remit-table-card > .pagination { flex: 0 0 auto; }
#view-org-social .social-pane[data-pane="remit"] > .remit-note-card { flex: 0 0 auto; }

/* 政策规则弹窗：表单列数随弹窗宽度自适应（拉伸浮窗时自动增减列数）。
   覆盖 css_global.css 对 .modal.modal-auto .form-grid 的固定 2 列 + width:max-content；
   ID 选择器特异度高于全局类选择器，弹窗默认宽约 2 列，拉宽浮窗自动变 3/4 列 */
#socialRuleForm .form-grid,
.float-win__body > .modal #socialRuleForm .form-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  width: 100%;
  max-width: 100%;
}

/* 缴费基数方案弹窗：初始固定 2 列（3 列过挤、内容显示不全），随浮窗拖宽自适应 3 列、拖窄 1 列。
   300px 最小轨道：默认 720px 窗（内容约 692px）= 2 列；拉宽到约 960px 起 = 3 列 */
#socialPlanForm .form-grid,
.float-win__body > .modal #socialPlanForm .form-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 290px), 1fr));
  width: 100%;
  max-width: 100%;
}

/* 待入职弹窗（新建/编辑）表单：列数 + 标签折行修正（2026-10-23）。
   浮窗内 .form-grid 默认 210px 最小轨道（本文件 line 2283 浮窗通用规则），960px 窗会排出
   4 列 219px——长标签（政治面貌/最高学历/关联候选人）被挤压换行断裂
   （如"政治面/貌"、"最高学/历"），且浮窗规则将 label 的 white-space 改为 normal（line 2294）允许折行。
   按 290px 最小轨道收复为 3 列（约 297px/列，标签与控件均舒展，与缴费基数方案弹窗同口径；
   300px 在 924px 内容宽下差 8px 只排 2 列，故取 290px），标签禁止折行；
   双选择器同时覆盖遮罩态与浮窗态，ID 特异度压过浮窗通用 0-3-0 规则；
   拖窄浮窗时 3→2→1 自然重排（960→3 列 / 700→2 列 / 480→1 列），与系统 .form-grid 行为一致。 */
#ebForm .form-grid,
.float-win__body > .modal #ebForm .form-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 290px), 1fr));
  width: 100%;
  max-width: 100%;
}
#ebForm .form-grid label,
.float-win__body > .modal #ebForm .form-grid label {
  white-space: nowrap;
}

/* 待入职弹窗：所属部门/岗位/职级 三联合一行（2026-10-23）。
   原结构两层问题：① 外层 <label class="full"> 直排文本「部门 / 岗位 / 职级」，而 .form-grid label
   是 flex-row → 文本与级联块横向并排、把级联挤去右侧，文本本身冗余（HTML 已去掉，外层改 div.full）；
   ② 级联内两级行（所属部门独占一行、岗位/职级第二行）上下堆叠；且 .form-grid label 的
   align-items:center 泄漏进列方向的级联单元格使 caption 居中、label>input 的 flex:1
   在列方向把部门输入框压成 19px（与 30px 系统标准不一致）。
   现改为三联合一行 + 标签左对齐（与招聘需求 #recruitLinkage、员工基本信息级联同口径：
   caption 吃 .form-grid label>span 的 flex:0 0 auto 居左，控件吃 label>input/.wb-combo 的 flex:1 撑满）；
   列轨沿用 .emp-cascade 默认 auto-fit 220px，拖窄浮窗 3→2→1 自然重排；
   行尾 margin 归零——级联行后面跟了一批 hidden input，:last-child 不生效会留 14px，
   与 form-grid 的 14px 行距叠加成 28px 双倍间距；
   双选择器同时覆盖遮罩态与浮窗态，ID 特异度压过浮窗通用 0-3-0 规则。 */
#entryDeptPosCascade .cascade-row,
.float-win__body > .modal #entryDeptPosCascade .cascade-row {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  margin-bottom: 0;
}
#entryDeptPosCascade .cascade-cell,
.float-win__body > .modal #entryDeptPosCascade .cascade-cell {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
}

/* 其余子版块（参保方案/政策规则库/补缴台账/变更历史/意外险）与月度台账同款四件套：
   表格卡在固定高度内滚动、翻页器钉在表格下、说明卡置页面底部 */
#view-org-social .social-pane,
#view-org-accident .social-pane { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
#view-org-social .social-pane > .toolbar,
#view-org-accident .social-pane > .toolbar { flex: 0 0 auto; }
#view-org-social .ss-table-card,
#view-org-accident .ss-table-card { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
#view-org-social .ss-table-card > .table-wrap,
#view-org-accident .ss-table-card > .table-wrap { flex: 1 1 auto; min-height: 0; overflow: auto; }
#view-org-social .ss-table-card > .pagination,
#view-org-accident .ss-table-card > .pagination { flex: 0 0 auto; }
#view-org-social .social-pane > .ss-note-card,
#view-org-accident .social-pane > .ss-note-card { flex: 0 0 auto; }
/* 意外险子 tab 栏间距与社保/公积金（#view-org-social）同一口径：上提贴顶栏、标签紧凑、与下方工具栏零间距 */
#view-org-accident .sub-tabs { margin: -2px 0 0; }
#view-org-accident .sub-tab { padding: 4px 16px; }
.kpi-card {
  background: var(--card-bg); border-radius: var(--radius-lg);
  padding: 14px 16px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 4px;
  transition: transform .18s ease, box-shadow .18s ease;
}
.kpi-card:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(26,115,232,.10); }
.kpi-card .kpi-value { font-size: 22px; font-weight: 600; color: var(--text-strong); line-height: 1.2; }
.kpi-card .kpi-label { font-size: 12px; color: var(--text-muted); }
#view-org-social .wb-kpi { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1100px) { #view-org-social .wb-kpi { grid-template-columns: repeat(2, 1fr); } }

/* 接口规范卡片 */
.social-iface-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.iface-card {
  background: var(--card-bg); border-radius: var(--radius-lg); padding: 14px 16px;
  box-shadow: var(--shadow); border-left: 3px solid var(--primary);
  display: flex; flex-direction: column; gap: 8px;
}
.iface-name { font-weight: 600; color: var(--text-strong); font-size: 14px; }
.iface-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 12px; }
.iface-dir { font-size: 11px; padding: 2px 8px; border-radius: 8px; font-weight: 600; }
.iface-dir.in { background: #E6F7EE; color: #1a9e57; }
.iface-dir.out { background: #E8F0FE; color: #2b6cff; }
.iface-dir.inner { background: #FEF6E7; color: #B7791F; }
.iface-content { font-size: 12px; color: var(--text-muted); line-height: 1.7; }

/* ============================================================
   花名册：单行统计条（|| 分隔） + 高级筛选条（并入工具栏）
   ============================================================ */
.emp-stat-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  align-items: stretch;
  gap: 10px;
  margin: 0 0 6px;
  font-size: 14px;
}
.emp-stat-item { transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
  position: relative;
  display: flex; flex-direction: column; gap: 2px;
  min-width: 0; height: 100%; min-height: 108px;
  padding: 7px 12px;
  background: #fff; border: 1px solid var(--border, #e5e7eb);
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(16,24,40,.06), 0 8px 20px -8px rgba(16,24,40,.12);
  cursor: pointer; white-space: normal; user-select: none;
  --accent: var(--primary, #1a73e8);
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease, background .15s;
}
.emp-stat-item:hover { transform: translateY(-4px); box-shadow: 0 4px 6px rgba(16,24,40,.06), 0 20px 36px -14px rgba(16,24,40,.28); border-color: var(--accent); }
.emp-stat-item.emp-stat-static { cursor: default; }
.emp-stat-item.emp-stat-static:hover { transform: translateY(-4px); border-color: var(--accent); box-shadow: 0 6px 16px -6px color-mix(in srgb, var(--accent) 30%, rgba(16,24,40,.20)), 0 14px 28px -14px color-mix(in srgb, var(--accent) 22%, transparent); }
.emp-stat-item.active { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 22%, transparent); background: color-mix(in srgb, var(--accent) 6%, #fff); }
.emp-stat-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.esc-label { font-size: 12.5px; font-weight: 600; line-height: 1.15; color: var(--text-2, #374151); }
.emp-stat-icon { flex: none; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 7px; color: var(--accent); background: color-mix(in srgb, var(--accent) 13%, transparent); }
.emp-stat-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.emp-stat-chip { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 999px; font-size: 10.5px; font-weight: 600; line-height: 1.5; color: var(--chip, #3b82f6); background: color-mix(in srgb, var(--chip, #3b82f6) 10%, transparent); border: 1px solid color-mix(in srgb, var(--chip, #3b82f6) 28%, transparent); }
.emp-stat-chip i { flex: none; width: 5px; height: 5px; border-radius: 999px; background: var(--chip, #3b82f6); }
.emp-stat-chip b { font-weight: 600; }
.emp-stat-duo { display: flex; gap: 22px; margin-top: 3px; }
.emp-stat-duo .duo-cell { display: flex; flex-direction: column; line-height: 1.15; }
.emp-stat-duo .duo-cell i { font-style: normal; font-size: 10.5px; color: var(--text-3, #6b7280); }
.emp-stat-duo .duo-cell b { font-size: 17px; font-weight: 700; color: var(--text-1, #111827); }
.emp-stat-duo .duo-cell em { font-style: normal; font-size: 10.5px; margin-left: 2px; font-weight: 600; color: var(--text-2, #374151); }
.emp-stat-icon svg { width: 21px; height: 21px; display: block; }
.esc-value {
  margin-top: 1px; font-size: 20px; font-weight: 700; line-height: 1.0;
  letter-spacing: -0.02em;
  color: var(--text-1, #0f172a);
  font-variant-numeric: tabular-nums;
}
.esc-value .unit { margin-left: 3px; font-size: 11px; font-weight: 600; color: var(--text-2, #374151); }
.esc-value.danger { color: var(--danger, #dc2626); }
.esc-value.warn { color: #d97706; }
.esc-value.ok { color: #059669; }
/* 进度条 */
.emp-stat-progress { height: 5px; margin-top: 6px; border-radius: 999px; background: color-mix(in srgb, var(--accent) 15%, transparent); overflow: hidden; }
.emp-stat-progress > i { display: block; height: 100%; border-radius: 999px; background: var(--accent); }
/* 堆叠条（分布） */
.emp-stat-stack { display: flex; height: 5px; border-radius: 999px; overflow: hidden; margin-top: 2px; gap: 2px; }
.emp-stat-stack > i { display: block; height: 100%; }
.emp-stat-stack-legend { display: flex; flex-wrap: wrap; gap: 3px 10px; margin-top: 2px; font-size: 11.5px; line-height: 1.25; max-height: 30px; overflow: hidden; color: var(--text-2, #374151); }
.emp-stat-stack-legend span { display: inline-flex; align-items: center; gap: 4px; }
.emp-stat-stack-legend i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }
/* 迷你列表（Top3） */
.emp-stat-list { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.emp-stat-list__item { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.emp-stat-list__item .sl-name { color: var(--text-2, #374151); white-space: nowrap; }
.emp-stat-list__item .sl-bar { flex: 1; min-width: 40px; height: 6px; border-radius: 999px; background: color-mix(in srgb, var(--accent) 12%, transparent); overflow: hidden; }
.emp-stat-list__item .sl-bar > i { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.emp-stat-list__item .sl-val { font-weight: 700; color: var(--text-1, #0f172a); font-variant-numeric: tabular-nums; }
/* 竖向迷你柱状图（参考设计稿 .spark）：关系分布等 */
.emp-stat-spark { display: flex; align-items: flex-end; gap: 3px; height: 13px; margin-top: 4px; }
.emp-stat-spark > i { flex: 1; min-height: 4px; border-radius: 3px 3px 2px 2px; background: color-mix(in srgb, var(--accent) 22%, transparent); transition: background .2s ease; }
.emp-stat-spark > i:last-child { background: var(--accent); }
.emp-stat-item:hover .emp-stat-spark > i { background: color-mix(in srgb, var(--accent) 40%, transparent); }
.emp-stat-item:hover .emp-stat-spark > i:last-child { background: var(--accent); }
/* 底部趋势/脚注 */
.emp-stat-foot { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 1px; font-size: 11px; color: var(--text-3, #5b6577); }
.emp-stat-trend { display: inline-flex; align-items: center; gap: 3px; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.emp-stat-trend svg { width: 12px; height: 12px; }
.emp-stat-trend.up { color: #10b981; background: rgba(16,185,129,.14); }
.emp-stat-trend.down { color: #ef4444; background: rgba(239,68,68,.14); }
.emp-stat-trend.warn { color: #f59e0b; background: rgba(245,158,11,.14); }
/* || 分隔符（卡片式下不再生成，保留样式以防别处引用） */
.esc-sep {
  color: var(--text-faint, #9ca3af);
  font-weight: 700; font-size: 13px;
  margin: 0 4px; user-select: none; line-height: 1;
}

/* 高级筛选条并入工具栏：去掉独立行的外边距，加左侧分隔线 */
.toolbar .emp-filter-bar { margin: 0; }
#view-emp-list .toolbar .emp-filter-group { padding-left: 14px; border-left: 1px solid var(--border, #e5e7eb); }
.emp-filter-bar { margin: 10px 0 12px; }
.emp-filter-group { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.efg-label { font-size: 13px; color: var(--text-muted, #6b7280); white-space: nowrap; }
.filter-date {
  height: 32px; padding: 0 10px;
  border: 1px solid var(--border, #d0d7de); border-radius: 8px;
  background: #fff; font-size: 13px; color: var(--text, #111);
  outline: none;
}
/* 花名册搜索栏日期区间框收窄（仅作用于此视图，不影响其它页面的 .filter-date） */
#view-emp-list .emp-filter-bar .filter-date {
  width: 112px; padding: 0 6px; flex: 0 0 auto;
}
/* 入职日期：单框日期范围选择器（复用 createRangePicker），收窄以适配紧凑工具栏 */
#view-emp-list .emp-filter-bar .att2-rp { flex: 0 0 auto; }
#view-emp-list .emp-filter-bar .att2-rp .att2-rp-in { width: 68px; font-size: 12px; }
#view-emp-list .emp-filter-bar .att2-rp .att2-rp-pop { width: 500px; }
/* 日期框遵循全局规则：收起态仅浅灰描边，hover/focus/open 不改颜色 */

/* 花名册工具栏单行紧凑布局：收窄搜索框、按钮不换行、间距收紧 */
#view-emp-list .toolbar { gap: 8px; flex-wrap: wrap; row-gap: 6px; }
#view-emp-list .toolbar-left { gap: 8px; min-width: 0; }
#view-emp-list .toolbar-right { gap: 6px; margin-left: auto; }
#view-emp-list .toolbar-right button { padding: 0 8px; white-space: nowrap; }
/* 花名册自定义排序控件（字段 + 升降序） */
#view-emp-list .emp-sort-ctl { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
#view-emp-list .emp-sort-ctl .filter-select { width: 104px; height: var(--ctrl-h, 32px); flex: 0 0 auto; }
#view-emp-list .emp-sort-ctl #empSortDir { min-width: 62px; height: var(--ctrl-h, 32px); padding: 0 8px; }
#view-emp-list .search-combined .search.search-dark.combo { width: 240px; max-width: 30vw; min-width: 180px; }
#view-emp-list .emp-filter-group { gap: 6px; flex-wrap: nowrap; }
#view-emp-list .efg-label { font-size: 12px; }

/* ============================================================
   员工详情 · 全生命周期时间轴（scoped，避免与通用 .timeline 冲突）
   ============================================================ */
.emp-lifecycle { list-style: none; margin: 0; padding: 0 0 0 4px; }
.emp-lifecycle .emp-tl-item {
  position: relative; display: flex; gap: 8px; padding: 0 0 8px 0;
}
.emp-lifecycle .emp-tl-item::before {
  content: ''; position: absolute; left: 8px; top: 20px; bottom: 0;
  width: 2px; background: var(--border, #e5e7eb);
}
.emp-lifecycle .emp-tl-item:last-child::before { display: none; }
.emp-lifecycle .emp-tl-dot {
  position: relative; z-index: 1; flex: 0 0 18px; margin: 0;
  width: 18px; height: 18px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; color: #fff;
  border: 2px solid #fff; box-shadow: 0 0 0 1px var(--border, #e5e7eb);
}
/* 全生命周期：一条数据压在一行内展示（参考「变更历史」紧凑单行），过长部分省略号截断 */
.emp-lifecycle .tl-body {
  flex: 1 1 auto; min-width: 0; max-height: none;
  display: flex !important;
  flex-direction: row !important;
  align-items: baseline; gap: 8px;
  flex-wrap: nowrap; overflow: hidden;
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  padding: 0 !important;
  box-shadow: none !important;
}
.emp-lifecycle .tl-head {
  display: inline-flex; align-items: baseline; gap: 6px; flex: 0 0 auto;
  font-size: 13px; color: var(--text-muted, #6b7280); margin-bottom: 0; white-space: nowrap;
}
.emp-lifecycle .tl-head b { color: var(--text-strong, #111); font-weight: 600; }
.emp-lifecycle .tl-date { font-size: 12px; color: var(--text-faint, #9ca3af); margin-left: 0; }
.emp-lifecycle .tl-meta {
  flex: 1 1 auto; min-width: 0;
  font-size: 13px; color: var(--text, #374151); line-height: 1.45;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.emp-lifecycle .tl-src {
  flex: 0 0 auto; margin-top: 0;
  font-size: 12px; color: var(--text-faint, #9ca3af); white-space: nowrap;
}

/* 变更历史 / 全生命周期：保持各自独立卡片（沿用 .emp-section 默认白卡样式），
   仅内部条目压缩为单行紧凑展示（见上方 .emp-lifecycle 与 .timeline.compact 规则） */

/* ---------- 花名册批量勾选列 + 批量操作条 ---------- */
#empTable th.col-check, #empTable td.col-check {
  width: 38px; min-width: 38px; max-width: 38px; text-align: center; padding-left: 6px; padding-right: 6px;
}
#empTable td.col-check { cursor: pointer; }
.chk-cell { display: inline-flex; align-items: center; justify-content: center; line-height: 1; }
.emp-row-check, #empCheckAll { width: 16px; height: 16px; cursor: pointer; accent-color: var(--primary, #2563eb); }
#empTable tbody tr.emp-tr-selected { background: var(--primary-soft, #eef4ff); }
#empTable tbody tr.emp-tr-selected td.col-check { box-shadow: inset 3px 0 0 var(--primary, #2563eb); }

.emp-batch-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin: 8px 0 10px; padding: 10px 14px;
  background: var(--card, #fff);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.emp-batch-info { font-size: 13px; font-weight: 600; color: var(--text-strong, #1f2937); }
.emp-batch-actions { display: flex; align-items: center; gap: 8px; }
.btn-danger {
  background: var(--danger, #dc2626); color: #fff; border: 1px solid var(--danger, #dc2626);
  border-radius: 6px; cursor: pointer; font-size: 13px; padding: 0 12px; height: 32px;
}
.btn-danger:hover { filter: brightness(0.95); }
.btn-sm { height: 30px; padding: 0 12px; font-size: 13px; border-radius: 6px; }
.link-btn {
  background: none; border: none; color: var(--primary, #2563eb); cursor: pointer;
  font-size: 13px; padding: 0 4px; text-decoration: underline;
}




#ctGenericModal .modal-body { padding: 16px 18px; }

/* ===================== 合同管理台账：结构对齐花名册左侧列表 =====================
   card 内加 .table-wrap 后命中全局"直角/无边框/透明卡"规则；
   此处再对齐花名册的表格宽度行为（列压缩适配宽度，不横向滚动）。 */
#view-emp-contract .data-table { width: 100%; min-width: 0; table-layout: auto; }

/* ===================== 合同管理统计条：花名册同款（点击筛选） =====================
   复用 .emp-stat-item / .esc-label / .esc-value / .esc-sep；
   「在职无合同」项无法映射到台账列表筛选（列表展示的是合同行），设为不可点击。 */
#view-emp-contract .emp-stat-cards { margin: 0 0 8px; }
.emp-stat-item.ct-plain { cursor: default; }
.emp-stat-item.ct-plain:hover { background: transparent; }

/* ===================== 新签/编辑合同弹窗：加宽 + 防横向滚动 ===================== */
#ctEditModal .form-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
#ctEditModal .form-grid label { white-space: normal; min-width: 0; }
#ctEditModal .modal-body { overflow-x: hidden; }
#ctEditModal .combo-box .combo-display { width: 100%; }
#ctEditModal .combo-list { max-height: 240px; overflow: auto; }

/* ===================== 编制总览树表（方案 §7.1） ===================== */
.stf-alertbar { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; margin: 0 0 10px; font-size: 12.5px; }
.stf-rollup-head { padding: 8px 12px; font-size: 12.5px; font-weight: 600; color: #334155; border-bottom: 1px solid var(--border, #e5e9f0); background: #f6f8fb; }
.stf-alert { padding: 4px 10px; border-radius: 12px; border: 1px solid var(--border); background: #fff; }
.stf-alert.red { background: #FDECEC; color: #d93025; border-color: #f5c6c6; }
.stf-alert.yellow { background: #FEF7E0; color: #8a6d3b; border-color: #f0c36d; }
.stf-alert.blue { background: #E8F0FE; color: #1a56b0; border-color: #c3d4f5; }
.stf-alert.ok { background: #EAF6EC; color: #1e7e34; border-color: #bfe5c8; }
#stfTreeTable .stf-node td { background: #fff; }
#stfTable .stf-node td, #stfTreeTable tr.stf-node { font-weight: 500; }
#stfTreeTable .stf-toggle { display: inline-block; width: 16px; color: var(--primary); font-size: 11px; }
.stf-toggle-sp { display: inline-block; width: 16px; }
#stfTreeTable .stf-level td { color: var(--text-muted); font-size: 12.5px; background: #FAFBFD; }
#stfTreeTable td.bal-zero, #stfTable td.bal-zero { color: #d93025; font-weight: 600; }
.badge.low { background: #E8F0FE; color: #1a56b0; }

/* ===================== 考勤打卡（新板块）布局修正 =====================
   .employee-page 为纵向 flex 且 .tabs 基础样式带 flex:1，内容少时标签条被拉伸出大片空白；
   固定标签条高度、让面板区自行撑满+滚动。 */
#view-att-clock > .tabs.subtabs {
  flex: 0 0 auto;
  padding: 0 8px;
  border-bottom: 2px solid var(--border);
  margin-bottom: 14px;
  gap: 4px;
}
#view-att-clock > .tabs.subtabs .subtab { padding: 8px 20px; font-size: 14px; }
#view-att-clock > div[id$="Panel"] { flex: 1; min-height: 0; overflow: auto; }
#view-att-clock .card { flex: 0 0 auto; }
#view-att-clock #attHomePanel .card:last-child { flex: 1; min-height: 0; }

/* 考勤打卡：页签条吸顶，防止外层容器滚动后找不到切换标签 */
#view-att-clock > .tabs.subtabs { position: sticky; top: 0; z-index: 10; background: var(--bg, #F5F6FA); }

/* 考勤组卡片 chips */
.chip { display: inline-block; padding: 2px 10px; border: 1px solid var(--border); border-radius: 14px; margin: 0 6px 6px 0; font-size: 12px; background: #fff; }

/* 部门详情 · 组织变更记录（紧凑文本行） */
.dept-log-lines { display: flex; flex-direction: column; gap: 6px; }
.dept-log-line { display: flex; align-items: baseline; gap: 8px; padding: 3px 0; font-size: 12.5px; cursor: default; }
.dept-log-line:last-child { margin-bottom: 0; padding-bottom: 0; }
.dept-log-line .dll-type { flex: 0 0 auto; color: var(--primary); font-weight: 600; }
.dept-log-line .dll-text { flex: 1 1 auto; min-width: 0; overflow: visible; text-overflow: unset; white-space: normal; word-break: break-word; line-height: 1.6; color: var(--text); }
.dept-log-line .dll-meta { flex: 0 0 auto; margin-left: auto; color: var(--text-faint); font-size: 11.5px; white-space: nowrap; }

/* 部门管理：单击行高亮（区别于双击/右键打开详情的 .selected 更深高亮）
   —— 三档底色统一在下方“部门管理数据表”区块定义（hover / row-focus / selected），此处不再单独设色 */

/* ===================== 组织架构树（飞书式 左树右成员） ===================== */
.ost-layout { display: flex; gap: 12px; align-items: flex-start; }
.ost-tree-pane { width: 300px; flex: 0 0 300px; padding: 0 0 8px; overflow: hidden; }
.ost-tree-box { max-height: calc(100vh - 300px); overflow: auto; padding: 0 6px 6px; }
.ost-node { display: flex; align-items: center; gap: 4px; padding: 6px 8px; border-radius: 6px; cursor: pointer; font-size: 13px; }
.ost-node:hover { background: var(--bg, #F5F6FA); }
.ost-node.active { background: #E8F0FE; }
.ost-node.active .ost-node-name { color: var(--primary); font-weight: 600; }
.ost-toggle { width: 16px; flex: 0 0 16px; text-align: center; color: var(--text-faint); font-size: 11px; }
.ost-toggle-sp { width: 16px; flex: 0 0 16px; }
.ost-node-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ost-node-count { flex: 0 0 auto; font-size: 11.5px; color: var(--text-faint); }
.ost-cat-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 5px; vertical-align: 1px; }
.ost-cat-func { background: #1A73E8; }
.ost-cat-sub { background: #E37400; }
.ost-cat-fac { background: #1e7e34; }
.ost-cat-vir { background: #86909c; }

/* ===================== 组织架构树：页签条防拉伸（同培训管理下划线式） ===================== */
#view-org-structure > .tabs.subtabs {
  flex: 0 0 auto;
  padding: 0;
  border-bottom: 1px solid var(--border, #eee);
  margin-bottom: 14px;
  gap: 4px;
  flex-wrap: wrap;
}
#view-org-structure > .tabs.subtabs .subtab {
  padding: 13px 18px 6px;
  font-size: 14px;
  font-weight: 400;
  color: var(--text-faint);
  background: none;
  border-radius: 0;
  border: none;
  border-bottom: 2px solid transparent;
  user-select: none;
}
#view-org-structure > .tabs.subtabs .subtab:hover { color: var(--primary); background: none; }
#view-org-structure > .tabs.subtabs .subtab.active {
  color: var(--primary);
  background: none;
  border-bottom-color: var(--primary);
  font-weight: 600;
  box-shadow: none;
}
#view-org-structure > div[id$="Panel"] { flex: 1; min-height: 0; overflow: auto; }

/* 组织架构树：左右分区比例对齐部门管理（1fr : 2fr 网格，整体等高填充） */
#ostMemberPanel { display: flex; flex-direction: column; overflow: hidden; }
.ost-layout { display: grid; grid-template-columns: 1fr 2fr; gap: 10px; align-items: stretch; flex: 1; min-height: 0; }
.ost-tree-pane { width: auto; flex: initial; display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.ost-tree-box { flex: 1; min-height: 0; max-height: none; }
.ost-main-pane { min-width: 0; display: flex; flex-direction: column; min-height: 0; overflow-y: auto; padding-right: 4px; }
.ost-main-pane .table-wrap { max-height: none !important; overflow: visible; }

/* 组织架构树：右侧头卡不拉伸（.employee-page .card flex:1 全局规则导致空白），成员卡占满剩余高度 */
#view-org-structure .card { flex: 0 0 auto; }
#ostMemberPanel .ost-main-pane > .card:last-child { flex: 1; min-height: 0; }
#ostMemberPanel .ost-main-pane > .card:last-child .table-wrap { flex: 1; min-height: 0; max-height: none !important; overflow: auto; }



/* 部门管理数据表：白底；hover 高亮覆盖部门简称列并加深；表头蓝底 */
#deptTable thead th { background: var(--primary); color: #fff; border-bottom-color: var(--primary); }
#deptTableBody tr.dept-row > td:not([data-col="id"]):not([data-col="name"]) { background: #fff; }
#deptTableBody tr.dept-row > td:first-child { background: #fff; }
/* 行高亮三档（默认白 → 悬停 → 单击 → 选中，逐级加深；原 hover 与 --primary-soft 同为 #E8F0FE 导致选中/悬停分不清） */
#deptTableBody tr.dept-row.hl > td { background: #BBD2F6 !important; }        /* 悬停(JS驱动：滚动中摘除，规避Chrome sticky残影) */
#deptTableBody tr.dept-row.row-focus > td { background: #9FBCF1 !important; }    /* 单击高亮 */
#deptTableBody tr.dept-row.selected > td { background: #84A8EB !important; }     /* 选中（双击/右键打开详情），最深 */
#deptTableBody tr.company-row > td { background: #fff; }

/* 部门简称列：仅表头保留横向分隔线；单元格（含已展开子部门）去除横向线，避免行线干扰树分支 */
#deptTable tbody td.col-name { border-bottom: none; }
/* 但最末一行的简称列补回底部横线：否则整列下方“开口”，与右侧各列的表格底线不齐 */
#deptTable tbody tr:last-child td.col-name { border-bottom: 1px solid var(--border, #e5e7eb); }
/* 部门全称列内容左对齐 */
#deptTable tbody td[data-col="full_name"] { text-align: left; }
/* 所在地 / 部门职责 等文本列左对齐（与全称列一致，长文本居中难读） */
#deptTable tbody td[data-col="location"] { text-align: left; }
#deptTable tbody td[data-col="duty"] { text-align: left; }

/* 部门管理表格：表头垂直滚动时吸顶（双列水平冻结见下方 data-col 块）
   ⚠️ 底色必须与 8880 行的表头蓝底一致：此块只负责 sticky 定位，
   底色仍用 --primary，若写成 #fff 会（同特异性、靠后）覆盖蓝底，
   而文字 color:#fff 仍生效 → 白字白底、表头文字“消失”。 */
#deptTable thead th {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--primary);
}

/* 通讯录：下拉箭头调大 */
.ost-toggle { width: 20px; flex: 0 0 20px; font-size: 14px; color: var(--text-muted); line-height: 1; }
.ost-toggle-sp { width: 20px; flex: 0 0 20px; }

/* ================= 岗位管理（position_instance 全生命周期） ================= */
/* 统计卡 - 紧凑样式 */
/* 统计卡片 → 数据表 的间距对齐招聘需求（.quota-summary margin-bottom:4px） */
.pos-stat-row { display: flex; gap: 8px; margin: 0 0 2px; flex: 0 0 auto; flex-wrap: wrap; }
#posStatRow { margin-left: 0px; }
/* 列表卡左侧与上方子标签栏/统计卡对齐；去掉卡片内边距使数据列表左缘与之一致 */
#view-org-position #posListCard { margin-left: 0; padding: 0; }
.pos-stat { background: var(--card-bg); border: 1px solid var(--border); border-radius: 3px; padding: 3px 8px; min-width: auto; display: inline-flex; align-items: center; gap: 3px; }
.pos-stat-val { font-size: 14px; font-weight: 600; line-height: 1.3; }
.pos-stat-label { font-size: 12px; color: var(--text-muted); }
/* 树形列表 */
.pos-dept-row > td { background: #F7F9FC; font-weight: 600; color: var(--text-strong); padding: 8px 12px; text-align: left; }
.pos-dept-count { font-size: 11px; color: var(--text-faint); font-weight: 400; margin-left: 6px; }
.pos-ops a { margin-right: 2px; white-space: nowrap; }
/* badge 变体（岗位状态） */
.badge { display: inline-block; padding: 1px 6px; border-radius: 10px; font-size: 12px; }
.badge.ok { background: #E6F4EA; color: #1E7E34; }
.badge.gray { background: #EEF0F3; color: #6B7280; }
.badge.warn { background: #FEF3E0; color: #B26A00; }
/* 弹窗 */
.pos-modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center; z-index: 1000; }
.pos-modal { background: var(--card-bg); border-radius: 12px; width: min(720px, 94vw); max-height: 90vh; display: flex; flex-direction: column; box-shadow: 0 12px 40px rgba(0,0,0,.25); resize: both; overflow: hidden; min-width: 480px; min-height: 360px; }
.pos-modal-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--border); font-size: 16px; font-weight: 600; color: var(--text-strong); }
.pos-modal-x { border: none; background: none; font-size: 22px; line-height: 1; cursor: pointer; color: var(--text-muted); }
.pos-modal-body { padding: 16px 18px; overflow: auto; flex: 1 1 auto; }
/* 岗位管理：工具栏筛选器与新增按钮在同一行 */
/* 缩小与左侧导航的间距 */
#view-org-position { margin-left: 2px; margin-top: -27px; }
#view-org-position .sub-tabs { margin: 10px 0 4px; }
/* 子标签文字下移 2px（上内边距 6→8），下划线仍贴容器底边 */
#view-org-position .sub-tab { padding: 8px 18px 2px; }
#view-org-position .pt-row { padding: 4px 10px !important; }
#view-org-position .pt-colheader { padding: 6px 10px !important; }
#view-org-position .toolbar { flex-wrap: nowrap; gap: 8px; margin-bottom: 4px; }
#view-org-position .toolbar-left { flex-wrap: nowrap; gap: 8px; flex: 1 1 auto; min-width: 0; overflow: hidden; }
#view-org-position .toolbar-right { flex: 0 0 auto; }
#view-org-position .toolbar-left .filter-input { width: auto; flex: 0 0 auto; }
#posDeptFilter { min-width: 140px; max-width: 160px; }
#posJobFilter { min-width: 140px; max-width: 180px; }
#posStateFilter { min-width: 100px; max-width: 120px; }
#posKw { min-width: 160px; max-width: 220px; }
@media (max-width: 900px) {
  #view-org-position .toolbar { flex-wrap: wrap; }
  #view-org-position .toolbar-left { flex-wrap: wrap; }
}
.pos-modal { width: min(720px, 94vw); }
.pos-modal .form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 12px 16px; }
.pos-modal .form-grid label { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--text-muted); }
.pos-modal .form-grid label input, .pos-modal .form-grid label select, .pos-modal .form-grid label textarea { width: 100%; box-sizing: border-box; }
/* 新增/编辑岗位弹窗：上下式（标签在上、控件在下），对齐考勤配置 .att2-form */
.pos-modal .form-grid label.full { grid-column: 1 / -1; }
.pos-modal .form-grid label .req-star { color: var(--danger); font-weight: 700; }
.pos-modal .pos-inherit { margin-top: 6px; padding: 6px 10px; background: var(--bg-light); border-radius: 6px; font-size: 12px; color: var(--text-muted); }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 14px; }
.pos-info { background: var(--primary-soft); padding: 8px 12px; border-radius: 8px; font-size: 13px; margin-bottom: 10px; }
.pos-inherit { background: #F7F9FC; border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; font-size: 12.5px; color: var(--text-muted); margin-bottom: 8px; }
/* 任职历史时间线 */
.pos-timeline { position: relative; padding-left: 6px; }
.ph-item { position: relative; padding: 0 0 14px 18px; border-left: 2px solid var(--border); }
.ph-item:last-child { border-left-color: transparent; }
.ph-dot { position: absolute; left: -6px; top: 3px; width: 10px; height: 10px; border-radius: 50%; background: var(--primary); }
.ph-top { display: flex; justify-content: space-between; font-size: 13px; }
.ph-type { font-weight: 600; color: var(--text-strong); }
.ph-date { color: var(--text-faint); font-size: 12px; }
.ph-desc { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; }
/* 岗位架构图 */
.pos-chart { padding: 8px; }
.pos-chart-dept { margin-bottom: 14px; }
.pos-chart-dept-name { font-weight: 600; color: var(--text-strong); margin-bottom: 8px; }
.pos-chart-chips { display: flex; flex-wrap: wrap; gap: 10px; }
.pos-chip { background: #F2F4F7; border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px; min-width: 150px; cursor: pointer; display: flex; flex-direction: column; gap: 2px; }
.pos-chip.occ { border-left: 3px solid var(--success); }
.pos-chip.vac { border-left: 3px solid var(--text-faint); }
.pos-chip.rec { border-left: 3px solid var(--warning); }
.pos-chip-sub { font-size: 11px; color: var(--text-faint); }

/* 字段提示图标 */
.field-tip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--bg,#F0F0F0);
  color: var(--text-faint,#999);
  font-size: 12px;
  font-style: normal;
  cursor: help;
  margin-left: 6px;
  vertical-align: middle;
  transition: background .2s, color .2s;
}
.field-tip:hover {
  background: var(--primary,#1A73E8);
  color: #fff;
}
/* label 容器使用 grid 或 flex 时，让 tip 跟随正确 */
.form-section-body label { position: relative; }


/* 部门表格单独改用 separate + spacing 0
   —— 修复 sticky + collapse 在 Chrome 里的渲染 bug（背景透出、内容叠加、z-index 错乱）
   —— 仅作用于 #deptTable，不影响 .data-table 全局（其他表格仍 collapse） */
#deptTable { border-collapse: separate; border-spacing: 0; }

/* ==========================================================================
   部门管理列表：部门ID + 部门简称 双列冻结（含表头）
   —— 白底、横向滚动时不被其他列覆盖
   —— 用 data-col 属性选择器定位（渲染时 id 列无 col-xxx 类，只有 data-col）
   —— ID 选择器的特异性高于 `.dept-table tbody td.col-name{background:var(--surface)}`，
      故无需 !important；选中行的高亮（!important）仍可正常覆盖，保留选中反馈。
   ========================================================================== */
/* ===== 部门表固定列（部门ID + 部门简称）改「独立浮层 + JS 同步滚动」方案 =====
   彻底规避 Chrome 对 sticky 单元格的滚动叠画残影 bug（hover 高亮行滚动时冻结列文字叠在他行上）。
   - #deptFrozen 绝对定位于 .dept-tree-pane 左上，覆盖原表前两列；
   - 内部 head（表头）固定、body 随 table-wrap.scrollTop 反向偏移 → 视觉冻结；
   - 浮层不透明（白底），遮挡横向滚动后被卷走的原表前两列；
   - 浮层接收点击并转发到对应原表行，交互与原表完全一致。 */
.dept-tree-pane { position: relative; }
.dept-frozen {
  position: absolute; left: 0; top: 0; z-index: 20; overflow: hidden;
  pointer-events: auto;
  box-shadow: none;               /* 浮层不显示任何阴影，与原表完全融为一体 */
}
.dept-frozen-head { overflow: hidden; }
.dept-frozen-body { position: absolute; left: 0; overflow: hidden; }
.dept-frozen-inner { will-change: transform; }
.dept-frozen-table { border-collapse: separate !important; border-spacing: 0; } /* 布局算法与原表一致（宽度由 JS 写入实测原表宽），保证克隆行逐像素同高 */
.dept-frozen-table thead { position: static !important; z-index: auto; }
.dept-frozen-table th, .dept-frozen-table td {
  box-sizing: border-box; background: #fff; white-space: nowrap; overflow: hidden;
  position: static !important;    /* 克隆表必须全面去 sticky：全局 .data-table th/.dept-table .col-name 的 sticky 是类选择器，会命中克隆表，把 Chrome sticky 渲染 bug 带进浮层 */
  border-right: none;             /* 原表无竖向分隔线，浮层也不加，避免多出两道竖线 */
  border-bottom: 1px solid var(--border, #e5e7eb);
}
.dept-frozen-table thead th { background: var(--primary); color: #fff; }
/* 镜像原表 #deptTable 的简称列横线口径（ID 选择器规则不会命中克隆表，须在此复刻）：
   简称列除最末行外不带行线，避免行线干扰树分支引导线 */
.dept-frozen-table tbody td.col-name { border-bottom: none; }
.dept-frozen-table tbody tr:last-child td.col-name { border-bottom: 1px solid var(--border, #e5e7eb); }
.dept-frozen-table tbody td.col-name { background: #fff; }
/* 浮层高亮跟随原表行状态（.hl=悬停 / .row-focus=单击 / .selected=选中），由 MutationObserver 同步 */
#deptFrozen tr.dept-row.hl > td { background: #BBD2F6 !important; }
#deptFrozen tr.dept-row.row-focus > td { background: #9FBCF1 !important; }
#deptFrozen tr.dept-row.selected > td { background: #84A8EB !important; }
/* 覆盖全局 .dept-table .col-name 的 sticky 定位（4279 行），避免冻结列被原表 sticky 单元格再次引入残影 */
#deptTable th[data-col="name"], #deptTable td[data-col="name"] { position: static !important; left: auto !important; }

/* ============================================================
   浮动窗口（非模态 / 可拖拽 / 可缩放 / 按页面隔离 / 同页可多开）
   - #floatLayer 全屏覆盖但 pointer-events:none，不拦截对页面其他区域的操作
   - .float-win 各自 pointer-events:auto，可自由交互、拖动、缩放
   ============================================================ */
#floatLayer { position: fixed; inset: 0; z-index: 5000; pointer-events: none; }
.float-win {
  position: absolute;
  display: flex;
  flex-direction: column;
  min-width: 260px;
  min-height: 140px;
  background: var(--card-bg, #fff);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 10px;
  box-shadow: 0 10px 34px rgba(15, 23, 42, .18);
  overflow: hidden;
  pointer-events: auto;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  color: var(--text, #1f2937);
}
.float-win.is-active { border-color: var(--primary, #1677ff); box-shadow: 0 14px 40px rgba(22, 119, 255, .22); }
.float-win__head {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 8px 0 12px;
  flex: 0 0 auto;
  background: linear-gradient(180deg, #1f2a44, #16213a);
  color: #fff;
  cursor: move;
  user-select: none;
  font-size: 13px;
  font-weight: 600;
}
.float-win__title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.float-win__btns { display: flex; align-items: center; gap: 2px; }
.float-win__btn {
  width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 6px; cursor: pointer; color: #cbd5e1;
  font-size: 15px; line-height: 1;
  transition: background .15s, color .15s;
}
.float-win__btn:hover { background: rgba(255, 255, 255, .14); color: #fff; }
.float-win__body { flex: 1 1 auto; overflow: auto; padding: 14px; background: var(--card-bg, #fff); }
.float-win__resize {
  position: absolute; right: 0; bottom: 0;
  width: 22px; height: 22px; cursor: nwse-resize;
  /* z-index 必须高于弹窗页脚：.modal-foot 是 position:sticky + z-index:3，
     会把右下角这个缩放手柄整个盖住，表现为「浮窗拖不动大小」。
     手柄只是角落一小块，抬高不会影响页脚按钮的点击。 */
  z-index: 6;
  background: linear-gradient(135deg,
    transparent 0 50%,
    rgba(100, 116, 139, .55) 50% 60%,
    transparent 60% 70%,
    rgba(100, 116, 139, .55) 70% 80%,
    transparent 80%);
}
/* 命中区外扩：视觉仍是 22px 斜纹，实际可抓范围放大到 28px，更容易拖中 */
.float-win__resize::after {
  content: ''; position: absolute; inset: -6px 0 0 -6px;
}
.float-win.minimized { height: auto !important; min-height: 0; }
.float-win.minimized .float-win__body,
.float-win.minimized .float-win__resize { display: none; }

/* 部门弹窗（headless 浮窗）承载：.modal 填满窗口、表单随窗口宽度自适应重排 */
.dept-float-modal { width: 100%; max-width: none; max-height: none; }
.dept-float-modal .form-section-body {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
}
.dept-float-modal .dept-cards { grid-column: 1 / -1; }

/* ===== 部门管理弹窗：分板块框起来（参考考勤规则 .att2-fsec）+ 间距收紧 =====
   2026-10-31：① 各分节改为带边框圆角卡片；② 字段行距 22px→12px、列距 24px→16px
   （对齐 .att2-form 的 12px 16px）；③ 分节间距 28px→14px。 */
#deptForm, #candForm {
  gap: 14px 0;                 /* 各分节（①~⑥）之间的纵向间距 */
}
#deptForm .form-section, #candForm .form-section {
  margin-bottom: 0;            /* 改由 #deptForm 的 gap 统一控制，避免重复叠加 */
  border: 1px solid var(--border);
  border-radius: var(--radius, 8px);
  background: var(--card-bg);
  padding: 12px 16px 16px;
}
#deptForm .form-section-title, #candForm .form-section-title {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 12px;
  padding: 0;
  background: none;
  border-left: none;
  border-radius: 0;
  font-size: 13px; font-weight: 600;
  color: var(--text-strong);   /* 对齐 .att2-fsec > .hd .t */
}
/* 编号小方块：对齐 .att2-fsec > .hd .n */
#deptForm .form-section-title .sec-n, #candForm .form-section-title .sec-n {
  display: inline-flex; align-items: center; justify-content: center;
  flex: 0 0 auto;
  width: 18px; height: 18px; border-radius: 5px;
  background: var(--primary-soft, #E8F0FE); color: var(--primary);
  font-size: 10.5px; font-weight: 700;
}
/* 候选人弹窗第 5 节标题的补充说明（弱化） */
#candForm .form-section-title .cand-tt-sub { font-size: 11.5px; font-weight: 400; color: var(--text-faint); }
#deptForm .dept-cards { grid-column: 1 / -1; }
#deptForm .form-section-body {
  gap: 12px 16px;             /* 字段之间的行/列间距（对齐 att2-form） */
}


/* 浮窗承载的弹窗：间距规则同样生效（id 选择器优先级高于浮窗通用规则） */
.float-win__body > .modal #deptForm .form-section-body { gap: 12px 16px; }
.float-win__body > .modal #deptForm, .float-win__body > .modal #candForm { gap: 14px 0; }
/* 部门弹窗列宽：自适应列数（#id 提升特异性）。
   用 auto-fill + minmax，列数随弹窗宽度自动增减（宽屏多列、窄屏少列），
   各列始终等宽 1fr，配合 label 内 flex:1 的输入框，所有输入框右边缘严格对齐。 */
.float-win__body > .modal #deptForm .form-section-body {
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

/* ===== 部门弹窗：参考花名册/员工表单布局 =====
   - 标签为内容宽度、左对齐，与输入框之间保持固定窄间距；
   - 输入框 flex:1 1 0 吃满本列剩余空间，保证同列输入框右边缘对齐；
   - <select> 等 replaced 元素通过 flex-basis:0 忽略 intrinsic width。 */
#deptForm .form-section-body label {
  display: flex;
  flex-direction: column;            /* 2026-10-30 上下式：标签在上、输入框在下 */
  align-items: stretch;
  gap: 5px;
  line-height: 1.4;
}
#deptForm .form-section-body label .lbl-text {
  flex: 0 0 auto;
  width: auto;
  min-width: 0;
  max-width: none;
  text-align: left;
  white-space: normal;
  color: var(--text-muted, #475569);
  font-size: 13px;
  line-height: 1.35;
}
#deptForm .form-section-body label > input,
#deptForm .form-section-body label > select,
#deptForm .form-section-body label > textarea,
#deptForm .form-section-body label > .wb-combo,
#deptForm .form-section-body label > .emp-picker,
#deptForm .form-section-body label > .loc-ac {
  flex: none;                /* 上下式下 input 不能 flex:1（纵轴会坍缩） */
  width: 100%;
  box-sizing: border-box;
  min-width: 0;
  min-height: 32px;
}
/* 内嵌选择器（部门负责人 / 地区联想）整体与内部输入框都撑满 */
#deptForm .form-section-body label .emp-picker,
#deptForm .form-section-body label .loc-ac { width: 100%; }
#deptForm .form-section-body label .emp-picker input,
#deptForm .form-section-body label .loc-ac input { width: 100%; }
/* 跨整行的字段（如部门职责 textarea） */
#deptForm .form-section-body label.full { align-items: stretch; grid-column: 1 / -1; }

/* 部门职责 / 所在地：显式左对齐（编辑框与详情面板口径一致，避免被全局/继承样式居中） */
#deptForm .form-section-body label > textarea[name="duty"],
#deptForm .form-section-body label > .loc-ac input#deptLocationInput { text-align: left; }
.dept-detail .di-duty-body,
.dept-detail .di-v { text-align: left; }

/* 浮窗态：把最小列宽从 340px 提到 420px，进一步保证输入框不被压短 */
.dept-float-modal .form-section-body {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
}

/* 浮窗 最小化 / 最大化 图标（复用系统原模态框头时也可注入到 .modal-head） */
.float-ctrl {
  width: 28px; height: 28px; flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 6px; cursor: pointer; color: inherit;
  font-size: 15px; line-height: 1; user-select: none;
  transition: background .15s, color .15s;
}
.float-ctrl:hover { background: rgba(127, 127, 127, .14); }
.float-ctrl svg { width: 14px; height: 14px; }
.float-win__head .float-ctrl { color: #cbd5e1; }
.float-win__head .float-ctrl:hover { background: rgba(255, 255, 255, .14); color: #fff; }
/* 最大化时铺满主内容区，去掉圆角更贴合 */
.float-win.is-max { border-radius: 0; }

/* 最小化停靠条：左下角横向排列的窗口胶囊 */
.float-dock {
  position: fixed; left: 12px; bottom: 12px; z-index: 5500;
  display: flex; gap: 8px; flex-wrap: wrap; max-width: 60vw;
}
.float-dock__chip {
  background: var(--card-bg, #fff); border: 1px solid var(--border, #e5e7eb);
  border-radius: 8px; padding: 8px 12px; font-size: 13px;
  color: var(--text, #1f2937); cursor: pointer; max-width: 220px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  box-shadow: 0 4px 14px rgba(15, 23, 42, .14);
}
.float-dock__chip:hover { border-color: var(--primary, #1677ff); color: var(--primary, #1677ff); }

/* ============================================================
   上级部门选择器（#deptPickerPop）—— 输入框底下的下拉树
   形态对齐系统其它下拉（.combo-list / .emp-picker-list，白底硬编码色）。
   定位由 core.n14.js 用 anchorFixedList() 写成 position:fixed 贴合
   #deptParentName：fixed 不受 .modal-body(overflow:auto) /
   .float-win__body(overflow:hidden) 裁剪，并自动向下弹出/向上翻出。
   ============================================================ */
.dept-picker-pop {
  position: fixed;                 /* 由 JS 写入 left/top/width/maxHeight */
  z-index: 9000;                   /* 高于浮窗层（.float-win 从 5001 起、每次置顶 +1） */
  display: none;
  flex-direction: column;
  box-sizing: border-box;
  padding: 8px;
  background: #fff;                /* 与 .combo-list / .emp-picker-list 一致：不随夜间模式变暗 */
  border: 1px solid var(--border, #E5E7EB);
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, .18), 0 2px 8px rgba(15, 23, 42, .10);
  max-height: 360px;
  overflow: hidden;
}
.dept-picker-pop.open { display: flex; }
/* 搜索框固定在上，树体吃满剩余高度并自己滚动 */
.dept-picker-pop .dept-picker-search { margin-bottom: 6px; flex: 0 0 auto; }
.dept-picker-pop .dept-picker-tree {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  overflow-y: auto;
  border: none;                    /* 面板自身已有描边，去掉内层双边框 */
  border-radius: 0;
  padding: 2px;
}
.dept-picker-pop .dept-picker-tree::-webkit-scrollbar { width: 8px; }
.dept-picker-pop .dept-picker-tree::-webkit-scrollbar-thumb {
  background: rgba(15, 23, 42, .18); border-radius: 4px;
}
/* 面板口径说明：只列「当前有效」部门（撤销/冻结/筹建中不显示） */
.dept-picker-pop .dept-picker-note {
  flex: 0 0 auto;
  margin: 0 2px 6px;
  padding: 5px 8px;
  border-radius: 6px;
  background: #F8FAFC;
  color: #9AA0A6;
  font-size: 11px;
  line-height: 1.5;
}
.dept-picker-pop .dept-picker-note:empty { display: none; }
/* 级联（.emp-cascade）里的部门锚点：级联自己的样式用 background 简写 + 固定 30px 高，
   会把通用锚点的箭头背景一起清掉，故并列一个更高优先级的选择器把箭头加回来。
   （招聘「申请部门」锚点在 .combo-box 里，同类处理见上面的规则） */
.emp-cascade .cascade-cell input[type="text"].dept-picker-anchor {
  background-color: #fff;
  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='%239AA0A6' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
  cursor: pointer;
}
/* 触发输入框右侧加下拉小箭头，明确「点开选择」的下拉语义
   全系统「选择部门」的锚点输入框统一加 .dept-picker-anchor（原仅 #deptParentName 专属），
   由 core.n14.js 的 window.openDeptPicker() 复用同一浮层。
   注意：.form-grid .combo-box .combo-display 的 background 简写会清掉箭头，故并列一个
   更高优先级的选择器（招聘需求「申请部门」的锚点就在 .combo-box 里）。 */
#deptParentName,
.dept-picker-anchor,
.form-grid .combo-box .combo-display.dept-picker-anchor {
  background-color: #fff;
  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='%239AA0A6' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 30px;
  cursor: pointer;
}

/* 末项「└ 收尾」用底色遮住竖线；面板固定白底，遮罩也必须用白，否则夜间模式出现深色小块 */
.dept-picker-pop .dept-picker-list.nested > .dept-picker-item:last-child::after { background: #fff; }

/* ============================================================
   全部浮窗弹窗统一口径（2026-09-14，参考部门/招聘弹窗模式）：
   1) 打开多个弹窗互不覆盖 —— 由 floatwin.js 克隆多实例保证（CSS 无关）
   2) 内容随窗口拉大缩小自适应重排，缩小后不溢出卡片/窗体
   3) 底部按钮栏钉底、与弹窗底边零间距、行高压缩
   说明：全部规则限定在 .float-win__body > .modal 作用域内，
        只影响已浮起的弹窗，不改变未浮窗（遮罩内）弹窗的原布局。
   ============================================================ */

/* --- 2) 自适应：表单网格随窗口宽度自动换列（3→2→1），窄窗不溢出 --- */
.float-win__body > .modal .form-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(210px, 100%), 1fr));
}
/* grid 子项允许收缩到轨道宽度内（默认 min-width:auto 会把带输入框的 label 撑破窄窗） */
.float-win__body > .modal .form-grid > * { min-width: 0; max-width: 100%; }
/* 分节网格（form-section-body）同样自适应换列 + 允许收缩 */
.float-win__body > .modal .form-section-body {
  grid-template-columns: repeat(auto-fit, minmax(min(210px, 100%), 1fr));
}
.float-win__body > .modal .form-section-body > * { min-width: 0; max-width: 100%; }
/* 标签允许换行，避免长标签在窄列里撑破 */
.float-win__body > .modal .form-grid label { white-space: normal; }
/* 最大化时给足多行文本域高度，避免大片留白 */
.float-win.is-max .form-grid textarea { min-height: 74px; }
/* 窗体缩小时横向可滚（宽表格等），纵向不溢出卡片 */
.float-win__body > .modal .modal-body { min-height: 0; }

/* --- 员工基本信息卡片（浮窗内）：照片绝对定位钉右上角，右侧通道预留空白 --- */
.float-win__body > .modal .emp-basic-body {
  position: relative;
}
.float-win__body > .modal .emp-section[data-section="basic"] > .emp-basic-body > .form-grid {
  min-width: 0;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  padding-right: 96px;
}
.float-win__body > .modal .emp-basic-body .emp-avatar-cell {
  position: absolute; top: 0; right: 0;
  width: 80px; margin: 0;
}

/* --- 3) 底部按钮栏钉底 --- */
/* footer 在滚动区内（如招聘表单）：sticky 钉底，背景实底盖住滚动内容 */
.float-win__body > .modal .modal-foot {
  position: sticky; bottom: 0; z-index: 3;
  background: var(--card-bg, #fff);
  border-top: 1px solid var(--border, #e5e7eb);
  /* 行高压缩：原 14px 20px → 8px 16px */
  padding: 8px 16px;
  margin-top: 0;
  border-radius: 0 0 14px 14px;   /* 贴合卡片圆角，钉底时不露方角 */
  box-sizing: border-box;
}
.float-win__body > .modal .modal-foot > button { min-height: 28px; padding-top: 4px; padding-bottom: 4px; white-space: nowrap; flex: 0 0 auto; }
/* footer 处于滚动容器内时：容器底部内边距归零，避免滚到底露出空隙
   （sticky 盒被约束在包含块内容盒内，滚动容器留 padding-bottom 必露缝——招聘弹窗踩过） */
.float-win__body > .modal .modal-body:has(.modal-foot) { padding-bottom: 0; }
/* footer 是 .modal-body 兄弟节点时由 flex 列布局自然钉底（.modal 本身 flex column），无需额外处理 */

/* ============================================================
   修正（2026-09-14）：浮窗里的 .modal-lg 宽度被限死在 960px，
   导致「拉大弹窗 → 卡片不再变宽 → 表单列数不变、只把输入框拉长」。
   根因：`.modal.modal-lg { width: min(960px, 100%) }`（line 1786，特异性 0-2-0）
        写在 `.float-win__body > .modal { width: 100% }`（line 1425，同为 0-2-0）之后，
        同特异性时后者胜出 → 浮窗内的 modal-lg 一律退回 960px 上限。
   此处以同特异性 + 靠后顺序（并对 .modal-lg/.modal-sm 变体提特异性到 0-3-0）
   重新声明为「填满浮窗」，使卡片宽度跟随浮窗拖拽变化，
   内部 auto-fit 网格才能真正按窗体宽度重新排列列数。
   （部门弹窗用的是 .dept-float-modal（line 8968 已 width:100% / max-width:none），不受此影响，
    这也正是部门弹窗能自适应、招聘弹窗不能的原因。）
   ============================================================ */
.float-win__body > .modal,
.float-win__body > .modal.modal-lg,
.float-win__body > .modal.modal-sm {
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
}

/* 社保/公积金规则：两行分组表头（2026-10-21 复原） */
#view-org-social .ss-rule-thead > tr:first-child th { border-bottom: 1px solid var(--border); }
#view-org-social .ss-rule-thead .th-group { border-right: none; }
#view-org-social .ss-rule-table { min-width: 1400px; }
