/* ===================================================================
   人员管理（PersonnelPage）
   视觉语言：与 B01 管理后台统一 —— 浅灰页面底 / 白色卡片 / 黑白灰
   标题 #25372f · 正文 #455c4e · 辅助灰 #8e8e93 · 表头灰 #aeaeb2
   大圆角白卡 + 极轻阴影 + 克制状态色（启用绿 / 危险红）
   =================================================================== */

/* ---- 页面根容器：占满主内容区，内部纵向滚动（与学习/工作手册同布局模式） ---- */
#adminPagePersonnel {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.personnel-page {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  background: transparent;
  color: #455c4e;
  font-size: 14px;
}

.personnel-inner {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 6px 0 40px;
  box-sizing: border-box;
}

/* ---- 页头 ---- */
.personnel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}
.personnel-title {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  color: #25372f;
  letter-spacing: 0.2px;
}
.personnel-sub {
  margin: 8px 0 0;
  font-size: 13px;
  color: #8e8e93;
  line-height: 1.7;
}
.personnel-note {
  margin: 6px 0 0;
  font-size: 12px;
  color: #aeaeb2;
  line-height: 1.7;
}

/* ---- 通用白卡片 ---- */
.pnp-card {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
  overflow: hidden;
  margin-bottom: 20px;
}
.pnp-card-title {
  font-weight: 600;
  color: #25372f;
  font-size: 15px;
  padding: 20px 24px 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.pnp-card-badge {
  background: #f4f7f3;
  border: 1px solid #e5ece4;
  color: #6d6d72;
  border-radius: 999px;
  min-width: 20px;
  height: 20px;
  padding: 0 8px;
  font-size: 12px;
  line-height: 18px;
  text-align: center;
  font-weight: 600;
}
.pnp-card-note {
  font-size: 12px;
  color: #8e8e93;
  margin: 2px 24px 10px;
  line-height: 1.6;
}

/* ---- 次级信息卡片（已删除归档 / legacy 兼容）：
       标题更小更轻、行更灰，不与正式员工主列表抢视觉权重 ---- */
.pnp-archived-card .pnp-card-title,
.pnp-legacy-card .pnp-card-title {
  font-size: 13.5px;
  color: #6d6d72;
  font-weight: 600;
  padding-top: 16px;
}
.pnp-archived-card .pnp-card-badge,
.pnp-legacy-card .pnp-card-badge {
  background: #e5ece4;
  border-color: #e0e0e5;
  color: #8e8e93;
  font-weight: 500;
}
.pnp-archived-card .pnp-head,
.pnp-legacy-card .pnp-head {
  background: #fcfcfc;
  border-top: 1px solid #f7f7f8;
  color: #b5b5bc;
}
.pnp-archived-card .pnp-name,
.pnp-legacy-card .pnp-name {
  color: #6d6d72;
  font-weight: 500;
}

/* ---- 岗位筛选胶囊（黑选中 / 浅灰未选中） ---- */
.pnp-tabs {
  display: flex;
  gap: 8px;
  padding: 18px 24px 14px;
  flex-wrap: wrap;
}
.pnp-tab {
  border: 1px solid #e5ece4;
  background: #f4f7f3;
  color: #455c4e;
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.pnp-tab:hover {
  background: #e5ece4;
  border-color: #d9d9de;
}
.pnp-tab.is-active {
  background: #355944;
  color: #fff;
  border-color: #355944;
}
.pnp-tab-count {
  background: #e5ece4;
  color: #8e8e93;
  border-radius: 999px;
  padding: 0 7px;
  font-size: 12px;
  line-height: 17px;
}
.pnp-tab.is-active .pnp-tab-count {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
}

/* ---- 列表网格 ---- */
.pnp-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 0.75fr) minmax(0, 0.75fr) minmax(0, 1.9fr) minmax(0, 0.6fr) 220px;
  gap: 12px;
  align-items: center;
  padding: 12px 24px;
}

