/* ===== 自定义确认弹窗 (替代原生 confirm) ===== */
.confirm-overlay {
  position: fixed; inset: 0; z-index: 10000;
  background: rgba(32,33,36,.55);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.confirm-box {
  background: #fff; border-radius: 14px;
  width: min(400px, 100%);
  box-shadow: 0 16px 48px rgba(0,0,0,.22);
  animation: confirmIn .2s ease;
  overflow: hidden;
}
@keyframes confirmIn { from { transform: scale(.92); opacity: .5 } to { transform: none; opacity: 1 } }
.confirm-icon {
  text-align: center; padding-top: 28px; font-size: 42px; line-height: 1;
}
.confirm-title {
  text-align: center; font-size: 16px; font-weight: 600;
  color: var(--text); padding: 12px 28px 4px;
}
.confirm-msg {
  text-align: center; font-size: 13.5px; color: #555;
  line-height: 1.65; padding: 4px 28px 20px; white-space: pre-line;
}
.confirm-checks {
  margin: 0 28px 16px; padding: 12px 14px;
  background: #fef3e6; border-radius: 10px; font-size: 12.5px; color: #92400e; line-height: 1.7;
}
.confirm-checks .cc-item { display: flex; gap: 6px; }
.confirm-checks .cc-dot { color: #d97706; font-weight: 700; }
.confirm-btns {
  display: flex; gap: 10px; padding: 14px 20px 18px;
  justify-content: flex-end; border-top: 1px solid #f0eff3;
}
.confirm-btns button {
  padding: 8px 22px; border-radius: 8px; font-size: 13.5px;
  font-weight: 400; cursor: pointer; transition: all .15s;
  border: 1px solid transparent;
}
.confirm-btns .cb-cancel {
  background: #f5f5f7; color: #444; border-color: #e2e1e6;
}
.confirm-btns .cb-cancel:hover { background: #ececef; border-color: #d4d3da; }
.confirm-btns .cb-danger {
  background: #dc2626; color: #fff;
}
.confirm-btns .cb-danger:hover { background: #b91c1c; }

.form-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 12px 16px; align-items: start;
}
.form-grid label {
  display: flex; flex-direction: column; align-items: stretch; gap: 5px;
  font-size: 12px; color: var(--text-muted); font-weight: 400;
  white-space: normal;
}
/* 上下式布局（2026-10-30 全局调整，参考考勤规则 .att2-form）：
   标签文字在上、输入框在下吃满整行。 */
.form-grid label > span,
.form-grid label > .field-label { flex: 0 0 auto; text-align: left; }
.form-grid label > input,
.form-grid label > select,
.form-grid label > textarea,
.form-grid label > .emp-picker,
.form-grid label > .loc-ac,
.form-grid label > .wb-combo { flex: none; width: 100%; min-width: 0; box-sizing: border-box; }
/* 复选/单选框不参与 width:100% 拉伸：固定 16px 方块（2026-10-31，修候选人「加入黑名单」被拉成大框） */
.form-grid label input[type="checkbox"],
.form-grid label input[type="radio"] { flex: 0 0 16px; width: 16px; height: 16px; min-width: 16px; margin: 0; }
/* 2026-10-31：控件精确对齐考勤配置 .att2-form（高32/圆角6/1px边框/卡片底色/13px字） */
.form-grid label > input[type="text"],
.form-grid label > input[type="number"],
.form-grid label > input[type="date"],
.form-grid label > input[type="datetime-local"],
.form-grid label > input[type="month"],
.form-grid label > select,
.form-grid label > textarea {
  height: 32px; padding: 0 9px;
  border: 1px solid var(--border); border-radius: 6px;
  background: var(--card-bg); color: var(--text);
  font-size: 13px; outline: none;
}
.form-grid label > textarea { height: auto; min-height: 64px; padding: 7px 9px; resize: vertical; line-height: 1.6; }
.form-grid label > .date-picker { width: 100%; box-sizing: border-box; flex: none; height: 32px; border-radius: 6px; }
.form-grid label > .date-picker .dp-input { border: none; background: transparent; padding: 0; height: 100%; border-radius: 0; }
.form-grid input:focus, .form-grid select:focus, .form-grid textarea:focus { border-color: var(--primary); }
/* 花名册（员工创建/编辑/详情，.emp-section）保留横向：标签左、输入框右 —— 用户指定「除花名册外」 */
.emp-section .form-grid label {
  display: flex; flex-direction: row; align-items: center; gap: 10px; white-space: nowrap;
}
.emp-section .form-grid label > span,
.emp-section .form-grid label > .field-label { flex: 0 0 auto; min-width: 0; max-width: none; text-align: left; }
.emp-section .form-grid label > input,
.emp-section .form-grid label > select,
.emp-section .form-grid label > textarea,
.emp-section .form-grid label > .emp-picker,
.emp-section .form-grid label > .loc-ac,
.emp-section .form-grid label > .wb-combo { flex: 1; min-width: 0; width: 100%; }
/* 上级部门选择器：保持自身flex布局不变 */
.form-grid label.dept-parent-wrap { flex-wrap: nowrap; }

/* 编制调整单：部门/职位编制概况卡片 */
.qa-quota-card {
  border: 1px solid var(--border, #E8ECF4); border-radius: 12px;
  overflow: hidden; background: #fff; margin-top: 2px;
  width: 100%;
}
.qa-quota-title {
  padding: 11px 16px; background: linear-gradient(to right, #F7F9FC, #FBFCFE);
  font-size: 13px; font-weight: 600; color: var(--text, #1F2733);
  border-bottom: 1px solid var(--border, #E8ECF4);
}

/* 统计网格 — 单行铺满宽度 */
.qa-grid {
  display: grid;
  gap: 1px;
  background: #EEF0F4;
  padding: 1px;
}
.qa-grid-6 { grid-template-columns: repeat(6, 1fr); }
.qa-grid-3 { grid-template-columns: repeat(3, 1fr); }

.qa-cell {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 4px;
  padding: 14px 8px 12px; background: #fff;
  transition: background .15s;
}
.qa-cell:hover { background: #FAFBFD; }
.qa-label {
  font-size: 12px; color: var(--text-muted, #8892A0); font-weight: 400;
  white-space: nowrap; letter-spacing: .2px;
}
.qa-val {
  font-size: 22px; font-weight: 700; color: var(--text, #1F2733);
  line-height: 1.15;
}
.qa-val.small { font-size: 18px; }
.qa-cell.danger .qa-val { color: var(--danger, #DC2626); }
.qa-cell:not(.danger) .qa-val { color: var(--primary); }

.qa-hint { font-size: 13px; color: var(--text-faint, #9AA0A6); }

/* 调整对象提示条 */
.qa-context {
  display: flex; align-items: center; flex-wrap: wrap; gap: 4px;
  padding: 11px 16px; margin-bottom: 14px;
  background: linear-gradient(to right, #EFF4FF, #F7F9FC);
  border: 1px solid #DCE6F7; border-radius: 10px;
  font-size: 13px; color: var(--text-muted, #5B6573);
}
.qa-context b { color: var(--primary); font-weight: 700; }
.qa-context .sep { color: var(--text-faint, #B5BCC7); margin: 0 2px; }
.qa-context-tip { font-size: 12px; color: var(--text-faint, #9AA0A6); margin-left: 4px; }

.form-grid label.full { grid-column: 1 / -1; }

.form-grid div.full { grid-column: 1 / -1; }

/* ===================== 候选人弹窗：对齐部门管理弹窗标准 =====================
   分节结构(.form-section)与部门一致；标题浅灰底+3px主色条；
   标签在上、输入框在下并撑满整列；列数随弹窗宽度自适应；
   分节/字段/标签间距与 #deptForm 一致；底部按钮栏固定底部零缝 */
#candModal .modal { max-width: 960px; }

/* 弹窗主体：分节之间统一纵向间距（2026-10-31 对齐 att2 分节卡片口径：14px） */
#candForm {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px 20px 0;
}
#candForm:has(.modal-foot) { padding-bottom: 0; }

/* 分节容器：间距由 #candForm 的 gap 统一控制 */
.cand-form .form-section { margin-bottom: 0; }

/* 分节标题：对齐 .form-section-title（浅灰底 + 3px 主色条 + 13px/600） */
.cand-form .form-section-title {
  background: #F3F4F6;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  color: #374151;
  border-left: 3px solid var(--primary);
  margin-bottom: 16px;
  line-height: 1.3;
}

/* 表单网格：自适应列 + 舒适间距（对齐部门 .form-section-body auto-fit） */
.cand-form .form-section-body.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 12px 16px;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 0;
}

/* 字段：标签在上、输入框在下，输入框占满整列（对齐部门 #deptForm） */
.cand-form .form-section-body label {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 5px;
  margin: 0;
}
.cand-form .form-section-body label .field-label {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 400;
  white-space: normal;
  line-height: 1.3;
}
.cand-form .form-section-body label input,
.cand-form .form-section-body label select,
.cand-form .form-section-body label textarea {
  width: 100%;
  box-sizing: border-box;
  height: 32px; padding: 0 9px;
  border: 1px solid var(--border); border-radius: 6px;
  background: var(--card-bg); color: var(--text);
  font-size: 13px; outline: none;
}
.cand-form .form-section-body label.full {
  grid-column: 1 / -1;
  align-items: stretch;
}
.cand-form textarea { min-height: 80px; }

/* 复选行（加入黑名单）保持左右排列 */
.cand-form .form-section-body label.check-inline {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
.cand-form .form-section-body label.check-inline:hover {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26,115,232,.08);
}
.cand-form .form-section-body label.check-inline input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--primary);
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
}
.cand-form .form-section-body label.full .resume-uploader { padding-top: 6px; }

/* 底部按钮栏：固定底部、零缝、按钮行高压缩（对齐部门 .modal-foot） */
#candForm .modal-foot {
  position: sticky;
  bottom: 0;
  margin-top: 8px;
  /* 同招聘：form 自带 20px 左右内边距，负外边距抵消 → 按钮栏左右贴合窗体边缘 */
  margin-left: -20px;
  margin-right: -20px;
  background: var(--card-bg, #fff);
  padding: 8px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  border-radius: 0 0 14px 14px;
  z-index: 3;
}
#candForm .modal-foot .btn-primary,
#candForm .modal-foot .btn-secondary { min-height: 28px; padding: 0 16px; }

/* 编制调整单：改为 2 列网格，紧凑一致 */
.qa-form { grid-template-columns: repeat(2, 1fr); row-gap: 16px; column-gap: 18px; }
.qa-quota-slot { min-height: 0; }
.qa-preview {
  display: flex; align-items: flex-end; padding-bottom: 2px;
  font-size: 14px; color: var(--text, #1F2733); line-height: 1.5;
}
.qa-preview .warn-text { color: var(--danger, #DC2626); font-size: 12.5px; margin-left: 6px; }
/* 编制调整单：调整类型胶囊单选 */
.qa-type-row { display: flex; gap: 10px; flex-wrap: wrap; padding-top: 2px; }
.radio-card {
  position: relative; display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 18px; border: 1px solid var(--border, #E5E9F0); border-radius: 9px;
  cursor: pointer; font-size: 13px; color: var(--text-muted, #6B7280);
  background: #fff; transition: all .15s; user-select: none; white-space: nowrap;
}
.radio-card:hover { border-color: var(--primary); }
.radio-card input { accent-color: var(--primary); margin: 0; }
.radio-card.is-checked {
  border-color: var(--primary);
  background: #EFF4FF; color: var(--primary);
  font-weight: 600; box-shadow: 0 1px 4px rgba(26,115,232,.12);
}
.form-grid label .field-label {
  display: inline-flex; align-items: center; gap: 4px;
  white-space: nowrap;
}
.form-grid label .req-star { display: none; }
.form-grid input,
.form-grid select,
.form-grid textarea,
.form-grid .readonly-field {
  border: 1px solid var(--border); border-radius: 8px;
  padding: 5px 8px; font-size: 13px; color: var(--text);
  background: #fff; font-family: inherit;
  transition: border-color .15s, box-shadow .15s;
}
.form-grid select {
  height: 30px;
  padding: 0 24px 0 8px;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235F6368' stroke-width='2' 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 8px center;
  cursor: pointer;
}
.form-grid input[disabled],
.form-grid input.locked-field,
.form-grid select[disabled],
.form-grid select.locked-field,
.form-grid textarea[disabled],
.form-grid .readonly-field {
  background: #F8F9FA;
  cursor: not-allowed;
  white-space: pre-wrap;
  word-break: break-word;
}
/* 只读（readonly）输入框：白底正常观感，不再灰底；光标保持默认（部分只读框可点击触发选择器） */
.form-grid input[readonly],
.form-grid textarea[readonly] {
  background: #fff;
  cursor: default;
  white-space: pre-wrap;
  word-break: break-word;
}
/* 自动带出的只读字段：用灰色区分（部门层级路径、全称等系统自动生成的值） */
.form-grid input[readonly].auto-filled,
.form-grid textarea[readonly].auto-filled,
.form-grid .auto-filled {
  color: #6B7280;
}
/* 只读 select：去掉原生下拉箭头，与文本框外观一致（保证详情面板所有单元格颜色/边框统一） */
.form-grid select[disabled],
.form-grid select.locked-field {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: none;
  padding-right: 10px;
}
.form-grid textarea {
  min-height: 32px; line-height: 1.5; field-sizing: content;
  resize: none; overflow: hidden; /* 无拉动把手、无滚动条：高度由全局自适应机制按内容控制 */
}
.form-grid label.st-f.full { grid-column: 1 / -1; }
#fRemark { min-height: 110px; }
/* 表单网格内的日期控件：统一为全站外观，并预留右侧给隐藏的原生 picker 指示区 */
.form-grid input[type="date"],
.form-grid input[type="datetime-local"],
.form-grid input[type="month"] {
  height: 30px;
  padding: 0 24px 0 8px;
}
.form-grid input::placeholder,
.form-grid textarea::placeholder { color: #9aa0a6; }
.form-grid input:focus,
.form-grid select:focus,
.form-grid textarea:focus {
  border-color: var(--primary); outline: none;
  box-shadow: 0 0 0 2px var(--primary-soft);
}
.modal-foot {
  display: flex; justify-content: flex-end; gap: 12px;
  padding: 14px 20px; border-top: 1px solid var(--border);
}
/* 审批弹窗底部按钮统一：取消置左、操作置右、驳回统一红、通过统一蓝 */
.modal-foot .mf-cancel { margin-right: auto; }
.modal-foot > button { min-height: 34px; }
.modal.modal-lg { width: min(960px, 100%); }

/* ===== 登录待办事项弹窗 ===== */
.login-todo-modal { width: min(640px, 100%); max-height: 86vh; display: flex; flex-direction: column; }
.login-todo-modal .modal-body { padding: 16px 20px; }
.login-todo-summary {
  font-size: 14px; color: var(--color-text-secondary);
  background: #fff8e6; border: 1px solid #ffe2a8; border-radius: 8px;
  padding: 10px 14px; margin-bottom: 14px;
}
.login-todo-summary b { color: #c5221d; font-size: 16px; margin: 0 2px; }
.login-todo-groups { display: flex; flex-direction: column; gap: 12px; }
.login-todo-group {
  border: 1px solid var(--border); border-radius: 10px; overflow: hidden;
}
.ltg-head {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px; background: #f7f9fc; border-bottom: 1px solid var(--border);
}
.ltg-icon { font-size: 16px; }
.ltg-title { font-weight: 600; font-size: 14px; }
.ltg-count {
  background: #c5221d; color: #fff; border-radius: 10px;
  font-size: 12px; line-height: 1; padding: 3px 8px; font-weight: 600;
}
.ltg-go {
  margin-left: auto; font-size: 12px; padding: 4px 10px; min-height: 0;
  background: #fff; border: 1px solid var(--border); border-radius: 6px; cursor: pointer; color: var(--color-primary);
}
.ltg-go:hover { background: #eef4ff; }
.ltg-summary { padding: 8px 14px 0; font-size: 12px; color: #b06000; }
.ltg-items { list-style: none; margin: 6px 0 0; padding: 0 14px 12px; }
.ltg-items li {
  display: flex; align-items: baseline; gap: 8px; padding: 6px 0;
  border-top: 1px dashed #eef0f3; font-size: 13px;
}
.ltg-items li:first-child { border-top: none; }
.ltg-name { font-weight: 600; }
.ltg-empno { color: #9aa0a6; font-size: 12px; }
.ltg-dept { color: var(--color-text-secondary); }
.ltg-date { margin-left: auto; color: #c5221d; font-weight: 600; white-space: nowrap; }
.ltg-desc { color: #9aa0a6; font-size: 12px; }
.login-todo-empty { text-align: center; color: var(--color-text-secondary); padding: 26px 0; }
.login-todo-empty .ok { font-size: 34px; }
.login-todo-modal .modal-foot {
  display: flex; justify-content: center; padding: 14px 20px 18px;
  border-top: none;
}
.login-todo-modal .modal-foot .btn-primary {
  min-width: 120px; padding: 10px 32px; font-size: 14px;
  border-radius: 10px; font-weight: 600;
}

/* 详情查看（只读键值对） */
.detail-grid {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 12px 18px;
}
.detail-row {
  display: flex; flex-direction: column; gap: 4px;
  padding: 10px 12px; border-radius: 8px;
  background: var(--bg);
}
.detail-row .detail-label {
  font-size: 12px; color: var(--text-muted); font-weight: 400;
}
.detail-row .detail-value {
  font-size: 14px; color: var(--text); word-break: break-word;
}
.detail-row .text-faint { color: var(--text-faint); }
.data-table tbody tr { cursor: default; }
.data-table tbody tr[data-id] { cursor: pointer; }
.data-table tbody tr[data-id]:hover { background: var(--primary-soft, rgba(26,115,232,.06)); }
@media (max-width: 720px) {
  .detail-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: repeat(2, 1fr); }
  /* 窄屏：照片回网格流置顶居中，取消右侧通道预留 */
  .emp-basic-body > .form-grid { padding-right: 0; }
  .emp-section[data-section="basic"] .emp-avatar-cell {
    position: static; order: -1;
    grid-column: 1 / -1; grid-row: auto; justify-self: center; align-self: start;
  }
}
@media (max-width: 520px) {
  .form-grid,
  .emp-section .form-grid { grid-template-columns: 1fr; }
  /* 单列时照片作为顶部首项，字段在其下方单列排布 */
  .emp-section[data-section="basic"] .emp-avatar-cell {
    grid-column: 1; grid-row: 1; justify-self: start; align-self: start; margin-bottom: 8px;
  }
  .emp-basic-body > .form-grid { padding-right: 0; }
}

@media (max-width: 900px) {
  .toolbar { flex-direction: column; align-items: stretch; }
  .toolbar-left, .toolbar-right { width: 100%; }
  .toolbar-right { justify-content: flex-end; }
  .search-dark { width: 100%; max-width: none; }
}

@media (max-width: 640px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .content { padding: 16px; }
  .search { width: 140px; }
}

/* =========================================================
   员工管理模块 UI
   ========================================================= */

/* 大号弹窗（员工详情） */
.modal-lg { width: min(960px, 100%); }

/* 员工弹窗：左侧标签导航 + 右侧单 tab 内容区
   顶部保留 14px 留白，避免 modal-head 的标题/快捷按钮与左侧或顶部 nav 视觉粘连（编辑模式下 emp-quick-actions 显示时尤其明显） */
.emp-modal-body {
  display: flex;
  align-items: stretch;
  padding: 14px 0 0;
  height: 70vh;
  max-height: 70vh;
  overflow: hidden;
}
.emp-nav {
  flex: 0 0 auto;
  width: 112px;
  border-right: 1px solid var(--border);
  background: var(--bg);
  padding: 8px 0;
  overflow-y: auto;
}
.emp-nav-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 10px 8px 10px;
  border: none;
  border-left: 2px solid transparent;
  background: transparent;
  color: var(--text);
  font-size: 12.5px;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.emp-nav-item:hover { background: rgba(0,0,0,.03); }
.emp-nav-item.active {
  border-left-color: var(--primary);
  color: var(--primary);
  background: rgba(26,115,232,.08);
  font-weight: 400;
}
.emp-content {
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 18px 20px 30px;
}
.emp-section {
  animation: empFadeIn .18s ease;
  scroll-margin-top: 8px;
}
@keyframes empFadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}
.emp-section-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-strong);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.emp-section-title::before {
  content: "";
  width: 4px;
  height: 15px;
  border-radius: 2px;
  background: var(--primary);
}
.tab-content { padding: 18px 4px 4px; }

/* 键值信息盒 */
.kv-box {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 14px 16px; margin-bottom: 14px;
}
.kv-title {
  font-size: 13px; font-weight: 600; color: var(--text-strong);
  margin-bottom: 10px; display: flex; align-items: center; gap: 8px;
}
.kv-title::before {
  content: ""; width: 3px; height: 13px; border-radius: 2px; background: var(--primary);
}
.kv-row {
  display: grid; grid-template-columns: 140px 1fr; gap: 10px;
  padding: 6px 0; font-size: 13px; border-top: 1px dashed var(--border);
}
.kv-row:first-of-type { border-top: none; }
.kv-k { color: var(--text-muted); }
.kv-v { color: var(--text-strong); word-break: break-all; }

/* 员工详情滚动定位面板 */
.emp-form-wrap { height: 100%; }
.emp-tab-panel { display: block; }
.emp-tab-panel + .emp-tab-panel { margin-top: 24px; }
/* 员工详情：基本信息参考部门管理，统一一行 3 项 */
.emp-section .form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 16px; align-items: start; }
.emp-section .form-grid > label { min-width: 0; }

/* 子表（教育/合同/证书/家庭） */
.sub-table-wrap { overflow-x: auto; overflow-y: hidden; width: 100%; }
.sub-table-toolbar { display: flex; justify-content: flex-end; margin-bottom: 10px; }
.sub-table-toolbar .btn-sm { padding: 5px 12px; font-size: 13px; }
.sub-table { margin-top: 4px; background: #fff; font-size: 12px; }
.sub-table th { background: var(--card-bg, #fff); font-size: 12px; font-weight: 600; padding: 6px 8px; white-space: nowrap; text-align: center; }
.sub-table td { padding: 5px 7px; vertical-align: middle; white-space: nowrap; text-align: center; }
/* 工作描述 / 离职原因等长文本单元格左对齐更易读 */
.sub-table td.has-textarea { text-align: left; }
/* 操作列在子表里也居中（按钮紧贴好看） */
.sub-table th.col-actions,
.sub-table td.col-actions { text-align: center; white-space: nowrap; }
.sub-table th.col-actions { width: 1%; }
/* 合同记录 / 教育经历 / 工作经历 / 家庭 / 证书 / 奖惩 / 培训：
   统一小表格样式——列宽完全由内容决定（table-layout: auto + width: auto），
   表格总宽 = 各列内容宽之和，不强制铺满父容器，避免空列/短内容留白占据空间；
   父容器 .sub-table-wrap 提供 overflow-x: auto，超出可水平滚动 */
.sub-table[data-sub-table="contracts"],
.sub-table[data-sub-table="education"],
.sub-table[data-sub-table="work_exp"],
.sub-table[data-sub-table="family"],
.sub-table[data-sub-table="certificates"],
.sub-table[data-sub-table="award"],
.sub-table[data-sub-table="emergency"],
.sub-table[data-sub-table="training"] {
  table-layout: auto;
  width: auto;
  max-width: none;
  font-size: 11px;
  border-collapse: collapse;
}
/* 子表「未填写内容」时（无数据行）强制铺满弹窗宽度，列均分填满；
   一旦有内容（data-empty="0"），回到 table-layout:auto + width:auto 的内容自适应，
   内容总宽超出父容器时由 .sub-table-wrap 的 overflow-x:auto 提供左右滚动条 */
.sub-table[data-empty="1"] {
  width: 100%;
  min-width: 100%;
}
.sub-table[data-sub-table="contracts"] th,
.sub-table[data-sub-table="contracts"] td,
.sub-table[data-sub-table="education"] th,
.sub-table[data-sub-table="education"] td,
.sub-table[data-sub-table="work_exp"] th,
.sub-table[data-sub-table="work_exp"] td,
.sub-table[data-sub-table="family"] th,
.sub-table[data-sub-table="family"] td,
.sub-table[data-sub-table="certificates"] th,
.sub-table[data-sub-table="certificates"] td,
.sub-table[data-sub-table="award"] th,
.sub-table[data-sub-table="award"] td,
.sub-table[data-sub-table="emergency"] th,
.sub-table[data-sub-table="training"] th,
.sub-table[data-sub-table="training"] td {
  padding: 3px 5px;
  white-space: nowrap;
  vertical-align: middle;
  border-bottom: 1px solid var(--border);
}
.sub-table[data-sub-table="contracts"] .sub-input,
.sub-table[data-sub-table="education"] .sub-input,
.sub-table[data-sub-table="work_exp"] .sub-input,
.sub-table[data-sub-table="family"] .sub-input,
.sub-table[data-sub-table="certificates"] .sub-input,
.sub-table[data-sub-table="award"] .sub-input,
.sub-table[data-sub-table="emergency"] .sub-input,
.sub-table[data-sub-table="training"] .sub-input {
  min-width: 60px;
  padding: 3px 5px;
  font-size: 11px;
}
.sub-table[data-sub-table="contracts"] textarea.sub-input,
.sub-table[data-sub-table="education"] textarea.sub-input,
.sub-table[data-sub-table="work_exp"] textarea.sub-input,
.sub-table[data-sub-table="family"] textarea.sub-input,
.sub-table[data-sub-table="certificates"] textarea.sub-input,
.sub-table[data-sub-table="award"] textarea.sub-input,
.sub-table[data-sub-table="emergency"] textarea.sub-input,
.sub-table[data-sub-table="training"] textarea.sub-input {
  width: 180px;
  min-height: 28px;
  resize: vertical;
}
/* 内容自适应：这一族小表格的输入框按内容宽度收缩（不再被通用 width:100%/min-width:80px 撑宽），
   配合 table-layout:auto + width:auto，编辑态列宽也跟随每列内容长短调整 */
.sub-table[data-sub-table="contracts"] .sub-input,
.sub-table[data-sub-table="education"] .sub-input,
.sub-table[data-sub-table="work_exp"] .sub-input,
.sub-table[data-sub-table="family"] .sub-input,
.sub-table[data-sub-table="certificates"] .sub-input,
.sub-table[data-sub-table="award"] .sub-input,
.sub-table[data-sub-table="emergency"] .sub-input,
.sub-table[data-sub-table="training"] .sub-input {
  width: auto;
  min-width: 0;
}

.sub-table td .sub-input,
.sub-card-field .sub-input {
  width: 100%; min-width: 80px; box-sizing: border-box;
  border: 1px solid var(--border); border-radius: 6px;
  padding: 5px 7px; font-size: 13px; color: var(--text);
  background: #fff; font-family: inherit;
  transition: border-color .15s, box-shadow .15s;
}
.sub-table td .sub-input:focus,
.sub-card-field .sub-input:focus { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-soft); outline: none; }
.sub-table td .sub-input[type="date"],
.sub-card-field .sub-input[type="date"] { padding: 4px 24px 4px 6px; }
.sub-input[type="date"],
.sub-input[type="datetime-local"],
.sub-input[type="month"] { padding-right: 26px; }
.sub-card-field .sub-input { min-width: 0; }

/* 子表单元格内 input/select 控件：表单元素默认不继承父 td 的 text-align，
   显式让"丰美 / 小学 / 2026 年 07 月"等内容在控件内水平居中显示；
   textarea 保持默认左对齐，保留长文本换行与可读性。 */
.sub-table td input.sub-input,
.sub-table td select.sub-input,
.sub-card-field input.sub-input,
.sub-card-field select.sub-input {
  text-align: center;
}

/* 合同记录等卡片式（纵向分行，避免横向滚动） */
.sub-cards { display: flex; flex-direction: column; gap: 12px; margin-top: 4px; }
.sub-card { border: 1px solid var(--border); border-radius: 10px; background: #fff; padding: 12px 14px; min-width: 0; }
.sub-card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.sub-card-title { font-size: 13px; font-weight: 600; color: var(--text); }
.sub-card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 10px 18px; min-width: 0; }
.sub-card-field { display: flex; flex-direction: row; align-items: flex-start; gap: 6px; min-width: 0; }
.sub-card-field > label { flex: 0 0 auto; white-space: nowrap; font-size: 12px; color: var(--text-muted, #5F6368); padding-top: 7px; margin-bottom: 0; text-align: left; }
.sub-card-field > .sub-input,
.sub-card-field > .sub-card-val { flex: 1 1 auto; min-width: 0; width: auto; max-width: none; }
.sub-card-val { font-size: 13px; color: var(--text); word-break: normal; overflow-wrap: anywhere; }
@media (max-width: 520px) {
  .sub-card-grid { grid-template-columns: 1fr; }
}

/* 身份证有效期：双日期选择器平分栅格列宽度，右边缘与同列其他输入框对齐，高度统一 32px */
.id-validity .date-range {
  display: flex; align-items: center; gap: 6px;
  width: 100%; min-width: 0; box-sizing: border-box;
  background: transparent; border: none; padding: 0; border-radius: 0;
}
.form-grid label.id-validity { min-width: 0; overflow: visible; }
.id-validity .date-range input[type="date"] {
  flex: 1 1 0 !important;
  width: auto !important;
  min-width: 0 !important;
  max-width: none !important;
  height: 32px !important;
  padding: 0 24px 0 8px;
  font-size: 12.5px;
}
.id-validity .date-range > span {
  color: var(--text-muted); font-size: 12px; white-space: nowrap; flex: 0 0 auto;
}
/* 身份证号校验错误 */
#empBaseForm [name="id_card_no"].field-error {
  border-color: #DB4437 !important;
  box-shadow: 0 0 0 2px rgba(219,68,55,.15) !important;
  background: #FCE8E6;
}
.id-card-err { animation: fadeInUp .2s ease; }
@keyframes fadeInUp { from{opacity:0;transform:translateY(-4px)} to{opacity:1;transform:none} }

/* 子表长文本字段（地址/备注）：不再占满整行，与普通字段同样只占一个自适应列 */
.sub-card-field.remark-field textarea.sub-input {
  flex: 1 1 auto; width: auto; min-width: 0; max-width: none;
  min-height: 34px; resize: none; overflow: hidden; line-height: 1.5;
}
.sub-table td.actions { text-align: center; white-space: nowrap; }
.sub-table td.actions .icon-btn { width: 26px; height: 26px; }
.sub-table td.actions .icon-btn.danger { color: var(--danger); }

/* 敏感标记 */
.tag-sens {
  display: inline-block; padding: 1px 7px; border-radius: var(--radius-pill);
  font-size: 11px; font-weight: 400; line-height: 1.6;
  color: #B3261E; background: rgba(234,67,53,.12);
}

/* 自动识别字段标记 */
.tag-auto {
  display: inline-block; padding: 1px 7px; border-radius: var(--radius-pill);
  font-size: 11px; font-weight: 400; line-height: 1.6;
  color: var(--primary); background: var(--primary-soft);
}
.tag-lock {
  display: inline-block; padding: 1px 7px; border-radius: var(--radius-pill);
  font-size: 11px; font-weight: 400; line-height: 1.6;
  color: #6b7280; background: #eef0f3;
  cursor: help;
}
/* 敏感字段：不再渲染「敏感」胶囊标签，改为标签文字使用特殊配色提示
   （同原「敏感」标签的红棕色，保持同一语义色；工号/试用期等普通字段不加任何标记） */
.form-grid label.is-sensitive > .field-label { color: #B3261E; }

/* 通用状态标签（定调薪台账等场景复用） */
.tag {
  display: inline-block; padding: 2px 9px; border-radius: var(--radius-pill);
  font-size: 11px; font-weight: 600; line-height: 1.6; white-space: nowrap;
}
.tag-gray { color: #5f6b7a; background: #eef1f5; }
.tag-blue { color: #1A73E8; background: rgba(26,115,232,.12); }
.tag-purple { color: #A855F7; background: rgba(168,85,247,.12); }
.tag-green { color: #137333; background: rgba(19,115,51,.12); }
.tag-red { color: #c5221f; background: rgba(197,34,31,.12); }

/* 统计卡片（定调薪概览） */
.stat-row { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 4px; }
.stat-card {
  flex: 1 1 0; min-width: 140px; padding: 14px 16px; border-radius: var(--radius);
  background: var(--card-bg); border: 1px solid var(--border);
}
.stat-num { font-size: 22px; font-weight: 700; color: var(--text-strong); line-height: 1.2; }
.stat-label { margin-top: 4px; font-size: 12px; color: var(--text-muted); }
/* 退役军人/残疾人/贫困户：复选框横排一行（标签 ☑ 是） */
.form-grid > label:has(> .chk-yesno) {
  flex-direction: row !important; align-items: center; gap: 6px;
}
.chk-yesno {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 13px; color: var(--text); cursor: pointer;
}
.chk-yesno input[type="checkbox"] {
  width: 15px; height: 15px; accent-color: var(--primary);
  cursor: pointer; margin: 0; vertical-align: middle;
}
.chk-yesno .chk-txt {
  font-size: 13px; line-height: 1;
}
input.auto-field, select.auto-field, textarea.auto-field {
  background: #f8f9fa;
}
input.auto-field[readonly], select.auto-field:disabled, textarea.auto-field[readonly] {
  cursor: default;
}
.form-grid input.locked-field,
.form-grid select.locked-field,
.form-grid textarea.locked-field {
  background: #f8f9fa;
  cursor: not-allowed;
}

/* 空状态：紧凑化，避免「暂无XX」占一大块空间 */
.empty-box {
  text-align: center; color: var(--text-faint); font-size: 12.5px;
  padding: 12px 16px;
}

/* 弱文本 */
.muted { color: var(--text-muted); }

/* 变更历史时间线 */
.timeline { position: relative; padding-left: 18px; }
.timeline::before {
  content: ""; position: absolute; left: 5px; top: 4px; bottom: 4px;
  width: 2px; background: var(--border);
}
.tl-item { position: relative; padding: 0 0 18px 14px; }
.tl-dot {
  position: absolute; left: -18px; top: 4px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--primary); border: 2px solid #fff;
  box-shadow: 0 0 0 2px var(--border);
}
.tl-dot.add { background: var(--success, #1E8E3E); box-shadow: 0 0 0 2px rgba(30,142,62,.25); }
.tl-dot.del { background: var(--danger, #EA4335); box-shadow: 0 0 0 2px rgba(234,67,53,.25); }
.tl-body { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; }
.tl-head { font-size: 12px; color: var(--text-muted); margin-bottom: 6px; }
.tl-head b { color: var(--text-strong); }
.tl-diff {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: 13px; font-variant-numeric: tabular-nums;
}
.tl-diff .old { color: var(--danger, #EA4335); text-decoration: line-through; opacity: .85; }
.tl-diff .new { color: var(--success, #1E8E3E); font-weight: 400; }
.tl-diff .arrow { color: var(--text-faint); }

/* 变更历史：紧凑单行样式（员工详情弹窗 / 变更历史页） */
.timeline.compact { padding-left: 16px; }
.timeline.compact::before { left: 5px; top: 6px; bottom: 6px; }
.timeline.compact .tl-item { padding: 3px 0 3px 10px; }
.timeline.compact .tl-dot { left: -15px; top: 7px; width: 10px; height: 10px; box-shadow: 0 0 0 2px var(--border); }
.timeline.compact .tl-row {
  display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
  flex: 1; min-width: 0; font-size: 13px; line-height: 1.5; color: var(--text);
}
.timeline.compact .tl-row > b { color: var(--text-strong); font-weight: 600; }
.timeline.compact .tl-op-tag {
  font-size: 11px; line-height: 1; padding: 2px 6px; border-radius: 4px;
  background: var(--bg-soft, #f3f4f6); color: var(--text-muted); white-space: nowrap;
}
.timeline.compact .tl-op-tag.add { background: #E6F7EE; color: #1E8E3E; }
.timeline.compact .tl-op-tag.del { background: #FFEAEB; color: #EA4335; }
.timeline.compact .tl-diff { display: inline-flex; align-items: center; gap: 5px; flex-wrap: wrap; font-variant-numeric: tabular-nums; }
.timeline.compact .tl-old { color: var(--danger, #EA4335); text-decoration: line-through; opacity: .85; }
.timeline.compact .tl-new { color: var(--success, #1E8E3E); font-weight: 400; }
.timeline.compact .tl-arrow { color: var(--text-faint); }
.timeline.compact .tl-meta { margin-left: auto; color: var(--text-faint); font-size: 12px; white-space: nowrap; }
/* 字段配置表内联控件 */
.field-toggle {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  font-size: 13px; color: var(--text); user-select: none;
}
.field-toggle input { width: 15px; height: 15px; accent-color: var(--primary); cursor: pointer; }
.field-edit {
  border: 1px solid var(--border); border-radius: 6px; padding: 4px 8px;
  font-size: 13px; width: 64px; text-align: center; color: var(--text);
}
.field-edit:focus { border-color: var(--primary); outline: none; }
.link-btn.danger { color: var(--danger, #EA4335); }

/* 搜索建议高亮（empSuggest 复用 .suggest-list） */
.suggest-list li mark { background: transparent; color: var(--primary); font-weight: 600; }

/* 数据表内操作按钮间距 */
.data-table .row-actions { display: flex; gap: 10px; }
.data-table .row-actions .link-btn { font-size: 13px; }

/* ============================================================
   组织架构页
   ============================================================ */
.org-page {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
  height: 100%;
  overflow: hidden;
  width: 100%;
  min-width: 0;
}
.org-page .toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px var(--pad);
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}
.org-page .toolbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}
.org-meta {
  font-size: 13px;
  color: var(--text-muted);
}
.org-meta b {
  color: var(--primary);
  font-weight: 700;
  margin: 0 2px;
}

/* 展开/收起 下拉按钮 */
.org-dropdown {
  position: relative;
  display: inline-block;
}
.org-dropdown .org-drop-btn {
  padding-right: 22px;
  position: relative;
}
.org-drop-menu {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  z-index: 50;
  min-width: 150px;
  background: #fff;
  border: 1px solid var(--border, #E2E8F0);
  border-radius: 8px;
  box-shadow: 0 6px 20px rgba(15,23,42,0.12);
  padding: 4px;
  animation: orgDropIn 0.12s ease-out;
}
.org-dropdown.open > .org-drop-menu { display: block; }
@keyframes orgDropIn { from { opacity:0; transform:translateY(-4px); } to { opacity:1; transform:none; } }
.org-drop-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 12px;
  border: none;
  border-radius: 5px;
  background: transparent;
  color: var(--text, #334155);
  font-size: 13px;
  cursor: pointer;
  text-align: left;
  transition: background 0.1s ease;
}
.org-drop-item:hover { background: #EEF2FF; color: #4338CA; }
.org-drop-item:active { background: #E0E7FF; }
.org-card {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
  min-height: 0;
}
/* 框架图卡片：不自身滚动，交给内部 .org-framework 统一处理 */
#orgTabFramework { overflow: hidden; }

/* ── SVG组织架构图（威特雅风格）── */
.org-svg-wrap {
  width: 100%; height: 100%;
  overflow: hidden; position: relative;
  cursor: grab; background: #F8FAFC; border-radius: 10px;
}
.org-svg-wrap:active { cursor: grabbing; }
.org-svg-inner { will-change: transform; }
.org-chart-svg {
  display: block; width: 100%; height: 100%;
}
.org-columns {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  flex-wrap: wrap;
  min-width: 0;
}
.org-column {
  flex: 1 1 0;
  min-width: 280px;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}
.org-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  border-radius: 12px;
  padding: 0 18px;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  cursor: pointer;
  user-select: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.org-header:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}
.org-header .count {
  font-size: 14px;
  font-weight: 400;
  opacity: 0.95;
  background: rgba(255, 255, 255, 0.18);
  padding: 4px 10px;
  border-radius: 999px;
}
.org-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.org-dept {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: box-shadow 0.15s ease;
}
.org-dept:hover { box-shadow: var(--shadow-hover); }
.org-dept-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 52px;
  padding: 0 16px;
  cursor: pointer;
  user-select: none;
}
.org-dept-head .name {
  font-size: 14px;
  color: var(--text-strong);
  font-weight: 400;
  display: flex;
  align-items: center;
  gap: 8px;
}
.org-dept-head .name .arrow {
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  color: var(--text-muted);
  transition: transform 0.2s ease;
}
.org-dept-head .name .arrow.expanded { transform: rotate(90deg); }
.org-dept-head .count {
  font-size: 13px;
  color: var(--text-muted);
  background: var(--bg);
  padding: 3px 9px;
  border-radius: 999px;
}
.org-dept-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease, padding 0.25s ease;
  padding: 0 16px;
}
.org-dept-body.expanded {
  max-height: 600px;
  padding: 0 16px 12px;
}
.org-third-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  border-left: 2px solid var(--border);
  padding-left: 12px;
  margin-left: 8px;
}
.org-third-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 13px;
  color: var(--text);
  background: #F8FAFC;
}
.org-third-item:hover { background: #F1F5F9; }
.org-third-item .name { color: var(--text-muted); }
.org-third-item .count {
  color: var(--text-faint);
  font-weight: 400;
}
.org-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 60px;
  color: var(--text-faint);
  font-size: 14px;
}
.org-empty .big { font-size: 48px; }

/* 框架图：部门卡片内员工列表 */
.org-dept-body {
  transition: max-height 0.25s ease, padding 0.25s ease;
  padding: 0 16px;
}
.org-dept-body.expanded { padding: 0 16px 12px; }
.org-emp-list { display: flex; flex-direction: column; gap: 4px; }
.org-emp-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 13px;
  background: #F8FAFC;
  transition: background 0.15s ease;
}
.org-emp-item:hover { background: #EEF2FF; }
.org-emp-item.left { opacity: 0.55; }
.org-emp-item .emp-dot {
  width: 7px; height: 7px; border-radius: 50%; flex: none;
}
.org-emp-item .emp-dot.on { background: #22C55E; }
.org-emp-item .emp-dot.off { background: #CBD5E1; }
.org-emp-item .emp-name { color: var(--text-strong); font-weight: 400; }
.org-emp-item .emp-rank {
  color: var(--text-muted); font-size: 12px;
  background: #E2E8F0; padding: 1px 7px; border-radius: 999px;
}
.org-emp-item .emp-no {
  margin-left: auto; color: var(--text-faint); font-size: 12px;
  font-family: ui-monospace, Menlo, Consolas, monospace;
}

/* ═══ 树状图（参考截图样式：左侧根节点+右侧垂直列表+连接线） ═══ */
.org-tree-wrap {
  overflow: auto; padding: 20px 24px; height: 100%;
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
}
/* ── 根节点（左侧公司） ── */
.ot-root {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 8px 16px;
  background: #EFF6FF;
  border: 1px solid #BFDBFE;
  border-radius: 8px;
  font-size: 14px; color: #64748B;
}
.ot-icon-root {
  display: inline-block; width: 28px; height: 28px;
  background: linear-gradient(135deg, #93C5FD, #60A5FA);
  border-radius: 7px;
  position: relative;
  flex-shrink: 0;
}
.ot-icon-root::before {
  content: ''; position: absolute; top: 8px; left: 6px;
  width: 14px; height: 11px; border: 2px solid #fff; border-top: none; border-radius: 0 0 4px 4px;
}
.ot-icon-root::after {
  content: ''; position: absolute; top: 5px; left: 9px;
  width: 8px; height: 3px; background: #fff; border-radius: 2px 2px 0 0;
}
.ot-root .ot-name { font-weight: 400; }

/* ── 主体：左右布局（根节点 + 连接线 + 列表） ── */
.ot-body {
  display: flex; align-items: flex-start; margin-top: 12px;
}

/* ── 垂直连接线（从第一个到最后一个子节点） ── */
.ot-vline-box {
  display: flex; flex-direction: column; align-items: center;
  margin-left: 26px; margin-top: 18px;
  position: relative;
  min-width: 20px;
}
.ot-vline-box::before {
  content: '';
  position: absolute; top: 0; bottom: 0; left: 50%;
  width: 1.5px; background: #D4DCE6;
  transform: translateX(-50%);
}

/* ── 子节点列表（垂直排列） ── */
.ot-list {
  display: flex; flex-direction: column; gap: 0;
}

/* ── 每个子节点项 ── */
.ot-item {
  position: relative;
  padding-left: 22px;
}
/* 横向分支线 */
.ot-item::before {
  content: '';
  position: absolute; left: 0; top: 18px;
  width: 18px; height: 1.5px;
  background: #D4DCE6;
}
/* 最后一个子节点的垂直线要截断 */
.ot-last .ot-item::after, /* 嵌套时 */.ot-item.ot-last > .ot-card::after {
  content: '';
  position: absolute; left: -22px; top: 18px;
  width: 1.5px; height: calc(100% + 8px);
  background: #fff; /* 用白色遮盖父级vline的下半部分 */
}

/* ── 节点卡片 ── */
.ot-card {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 14px 8px 6px;
  border-radius: 8px;
  transition: background 0.15s ease;
  cursor: default;
}
.ot-card:hover { background: #F8FAFC; }
.ot-card.collapsible { cursor: pointer; }
.ot-card.collapsible:hover { background: #F0F7FF; }

/* ── 图标 ── */
.ot-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 8px; flex-shrink: 0;
}
/* 文件夹图标（蓝色方块+白色文件夹形状） */
.ot-icon-folder {
  background: linear-gradient(135deg, #93C5FB, #60A5FA);
  position: relative;
}
.ot-icon-folder::before {
  content: '';
  position: absolute; top: 9px; left: 7px;
  width: 17px; height: 13px;
  border: 2px solid #fff; border-top: none;
  border-radius: 0 0 3px 3px;
}
.ot-icon-folder::after {
  content: '';
  position: absolute; top: 6px; left: 10px;
  width: 10px; hight: 3px; background: #fff;
  border-radius: 2px 2px 0 0;
}
/* 叶子/员工图标（浅蓝小方块） */
.ot-icon-leaf {
  background: linear-gradient(135deg, #DBEAFE, #BFDBFE);
  position: relative;
}
.ot-icon-leaf::before {
  content: '';
  position: absolute; top: 10px; left: 10px;
  width: 12px; height: 12px;
  background: #fff; opacity: 0.7;
  border-radius: 2px;
}

/* ── 文字信息 ── */
.ot-info { display: flex; flex-direction: column; gap: 1px; flex: 1; min-width: 0; }
.ot-dname { font-size: 14px; font-weight: 600; color: #1E293B; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ot-sub { font-size: 12px; color: #94A3B8; font-weight: 400; }
.ot-pname { font-size: 13px; color: #334155; font-weight: 400; }

/* ── 右侧人数徽章 ── */
.ot-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 24px; height: 20px; padding: 0 7px;
  background: #DBEAFE; color: #1A73E8;
  font-size: 12px; font-weight: 600; border-radius: 10px;
  flex-shrink: 0;
  position: relative;
}
/* 徽章左侧的小横线连接到节点 */
.ot-badge::before {
  content: '';
  position: absolute; right: 100%; top: 50%;
  width: 10px; height: 1.5px; background: #CBD5E1;
}

/* ── 嵌套子树 ── */
.ot-sub-body {
  display: flex; align-items: flex-start; margin-left: 38px; margin-top: 2px;
}
.ot-svline {
  display: flex; flex-direction: column; align-items: center;
  min-width: 20px; position: relative; margin-top: 18px;
}
.ot-svline::before {
  content: '';
  position: absolute; top: 0; bottom: 0; left: 50%;
  width: 1.5px; background: #E2E8F0;
  transform: translateX(-50%);
}
.ot-sub-list {
  display: flex; flex-direction: column;
}

/* ========== HTML 框架图（参考威特雅组织架构样式） ========== */
.org-html-wrap {
  position: absolute;
  top: 0;
  left: 0;
  padding: 16px 20px;
  cursor: grab;
  display: inline-block;
  min-width: 100%;
}
.org-html-wrap:active { cursor: grabbing; }
.org-html-wrap * { transform-origin: top left; }

/* 框架图容器：视口 + 缩放控制条定位上下文 */
.org-framework {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* 右上角缩放调节条 */
.org-zoom-ctrl {
  position: absolute;
  top: 10px;
  right: 12px;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  background: rgba(255,255,255,0.92);
  border: 1px solid var(--border, #E2E8F0);
  border-radius: 999px;
  box-shadow: 0 2px 8px rgba(15,23,42,0.10);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  font-size: 12px;
  color: var(--text, #1f2937);
  user-select: none;
}
.org-zoom-ctrl .oz-btn {
  width: 22px; height: 22px;
  border: none; border-radius: 50%;
  background: #EEF2FF; color: #4338CA;
  font-size: 15px; line-height: 1;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s ease;
}
.org-zoom-ctrl .oz-btn:hover { background: #E0E7FF; }
.org-zoom-ctrl .oz-btn:active { transform: scale(0.92); }
.org-zoom-ctrl .oz-slider {
  width: 88px; height: 4px;
  cursor: pointer;
  accent-color: #4338CA;
}
.org-zoom-ctrl .oz-val {
  min-width: 38px;
  text-align: center;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: #4338CA;
}

/* 顶部公司栏 */
.org-company-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: linear-gradient(135deg, #1E3A5F 0%, #1A73E8 100%);
  color: #fff;
  padding: 12px 28px;
  border-radius: 10px;
  margin-bottom: 18px;
  box-shadow: 0 4px 14px rgba(26,115,232,0.25);
}
.org-co-name {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 6px;
  text-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.org-co-count {
  font-size: 13px;
  opacity: 0.85;
  background: rgba(255,255,255,0.15);
  padding: 2px 12px;
  border-radius: 999px;
}

/* 一级部门行：横向排列 */
.org-l1-row {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

/* 一级部门列 */
.org-l1-col {
  display: flex;
  flex-direction: column;
  min-width: 200px;
  flex: 1;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--shadow);
  background: var(--card-bg);
  border: 1px solid var(--border);
}
.org-l1-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 11px 16px;
  color: #fff;
  cursor: default;
}
.l1-name { font-size: 15px; font-weight: 600; }
.l1-count { font-size: 13px; opacity: 0.85; }

/* 二级部门列表（卡片容器） */
.org-l2-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 10px 10px;
}

/* 二级/三级部门卡片 */
.org-l2-card {
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  padding: 8px 10px;
  transition: box-shadow 0.15s ease;
}
.org-l2-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.06); }

/* 部门节点标题 */
.org-dept-head, .org-pos-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 8px;
  border-radius: 6px;
  cursor: default;
  user-select: none;
  font-size: 13px;
}
.org-dept-head {
  background: #EFF6FF;
  color: #1D4ED8;
  border: 1px solid #BFDBFE;
  font-weight: 600;
}
.org-dept-head.collapsible { cursor: pointer; }
.org-dept-head:hover { background: #DBEAFE; }
.org-pos-head {
  background: #F0FDF4;
  color: #15803D;
  border: 1px solid #BBF7D0;
  font-weight: 400;
  font-size: 12.5px;
}
.dn-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dn-count {
  font-size: 11.5px; font-weight: 400; opacity: 0.75;
  background: rgba(0,0,0,0.06); padding: 1px 7px; border-radius: 999px;
  flex-shrink: 0;
  margin-left: 8px;
}
.dn-arrow { font-size: 10px; width: 14px; flex-shrink: 0; transition: transform 0.15s ease; }

/* 子节点容器 */
.org-children {
  margin-top: 5px;
  padding-left: 14px;
  border-left: 2px solid #E2E8F0;
  margin-left: 6px;
  transition: all 0.2s ease;
}
.org-children.collapsed { display: none; }

/* 员工姓名标签 */
.org-person {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  margin: 2px 2px;
  border-radius: 5px;
  font-size: 12.5px;
  background: #fff;
  border: 1px solid #E2E8F0;
  color: var(--text-strong);
  font-weight: 400;
  cursor: default;
  white-space: nowrap;
  transition: background 0.12s ease;
}
.org-person:hover { background: #EEF2FF; border-color: #BFDBFE; }
.org-person.left { opacity: 0.45; text-decoration: line-through; }
.org-person .emp-dot { width: 6px; height: 6px; border-radius: 50%; flex: none; }
.org-person .emp-dot.on { background: #22C55E; }
.org-person .emp-dot.off { background: #CBD5E1; }

@media (max-width: 1200px) {
  .org-column { min-width: 260px; max-width: none; flex: 1 1 calc(50% - 12px); }
}
@media (max-width: 760px) {
  .org-columns { flex-direction: column; }
  .org-column { width: 100%; max-width: none; }
}

/* ============================================================
   站点考勤月度表（纸质考勤表风格）
   ============================================================ */
.attendance-sheet-wrap {
  flex: 1;
  overflow: auto;
  min-width: 0;
  background: var(--card-bg);
}
.attendance-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-faint);
  font-size: 14px;
}
.attendance-sheet {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  table-layout: fixed;
  background: #fff;
  color: #1f2937;
}
.attendance-sheet caption {
  padding: 14px;
  font-size: 16px;
  font-weight: 700;
  caption-side: top;
}
.attendance-sheet th,
.attendance-sheet td {
  border: 1px solid #6b7280;
  text-align: center;
  vertical-align: middle;
  padding: 3px 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.attendance-sheet thead th {
  background: var(--card-bg, #fff);
  font-weight: 600;
  position: sticky;
  top: 0;
  z-index: 10;
  /* border-collapse:collapse 下 sticky 表头滚动会丢底边框，用内阴影锁住横线 */
  box-shadow: inset 0 -1px 0 #6b7280;
}
.attendance-sheet .num-col { width: 30px; min-width: 30px; }
.attendance-sheet .dept-col {
  width: 92px; min-width: 92px;
  white-space: normal; overflow-wrap: anywhere; word-break: break-word;
}
.attendance-sheet .site-col {
  width: 68px; min-width: 68px;
  white-space: normal; overflow-wrap: anywhere; word-break: break-word;
}
.attendance-sheet .name-col {
  width: 62px; min-width: 62px; vertical-align: middle;
  white-space: normal; overflow-wrap: anywhere; word-break: break-word;
}
.attendance-sheet .name-col .person-cat {
  margin-top: 2px;
  font-size: 11px;
  font-weight: 400;
  color: #1A73E8;
  background: #eff6ff;
  border-radius: 4px;
  padding: 1px 5px;
  display: inline-block;
}
.attend-cat-other input { width: 100%; }
.attendance-sheet .item-col {
  width: 40px; min-width: 40px;
  white-space: normal; overflow-wrap: anywhere; word-break: break-word;
}
.attendance-sheet .day-col { width: 30px; min-width: 30px; }
.attendance-sheet .summary-col { width: 104px; min-width: 104px; }
/* 原「合计」拆出的出勤/用餐统计明细列 */
.attendance-sheet .stat-col {
  width: 32px; min-width: 32px; max-width: 32px;
  font-size: 12px; line-height: 1.25;
  padding: 2px 1px;
  white-space: normal; overflow-wrap: anywhere; word-break: break-word;
}
.attendance-sheet thead th.stat-col,
.attendance-sheet tbody td.stat-col { width: 32px; min-width: 32px; max-width: 32px; }
.attendance-sheet thead th.stat-col {
  font-size: 12px; font-weight: 700; line-height: 1.2;
  white-space: normal; overflow-wrap: anywhere; word-break: break-all;
  vertical-align: middle;
}
.attendance-sheet .stat-col[data-stat="workday"],
.attendance-sheet .stat-col[data-stat="holidayOt"],
.attendance-sheet .stat-col[data-stat="mealTotal"] { width: 44px; min-width: 44px; max-width: 44px; }
.attendance-sheet .stat-col[data-stat="weekend"],
.attendance-sheet .stat-col[data-stat="holiday"],
.attendance-sheet .stat-col[data-stat="mealDays"] { width: 38px; min-width: 38px; max-width: 38px; }
/* 伙食费右侧的人员备注列 */
.attendance-sheet .remark-col {
  width: 110px; min-width: 110px; max-width: 110px;
  font-size: 11px; line-height: 1.3;
  text-align: left; vertical-align: middle;
  white-space: normal; overflow-wrap: anywhere; word-break: break-word;
  cursor: pointer;
}
.attendance-sheet .remark-col:hover { background: #fffbeb; }
.attend-remark-pop {
  position: fixed; z-index: 100;
  width: 260px; padding: 12px;
  background: var(--card-bg, #fff);
  border: 1px solid var(--border, #d9d9d9);
  border-radius: 8px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, .18);
}
.attend-remark-title { font-size: 12px; font-weight: 700; margin-bottom: 8px; color: var(--text, #1f2937); }
.attend-remark-input {
  width: 100%; height: 88px; resize: vertical;
  border: 1px solid var(--border, #d9d9d9); border-radius: 4px;
  padding: 6px; font-size: 12px; line-height: 1.4;
  box-sizing: border-box; font-family: inherit;
}
.attend-remark-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.attend-remark-actions button { padding: 4px 12px; font-size: 12px; border-radius: 4px; cursor: pointer; }
.attend-remark-cancel { border: 1px solid var(--border, #d9d9d9); background: #fff; }
.attend-remark-save { border: 1px solid var(--primary, #1677ff); background: var(--primary, #1677ff); color: #fff; }
/* 月度表冻结左侧五列；日期与统计明细列随横向滚动查看 */
.site-month-sheet .num-col,
.site-month-sheet .dept-col,
.site-month-sheet .site-col,
.site-month-sheet .name-col,
.site-month-sheet .item-col {
  position: sticky;
  background: var(--card-bg, #fff);
}
.site-month-sheet thead th.num-col { left: 0; z-index: 14; }
.site-month-sheet thead th.dept-col { left: 30px; z-index: 14; }
.site-month-sheet thead th.site-col { left: 122px; z-index: 14; }
.site-month-sheet thead th.name-col { left: 190px; z-index: 14; }
.site-month-sheet thead th.item-col { left: 252px; z-index: 14; }
.site-month-sheet tbody td.num-col { left: 0; z-index: 6; }
.site-month-sheet tbody td.dept-col { left: 30px; z-index: 6; }
.site-month-sheet tbody td.site-col { left: 122px; z-index: 6; }
.site-month-sheet tbody td.name-col { left: 190px; z-index: 6; }
.site-month-sheet tbody td.item-col { left: 252px; z-index: 6; box-shadow: 2px 0 4px rgba(15, 23, 42, .06); }
/* 站点考勤：按站点区分数据行底色，同站点同色、不同站点不同色（低饱和柔和色板） */
.attendance-sheet tbody tr.site-tone-0 { --site-row-bg: #eef4ff; }
.attendance-sheet tbody tr.site-tone-1 { --site-row-bg: #eaf7ef; }
.attendance-sheet tbody tr.site-tone-2 { --site-row-bg: #fff4e5; }
.attendance-sheet tbody tr.site-tone-3 { --site-row-bg: #f3ecff; }
.attendance-sheet tbody tr.site-tone-4 { --site-row-bg: #e8f7fa; }
.attendance-sheet tbody tr.site-tone-5 { --site-row-bg: #fff0f3; }
.attendance-sheet tbody tr.site-tone-6 { --site-row-bg: #f5f7e8; }
.attendance-sheet tbody tr.site-tone-7 { --site-row-bg: #edf1f7; }
.attendance-sheet tbody tr[class*="site-tone-"] > td { background: var(--site-row-bg); }
.attendance-sheet td.day-cell {
  cursor: pointer;
  user-select: none;
  font-size: 14px;
  height: 28px;
  position: relative;
}
.attendance-sheet td.day-cell:hover { background: #eef2ff; }
.attendance-sheet td.day-cell.attend { color: #1d4ed8; }
.attendance-sheet td.day-cell.meal { color: #047857; }
.attendance-sheet td.day-cell.readonly { cursor: default; }
.attendance-sheet td.day-cell.disabled {
  background: #f1f3f5;
  color: #c4c9d4;
  cursor: not-allowed;
}
.attendance-sheet td.day-cell.disabled:hover { background: #f1f3f5; }
/* 日期表头周末（周六/周日）：低饱和橙底 + 橙字，便于从表头一眼识别周末；
   仅非法定假日期着色（法定假红色优先），与法定假浅红底区分。 */
.attendance-sheet thead th.day-col.weekend-date {
  color: #b26a00;
  background: #fff4e5;
  font-weight: 600;
}
[data-theme="dark"] .attendance-sheet thead th.day-col.weekend-date {
  color: #f0b35c;
  background: rgba(251, 146, 60, .16);
}
/* 日期表头法定节假日：浅红底 + 红色数字 + 右上角批注红点（数据源 atr_holiday） */
.attendance-sheet thead th.day-col.holiday-date {
  color: #dc2626;
  background: #fef2f2;
  font-weight: 700;
  position: sticky;
}
.attendance-sheet thead th.day-col.holiday-date::after {
  content: '';
  position: absolute;
  top: 2px; right: 2px;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: #dc2626;
}
/* 法定假 / 法定假加班（3倍工资）日期标红；有批注的加红点提示 */
.attendance-sheet td.day-cell.holiday {
  color: #dc2626; font-weight: 600; background: #fef2f2;
}
.attendance-sheet td.day-cell.holiday[data-val="法定假加班"] {
  color: #b91c1c; background: #fee2e2;
}
.attendance-sheet td.day-cell.holiday:hover { background: #fee2e2; }
.attendance-sheet td.day-cell.holiday.has-holiday-note::after {
  content: '•';
  position: absolute;
  right: 1px; top: -1px;
  color: #dc2626;
  font-size: 12px;
  line-height: 1;
}
.attendance-sheet .item-label { color: #6b7280; font-size: 11px; }
.attendance-sheet .summary-col {
  font-size: 10.5px; line-height: 1.35;
  white-space: normal; overflow-wrap: anywhere; word-break: break-word;
}
.attendance-sheet .count-row { background: #f9fafb; font-weight: 600; }

/* 单元格内联编辑 */
.attend-editor {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  z-index: 5;
}
.attend-editor select,
.attend-editor input {
  width: 100%;
  height: 100%;
  border: 2px solid var(--primary);
  outline: none;
  font-size: 12px;
  text-align: center;
  padding: 0 2px;
  background: #fff;
  color: var(--text);
}
.attend-editor select { padding: 0 2px; }

/* 出勤选项弹出面板 */
.attend-option-pop {
  position: fixed;
  z-index: 100;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 30px rgba(0,0,0,.18);
  padding: 10px;
  min-width: 140px;
  animation: popIn .12s ease;
}
@keyframes popIn {
  from { transform: scale(.96); opacity: .6; }
  to { transform: scale(1); opacity: 1; }
}
.attend-option-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.attend-option-pop .attend-option {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 6px;
  padding: 8px 4px;
  font-size: 12px;
  color: var(--text);
  cursor: pointer;
  transition: all .12s;
  white-space: nowrap;
}
.attend-option-pop .attend-option:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-soft);
}
.attend-option-pop .attend-option.selected {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}
.attend-option-pop .attend-option-cancel {
  width: 100%;
  margin-top: 8px;
  border: none;
  background: #f3f4f6;
  border-radius: 6px;
  padding: 7px 0;
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
  transition: background .12s;
}
.attend-option-pop .attend-option-cancel:hover {
  background: #e5e7eb;
  color: var(--text);
}
/* 就餐弹出：两个主选项一排，下方“修改金额” */
.meal-option-pop .attend-option-grid {
  grid-template-columns: repeat(2, minmax(64px, 1fr));
}
.attend-option-pop .attend-option-secondary {
  width: 100%;
  margin-top: 8px;
  border: 1px dashed var(--border);
  background: transparent;
  border-radius: 6px;
  padding: 7px 0;
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all .12s;
}
.attend-option-pop .attend-option-secondary:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-soft);
}

.attendance-sheet .notes-row td {
  text-align: left;
  padding: 8px 12px;
  white-space: normal;
  font-size: 11px;
  color: #4b5563;
  line-height: 1.5;
}
.attendance-sheet .notes-row strong { color: #1f2937; }
.attendance-sheet .notes-row .note-item {
  display: block;
  margin-bottom: 4px;
}
.attendance-sheet .notes-row .attend-month-summary-box {
  width: 100%;
  min-height: 60px;
  margin-top: 6px;
  padding: 6px 8px;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  font-size: 12px;
  line-height: 1.5;
  resize: vertical;
  font-family: inherit;
  background: #fff;
  color: #1f2937;
}
.attendance-sheet .summary-row td { font-weight: 600; background: #f3f4f6; }
.attend-status {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 400;
  margin-left: 8px;
  background: #e5e7eb;
  color: #374151;
}
#attendSearchBox { display: inline-flex; }
#attendSearchBox input { background: transparent; }
@media (max-width: 900px) {
  #attendSearchBox { display: inline-flex !important; width: 100% !important; max-width: none !important; margin-left: 0 !important; }
  #attendAddPerson { width: 100%; justify-content: center; }
}
.attend-status.draft { background: #e5e7eb; color: #374151; }
.attend-status.auditing { background: #fef3c7; color: #92400e; }
.attend-status.locked { background: #fee2e2; color: #991b1b; }

/* ===== 异动记录表模块 ===== */
.btn-success {
  border: none; background: var(--success, #34a853); color: #fff;
  padding: 8px 16px; border-radius: 8px; font-size: 13px; font-weight: 400;
  cursor: pointer; transition: filter .15s;
}
.btn-success:hover { filter: brightness(1.05); }
.btn-danger {
  border: none; background: var(--danger, #ea4335); color: #fff;
  padding: 8px 16px; border-radius: 8px; font-size: 13px; font-weight: 400;
  cursor: pointer; transition: filter .15s;
}
.btn-danger:hover { filter: brightness(1.05); }
.btn-danger-soft {
  border: 1px solid rgba(234,67,53,.5); background: #fff; color: var(--danger, #ea4335);
  padding: 8px 16px; border-radius: 8px; font-size: 13px; font-weight: 400; cursor: pointer;
  transition: background .15s;
}
.btn-danger-soft:hover { background: rgba(234,67,53,.08); }

.pager { display: flex; align-items: center; padding: 12px 16px; gap: 6px; border-top: 1px solid var(--border); }
.pager .btn-secondary { padding: 5px 12px; font-size: 12px; }
.pager .btn-secondary:disabled { opacity: .45; cursor: not-allowed; }

/* 审批状态药丸 */
.status.draft     { background: rgba(154,160,166,.15); color: #5f6368; }
.status.pending   { background: rgba(251,188,4,.15);   color: #b06000; }
.status.approved  { background: rgba(52,168,83,.15);   color: var(--success, #2e8b57); }
.status.rejected  { background: rgba(234,67,53,.15);   color: var(--danger, #d33); }
.status.withdrawn { background: rgba(66,133,244,.15);  color: #1A73E8; }

/* 弹窗内字段分组 */
.modal-body fieldset {
  border: 1px solid var(--border, #e3e8ef); border-radius: 10px;
  padding: 14px 16px 16px; margin: 0 0 16px;
}
.modal-body fieldset legend {
  font-size: 13px; font-weight: 600; color: var(--primary);
  padding: 0 8px; margin-left: 4px;
}
.modal-body fieldset .form-grid { margin-top: 6px; }

@media (max-width: 900px) {
  .attendance-sheet .num-col { width: 26px; min-width: 26px; }
  .attendance-sheet .dept-col { width: 78px; min-width: 78px; }
  .attendance-sheet .site-col { width: 60px; min-width: 60px; }
  .attendance-sheet .name-col { width: 56px; min-width: 56px; }
  .attendance-sheet .item-col { width: 36px; min-width: 36px; }
  .attendance-sheet .day-col { width: 26px; min-width: 26px; }
  .attendance-sheet .summary-col { width: 92px; min-width: 92px; }
  .attendance-sheet .stat-col { width: 30px; min-width: 30px; max-width: 30px; }
  .attendance-sheet thead th.stat-col { font-size: 11.5px; }
  .attendance-sheet .stat-col[data-stat="workday"],
  .attendance-sheet .stat-col[data-stat="holidayOt"],
  .attendance-sheet .stat-col[data-stat="mealTotal"] { width: 40px; min-width: 40px; max-width: 40px; }
  .attendance-sheet .stat-col[data-stat="weekend"],
  .attendance-sheet .stat-col[data-stat="holiday"],
  .attendance-sheet .stat-col[data-stat="mealDays"] { width: 34px; min-width: 34px; max-width: 34px; }
  .attendance-sheet .remark-col { width: 90px; min-width: 90px; max-width: 90px; }
  .site-month-sheet thead th.dept-col,
  .site-month-sheet tbody td.dept-col { left: 26px; }
  .site-month-sheet thead th.site-col,
  .site-month-sheet tbody td.site-col { left: 104px; }
  .site-month-sheet thead th.name-col,
  .site-month-sheet tbody td.name-col { left: 164px; }
  .site-month-sheet thead th.item-col,
  .site-month-sheet tbody td.item-col { left: 220px; }
  .attendance-sheet { font-size: 12px; }
}

/* ===================== 员工分布表 ===================== */
.dist-total {
  font-size: 13px; color: var(--text-faint);
  background: var(--primary-soft); color: var(--primary);
  padding: 6px 12px; border-radius: 6px; font-weight: 400; margin-right: 8px;
}
.dist-tag {
  display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 4px;
  background: var(--primary-soft); color: var(--primary); font-weight: 400; white-space: nowrap;
}
#distTable .dist-members { line-height: 1.7; color: var(--text); word-break: break-all; }
#distTable td { vertical-align: middle; }
#distTable .dist-ops { white-space: nowrap; }
.dist-in {
  width: 100%; box-sizing: border-box; padding: 5px 8px;
  border: 1px solid var(--primary); border-radius: 5px; font-size: 13px;
  outline: none; background: #fff; color: var(--text);
}
.dist-in:focus { box-shadow: 0 0 0 2px var(--primary-soft); }
#app tr.dist-editing > td { background: var(--primary-soft, #E8F0FE) !important; }
tr.dist-editing td { padding: 6px 8px; }

/* ===== 员工列表右键菜单 ===== */
.context-menu {
  position: fixed;
  z-index: 1000;
  min-width: 152px;
  background: var(--card-bg, #fff);
  border: 1px solid var(--border, #E5E7EB);
  border-radius: var(--radius, 8px);
  box-shadow: var(--shadow-hover, 0 2px 6px rgba(60,64,67,.12)), 0 8px 24px rgba(0,0,0,.10);
  padding: 6px 0;
  display: none;
  user-select: none;
}
.ctx-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  font-size: 14px;
  color: var(--text, #3C4043);
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.ctx-item:hover { background: var(--bg, #F7F8FC); }
.ctx-item svg {
  width: 16px; height: 16px;
  color: var(--text-muted, #5F6368);
  flex: 0 0 16px;
  transition: color .15s ease;
}
.ctx-item:hover svg { color: var(--text, #3C4043); }
.ctx-item.ctx-danger { color: var(--danger, #EA4335); }
.ctx-item.ctx-danger svg { color: var(--danger, #EA4335); }
.ctx-item.ctx-danger:hover { background: rgba(234,67,53,.08); }
.ctx-divider {
  height: 1px;
  background: var(--border, #E5E7EB);
  margin: 6px 8px;
}

/* ===================== 员工详情 · 卡片式模块 ===================== */
.emp-section {
  background: #fff;
  border: 1px solid var(--border, #E5E7EB);
  border-radius: var(--radius-lg, 12px);
  padding: 14px 16px 16px;
  box-shadow: 0 1px 2px rgba(16,24,40,.04);
}
.emp-section + .emp-section { margin-top: 10px; }

/* 员工弹窗（新增/编辑/查看）内模块扁平化：去掉卡片外框与段间横线，靠灰底标题栏 + 留白分区 */
.emp-modal-body .emp-section {
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
}
/* 段间仅留白，不画分隔横线（标题栏灰底已足够区分段落） */
.emp-modal-body .emp-section + .emp-section {
  margin-top: 18px;
}
.emp-modal-body .emp-section-head {
  background: #F3F4F6;
  border-radius: 0;   /* 直角 */
  padding: 6px 12px;
  margin-bottom: 12px;
}
.emp-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.emp-section-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-strong, #1F2937);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.emp-section-title::before {
  content: "";
  width: 4px;
  height: 15px;
  border-radius: 2px;
  background: var(--primary);
}
.emp-section-actions { display: flex; gap: 8px; flex: 0 0 auto; }

/* 异动记录卡片 — 横向表格布局（扁平：无圆角、无左右框线，仅保留上下分隔线） */
.transfer-list { display: flex; flex-direction: column; gap: 8px; }
.transfer-card {
  border-top: 1px solid var(--border, #E5E7EB);
  border-bottom: 1px solid var(--border, #E5E7EB);
  border-left: none;
  border-right: none;
  border-radius: 0;
  background: #fff;
  overflow: hidden;
}
.transfer-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 6px 12px;
  background: #F8FAFC;
  border-bottom: 1px solid var(--border, #E5E7EB);
}
.transfer-type-badge {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  background: var(--primary);
  border-radius: 6px;
  padding: 2px 10px;
}
.transfer-code { font-size: 12px; color: var(--text-muted, #5F6368); font-family: monospace; }
.transfer-date { font-size: 12px; color: var(--text-muted, #5F6368); }
.transfer-status {
  margin-left: auto;
  font-size: 12px;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 999px;
}
.transfer-status.ok { color: #0F9D58; background: #E6F4EA; }
.transfer-status.no { color: #DB4437; background: #FCE8E6; }
.transfer-status.pending { color: #F4B400; background: #FEF7E0; }

/* 紧凑对比表格 */
.transfer-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.transfer-table th {
  text-align: left;
  padding: 4px 10px 3px;
  font-weight: 600;
  color: var(--text-muted, #5F6368);
  font-size: 12px;
  white-space: nowrap;
  border-bottom: 1px solid var(--border, #E5E7EB);
}
.transfer-table td {
  padding: 3px 10px;
  color: var(--text-strong, #1F2937);
  vertical-align: middle;
  white-space: nowrap;
}
.tf-tag {
  font-weight: 600;
  font-size: 12px;
  color: var(--text-muted, #5F6368);
  width: 1%;
  white-space: nowrap;
}
.tf-tag.after {
  color: #0F9D58;
}
.tf-row-before td { border-bottom: 1px dashed rgba(128,128,128,.15); }
.tf-row-after {
  background: #F0FDF4;
}
.transfer-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 3px 16px;
  padding: 5px 12px;
  background: #F8FAFC;
  border-top: 1px solid var(--border, #E5E7EB);
  font-size: 12px;
  color: var(--text-muted, #5F6368);
}

/* 银行卡横向表格 */
.bank-table-wrap { overflow-x: auto; }
.bank-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.bank-table th {
  text-align: left;
  padding: 10px 12px;
  font-weight: 600;
  color: var(--text-muted, #5F6368);
  font-size: 12px;
  white-space: nowrap;
  background: #F8FAFC;
  border-bottom: 1px solid var(--border, #E5E7EB);
}
.bank-table td {
  padding: 8px 10px;
  vertical-align: middle;
  border-bottom: 1px solid var(--border, #E5E7EB);
}
.bank-table tr:hover td { background: #FAFBFE; }
.bank-active {
  background: #F0FDF4 !important;
}
.bank-active td { border-bottom-color: #BBF7D0; }
.bank-active:hover td { background: #ECFDF5 !important; }
.bank-input {
  width: 100%;
  min-width: 100px;
  padding: 4px 6px;
  border: 1px solid var(--border, #D1D5DB);
  border-radius: 4px;
  font-size: 13px;
  background: #fff;
  box-sizing: border-box;
}
.bank-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(26,115,232,.15);
}
.bank-active-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  color: #0F9D58;
  background: #E6F4EA;
  padding: 2px 8px;
  border-radius: 999px;
  letter-spacing: .3px;
}

.emp-sub-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted, #5F6368);
  margin: 18px 0 8px;
}
/* 基本信息布局：照片绝对定位钉右上角，右侧整条通道预留空白（照片下方不放字段） */
.emp-basic-body {
  position: relative;
}
/* 仅基本信息板块预留照片通道；工作信息/个人信息等共用 .emp-basic-body 包裹层，不再让位 */
.emp-section[data-section="basic"] > .emp-basic-body > .form-grid {
  min-width: 0;
  padding-right: 96px;   /* 预留照片通道：照片 80px + 间距 16px */
}
.emp-section[data-section="basic"] .form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 10px 14px;
  align-items: start;
  position: static;
}
/* 照片区：绝对定位钉在右上角，脱离网格流；照片下方通道保持空白 */
.emp-section[data-section="basic"] .emp-avatar-cell {
  position: absolute; top: 0; right: 0;
  width: 80px;
  margin: 0;
  display: flex; flex-direction: column; align-items: center;
  gap: 6px; min-width: 0;
}
/* 基本信息区：标签左对齐、与输入框固定 6px 间距、输入框列内右对齐 */
.emp-section[data-section="basic"] .form-grid label { gap: 6px !important; }
.emp-section[data-section="basic"] .form-grid label > span {
  flex: 0 0 auto;
  min-width: 0;
  max-width: none;
  text-align: left;
  white-space: nowrap;
}
/* position 级联块的 label 里 span.field-label 是空串（display_name 置空），但仍是 flex item，
   会触发 label 的 6px gap，使整个级联块（所属部门/直属上级/所属岗位）相对普通字段右移 6px。
   空标签不参与布局，级联块左缘即与「试用期月数」等普通字段标签左缘对齐 */
.emp-section[data-section="basic"] .form-grid label > span.field-label:empty { display: none; }
/* 个人信息 / 招聘信息：与基本信息一致——标签左对齐、标签与输入框固定 6px 间距、去掉固定宽度标签盒
   （避免输入框按列对齐、间距过大）；只读态空 field-label 同样不参与布局 */
.emp-section[data-section="personal"] .form-grid label,
.emp-section[data-section="work"] .form-grid label { gap: 6px !important; }
.emp-section[data-section="personal"] .form-grid label > span,
.emp-section[data-section="work"] .form-grid label > span {
  flex: 0 0 auto;
  min-width: 0;
  max-width: none;
  text-align: left;
  white-space: nowrap;
}
.emp-section[data-section="personal"] .form-grid label > span.field-label:empty,
.emp-section[data-section="work"] .form-grid label > span.field-label:empty { display: none; }
/* 级联行（部门/岗位/职级/直属上级）与普通字段统一：label 横向排列，输入框等高 */
.emp-section[data-section="basic"] .emp-cascade { width: 100%; }
/* 级联块已打平为网格项（外层 display:contents）：加载失败提示横跨整行 */
.emp-section[data-section="basic"] .emp-cascade .form-hint { grid-column: 1 / -1; }
.emp-section[data-section="basic"] .emp-cascade .cascade-row { gap: 10px 14px; margin-bottom: 10px; }
/* 级联块内仅第一行下方留 10px（与 .form-grid 行距一致）；末行 margin 归零，
   避免与下方网格 gap(10px) 叠加成双倍间距 */
.emp-section[data-section="basic"] .emp-cascade .cascade-row:last-child { margin-bottom: 0; }
.emp-section[data-section="basic"] .emp-cascade .cascade-cell {
  display: flex; flex-direction: row; align-items: center; gap: 6px;
}
.emp-section[data-section="basic"] .emp-cascade .cascade-cap {
  flex: 0 0 auto; min-width: 0; max-width: none;
  font-size: 13px; color: var(--text-muted); white-space: nowrap; text-align: left;
}
.emp-section[data-section="basic"] .emp-cascade .cascade-cell select,
.emp-section[data-section="basic"] .emp-cascade .cascade-cell input[type="text"] {
  flex: 1; min-width: 0; height: 30px;
}
/* 基本信息区普通控件撑满所在栅格列宽：保证同行（工号/姓名/状态…）输入框右缘对齐，
   短选项下拉（如"状态"）不再因内容窄而偏左。仅作用于 label 直接子级控件，
   不影响 .emp-cascade 级联块内、id-card-validity 区间内的输入框 */
.emp-section[data-section="basic"] .form-grid > label > input,
.emp-section[data-section="basic"] .form-grid > label > select,
.emp-section[data-section="basic"] .form-grid > label > textarea {
  width: 100%;
  box-sizing: border-box;
}
.emp-avatar-preview {
  width: 70px; height: 88px;
  border-radius: 6px; overflow: hidden;
  background: #eef1f6;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border);
  position: relative; cursor: pointer;
}
.emp-avatar-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.emp-avatar-preview:hover { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(26,115,232,.10); }
.emp-avatar-ph { font-size: 12px; color: var(--text-faint); }
.emp-avatar-hint {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 4px 2px; background: rgba(32,33,36,.55);
  color: #fff; font-size: 11px; text-align: center;
  line-height: 1.2; pointer-events: none;
}
.emp-avatar-btn { cursor: pointer; }
.emp-avatar-status { font-size: 12px; line-height: 1.4; color: var(--text-muted); word-break: break-all; }
.emp-avatar-status.ok { color: #16a34a; }
.emp-avatar-status.error { color: #dc2626; font-weight: 400; }
.emp-avatar-status.pending { color: #1A73E8; }
.btn-sm {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 12px;
  font-size: 13px;
  line-height: 1.4;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  font-weight: 400;
  white-space: nowrap;
}
.btn-xs {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 8px;
  font-size: 12px;
  line-height: 1.4;
  border-radius: 6px;
  border: 1px solid transparent;
  cursor: pointer;
  font-weight: 400;
  white-space: nowrap;
}
.btn-ghost {
  background: transparent;
  border-color: var(--border, #E5E7EB);
  color: var(--text, #3C4043);
}
.btn-ghost:hover { background: rgba(26,115,232,.08); border-color: var(--primary); color: var(--primary); }

/* 个人材料 */
.attach-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px 18px; }
.attach-group { border: 1px dashed var(--border, #E5E7EB); border-radius: 10px; padding: 10px 12px; }
.attach-group-title { font-size: 13px; font-weight: 600; color: var(--text-strong, #1F2937); margin-bottom: 8px; }
.attach-group-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.attach-group-head .attach-group-title { margin-bottom: 0; }
.attach-items { display: flex; flex-direction: column; gap: 6px; }
.attach-item { display: flex; align-items: center; gap: 8px; }
.attach-link {
  flex: 1 1 auto;
  font-size: 13px;
  color: var(--primary);
  text-decoration: none;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.attach-link:hover { text-decoration: underline; }
.attach-empty { font-size: 12px; color: var(--text-faint, #9AA0A6); }
.attach-upload { cursor: pointer; justify-content: center; margin-top: 0; flex: 0 0 auto; }

/* 员工详情 · 顶部快捷操作 */
.emp-quick-actions { display: flex; gap: 8px; margin-left: auto; margin-right: 12px; }

/* ============================================================
   工作台
   ============================================================ */
.workbench { display: flex; flex-direction: row; align-items: flex-start; gap: var(--gap); width: 100%; min-width: 0; }

/* KPI 卡片 */
.wb-kpi {
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px;
}
.wb-card.kpi {
  background: var(--card-bg); border-radius: var(--radius-lg);
  padding: 16px; box-shadow: var(--shadow);
  display: flex; align-items: center; gap: 12px;
  transition: transform .18s ease, box-shadow .18s ease;
  margin-bottom: 12px;
}
.wb-card.kpi:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(26,115,232,.10);
}
.lc-step {
  transition: transform .18s ease, box-shadow .18s ease;
}
.lc-step:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 18px rgba(26,115,232,.10);
}
.kpi-icon {
  width: 44px; height: 44px; border-radius: 12px; flex: 0 0 44px;
  display: grid; place-items: center; font-size: 20px; color: #fff;
}
.kpi-icon.teal { background: linear-gradient(135deg, #00c6b6, #00a896); }
.kpi-icon.blue { background: linear-gradient(135deg, #1A73E8, #1557b0); }
.kpi-icon.purple { background: linear-gradient(135deg, #7c4dff, #5e35b1); }
.kpi-icon.orange { background: linear-gradient(135deg, #ff9800, #f57c00); }
.kpi-icon.green { background: linear-gradient(135deg, #34a853, #2e7d32); }
.kpi-icon.indigo { background: linear-gradient(135deg, #5c6bc0, #3949ab); }
.kpi-body { flex: 1; min-width: 0; }
.kpi-label { font-size: 12px; color: var(--text-muted); }
.kpi-value { font-size: 22px; font-weight: 600; color: var(--text-strong); line-height: 1.2; margin-top: 2px; }
.kpi-value .unit { font-size: 12px; color: var(--text-muted); font-weight: 400; margin-left: 4px; }
.kpi-trend { font-size: 11px; margin-top: 4px; color: var(--success); font-weight: 400; }

/* 通用面板 */
.wb-row { display: flex; gap: 12px; }
.wb-panel {
  background: var(--card-bg); border-radius: var(--radius-lg);
  padding: 14px; box-shadow: var(--shadow); min-width: 0;
  display: flex; flex-direction: column;
  margin-bottom: 8px;
}
.wb-head { margin-bottom: 10px; }
/* 工作台筛选栏（单行内联 + 滚动吸顶） */
.wb-filter {
  padding: 8px 12px;
  position: sticky;
  top: var(--wb-sticky-top);
  z-index: 100;
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  margin-bottom: 0;
}
.wb-filter::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: var(--border);
  opacity: 0;
  transition: opacity .2s;
}
.wb-filter.is-stuck::after { opacity: 1; }
.wb-filter.is-stuck {
  box-shadow: 0 6px 20px rgba(0,0,0,0.08), 0 1px 0 rgba(0,0,0,0.05);
}
.wb-filter-row { display: flex; flex-wrap: nowrap; align-items: center; gap: 14px; overflow: visible; }
.wb-filter-title { font-size: 13px; font-weight: 600; color: var(--text-strong); white-space: nowrap; }
.wb-field-inline { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--text-muted); white-space: nowrap; }
.wb-field-inline .wb-field-label { display: inline-block; width: 56px; text-align: left; }

/* 工作台筛选栏：部门可输入检索联想下拉（外观统一为花名册政治面貌 .combo-box 样式） */
.wb-combo { position: relative; width: 104px; flex-shrink: 0; }
.wb-combo-input {
  width: 100%; height: 32px; box-sizing: border-box; line-height: 30px;
  padding: 0 28px 0 10px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--card-bg); color: var(--text);
  font-size: 13px; font-family: inherit; outline: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235F6368' stroke-width='2' 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 8px center;
  transition: border-color .15s, box-shadow .15s;
}
.wb-combo-input:focus { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-soft); outline: none; }
.wb-combo-caret { display: none; }
.wb-combo-list {
  position: absolute; left: 0; top: calc(100% + 6px); width: 100%;
  max-height: 260px; overflow-y: auto;
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-hover);
  z-index: 999; padding: 0; margin: 0; list-style: none;
}
/* 弹窗/浮窗内：下拉浮层挂到 body 用 fixed，彻底脱离父容器 overflow 裁剪 */
.wb-combo-list-fixed {
  position: fixed; z-index: 9999;
}
.wb-combo-item {
  padding: 5px 10px; font-size: 12px; color: var(--text); border-radius: 0;
  cursor: pointer; display: flex; align-items: center; line-height: 1.2;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.wb-combo-item:hover { background: var(--primary); color: #fff; }
.wb-combo-item.is-sel,
.wb-combo-item.is-active { background: var(--primary-soft, #e8f0fe); color: var(--primary); font-weight: 600; }
.wb-combo-item.is-sel::after,
.wb-combo-item.is-active::after { content: "\2713"; margin-left: auto; font-weight: 700; }
.wb-combo-empty { padding: 8px 12px; font-size: 13px; color: var(--text-muted); cursor: default; }
.wb-field-inline input[type="date"], .wb-field-inline .wb-sel,
.wb-field-inline .date-picker {
  height: 28px; padding: 0 4px; border: 1px solid var(--border); border-radius: 6px;
  background: var(--card-bg); color: var(--text-strong); font-size: 12px; min-width: 0;
  box-sizing: border-box;
}
/* 内部文本框只继承字体与高度，不显示独立边框/背景，避免"框叠框" */
.wb-field-inline .date-picker .dp-input {
  border: none; background: transparent; padding: 0; box-shadow: none; border-radius: 0;
}
.wb-field-inline input[type="date"], .wb-field-inline .date-picker,
.wb-field-inline .wb-sel { width: 104px; min-width: 104px; max-width: 104px; }
/* 去掉工作台筛选栏原生日期框内部的浅色编辑区背景（避免"框上浮框"） */
.wb-field-inline input[type="date"]::-webkit-datetime-edit,
.wb-field-inline input[type="date"]::-webkit-datetime-edit-fields-wrapper,
.wb-field-inline input[type="date"]::-webkit-datetime-edit-text,
.wb-field-inline input[type="date"]::-webkit-datetime-edit-month-field,
.wb-field-inline input[type="date"]::-webkit-datetime-edit-day-field,
.wb-field-inline input[type="date"]::-webkit-datetime-edit-year-field {
  background: transparent !important;
  box-shadow: none !important;
  border: 0 !important;
}
.wb-field-inline .date-picker .dp-input-container { padding: 0 3px 0 5px; gap: 2px; height: 100%; }
.wb-field-inline .date-picker .dp-icon-btn { width: 20px; height: 20px; }
.wb-field-inline .date-picker .dp-icon-btn svg { width: 14px; height: 14px; }
.wb-field-inline input[type="date"]:focus, .wb-field-inline .wb-sel:focus,
.wb-field-inline .date-picker:has(.dp-input:focus), .wb-field-inline .date-picker.dp-open { border-color: var(--primary); box-shadow: none !important; outline: none; }
.wb-filter-row .btn-sm {
  display: inline-flex; align-items: center; justify-content: center;
  height: 28px; padding: 0 12px; font-size: 12px; line-height: 1;
  border-radius: 6px; min-width: 52px;
}
.wb-filters select.search-dark { height: 30px; min-width: 90px; font-size: 12px; }

/* 员工全生命周期管理占满整行 */
.wb-row-2 .lifecycle { flex: 1 1 100%; }

/* 生命周期流程 */
.lifecycle-flow {
  display: flex; align-items: stretch; gap: 10px; overflow-x: auto; padding-bottom: 6px;
}
.lc-step {
  flex: 1 1 0; min-width: 120px; text-align: center;
  background: var(--bg); border-radius: var(--radius); padding: 14px 10px;
  position: relative;
}
.lc-step:not(:last-child)::after {
  content: ''; position: absolute; right: -10px; top: 50%; width: 10px; height: 2px;
  background: var(--border); transform: translateY(-50%);
}
.lc-dot {
  width: 40px; height: 40px; border-radius: 50%; margin: 0 auto 10px;
  display: grid; place-items: center; color: #fff; font-size: 14px; font-weight: 600;
}
.lc-dot.blue { background: #1A73E8; }
.lc-dot.teal { background: #00c6b6; }
.lc-dot.green { background: #34a853; }
.lc-dot.orange { background: #ff9800; }
.lc-dot.purple { background: #7c4dff; }
.lc-dot.pink { background: #ff6b81; }
.lc-title { font-size: 13px; font-weight: 600; color: var(--text-strong); }
.lc-desc { font-size: 11px; color: var(--text-muted); line-height: 1.5; margin-top: 4px; }
.lc-meta { font-size: 11px; color: var(--primary); margin-top: 8px; font-weight: 400; }

/* 关键人才画像 */
.tp-card { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; }
.tp-avatar {
  width: 56px; height: 56px; border-radius: 50%; flex: 0 0 56px;
  background: linear-gradient(135deg, #1A73E8, #7c4dff); color: #fff;
  display: grid; place-items: center; font-size: 20px; font-weight: 600;
}
.tp-info { flex: 1; min-width: 0; }
.tp-name { font-size: 16px; font-weight: 600; color: var(--text-strong); }
.tp-role { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.tp-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.tp-tags .tag {
  font-size: 10px; padding: 2px 8px; border-radius: 20px;
  background: var(--primary-soft); color: var(--primary);
}
.tp-score { font-size: 13px; font-weight: 600; color: var(--warning); margin-top: 6px; }
.tp-fields { display: flex; flex-direction: column; gap: 8px; }
.tp-field { display: flex; justify-content: space-between; font-size: 12px; }
.tp-field span { color: var(--text-muted); }
.tp-field b { color: var(--text-strong); font-weight: 400; }
.tp-link { font-size: 12px; color: var(--primary); text-decoration: none; margin-top: auto; padding-top: 12px; }
.tp-link:hover { text-decoration: underline; }

/* 三列：组织 / 地图 / 待办（待办已移到右侧独立栏，这里只剩组织 + 地图） */
.wb-row-3 .org-tree { flex: 1 1 0; }
.wb-row-3 .talent-map { flex: 2 1 0; }

/* 工作台两栏布局：左侧主内容 2/3 + 右侧待办栏 1/3 */
.wb-main { flex: 2 1 0; min-width: 0; display: flex; flex-direction: column; gap: 12px; position: relative; }
.wb-aside {
  flex: 1 1 0; min-width: 0;
  position: sticky; top: var(--wb-sticky-top);
  height: calc(100vh - var(--wb-sticky-top) - var(--pad));
  display: flex; flex-direction: column;
}
.wb-aside .todo-module { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0; }
.wb-aside .todo-module .todo-list { flex: 1 1 auto; overflow-y: auto; min-height: 0; padding-right: 2px; }
.wb-aside .todo-empty {
  flex: 1 1 auto;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
/* 板块点击热力图（待办面板底部小块） */
.wb-heatmap-block {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.wb-heatmap-block .wb-head { margin-bottom: 6px; }
.wb-heatmap-wrap { display: flex; align-items: stretch; }
.wb-heatmap-y {
  flex: 0 0 auto; width: 40px; box-sizing: border-box; padding-top: 6px;
  font-size: 11px; color: #5f6368; text-align: center;
}
.wb-heatmap-y .hm-y-row { white-space: nowrap; overflow: hidden; }
.wb-heatmap-scroll { flex: 1 1 auto; max-height: 300px; overflow-x: auto; overflow-y: hidden; }
.wb-heatmap-block #wbHeatmap { width: 100%; }
@media (max-width: 1100px) {
  .workbench { flex-direction: column; }
  .wb-aside { position: static; height: auto; }
}

/* 组织架构树 */
.org-list { font-size: 13px; }
.org-group { }
.org-node {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 0; color: var(--text); cursor: pointer;
}
.org-node b { margin-left: auto; font-weight: 400; color: var(--text-muted); font-size: 12px; }
.org-node.root { font-weight: 600; color: var(--text-strong); }
.org-node.active { color: var(--primary); }
.org-node.leaf { padding-left: 20px; color: var(--text-muted); }
.org-chev { font-size: 10px; color: var(--text-faint); width: 12px; }
.org-ico { font-size: 14px; }
.org-children { padding-left: 16px; border-left: 1px dashed var(--border); margin-left: 6px; }

/* 人才分布地图 */
.map-wrap { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.china-map { flex: 1; height: auto; max-height: 180px; }
.map-legend { display: flex; align-items: center; gap: 6px; font-size: 10px; color: var(--text-muted); }
.map-gradient { width: 60px; height: 6px; border-radius: 3px; background: linear-gradient(90deg, #e8f0fe, #1A73E8); }
.map-stats { display: flex; flex-direction: column; gap: 6px; }
.ms-item { display: flex; flex-direction: column; gap: 4px; padding: 6px 0; border-bottom: 1px dashed #f0f2f5; }
.ms-item:last-child { border-bottom: none; }
.ms-main { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
.ms-city { min-width: 48px; color: var(--text-strong); font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ms-main > b { width: 54px; text-align: right; font-weight: 400; }
.ms-pct { margin-left: auto; color: var(--text-faint); font-size: 11px; }
.ms-subs { display: flex; flex-direction: column; gap: 2px; margin: 2px 0 0 56px; padding-left: 10px; border-left: 2px solid #eef2f7; }
.ms-sub { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--text-muted); }
.ms-subname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ms-sub > b { margin-left: auto; font-weight: 400; color: var(--text); min-width: 40px; text-align: right; }
.map-total { font-size: 12px; color: var(--text-muted); text-align: right; margin-top: auto; }
.map-total b { color: var(--text-strong); }

/* 待办事项 */
.todo-list { display: flex; flex-direction: column; gap: 8px; }
.todo-item { display: flex; gap: 10px; }
.todo-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 5px; flex: 0 0 8px; }
.todo-dot.red { background: #ea4335; }
.todo-dot.orange { background: #ff9800; }
.todo-dot.blue { background: #1A73E8; }
.todo-dot.green { background: #34a853; }
.todo-text { flex: 1; font-size: 13px; color: var(--text); line-height: 1.4; }
.todo-meta { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* ==================== 工作台待办事项模块 ==================== */
.todo-module { padding: 12px; }
.todo-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.todo-head .wb-title { display: inline-flex; align-items: center; gap: 6px; font-size: 15px; font-weight: 600; color: var(--text-strong); }
.todo-head-actions { display: flex; align-items: center; gap: 6px; position: relative; }
.icon-btn {
  width: 28px; height: 28px; border-radius: 6px; border: 1px solid var(--border); background: var(--card-bg);
  color: var(--text-muted); font-size: 15px; line-height: 1; cursor: pointer; display: grid; place-items: center;
}
.icon-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.todo-overdue-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: #ea4335; color: #fff; font-size: 11px; font-weight: 600;
}
.todo-add-dropdown {
  position: absolute; right: 0; top: calc(100% + 4px);
  background: var(--card-bg); border: 1px solid var(--border); border-radius: 8px;
  box-shadow: var(--shadow); padding: 4px; z-index: 100; min-width: 130px; display: none;
}
.tad-item { padding: 8px 10px; border-radius: 6px; font-size: 13px; color: var(--text); cursor: pointer; white-space: nowrap; }
.tad-item:hover { background: var(--bg); }

.todo-toolbar { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.todo-views { display: flex; gap: 4px; }
.tv-btn {
  padding: 4px 10px; border-radius: 6px; border: 1px solid transparent; background: transparent;
  font-size: 12px; color: var(--text-muted); cursor: pointer;
}
.tv-btn:hover { background: var(--bg); }
.tv-btn.active { background: var(--primary-soft); color: var(--primary); border-color: var(--primary-soft); }
.todo-status-filter {
  height: 26px; padding: 0 8px; border: 1px solid var(--border); border-radius: 6px;
  background: var(--card-bg); color: var(--text-strong); font-size: 12px; min-width: 90px;
}
.todo-status-filter:focus { border-color: var(--primary); outline: none; }

.todo-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.todo-tag-chip {
  display: inline-flex; align-items: center; padding: 3px 8px; border-radius: 12px;
  background: var(--bg); color: var(--text-muted); font-size: 11px; cursor: pointer; border: 1px solid transparent;
}
.todo-tag-chip:hover { border-color: var(--primary); color: var(--primary); }
.todo-tag-chip.active { background: var(--primary-soft); color: var(--primary); border-color: var(--primary-soft); }

/* 任务卡片 */
.todo-card {
  background: var(--bg); border-radius: var(--radius); padding: 10px;
  border: 1px solid transparent; transition: box-shadow .15s, border-color .15s;
  display: flex; flex-direction: column; gap: 4px;
}
.todo-card:hover { border-color: var(--primary-soft); box-shadow: 0 2px 8px rgba(0,0,0,.04); }
.tc-top { display: flex; align-items: center; gap: 6px; }
.tc-badges { display: flex; align-items: center; gap: 4px; flex: 0 0 auto; }
.tc-banner {
  font-size: 11px; font-weight: 600; color: #fff; background: #ea4335;
  padding: 1px 5px; border-radius: 4px; display: inline-flex; align-items: center;
}
.tc-priority {
  padding: 1px 5px; border-radius: 4px; font-size: 11px; font-weight: 600;
}
.tc-priority.pri-urgent { background: rgba(234,67,53,.12); color: #c5221f; }
.tc-priority.pri-important { background: rgba(255,152,0,.12); color: #e65100; }
.tc-priority.pri-normal { background: rgba(128,128,128,.12); color: #666; }
.tc-title {
  flex: 1; min-width: 0; font-size: 13px; font-weight: 400; color: var(--text-strong);
  line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tc-actions { display: flex; gap: 4px; flex: 0 0 auto; }
.tc-btn {
  padding: 2px 6px; border-radius: 6px; border: 1px solid var(--border);
  background: var(--card-bg); color: var(--text); font-size: 12px; cursor: pointer; line-height: 1.3;
}
.tc-btn:hover { border-color: var(--primary); color: var(--primary); }
.tc-btn.done:hover { border-color: #34a853; color: #34a853; }
.tc-btn.postpone:hover { border-color: #ff9800; color: #ff9800; }
.tc-btn.logs:hover { border-color: #7c4dff; color: #7c4dff; }
.tc-bottom { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 11px; color: var(--text-muted); }
.tc-deadline.urgent { color: #ea4335; font-weight: 600; }
.tc-est, .tc-repeat { background: var(--card-bg); padding: 1px 5px; border-radius: 4px; }
.tc-tags { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.tc-tag {
  font-size: 11px; padding: 1px 5px; border-radius: 10px;
  background: var(--primary-soft); color: var(--primary);
}
.tc-subbar { font-size: 11px; color: var(--text-muted); }
.tc-suggest {
  font-size: 11px; color: #e65100; background: rgba(255,152,0,.08);
  padding: 3px 6px; border-radius: 4px;
}

/* 看板 */
.todo-kanban {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 10px;
  height: 100%;
  min-height: 0;
}
.todo-kb-col {
  background: var(--bg); border-radius: var(--radius); border-top: 3px solid var(--border);
  padding: 10px; min-height: 0;
  display: flex; flex-direction: column; overflow: hidden;
}
.todo-kb-col.kb-q1 { border-top-color: #ea4335; }
.todo-kb-col.kb-q2 { border-top-color: #ff9800; }
.todo-kb-col.kb-q3 { border-top-color: #1A73E8; }
.todo-kb-col.kb-q4 { border-top-color: #9e9e9e; }
.kb-head { font-size: 12px; font-weight: 600; color: var(--text-strong); margin-bottom: 8px; display: flex; justify-content: space-between; flex: 0 0 auto; }
.kb-list {
  display: flex; flex-direction: column; gap: 8px;
  flex: 1 1 auto; overflow-y: auto; min-height: 0; padding-right: 2px;
}
.kb-list .todo-card { padding: 8px; }
.kb-list .tc-actions { display: none; } /* 看板内简化，点击进入编辑 */
.kb-list .todo-card:hover .tc-actions { display: flex; }

/* 表单弹窗 */
.todo-form-body, .todo-rules-body { display: flex; flex-direction: column; gap: 14px; }
.tf-row { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--text-muted); }
.tf-field-label { display: inline-flex; align-items: center; gap: 2px; }
.tf-required { color: #ea4335; }
.tf-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tf-row input[type="text"], .tf-row input[type="number"], .tf-row input[type="datetime-local"],
.tf-row select, .tf-row textarea {
  height: 34px; padding: 0 10px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--card-bg); color: var(--text-strong); font-size: 13px; width: 100%;
  font-family: inherit;
}
.tf-row textarea { height: auto; min-height: 60px; padding: 8px 10px; resize: vertical; }
.tf-row input:focus, .tf-row select:focus, .tf-row textarea:focus { border-color: var(--primary); outline: none; box-shadow: none !important; }
.tf-subtitle { font-weight: 600; color: var(--text-strong); margin-bottom: 4px; }
.tf-sub-item { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text); margin-bottom: 6px; }
.tf-sub-item .done { text-decoration: line-through; color: var(--text-muted); }
.tf-addsub { display: flex; gap: 8px; }
.tf-addsub input { flex: 1; }

/* 口语解析预览 */
.tn-preview { background: var(--bg); border-radius: var(--radius); padding: 14px; margin-top: 10px; }
.tn-preview-title { font-size: 13px; font-weight: 600; color: var(--text-strong); margin-bottom: 12px; }
.tn-preview-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tn-preview-grid label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--text-muted); }
.tn-preview-grid .tn-field-label { display: inline-flex; align-items: center; gap: 2px; }
.tn-preview-grid .tn-required { color: #ea4335; }
.tn-preview-grid input, .tn-preview-grid select, .tn-preview-grid textarea {
  padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--card-bg); color: var(--text-strong); font-size: 13px;
  font-family: inherit;
  box-sizing: border-box; width: 100%; resize: vertical;
}
.tn-preview-grid input, .tn-preview-grid select { height: 34px; }
.tn-preview-grid input { padding: 0 10px; line-height: 32px; }
.tn-preview-grid select { padding: 0 24px 0 10px; line-height: 32px; }
.tn-preview-grid textarea { min-height: 56px; line-height: 1.4; }
.tn-preview-grid input:focus, .tn-preview-grid select:focus, .tn-preview-grid textarea:focus { border-color: var(--primary); outline: none; }

/* 规则设置 */
.tr-master { font-size: 13px; font-weight: 600; color: var(--text-strong); padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.tr-master input { margin-right: 6px; }
.tr-rule { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; color: var(--text); }
.tr-rule input[type="checkbox"] { margin-right: 2px; }
.tr-rule input[type="number"] {
  width: 56px; height: 28px; padding: 0 6px; border: 1px solid var(--border); border-radius: 6px;
  background: var(--card-bg); color: var(--text-strong); font-size: 12px;
}

/* 自定义规则（IF-THEN） */
.tr-custom-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-top: 16px; padding-top: 12px; border-top: 1px dashed var(--border);
  font-size: 13px; font-weight: 600; color: var(--text-strong);
}
.tr-custom-list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.trc-empty { font-size: 12px; color: var(--text-muted); padding: 8px 0; }
.trc-item {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px;
  background: var(--bg-soft, #f6f7f9); border: 1px solid var(--border); border-radius: 8px;
}
.trc-item.off { opacity: .58; }
.trc-toggle { flex: 0 0 auto; }
.trc-toggle input { width: 16px; height: 16px; cursor: pointer; }
.trc-main { flex: 1 1 auto; min-width: 0; }
.trc-name { font-size: 13px; font-weight: 600; color: var(--text-strong); }
.trc-summary { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.trc-ops { flex: 0 0 auto; display: flex; gap: 6px; }

/* 自定义规则构建弹窗 */
.todo-custom-body { display: flex; flex-direction: column; gap: 12px; }
.trc-if {
  font-size: 12px; font-weight: 600; color: var(--primary);
  margin-top: 4px; padding-left: 2px;
}
.trc-row { display: flex; align-items: center; gap: 10px; }
.trc-label { flex: 0 0 64px; font-size: 12px; color: var(--text-muted); text-align: right; }
.trc-row select, .trc-row input[type="text"], .trc-row input[type="number"] {
  flex: 1 1 auto; height: 32px; padding: 0 10px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--card-bg); color: var(--text-strong); font-size: 13px; min-width: 0;
}
.trc-row.trc-enabled { gap: 8px; }
.trc-row.trc-enabled .trc-label { text-align: left; flex: 0 0 auto; }

/* 日志 */
.tl-body { display: flex; flex-direction: column; gap: 12px; max-height: 60vh; overflow-y: auto; padding-right: 4px; }
.tl-empty, .tl-loading { font-size: 13px; color: var(--text-muted); text-align: center; padding: 24px 0; }
.tl-item { padding-left: 12px; border-left: 3px solid var(--primary); }
.tl-time { font-size: 11px; color: var(--text-muted); margin-bottom: 2px; }
.tl-rule { font-size: 13px; color: var(--text); }

/* 弹窗在待办模块中的微调 */
#todoFormModal .modal, #todoNlModal .modal, #todoRulesModal .modal, #todoLogModal .modal, #todoCustomRuleModal .modal {
  max-height: 90vh; overflow: hidden; display: flex; flex-direction: column;
}
#todoFormModal .modal-body, #todoNlModal .modal-body, #todoRulesModal .modal-body, #todoLogModal .modal-body, #todoCustomRuleModal .modal-body {
  overflow-y: auto; padding: 18px 20px;
}

/* 底部四列分析 */
.wb-row-4 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.chart-card { min-height: 220px; }

/* 招聘数据统计（迁移到工作台） */
.wb-recruit-stats { display: flex; flex-direction: column; gap: 12px; margin-bottom: 8px; }
.wb-recruit-stats > .wb-panel,
.wb-recruit-stats > .wb-row { margin: 0; }
.wb-recruit-row .chart-card { flex: 1 1 0; min-width: 0; }
/* 工作台招聘数据统计：指标卡改为小卡片，三列横向排列 */
.wb-recruit-stats .quota-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 0;
}
.wb-recruit-stats .quota-card {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 12px 6px;
  border-radius: 10px;
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
}
.wb-recruit-stats .quota-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0,0,0,.06);
}
.wb-recruit-stats .quota-card .qc-val {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0;
}
.wb-recruit-stats .quota-card .qc-label {
  font-size: 12px;
  margin-top: 0;
}
@media (max-width: 520px) {
  .wb-recruit-stats .quota-summary { grid-template-columns: 1fr; }
}

/* 招聘漏斗 */
.funnel { display: flex; flex-direction: column; gap: 10px; }
.funnel-row { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.fl-label { width: 64px; color: var(--text-muted); }
.fl-bar { flex: 1; height: 22px; background: var(--bg); border-radius: 4px; overflow: hidden; }
.fl-fill { height: 100%; background: linear-gradient(90deg, #1A73E8, #4285f4); color: #fff; display: flex; align-items: center; padding-left: 8px; font-size: 11px; font-weight: 400; border-radius: 4px; }
.fl-rate { width: 46px; text-align: right; color: var(--text-faint); }

/* 离职分析 donut */
.resign-wrap { display: flex; align-items: center; gap: 14px; margin-top: 4px; }
.donut-chart {
  width: 110px; height: 110px; border-radius: 50%; flex: 0 0 110px;
  background: conic-gradient(#1A73E8 calc(var(--p) * 1%), #e8f0fe 0);
  position: relative;
}
.donut-inner {
  position: absolute; inset: 14px; border-radius: 50%; background: var(--card-bg);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.donut-inner b { font-size: 22px; color: var(--text-strong); }
.donut-inner span { font-size: 10px; color: var(--text-muted); }
.donut-legend { flex: 1; display: flex; flex-direction: column; gap: 6px; font-size: 11px; }
.dl-item { display: flex; align-items: center; gap: 6px; color: var(--text-muted); }
.dl-dot { width: 8px; height: 8px; border-radius: 2px; }
.resign-trend { margin-top: auto; font-size: 12px; color: var(--danger); font-weight: 400; }

/* 绩效趋势 */
.perf-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.perf-value { font-size: 24px; font-weight: 600; color: var(--text-strong); }
.perf-trend { font-size: 12px; color: var(--success); }
.line-chart { width: 100%; height: 90px; }
.line-labels { display: flex; justify-content: space-between; font-size: 10px; color: var(--text-faint); margin-top: 6px; }

/* 培训完成 */
.train-ring { position: relative; width: 130px; height: 130px; margin: 0 auto 12px; }
.train-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-text {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.ring-text b { font-size: 22px; color: var(--text-strong); }
.ring-text span { font-size: 11px; color: var(--text-muted); }
.train-meta { text-align: center; font-size: 12px; color: var(--text-muted); line-height: 1.8; }
.train-meta b { color: var(--text-strong); }
.train-trend { color: var(--success); font-weight: 400; }

/* 工作台响应式 */
@media (max-width: 1400px) {
  .wb-kpi { grid-template-columns: repeat(3, 1fr); }
  .wb-row-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 1100px) {
  .wb-row-2, .wb-row-3 { flex-direction: column; }
  .wb-row-2 .lifecycle, .wb-row-2 .talent-profile,
  .wb-row-3 .org-tree, .wb-row-3 .talent-map, .wb-row-3 .todo { flex: 1 1 auto; }
}
@media (max-width: 768px) {
  .wb-kpi { grid-template-columns: repeat(2, 1fr); }
  .wb-row-4 { grid-template-columns: 1fr; }
  .lifecycle-flow { flex-wrap: wrap; }
  .lc-step { flex: 1 1 30%; min-width: 100px; }
}
@media (max-width: 480px) {
  .wb-kpi { grid-template-columns: 1fr; }
}

/* 2026-10-31：弹窗安全网 —— 未用 .form-grid 的 form.modal-body（如 scForm 稀缺溢价 / socialRuleForm /
   payrollForm / rcForm / apForm / jf*Form / ivForm / ofForm / prDelayForm / npForm 等）直接子 label
   也走考勤配置 .att2-form 的上下式，输入控件与 .filter-input/.filter-select/.combo-input 对齐
   精确值（高32/圆角6/1px边框/卡片底色/13px字）。不涉及 .emp-section（花名册保留横向）。 */
form.modal-body > label:has(> input:not([type="checkbox"]):not([type="radio"])),
form.modal-body > label:has(> select),
form.modal-body > label:has(> textarea) {
  display: flex; flex-direction: column; gap: 5px;
  font-size: 12px; color: var(--text-muted); margin: 0 0 12px;
}
form.modal-body > label > input:not([type="checkbox"]):not([type="radio"]),
form.modal-body > label > select,
form.modal-body > label > textarea {
  height: 32px; padding: 0 9px;
  border: 1px solid var(--border); border-radius: 6px;
  background: var(--card-bg); color: var(--text);
  font-size: 13px; box-sizing: border-box; outline: none; width: 100%;
}
/* 保留 .filter-input/.filter-select/.combo-input 自带的搜索/箭头内边距，仅对齐尺寸与配色 */
form.modal-body .filter-input,
form.modal-body .filter-select {
  height: 32px; border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--card-bg); color: var(--text);
}
form.modal-body .combo-input { height: 32px; border-radius: 6px; }
