/* 绩效核算页面样式 */
#page-performance .section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
#page-performance .section-header h3 {
  font-size: 18px;
  font-weight: 600;
  color: #1a1a2e;
  margin: 0;
}
#page-performance .period-nav {
  display: flex;
  align-items: center;
  gap: 12px;
}
#page-performance .perf-period-label {
  font-size: 15px;
  font-weight: 600;
  min-width: 80px;
  text-align: center;
}

/* 绩效卡片 */
#page-performance .perf-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
#page-performance .perf-card {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  border: 1px solid #f0f0f0;
}
#page-performance .perf-card h4 {
  font-size: 13px;
  color: #666;
  margin: 0 0 8px;
  font-weight: 500;
}
#page-performance .perf-card .perf-val {
  font-size: 28px;
  font-weight: 700;
  color: #1a1a2e;
}
#page-performance .perf-card .perf-val.highlight {
  color: #16a34a;
}
#page-performance .perf-card .perf-sub {
  font-size: 12px;
  color: #999;
  margin-top: 4px;
}

/* 提成卡片 */
#page-performance .commission-card {
  background: linear-gradient(135deg, #4f6ef7 0%, #6366f1 100%);
  border-radius: 12px;
  padding: 24px;
  color: #fff;
  margin-bottom: 24px;
}
#page-performance .commission-card h4 {
  font-size: 14px;
  opacity: 0.9;
  margin: 0 0 8px;
}
#page-performance .commission-card .commission-amount {
  font-size: 36px;
  font-weight: 700;
}
#page-performance .commission-card .commission-plan {
  font-size: 12px;
  opacity: 0.8;
  margin-top: 8px;
}

/* 趋势列表 */
#page-performance .trend-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
  margin-top: 20px;
}
#page-performance .trend-item {
  background: #f8fafc;
  border-radius: 8px;
  padding: 12px;
  text-align: center;
}
#page-performance .trend-item .trend-month {
  font-size: 12px;
  color: #666;
}
#page-performance .trend-item .trend-val {
  font-size: 18px;
  font-weight: 600;
  color: #1a1a2e;
  margin-top: 4px;
}

/* 团队绩效表格 */
#page-performance .perf-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
#page-performance .perf-table th {
  background: #f8fafc;
  padding: 10px 12px;
  text-align: left;
  font-weight: 600;
  color: #555;
  border-bottom: 2px solid #e5e7eb;
}
#page-performance .perf-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #f0f0f0;
}
#page-performance .perf-table tr:hover td {
  background: #f8fafc;
}

/* 方案卡片 */
#page-performance .plan-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}
#page-performance .plan-card {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  border: 1px solid #f0f0f0;
  position: relative;
}
#page-performance .plan-card .plan-name {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
}
#page-performance .plan-card .plan-type {
  display: inline-block;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  background: #e0e7ff;
  color: #4f46e5;
  margin-bottom: 8px;
}
#page-performance .plan-card .plan-desc {
  font-size: 12px;
  color: #666;
  margin-bottom: 12px;
}
#page-performance .plan-card .plan-rules {
  font-size: 12px;
  color: #444;
  background: #f8fafc;
  padding: 10px;
  border-radius: 6px;
  margin-bottom: 12px;
}
#page-performance .plan-card .plan-default {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  background: #dcfce7;
  color: #16a34a;
}
#page-performance .plan-card .plan-actions {
  display: flex;
  gap: 8px;
}

/* 方案编辑弹窗 */
#page-performance .modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}
#page-performance .modal-content {
  background: #fff;
  border-radius: 12px;
  width: 90%;
  max-width: 600px;
  max-height: 80vh;
  overflow-y: auto;
}
#page-performance .modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  border-bottom: 1px solid #f0f0f0;
}
#page-performance .modal-header h3 { margin: 0; font-size: 18px; }
#page-performance .modal-close {
  background: none; border: none; font-size: 24px; cursor: pointer; color: #666;
}
#page-performance .modal-body { padding: 24px; }
#page-performance .modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 24px;
  border-top: 1px solid #f0f0f0;
}

/* 阶梯规则编辑 */
#page-performance .tier-rows { margin-top: 12px; }
#page-performance .tier-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}
#page-performance .tier-row input {
  width: 100px;
  padding: 6px 8px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 13px;
}
#page-performance .tier-row .tier-remove {
  background: none; border: none; color: #ef4444; cursor: pointer; font-size: 18px;
}

