/* ---------------------------------------------------------------------------
 * IK000111 + IK000111_T01 변환본 — 판매장려금 기준 관리 (5탭 wrapper).
 *
 * 신규 패턴: *Tab UI 첫 도입* — .tab-headers + .tab-panel 의 CSS class 기반
 * 활성 전환. 향후 다른 탭 화면 (IK000111_T02-T05, 다른 도메인의 탭 화면) 도
 * 동일 CSS 클래스 패턴을 재사용 가능하도록 *generic 디자인*.
 * --------------------------------------------------------------------------- */

.ik-rebate-code-master-fragment .page-head {
  margin-bottom: 8px;
}

/* ===== Tab UI (generic — 향후 재사용) ===== */
.tab-headers {
  display: flex;
  gap: 2px;
  border-bottom: 2px solid #2c4368;
  margin-bottom: 12px;
}
.tab-header {
  background: #f0f2f5;
  border: 1px solid #d0d5dc;
  border-bottom: 0;
  padding: 8px 16px;
  font-size: 13px;
  color: #555;
  cursor: pointer;
  border-radius: 4px 4px 0 0;
  font-weight: 500;
}
.tab-header:hover { background: #e3e8ee; }
.tab-header.active {
  background: #2c4368;
  color: #ffffff;
  border-color: #2c4368;
  font-weight: 600;
}
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.tab-placeholder {
  padding: 60px 20px;
  text-align: center;
  color: #888;
  background: #fafbfc;
  border: 1px dashed #d0d5dc;
  border-radius: 4px;
  font-size: 13px;
}

/* ===== T01 검색/그리드 ===== */
.ik-rebate-code-master-fragment .conditions {
  margin-bottom: 8px;
}
.ik-rebate-code-master-fragment .result-box {
  background: #ffffff;
}
.ik-rebate-code-master-fragment .result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0 8px;
}
.ik-rebate-code-master-fragment .result-head h3 {
  font-size: 14px;
  margin: 0;
  color: #2c4368;
  font-weight: 600;
}
.ik-rebate-code-master-fragment .result-head .count {
  font-size: 12px;
  color: #777;
  margin-left: 8px;
  font-weight: 400;
}
.ik-rebate-code-master-fragment .btn-area { display: flex; gap: 4px; }
.ik-rebate-code-master-fragment .admin-grid {
  border: 1px solid #d0d5dc;
  min-height: 360px;
}

/* ===== CODE_MASTER 모드 (read-only) — 모달 호출 시 ===== */
.ik-rebate-code-master-fragment[data-mode="code-master"] .ik-rebate-code-master-t01-add,
.ik-rebate-code-master-fragment[data-mode="code-master"] .ik-rebate-code-master-t01-del,
.ik-rebate-code-master-fragment[data-mode="code-master"] .ik-rebate-code-master-t01-save,
.ik-rebate-code-master-fragment[data-mode="code-master"] .ik-rebate-code-master-t01-excel-up {
  display: none;
}

/* ===== 모달 wrapper (IkRebateCodeMasterTabModal) ===== */
#ik-rebate-code-master-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-rebate-code-master-modal.is-open { display: flex; }
#ik-rebate-code-master-modal .layer-wrap {
  width: 820px;
  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-rebate-code-master-modal .layer-header {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 2px solid #2c4368;
  background: #2c4368;
  color: #ffffff;
}
#ik-rebate-code-master-modal .layer-title {
  flex: 1;
  font-size: 14px;
  font-weight: 600;
  margin: 0;
}
#ik-rebate-code-master-modal .layer-close {
  background: transparent;
  border: 0;
  color: #ffffff;
  font-size: 20px;
  cursor: pointer;
  line-height: 1;
}
#ik-rebate-code-master-modal .layer-content {
  padding: 12px 16px;
  flex: 1;
  overflow-y: auto;
}
#ik-rebate-code-master-modal .layer-footer {
  display: flex;
  justify-content: center;
  padding: 10px 16px;
  border-top: 1px solid #e1e5eb;
  background: #f7f8fa;
}
#ik-rebate-code-master-modal .btn-confirm {
  min-width: 80px;
  padding: 6px 16px;
  border-radius: 3px;
  font-size: 12px;
  cursor: pointer;
  border: 1px solid #2c4368;
  background: #2c4368;
  color: #ffffff;
}