/* 表头：白 / 极浅灰，中性灰文字 */
.pnp-head {
  color: #aeaeb2;
  font-size: 12px;
  font-weight: 500;
  background: #fafafa;
  border-top: 1px solid #f4f7f3;
  border-bottom: 1px solid #e5ece4;
}
.pnp-row {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 0.75fr) minmax(0, 0.75fr) minmax(0, 1.9fr) minmax(0, 0.6fr) 220px;
  gap: 12px;
  align-items: center;
  padding: 13px 24px;
  border-bottom: 1px solid #f4f7f3;
}
.pnp-row:last-child {
  border-bottom: none;
}
.pnp-row.is-disabled {
  opacity: 0.6;
  background: #fafafa;
}
.pnp-row.is-archived {
  background: #fafafa;
}
.pnp-legacy-row {
  background: #fbfbfa;
}
.pnp-legacy-row .pnp-name,
.pnp-row.is-archived .pnp-name {
  color: #6d6d72;
  font-weight: 500;
}

.pnp-cell {
  min-width: 0;
}
.pnp-cell-name {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.pnp-name {
  font-weight: 600;
  font-size: 13.5px;
  color: #25372f;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pnp-sub {
  font-size: 11.5px;
  color: #aeaeb2;
}
.pnp-job {
  color: #455c4e;
  font-size: 13px;
}
.pnp-level {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  background: #f4f7f3;
  border: 1px solid #e5ece4;
  color: #6d6d72;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}
.pnp-level.is-leader {
  background: #e5ece4;
  border-color: #e0e0e5;
  color: #455c4e;
}

/* 模块权限 chip：中性浅灰，不使用大面积暖色 */
.pnp-perms {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.pnp-chip {
  display: inline-block;
  background: #f4f7f3;
  border: 1px solid #e5ece4;
  color: #6d6d72;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.5;
  padding: 1px 7px;
}
.pnp-chip-base,
.pnp-chip-legacy {
  background: #f4f7f3;
  border: 1px solid #e5ece4;
  color: #6d6d72;
}

.pnp-status {
  font-size: 12.5px;
  font-weight: 500;
  color: #4f7d55;
  white-space: nowrap;
}
.pnp-status.is-off {
  color: #c0392b;
}
.pnp-status.is-deleted {
  color: #9a9aa0;
}

.pnp-muted {
  font-size: 12px;
  color: #c7c7cc;
}

.pnp-hint {
  font-size: 11.5px;
  color: #aeaeb2;
  white-space: nowrap;
}

.pnp-cell-ops {
  display: flex;
  gap: 6px;
  align-items: center;
}

/* ---- 按钮（黑主 / 灰次 / 危险红） ---- */
.pnp-btn {
  border: none;
  border-radius: 10px;
  padding: 6px 13px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s, opacity 0.15s;
}
.pnp-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.pnp-btn-primary {
  background: #355944;
  color: #fff;
  font-weight: 600;
  padding: 9px 18px;
  line-height: 1.2;
}
.pnp-btn-primary:hover {
  background: #455c4e;
}
.pnp-btn-ghost {
  background: #fff;
  color: #455c4e;
  border: 1px solid #d9d9de;
}
.pnp-btn-ghost:hover {
  background: #f4f7f3;
  border-color: #c7c7cc;
}
.pnp-btn-warn {
  background: #fff;
  color: #6d6d72;
  border: 1px solid #d9d9de;
}
.pnp-btn-warn:hover {
  background: #f4f7f3;
  border-color: #c7c7cc;
}
.pnp-btn-danger {
  background: #fff;
  color: #c0392b;
  border: 1px solid #e8c6c2;
}
.pnp-btn-danger:hover {
  background: #fdf3f2;
  border-color: #d9a09a;
}
.pnp-btn-danger-solid {
  background: #c0392b;
  color: #fff;
}
.pnp-btn-danger-solid:hover {
  background: #a93226;
}

/* ---- 空态（居中浅灰，留足空间） ---- */
.pnp-empty {
  padding: 44px 24px;
  text-align: center;
}
.pnp-empty-title {
  font-size: 14px;
  font-weight: 600;
  color: #455c4e;
  margin-bottom: 6px;
}
.pnp-empty-desc {
  margin: 0;
  font-size: 12.5px;
  color: #8e8e93;
}

/* ===== 弹窗（白卡 / 黑标题 / 黑主按钮 / 灰次按钮） ===== */
.personnel-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.personnel-modal {
  background: #fff;
  border-radius: 16px;
  width: 640px;
  max-width: 96vw;
  max-height: 92vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.22);
  animation: pnpPop 0.16s ease-out;
}
/* 弹窗内部滚动：标题栏 / 底部按钮固定，仅表单内容区超高时滚动 */
.personnel-modal-head,
.personnel-modal-foot {
  flex: 0 0 auto;
}
.personnel-modal-wide {
  width: 760px;
}
.personnel-modal-confirm {
  width: 440px;
}
@keyframes pnpPop {
  from {
    transform: translateY(10px) scale(0.98);
    opacity: 0;
  }
  to {
    transform: none;
    opacity: 1;
  }
}
.personnel-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 14px;
  border-bottom: 1px solid #eef3ee;
}
.personnel-modal-title {
  font-size: 17px;
  margin: 0;
  color: #25372f;
  font-weight: 700;
}
.personnel-modal-close {
  border: none;
  background: none;
  font-size: 22px;
  color: #aeaeb2;
  cursor: pointer;
  line-height: 1;
}
.personnel-modal-close:hover {
  color: #25372f;
}
.personnel-modal-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 18px 24px 20px;
}
.personnel-modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 24px 18px;
  border-top: 1px solid #eef3ee;
}

