:root {
  --primary: #4F46E5;
  --primary-dark: #4338CA;
  --primary-light: #EEF2FF;
  --success: #10B981;
  --success-light: #D1FAE5;
  --warning: #F59E0B;
  --warning-light: #FEF3C7;
  --danger: #EF4444;
  --danger-light: #FEE2E2;
  --info: #3B82F6;
  --info-light: #DBEAFE;
  --gray-50: #F9FAFB;
  --gray-100: #F3F4F6;
  --gray-200: #E5E7EB;
  --gray-300: #D1D5DB;
  --gray-400: #9CA3AF;
  --gray-500: #6B7280;
  --gray-600: #4B5563;
  --gray-700: #374151;
  --gray-800: #1F2937;
  --gray-900: #111827;
  --sidebar-width: 240px;
  --header-height: 60px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--gray-50);
  color: var(--gray-800);
  line-height: 1.6;
}

/* 앱 컨테이너 */
.app-container {
  display: flex;
  min-height: 100vh;
}

/* 사이드바 */
.sidebar {
  width: var(--sidebar-width);
  background: linear-gradient(180deg, var(--gray-900) 0%, var(--gray-800) 100%);
  color: white;
  position: fixed;
  height: 100vh;
  display: flex;
  flex-direction: column;
  z-index: 100;
}

.logo {
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.25rem;
  font-weight: 700;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.logo i {
  font-size: 1.5rem;
  color: var(--primary);
}

.nav-menu {
  flex: 1;
  padding: 20px 0;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 24px;
  color: var(--gray-300);
  text-decoration: none;
  transition: all 0.2s;
  border-left: 3px solid transparent;
}

.nav-item:hover {
  background: rgba(255,255,255,0.05);
  color: white;
}

.nav-item.active {
  background: rgba(79, 70, 229, 0.2);
  color: white;
  border-left-color: var(--primary);
}

.nav-item i {
  width: 20px;
  text-align: center;
}

.sidebar-footer {
  padding: 20px;
  text-align: center;
  color: var(--gray-500);
  border-top: 1px solid rgba(255,255,255,0.1);
}

/* 메인 콘텐츠 */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  padding: 24px;
}

/* 페이지 */
.page {
  display: none;
}

.page.active {
  display: block;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.page-header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}

.page-header h1 i {
  color: var(--primary);
}

.header-actions {
  display: flex;
  gap: 10px;
}

/* 통계 카드 */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.stat-card {
  background: white;
  border-radius: 12px;
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.stat-icon {
  width: 60px;
  height: 60px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.stat-card.primary .stat-icon { background: var(--primary-light); color: var(--primary); }
.stat-card.success .stat-icon { background: var(--success-light); color: var(--success); }
.stat-card.warning .stat-icon { background: var(--warning-light); color: var(--warning); }
.stat-card.info .stat-icon { background: var(--info-light); color: var(--info); }

.stat-info {
  display: flex;
  flex-direction: column;
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--gray-900);
}

.stat-label {
  font-size: 0.875rem;
  color: var(--gray-500);
}

/* 차트 영역 */
.charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 20px;
}

.chart-card {
  background: white;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.chart-card h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--gray-700);
}

.chart-container {
  height: 250px;
}

.chart-bar {
  display: flex;
  align-items: center;
  margin-bottom: 12px;
}

.chart-bar-label {
  width: 100px;
  font-size: 0.875rem;
  color: var(--gray-600);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chart-bar-track {
  flex: 1;
  height: 24px;
  background: var(--gray-100);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.chart-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary) 0%, var(--info) 100%);
  border-radius: 4px;
  transition: width 0.5s ease;
}

.chart-bar-value {
  width: 60px;
  text-align: right;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--gray-700);
  padding-left: 12px;
}

/* 필터 바 */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  background: white;
  padding: 20px;
  border-radius: 12px;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 150px;
}

.filter-group.search-group {
  flex: 1;
  min-width: 250px;
}

.filter-group label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.filter-group select,
.filter-group input {
  padding: 10px 14px;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  font-size: 0.875rem;
  background: white;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.filter-group select:focus,
.filter-group input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.search-input {
  position: relative;
}

.search-input input {
  width: 100%;
  padding-right: 40px;
}

.search-input i {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-400);
}

/* 결과 정보 */
.result-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  font-size: 0.875rem;
  color: var(--gray-600);
}

/* 테이블 */
.table-container {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  padding: 14px 16px;
  text-align: center;
  border: 1px solid #e5e7eb;
  white-space: nowrap;
}

.data-table th {
  background: var(--gray-50);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--gray-600);
}

.data-table tbody tr:hover {
  background: var(--gray-50);
}

.data-table td {
  font-size: 0.875rem;
}

