/* =====================================================
   피팅 고객 상담일지 모달 스타일
   카엔쿠로골프 피팅센터 CRM
===================================================== */

/* ── 고객 검색 드롭다운 출처 배지 ── */
.consult-src-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 10px;
  white-space: nowrap;
  vertical-align: middle;
}
.consult-src-badge.src-db   { background:#dcfce7; color:#1a6b3c; border:1px solid #86efac; }
.consult-src-badge.src-appt { background:#dbeafe; color:#1e40af; border:1px solid #93c5fd; }
.consult-src-badge.src-inf  { background:#ede9fe; color:#7c3aed; border:1px solid #c4b5fd; }

/* ── 통합 검색 드롭다운 ── */
.consult-dd-empty {
  padding: 12px 16px;
  font-size: 12px;
  color: var(--text-light);
  display: flex;
  align-items: center;
  gap: 6px;
}

.consult-dd-item {
  padding: 9px 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background 0.12s;
}
.consult-dd-item:last-child { border-bottom: none; }
.consult-dd-item:hover { background: #f0fdf4; }

.consult-dd-top {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.consult-dd-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
}
.consult-dd-sub {
  font-size: 11px;
  color: var(--text-sub);
  margin-top: 2px;
}

/* ── 중복 선택 팝업 ── */
.dup-guide {
  padding: 10px 16px;
  font-size: 12px;
  color: #7c5a00;
  background: #fffde7;
  border-bottom: 1px solid #fde68a;
  display: flex;
  align-items: flex-start;
  gap: 7px;
  line-height: 1.6;
}
.dup-guide i { color: #d97706; margin-top: 2px; flex-shrink: 0; }

.dup-list {
  max-height: 380px;
  overflow-y: auto;
}

.dup-item {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.12s;
}
.dup-item:last-child { border-bottom: none; }
.dup-item:hover { background: #f0fdf4; }

.dup-item-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.dup-item-name {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-main);
}
.dup-src-label {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 12px;
  white-space: nowrap;
}

.dup-item-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.dup-item-fields span {
  font-size: 12px;
  color: var(--text-sub);
  background: #f3f4f6;
  border-radius: 6px;
  padding: 2px 8px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.dup-item-fields span i {
  font-size: 10px;
  color: var(--primary);
}

/* ── 섹션 래퍼 ── */
.cj-section {
  border-bottom: 1px solid var(--border);
  padding: 18px 24px;
}
.cj-section:last-of-type { border-bottom: none; }

/* ── 섹션 타이틀 (파란~회색 헤더) ── */
.cj-section-title {
  font-size: 14px;
  font-weight: 800;
  color: white;
  background: linear-gradient(90deg, #1a6b3c 0%, #2d9b57 100%);
  padding: 7px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 14px;
  letter-spacing: 0.03em;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ── 4열 그리드 ── */
.cj-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px 16px;
}

/* ── 개선 희망 (단일 열) ── */
.cj-improve-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ── 필드 (label + input) ── */
.cj-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: relative;
}
.cj-field.full-2 {
  grid-column: span 2;
}
.cj-field.full {
  grid-column: 1 / -1;
}

/* ── 라벨 ── */
.cj-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-sub);
  white-space: nowrap;
}
.cj-label .req {
  color: var(--danger);
  margin-left: 2px;
}

/* ── 입력 요소 공통 ── */
.cj-input {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: 'Noto Sans KR', sans-serif;
  color: var(--text-main);
  background: var(--surface);
  transition: border-color 0.15s, box-shadow 0.15s;
  box-sizing: border-box;
}
.cj-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(26,107,60,0.15);
}
.cj-input::placeholder { color: #bbb; }

textarea.cj-input {
  resize: vertical;
  min-height: 60px;
}

/* ── 라디오 그룹 (성별) ── */
.cj-radio-group {
  display: flex;
  gap: 16px;
  align-items: center;
  padding: 7px 0;
}
.cj-radio {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  user-select: none;
}
.cj-radio input[type="radio"] {
  width: 15px;
  height: 15px;
  accent-color: var(--primary);
  cursor: pointer;
}

/* ── 장비/스윙 테이블 공통 ── */
.cj-table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.cj-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  min-width: 600px;
}

.cj-table thead th {
  padding: 9px 12px;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
  border-bottom: 2px solid var(--border);
  border-right: 1px solid var(--border);
}
.cj-table thead th:last-child { border-right: none; }

.cj-th-equip {
  background: #e8f5e9;
  color: #1a6b3c;
  width: 90px;
}
.cj-th-item {
  background: #f3f4f6;
  color: var(--text-sub);
  width: 150px;
}
.cj-th-before {
  background: #fffde7;
  color: #7c5a00;
  width: 220px;
}
.cj-th-after {
  background: #e8f5e9;
  color: #1a6b3c;
  width: 220px;
}

.cj-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background 0.12s;
}
.cj-table tbody tr:hover { background: #f8fffe; }
.cj-table tbody tr:last-child { border-bottom: none; }

.cj-table tbody td {
  padding: 4px 6px;
  border-right: 1px solid var(--border);
  vertical-align: middle;
}
.cj-table tbody td:last-child { border-right: none; }

.cj-equip-name {
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
  background: #f0fdf4;
  border-right: 1px solid var(--border) !important;
  white-space: nowrap;
}

.cj-item-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-sub);
  background: #fafbfc;
  white-space: nowrap;
  padding-left: 10px !important;
}

/* ── 테이블 안 인풋/셀렉트 ── */
.cj-cell-input {
  width: 100%;
  border: none;
  outline: none;
  background: transparent;
  font-size: 12px;
  font-family: 'Noto Sans KR', sans-serif;
  color: var(--text-main);
  padding: 5px 8px;
  border-radius: 4px;
  transition: background 0.12s, box-shadow 0.12s;
  box-sizing: border-box;
}
.cj-cell-input:focus {
  background: #fff;
  box-shadow: 0 0 0 2px rgba(26,107,60,0.18);
}
.cj-cell-input::placeholder { color: #ccc; font-size: 11px; }

/* 피팅 전 셀 배경 */
.cj-table td:nth-child(3) { background: #fffef5; }
/* 피팅 후 셀 배경 */
.cj-table td:nth-child(4) { background: #f6fff8; }

/* ── 개인정보 안내 ── */
.cj-privacy {
  padding: 14px 24px;
  font-size: 11px;
  color: var(--text-light);
  line-height: 1.7;
  background: #fafbfc;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
  align-items: flex-start;
}
.cj-privacy i { color: var(--primary); margin-top: 2px; flex-shrink: 0; }

/* ── 반응형 ── */

/* 아이패드 (769~1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
  .cj-grid-4 { grid-template-columns: repeat(2, 1fr); }
  .cj-field.full-4 { grid-column: span 2; }
  .cj-section { padding: 16px 20px; }
  /* 비교 테이블: 아이패드에서 가로 스크롤 */
  .cj-compare-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .cj-compare-table { min-width: 480px; }
  /* 그룹 헤더 */
  .cg-header { padding: 12px 14px; }
  .cg-name { font-size: 14px; }
  /* 이전 방문 칩 */
  .prev-visit-chips { flex-wrap: wrap; }
}

/* 스마트폰 (768px 이하) */
@media (max-width: 768px) {
  .cj-grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
  .cj-field.full-2 { grid-column: span 2; }
  .cj-section { padding: 14px 16px; }
  /* 비교 테이블 가로 스크롤 */
  .cj-compare-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .cj-compare-table { min-width: 460px; }
  /* 이전 방문 배너 */
  .prev-visit-banner { padding: 12px 16px; }
  .prev-visit-info { flex-direction: column; align-items: flex-start; }
  /* 상담 그룹 뷰 */
  .cg-header { padding: 10px 12px; }
  .cg-avatar { width: 32px; height: 32px; font-size: 14px; }
  .cg-name { font-size: 13px; }
  .cg-meta { font-size: 11px; gap: 5px; }
  .cg-total-sale { font-size: 12px; }
  .cg-table { font-size: 11px; }
}

@media (max-width: 480px) {
  .cj-grid-4 {
    grid-template-columns: 1fr;
  }
  .cj-field.full-2 { grid-column: 1; }
  /* 그룹 헤더 버튼들 */
  .cg-header-right { gap: 6px; }
  .cg-header-right .btn-sm { font-size: 11px; padding: 4px 8px; }
}

/* =====================================================
   이전 방문 배너 스타일
===================================================== */
.prev-visit-banner {
  background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
  border-bottom: 2px solid var(--primary);
  padding: 14px 22px;
}
.prev-visit-banner-inner {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.prev-visit-info {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 13px;
  color: #166534;
}
.prev-visit-hint {
  font-size: 11px;
  color: #4b7c5f;
  background: #d1fae5;
  padding: 2px 10px;
  border-radius: 10px;
  white-space: nowrap;
}
.prev-visit-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.prev-visit-chip {
  background: #fff;
  border: 1px solid #86efac;
  color: #166534;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 11px;
  cursor: pointer;
  transition: all .15s;
  display: flex;
  align-items: center;
  gap: 5px;
}
.prev-visit-chip:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* =====================================================
   상담 고객 그룹 뷰 스타일
===================================================== */
.consult-group-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 4px 0;
}
.cg-empty {
  padding: 60px;
  text-align: center;
  color: var(--text-light);
  font-size: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.cg-empty i { font-size: 36px; opacity: .3; }

.cg-group {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: box-shadow .2s;
}
.cg-group:hover { box-shadow: 0 2px 12px rgba(0,0,0,.07); }
.cg-group.cg-open { border-color: var(--primary); }

.cg-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  cursor: pointer;
  user-select: none;
  transition: background .15s;
}
.cg-header:hover { background: #f8fffe; }

.cg-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.cg-avatar {
  width: 38px; height: 38px;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 700;
  flex-shrink: 0;
}
.cg-info { display: flex; flex-direction: column; gap: 3px; }
.cg-name { font-size: 15px; font-weight: 700; color: var(--text-main); }
.cg-meta {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  font-size: 12px; color: var(--text-sub);
}
.cg-visit-badge {
  background: #dcfce7; color: #166534;
  border: 1px solid #86efac;
  padding: 1px 8px; border-radius: 10px;
  font-weight: 700; font-size: 11px;
}

.cg-header-right {
  display: flex; align-items: center; gap: 10px;
}
.cg-total-sale {
  font-size: 14px; font-weight: 700; color: var(--primary);
}
.cg-chevron {
  transition: transform .25s;
  color: var(--text-light);
  font-size: 13px;
}

/* 방문 이력 테이블 */
.cg-history { border-top: 1px solid var(--border); }
.cg-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.cg-table th {
  background: #f8fafb;
  padding: 8px 12px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-sub);
  border-bottom: 1px solid var(--border);
}
.cg-history-row td {
  padding: 10px 12px;
  border-bottom: 1px solid #f3f4f6;
  vertical-align: middle;
}
.cg-history-row:last-child td { border-bottom: none; }
.cg-history-row:hover td { background: #f0fdf4; }
.cg-hist-idx {
  font-size: 11px; font-weight: 700;
  color: var(--primary);
  background: #dcfce7;
  padding: 2px 8px; border-radius: 10px;
  white-space: nowrap;
  display: inline-block;
}
.cg-hist-date { color: var(--text-sub); font-size: 12px; white-space: nowrap; }