.pnp-form-sec-title {
  font-size: 14px;
  font-weight: 700;
  color: #25372f;
  margin: 2px 0 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid #eef3ee;
}

.pnp-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 16px;
  margin-bottom: 14px;
}
.pnp-form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.pnp-form-label {
  font-size: 13px;
  color: #455c4e;
  font-weight: 600;
}
.pnp-input,
.pnp-select {
  border: 1px solid #d9d9de;
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 14px;
  background: #fff;
  color: #455c4e;
  outline: none;
  transition: border-color 0.15s;
}
.pnp-input:focus,
.pnp-select:focus {
  border-color: #355944;
}
.pnp-input:disabled {
  background: #f4f7f3;
  color: #aeaeb2;
}
.pnp-form-hint {
  font-size: 12px;
  color: #8e8e93;
  margin: 6px 0 0;
  line-height: 1.6;
}
.pnp-rename-tip {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #6d6d72;
  margin-top: 6px;
  cursor: pointer;
  user-select: none;
}
.pnp-rename-tip input {
  accent-color: #25372f;
  width: 14px;
  height: 14px;
}

/* ---- 表单分区：基本信息 / 岗位信息 / 功能权限 ---- */
.pnp-form-section {
  margin-bottom: 20px;
}
.pnp-form-section:last-child {
  margin-bottom: 0;
}
.pnp-form-field-full {
  grid-column: 1 / -1;
}
.pnp-form-intro {
  font-size: 12.5px;
  color: #6d6d72;
  margin: 0 0 10px;
  line-height: 1.6;
}

/* ---- 岗位身份说明（轻量提示） ---- */
.pnp-form-note-level {
  font-size: 12px;
  color: #6d6d72;
  background: #f7f7f8;
  border: 1px solid #e5ece4;
  border-radius: 8px;
  padding: 8px 10px;
  margin: 10px 0 0;
  line-height: 1.7;
}
.pnp-note-em {
  color: #455c4e;
  font-weight: 600;
}

/* ---- 账号状态单选（启用 / 停用） ---- */
.pnp-radio-group {
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 5px 2px;
}
.pnp-radio {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: #455c4e;
  cursor: pointer;
  user-select: none;
}
.pnp-radio input {
  width: 15px;
  height: 15px;
  accent-color: #25372f;
  margin: 0;
}