.checkbox-col {
  width: 40px;
  text-align: center !important;
}

.action-col {
  width: 100px;
  text-align: center !important;
}

.action-btns {
  display: flex;
  gap: 8px;
  justify-content: center;
}

.action-btns button {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.action-btns .btn-edit {
  background: var(--info-light);
  color: var(--info);
}

.action-btns .btn-edit:hover {
  background: var(--info);
  color: white;
}

.action-btns .btn-delete {
  background: var(--danger-light);
  color: var(--danger);
}

.action-btns .btn-delete:hover {
  background: var(--danger);
  color: white;
}

/* 태그 뱃지 */
.badge {
  display: inline-block;
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 20px;
}

.badge-channel {
  background: var(--primary-light);
  color: var(--primary);
}

.badge-set {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--gray-100);
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  margin: 2px;
}

.badge-set .ratio {
  background: var(--primary);
  color: white;
  padding: 2px 6px;
  border-radius: 10px;
  font-size: 0.625rem;
}

/* 버튼 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border: none;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-dark);
}

.btn-secondary {
  background: var(--gray-100);
  color: var(--gray-700);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--gray-200);
}

.btn-danger {
  background: var(--danger);
  color: white;
}

.btn-danger:hover:not(:disabled) {
  background: #DC2626;
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--gray-300);
  color: var(--gray-600);
}

.btn-outline:hover:not(:disabled) {
  background: var(--gray-100);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.75rem;
}

/* 모달 */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal.active {
  display: flex;
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
}

.modal-content {
  position: relative;
  background: white;
  border-radius: 16px;
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  animation: modalIn 0.3s ease;
}

.modal-content.modal-lg {
  max-width: 700px;
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(-20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--gray-100);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h2 {
  font-size: 1.125rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-header h2 i {
  color: var(--primary);
}

.modal-close {
  width: 36px;
  height: 36px;
  border: none;
  background: var(--gray-100);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-600);
  transition: all 0.2s;
}

.modal-close:hover {
  background: var(--gray-200);
  color: var(--gray-900);
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--gray-100);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* 폼 */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray-700);
}

.form-group .required {
  color: var(--danger);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  font-size: 0.875rem;
  transition: all 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.form-group textarea {
  resize: vertical;
  min-height: 80px;
}

.form-row {
  display: flex;
  gap: 16px;
}

.form-row .form-group {
  flex: 1;
}

.form-row .form-group.flex-2 {
  flex: 2;
}

.form-row .form-group.flex-1 {
  flex: 1;
}

.section-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--gray-700);
  margin: 24px 0 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  gap: 8px;
}

.set-composition .set-item {
  background: var(--gray-50);
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 8px;
}

/* 토스트 */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--gray-900);
  color: white;
  padding: 14px 24px;
  border-radius: 10px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.2);
  display: none;
  align-items: center;
  gap: 12px;
  z-index: 2000;
  animation: toastIn 0.3s ease;
}

.toast.active {
  display: flex;
}

.toast.success {
  background: var(--success);
}

.toast.error {
  background: var(--danger);
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 로딩 */
.loader {
  display: inline-block;
  width: 24px;
  height: 24px;
  border: 3px solid var(--gray-200);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  vertical-align: middle;
  margin-right: 10px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-row td {
  text-align: center;
  padding: 60px 40px;
  color: var(--gray-500);
  font-size: 0.9rem;
}

.loading-row td .loader {
  width: 32px;
  height: 32px;
  border-width: 4px;
  margin-bottom: 12px;
  margin-right: 0;
}

.loading-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.loading-content .loader {
  width: 40px;
  height: 40px;
  border-width: 4px;
  margin: 0;
}

.loading-content span {
  color: var(--gray-500);
  font-size: 0.875rem;
}

.loading-text {
  color: var(--gray-400);
  font-size: 0.875rem;
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* 설정 페이지 */
.settings-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  border-bottom: 2px solid var(--gray-200);
  padding-bottom: 0;
}

.settings-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border: none;
  background: transparent;
  color: var(--gray-500);
  font-size: 0.9375rem;
  font-weight: 500;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s;
}

.settings-tab:hover {
  color: var(--primary);
}

.settings-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.settings-tab i {
  font-size: 1rem;
}

.settings-tab-content {
  display: none;
}

.settings-tab-content.active {
  display: block;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 24px;
}

.settings-card {
  background: white;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  overflow: hidden;
}

.settings-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-100);
}

.settings-card-header h3 {
  font-size: 1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--gray-700);
}

.settings-card-header h3 i {
  color: var(--primary);
}

.settings-card-body {
  padding: 0;
}

