/*
 * 광고캠페인관리 모달 (.adcm-* + 구 인라인 스타일 이관)  2026-08-22 A-4 개편
 * 소비처: 광고매니저 이관 모달 · 광고캠페인 등록/설정 모달 · 유입경로 자식모달 5종.
 * ⚠유입경로 모달 내부(.adc-inflow-* / .adc-ct-warning)와 유입경로 섹션 카드(.adc-inflow-card)는
 *   JS·turbo 계약이 걸린 기존 클래스 — 이름 유지, 여기서 톤만 A-4 로 재정의한다.
 *   (구 _adc_inflow_modal_styles 파셜·inflow_section 인라인 <style> 을 이 파일로 이관 — 규칙 1)
 */

/* ── 모달 본문 공통 ── */
.adcm-body { padding: 16px; background: #f6f9fc; container-type: inline-size; text-align: left; color: #374151; }

/* ── 섹션 카드 — 헤더 밴드 + 본문 ── */
.adcm-sec { background: #fff; border: 1px solid #dbe6f0; border-radius: 10px; overflow: hidden; }
.adcm-sec + .adcm-sec { margin-top: 10px; }
.adcm-sec-title {
  font-size: 12px;
  font-weight: 700;
  color: #3e6187;
  margin: 0;
  padding: 8px 14px;
  background: #f3f7fb;
  border-bottom: 1px solid #e4edf5;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.adcm-sec-meta { font-size: 10.5px; font-weight: 400; color: #94a3b8; }
.adcm-sec-right { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; }
.adcm-sec-bd { padding: 12px 14px; }

/* ── 마스터/상태 카드 ── */
.adcm-master { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; background: #fbfdfe; border: 1px solid #e4edf5; border-radius: 9px; }
.adcm-master-title { font-size: 12.5px; font-weight: 700; color: #1e293b; margin-bottom: 2px; }
.adcm-master-desc { font-size: 10.5px; color: #94a3b8; line-height: 1.5; }

/* ── 안내/입력 공통 ── */
.adcm-info { font-size: 11.5px; color: #64748b; background: #f8fbfd; border: 1px solid #e4edf5; border-radius: 8px; padding: 9px 11px; line-height: 1.6; margin-bottom: 10px; }
.adcm-info b, .adcm-info strong { color: #3e6187; }
.adcm-label { display: block; font-size: 12px; font-weight: 600; color: #374151; margin-bottom: 6px; }
.adcm-input, .adcm-select, .adcm-textarea { width: 100%; padding: 8px 11px; border: 1px solid #cbd5e1; border-radius: 8px; font-size: 13px; box-sizing: border-box; background: #fff; color: #111827; font-family: inherit; }
.adcm-textarea { resize: vertical; }
.adcm-input:focus, .adcm-select:focus, .adcm-textarea:focus { outline: none; border-color: #3e6187; box-shadow: 0 0 0 3px #3e618722; }
.adcm-input:disabled, .adcm-select:disabled, .adcm-textarea:disabled { background: #f8fafc; color: #94a3b8; }

/* ── 배지 ── */
.adcm-badge { display: inline-block; font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 8px; white-space: nowrap; }
.adcm-badge.is-active { background: #ecfdf5; color: #059669; border: 1px solid #a7f3d0; }
.adcm-badge.is-red { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.adcm-badge.is-warn { background: #fffbeb; color: #b45309; border: 1px solid #fde68a; }
.adcm-badge.is-third { background: #f3e8ff; color: #7c3aed; border: 1px solid #ddd6fe; }

/* ── 이관 표 ── */
.adcm-table-scroll { overflow-x: auto; }
.adcm-table { width: 100%; border-collapse: collapse; font-size: 11.5px; }
.adcm-table th { text-align: left; font-size: 10.5px; color: #8aa2b8; font-weight: 700; padding: 6px 9px; border-bottom: 1px solid #e4edf5; white-space: nowrap; }
.adcm-table td { padding: 8px 9px; border-bottom: 1px solid #f1f6fa; color: #374151; white-space: nowrap; }
.adcm-table tbody tr:hover td { background: #f8fbfd; }
.adcm-btn { padding: 5px 14px; border: none; border-radius: 7px; background: #3e6187; color: #fff; font-size: 11.5px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.adcm-btn:hover { background: #355475; }

/* ── 이력 행 ── */
.adcm-hrow { padding: 9px 12px; border: 1px solid #eef4f9; border-radius: 9px; margin-bottom: 6px; background: #fff; }
.adcm-hrow:last-child { margin-bottom: 0; }
.adcm-hrow-top { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 3px; font-size: 11px; flex-wrap: wrap; }
.adcm-hrow-who { font-weight: 700; color: #3e6187; }
.adcm-hrow-when { color: #94a3b8; }
.adcm-hrow-msg { font-size: 12px; color: #374151; line-height: 1.55; }

/* ============================================================
   유입경로 선택 섹션 (adc-inflow-* — 구 inflow_section 인라인 <style> 이관, 클래스 계약 유지)
   ============================================================ */
.adc-inflow-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.adc-inflow-grid.locked .adc-inflow-card { pointer-events: none; opacity: 0.55; cursor: not-allowed; }
.adc-inflow-grid.locked .adc-inflow-card.selected { opacity: 1; }
/* 잠금 상태의 선택 카드 = 확인 열람 가능(2026-08-18) — 클릭을 다시 살리고 커서로 알린다 */
.adc-inflow-grid.locked .adc-inflow-card.viewable { pointer-events: auto; cursor: pointer; }
.adc-inflow-card {
  position: relative;
  padding: 14px 10px 12px;
  border: 2px solid #e4edf5;
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  transition: border-color 0.15s, background 0.15s, transform 0.1s, box-shadow 0.15s;
}
.adc-inflow-card:hover:not(.selected) { border-color: #9db7cf; background: #f8fbfd; transform: translateY(-1px); box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05); }
.adc-inflow-card:active { transform: translateY(0); }
.adc-inflow-card.selected { border-color: #3e6187; background: #eef4f9; box-shadow: 0 0 0 3px #3e618715; }
.adc-inflow-card.selected.configured { border-color: #10b981; background: #f0fdf4; box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1); }
.adc-inflow-card-icon { width: 36px; height: 36px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; }
.adc-inflow-card-label { font-size: 12.5px; font-weight: 700; color: #1e293b; }
.adc-inflow-card-desc { font-size: 10px; color: #94a3b8; line-height: 1.3; }
.adc-inflow-card-badge { position: absolute; top: 6px; right: 6px; font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 10px; display: inline-flex; align-items: center; gap: 3px; }
.adc-inflow-card-badge.ok { background: #d1fae5; color: #065f46; }
.adc-inflow-card-badge.warn { background: #fef3c7; color: #92400e; }
.adc-inflow-summary { margin-top: 10px; padding: 9px 13px; background: #ecfdf5; border: 1px solid #a7f3d0; border-radius: 9px; display: flex; align-items: center; gap: 8px; font-size: 12px; color: #065f46; }
.adc-inflow-summary.warn { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.adc-inflow-summary span { flex: 1; min-width: 0; }
.adc-inflow-summary-edit { padding: 4px 11px; background: #fff; border: 1px solid #86efac; border-radius: 7px; font-size: 11px; font-weight: 700; color: #047857; cursor: pointer; white-space: nowrap; }
.adc-inflow-summary-edit:hover { background: #f0fdf4; }
@media (max-width: 640px) { .adc-inflow-grid { grid-template-columns: repeat(2, 1fr); } }

/* ============================================================
   유입경로 자식모달 (adc-inflow-* — 구 _adc_inflow_modal_styles 파셜 이관, 클래스 계약 유지)
   A-4: 본문 배경 + 히어로 헤더 + 필드 카드 + 차콜블루 포커스
   ============================================================ */
.adc-inflow-body { padding: 16px; background: #f6f9fc; display: flex; flex-direction: column; gap: 10px; }
.adc-inflow-header { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; background: #fbfdfe; border: 1px solid #e4edf5; border-radius: 10px; }
.adc-inflow-icon { width: 38px; height: 38px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.adc-inflow-title { font-size: 13.5px; font-weight: 700; color: #1e293b; margin-bottom: 3px; }
.adc-inflow-desc { font-size: 11.5px; color: #94a3b8; line-height: 1.55; }
.adc-inflow-field { display: flex; flex-direction: column; gap: 6px; background: #fff; border: 1px solid #dbe6f0; border-radius: 10px; padding: 12px 14px; }
.adc-inflow-label { font-size: 12px; font-weight: 700; color: #3e6187; }
.adc-inflow-required { color: #dc2626; margin-left: 2px; }
.adc-inflow-select, .adc-inflow-input {
  width: 100%; padding: 9px 11px; border: 1px solid #cbd5e1; border-radius: 8px;
  font-size: 13px; background: #fff; color: #111827; box-sizing: border-box; transition: border-color 0.15s, box-shadow 0.15s;
}
.adc-inflow-select:focus, .adc-inflow-input:focus { outline: none; border-color: #3e6187; box-shadow: 0 0 0 3px #3e618722; }
.adc-inflow-hint { margin: 2px 0 0; font-size: 11px; color: #94a3b8; line-height: 1.4; }
.adc-inflow-note { padding: 9px 11px; background: #f8fbfd; border: 1px solid #e4edf5; border-radius: 8px; font-size: 11px; color: #64748b; line-height: 1.55; display: flex; gap: 8px; align-items: flex-start; }
.adc-inflow-note svg { flex-shrink: 0; margin-top: 1px; }
.adc-inflow-placeholder { padding: 32px 20px; text-align: center; color: #9ca3af; font-size: 13px; background: #fbfdfe; border: 1px dashed #dbe6f0; border-radius: 10px; }

/* 동의서 연동 책임 고지 — 체크 시 빨강→초록 (기존 동작·클래스 유지) */
.adc-ct-warning { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; background: #fef2f2; border: 1px solid #fecaca; border-radius: 10px; cursor: pointer; transition: border-color 0.15s, background 0.15s; }
.adc-ct-warning:hover { border-color: #f87171; }
.adc-ct-warning.checked { background: #ecfdf5; border-color: #a7f3d0; }
.adc-ct-warning input[type="checkbox"] { width: 18px; height: 18px; accent-color: #dc2626; flex-shrink: 0; margin-top: 1px; cursor: pointer; }
.adc-ct-warning.checked input[type="checkbox"] { accent-color: #059669; }
.adc-ct-warning-content { flex: 1; min-width: 0; }
.adc-ct-warning-title { font-size: 13px; font-weight: 700; color: #b91c1c; display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.adc-ct-warning.checked .adc-ct-warning-title { color: #065f46; }
.adc-ct-warning-desc { font-size: 11.5px; color: #7f1d1d; line-height: 1.55; }
.adc-ct-warning.checked .adc-ct-warning-desc { color: #065f46; }
/* 공유(대행사) 동의서 선택 시 안내 — 라벨 밖(클릭해도 체크 토글 안 됨) */
.adc-ct-shared-note { display: none; margin-top: 8px; padding: 9px 11px; background: #faf5ff; border: 1px solid #d8b4fe; border-radius: 8px; font-size: 11.5px; color: #5b21b6; line-height: 1.65; }

/* ── 통계탭 프리셋 (구 인라인 <style> 이관 — 클래스 계약 유지, 차콜블루 톤) ── */
.adc-preset-btn { font-size: 11px; color: #64748b; cursor: pointer; padding: 3px 10px; border: 1px solid #dbe6f0; border-radius: 6px; background: #fff; transition: all 0.15s; user-select: none; white-space: nowrap; }
.adc-preset-btn:hover { background: #f3f7fb; border-color: #9db7cf; color: #3e6187; }
.adc-preset-btn.adc-active { background: #3e6187; border-color: #3e6187; color: #fff; font-weight: 700; }
.adc-funnel-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 16px; }
.adc-funnel-cells { display: grid; grid-template-columns: repeat(3, 1fr); }
.adc-funnel-cells-4 { grid-template-columns: repeat(4, 1fr); }
.adc-funnel-cells > div + div { border-left: 1px solid #f1f5f9; }
@media (max-width: 900px) { .adc-funnel-grid { grid-template-columns: 1fr; } }