/* ---- 固定权限（营销活动：全员固定可读，不提供勾选） ---- */
.pnp-fixed-perms {
  margin-top: 14px;
  border: 1px dashed #c9c9cf;
  border-radius: 12px;
  background: #fcfcfd;
  padding: 12px 16px 10px;
}
.pnp-fixed-item {
  margin-top: 8px;
}
.pnp-fixed-row {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 10px;
  margin-top: 6px;
}
.pnp-fixed-name {
  display: inline-block;
  background: #355944;
  color: #fff;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
  padding: 1px 8px;
}
.pnp-fixed-view {
  font-size: 13px;
  color: #4f7d55;
  font-weight: 600;
}
.pnp-fixed-mgmt {
  font-size: 12px;
  color: #8e8e93;
  line-height: 1.6;
}
.pnp-fixed-note {
  font-size: 11.5px;
  color: #aeaeb2;
  margin: 8px 0 0;
  line-height: 1.7;
}

/* ---- 模块权限多选（中性极简） ---- */
.pnp-form-perms-wrap {
  margin-top: 6px;
}
.pnp-form-perms {
  border: 1px dashed #d5d5da;
  border-radius: 12px;
  padding: 14px 16px;
  background: #fafafa;
}
.pnp-perm-sec {
  margin-bottom: 14px;
}
.pnp-perm-sec:last-child {
  margin-bottom: 0;
}
.pnp-perm-sec-title {
  font-size: 12px;
  color: #6d6d72;
  font-weight: 700;
}
.pnp-perm-opts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin-top: 8px;
}
.pnp-perm-opt {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 13.5px;
  color: #455c4e;
}
.pnp-perm-opt input {
  width: 15px;
  height: 15px;
  accent-color: #25372f;
}
.pnp-perm-empty {
  font-size: 12px;
  color: #8e8e93;
  padding: 10px 0 2px;
  line-height: 1.7;
}
.pnp-reco-line {
  margin-top: 12px;
}
.pnp-reco-btn {
  border: 1px dashed #c9c9cf;
  background: #fff;
  color: #6d6d72;
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}
.pnp-reco-btn:hover {
  background: #e9f1e8;
  border-color: #b5b5bc;
  color: #455c4e;
}

/* ---- 确认弹窗 ---- */
.pnp-confirm-title {
  font-size: 16px;
  font-weight: 700;
  color: #25372f;
}
.pnp-confirm-msg {
  margin-top: 10px;
  color: #455c4e;
  font-size: 14px;
  line-height: 1.8;
  white-space: pre-line;
}

/* ===== Toast（黑底白字；错误红） ===== */
.personnel-toast {
  position: fixed;
  top: 70px;
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  background: #355944;
  color: #fff;
  padding: 10px 20px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  z-index: 120;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
}
.personnel-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.personnel-toast.is-err {
  background: #c0392b;
}

/* ===== 移动端 / 窄屏 ===== */
@media (max-width: 1000px) {
  .personnel-inner {
    max-width: 100%;
  }
}
@media (max-width: 860px) {
  .personnel-inner {
    padding: 2px 0 28px;
  }
  .personnel-head {
    margin-bottom: 16px;
  }
  .personnel-title {
    font-size: 20px;
  }
  .pnp-grid,
  .pnp-row {
    grid-template-columns: 1fr 1fr;
  }
  .pnp-cell-ops,
  .pnp-cell-name {
    grid-column: auto;
  }
  .pnp-form-grid {
    grid-template-columns: 1fr;
  }
  .pnp-card-title {
    padding: 18px 18px 2px;
  }
  .pnp-card-note {
    margin: 2px 18px 8px;
  }
  .pnp-tabs {
    padding: 16px 18px 12px;
  }
  .pnp-grid,
  .pnp-row {
    padding: 10px 18px;
  }
  .personnel-modal-body {
    padding: 16px 18px;
  }
  .personnel-modal-head,
  .personnel-modal-foot {
    padding-left: 18px;
    padding-right: 18px;
  }
}