/* 分配表格 */
#page-performance .assign-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
#page-performance .assign-table th {
  background: #f8fafc;
  padding: 10px 12px;
  text-align: left;
  font-weight: 600;
  border-bottom: 2px solid #e5e7eb;
}
#page-performance .assign-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #f0f0f0;
}
#page-performance .assign-table select {
  padding: 5px 8px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 12px;
  min-width: 150px;
}

/* 按钮样式 */
#page-performance .btn {
  display: inline-block;
  padding: 8px 16px;
  font-size: 13px;
  border-radius: 6px;
  border: 1px solid #ddd;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s;
}
#page-performance .btn-primary {
  background: #4f6ef7;
  color: #fff;
  border-color: #4f6ef7;
}
#page-performance .btn-primary:hover {
  background: #3b5de7;
  border-color: #3b5de7;
}
#page-performance .btn-outline {
  background: #fff;
  color: #4f6ef7;
  border-color: #4f6ef7;
}
#page-performance .btn-outline:hover {
  background: #f0f4ff;
}
#page-performance .btn-sm {
  padding: 5px 12px;
  font-size: 12px;
}

/* 空状态 */
#page-performance .empty-state {
  text-align: center;
  padding: 40px;
  color: #999;
  font-size: 14px;
}

/* ===== Toast 通知 ===== */
.perf-toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  padding: 10px 24px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: #fff;
  background: #1a1a2e;
  z-index: 99999;
  opacity: 0;
  transition: opacity 0.25s, transform 0.25s;
  white-space: nowrap;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}
.perf-toast.perf-toast-show { opacity: 1; transform: translateX(-50%) translateY(0); }
.perf-toast.perf-toast-error   { background: #dc2626; }
.perf-toast.perf-toast-warn    { background: #d97706; }
.perf-toast.perf-toast-info    { background: #2563eb; }
.perf-toast.perf-toast-success { background: #16a34a; }

/* ===== 内联确认弹窗 ===== */
.perf-confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 99998;
  display: flex;
  align-items: center;
  justify-content: center;
}
.perf-confirm-box {
  background: #fff;
  border-radius: 12px;
  padding: 28px 32px;
  max-width: 380px;
  width: 90%;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
}
.perf-confirm-msg {
  font-size: 15px;
  color: #1a1a2e;
  margin-bottom: 24px;
  line-height: 1.6;
}
.perf-confirm-btns {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

/* ===== 提成卡片改造 ===== */
#page-performance .commission-main {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  flex-wrap: wrap;
}
#page-performance .commission-breakdown {
  background: rgba(255,255,255,0.15);
  border-radius: 8px;
  padding: 10px 16px;
  min-width: 200px;
}
#page-performance .breakdown-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  opacity: 0.9;
  padding: 3px 0;
  gap: 20px;
}
#page-performance .breakdown-key {
  font-weight: 700;
  opacity: 1;
  border-top: 1px solid rgba(255,255,255,0.3);
  margin-top: 4px;
  padding-top: 6px;
}

/* ===== 业绩卡片目标进度 ===== */
#page-performance .perf-target-row {
  font-size: 11px;
  color: #6b7280;
  margin-top: 6px;
}
#page-performance .perf-pct {
  font-size: 11px;
  color: #374151;
  font-weight: 500;
}
#page-performance .progress-bar {
  height: 5px;
  background: #e5e7eb;
  border-radius: 3px;
  overflow: hidden;
}
#page-performance .progress-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.4s;
}
#page-performance .progress-fill.green  { background: #16a34a; }
#page-performance .progress-fill.yellow { background: #d97706; }
#page-performance .progress-fill.red    { background: #dc2626; }

/* ===== 趋势高亮 ===== */
#page-performance .trend-active {
  background: #eef2ff;
  border: 1px solid #c7d2fe;
}
#page-performance .trend-active .trend-val { color: #4f46e5; }

/* ===== 批量分配工具栏 ===== */
#page-performance .batch-assign-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 14px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 6px;
  margin-bottom: 14px;
  font-size: 13px;
  color: #1e40af;
}

/* ===== 核算配置页 ===== */
#page-performance .config-section-title {
  font-size: 15px;
  font-weight: 600;
  color: #1a1a2e;
  margin: 0 0 6px;
  padding-bottom: 8px;
  border-bottom: 2px solid #e5e7eb;
}
#page-performance .config-desc {
  font-size: 13px;
  color: #6b7280;
  margin: 0;
  line-height: 1.6;
}

/* ===== 目标管理追踪页新样式 ===== */

/* 月份区块 */
#page-targets .tracking-period-block {
  background: #fff;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  padding: 16px 20px 20px;
  margin-bottom: 20px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}
