/* ---------------------------------------------------------------------------
 * IK000120_P01.xfdl 변환본 — IK 인센티브 세부 내역 모달.
 * Modal #A 25번째 인스턴스 + *표시 카테고리* 5번째 사례.
 *
 * IK000110_P01 (ik-rebate-detail-modal) 와 *형상 매우 유사 + 마지막 그리드 형 다름* (Rule of Two):
 *   리베이트 상세 = 3 그리드 모두 (이름/금액)
 *   *본 commit (인센티브 상세)* = 매출/특별인센 (이름/금액) + 패널티 (이름/율)
 *   → 추출 보류: 마지막 그리드의 *amt vs rate* 차이 + 도메인 분리 의도
 *
 * 디자인:
 *   - 헤더: 표시 정형색 (#2c4368)
 *   - 본문: 컨텍스트 요약 1줄 + 3 섹션 (매출/특별인센/패널티)
 *   - 푸터: 확인 단일
 *   - 사이즈: 480x540 (IK000110_P01 와 동일 — 같은 시각 정합성)
 *
 * 패널티 섹션 = *주황색 강조* (#fff8e6 + #b65a00) — 매출/특별인센 (긍정) 과 *시각 분리*
 * --------------------------------------------------------------------------- */

#ik-incentive-detail-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(0, 0, 0, 0.45);
  align-items: center;
  justify-content: center;
  font-family: 'Pretendard', 'Malgun Gothic', sans-serif;
}
#ik-incentive-detail-modal.is-open { display: flex; }

#ik-incentive-detail-modal .layer-wrap {
  width: 480px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 32px);
  background: #ffffff;
  border-radius: 6px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
#ik-incentive-detail-modal .layer-header {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 2px solid #2c4368;
  background: #2c4368;
  color: #ffffff;
}
#ik-incentive-detail-modal .layer-title {
  flex: 1;
  font-size: 14px;
  font-weight: 600;
  margin: 0;
}
#ik-incentive-detail-modal .layer-close {
  background: transparent;
  border: 0;
  color: #ffffff;
  font-size: 20px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

#ik-incentive-detail-modal .layer-content {
  padding: 12px 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
}

#ik-incentive-detail-modal .context-bar {
  background: #f7fafe;
  border: 1px solid #d8e3f0;
  border-radius: 4px;
  padding: 8px 12px;
  font-size: 12px;
  color: #2c4368;
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}
#ik-incentive-detail-modal .context-bar > span > strong {
  font-weight: 600;
  margin-left: 4px;
}

#ik-incentive-detail-modal .section { display: flex; flex-direction: column; }
#ik-incentive-detail-modal .section-title {
  font-size: 13px;
  font-weight: 600;
  color: #2c4368;
  margin: 0 0 4px;
  padding-left: 6px;
  border-left: 3px solid #2c4368;
}
/* 패널티 섹션 = 주황 강조 — 도메인 의미상 *부정적 메트릭* */
#ik-incentive-detail-modal .section.penalty .section-title {
  color: #b65a00;
  border-left-color: #b65a00;
}
#ik-incentive-detail-modal .grid-shell {
  border: 1px solid #c8d3e0;
  border-radius: 3px;
  overflow: hidden;
}
#ik-incentive-detail-modal .grid-shell table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
#ik-incentive-detail-modal .grid-shell th,
#ik-incentive-detail-modal .grid-shell td {
  padding: 6px 8px;
  border-bottom: 1px solid #e3e8ee;
  text-align: right;
}
#ik-incentive-detail-modal .grid-shell th {
  background: #f0f4f9;
  color: #344b6e;
  font-weight: 600;
  text-align: center;
  border-bottom: 1px solid #c8d3e0;
}
#ik-incentive-detail-modal .section.penalty .grid-shell th {
  background: #fff8e6;
  color: #b65a00;
}
#ik-incentive-detail-modal .grid-shell th:first-child,
#ik-incentive-detail-modal .grid-shell td:first-child {
  text-align: left;
}
#ik-incentive-detail-modal .grid-shell tr:last-child td { border-bottom: 0; }
#ik-incentive-detail-modal .grid-shell .empty-row td {
  text-align: center;
  color: #888;
  padding: 16px 8px;
}
#ik-incentive-detail-modal .grid-shell .total-row td {
  background: #fff8e6;
  font-weight: 600;
  color: #b65a00;
  border-top: 1px solid #f0d68a;
}

#ik-incentive-detail-modal .layer-footer {
  display: flex;
  justify-content: center;
  padding: 10px 16px;
  border-top: 1px solid #e1e5eb;
  background: #f7f8fa;
}
#ik-incentive-detail-modal .btn {
  min-width: 80px;
  padding: 6px 16px;
  border-radius: 3px;
  font-size: 12px;
  cursor: pointer;
  border: 1px solid #2c4368;
  background: #2c4368;
  color: #ffffff;
}
#ik-incentive-detail-modal .btn:hover { background: #1f314c; }
