/* src/seller_console/static/seller.css — 셀러 콘솔 스타일 (Phase 122 + Phase 147 모바일 개선) */

body {
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--pc-color-bg, #f8fafc);
}

/* 사이드바 */
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar .nav-link {
  font-size: 0.9rem;
  padding: 6px 10px;
  border-radius: 6px;
  transition: background 0.15s;
  /* Phase 147: 최소 터치 영역 44px */
  min-height: 44px;
  display: flex;
  align-items: center;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.text-white {
  background: rgba(255, 255, 255, 0.1);
}

/* 카드 공통 */
.card {
  border-radius: var(--pc-radius-md, 10px);
  border-color: var(--pc-color-border, #dbe2f2);
}

/* KPI 값 */
.kpi-value {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.1;
}

/* 배지 */
.badge {
  font-weight: 500;
}

/* 테이블 */
.table th {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  color: #6c757d;
  letter-spacing: 0.5px;
}

.table td {
  font-size: 0.9rem;
  vertical-align: middle;
}

/* Phase 147: 테이블 가로 스크롤 기본 래퍼 */
.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* 범위 슬라이더 */
input[type="range"] {
  accent-color: #0d6efd;
}

/* 토스트 */
.toast {
  min-width: 280px;
  box-shadow: var(--pc-shadow-md, 0 14px 30px rgba(2, 0, 16, .12));
}

/* 이미지 갤러리 */
#imageGallery img {
  cursor: pointer;
  transition: transform 0.1s;
}

#imageGallery img:hover {
  transform: scale(1.05);
}

/* 로딩 오버레이 */
.loading-overlay {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
}

/* Phase 147: 버튼 최소 터치 영역 44px */
.btn {
  min-height: 44px;
  min-width: 44px;
}
.btn-sm {
  min-height: 36px;
  min-width: 36px;
}

/* Phase 147: 폼 인풋 모바일 최적화 */
input[type="number"] {
  -moz-appearance: textfield;
  inputmode: numeric;
}
input[type="tel"] {
  inputmode: tel;
}

/* Phase 147: 모바일 반응형 */
@media (max-width: 768px) {
  /* v14 P0: 드로어 오버레이 — 바깥 영역을 실제로 덮어 탭하면 닫히게(기존엔 위치/배경 없어 클릭 안 먹힘) */
  .sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .45);
    z-index: 1040;
    display: none;
  }
  body.kgp-drawer-open { overflow: hidden; }   /* 드로어 열림 시 배경 스크롤 잠금 */
  /* 모바일 사이드바 drawer */
  .sidebar {
    position: fixed !important;
    top: 0;
    left: -240px;
    width: 240px !important;
    height: 100vh;
    z-index: 1050;
    transition: left 0.25s ease;
    overflow-y: auto;
    padding-top: 56px !important;
  }
  .sidebar.show {
    left: 0;
    box-shadow: 4px 0 16px rgba(0,0,0,.4);
  }
  /* 메인 콘텐츠 패딩 조정 */
  main.flex-grow-1 {
    padding: 1rem !important;
  }
  /* v36 PART A: 표는 .table-cards(콘솔 CSS)로 카드화 — 전역 강제 min-width(가로 스크롤) 제거.
     .table-cards가 아닌 표만 .table-responsive 컨테이너 안에서 자체 스크롤되도록 가벼운 하한. */
  .table-responsive > table:not(.table-cards) {
    min-width: 560px;
  }
}

@media (min-width: 769px) {
  /* 데스크톱: 모바일 헤더 숨김 */
  .mobile-topbar {
    display: none !important;
  }
  .sidebar-overlay {
    display: none !important;
  }
}