#page-targets .tracking-period-block.period-current {
  border-color: #c7d2fe;
  background: #fafbff;
}
#page-targets .tracking-period-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
#page-targets .tracking-period-label {
  font-size: 16px;
  font-weight: 700;
  color: #1a1a2e;
  border-left: 3px solid #4f6ef7;
  padding-left: 10px;
}
#page-targets .tracking-time-hint {
  font-size: 12px;
  color: #6b7280;
  background: #f3f4f6;
  padding: 2px 10px;
  border-radius: 20px;
}

/* 追踪卡片 */
#page-targets .tracking-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}
#page-targets .tracking-card {
  background: #f8fafc;
  border-radius: 10px;
  padding: 14px 14px 12px;
  border: 1px solid #f0f0f0;
  transition: box-shadow 0.2s;
}
#page-targets .tracking-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.07); }
#page-targets .tracking-card h4 { font-size: 12px; color: #6b7280; margin: 0 0 6px; font-weight: 500; }
#page-targets .tracking-card-gold { background: linear-gradient(135deg,#fefce8,#fef9c3); border-color: #fbbf24; }

/* 大字 % */
#page-targets .tracking-pct-big { font-size: 28px; font-weight: 700; color: #1a1a2e; line-height: 1.1; margin-bottom: 4px; }
#page-targets .tracking-card-gold .tracking-pct-big { color: #b45309; }

/* 实际/目标数字 */
#page-targets .tracking-nums { font-size: 12px; color: #6b7280; margin-bottom: 8px; line-height: 1.6; }
#page-targets .tracking-nums strong { color: #1a1a2e; }

/* 应达行 */
#page-targets .tracking-expected-row { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; flex-wrap: wrap; gap: 4px; }
#page-targets .tracking-expected-val { font-size: 11px; color: #6b7280; }

/* 超额徽章 */
#page-targets .tracking-over-badge { margin-top: 8px; font-size: 11px; font-weight: 600; color: #92400e; background: #fef3c7; border-radius: 4px; padding: 2px 6px; display: inline-block; }

/* 进度条：超额标记 */
#page-targets .progress-over-mark { position: absolute; right: 0; top: -3px; width: 2px; height: 11px; background: #f59e0b; border-radius: 1px; z-index: 1; }
#page-targets .progress-fill.gold { background: linear-gradient(90deg,#f59e0b,#fbbf24); }

/* 状态标签 */
.target-badge { display: inline-block; font-size: 10px; font-weight: 600; padding: 1px 7px; border-radius: 10px; white-space: nowrap; }
.target-badge.badge-gold   { background: #fef3c7; color: #92400e; }
.target-badge.badge-green  { background: #dcfce7; color: #15803d; }
.target-badge.badge-yellow { background: #fef9c3; color: #b45309; }
.target-badge.badge-red    { background: #fee2e2; color: #b91c1c; }

/* 部门追踪卡 */
#page-targets .dept-tracking-card { background: #fff; border-radius: 10px; border: 1px solid #f0f0f0; padding: 16px; margin-bottom: 14px; }
#page-targets .dept-tracking-name { font-size: 14px; font-weight: 600; color: #1a1a2e; margin-bottom: 12px; }

/* 分区标题 */
#page-targets .tracking-section-title { font-size: 15px; font-weight: 700; color: #1a1a2e; border-left: 3px solid #4f6ef7; padding-left: 10px; margin: 28px 0 14px; }

/* 个人排行表 */
#page-targets .person-rank-wrap { overflow-x: auto; border-radius: 10px; border: 1px solid #e5e7eb; }
#page-targets .person-rank-table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 680px; }
#page-targets .person-rank-table th { background: #f8fafc; padding: 10px 12px; text-align: left; font-weight: 600; color: #555; border-bottom: 2px solid #e5e7eb; }
#page-targets .person-rank-table td { padding: 10px 12px; border-bottom: 1px solid #f0f0f0; }
#page-targets .person-rank-table tr:last-child td { border-bottom: none; }
#page-targets .rank-cell { font-size: 16px; text-align: center; min-width: 36px; }
#page-targets .rank-row-gold td { background: #fefce8; }
#page-targets .person-rank-table tr:hover td { background: #f8fafc; }
#page-targets .rank-row-gold:hover td { background: #fef9c3; }

/* 部门合计提示 */
#page-targets .dept-sum-hint { padding: 8px 14px; border-radius: 8px; background: #f8fafc; font-size: 13px; margin-bottom: 12px; border: 1px solid #e5e7eb; min-height: 36px; line-height: 1.6; }

