/**
 * rental.css - 임대 상품 관리 페이지 전용 스타일
 * 노션 디자인 시스템 기반으로 리팩토링
 */

/* ===============================================
   페이지 타이틀 - 노션 스타일
   =============================================== */
.notion-page-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.notion-page-emoji {
  font-size: 24px;
  line-height: 1;
}

.notion-page-title h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  color: var(--notion-text-default, #37352f);
}

/* ===============================================
   폼 헤더 이모지 - 노션 스타일
   =============================================== */
.form-header-emoji {
  font-size: 18px;
  line-height: 1;
  margin-right: 4px;
}

.form-header h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 600;
  color: var(--notion-text-default, #37352f);
}

/* ===============================================
   섹션 타이틀 - 노션 스타일 (hourly-products와 동일)
   =============================================== */
.section-title {
  display: flex;
  align-items: center;
  gap: var(--notion-space-2, 8px);
  margin-bottom: var(--notion-space-4, 16px);
  padding-bottom: var(--notion-space-2, 8px);
}

.section-emoji {
  font-size: 1.25rem;
  line-height: 1;
}

.section-title h4 {
  font-size: var(--notion-text-lg, 16px);
  font-weight: var(--notion-font-semibold, 600);
  color: var(--notion-text-default, #37352f);
  margin: 0;
}

/* ===============================================
   테이블 헤더 - 노션 스타일
   =============================================== */
.table-header {
  display: flex;
  align-items: center;
  gap: var(--notion-space-3, 12px);
  padding: var(--notion-space-4, 16px) var(--notion-space-5, 20px);
  border-bottom: 1px solid var(--notion-border-light, #f1f1ef);
}

.table-emoji {
  font-size: 1.25rem;
  line-height: 1;
}

.table-title {
  font-size: var(--notion-text-lg, 16px);
  font-weight: var(--notion-font-semibold, 600);
  color: var(--notion-text-default, #37352f);
  margin: 0;
}

.table-count {
  font-size: var(--notion-text-sm, 13px);
  color: var(--notion-text-gray, #9b9a97);
  background: var(--notion-bg-gray, #f7f6f3);
  padding: var(--notion-space-1, 4px) var(--notion-space-2, 8px);
  border-radius: var(--notion-radius-full, 9999px);
}

/* ===============================================
   폼 푸터 스타일 - 노션 스타일
   =============================================== */
.form-footer {
  display: flex;
  gap: var(--notion-space-3, 12px);
  justify-content: flex-end;
  margin-top: var(--notion-space-5, 20px);
  padding-top: var(--notion-space-5, 20px);
  border-top: 1px solid var(--notion-border-light, #f1f1ef);
}

/* .page-title 스타일 제거됨 - .notion-page-title로 대체 */

/* 기본 폰트를 Pretendard로 설정 */
body, * {
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, Roboto, 'Helvetica Neue', 'Segoe UI', 'Apple SD Gothic Neo', 'Noto Sans KR', 'Malgun Gothic', 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', sans-serif;
}

/* syncle 로고 - Pretendard 폰트 사용 */
.sidebar-brand h1,
.sidebar-brand h1 a {
  font-weight: 700;
  letter-spacing: 0.5px;
}

/* New chat 버튼 - Pretendard 폰트 사용 */
.new-chat-btn span {
  font-weight: 600;
  letter-spacing: 0.3px;
}

/* Menu 헤더 - Pretendard 폰트 사용 */
.nav-section-header {
  text-transform: uppercase;
  font-size: var(--notion-text-xs, 11px);
  font-weight: 600;
  letter-spacing: 1px;
}

/* Profile 헤더 - Pretendard 폰트 사용 */
.profile-section .profile-header {
  text-transform: uppercase;
  font-size: var(--notion-text-sm, 12px);
  font-weight: 600;
  letter-spacing: 1px;
}

/* Log out 버튼 - Pretendard 폰트 사용 */
.logout-section .logout-btn span {
  font-weight: 600;
  letter-spacing: 0.5px;
}

/* ===============================================
   네이버 지도 관련 스타일 - 노션 스타일
   =============================================== */

/* 지도 컨테이너 스타일 */
#rentalMapContainer {
  position: relative;
  width: 100%;
  height: 400px;
  background: var(--notion-bg-gray-light, #fafafa);
  border: 1px solid var(--notion-border-default, #e9e9e7);
  border-radius: var(--notion-radius-lg, 8px);
  overflow: hidden;
}

#rentalMap {
  width: 100% !important;
  height: 100% !important;
  position: absolute;
  top: 0;
  left: 0;
}

.map-loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  z-index: 10;
  background: var(--notion-bg-default, #ffffff);
  padding: var(--notion-space-5, 20px);
  border-radius: var(--notion-radius-lg, 8px);
  box-shadow: var(--notion-shadow-lg, 0 10px 15px -3px rgba(0, 0, 0, 0.08));
}

.map-loading .spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--notion-border-default, #e9e9e7);
  border-top: 2px solid var(--notion-text-blue, #0b6e99);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 10px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.autocomplete-results {
  position: absolute;
  background: var(--notion-bg-default, #ffffff);
  border: 1px solid var(--notion-border-default, #e9e9e7);
  border-radius: var(--notion-radius-sm, 4px);
  max-height: 200px;
  overflow-y: auto;
  z-index: 1000;
}

.autocomplete-item {
  padding: var(--notion-space-2, 8px) var(--notion-space-3, 12px);
  cursor: pointer;
  border-bottom: 1px solid var(--notion-border-light, #f1f1ef);
  color: var(--notion-text-default, #37352f);
  font-size: var(--notion-text-base, 14px);
}

.autocomplete-item:hover {
  background-color: var(--notion-bg-gray, #f7f6f3);
}

/* ===============================================
   데스크탑 최대 화면 활용 (rental 전용)
   =============================================== */

@media (min-width: 1024px) {
  .table-container {
    max-width: none !important;
    width: 100% !important;
  }

  .data-table {
    max-width: none !important;
    width: 100% !important;
    table-layout: auto !important;
  }

  .page-content {
    max-width: none !important;
    width: 100% !important;
  }

  .action-bar {
    max-width: none !important;
    width: 100% !important;
  }
}

/* ===============================================
   미니멀 디자인 강제 적용 (rental 전용)
   =============================================== */

/* 모든 그림자 효과 완전 제거 (드롭다운 메뉴, 모달 제외) */
*:not(.status-dropdown-menu):not(.custom-modal):not(.custom-modal *):not(.modal-content):not(.modal-overlay):not(.toast):not(.toast-container):not(.toast *) {
  box-shadow: none !important;
}

/* 호버, 포커스 시에도 그림자 없음 (드롭다운 메뉴, 모달 제외) */
*:not(.status-dropdown-menu):not(.custom-modal):not(.custom-modal *):not(.modal-content):not(.toast):not(.toast *):hover,
*:not(.status-dropdown-menu):not(.custom-modal):not(.custom-modal *):not(.modal-content):not(.toast):not(.toast *):focus,
*:not(.status-dropdown-menu):not(.custom-modal):not(.custom-modal *):not(.modal-content):not(.toast):not(.toast *):active {
  box-shadow: none !important;
}

/* Transform 효과도 제거 (모달 제외) */
*:not(.custom-modal):not(.custom-modal *):not(.modal-content):not(.toast):not(.toast *):hover {
  transform: none !important;
}

/* 위치 입력 그룹 반응형 스타일 - 노션 스타일 */
.location-input-group {
  display: flex;
  gap: var(--notion-space-2, 8px);
  width: 100%;
}

.location-input-group .form-input {
  flex: 1;
  min-width: 0;
}

.location-input-group .location-select-btn {
  white-space: nowrap;
  flex-shrink: 0;
}

@media (max-width: 768px) {
  .location-input-group {
    flex-direction: column;
  }

  .location-input-group .location-select-btn {
    width: 100%;
  }
}

/* ===============================================
   테이블 컨테이너 - 노션 스타일
   =============================================== */

.table-container {
  border: 1px solid var(--notion-border-default, #e9e9e7) !important;
  border-radius: var(--notion-radius-lg, 8px);
  overflow-x: auto;
  overflow-y: visible;
  position: relative !important;
  z-index: 1 !important;
}

/* 테이블 헤더 배경 제거 - 노션 스타일 */
.table-container .data-table thead {
  background: transparent !important;
  background-color: transparent !important;
}

.table-container .data-table th {
  background: transparent !important;
  background-color: transparent !important;
  color: var(--notion-text-gray, #9b9a97);
  font-weight: var(--notion-font-medium, 500);
  font-size: var(--notion-text-sm, 13px);
  border-bottom: 1px solid var(--notion-border-light, #f1f1ef);
}

.table-actions {
  z-index: 1 !important;
  position: relative !important;
}

.btn-icon {
  z-index: 1 !important;
  position: relative !important;
}

/* 테이블과 드롭다운 z-index 강화 */
.data-table {
  position: relative !important;
  z-index: 1 !important;
  isolation: isolate !important;
}

.data-table tbody tr {
  position: relative !important;
}

.data-table tbody td {
  position: relative !important;
}

/* ===============================================
   인라인 폼 스타일 - 노션 스타일
   =============================================== */

.rental-form-container {
  background: var(--notion-bg-default, #ffffff);
  border: 1px solid var(--notion-border-default, #e9e9e7);
  border-radius: var(--notion-radius-lg, 8px);
  padding: var(--notion-space-5, 20px);
  margin-bottom: var(--notion-space-5, 20px);
  display: none;
}

.rental-form-container.show {
  display: block;
}

.form-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--notion-space-5, 20px);
  padding-bottom: var(--notion-space-4, 16px);
  border-bottom: 1px solid var(--notion-border-light, #f1f1ef);
}

.form-header h2,
.form-header h3 {
  margin: 0;
  color: var(--notion-text-default, #37352f);
  font-weight: var(--notion-font-semibold, 600);
}

.form-close-btn {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--notion-text-gray, #9b9a97);
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--notion-radius-sm, 4px);
  transition: all var(--notion-transition-fast, 0.1s ease);
}

.form-close-btn:hover {
  color: var(--notion-text-default, #37352f);
  background: var(--notion-bg-gray, #f7f6f3);
}

/* ===============================================
   카테고리 선택 버튼 스타일 - 노션 스타일
   =============================================== */

.category-buttons {
  display: flex;
  gap: var(--notion-space-2, 8px);
  margin-top: var(--notion-space-2, 8px);
  flex-wrap: wrap;
}

.category-btn {
  padding: var(--notion-space-2, 8px) var(--notion-space-4, 16px);
  margin: var(--notion-space-1, 4px);
  border: 1px solid var(--notion-border-default, #e9e9e7);
  border-radius: var(--notion-radius-full, 9999px);
  background: var(--notion-bg-default, #ffffff);
  cursor: pointer;
  transition: all var(--notion-transition-normal, 0.2s ease);
  font-size: var(--notion-text-base, 14px);
  color: var(--notion-text-default, #37352f);
  display: inline-flex;
  align-items: center;
  gap: var(--notion-space-1, 4px);
}

.category-btn i,
.category-btn svg {
  font-size: 14px;
  width: 14px;
  height: 14px;
}

/* 노션 블루 스타일 선택 상태 */
.category-btn.selected {
  background: var(--notion-bg-blue, #e7f3f8);
  color: var(--notion-text-blue, #0b6e99);
  border-color: var(--notion-text-blue, #0b6e99);
}

.category-btn:hover {
  border-color: var(--notion-border-dark, #d3d3d0);
  background: var(--notion-bg-gray, #f7f6f3);
}

/* ===============================================
   카테고리 배지 스타일 - 노션 스타일
   =============================================== */

.category-badge {
  display: inline-block;
  padding: var(--notion-space-1, 4px) var(--notion-space-2, 8px);
  border-radius: var(--notion-radius-sm, 4px);
  font-size: var(--notion-text-sm, 12px);
  font-weight: var(--notion-font-medium, 500);
  text-align: center;
  white-space: nowrap;
}

/* 노션 색상 시스템 기반 카테고리 배지 */
.category-badge.office {
  background: var(--notion-bg-blue, #e7f3f8);
  color: var(--notion-text-blue, #0b6e99);
}

.category-badge.housing {
  background: var(--notion-bg-purple, #f4e8fa);
  color: var(--notion-text-purple, #9065b0);
}

.category-badge.kitchen {
  background: var(--notion-bg-orange, #fbecdd);
  color: var(--notion-text-orange, #d9730d);
}

.category-badge.none {
  background: var(--notion-bg-gray, #f7f6f3);
  color: var(--notion-text-gray, #9b9a97);
}

.category-badge.studycafe {
  background: var(--notion-bg-pink, #f5e0e9);
  color: var(--notion-text-pink, #ad1a72);
}

.category-badge.garden {
  background: var(--notion-bg-green, #dbeddb);
  color: var(--notion-text-green, #0f7b6c);
}

.category-badge.warehouse {
  background: var(--notion-bg-orange, #fbecdd);
  color: var(--notion-text-orange, #d9730d);
}

.category-badge.storage-warehouse {
  background: var(--notion-bg-red, #fbe4e4);
  color: var(--notion-text-red, #e03e3e);
}

.category-badge.logistics-warehouse {
  background: var(--notion-bg-brown, #eee0da);
  color: var(--notion-text-brown, #64473a);
}

/* ===============================================
   이미지 업로드 관련 스타일 - 노션 스타일
   =============================================== */

.multi-image-upload-area {
  position: relative;
  width: 100%;
  min-height: 150px;
  border: 2px dashed var(--notion-border-default, #e9e9e7);
  border-radius: var(--notion-radius-lg, 8px);
  transition: all var(--notion-transition-normal, 0.2s ease);
  background: var(--notion-bg-gray-light, #fafafa);
  cursor: pointer;
  overflow: hidden;
  z-index: 1;
}

.multi-image-upload-area.drag-over {
  border-color: var(--notion-text-blue, #0b6e99);
  background: var(--notion-bg-blue, #e7f3f8);
}

.upload-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--notion-space-10, 40px) var(--notion-space-5, 20px);
  cursor: pointer;
  transition: all var(--notion-transition-normal, 0.2s ease);
  width: 100%;
  height: 100%;
  min-height: 150px;
  user-select: none;
}

.upload-placeholder:hover {
  background: var(--notion-bg-gray, #f7f6f3);
}

.upload-placeholder * {
  cursor: pointer;
  user-select: none;
  pointer-events: auto;
}

.upload-placeholder i,
.upload-placeholder svg {
  font-size: 48px;
  width: 48px;
  height: 48px;
  color: var(--notion-text-gray, #9b9a97);
  margin-bottom: var(--notion-space-4, 16px);
}

.upload-placeholder p {
  color: var(--notion-text-gray, #9b9a97);
  margin: 0;
  text-align: center;
  font-size: var(--notion-text-base, 14px);
}

.image-preview-grid {
  display: none;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: var(--notion-space-2, 8px);
  padding: var(--notion-space-4, 16px);
}

.image-preview-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--notion-radius-md, 6px);
  overflow: hidden;
  border: 1px solid var(--notion-border-default, #e9e9e7);
  cursor: move;
  transition: border var(--notion-transition-fast, 0.1s ease), opacity var(--notion-transition-fast, 0.1s ease);
}

.image-preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.remove-image {
  position: absolute;
  top: var(--notion-space-1, 4px);
  right: var(--notion-space-1, 4px);
  background: rgba(55, 53, 47, 0.8);
  color: white;
  border: none;
  border-radius: var(--notion-radius-full, 9999px);
  width: 24px;
  height: 24px;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--notion-transition-fast, 0.1s ease);
}

.remove-image:hover {
  background: var(--notion-text-red, #e03e3e);
}

/* ===============================================
   상태별 뱃지 색상 - 노션 스타일
   =============================================== */

.status-badge.occupied {
  background-color: var(--notion-bg-red, #fbe4e4);
  color: var(--notion-text-red, #e03e3e);
}

.status-badge.maintenance {
  background-color: var(--notion-bg-orange, #fbecdd);
  color: var(--notion-text-orange, #d9730d);
}

/* ===============================================
   상품명 링크 스타일 - 노션 스타일
   =============================================== */

.product-link {
  color: var(--notion-text-default, #37352f);
  text-decoration: none;
  font-weight: var(--notion-font-medium, 500);
  transition: all var(--notion-transition-fast, 0.1s ease);
}

.product-link:hover {
  color: var(--notion-text-default, #37352f);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ===============================================
   뱃지 스타일 - 노션 스타일
   =============================================== */

.badge {
  display: inline-block;
  padding: var(--notion-space-1, 4px) var(--notion-space-2, 8px);
  border-radius: var(--notion-radius-sm, 4px);
  font-size: var(--notion-text-xs, 11px);
  font-weight: var(--notion-font-semibold, 600);
  text-transform: uppercase;
}

.badge-success {
  background-color: var(--notion-bg-green, #dbeddb);
  color: var(--notion-text-green, #0f7b6c);
}

.badge-secondary {
  background-color: var(--notion-bg-gray, #f7f6f3);
  color: var(--notion-text-gray, #9b9a97);
}

/* ===============================================
   폼 섹션 박스 제거 - 노션 스타일
   =============================================== */

.form-section {
  border: none !important;
  background: transparent !important;
  padding: var(--notion-space-5, 20px) 0 !important;
  margin-bottom: var(--notion-space-6, 24px) !important;
  border-bottom: 1px solid var(--notion-border-light, #f1f1ef) !important;
}

.form-section:last-child {
  border-bottom: none !important;
}

/* .section-title 스타일은 상단에 정의됨 (hourly-products와 동일) */

/* ===============================================
   Tiptap 에디터 스타일 - 노션 스타일
   =============================================== */

.tiptap-wrapper {
  border: 1px solid var(--notion-border-default, #e9e9e7);
  border-radius: var(--notion-radius-md, 6px);
  background: var(--notion-bg-default, #ffffff);
  overflow: hidden;
  transition: border-color var(--notion-transition-fast, 0.1s ease);
  position: relative;
}

.tiptap-wrapper:focus-within {
  border-color: var(--notion-text-blue, #0b6e99);
  box-shadow: 0 0 0 2px var(--notion-bg-blue, #e7f3f8);
}

.tiptap-toolbar {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: var(--notion-space-1, 4px);
  background: var(--notion-bg-gray-light, #fafafa);
  border: none;
  border-bottom: 1px solid var(--notion-border-default, #e9e9e7);
  flex-wrap: wrap;
}

.tiptap-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 6px;
  border: none;
  background: transparent;
  border-radius: var(--notion-radius-sm, 4px);
  cursor: pointer;
  color: var(--notion-text-default, #37352f);
  transition: all var(--notion-transition-fast, 0.1s ease);
}

.tiptap-btn:hover {
  background: var(--notion-bg-gray, #f7f6f3);
  color: var(--notion-text-default, #37352f);
}

.tiptap-btn.active {
  background: var(--notion-bg-blue, #e7f3f8);
  color: var(--notion-text-blue, #0b6e99);
}

.tiptap-btn svg {
  display: block;
  width: 18px;
  height: 18px;
  pointer-events: none;
}

.tiptap-btn-text {
  min-width: 36px;
  padding: 6px 8px;
}

.tiptap-btn-text span {
  font-size: var(--notion-text-sm, 12px);
  font-weight: var(--notion-font-semibold, 600);
  line-height: 1;
  color: inherit;
}

.tiptap-divider {
  width: 1px;
  height: 24px;
  background: var(--notion-border-default, #e9e9e7);
  margin: 0 var(--notion-space-1, 4px);
}

.tiptap-editor {
  min-height: 300px;
  padding: var(--notion-space-4, 16px);
  border: none;
  background: var(--notion-bg-default, #ffffff);
  font-size: var(--notion-text-lg, 16px);
  line-height: 1.75;
  outline: none;
  overflow-y: auto;
  word-wrap: break-word;
  color: var(--notion-text-default, #37352f);
}

.tiptap-editor:empty:before {
  content: attr(data-placeholder);
  color: var(--notion-text-gray, #9b9a97);
  pointer-events: none;
  position: absolute;
}

/* 에디터 내부 요소 스타일 */
.tiptap-editor h1 {
  font-size: 2em;
  font-weight: var(--notion-font-bold, 700);
  margin: 1em 0 0.5em 0;
  line-height: 1.2;
  color: var(--notion-text-default, #37352f);
}

.tiptap-editor h2 {
  font-size: 1.5em;
  font-weight: var(--notion-font-semibold, 600);
  margin: 0.8em 0 0.4em 0;
  line-height: 1.3;
  color: var(--notion-text-default, #37352f);
}

.tiptap-editor h3 {
  font-size: 1.25em;
  font-weight: var(--notion-font-semibold, 600);
  margin: 0.6em 0 0.3em 0;
  line-height: 1.4;
  color: var(--notion-text-default, #37352f);
}

.tiptap-editor h4 {
  font-size: 1.1em;
  font-weight: var(--notion-font-semibold, 600);
  margin: 0.5em 0 0.25em 0;
  color: var(--notion-text-default, #37352f);
}

.tiptap-editor h5,
.tiptap-editor h6 {
  font-size: 1em;
  font-weight: var(--notion-font-semibold, 600);
  margin: 0.4em 0 0.2em 0;
  color: var(--notion-text-default, #37352f);
}

.tiptap-editor p {
  margin: 0.5em 0;
  line-height: 1.75;
}

.tiptap-editor ul,
.tiptap-editor ol {
  padding-left: 1.5em;
  margin: 0.5em 0;
}

.tiptap-editor li {
  margin: 0.25em 0;
  line-height: 1.75;
}

.tiptap-editor a {
  color: var(--notion-text-blue, #0b6e99);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.tiptap-editor a:hover {
  color: var(--notion-text-default, #37352f);
}

.tiptap-editor code {
  background: var(--notion-bg-gray, #f7f6f3);
  padding: 2px 6px;
  border-radius: var(--notion-radius-xs, 3px);
  font-family: var(--notion-font-mono, 'JetBrains Mono', monospace);
  font-size: 0.9em;
  color: var(--notion-text-red, #e03e3e);
}

.tiptap-editor pre {
  background: var(--notion-bg-gray, #f7f6f3);
  color: var(--notion-text-default, #37352f);
  padding: 1em;
  border-radius: var(--notion-radius-md, 6px);
  overflow-x: auto;
  margin: 1em 0;
  font-family: var(--notion-font-mono, 'JetBrains Mono', monospace);
  font-size: 0.9em;
  line-height: 1.5;
  border: 1px solid var(--notion-border-default, #e9e9e7);
}

.tiptap-editor pre code {
  background: transparent;
  padding: 0;
  color: inherit;
  border-radius: 0;
}

.tiptap-editor blockquote {
  border-left: 3px solid var(--notion-border-dark, #d3d3d0);
  padding-left: 1em;
  margin: 1em 0;
  color: var(--notion-text-gray, #9b9a97);
  font-style: italic;
}

.tiptap-editor hr {
  border: none;
  border-top: 1px solid var(--notion-border-default, #e9e9e7);
  margin: 2em 0;
}

.tiptap-editor strong {
  font-weight: var(--notion-font-bold, 700);
}

.tiptap-editor em {
  font-style: italic;
}

.tiptap-editor s {
  text-decoration: line-through;
}

/* Highlight (형광펜) 스타일 */
.tiptap-editor mark {
  padding: 0.1em 0.2em;
  border-radius: 2px;
}

/* Color picker palette */
.color-picker-palette {
  position: absolute;
  display: flex;
  gap: var(--notion-space-2, 6px);
  padding: var(--notion-space-2, 8px);
  background: var(--notion-bg-default, #ffffff);
  border: 1px solid var(--notion-border-default, #e9e9e7);
  border-radius: var(--notion-radius-md, 6px);
  box-shadow: var(--notion-shadow-lg, 0 10px 15px -3px rgba(0, 0, 0, 0.08));
  z-index: 1000;
  margin-top: var(--notion-space-1, 4px);
}

.color-option {
  width: 24px;
  height: 24px;
  border: 1px solid var(--notion-border-default, #e9e9e7);
  border-radius: var(--notion-radius-sm, 4px);
  cursor: pointer;
  transition: all var(--notion-transition-fast, 0.1s ease);
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.color-option:hover {
  border-color: var(--notion-border-dark, #d3d3d0);
  transform: scale(1.1);
}

.color-option.color-remove {
  background: var(--notion-bg-default, #ffffff);
}

.color-option.color-remove svg {
  display: block;
}

/* Task List 스타일 */
.tiptap-editor ul[data-type="taskList"] {
  list-style: none;
  padding-left: 0;
}

.tiptap-editor ul[data-type="taskList"] li[data-type="taskItem"] {
  display: flex;
  align-items: flex-start;
  gap: 0.5em;
  margin: 0.5em 0;
}

.tiptap-editor ul[data-type="taskList"] li[data-type="taskItem"] label {
  display: flex;
  align-items: flex-start;
  gap: 0.5em;
  cursor: pointer;
  flex: 1;
}

.tiptap-editor ul[data-type="taskList"] li[data-type="taskItem"] input[type="checkbox"] {
  margin-top: 0.25em;
  cursor: pointer;
  flex-shrink: 0;
  accent-color: var(--notion-text-blue, #0b6e99);
}

.tiptap-editor ul[data-type="taskList"] li[data-type="taskItem"][data-checked="true"] > label > span {
  text-decoration: line-through;
  color: var(--notion-text-gray, #9b9a97);
}

.tiptap-editor ul[data-type="taskList"] li[data-type="taskItem"] > label > span {
  flex: 1;
}

/* ===============================================
   상태 드롭다운 - 노션 스타일
   =============================================== */

.status-dropdown {
  position: relative !important;
  display: inline-block !important;
  z-index: 100 !important;
  isolation: isolate !important;
}

.status-dropdown:hover {
  transform: none !important;
}

.status-dropdown .status-badge {
  cursor: pointer;
  user-select: none;
  transition: opacity var(--notion-transition-fast, 0.1s ease);
  transform: none !important;
  position: relative !important;
  z-index: 101 !important;
}

.status-dropdown .status-badge:hover {
  opacity: 0.8;
  transform: none !important;
}

.status-dropdown-menu {
  position: fixed !important;
  background: var(--notion-bg-default, #ffffff) !important;
  border: 1px solid var(--notion-border-default, #e9e9e7) !important;
  border-radius: var(--notion-radius-md, 6px) !important;
  box-shadow: var(--notion-shadow-lg, 0 10px 15px -3px rgba(0, 0, 0, 0.08)) !important;
  z-index: 999999 !important;
  min-width: 120px !important;
  display: none !important;
  white-space: nowrap !important;
  pointer-events: auto !important;
}

.status-dropdown-menu[style*="block"] {
  display: block !important;
}

.status-option {
  padding: var(--notion-space-2, 8px) var(--notion-space-4, 16px);
  cursor: pointer;
  font-size: var(--notion-text-base, 14px);
  color: var(--notion-text-default, #37352f);
  transition: background-color var(--notion-transition-fast, 0.1s ease);
  white-space: nowrap;
}

.status-option:hover {
  background-color: var(--notion-bg-gray, #f7f6f3);
}

.status-option:not(:last-child) {
  border-bottom: 1px solid var(--notion-border-light, #f1f1ef);
}

/* ===============================================
   편의시설 카테고리 헤더 - 노션 스타일
   =============================================== */

.amenity-category-header,
.amenity-category h5 {
  margin-bottom: var(--notion-space-2, 8px);
  color: var(--notion-text-gray, #9b9a97);
  font-size: var(--notion-text-base, 14px);
  font-weight: var(--notion-font-semibold, 600);
}

/* ===============================================
   스크린리더 전용 (시각적으로 숨김)
   =============================================== */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ===============================================
   테이블 썸네일 래퍼
   =============================================== */

.thumbnail-wrapper {
  width: 60px;
  height: 60px;
}

.thumbnail-wrapper .table-thumbnail {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--notion-radius-sm, 4px);
}

.thumbnail-wrapper .no-image {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--notion-bg-gray, #f7f6f3);
  border-radius: var(--notion-radius-sm, 4px);
  color: var(--notion-text-gray, #9b9a97);
}

/* ===============================================
   할인가 표시
   =============================================== */

.discount-price {
  color: var(--notion-text-red, #e03e3e);
  font-weight: var(--notion-font-semibold, 600);
}

/* ===============================================
   모바일 반응형 스타일 (768px 이하)
   =============================================== */

@media (max-width: 768px) {
  /* 페이지 콘텐츠 패딩 조정 */
  .page-content {
    padding: 12px !important;
  }

  /* 대시보드 헤더 간소화 */
  .dashboard-header {
    padding: 12px 16px;
  }

  .notion-page-title h2 {
    font-size: 18px;
  }

  .notion-page-emoji {
    font-size: 20px;
  }

  /* =========================================
     액션 바 - 모바일 최적화
     ========================================= */
  .action-bar {
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
    margin-bottom: 16px;
  }

  .action-bar .search-box {
    max-width: none;
    width: 100%;
    order: 1;
  }

  .action-bar .search-box input {
    height: 44px;
    font-size: 16px; /* iOS 줌 방지 */
    padding: 10px 12px 10px 40px;
  }

  .action-bar .action-buttons {
    order: 2;
    display: flex;
    gap: 8px;
    width: 100%;
  }

  .action-bar .action-buttons .notion-btn {
    flex: 1;
    min-height: 44px;
    font-size: 14px;
    padding: 10px 12px;
    justify-content: center;
  }

  /* Excel 버튼 아이콘만 표시 (선택사항) */
  .action-bar .action-buttons .notion-btn[data-text="excel"] span {
    display: none;
  }

  /* =========================================
     폼 컨테이너 - 모바일 최적화
     ========================================= */
  .rental-form-container {
    padding: 16px;
    margin-bottom: 16px;
    border-radius: var(--notion-radius-md, 6px);
  }

  .form-header {
    margin-bottom: 16px;
    padding-bottom: 12px;
  }

  .form-header h2,
  .form-header h3 {
    font-size: 16px;
  }

  .form-close-btn {
    width: 40px;
    height: 40px;
    font-size: 28px;
  }

  /* =========================================
     폼 섹션 - 세로 배열
     ========================================= */
  .form-section {
    padding: 16px 0 !important;
    margin-bottom: 16px !important;
  }

  .section-title {
    margin-bottom: 12px;
  }

  .section-title h4 {
    font-size: 15px;
  }

  /* 폼 행 - 단일 컬럼 */
  .form-row {
    flex-direction: column;
    gap: 16px;
  }

  .form-row .form-group {
    flex: none !important;
    width: 100%;
  }

  /* 입력 필드 - 터치 친화적 */
  .form-group input,
  .form-group select,
  .form-group textarea {
    min-height: 48px;
    font-size: 16px; /* iOS 줌 방지 */
    padding: 12px 14px;
  }

  .form-group label {
    font-size: 14px;
    margin-bottom: 6px;
  }

  /* =========================================
     카테고리/편의시설 버튼 - 터치 최적화
     ========================================= */
  .category-buttons {
    gap: 8px;
    margin-top: 8px;
  }

  .category-btn {
    min-height: 44px;
    padding: 10px 16px;
    font-size: 14px;
    margin: 2px;
    flex-grow: 1;
    flex-basis: calc(50% - 12px); /* 2열 배치 */
    justify-content: center;
  }

  /* 상태 버튼 - 3개 균등 배분 */
  #statusButtons .category-btn {
    flex-basis: calc(33.33% - 12px);
  }

  /* 사업자등록 가능 여부 버튼 */
  #businessRegButtons {
    flex-direction: row !important;
    gap: 8px !important;
  }

  #businessRegButtons .category-btn {
    flex: 1;
    min-height: 48px !important;
    padding: 12px 16px !important;
  }

  /* 편의시설 카테고리 */
  .amenity-category {
    margin-bottom: 16px;
  }

  .amenity-category h5 {
    margin-bottom: 12px;
    font-size: 13px;
  }

  /* 커스텀 편의시설 입력 */
  .custom-amenity {
    flex-direction: column;
    gap: 8px;
  }

  .custom-amenity input,
  .custom-amenity select {
    width: 100%;
    min-height: 44px;
    margin-left: 0 !important;
  }

  .custom-amenity .notion-btn {
    width: 100%;
    margin-left: 0 !important;
    min-height: 44px;
  }

  /* =========================================
     이미지 업로드 - 모바일 최적화
     ========================================= */
  .multi-image-upload-area {
    min-height: 120px;
  }

  .upload-placeholder {
    padding: 24px 16px;
    min-height: 120px;
  }

  .upload-placeholder p {
    font-size: 13px;
    line-height: 1.4;
  }

  .upload-placeholder i,
  .upload-placeholder svg {
    font-size: 36px;
    width: 36px;
    height: 36px;
  }

  .image-preview-grid {
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 8px;
    padding: 12px;
  }

  .remove-image {
    width: 28px;
    height: 28px;
    font-size: 14px;
  }

  /* =========================================
     위치 입력 - 모바일 최적화
     ========================================= */
  .location-input-group {
    flex-direction: column;
    gap: 10px;
  }

  .location-input-group .form-input {
    min-height: 48px;
  }

  .location-input-group .location-select-btn {
    width: 100%;
    min-height: 48px;
    justify-content: center;
  }

  #rentalMiniMap {
    height: 180px !important;
    margin-top: 12px !important;
  }

  /* =========================================
     Tiptap 에디터 - 모바일 최적화
     ========================================= */
  .tiptap-toolbar {
    padding: 6px;
    gap: 2px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
  }

  .tiptap-btn {
    min-width: 36px;
    min-height: 36px;
    flex-shrink: 0;
  }

  .tiptap-btn-text {
    min-width: 40px;
    padding: 6px 10px;
  }

  .tiptap-divider {
    height: 20px;
    margin: 0 2px;
  }

  .tiptap-editor {
    min-height: 200px;
    padding: 12px;
    font-size: 15px;
  }

  .color-picker-palette {
    padding: 8px;
    gap: 8px;
  }

  .color-option {
    width: 32px;
    height: 32px;
  }

  /* =========================================
     폼 푸터 - 모바일 최적화
     ========================================= */
  .form-footer {
    flex-direction: column-reverse;
    gap: 10px;
    padding-top: 16px;
    margin-top: 16px;
  }

  .form-footer .notion-btn {
    width: 100%;
    min-height: 48px;
    font-size: 15px;
    justify-content: center;
  }

  /* =========================================
     테이블 컨테이너 - 모바일 최적화
     ========================================= */
  .table-container {
    border-radius: var(--notion-radius-md, 6px);
    margin: 0 -12px; /* 풀 블리드 효과 */
    width: calc(100% + 24px);
    border-left: none;
    border-right: none;
    border-radius: 0;
  }

  .table-header {
    padding: 12px 16px;
    position: sticky;
    top: 0;
    background: var(--notion-bg-default, #ffffff);
    z-index: 10;
  }

  .table-emoji {
    font-size: 1.1rem;
  }

  .table-title {
    font-size: 15px;
  }

  .table-count {
    font-size: 12px;
    padding: 3px 8px;
  }

  /* 테이블 - 가로 스크롤 최적화 */
  .data-table {
    font-size: 13px;
  }

  .data-table th,
  .data-table td {
    padding: 10px 12px;
    white-space: nowrap;
  }

  /* 고정 열 - 상품명 */
  .data-table th:nth-child(4),
  .data-table td:nth-child(4) {
    position: sticky;
    left: 0;
    background: var(--notion-bg-default, #ffffff);
    z-index: 5;
    min-width: 120px;
  }

  /* 테이블 썸네일 크기 축소 */
  .thumbnail-wrapper {
    width: 48px;
    height: 48px;
  }

  /* 테이블 액션 버튼 */
  .table-actions {
    display: flex;
    gap: 4px;
  }

  .table-actions .btn-icon {
    min-width: 36px;
    min-height: 36px;
    padding: 6px;
  }

  /* 상태 배지 */
  .status-badge {
    font-size: 11px;
    padding: 4px 8px;
  }

  /* 카테고리 배지 */
  .category-badge {
    font-size: 11px;
    padding: 3px 6px;
  }

  /* =========================================
     상태 드롭다운 - 모바일 최적화
     ========================================= */
  .status-dropdown-menu {
    min-width: 140px !important;
  }

  .status-option {
    padding: 12px 16px;
    font-size: 14px;
  }
}

/* ===============================================
   초소형 화면 (480px 이하)
   =============================================== */

@media (max-width: 480px) {
  .page-content {
    padding: 8px !important;
  }

  /* 폼 내 카테고리 버튼 - 단일 열 */
  .category-btn {
    flex-basis: 100%;
  }

  #statusButtons .category-btn {
    flex-basis: 100%;
  }

  /* 이미지 그리드 - 2열 */
  .image-preview-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Tiptap 툴바 - 더 작게 */
  .tiptap-btn {
    min-width: 32px;
    min-height: 32px;
  }

  .tiptap-btn svg {
    width: 16px;
    height: 16px;
  }

  /* 테이블 - 더 컴팩트하게 */
  .data-table th,
  .data-table td {
    padding: 8px 10px;
    font-size: 12px;
  }

  .thumbnail-wrapper {
    width: 40px;
    height: 40px;
  }

  /* 액션 바 버튼 - 아이콘만 */
  .action-bar .action-buttons .notion-btn svg + span,
  .action-bar .action-buttons .notion-btn i + span {
    display: none;
  }

  .action-bar .action-buttons .notion-btn {
    padding: 10px;
  }
}

/* ===============================================
   태블릿 가로 모드 (768px ~ 1024px)
   =============================================== */

@media (min-width: 769px) and (max-width: 1024px) {
  /* 폼 행 - 2열 유지하되 간격 조정 */
  .form-row {
    gap: 16px;
  }

  /* 카테고리 버튼 - 3열 배치 */
  .category-btn {
    flex-basis: calc(33.33% - 12px);
  }

  /* 이미지 그리드 - 더 많은 열 */
  .image-preview-grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  }
}
