/* ---------------------------------------------------------------------------
 * IK000210_P02.xfdl 변환본 — IK 부서 선택 lookup 모달 (600x400).
 * Modal #A 28번째 인스턴스 + *lookup 카테고리* Rule of Two:
 *   - IkUserSelectModal (직원 선택) + IkDeptSelectModal (본 commit)
 *   → 공통 패턴: 그리드 표시 + 더블클릭 → row 반환 + close-only
 *
 * IkDeptMasterModal (관리 = 본 commit 이전) 와 *백엔드 endpoint 동일 + 다른 의도*:
 *   - 관리 = CRUD (저장)
 *   - 선택 = lookup (반환만)
 *
 * 디자인:
 *   - 헤더: lookup 정형색 (#2c4368)
 *   - 본문: 그리드만 (검색 인풋 없음 = 자동 조회 후 표시)
 *   - 푸터: 닫기 (선택 없이 종료)
 * --------------------------------------------------------------------------- */

#ik-dept-select-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-dept-select-modal.is-open { display: flex; }

#ik-dept-select-modal .layer-wrap {
  width: 620px;
  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-dept-select-modal .layer-header {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 2px solid #2c4368;
  background: #2c4368;
  color: #ffffff;
}
#ik-dept-select-modal .layer-title { flex: 1; font-size: 14px; font-weight: 600; margin: 0; }
#ik-dept-select-modal .layer-close {
  background: transparent; border: 0; color: #ffffff; font-size: 20px; cursor: pointer; line-height: 1;
}
#ik-dept-select-modal .layer-content {
  padding: 12px 16px;
  flex: 1;
  overflow-y: auto;
}
#ik-dept-select-modal .hint {
  font-size: 11px;
  color: #2c4368;
  margin-bottom: 6px;
  background: #f7fafe;
  border: 1px solid #d8e3f0;
  border-radius: 3px;
  padding: 6px 10px;
}

#ik-dept-select-modal .grid-shell {
  border: 1px solid #c8d3e0;
  border-radius: 3px;
  max-height: 320px;
  overflow: auto;
  background: #ffffff;
}
#ik-dept-select-modal .grid-shell table {
  width: 100%; border-collapse: collapse; font-size: 11px;
}
#ik-dept-select-modal .grid-shell th,
#ik-dept-select-modal .grid-shell td {
  padding: 5px 8px; border-bottom: 1px solid #e3e8ee; text-align: center;
}
#ik-dept-select-modal .grid-shell th {
  background: #f0f4f9; color: #344b6e; font-weight: 600; position: sticky; top: 0;
}
#ik-dept-select-modal .grid-shell tbody tr { cursor: pointer; }
#ik-dept-select-modal .grid-shell tbody tr:hover td { background: #f7fafe; }
#ik-dept-select-modal .grid-shell .empty-row { cursor: default; }
#ik-dept-select-modal .grid-shell .empty-row td {
  text-align: center; color: #888; padding: 32px 8px;
}

#ik-dept-select-modal .layer-footer {
  display: flex; justify-content: flex-end;
  padding: 10px 16px;
  border-top: 1px solid #e1e5eb;
  background: #f7f8fa;
}
#ik-dept-select-modal .btn-cancel {
  min-width: 80px; padding: 6px 12px;
  border-radius: 3px; font-size: 12px; cursor: pointer;
  border: 1px solid #c8d3e0; background: #ffffff; color: #344b6e;
}
#ik-dept-select-modal .btn-cancel:hover { background: #f0f4f9; }
