/* 공통 엑셀 다운로드 모달 — 레거시 WMS .mLayer 보강 */

.mLayer.eExcelDownLayer {
  position: fixed;
  top: 8vh;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1100;
  width: 720px;
  max-width: calc(100vw - 32px);
  max-height: 84vh;
  overflow: auto;
  background: #fff;
  border: 1px solid #1f3a64;
  border-radius: 6px;
  box-shadow: 0 18px 48px rgba(20, 30, 50, 0.32);
  padding: 0;
}

.mLayer.eExcelDownLayer > h2 {
  margin: 0;
  padding: 14px 18px;
  font-size: 16px;
  background: linear-gradient(180deg, #29457d 0%, #1f3a64 100%);
  color: #fff;
  cursor: move;
  user-select: none;
  border-radius: 6px 6px 0 0;
}
.mLayer.eExcelDownLayer > h2 small { color: #cfdef0 !important; }

.mLayer.eExcelDownLayer .wrap {
  padding: 14px 18px;
}

/* 글로벌 .mTitle { display: flex; align-items: center; justify-content: space-between } 유지.
   h3/ul 의 비대칭 margin 을 0 으로 통일 → 좌(타이틀)·우(안내문구) 가 세로 중앙에 정렬.
   .mTitle 자체에 위/아래 padding 으로 섹션 간격 유지. */
.mLayer.eExcelDownLayer .mTitle {
  margin: 14px 0 6px;
  padding: 0;
}
.mLayer.eExcelDownLayer .mTitle h3 {
  font-size: 13px;
  color: #1d2c4a;
  margin: 0;
  font-weight: 600;
  line-height: 1.4;
}
.mLayer.eExcelDownLayer .mTitle ul.gDouble {
  margin: 0;
  padding: 0 0 0 14px;
  font-size: 11px;
  color: #6c7a8e;
  line-height: 1.4;
}
.mLayer.eExcelDownLayer .mTitle ul.gDouble li { margin: 0; line-height: inherit; }

.mLayer.eExcelDownLayer .footer {
  padding: 12px 18px;
  border-top: 1px solid #e2e6ec;
  background: #f8fafc;
  text-align: center;
  border-radius: 0 0 6px 6px;
}

.mLayer.eExcelDownLayer .btnClose.eExcelClose {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 22px;
  height: 22px;
  background: rgba(255,255,255,0.16);
  border-radius: 50%;
  text-indent: -9999px;
  color: transparent;
}
.mLayer.eExcelDownLayer .btnClose.eExcelClose::before,
.mLayer.eExcelDownLayer .btnClose.eExcelClose::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 12px;
  height: 1.5px;
  background: #fff;
  transform-origin: center;
}
.mLayer.eExcelDownLayer .btnClose.eExcelClose::before { transform: translate(-50%, -50%) rotate(45deg); }
.mLayer.eExcelDownLayer .btnClose.eExcelClose::after  { transform: translate(-50%, -50%) rotate(-45deg); }
.mLayer.eExcelDownLayer .btnClose.eExcelClose:hover { background: rgba(255,255,255,0.32); }

/* 컬럼 리스트 — 로딩 안내 (fetch + render 동안 표출) */
.eExcelColList .eExcelColLoading {
  padding: 24px 12px;
  text-align: center;
  color: #6b7d99;
  font-size: 12px;
  position: relative;
}
.eExcelColList .eExcelColLoading::after {
  content: '';
  display: inline-block;
  margin-left: 6px;
  width: 10px; height: 10px;
  border: 2px solid #c8d3e3;
  border-top-color: #1f4d8a;
  border-radius: 50%;
  vertical-align: -2px;
  animation: eExcelColSpin 0.8s linear infinite;
}
@keyframes eExcelColSpin { to { transform: rotate(360deg); } }

/* 컬럼 리스트 */
.eExcelColList .eExcelColItem {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border: 1px solid #e2e6ec;
  border-radius: 4px;
  margin-bottom: 4px;
  background: #fff;
  cursor: grab;
}
.eExcelColList .eExcelColItem:hover { background: #f4f7fb; }
.eExcelColList .eExcelColItem.dragging { opacity: 0.4; }
.eExcelColList .eExcelColItem.drop-target { border-color: #1f4d8a; background: #eef4fb; }
.eExcelColList .eExcelColHandle {
  color: #aab3c1;
  font-size: 14px;
  line-height: 1;
  flex-shrink: 0;
}
.eExcelColList .eExcelColLabel { flex: 1; font-size: 13px; color: #1d2c4a; }
.eExcelColList .eExcelColId { font-size: 11px; color: #8a93a3; }

/* 백드롭 */
.mLayer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.42);
  z-index: 1090;
}

/* 옵션 슬롯 */
.eExcelOptBox table th { width: 30%; }
.eExcelOptBox table input.fText { width: 200px; }
/* 비밀번호 보호 ↔ 추가 옵션 간격 — 글로벌 mTitle 기본 18px 보다 더 넓게 (2026-06-08). */
.mLayer.eExcelDownLayer .mTitle.eExcelOptTitle { margin-top: 30px; }

/* 플래시 메시지 */
.eExcelFlash {
  margin: 10px 18px 14px;       /* 하단 여백 확보 — footer 와 분리 */
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 12px;
  display: none;
}
.eExcelFlash[data-type="ok"]  { background: #e7f4ec; color: #1c6b3f; border: 1px solid #b4dcc1; display: block; }
.eExcelFlash[data-type="err"] { background: #fdecec; color: #a93434; border: 1px solid #f3b4b4; display: block; }

/* 프리셋 삭제 버튼 — 세로 중앙 정렬 (레거시 WMS .btnNormal 의 행 정렬 보강) */
.mLayer.eExcelDownLayer .btnNormal.eExcelPresetDelete {
  display: inline-flex;
  align-items: center;
  height: 24px;
  vertical-align: middle;
}
.mLayer.eExcelDownLayer .btnNormal.eExcelPresetDelete > span {
  display: inline-flex;
  align-items: center;
  line-height: 1;
}

/* 비밀번호 토글 — 체크 시 input 노출 */
.eExcelPasswordToggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  user-select: none;
  font-size: 12px;
}
.eExcelPasswordRow.is-hidden { display: none; }
.eExcelPasswordHint {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  color: #8a93a3;
}

/* 로딩 상태 */
.eExcelGo.loading { opacity: 0.6; pointer-events: none; }

/* 컬럼 아코디언 (details/summary) */
details.eExcelColAccordion {
  margin: 14px 0 6px;
  border: 1px solid #cbd3df;
  border-radius: 4px;
  background: #fff;
}
details.eExcelColAccordion > summary {
  list-style: none;
  cursor: pointer;
  padding: 10px 14px;
  background: linear-gradient(180deg, #f7f9fc 0%, #eef2f8 100%);
  font-weight: 600;
  font-size: 13px;
  color: #1d2c4a;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 10px;
  user-select: none;
}
details.eExcelColAccordion > summary::-webkit-details-marker { display: none; }
details.eExcelColAccordion > summary::before {
  content: '▶';
  font-size: 10px;
  color: #6c7a8e;
  transition: transform 120ms;
}
details.eExcelColAccordion[open] > summary::before { transform: rotate(90deg); }
details.eExcelColAccordion[open] > summary {
  border-radius: 4px 4px 0 0;
  border-bottom: 1px solid #cbd3df;
}
.eExcelColAccTitle { flex: 0 0 auto; }
.eExcelColAccCount {
  flex: 0 0 auto;
  font-weight: 500;
  font-size: 12px;
  color: #4a5872;
  background: #fff;
  border: 1px solid #d0d8e3;
  padding: 2px 8px;
  border-radius: 999px;
}
.eExcelColAccCount em { font-style: normal; font-weight: 700; color: #1f4d8a; }
.eExcelColAccHint {
  flex: 1 1 auto;
  text-align: right;
  font-size: 11px;
  color: #8a93a3;
  font-weight: 400;
}
details.eExcelColAccordion[open] .eExcelColAccHint { display: none; }
details.eExcelColAccordion > .mBoard { margin: 8px; }

/* 비밀번호 아코디언 — 컬럼 아코디언과 동일 골격 + state pill */
details.eExcelPwAccordion {
  margin: 14px 0 6px;
  border: 1px solid #cbd3df;
  border-radius: 4px;
  background: #fff;
}
details.eExcelPwAccordion > summary {
  list-style: none;
  cursor: pointer;
  padding: 10px 14px;
  background: linear-gradient(180deg, #f7f9fc 0%, #eef2f8 100%);
  font-weight: 600;
  font-size: 13px;
  color: #1d2c4a;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 10px;
  user-select: none;
}
details.eExcelPwAccordion > summary::-webkit-details-marker { display: none; }
details.eExcelPwAccordion > summary::before {
  content: '▶';
  font-size: 10px;
  color: #6c7a8e;
  transition: transform 120ms;
}
details.eExcelPwAccordion[open] > summary::before { transform: rotate(90deg); }
details.eExcelPwAccordion[open] > summary {
  border-radius: 4px 4px 0 0;
  border-bottom: 1px solid #cbd3df;
}
details.eExcelPwAccordion[open] .eExcelColAccHint { display: none; }
details.eExcelPwAccordion > .mBoard { margin: 8px; }

/* 비밀번호 상태 pill (사용 안함 = 회색, 사용 중 = 강조) */
.eExcelPwState[data-on="1"] {
  color: #fff;
  background: #1f4d8a;
  border-color: #1f4d8a;
}
