/* ========================================
   CSS 변수 정의 (색상 테마)
   ======================================== */
:root {
  /* 라이트 모드 색상 */
  --bg-primary: #f5f7fa;
  --bg-secondary: #fff;
  --bg-header: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --text-primary: #333;
  --text-secondary: #666;
  --text-light: #999;
  --border-color: #e0e0e0;
  --border-light: #eee;
  
  /* 공통 액센트 색상 */
  --primary-color: #2563eb;
  --primary-hover: #1d4ed8;
  --danger-color: #e74c3c;
  --danger-hover: #c0392b;
  --success-color: #27ae60;
  --warning-color: #f39c12;
  
  /* 그림자 */
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.15);
  --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.2);
  --shadow-focus: 0 0 0 2px rgba(37, 99, 235, 0.2);
  
  /* border-radius 표준화 */
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-xl: 12px;
  --radius-2xl: 16px;
  
  /* 트랜지션 */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.2s ease;
  --transition-slow: 0.3s ease;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* 모바일 터치 최적화 */
html {
  -webkit-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: #f5f7fa;
  color: #333;
  line-height: 1.6;
  -webkit-tap-highlight-color: transparent;
  -webkit-overflow-scrolling: touch;
}

.container {
  max-width: 1800px;
  margin: 0 auto;
  padding: 20px;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  padding: 20px;
  background: #fff;
  border-radius: 12px;
  color: #333;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  border: 1px solid #e1e5eb;
}

header h1 {
  font-size: 1.8rem;
}

/* 1차/2차 부서 탭 */
.department-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 15px;
  background: #fff;
  border-radius: 8px;
  padding: 4px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  width: fit-content;
}

.dept-tab {
  padding: 10px 30px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 500;
  color: #666;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.dept-tab:hover {
  background: #f0f0f0;
}

.dept-tab.active {
  background: #007bff;
  color: #fff;
}

.dept-tab.active:hover {
  background: #0056b3;
}

/* 1차 탭 활성화 시 */
.dept-tab[data-dept="primary"].active {
  background: #28a745;
}

.dept-tab[data-dept="primary"].active:hover {
  background: #218838;
}

/* 2차 탭 활성화 시 */
.dept-tab[data-dept="secondary"].active {
  background: #007bff;
}

.dept-tab[data-dept="secondary"].active:hover {
  background: #0056b3;
}

/* 공개DB 탭 활성화 시 */
.dept-tab[data-dept="public"].active {
  background: #fd7e14;
}

.dept-tab[data-dept="public"].active:hover {
  background: #e96f0a;
}

.header-buttons {
  display: flex;
  gap: 10px;
  align-items: center;
}

/* 사용자 정보 영역 */
.user-info {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-right: 16px;
  border-right: 1px solid #e1e5eb;
  margin-right: 6px;
}

.user-name {
  font-size: 0.9rem;
  color: #555;
  font-weight: 500;
}

.btn-admin-link, .btn-logout-link, .btn-announcement-link {
  padding: 6px 12px;
  font-size: 0.8rem;
  background: transparent;
  border: 1px solid #ddd;
  color: #666;
}

.btn-admin-link:hover {
  background: #f5f5f5;
  border-color: #ccc;
}

.btn-announcement-link:hover {
  background: #fff3cd;
  border-color: #ffc107;
  color: #856404;
}

.btn-bug-report {
  padding: 6px 12px;
  font-size: 0.8rem;
  background: transparent;
  border: 1px solid #dc3545;
  color: #dc3545;
}

.btn-bug-report:hover {
  background: #dc3545;
  color: #fff;
  border-color: #dc3545;
}

.btn-logout-link:hover {
  background: #333;
  color: #fff;
  border-color: #333;
}

/* 버튼 스타일 */
.btn {
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  transition: all 0.3s ease;
}

.btn-primary {
  background: #f8f9fa;
  color: #333;
  border: 1px solid #dee2e6;
}

.btn-primary:hover {
  background: #e9ecef;
  border-color: #ced4da;
}

.btn-secondary {
  background-color: #6c757d;
  color: white;
}

.btn-secondary:hover {
  background-color: #5a6268;
}

.btn-danger {
  background-color: #dc3545;
  color: white;
}

.btn-danger:hover {
  background-color: #c82333;
}

.btn-kb {
  background-color: #ff6b00;
  color: white;
  padding: 8px 16px;
  font-size: 0.85rem;
  margin-top: 10px;
  width: 100%;
}

.btn-kb:hover {
  background-color: #e55b00;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(255, 107, 0, 0.4);
}

.btn-kb:disabled {
  background-color: #ccc;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-small {
  padding: 8px 16px;
  font-size: 0.875rem;
}

/* 테이블 스타일 */
.table-container {
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  overflow-x: auto;
  overflow-y: visible;
  max-width: 100%;
  position: relative;
  opacity: 0;
  transition: opacity 0.15s ease-in-out;
}

/* 로드 완료 후 테이블 표시 */
.table-container.loaded {
  opacity: 1;
}

/* 테이블 자동 크기 조정 */
#customerTable {
  width: 100%;
  min-width: 100%;
  table-layout: fixed;
}

/* CSS 변수를 이용한 폰트 크기 적용 (성능 최적화) */
#customerTable.custom-font-size th,
#customerTable.custom-font-size td {
  font-size: var(--table-font-size, 0.72rem);
}

#customerTable.custom-font-size th {
  font-size: var(--table-header-font-size, 0.70rem);
}

#customerTable.custom-font-size .list-price-info,
#customerTable.custom-font-size .list-debt-info,
#customerTable.custom-font-size .list-ltv-info {
  font-size: var(--table-price-font-size, 0.65rem);
}

#customerTable.custom-font-size .business-loan-cell,
#customerTable.custom-font-size .created-at-cell {
  font-size: var(--table-special-font-size, 0.68rem);
}

/* 스크롤바 스타일링 */
.table-container::-webkit-scrollbar {
  height: 8px;
}

.table-container::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

.table-container::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 4px;
}

.table-container::-webkit-scrollbar-thumb:hover {
  background: #a1a1a1;
}

/* 테이블 래퍼 (스크롤 힌트용) */
.table-wrapper {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
}

/* 스크롤 힌트 그림자 */
.scroll-hint {
  position: absolute;
  top: 0;
  bottom: 8px; /* 스크롤바 높이 제외 */
  width: 30px;
  pointer-events: none;
  z-index: 5;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.scroll-hint-right {
  right: 0;
  background: linear-gradient(to left, rgba(0,0,0,0.08), transparent);
}

.scroll-hint-left {
  left: 0;
  background: linear-gradient(to right, rgba(0,0,0,0.08), transparent);
}

.scroll-hint.visible {
  opacity: 1;
}

/* 페이지네이션 스타일 */
.pagination-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: #fff;
  border-radius: 0 0 12px 12px;
  border-top: 1px solid #eee;
  margin-top: -8px;
}

.pagination-info {
  font-size: 0.9rem;
  color: #666;
}

.pagination {
  display: flex;
  gap: 4px;
  align-items: center;
}

.keyboard-hint {
  font-size: 0.75rem;
  color: #999;
  padding: 4px 10px;
  background: #f5f5f5;
  border-radius: 4px;
  border: 1px solid #e0e0e0;
  margin-right: 8px;
}

.page-btn {
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border: 1px solid #ddd;
  background: #fff;
  color: #333;
  font-size: 0.9rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.page-btn:hover:not(.disabled):not(.active) {
  background: #f5f5f5;
  border-color: #ccc;
}

.page-btn.active {
  background: #4CAF50;
  color: #fff;
  border-color: #4CAF50;
  font-weight: 600;
}

.page-btn.disabled {
  color: #ccc;
  cursor: not-allowed;
  background: #f9f9f9;
}

.page-btn.prev-btn,
.page-btn.next-btn {
  font-weight: bold;
}

.page-ellipsis {
  padding: 0 8px;
  color: #999;
}

/* 페이지네이션 컨트롤 영역 */
.pagination-controls {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* 페이지당 표시 개수 선택 */
.items-per-page {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: #666;
}

.items-per-page label {
  white-space: nowrap;
}

.items-per-page select {
  padding: 6px 24px 6px 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E") no-repeat right 8px center;
  background-size: 10px;
  font-size: 0.85rem;
  color: #333;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  min-width: 70px;
}

.items-per-page select:hover {
  border-color: #bbb;
}

.items-per-page select:focus {
  outline: none;
  border-color: #4CAF50;
  box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.1);
}

table {
  width: 100%;
  border-collapse: collapse;
  table-layout: auto;
  min-width: 1200px; /* 최소 너비 설정으로 컬럼 압축 방지 */
}

thead {
  background: #f8f9fa;
  color: #333;
}

th {
  padding: 10px 8px;
  text-align: left;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.3px;
  border-bottom: 2px solid #e1e5eb;
  background: #f8f9fa;
  color: #333;
}

td {
  padding: 8px 6px;
  border-bottom: 1px solid #eee;
  font-size: 0.75rem;
  background: inherit;
  color: #333;
}

tbody tr {
  cursor: pointer;
  transition: background-color 0.2s ease;
  background-color: white;
}

tbody tr:hover {
  background-color: #e8f4fc;
}

tbody tr:hover td {
  background-color: #e8f4fc;
}

body.dark-mode tbody tr:hover {
  background-color: #2d4a6f !important;
}

body.dark-mode tbody tr:hover td {
  background-color: #2d4a6f !important;
}

tbody tr:last-child td {
  border-bottom: none;
}

/* 진행상태 뱃지 */
.status-badge {
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 700;
  display: inline-block;
  white-space: nowrap;
  background-color: transparent;
}

.status-대기, .status-waiting { color: #b8860b; }
.status-관리중, .status-managing { color: #6c5ce7; }
.status-보류, .status-hold { color: #e17055; }
.status-성향불량, .status-badattitude { color: #d63031; }
.status-진행중, .status-inprogress { color: #0984e3; }
.status-진행완료, .status-completed { color: #00b894; }
.status-부재, .status-absent { color: #636e72; }
.status-public { color: #6f42c1; background: #f3e5f5; }
.status-default { color: #636e72; }

/* 관리 버튼 */
.action-btn {
  padding: 6px 12px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  margin-right: 5px;
  transition: all 0.2s ease;
}

.edit-btn {
  background-color: #555;
  color: white;
}

.edit-btn:hover {
  background-color: #444;
}

.delete-btn {
  background-color: #dc3545;
  color: white;
}

.delete-btn:hover {
  background-color: #c82333;
}

/* ===== 컴팩트 모달 오버레이 ===== */
.compact-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  z-index: 2000;
  display: none;  /* 기본 숨김 */
  justify-content: center;
  align-items: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.compact-modal-overlay.show {
  opacity: 1;
  visibility: visible;
}

.compact-modal-container {
  position: relative;
  width: 95vw;
  height: 95vh;
  background: #f5f6f8;
  border-radius: 10px;
  box-shadow: 0 15px 50px rgba(0, 0, 0, 0.3);
  overflow: hidden;
}

.compact-modal-close {
  position: absolute;
  top: 8px;
  right: 12px;
  width: 28px;
  height: 28px;
  border: none;
  background: rgba(255, 255, 255, 0.9);
  color: #666;
  font-size: 20px;
  font-weight: bold;
  cursor: pointer;
  border-radius: 50%;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.compact-modal-close:hover {
  background: #e74c3c;
  color: #fff;
  transform: scale(1.1);
}

.compact-modal-iframe {
  width: 100%;
  height: 100%;
  border: none;
  background: #f5f6f8;
}

/* 모달 스타일 */
.modal {
  display: block;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  overflow-y: auto;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease, visibility 0.15s ease;
}

/* KB 패널이 열렸을 때 모달 배경은 클릭 통과 */
.modal.kb-panel-active {
  pointer-events: none;
}

/* 모달 콘텐츠는 항상 클릭 가능 */
.modal.kb-panel-active .modal-content {
  pointer-events: auto;
}

.modal.show {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background-color: white;
  margin: 30px auto;
  padding: 0;
  border-radius: 16px;
  width: 90%;
  max-width: 700px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  /* 애니메이션 제거하여 성능 개선 */
}

/* 슬라이드 애니메이션 비활성화 (성능 개선) */
/*
@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-50px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
*/

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 30px;
  background: #f8f9fa;
  color: #333;
  border-radius: 16px 16px 0 0;
  border-bottom: 1px solid #e1e5eb;
}

.modal-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.modal-header-left .btn-log {
  padding: 6px 12px;
  font-size: 0.8rem;
  background: #6c757d;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.modal-header-left .btn-log:hover {
  background: #5a6268;
}

.modal-header h2 {
  font-size: 1.4rem;
}

.close {
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.2s;
  color: #333;
}

/* 전체화면 버튼 스타일 */
.fullscreen {
  font-size: 20px;
  font-weight: bold;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.2s;
  color: #333;
  margin-right: 8px;
}

.fullscreen:hover {
  opacity: 1;
  color: #007bff;
}

/* 팝업 모드 스타일 */
body.popup-mode {
  overflow: hidden;
  background: #f5f7fa;
}

body.popup-mode #modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: #f5f7fa;
  display: block !important;
  opacity: 1 !important;
  visibility: visible !important;
}

body.popup-mode #modal .modal-content {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: 100%;
  height: 100%;
  max-height: 100%;
  margin: 0;
  border-radius: 0;
  transform: none;
  background: #f5f7fa;
  box-shadow: none;
}

body.popup-mode #modal .modal-header {
  border-radius: 0;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  padding: 12px 24px;
}

body.popup-mode #modal .modal-header h2 {
  color: #fff;
}

body.popup-mode #modal .modal-header .close {
  color: #fff;
  opacity: 0.8;
}

body.popup-mode #modal .modal-header .close:hover {
  opacity: 1;
}

body.popup-mode #modal .modal-body {
  height: calc(100% - 110px);
  padding: 16px 24px;
  overflow-y: auto;
  background: #f5f7fa;
}

body.popup-mode #modal .modal-footer {
  background: #fff;
  border-top: 1px solid #e1e5eb;
  padding: 12px 24px;
}

body.popup-mode .fullscreen {
  display: none;
}

body.popup-mode .main-container,
body.popup-mode header,
body.popup-mode footer,
body.popup-mode .filter-container,
body.popup-mode .top-bar {
  display: none !important;
}

/* 팝업 모드: 2열 레이아웃 */
body.popup-mode #customerForm {
  display: grid;
  grid-template-columns: 380px 1fr;
  grid-template-rows: auto 1fr auto;
  gap: 16px;
  height: 100%;
  min-height: 0;
}

/* 팝업 모드: 고객 기본정보 영역 (왼쪽 상단) */
body.popup-mode .customer-form-fields {
  grid-column: 1;
  grid-row: 1;
  display: grid !important;
  grid-template-columns: 1fr 1fr;
  gap: 10px 12px;
  background: #fff;
  padding: 16px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  align-content: start;
  max-height: fit-content;
}

/* 팝업 모드: 2열 레이아웃 배치 (4열 grid-column 오버라이드) */
body.popup-mode .customer-form-fields .form-group {
  margin-bottom: 0;
  grid-column: auto !important;
  grid-row: auto !important;
}

/* 팝업 모드 필드 순서 - 2열 기준 */
/* 1행: 담당직원, 진행상태 */
body.popup-mode .customer-form-fields .form-group-staff { order: 1; }
body.popup-mode .customer-form-fields .form-group-status { order: 2; }
/* 2행: 이름, 생년월일 */
body.popup-mode .customer-form-fields .form-group-name { order: 3; }
body.popup-mode .customer-form-fields .form-group-birth { order: 4; }
/* 3행: 연락처, 통신사 */
body.popup-mode .customer-form-fields .form-group-phone { order: 5; }
body.popup-mode .customer-form-fields .form-group-carrier { order: 6; }
/* 4행: 직군, 연봉 */
body.popup-mode .customer-form-fields .form-group-occupation { order: 7; }
body.popup-mode .customer-form-fields .form-group-salary { order: 8; }
/* 5행: 신청금액, 신용점수 */
body.popup-mode .customer-form-fields .form-group-loan-info { order: 9; }
body.popup-mode .customer-form-fields .form-group-credit-score { order: 10; }
/* 사업자 정보 (2열 전체) */
body.popup-mode .customer-form-fields .form-group-business-info { 
  order: 11; 
  grid-column: 1 / -1 !important;
}

body.popup-mode .customer-form-fields .form-group label {
  font-size: 0.75rem;
  margin-bottom: 4px;
}

body.popup-mode .customer-form-fields .form-group input,
body.popup-mode .customer-form-fields .form-group select {
  padding: 6px 10px;
  font-size: 0.85rem;
}

/* 팝업 모드: 사업자 정보 2열 레이아웃 */
body.popup-mode .business-info-container {
  grid-template-columns: 1fr 1fr !important;
  gap: 8px 10px;
}

/* 팝업 모드: 사업자 정보 필드 순서 재배치 */
/* 1행: 상호명, 사업자등록번호 */
body.popup-mode .business-field-name { order: 1; }
body.popup-mode .business-field-number { order: 2; }
/* 2행: 사업장분류, 매출 */
body.popup-mode .business-field-category { order: 3; }
body.popup-mode .business-field-revenue { order: 4; }
/* 3행: 개업일 (2열 전체) */
body.popup-mode .business-field-opendate { 
  order: 5; 
  grid-column: 1 / -1 !important;
}
/* 4행: 사업장주소 (2열 전체) */
body.popup-mode .business-field.business-address-field {
  order: 6;
  grid-column: 1 / -1 !important;
}

/* 팝업 모드: 개업일/매출 2열 배치 */
body.popup-mode .business-field {
  min-width: 0;
}

/* 팝업 모드: 상담내용 영역 (왼쪽 하단) */
body.popup-mode .popup-consultation-section,
body.popup-mode #customerForm > .form-group:has(#consultationNotesContainer) {
  grid-column: 1;
  grid-row: 2;
  background: #fff;
  padding: 16px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  display: flex;
  flex-direction: column;
  min-height: 200px;
  max-height: 350px;
}

body.popup-mode .popup-consultation-section > label,
body.popup-mode #customerForm > .form-group:has(#consultationNotesContainer) > label {
  flex-shrink: 0;
  margin-bottom: 8px;
  font-weight: 600;
  color: #333;
}

body.popup-mode #consultationNotesContainer {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

body.popup-mode #consultationNotesList {
  flex: 1;
  overflow-y: auto;
  max-height: none;
}

/* 팝업 모드: 담보물 영역 (오른쪽 전체) */
body.popup-mode .popup-collateral-section,
body.popup-mode #customerForm > .form-group:has(#collateralContainer) {
  grid-column: 2;
  grid-row: 1 / 4;
  background: #fff;
  padding: 16px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

body.popup-mode .popup-collateral-section > label,
body.popup-mode #customerForm > .form-group:has(#collateralContainer) > label {
  flex-shrink: 0;
  margin-bottom: 10px;
  font-weight: 600;
  font-size: 1rem;
  color: #333;
}

body.popup-mode #collateralContainer {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}

body.popup-mode #addCollateralBtn {
  flex-shrink: 0;
  margin-top: 12px;
}

/* 팝업 모드: 담보물 아이템 스타일 개선 */
body.popup-mode .collateral-item {
  border: 1px solid #e1e5eb;
  border-radius: 8px;
  margin-bottom: 12px;
  background: #fafbfc;
}

body.popup-mode .collateral-header {
  padding: 10px 14px;
  background: #f8f9fa;
  border-radius: 8px 8px 0 0;
}

body.popup-mode .collateral-content {
  padding: 14px;
}

/* 팝업 모드: 채권/환수 테이블 개선 */
body.popup-mode .debt-table-wrapper {
  max-height: none;
  overflow-x: auto;
}

body.popup-mode .debt-table {
  font-size: 0.8rem;
}

body.popup-mode .debt-table th,
body.popup-mode .debt-table td {
  padding: 6px 8px;
}

body.popup-mode .debt-table input,
body.popup-mode .debt-table select {
  font-size: 0.8rem;
  padding: 4px 6px;
}

/* 팝업 모드: 탭 스타일 */
body.popup-mode .collateral-tabs {
  margin-bottom: 12px;
}

body.popup-mode .collateral-tab {
  padding: 6px 12px;
  font-size: 0.8rem;
}

/* 팝업 모드: 주소 선택 영역 */
body.popup-mode .address-row {
  gap: 8px;
}

body.popup-mode .address-row select {
  font-size: 0.8rem;
  padding: 6px 8px;
}

/* 팝업 모드: 시세 정보 */
body.popup-mode .price-section {
  background: #f8f9fa;
  padding: 12px;
  border-radius: 8px;
  margin-top: 10px;
}

body.popup-mode .price-row {
  gap: 8px;
}

body.popup-mode .price-row input {
  font-size: 0.85rem;
}

/* 팝업 모드: 첨부파일 영역 */
body.popup-mode .registry-doc-section {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #e9ecef;
}

body.popup-mode .registry-doc-table {
  font-size: 0.8rem;
}

/* 팝업 모드: 특이사항 영역 */
body.popup-mode .notes-section {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #e9ecef;
}

/* 팝업 모드 반응형 - 작은 화면 */
@media (max-width: 1200px) {
  body.popup-mode #customerForm {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto 1fr;
  }
  
  body.popup-mode .customer-form-fields {
    grid-column: 1;
    grid-row: 1;
  }
  
  body.popup-mode .popup-consultation-section,
  body.popup-mode #customerForm > .form-group:has(#consultationNotesContainer) {
    grid-column: 1;
    grid-row: 2;
    max-height: 200px;
  }
  
  body.popup-mode .popup-collateral-section,
  body.popup-mode #customerForm > .form-group:has(#collateralContainer) {
    grid-column: 1;
    grid-row: 3;
  }
}

/* 고객 상세 정보 모달 특별 스타일 */
#modal .modal-content {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90%;
  max-width: 700px;
  height: 80vh;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  margin: 0;
  overflow: visible; /* 펼치기 버튼이 보이도록 */
}

#modal .modal-header {
  flex-shrink: 0;
  border-bottom: 1px solid #e1e5eb;
}

#modal .modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 0px 20px 20px 20px;
}

#modal .modal-footer {
  flex-shrink: 0;
  border-top: 1px solid #e1e5eb;
  padding: 15px 20px;
  background: #f8f9fa;
}

#modal .form-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0;
  padding: 0;
  width: 100%;
}

#modal .form-actions #deleteBtn {
  flex-shrink: 0;
  margin-right: auto;
}

#modal .form-actions .form-actions-right {
  display: flex;
  gap: 10px;
  margin-left: auto;
}

/* 시세조회, 사업대공식, 소액임차 모달 중앙 위치 스타일 */
#businessLoanFormulaModal .modal-content {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 95%;
  max-width: 700px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  margin: 0;
  overflow: hidden;
}

/* 사업대 공식 모달 테이블 - min-width 제거 */
#businessLoanFormulaModal .modal-body {
  overflow-x: hidden !important;
  padding: 20px 19px !important;
}

#businessLoanFormulaModal .deposit-table {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  table-layout: fixed !important;
}

/* 시세조회 모달 - 가로 크기 축소 */
#priceSourceListModal .modal-content {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 95%;
  max-width: 700px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  margin: 0;
  overflow: hidden;
}

/* 소액임차 모달 - 높이 90%로 증가, 가로 최적화 */
#depositModal .modal-content {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 95%;
  max-width: 900px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  margin: 0;
  overflow: hidden;
}

/* 소액임차 모달 테이블 - 컬럼 너비 고정 */
#depositModal .modal-body {
  overflow-x: hidden !important;
  padding: 20px 19px !important;
}

#depositModal .deposit-table {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  table-layout: fixed !important;
}

#depositModal .deposit-table td,
#depositModal .deposit-table th {
  overflow: hidden;
  text-overflow: ellipsis;
}

#depositModal .deposit-table .region-detail {
  word-break: break-all;
  overflow-wrap: anywhere;
}

#depositModal .deposit-table colgroup col:nth-child(1) { width: 50px !important; }
#depositModal .deposit-table colgroup col:nth-child(2) { width: 620px !important; }
#depositModal .deposit-table colgroup col:nth-child(3) { width: 95px !important; }
#depositModal .deposit-table colgroup col:nth-child(4) { width: 95px !important; }

#priceSourceListModal .modal-header,
#businessLoanFormulaModal .modal-header,
#depositModal .modal-header {
  flex-shrink: 0;
  border-bottom: 1px solid #e1e5eb;
}

#priceSourceListModal .modal-body,
#businessLoanFormulaModal .modal-body,
#depositModal .modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.close:hover {
  opacity: 1;
}

/* 폼 스타일 */
form {
  padding: 30px;
}

.form-row {
  display: flex;
  gap: 15px;
  margin-bottom: 15px;
}

.form-row .form-group {
  flex: 0 0 auto;
  margin-bottom: 0;
}

/* 고객 정보 필드 컨테이너 (PC) - 4열 그리드 */
.customer-form-fields {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px 12px;
  margin-bottom: 10px;
  align-items: start;
}

.customer-form-fields .form-group {
  margin-bottom: 0;
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
  flex: none !important;
}

.customer-form-fields .form-group label {
  font-size: 0.7rem;
  margin-bottom: 1px;
  color: #555;
  display: block;
  line-height: 1.2;
  min-height: 16px;
}

/* 연봉 레이블 - 즉발여부 우측 배치 */
.customer-form-fields .form-group-salary > label {
  display: flex !important;
  justify-content: space-between;
  align-items: center;
  min-height: 16px;
}

/* 신용점수 레이블 - 특이사항 우측 배치 */
.customer-form-fields .form-group-credit-score > label,
.form-group-credit-score > label {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  min-height: 16px;
}

/* 진행상태 레이블 */
.customer-form-fields .form-group-status > label {
  display: flex !important;
  justify-content: space-between;
  align-items: center;
  min-height: 16px;
}

.customer-form-fields .form-group input:not([type="checkbox"]),
.customer-form-fields .form-group select {
  padding: 4px 6px;
  font-size: 0.78rem;
  width: 100% !important;
  box-sizing: border-box;
  min-width: 0;
  height: 26px;
}

/* PC 배치 순서 (4열 그리드) */
/* 1행: (빈칸), (빈칸), 담당직원, 진행상태 - 오른쪽 2열만 사용 */
/* 2행: 이름, 생년월일, 연락처, 통신사 */
/* 3행: 직군, 연봉, 신청금액, 신용점수 */
/* 4행: 사업자 정보 (전체 열 차지) */
.customer-form-fields .form-group-staff {
  grid-column: 3;
  grid-row: 1;
}

.customer-form-fields .form-group-status {
  grid-column: 4;
  grid-row: 1;
}

.customer-form-fields .form-group-name {
  grid-column: 1;
  grid-row: 2;
}

.customer-form-fields .form-group-birth {
  grid-column: 2;
  grid-row: 2;
}

.customer-form-fields .form-group-phone {
  grid-column: 3;
  grid-row: 2;
}

.customer-form-fields .form-group-carrier {
  grid-column: 4;
  grid-row: 2;
}

.customer-form-fields .form-group-occupation {
  grid-column: 1;
  grid-row: 3;
}

.customer-form-fields .form-group-salary {
  grid-column: 2;
  grid-row: 3;
}

.customer-form-fields .form-group-loan-info {
  grid-column: 3;
  grid-row: 3;
}

.customer-form-fields .form-group-credit-score {
  grid-column: 4;
  grid-row: 3;
}

/* 데스크톱용 즉발사업자 별도 필드 숨김 (연봉 옆 인라인으로 대체) */
.customer-form-fields .form-group-instant-biz.desktop-only {
  display: none;
}

/* 즉발사업자 인라인 체크박스 (PC/모바일 공통) - 특이사항과 동일 스타일 */
.instant-biz-inline {
  display: inline-flex !important;
  align-items: center !important;
  margin-left: auto !important;
  font-size: 0.75rem;
  gap: 4px;
  cursor: pointer;
  flex-shrink: 0;
}
.instant-biz-inline input[type="checkbox"] {
  width: 14px !important;
  height: 14px !important;
  margin: 0 !important;
  cursor: pointer;
  flex-shrink: 0;
}
.instant-biz-inline span {
  font-size: 0.7rem;
  color: #666;
  white-space: nowrap;
}

/* 컴팩트 폼 행 */
.form-row-compact {
  gap: 12px;
  margin-bottom: 12px;
}

.form-row-compact .form-group label {
  font-size: 0.8rem;
  margin-bottom: 4px;
}

.form-row-compact .form-group input,
.form-row-compact .form-group select {
  padding: 6px 8px;
  font-size: 0.85rem;
}

/* 새로운 고객 정보 행 스타일 */
.form-row-info {
  display: flex;
  gap: 12px;
  margin-bottom: 14px;
  align-items: flex-end;
}

.form-row-info .form-group {
  margin-bottom: 0;
}

.form-row-info .form-group label {
  font-size: 0.8rem;
  margin-bottom: 4px;
  color: #555;
}

.form-row-info .form-group input,
.form-row-info .form-group select {
  padding: 7px 10px;
  font-size: 0.85rem;
}

/* 필드 크기 클래스 */
.form-group-xs {
  flex: 0 0 80px;
  min-width: 80px;
}

.form-group-sm {
  flex: 0 0 120px;
  min-width: 120px;
}

.form-group-md {
  flex: 0 0 150px;
  min-width: 150px;
}

.form-group-lg {
  flex: 1;
  min-width: 180px;
}

/* 체크박스 필드 */
.form-group-check {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  padding-bottom: 4px;
}

/* 레거시 고정 너비 - 4열 그리드에서는 무시됨 */
.customer-form-fields .form-group-name,
.customer-form-fields .form-group-birth,
.customer-form-fields .form-group-phone,
.customer-form-fields .form-group-carrier,
.customer-form-fields .form-group-occupation,
.customer-form-fields .form-group-salary,
.customer-form-fields .form-group-loan-info,
.customer-form-fields .form-group-credit-score,
.customer-form-fields .form-group-status {
  flex: none !important;
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
}

/* 레거시: 비-그리드 레이아웃용 */
.form-group-name,
.form-group-birth,
.form-group-phone,
.form-group-carrier,
.form-group-occupation,
.form-group-salary,
.form-group-loan-info {
  flex: 0 0 130px !important;
  min-width: 130px !important;
}

.form-group-credit-score {
  flex: 0 0 180px !important;
  min-width: 180px !important;
  transition: all 0.2s ease;
}

/* 특이사항 활성화 시 - 4열 그리드에서 위치 유지, 확장 안함 */
.customer-form-fields .form-group-credit-score.special-expanded {
  grid-column: 4;
  grid-row: 3;
  /* 그리드 내에서는 확장하지 않음 */
}

/* 레거시 flex 레이아웃용 (그리드가 아닌 경우) */
.form-row .form-group-credit-score.special-expanded {
  flex: 0 0 280px !important;
  min-width: 280px !important;
}

/* 신용점수 특이사항 토글 (즉발여부와 동일 스타일) */
.credit-special-toggle {
  display: inline-flex !important;
  align-items: center !important;
  margin-left: auto !important;
  font-size: 0.75rem;
  gap: 4px;
  cursor: pointer;
  flex-shrink: 0;
}

.credit-special-toggle input[type="checkbox"] {
  width: 14px !important;
  height: 14px !important;
  margin: 0 !important;
  cursor: pointer;
  flex-shrink: 0;
}

.credit-special-toggle span {
  font-size: 0.7rem;
  color: #666;
  white-space: nowrap;
}

/* 신용점수 입력 래퍼 */
.credit-input-wrapper {
  position: relative;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

.credit-input-wrapper > input[type="text"] {
  width: 100%;
}

/* 특이사항 옵션들 (입력필드 자리에 표시) - 열 밀림 방지 */
.credit-special-options {
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 2px 4px;
  background: #fff8e1;
  border: 1px solid #ffc107;
  border-radius: 4px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  gap: 0;
  height: 26px;
  overflow: hidden;
}

.credit-option-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 1px;
  font-size: 0.6rem;
  cursor: pointer;
  color: #333;
  white-space: nowrap;
  padding: 1px 2px;
  flex: 0 1 auto;
  min-width: 0;
  text-align: center;
  box-sizing: border-box;
}

.credit-option-label input[type="checkbox"],
.credit-option-label input[type="radio"] {
  width: 9px !important;
  height: 9px !important;
  min-width: 9px !important;
  max-width: 9px !important;
  margin: 0;
  cursor: pointer;
  flex: 0 0 9px !important;
  flex-shrink: 0 !important;
  flex-grow: 0 !important;
}

.credit-option-label span {
  user-select: none;
  white-space: nowrap;
  font-size: 0.58rem;
}

/* 레거시: 비-그리드 레이아웃용 진행상태 */
.form-group-status {
  flex: 0 0 100px !important;
  min-width: 100px !important;
}

/* 폼 행 spacer (우측 정렬용) */
.form-row-spacer {
  flex: 1 1 auto !important;
  min-width: 20px;
}

/* 즉발사업자 체크박스 스타일 */
.form-group-instant-biz {
  flex: 0 0 100px !important;
  width: 100px !important;
  max-width: 100px !important;
  min-width: 100px !important;
  display: flex;
  align-items: flex-end;
  padding-bottom: 4px;
}

.checkbox-label-inline {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-weight: 500;
  color: #555;
  white-space: nowrap;
  padding: 7px 0;
}

.checkbox-label-inline input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  margin: 0;
  accent-color: #2196F3;
}

.checkbox-label-inline span {
  font-size: 0.85rem;
}

.form-group {
  margin-bottom: 15px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  color: #555;
  font-size: 0.85rem;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 0.85rem;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  box-sizing: border-box;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #999;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.05);
}

.form-group textarea {
  resize: vertical;
  min-height: 80px;
}

/* 담보물 주소 컨테이너 */
#collateralContainer {
  margin-bottom: 10px;
}

.collateral-item {
  background: #f8f9fa;
  border: 1px solid #e1e5eb;
  border-radius: 8px;
  margin-bottom: 15px;
  overflow: hidden;
}

/* 담보물 접힘 상태에서도 .collateral-content는 보이지만 내부 요소만 숨김 (아래 규칙에서 처리) */

.collateral-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 15px;
  background: #eef1f5;
  cursor: pointer;
  user-select: none;
  transition: background-color 0.2s;
}

.collateral-header:hover {
  background: #e3e7ec;
}

.collateral-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.collateral-toggle {
  font-size: 0.75rem;
  color: #666;
  width: 14px;
  flex-shrink: 0;
}

.collateral-header-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.collateral-header-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.collateral-header-row.collateral-price-row {
  gap: 12px;
}

.collateral-type-badge {
  display: inline-block;
  background: #3498db;
  color: #fff;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 0.7rem;
  font-weight: 500;
  flex-shrink: 0;
}

.collateral-address-preview {
  color: #333;
  font-size: 0.8rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}

.collateral-price-preview {
  font-size: 0.72rem;
  flex-shrink: 0;
}

.collateral-price-preview.past-price {
  color: #7f8c8d;
}

.collateral-price-preview.current-price {
  color: #e67e22;
  font-weight: 600;
}

.no-debt-message {
  text-align: center;
  color: #888;
  font-size: 0.8rem;
  padding: 10px;
  margin: 0;
}

.collateral-content {
  padding: 15px;
}

/* 담보물 접힌 상태 - 채권/압류/환수, 특이사항, 첨부파일 섹션만 보임 */
.collateral-item.collapsed .collateral-content > *:not(.debt-recovery-section):not(.notes-section):not(.registry-doc-section) {
  display: none !important;
}

.collateral-item.collapsed .collateral-content > .debt-recovery-section,
.collateral-item.collapsed .collateral-content > .notes-section,
.collateral-item.collapsed .collateral-content > .registry-doc-section {
  display: block !important;
}

.collateral-item.collapsed .collateral-content {
  padding: 0;
}

/* 접힌 상태에서 섹션들에 패딩 추가 */
.collateral-item.collapsed .collateral-content > .notes-section,
.collateral-item.collapsed .collateral-content > .registry-doc-section {
  padding: 10px 15px;
  border-top: 1px solid #e2e8f0;
}

.collateral-item.collapsed .collateral-content > .debt-recovery-section {
  padding: 0;
}

/* 읽기 전용 모드 */
.collateral-content.readonly-mode {
  background-color: #f8f9fa;
}

.collateral-content.readonly-mode input:disabled,
.collateral-content.readonly-mode select:disabled,
.collateral-content.readonly-mode textarea:disabled {
  background-color: #e9ecef;
  color: #495057;
  cursor: not-allowed;
  opacity: 1;
}

.collateral-content.readonly-mode button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* 유형 + 지역 한 줄 배치 */
.type-region-section {
  margin-bottom: 12px;
}

/* KB부동산 검색 섹션 */
.search-section {
  margin-bottom: 12px;
}

.kb-search-container {
  position: relative;
}

.kb-search-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 0.9rem;
  box-sizing: border-box;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.kb-search-input:focus {
  border-color: #ff6600;
  outline: none;
  box-shadow: 0 0 0 3px rgba(255, 102, 0, 0.1);
}

.kb-search-input::placeholder {
  color: #aaa;
}

.kb-search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  max-height: 300px;
  overflow-y: auto;
  background: white;
  border: 1px solid #ddd;
  border-top: none;
  border-radius: 0 0 6px 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  z-index: 100;
}

.kb-search-item {
  display: flex;
  align-items: center;
  padding: 10px 12px;
  cursor: pointer;
  gap: 8px;
  border-bottom: 1px solid #f0f0f0;
  transition: background 0.15s;
}

.kb-search-item:last-child {
  border-bottom: none;
}

.kb-search-item:hover,
.kb-search-item.selected {
  background: #fff5ee;
}

.kb-search-item.selected {
  background: #ffe8d9;
}

.kb-search-type {
  flex-shrink: 0;
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 0.7rem;
  font-weight: 600;
  color: white;
}

.kb-search-type.apt {
  background: #4a90d9;
}

.kb-search-type.officetel {
  background: #9b59b6;
}

.kb-search-type.villa {
  background: #27ae60;
}

.kb-search-name {
  flex: 1;
  font-weight: 500;
  color: #333;
  font-size: 0.9rem;
}

.kb-search-addr {
  flex-shrink: 0;
  font-size: 0.8rem;
  color: #888;
}

.kb-search-loading,
.kb-search-empty,
.kb-search-error {
  padding: 16px;
  text-align: center;
  color: #666;
  font-size: 0.85rem;
}

.kb-search-error {
  color: #e74c3c;
  background: #fdf0ef;
}

.kb-search-error strong {
  display: block;
  margin-bottom: 4px;
}

.kb-search-error small {
  color: #999;
}

/* 주소 섹션 공통 */
.address-section {
  background: white;
  padding: 10px;
  border-radius: 6px;
  border: 1px solid #e1e5eb;
}

.address-section label {
  display: block;
  font-size: 0.8rem;
  color: #555;
  margin-bottom: 6px;
  font-weight: 600;
}

/* 단지 선택 단독 배치 */
.complex-section {
  margin-bottom: 12px;
}

/* KB부동산 시세 미제공 메시지 */
.kb-no-data-message {
  margin-top: 10px;
  padding: 10px 12px;
  background-color: #fff3cd;
  border: 1px solid #ffc107;
  border-radius: 6px;
  color: #856404;
  font-size: 0.85rem;
  text-align: center;
}

/* 도로명/지번주소 입력 (단지선택 카드 내부) */
.address-detail-row {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed #ddd;
}

.address-detail-row label {
  display: block;
  font-weight: 500;
  margin-bottom: 6px;
  color: #333;
  font-size: 0.8rem;
}

.address-detail-input-wrapper {
  display: flex;
  gap: 8px;
  align-items: center;
}

.address-detail-input-wrapper input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 0.85rem;
}

.address-detail-input-wrapper input:focus {
  border-color: #007bff;
  outline: none;
}

.btn-fetch-address {
  flex-shrink: 0;
  padding: 8px 14px;
  background: #28a745;
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 0.85rem;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s;
}

.btn-fetch-address:hover:not(:disabled) {
  background: #218838;
}

.btn-fetch-address:disabled {
  background: #6c757d;
  cursor: not-allowed;
}

.complex-row {
  flex-wrap: nowrap !important;
}

.complex-row > .btn-kb-fetch {
  flex: 0 0 auto;
  width: auto;
  min-width: 100px;
  padding: 8px 16px;
}

.complex-wrapper {
  flex: 3 !important;
  min-width: 200px;
}

.building-wrapper,
.unit-wrapper {
  flex: 1 !important;
  min-width: 70px;
}

.address-row {
  display: flex;
  gap: 6px;
}

.select-wrapper {
  flex: 1;
  position: relative;
  min-width: 0;
  display: flex;
  gap: 4px;
  align-items: center;
}

/* 직접입력 버튼 */
.btn-manual-input {
  flex: 1;
  padding: 8px 10px;
  font-size: 0.85rem;
  background: #007bff;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
  text-align: center;
}

.btn-manual-input:hover {
  background: #0056b3;
}

/* 직접입력 필드 */
.manual-building,
.manual-unit {
  flex: 1;
  padding: 8px 6px;
  border: 1px solid #007bff;
  border-radius: 4px;
  font-size: 0.85rem;
  min-width: 0;
  background: #f0f7ff;
  box-sizing: border-box;
}

.manual-building:focus,
.manual-unit:focus {
  outline: none;
  border-color: #0056b3;
  background: #fff;
}

.address-row select {
  flex: 1;
  width: auto;
  padding: 8px 6px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 0.85rem;
  min-width: 0;
  background: white;
  box-sizing: border-box;
  cursor: pointer;
}

.address-row select:disabled {
  background-color: #f5f5f5;
  color: #999;
  cursor: not-allowed;
}

.address-row select:focus {
  outline: none;
  border-color: #999;
}

/* 유형 및 지역 헤더 (거주유형 포함) */
.type-region-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.type-region-header > label {
  font-size: 0.8rem;
  color: #555;
  font-weight: 600;
  margin: 0;
}

.residence-options-inline {
  display: flex;
  align-items: center;
  gap: 8px;
}

.radio-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  cursor: pointer;
  font-size: 0.75rem;
  color: #333;
  white-space: nowrap;
}

.radio-label input[type="radio"] {
  cursor: pointer;
  accent-color: #333;
  margin: 0;
  width: 12px;
  height: 12px;
}

.radio-label span {
  line-height: 1;
}

/* 세입자 정보 섹션 */
.tenant-info-section {
  background: #fff8e1;
  padding: 12px 14px;
  border-radius: 6px;
  border: 1px solid #ffe082;
  margin-bottom: 12px;
}

.tenant-info-row {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.tenant-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.tenant-field label {
  font-size: 0.75rem;
  color: #555;
  font-weight: 600;
  white-space: nowrap;
}

/* 보증금/월세 입력 필드 */
.tenant-deposit-field,
.tenant-monthly-rent-field {
  flex: 0 0 auto;
  min-width: 100px;
  max-width: 120px;
}

/* 설정여부 체크박스 */
.tenant-setting-check {
  display: flex;
  align-items: center;
  padding-top: 20px;
}

.tenant-field .checkbox-label {
  font-size: 0.8rem;
  gap: 5px;
  display: flex;
  align-items: center;
  cursor: pointer;
}

.tenant-field .checkbox-label input[type="checkbox"] {
  width: 15px;
  height: 15px;
  cursor: pointer;
}

/* 설정금액 입력 필드 */
.tenant-setting-amount {
  flex: 0 0 auto;
  min-width: 100px;
  max-width: 120px;
}

.tenant-deposit,
.tenant-monthly-rent,
.tenant-setting-input {
  padding: 8px 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 0.85rem;
  width: 100%;
  box-sizing: border-box;
}

.tenant-deposit:focus,
.tenant-monthly-rent:focus,
.tenant-setting-input:focus {
  outline: none;
  border-color: #f9a825;
}

/* 세입자 동의 필드 */
.tenant-consent-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-left: auto;
}

.tenant-consent-options {
  display: flex;
  gap: 10px;
  align-items: center;
}

.tenant-consent-options .radio-label {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8rem;
  cursor: pointer;
}

.tenant-consent-options input[type="radio"] {
  width: 14px;
  height: 14px;
  margin: 0;
  cursor: pointer;
}

/* 사업자 정보 섹션 - 4열 그리드 4행 전체 */
.form-group-business-info {
  grid-column: 1 / -1;
  grid-row: 4;
  margin-top: 4px;
}

.business-info-container {
  background: #e3f2fd;
  padding: 10px 12px;
  border-radius: 5px;
  border: 1px solid #90caf9;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px 12px;
}

.business-info-row {
  display: contents;
}

.business-info-row:last-child {
  margin-bottom: 0;
}

.business-field {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

/* 사업장 주소는 3열 차지 */
.business-field.business-address-field {
  grid-column: 1 / -1;
}

.business-field label {
  font-size: 0.7rem;
  color: #1565c0;
  font-weight: 600;
}

.business-field input,
.business-field select {
  padding: 5px 8px;
  border: 1px solid #90caf9;
  border-radius: 4px;
  font-size: 0.8rem;
  background: white;
  height: 28px;
}

.business-field input:focus,
.business-field select:focus {
  outline: none;
  border-color: #1976d2;
}

/* 개업일 년/월/일 분리 입력 - 컴팩트 */
.date-input-group {
  display: flex;
  align-items: center;
  gap: 2px;
}

.date-input-group .date-year {
  width: 50px;
  padding: 5px 4px;
  border: 1px solid #90caf9;
  border-radius: 4px;
  font-size: 0.8rem;
  text-align: center;
  height: 28px;
}

.date-input-group .date-month,
.date-input-group .date-day {
  width: 32px;
  padding: 5px 4px;
  border: 1px solid #90caf9;
  border-radius: 4px;
  font-size: 0.8rem;
  text-align: center;
  height: 28px;
}

.date-input-group .date-separator {
  color: #666;
  font-size: 0.8rem;
}

.date-input-group input:focus {
  outline: none;
  border-color: #1976d2;
}

/* 실매출 체크박스 인라인 */
.real-revenue-inline {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-left: 8px;
  font-weight: normal;
  font-size: 0.7rem;
  color: #666;
}

.real-revenue-inline input[type="checkbox"] {
  width: 12px;
  height: 12px;
  margin: 0;
}

.real-revenue-inline span {
  font-size: 0.7rem;
}

.collateral-header-buttons {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.btn-edit-collateral {
  padding: 6px 12px;
  background-color: #007bff;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.8rem;
  transition: background-color 0.2s;
}

.btn-edit-collateral:hover {
  background-color: #0056b3;
}

.btn-save-collateral {
  padding: 6px 12px;
  background-color: #28a745;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.8rem;
  transition: background-color 0.2s;
}

.btn-save-collateral:hover {
  background-color: #218838;
}

.btn-cancel-collateral {
  padding: 6px 12px;
  background-color: #6c757d;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.8rem;
  transition: background-color 0.2s;
}

.btn-cancel-collateral:hover {
  background-color: #5a6268;
}

.remove-collateral {
  padding: 6px 12px;
  background-color: #dc3545;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.8rem;
  transition: background-color 0.2s;
  flex-shrink: 0;
}

.remove-collateral:hover {
  background-color: #c82333;
}

/* 시세 섹션 */
.price-section {
  margin-bottom: 12px;
}

.price-row {
  display: flex;
  gap: 12px;
  align-items: stretch;
  margin-bottom: 10px;
}

/* 시세 헤더 + AI시세 체크박스 (과거시세/현재시세 공통) */
.price-header-with-ai {
  display: flex;
  align-items: center;
  gap: 6px;
}

.price-header-with-ai h5 {
  margin: 0;
  font-size: 0.85rem;
  color: #555;
  font-weight: 600;
}

/* AI시세 체크박스 레이블 */
.ai-price-checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 1px;
  cursor: pointer;
  font-size: 0.35rem;
  color: #e67e22;
  font-weight: 500;
  white-space: nowrap;
  opacity: 0.9;
}

.ai-price-checkbox-label input[type="checkbox"] {
  width: 9px;
  height: 9px;
  accent-color: #e67e22;
  cursor: pointer;
  margin: 0;
}

.ai-price-checkbox-label span {
  user-select: none;
  font-size: 0.6rem !important;
}

.price-group {
  background: white;
  padding: 10px;
  border-radius: 6px;
  border: 1px solid #e1e5eb;
  flex: 1;
}

.price-group h5 {
  margin: 0;
  font-size: 0.85rem;
  color: #555;
  font-weight: 600;
}

/* 시세 헤더 (버튼 포함) - 과거시세/현재시세 공통 */
.price-header-with-btn {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  min-height: 24px;
}

.price-header-with-btn .price-header-with-ai {
  margin-bottom: 0;
}

.price-header-with-btn h5 {
  margin: 0;
  font-size: 0.85rem;
  color: #555;
  font-weight: 600;
}

.btn-apply-past {
  padding: 3px 8px;
  font-size: 0.7rem;
  background: #6c757d;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.btn-apply-past:hover {
  background: #5a6268;
}

.price-inputs {
  display: flex;
  gap: 6px;
}

.price-inputs input {
  flex: 1;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 0.85rem;
  text-align: center;
}

.price-inputs input:focus {
  outline: none;
  border-color: #999;
}

.price-inputs input::placeholder {
  font-size: 0.75rem;
  color: #aaa;
}

.btn-kb-fetch {
  width: 100%;
  padding: 10px 16px;
  background-color: #333;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  transition: background-color 0.2s;
}

.btn-kb-fetch:hover {
  background-color: #555;
}

.btn-kb-fetch:disabled {
  background-color: #999;
  cursor: not-allowed;
}

/* 채권 정보 섹션 */
.debt-section {
  background: #f8f9fa;
  padding: 10px 12px;
  border-radius: 6px;
  border: 1px solid #e1e5eb;
  margin-bottom: 12px;
}

.debt-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  user-select: none;
}

.debt-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.debt-toggle {
  font-size: 0.75rem;
  color: #666;
  transition: transform 0.2s;
}

.debt-header h5 {
  margin: 0;
  font-size: 0.9rem;
  color: #333;
  font-weight: 600;
}

.debt-count {
  font-size: 0.8rem;
  color: #888;
  font-weight: normal;
}

.btn-add-debt {
  padding: 4px 10px;
  background-color: #28a745;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 500;
  transition: background-color 0.2s;
}

.btn-add-debt:hover {
  background-color: #218838;
}

/* 등기 PDF 파싱 버튼 */
.btn-parse-registry {
  padding: 4px 10px;
  background-color: #17a2b8;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 500;
  transition: background-color 0.2s;
  margin-left: 8px;
}

.debt-content {
  margin-top: 10px;
}

/* 테이블 컬럼 리사이즈 기능 */
.resizable-table {
  table-layout: fixed;
}

.resizable-table th.resizable-col {
  position: relative;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.resizable-table th.resizable-col::after {
  content: '';
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 5px;
  cursor: col-resize;
  background: transparent;
  transition: background 0.2s;
}

.resizable-table th.resizable-col:hover::after {
  background: rgba(0, 123, 255, 0.3);
}

.resizable-table th.resizing::after {
  background: rgba(0, 123, 255, 0.5);
}

.debt-table-wrapper {
  overflow-x: auto;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: white;
  scrollbar-width: thin;
}

.debt-table-wrapper::-webkit-scrollbar {
  height: 8px;
}

.debt-table-wrapper::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

.debt-table-wrapper::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 4px;
}

.debt-table-wrapper::-webkit-scrollbar-thumb:hover {
  background: #a1a1a1;
}

.debt-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: auto;
  min-width: 850px;
}

.debt-table th,
.debt-table td {
  padding: 6px 4px;
  border: 1px solid #e1e5eb;
  text-align: center;
  font-size: 0.75rem;
  white-space: nowrap;
}

.debt-table th {
  background: #f1f3f5;
  font-weight: 600;
  color: #555;
  position: relative;
  white-space: nowrap;
}

.debt-table tbody tr:hover {
  background: #f8f9fa;
}

.debt-table input,
.debt-table select {
  width: 100%;
  padding: 5px 3px;
  border: 1px solid transparent;
  border-radius: 3px;
  font-size: 0.78rem;
  text-align: center;
  background: transparent;
  box-sizing: border-box;
}

.debt-table input[type="date"] {
  font-size: 0.75rem;
  padding: 4px 2px;
}

/* 날짜 입력 달력 아이콘 탭 제외 및 스타일 */
.debt-table input[type="date"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  pointer-events: auto;
}

/* 날짜 입력에서 탭으로 달력 아이콘 선택 방지 */
.debt-table input[type="date"] {
  position: relative;
}

.debt-table input:focus,
.debt-table select:focus {
  outline: none;
  border-color: #007bff;
  background: white;
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.15);
}

/* 대환 체크박스 셀 */
.debt-refinance-cell {
  text-align: center;
}
.debt-refinance-cell input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

/* select 키보드 동작 수정 */
.debt-table select,
.form-group select {
  -webkit-appearance: menulist;
  -moz-appearance: menulist;
  appearance: menulist;
}

/* ====== 물건정보 섹션 (접이식) ====== */
.property-info-section {
  background: #f8f9fa;
  padding: 10px 12px;
  border-radius: 6px;
  border: 1px solid #e1e5eb;
  margin-top: 12px;
}

/* 단지정보 섹션 (접을 수 있음) */
.complex-info-section {
  background: #f8f9fa;
  padding: 10px 12px;
  border-radius: 6px;
  border: 1px solid #e1e5eb;
  margin-top: 12px;
}

.complex-info-header {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}

.complex-info-toggle {
  font-size: 0.75rem;
  color: #666;
  transition: transform 0.2s;
}

.complex-info-header h5 {
  margin: 0;
  font-size: 0.9rem;
  color: #333;
  font-weight: 600;
}

.complex-info-content {
  margin-top: 10px;
}

.complex-info-content .address-section,
.complex-info-content .price-section {
  margin-top: 0;
}

.complex-info-content > *:first-child {
  margin-top: 0;
}

.property-info-header {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}

.property-info-toggle {
  font-size: 0.75rem;
  color: #666;
  transition: transform 0.2s;
}

.property-info-header h5 {
  margin: 0;
  font-size: 0.9rem;
  color: #333;
  font-weight: 600;
}

.property-info-content {
  margin-top: 10px;
}

.property-info-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 8px;
}

.property-info-row:last-child {
  margin-bottom: 0;
}

.property-info-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.property-info-field label {
  font-size: 0.75rem;
  color: #666;
  font-weight: 500;
}

.property-info-field input,
.property-info-field select {
  padding: 6px 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 0.85rem;
  background: #fff;
}

.property-info-field input:focus,
.property-info-field select:focus {
  border-color: #4a90d9;
  outline: none;
}

.property-info-field input:disabled,
.property-info-field select:disabled {
  background: #f5f5f5;
  cursor: not-allowed;
}

/* 재건축/재개발 라디오 버튼 */
.reconstruction-field {
  flex: 1 !important;
  min-width: 200px;
  padding-right: 15px;
}

/* 재건축/압류, 증여/상속 행은 2열 레이아웃 */
.property-info-row:has(.reconstruction-field),
.property-info-row:has(.inheritance-gift-field) {
  grid-template-columns: 1fr 1fr;
}

.reconstruction-radios {
  display: inline-flex;
  gap: 12px;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: nowrap;
}

.reconstruction-radio-label {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  cursor: pointer;
  font-size: 0.8rem;
  color: #333;
  white-space: nowrap;
}

.reconstruction-radio-label input[type="radio"] {
  margin: 0;
  cursor: pointer;
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.reconstruction-radio-label span {
  user-select: none;
  font-size: 0.75rem;
}

/* ====== 접수 가능 상품 섹션 (접이식) ====== */
.eligible-products-section {
  background: #f0f7ff;
  padding: 10px 12px;
  border-radius: 6px;
  border: 1px solid #c5ddf7;
  margin-top: 12px;
}

.eligible-products-header {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}

.eligible-products-toggle {
  font-size: 0.75rem;
  color: #2563eb;
  transition: transform 0.2s;
}

.eligible-products-header h5 {
  margin: 0;
  font-size: 0.9rem;
  color: #1d4ed8;
  font-weight: 600;
}

.eligible-products-count {
  font-size: 0.8rem;
  color: #3b82f6;
  font-weight: 500;
}

/* 적합성검증 버튼 */
.btn-verify-all-products {
  margin-left: auto;
  background: #8b5cf6;
  color: white;
  border: none;
  border-radius: 4px;
  padding: 4px 10px;
  font-size: 0.75rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: background 0.2s;
  white-space: nowrap;
}

.btn-verify-all-products:hover {
  background: #7c3aed;
}

.btn-refresh-products {
  margin-left: 6px;
  background: #3b82f6;
  color: white;
  border: none;
  border-radius: 4px;
  width: 24px;
  height: 24px;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.btn-refresh-products:hover {
  background: #2563eb;
}

.eligible-products-content {
  margin-top: 10px;
}

.eligible-products-placeholder {
  padding: 20px;
  text-align: center;
  color: #6b7280;
  font-size: 0.85rem;
}

.eligible-products-placeholder p {
  margin: 0;
}

/* 테이블 스크롤 컨테이너 */
.eligible-products-list {
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: #93c5fd #e0ecf9;
}

.eligible-products-list::-webkit-scrollbar {
  height: 8px;
}

.eligible-products-list::-webkit-scrollbar-track {
  background: #e0ecf9;
  border-radius: 4px;
}

.eligible-products-list::-webkit-scrollbar-thumb {
  background: #93c5fd;
  border-radius: 4px;
}

.eligible-products-list::-webkit-scrollbar-thumb:hover {
  background: #3b82f6;
}

.eligible-products-table {
  min-width: 500px;
  width: max-content;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.eligible-products-table thead {
  background: #e0ecf9;
}

.eligible-products-table th {
  padding: 8px 10px;
  text-align: left;
  font-weight: 600;
  color: #1e40af;
  border-bottom: 2px solid #93c5fd;
  white-space: nowrap;
  position: relative;
  min-width: 60px;
  user-select: none;
}

/* 컬럼 리사이즈 핸들 */
.eligible-products-table th .resize-handle {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 5px;
  cursor: col-resize;
  background: transparent;
}

.eligible-products-table th .resize-handle:hover,
.eligible-products-table th .resize-handle.resizing {
  background: #3b82f6;
}

/* 컬럼 기본 너비 */
.eligible-products-table th:nth-child(1) { width: 70px; }  /* 업체명 */
.eligible-products-table th:nth-child(2) { width: 100px; } /* 상품명 */
.eligible-products-table th:nth-child(3) { width: 110px; } /* 선순위 예상한도 */
.eligible-products-table th:nth-child(4) { width: 90px; }  /* 선순위 금리 */
.eligible-products-table th:nth-child(5) { width: 110px; } /* 후순위 예상한도 */
.eligible-products-table th:nth-child(6) { width: 90px; }  /* 후순위 금리 */
.eligible-products-table th:nth-child(7) { width: 120px; } /* 참고사항 */

.eligible-products-table td {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 8px 10px;
  border-bottom: 1px solid #dbeafe;
  color: #1f2937;
  max-width: 200px;
}

.eligible-products-table tbody tr:hover {
  background: #dbeafe;
}

.eligible-products-table .conditions-note {
  font-size: 0.8rem;
  color: #6b7280;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 불가 표시 스타일 */
.eligible-products-table td.limit-not-feasible {
  color: #dc2626;
  font-weight: 500;
}

/* 급지 미확인/한도불가 스타일 */
.eligible-products-table td.grade-unavailable {
  color: #dc2626;
  font-weight: 500;
  background-color: #fef2f2;
}

.eligible-products-table td.grade-unknown {
  color: #f59e0b;
  font-weight: 500;
  background-color: #fffbeb;
}

/* ====== 채권/환수 정보 섹션 (탭 구조) ====== */
.debt-recovery-section {
  background: #f8f9fa;
  padding: 10px 12px;
  border-radius: 6px;
  border: 1px solid #e1e5eb;
  margin-bottom: 12px;
}

.debt-recovery-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  user-select: none;
}

.debt-recovery-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.debt-recovery-toggle {
  font-size: 0.75rem;
  color: #666;
  transition: transform 0.2s;
}

.debt-recovery-header h5 {
  margin: 0;
  font-size: 0.9rem;
  color: #333;
  font-weight: 600;
}

.debt-recovery-content {
  margin-top: 10px;
}

.debt-recovery-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 12px;
  border-bottom: 2px solid #e1e5eb;
  padding-bottom: 0;
}

.debt-tab-btn {
  padding: 8px 16px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  font-size: 0.85rem;
  font-weight: 500;
  color: #666;
  cursor: pointer;
  transition: all 0.2s;
}

.debt-tab-btn:hover {
  color: #007bff;
}

.debt-tab-btn.active {
  color: #007bff;
  border-bottom-color: #007bff;
}

.debt-table-header {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.debt-ltv-summary {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
}

.debt-ltv-summary span {
  white-space: nowrap;
}

.debt-tab-content {
  display: none;
}

.debt-tab-content.active {
  display: block;
}

/* 환수 테이블 스타일 (채권 테이블과 동일) */
.recovery-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: auto;
  min-width: 850px;
}

.btn-add-recovery {
  padding: 4px 10px;
  background-color: #17a2b8;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 500;
  transition: background-color 0.2s;
}

.btn-add-recovery:hover {
  background-color: #138496;
}

.btn-remove-recovery {
  padding: 4px 8px;
  background-color: #dc3545;
  color: white;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  font-size: 0.75rem;
  transition: background-color 0.2s;
}

.btn-remove-recovery:hover {
  background-color: #c82333;
}

.recovery-table .recovery-setup-amount,
.recovery-table .recovery-amount,
.recovery-table .recovery-monthly,
.recovery-table .recovery-approval-amount,
.recovery-table .recovery-commission,
.recovery-table .recovery-deduction {
  text-align: right;
}

/* 주소 드롭다운 열림 상태 스타일 */
.addr-row select[size]:not([size="1"]) {
  background: white;
  border: 1px solid #007bff;
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.addr-row select[size]:not([size="1"]) option {
  padding: 6px 10px;
}

.addr-row select[size]:not([size="1"]) option:hover,
.addr-row select[size]:not([size="1"]) option:checked {
  background: #e7f1ff;
}

.debt-table .debt-setup-amount,
.debt-table .debt-amount,
.debt-table .debt-monthly {
  text-align: right;
}

.btn-remove-debt {
  padding: 4px 8px;
  background-color: #dc3545;
  color: white;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  font-size: 0.75rem;
  transition: background-color 0.2s;
}

.btn-remove-debt:hover {
  background-color: #c82333;
}

/* 등기부등본 업로드 섹션 */
.registry-doc-section {
  background: white;
  padding: 10px;
  border-radius: 6px;
  border: 1px solid #e1e5eb;
}

.registry-doc-section > label {
  display: block;
  font-size: 0.8rem;
  color: #555;
  margin-bottom: 6px;
  font-weight: 600;
}

.registry-doc-upload {
  border: 2px dashed #ccc;
  border-radius: 6px;
  padding: 15px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  background: #fafafa;
  position: relative;
}

.registry-doc-upload:hover:not(.disabled) {
  border-color: #4CAF50;
  background: #f0f9f0;
}

.registry-doc-upload.drag-over {
  border-color: #4CAF50;
  background: #e8f5e9;
}

.registry-doc-upload.disabled {
  cursor: not-allowed;
  opacity: 0.7;
  background: #f5f5f5;
}

.registry-doc-upload input[type="file"] {
  display: none;
}

.registry-doc-placeholder {
  color: #888;
  font-size: 0.85rem;
}

.registry-doc-placeholder .upload-icon {
  font-size: 1.5rem;
  margin-bottom: 5px;
  color: #bbb;
}

.registry-doc-placeholder span {
  display: block;
}

/* 첨부파일 테이블 스타일 */
.registry-doc-table-wrapper {
  overflow-x: auto;
  margin-bottom: 10px;
  display: none;
}

.registry-doc-table-wrapper:has(tbody tr) {
  display: block;
}

.registry-doc-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: auto;
  min-width: 500px;
}

.registry-doc-table th,
.registry-doc-table td {
  padding: 6px 8px;
  border: 1px solid #e1e5eb;
  text-align: center;
  font-size: 0.78rem;
  white-space: nowrap;
}

.registry-doc-table th {
  background: #f1f3f5;
  font-weight: 600;
  color: #555;
}

.registry-doc-table tbody tr:hover {
  background: #f8f9fa;
}

.registry-doc-table .file-name-cell {
  text-align: left;
  min-width: 200px;
  white-space: nowrap;
}

.registry-doc-table .file-name {
  display: inline-block;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
  color: #333;
}

/* 파일명 셀 내 적용 버튼 */
.registry-doc-table .file-name-cell .btn-apply {
  margin-left: 8px;
  vertical-align: middle;
}

.registry-doc-table .file-print-date,
.registry-doc-table .file-upload-date {
  color: #666;
  font-size: 0.75rem;
}

.registry-doc-table .file-action-cell {
  padding: 4px;
}

/* 텍스트 버튼 스타일 */
.btn-file-action {
  padding: 4px 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.72rem;
  background: #fff;
  color: #555;
  transition: all 0.2s;
}

.btn-file-action:hover:not(:disabled) {
  background: #f0f0f0;
}

.btn-file-action:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-file-action.btn-apply {
  color: #28a745;
  border-color: #28a745;
}

.btn-file-action.btn-apply:hover:not(:disabled) {
  background: #28a745;
  color: white;
}

.btn-file-action.btn-dl {
  color: #28a745;
  border-color: #28a745;
}

.btn-file-action.btn-dl:hover:not(:disabled) {
  background: #28a745;
  color: white;
}

.btn-file-action.btn-view {
  color: #007bff;
  border-color: #007bff;
}

.btn-file-action.btn-view:hover:not(:disabled) {
  background: #007bff;
  color: white;
}

.btn-file-action.btn-remove {
  color: #dc3545;
  border-color: #dc3545;
}

.btn-file-action.btn-remove:hover:not(:disabled) {
  background: #dc3545;
  color: white;
}

/* 적용된 등기 표시 (테이블 행) */
.registry-doc-table tbody tr.active-registry {
  background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
}

.registry-doc-table tbody tr.active-registry td {
  border-color: #4caf50;
}

.registry-doc-table .active-registry-label {
  display: inline-block;
  font-size: 0.65rem;
  color: #2e7d32;
  background: #e8f5e9;
  padding: 2px 5px;
  border-radius: 3px;
  margin-left: 6px;
  font-weight: 600;
  border: 1px solid #4caf50;
  vertical-align: middle;
}

.registry-doc-table tbody tr.active-registry .file-name {
  color: #2e7d32;
  font-weight: 600;
}

/* 특이사항 섹션 */
.notes-section {
  background: white;
  padding: 10px;
  border-radius: 6px;
  border: 1px solid #e1e5eb;
}

.notes-section label {
  display: block;
  font-size: 0.8rem;
  color: #555;
  margin-bottom: 6px;
  font-weight: 600;
}

/* 심플 노트 스타일 */
.simple-notes-container {
  background: #f8f9fa;
  border: 1px solid #e1e5eb;
  border-radius: 6px;
  overflow: hidden;
}

.simple-notes-list {
  max-height: 200px;
  overflow-y: auto;
  padding: 8px;
}

.simple-note-item {
  background: white;
  border: 1px solid #e9ecef;
  border-radius: 4px;
  padding: 8px 10px;
  margin-bottom: 6px;
}

.simple-note-item:last-child {
  margin-bottom: 0;
}

.simple-note-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.simple-note-meta {
  font-size: 0.7rem;
  color: #888;
}

.simple-note-actions {
  display: flex;
  gap: 4px;
}

.btn-note-edit,
.btn-note-delete {
  width: 18px;
  height: 18px;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  font-size: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
}

.btn-note-edit {
  background: #e9ecef;
  color: #495057;
}

.btn-note-edit:hover {
  background: #4a90d9;
  color: white;
}

.btn-note-delete {
  background: #f8d7da;
  color: #dc3545;
}

.btn-note-delete:hover {
  background: #dc3545;
  color: white;
}

.simple-note-content {
  font-size: 0.85rem;
  color: #333;
  line-height: 1.4;
  word-break: break-word;
}

/* 인라인 수정 입력 */
.inline-edit-input {
  width: 100%;
  padding: 4px 8px;
  border: 1px solid #4a90d9;
  border-radius: 4px;
  font-size: 0.85rem;
  background: white;
  box-sizing: border-box;
}

.inline-edit-input:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(74, 144, 217, 0.2);
}

.simple-note-item.editing {
  background: #f0f7ff;
  border-color: #4a90d9;
}

.simple-notes-input {
  display: flex;
  gap: 6px;
  padding: 8px;
  background: #e9ecef;
  border-top: 1px solid #dee2e6;
}

.simple-notes-input input {
  flex: 1;
  padding: 6px 10px;
  border: 1px solid #ced4da;
  border-radius: 4px;
  font-size: 0.85rem;
  min-width: 0;
}

.simple-notes-input input:focus {
  outline: none;
  border-color: #4a90d9;
}

.btn-add-simple-note {
  padding: 6px 12px;
  background: #4a90d9;
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 0.8rem;
  cursor: pointer;
  white-space: nowrap;
}

.btn-add-simple-note:hover {
  background: #357abd;
}

.btn-add-simple-note:disabled {
  background: #adb5bd;
  cursor: not-allowed;
}

/* 엑셀 형식 노트 테이블 (레거시) */
.excel-notes-container {
  background: #fafbfc;
  border: 1px solid #e1e5eb;
  border-radius: 4px;
  overflow-x: auto;
  width: 100%;
}

.excel-notes-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
  table-layout: fixed;
}

.excel-notes-table thead {
  background: #f0f2f5;
}

.excel-notes-table th {
  padding: 5px 4px;
  text-align: left;
  font-weight: 600;
  color: #555;
  border-bottom: 1px solid #ddd;
  font-size: 0.75rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.excel-notes-table td {
  padding: 2px 3px;
  border-bottom: 1px solid #eee;
  vertical-align: middle;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.excel-notes-table tbody tr:last-child td {
  border-bottom: none;
}

.excel-notes-table input[type="text"] {
  width: 100%;
  padding: 4px 5px;
  border: 1px solid transparent;
  border-radius: 2px;
  font-size: 0.8rem;
  background: transparent;
  box-sizing: border-box;
  min-width: 0;
}

.excel-notes-table .note-content {
  width: 100%;
  min-width: 0;
}

.excel-notes-table input[type="text"]:focus {
  outline: none;
  border-color: #007bff;
  background: white;
}

.excel-notes-table input[readonly] {
  background: #f8f9fa;
  color: #666;
  cursor: default;
}

.excel-notes-table .note-date {
  text-align: center;
}

.excel-notes-table .note-time {
  text-align: center;
}

.btn-remove-note {
  width: 18px;
  height: 18px;
  padding: 0;
  border: none;
  background: #f8d7da;
  color: #dc3545;
  border-radius: 50%;
  cursor: pointer;
  font-size: 11px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-remove-note:hover:not(:disabled) {
  background: #dc3545;
  color: white;
}

.btn-remove-note:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-edit-note {
  width: 18px;
  height: 18px;
  padding: 0;
  border: none;
  background: #e2e6ea;
  color: #495057;
  border-radius: 50%;
  cursor: pointer;
  font-size: 10px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-edit-note:hover {
  background: #4a90d9;
  color: white;
}

.note-actions-cell {
  text-align: center;
  white-space: nowrap;
  padding: 2px !important;
}

.note-actions-cell button {
  display: inline-flex;
  vertical-align: middle;
  margin: 0 1px;
}

.note-author {
  font-size: 0.7rem;
  color: #666;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 2px !important;
}

.btn-add-note {
  display: block;
  width: 100%;
  padding: 5px;
  background: #e9ecef;
  border: none;
  border-top: 1px solid #ddd;
  color: #555;
  font-size: 0.75rem;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-add-note:hover:not(:disabled) {
  background: #dee2e6;
}

.btn-add-note:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.collateral-notes {
  width: 100%;
  min-height: 60px;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 0.85rem;
  resize: vertical;
  font-family: inherit;
  box-sizing: border-box;
}

.collateral-notes:focus {
  outline: none;
  border-color: #999;
}

.collateral-notes::placeholder {
  color: #aaa;
}

/* 연락처+통신사 그룹 스타일 */
.phone-carrier-group {
  display: flex;
  gap: 5px;
  align-items: center;
}

.phone-carrier-group input[type="text"] {
  flex: 1;
  min-width: 140px;
}

.carrier-select {
  width: 90px;
  padding: 8px 5px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 0.85rem;
  background: white;
  cursor: pointer;
}

.carrier-select:focus {
  outline: none;
  border-color: #999;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.05);
}

/* 생년월일 입력 스타일 */
.birth-date-input {
  display: flex;
  align-items: center;
  gap: 5px;
}

.birth-input {
  padding: 8px 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 0.9rem;
  text-align: center;
}

.birth-input.birth-front {
  width: 100px;
}

.birth-input:focus {
  outline: none;
  border-color: #999;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.05);
}

.birth-input.birth-gender {
  width: 45px;
}

.birth-separator {
  font-size: 1.2rem;
  font-weight: bold;
  color: #555;
  margin: 0 2px;
}

/* 연락처 폼 그룹 (3:1 비율) */
.form-group-phone {
  flex: 3 !important;
}

/* 통신사 폼 그룹 (3:1 비율) */
.form-group-carrier {
  flex: 1 !important;
}

.form-group-carrier .carrier-select {
  width: 100%;
}

/* 작은 폼 그룹 (미사용) */
.form-group-small {
  flex: 0 0 auto !important;
  width: 130px;
  min-width: 100px;
}

/* 이름 필드 절반 길이 (미사용) */
.form-group-half {
  flex: 0.5 !important;
  max-width: 200px;
}

/* 주소 라벨 행 */
.address-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.address-label-row > label:first-child {
  margin-bottom: 0;
}

/* 체크박스 스타일 */
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  color: #555;
  font-weight: normal;
}

.checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: #333;
}

.checkbox-label span {
  user-select: none;
}

/* 광고 체크박스 인라인 (진행상태 라벨 우측, 즉발 여부와 동일 스타일) */
.ad-customer-inline {
  display: inline-flex !important;
  align-items: center;
  margin-left: auto;
  font-size: 0.75rem;
  font-weight: normal;
  color: #d35400;
  gap: 4px;
  white-space: nowrap;
}

.ad-customer-inline input[type="checkbox"] {
  width: 14px !important;
  height: 14px !important;
  margin: 0 !important;
  flex-shrink: 0;
  accent-color: #d35400;
}

.ad-customer-inline span {
  font-size: 0.7rem;
  white-space: nowrap;
}

/* 비활성화된 광고 체크박스 (일반 사원용) */
.ad-customer-inline input[type="checkbox"]:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.ad-customer-inline:has(input[type="checkbox"]:disabled) {
  cursor: not-allowed;
  opacity: 0.7;
}

.form-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid #eee;
}

.form-actions-right {
  display: flex;
  gap: 10px;
  margin-left: auto;
}

/* 빈 상태 메시지 */
.empty-message {
  text-align: center;
  padding: 60px 20px;
  color: #888;
}

.empty-message h3 {
  font-size: 1.2rem;
  margin-bottom: 10px;
}

/* 반응형 */
@media (max-width: 768px) {
  /* 모바일에서 AI시세 체크박스 아래로 배치 */
  .price-header-with-ai {
    flex-direction: column;
    align-items: flex-start !important;
    gap: 2px;
  }
  
  /* 모바일에서 AI시세 체크박스+텍스트 왼쪽 정렬, 붙어있게 */
  .ai-price-checkbox-label {
    justify-content: flex-start;
    gap: 2px;
  }
  
  .price-header-with-btn {
    flex-wrap: wrap;
    gap: 4px;
  }
  
  .price-header-with-btn .btn-apply-past {
    order: 1;
  }
  
  /* 모바일에서 지번주소 입력란 + 버튼 세로 배치 */
  .address-detail-input-wrapper {
    flex-direction: column;
    align-items: stretch;
  }
  
  .address-detail-input-wrapper .btn-fetch-address {
    width: 100%;
  }

  /* 모바일 DB 탭 스타일 - 명확하게 */
  .db-tabs {
    margin: 0 8px 10px 8px;
    gap: 4px;
    flex-wrap: nowrap;
    border-bottom: 2px solid #666;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0;
  }
  
  .db-tab-btn {
    padding: 8px 10px;
    font-size: 0.75rem;
    gap: 4px;
    flex-shrink: 0;
    border-radius: 6px 6px 0 0;
    font-weight: 500;
  }
  
  .db-tab-btn .tab-count {
    padding: 2px 6px;
    font-size: 0.65rem;
    min-width: 20px;
    text-align: center;
    border-radius: 8px;
  }
  
  .db-tab-btn.active {
    border-bottom-width: 3px;
    font-weight: 700;
    background: #e3f2fd;
    color: #1565c0;
  }
  
  .db-tab-btn.active .tab-count {
    background: #1565c0;
    color: #fff;
  }
  
  .db-tab-btn[data-tab="public"].active {
    background: #f3e5f5;
    color: #7b1fa2;
  }
  
  .db-tab-btn[data-tab="public"].active .tab-count {
    background: #7b1fa2;
  }
  
  /* 모바일 탭 구분선 */
  .custom-tabs-divider {
    padding: 0 6px;
    margin: 0;
    flex-shrink: 0;
    align-self: center;
  }
  
  .custom-tabs-divider .divider-pipe {
    width: 2px;
    height: 20px;
    background: #666;
    border-radius: 1px;
  }
  
  /* 모바일 탭 추가 버튼 */
  .add-tab-btn {
    padding: 6px 10px !important;
    min-width: 32px !important;
    flex-shrink: 0;
    font-size: 1rem !important;
  }
  
  .add-tab-btn span {
    font-size: 1.1rem;
    font-weight: 600;
  }
  
  /* 커스텀 탭 컨테이너 */
  #customTabsContainer {
    gap: 4px;
    flex-shrink: 0;
  }
  
  /* 공개 DB 안내 메시지 - 모바일 */
  .public-db-info {
    margin: 0 8px 10px 8px;
    padding: 10px 12px;
    font-size: 0.8rem;
    flex-direction: column;
    gap: 10px;
    text-align: center;
    line-height: 1.4;
  }
  
  .public-db-info .btn {
    padding: 10px 16px;
    font-size: 0.8rem;
    width: 100%;
    font-weight: 600;
  }
  
  .assign-staff-select {
    padding: 8px 10px;
    font-size: 0.8rem;
    width: 100%;
  }
  
  .form-row {
    flex-direction: column;
    gap: 0;
  }
  
  .form-row .form-group {
    margin-bottom: 20px;
  }
  
  header {
    flex-direction: column;
    gap: 15px;
    text-align: center;
  }
  
  header h1 {
    font-size: 1.4rem;
  }
  
  .table-container {
    overflow-x: auto;
  }
  
  table {
    min-width: 600px;
  }
  
  .type-region-section .address-row {
    flex-wrap: wrap;
  }
  
  .price-row {
    flex-direction: column;
  }
  
  .complex-row {
    flex-wrap: wrap !important;
  }
  
  .complex-row > .btn-kb-fetch {
    flex: 1 1 100%;
    width: 100%;
    margin-top: 6px;
    order: 10; /* 맨 아래로 배치 */
  }
  
  .complex-wrapper {
    min-width: 100px;
  }
  
  .debt-row {
    flex-direction: column;
    align-items: stretch;
  }
  
  .debt-field input,
  .debt-field select {
    width: 100% !important;
  }
  
  .btn-remove-debt {
    margin-left: 0;
    width: 100%;
  }
  
  .residence-options {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* 자동 입력 툴팁 (클릭형으로 변경) */
.auto-fill-tooltip {
  position: absolute;
  background: #333;
  color: #fff;
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 0.8rem;
  line-height: 1.5;
  white-space: nowrap;
  z-index: 1001;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  top: calc(100% + 8px);
  left: 0;
}

.auto-fill-tooltip::before {
  content: '';
  position: absolute;
  top: -6px;
  left: 20px;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-bottom: 6px solid #333;
}

/* 클릭형 툴팁 (사라지지 않음) - 단지선택 섹션 기준 */
.click-tooltip {
  position: absolute;
  background: #333;
  color: #fff;
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 0.8rem;
  line-height: 1.5;
  z-index: 1001;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  max-width: 100%;
  white-space: normal;
  word-break: keep-all;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
}

.click-tooltip::before {
  content: '';
  position: absolute;
  top: -6px;
  right: 80px;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-bottom: 6px solid #333;
}

.btn-manual-input {
  position: relative;
}

/* 면적별 시세 표시 영역 */
.area-price-container {
  margin: 15px 0;
  padding: 15px;
  background: #f8f9fa;
  border-radius: 8px;
  border: 1px solid #e9ecef;
}

.area-price-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.area-price-section h5 {
  margin: 0;
  font-size: 0.95rem;
  color: #333;
}

.btn-unit-toggle {
  background: #fff;
  border: 1px solid #3498db;
  color: #3498db;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-unit-toggle:hover {
  background: #3498db;
  color: #fff;
}

.area-price-table {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.area-price-header,
.area-price-row {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 4px;
}

.area-price-header {
  background: #e9ecef;
  font-weight: 600;
  font-size: 0.85rem;
  color: #495057;
}

.area-price-row {
  background: #fff;
  border: 1px solid #e9ecef;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.15s;
}

.area-price-row:hover {
  background: #e3f2fd;
  border-color: #2196f3;
}

.area-col {
  flex: 1.2;
  min-width: 100px;
}

.price-col {
  flex: 1;
  text-align: right;
  min-width: 90px;
}

.area-price-row .price-low {
  color: #27ae60;
}

.area-price-row .price-mid {
  color: #2980b9;
  font-weight: 600;
}

.area-price-row .price-high {
  color: #e74c3c;
}

.area-price-note {
  margin: 10px 0 0 0;
  font-size: 0.8rem;
  color: #6c757d;
  text-align: center;
}

/* 고객 리스트 스타일 */
.list-collateral-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.list-collateral-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.collateral-type-badge.small {
  font-size: 0.65rem;
  padding: 1px 4px;
}

.list-collateral-address {
  font-size: 0.85rem;
  color: #333;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 250px;
}

.list-collateral-prices {
  display: flex;
  gap: 10px;
  font-size: 0.75rem;
}

.list-price {
  white-space: nowrap;
}

.list-price.past {
  color: #7f8c8d;
}

.list-price.current {
  color: #e67e22;
  font-weight: 600;
}

/* 고객 리스트 시세 정보 */
.list-price-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.65rem;
  white-space: normal;
  line-height: 1.3;
  text-align: center;
}

.list-price-row {
  padding: 0;
  text-align: center;
  white-space: nowrap;
}

.list-price-row.past {
  color: inherit;
  text-align: center;
}

.list-price-row.current {
  color: inherit;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-align: center;
}

/* LTV 계산 기준 시세 표시 (빨간색) */
.ltv-ref {
  color: #dc3545;
  font-weight: 700;
}

/* 시세 등락 표시 */
.price-change {
  font-size: 0.6rem;
  font-weight: 700;
  padding: 0 2px;
  border-radius: 2px;
  white-space: nowrap;
}

.price-change.up {
  color: #dc3545;
  background-color: rgba(220, 53, 69, 0.1);
}

.price-change.down {
  color: #0d6efd;
  background-color: rgba(13, 110, 253, 0.1);
}

.price-change.same {
  color: #6c757d;
  background-color: rgba(108, 117, 125, 0.1);
}

/* 시세 소스 표시 */
.price-source {
  font-size: 0.55rem;
  font-weight: 600;
  padding: 0 2px;
  border-radius: 2px;
  white-space: nowrap;
  margin-right: 2px;
}

.price-source.kb {
  color: #ff8c00;
  background-color: rgba(255, 140, 0, 0.15);
}

.price-source.howsmuch {
  color: #2196f3;
  background-color: rgba(33, 150, 243, 0.15);
}

.price-source.manual {
  color: #9c27b0;
  background-color: rgba(156, 39, 176, 0.15);
}

/* 고객 리스트 채권 정보 */
.list-debt-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.65rem;
  white-space: normal;
  line-height: 1.3;
}

.list-debt-row {
  padding: 0;
  white-space: nowrap;
}

.list-debt-row.setup {
  color: inherit;
}

.list-debt-row.amount {
  color: inherit;
  font-weight: 600;
}

/* 소액임차LTV 정보 */
.list-ltv-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.65rem;
  white-space: normal;
  line-height: 1.3;
}

.list-ltv-row {
  padding: 0;
  white-space: nowrap;
}

.list-ltv-row.setup {
  color: inherit;
  font-weight: normal;
}

.list-ltv-row.debt {
  color: inherit;
  font-weight: 600;
}

/* 직군/연봉 정보 */
.list-job-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.8rem;
  white-space: nowrap;
}

.list-job-row {
  padding: 1px 0;
}

.list-job-row.occupation {
  color: inherit;
  font-weight: 500;
}

.list-job-row.salary {
  color: inherit;
}

/* LTV/DTI 비율 정보 */
.list-ratio-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.95rem;
  white-space: nowrap;
}

.list-ratio-row {
  padding: 1px 0;
  font-weight: 600;
}

.list-ratio-row.ltv {
  color: inherit;
}

.list-ratio-row.dti {
  color: inherit;
}

/* 주소 셀 */
.address-cell {
  max-width: 220px;
  text-align: center !important;
}

.address-multi-line {
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: center;
}

.address-kb {
  font-weight: 500;
  color: inherit;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.address-road {
  font-size: 0.8rem;
  color: #666;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 연봉 셀 */
.salary-cell {
  color: inherit;
  font-weight: 500;
  white-space: nowrap;
}

/* LTV/DTI 셀 */
.ltv-cell {
  color: inherit;
  font-weight: 600;
}

.dti-cell {
  color: inherit;
  font-weight: 600;
}

/* 테이블 컬럼 너비 조정 (14컬럼 + 담당직원) */
#customerTable th,
#customerTable td {
  font-size: 0.72rem;
  padding: 6px 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
}

#customerTable thead {
  overflow: visible;
}

#customerTable th {
  white-space: nowrap;
  font-size: 0.7rem;
}

/* 고객 이름 셀 - 클릭 가능 스타일 */
#customerTable .name-cell {
  cursor: pointer;
}

#customerTable .name-cell .customer-name-link {
  color: #1565c0;
  transition: all 0.15s ease;
  padding: 2px 6px;
  border-radius: 4px;
  display: inline-block;
}

#customerTable .name-cell:hover .customer-name-link {
  background: #e3f2fd;
  color: #0d47a1;
  text-decoration: underline;
}

#customerTable .name-cell:active .customer-name-link {
  background: #bbdefb;
}

/* 주소 셀 - 복사 가능 스타일 */
#customerTable .address-cell {
  cursor: copy;
}

#customerTable .address-cell .address-copy-area {
  transition: all 0.15s ease;
  padding: 2px 4px;
  border-radius: 3px;
}

#customerTable .address-cell:hover .address-copy-area {
  background: #fff3e0;
}

#customerTable .address-cell:active .address-copy-area {
  background: #ffe0b2;
}

/* 시세/설정채권/소액임차LTV 컬럼은 여러 줄 허용 */
#customerTable .list-price-info,
#customerTable .list-debt-info,
#customerTable .list-ltv-info {
  white-space: normal;
}

/* 최적화 버튼 활성화 상태 */
#settingsResetBtn.active {
  background: linear-gradient(135deg, #4CAF50, #45a049);
  color: white;
  border-color: #45a049;
  box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
}

#settingsResetBtn.active::before {
  content: '✓ ';
}

/* 테이블 헤더 리사이즈 핸들 */
#customerTable th.resizable-header {
  position: relative;
}

#customerTable th .resize-handle {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 6px;
  cursor: col-resize;
  background: transparent;
  z-index: 10;
  transition: background-color 0.2s;
}

#customerTable th .resize-handle:hover,
#customerTable th .resize-handle.active {
  background: linear-gradient(to right, transparent, rgba(66, 133, 244, 0.5), transparent);
}

#customerTable th .resize-handle::after {
  content: '';
  position: absolute;
  right: 2px;
  top: 50%;
  transform: translateY(-50%);
  width: 2px;
  height: 14px;
  background: #ccc;
  border-radius: 1px;
  opacity: 0;
  transition: opacity 0.2s;
}

#customerTable th:hover .resize-handle::after,
#customerTable th .resize-handle.active::after {
  opacity: 1;
}

body.dark-mode #customerTable th .resize-handle:hover,
body.dark-mode #customerTable th .resize-handle.active {
  background: linear-gradient(to right, transparent, rgba(100, 180, 255, 0.4), transparent);
}

body.dark-mode #customerTable th .resize-handle::after {
  background: #666;
}

/* 리사이즈 중 선택 방지 */
body.column-resizing {
  cursor: col-resize !important;
  user-select: none !important;
}

body.column-resizing * {
  cursor: col-resize !important;
}

/* 정렬 가능한 테이블 헤더 */
#customerTable th.sortable {
  cursor: pointer;
  user-select: none;
  position: relative;
  transition: background-color 0.2s;
}
#customerTable th.sortable:hover {
  background-color: #e9ecef;
}
#customerTable th .sort-icon {
  font-size: 0.7em;
  margin-left: 4px;
  opacity: 0.3;
}
#customerTable th.sort-asc .sort-icon::after {
  content: '▲';
  opacity: 1;
}
#customerTable th.sort-desc .sort-icon::after {
  content: '▼';
  opacity: 1;
}
#customerTable th.sort-asc .sort-icon,
#customerTable th.sort-desc .sort-icon {
  opacity: 1;
}

/* 컬럼 너비: 등록일, 이름, 연락처, 직군, 연봉, 형태, 주소, 거주형태, 시세, 채권, LTV, DTI, 상태, 사업대, 담당직원 */
#customerTable th:nth-child(1),
#customerTable td:nth-child(1) { width: 62px; } /* 등록일 */
#customerTable th:nth-child(2),
#customerTable td:nth-child(2) { width: 45px; } /* 이름 */
#customerTable th:nth-child(3),
#customerTable td:nth-child(3) { width: 85px; } /* 연락처 */
#customerTable th:nth-child(4),
#customerTable td:nth-child(4) { width: 45px; } /* 직군 */
#customerTable th:nth-child(5),
#customerTable td:nth-child(5) { width: 55px; } /* 연봉 */
#customerTable th:nth-child(6),
#customerTable td:nth-child(6) { width: 45px; } /* 형태 */
#customerTable th:nth-child(7),
#customerTable td:nth-child(7) { width: auto; min-width: 70px; } /* 주소 */
#customerTable th:nth-child(8),
#customerTable td:nth-child(8) { width: 45px; } /* 거주형태 */
#customerTable th:nth-child(9),
#customerTable td:nth-child(9) { width: 140px; } /* 시세 */
#customerTable th:nth-child(10),
#customerTable td:nth-child(10) { width: 75px; } /* 채권 */
#customerTable th:nth-child(11),
#customerTable td:nth-child(11) { width: 35px; } /* LTV */
#customerTable th:nth-child(12),
#customerTable td:nth-child(12) { width: 35px; } /* DTI */
#customerTable th:nth-child(13),
#customerTable td:nth-child(13) { width: 50px; } /* 상태 */
#customerTable th:nth-child(14),
#customerTable td:nth-child(14) { width: 60px; } /* 사업대 */
#customerTable th:nth-child(15),
#customerTable td:nth-child(15) { width: 70px; } /* 담당직원 */

.business-loan-cell {
  font-weight: 600;
  color: #2196F3;
  font-size: 0.68rem;
}

/* 등록일 셀 */
.created-at-cell {
  font-size: 0.68rem;
  color: #666;
  text-align: center;
  white-space: nowrap;
}

/* 관리자용 담당직원 컬럼 */
.staff-cell {
  padding: 2px 4px;
}

.staff-select {
  padding: 3px 5px;
  border: 1px solid #ddd;
  border-radius: 3px;
  font-size: 0.68rem;
  background: #fff;
  cursor: pointer;
  min-width: 60px;
  width: 100%;
}

.staff-select:hover {
  border-color: #4CAF50;
}

.staff-select:focus {
  outline: none;
  border-color: #4CAF50;
  box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.2);
}

/* 관리자용 담당직원 필드 (모달) */
.form-group-staff {
  flex: 0 0 130px !important;
  width: 130px !important;
  max-width: 130px !important;
  min-width: 130px !important;
}

.form-group-staff select {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 0.85rem;
}

/* 미배정 고객 자동 배정 버튼 */
.btn-auto-assign {
  padding: 8px 16px;
  font-size: 0.85rem;
  background: #ff9800;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-auto-assign:hover {
  background: #f57c00;
}

/* 이관 버튼 (1차 → 2차) */
.btn-transfer {
  padding: 8px 16px;
  font-size: 0.85rem;
  background: #17a2b8;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-transfer:hover {
  background: #138496;
}

/* 역이관 버튼 (2차 → 1차) */
.btn-revert-transfer {
  padding: 8px 16px;
  font-size: 0.85rem;
  background: #6c757d;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-revert-transfer:hover {
  background: #5a6268;
}

/* 공개DB 이관 버튼 (2차 → 공개DB) */
.btn-to-public {
  padding: 8px 16px;
  font-size: 0.85rem;
  background: #fd7e14;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-to-public:hover {
  background: #e96f0a;
}

/* 공개DB 가져오기 버튼 */
.btn-claim-public {
  padding: 8px 16px;
  font-size: 0.85rem;
  background: #20c997;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-claim-public:hover {
  background: #1aa87f;
}

/* 배정 버튼 (2차 관리자용) */
.btn-assign {
  padding: 8px 16px;
  font-size: 0.85rem;
  background: #28a745;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-assign:hover {
  background: #218838;
}

/* 공개 DB 이관 버튼 */
.btn-public {
  padding: 8px 16px;
  font-size: 0.85rem;
  background: #6f42c1;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-public:hover {
  background: #5a32a3;
}

/* DB 탭 (내 DB / 공개 DB) */
.db-tabs {
  display: flex;
  gap: 0;
  margin: 0 20px 10px 20px;
  border-bottom: 2px solid #e0e0e0;
}

.db-tab-btn {
  padding: 10px 24px;
  font-size: 0.95rem;
  font-weight: 500;
  background: transparent;
  color: #666;
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: -2px;
}

.db-tab-btn:hover {
  color: #333;
  background: #f5f5f5;
}

.db-tab-btn.active {
  color: #1976d2;
  border-bottom-color: #1976d2;
  font-weight: 600;
}

.db-tab-btn .tab-count {
  background: #e0e0e0;
  color: #666;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.8rem;
  font-weight: 500;
}

.db-tab-btn.active .tab-count {
  background: #1976d2;
  color: #fff;
}

/* 공개 DB 탭 활성화 시 */
.db-tab-btn[data-tab="public"].active {
  color: #6f42c1;
  border-bottom-color: #6f42c1;
}

.db-tab-btn[data-tab="public"].active .tab-count {
  background: #6f42c1;
}

/* 커스텀 탭 컨테이너 */
#customTabsContainer {
  display: flex;
  gap: 8px;
}

/* 탭 추가 버튼 */
.add-tab-btn {
  min-width: 36px !important;
  padding: 6px 12px !important;
  background: transparent !important;
  border: none !important;
  color: #888 !important;
}

.add-tab-btn:hover {
  background: #f0f0f0 !important;
  border: none !important;
  color: #333 !important;
}

.add-tab-btn span {
  font-size: 1.2rem;
  font-weight: bold;
}

/* 커스텀 탭 버튼 */
.db-tab-btn.custom-tab {
  position: relative;
  padding-right: 28px !important;
}

.db-tab-btn.custom-tab .tab-edit-btn {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 16px;
  line-height: 22px;
  padding: 0;
  opacity: 0;
  transition: all 0.2s;
  color: #666;
  display: flex;
  align-items: center;
  justify-content: center;
}

.db-tab-btn.custom-tab .tab-edit-btn:focus {
  outline: none;
}

.db-tab-btn.custom-tab:hover .tab-edit-btn {
  opacity: 0.7;
}

.db-tab-btn.custom-tab .tab-edit-btn:hover {
  opacity: 1;
  background: rgba(0,0,0,0.1);
  color: #333;
}

/* 커스텀 탭 구분선 */
.custom-tabs-divider {
  display: flex;
  align-items: center;
  padding: 0 8px;
  margin: 0 4px;
}

.custom-tabs-divider .divider-pipe {
  width: 2px;
  height: 24px;
  background: #555;
  border-radius: 1px;
}

/* 커스텀 탭 모달 */
.custom-tab-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

.custom-tab-modal-content {
  background: white;
  border-radius: 12px;
  width: 90%;
  max-width: 520px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.custom-tab-modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

/* 탭 이름 입력 영역 */
.ct-tab-name-wrapper {
  padding: 12px 20px;
  border-bottom: 1px solid #eee;
  flex-shrink: 0;
}

.ct-tab-name-wrapper .tab-name-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 0.95rem;
}

/* 설정 탭 버튼 */
.ct-settings-tabs {
  display: flex;
  padding: 0 20px;
  border-bottom: 1px solid #eee;
  flex-shrink: 0;
}

.ct-settings-tab {
  padding: 10px 20px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  font-size: 0.9rem;
  color: #666;
  cursor: pointer;
  transition: all 0.2s;
}

.ct-settings-tab:hover {
  color: #333;
}

.ct-settings-tab.active {
  color: #2196f3;
  border-bottom-color: #2196f3;
}

/* 설정 탭 내용 */
.ct-settings-content {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.ct-settings-content .custom-tab-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
}

/* 필터 설정 푸터 */
.ct-filter-footer,
.ct-table-footer {
  padding: 12px 20px;
  border-top: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.ct-filter-list-wrapper,
.ct-settings-list-wrapper {
  position: relative;
}

.ct-filter-list-wrapper .filter-preset-popup,
.ct-settings-list-wrapper .settings-preset-popup {
  position: absolute;
  bottom: calc(100% + 8px);
  right: 0;
  min-width: 200px;
  z-index: 1001;
}

/* 테이블 설정 내용 */
.ct-table-settings-body {
  padding: 16px 20px;
}

.ct-font-size-control {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid #eee;
}

.ct-font-size-control label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #555;
}

.ct-font-size-control .font-size-btns {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ct-font-size-control .font-size-btns button {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid #ddd;
  background: #f5f5f5;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: bold;
  transition: all 0.2s;
}

.ct-font-size-control .font-size-btns button:hover {
  background: #2196f3;
  color: white;
  border-color: #2196f3;
}

.ct-font-size-control #ctFontSizeValue {
  min-width: 40px;
  text-align: center;
  font-size: 0.9rem;
  font-weight: bold;
}

/* 컬럼 너비 설정 */
.ct-column-widths-section h4 {
  font-size: 0.85rem;
  font-weight: 600;
  color: #555;
  margin: 0 0 12px 0;
}

.ct-column-widths-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 300px;
  overflow-y: auto;
}

.ct-column-width-item {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ct-column-width-item label {
  flex: 0 0 100px;
  font-size: 0.8rem;
  color: #555;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ct-column-width-item input {
  width: 70px;
  padding: 6px 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 0.85rem;
  text-align: right;
}

.ct-column-width-item span {
  font-size: 0.8rem;
  color: #999;
}

.custom-tab-modal-header h3 {
  margin: 0;
  font-size: 1.1rem;
}

.modal-close-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #999;
  line-height: 1;
}

.modal-close-btn:hover {
  color: #333;
}

.custom-tab-modal-body {
  padding: 16px 20px;
  max-height: 60vh;
  overflow-y: auto;
}

/* 탭 이름 입력 섹션 */
.custom-tab-modal-body .tab-name-section {
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid #eee;
}

.custom-tab-modal-body .tab-name-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 0.95rem;
}

/* 필터 섹션 - 메인 필터 팝업과 동일한 스타일 */
.custom-tab-modal-body .filter-section {
  margin-bottom: 16px;
}

.custom-tab-modal-body .filter-section h4 {
  font-size: 0.85rem;
  font-weight: 600;
  color: #555;
  margin: 0 0 8px 0;
}

.custom-tab-modal-body .filter-checkboxes {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.custom-tab-modal-body .filter-chip {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  background: #f5f5f5;
  border: 1px solid #ddd;
  border-radius: 16px;
  cursor: pointer;
  font-size: 0.8rem;
  transition: all 0.2s;
}

.custom-tab-modal-body .filter-chip:hover {
  background: #e8e8e8;
}

.custom-tab-modal-body .filter-chip input[type="checkbox"] {
  display: none;
}

.custom-tab-modal-body .filter-chip:has(input:checked) {
  background: #e3f2fd;
  border-color: #2196f3;
  color: #1976d2;
}

/* 날짜 버튼 */
.custom-tab-modal-body .filter-date-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.custom-tab-modal-body .filter-date-range {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.custom-tab-modal-body .date-range-inputs {
  display: flex;
  align-items: center;
  gap: 6px;
}

.custom-tab-modal-body .date-range-inputs input[type="date"] {
  padding: 6px 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 0.8rem;
}

/* 범위 토글 필터 */
.custom-tab-modal-body .filter-toggle-range {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.custom-tab-modal-body .range-toggle.active {
  background: #e3f2fd;
  border-color: #2196f3;
  color: #1976d2;
}

.custom-tab-modal-body .range-inputs {
  display: flex;
  align-items: center;
  gap: 6px;
}

.custom-tab-modal-body .range-inputs input[type="number"] {
  width: 70px;
  padding: 6px 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 0.8rem;
}

.custom-tab-modal-body .range-inputs span {
  color: #999;
  font-size: 0.85rem;
}

/* 커스텀 탭 모달 푸터 */
.custom-tab-modal-footer {
  padding: 12px 20px;
  border-top: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.custom-tab-footer-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ct-filter-list-wrapper {
  position: relative;
}

.ct-filter-list-wrapper .filter-preset-popup {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  min-width: 200px;
  z-index: 1001;
}

/* 커스텀 탭 날짜 버튼 활성화 스타일 */
.ct-date-btn.active {
  background: #e3f2fd !important;
  border-color: #2196f3 !important;
  color: #1976d2 !important;
}

/* 다크모드 커스텀 탭 모달 */
body.dark-mode .custom-tab-modal-content {
  background: #2d2d2d;
  color: #e0e0e0;
}

body.dark-mode .custom-tab-modal-header {
  border-bottom-color: #444;
}

body.dark-mode .custom-tab-modal-footer {
  border-top-color: #444;
}

body.dark-mode .custom-tab-modal-body input,
body.dark-mode .custom-tab-modal-body select {
  background: #3d3d3d;
  border-color: #555;
  color: #e0e0e0;
}

body.dark-mode .filter-option .filter-chip {
  background: #3d3d3d;
  border-color: #555;
  color: #ccc;
}

body.dark-mode .custom-tab-modal-body .filter-chip {
  background: #3d3d3d;
  border-color: #555;
  color: #ccc;
}

body.dark-mode .custom-tab-modal-body .filter-chip:hover {
  background: #4d4d4d;
}

body.dark-mode .custom-tab-modal-body .filter-chip:has(input:checked) {
  background: #1e3a5f;
  border-color: #2196f3;
  color: #64b5f6;
}

body.dark-mode .custom-tab-modal-body .filter-section h4 {
  color: #aaa;
}

body.dark-mode .custom-tab-modal-body .tab-name-section {
  border-bottom-color: #444;
}

body.dark-mode .custom-tab-modal-body .range-toggle.active {
  background: #1e3a5f;
  border-color: #2196f3;
  color: #64b5f6;
}

body.dark-mode .ct-date-btn.active {
  background: #1e3a5f !important;
  border-color: #2196f3 !important;
  color: #64b5f6 !important;
}

/* 다크모드 - 커스텀 탭 구분선 */
body.dark-mode .custom-tabs-divider .divider-pipe {
  background: #555;
}

/* 다크모드 - 커스텀 탭 모달 설정 탭 */
body.dark-mode .ct-tab-name-wrapper {
  border-bottom-color: #444;
}

body.dark-mode .ct-tab-name-wrapper .tab-name-input {
  background: #3d3d3d;
  border-color: #555;
  color: #fff;
}

body.dark-mode .ct-settings-tabs {
  border-bottom-color: #444;
}

body.dark-mode .ct-settings-tab {
  color: #888;
}

body.dark-mode .ct-settings-tab:hover {
  color: #bbb;
}

body.dark-mode .ct-settings-tab.active {
  color: #64b5f6;
  border-bottom-color: #2196f3;
}

body.dark-mode .ct-filter-footer,
body.dark-mode .ct-table-footer {
  border-top-color: #444;
}

body.dark-mode .ct-font-size-control {
  border-bottom-color: #444;
}

body.dark-mode .ct-font-size-control label {
  color: #aaa;
}

body.dark-mode .ct-font-size-control .font-size-btns button {
  background: #3d3d3d;
  border-color: #555;
  color: #ccc;
}

body.dark-mode .ct-font-size-control .font-size-btns button:hover {
  background: #1e88e5;
  border-color: #1e88e5;
  color: white;
}

body.dark-mode .ct-font-size-control #ctFontSizeValue {
  color: #fff;
}

body.dark-mode .ct-column-widths-section h4 {
  color: #aaa;
}

body.dark-mode .ct-column-width-item label {
  color: #bbb;
}

body.dark-mode .ct-column-width-item input {
  background: #3d3d3d;
  border-color: #555;
  color: #fff;
}

body.dark-mode .ct-column-width-item span {
  color: #888;
}

body.dark-mode .add-tab-btn {
  background: transparent !important;
  border: none !important;
  color: #aaa !important;
}

body.dark-mode .add-tab-btn:hover {
  background: #3d3d3d !important;
  border: none !important;
  color: #fff !important;
}

/* 공개 DB 안내 메시지 */
.public-db-info {
  margin: 0 20px 10px 20px;
  padding: 10px 16px;
  background: #f3e5f5;
  border: 1px solid #ce93d8;
  border-radius: 6px;
  color: #6a1b9a;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 12px;
}

.public-db-info .btn {
  padding: 6px 14px;
  font-size: 0.85rem;
  white-space: nowrap;
}

/* 배정 직원 선택 */
.assign-staff-select {
  padding: 8px 12px;
  font-size: 0.85rem;
  border: 1px solid #ddd;
  border-radius: 6px;
  background: #fff;
}

/* 체크박스 컬럼 */
.checkbox-column {
  width: 40px;
  text-align: center;
}

.customer-checkbox,
.public-customer-checkbox {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

/* 이관된 고객 표시 */
tr.transferred-customer {
  background-color: #f8f9fa;
  opacity: 0.7;
}

tr.transferred-customer td {
  color: #999;
}

/* 필터 바 */
.filter-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  margin-bottom: 20px;
}

.filter-bar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* 관리자 버튼 행 - 데스크탑에서는 인라인 표시 */
.filter-bar-left .admin-buttons-row {
  display: contents;
}

.filter-bar-left input[type="text"] {
  padding: 10px 15px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 0.9rem;
  width: 280px;
}

.filter-bar-left input[type="text"]:focus {
  outline: none;
  border-color: #4CAF50;
}

.search-container {
  position: relative;
  display: flex;
  align-items: center;
}

.search-container input[type="text"] {
  padding-right: 35px;
}

.search-clear-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #999;
  font-size: 18px;
  cursor: pointer;
  padding: 2px;
  line-height: 1;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.15s;
}

.search-clear-btn:hover {
  background: rgba(0,0,0,0.1);
  color: #666;
}

.filter-bar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* 필터 버튼 */
.btn-filter {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: #f8f9fa;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn-filter:hover {
  background: #e9ecef;
  border-color: #adb5bd;
}

.filter-icon {
  font-size: 1rem;
}

.filter-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: #4CAF50;
  color: white;
  border-radius: 10px;
  font-size: 0.75rem;
  font-weight: bold;
}

/* 필터 팝업 */
.filter-btn-wrapper {
  position: relative;
  display: flex;
  gap: 8px;
  align-items: center;
}

.filter-popup {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 8px;
  width: 520px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  z-index: 1500;
  border: 1px solid #e5e5e5;
  overflow: visible;
}

.filter-popup.show {
  display: block;
}

.filter-popup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: #f8f9fa;
  border-bottom: 1px solid #e9ecef;
  gap: 10px;
}

.filter-popup-header h3 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: #333;
  flex-shrink: 0;
}

/* 툴팁 토글 버튼 */
.tooltip-toggle-btn {
  background: #e9ecef;
  border: none;
  border-radius: 4px;
  padding: 4px 8px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  color: #666;
  margin-left: auto;
  margin-right: 8px;
}

.tooltip-toggle-btn:hover {
  background: #dee2e6;
}

.tooltip-toggle-btn.active {
  background: #fff3cd;
  color: #856404;
}

.tooltip-toggle-btn .tooltip-text {
  font-size: 0.75rem;
  font-weight: 500;
}

.filter-close-btn {
  background: none;
  border: none;
  font-size: 1.4rem;
  color: #888;
  cursor: pointer;
  line-height: 1;
  padding: 4px;
  transition: color 0.2s;
}

.filter-close-btn:hover {
  color: #333;
}

.filter-popup-body {
  padding: 16px 20px;
  max-height: 420px;
  overflow-y: auto;
}

.filter-section {
  margin-bottom: 18px;
}

.filter-section:last-child {
  margin-bottom: 0;
}

.filter-section h4 {
  margin: 0 0 10px 0;
  font-size: 0.78rem;
  color: #666;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.filter-checkboxes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* 필터 칩 스타일 - 심플하고 컬러풀 */
.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  background: #f5f5f5;
  border-radius: 6px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.15s ease;
  border: 1px solid #e0e0e0;
  user-select: none;
}

.filter-chip:hover {
  background: #ebebeb;
}

/* 진행상태별 색상 */
.filter-chip[data-status="생성"]:has(input:checked),
.filter-chip[data-status="대기"]:has(input:checked) {
  background: #e3f2fd;
  border-color: #2196F3;
  color: #1565C0;
}

.filter-chip[data-status="상담완료"]:has(input:checked),
.filter-chip[data-status="관리중"]:has(input:checked),
.filter-chip[data-status="관리"]:has(input:checked) {
  background: #e8f5e9;
  border-color: #4CAF50;
  color: #2e7d32;
}

.filter-chip[data-status="진행중"]:has(input:checked) {
  background: #fff3e0;
  border-color: #FF9800;
  color: #e65100;
}

.filter-chip[data-status="진행완료"]:has(input:checked) {
  background: #e0f2f1;
  border-color: #009688;
  color: #00695c;
}

.filter-chip[data-status="보류"]:has(input:checked) {
  background: #fff8e1;
  border-color: #FFC107;
  color: #f57f17;
}

.filter-chip[data-status="성향불량"]:has(input:checked) {
  background: #ffebee;
  border-color: #f44336;
  color: #c62828;
}

.filter-chip[data-status="부재"]:has(input:checked) {
  background: #eceff1;
  border-color: #607d8b;
  color: #37474f;
}

/* 광고 여부 필터 선택 색상 */
.filter-chip[data-ad="normal"]:has(input:checked) {
  background: #e3f2fd;
  border-color: #2196F3;
  color: #1565C0;
}

.filter-chip[data-ad="ad"]:has(input:checked) {
  background: #fff3e0;
  border-color: #FF9800;
  color: #e65100;
}

/* 시세관리 필터 선택 색상 */
.filter-chip[data-price-mgmt="managed"]:has(input:checked) {
  background: #fff3e0;
  border-color: #FF9800;
  color: #e65100;
}

.filter-chip[data-price-mgmt="notManaged"]:has(input:checked) {
  background: #e3f2fd;
  border-color: #2196F3;
  color: #1565C0;
}

/* 기본 선택 색상 (직군, 유형, 거주형태 등) */
.filter-chip:has(input:checked) {
  background: #e8eaf6;
  border-color: #5c6bc0;
  color: #3949ab;
}

.filter-chip input[type="checkbox"] {
  display: none;
}

.filter-chip .chip-text {
  font-weight: 500;
}

.filter-chip .chip-count {
  font-size: 0.7rem;
  padding: 1px 6px;
  background: rgba(0,0,0,0.06);
  border-radius: 10px;
  font-weight: 600;
  min-width: 18px;
  text-align: center;
}

.filter-chip:has(input:checked) .chip-count {
  background: rgba(0,0,0,0.1);
}

/* 담당직원 드롭다운 검색 필터 */
.staff-filter-dropdown-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
}

.staff-filter-search-wrapper {
  position: relative;
  width: 100%;
}

.staff-filter-search {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 0.85rem;
  background: #fafafa;
  transition: all 0.15s;
}

.staff-filter-search:focus {
  outline: none;
  border-color: #5c6bc0;
  background: #fff;
}

.staff-filter-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  max-height: 200px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid #ddd;
  border-top: none;
  border-radius: 0 0 6px 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  z-index: 100;
}

.staff-filter-dropdown-item {
  padding: 8px 12px;
  cursor: pointer;
  font-size: 0.85rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background 0.15s;
}

.staff-filter-dropdown-item:hover {
  background: #f0f0f0;
}

.staff-filter-dropdown-item.selected {
  background: #e8eaf6;
  color: #5c6bc0;
}

.staff-filter-dropdown-item .staff-name {
  font-weight: 500;
}

.staff-filter-dropdown-item .staff-id {
  color: #888;
  font-size: 0.8rem;
}

.staff-filter-dropdown-item .staff-count {
  font-size: 0.75rem;
  color: #666;
  background: #f0f0f0;
  padding: 2px 6px;
  border-radius: 10px;
  min-width: 20px;
  text-align: center;
}

.staff-filter-selected {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.staff-filter-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  background: #e8eaf6;
  color: #5c6bc0;
  border-radius: 14px;
  font-size: 0.8rem;
}

.staff-filter-tag .tag-remove {
  cursor: pointer;
  font-weight: bold;
  font-size: 0.9rem;
  margin-left: 2px;
  color: #888;
  transition: color 0.15s;
}

.staff-filter-tag .tag-remove:hover {
  color: #e53935;
}

.staff-filter-no-result {
  padding: 10px 12px;
  color: #888;
  font-size: 0.85rem;
  text-align: center;
}

/* 다크모드 */
body.dark-mode .staff-filter-search {
  background: #2a2a2a;
  border-color: #444;
  color: #e0e0e0;
}

body.dark-mode .staff-filter-search:focus {
  border-color: #7986cb;
  background: #333;
}

body.dark-mode .staff-filter-dropdown {
  background: #2a2a2a;
  border-color: #444;
}

body.dark-mode .staff-filter-dropdown-item:hover {
  background: #333;
}

body.dark-mode .staff-filter-dropdown-item.selected {
  background: #3a3a5a;
}

body.dark-mode .staff-filter-dropdown-item .staff-id {
  color: #aaa;
}

body.dark-mode .staff-filter-dropdown-item .staff-count {
  background: #444;
  color: #aaa;
}

body.dark-mode .staff-filter-tag {
  background: #3a3a5a;
  color: #9fa8da;
}

.filter-range {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: #666;
}

.filter-range input[type="number"] {
  width: 80px;
  padding: 8px 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 0.82rem;
  background: #fafafa;
  transition: all 0.15s;
}

.filter-range input[type="number"]:focus {
  outline: none;
  border-color: #5c6bc0;
  background: #fff;
}

/* LTV/DTI/시세등락율 토글 범위 필터 */
.filter-toggle-range {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.filter-toggle-range .range-toggle {
  flex-shrink: 0;
}

.filter-toggle-range .range-toggle.active {
  background: #5c6bc0;
  color: white;
  border-color: #5c6bc0;
}

.filter-toggle-range .range-inputs {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: #666;
}

/* 소액임차LTV 필터 전용 스타일 (드롭다운 포함) */
#ltvRangeInputs,
#ctLtvRangeInputs {
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  margin-top: 8px;
}

#ltvRangeInputs .filter-select,
#ctLtvRangeInputs .filter-select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 0.82rem;
  background: #fafafa;
  color: #333;
  cursor: pointer;
  transition: all 0.15s;
}

#ltvRangeInputs .filter-select:focus,
#ctLtvRangeInputs .filter-select:focus {
  outline: none;
  border-color: #5c6bc0;
  background: #fff;
}

#ltvRangeInputs .range-input-row,
#ctLtvRangeInputs .range-input-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.filter-toggle-range .range-inputs input[type="number"] {
  width: 70px;
  padding: 6px 8px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 0.82rem;
  background: #fafafa;
}

.filter-toggle-range .range-inputs input[type="number"]:focus {
  outline: none;
  border-color: #5c6bc0;
  background: #fff;
}

.filter-toggle-range .range-inputs .range-separator {
  color: #666;
  font-size: 0.82rem;
  white-space: nowrap;
}

.filter-toggle-range .range-inputs .range-unit {
  color: #666;
  font-size: 0.82rem;
}

.filter-date-buttons {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
}

.filter-date-buttons button.active {
  background-color: #5c6bc0;
  color: white;
  border-color: #5c6bc0;
}

.filter-date-range {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: #666;
  flex-wrap: wrap;
}

.date-range-inputs {
  display: flex;
  align-items: center;
  gap: 6px;
}

.filter-date-range input[type="date"] {
  padding: 8px 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 0.82rem;
  background: #fafafa;
  transition: all 0.15s;
}

.filter-date-range input[type="date"]:focus {
  outline: none;
  border-color: #5c6bc0;
  background: #fff;
}

.date-range-toggle {
  padding: 8px 12px;
  font-size: 0.8rem;
  min-width: 70px;
  transition: all 0.2s;
}

.date-range-toggle.active {
  background-color: #dc3545;
  color: white;
  border-color: #dc3545;
}

.date-range-toggle.active:hover {
  background-color: #c82333;
  border-color: #c82333;
}

.filter-popup-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid #e9ecef;
  background: #f8f9fa;
  position: relative;
  border-radius: 0 0 12px 12px;
}

.filter-footer-right {
  display: flex;
  gap: 8px;
}

.filter-list-btn-wrapper,
.filter-save-btn-wrapper,
.filter-apply-btn-wrapper {
  position: relative;
}

/* 필터 저장 버튼 */
.btn-info {
  background: #17a2b8;
  color: #fff;
  border: none;
}

.btn-info:hover {
  background: #138496;
}

/* 필터 리스트 버튼 (아웃라인) */
.btn-outline {
  background: #fff;
  color: #495057;
  border: 1px solid #ced4da;
}

.btn-outline:hover {
  background: #e9ecef;
  border-color: #adb5bd;
}

/* 필터 저장 완료 툴팁 (필터 리스트 버튼 위에 표시) */
.filter-save-tooltip {
  position: absolute;
  bottom: calc(100% + 10px);
  right: 80px;
  background: #28a745;
  color: #fff;
  padding: 10px 16px;
  border-radius: 6px;
  font-size: 0.85rem;
  white-space: nowrap;
  z-index: 1002;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  display: none;
}

.filter-save-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  right: 50px;
  border: 6px solid transparent;
  border-top-color: #28a745;
}

.filter-save-tooltip.show {
  display: block;
  animation: tooltipFadeIn 0.3s ease;
}

/* 필터 안내 툴팁 (저장 버튼 위에 표시) */
.filter-guide-tooltip {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  background: #333;
  color: #fff;
  padding: 10px 16px;
  border-radius: 6px;
  font-size: 0.85rem;
  white-space: normal;
  max-width: 300px;
  min-width: 200px;
  text-align: center;
  word-break: break-word;
  z-index: 2003;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  display: none;
}

.filter-guide-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: #333;
}

.filter-guide-tooltip.show {
  display: block;
  animation: tooltipFadeIn 0.3s ease;
}

/* 적용 안내 툴팁 (적용 버튼 아래에 표시) */
.filter-apply-tooltip {
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  background: #333;
  color: #fff;
  padding: 10px 16px;
  border-radius: 6px;
  font-size: 0.85rem;
  white-space: normal;
  max-width: 300px;
  min-width: 200px;
  text-align: center;
  word-break: break-word;
  z-index: 2003;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  display: none;
}

.filter-apply-tooltip::after {
  content: '';
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-bottom-color: #333;
}

.filter-apply-tooltip.show {
  display: block;
  animation: tooltipFadeIn 0.3s ease;
}

/* 필터 프리셋 팝업 (단순화) */
.filter-preset-popup {
  position: absolute;
  bottom: calc(100% + 10px);
  right: 0;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  width: 280px;
  z-index: 1003;
  display: none;
  border: 1px solid #e0e0e0;
}

.filter-preset-popup.show {
  display: block;
  animation: tooltipFadeIn 0.2s ease;
}

.filter-preset-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: #f8f9fa;
  border-bottom: 1px solid #e9ecef;
  border-radius: 8px 8px 0 0;
}

.filter-preset-header span {
  font-weight: 600;
  font-size: 0.9rem;
  color: #333;
}

.filter-preset-close {
  background: none;
  border: none;
  font-size: 1.3rem;
  color: #888;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.filter-preset-close:hover {
  color: #333;
}

.filter-preset-body {
  max-height: 250px;
  overflow-y: auto;
}

.filter-preset-empty {
  padding: 24px 16px;
  text-align: center;
  color: #999;
  font-size: 0.85rem;
}

.filter-preset-item {
  display: flex;
  align-items: center;
  padding: 10px 16px;
  border-bottom: 1px solid #f0f0f0;
  cursor: pointer;
  transition: background 0.15s;
}

.filter-preset-item:last-child {
  border-bottom: none;
}

.filter-preset-item:hover {
  background: #f5f5f5;
}

.filter-preset-item-info {
  flex: 1;
  min-width: 0;
}

.filter-preset-item-name {
  font-weight: 500;
  color: #333;
  font-size: 0.85rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.filter-preset-item-detail {
  font-size: 0.7rem;
  color: #888;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.filter-preset-item-actions {
  display: flex;
  gap: 2px;
  margin-left: 8px;
}

.filter-preset-item-actions button {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 5px;
  border-radius: 4px;
  font-size: 0.8rem;
  opacity: 0.5;
  transition: all 0.15s;
}

.filter-preset-item-actions button:hover {
  opacity: 1;
  background: #e9ecef;
}

@keyframes tooltipFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes tooltipFadeInCenter {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* 소액임차보증금 모달 */
.modal-wide {
  width: 95%;
  max-width: 900px;
}

.modal-wide .modal-body {
  overflow-x: auto;
  max-height: 80vh;
  overflow-y: auto;
}

.deposit-table {
  width: 860px;
  max-width: 860px;
  border-collapse: collapse;
  font-size: 0.9rem;
  table-layout: fixed;
}

.deposit-table th,
.deposit-table td {
  border: 1px solid #333;
  padding: 12px;
  text-align: left;
}

.deposit-table th {
  background: #1a1a2e;
  color: #fff;
  font-weight: 600;
  text-align: center;
}

.deposit-table .region-code {
  text-align: center;
  font-weight: bold;
  width: 40px;
  background: #1a1a2e;
  color: #fff;
  padding: 8px 4px;
}

.deposit-table .region-detail {
  background: #16213e;
  color: #fff;
  line-height: 1.4;
  font-size: 0.8rem;
  padding: 8px 10px;
  word-wrap: break-word;
  overflow-wrap: break-word;
  white-space: normal;
}

.deposit-table .region-detail strong {
  color: #ff9f43;
}

.deposit-table .sub-region {
  display: block;
  font-size: 0.85rem;
  color: #ccc;
  margin-left: 5px;
}

.deposit-table .highlight-region {
  color: #ff9f43;
}

.deposit-table .amount {
  text-align: center;
  font-weight: bold;
  width: 90px;
  background: #1a1a2e;
  color: #fff;
  font-size: 0.8rem;
  padding: 8px 4px;
  white-space: nowrap;
}

.deposit-table .amount.highlight {
  color: #00ff88;
}

.deposit-table .col-category {
  width: 40px;
}

.deposit-table .col-region {
  width: auto;
}

.deposit-table .col-amount {
  width: 90px;
  white-space: nowrap;
}

/* 소액임차 검색 기능 스타일 */
.deposit-search-section {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 15px;
  padding: 10px;
  background: #f8f9fa;
  border-radius: 6px;
  border: 1px solid #e1e5eb;
}

.deposit-search-section label {
  font-weight: 500;
  color: #333;
  white-space: nowrap;
}

.deposit-search-container {
  position: relative;
  flex: 1;
  max-width: 400px;
}

#depositSearchInput {
  width: 100%;
  padding: 8px 35px 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  background: white;
}

.deposit-search-amount {
  position: absolute;
  right: 35px;
  top: 50%;
  transform: translateY(-50%);
  color: #007bff;
  font-size: 12px;
  font-weight: 500;
  background: rgba(0, 123, 255, 0.1);
  padding: 2px 6px;
  border-radius: 3px;
  white-space: nowrap;
  display: none;
}

#depositSearchInput:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.search-clear-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #999;
  font-size: 18px;
  cursor: pointer;
  padding: 2px;
  line-height: 1;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s;
}

.search-clear-btn:hover {
  background: #f0f0f0;
  color: #666;
}

.deposit-autocomplete {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 1px solid #ddd;
  border-top: none;
  border-radius: 0 0 4px 4px;
  z-index: 1000;
  display: none;
  max-height: 230px; /* 총 검색결과 공간 확보를 위해 높이 증가 */
}

.autocomplete-results {
  max-height: 200px; /* 검색 결과만 스크롤 */
  overflow-y: scroll; /* 스크롤 가능하지만 숨김 처리 */
}

/* 스크롤바 숨김 */
.autocomplete-results::-webkit-scrollbar {
  display: none;
}
.autocomplete-results {
  -ms-overflow-style: none; /* IE and Edge */
  scrollbar-width: none; /* Firefox */
}

.deposit-autocomplete-item {
  padding: 8px 12px;
  cursor: pointer;
  border-bottom: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.deposit-autocomplete-item:hover,
.deposit-autocomplete-item.highlighted {
  background: linear-gradient(135deg, #e3f2fd 0%, #f8f9fa 100%);
  border-left: 4px solid #007bff;
  color: #007bff;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(0, 123, 255, 0.15);
  transform: translateX(2px);
  transition: all 0.15s ease;
}

.deposit-autocomplete-item:last-child {
  border-bottom: none;
}

.autocomplete-city {
  font-weight: 500;
}

.autocomplete-amount {
  color: #007bff;
  font-weight: bold;
}

/* 검색된 텍스트 강조 */
.deposit-table tbody td.search-highlight {
  background: #fff3cd !important;
  color: #856404 !important;
  font-weight: bold !important;
}

.search-text-highlight {
  background: #ffc107 !important;
  color: #000 !important;
  padding: 2px 4px;
  border-radius: 2px;
  font-weight: bold;
}

/* 사업대 적용 공식 버튼 스타일 */
.btn-formula {
  background: #f8f9fa;
  color: #333;
  border: 1px solid #dee2e6;
}

.btn-formula:hover {
  background: #e9ecef;
  border-color: #ced4da;
}

/* 버튼 info 스타일 */
.btn-info {
  background: #f8f9fa;
  color: #333;
  border: 1px solid #dee2e6;
}

.btn-info:hover {
  background: #e9ecef;
  border-color: #ced4da;
}

/* 사업대 공식 참고사항 */
.formula-note {
  margin-top: 20px;
  padding: 15px 20px;
  background-color: #f8f9fa;
  border-radius: 8px;
  border-left: 4px solid #6f42c1;
}

.formula-note h3 {
  margin: 0 0 10px 0;
  color: #6f42c1;
  font-size: 16px;
}

.formula-note ul {
  margin: 0;
  padding-left: 20px;
}

.formula-note li {
  margin-bottom: 8px;
  color: #555;
  line-height: 1.5;
}

.formula-note li:last-child {
  margin-bottom: 0;
}

/* 컴팩트 버튼 스타일 */
.btn-compact {
  padding: 5px 10px !important;
  font-size: 0.75rem !important;
  border-radius: 4px !important;
}

/* 새 고객 추가 버튼 */
.btn-add-customer {
  padding: 6px 12px !important;
  font-size: 0.85rem !important;
  white-space: nowrap;
}

/* 선택 삭제 버튼 (새 고객 버튼과 동일 크기) */
#deleteSelectedBtn {
  padding: 6px 12px !important;
  font-size: 0.85rem !important;
  white-space: nowrap;
}

/* 시세 조회 리스트 버튼 */
.btn-source {
  background: #f8f9fa;
  color: #333;
  border: 1px solid #dee2e6;
}

.btn-source:hover {
  background: #e9ecef;
  border-color: #ced4da;
}

/* 시세관리 버튼 */
.btn-price-mgmt {
  background: linear-gradient(135deg, #7c4dff, #651fff);
  color: white;
  border: 1px solid #5c3db8;
  font-weight: 600;
}

.btn-price-mgmt:hover {
  background: linear-gradient(135deg, #651fff, #5c3db8);
  border-color: #4527a0;
}

/* 하우스머치 시세 갱신 버튼 */
.btn-howsmuch {
  background: linear-gradient(135deg, #4CAF50, #45a049);
  color: white;
  border: 1px solid #388e3c;
  font-weight: 600;
}

.btn-howsmuch:hover {
  background: linear-gradient(135deg, #45a049, #388e3c);
  border-color: #2e7d32;
}

/* 하우스머치 로그인 완료 상태 */
.btn-howsmuch.logged-in {
  background: linear-gradient(135deg, #2196F3, #1976D2);
  border-color: #1565C0;
}

.btn-howsmuch.logged-in:hover {
  background: linear-gradient(135deg, #1976D2, #1565C0);
  border-color: #0D47A1;
}

/* 하우스머치 설치 안내 오버레이 */
.howsmuch-install-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

.howsmuch-install-dialog {
  background: #fff;
  border-radius: 8px;
  width: 90%;
  max-width: 360px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  overflow: hidden;
}

.howsmuch-install-dialog .install-header {
  background: #fff;
  color: #333;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #e5e5e5;
}

.howsmuch-install-dialog .install-header h3 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: #333;
}

.howsmuch-install-dialog .install-header .close-btn {
  background: none;
  border: none;
  color: #888;
  font-size: 1.3rem;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.howsmuch-install-dialog .install-header .close-btn:hover {
  color: #333;
}

.howsmuch-install-dialog .install-content {
  padding: 18px;
}

.howsmuch-install-dialog .install-content p {
  margin: 0 0 14px;
  color: #444;
  font-size: 0.9rem;
}

.howsmuch-install-dialog .install-note {
  font-size: 0.8rem;
  color: #666;
  background: #f5f5f5;
  padding: 8px 10px;
  border-radius: 4px;
  margin-bottom: 14px !important;
}

.howsmuch-install-dialog .install-steps {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.howsmuch-install-dialog .step {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  color: #555;
}

.howsmuch-install-dialog .step-num {
  width: 22px;
  height: 22px;
  background: #606060;
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 500;
  font-size: 0.75rem;
  flex-shrink: 0;
}

.howsmuch-install-dialog .install-buttons {
  display: flex;
  gap: 10px;
  padding: 14px 18px;
  border-top: 1px solid #e5e5e5;
}

.howsmuch-install-dialog .btn-download {
  flex: 1;
  background: #505050;
  color: white;
  border: none;
  padding: 10px 16px;
  border-radius: 6px;
  font-weight: 500;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.2s;
}

.howsmuch-install-dialog .btn-download:hover {
  background: #404040;
}

.howsmuch-install-dialog .btn-download:disabled {
  background: #aaa;
  cursor: not-allowed;
}

.howsmuch-install-dialog .btn-cancel {
  flex: 1;
  background: #f0f0f0;
  color: #444;
  border: 1px solid #ddd;
  padding: 10px 16px;
  border-radius: 6px;
  font-weight: 500;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.2s;
}

.howsmuch-install-dialog .btn-cancel:hover {
  background: #e5e5e5;
}

/* 하우스머치 업데이트 안내 오버레이 */
.howsmuch-update-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

.howsmuch-update-dialog {
  background: #fff;
  border-radius: 8px;
  width: 90%;
  max-width: 380px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  overflow: hidden;
}

.howsmuch-update-dialog .update-header {
  background: #fff;
  color: #333;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #e5e5e5;
}

.howsmuch-update-dialog .update-header h3 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: #333;
}

.howsmuch-update-dialog .update-header .close-btn {
  background: none;
  border: none;
  color: #888;
  font-size: 1.3rem;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.howsmuch-update-dialog .update-header .close-btn:hover {
  color: #333;
}

.howsmuch-update-dialog .update-content {
  padding: 18px;
}

.howsmuch-update-dialog .update-content p {
  margin: 0 0 14px;
  color: #444;
  font-size: 0.9rem;
}

.howsmuch-update-dialog .version-info {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: #f8f9fa;
  padding: 12px;
  border-radius: 6px;
}

.howsmuch-update-dialog .version {
  font-size: 0.85rem;
  padding: 6px 10px;
  border-radius: 4px;
}

.howsmuch-update-dialog .version.old {
  background: #ffebee;
  color: #c62828;
}

.howsmuch-update-dialog .version.new {
  background: #e8f5e9;
  color: #2e7d32;
  font-weight: 600;
}

.howsmuch-update-dialog .version-arrow {
  color: #666;
  font-size: 1rem;
}

.howsmuch-update-dialog .update-buttons {
  display: flex;
  gap: 10px;
  padding: 14px 18px;
  border-top: 1px solid #e5e5e5;
}

.howsmuch-update-dialog .btn-download {
  flex: 1;
  background: #1976d2;
  color: white;
  border: none;
  padding: 10px 16px;
  border-radius: 6px;
  font-weight: 500;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.2s;
}

.howsmuch-update-dialog .btn-download:hover {
  background: #1565c0;
}

.howsmuch-update-dialog .btn-later {
  flex: 0.6;
  background: #f0f0f0;
  color: #444;
  border: 1px solid #ddd;
  padding: 10px 16px;
  border-radius: 6px;
  font-weight: 500;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.2s;
}

.howsmuch-update-dialog .btn-later:hover {
  background: #e5e5e5;
}

/* 시세 조회 리스트 모달 */
.modal-medium {
  max-width: 600px;
}

.price-source-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.price-source-item {
  background: #f8f9fa;
  border-radius: 12px;
  padding: 20px;
  border-left: 4px solid #6c757d;
}

.price-source-item.priority-1 {
  border-left-color: #28a745;
  background: linear-gradient(135deg, #f0fff4, #f8f9fa);
}

.price-source-item.priority-2 {
  border-left-color: #ffc107;
  background: linear-gradient(135deg, #fffef0, #f8f9fa);
}

.price-source-item.priority-3 {
  border-left-color: #6c757d;
  background: linear-gradient(135deg, #f5f5f5, #f8f9fa);
}

.source-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.source-header h3 {
  margin: 0;
  font-size: 1.1rem;
  color: #333;
}

.priority-badge {
  background: #333;
  color: white;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
}

.priority-1 .priority-badge {
  background: #28a745;
}

.priority-2 .priority-badge {
  background: #ffc107;
  color: #333;
}

.priority-3 .priority-badge {
  background: #6c757d;
}

.source-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 10px;
}

.source-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: white;
  border: 1px solid #ddd;
  border-radius: 8px;
  color: #0066cc;
  text-decoration: none;
  font-size: 0.9rem;
  transition: all 0.2s;
}

.source-link:hover {
  background: #0066cc;
  color: white;
  border-color: #0066cc;
}

.link-icon {
  font-size: 1rem;
}

.source-desc {
  margin: 0;
  color: #555;
  font-size: 0.9rem;
  line-height: 1.5;
}

.source-warning {
  margin: 8px 0 0 0;
  color: #856404;
  font-size: 0.85rem;
  background: #fff3cd;
  padding: 8px 12px;
  border-radius: 6px;
}

/* 사업대 드롭다운 헤더 */
.business-loan-header {
  position: relative;
  padding: 0 !important;
  overflow: visible !important;
}

.business-loan-dropdown {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  cursor: pointer;
  padding: 6px 4px;
  user-select: none;
  transition: background 0.2s;
  max-width: 100%;
  overflow: hidden;
}

.business-loan-dropdown #businessLoanHeaderText {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: calc(100% - 12px);
}

.business-loan-dropdown:hover {
  background: rgba(0, 0, 0, 0.05);
}

.dropdown-arrow {
  font-size: 0.7rem;
  color: #666;
}

.business-loan-dropdown-menu {
  display: none;
  position: fixed;
  background: white;
  border: 1px solid #ddd;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 9999;
  min-width: 140px;
  overflow: hidden;
}

.business-loan-dropdown-menu.show {
  display: block;
}

.business-loan-dropdown-menu .dropdown-item {
  padding: 10px 16px;
  cursor: pointer;
  font-size: 0.9rem;
  white-space: nowrap;
  transition: background 0.2s;
}

.business-loan-dropdown-menu .dropdown-item:hover {
  background: #f0f0f0;
}

.business-loan-dropdown-menu .dropdown-item:first-child {
  border-bottom: 1px solid #eee;
}

/* 담보물 탭 스타일 */
.collateral-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 20px;
  border-bottom: 2px solid #e1e5eb;
}

/* residence-section 바로 아래 tabs일 때 연결 */
.residence-section + .collateral-tabs {
  margin-top: 0;
  border-radius: 0;
}

.collateral-tab {
  padding: 12px 24px;
  border: none;
  background: transparent;
  color: #666;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  position: relative;
  transition: all 0.2s;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
}

.collateral-tab:hover {
  color: #333;
  background: #f5f5f5;
}

.collateral-tab.active {
  color: #3498db;
  font-weight: 600;
  border-bottom-color: #3498db;
}

.collateral-tab-content {
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

/* 외부 사이트 플레이스홀더 */
.external-site-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 50px 30px;
  text-align: center;
  background: #f8f9fa;
  border-radius: 12px;
  border: 2px dashed #ddd;
}

.external-site-icon {
  font-size: 3rem;
  margin-bottom: 16px;
}

.external-site-placeholder h4 {
  margin: 0 0 12px 0;
  color: #333;
  font-size: 1.2rem;
}

.external-site-placeholder p {
  margin: 0 0 8px 0;
  color: #666;
  font-size: 0.95rem;
  line-height: 1.5;
  max-width: 400px;
}

.external-site-placeholder .warning-text {
  color: #856404;
  background: #fff3cd;
  padding: 8px 16px;
  border-radius: 6px;
  margin: 10px 0;
}

.btn-external {
  margin-top: 16px;
  padding: 12px 28px;
  background: linear-gradient(135deg, #3498db, #2980b9);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-external:hover {
  background: linear-gradient(135deg, #2980b9, #1a6aa5);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

/* ===== 하우스머치 검색 UI ===== */
.howsmuch-container {
  padding: 20px;
  background: #f8f9fa;
  border-radius: 12px;
  border: 1px solid #e9ecef;
  position: relative;
}

/* 하우스머치 세션 만료 오버레이 */
.howsmuch-session-expired {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.95);
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 12px;
  z-index: 10;
}

.session-expired-message {
  text-align: center;
  padding: 24px 32px;
  background: #f5f5f5;
  border: 1px solid #ddd;
  border-radius: 8px;
}

.session-expired-icon {
  display: none;
}

.session-expired-message p {
  margin: 0 0 12px 0;
  color: #444;
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.5;
}

/* ★ 하우스머치 인라인 상태 메시지 (검색/동/호 선택은 가리지 않음) */
.howsmuch-status-message {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  margin-top: 8px;
  background: #fff8e1;
  border: 1px solid #ffe082;
  border-radius: 6px;
  font-size: 0.82rem;
  color: #795548;
}

.howsmuch-status-message .status-icon {
  font-size: 1rem;
  flex-shrink: 0;
}

.howsmuch-status-message .status-text {
  flex: 1;
  font-weight: 500;
}

.btn-howsmuch-login-inline {
  padding: 3px 10px;
  font-size: 0.75rem;
  border: 1px solid #f57c00;
  background: #fff;
  color: #f57c00;
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
  flex-shrink: 0;
}

.btn-howsmuch-login-inline:hover {
  background: #f57c00;
  color: #fff;
}

/* ===== 직접입력 컨테이너 ===== */
.manual-input-container {
  padding: 20px;
  background: #f8f9fa;
  border-radius: 12px;
  border: 1px solid #e9ecef;
}

.manual-input-container .address-detail-row {
  margin-bottom: 12px;
}

.manual-input-container .address-detail-row label {
  min-width: 80px;
}

.manual-input-container .price-row {
  margin-top: 16px;
}

.howsmuch-header {
  margin-bottom: 16px;
}

.howsmuch-header h4 {
  margin: 0 0 8px 0;
  color: #333;
  font-size: 1.1rem;
}

.howsmuch-desc {
  margin: 0;
  color: #666;
  font-size: 0.9rem;
}

/* 거주유형/소유주 공통 섹션 (드롭다운 스타일) */
.residence-section {
  padding: 0;
  background: transparent;
}

/* 기본 거주형태/소유주 행 (본인자가, 지분일 때만 표시) */
.residence-section .residence-owner-row.residence-basic {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 8px 12px;
}

.residence-section .residence-select-wrapper,
.residence-section .owner-type-wrapper {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 100px;
}

.residence-section .residence-select-wrapper label,
.residence-section .owner-type-wrapper label {
  font-size: 0.75rem;
  font-weight: 500;
  color: #555;
  white-space: nowrap;
}

.residence-section .residence-select,
.residence-section .owner-type-select {
  padding: 6px 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 0.85rem;
  background: #fff;
  cursor: pointer;
  width: 100%;
}

.residence-section .residence-select:focus,
.residence-section .owner-type-select:focus {
  border-color: #2196f3;
  outline: none;
}

/* 담보제공자/법인 정보 섹션 */
.owner-info-section {
  padding: 10px 12px;
  background: #f8fafc;
  border-top: 1px dashed #e0e0e0;
  margin-top: 0;
}

/* 헤더 영역 (거주형태/소유주 오른쪽 정렬) */
.owner-info-section .owner-info-header {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-bottom: 12px;
}

.owner-info-section .owner-info-header .residence-select-wrapper,
.owner-info-section .owner-info-header .owner-type-wrapper {
  min-width: 100px;
}

.owner-info-section .owner-info-row {
  display: grid;
  gap: 12px;
  margin-bottom: 8px;
}

.owner-info-section .owner-info-row:last-child {
  margin-bottom: 0;
}

/* 3열 그리드 (담보제공자 정보) - 전체 너비 사용 */
.owner-info-section .owner-info-row.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

/* 2열 그리드 (법인 정보) - 전체 너비 사용 */
.owner-info-section .owner-info-row.grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

.owner-info-section .owner-info-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.owner-info-section .owner-info-field label {
  font-size: 0.75rem;
  font-weight: 500;
  color: #555;
  white-space: nowrap;
}

.owner-info-section .owner-info-field input {
  padding: 6px 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 0.85rem;
  background: #fff;
  width: 100%;
  box-sizing: border-box;
}

.owner-info-section .owner-info-field input:focus {
  border-color: #2196f3;
  outline: none;
  box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.1);
}

.owner-info-section .owner-info-field input::placeholder {
  color: #aaa;
  font-size: 0.8rem;
}

/* 모바일 반응형 */
@media (max-width: 768px) {
  .residence-section .residence-owner-row.residence-basic {
    justify-content: flex-start;
  }
  .owner-info-section .owner-info-header {
    justify-content: flex-start;
    flex-wrap: wrap;
  }
  .owner-info-section .owner-info-row.grid-3 {
    grid-template-columns: 1fr;
  }
  .owner-info-section .owner-info-row.grid-2 {
    grid-template-columns: 1fr;
  }
}

/* 기존 라디오 버튼 스타일 (하위 호환용) */
.residence-section .residence-options {
  display: flex;
  gap: 0;
  align-items: stretch;
  border: 1px solid #ccc;
  border-radius: 4px;
  overflow: hidden;
  background: #fff;
}

.residence-section .residence-options .radio-label {
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  font-size: 0.8rem;
  color: #555;
  padding: 6px 12px;
  border-right: 1px solid #ccc;
  background: #fff;
  transition: background 0.2s;
  margin: 0;
}

.residence-section .residence-options .radio-label:last-child {
  border-right: none;
}

.residence-section .residence-options .radio-label:hover {
  background: #f0f0f0;
}

.residence-section .residence-options .radio-label:has(input:checked) {
  background: #e3f2fd;
  color: #1976d2;
}

.residence-section .residence-options .radio-label input[type="radio"] {
  margin: 0;
  cursor: pointer;
}

.residence-section .residence-options .radio-label span {
  white-space: nowrap;
}

/* 압류여부 라디오 버튼 */
.seizure-field {
  flex: 1 !important;
  min-width: 140px;
  padding-left: 15px;
  border-left: 1px solid #ddd;
}

.seizure-radios {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  flex-wrap: nowrap;
}

.seizure-radio-label {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  cursor: pointer;
  font-size: 0.8rem;
  color: #333;
  white-space: nowrap;
}

.seizure-radio-label input[type="radio"] {
  margin: 0;
  cursor: pointer;
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.seizure-radio-label span {
  user-select: none;
  font-size: 0.75rem;
}

/* 증여/상속 라디오 버튼 */
.inheritance-gift-field {
  flex: 1.5 !important;
  min-width: 180px;
}

.inheritance-gift-radios {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  flex-wrap: nowrap;
}

.inheritance-gift-radio-label {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  cursor: pointer;
  font-size: 0.8rem;
  color: #333;
  white-space: nowrap;
}

.inheritance-gift-radio-label input[type="radio"] {
  margin: 0;
  cursor: pointer;
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.inheritance-gift-radio-label span {
  user-select: none;
  font-size: 0.75rem;
}

/* 증여/상속 기간 필드 */
.inheritance-gift-period-field {
  flex: 1 !important;
  min-width: 120px;
  padding-left: 15px;
  border-left: 1px solid #ddd;
}

.inheritance-gift-period-field input {
  width: 100%;
  padding: 4px 8px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 0.8rem;
}

/* 하우스머치 검색 섹션 (라벨 왼쪽, 검색창 오른쪽) */
.howsmuch-search-section {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.howsmuch-search-section > label {
  font-weight: 500;
  color: #333;
  font-size: 0.8rem;
  white-space: nowrap;
  min-width: 70px;
}

.howsmuch-search-wrapper {
  flex: 1;
  position: relative;
}

.howsmuch-search-input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 0.85rem;
  transition: border-color 0.2s;
  box-sizing: border-box;
}

.howsmuch-search-input:focus {
  outline: none;
  border-color: #4a90d9;
}

/* 하우스머치 헤더 영역 (구버전 호환용) */
.howsmuch-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 10px;
}

.howsmuch-search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}

.howsmuch-search-label {
  min-width: 70px;
  font-weight: 500;
  color: #333;
  font-size: 0.8rem;
  white-space: nowrap;
}

/* 하우스머치 자동완성 드롭다운 */
.howsmuch-search-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 2px solid #4a90d9;
  border-top: none;
  border-radius: 0 0 8px 8px;
  max-height: 250px;
  overflow-y: auto;
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  display: none;
}

.howsmuch-search-dropdown.show {
  display: block;
}

.howsmuch-dropdown-item {
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 1px solid #f0f0f0;
  transition: background-color 0.15s;
}

.howsmuch-dropdown-item:last-child {
  border-bottom: none;
}

.howsmuch-dropdown-item:hover,
.howsmuch-dropdown-item:active,
.howsmuch-dropdown-item.selected {
  background: #e8f4fd;
}

/* 키보드 선택 시 강조 표시 */
.howsmuch-dropdown-item.selected {
  background: #d0e8fc;
  border-left: 3px solid #1d9bf0;
}

.dropdown-address-main {
  font-weight: 600;
  color: #333;
  font-size: 0.85rem;
}

.dropdown-address-sub {
  color: #888;
  font-size: 0.75rem;
  margin-top: 2px;
}

.howsmuch-dropdown-loading,
.howsmuch-dropdown-empty {
  padding: 12px 14px;
  text-align: center;
  color: #666;
  font-size: 0.9rem;
}

.howsmuch-dropdown-loading {
  color: #4a90d9;
}

.btn-howsmuch-search {
  height: 42px;
  padding: 0 20px;
  background: linear-gradient(135deg, #27ae60, #219a52);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn-howsmuch-search:hover {
  background: linear-gradient(135deg, #219a52, #1a7a3e);
}

.btn-howsmuch-search:disabled {
  background: #bdc3c7;
  cursor: not-allowed;
}

.howsmuch-search-results {
  max-height: 200px;
  overflow-y: auto;
  margin-bottom: 12px;
}

.howsmuch-result-item {
  padding: 12px 14px;
  background: white;
  border: 1px solid #e1e5eb;
  border-radius: 8px;
  margin-bottom: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.howsmuch-result-item:hover {
  background: #e8f4fd;
  border-color: #4a90d9;
}

.result-address-main {
  font-weight: 600;
  color: #333;
  font-size: 0.95rem;
}

.result-address-sub {
  color: #888;
  font-size: 0.85rem;
  margin-top: 4px;
}

.howsmuch-selected {
  padding: 12px 14px;
  background: #d4edda;
  border: 1px solid #28a745;
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #155724;
  font-size: 0.95rem;
}

.btn-clear-selection {
  background: none;
  border: none;
  color: #155724;
  cursor: pointer;
  font-size: 1.1rem;
  padding: 4px 8px;
}

.btn-clear-selection:hover {
  color: #c0392b;
}

.howsmuch-hint,
.howsmuch-no-result,
.howsmuch-error,
.howsmuch-loading,
.howsmuch-no-price {
  padding: 12px;
  text-align: center;
  color: #666;
  font-size: 0.9rem;
}

.howsmuch-error {
  color: #c0392b;
  background: #fce4e4;
  border-radius: 6px;
}

.howsmuch-no-price {
  color: #856404;
  background: #fff3cd;
  border: 1px solid #ffc107;
  border-radius: 6px;
}

.howsmuch-no-price .hint {
  font-size: 0.8rem;
  color: #997404;
  margin-top: 6px;
}

.howsmuch-loading {
  color: #4a90d9;
}

.howsmuch-selects {
  display: flex;
  gap: 12px;
  background: white;
  padding: 10px 12px;
  border-radius: 6px;
  border: 1px solid #e1e5eb;
  margin-bottom: 12px;
  align-items: center;
}

.howsmuch-select-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.howsmuch-select-group label {
  color: #555;
  font-weight: 600;
  font-size: 0.85rem;
  white-space: nowrap;
}

.howsmuch-dong-select,
.howsmuch-ho-select {
  flex: 1;
  padding: 6px 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 0.85rem;
  background: white;
}

.howsmuch-dong-select:focus,
.howsmuch-ho-select:focus {
  outline: none;
  border-color: #4a90d9;
}

.btn-howsmuch-fetch {
  padding: 8px 14px;
  background: linear-gradient(135deg, #27ae60, #219a52);
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn-howsmuch-fetch:hover:not(:disabled) {
  background: linear-gradient(135deg, #219a52, #1a7a3e);
}

.btn-howsmuch-fetch:disabled {
  background: #bdc3c7;
  cursor: not-allowed;
}

.howsmuch-result {
  background: #fff3cd;
  padding: 16px;
  border-radius: 8px;
  border: 1px solid #ffc107;
  text-align: center;
}

.howsmuch-result p {
  margin: 0 0 12px 0;
  color: #856404;
  font-size: 0.9rem;
}

.howsmuch-link {
  display: inline-block;
  padding: 10px 24px;
  background: linear-gradient(135deg, #27ae60, #219a52);
  color: white !important;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
  transition: all 0.2s;
}

.howsmuch-link:hover {
  background: linear-gradient(135deg, #219a52, #1a7a3e);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(39, 174, 96, 0.3);
}

/* 하우스머치 세션 및 시세 정보 스타일 */
.howsmuch-session-status {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.btn-howsmuch-login-small {
  padding: 6px 12px;
  font-size: 0.85rem;
  background: #505050;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-howsmuch-login-small:hover {
  background: #404040;
}

.btn-howsmuch-save-session {
  padding: 6px 12px;
  font-size: 0.85rem;
  background: linear-gradient(135deg, #27ae60, #219a52);
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-howsmuch-save-session:hover {
  background: linear-gradient(135deg, #219a52, #1a7a3e);
}

.howsmuch-price-info {
  margin: 12px 0;
}

.howsmuch-price-card {
  background: white;
  border-radius: 12px;
  border: 2px solid #27ae60;
  padding: 16px;
  box-shadow: 0 4px 12px rgba(39, 174, 96, 0.15);
}

.howsmuch-price-card .price-main {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 12px;
  border-bottom: 1px solid #e1e5eb;
  margin-bottom: 12px;
}

.howsmuch-price-card .price-label {
  color: #666;
  font-size: 0.95rem;
}

.howsmuch-price-card .price-value {
  font-size: 1.6rem;
  font-weight: 700;
  color: #27ae60;
}

.howsmuch-price-card .price-range {
  display: flex;
  justify-content: center;
  gap: 12px;
  font-size: 0.9rem;
  color: #666;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid #e1e5eb;
}

.howsmuch-price-card .price-details {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.howsmuch-price-card .detail-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  padding: 6px 8px;
  background: #f8f9fa;
  border-radius: 6px;
}

.howsmuch-price-card .detail-row span:first-child {
  color: #666;
}

.howsmuch-price-card .detail-row span:last-child {
  font-weight: 600;
  color: #333;
}

.howsmuch-price-card .detail-row.highlight {
  background: #fff8e6;
  margin: 0 -12px;
  padding: 8px 12px;
  border-radius: 6px;
  margin-top: 8px;
}

.howsmuch-price-card .detail-row.highlight span:first-child {
  color: #e67e22;
  font-weight: 500;
}

.howsmuch-price-card .detail-row.highlight span:last-child {
  color: #d35400;
  font-weight: 700;
}

.howsmuch-price-card .recent-sales {
  background: #f0f8ff;
  padding: 10px;
  border-radius: 8px;
  margin-top: 12px;
}

.howsmuch-price-card .recent-sales h5 {
  margin: 0 0 8px 0;
  font-size: 0.9rem;
  color: #4a90d9;
}

.howsmuch-price-card .sale-item {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  padding: 4px 0;
  border-bottom: 1px dotted #ddd;
}

.howsmuch-price-card .sale-item:last-child {
  border-bottom: none;
}

.howsmuch-price-card .price-date {
  text-align: right;
  font-size: 0.8rem;
  color: #999;
  margin-top: 12px;
  margin-bottom: 0;
}

.howsmuch-login-required {
  background: #f5f5f5;
  padding: 16px;
  border-radius: 8px;
  border: 1px solid #ddd;
  text-align: center;
}

.howsmuch-login-required p {
  margin: 0 0 12px 0;
  color: #444;
  font-size: 0.9rem;
}

.howsmuch-login-required .login-hint {
  font-size: 0.8rem;
  color: #888;
  margin-top: 8px;
}

.btn-howsmuch-login {
  display: inline-block;
  padding: 10px 24px;
  background: linear-gradient(135deg, #9b59b6, #8e44ad);
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-howsmuch-login:hover {
  background: linear-gradient(135deg, #8e44ad, #7d3c98);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(155, 89, 182, 0.3);
}

/* 하우스머치 시세 입력 섹션 - KB부동산 동일 스타일 */
.howsmuch-price-section {
  margin-top: 12px;
  background: white;
  padding: 10px;
  border-radius: 6px;
  border: 1px solid #e1e5eb;
}

.howsmuch-price-section .address-detail-row {
  display: block;
  margin-bottom: 10px;
  padding: 0;
  border: none;
  margin-top: 0;
  padding-top: 0;
}

.howsmuch-price-section .address-detail-row:first-child {
  margin-top: 0;
}

.howsmuch-price-section .address-detail-row label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  color: #555;
  font-size: 0.8rem;
}

.howsmuch-price-section .address-detail-input-wrapper {
  flex: 1;
}

.howsmuch-price-section .howsmuch-jibun-address {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 0.85rem;
  background: white;
  color: #333;
  box-sizing: border-box;
}

.howsmuch-price-section .howsmuch-property-type {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 0.85rem;
  background: white;
  color: #333;
  cursor: pointer;
  box-sizing: border-box;
}

.howsmuch-price-section .howsmuch-property-type:focus {
  outline: none;
  border-color: #4a90d9;
}

.howsmuch-price-section .price-row {
  display: flex;
  gap: 20px;
}

.howsmuch-price-section .price-group {
  flex: 1;
}

.howsmuch-price-section .price-group h5 {
  margin: 0 0 8px 0;
  font-size: 0.85rem;
  color: #555;
  font-weight: 600;
}

.howsmuch-price-section .price-header-with-btn {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.howsmuch-price-section .price-header-with-btn h5 {
  margin: 0;
}

.howsmuch-price-section .btn-apply-past {
  padding: 2px 6px;
  font-size: 0.7rem;
  background: #6c757d;
  color: white;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  transition: background 0.2s;
}

.howsmuch-price-section .btn-apply-past:hover {
  background: #5a6268;
}

.howsmuch-price-section .price-inputs {
  display: flex;
  gap: 6px;
}

.howsmuch-price-section .price-inputs input {
  flex: 1;
  padding: 8px 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 0.85rem;
  text-align: right;
  min-width: 0;
  box-sizing: border-box;
}

.howsmuch-price-section .price-inputs input:focus {
  outline: none;
  border-color: #4a90d9;
}

.howsmuch-price-section .price-inputs input::placeholder {
  text-align: center;
  color: #aaa;
  font-size: 0.75rem;
}

/* 하우스머치 과거시세 자동입력 툴팁 (KB부동산과 동일) */
.howsmuch-auto-fill-tooltip {
  position: absolute;
  background: #333;
  color: #fff;
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 0.8rem;
  line-height: 1.5;
  white-space: nowrap;
  z-index: 1001;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  top: calc(100% + 8px);
  left: 0;
  max-width: calc(100vw - 40px);
}

@media (max-width: 768px) {
  .howsmuch-auto-fill-tooltip {
    white-space: normal;
    word-break: keep-all;
    left: 50%;
    transform: translateX(-50%);
    min-width: 200px;
    text-align: center;
  }
  
  .howsmuch-auto-fill-tooltip::before {
    left: 50%;
    transform: translateX(-50%);
  }
}

.howsmuch-auto-fill-tooltip::before {
  content: '';
  position: absolute;
  top: -6px;
  left: 20px;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-bottom: 6px solid #333;
}

/* 메인 담보물 라디오 버튼 */
.main-collateral-radio {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-right: 8px;
  cursor: pointer;
}

.main-collateral-radio input[type="radio"] {
  width: 14px;
  height: 14px;
  cursor: pointer;
  accent-color: #4CAF50;
}

.main-collateral-label {
  font-size: 0.75rem;
  color: #666;
  font-weight: 500;
}

.main-collateral-input:checked + .main-collateral-label {
  color: #4CAF50;
  font-weight: 600;
}

/* 탭별 메인 정보 라디오 */
.collateral-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 15px;
  border-bottom: 2px solid #e1e5eb;
}

/* 탭 내부 메인 지정 셀렉터 */
.main-tab-selector {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 8px 12px;
  background: linear-gradient(to right, #f8f9fa, #fff);
  border-bottom: 1px solid #e9ecef;
  margin-bottom: 10px;
}

.main-tab-label {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  padding: 4px 10px;
  border-radius: 4px;
  transition: all 0.2s ease;
  font-size: 0.85rem;
  color: #666;
}

.main-tab-label:hover {
  background: #e9ecef;
}

.main-tab-label input[type="radio"] {
  width: 14px;
  height: 14px;
  cursor: pointer;
  accent-color: #4a90d9;
  margin: 0;
}

.main-tab-label input[type="radio"]:checked {
  accent-color: #4CAF50;
}

.main-tab-label input[type="radio"]:checked + span {
  color: #4CAF50;
  font-weight: 600;
}

/* 시세관리 체크박스 (메인으로 지정 옆) */
.main-tab-selector .price-management-label {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  padding: 4px 10px;
  border-radius: 4px;
  transition: all 0.2s ease;
  font-size: 0.85rem;
  color: #666;
  border: 1px solid #ddd;
  background: #fff;
}

.main-tab-selector .price-management-label:hover {
  background: #fff3e0;
  border-color: #FF9800;
}

.main-tab-selector .price-management-label input[type="checkbox"] {
  width: 14px;
  height: 14px;
  cursor: pointer;
  accent-color: #FF9800;
  margin: 0;
}

.main-tab-selector .price-management-label:has(input:checked) {
  background: #fff3e0;
  border-color: #FF9800;
  color: #e65100;
}

.main-tab-selector .price-management-label:has(input:checked) span {
  font-weight: 600;
}

/* 담보물 갯수 표시 */
.collateral-count {
  font-size: 0.85rem;
  color: #888;
  font-weight: normal;
  margin-left: 4px;
}

/* 담당 직원 필터 드롭다운 */
.staff-filter {
  padding: 8px 12px;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  font-size: 0.9rem;
  background: #fff;
  cursor: pointer;
  min-width: 120px;
}

.staff-filter:hover {
  border-color: #ced4da;
  background: #f8f9fa;
}

.staff-filter:focus {
  outline: none;
  border-color: #4a90d9;
  box-shadow: 0 0 0 2px rgba(74, 144, 217, 0.15);
}

/* 모달 헤더 래퍼 */
.modal-header-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

/* 로그 버튼 */
.btn-log {
  padding: 6px 12px;
  background: #6c757d;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 0.85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s ease;
}

.btn-log:hover {
  background: #5a6268;
}

/* 시세 갱신 버튼 */
.btn-price-refresh {
  padding: 6px 12px;
  background: linear-gradient(135deg, #28a745, #20c997);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 0.85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(40, 167, 69, 0.3);
}

.btn-price-refresh:hover {
  background: linear-gradient(135deg, #218838, #1abc9c);
  box-shadow: 0 3px 6px rgba(40, 167, 69, 0.4);
  transform: translateY(-1px);
}

.btn-price-refresh:disabled {
  background: #6c757d;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.btn-price-refresh .loading-spinner-small {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* 고객 로그 모달 */
.modal-log-content {
  background: #fff;
  width: 95%;
  max-width: 500px;
  max-height: 70vh;
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.modal-log-content .modal-header {
  padding: 12px 16px;
  flex-shrink: 0;
}

.modal-log-content .modal-header h2 {
  font-size: 1rem;
}

.modal-log-content .modal-body {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}

.log-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px 12px;
}

/* 심플 로그 스타일 */
.log-simple-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 0;
  font-size: 0.75rem;
  border-bottom: 1px solid #f0f0f0;
  flex-wrap: wrap;
}

.log-simple-item:last-child {
  border-bottom: none;
}

.log-simple-date {
  color: #888;
  min-width: 70px;
}

.log-simple-time {
  color: #aaa;
  min-width: 36px;
}

.log-simple-action {
  color: #333;
  font-weight: 500;
  min-width: 60px;
}

.log-simple-user {
  color: #666;
  min-width: 50px;
}

.log-simple-details {
  color: #888;
  flex: 1;
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
  padding: 2px 0;
  scrollbar-width: thin;
  scrollbar-color: #ccc #f0f0f0;
}

.log-simple-details::-webkit-scrollbar {
  height: 4px;
}

.log-simple-details::-webkit-scrollbar-track {
  background: #f0f0f0;
  border-radius: 2px;
}

.log-simple-details::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 2px;
}

.log-simple-details::-webkit-scrollbar-thumb:hover {
  background: #aaa;
}

.no-logs {
  text-align: center;
  padding: 20px;
  color: #888;
  font-size: 0.85rem;
}

/* 로그 리스트 패딩 조정 */
.log-list {
  padding: 12px 12px 12px 16px;
}

/* 로그 탭 스타일 */
.log-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid #e0e0e0;
  margin-bottom: 12px;
  padding: 0 12px;
}

.log-tab-btn {
  background: none;
  border: none;
  padding: 10px 16px;
  cursor: pointer;
  font-size: 0.9rem;
  color: #666;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
}

.log-tab-btn:hover {
  color: #333;
}

.log-tab-btn.active {
  color: #4a90d9;
  border-bottom-color: #4a90d9;
  font-weight: 600;
}

.log-tab-content {
  display: none;
}

.log-tab-content.active {
  display: block;
}

.duplicate-count {
  background: #e74c3c;
  color: white;
  font-size: 0.75rem;
  padding: 2px 6px;
  border-radius: 10px;
  margin-left: 4px;
}

/* 중복 고객 리스트 */
.duplicate-list {
  padding: 12px 16px;
}

.duplicate-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  margin-bottom: 8px;
  background: #fafafa;
  cursor: pointer;
  transition: background 0.2s;
}

.duplicate-item:hover {
  background: #f0f0f0;
}

.duplicate-item.current {
  background: #e8f4fd;
  border-color: #4a90d9;
}

.duplicate-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.duplicate-name {
  font-weight: 600;
  color: #333;
}

.duplicate-phone {
  font-size: 0.85rem;
  color: #666;
}

.duplicate-staff {
  font-size: 0.85rem;
  color: #888;
}

.duplicate-staff.public {
  color: #e67e22;
}

.duplicate-date {
  font-size: 0.8rem;
  color: #999;
}

.no-duplicates {
  text-align: center;
  color: #888;
  padding: 20px;
}

/* 커스텀 다이얼로그 스타일 */
.custom-dialog-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 10000;
  justify-content: center;
  align-items: center;
  animation: fadeIn 0.2s ease;
}

.custom-dialog-overlay.show {
  display: flex;
  visibility: visible !important;
}

.custom-dialog {
  background: white;
  border-radius: 12px;
  padding: 24px;
  min-width: 320px;
  max-width: 450px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  animation: slideIn 0.2s ease;
  text-align: center;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideIn {
  from { transform: translateY(-20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.custom-dialog-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
}

.custom-dialog-icon.success {
  background: #d4edda;
  color: #28a745;
}

.custom-dialog-icon.error {
  background: #f8d7da;
  color: #dc3545;
}

.custom-dialog-icon.warning {
  background: #fff3cd;
  color: #ffc107;
}

.custom-dialog-icon.info {
  background: #d1ecf1;
  color: #17a2b8;
}

.custom-dialog-icon.question {
  background: #e9ecef;
  color: #6c757d;
}

.custom-dialog-message {
  font-size: 0.95rem;
  color: #333;
  line-height: 1.6;
  margin-bottom: 20px;
  white-space: pre-line;
}

.custom-dialog-input {
  margin-bottom: 16px;
}

.custom-dialog-input-field {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 0.9rem;
  transition: border-color 0.2s;
}

.custom-dialog-input-field:focus {
  outline: none;
  border-color: #4a90d9;
  box-shadow: 0 0 0 3px rgba(74, 144, 217, 0.1);
}

.custom-dialog-buttons {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.custom-dialog-btn {
  padding: 10px 24px;
  border: none;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  min-width: 80px;
}

.custom-dialog-btn.primary {
  background: #4a90d9;
  color: white;
}

.custom-dialog-btn.primary:hover {
  background: #357abd;
}

.custom-dialog-btn.secondary {
  background: #e9ecef;
  color: #495057;
}

.custom-dialog-btn.secondary:hover {
  background: #dee2e6;
}

.custom-dialog-btn.danger {
  background: #dc3545;
  color: white;
}

.custom-dialog-btn.danger:hover {
  background: #c82333;
}

/* ====== 테이블 설정 버튼 및 팝업 ====== */
.settings-btn-wrapper {
  position: relative;
  margin-left: 8px;
}

.btn-settings {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  background: #f8f9fa;
  border: 1px solid #ddd;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-settings:hover {
  background: #e9ecef;
  border-color: #adb5bd;
}

/* 톱니바퀴 버튼 - 최적화 활성화 상태 */
.btn-settings.optimize-active {
  background: linear-gradient(135deg, #4CAF50, #45a049);
  border-color: #45a049;
  box-shadow: 0 2px 8px rgba(76, 175, 80, 0.4);
}

.btn-settings.optimize-active .settings-icon {
  color: white;
  animation: rotateGear 3s linear infinite;
}

@keyframes rotateGear {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.btn-settings.optimize-active:hover {
  background: linear-gradient(135deg, #45a049, #3d8b40);
  box-shadow: 0 3px 12px rgba(76, 175, 80, 0.5);
}

.settings-icon {
  font-size: 1.2rem;
}

/* 설정 팝업 */
.settings-popup {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 8px;
  width: 380px;
  max-height: 450px;
  background: rgba(255, 255, 255, 0.92);
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  z-index: 2000;
  overflow: visible;
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.settings-popup.show {
  display: block;
}

.settings-popup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: rgba(248, 249, 250, 0.92);
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.settings-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.settings-header-left h3 {
  flex-shrink: 0;
}

.settings-header-left .tooltip-toggle-btn {
  margin-left: 0;
  margin-right: 0;
}

.settings-popup-header h3 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: #333;
}

.settings-popup-header h3 small {
  font-size: 0.75rem;
  font-weight: 400;
  color: #888;
  margin-left: 4px;
}

.settings-close-btn {
  background: none;
  border: none;
  font-size: 1.3rem;
  color: #999;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.settings-close-btn:hover {
  color: #333;
}

.settings-popup-body {
  padding: 12px 16px;
  max-height: 350px;
  overflow-y: auto;
}

.settings-popup-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 12px 16px 14px 16px;
  background: rgba(255, 255, 255, 0.92);
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 0 0 8px 8px;
  position: relative;
}

.settings-footer-left {
  display: flex;
  gap: 8px;
  position: relative;
}

.settings-save-btn-wrapper,
.settings-apply-btn-wrapper {
  position: relative;
}

.settings-popup-footer .footer-buttons {
  display: flex;
  gap: 8px;
  position: relative;
}

/* 설정 안내 툴팁 (저장 버튼 위) */
.settings-guide-tooltip {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  background: #333;
  color: #fff;
  padding: 10px 16px;
  border-radius: 6px;
  font-size: 0.85rem;
  white-space: normal;
  max-width: 300px;
  min-width: 200px;
  text-align: center;
  word-break: break-word;
  z-index: 2003;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  display: none;
}

.settings-guide-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: #333;
}

/* 적용 버튼 안내 툴팁 (적용 버튼 아래) */
#saveTooltip {
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  background: #333;
  color: #fff;
  padding: 10px 16px;
  border-radius: 6px;
  font-size: 0.85rem;
  white-space: normal;
  max-width: 300px;
  min-width: 200px;
  text-align: center;
  word-break: break-word;
  z-index: 2003;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  display: none;
}

#saveTooltip::after {
  content: '';
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-bottom-color: #333;
}

#saveTooltip.show {
  display: block;
  animation: tooltipFadeIn 0.3s ease;
}

.settings-guide-tooltip.show {
  display: block;
  animation: tooltipFadeIn 0.3s ease;
}

/* 설정 저장 완료 툴팁 (설정 리스트 버튼 위) */
.settings-save-tooltip {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #333;
  color: #fff;
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 0.85rem;
  white-space: normal;
  max-width: 300px;
  text-align: center;
  line-height: 1.5;
  z-index: 10000;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
  display: none;
}

.settings-save-tooltip::after {
  display: none;
}

.settings-save-tooltip.show {
  display: block;
  animation: tooltipFadeIn 0.3s ease;
}

/* 설정 프리셋 팝업 */
.settings-preset-popup {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 0;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  width: 260px;
  z-index: 2004;
  display: none;
  border: 1px solid #e0e0e0;
}

.settings-preset-popup.show {
  display: block;
  animation: tooltipFadeIn 0.2s ease;
}

.settings-preset-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: #f8f9fa;
  border-bottom: 1px solid #e9ecef;
  border-radius: 8px 8px 0 0;
}

.settings-preset-header span {
  font-weight: 600;
  font-size: 0.9rem;
  color: #333;
}

.settings-preset-close {
  background: none;
  border: none;
  font-size: 1.3rem;
  color: #888;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.settings-preset-close:hover {
  color: #333;
}

.settings-preset-body {
  max-height: 200px;
  overflow-y: auto;
}

.settings-preset-empty {
  padding: 20px;
  text-align: center;
  color: #888;
  font-size: 0.85rem;
}

.settings-preset-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  border-bottom: 1px solid #f0f0f0;
  cursor: pointer;
  transition: background 0.2s;
}

.settings-preset-item:last-child {
  border-bottom: none;
}

.settings-preset-item:hover {
  background: #f8f9fa;
}

.settings-preset-item-info {
  flex: 1;
  min-width: 0;
}

.settings-preset-item-name {
  font-size: 0.85rem;
  font-weight: 500;
  color: #333;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.settings-preset-item-detail {
  font-size: 0.75rem;
  color: #888;
  margin-top: 2px;
}

.settings-preset-item-actions {
  display: flex;
  gap: 4px;
  margin-left: 8px;
}

.settings-preset-item-actions button {
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  font-size: 0.8rem;
  opacity: 0.6;
  transition: opacity 0.2s;
}

.settings-preset-item-actions button:hover {
  opacity: 1;
}

/* 반투명도 컨트롤 */
.opacity-control {
  display: flex;
  align-items: center;
  gap: 6px;
}

.opacity-label {
  font-size: 0.75rem;
  color: #666;
}

.opacity-slider {
  width: 60px;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: #ddd;
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}

.opacity-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  background: #4CAF50;
  border-radius: 50%;
  cursor: pointer;
}

.opacity-slider::-moz-range-thumb {
  width: 12px;
  height: 12px;
  background: #4CAF50;
  border-radius: 50%;
  cursor: pointer;
  border: none;
}

.opacity-value {
  font-size: 0.75rem;
  color: #4CAF50;
  font-weight: 600;
  min-width: 32px;
}

/* 설정 섹션 */
.settings-popup .settings-section {
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #f0f0f0;
}

.settings-popup .settings-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.settings-popup .settings-section h4 {
  margin: 0 0 10px 0;
  font-size: 0.85rem;
  color: #555;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.settings-popup .settings-section h4 span {
  font-weight: 600;
  color: #4CAF50;
}

/* 휠 컨트롤 */
.font-size-control {
  display: flex;
  align-items: center;
  gap: 8px;
}

.wheel-btn {
  width: 28px;
  height: 28px;
  border: 1px solid #ddd;
  background: #f8f9fa;
  border-radius: 4px;
  font-size: 1.1rem;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #555;
  transition: all 0.15s;
}

.wheel-btn:hover {
  background: #e9ecef;
  border-color: #adb5bd;
}

.wheel-btn:active {
  background: #dee2e6;
}

.wheel-area {
  flex: 1;
  height: 28px;
  background: linear-gradient(to right, #e9ecef, #f8f9fa, #e9ecef);
  border: 1px solid #ddd;
  border-radius: 4px;
  cursor: ew-resize;
  position: relative;
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.wheel-area:hover {
  border-color: #4CAF50;
}

.wheel-area.dragging {
  border-color: #4CAF50;
  box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.2);
}

.wheel-indicator {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 6px;
  height: 6px;
  background: #4CAF50;
  border-radius: 50%;
}

/* 컬럼 너비 컨트롤 */
.column-width-controls {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.column-width-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  background: #f8f9fa;
  border-radius: 4px;
}

.column-width-row .col-label {
  flex: 1;
  font-size: 0.8rem;
  color: #555;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 70px;
}

.column-width-row .col-value {
  font-size: 0.8rem;
  font-weight: 600;
  color: #4CAF50;
  min-width: 45px;
  text-align: right;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: background 0.2s;
}

.column-width-row .col-value:hover {
  background: rgba(76, 175, 80, 0.15);
}

.column-width-row .wheel-btn {
  width: 22px;
  height: 22px;
  font-size: 0.9rem;
}

.column-width-row .wheel-area {
  width: 60px;
  height: 22px;
  flex: none;
}

.column-width-row .wheel-indicator {
  width: 4px;
  height: 4px;
}
/* ====== 적용 버튼 툴팁 ====== */
.save-btn-wrapper {
  position: relative;
  display: inline-block;
}

.save-tooltip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: #333;
  color: #fff;
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 0.75rem;
  line-height: 1.4;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s, transform 0.3s;
  z-index: 3000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.save-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: #333;
}

.save-tooltip.show {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(-5px);
}

/* ====== 실시간 알림 팝업 ====== */
.notification-popup {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: linear-gradient(135deg, #4CAF50, #45a049);
  color: #fff;
  padding: 16px 24px;
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(76, 175, 80, 0.4);
  z-index: 10000;
  display: flex;
  align-items: center;
  gap: 12px;
  transform: translateY(100px);
  opacity: 0;
  transition: transform 0.4s ease-out, opacity 0.4s ease-out;
  max-width: 400px;
}

.notification-popup.show {
  transform: translateY(0);
  opacity: 1;
}

.notification-popup .notif-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.notification-popup .notif-message {
  font-size: 0.95rem;
  font-weight: 500;
}

.notification-popup .notif-close {
  position: absolute;
  top: 8px;
  right: 12px;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  font-size: 1.2rem;
  cursor: pointer;
  line-height: 1;
}

.notification-popup .notif-close:hover {
  color: #fff;
}

/* ====== 신규 고객 하이라이트 ====== */
tr.new-customer,
tr.new-customer td {
  background-color: #e3f2fd !important;
  animation: newCustomerPulse 2s ease-in-out;
}

tr.new-customer:hover,
tr.new-customer:hover td {
  background-color: #bbdefb !important;
}

@keyframes newCustomerPulse {
  0%, 100% { background-color: #e3f2fd; }
  50% { background-color: #bbdefb; }
}

/* 미배정 고객 (기존) */
tr.unassigned-customer {
  background-color: #fff3cd;
}

tr.unassigned-customer:hover {
  background-color: #ffe69c;
}

/* ============================================
   모바일 반응형 스타일
   ============================================ */

/* 태블릿 (1024px 이하) */
@media (max-width: 1024px) {
  .container {
    padding: 15px;
  }
  
  header {
    padding: 15px;
  }
  
  header h1 {
    font-size: 1.4rem;
  }
  
  .department-tabs {
    flex-wrap: wrap;
  }
  
  .dept-tab {
    padding: 8px 20px;
    font-size: 0.85rem;
  }
}

/* 모바일 (768px 이하) */
@media (max-width: 768px) {
  body {
    font-size: 13px;
  }
  
  .container {
    padding: 6px;
    max-width: 100%;
  }
  
  header {
    flex-direction: column;
    gap: 6px;
    padding: 8px;
    text-align: center;
    margin-bottom: 8px;
  }
  
  header h1 {
    font-size: 0.95rem;
    margin-bottom: 2px;
  }
  
  /* 헤더 버튼 그룹 - CSS Grid로 줄별로 그룹핑 */
  .header-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 4px 4px;
    width: 100%;
  }
  
  /* 사용자 정보 행 (이름 + 관리자메뉴 + 로그아웃) - 전체 너비 */
  .user-info {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 6px;
    width: 100%;
    padding: 0;
    border: none;
    margin: 0;
    order: 1;
  }
  
  .user-info .user-name {
    font-size: 0.72rem;
    padding-right: 8px;
    border-right: 1px solid #ddd;
  }
  
  .user-info .btn {
    padding: 4px 8px !important;
    font-size: 0.68rem !important;
  }
  
  /* 기능 버튼들 (시세조회, 사업대공식, 소액임차) - 3개가 한 줄에 배치됨 */
  .header-buttons .btn-compact,
  .header-buttons .btn-source,
  .header-buttons .btn-formula,
  .header-buttons .btn-info:not(.btn-admin-link) {
    order: 2;
    width: 100%;
    padding: 6px 4px !important;
    font-size: 0.7rem !important;
    white-space: nowrap;
    text-align: center;
    box-sizing: border-box;
  }
  
  .header-buttons .btn {
    padding: 5px 6px !important;
    font-size: 0.68rem !important;
    white-space: nowrap;
  }
  
  /* 부서 탭 */
  .department-tabs {
    width: 100%;
    justify-content: center;
    padding: 3px;
  }
  
  .dept-tab {
    padding: 6px 12px;
    font-size: 0.75rem;
    flex: 1;
    text-align: center;
  }
  
  /* 필터 영역 */
  .filter-section {
    padding: 8px;
    margin-bottom: 10px;
  }
  
  .filter-row {
    flex-direction: column;
    gap: 6px;
  }
  
  .filter-group {
    width: 100%;
  }
  
  .filter-group select,
  .filter-group input {
    width: 100%;
    font-size: 14px;
    padding: 8px;
  }
  
  /* 테이블 래퍼 */
  .table-wrapper {
    border-radius: 6px;
  }
  
  /* 테이블 컨테이너 */
  .table-container {
    margin: 0;
    border-radius: 6px;
    -webkit-overflow-scrolling: touch;
  }
  
  /* 테이블 - 더 컴팩트하게 */
  table,
  #customerTable {
    font-size: 0.6rem !important;
    min-width: 550px;
  }
  
  table th,
  table td,
  #customerTable th,
  #customerTable td {
    padding: 4px 2px !important;
    white-space: nowrap;
    font-size: 0.6rem !important;
  }
  
  #customerTable th {
    font-size: 0.58rem !important;
    font-weight: 600;
  }
  
  /* 페이지네이션 - 컴팩트 */
  .pagination-container {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 6px;
    padding: 8px;
    background: #f8f9fa;
    border-radius: 6px;
    margin-top: 8px;
  }
  
  .pagination-info {
    font-size: 0.68rem;
    color: #666;
  }
  
  .pagination {
    display: flex;
    flex-wrap: nowrap;
    gap: 2px;
    justify-content: center;
  }
  
  .page-btn {
    padding: 4px 6px;
    font-size: 0.65rem;
    min-width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
  }
  
  .page-btn.active {
    background: #4CAF50;
    color: #fff;
    font-weight: 600;
  }
  
  .page-ellipsis {
    padding: 0 4px;
    font-size: 0.65rem;
  }
  
  .keyboard-hint {
    display: none;
  }
  
  /* 페이지당 표시 개수 - 모바일 */
  .pagination-controls {
    display: flex;
    align-items: center;
    gap: 8px;
  }
  
  .items-per-page {
    font-size: 0.68rem;
    gap: 4px;
  }
  
  .items-per-page label {
    display: none;
  }
  
  .items-per-page select {
    padding: 4px 20px 4px 6px;
    font-size: 0.68rem;
    min-width: 55px;
    border-radius: 4px;
  }
  
  /* 모달 - 컴팩트 */
  .modal {
    padding: 6px;
  }
  
  .modal-content {
    width: 100% !important;
    max-width: 100% !important;
    margin: 6px auto;
    max-height: calc(100vh - 20px);
    overflow-y: auto;
    border-radius: 10px;
    padding-bottom: 10px;
  }
  
  /* 고객 상세 정보 모달 - 모바일 */
  #modal .modal-content {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: 95% !important;
    max-width: 95% !important;
    height: 70vh !important;
    max-height: 70vh !important;
    display: flex !important;
    flex-direction: column !important;
    margin: 0 !important;
    overflow: hidden !important;
    padding-bottom: 0 !important;
  }
  
  #modal .modal-body {
    flex: 1 !important;
    overflow-y: auto !important;
    padding: 15px !important;
  }
  
  #modal .modal-footer {
    flex-shrink: 0 !important;
    border-top: 1px solid #e1e5eb !important;
    padding: 12px 15px !important;
    background: #f8f9fa !important;
  }
  
  #modal .form-actions {
    margin: 0 !important;
    padding: 0 !important;
  }
  
  /* 시세조회, 사업대공식, 소액임차 모달 - 모바일 중앙 위치 */
  #priceSourceListModal .modal-content,
  #businessLoanFormulaModal .modal-content,
  #depositModal .modal-content {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: 95% !important;
    max-width: 95% !important;
    display: flex !important;
    flex-direction: column !important;
    margin: 0 !important;
    overflow: hidden !important;
  }
  
  /* 시세조회 모달 - 모바일 높이 70% 제한 */
  #priceSourceListModal .modal-content {
    height: 70vh !important;
    max-height: 70vh !important;
  }
  
  /* 사업대공식, 소액임차 모달 - 모바일 높이 제한 없음 */
  #businessLoanFormulaModal .modal-content,
  #depositModal .modal-content {
    max-height: 85vh !important;
  }
  
  #priceSourceListModal .modal-body,
  #businessLoanFormulaModal .modal-body,
  #depositModal .modal-body {
    flex: 1 !important;
    overflow-y: auto !important;
    padding: 15px !important;
  }
  
  .modal-header {
    padding: 10px 12px;
    border-radius: 10px 10px 0 0;
    flex-wrap: wrap;
  }
  
  .modal-header-left {
    display: flex;
    align-items: center;
    gap: 8px;
  }
  
  .modal-header-left .btn-log {
    padding: 4px 8px;
    font-size: 0.68rem;
    height: 26px;
  }
  
  .modal-header h2 {
    font-size: 0.92rem;
    flex: 0 0 auto;
  }
  
  /* 모바일에서 헤더 버튼 배치 */
  .modal-header-buttons {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
  }
  
  .modal-header .btn-price-refresh {
    padding: 5px 10px;
    font-size: 0.7rem;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  .close {
    font-size: 22px;
    padding: 0;
    line-height: 1;
  }
  
  /* 폼 - 컴팩트 */
  form {
    padding: 10px;
  }
  
  .form-group {
    margin-bottom: 8px !important;
  }
  
  .form-group label {
    font-size: 0.72rem;
    margin-bottom: 3px;
    display: block;
    color: #555;
  }
  
  .form-group input,
  .form-group select,
  .form-group textarea,
  .modal-form input,
  .modal-form select,
  .modal-form textarea,
  input[type="text"],
  input[type="tel"],
  input[type="number"],
  input[type="date"],
  select,
  textarea {
    font-size: 13px !important;
    padding: 7px !important;
    border-radius: 5px;
    height: auto;
  }
  
  /* 셀렉트박스 높이 조절 */
  select {
    height: 32px !important;
    padding: 5px 7px !important;
    font-size: 12px !important;
  }
  
  /* 고객 폼 필드 컨테이너 - 모바일 그리드 */
  .customer-form-fields {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 6px 8px;
    max-height: calc(100vh - 200px);
    overflow-y: auto;
    padding: 4px;
  }
  
  .customer-form-fields .form-group {
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    flex: none !important;
    margin-bottom: 0 !important;
  }
  
  .customer-form-fields .form-group label {
    font-size: 0.7rem !important;
    margin-bottom: 2px !important;
    display: block !important;
  }
  
  .customer-form-fields .form-group input:not([type="checkbox"]),
  .customer-form-fields .form-group select {
    width: 100% !important;
    box-sizing: border-box !important;
    font-size: 0.75rem !important;
    padding: 6px 8px !important;
    height: 32px !important;
    border-radius: 4px !important;
  }
  
  /* 모바일 폼 필드 순서 재배치 - grid-row로 명시적 배치 */
  /* 1줄: 담당직원 (좌), 진행상태 (우) */
  .form-group-staff { 
    order: 1 !important; 
    grid-column: 1 !important;
    grid-row: 1 !important;
    justify-self: stretch !important;
    width: 100% !important;
  }
  .form-group-status { 
    order: 2 !important; 
    grid-column: 2 !important;
    grid-row: 1 !important;
  }
  /* 2줄: 이름, 생년월일 */
  .form-group-name { order: 3 !important; grid-column: 1 !important; grid-row: 2 !important; }
  .form-group-birth { order: 4 !important; grid-column: 2 !important; grid-row: 2 !important; }
  /* 3줄: 연락처, 통신사 */
  .form-group-phone { order: 5 !important; grid-column: 1 !important; grid-row: 3 !important; }
  .form-group-carrier { order: 6 !important; grid-column: 2 !important; grid-row: 3 !important; }
  /* 4줄: 직군, 연봉 (연봉 레이블 옆에 즉발사업자) */
  .form-group-occupation { order: 7 !important; grid-column: 1 !important; grid-row: 4 !important; }
  .form-group-salary { 
    order: 8 !important; 
    grid-column: 2 !important; 
    grid-row: 4 !important;
  }
  /* 연봉 레이블 */
  .form-group-salary > label {
    display: inline-flex !important;
    align-items: center !important;
  }
  /* 데스크톱용 즉발사업자 숨김 (모바일에서) */
  .form-group-instant-biz.desktop-only { 
    display: none !important;
  }
  
  /* 담보물 정보 - 모바일 */
  #collateralContainer {
    margin-bottom: 8px !important;
  }
  
  .collateral-item {
    margin-bottom: 8px !important;
    border-radius: 6px !important;
  }
  
  .collateral-header {
    padding: 8px 12px !important;
    font-size: 0.75rem !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
  }
  
  .collateral-header-left {
    width: 100% !important;
    flex: none !important;
  }
  
  .collateral-header-info {
    flex: 1 !important;
    min-width: 0 !important;
  }
  
  .collateral-header-row {
    flex-wrap: nowrap !important;
  }
  
  .collateral-address-preview {
    max-width: 100% !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }
  
  .collateral-header-buttons {
    display: flex !important;
    justify-content: flex-end !important;
    gap: 6px !important;
    width: 100% !important;
    padding-top: 6px !important;
    border-top: 1px solid rgba(0,0,0,0.08) !important;
  }
  
  .collateral-header-buttons .btn-edit-collateral,
  .collateral-header-buttons .btn-save-collateral,
  .collateral-header-buttons .btn-cancel-collateral,
  .collateral-header-buttons .remove-collateral {
    padding: 6px 12px !important;
    font-size: 0.72rem !important;
    flex-shrink: 0 !important;
  }
  
  .collateral-toggle {
    font-size: 0.7rem !important;
  }
  
  .collateral-address-preview {
    font-size: 0.7rem !important;
  }
  
  .collateral-price-preview {
    font-size: 0.75rem !important;
  }
  
  .collateral-content {
    padding: 8px 12px !important;
  }
  
  .collateral-content input,
  .collateral-content select,
  .collateral-content textarea {
    font-size: 0.75rem !important;
    padding: 6px 8px !important;
  }
  
  /* 상담내용 - 모바일 */
  .simple-notes-container {
    margin-bottom: 8px !important;
  }
  
  .simple-notes-list {
    max-height: 120px !important;
    overflow-y: auto !important;
    border: 1px solid #e1e5eb !important;
    border-radius: 4px !important;
    padding: 4px !important;
  }
  
  .simple-notes-item {
    font-size: 0.7rem !important;
    padding: 4px 6px !important;
    margin-bottom: 2px !important;
  }
  
  .simple-notes-input input {
    font-size: 0.75rem !important;
    padding: 6px 8px !important;
    height: 32px !important;
  }
  
  .simple-notes-input .btn-add-simple-note {
    padding: 6px 10px !important;
    font-size: 0.7rem !important;
    height: 32px !important;
  }
  
  .btn-small {
    padding: 5px 8px;
    font-size: 0.68rem;
    width: auto;
  }
  
  .modal-actions,
  .form-actions {
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 6px;
    margin-top: 10px;
    align-items: stretch;
    justify-content: space-between;
  }
  
  #modal .form-actions #deleteBtn {
    flex: 0 0 auto;
    margin-right: auto;
  }
  
  .form-actions-right {
    display: flex;
    flex-direction: row;
    gap: 6px;
    flex: 0 0 auto;
    margin-left: auto;
  }
  
  .modal-actions .btn,
  .form-actions .btn {
    flex: 1;
    min-width: auto;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    writing-mode: horizontal-tb;
    padding: 8px 10px !important;
    font-size: 0.75rem !important;
  }
  
  /* 알림 */
  .notification-badge {
    font-size: 0.58rem;
    padding: 1px 3px;
  }
  
  /* 테이블 설정 팝업 - 모바일 */
  .settings-popup {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    right: auto !important;
    width: 88% !important;
    max-width: 300px !important;
    max-height: 40vh;
    overflow: visible !important;
    background: rgba(255, 255, 255, 0.98) !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25) !important;
    display: none;
    flex-direction: column;
  }
  
  .settings-popup.show {
    display: flex !important;
  }
  
  .settings-popup-header {
    position: sticky;
    top: 0;
    z-index: 10;
    background: rgba(248, 249, 250, 0.98) !important;
    padding: 8px 10px;
    flex-wrap: nowrap;
    gap: 4px;
    border-bottom: 1px solid #ddd;
    flex-shrink: 0;
  }
  
  .settings-header-left {
    flex-wrap: wrap;
    gap: 4px !important;
    flex: 1;
  }
  
  .settings-header-left h3 {
    font-size: 0.82rem;
  }
  
  .settings-header-left .tooltip-toggle-btn {
    padding: 2px 5px;
    font-size: 0.62rem;
  }
  
  .settings-header-left .opacity-control {
    flex-basis: 100%;
    margin-top: 2px;
    gap: 4px;
  }
  
  .settings-close-btn {
    position: absolute !important;
    top: 6px !important;
    right: 6px !important;
    font-size: 1.2rem !important;
    padding: 2px 6px !important;
  }
  
  .opacity-label {
    font-size: 0.65rem !important;
  }
  
  .opacity-slider {
    width: 50px !important;
    height: 3px !important;
  }
  
  .opacity-value {
    font-size: 0.65rem !important;
    min-width: 28px !important;
  }
  
  .settings-popup-body {
    padding: 8px 10px;
    overflow-x: hidden;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
  }
  
  .settings-section h4 {
    font-size: 0.72rem !important;
    margin-bottom: 6px !important;
  }
  
  .font-size-control {
    gap: 4px !important;
  }
  
  .column-width-controls {
    gap: 4px !important;
  }
  
  .column-width-row {
    padding: 4px 6px !important;
    font-size: 0.65rem !important;
    gap: 4px !important;
  }
  
  .col-name {
    font-size: 0.62rem !important;
    min-width: 45px !important;
    max-width: 55px !important;
  }
  
  .col-value {
    font-size: 0.62rem !important;
    min-width: 32px !important;
  }
  
  .wheel-area {
    width: 45px !important;
    height: 14px !important;
  }
  
  .wheel-btn {
    width: 16px !important;
    height: 16px !important;
    font-size: 0.75rem !important;
  }
  
  .settings-popup-footer {
    position: sticky;
    bottom: 0;
    z-index: 10;
    background: rgba(255, 255, 255, 0.98) !important;
    padding: 6px 8px;
    flex-wrap: nowrap;
    gap: 3px;
    overflow: visible;
    border-top: 1px solid #ddd;
    flex-shrink: 0;
  }
  
  .settings-footer-left {
    width: auto;
    justify-content: flex-start;
    gap: 3px !important;
    flex-shrink: 0;
  }
  
  .settings-footer-left .btn {
    padding: 4px 6px !important;
    font-size: 0.58rem !important;
    white-space: nowrap;
  }
  
  .settings-popup-footer .footer-buttons {
    width: auto;
    justify-content: flex-end;
    gap: 3px !important;
    flex-shrink: 0;
    margin-left: auto;
  }
  
  .settings-popup-footer .footer-buttons .btn {
    padding: 4px 6px !important;
    font-size: 0.58rem !important;
    white-space: nowrap;
  }
  
  /* 모바일 툴팁 스타일 - 테이블 설정 */
  .settings-guide-tooltip {
    position: absolute !important;
    left: 0 !important;
    right: auto !important;
    top: calc(100% + 8px) !important;
    bottom: auto !important;
    transform: none !important;
    white-space: normal !important;
    max-width: 200px !important;
    text-align: left;
    font-size: 0.65rem !important;
    padding: 6px 10px !important;
    z-index: 2010 !important;
  }
  
  .settings-guide-tooltip::after {
    content: '' !important;
    display: block !important;
    position: absolute !important;
    bottom: 100% !important;
    top: auto !important;
    left: 20px !important;
    border: 6px solid transparent !important;
    border-bottom-color: #333 !important;
    border-top-color: transparent !important;
  }
  
  #saveTooltip {
    position: absolute !important;
    right: 0 !important;
    left: auto !important;
    bottom: calc(100% + 8px) !important;
    top: auto !important;
    transform: none !important;
    white-space: normal !important;
    max-width: 220px !important;
    text-align: center;
    font-size: 0.65rem !important;
    padding: 8px 12px !important;
    z-index: 2010 !important;
  }
  
  #saveTooltip::after {
    content: '' !important;
    display: block !important;
    position: absolute !important;
    top: 100% !important;
    bottom: auto !important;
    right: 15px !important;
    left: auto !important;
    transform: none !important;
    border: 6px solid transparent !important;
    border-top-color: #333 !important;
    border-bottom-color: transparent !important;
  }
  
  /* 모바일 필터 적용 툴팁 */
  .filter-apply-tooltip {
    position: absolute !important;
    right: 0 !important;
    left: auto !important;
    top: calc(100% + 8px) !important;
    bottom: auto !important;
    transform: none !important;
    white-space: normal !important;
    max-width: 220px !important;
    text-align: center;
    font-size: 0.65rem !important;
    padding: 8px 12px !important;
    z-index: 2010 !important;
  }
  
  .filter-apply-tooltip::after {
    content: '' !important;
    display: block !important;
    position: absolute !important;
    bottom: 100% !important;
    top: auto !important;
    right: 12px !important;
    left: auto !important;
    transform: none !important;
    border: 6px solid transparent !important;
    border-bottom-color: #333 !important;
    border-top-color: transparent !important;
  }

  .settings-save-tooltip {
    position: fixed !important;
    left: 50% !important;
    right: auto !important;
    bottom: auto !important;
    top: 50% !important;
    transform: translate(-50%, -50%) !important;
    font-size: 0.7rem !important;
    padding: 10px 16px !important;
    z-index: 9999 !important;
    max-width: 280px !important;
    white-space: normal !important;
    text-align: center !important;
    line-height: 1.4 !important;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3) !important;
  }
  
  .settings-save-tooltip::after {
    display: none !important;
  }
  
  /* 테이블 설정 팝업 (deprecated) */
  .table-settings-popup {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    right: auto !important;
    width: 90% !important;
    max-width: 320px !important;
    max-height: 80vh;
    overflow-y: auto;
  }
  
  /* 필터 팝업 - 모바일 */
  .filter-popup {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: 90% !important;
    max-width: 320px !important;
    max-height: 50vh;
    background: rgba(255, 255, 255, 0.98) !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25) !important;
    overflow: visible !important;
    display: none;
    flex-direction: column;
  }
  
  .filter-popup.show {
    display: flex !important;
  }
  
  .filter-popup-header {
    position: relative;
    z-index: 10;
    background: rgba(248, 249, 250, 0.98) !important;
    padding: 8px 10px;
    padding-right: 30px;
    gap: 4px !important;
    border-bottom: 1px solid #ddd;
    flex-shrink: 0;
  }
  
  .filter-popup-header h3 {
    font-size: 0.82rem;
  }
  
  .filter-popup-header .tooltip-toggle-btn {
    padding: 2px 5px;
    font-size: 0.62rem;
    margin-right: 0;
  }
  
  .filter-close-btn {
    position: absolute !important;
    top: 6px !important;
    right: 6px !important;
    font-size: 1.2rem !important;
    padding: 2px 6px !important;
  }
  
  .filter-popup-body {
    padding: 8px 10px;
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1 1 auto;
    min-height: 0;
    max-height: calc(50vh - 85px);
  }
  
  .filter-section h4 {
    font-size: 0.7rem !important;
    margin-bottom: 4px !important;
  }
  
  .filter-section {
    margin-bottom: 8px !important;
  }
  
  .filter-checkboxes label {
    font-size: 0.6rem !important;
    padding: 2px 5px !important;
  }
  
  .filter-checkboxes {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 3px !important;
    overflow: visible !important;
    width: 100% !important;
    max-width: 100% !important;
  }
  
  /* 필터 체크박스 라벨 (칩 스타일) */
  .filter-checkboxes label.filter-chip {
    flex-shrink: 1 !important;
    min-width: 0 !important;
  }
  
  .filter-popup-footer {
    position: relative;
    z-index: 10;
    background: rgba(255, 255, 255, 0.98) !important;
    padding: 8px 10px;
    border-top: 1px solid #ddd;
    flex-shrink: 0;
    gap: 6px;
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: center !important;
    flex-wrap: nowrap !important;
  }
  
  .filter-popup-footer .btn {
    padding: 5px 8px !important;
    font-size: 0.6rem !important;
    white-space: nowrap !important;
    flex-shrink: 0;
  }
  
  .filter-footer-right {
    display: flex !important;
    gap: 4px !important;
    flex-shrink: 0;
  }
  
  /* 필터 버튼 래퍼 - 툴팁 위치 기준 */
  .filter-list-btn-wrapper,
  .filter-save-btn-wrapper,
  .filter-apply-btn-wrapper {
    position: relative !important;
    display: inline-block !important;
  }
  
  /* 필터 관련 툴팁 - 모바일 */
  /* filterGuideTooltip: 저장 버튼 위에 표시 (오른쪽 정렬) */
  .filter-guide-tooltip {
    position: absolute !important;
    left: auto !important;
    right: 0 !important;
    bottom: calc(100% + 8px) !important;
    top: auto !important;
    transform: none !important;
    white-space: nowrap !important;
    max-width: none !important;
    text-align: center;
    font-size: 0.6rem !important;
    padding: 5px 8px !important;
    z-index: 2010 !important;
    background: #333 !important;
    color: #fff !important;
    border-radius: 6px !important;
  }
  
  .filter-guide-tooltip::after {
    content: '' !important;
    display: block !important;
    position: absolute !important;
    top: 100% !important;
    bottom: auto !important;
    left: auto !important;
    right: 10px !important;
    transform: none !important;
    border: 6px solid transparent !important;
    border-top-color: #333 !important;
    border-bottom-color: transparent !important;
  }
  
  /* filterSaveTooltip: 필터리스트 버튼 위에 표시 (오른쪽 정렬) */
  .filter-save-tooltip {
    position: absolute !important;
    left: auto !important;
    right: -50px !important;
    bottom: calc(100% + 8px) !important;
    top: auto !important;
    transform: none !important;
    font-size: 0.6rem !important;
    padding: 5px 8px !important;
    z-index: 2010 !important;
    white-space: nowrap !important;
    background: #28a745 !important;
    color: #fff !important;
    border-radius: 6px !important;
  }
  
  .filter-save-tooltip::after {
    content: '' !important;
    display: block !important;
    position: absolute !important;
    top: 100% !important;
    bottom: auto !important;
    left: auto !important;
    right: 60px !important;
    transform: none !important;
    border: 6px solid transparent !important;
    border-top-color: #28a745 !important;
    border-bottom-color: transparent !important;
  }
  
  /* 주소 입력 */
  .address-row {
    flex-direction: column;
    gap: 8px;
  }
  
  .address-row input,
  .address-row select {
    width: 100% !important;
  }
  
  /* 담보물 섹션 */
  .collateral-section {
    padding: 10px;
  }
  
  /* 담보물 탭 - 줄바꿈 방지 */
  .collateral-tabs {
    display: flex;
    flex-wrap: nowrap;
    gap: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  .collateral-tab {
    flex-shrink: 0;
    padding: 8px 10px;
    font-size: 0.7rem;
    white-space: nowrap;
  }
  
  .collateral-item {
    padding: 10px;
    margin-bottom: 10px;
  }
  
  .price-row {
    flex-direction: column;
    gap: 8px;
  }
  
  .price-row input {
    width: 100% !important;
  }
  
  .price-field {
    width: 100%;
  }
  
  /* 채무 행 */
  .debt-row {
    flex-direction: column;
    gap: 8px;
  }
  
  .debt-field {
    width: 100%;
  }
  
  .debt-field input,
  .debt-field select {
    width: 100% !important;
  }
  
  .btn-remove-debt {
    width: 100%;
    margin-left: 0;
  }
  
  /* 토스트 메시지 */
  .toast {
    left: 10px !important;
    right: 10px !important;
    transform: none !important;
    max-width: none !important;
    bottom: 20px;
  }
  
  /* 커스텀 다이얼로그 */
  #customAlertModal,
  .custom-dialog-overlay {
    padding: 15px;
  }
  
  .custom-dialog-overlay .custom-dialog,
  .custom-dialog {
    width: 100% !important;
    max-width: 320px !important;
    padding: 20px;
  }
  
  .custom-dialog h3 {
    font-size: 1rem;
  }
  
  .custom-dialog p {
    font-size: 0.85rem;
  }
  
  /* 툴팁 */
  .tooltip,
  .auto-fill-tooltip,
  .click-tooltip {
    max-width: 260px;
    font-size: 0.72rem;
  }
  
  /* 스크롤 힌트 */
  .scroll-hint {
    display: none;
  }
  
  /* 섹션 헤더 */
  .section-header {
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
  }
  
  .section-header h4 {
    font-size: 0.9rem;
  }
  
  /* 타입/지역 섹션 */
  .type-region-section {
    padding: 10px;
  }
  
  /* 특이사항 테이블 */
  .memo-table {
    font-size: 0.7rem;
  }
  
  .memo-table th,
  .memo-table td {
    padding: 6px 4px;
  }
  
  /* KB 시세 버튼 - complex-row 내부 배치 */
  .complex-row > .btn-kb-fetch {
    flex: 1 1 100%;
    width: 100%;
    padding: 10px;
    font-size: 0.85rem;
    margin-top: 6px;
    order: 10;
  }
  
  /* 거주형태 옵션 */
  /* 거주형태 옵션 - 줄바꿈 허용 (스크롤 없이) */
  .residence-options,
  .residence-section .residence-options {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    overflow-x: visible !important;
    gap: 4px 6px !important;
  }
  
  .residence-section .residence-options .radio-label {
    flex-shrink: 0;
    padding: 4px 6px;
    font-size: 0.65rem;
  }
  
  /* 메인으로 지정하기 - 컴팩트하게 우측 상단에 배치 */
  .main-tab-selector {
    padding: 4px 8px;
    margin: 0 0 6px 0;
    background: transparent;
    border: none;
    justify-content: flex-end;
  }
  
  .main-tab-label {
    font-size: 0.68rem;
    padding: 3px 8px;
    gap: 4px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 4px;
  }
  
  .main-tab-label input[type="radio"] {
    width: 12px;
    height: 12px;
  }
  
  .residence-option {
    width: auto;
  }
  
  /* 필터 바 */
  .filter-bar {
    flex-direction: column;
    gap: 10px;
    padding: 10px;
    margin-bottom: 10px;
  }
  
  .filter-bar-left {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 8px;
  }
  
  /* 관리자 버튼 행 - 2열 그리드 */
  .filter-bar-left .admin-buttons-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    width: 100%;
  }
  
  /* 버튼이 하나만 있는 행은 숨김 처리 (빈 행 방지) */
  .filter-bar-left .admin-buttons-row:empty {
    display: none;
  }
  
  /* 표시되는 버튼이 없으면 행 숨김 */
  .filter-bar-left .admin-buttons-row:not(:has(button:not([style*="display: none"]):not([style*="display:none"]))) {
    display: none;
  }
  
  .filter-bar-left .search-container {
    width: 100%;
  }
  
  .filter-bar-left input[type="text"] {
    width: 100%;
    font-size: 14px;
  }
  
  /* 관리자 버튼들 (이관, 자동배정 등) */
  .filter-bar-left .btn-transfer,
  .filter-bar-left .btn-revert-transfer,
  .filter-bar-left .btn-auto-assign,
  .filter-bar-left .btn-assign {
    font-size: 0.65rem !important;
    padding: 8px 6px !important;
    white-space: nowrap;
    width: 100%;
    text-align: center;
  }
  
  /* 직원선택 드롭다운 */
  .filter-bar-left .assign-staff-select {
    height: 34px !important;
    font-size: 0.65rem !important;
    width: 100%;
  }
  
  .filter-bar-right {
    width: 100%;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
  }
  
  .filter-bar-right .btn-add-customer {
    flex: 0 0 auto;
    padding: 8px 10px;
    font-size: 0.72rem;
    white-space: nowrap;
  }
  
  .filter-bar-right .staff-filter {
    flex: 1 1 auto;
    min-width: 0;
    max-width: 120px;
    font-size: 0.65rem !important;
    padding: 6px 4px !important;
  }
  
  .filter-bar-right .filter-btn-wrapper {
    flex: 0 0 auto;
  }
  
  .btn-filter {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 8px 10px;
    font-size: 0.72rem;
    white-space: nowrap;
    min-width: auto;
  }
  
  .btn-filter span,
  .btn-filter .filter-icon {
    display: inline;
  }
  
  /* 필터 팝업 */
  .filter-popup {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: 90% !important;
    max-width: 300px;
    max-height: 80vh;
    overflow-y: auto;
  }
  
  .filter-section h4 {
    font-size: 0.8rem;
  }
  
  .filter-checkboxes {
    gap: 4px;
  }
  
  .filter-chip {
    padding: 4px 8px;
    font-size: 0.7rem;
  }
}

/* 아주 작은 모바일 (360px 이하) */
@media (max-width: 360px) {
  .container {
    padding: 5px;
  }
  
  header {
    padding: 8px;
    gap: 6px;
  }
  
  header h1 {
    font-size: 0.9rem;
  }
  
  .header-buttons {
    gap: 4px;
    justify-content: flex-end;
  }
  
  .header-buttons .btn {
    padding: 4px 8px;
    font-size: 0.65rem;
  }
  
  .user-info .user-name {
    font-size: 0.68rem;
  }
  
  .dept-tab {
    padding: 5px 8px;
    font-size: 0.7rem;
  }
  
  table,
  #customerTable {
    font-size: 0.6rem !important;
  }
  
  .page-btn {
    padding: 3px 5px;
    font-size: 0.6rem;
    min-width: 22px;
    height: 22px;
  }
  
  .filter-bar {
    padding: 8px;
    gap: 8px;
  }
  
  .btn-filter {
    padding: 6px 10px;
    font-size: 0.7rem;
  }
  
  .filter-bar-left input[type="text"] {
    font-size: 13px;
    padding: 8px 12px;
  }
}

/* 모바일 가로 스크롤 방지 */
@media (max-width: 768px) {
  html, body {
    overflow-x: hidden !important;
  }
  
  .container {
    max-width: 100vw !important;
    overflow-x: hidden !important;
  }
  
  /* 거주형태 필터 옵션 - 한 줄에 모두 표시 */
  #residenceTypeFilterContainer {
    display: flex !important;
    flex-wrap: nowrap !important;
    gap: 3px !important;
    overflow: visible !important;
  }
  
  #residenceTypeFilterContainer .filter-chip {
    padding: 3px 5px !important;
    font-size: 0.6rem !important;
    white-space: nowrap !important;
    flex-shrink: 0;
  }
  
  /* 모바일 필터 날짜 버튼들 */
  .filter-date-buttons {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 6px !important;
    margin-bottom: 10px !important;
  }
  
  .filter-date-buttons button {
    padding: 10px 8px !important;
    font-size: 0.75rem !important;
    font-weight: 500 !important;
    white-space: nowrap !important;
    border-radius: 6px !important;
    border: 1.5px solid #ccc !important;
    background: #f8f9fa !important;
    color: #333 !important;
  }
  
  .filter-date-buttons button.active {
    background: #5c6bc0 !important;
    color: white !important;
    border-color: #5c6bc0 !important;
  }
  
  /* 모바일 기간 선택 UI */
  .filter-date-range {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
  }
  
  .filter-date-range .date-range-toggle {
    width: 100% !important;
    padding: 10px !important;
    font-size: 0.75rem !important;
    font-weight: 500 !important;
    border-radius: 6px !important;
  }
  
  .date-range-inputs {
    /* display는 JS에서 제어 - 여기서 강제하지 않음 */
    align-items: center !important;
    gap: 6px !important;
    width: 100% !important;
  }
  
  .date-range-inputs.show {
    display: flex !important;
  }
  
  .filter-date-range input[type="date"] {
    flex: 1 !important;
    min-width: 0 !important;
    padding: 8px 6px !important;
    font-size: 0.72rem !important;
  }
  
  /* 필터 적용 버튼 툴팁 - 화면 중앙에 표시 */
  .filter-save-tooltip {
    position: fixed !important;
    left: 50% !important;
    right: auto !important;
    bottom: auto !important;
    top: 50% !important;
    transform: translate(-50%, -50%) !important;
    font-size: 0.7rem !important;
    padding: 10px 16px !important;
    z-index: 9999 !important;
    white-space: normal !important;
    background: #28a745 !important;
    color: #fff !important;
    border-radius: 8px !important;
    max-width: 280px !important;
    text-align: center !important;
    line-height: 1.4 !important;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3) !important;
  }
  
  .filter-save-tooltip::after {
    display: none !important;
  }
}

/* 로딩 인디케이터 */
.loading-indicator {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  min-height: 200px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(240, 245, 255, 0.98) 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(4px);
  border-radius: 12px;
  animation: loadingFadeIn 0.3s ease-out;
}

@keyframes loadingFadeIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.loading-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid #e8f0fe;
  border-top: 4px solid #1a73e8;
  border-right: 4px solid #4285f4;
  border-radius: 50%;
  animation: spin 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite;
  margin-bottom: 16px;
  box-shadow: 0 4px 15px rgba(26, 115, 232, 0.2);
}

.loading-text {
  color: #444;
  font-size: 15px;
  font-weight: 600;
  animation: loadingTextPulse 1.5s ease-in-out infinite;
}

@keyframes loadingTextPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* 로딩 중 테이블 스켈레톤 효과 */
.table-container:not(.loaded) tbody tr {
  animation: skeletonPulse 1.5s ease-in-out infinite;
}

@keyframes skeletonPulse {
  0%, 100% { background-color: #fff; }
  50% { background-color: #f8f9fa; }
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* 로딩 진행률 표시 */
.loading-progress-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 12px;
  width: 200px;
}

.loading-progress-bar {
  width: 100%;
  height: 6px;
  background: #e9ecef;
  border-radius: 3px;
  overflow: hidden;
}

.loading-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #007bff, #0056b3);
  border-radius: 3px;
  transition: width 0.3s ease;
}

.loading-progress-text {
  margin-top: 6px;
  font-size: 12px;
  color: #666;
}

/* 데이터 로딩 중 배지 */
.data-loading-badge {
  display: inline-block;
  padding: 2px 6px;
  background: linear-gradient(90deg, #ffc107, #fd7e14);
  color: white;
  font-size: 10px;
  font-weight: 600;
  border-radius: 8px;
  margin-left: 6px;
  animation: pulse-badge 1s infinite;
  cursor: help;
}

@keyframes pulse-badge {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* 로딩 중일 때 테이블 컨테이너 상대 위치 지정 */
.table-wrapper {
  position: relative;
}

/* 입금 검색 자동완성 총 검색결과 표시 */
.deposit-autocomplete-more {
  padding: 6px 12px;
  color: #007bff;
  font-size: 11px;
  font-weight: 600;
  text-align: center;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-top: 2px solid #dee2e6;
}

.more-text {
  font-weight: 600;
}

/* ========================================
   모바일: 소액임차, 사업대공식 모달 시인성 개선
   ======================================== */
@media (max-width: 480px) {
  /* 소액임차 모달 - 모바일 최적화 */
  #depositModal .modal-content {
    width: 98% !important;
    max-width: none !important;
    max-height: 95vh !important;
    padding: 0 !important;
  }
  
  #depositModal .modal-header {
    padding: 10px 12px !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    flex-wrap: nowrap !important;
  }
  
  #depositModal .modal-header h2 {
    font-size: 14px !important;
    flex: 1 !important;
    margin-right: 10px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }
  
  #depositModal .modal-header .close {
    flex-shrink: 0 !important;
    position: static !important;
    margin: 0 !important;
  }
  
  #depositModal .modal-body {
    padding: 8px 4px !important;
    overflow-x: auto !important;
  }
  
  #depositModal .deposit-table {
    width: 100% !important;
    min-width: 0 !important;
    font-size: 11px !important;
  }
  
  #depositModal .deposit-table th {
    padding: 8px 3px !important;
    font-size: 10px !important;
    font-weight: 700 !important;
    background: #2c3e50 !important;
    color: #fff !important;
  }
  
  #depositModal .deposit-table td {
    padding: 7px 3px !important;
    font-size: 10px !important;
    line-height: 1.4 !important;
    background: #fff !important;
    color: #333 !important;
  }
  
  /* 소액임차 모바일 컬럼 너비 - 첫번째 컬럼 확대 */
  #depositModal .deposit-table colgroup col:nth-child(1) { width: 10% !important; }
  #depositModal .deposit-table colgroup col:nth-child(2) { width: 47% !important; }
  #depositModal .deposit-table colgroup col:nth-child(3) { width: 23% !important; }
  #depositModal .deposit-table colgroup col:nth-child(4) { width: 20% !important; }
  
  /* 소액임차 구분 컬럼 (1호, 2호 등) */
  #depositModal .deposit-table .region-code {
    background: #34495e !important;
    color: #fff !important;
    font-size: 10px !important;
    padding: 6px 2px !important;
  }
  
  /* 소액임차 지역 상세 */
  #depositModal .deposit-table .region-detail {
    word-break: break-word !important;
    white-space: normal !important;
    font-size: 9px !important;
    line-height: 1.3 !important;
    background: #f8f9fa !important;
    color: #333 !important;
  }
  
  #depositModal .deposit-table .region-detail strong {
    color: #e67e22 !important;
  }
  
  /* 소액임차 금액 컬럼 */
  #depositModal .deposit-table td:nth-child(3),
  #depositModal .deposit-table td:nth-child(4) {
    background: #fff !important;
    color: #2c3e50 !important;
    font-weight: 600 !important;
    text-align: center !important;
  }
  
  /* 사업대 공식 모달 - 모바일 최적화 */
  #businessLoanFormulaModal .modal-content {
    width: 98% !important;
    max-width: none !important;
    max-height: 95vh !important;
    padding: 0 !important;
  }
  
  #businessLoanFormulaModal .modal-header {
    padding: 10px 12px !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    flex-wrap: nowrap !important;
  }
  
  #businessLoanFormulaModal .modal-header h2 {
    font-size: 14px !important;
    flex: 1 !important;
    margin-right: 10px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }
  
  #businessLoanFormulaModal .modal-header .close {
    flex-shrink: 0 !important;
    position: static !important;
    margin: 0 !important;
  }
  
  #businessLoanFormulaModal .modal-body {
    padding: 10px 6px !important;
    overflow-x: auto !important;
  }
  
  #businessLoanFormulaModal .deposit-table {
    width: 100% !important;
    min-width: 0 !important;
    font-size: 11px !important;
  }
  
  #businessLoanFormulaModal .deposit-table th {
    padding: 10px 4px !important;
    font-size: 10px !important;
    font-weight: 700 !important;
    word-break: keep-all !important;
    background: #2c3e50 !important;
    color: #fff !important;
  }
  
  #businessLoanFormulaModal .deposit-table td {
    padding: 10px 4px !important;
    font-size: 11px !important;
    line-height: 1.4 !important;
    background: #fff !important;
    color: #333 !important;
  }
  
  /* 사업대 공식 - 첫번째 컬럼 너비 확대 */
  #businessLoanFormulaModal .deposit-table colgroup col:nth-child(1) { width: 18% !important; }
  #businessLoanFormulaModal .deposit-table colgroup col:nth-child(2) { width: 20% !important; }
  #businessLoanFormulaModal .deposit-table colgroup col:nth-child(3) { width: 15% !important; }
  #businessLoanFormulaModal .deposit-table colgroup col:nth-child(4) { width: 15% !important; }
  #businessLoanFormulaModal .deposit-table colgroup col:nth-child(5) { width: 32% !important; }
  
  /* 사업대 공식 - 공식 셀 가독성 */
  #businessLoanFormulaModal .deposit-table td:last-child {
    font-size: 10px !important;
    word-break: break-word !important;
    white-space: normal !important;
    color: #2563eb !important;
    font-weight: 500 !important;
    background: #f0f7ff !important;
  }
}

/* ========================================
   다크/라이트 모드 토글 버튼 (텍스트 버전)
   ======================================== */
.header-title-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-theme-text {
  background: transparent;
  color: #666;
  border: 1px solid #ddd;
  padding: 4px 10px;
  font-size: 0.72rem;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-theme-text:hover {
  background: #f0f0f0;
  border-color: #bbb;
  color: #333;
}

.theme-text {
  font-weight: 500;
}

/* ========================================
   다크모드 스타일
   ======================================== */
body.dark-mode {
  background-color: #1a1a2e;
  color: #e0e0e0;
}

body.dark-mode .container {
  background-color: #1a1a2e;
}

body.dark-mode header {
  background: #16213e;
  color: #e0e0e0;
  border-color: #2d3a4f;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

body.dark-mode header h1 {
  color: #fff;
}

body.dark-mode .department-tabs {
  background: #16213e;
  border-color: #2d3a4f;
}

body.dark-mode .dept-tab {
  background: #1a1a2e;
  color: #a0a0a0;
  border-color: #2d3a4f;
}

body.dark-mode .dept-tab:hover {
  background: #2d3a4f;
  color: #fff;
}

body.dark-mode .dept-tab.active {
  background: #2563eb;
  color: #fff;
}

body.dark-mode .filter-bar {
  background: #16213e;
  border-color: #2d3a4f;
}

body.dark-mode .search-input,
body.dark-mode .filter-select,
body.dark-mode input[type="text"],
body.dark-mode input[type="number"],
body.dark-mode input[type="date"],
body.dark-mode select,
body.dark-mode textarea {
  background: #1a1a2e;
  color: #e0e0e0;
  border-color: #2d3a4f;
}

body.dark-mode .search-input:focus,
body.dark-mode .filter-select:focus,
body.dark-mode input:focus,
body.dark-mode select:focus,
body.dark-mode textarea:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

body.dark-mode .table-container {
  background: #16213e;
  border-color: #2d3a4f;
}

body.dark-mode table {
  background: #16213e;
}

body.dark-mode table th {
  background: #1a1a2e;
  color: #fff;
  border-color: #2d3a4f;
}

body.dark-mode table td {
  background: #16213e;
  color: #e0e0e0;
  border-color: #2d3a4f;
}

body.dark-mode table tr:hover td {
  background: #2d3a4f;
}

body.dark-mode table tr.selected td {
  background: #1e3a5f;
}

body.dark-mode .modal-content {
  background: #16213e;
  color: #e0e0e0;
  border-color: #2d3a4f;
}

body.dark-mode .modal-header {
  background: #1a1a2e;
  border-color: #2d3a4f;
}

body.dark-mode .modal-header h2 {
  color: #fff;
}

body.dark-mode .modal-body {
  background: #16213e;
}

body.dark-mode .form-group label {
  color: #b0b0b0;
}

body.dark-mode .card,
body.dark-mode .info-card,
body.dark-mode .section-card {
  background: #16213e;
  border-color: #2d3a4f;
  color: #e0e0e0;
}

body.dark-mode .card-header,
body.dark-mode .section-header {
  background: #1a1a2e;
  color: #fff;
  border-color: #2d3a4f;
}

body.dark-mode .btn {
  background: #2d3a4f;
  color: #e0e0e0;
  border-color: #3d4a5f;
}

body.dark-mode .btn:hover {
  background: #3d4a5f;
}

body.dark-mode .btn-primary {
  background: #2563eb;
  color: #fff;
  border-color: #2563eb;
}

body.dark-mode .btn-primary:hover {
  background: #1d4ed8;
}

body.dark-mode .pagination {
  background: #16213e;
}

body.dark-mode .pagination-container {
  background: #16213e;
  border-color: #2d3a4f;
}

body.dark-mode .pagination-info {
  color: #b0b0b0;
}

body.dark-mode .keyboard-hint {
  background: #1a1a2e;
  color: #b0b0b0;
  border-color: #2d3a4f;
}

body.dark-mode .pagination button {
  background: #1a1a2e;
  color: #e0e0e0;
  border-color: #2d3a4f;
}

body.dark-mode .pagination button:hover:not(:disabled) {
  background: #2d3a4f;
}

body.dark-mode .pagination button.active {
  background: #2563eb;
  color: #fff;
}

body.dark-mode .items-per-page {
  color: #b0b0b0;
}

body.dark-mode .items-per-page select {
  background-color: #1a1a2e;
  color: #e0e0e0;
  border-color: #2d3a4f;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23b0b0b0' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
}

body.dark-mode .items-per-page select:hover {
  border-color: #3d4a5f;
}

body.dark-mode .items-per-page select:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

body.dark-mode .tooltip,
body.dark-mode .auto-fill-tooltip,
body.dark-mode .click-tooltip {
  background: #2d3a4f;
  color: #e0e0e0;
  border-color: #3d4a5f;
}

body.dark-mode .autocomplete-list {
  background: #1a1a2e;
  border-color: #2d3a4f;
}

body.dark-mode .autocomplete-item {
  color: #e0e0e0;
}

body.dark-mode .autocomplete-item:hover,
body.dark-mode .autocomplete-item.selected {
  background: #2d3a4f;
}

body.dark-mode .dialog-overlay .dialog-content {
  background: #16213e;
  color: #e0e0e0;
  border-color: #2d3a4f;
}

body.dark-mode .dialog-header {
  background: #1a1a2e;
  border-color: #2d3a4f;
}

body.dark-mode .toast {
  background: #2d3a4f;
  color: #fff;
}

body.dark-mode .toast.success {
  background: #166534;
  color: #fff;
}

body.dark-mode .toast.error {
  background: #991b1b;
  color: #fff;
}

body.dark-mode .toast.info {
  background: #1e40af;
  color: #fff;
}

body.dark-mode .toast.warning {
  background: #92400e;
  color: #fff;
}

body.dark-mode .user-info {
  color: #e0e0e0;
}

body.dark-mode .user-name {
  color: #fff;
}

body.dark-mode ::placeholder {
  color: #666;
}

body.dark-mode .close {
  color: #a0a0a0;
}

body.dark-mode .close:hover {
  color: #fff;
}

/* 다크모드 스크롤바 */
body.dark-mode ::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

body.dark-mode ::-webkit-scrollbar-track {
  background: #1a1a2e;
}

body.dark-mode ::-webkit-scrollbar-thumb {
  background: #3d4a5f;
  border-radius: 4px;
}

body.dark-mode ::-webkit-scrollbar-thumb:hover {
  background: #4d5a6f;
}

/* 다크모드 - 필터 관련 */
body.dark-mode .filter-popup,
body.dark-mode .settings-popup {
  background: #16213e;
  border-color: #2d3a4f;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

body.dark-mode .filter-popup-header,
body.dark-mode .settings-popup-header {
  background: #1a1a2e;
  border-color: #2d3a4f;
}

body.dark-mode .filter-popup-header h3,
body.dark-mode .settings-popup-header h3 {
  color: #e0e0e0;
}

body.dark-mode .filter-popup-header .filter-close-btn,
body.dark-mode .settings-popup-header .close-btn {
  color: #888;
}

body.dark-mode .filter-popup-header .filter-close-btn:hover,
body.dark-mode .settings-popup-header .close-btn:hover {
  color: #fff;
}

body.dark-mode .filter-section,
body.dark-mode .settings-section {
  border-color: #2d3a4f;
}

body.dark-mode .checkbox-label {
  color: #e0e0e0;
}

/* 다크모드 - 테이블 설정 팝업 시인성 개선 */
body.dark-mode .settings-popup .settings-section h4 {
  color: #b0c4de;
}

body.dark-mode .settings-popup .settings-section h4 span {
  color: #66bb6a;
}

body.dark-mode .wheel-btn {
  background: #2d3a4f;
  border-color: #3d4a5f;
  color: #e0e0e0;
}

body.dark-mode .wheel-btn:hover {
  background: #3d4a5f;
  border-color: #4d5a6f;
}

body.dark-mode .wheel-btn:active {
  background: #4d5a6f;
}

body.dark-mode .wheel-area {
  background: linear-gradient(to right, #2d3a4f, #1a1a2e, #2d3a4f);
  border-color: #3d4a5f;
}

body.dark-mode .wheel-area:hover {
  border-color: #66bb6a;
}

body.dark-mode .wheel-area.dragging {
  border-color: #66bb6a;
  box-shadow: 0 0 0 2px rgba(102, 187, 106, 0.3);
}

body.dark-mode .wheel-indicator {
  background: #66bb6a;
}

body.dark-mode .column-width-row {
  background: #2d3a4f;
}

body.dark-mode .column-width-row .col-label {
  color: #b0b0b0;
}

body.dark-mode .settings-popup-footer {
  background: #1a1a2e;
  border-color: #2d3a4f;
}

body.dark-mode .column-checkbox-grid {
  background: transparent;
}

body.dark-mode .column-checkbox-item {
  background: #2d3a4f;
  border-color: #3d4a5f;
  color: #e0e0e0;
}

body.dark-mode .column-checkbox-item:hover {
  background: #3d4a5f;
  border-color: #4d5a6f;
}

body.dark-mode .column-checkbox-item.checked {
  background: #1e4a7f;
  border-color: #2563eb;
  color: #fff;
}

body.dark-mode .preset-popup {
  background: #16213e;
  border-color: #2d3a4f;
}

body.dark-mode .preset-popup-header {
  background: #1a1a2e;
  border-color: #2d3a4f;
}

body.dark-mode .preset-popup-header h4 {
  color: #e0e0e0;
}

body.dark-mode .preset-list-item {
  background: #2d3a4f;
  border-color: #3d4a5f;
  color: #e0e0e0;
}

body.dark-mode .preset-list-item:hover {
  background: #3d4a5f;
}

body.dark-mode .preset-list-item.active {
  background: #1e4a7f;
  border-color: #2563eb;
}

/* 다크모드 - 테이블 호버 및 미열람 강조 */
body.dark-mode table tr:hover td {
  background: #2d4a6f !important;
}

body.dark-mode table tr.selected td {
  background: #1e4a7f !important;
}

body.dark-mode table tr.unread td {
  background: #3d2a5f !important;
}

body.dark-mode table tr.unread:hover td {
  background: #4d3a6f !important;
}

/* 다크모드 - 모달 헤더 텍스트 */
body.dark-mode .modal-header h2,
body.dark-mode .modal-header h3 {
  color: #fff !important;
}

body.dark-mode #depositModal .modal-header,
body.dark-mode #businessLoanFormulaModal .modal-header,
body.dark-mode #priceSourceListModal .modal-header {
  background: #1a1a2e;
  color: #fff;
}

body.dark-mode #depositModal .modal-header h2,
body.dark-mode #businessLoanFormulaModal .modal-header h2,
body.dark-mode #priceSourceListModal .modal-header h2 {
  color: #fff !important;
}

/* ====== 다크모드 - 소액임차 검색창 및 자동완성 ====== */
body.dark-mode .deposit-search-section {
  background: #1d2125 !important;
  border-color: #3d4449 !important;
}

body.dark-mode .deposit-search-section label {
  color: #e7e9ea !important;
}

body.dark-mode #depositSearchInput {
  background: #16181c !important;
  color: #e7e9ea !important;
  border-color: #3d4449 !important;
}

body.dark-mode #depositSearchInput::placeholder {
  color: #6e767d !important;
}

body.dark-mode #depositSearchInput:focus {
  border-color: #1d9bf0 !important;
  box-shadow: 0 0 0 2px rgba(29, 155, 240, 0.2) !important;
}

body.dark-mode .search-clear-btn {
  color: #8b98a5 !important;
}

body.dark-mode .search-clear-btn:hover {
  background: #2f3336 !important;
  color: #e7e9ea !important;
}

body.dark-mode .deposit-search-amount {
  background: rgba(29, 155, 240, 0.2) !important;
  color: #1d9bf0 !important;
}

body.dark-mode .deposit-autocomplete {
  background: #1d2125 !important;
  border-color: #3d4449 !important;
}

body.dark-mode .deposit-autocomplete-item {
  color: #e7e9ea !important;
  border-bottom-color: #2f3336 !important;
}

body.dark-mode .deposit-autocomplete-item:hover,
body.dark-mode .deposit-autocomplete-item.highlighted {
  background: linear-gradient(135deg, #1a3a5c 0%, #1d2125 100%) !important;
  border-left-color: #1d9bf0 !important;
  color: #1d9bf0 !important;
}

body.dark-mode .autocomplete-city {
  color: #e7e9ea !important;
}

body.dark-mode .autocomplete-amount {
  color: #1d9bf0 !important;
}

body.dark-mode .deposit-table tbody td.search-highlight {
  background: #3d3d00 !important;
  color: #ffc107 !important;
}

body.dark-mode .search-text-highlight {
  background: #ffc107 !important;
  color: #000 !important;
}

/* 다크모드 - 고객 상세 모달 전체 스타일 강화 */
body.dark-mode #modal .modal-content {
  background: #0f1419 !important;
  color: #e7e9ea !important;
  border-color: #2f3336 !important;
}

body.dark-mode #modal .modal-header {
  background: #16181c !important;
  border-bottom: 1px solid #2f3336 !important;
}

body.dark-mode #modal .modal-header h2 {
  color: #e7e9ea !important;
}

body.dark-mode #modal .modal-body {
  background: #0f1419 !important;
}

body.dark-mode #modal .staff-select-wrapper select {
  background: #1d2125 !important;
  color: #e7e9ea !important;
  border-color: #3d4449 !important;
}

body.dark-mode #modal .form-section,
body.dark-mode #modal .collateral-section,
body.dark-mode #modal .debt-section {
  background: #16181c !important;
  border: 1px solid #2f3336 !important;
  border-radius: 12px;
}

body.dark-mode #modal .section-title {
  color: #e7e9ea !important;
  border-bottom: 1px solid #2f3336 !important;
  padding-bottom: 10px;
  margin-bottom: 15px;
  font-weight: 600;
}

body.dark-mode #modal .form-group label {
  color: #8b98a5 !important;
  font-weight: 500;
}

body.dark-mode #modal .form-group input,
body.dark-mode #modal .form-group select,
body.dark-mode #modal .form-group textarea {
  background: #1d2125 !important;
  color: #e7e9ea !important;
  border: 1px solid #3d4449 !important;
  border-radius: 6px;
}

body.dark-mode #modal .form-group input:focus,
body.dark-mode #modal .form-group select:focus,
body.dark-mode #modal .form-group textarea:focus {
  border-color: #1d9bf0 !important;
  box-shadow: 0 0 0 3px rgba(29, 155, 240, 0.2) !important;
  outline: none !important;
}

body.dark-mode #modal .form-group input::placeholder,
body.dark-mode #modal .form-group textarea::placeholder {
  color: #6e767d !important;
}

body.dark-mode #modal .form-group input:disabled,
body.dark-mode #modal .form-group select:disabled,
body.dark-mode #modal .form-group textarea:disabled {
  background: #0f1419 !important;
  color: #6e767d !important;
  border-color: #2f3336 !important;
}

/* 다크모드 - 상태 배지 */
body.dark-mode .status-badge {
  font-weight: 600;
}

/* 다크모드 - 셀 내 텍스트 가시성 */
body.dark-mode table td {
  color: #e8e8e8 !important;
}

body.dark-mode table td a {
  color: #60a5fa !important;
}

body.dark-mode table td .customer-name {
  color: #fff !important;
}

/* 다크모드 - 신규 고객 (미조회) 강조 */
body.dark-mode tr.new-customer td,
body.dark-mode tr.new-customer {
  background-color: #1e3a5f !important;
  animation: darkNewCustomerPulse 2s ease-in-out;
}

body.dark-mode tr.new-customer:hover td,
body.dark-mode tr.new-customer:hover {
  background-color: #2a4a6f !important;
}

@keyframes darkNewCustomerPulse {
  0%, 100% { background-color: #1e3a5f; }
  50% { background-color: #2a4a6f; }
}

/* 다크모드 - 필터 팝업 시인성 개선 */
body.dark-mode .filter-section h4 {
  color: #b0c4de;
}

body.dark-mode .filter-chip {
  background: #2d3a4f;
  border-color: #3d4a5f;
  color: #e0e0e0;
}

body.dark-mode .filter-chip:hover {
  background: #3d4a5f;
  border-color: #4d5a6f;
}

body.dark-mode .filter-chip:has(input:checked) {
  background: #3949ab;
  border-color: #5c6bc0;
  color: #fff;
}

/* 다크모드 - 광고 여부 필터 선택 색상 */
body.dark-mode .filter-chip[data-ad="normal"]:has(input:checked) {
  background: #1565C0;
  border-color: #2196F3;
  color: #fff;
}

body.dark-mode .filter-chip[data-ad="ad"]:has(input:checked) {
  background: #e65100;
  border-color: #FF9800;
  color: #fff;
}

/* 다크모드 - 시세관리 필터 선택 색상 */
body.dark-mode .filter-chip[data-price-mgmt="managed"]:has(input:checked) {
  background: #e65100;
  border-color: #FF9800;
  color: #fff;
}

body.dark-mode .filter-chip[data-price-mgmt="notManaged"]:has(input:checked) {
  background: #1565C0;
  border-color: #2196F3;
  color: #fff;
}

body.dark-mode .filter-chip .chip-count {
  background: rgba(255,255,255,0.15);
}

body.dark-mode .filter-range {
  color: #b0b0b0;
}

body.dark-mode .filter-range input[type="number"] {
  background: #1a1a2e;
  border-color: #3d4a5f;
  color: #e0e0e0;
}

body.dark-mode .filter-range input[type="number"]:focus {
  border-color: #5c6bc0;
  background: #16213e;
}

/* 다크모드 - LTV/DTI/시세등락율 토글 범위 필터 */
body.dark-mode .filter-toggle-range .range-toggle {
  background: #1a1a2e;
  border-color: #3d4a5f;
  color: #b0b0b0;
}

body.dark-mode .filter-toggle-range .range-toggle:hover {
  background: #2d3a4f;
  border-color: #5c6bc0;
}

body.dark-mode .filter-toggle-range .range-toggle.active {
  background: #3949ab;
  color: white;
  border-color: #5c6bc0;
}

body.dark-mode .filter-toggle-range .range-inputs {
  color: #b0b0b0;
}

body.dark-mode .filter-toggle-range .range-inputs input[type="number"] {
  background: #1a1a2e;
  border-color: #3d4a5f;
  color: #e0e0e0;
}

body.dark-mode .filter-toggle-range .range-inputs input[type="number"]:focus {
  border-color: #5c6bc0;
  background: #16213e;
}

/* 다크모드 - 소액임차LTV 필터 전용 스타일 */
body.dark-mode #ltvRangeInputs .filter-select,
body.dark-mode #ctLtvRangeInputs .filter-select {
  background: #1a1a2e;
  border-color: #3d4a5f;
  color: #e0e0e0;
}

body.dark-mode #ltvRangeInputs .filter-select:focus,
body.dark-mode #ctLtvRangeInputs .filter-select:focus {
  border-color: #5c6bc0;
  background: #16213e;
}

body.dark-mode #ltvRangeInputs .range-separator,
body.dark-mode #ltvRangeInputs .range-unit,
body.dark-mode #ctLtvRangeInputs .range-separator,
body.dark-mode #ctLtvRangeInputs .range-unit {
  color: #b0b0b0;
}

body.dark-mode .filter-date-range {
  color: #b0b0b0;
}

body.dark-mode .filter-date-range input[type="date"] {
  background: #1a1a2e;
  border-color: #3d4a5f;
  color: #e0e0e0;
}

body.dark-mode .filter-date-range input[type="date"]:focus {
  border-color: #5c6bc0;
  background: #16213e;
}

body.dark-mode .filter-popup-footer {
  background: #1a1a2e;
  border-color: #2d3a4f;
}

body.dark-mode .filter-close-btn {
  color: #888;
}

body.dark-mode .filter-close-btn:hover {
  color: #fff;
}

/* ====== 다크모드 - 모바일 필터/테이블설정 팝업 강화 ====== */
/* 필터 팝업 - 푸터 버튼 */
body.dark-mode .filter-popup-footer {
  background: #1a1a2e !important;
  border-color: #2d3a4f !important;
}

body.dark-mode .filter-popup-footer .btn {
  background: #2d3a4f;
  color: #e0e0e0;
  border: 1px solid #3d4a5f;
}

body.dark-mode .filter-popup-footer .btn:hover {
  background: #3d4a5f;
  border-color: #4d5a6f;
}

body.dark-mode .filter-popup-footer .btn-primary,
body.dark-mode .filter-popup-footer .btn[onclick*="applyFilter"] {
  background: #3949ab !important;
  border-color: #5c6bc0 !important;
  color: #fff !important;
}

body.dark-mode .filter-popup-footer .btn-primary:hover,
body.dark-mode .filter-popup-footer .btn[onclick*="applyFilter"]:hover {
  background: #5c6bc0 !important;
}

/* 테이블 설정 팝업 - 푸터 버튼 */
body.dark-mode .settings-popup-footer .btn {
  background: #2d3a4f;
  color: #e0e0e0;
  border: 1px solid #3d4a5f;
}

body.dark-mode .settings-popup-footer .btn:hover {
  background: #3d4a5f;
  border-color: #4d5a6f;
}

body.dark-mode .settings-popup-footer .btn-primary,
body.dark-mode .settings-popup-footer .btn[onclick*="apply"] {
  background: #3949ab !important;
  border-color: #5c6bc0 !important;
  color: #fff !important;
}

body.dark-mode .settings-popup-footer .btn[onclick*="optimize"] {
  background: #1e4a7f !important;
  border-color: #2563eb !important;
  color: #fff !important;
}

/* 테이블 설정 - 슬라이더 영역 */
body.dark-mode .settings-popup input[type="range"] {
  background: #2d3a4f;
}

body.dark-mode .settings-popup input[type="range"]::-webkit-slider-thumb {
  background: #66bb6a;
}

body.dark-mode .settings-popup input[type="range"]::-webkit-slider-runnable-track {
  background: #3d4a5f;
}

/* 테이블 설정 - 값 표시 */
body.dark-mode .settings-popup .value-display,
body.dark-mode .settings-popup .range-value {
  color: #66bb6a;
  background: #1a1a2e;
  border-color: #3d4a5f;
}

/* 테이블 설정 - input 필드 */
body.dark-mode .settings-popup input[type="text"],
body.dark-mode .settings-popup input[type="number"] {
  background: #1a1a2e;
  color: #e0e0e0;
  border-color: #3d4a5f;
}

body.dark-mode .settings-popup input[type="text"]:focus,
body.dark-mode .settings-popup input[type="number"]:focus {
  border-color: #5c6bc0;
}

/* 필터/설정 팝업 - 가이드 툴팁 */
body.dark-mode .filter-guide-tooltip,
body.dark-mode .settings-guide-tooltip {
  background: #2d3a4f !important;
  color: #e0e0e0 !important;
  border: 1px solid #3d4a5f !important;
}

/* 필터 팝업 - 직군 선택 */
body.dark-mode .filter-section select {
  background: #1a1a2e;
  color: #e0e0e0;
  border-color: #3d4a5f;
}

body.dark-mode .filter-section select:focus {
  border-color: #5c6bc0;
}

/* 필터 팝업 - 기간 선택 버튼 */
body.dark-mode .date-preset-btn {
  background: #2d3a4f;
  color: #e0e0e0;
  border-color: #3d4a5f;
}

body.dark-mode .date-preset-btn:hover {
  background: #3d4a5f;
  border-color: #4d5a6f;
}

body.dark-mode .date-preset-btn.active {
  background: #3949ab;
  border-color: #5c6bc0;
  color: #fff;
}

/* 필터 팝업 - 기간 선택 (직접 입력) */
body.dark-mode .btn-date-picker {
  background: #2d3a4f;
  color: #e0e0e0;
  border-color: #3d4a5f;
}

body.dark-mode .btn-date-picker:hover {
  background: #3d4a5f;
}

body.dark-mode .tooltip-toggle-btn {
  background: #2d3a4f;
  color: #b0b0b0;
}

body.dark-mode .tooltip-toggle-btn:hover {
  background: #3d4a5f;
}

body.dark-mode .tooltip-toggle-btn.active {
  background: #665d35;
  color: #ffc107;
}

/* 다크모드 - 테마 텍스트 버튼 */
body.dark-mode .btn-theme-text {
  background: transparent;
  color: #b0b0b0;
  border-color: #3d4a5f;
}

body.dark-mode .btn-theme-text:hover {
  background: #2d3a4f;
  border-color: #5d6a7f;
  color: #fff;
}

/* 모바일 다크모드 테마 버튼 */
@media (max-width: 480px) {
  .btn-theme-text {
    padding: 3px 8px;
    font-size: 0.65rem;
  }
}

/* ====== 다크모드 - 담보물 정보 섹션 시인성 개선 ====== */
body.dark-mode #modal .collateral-item {
  background: #16181c !important;
  border: 1px solid #2f3336 !important;
  border-radius: 10px;
  overflow: hidden;
}

body.dark-mode #modal .collateral-header {
  background: #1d2125 !important;
  border-bottom: 1px solid #2f3336 !important;
}

body.dark-mode #modal .collateral-header:hover {
  background: #22272b !important;
}

body.dark-mode #modal .collateral-toggle {
  color: #8b98a5 !important;
}

body.dark-mode #modal .collateral-type-badge {
  background: #1d9bf0 !important;
  color: #fff !important;
  font-weight: 600;
}

body.dark-mode #modal .collateral-address-preview {
  color: #e7e9ea !important;
}

body.dark-mode #modal .collateral-price-preview.past-price {
  color: #8b98a5 !important;
}

body.dark-mode #modal .collateral-price-preview.current-price {
  color: #f7b928 !important;
  font-weight: 600;
}

body.dark-mode #modal .no-debt-message {
  color: #8b98a5 !important;
}

body.dark-mode #modal .collateral-content {
  background: #16181c !important;
  padding: 15px;
}

body.dark-mode #modal .collateral-content.readonly-mode {
  background: #0f1419 !important;
}

/* 다크모드 - 담보물 접힌 상태 */
body.dark-mode #modal .collateral-item.collapsed .collateral-content {
  padding: 0 !important;
}

body.dark-mode #modal .collateral-item.collapsed .collateral-content > .notes-section,
body.dark-mode #modal .collateral-item.collapsed .collateral-content > .registry-doc-section {
  padding: 10px 15px !important;
  border-top: 1px solid #2f3336 !important;
}

/* 담보물 내부 주소 섹션 */
body.dark-mode #modal .address-section {
  background: #1d2125 !important;
  border: 1px solid #2f3336 !important;
  border-radius: 8px;
}

body.dark-mode #modal .address-section label {
  color: #8b98a5 !important;
}

/* KB부동산 검색 다크모드 */
body.dark-mode #modal .kb-search-input {
  background: #1d2125 !important;
  color: #e7e9ea !important;
  border-color: #3d4449 !important;
}

body.dark-mode #modal .kb-search-input:focus {
  border-color: #ff6600 !important;
  box-shadow: 0 0 0 3px rgba(255, 102, 0, 0.2) !important;
}

body.dark-mode #modal .kb-search-input::placeholder {
  color: #6e767d !important;
}

body.dark-mode #modal .kb-search-results {
  background: #1d2125 !important;
  border-color: #3d4449 !important;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4) !important;
}

body.dark-mode #modal .kb-search-item {
  border-bottom-color: #2f3336 !important;
}

body.dark-mode #modal .kb-search-item:hover,
body.dark-mode #modal .kb-search-item.selected {
  background: #2a2f35 !important;
}

body.dark-mode #modal .kb-search-item.selected {
  background: #3a3f45 !important;
}

body.dark-mode #modal .kb-search-name {
  color: #e7e9ea !important;
}

body.dark-mode #modal .kb-search-addr {
  color: #8b98a5 !important;
}

body.dark-mode #modal .kb-search-loading,
body.dark-mode #modal .kb-search-empty {
  color: #8b98a5 !important;
}

body.dark-mode #modal .kb-search-error {
  background: #2d1f1f !important;
  color: #e74c3c !important;
}

body.dark-mode #modal .address-detail-row {
  border-top-color: #2f3336 !important;
}

body.dark-mode #modal .address-detail-row label {
  color: #e7e9ea !important;
}

/* 담보물 내부 입력 필드 */
body.dark-mode #modal .collateral-content input,
body.dark-mode #modal .collateral-content select,
body.dark-mode #modal .collateral-content textarea {
  background: #1d2125 !important;
  color: #e7e9ea !important;
  border: 1px solid #3d4449 !important;
  border-radius: 6px;
}

body.dark-mode #modal .collateral-content input:focus,
body.dark-mode #modal .collateral-content select:focus,
body.dark-mode #modal .collateral-content textarea:focus {
  border-color: #1d9bf0 !important;
  box-shadow: 0 0 0 3px rgba(29, 155, 240, 0.2) !important;
}

body.dark-mode #modal .collateral-content input:disabled,
body.dark-mode #modal .collateral-content select:disabled,
body.dark-mode #modal .collateral-content textarea:disabled {
  background: #0f1419 !important;
  color: #6e767d !important;
  border-color: #2f3336 !important;
}

/* 담보물 삭제 버튼 */
body.dark-mode #modal .collateral-header .btn-remove-collateral,
body.dark-mode #modal .collateral-header .btn-small {
  background: #f4212e !important;
  color: #fff !important;
  border: none !important;
}

body.dark-mode #modal .collateral-header .btn-remove-collateral:hover,
body.dark-mode #modal .collateral-header .btn-small:hover {
  background: #dc1e28 !important;
}

/* 담보물 추가 버튼 */
body.dark-mode #modal .btn-add-collateral {
  background: #00ba7c !important;
  color: #fff !important;
  border: none !important;
}

body.dark-mode #modal .btn-add-collateral:hover {
  background: #00a06a !important;
}

/* 시세 조회 버튼 */
body.dark-mode #modal .btn-price-query,
body.dark-mode #modal .btn-query-price {
  background: #7856ff !important;
  color: #fff !important;
  border: none !important;
}

body.dark-mode #modal .btn-price-query:hover,
body.dark-mode #modal .btn-query-price:hover {
  background: #6644ee !important;
}

/* 단지 선택 드롭다운 */
body.dark-mode #modal .complex-section select {
  background: #1d2125 !important;
  color: #e7e9ea !important;
  border: 1px solid #3d4449 !important;
}

/* 지역 선택 드롭다운 */
body.dark-mode #modal .type-region-section select {
  background: #1d2125 !important;
  color: #e7e9ea !important;
  border: 1px solid #3d4449 !important;
}

/* ====== 다크모드 - 모달 푸터 시인성 개선 ====== */
body.dark-mode #modal .modal-footer {
  background: #16181c !important;
  border-top: none !important;
  box-shadow: none !important;
}

body.dark-mode #modal .modal-body {
  border-bottom: none !important;
}

body.dark-mode #modal .modal-footer .btn {
  font-weight: 600;
  padding: 10px 20px;
  border-radius: 20px;
  transition: all 0.2s ease;
}

/* 저장 버튼 */
body.dark-mode #modal .modal-footer .btn-primary,
body.dark-mode #modal .modal-footer .btn-save {
  background: #1d9bf0 !important;
  color: #fff !important;
  border: none !important;
}

body.dark-mode #modal .modal-footer .btn-primary:hover,
body.dark-mode #modal .modal-footer .btn-save:hover {
  background: #1a8cd8 !important;
}

/* 취소/닫기 버튼 */
body.dark-mode #modal .modal-footer .btn-cancel,
body.dark-mode #modal .modal-footer .btn-secondary {
  background: transparent !important;
  color: #e7e9ea !important;
  border: 1px solid #536471 !important;
}

body.dark-mode #modal .modal-footer .btn-cancel:hover,
body.dark-mode #modal .modal-footer .btn-secondary:hover {
  background: rgba(239, 243, 244, 0.1) !important;
}

/* 삭제 버튼 */
body.dark-mode #modal .modal-footer .btn-danger,
body.dark-mode #modal .modal-footer .btn-delete {
  background: #f4212e !important;
  color: #fff !important;
  border: none !important;
}

body.dark-mode #modal .modal-footer .btn-danger:hover,
body.dark-mode #modal .modal-footer .btn-delete:hover {
  background: #dc1e28 !important;
}

/* 폼 액션 버튼 그룹 */
body.dark-mode #modal .form-actions {
  background: transparent !important;
  border-top: none !important;
  margin-top: 0 !important;
  padding-top: 0 !important;
}

body.dark-mode #modal .form-actions .btn {
  min-width: 80px;
}

/* ====== 다크모드 - 채무정보 섹션 ====== */
body.dark-mode #modal .debt-item {
  background: #16181c !important;
  border: 1px solid #2f3336 !important;
  border-radius: 10px;
}

body.dark-mode #modal .debt-header {
  background: #1d2125 !important;
}

body.dark-mode #modal .debt-header:hover {
  background: #22272b !important;
}

body.dark-mode #modal .debt-content {
  background: #16181c !important;
  border-top: 1px solid #2f3336 !important;
}

body.dark-mode #modal .debt-content input,
body.dark-mode #modal .debt-content select {
  background: #1d2125 !important;
  color: #e7e9ea !important;
  border: 1px solid #3d4449 !important;
}

body.dark-mode #modal .debt-content input:focus,
body.dark-mode #modal .debt-content select:focus {
  border-color: #1d9bf0 !important;
  box-shadow: 0 0 0 3px rgba(29, 155, 240, 0.2) !important;
}

/* ====== 다크모드 - 시세 정보 섹션 (price-group) ====== */
body.dark-mode #modal .price-row {
  background: transparent !important;
}

body.dark-mode #modal .price-group {
  background: #1d2125 !important;
  border: 1px solid #2f3336 !important;
  border-radius: 8px;
}

body.dark-mode #modal .price-group h5,
body.dark-mode #modal .price-header-with-ai h5 {
  color: #8b98a5 !important;
}

/* 다크모드 AI시세 체크박스 */
body.dark-mode #modal .ai-price-checkbox-label {
  color: #f5a623 !important;
}

body.dark-mode #modal .price-header-with-btn h5 {
  color: #8b98a5 !important;
}

body.dark-mode #modal .price-inputs input {
  background: #16181c !important;
  color: #e7e9ea !important;
  border: 1px solid #3d4449 !important;
}

body.dark-mode #modal .price-inputs input::placeholder {
  color: #6e767d !important;
}

body.dark-mode #modal .price-inputs input:focus {
  border-color: #1d9bf0 !important;
  box-shadow: 0 0 0 2px rgba(29, 155, 240, 0.2) !important;
}

body.dark-mode #modal .btn-apply-past {
  background: #536471 !important;
  color: #e7e9ea !important;
  border: none !important;
}

body.dark-mode #modal .btn-apply-past:hover {
  background: #6e767d !important;
}

body.dark-mode #modal .btn-kb-fetch {
  background: #1d9bf0 !important;
  color: #fff !important;
  border: none !important;
}

body.dark-mode #modal .btn-kb-fetch:hover {
  background: #1a8cd8 !important;
}

body.dark-mode #modal .btn-kb-fetch:disabled {
  background: #3d4449 !important;
  color: #6e767d !important;
}

/* ====== 다크모드 - 첨부파일 섹션 (registry-doc) ====== */
body.dark-mode #modal .registry-doc-section {
  background: #16181c !important;
  border: 1px solid #2f3336 !important;
  border-radius: 8px;
}

body.dark-mode #modal .registry-doc-section label {
  color: #8b98a5 !important;
}

body.dark-mode #modal .registry-doc-upload {
  background: #1d2125 !important;
  border: 2px dashed #3d4449 !important;
  border-radius: 8px;
}

body.dark-mode #modal .registry-doc-upload:hover {
  border-color: #1d9bf0 !important;
  background: #22272b !important;
}

body.dark-mode #modal .registry-doc-placeholder {
  color: #8b98a5 !important;
}

/* 다크모드 - 첨부파일 테이블 */
body.dark-mode #modal .registry-doc-table {
  border-color: #2f3336 !important;
}

body.dark-mode #modal .registry-doc-table th {
  background: #22272b !important;
  color: #8b98a5 !important;
  border-color: #2f3336 !important;
}

body.dark-mode #modal .registry-doc-table td {
  border-color: #2f3336 !important;
}

body.dark-mode #modal .registry-doc-table tbody tr:hover {
  background: #22272b !important;
}

body.dark-mode #modal .registry-doc-table .file-name {
  color: #e7e9ea !important;
}

body.dark-mode #modal .registry-doc-table .file-print-date,
body.dark-mode #modal .registry-doc-table .file-upload-date {
  color: #6e7681 !important;
}

body.dark-mode #modal .btn-file-action {
  background: #22272b !important;
  border-color: #3d4449 !important;
  color: #8b98a5 !important;
}

body.dark-mode #modal .btn-file-action.btn-apply {
  color: #b794f6 !important;
  border-color: #b794f6 !important;
}

body.dark-mode #modal .btn-file-action.btn-apply:hover:not(:disabled) {
  background: #6f42c1 !important;
  color: white !important;
}

body.dark-mode #modal .btn-file-action.btn-dl {
  color: #00ba7c !important;
  border-color: #00ba7c !important;
}

body.dark-mode #modal .btn-file-action.btn-dl:hover:not(:disabled) {
  background: #00ba7c !important;
  color: white !important;
}

body.dark-mode #modal .btn-file-action.btn-view {
  color: #1d9bf0 !important;
  border-color: #1d9bf0 !important;
}

body.dark-mode #modal .btn-file-action.btn-view:hover:not(:disabled) {
  background: #1d9bf0 !important;
  color: white !important;
}

body.dark-mode #modal .btn-file-action.btn-remove {
  color: #f4212e !important;
  border-color: #f4212e !important;
}

body.dark-mode #modal .btn-file-action.btn-remove:hover:not(:disabled) {
  background: #f4212e !important;
  color: white !important;
}

/* 다크모드 - 적용된 등기 표시 (테이블) */
body.dark-mode #modal .registry-doc-table tbody tr.active-registry {
  background: linear-gradient(135deg, #1b3a1f 0%, #2e5a32 100%) !important;
}

body.dark-mode #modal .registry-doc-table tbody tr.active-registry td {
  border-color: #4caf50 !important;
}

body.dark-mode #modal .registry-doc-table .active-registry-label {
  background: #1b3a1f !important;
  color: #81c784 !important;
  border: 1px solid #4caf50 !important;
}

body.dark-mode #modal .registry-doc-table tbody tr.active-registry .file-name {
  color: #81c784 !important;
}

/* ====== 다크모드 - 특이사항 섹션 (notes-section) ====== */
body.dark-mode #modal .notes-section {
  background: #16181c !important;
  border: 1px solid #2f3336 !important;
  border-radius: 8px;
}

body.dark-mode #modal .notes-section label {
  color: #8b98a5 !important;
}

body.dark-mode #modal .simple-notes-container {
  background: #1d2125 !important;
  border: 1px solid #2f3336 !important;
}

body.dark-mode #modal .simple-notes-input-row {
  background: #16181c !important;
  border-bottom: 1px solid #2f3336 !important;
}

body.dark-mode #modal .simple-notes-input-row input {
  background: #1d2125 !important;
  color: #e7e9ea !important;
  border: 1px solid #3d4449 !important;
}

body.dark-mode #modal .simple-notes-input-row input::placeholder {
  color: #6e767d !important;
}

body.dark-mode #modal .simple-notes-input-row input:focus {
  border-color: #1d9bf0 !important;
}

body.dark-mode #modal .simple-notes-input-row .btn-add-note {
  background: #1d9bf0 !important;
  color: #fff !important;
  border: none !important;
}

body.dark-mode #modal .simple-notes-input-row .btn-add-note:hover {
  background: #1a8cd8 !important;
}

body.dark-mode #modal .simple-notes-list {
  background: #16181c !important;
}

body.dark-mode #modal .simple-note-item {
  background: #1d2125 !important;
  border-bottom: 1px solid #2f3336 !important;
  color: #e7e9ea !important;
}

body.dark-mode #modal .simple-note-item:hover {
  background: #22272b !important;
}

body.dark-mode #modal .note-content {
  color: #e7e9ea !important;
}

body.dark-mode #modal .note-timestamp {
  color: #6e767d !important;
}

body.dark-mode #modal .note-actions button {
  color: #8b98a5 !important;
}

body.dark-mode #modal .note-actions button:hover {
  color: #e7e9ea !important;
  background: rgba(239, 243, 244, 0.1) !important;
}

/* ====== 다크모드 - 상담내용 섹션 ====== */
body.dark-mode #modal .consultation-section {
  background: #16181c !important;
  border: 1px solid #2f3336 !important;
  border-radius: 8px;
}

body.dark-mode #modal .consultation-section label {
  color: #8b98a5 !important;
}

body.dark-mode #modal .consultation-input-row input {
  background: #1d2125 !important;
  color: #e7e9ea !important;
  border: 1px solid #3d4449 !important;
}

body.dark-mode #modal .consultation-input-row input::placeholder {
  color: #6e767d !important;
}

body.dark-mode #modal .consultation-input-row .btn-add-consultation {
  background: #1d9bf0 !important;
  color: #fff !important;
  border: none !important;
}

body.dark-mode #modal .consultation-input-row .btn-add-consultation:hover {
  background: #1a8cd8 !important;
}

body.dark-mode #modal .consultation-list {
  background: #16181c !important;
}

body.dark-mode #modal .consultation-item {
  background: #1d2125 !important;
  border-bottom: 1px solid #2f3336 !important;
}

body.dark-mode #modal .consultation-item:hover {
  background: #22272b !important;
}

body.dark-mode #modal .consultation-content {
  color: #e7e9ea !important;
}

body.dark-mode #modal .consultation-timestamp {
  color: #6e767d !important;
}

/* ====== 다크모드 - 탭 섹션 ====== */
body.dark-mode #modal .collateral-tabs {
  background: #0f1419 !important;
  border-bottom: 1px solid #2f3336 !important;
}

body.dark-mode #modal .collateral-tab {
  background: transparent !important;
  color: #8b98a5 !important;
  border: none !important;
}

body.dark-mode #modal .collateral-tab:hover {
  background: rgba(29, 155, 240, 0.1) !important;
  color: #1d9bf0 !important;
}

body.dark-mode #modal .collateral-tab.active {
  background: transparent !important;
  color: #1d9bf0 !important;
  border-bottom: 2px solid #1d9bf0 !important;
}

body.dark-mode #modal .tab-content {
  background: #16181c !important;
}

/* ====== 다크모드 - 유형 및 지역 선택 섹션 ====== */
body.dark-mode #modal .type-region-section {
  background: #1d2125 !important;
  border: 1px solid #2f3336 !important;
  border-radius: 8px;
}

body.dark-mode #modal .type-region-section label {
  color: #8b98a5 !important;
}

body.dark-mode #modal .type-region-section select {
  background: #16181c !important;
  color: #e7e9ea !important;
  border: 1px solid #3d4449 !important;
}

body.dark-mode #modal .type-region-section select:focus {
  border-color: #1d9bf0 !important;
}

/* ====== 다크모드 - 단지 선택 섹션 ====== */
body.dark-mode #modal .complex-section {
  background: #1d2125 !important;
  border: 1px solid #2f3336 !important;
  border-radius: 8px;
}

body.dark-mode #modal .complex-section label {
  color: #8b98a5 !important;
}

body.dark-mode #modal .complex-section select {
  background: #16181c !important;
  color: #e7e9ea !important;
  border: 1px solid #3d4449 !important;
}

/* 다크모드 - KB부동산 시세 미제공 메시지 */
body.dark-mode .kb-no-data-message {
  background-color: #3d3300 !important;
  border-color: #6b5900 !important;
  color: #ffc107 !important;
}

/* ====== 다크모드 - 지번주소 섹션 ====== */
body.dark-mode #modal .jibun-section {
  background: #1d2125 !important;
  border: 1px solid #2f3336 !important;
  border-radius: 8px;
}

body.dark-mode #modal .jibun-section label {
  color: #8b98a5 !important;
}

body.dark-mode #modal .jibun-section input {
  background: #16181c !important;
  color: #e7e9ea !important;
  border: 1px solid #3d4449 !important;
}

body.dark-mode #modal .btn-jibun-fetch {
  background: #1d9bf0 !important;
  color: #fff !important;
  border: none !important;
}

body.dark-mode #modal .btn-jibun-fetch:hover {
  background: #1a8cd8 !important;
}

/* ====== 다크모드 - 소유자 유형 라디오 버튼 ====== */
body.dark-mode #modal .owner-type-section {
  background: #1d2125 !important;
  border: 1px solid #2f3336 !important;
  border-radius: 8px;
}

body.dark-mode #modal .owner-type-section label {
  color: #e7e9ea !important;
}

body.dark-mode #modal .owner-type-section input[type="radio"] + label {
  color: #8b98a5 !important;
}

body.dark-mode #modal .owner-type-section input[type="radio"]:checked + label {
  color: #1d9bf0 !important;
}

/* ====== 다크모드 - 채권 정보 섹션 ====== */
body.dark-mode #modal .debt-section {
  background: #16181c !important;
  border: 1px solid #2f3336 !important;
  border-radius: 8px;
}

body.dark-mode #modal .debt-section label {
  color: #8b98a5 !important;
}

body.dark-mode #modal .btn-add-debt {
  background: #00ba7c !important;
  color: #fff !important;
  border: none !important;
}

body.dark-mode #modal .btn-add-debt:hover {
  background: #00a06a !important;
}

/* ====== 다크모드 - 파일 선택 버튼 ====== */
body.dark-mode #modal .btn-select-file {
  background: #2f3336 !important;
  color: #e7e9ea !important;
  border: 1px solid #3d4449 !important;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
}

body.dark-mode #modal .btn-select-file:hover {
  background: #3d4449 !important;
  border-color: #536471 !important;
}

body.dark-mode #modal .btn-select-file:disabled {
  background: #1d2125 !important;
  color: #6e767d !important;
  cursor: not-allowed;
}

/* ====== 다크모드 - 파일 업로드 영역 텍스트 ====== */
body.dark-mode #modal .registry-doc-upload p,
body.dark-mode #modal .registry-doc-upload span {
  color: #8b98a5 !important;
}

/* ====== 다크모드 - 소유자 유형 라디오 그룹 전체 ====== */
body.dark-mode #modal .owner-type-group,
body.dark-mode #modal .radio-group {
  background: transparent !important;
}

body.dark-mode #modal .owner-type-group label,
body.dark-mode #modal .radio-group label {
  color: #e7e9ea !important;
  background: #1d2125 !important;
  border: 1px solid #3d4449 !important;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
}

body.dark-mode #modal .owner-type-group label:hover,
body.dark-mode #modal .radio-group label:hover {
  background: #22272b !important;
  border-color: #536471 !important;
}

body.dark-mode #modal .owner-type-group input[type="radio"]:checked + label,
body.dark-mode #modal .radio-group input[type="radio"]:checked + label {
  background: #1d9bf0 !important;
  border-color: #1d9bf0 !important;
  color: #fff !important;
}

/* ====== 다크모드 - 메인으로 지정 버튼 ====== */
body.dark-mode #modal .btn-set-main,
body.dark-mode #modal .main-indicator {
  color: #00ba7c !important;
}

/* ====== 다크모드 - 채권 추가 버튼 ====== */
body.dark-mode #modal .btn-add-debt-item {
  background: #00ba7c !important;
  color: #fff !important;
  border: none !important;
}

body.dark-mode #modal .btn-add-debt-item:hover {
  background: #00a06a !important;
}

/* ====== 다크모드 - 거주유형 라디오 버튼 (본인거주/가족거주/세입자/전세/월세) ====== */
body.dark-mode #modal .residence-section {
  background: transparent !important;
}

body.dark-mode #modal .residence-section .residence-options {
  background: #1d2125 !important;
  border: 1px solid #3d4449 !important;
}

body.dark-mode #modal .residence-section .residence-options .radio-label {
  background: #1d2125 !important;
  color: #8b98a5 !important;
  border-right: 1px solid #3d4449 !important;
}

body.dark-mode #modal .residence-section .residence-options .radio-label:hover {
  background: #22272b !important;
}

body.dark-mode #modal .residence-section .residence-options .radio-label:has(input:checked) {
  background: #1d9bf0 !important;
  color: #fff !important;
}

body.dark-mode #modal .residence-section .residence-options .radio-label span {
  color: inherit !important;
}

/* ====== 다크모드 - 메인으로 지정 셀렉터 ====== */
body.dark-mode #modal .main-tab-selector,
body.dark-mode .main-tab-selector,
body.dark-mode #modal .collateral-tab-content .main-tab-selector,
body.dark-mode .collateral-tab-content .main-tab-selector {
  background: #1d2125 !important;
  background-image: none !important;
  border: 1px solid #3d4449 !important;
  border-radius: 8px !important;
}

body.dark-mode #modal .main-tab-label,
body.dark-mode .main-tab-label,
body.dark-mode #modal .collateral-tab-content .main-tab-label,
body.dark-mode .collateral-tab-content .main-tab-label {
  color: #8b98a5 !important;
  background: transparent !important;
}

body.dark-mode #modal .main-tab-label span,
body.dark-mode .main-tab-label span,
body.dark-mode #modal .collateral-tab-content .main-tab-label span,
body.dark-mode .collateral-tab-content .main-tab-label span {
  color: #8b98a5 !important;
}

body.dark-mode #modal .main-tab-label:hover,
body.dark-mode .main-tab-label:hover {
  background: #22272b !important;
}

body.dark-mode #modal .main-tab-label input[type="radio"]:checked + span,
body.dark-mode .main-tab-label input[type="radio"]:checked + span {
  color: #00ba7c !important;
}

/* ====== 다크모드 - 시세관리 체크박스 (main-tab-selector 내부) ====== */
body.dark-mode #modal .main-tab-selector .price-management-label,
body.dark-mode .main-tab-selector .price-management-label {
  background: #1d2125 !important;
  color: #8b98a5 !important;
  border: 1px solid #ff9800 !important;
}

body.dark-mode #modal .main-tab-selector .price-management-label:hover,
body.dark-mode .main-tab-selector .price-management-label:hover {
  background: #22272b !important;
}

body.dark-mode #modal .main-tab-selector .price-management-label:has(input:checked),
body.dark-mode .main-tab-selector .price-management-label:has(input:checked) {
  background: #ff9800 !important;
  color: #fff !important;
}

/* ====== 다크모드 - 특이사항 입력창 ====== */
body.dark-mode #modal .notes-input-row input,
body.dark-mode #modal .simple-notes-input input,
body.dark-mode #modal input.note-input {
  background: #1d2125 !important;
  color: #e7e9ea !important;
  border: 1px solid #3d4449 !important;
}

body.dark-mode #modal .notes-input-row input::placeholder,
body.dark-mode #modal .simple-notes-input input::placeholder,
body.dark-mode #modal input.note-input::placeholder {
  color: #6e767d !important;
}

body.dark-mode #modal .notes-input-row input:focus,
body.dark-mode #modal .simple-notes-input input:focus,
body.dark-mode #modal input.note-input:focus {
  border-color: #1d9bf0 !important;
  box-shadow: 0 0 0 2px rgba(29, 155, 240, 0.2) !important;
}

/* ====== 다크모드 - 상담내용 입력창 ====== */
body.dark-mode #modal .consultation-input input,
body.dark-mode #modal input.consultation-input {
  background: #1d2125 !important;
  color: #e7e9ea !important;
  border: 1px solid #3d4449 !important;
}

body.dark-mode #modal .consultation-input input::placeholder,
body.dark-mode #modal input.consultation-input::placeholder {
  color: #6e767d !important;
}

/* ====== 다크모드 - 유형 및 지역 선택 select ====== */
body.dark-mode #modal .address-row select,
body.dark-mode #modal .type-region-section select,
body.dark-mode #modal .select-wrapper select {
  background: #1d2125 !important;
  color: #e7e9ea !important;
  border: 1px solid #3d4449 !important;
}

body.dark-mode #modal .address-row select:focus,
body.dark-mode #modal .type-region-section select:focus,
body.dark-mode #modal .select-wrapper select:focus {
  border-color: #1d9bf0 !important;
}

body.dark-mode #modal .address-row select option,
body.dark-mode #modal .type-region-section select option,
body.dark-mode #modal .select-wrapper select option {
  background: #1d2125 !important;
  color: #e7e9ea !important;
}

/* ====== 다크모드 - 담보물 탭 버튼 ====== */
body.dark-mode #modal .collateral-tabs {
  background: #0f1419 !important;
  border-bottom: 1px solid #2f3336 !important;
}

body.dark-mode #modal .collateral-tab {
  background: transparent !important;
  color: #8b98a5 !important;
  border: none !important;
  border-bottom: 2px solid transparent !important;
}

body.dark-mode #modal .collateral-tab:hover {
  color: #1d9bf0 !important;
  background: rgba(29, 155, 240, 0.1) !important;
}

body.dark-mode #modal .collateral-tab.active {
  color: #1d9bf0 !important;
  border-bottom-color: #1d9bf0 !important;
}

/* ====== 다크모드 - 탭 콘텐츠 영역 ====== */
body.dark-mode #modal .collateral-tab-content {
  background: #16181c !important;
}

/* ====== 다크모드 - 담보물 특이사항 입력창 ====== */
body.dark-mode #modal .simple-notes-input {
  background: #16181c !important;
  border-top: 1px solid #2f3336 !important;
}

body.dark-mode #modal .simple-notes-input input,
body.dark-mode #modal .collateral-note-input,
body.dark-mode #modal input.collateral-note-input,
body.dark-mode #modal #newNoteInput {
  background: #1d2125 !important;
  color: #e7e9ea !important;
  border: 1px solid #3d4449 !important;
}

body.dark-mode #modal .simple-notes-input input::placeholder,
body.dark-mode #modal .collateral-note-input::placeholder,
body.dark-mode #modal #newNoteInput::placeholder {
  color: #6e767d !important;
}

body.dark-mode #modal .simple-notes-input input:focus,
body.dark-mode #modal .collateral-note-input:focus,
body.dark-mode #modal #newNoteInput:focus {
  border-color: #1d9bf0 !important;
  box-shadow: 0 0 0 2px rgba(29, 155, 240, 0.2) !important;
  outline: none !important;
}

/* ====== 다크모드 - 특이사항 추가 버튼 ====== */
body.dark-mode #modal .btn-add-simple-note {
  background: #1d9bf0 !important;
  color: #fff !important;
  border: none !important;
}

body.dark-mode #modal .btn-add-simple-note:hover {
  background: #1a8cd8 !important;
}

/* ====== 다크모드 - 특이사항 목록 ====== */
body.dark-mode #modal .simple-notes-container {
  background: #16181c !important;
  border: 1px solid #2f3336 !important;
}

body.dark-mode #modal .simple-notes-list {
  background: #16181c !important;
}

body.dark-mode #modal .simple-note-item {
  background: #1d2125 !important;
  border-bottom: 1px solid #2f3336 !important;
}

body.dark-mode #modal .simple-note-item:hover {
  background: #22272b !important;
}

body.dark-mode #modal .simple-note-header {
  color: #6e767d !important;
}

body.dark-mode #modal .simple-note-meta {
  color: #6e767d !important;
}

body.dark-mode #modal .simple-note-content {
  color: #e7e9ea !important;
}

body.dark-mode #modal .simple-note-actions button {
  color: #8b98a5 !important;
  background: transparent !important;
}

body.dark-mode #modal .simple-note-actions button:hover {
  color: #e7e9ea !important;
  background: rgba(239, 243, 244, 0.1) !important;
}

/* ====== 다크모드 - 직접입력 컨테이너 ====== */
body.dark-mode #modal .manual-input-container {
  background: #16181c !important;
  border: 1px solid #2f3336 !important;
}

body.dark-mode #modal .manual-input-container label {
  color: #8b98a5 !important;
}

body.dark-mode #modal .manual-input-container input,
body.dark-mode #modal .manual-input-container select,
body.dark-mode #modal .manual-input-container textarea {
  background: #1d2125 !important;
  color: #e7e9ea !important;
  border: 1px solid #3d4449 !important;
}

body.dark-mode #modal .manual-input-container input::placeholder,
body.dark-mode #modal .manual-input-container textarea::placeholder {
  color: #6e767d !important;
}

body.dark-mode #modal .manual-input-container input:focus,
body.dark-mode #modal .manual-input-container select:focus,
body.dark-mode #modal .manual-input-container textarea:focus {
  border-color: #1d9bf0 !important;
}

/* ====== 다크모드 - 모달 바디 하단 border 제거 ====== */
body.dark-mode #modal .modal-body {
  border-bottom: none !important;
}

/* ====== 다크모드 - 상담내용 섹션 (모달 하단) ====== */
body.dark-mode #modal .consultation-section {
  background: transparent !important;
  border: none !important;
}

body.dark-mode #modal .consultation-section > label {
  color: #8b98a5 !important;
}

body.dark-mode #modal .consultation-input-container {
  background: #16181c !important;
  border: 1px solid #2f3336 !important;
  border-radius: 8px;
}

body.dark-mode #modal .consultation-input-container input,
body.dark-mode #modal #consultationInput {
  background: #1d2125 !important;
  color: #e7e9ea !important;
  border: 1px solid #3d4449 !important;
}

body.dark-mode #modal .consultation-input-container input::placeholder,
body.dark-mode #modal #consultationInput::placeholder {
  color: #6e767d !important;
}

body.dark-mode #modal .consultation-input-container input:focus,
body.dark-mode #modal #consultationInput:focus {
  border-color: #1d9bf0 !important;
}

body.dark-mode #modal .consultation-list {
  background: #16181c !important;
  border: 1px solid #2f3336 !important;
  border-radius: 8px;
}

body.dark-mode #modal .consultation-item {
  background: #1d2125 !important;
  border-bottom: 1px solid #2f3336 !important;
}

body.dark-mode #modal .consultation-item:hover {
  background: #22272b !important;
}

body.dark-mode #modal .consultation-meta {
  color: #6e767d !important;
}

body.dark-mode #modal .consultation-content {
  color: #e7e9ea !important;
}

/* ====== 다크모드 - 특이사항 섹션 (담보물 외부) ====== */
body.dark-mode #modal .notes-section {
  background: transparent !important;
  border: none !important;
}

body.dark-mode #modal .notes-section > label {
  color: #8b98a5 !important;
}

body.dark-mode #modal .notes-input-container {
  background: #16181c !important;
  border: 1px solid #2f3336 !important;
  border-radius: 8px;
}

body.dark-mode #modal .notes-input-container input,
body.dark-mode #modal #noteInput,
body.dark-mode #modal #newNoteInput {
  background: #1d2125 !important;
  color: #e7e9ea !important;
  border: 1px solid #3d4449 !important;
}

body.dark-mode #modal .notes-input-container input::placeholder,
body.dark-mode #modal #noteInput::placeholder,
body.dark-mode #modal #newNoteInput::placeholder {
  color: #6e767d !important;
}

body.dark-mode #modal .notes-list {
  background: #16181c !important;
  border: 1px solid #2f3336 !important;
  border-radius: 8px;
}

body.dark-mode #modal .note-item {
  background: #1d2125 !important;
  border-bottom: 1px solid #2f3336 !important;
}

body.dark-mode #modal .note-item:hover {
  background: #22272b !important;
}

body.dark-mode #modal .note-meta {
  color: #6e767d !important;
}

body.dark-mode #modal .note-content {
  color: #e7e9ea !important;
}

/* ===== 하우스머치 다크모드 스타일 ===== */
body.dark-mode #modal .howsmuch-container {
  background: #16181c !important;
  border-color: #2f3336 !important;
}

body.dark-mode #modal .howsmuch-header h4 {
  color: #e7e9ea !important;
}

body.dark-mode #modal .howsmuch-desc {
  color: #8b98a5 !important;
}

/* 하우스머치 검색 입력란 */
body.dark-mode #modal .howsmuch-search-input,
body.dark-mode #modal #howsmuchSearchInput {
  background: #1d2125 !important;
  color: #e7e9ea !important;
  border-color: #3d4449 !important;
}

body.dark-mode #modal .howsmuch-search-input::placeholder,
body.dark-mode #modal #howsmuchSearchInput::placeholder {
  color: #6e767d !important;
}

body.dark-mode #modal .howsmuch-search-input:focus,
body.dark-mode #modal #howsmuchSearchInput:focus {
  border-color: #1d9bf0 !important;
}

body.dark-mode #modal .howsmuch-search-section > label,
body.dark-mode #modal .howsmuch-search-label {
  color: #8b98a5 !important;
}

/* 하우스머치 드롭다운 */
body.dark-mode #modal .howsmuch-search-dropdown {
  background: #1d2125 !important;
  border-color: #1d9bf0 !important;
  box-shadow: 0 4px 12px rgba(0,0,0,0.5) !important;
}

body.dark-mode #modal .howsmuch-dropdown-item {
  border-bottom-color: #2f3336 !important;
}

body.dark-mode #modal .howsmuch-dropdown-item:hover,
body.dark-mode #modal .howsmuch-dropdown-item:active,
body.dark-mode #modal .howsmuch-dropdown-item.selected {
  background: #22272b !important;
}

/* 키보드 선택 시 강조 표시 (다크모드) */
body.dark-mode #modal .howsmuch-dropdown-item.selected {
  background: #1a3040 !important;
  border-left: 3px solid #1d9bf0 !important;
}

body.dark-mode #modal .dropdown-address-main {
  color: #e7e9ea !important;
}

body.dark-mode #modal .dropdown-address-sub {
  color: #6e767d !important;
}

/* 하우스머치 select 그룹 (부동산유형, 동호수 등) */
body.dark-mode #modal .howsmuch-selects {
  background: #1d2125 !important;
  border-color: #2f3336 !important;
}

body.dark-mode #modal .howsmuch-select-group label {
  color: #8b98a5 !important;
}

body.dark-mode #modal .howsmuch-dong-select,
body.dark-mode #modal .howsmuch-ho-select,
body.dark-mode #modal #howsmuchPropertyType {
  background: #1d2125 !important;
  color: #e7e9ea !important;
  border-color: #3d4449 !important;
}

body.dark-mode #modal .howsmuch-dong-select:focus,
body.dark-mode #modal .howsmuch-ho-select:focus,
body.dark-mode #modal #howsmuchPropertyType:focus {
  border-color: #1d9bf0 !important;
}

/* 하우스머치 결과 아이템 */
body.dark-mode #modal .howsmuch-result-item {
  background: #1d2125 !important;
  border-color: #2f3336 !important;
}

body.dark-mode #modal .howsmuch-result-item:hover {
  background: #22272b !important;
  border-color: #1d9bf0 !important;
}

body.dark-mode #modal .result-address-main {
  color: #e7e9ea !important;
}

body.dark-mode #modal .result-address-sub {
  color: #6e767d !important;
}

/* 하우스머치 선택된 항목 */
body.dark-mode #modal .howsmuch-selected {
  background: #1a3d2b !important;
  border-color: #27ae60 !important;
  color: #4ade80 !important;
}

body.dark-mode #modal .btn-clear-selection {
  color: #4ade80 !important;
}

/* 하우스머치 세션 만료 오버레이 */
body.dark-mode #modal .howsmuch-session-expired {
  background: rgba(22, 24, 28, 0.95) !important;
}

body.dark-mode #modal .session-expired-message {
  background: #2a2518 !important;
  border-color: #ffc107 !important;
}

body.dark-mode #modal .session-expired-message p {
  color: #ffc107 !important;
}

/* 하우스머치 인라인 상태 메시지 다크모드 */
body.dark-mode .howsmuch-status-message {
  background: #2a2518 !important;
  border-color: #5c4a1e !important;
  color: #ffc107 !important;
}

body.dark-mode .btn-howsmuch-login-inline {
  background: #2a2518 !important;
  border-color: #f57c00 !important;
  color: #f57c00 !important;
}

body.dark-mode .btn-howsmuch-login-inline:hover {
  background: #f57c00 !important;
  color: #fff !important;
}

/* 하우스머치 가격 카드 */
body.dark-mode #modal .howsmuch-price-card {
  background: #1d2125 !important;
  border-color: #27ae60 !important;
}

body.dark-mode #modal .howsmuch-price-card .price-main {
  border-bottom-color: #2f3336 !important;
}

body.dark-mode #modal .howsmuch-price-card .price-label {
  color: #8b98a5 !important;
}

body.dark-mode #modal .howsmuch-price-card .price-range {
  color: #8b98a5 !important;
  border-bottom-color: #2f3336 !important;
}

body.dark-mode #modal .howsmuch-price-card .detail-row.highlight {
  background: #3d2e18 !important;
}

body.dark-mode #modal .howsmuch-price-card .detail-row.highlight span:first-child {
  color: #f39c12 !important;
}

body.dark-mode #modal .howsmuch-price-card .detail-row.highlight span:last-child {
  color: #f1c40f !important;
}

/* 하우스머치 힌트/에러/로딩 메시지 */
body.dark-mode #modal .howsmuch-hint,
body.dark-mode #modal .howsmuch-no-result {
  color: #8b98a5 !important;
}

body.dark-mode #modal .howsmuch-error {
  background: #3d1f1f !important;
  color: #f87171 !important;
}

body.dark-mode #modal .howsmuch-no-price {
  background: #3d3520 !important;
  border-color: #ffc107 !important;
  color: #ffc107 !important;
}

body.dark-mode #modal .howsmuch-no-price .hint {
  color: #d4a506 !important;
}

body.dark-mode #modal .howsmuch-loading {
  color: #1d9bf0 !important;
}

/* 직접입력 컨테이너 다크모드 */
body.dark-mode #modal .manual-input-container {
  background: #16181c !important;
  border-color: #2f3336 !important;
}

body.dark-mode #modal .manual-input-container .address-detail-row label {
  color: #8b98a5 !important;
}

body.dark-mode #modal .manual-input-container input,
body.dark-mode #modal .manual-input-container select {
  background: #1d2125 !important;
  color: #e7e9ea !important;
  border-color: #3d4449 !important;
}

body.dark-mode #modal .manual-input-container input::placeholder {
  color: #6e767d !important;
}

/* ===== 시세 입력 섹션 다크모드 (과거시세/현재시세) ===== */
body.dark-mode #modal .price-group {
  background: #1d2125 !important;
  border-color: #2f3336 !important;
}

body.dark-mode #modal .price-group h5,
body.dark-mode #modal .price-header-with-btn h5 {
  color: #e7e9ea !important;
}

body.dark-mode #modal .price-inputs input {
  background: #16181c !important;
  color: #e7e9ea !important;
  border-color: #3d4449 !important;
}

body.dark-mode #modal .price-inputs input:focus {
  border-color: #1d9bf0 !important;
}

body.dark-mode #modal .price-inputs input::placeholder {
  color: #6e767d !important;
}

/* 하우스머치 시세 섹션 다크모드 */
body.dark-mode #modal .howsmuch-price-section {
  background: transparent !important;
}

body.dark-mode #modal .howsmuch-price-section .address-detail-row label {
  color: #8b98a5 !important;
}

body.dark-mode #modal .howsmuch-price-section input,
body.dark-mode #modal .howsmuch-price-section select,
body.dark-mode #modal .howsmuch-property-type,
body.dark-mode #modal .howsmuch-jibun-address {
  background: #1d2125 !important;
  color: #e7e9ea !important;
  border-color: #3d4449 !important;
}

body.dark-mode #modal .howsmuch-price-section input::placeholder {
  color: #6e767d !important;
}

body.dark-mode #modal .howsmuch-price-section input:focus,
body.dark-mode #modal .howsmuch-price-section select:focus {
  border-color: #1d9bf0 !important;
}

/* 채권정보 다크모드 */
body.dark-mode #modal .debt-section {
  background: #16181c !important;
  border-color: #2f3336 !important;
}

body.dark-mode #modal .debt-header {
  color: #e7e9ea !important;
}

body.dark-mode #modal .debt-list {
  background: transparent !important;
}

body.dark-mode #modal .debt-item {
  background: #1d2125 !important;
  border-color: #2f3336 !important;
}

body.dark-mode #modal .debt-item:hover {
  background: #22272b !important;
}

body.dark-mode #modal .btn-add-debt {
  background: #1d9bf0 !important;
  color: #fff !important;
}

/* ===== 저장하지 않은 변경사항 다이얼로그 ===== */
.unsaved-changes-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10001;
  animation: fadeIn 0.2s ease;
}

.unsaved-changes-dialog {
  background: white;
  border-radius: 12px;
  padding: 24px 28px;
  max-width: 420px;
  width: 90%;
  text-align: center;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  animation: slideUp 0.2s ease;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.unsaved-changes-icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
}

.unsaved-changes-title {
  font-size: 1.2rem;
  font-weight: 600;
  color: #333;
  margin-bottom: 8px;
}

.unsaved-changes-message {
  color: #666;
  font-size: 0.95rem;
  margin-bottom: 12px;
  line-height: 1.5;
}

.unsaved-changes-hint {
  background: #f8f9fa;
  color: #666;
  font-size: 0.8rem;
  padding: 8px 12px;
  border-radius: 6px;
  margin-bottom: 16px;
  border: 1px dashed #ddd;
}

.unsaved-changes-buttons {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.unsaved-changes-buttons button {
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}

.btn-unsaved-cancel {
  background: #e9ecef;
  color: #495057;
}

.btn-unsaved-cancel:hover {
  background: #dee2e6;
}

.btn-unsaved-discard {
  background: #dc3545;
  color: white;
}

.btn-unsaved-discard:hover {
  background: #c82333;
}

.btn-unsaved-save {
  background: #28a745;
  color: white;
}

.btn-unsaved-save:hover {
  background: #218838;
}

/* 다크모드 */
body.dark-mode .unsaved-changes-dialog {
  background: #1d2125;
}

body.dark-mode .unsaved-changes-title {
  color: #e7e9ea;
}

body.dark-mode .unsaved-changes-message {
  color: #8b98a5;
}

body.dark-mode .unsaved-changes-hint {
  background: #2f3336;
  color: #8b98a5;
  border-color: #3d4449;
}

body.dark-mode .btn-unsaved-cancel {
  background: #2f3336;
  color: #e7e9ea;
}

body.dark-mode .btn-unsaved-cancel:hover {
  background: #3d4449;
}

/* ===== 하우스머치 모바일 시인성 개선 ===== */
@media (max-width: 768px) {
  .howsmuch-container {
    padding: 12px;
  }
  
  .howsmuch-search-section {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  
  .howsmuch-search-section > label,
  .howsmuch-search-label {
    min-width: auto;
    font-size: 0.85rem;
  }
  
  .howsmuch-search-input {
    font-size: 16px !important; /* iOS 자동 줌 방지 */
    padding: 12px;
  }
  
  .howsmuch-search-dropdown {
    max-height: 200px;
  }
  
  .howsmuch-dropdown-item {
    padding: 14px 12px;
  }
  
  .dropdown-address-main {
    font-size: 0.9rem;
    line-height: 1.4;
  }
  
  .dropdown-address-sub {
    font-size: 0.8rem;
    margin-top: 4px;
  }
  
  /* 모바일 저장하지 않은 변경사항 다이얼로그 */
  .unsaved-changes-dialog {
    padding: 20px 16px;
    width: 94%;
    max-width: 360px;
  }
  
  .unsaved-changes-icon {
    font-size: 2rem;
    margin-bottom: 8px;
  }
  
  .unsaved-changes-title {
    font-size: 1.1rem;
  }
  
  .unsaved-changes-message {
    font-size: 0.9rem;
  }
  
  .unsaved-changes-hint {
    font-size: 0.75rem;
    padding: 6px 10px;
  }
  
  .unsaved-changes-buttons {
    flex-direction: column;
    gap: 8px;
  }
  
  .unsaved-changes-buttons button {
    width: 100%;
    padding: 12px 16px;
    font-size: 0.95rem;
  }
  
  /* 모바일 하우스머치 시세 카드 */
  .howsmuch-price-card {
    padding: 12px;
    border-radius: 10px;
  }
  
  .howsmuch-price-card .price-main {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding-bottom: 10px;
    margin-bottom: 10px;
  }
  
  .howsmuch-price-card .price-value {
    font-size: 1.4rem;
  }
  
  .howsmuch-price-card .price-range {
    flex-direction: column;
    align-items: center;
    gap: 4px;
    font-size: 0.85rem;
  }
  
  .howsmuch-price-card .price-details {
    grid-template-columns: 1fr;
  }
  
  .howsmuch-price-card .detail-row {
    font-size: 0.82rem;
  }
  
  .howsmuch-price-card .recent-sales {
    padding: 8px;
  }
  
  .howsmuch-price-card .recent-sales h5 {
    font-size: 0.85rem;
  }
  
  .howsmuch-price-card .sale-item {
    font-size: 0.78rem;
    flex-wrap: wrap;
  }
  
  .howsmuch-selects {
    flex-direction: column;
    gap: 10px;
    padding: 12px;
  }
  
  .howsmuch-select-group {
    width: 100%;
  }
  
  .howsmuch-select-group label {
    min-width: 50px;
  }
  
  .howsmuch-dong-select,
  .howsmuch-ho-select,
  .howsmuch-property-type {
    font-size: 16px !important;
    padding: 10px;
    flex: 1;
  }
  
  .btn-howsmuch-fetch {
    width: 100%;
    padding: 12px;
    font-size: 0.95rem;
  }
  
  /* 시세 입력 영역 모바일 */
  .howsmuch-price-section .address-detail-row {
    flex-direction: column;
    gap: 6px;
  }
  
  .howsmuch-price-section .address-detail-row label {
    min-width: auto;
  }
  
  .howsmuch-price-section .price-row {
    flex-direction: column;
    gap: 12px;
  }
  
  .howsmuch-price-section .price-group {
    padding: 12px;
  }
  
  .howsmuch-price-section .price-inputs {
    flex-direction: column;
    gap: 8px;
  }
  
  .howsmuch-price-section .price-inputs input {
    font-size: 16px !important;
    padding: 12px;
    text-align: left;
  }
  
  .howsmuch-price-section .price-header-with-btn {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  
  .howsmuch-price-section .btn-apply-past {
    padding: 8px 12px;
    font-size: 0.8rem;
  }
  
  /* 지번주소 입력란 */
  .howsmuch-jibun-address {
    font-size: 16px !important;
  }
}

/* ===== 하우스머치 시세 카드 다크모드 스타일 ===== */
body.dark-mode .howsmuch-price-card {
  background: #1d2125;
  border-color: #27ae60;
}

body.dark-mode .howsmuch-price-card .price-main {
  border-bottom-color: #3d4449;
}

body.dark-mode .howsmuch-price-card .price-label {
  color: #8b98a5;
}

body.dark-mode .howsmuch-price-card .price-value {
  color: #2ecc71;
}

body.dark-mode .howsmuch-price-card .price-range {
  color: #8b98a5;
  border-bottom-color: #3d4449;
}

body.dark-mode .howsmuch-price-card .detail-row {
  background: #2a2f33;
}

body.dark-mode .howsmuch-price-card .detail-row span:first-child {
  color: #8b98a5;
}

body.dark-mode .howsmuch-price-card .detail-row span:last-child {
  color: #e7e9ea;
}

body.dark-mode .howsmuch-price-card .recent-sales {
  background: #1a2633;
  border: 1px solid #2a4a6b;
}

body.dark-mode .howsmuch-price-card .recent-sales h5 {
  color: #5dade2;
}

body.dark-mode .howsmuch-price-card .sale-item {
  color: #8b98a5;
  border-bottom-color: #3d4449;
}

body.dark-mode .howsmuch-price-card .price-date {
  color: #6b7280;
}

/* ===== 하우스머치 설치 안내 다이얼로그 ===== */
.howsmuch-install-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10002;
  animation: fadeIn 0.2s ease;
}

.howsmuch-install-dialog {
  background: white;
  border-radius: 16px;
  padding: 28px;
  max-width: 420px;
  width: 92%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  animation: slideUp 0.3s ease;
}

.install-header {
  text-align: center;
  margin-bottom: 20px;
}

.install-header .install-icon {
  font-size: 3rem;
  display: block;
  margin-bottom: 12px;
}

.install-header h3 {
  margin: 0;
  font-size: 1.3rem;
  color: #333;
}

.install-content {
  margin-bottom: 24px;
}

.install-content p {
  text-align: center;
  color: #555;
  margin: 0 0 20px 0;
  line-height: 1.6;
}

.install-content .install-sub {
  font-size: 0.9rem;
  color: #888;
  margin-top: 8px;
}

.install-steps {
  background: #f8f9fa;
  border-radius: 10px;
  padding: 16px;
}

.install-steps .step {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid #e9ecef;
}

.install-steps .step:last-child {
  border-bottom: none;
}

.install-steps .step-num {
  width: 24px;
  height: 24px;
  background: #007bff;
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: bold;
  flex-shrink: 0;
}

.install-steps .step span:last-child {
  color: #333;
  font-size: 0.9rem;
}

.install-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn-install-download {
  padding: 14px 20px;
  background: linear-gradient(135deg, #28a745, #20c997);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s;
}

.btn-install-download:hover {
  background: #444;
}

.btn-install-download:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-install-close {
  padding: 10px 16px;
  background: #f0f0f0;
  color: #555;
  border: none;
  border-radius: 6px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-install-close:hover {
  background: #e5e5e5;
}

.install-note {
  text-align: center;
  font-size: 0.75rem;
  color: #999;
  margin: 12px 0 0 0;
}

/* 컴팩트 다이얼로그 */
.howsmuch-install-dialog.compact {
  padding: 20px;
  max-width: 300px;
}

.install-steps.compact {
  padding: 10px;
}

.install-buttons.horizontal {
  flex-direction: row;
  gap: 10px;
}

.install-buttons.horizontal button {
  flex: 1;
}

/* 컴팩트 무채색 버튼 */
.btn-confirm {
  padding: 10px 16px;
  background: #444;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-confirm:hover {
  background: #333;
}

.btn-install {
  padding: 10px 16px;
  background: #f0f0f0;
  color: #444;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-install:hover {
  background: #e5e5e5;
  border-color: #ccc;
}

.btn-download {
  padding: 10px 16px;
  background: #555;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-download:hover {
  background: #444;
}

.btn-download:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-cancel {
  padding: 10px 16px;
  background: #f0f0f0;
  color: #666;
  border: none;
  border-radius: 6px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-cancel:hover {
  background: #e5e5e5;
}

/* 다크모드 */
body.dark-mode .howsmuch-install-dialog {
  background: #2d2d2d;
}

body.dark-mode .install-header h3 {
  color: #e0e0e0;
}

body.dark-mode .install-content p {
  color: #b0b0b0;
}

body.dark-mode .install-content .install-sub {
  color: #808080;
}

body.dark-mode .install-steps {
  background: #252525;
}

body.dark-mode .install-steps .step {
  border-bottom-color: #3a3a3a;
}

body.dark-mode .install-steps .step-num {
  background: #555;
}

body.dark-mode .install-steps .step span:last-child {
  color: #c0c0c0;
}

body.dark-mode .btn-confirm {
  background: #555;
}

body.dark-mode .btn-confirm:hover {
  background: #666;
}

body.dark-mode .btn-install,
body.dark-mode .btn-cancel {
  background: #3a3a3a;
  color: #c0c0c0;
  border-color: #4a4a4a;
}

body.dark-mode .btn-install:hover,
body.dark-mode .btn-cancel:hover {
  background: #454545;
}

body.dark-mode .btn-download,
body.dark-mode .btn-install-download {
  background: #4a4a4a;
}

body.dark-mode .btn-download:hover,
body.dark-mode .btn-install-download:hover {
  background: #555;
}

body.dark-mode .btn-install-close {
  background: #3a3a3a;
  color: #b0b0b0;
}

body.dark-mode .btn-install-close:hover {
  background: #454545;
}

body.dark-mode .install-note {
  color: #707070;
}

/* ====== 모바일 다크모드 - 필터/테이블설정 팝업 (최우선순위) ====== */
@media (max-width: 768px) {
  /* 필터 팝업 - 전체 배경 */
  body.dark-mode .filter-popup {
    background: #16213e !important;
    border-color: #2d3a4f !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5) !important;
  }
  
  /* 필터 팝업 - 헤더 */
  body.dark-mode .filter-popup-header {
    background: #1a1a2e !important;
    border-color: #2d3a4f !important;
  }
  
  body.dark-mode .filter-popup-header h3 {
    color: #e0e0e0 !important;
  }
  
  /* 필터 팝업 - 바디 */
  body.dark-mode .filter-popup-body {
    background: #16213e !important;
  }
  
  /* 필터 팝업 - 섹션 제목 */
  body.dark-mode .filter-section h4 {
    color: #b0c4de !important;
  }
  
  /* 필터 팝업 - 기간 선택 버튼 */
  body.dark-mode .date-preset-btn {
    background: #2d3a4f !important;
    color: #e0e0e0 !important;
    border-color: #3d4a5f !important;
  }
  
  body.dark-mode .date-preset-btn:hover {
    background: #3d4a5f !important;
    border-color: #4d5a6f !important;
  }
  
  body.dark-mode .date-preset-btn.active {
    background: #3949ab !important;
    border-color: #5c6bc0 !important;
    color: #fff !important;
  }
  
  /* 필터 팝업 - 기간 선택 */
  body.dark-mode .btn-date-picker {
    background: #2d3a4f !important;
    color: #e0e0e0 !important;
    border-color: #3d4a5f !important;
  }
  
  body.dark-mode .btn-date-picker:hover {
    background: #3d4a5f !important;
  }
  
  /* 필터 팝업 - 진행상태/직군 칩 */
  body.dark-mode .filter-chip {
    background: #2d3a4f !important;
    color: #e0e0e0 !important;
    border-color: #3d4a5f !important;
  }
  
  body.dark-mode .filter-chip:hover {
    background: #3d4a5f !important;
    border-color: #4d5a6f !important;
  }
  
  body.dark-mode .filter-chip:has(input:checked),
  body.dark-mode .filter-chip.active {
    background: #3949ab !important;
    border-color: #5c6bc0 !important;
    color: #fff !important;
  }
  
  /* 필터 팝업 - 직군 선택 */
  body.dark-mode .filter-section select {
    background: #1a1a2e !important;
    color: #e0e0e0 !important;
    border-color: #3d4a5f !important;
  }
  
  /* 필터 팝업 - 푸터 */
  body.dark-mode .filter-popup-footer {
    background: #1a1a2e !important;
    border-color: #2d3a4f !important;
  }
  
  /* 필터 팝업 - 푸터 버튼 */
  body.dark-mode .filter-popup-footer .btn {
    background: #2d3a4f !important;
    color: #e0e0e0 !important;
    border: 1px solid #3d4a5f !important;
  }
  
  body.dark-mode .filter-popup-footer .btn:hover {
    background: #3d4a5f !important;
    border-color: #4d5a6f !important;
  }
  
  body.dark-mode .filter-popup-footer .btn-primary {
    background: #3949ab !important;
    border-color: #5c6bc0 !important;
    color: #fff !important;
  }
  
  body.dark-mode .filter-popup-footer .btn-primary:hover {
    background: #5c6bc0 !important;
  }
  
  /* 필터 팝업 - 툴팁 버튼 */
  body.dark-mode .tooltip-toggle-btn {
    background: #665d35 !important;
    color: #ffc107 !important;
    border-color: #7a6e3f !important;
  }
  
  /* 필터 팝업 - 가이드 툴팁 */
  body.dark-mode .filter-guide-tooltip {
    background: #2d3a4f !important;
    color: #e0e0e0 !important;
    border: 1px solid #3d4a5f !important;
  }
  
  /* 테이블 설정 팝업 - 전체 배경 */
  body.dark-mode .settings-popup {
    background: #16213e !important;
    border-color: #2d3a4f !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5) !important;
  }
  
  /* 테이블 설정 팝업 - 헤더 */
  body.dark-mode .settings-popup-header {
    background: #1a1a2e !important;
    border-color: #2d3a4f !important;
  }
  
  body.dark-mode .settings-popup-header h3 {
    color: #e0e0e0 !important;
  }
  
  /* 테이블 설정 팝업 - 바디 */
  body.dark-mode .settings-popup-body {
    background: #16213e !important;
  }
  
  /* 테이블 설정 팝업 - 섹션 제목 */
  body.dark-mode .settings-section h4 {
    color: #b0c4de !important;
  }
  
  body.dark-mode .settings-section h4 span {
    color: #66bb6a !important;
  }
  
  /* 테이블 설정 팝업 - 슬라이더 영역 */
  body.dark-mode .settings-popup .slider-container,
  body.dark-mode .settings-popup .range-container {
    background: #2d3a4f !important;
  }
  
  body.dark-mode .settings-popup input[type="range"] {
    background: #3d4a5f !important;
  }
  
  /* 테이블 설정 팝업 - 컬럼 너비 행 */
  body.dark-mode .column-width-row {
    background: #2d3a4f !important;
    border-color: #3d4a5f !important;
  }
  
  body.dark-mode .column-width-row .col-label {
    color: #b0b0b0 !important;
  }
  
  /* 테이블 설정 팝업 - 입력 필드 */
  body.dark-mode .settings-popup input[type="text"],
  body.dark-mode .settings-popup input[type="number"] {
    background: #1a1a2e !important;
    color: #e0e0e0 !important;
    border-color: #3d4a5f !important;
  }
  
  /* 테이블 설정 팝업 - 휠 버튼 */
  body.dark-mode .wheel-btn {
    background: #2d3a4f !important;
    border-color: #3d4a5f !important;
    color: #e0e0e0 !important;
  }
  
  body.dark-mode .wheel-btn:hover {
    background: #3d4a5f !important;
  }
  
  /* 테이블 설정 팝업 - 휠 영역 */
  body.dark-mode .wheel-area {
    background: linear-gradient(to right, #2d3a4f, #1a1a2e, #2d3a4f) !important;
    border-color: #3d4a5f !important;
  }
  
  /* 테이블 설정 팝업 - 푸터 */
  body.dark-mode .settings-popup-footer {
    background: #1a1a2e !important;
    border-color: #2d3a4f !important;
  }
  
  /* 테이블 설정 팝업 - 푸터 버튼 */
  body.dark-mode .settings-popup-footer .btn {
    background: #2d3a4f !important;
    color: #e0e0e0 !important;
    border: 1px solid #3d4a5f !important;
  }
  
  body.dark-mode .settings-popup-footer .btn:hover {
    background: #3d4a5f !important;
    border-color: #4d5a6f !important;
  }
  
  body.dark-mode .settings-popup-footer .btn-primary {
    background: #3949ab !important;
    border-color: #5c6bc0 !important;
    color: #fff !important;
  }
  
  body.dark-mode .settings-popup-footer .btn-primary:hover {
    background: #5c6bc0 !important;
  }
  
  /* 테이블 설정 팝업 - 가이드 툴팁 */
  body.dark-mode .settings-guide-tooltip {
    background: #2d3a4f !important;
    color: #e0e0e0 !important;
    border: 1px solid #3d4a5f !important;
  }
}

/* ====== 진행완료 정보 입력 모달 ====== */
.completion-modal-content {
  max-width: 1000px !important;
  margin: 60px auto !important;
}

.completion-modal-content .modal-header {
  padding: 12px 16px !important;
}

.completion-modal-content .modal-header h2 {
  font-size: 1rem !important;
}

.completion-modal-content .modal-body {
  padding: 16px !important;
  max-height: 70vh;
  overflow-y: auto;
}

.completion-modal-content .modal-footer {
  padding: 10px 16px !important;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* 진행완료 테이블 섹션 */
.completion-table-section {
  width: 100%;
}

.completion-table-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.completion-table-header span {
  font-size: 0.9rem;
  color: #666;
  font-weight: 500;
}

.btn-add-completion {
  padding: 6px 14px;
  font-size: 0.85rem;
  font-weight: 500;
  background: #28a745;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-add-completion:hover {
  background: #218838;
}

/* 진행완료 테이블 래퍼 */
.completion-table-wrapper {
  width: 100%;
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: #c1c1c1 #f1f1f1;
}

/* 웹킷 브라우저용 스크롤바 스타일 */
.completion-table-wrapper::-webkit-scrollbar {
  height: 8px;
}

.completion-table-wrapper::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

.completion-table-wrapper::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 4px;
}

.completion-table-wrapper::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

/* 진행완료 테이블 */
.completion-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.completion-table thead th {
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  padding: 8px 4px;
  font-weight: 600;
  color: #495057;
  text-align: center;
  white-space: nowrap;
  font-size: 0.8rem;
}

.completion-table tbody td {
  border: 1px solid #dee2e6;
  padding: 4px;
  vertical-align: middle;
}

.completion-row {
  background: white;
}

.completion-row:hover {
  background: #f8f9fa;
}

/* 테이블 내 입력 필드 */
.completion-input {
  width: 100%;
  padding: 5px 6px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 0.8rem;
  box-sizing: border-box;
}

.completion-input:disabled {
  background: #f5f5f5;
  color: #666;
  cursor: not-allowed;
}

.completion-input:focus {
  border-color: #007bff;
  outline: none;
}

/* 수당 % 셀 */
.commission-percent-cell {
  text-align: center;
}

.commission-percent-cell .completion-percent {
  width: 60px;
  text-align: center;
}

.completion-percent-display {
  color: #999;
}

/* 수당금액 셀 */
.commission-amount-cell {
  text-align: center;
  white-space: nowrap;
}

.commission-amount-cell .completion-amount-fixed {
  width: 70px;
  text-align: right;
}

.commission-unit-small {
  font-size: 0.75rem;
  color: #666;
  margin-left: 2px;
}

.completion-calculated {
  font-size: 0.8rem;
  color: #28a745;
  font-weight: 600;
  white-space: nowrap;
}

/* 행 액션 버튼 */
.completion-row-actions {
  display: flex;
  gap: 4px;
  justify-content: center;
}

.btn-save-row,
.btn-edit-row,
.btn-delete-row {
  padding: 4px 6px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.85rem;
  background: transparent;
  transition: background 0.2s;
}

.btn-save-row:hover {
  background: #e3f2fd;
}

.btn-edit-row:hover {
  background: #fff3e0;
}

.btn-delete-row:hover {
  background: #ffebee;
}

/* 진행상태 입력 버튼 - 컴팩트 */
.status-input-wrapper {
  display: flex;
  gap: 4px;
  align-items: center;
}

.status-input-wrapper select {
  flex: 1;
  min-width: 0;
  height: 26px;
  padding: 4px 6px;
  font-size: 0.78rem;
}

.status-input-wrapper.completion-active select {
  flex: 0 0 auto !important;
  width: auto !important;
  min-width: 80px !important;
  max-width: 90px !important;
}

.btn-completion-input {
  display: none !important;
  padding: 4px 8px;
  font-size: 0.72rem;
  font-weight: 500;
  background: #28a745;
  color: white;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s;
  height: 26px;
}

.status-input-wrapper.completion-active .btn-completion-input {
  display: inline-block !important;
}

.btn-completion-input:hover {
  background: #218838;
}

/* 다크모드 - 진행완료 모달 */
body.dark-mode .completion-modal-content {
  background: #1d2125 !important;
  border: 1px solid #2f3336;
}

body.dark-mode .completion-modal-content .modal-header {
  background: #15191c !important;
  border-bottom: 1px solid #2f3336;
}

body.dark-mode .completion-modal-content .modal-header h2 {
  color: #e7e9ea !important;
}

body.dark-mode .completion-modal-content .modal-footer {
  background: #15191c !important;
  border-top: 1px solid #2f3336;
}

body.dark-mode .completion-table-header span {
  color: #8b98a5;
}

body.dark-mode .btn-add-completion {
  background: #1a7f37;
}

body.dark-mode .btn-add-completion:hover {
  background: #238636;
}

body.dark-mode .completion-table thead th {
  background: #22272b;
  border-color: #3d4449;
  color: #e7e9ea;
}

body.dark-mode .completion-table tbody td {
  border-color: #3d4449;
}

body.dark-mode .completion-row {
  background: #1d2125;
}

body.dark-mode .completion-row:hover {
  background: #22272b;
}

body.dark-mode .completion-input {
  background: #15191c;
  border-color: #3d4449;
  color: #e7e9ea;
}

body.dark-mode .completion-input:focus {
  border-color: #1d9bf0;
}

body.dark-mode .commission-unit {
  color: #8b98a5;
}

body.dark-mode .completion-calculated {
  color: #3fb950;
}

body.dark-mode .btn-save-row:hover {
  background: rgba(29, 155, 240, 0.15);
}

body.dark-mode .btn-delete-row:hover {
  background: rgba(248, 81, 73, 0.15);
}

/* 다크모드 - 진행완료 입력 버튼 */
body.dark-mode .btn-completion-input {
  background: #1a8f3c;
}

body.dark-mode .btn-completion-input:hover {
  background: #238c41;
}

/* ====== 다크모드 - 물건정보 섹션 ====== */
body.dark-mode #modal .property-info-section {
  background: #1d2125 !important;
  border-color: #2f3336 !important;
}

body.dark-mode #modal .property-info-header h5 {
  color: #e7e9ea !important;
}

body.dark-mode #modal .property-info-toggle {
  color: #8b98a5 !important;
}

body.dark-mode #modal .property-info-field label {
  color: #8b98a5 !important;
}

/* ====== 다크모드 - 단지정보 섹션 ====== */
body.dark-mode #modal .complex-info-section {
  background: #1d2125 !important;
  border-color: #2f3336 !important;
}

body.dark-mode #modal .complex-info-header h5 {
  color: #e7e9ea !important;
}

body.dark-mode #modal .complex-info-toggle {
  color: #8b98a5 !important;
}

body.dark-mode #modal .property-info-field input,
body.dark-mode #modal .property-info-field select {
  background: #15181c !important;
  border-color: #2f3336 !important;
  color: #e7e9ea !important;
}

body.dark-mode #modal .property-info-field input:disabled,
body.dark-mode #modal .property-info-field select:disabled {
  background: #1d2125 !important;
  color: #6e767d !important;
}

/* ====== 다크모드 - 접수 가능 상품 섹션 ====== */
body.dark-mode #modal .eligible-products-section {
  background: #1a2332 !important;
  border-color: #1d4ed8 !important;
}

body.dark-mode #modal .eligible-products-header h5 {
  color: #60a5fa !important;
}

body.dark-mode #modal .eligible-products-toggle {
  color: #3b82f6 !important;
}

body.dark-mode #modal .eligible-products-count {
  color: #60a5fa !important;
}

body.dark-mode #modal .btn-verify-all-products {
  background: #7c3aed !important;
}

body.dark-mode #modal .btn-verify-all-products:hover {
  background: #8b5cf6 !important;
}

body.dark-mode #modal .btn-refresh-products {
  background: #2563eb !important;
}

body.dark-mode #modal .btn-refresh-products:hover {
  background: #3b82f6 !important;
}

body.dark-mode #modal .eligible-products-placeholder {
  color: #8b98a5 !important;
}

body.dark-mode #modal .eligible-products-table thead {
  background: #1e3a5f !important;
}

body.dark-mode #modal .eligible-products-table th {
  color: #93c5fd !important;
  border-bottom-color: #2563eb !important;
}

body.dark-mode #modal .eligible-products-table td {
  color: #e7e9ea !important;
  border-bottom-color: #1d4ed8 !important;
}

body.dark-mode #modal .eligible-products-table tbody tr:hover {
  background: #1e3a5f !important;
}

body.dark-mode #modal .eligible-products-table .conditions-note {
  color: #8b98a5 !important;
}

body.dark-mode #modal .eligible-products-table td.limit-not-feasible {
  color: #f87171 !important;
}

body.dark-mode #modal .eligible-products-table td.grade-unavailable {
  color: #f87171 !important;
  background-color: #450a0a !important;
}

body.dark-mode #modal .eligible-products-table td.grade-unknown {
  color: #fbbf24 !important;
  background-color: #451a03 !important;
}

/* ====== 다크모드 - 채권/환수 섹션 ====== */
body.dark-mode #modal .debt-recovery-section {
  background: #1d2125 !important;
  border-color: #2f3336 !important;
}

body.dark-mode #modal .debt-recovery-header h5 {
  color: #e7e9ea !important;
}

body.dark-mode #modal .debt-recovery-toggle {
  color: #8b98a5 !important;
}

body.dark-mode #modal .debt-recovery-tabs {
  border-bottom-color: #2f3336 !important;
}

body.dark-mode #modal .debt-tab-btn {
  color: #8b98a5;
}

body.dark-mode #modal .debt-tab-btn:hover {
  color: #1d9bf0;
}

body.dark-mode #modal .debt-tab-btn.active {
  color: #1d9bf0;
  border-bottom-color: #1d9bf0;
}

/* 다크모드 환수 테이블 스타일 */
body.dark-mode #modal .btn-add-recovery {
  background-color: #17a2b8;
  color: white;
}

body.dark-mode #modal .btn-add-recovery:hover {
  background-color: #138496;
}

body.dark-mode #modal .btn-remove-recovery {
  background-color: #dc3545;
  color: white;
}

body.dark-mode #modal .btn-remove-recovery:hover {
  background-color: #c82333;
}

body.dark-mode #modal .recovery-table {
  border-color: #3d4449;
}

body.dark-mode #modal .recovery-table th {
  background: #1e2428;
  color: #8b98a5;
  border-color: #3d4449;
}

body.dark-mode #modal .recovery-table td {
  border-color: #3d4449;
}

body.dark-mode #modal .recovery-table input,
body.dark-mode #modal .recovery-table select {
  background: transparent !important;
  color: #e7e9ea !important;
  border-color: transparent !important;
}

body.dark-mode #modal .recovery-table input:focus,
body.dark-mode #modal .recovery-table select:focus {
  background: #15191c !important;
  border-color: #1d9bf0 !important;
}

/* ====== 담보물 요약 모달 ====== */
.summary-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 10000;
  justify-content: center;
  align-items: center;
}

.summary-modal.show {
  display: flex;
}

.summary-modal-content {
  background: white;
  border-radius: 12px;
  width: 550px;
  max-width: 95vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.summary-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid #e5e7eb;
}

.summary-modal-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #1f2937;
}

.summary-modal-close {
  font-size: 24px;
  color: #6b7280;
  cursor: pointer;
  line-height: 1;
}

.summary-modal-close:hover {
  color: #1f2937;
}

.summary-modal-body {
  padding: 20px;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}

.summary-customer-info {
  width: 100%;
}

.summary-customer-table {
  width: 100%;
}

.summary-textarea {
  display: block;
  width: 100%;
  box-sizing: border-box;
  min-height: 350px;
  padding: 12px;
  font-family: 'D2Coding', 'Consolas', monospace;
  font-size: 13px;
  line-height: 1.6;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  resize: both;
  background: #f9fafb;
  white-space: pre;
  overflow-x: auto;
  overflow-y: auto;
}

.summary-textarea:focus {
  outline: none;
  border-color: #3b82f6;
}

.summary-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 20px;
  border-top: 1px solid #e5e7eb;
}

.btn-copy-summary {
  padding: 8px 20px;
  background: #3b82f6;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-copy-summary:hover {
  background: #2563eb;
}

.btn-close-summary {
  padding: 8px 20px;
  background: #6b7280;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-close-summary:hover {
  background: #4b5563;
}

/* 요약 버튼 스타일 */
.btn-summary-collateral {
  padding: 4px 12px;
  background: #8b5cf6;
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-summary-collateral:hover {
  background: #7c3aed;
}

/* 요약 버튼 행 */
.collateral-summary-row {
  margin-top: 4px;
}

.collateral-summary-row .btn-summary-collateral {
  padding: 3px 10px;
  font-size: 11px;
}

/* 다크모드 요약 모달 */
body.dark-mode .summary-modal-content {
  background: #1e2328;
}

body.dark-mode .summary-modal-header {
  border-color: #3d4449;
}

body.dark-mode .summary-modal-header h3 {
  color: #e7e9ea;
}

body.dark-mode .summary-modal-close {
  color: #8b98a5;
}

body.dark-mode .summary-modal-close:hover {
  color: #e7e9ea;
}

body.dark-mode .summary-textarea {
  background: #15191c;
  border-color: #3d4449;
  color: #e7e9ea;
}

body.dark-mode .summary-modal-footer {
  border-color: #3d4449;
}

/* 요약 고객정보 테이블 */
.summary-customer-table {
  width: auto;
  min-width: 100%;
  border-collapse: collapse;
  margin-bottom: 12px;
  font-size: 12px;
  table-layout: auto;
}

.summary-customer-table th,
.summary-customer-table td {
  padding: 4px 10px;
  border: 1px solid #e5e7eb;
  text-align: center;
  white-space: nowrap;
}

.summary-customer-table th {
  background: #f3f4f6;
  font-weight: 600;
  color: #374151;
}

.summary-customer-table td {
  background: #fff;
  color: #1f2937;
}

body.dark-mode .summary-customer-table th {
  background: #2d3339;
  color: #e7e9ea;
  border-color: #3d4449;
}

body.dark-mode .summary-customer-table td {
  background: #15191c;
  color: #e7e9ea;
  border-color: #3d4449;
}

/* 편집 버튼 스타일 */
.btn-edit-summary {
  padding: 8px 20px;
  background: #10b981;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-edit-summary:hover {
  background: #059669;
}

.btn-edit-summary.editing {
  background: #f59e0b;
}

.btn-edit-summary.editing:hover {
  background: #d97706;
}

/* 편집 가능한 텍스트 영역 스타일 */
.summary-textarea.editing {
  background: #fffde7;
  border-color: #f59e0b;
}

body.dark-mode .summary-textarea.editing {
  background: #2a2810;
  border-color: #f59e0b;
}

/* 메인 라디오 + 요약 버튼 컬럼 */
.collateral-main-summary-col {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.collateral-main-summary-col .collateral-label {
  display: flex;
  align-items: center;
  gap: 4px;
}

.collateral-main-summary-col .btn-summary-collateral {
  padding: 3px 10px;
  font-size: 11px;
}

/* ====== 직원용 내 성과 버튼 ====== */
.btn-my-performance {
  padding: 4px 12px;
  background: linear-gradient(135deg, #ff9800, #f57c00);
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-my-performance:hover {
  background: linear-gradient(135deg, #f57c00, #ef6c00);
  transform: translateY(-1px);
}

/* 내 성과 모달 */
#myPerformanceModal.show {
  display: flex !important;
  justify-content: center;
  align-items: center;
}

#myPerformanceModal .modal-content {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
}

/* 내 성과 모달 리스트 */
#myPerfListContainer {
  font-size: 11px;
}

#myPerfCompletionBody > div:last-child {
  border-bottom: none;
}

body.dark-mode #myPerformanceModal .modal-content {
  background: #1e2328 !important;
}

body.dark-mode #myPerformanceModal .modal-header {
  background: #1e2328 !important;
  border-color: #3d4449 !important;
}

body.dark-mode #myPerformanceModal .modal-footer {
  background: #1e2328 !important;
  border-color: #3d4449 !important;
}

body.dark-mode #myPerformanceModal h2,
body.dark-mode #myPerformanceModal h4 {
  color: #e7e9ea !important;
}

body.dark-mode #myPerformanceModal .modal-header > div > div {
  color: #9ca3af !important;
}

body.dark-mode #myPerformanceModal .modal-close {
  color: #e7e9ea !important;
}

body.dark-mode #myPerformanceModal .modal-body {
  background: #1e2328 !important;
}

body.dark-mode #myPerfListContainer {
  border-color: #3d4449;
  background: #23282d;
}

body.dark-mode #myPerfListContainer > div:first-child {
  background: #2d3339 !important;
  border-color: #3d4449;
}

body.dark-mode #myPerfCompletionBody > div {
  color: #e7e9ea;
  border-color: #3d4449;
}
/* 다크모드 요약 카드 */
body.dark-mode #myPerformanceModal .modal-body > div:nth-child(3) > div {
  background: #2d3339 !important;
  border-color: #3d4449 !important;
}

body.dark-mode #myPerformanceModal .modal-body > div:nth-child(3) > div > div:first-child {
  color: #9ca3af !important;
}

body.dark-mode #myPerformanceModal .modal-body > div:nth-child(3) > div > div:last-child {
  color: #e7e9ea !important;
}

/* 환수건수/환수금액 카드 다크모드 */
body.dark-mode #myPerformanceModal .modal-body > div:nth-child(3) > div:nth-child(3),
body.dark-mode #myPerformanceModal .modal-body > div:nth-child(3) > div:nth-child(4) {
  background: #3d2a2a !important;
  border-color: #5c3a3a !important;
}

body.dark-mode #myPerformanceModal .modal-body > div:nth-child(3) > div:nth-child(3) > div:first-child,
body.dark-mode #myPerformanceModal .modal-body > div:nth-child(3) > div:nth-child(4) > div:first-child {
  color: #ff8a8a !important;
}

body.dark-mode #myPerformanceModal .modal-body > div:nth-child(3) > div:nth-child(3) > div:last-child,
body.dark-mode #myPerformanceModal .modal-body > div:nth-child(3) > div:nth-child(4) > div:last-child {
  color: #ff6b6b !important;
}

/* 급여 카드 다크모드 */
body.dark-mode #myPerformanceModal .modal-body > div:nth-child(3) > div:nth-child(5) {
  background: #1e3a5f !important;
  border-color: #2d5a8a !important;
}

body.dark-mode #myPerformanceModal .modal-body > div:nth-child(3) > div:nth-child(5) > div:first-child {
  color: #64b5f6 !important;
}

body.dark-mode #myPerformanceModal .modal-body > div:nth-child(3) > div:nth-child(5) > div:last-child {
  color: #90caf9 !important;
}

/* 다크모드 기간 선택 */
body.dark-mode #myPerformanceModal select {
  background: #2d3339 !important;
  border-color: #3d4449 !important;
  color: #e7e9ea !important;
}

/* 다크모드 환수 행 */
body.dark-mode #myPerfCompletionBody > div[style*="background:#fff5f5"] {
  background: #3d2a2a !important;
}

/* ====== 내 성과 모달 모바일 반응형 ====== */
@media (max-width: 768px) {
  #myPerformanceModal {
    padding: 15px !important;
    align-items: center !important;
    justify-content: center !important;
  }
  
  #myPerformanceModal .modal-content {
    width: calc(100vw - 30px) !important;
    max-width: calc(100vw - 30px) !important;
    max-height: calc(100vh - 30px) !important;
    margin: auto !important;
    border-radius: 12px !important;
    display: flex;
    flex-direction: column;
    position: relative;
  }
  
  #myPerformanceModal .modal-header {
    padding: 12px 16px !important;
    flex-shrink: 0;
    position: relative;
    border-radius: 12px 12px 0 0;
  }
  
  #myPerformanceModal .modal-header h2 {
    font-size: 16px !important;
    padding-right: 30px;
  }
  
  #myPerformanceModal .modal-close {
    font-size: 24px !important;
    line-height: 1;
    padding: 4px 8px;
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
  }
  
  #myPerformanceModal .modal-body {
    padding: 12px !important;
    flex: 1;
    overflow-y: auto;
    min-height: 0;
  }
  
  /* 기간 선택 */
  #myPerformanceModal .modal-body > div:first-child {
    gap: 6px !important;
    flex-wrap: wrap !important;
  }
  
  #myPerformanceModal select {
    padding: 6px 8px !important;
    font-size: 12px !important;
  }
  
  /* 차트 영역 */
  #myPerformanceModal .modal-body > div:nth-child(2) {
    height: 120px !important;
    margin-bottom: 12px !important;
  }
  
  /* 요약 카드 */
  #myPerformanceModal .modal-body > div:nth-child(3) {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
    margin-bottom: 12px !important;
  }
  
  #myPerformanceModal .modal-body > div:nth-child(3) > div {
    flex: 1 1 calc(33.33% - 6px) !important;
    min-width: 80px !important;
    padding: 8px 4px !important;
  }
  
  #myPerformanceModal .modal-body > div:nth-child(3) > div > div:first-child {
    font-size: 9px !important;
  }
  
  #myPerformanceModal .modal-body > div:nth-child(3) > div > div:last-child {
    font-size: 12px !important;
  }
  
  /* 상세 내역 목록 */
  #myPerfListContainer {
    max-height: 200px !important;
    font-size: 10px !important;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  #myPerfListContainer > div:first-child,
  #myPerfCompletionBody > div {
    min-width: 420px;
  }
  
  #myPerfListContainer > div:first-child > div,
  #myPerfCompletionBody > div > div {
    padding: 5px 3px !important;
  }
  
  #myPerformanceModal h4 {
    font-size: 12px !important;
    margin-bottom: 6px !important;
  }
  
  #myPerformanceModal .modal-footer {
    padding: 12px 16px !important;
    flex-shrink: 0;
  }
  
  #myPerformanceModal .modal-footer button {
    padding: 10px 20px;
    font-size: 14px;
  }
}

@media (max-width: 480px) {
  #myPerformanceModal {
    padding: 10px !important;
    align-items: center !important;
    justify-content: center !important;
  }
  
  #myPerformanceModal .modal-content {
    width: calc(100vw - 20px) !important;
    max-width: calc(100vw - 20px) !important;
    max-height: calc(100vh - 20px) !important;
    margin: auto !important;
    border-radius: 10px !important;
  }
  
  #myPerformanceModal .modal-header {
    padding: 10px 14px !important;
    position: relative;
  }
  
  #myPerformanceModal .modal-header h2 {
    font-size: 15px !important;
    padding-right: 30px;
  }
  
  #myPerformanceModal .modal-close {
    font-size: 22px !important;
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
  }
  
  #myPerformanceModal .modal-body {
    padding: 10px !important;
  }
  
  /* 기간 선택 */
  #myPerformanceModal .modal-body > div:first-child {
    flex-wrap: wrap !important;
    gap: 4px !important;
  }
  
  #myPerformanceModal select {
    padding: 5px 6px !important;
    font-size: 11px !important;
  }
  
  /* 차트 영역 */
  #myPerformanceModal .modal-body > div:nth-child(2) {
    height: 100px !important;
    margin-bottom: 10px !important;
  }
  
  /* 요약 카드 - 2행 3열 배치 */
  #myPerformanceModal .modal-body > div:nth-child(3) {
    gap: 4px !important;
    margin-bottom: 10px !important;
  }
  
  #myPerformanceModal .modal-body > div:nth-child(3) > div {
    flex: 1 1 calc(33.33% - 4px) !important;
    min-width: 70px !important;
    padding: 6px 3px !important;
  }
  
  #myPerformanceModal .modal-body > div:nth-child(3) > div > div:first-child {
    font-size: 8px !important;
  }
  
  #myPerformanceModal .modal-body > div:nth-child(3) > div > div:last-child {
    font-size: 11px !important;
  }
  
  /* 상세 내역 목록 */
  #myPerfListContainer {
    max-height: 160px !important;
    font-size: 9px !important;
  }
  
  #myPerfListContainer > div:first-child,
  #myPerfCompletionBody > div {
    min-width: 380px;
  }
  
  #myPerfListContainer > div:first-child > div,
  #myPerfCompletionBody > div > div {
    padding: 4px 2px !important;
  }
  
  #myPerformanceModal .modal-footer {
    padding: 10px 14px !important;
  }
  
  #myPerformanceModal .modal-footer button {
    width: 100%;
    padding: 10px;
    font-size: 13px;
  }
}

/* ====== 요약 모달 모바일 반응형 ====== */
@media (max-width: 768px) {
  .summary-modal-content {
    width: 95vw !important;
    min-width: unset !important;
    max-width: 95vw;
    max-height: 85vh;
    margin: 10px;
  }
  
  .summary-modal-header {
    padding: 12px 16px;
  }
  
  .summary-modal-header h3 {
    font-size: 16px;
  }
  
  .summary-modal-body {
    padding: 12px;
  }
  
  .summary-customer-info {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  .summary-customer-table {
    font-size: 11px;
    min-width: 400px;
  }
  
  .summary-customer-table th,
  .summary-customer-table td {
    padding: 6px 8px;
  }
  
  .summary-textarea {
    min-width: unset !important;
    width: 100% !important;
    min-height: 250px;
    font-size: 12px;
    line-height: 1.5;
  }
  
  .summary-modal-footer {
    padding: 12px 16px;
    flex-wrap: wrap;
    justify-content: center;
  }
  
  .summary-modal-footer button {
    flex: 1;
    min-width: 70px;
    padding: 10px 12px;
  }
}

@media (max-width: 480px) {
  .summary-modal-content {
    width: 95vw !important;
    max-width: 95vw;
    max-height: 85vh;
    margin: 10px;
    border-radius: 12px;
  }
  
  .summary-modal-header {
    padding: 14px 16px;
  }
  
  .summary-modal-header h3 {
    font-size: 15px;
  }
  
  .summary-modal-close {
    font-size: 28px;
    padding: 4px 8px;
  }
  
  .summary-customer-table {
    font-size: 10px;
    min-width: 350px;
  }
  
  .summary-customer-table th,
  .summary-customer-table td {
    padding: 5px 6px;
  }
  
  .summary-textarea {
    min-height: 200px;
    font-size: 11px;
  }
  
  .summary-modal-footer {
    gap: 8px;
  }
  
  .summary-modal-footer button {
    font-size: 13px;
    padding: 12px 10px;
  }
}

/* ========================================
   등기 파싱 로딩 오버레이
   ======================================== */
.registry-loading-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 99999;
  justify-content: center;
  align-items: center;
}

.registry-loading-overlay.show {
  display: flex;
}

.registry-loading-content {
  background: var(--bg-secondary);
  padding: 40px 60px;
  border-radius: var(--radius-xl);
  text-align: center;
  box-shadow: var(--shadow-lg);
}

.registry-loading-spinner {
  width: 50px;
  height: 50px;
  border: 4px solid var(--border-color);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: registrySpinner 1s linear infinite;
  margin: 0 auto 20px;
}

@keyframes registrySpinner {
  to {
    transform: rotate(360deg);
  }
}

.registry-loading-text {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.registry-loading-subtext {
  font-size: 14px;
  color: var(--text-secondary);
}

/* 다크모드 */
[data-theme="dark"] .registry-loading-overlay {
  background: rgba(0, 0, 0, 0.8);
}

[data-theme="dark"] .registry-loading-content {
  background: var(--bg-secondary);
}

/* ========================================
   다중등록 모달 스타일
   ======================================== */
.bulk-register-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.bulk-register-modal.show {
  display: flex;
}

.bulk-modal-content {
  position: relative;
  max-width: 800px;
  max-height: 85vh;
  width: 90%;
  background: var(--bg-secondary);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.btn-bulk-register {
  margin-left: 8px;
  padding: 6px 12px !important;
  font-size: 0.85rem !important;
  white-space: nowrap;
  background: #6366f1;
  color: white;
  border: none;
}

.btn-bulk-register:hover {
  background: #4f46e5;
}

/* 다중등록 로딩 오버레이 */
.bulk-loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.9);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  z-index: 100;
  border-radius: 16px;
}

.bulk-loading-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid #e5e7eb;
  border-top-color: #6366f1;
  border-radius: 50%;
  animation: bulkSpin 1s linear infinite;
}

@keyframes bulkSpin {
  to { transform: rotate(360deg); }
}

.bulk-loading-text {
  font-size: 1rem;
  color: #374151;
  font-weight: 500;
}

.bulk-upload-area {
  border: 2px dashed #d1d5db;
  border-radius: 12px;
  padding: 40px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  background: #f9fafb;
}

.bulk-upload-area:hover,
.bulk-upload-area.drag-over {
  border-color: #6366f1;
  background: #eef2ff;
}

/* 컴팩트 모드 (파일 업로드 후) */
.bulk-upload-area.compact {
  padding: 16px 20px;
  margin-top: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: center;
}

.bulk-upload-area.compact .bulk-upload-icon {
  font-size: 24px;
  margin-bottom: 0;
}

.bulk-upload-area.compact .bulk-upload-text {
  font-size: 14px;
  margin-bottom: 0;
}

.bulk-upload-area.compact .bulk-upload-hint {
  display: none;
}

.bulk-upload-icon {
  font-size: 48px;
  margin-bottom: 12px;
}

.bulk-upload-text {
  font-size: 16px;
  color: #374151;
  margin-bottom: 8px;
}

.bulk-upload-hint {
  font-size: 13px;
  color: #9ca3af;
}

.bulk-file-list {
  margin-top: 20px;
}

.bulk-file-list h4 {
  font-size: 14px;
  color: #374151;
  margin-bottom: 12px;
}

.bulk-file-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  margin-bottom: 10px;
}

.bulk-file-info {
  flex: 1;
  min-width: 0;
}

.bulk-file-name {
  font-size: 14px;
  font-weight: 500;
  color: #111827;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bulk-file-count {
  font-size: 12px;
  color: #6b7280;
  margin-top: 2px;
}

.bulk-file-count strong {
  color: #2563eb;
}

.bulk-file-stats {
  display: block;
  font-size: 11px;
  color: #f59e0b;
  margin-top: 2px;
}

.bulk-file-staff {
  width: 140px;
}

.bulk-file-staff select {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 13px;
  background: white;
}

.bulk-file-ad {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #374151;
  white-space: nowrap;
}

.bulk-file-ad input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.bulk-file-remove {
  background: none;
  border: none;
  color: #9ca3af;
  cursor: pointer;
  padding: 4px;
  font-size: 18px;
  line-height: 1;
  transition: color 0.2s;
}

.bulk-file-remove:hover {
  color: #ef4444;
}

.bulk-file-add {
  margin-top: 12px;
  text-align: center;
}

.bulk-summary {
  display: flex;
  gap: 24px;
  justify-content: center;
  margin-top: 20px;
  padding: 16px;
  background: #eef2ff;
  border-radius: 8px;
}

.bulk-summary-item {
  font-size: 14px;
  color: #4f46e5;
}

.bulk-summary-item strong {
  font-size: 18px;
  margin: 0 4px;
}

/* 다크모드 */
[data-theme="dark"] .bulk-upload-area {
  background: var(--bg-secondary);
  border-color: var(--border-color);
}

[data-theme="dark"] .bulk-upload-area:hover,
[data-theme="dark"] .bulk-upload-area.drag-over {
  border-color: #818cf8;
  background: rgba(99, 102, 241, 0.1);
}

[data-theme="dark"] .bulk-upload-text {
  color: var(--text-primary);
}

[data-theme="dark"] .bulk-file-item {
  background: var(--bg-secondary);
  border-color: var(--border-color);
}

[data-theme="dark"] .bulk-file-name {
  color: var(--text-primary);
}

[data-theme="dark"] .bulk-file-staff select {
  background: var(--bg-secondary);
  border-color: var(--border-color);
  color: var(--text-primary);
}

[data-theme="dark"] .bulk-file-ad {
  color: var(--text-primary);
}

[data-theme="dark"] .bulk-summary {
  background: rgba(99, 102, 241, 0.15);
}

/* ==================== 기존 고객 섹션 스타일 ==================== */
.bulk-existing-section {
  margin-top: 16px;
  padding: 16px;
  background: linear-gradient(135deg, #faf5ff 0%, #f5f0ff 100%);
  border: 1px solid #e9d5ff;
  border-radius: 12px;
}

.bulk-existing-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.bulk-existing-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: #7c3aed;
}

.existing-icon {
  font-size: 18px;
}

.existing-count {
  font-size: 13px;
  font-weight: 400;
  color: #8b5cf6;
}

.bulk-existing-list {
  max-height: 200px;
  overflow-y: auto;
  background: white;
  border: 1px solid #e9d5ff;
  border-radius: 8px;
  margin-bottom: 12px;
}

.bulk-existing-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid #f3e8ff;
  font-size: 14px;
}

.bulk-existing-item:last-child {
  border-bottom: none;
}

.bulk-existing-item.is-public {
  background: #faf5ff;
  color: #9333ea;
}

.bulk-existing-item .existing-name {
  font-weight: 500;
  min-width: 80px;
}

.bulk-existing-item .existing-phone {
  color: #6b7280;
  min-width: 110px;
}

.bulk-existing-item .existing-staff {
  color: #8b5cf6;
  font-size: 13px;
}

.bulk-existing-action {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.bulk-move-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 14px;
  color: #374151;
}

.bulk-move-checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #9c27b0;
  cursor: pointer;
}

.bulk-move-hint {
  font-size: 12px;
  color: #9ca3af;
  margin-left: 26px;
}

/* 다크모드 - 기존 고객 섹션 */
[data-theme="dark"] .bulk-existing-section {
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.15) 0%, rgba(139, 92, 246, 0.1) 100%);
  border-color: rgba(139, 92, 246, 0.3);
}

[data-theme="dark"] .bulk-existing-title {
  color: #a78bfa;
}

[data-theme="dark"] .existing-count {
  color: #c4b5fd;
}

[data-theme="dark"] .bulk-existing-list {
  background: var(--bg-secondary);
  border-color: rgba(139, 92, 246, 0.3);
}

[data-theme="dark"] .bulk-existing-item {
  border-bottom-color: rgba(139, 92, 246, 0.2);
}

[data-theme="dark"] .bulk-existing-item.is-public {
  background: rgba(147, 51, 234, 0.15);
  color: #c4b5fd;
}

[data-theme="dark"] .bulk-existing-item .existing-name {
  color: var(--text-primary);
}

[data-theme="dark"] .bulk-existing-item .existing-phone {
  color: var(--text-secondary);
}

[data-theme="dark"] .bulk-existing-item .existing-staff {
  color: #c4b5fd;
}

[data-theme="dark"] .bulk-move-checkbox {
  color: var(--text-primary);
}

[data-theme="dark"] .bulk-move-hint {
  color: var(--text-secondary);
}

/* ==================== 다중등록 조건등록 모드 스타일 ==================== */
/* 모드 탭 스타일 */
.bulk-existing-mode-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 12px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #e9d5ff;
}

.bulk-mode-tab {
  flex: 1;
  padding: 10px 16px;
  background: white;
  border: none;
  font-size: 14px;
  font-weight: 500;
  color: #6b7280;
  cursor: pointer;
  transition: all 0.2s;
}

.bulk-mode-tab:first-child {
  border-right: 1px solid #e9d5ff;
}

.bulk-mode-tab:hover {
  background: #faf5ff;
  color: #7c3aed;
}

.bulk-mode-tab.active {
  background: linear-gradient(135deg, #9333ea 0%, #7c3aed 100%);
  color: white;
}

/* 조건등록 그룹 스타일 */
.bulk-conditional-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.bulk-conditional-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: white;
  border: 1px solid #e9d5ff;
  border-radius: 8px;
}

.bulk-conditional-label {
  min-width: 150px;
  font-size: 14px;
  font-weight: 500;
  color: #374151;
  display: flex;
  align-items: center;
  gap: 8px;
}

.count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 20px;
  padding: 0 6px;
  background: #e9d5ff;
  color: #7c3aed;
  font-size: 12px;
  font-weight: 600;
  border-radius: 10px;
}

.bulk-conditional-select {
  padding: 8px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
  color: #374151;
  background: white;
  cursor: pointer;
  min-width: 160px;
}

.bulk-conditional-select:focus {
  outline: none;
  border-color: #9333ea;
  box-shadow: 0 0 0 2px rgba(147, 51, 234, 0.2);
}

.bulk-staff-select {
  padding: 8px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
  color: #374151;
  background: white;
  cursor: pointer;
  min-width: 140px;
}

.bulk-staff-select:focus {
  outline: none;
  border-color: #9333ea;
  box-shadow: 0 0 0 2px rgba(147, 51, 234, 0.2);
}

.bulk-conditional-ad-checkbox {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #6b7280;
  cursor: pointer;
  margin-left: auto;
}

.bulk-conditional-ad-checkbox input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #9333ea;
  cursor: pointer;
}

/* 다크모드 - 조건등록 */
[data-theme="dark"] .bulk-existing-mode-tabs {
  border-color: rgba(139, 92, 246, 0.3);
}

[data-theme="dark"] .bulk-mode-tab {
  background: var(--bg-secondary);
  color: var(--text-secondary);
}

[data-theme="dark"] .bulk-mode-tab:first-child {
  border-right-color: rgba(139, 92, 246, 0.3);
}

[data-theme="dark"] .bulk-mode-tab:hover {
  background: rgba(139, 92, 246, 0.15);
  color: #a78bfa;
}

[data-theme="dark"] .bulk-mode-tab.active {
  background: linear-gradient(135deg, #9333ea 0%, #7c3aed 100%);
  color: white;
}

[data-theme="dark"] .bulk-conditional-row {
  background: var(--bg-secondary);
  border-color: rgba(139, 92, 246, 0.3);
}

[data-theme="dark"] .bulk-conditional-label {
  color: var(--text-primary);
}

[data-theme="dark"] .count-badge {
  background: rgba(139, 92, 246, 0.3);
  color: #c4b5fd;
}

[data-theme="dark"] .bulk-conditional-select,
[data-theme="dark"] .bulk-staff-select {
  background: var(--bg-primary);
  border-color: var(--border-color);
  color: var(--text-primary);
}

[data-theme="dark"] .bulk-conditional-ad-checkbox {
  color: var(--text-secondary);
}

/* ==================== 공지사항 모달 스타일 ==================== */
/* 모달 오버레이 기본 스타일 */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-overlay.hidden {
  display: none;
}

.modal-box {
  background: #fff;
  border-radius: 12px;
  width: 100%;
  max-width: 500px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid #e9ecef;
  flex-shrink: 0;
}

.modal-header h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0;
  color: #333;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #999;
  padding: 0;
  line-height: 1;
  transition: color 0.15s;
}

.modal-close:hover {
  color: #333;
}

.modal-body {
  padding: 16px 20px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 12px 20px;
  border-top: 1px solid #e9ecef;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-shrink: 0;
}

/* 공지사항 모달 - 리스트/상세 레이아웃 */
.announcement-modal-box {
  max-width: 900px;
  width: 95%;
  max-height: 85vh;
}

.announcement-modal-body {
  padding: 0;
  overflow: hidden;
}

.announcement-layout {
  display: flex;
  height: 60vh;
  max-height: 500px;
}

/* 왼쪽 사이드바 (리스트) */
.announcement-sidebar {
  width: 280px;
  min-width: 280px;
  border-right: 1px solid #e9ecef;
  background: #f8f9fa;
  display: flex;
  flex-direction: column;
}

.announcement-list-container {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}

/* 리스트 아이템 */
.announcement-list-item {
  padding: 12px 14px;
  border-radius: 8px;
  cursor: pointer;
  margin-bottom: 6px;
  background: #fff;
  border: 1px solid #e9ecef;
  transition: all 0.15s ease;
}

.announcement-list-item:last-child {
  margin-bottom: 0;
}

.announcement-list-item:hover {
  background: #f0f4f8;
  border-color: #d0d7de;
}

.announcement-list-item.selected {
  background: #e8f4fd;
  border-color: #4a90d9;
  box-shadow: 0 0 0 1px #4a90d9;
}

.announcement-list-item.important {
  border-left: 3px solid #dc3545;
}

.announcement-list-item.important.selected {
  border-left: 3px solid #dc3545;
}

.announcement-list-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.announcement-badge-important {
  font-size: 0.65rem;
  font-weight: 600;
  color: #fff;
  background: #dc3545;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
}

.announcement-list-date {
  font-size: 0.72rem;
  color: #888;
}

.announcement-list-title {
  font-size: 0.85rem;
  font-weight: 500;
  color: #333;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* 오른쪽 상세 영역 */
.announcement-detail {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #fff;
  overflow: hidden;
}

.announcement-detail-container {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
}

.announcement-detail-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #888;
  font-size: 0.9rem;
}

.announcement-detail-header {
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid #e9ecef;
}

.announcement-detail-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.announcement-detail-badge {
  font-size: 0.7rem;
  font-weight: 600;
  color: #fff;
  background: #dc3545;
  padding: 3px 8px;
  border-radius: 4px;
  flex-shrink: 0;
}

.announcement-detail-title {
  font-size: 1.15rem;
  font-weight: 600;
  color: #333;
  margin: 0;
  line-height: 1.4;
}

.announcement-detail-date {
  font-size: 0.8rem;
  color: #888;
}

.announcement-detail-content {
  padding-top: 4px;
}

.announcement-detail-content pre {
  font-size: 0.9rem;
  color: #444;
  line-height: 1.7;
  white-space: pre-wrap;
  word-wrap: break-word;
  margin: 0;
  font-family: inherit;
}

.no-announcements {
  text-align: center;
  color: #888;
  padding: 40px 20px;
  font-size: 0.9rem;
}

/* 반응형 - 모바일 */
@media (max-width: 768px) {
  .announcement-modal-box {
    max-width: 100%;
    width: 100%;
    height: 100%;
    max-height: 100vh;
    border-radius: 0;
  }
  
  .announcement-layout {
    flex-direction: column;
    height: calc(100vh - 130px);
    max-height: none;
  }
  
  .announcement-sidebar {
    width: 100%;
    min-width: 100%;
    height: 40%;
    border-right: none;
    border-bottom: 1px solid #e9ecef;
  }
  
  .announcement-detail {
    height: 60%;
  }
  
  .announcement-list-container {
    max-height: none;
  }
}

/* 다크모드 공지사항 */
[data-theme="dark"] .modal-overlay {
  background: rgba(0, 0, 0, 0.7);
}

[data-theme="dark"] .modal-box {
  background: var(--bg-primary);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .modal-header {
  border-bottom-color: var(--border-color);
}

[data-theme="dark"] .modal-header h3 {
  color: var(--text-primary);
}

[data-theme="dark"] .modal-close {
  color: var(--text-secondary);
}

[data-theme="dark"] .modal-close:hover {
  color: var(--text-primary);
}

[data-theme="dark"] .modal-footer {
  border-top-color: var(--border-color);
}

/* 다크모드 - 공지사항 사이드바/리스트 */
[data-theme="dark"] .announcement-sidebar {
  background: var(--bg-secondary);
  border-right-color: var(--border-color);
}

[data-theme="dark"] .announcement-list-item {
  background: var(--bg-primary);
  border-color: var(--border-color);
}

[data-theme="dark"] .announcement-list-item:hover {
  background: var(--bg-hover);
  border-color: var(--border-color-hover);
}

[data-theme="dark"] .announcement-list-item.selected {
  background: rgba(74, 144, 217, 0.15);
  border-color: #4a90d9;
}

[data-theme="dark"] .announcement-list-item.important {
  border-left-color: #dc3545;
}

[data-theme="dark"] .announcement-list-date {
  color: var(--text-muted);
}

[data-theme="dark"] .announcement-list-title {
  color: var(--text-primary);
}

/* 다크모드 - 공지사항 상세 */
[data-theme="dark"] .announcement-detail {
  background: var(--bg-primary);
}

[data-theme="dark"] .announcement-detail-header {
  border-bottom-color: var(--border-color);
}

[data-theme="dark"] .announcement-detail-title {
  color: var(--text-primary);
}

[data-theme="dark"] .announcement-detail-date {
  color: var(--text-muted);
}

[data-theme="dark"] .announcement-detail-content pre {
  color: var(--text-secondary);
}

[data-theme="dark"] .announcement-detail-empty {
  color: var(--text-muted);
}

[data-theme="dark"] .no-announcements {
  color: var(--text-muted);
}

[data-theme="dark"] .btn-announcement-link {
  border-color: var(--border-color);
  color: var(--text-secondary);
}

[data-theme="dark"] .btn-announcement-link:hover {
  background: rgba(255, 193, 7, 0.2);
  border-color: #ffc107;
  color: #ffc107;
}

/* ==========================================
   KB 부동산 상세 패널 - 모달 뒤에서 펼쳐짐
   ========================================== */

/* KB 패널 (모달 오른쪽에서 슬라이드 아웃) */
/* KB 패널 클립 컨테이너 - 모달 뒤로 들어가는 효과를 위한 overflow hidden */
.kb-panel-clip-container {
  position: fixed;
  top: 10vh;
  left: calc(50% + 350px); /* 모달(max-width:700px) 오른쪽 가장자리 */
  width: 400px;
  height: 80vh;
  overflow: hidden; /* 패널이 왼쪽(모달 방향)으로 넘어가면 안 보임 */
  z-index: 1001; /* 모달(1000) 위 */
  pointer-events: none; /* 컨테이너 자체는 클릭 통과 */
  display: none; /* 기본 숨김 */
}

.kb-panel-clip-container.active {
  display: block;
}

.kb-panel {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #fff;
  box-shadow: -4px 0 30px rgba(0, 0, 0, 0.3);
  display: flex !important; /* 항상 flex - 다른 규칙에 의해 none으로 변경되지 않도록 */
  flex-direction: column;
  border-radius: 0 12px 12px 0;
  pointer-events: auto; /* 패널은 클릭 가능 */
  /* 슬라이드 애니메이션 - 왼쪽(모달 방향)으로 이동하면 컨테이너에 의해 잘려서 숨겨짐 */
  transform: translateX(-100%); /* 기본: 왼쪽으로 숨김 (모달 뒤로) */
  transition: transform 0.35s ease-out;
}

/* 패널 표시 상태 */
.kb-panel.visible {
  transform: translateX(0); /* 보임 */
}

/* 패널 숨김 상태 (애니메이션 용) */
.kb-panel.hidden {
  transform: translateX(-100%); /* 왼쪽(모달 방향)으로 숨김 */
}

/* 펼치기 탭 (body에 직접 배치, 패널보다 항상 위에 표시) */
.kb-expand-tab {
  position: fixed;
  /* top, left는 JS에서 동적으로 계산 */
  top: 50vh;
  left: calc(50% + 350px - 24px); /* 모달 오른쪽 가장자리 */
  transform: translateY(-50%);
  display: none; /* 기본 숨김, 시세조회 완료시 표시 */
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 60px;
  background: linear-gradient(135deg, #0066cc, #0052a3);
  color: white;
  cursor: pointer;
  border-radius: 0 8px 8px 0;
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.15);
  z-index: 1002; /* 패널 컨테이너(1001)보다 위에 표시 */
  font-size: 1rem;
  /* transition 제거: 창 크기 변경 시 모달과 동시에 이동 */
  transition: background 0.2s, width 0.2s;
}

.kb-expand-tab:hover {
  background: linear-gradient(135deg, #0052a3, #003d7a);
  width: 28px;
}

.kb-expand-tab.active {
  background: linear-gradient(135deg, #ff6600, #e65c00);
}

/* 화살표 방향: 닫힘=>, 열림=< */
.kb-expand-tab.active .kb-tab-arrow {
  transform: scaleX(-1); /* 화살표 반전 */
}

.kb-tab-arrow {
  display: block;
  transition: transform 0.3s;
}

.kb-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: linear-gradient(135deg, #0066cc, #0052a3);
  color: white;
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: 0 12px 0 0;
}

.kb-panel-buttons {
  display: flex;
  gap: 8px;
}

.kb-panel-new-window,
.kb-panel-close {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  width: 28px;
  height: 28px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.kb-panel-new-window:hover,
.kb-panel-close:hover {
  background: rgba(255, 255, 255, 0.3);
}

.kb-panel-content {
  flex: 1;
  overflow: hidden;
  position: relative;
  border-radius: 0 0 12px 0;
}

.kb-panel-loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: #666;
}

.kb-panel-loading .loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #e0e0e0;
  border-top-color: #0066cc;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* 모바일 반응형 */
@media (max-width: 768px) {
  .kb-panel-clip-container {
    display: none !important; /* 모바일에서는 KB 패널 숨김 */
  }
  
  .kb-expand-tab {
    display: none !important;
  }
}

/* 더 작은 화면에서 모달이 90%일 때 */
@media (max-width: 1200px) {
  .kb-panel-clip-container {
    left: auto;
    right: 10px; /* 화면 오른쪽에 붙임 */
    width: 380px;
  }
  
  .kb-expand-tab {
    left: auto;
    right: calc(10px + 380px); /* 패널 왼쪽에 배치 */
  }
}

/* 다크모드 */
[data-theme="dark"] .kb-panel {
  background: #1e1e1e;
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .kb-panel-header {
  background: linear-gradient(135deg, #1a4a7a, #0d3a5c);
}

[data-theme="dark"] .kb-panel-loading {
  color: #aaa;
}

[data-theme="dark"] .kb-panel-loading .loading-spinner {
  border-color: #444;
  border-top-color: #5599dd;
}

[data-theme="dark"] .kb-expand-tab {
  background: linear-gradient(135deg, #1a4a7a, #0d3a5c);
}

[data-theme="dark"] .kb-expand-tab:hover {
  background: linear-gradient(135deg, #0d3a5c, #082a4a);
}

/* 진행상태 일괄 변경 팝업 */
.bulk-status-popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
}

.bulk-status-popup-content {
  background: white;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  min-width: 320px;
  max-width: 90%;
}

.bulk-status-popup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid #eee;
}

.bulk-status-popup-header h4 {
  margin: 0;
  font-size: 18px;
  color: #333;
}

.bulk-status-close-btn {
  background: none;
  border: none;
  font-size: 24px;
  color: #999;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.bulk-status-close-btn:hover {
  color: #333;
}

.bulk-status-info {
  padding: 12px 20px;
  margin: 0;
  color: #666;
  font-size: 14px;
  border-bottom: 1px solid #eee;
}

.bulk-status-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  padding: 20px;
}

.bulk-status-option {
  padding: 12px 16px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  background: #fff;
  font-size: 14px;
  font-weight: 500;
  color: #333;
  cursor: pointer;
  transition: all 0.2s ease;
}

.bulk-status-option:hover {
  border-color: #4a90d9;
  background: #f0f7ff;
  color: #4a90d9;
}

.bulk-status-option:active {
  transform: scale(0.98);
}

/* 다크모드 */
[data-theme="dark"] .bulk-status-popup-content {
  background: #2a2a2a;
  border: 1px solid #444;
}

[data-theme="dark"] .bulk-status-popup-header {
  border-bottom-color: #444;
}

[data-theme="dark"] .bulk-status-popup-header h4 {
  color: #eee;
}

[data-theme="dark"] .bulk-status-close-btn {
  color: #888;
}

[data-theme="dark"] .bulk-status-close-btn:hover {
  color: #eee;
}

[data-theme="dark"] .bulk-status-info {
  color: #aaa;
  border-bottom-color: #444;
}

[data-theme="dark"] .bulk-status-option {
  background: #333;
  border-color: #555;
  color: #ddd;
}

[data-theme="dark"] .bulk-status-option:hover {
  border-color: #5599dd;
  background: #3a4a5a;
  color: #5599dd;
}

/* 탭 컨텍스트 메뉴 (관리자용 엑셀 다운로드) */
.tab-context-menu {
  position: fixed;
  background: white;
  border: 1px solid #ddd;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  z-index: 10000;
  min-width: 160px;
  padding: 4px 0;
}

.tab-context-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  cursor: pointer;
  font-size: 0.9rem;
  color: #333;
  transition: background-color 0.15s;
}

.tab-context-menu-item:hover {
  background-color: #f0f0f0;
}

.tab-context-menu-item .menu-icon {
  font-size: 1rem;
}

[data-theme="dark"] .tab-context-menu {
  background: #2a2a2a;
  border-color: #444;
}

[data-theme="dark"] .tab-context-menu-item {
  color: #ddd;
}

[data-theme="dark"] .tab-context-menu-item:hover {
  background-color: #3a3a3a;
}

/* ========== 일괄 작업 드롭다운 ========== */
.bulk-actions-dropdown {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.bulk-actions-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: 0.8rem;
}

.bulk-actions-toggle .dropdown-arrow {
  font-size: 0.6rem;
  transition: transform 0.2s;
}

.bulk-actions-dropdown.open .dropdown-arrow {
  transform: rotate(180deg);
}

/* 일괄 작업 선택 해제 버튼 (X) */
.bulk-actions-clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  font-size: 1rem;
  font-weight: bold;
  color: #666;
  background: #f0f0f0;
  border: 1px solid #ccc;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.15s;
}

.bulk-actions-clear:hover {
  background: #e74c3c;
  color: #fff;
  border-color: #e74c3c;
}

.bulk-actions-menu {
  position: absolute;
  top: 100%;
  right: 0;
  min-width: 180px;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  z-index: 1000;
  overflow: hidden;
  margin-top: 4px;
}

.bulk-action-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 14px;
  border: none;
  background: none;
  font-size: 0.85rem;
  color: #333;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s;
}

.bulk-action-item:hover {
  background: #f5f5f5;
}

.bulk-action-item.bulk-action-danger {
  color: #dc3545;
}

.bulk-action-item.bulk-action-danger:hover {
  background: #fdf0f0;
}

.bulk-action-item.bulk-action-warning {
  color: #856404;
}

.bulk-action-item.bulk-action-warning:hover {
  background: #fff8e6;
}

.bulk-action-divider {
  height: 1px;
  background: #eee;
  margin: 4px 0;
}

/* 다크모드 */
[data-theme="dark"] .bulk-actions-menu {
  background: #2a2a2a;
  border-color: #444;
}

[data-theme="dark"] .bulk-action-item {
  color: #ddd;
}

[data-theme="dark"] .bulk-action-item:hover {
  background: #3a3a3a;
}

[data-theme="dark"] .bulk-action-item.bulk-action-danger {
  color: #ff6b6b;
}

[data-theme="dark"] .bulk-action-item.bulk-action-danger:hover {
  background: #3a2a2a;
}

[data-theme="dark"] .bulk-action-item.bulk-action-warning {
  color: #ffc107;
}

/* ========== 시세관리 모달 스타일 ========== */
.price-mgmt-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
}

.price-mgmt-modal {
  background: white;
  border-radius: 12px;
  width: 80%;
  height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.price-mgmt-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid #e0e4e8;
}

.price-mgmt-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #333;
}

.price-mgmt-close {
  background: none;
  border: none;
  font-size: 24px;
  color: #666;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.price-mgmt-close:hover {
  color: #333;
}

.price-mgmt-tabs {
  display: flex;
  border-bottom: 1px solid #e0e4e8;
  padding: 0 20px;
}

.price-mgmt-tab {
  background: none;
  border: none;
  padding: 12px 24px;
  font-size: 14px;
  color: #666;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all 0.2s;
}

.price-mgmt-tab:hover {
  color: #333;
}

.price-mgmt-tab.active {
  color: #7c4dff;
  border-bottom-color: #7c4dff;
  font-weight: 600;
}

.price-mgmt-body {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 16px 20px;
}

.price-mgmt-progress {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 16px;
}

.progress-bar-container {
  background: #e0e4e8;
  border-radius: 4px;
  height: 8px;
  overflow: hidden;
  margin-bottom: 8px;
}

.progress-bar {
  background: linear-gradient(135deg, #7c4dff, #651fff);
  height: 100%;
  width: 0%;
  transition: width 0.3s ease;
}

.progress-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: #666;
}

.price-mgmt-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 10px;
}

.price-mgmt-controls-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.price-mgmt-controls .checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #555;
  cursor: pointer;
}

/* 기간별 자동 선택 버튼 */
.price-mgmt-period-btns {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.price-mgmt-period-btns .period-label {
  font-size: 13px;
  color: #555;
  font-weight: 500;
}

.price-mgmt-period-btns .btn-period {
  padding: 6px 14px;
  font-size: 12px;
  background: #f0f0f0;
  border: 1px solid #ddd;
  border-radius: 4px;
  color: #555;
  cursor: pointer;
  transition: all 0.2s;
}

.price-mgmt-period-btns .btn-period:hover {
  background: #e0e0e0;
  border-color: #ccc;
}

.price-mgmt-period-btns .btn-period.active {
  background: #007bff;
  border-color: #007bff;
  color: #fff;
}

.price-mgmt-period-btns .btn-clear {
  background: #fff3e0;
  border-color: #ffcc80;
  color: #ef6c00;
}

.price-mgmt-period-btns .btn-clear:hover {
  background: #ffe0b2;
  border-color: #ffb74d;
}

.price-mgmt-info {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fff8e1;
  border: 1px solid #ffe082;
  border-radius: 6px;
  padding: 10px 14px;
  margin-bottom: 12px;
  font-size: 12px;
  color: #795548;
}

.price-mgmt-info .info-icon {
  font-size: 14px;
}

.price-mgmt-table-container {
  flex: 1;
  overflow: auto;
  border: 1px solid #e0e4e8;
  border-radius: 8px;
  /* 휠 클릭 스크롤 커서 */
  cursor: default;
}

.price-mgmt-table-container.wheel-scrolling {
  cursor: grabbing;
}

.price-mgmt-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  table-layout: auto;
}

.price-mgmt-table thead {
  position: sticky;
  top: 0;
  background: #f8f9fa;
  z-index: 1;
}

.price-mgmt-table th,
.price-mgmt-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid #e0e4e8;
}

/* 주소 컬럼은 줄바꿈 허용, 나머지는 nowrap */
.price-mgmt-table td:not(.price-address-cell) {
  white-space: nowrap;
}

.price-mgmt-table td.price-address-cell {
  white-space: normal;
  word-break: keep-all;
  min-width: 200px;
}

.price-mgmt-table th {
  font-weight: 600;
  color: #555;
  font-size: 12px;
  position: relative;
  user-select: none;
}

/* 컬럼 리사이즈 핸들 */
.price-mgmt-table th .resize-handle {
  position: absolute;
  right: 0;
  top: 0;
  width: 5px;
  height: 100%;
  cursor: col-resize;
  background: transparent;
}

.price-mgmt-table th .resize-handle:hover,
.price-mgmt-table th .resize-handle.resizing {
  background: #1a73e8;
}



.price-mgmt-table tbody tr:hover {
  background: #f8f9fa;
}

.price-mgmt-table input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

/* 진행여부 배지 */
.price-status-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 500;
}

.price-status-badge.pending {
  background: #fff3e0;
  color: #ef6c00;
}

.price-status-badge.in-progress {
  background: #e3f2fd;
  color: #1976d2;
}

.price-status-badge.completed {
  background: #e8f5e9;
  color: #388e3c;
}

/* 다크 모드 */
[data-theme="dark"] .price-mgmt-modal {
  background: #1e1e1e;
}

[data-theme="dark"] .price-mgmt-header {
  border-bottom-color: #333;
}

[data-theme="dark"] .price-mgmt-header h3 {
  color: #e0e0e0;
}

[data-theme="dark"] .price-mgmt-close {
  color: #aaa;
}

[data-theme="dark"] .price-mgmt-close:hover {
  color: #fff;
}

[data-theme="dark"] .price-mgmt-tabs {
  border-bottom-color: #333;
}

[data-theme="dark"] .price-mgmt-tab {
  color: #aaa;
}

[data-theme="dark"] .price-mgmt-tab:hover {
  color: #e0e0e0;
}

[data-theme="dark"] .price-mgmt-tab.active {
  color: #b39ddb;
  border-bottom-color: #b39ddb;
}

[data-theme="dark"] .price-mgmt-progress {
  background: #2a2a2a;
}

[data-theme="dark"] .progress-bar-container {
  background: #333;
}

[data-theme="dark"] .price-mgmt-controls .checkbox-label {
  color: #ccc;
}

[data-theme="dark"] .price-mgmt-table-container {
  border-color: #333;
}

[data-theme="dark"] .price-mgmt-table thead {
  background: #2a2a2a;
}

[data-theme="dark"] .price-mgmt-table th,
[data-theme="dark"] .price-mgmt-table td {
  border-bottom-color: #333;
}

[data-theme="dark"] .price-mgmt-table th {
  color: #bbb;
}

[data-theme="dark"] .price-mgmt-table th .resize-handle:hover,
[data-theme="dark"] .price-mgmt-table th .resize-handle.resizing {
  background: #4a9eff;
}

[data-theme="dark"] .price-mgmt-table tbody tr:hover {
  background: #2a2a2a;
}

[data-theme="dark"] .price-mgmt-table td {
  color: #e0e0e0;
}

[data-theme="dark"] .bulk-action-item.bulk-action-warning:hover {
  background: #3a3a2a;
}

[data-theme="dark"] .bulk-action-divider {
  background: #444;
}