.data-table.compact th,
.data-table.compact td {
  padding: 10px 14px;
  font-size: 0.8125rem;
  text-align: center;
  border: 1px solid #e5e7eb;
}

.modal-content.modal-sm {
  max-width: 400px;
}

.settings-card.full-width {
  grid-column: 1 / -1;
}

.settings-hint {
  padding: 12px 16px;
  background: var(--info-light);
  border-radius: 8px;
  font-size: 0.8125rem;
  color: var(--gray-600);
  margin: 0;
  border-bottom: 1px solid var(--gray-100);
}

.settings-hint i {
  color: var(--info);
  margin-right: 6px;
}

.form-hint {
  font-size: 0.8125rem;
  color: var(--gray-600);
  margin-bottom: 12px;
}

.form-hint i {
  color: var(--primary);
  margin-right: 6px;
}

.form-group small {
  display: block;
  font-size: 0.75rem;
  color: var(--gray-500);
  margin-top: 4px;
}

/* 판매내역 페이지 */
.sales-stats {
  margin-bottom: 20px;
}

.date-range {
  display: flex;
  align-items: center;
  gap: 8px;
}

.date-range input {
  padding: 10px 12px;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  font-size: 0.875rem;
}

.date-range span {
  color: var(--gray-400);
}

/* 통계/분석 페이지 */
.stats-charts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 24px;
  margin-bottom: 24px;
}

.chart-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--gray-100);
  background: var(--gray-50);
}

.chart-header h3 {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--gray-700);
  display: flex;
  align-items: center;
  gap: 8px;
}

.chart-header h3 i {
  color: var(--primary);
}

.chart-body {
  padding: 20px;
  height: 300px;
}

.stats-tables {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 24px;
}

.stats-table-card {
  background: white;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  overflow: hidden !important;
}

.stats-table-card * {
  overflow-x: hidden !important;
}

.stats-table-card .data-table.compact {
  table-layout: fixed !important;
  width: 100% !important;
}

.stats-table-card .data-table.compact th,
.stats-table-card .data-table.compact td {
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

.stats-table-card.full-width {
  grid-column: 1 / -1;
}

.stats-table-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--gray-100);
  background: var(--gray-50);
}

.stats-table-header h3 {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--gray-700);
  display: flex;
  align-items: center;
  gap: 8px;
}

.stats-table-header h3 i {
  color: var(--primary);
}

.stats-table-body {
  max-height: 350px;
  overflow-y: auto;
  overflow-x: hidden !important;
}

.stats-table-body table {
  margin: 0;
}

.percent-bar {
  display: flex;
  align-items: center;
  gap: 8px;
}

.percent-bar-bg {
  flex: 1;
  height: 8px;
  background: var(--gray-100);
  border-radius: 4px;
  overflow: hidden;
}

.percent-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary) 0%, var(--info) 100%);
  border-radius: 4px;
  transition: width 0.3s;
}

.percent-bar span {
  font-size: 0.75rem;
  color: var(--gray-600);
  min-width: 45px;
  text-align: right;
}

.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 600;
}

.rank-badge.gold {
  background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
  color: white;
}

.rank-badge.silver {
  background: linear-gradient(135deg, #C0C0C0 0%, #A0A0A0 100%);
  color: white;
}

.rank-badge.bronze {
  background: linear-gradient(135deg, #CD7F32 0%, #8B4513 100%);
  color: white;
}

.rank-badge.normal {
  background: var(--gray-200);
  color: var(--gray-600);
}

/* 업로드 영역 */
.upload-zone.drag-over {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.1);
  transform: scale(1.02);
}

.upload-zone.drag-over i {
  color: var(--primary);
  transform: scale(1.2);
}

.upload-zone {
  border: 2px dashed var(--gray-300);
  border-radius: 12px;
  padding: 40px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: var(--gray-50);
}

.upload-zone:hover,
.upload-zone.dragover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.upload-content i {
  font-size: 3rem;
  color: var(--gray-400);
  margin-bottom: 16px;
}

.upload-zone:hover .upload-content i {
  color: var(--primary);
}

.upload-content p {
  font-size: 1rem;
  color: var(--gray-700);
  margin-bottom: 8px;
}

.upload-hint {
  font-size: 0.75rem;
  color: var(--gray-500);
}

.upload-file-info {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--success-light);
  border-radius: 8px;
  margin-top: 16px;
}

.upload-file-info i {
  font-size: 1.5rem;
  color: var(--success);
}

.upload-file-info span {
  flex: 1;
  font-size: 0.875rem;
  color: var(--gray-700);
}

.btn-icon {
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--gray-500);
  border-radius: 50%;
}

.btn-icon:hover {
  background: var(--gray-200);
  color: var(--gray-700);
}

