/* 人员管理操作列随表格滚动，不固定在右侧。 */
.emp-tab-panel[data-emp-panel="people"] #empTable thead th.col-action,
.emp-tab-panel[data-emp-panel="people"] #empTable tbody td.col-action {
  position: static !important;
  right: auto !important;
  z-index: auto !important;
  box-shadow: none !important;
  background: inherit !important;
}

/* 资料修改：桌面紧凑三列，滚动区始终留在弹窗内部。 */
.staff-edit-modal {
  width: min(780px, calc(100vw - 32px)) !important;
  max-width: 780px !important;
  max-height: min(760px, calc(100dvh - 32px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.staff-edit-modal .modal-head { flex: 0 0 auto; padding-block: 11px; }
.staff-edit-modal .link-modal-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 12px 16px 14px;
}
.staff-profile-form {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px 12px !important;
  align-items: start;
}
.staff-profile-form .field { min-width: 0; margin: 0; gap: 4px; }
.staff-profile-form .field input:not([type="checkbox"]),
.staff-profile-form .field select {
  width: 100%;
  height: 34px;
  min-height: 34px;
  padding: 5px 9px;
  box-sizing: border-box;
}
.staff-profile-form .staff-profile-wide,
.staff-profile-form .staff-profile-actions {
  grid-column: 1 / -1;
}
.staff-profile-form .staff-profile-toggle { grid-column: span 2; }
.staff-profile-form .staff-profile-toggle > input[type="checkbox"] {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  min-height: 0;
}
.staff-profile-form .emp-hint { font-size: 11px; line-height: 1.35; }
.staff-profile-actions {
  position: sticky;
  bottom: -14px;
  z-index: 2;
  margin: 2px -2px 0;
  padding: 10px 2px 4px;
  background: #fff;
  border-top: 1px solid #e2e8f0;
}

/* 员工详情改为居中宽屏弹窗。 */
.hr-drawer-mask {
  justify-content: center !important;
  align-items: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.48);
}
.hr-drawer {
  width: min(1040px, calc(100vw - 48px)) !important;
  height: min(760px, calc(100vh - 48px)) !important;
  max-width: 1040px;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.24);
  overflow: hidden;
}
.hr-drawer-head { padding: 16px 20px; }
.hr-drawer-tabs { padding: 8px 20px; flex-wrap: nowrap; overflow-x: auto; }
.hr-drawer-body { padding: 20px 24px 28px; }
.hr-drawer-body .hr-dl {
  grid-template-columns: 120px minmax(180px, 1fr) 120px minmax(180px, 1fr);
  gap: 12px 16px;
}
.hr-drawer-body .hr-dl dd { min-width: 0; overflow-wrap: anywhere; }
.hr-drawer-body .hr-overview-note { grid-column: span 3; }
.hr-detail-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}
.hr-detail-metric {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 12px;
  background: #f8fafc;
}
.hr-detail-metric span { display: block; color: #64748b; font-size: 12px; }
.hr-detail-metric strong { display: block; margin-top: 5px; color: #0f172a; font-size: 18px; }
.hr-detail-metric .hr-detail-metric-text { font-size: 13px; line-height: 1.45; overflow-wrap: anywhere; }
.hr-detail-section-title { margin: 18px 0 8px; font-size: 14px; color: #0f172a; }
.hr-detail-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.hr-performance-eval {
  margin: 0 0 14px;
  padding: 12px 14px;
  border-left: 3px solid #f59e0b;
  background: #fffbeb;
  color: #475569;
  line-height: 1.65;
}

/* 员工业绩档案。 */
.pa-page { min-width: 0; color: #0f172a; }
.pa-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding-bottom: 12px;
  border-bottom: 1px solid #e2e8f0;
}
.pa-periods {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid #dbe3ec;
  border-radius: 8px;
  background: #f8fafc;
}
.pa-periods button {
  border: 0;
  border-radius: 6px;
  padding: 6px 12px;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  font-weight: 600;
}
.pa-periods button.active { background: #fff; color: #0f172a; box-shadow: 0 1px 2px rgba(15, 23, 42, 0.1); }
.pa-toolbar select { min-width: 150px; }
.pa-toolbar select,
.pa-toolbar input[type="date"] {
  height: 36px;
  min-height: 36px;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  background-color: #fff;
  color: #0f172a;
  padding: 0 10px;
  font-size: 13px;
  outline: none;
}
.pa-toolbar select:hover,
.pa-toolbar input[type="date"]:hover { border-color: #94a3b8; }
.pa-toolbar select:focus,
.pa-toolbar input[type="date"]:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}
.pa-range-label { margin-left: auto; color: #64748b; font-size: 12px; }
.pa-loading, .pa-empty { padding: 36px 12px; text-align: center; color: #64748b; }
.pa-error { color: #b91c1c; }
.pa-person-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 0 12px;
}
.pa-person-head span { color: #64748b; font-size: 12px; }
.pa-person-head h3 { margin: 3px 0; font-size: 20px; }
.pa-person-head p { margin: 0; color: #64748b; font-size: 12px; }
.pa-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.pa-kpi {
  min-width: 0;
  min-height: 88px;
  padding: 11px 12px;
  border: 1px solid #e2e8f0;
  border-left-width: 3px;
  border-radius: 8px;
  background: #fff;
  box-sizing: border-box;
}
.pa-kpi-reg { border-left-color: #f59e0b; }
.pa-kpi-money { border-left-color: #16a34a; }
.pa-kpi-rate { border-left-color: #2563eb; }
.pa-kpi-avg { border-left-color: #0f766e; }
.pa-kpi-commission { border-left-color: #dc2626; }
.pa-kpi-income { border-left-color: #7c3aed; }
.pa-kpi-expense { border-left-color: #475569; }
.pa-kpi-profit { border-left-color: #16a34a; }
.pa-kpi-loss { border-left-color: #dc2626; }
.pa-kpi-failed { border-left-color: #ea580c; }
.pa-failed { color: #dc2626; font-weight: 700; }
.pa-failed-ok { color: #94a3b8; }
.pa-profit-positive { color: #15803d !important; }
.pa-profit-negative { color: #b91c1c !important; }
.pa-kpi-history { border-left-color: #64748b; }
.pa-kpi > span { display: block; color: #64748b; font-size: 11px; }
.pa-kpi > strong { display: block; margin: 5px 0 4px; font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pa-kpi > small { display: block; color: #64748b; font-size: 10px; line-height: 1.45; }
.pa-change { display: inline-block; font-size: 10px; font-weight: 700; white-space: nowrap; }
.pa-change-up, .pa-rank-up { color: #15803d; }
.pa-change-down, .pa-rank-down { color: #b91c1c; }
.pa-change-flat, .pa-rank-flat { color: #64748b; }
.pa-section {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid #e2e8f0;
  min-width: 0;
}
.pa-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.pa-section-head h4 { margin: 0; font-size: 15px; }
.pa-section-head span { color: #64748b; font-size: 11px; }
.pa-evaluation { margin: 0; color: #334155; line-height: 1.7; font-size: 13px; }
.pa-finance-note { margin: 8px 0 0; color: #64748b; font-size: 11px; line-height: 1.55; }
.pa-team-strip { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 10px; color: #64748b; font-size: 12px; }
.pa-legend { display: flex; gap: 12px; }
.pa-legend span { display: inline-flex; align-items: center; gap: 4px; }
.pa-legend i { width: 8px; height: 8px; border-radius: 2px; }
.pa-legend-reg { background: #f59e0b; }
.pa-legend-recharge { background: #16a34a; }
.pa-chart-scroll { overflow-x: auto; padding-bottom: 4px; }
.pa-chart {
  display: grid;
  grid-template-columns: repeat(var(--pa-points), minmax(34px, 1fr));
  align-items: end;
  gap: 3px;
  min-width: max(100%, calc(var(--pa-points) * 38px));
  height: 190px;
  padding: 8px 4px 0;
  border-bottom: 1px solid #cbd5e1;
  box-sizing: border-box;
}
.pa-chart-point { height: 100%; display: grid; grid-template-rows: 1fr 22px; min-width: 0; }
.pa-chart-bars { display: flex; align-items: end; justify-content: center; gap: 3px; min-height: 0; }
.pa-chart-bars i { display: block; width: 9px; min-height: 0; border-radius: 3px 3px 0 0; }
.pa-bar-reg { background: #f59e0b; }
.pa-bar-recharge { background: #16a34a; }
.pa-chart-point > span { align-self: end; color: #94a3b8; font-size: 9px; text-align: center; white-space: nowrap; }
.pa-table-wrap { max-height: 440px; }
.pa-table { min-width: 1480px !important; font-size: 12px; }
.pa-table th, .pa-table td { text-align: center; white-space: nowrap; }
.pa-table tbody tr[data-pa-staff] { cursor: pointer; }
.pa-table tbody tr.is-selected td { background: #fff7ed; }
.pa-rank-no { display: inline-grid; place-items: center; min-width: 24px; height: 24px; border-radius: 6px; background: #f1f5f9; }
.pa-staff-link { border: 0; background: none; color: #0f172a; cursor: pointer; padding: 0; font: inherit; }
.pa-staff-link strong, .pa-staff-link small, .pa-cell-sub { display: block; }
.pa-staff-link small, .pa-cell-sub { margin-top: 2px; color: #94a3b8; font-size: 10px; }
.pa-empty-cell { padding: 28px !important; color: #64748b; text-align: center !important; }
.pa-split-sections { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 20px; }
.pa-split-sections .pa-section { min-width: 0; }
.pa-split-sections .pa-table { min-width: 720px !important; }
.pa-daily-wrap { max-height: 420px; }

@media (max-width: 1180px) {
  .pa-kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .pa-split-sections { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .staff-edit-modal { width: 100% !important; max-width: none !important; max-height: 100%; border-radius: 0 !important; }
  .staff-profile-form { grid-template-columns: 1fr; }
  .staff-profile-form .staff-profile-wide,
  .staff-profile-form .staff-profile-actions,
  .staff-profile-form .staff-profile-toggle { grid-column: auto; }
  .hr-drawer-mask { padding: 0; align-items: stretch; }
  .hr-drawer { width: 100% !important; height: 100% !important; max-width: none; border-radius: 0; }
  .hr-drawer-body { padding: 16px 12px 24px; }
  .hr-drawer-body .hr-dl { grid-template-columns: 92px minmax(0, 1fr); }
  .hr-drawer-body .hr-overview-note { grid-column: auto; }
  .hr-detail-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pa-toolbar { align-items: stretch; }
  .pa-periods { width: 100%; box-sizing: border-box; }
  .pa-periods button { flex: 1; padding: 8px 4px; }
  .pa-toolbar select, .pa-toolbar input[type="date"] { flex: 1 1 calc(50% - 6px); min-width: 0; }
  .pa-range-label { width: 100%; margin-left: 0; }
  .pa-person-head { align-items: flex-start; }
  .pa-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pa-kpi { min-height: 86px; }
  .pa-kpi > strong { font-size: 16px; }
  .pa-section-head { align-items: flex-start; }
}
