/* ==========================================================================
 * 执行管控 v2
 * 独立模块；纯色、细边框、无投影、无渐变、无背景模糊（扁平化设计规范）。
 * 风格与 users.css / calendar.css 一致：珊瑚橙主色 + slate 中性色 + 细边框卡片。
 * ========================================================================== */

.exe-page {
  box-sizing: border-box;
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  color: var(--text);
}

/* ---------- Hero 头部 ---------- */
.exe-hero {
  box-sizing: border-box;
  width: 100%;
  padding: 20px 20px 22px;
  margin-bottom: 14px;
  border: 1px solid var(--brand-200, #fed7aa);
  border-radius: var(--r-lg, 16px);
  background: #fff7ed;
}

.exe-hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.exe-title-wrap {
  min-width: 0;
}

.exe-title {
  margin: 0;
  font-size: var(--fs-xl);
  font-weight: 750;
  color: var(--brand-600, #ea580c);
}

.exe-subtitle {
  margin-top: 4px;
  font-size: var(--fs-xs);
  color: #9a3412;
}

/* 部门选择行（复用轮休日历的下拉规范） */
.exe-scope-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.exe-dept-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 13px;
  background: #fff;
  border: 1px solid var(--brand-200, #fed7aa);
  border-radius: 999px;
  font-size: var(--fs-xs);
  font-weight: 650;
  color: var(--brand-600, #ea580c);
}

.exe-dept-tag svg {
  width: 15px;
  height: 15px;
}

.exe-select {
  height: 32px;
  padding: 0 10px;
  background: #fff;
  border: 1px solid var(--brand-200, #fed7aa);
  border-radius: 999px;
  color: var(--brand-600, #ea580c);
  font-size: var(--fs-xs);
  font-weight: 650;
  cursor: pointer;
}

/* 汇总瓦片 */
.exe-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 16px;
}

.exe-stat {
  box-sizing: border-box;
  padding: 12px 10px;
  text-align: center;
  background: #fff;
  border: 1px solid var(--brand-200, #fed7aa);
  border-radius: var(--r-md, 12px);
}

.exe-stat-num {
  font-size: 26px;
  font-weight: 800;
  line-height: 1.1;
  color: var(--brand-600, #ea580c);
}

.exe-stat-label {
  margin-top: 4px;
  font-size: var(--fs-xs);
  color: var(--text-light);
}

/* 主/次按钮（扁平） */
.exe-primary-btn,
.exe-secondary-btn {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 16px;
  border-radius: var(--r-sm);
  font-family: inherit;
  font-size: var(--fs-sm);
  font-weight: 700;
  cursor: pointer;
  transition: background var(--dur-2), border-color var(--dur-2), color var(--dur-2);
}

.exe-primary-btn {
  background: var(--brand-600, #ea580c);
  border: 1px solid var(--brand-600, #ea580c);
  color: #fff;
}

.exe-primary-btn:hover {
  background: var(--brand, #f97316);
  border-color: var(--brand, #f97316);
}

.exe-primary-btn:disabled {
  opacity: .55;
  cursor: not-allowed;
}

.exe-secondary-btn {
  background: #fff;
  border: 1px solid var(--border);
  color: var(--text);
}

.exe-secondary-btn:hover {
  border-color: var(--brand-400, #fb923c);
  color: var(--brand-600, #ea580c);
}

.exe-white-btn {
  background: #fff;
  border: 1px solid var(--brand-300, #fdba74);
  color: var(--brand-600, #ea580c);
  height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  font-family: inherit;
  font-size: var(--fs-xs);
  font-weight: 700;
  cursor: pointer;
  transition: border-color var(--dur-2), color var(--dur-2);
}

.exe-white-btn:hover {
  border-color: var(--brand-500, #f97316);
}

/* ---------- 列表 ---------- */
.exe-list-card {
  box-sizing: border-box;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--r-lg, 16px);
  background: #fff;
  overflow: hidden;
}

.exe-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--border-light, #f1f5f9);
}

.exe-list-title {
  margin: 0;
  font-size: var(--fs-base);
  font-weight: 750;
}

.exe-list-count {
  font-weight: 600;
  color: var(--text-light);
}

.exe-sort-tip {
  font-size: var(--fs-xs);
  color: var(--text-light);
}

.exe-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  box-sizing: border-box;
  padding: 12px 16px;
  border: 0;
  border-bottom: 1px solid var(--border-light, #f1f5f9);
  background: transparent;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: background var(--dur-1);
}

.exe-row:last-child {
  border-bottom: 0;
}

.exe-row:hover {
  background: #fff7ed;
}

.exe-avatar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  color: #fff;
  font-size: var(--fs-base);
  font-weight: 750;
}

.exe-info {
  flex: 1;
  min-width: 0;
}

.exe-name-line {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.exe-name {
  font-size: var(--fs-sm);
  font-weight: 700;
}

.exe-dept-chip {
  padding: 1px 8px;
  background: var(--slate-100, #f1f5f9);
  border-radius: 999px;
  font-size: var(--fs-xs);
  color: var(--slate-600, #475569);
}

.exe-role-chip {
  padding: 1px 8px;
  background: #fef3c7;
  border-radius: 999px;
  font-size: var(--fs-xs);
  color: #92400e;
}

.exe-erp {
  margin-top: 2px;
  font-size: var(--fs-xs);
  color: var(--text-light);
  word-break: break-all;
}

.exe-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.exe-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: var(--fs-xs);
  font-weight: 650;
}

.exe-badge.new {
  background: #dbeafe;
  color: #1d4ed8;
}

.exe-badge.manual-pos {
  background: #dcfce7;
  color: #15803d;
}

.exe-badge.manual-neg {
  background: #fee2e2;
  color: #b91c1c;
}

.exe-score {
  flex-shrink: 0;
  min-width: 52px;
  text-align: right;
  font-size: 20px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.exe-score.high {
  color: #16a34a;
}

.exe-score.mid {
  color: var(--brand-600, #ea580c);
}

.exe-score.low {
  color: #dc2626;
}

.exe-chevron {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  color: var(--text-light);
}

.exe-empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--text-light);
  font-size: var(--fs-sm);
}

/* ---------- 弹窗通用（mask + 卡片，扁平淡入） ---------- */
.exe-mask {
  position: fixed;
  inset: 0;
  z-index: 320;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(15, 23, 42, .45);
  opacity: 0;
  transition: opacity .18s ease;
}

.exe-mask.is-open {
  display: flex;
  opacity: 1;
}

.exe-modal {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  width: min(560px, 100%);
  max-height: min(78vh, 640px);
  background: #fff;
  border-radius: var(--r-lg, 16px);
  overflow: hidden;
  transform: translateY(14px) scale(.98);
  transition: transform .2s ease;
}

.exe-mask.is-open .exe-modal {
  transform: translateY(0) scale(1);
}

.exe-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px 12px;
  border-bottom: 1px solid var(--border-light, #f1f5f9);
}

.exe-modal-title {
  margin: 0;
  font-size: var(--fs-lg, 17px);
  font-weight: 750;
}

.exe-modal-sub {
  margin-top: 3px;
  font-size: var(--fs-xs);
  color: var(--text-light);
  word-break: break-all;
}

.exe-close-btn {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: #fff;
  color: var(--text-light);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  transition: color var(--dur-1), border-color var(--dur-1);
}

.exe-close-btn:hover {
  color: var(--brand-600, #ea580c);
  border-color: var(--brand-400, #fb923c);
}

.exe-modal-body {
  flex: 1;
  min-height: 0;
  box-sizing: border-box;
  padding: 14px 18px 18px;
  overflow-y: auto;
}

/* ---------- 明细弹窗 ---------- */
.exe-breakdown {
  margin-bottom: 16px;
  border: 1px solid var(--border-light, #f1f5f9);
  border-radius: var(--r-md, 12px);
  overflow: hidden;
}

.exe-bd-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 13px;
  font-size: var(--fs-sm);
  border-bottom: 1px solid var(--border-light, #f1f5f9);
}

.exe-bd-row:last-child {
  border-bottom: 0;
}

.exe-bd-val {
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}

.exe-bd-val.pos {
  color: #16a34a;
}

.exe-bd-val.neg {
  color: #dc2626;
}

.exe-bd-row.highlight {
  background: #eff6ff;
  color: #1d4ed8;
}

.exe-bd-row.total {
  background: #fff7ed;
  font-weight: 800;
  color: var(--brand-600, #ea580c);
}

.exe-section-title {
  margin: 14px 0 8px;
  font-size: var(--fs-sm);
  font-weight: 750;
  color: var(--text-light);
}

.exe-record {
  box-sizing: border-box;
  padding: 10px 12px;
  margin-bottom: 8px;
  border: 1px solid var(--border-light, #f1f5f9);
  border-radius: var(--r-md, 12px);
}

.exe-record-main {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.exe-record-title {
  font-size: var(--fs-sm);
  font-weight: 650;
}

.exe-record-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 4px;
  font-size: var(--fs-xs);
  color: var(--text-light);
}

.exe-rec-status {
  padding: 1px 7px;
  border-radius: 999px;
  font-weight: 650;
}

.exe-rec-status.done {
  background: #dcfce7;
  color: #15803d;
}

.exe-rec-status.failed {
  background: #fee2e2;
  color: #b91c1c;
}

.exe-rec-status.overdue {
  background: #fef3c7;
  color: #b45309;
}

.exe-rec-decay,
.exe-rec-bonus {
  color: #1d4ed8;
  background: #dbeafe;
  padding: 1px 7px;
  border-radius: 999px;
}

.exe-record-points {
  flex-shrink: 0;
  font-size: var(--fs-sm);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.exe-record-points.pos {
  color: #16a34a;
}

.exe-record-points.neg {
  color: #dc2626;
}

.exe-manual-record {
  margin-top: 14px;
  padding: 11px 13px;
  border: 1px dashed var(--brand-300, #fdba74);
  border-radius: var(--r-md, 12px);
  background: #fffaf5;
}

.exe-record-reason {
  margin-top: 5px;
  font-size: var(--fs-xs);
  color: var(--text-light);
}

/* ---------- 人工调整弹窗 ---------- */
.exe-form-group {
  margin-bottom: 13px;
}

.exe-form-label {
  display: block;
  margin-bottom: 6px;
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--text);
}

.exe-form-hint {
  font-weight: 400;
  color: var(--text-light);
}

.exe-textarea,
.exe-input {
  box-sizing: border-box;
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: #fff;
  color: var(--text);
  font-family: inherit;
  font-size: var(--fs-sm);
  line-height: 1.55;
  resize: vertical;
}

.exe-textarea {
  min-height: 84px;
}

.exe-textarea:focus,
.exe-input:focus {
  outline: none;
  border-color: var(--brand-400, #fb923c);
}

.exe-form-actions {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}

.exe-form-actions .exe-primary-btn {
  flex: 1;
}

.exe-form-actions .exe-secondary-btn {
  flex: 1;
}

.exe-error-tip {
  margin: 10px 0 0;
  font-size: var(--fs-xs);
  color: #dc2626;
  white-space: pre-wrap;
}

/* ---------- 移动端 ---------- */
@media (max-width: 640px) {
  .exe-hero {
    padding: 16px 14px 18px;
    border-radius: 14px;
  }

  .exe-summary {
    gap: 8px;
  }

  .exe-stat-num {
    font-size: 22px;
  }

  .exe-row {
    padding: 11px 13px;
    gap: 10px;
  }

  .exe-avatar {
    width: 34px;
    height: 34px;
  }

  .exe-score {
    min-width: 44px;
    font-size: 18px;
  }

  .exe-modal {
    max-height: 86vh;
    border-radius: 14px;
  }
}