.upload-progress {
  margin-top: 20px;
}

.progress-bar {
  height: 8px;
  background: var(--gray-200);
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary) 0%, var(--info) 100%);
  width: 0%;
  transition: width 0.3s;
  animation: progressPulse 1.5s infinite;
}

@keyframes progressPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.upload-progress span {
  display: block;
  text-align: center;
  margin-top: 8px;
  font-size: 0.875rem;
  color: var(--gray-600);
}

.upload-result {
  margin-top: 20px;
  padding: 16px;
  border-radius: 8px;
  background: var(--gray-50);
}

.upload-result.success {
  background: var(--success-light);
}

.upload-result.error {
  background: var(--danger-light);
}

.upload-result h4 {
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.upload-result ul {
  list-style: none;
  font-size: 0.8125rem;
  color: var(--gray-600);
}

.upload-result li {
  padding: 4px 0;
}

/* 반응형 */
@media (max-width: 768px) {
  .sidebar {
    width: 60px;
  }

  .sidebar .logo span,
  .sidebar .nav-item span,
  .sidebar-footer {
    display: none;
  }

  .logo {
    justify-content: center;
    padding: 20px 0;
  }

  .nav-item {
    justify-content: center;
    padding: 14px 0;
  }

  .main-content {
    margin-left: 60px;
    padding: 16px;
  }

  .page-header {
    flex-direction: column;
    gap: 16px;
    align-items: flex-start;
  }

  .filter-bar {
    flex-direction: column;
  }

  .filter-group {
    width: 100%;
  }

  .charts-grid {
    grid-template-columns: 1fr;
  }

  .modal-content {
    margin: 16px;
  }
}

/* 판매 추이 섹션 */
.sales-trend-section {
  margin-bottom: 24px;
}

.trend-summary {
  display: flex;
  gap: 24px;
  margin-bottom: 16px;
  padding: 16px;
  background: #f8fafc;
  border-radius: 8px;
}

.trend-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.trend-label {
  font-size: 12px;
  color: #64748b;
}

.trend-value {
  font-size: 18px;
  font-weight: 600;
  color: #1e293b;
}

.trend-bar-container {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.trend-bar {
  display: flex;
  align-items: center;
  gap: 8px;
}

.trend-bar-label {
  width: 70px;
  font-size: 12px;
  color: #64748b;
  text-align: right;
}

.trend-bar-bg {
  flex: 1;
  height: 24px;
  background: #e2e8f0;
  border-radius: 4px;
  overflow: hidden;
}

.trend-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #60a5fa);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 8px;
  min-width: 60px;
}

.trend-bar-value {
  font-size: 11px;
  color: white;
  font-weight: 500;
}

@media (max-width: 768px) {
  .trend-summary {
    flex-direction: column;
    gap: 12px;
  }
}

/* 판매 요약 바 */
.sales-summary-bar {
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
  padding: 16px 20px;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  border-radius: 12px;
  color: white;
}

.summary-item {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.summary-item i {
  font-size: 20px;
  opacity: 0.8;
}

.summary-info {
  display: flex;
  flex-direction: column;
}

.summary-label {
  font-size: 11px;
  opacity: 0.8;
}

.summary-value {
  font-size: 16px;
  font-weight: 700;
}

/* 2열 그리드 */
.dashboard-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}

@media (max-width: 900px) {
  .dashboard-grid-2 {
    grid-template-columns: 1fr;
  }
  .sales-summary-bar {
    flex-wrap: wrap;
  }
  .summary-item {
    min-width: 45%;
  }
}

/* 상세 카드 */
.detail-card {
  background: white;
  border-radius: 10px;
  padding: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.detail-card h4 {
  font-size: 14px;
  font-weight: 600;
  color: #374151;
  margin: 0 0 12px 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 10px;
  border-bottom: 1px solid #e5e7eb;
}

.detail-card h4 i {
  color: #3b82f6;
}

.detail-table-wrap {
  max-height: 280px;
  overflow-y: auto;
}

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

.detail-table th {
  text-align: center;
  padding: 8px 6px;
  font-weight: 600;
  color: #6b7280;
  font-size: 11px;
  text-transform: uppercase;
  border-bottom: 1px solid #e5e7eb;
  position: sticky;
  top: 0;
  background: white;
}

.detail-table td {
  padding: 8px 6px;
  border-bottom: 1px solid #f3f4f6;
  color: #374151;
  text-align: center;
}

.detail-table tr:hover {
  background: #f9fafb;
}

.detail-table .text-right {
  text-align: right;
}

.detail-table .rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  background: #f3f4f6;
  color: #6b7280;
}

.detail-table .rank-badge.gold { background: #fbbf24; color: white; }
.detail-table .rank-badge.silver { background: #9ca3af; color: white; }
.detail-table .rank-badge.bronze { background: #d97706; color: white; }

.detail-table .change-up { color: #10b981; }
.detail-table .change-down { color: #ef4444; }
.detail-table .change-same { color: #6b7280; }

.detail-table .product-name {
  max-width: 180px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 매칭 탭 */
.matching-tab-content {
  display: none;
}

.matching-tab-content.active {
  display: block;
}

/* 반응형 숨김 클래스 */
@media (max-width: 1200px) {
  .hide-tablet {
    display: none !important;
  }

  .stats-tables {
    grid-template-columns: 1fr;
  }

  .stats-table-card {
    overflow: hidden !important;
  }

  .stats-table-body {
    overflow-x: hidden !important;
  }

  .stats-table-card .data-table.compact {
    table-layout: fixed !important;
    width: 100% !important;
  }

  .stats-table-card .data-table.compact th,
  .stats-table-card .data-table.compact td {
    padding: 8px 4px !important;
    font-size: 11px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  .stats-table-card .data-table.compact th:first-child,
  .stats-table-card .data-table.compact td:first-child {
    width: 22% !important;
    max-width: 90px !important;
  }

  .stats-table-card .data-table.compact th:nth-child(2),
  .stats-table-card .data-table.compact td:nth-child(2) {
    width: 12% !important;
  }

  .stats-table-card .data-table.compact th:nth-child(3),
  .stats-table-card .data-table.compact td:nth-child(3) {
    width: 22% !important;
  }

  .stats-table-card .data-table.compact th:nth-child(4),
  .stats-table-card .data-table.compact td:nth-child(4) {
    width: 22% !important;
  }

  .stats-table-card .data-table.compact th:nth-child(5),
  .stats-table-card .data-table.compact td:nth-child(5) {
    width: 12% !important;
  }

  .stats-table-card .data-table.compact th:last-child,
  .stats-table-card .data-table.compact td:last-child {
    width: 50px !important;
    min-width: 50px !important;
  }
}

@media (max-width: 768px) {
  .hide-mobile {
    display: none !important;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .header-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .date-range {
    width: 100%;
  }

  .date-range input[type="date"] {
    flex: 1;
    min-width: 0;
  }

  .stats-table-card .data-table.compact th,
  .stats-table-card .data-table.compact td {
    padding: 6px 3px;
    font-size: 10px;
  }

  .stats-table-card {
    overflow: hidden;
  }

  .stats-table-body {
    overflow-x: hidden !important;
    overflow-y: auto;
  }

  .stats-table-card .data-table.compact {
    table-layout: fixed;
    width: 100%;
  }

  .stats-table-card .data-table.compact th:first-child,
  .stats-table-card .data-table.compact td:first-child {
    width: 28%;
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .stats-table-card .data-table.compact th:nth-child(2),
  .stats-table-card .data-table.compact td:nth-child(2) {
    width: 18%;
    text-align: right;
  }

  .stats-table-card .data-table.compact th:last-child,
  .stats-table-card .data-table.compact td:last-child {
    width: 40px;
    min-width: 40px;
    max-width: 40px;
  }

  .stats-table-card .data-table.compact .btn {
    padding: 4px 6px;
    font-size: 9px;
  }

  .stats-table-card .data-table.compact .btn i {
    font-size: 10px;
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .stats-table-header h3 {
    font-size: 13px;
  }

  .stats-table-header h3 i {
    display: none;
  }

  .stats-table-card .data-table.compact th,
  .stats-table-card .data-table.compact td {
    padding: 5px 2px;
    font-size: 9px;
  }

  .stats-table-card .data-table.compact th:first-child,
  .stats-table-card .data-table.compact td:first-child {
    width: 30%;
    max-width: 70px;
  }
}

/* 상태 뱃지 */
.status-badge {
  display: inline-block;
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 20px;
}

.status-badge.match {
  background: var(--success-light);
  color: var(--success);
}

.status-badge.mismatch-plus {
  background: var(--warning-light);
  color: var(--warning);
}

.status-badge.mismatch-minus {
  background: var(--danger-light);
  color: var(--danger);
}

.diff-positive {
  color: var(--success);
  font-weight: 600;
}

.diff-negative {
  color: var(--danger);
  font-weight: 600;
}

.diff-zero {
  color: var(--gray-500);
}

.stat-card.danger .stat-icon {
  background: var(--danger-light);
  color: var(--danger);
}

/* 통계 테이블 가로스크롤 완전 제거 - 모든 해상도 */
.stats-table-card {
  overflow: hidden !important;
}

.stats-table-body {
  overflow-x: hidden !important;
  overflow-y: auto;
}

.stats-table-card .data-table.compact {
  table-layout: fixed !important;
  width: 100% !important;
}

.stats-table-card .data-table.compact th,
.stats-table-card .data-table.compact td {
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  text-align: center;
  padding: 10px 4px !important;
  font-size: 12px !important;
}

.stats-table-card .data-table.compact th:first-child,
.stats-table-card .data-table.compact td:first-child {
  width: 25% !important;
  text-align: left !important;
  padding-left: 12px !important;
}

.stats-table-card .data-table.compact th:nth-child(2),
.stats-table-card .data-table.compact td:nth-child(2) {
  width: 12% !important;
}

.stats-table-card .data-table.compact th:nth-child(3),
.stats-table-card .data-table.compact td:nth-child(3) {
  width: 22% !important;
}

.stats-table-card .data-table.compact th:nth-child(4),
.stats-table-card .data-table.compact td:nth-child(4) {
  width: 22% !important;
}

.stats-table-card .data-table.compact th:nth-child(5),
.stats-table-card .data-table.compact td:nth-child(5) {
  width: 10% !important;
}

.stats-table-card .data-table.compact th:last-child,
.stats-table-card .data-table.compact td:last-child {
  width: 9% !important;
}

@media (max-width: 1600px) {
  .stats-table-card .data-table.compact th,
  .stats-table-card .data-table.compact td {
    padding: 8px 3px !important;
    font-size: 11px !important;
  }
}

@media (max-width: 1400px) {
  .stats-table-card .data-table.compact th,
  .stats-table-card .data-table.compact td {
    padding: 7px 2px !important;
    font-size: 10px !important;
  }

  .stats-table-card .data-table.compact th:first-child,
  .stats-table-card .data-table.compact td:first-child {
    padding-left: 8px !important;
  }
}

@media (max-width: 1200px) {
  .stats-tables {
    grid-template-columns: 1fr !important;
  }

  .stats-table-card .data-table.compact th,
  .stats-table-card .data-table.compact td {
    padding: 8px 4px !important;
    font-size: 12px !important;
  }

  .stats-table-card .data-table.compact th:first-child,
  .stats-table-card .data-table.compact td:first-child {
    width: 22% !important;
  }

  .stats-table-card .data-table.compact .btn {
    padding: 4px 8px !important;
    font-size: 10px !important;
  }
}

@media (max-width: 768px) {
  .stats-table-card .data-table.compact th,
  .stats-table-card .data-table.compact td {
    padding: 6px 2px !important;
    font-size: 10px !important;
  }
}

/* ===== 리포트 헤더 ===== */
.report-header {
  background: linear-gradient(135deg, #1e3a5f 0%, #2d5a87 100%);
  color: white;
  padding: 24px 28px;
  border-radius: 16px;
  margin-bottom: 24px;
  box-shadow: 0 4px 20px rgba(30, 58, 95, 0.3);
}

.report-header-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
}

.report-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.report-title h1 {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0;
}

.report-title .report-icon {
  width: 48px;
  height: 48px;
  background: rgba(255,255,255,0.15);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.report-period {
  background: rgba(255,255,255,0.1);
  padding: 12px 16px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.report-period input[type="date"] {
  background: rgba(255,255,255,0.9);
  border: none;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 0.875rem;
  color: #1e3a5f;
}

.report-period span {
  color: rgba(255,255,255,0.7);
}

.report-period .btn {
  background: #fff;
  color: #1e3a5f;
  font-weight: 600;
}

.report-period .btn:hover {
  background: #f0f0f0;
}

.report-period select {
  background: rgba(255,255,255,0.9);
  border: none;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 0.875rem;
  color: #1e3a5f;
  cursor: pointer;
  min-width: 120px;
}

.report-period select:focus {
  outline: 2px solid rgba(255,255,255,0.5);
}

.report-period .period-divider {
  color: rgba(255,255,255,0.4);
  margin: 0 8px;
}

@media (max-width: 1200px) {
  .report-period {
    flex-wrap: wrap;
    gap: 8px;
  }

  .report-period .period-divider {
    display: none;
  }
}

.report-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.report-summary-card {
  background: rgba(255,255,255,0.1);
  padding: 16px 20px;
  border-radius: 12px;
  text-align: center;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.1);
}

.report-summary-card .label {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.7);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.report-summary-card .value {
  font-size: 1.5rem;
  font-weight: 700;
}

/* ===== 차트 섹션 ===== */
.charts-section {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}

.chart-card-new {
  background: white;
  border-radius: 16px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  overflow: hidden;
}

.chart-card-header {
  padding: 16px 20px;
  border-bottom: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chart-card-header h3 {
  font-size: 0.9375rem;
  font-weight: 600;
  color: #1e3a5f;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.chart-card-header h3 i {
  color: #4F46E5;
}

.chart-card-body {
  padding: 20px;
  height: 320px;
  position: relative;
}

.chart-loading {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #fff;
  gap: 12px;
}

.chart-loading .loader {
  width: 36px;
  height: 36px;
}

.chart-empty {
  color: #888;
  font-size: 0.875rem;
}

/* ===== 테이블 섹션 ===== */
.tables-section {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}

.table-card-new {
  background: white;
  border-radius: 16px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  overflow: hidden;
}

.table-card-new.full-width {
  grid-column: 1 / -1;
}

.table-card-new.half-width {
  grid-column: span 2;
}

.table-card-header {
  padding: 14px 18px;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.table-card-header h3 {
  font-size: 0.875rem;
  font-weight: 600;
  color: #1e3a5f;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.table-card-header h3 i {
  color: #4F46E5;
  font-size: 0.9rem;
}

.table-card-header .badge-count {
  background: #4F46E5;
  color: white;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.7rem;
  font-weight: 600;
}

.table-card-body {
  max-height: 350px;
  overflow-y: auto;
}

/* 리포트 테이블 스타일 */
.report-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
}

.report-table th {
  background: #f8fafc;
  padding: 10px 12px;
  text-align: center;
  font-weight: 600;
  color: #64748b;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  border: 1px solid #e5e7eb;
  position: sticky;
  top: 0;
  z-index: 1;
}

.report-table td {
  padding: 10px 12px;
  text-align: center;
  border: 1px solid #e5e7eb;
  color: #334155;
}

.report-table tbody tr:hover {
  background: #f8fafc;
}

.report-table .text-right {
  text-align: right;
}

.report-table .text-center {
  text-align: center;
}

.report-table .name-cell {
  font-weight: 500;
  color: #1e293b;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.report-table .amount-cell {
  font-family: 'SF Mono', 'Monaco', monospace;
  font-size: 0.8rem;
}

/* 비중 바 */
.ratio-bar {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ratio-bar-bg {
  flex: 1;
  height: 6px;
  background: #e2e8f0;
  border-radius: 3px;
  overflow: hidden;
  min-width: 50px;
}

.ratio-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.3s;
}

.ratio-bar-fill.blue { background: linear-gradient(90deg, #3b82f6, #60a5fa); }
.ratio-bar-fill.green { background: linear-gradient(90deg, #10b981, #34d399); }
.ratio-bar-fill.orange { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.ratio-bar-fill.purple { background: linear-gradient(90deg, #8b5cf6, #a78bfa); }

.ratio-bar span {
  font-size: 0.75rem;
  color: #64748b;
  min-width: 40px;
  text-align: right;
}

/* 순위 뱃지 */
.rank-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
}

.rank-num.rank-1 { background: linear-gradient(135deg, #fbbf24, #f59e0b); color: white; }
.rank-num.rank-2 { background: linear-gradient(135deg, #94a3b8, #64748b); color: white; }
.rank-num.rank-3 { background: linear-gradient(135deg, #d97706, #b45309); color: white; }
.rank-num.rank-other { background: #f1f5f9; color: #64748b; }

/* 상세보기 버튼 */
.btn-detail {
  padding: 4px 10px;
  background: #f1f5f9;
  border: none;
  border-radius: 6px;
  color: #4F46E5;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-detail:hover {
  background: #4F46E5;
  color: white;
}

/* 다운로드 액션 바 */
.action-bar {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-bottom: 20px;
}

.action-bar .btn {
  padding: 8px 16px;
  font-size: 0.8125rem;
}

/* ===== 리포트 반응형 ===== */
@media (max-width: 1400px) {
  .report-summary-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .charts-section {
    grid-template-columns: 1fr;
  }

  .tables-section {
    grid-template-columns: repeat(2, 1fr);
  }

  .table-card-new.half-width {
    grid-column: span 1;
  }
}

@media (max-width: 1024px) {
  .tables-section {
    grid-template-columns: 1fr;
  }

  .table-card-new.half-width,
  .table-card-new.full-width {
    grid-column: span 1;
  }

  .report-header-top {
    flex-direction: column;
    gap: 16px;
  }

  .report-period {
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
  }
}

@media (max-width: 768px) {
  .report-header {
    padding: 16px;
  }

  .report-summary-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .report-summary-card {
    padding: 12px;
  }

  .report-summary-card .value {
    font-size: 1.125rem;
  }

  .report-table th,
  .report-table td {
    padding: 8px 10px;
    font-size: 0.75rem;
  }

  .chart-card-body {
    height: 250px;
  }
}

/* ===== 판매내역 로딩 오버레이 ===== */
#page-sales .table-container {
  position: relative;
  min-height: 200px;
}

.sales-loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.95);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 10;
  gap: 16px;
  border-radius: 12px;
}

.sales-loading-overlay .loader {
  width: 48px;
  height: 48px;
  border-width: 4px;
}

.sales-loading-overlay .loading-text {
  color: var(--gray-600);
  font-size: 0.9375rem;
  font-weight: 500;
}

.sales-loading-overlay .loading-subtext {
  color: var(--gray-400);
  font-size: 0.8125rem;
}

/* ===== 판매내역 테이블 ===== */
#sales-table {
  width: 100%;
  table-layout: auto;
  border-collapse: collapse;
}

#sales-table th,
#sales-table td {
  white-space: nowrap;
  text-align: center;
  vertical-align: middle;
  border: 1px solid var(--gray-200);
  padding: 12px 14px;
}

/* 헤더 스타일 */
#sales-table th {
  background: var(--gray-50);
  font-weight: 600;
  font-size: 0.8125rem;
  color: var(--gray-600);
  border-bottom: 2px solid var(--gray-300);
}

/* 행 호버 효과 */
#sales-table tbody tr:hover {
  background: var(--gray-50);
}

/* 상품명, 옵션명 - 길면 생략 */
#sales-table td:nth-child(6),
#sales-table td:nth-child(7) {
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 체크박스 컬럼 */
#sales-table th:nth-child(1),
#sales-table td:nth-child(1) {
  width: 40px;
}

/* 작업 컬럼 */
#sales-table th:nth-child(11),
#sales-table td:nth-child(11) {
  width: 80px;
}

/* ===== 커스텀 툴팁 ===== */
.custom-tooltip {
  position: fixed;
  z-index: 99999;
  background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
  color: #fff;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 0.8125rem;
  max-width: 400px;
  word-break: break-all;
  line-height: 1.6;
  box-shadow: 0 10px 40px rgba(0,0,0,0.3), 0 0 0 1px rgba(255,255,255,0.1) inset;
  pointer-events: none;
  opacity: 0;
  transform: translateY(8px) scale(0.95);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  backdrop-filter: blur(10px);
}

.custom-tooltip.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.custom-tooltip::before {
  content: '';
  position: absolute;
  top: -8px;
  left: 24px;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-bottom: 8px solid #1e293b;
}

.custom-tooltip.tooltip-top::before {
  top: auto;
  bottom: -8px;
  border-bottom: none;
  border-top: 8px solid #334155;
}

.custom-tooltip .tooltip-label {
  font-size: 0.6875rem;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
  font-weight: 600;
}

.custom-tooltip .tooltip-text {
  color: #f1f5f9;
  font-weight: 400;
}

/* 툴팁 대상 셀 */
.cell-truncate {
  max-width: 250px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: default;
}

/* ===== 버튼 로딩 스피너 ===== */
.btn-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: btnSpin 0.6s linear infinite;
  vertical-align: middle;
  margin-right: 6px;
}

.btn-secondary .btn-spinner,
.btn-outline .btn-spinner {
  border-color: rgba(0,0,0,0.2);
  border-top-color: var(--gray-600);
}

.btn-loading {
  pointer-events: none;
  opacity: 0.8;
}

@keyframes btnSpin {
  to { transform: rotate(360deg); }
}

/* 다중 선택 드롭다운 */
.multi-select-dropdown {
  position: relative;
  min-width: 160px;
}

.multi-select-display {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: white;
  cursor: pointer;
  font-size: 14px;
  min-height: 38px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.multi-select-display:hover {
  border-color: #3b82f6;
}

.multi-select-display.active {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.multi-select-text {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #374151;
}

.multi-select-display i {
  margin-left: 8px;
  color: #6b7280;
  font-size: 12px;
  transition: transform 0.2s;
}

.multi-select-display.active i {
  transform: rotate(180deg);
}

.multi-select-options {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.15);
  z-index: 1000;
  max-height: 280px;
  overflow-y: auto;
}

.multi-select-option {
  padding: 8px 12px;
}

.multi-select-option label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 14px;
  color: #374151;
}

.multi-select-option label:hover {
  color: #1e40af;
}

.multi-select-option input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #3b82f6;
  cursor: pointer;
}

.multi-select-divider {
  height: 1px;
  background: #e5e7eb;
  margin: 4px 0;
}

.multi-select-items {
  max-height: 200px;
  overflow-y: auto;
}

.multi-select-item {
  padding: 6px 12px;
}

.multi-select-item label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
  color: #4b5563;
}

.multi-select-item label:hover {
  color: #1e40af;
  background: #f8fafc;
}

.multi-select-item input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: #3b82f6;
  cursor: pointer;
}
