:root {
  --primary-color: #4361ee;
  --secondary-color: #3f37c9;
  --success-color: #06d6a0;
  --warning-color: #ffd166;
  --danger-color: #ef476f;
  --dark-color: #1a1a2e;
  --light-color: #f8f9fa;
  --sidebar-width: 260px;
  --header-height: 60px;
}

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

body {
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  background-color: #f0f2f5;
  color: #333;
}

/* 로그인 화면 */
.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
}

.login-box {
  background: white;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  width: 100%;
  max-width: 400px;
  overflow: hidden;
}

.login-header {
  background: var(--dark-color);
  color: white;
  padding: 30px;
  text-align: center;
}

.login-header i {
  font-size: 3rem;
  margin-bottom: 10px;
  display: block;
}

.login-header h2 {
  font-size: 1.5rem;
  font-weight: 600;
}

.login-body {
  padding: 30px;
}

/* 사이드바 */
.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--dark-color);
  color: white;
  z-index: 1000;
  transition: transform 0.3s ease;
}

.sidebar.collapsed {
  transform: translateX(-100%);
}

.sidebar-header {
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header i {
  font-size: 1.8rem;
  color: var(--primary-color);
}

.sidebar-header span {
  font-size: 1.2rem;
  font-weight: 600;
}

.sidebar-menu {
  list-style: none;
  padding: 15px 0;
}

.menu-item {
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: all 0.2s;
  border-left: 3px solid transparent;
}

.menu-item:hover {
  background: rgba(255, 255, 255, 0.1);
}

.menu-item.active {
  background: rgba(67, 97, 238, 0.2);
  border-left-color: var(--primary-color);
}

.menu-item i {
  font-size: 1.2rem;
  width: 24px;
}

/* 메인 콘텐츠 */
.main-content {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  transition: margin-left 0.3s ease;
}

.sidebar.collapsed + .main-content {
  margin-left: 0;
}

.main-header {
  height: var(--header-height);
  background: white;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 20px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  position: sticky;
  top: 0;
  z-index: 100;
}

.main-header h1 {
  font-size: 1.3rem;
  font-weight: 600;
  margin: 0;
  flex: 1;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 15px;
}

#lastUpdate {
  font-size: 0.85rem;
  color: #666;
}

.sidebar-toggle {
  font-size: 1.5rem;
  color: #333;
}

/* 페이지 컨테이너 */
.page-container {
  padding: 20px;
}

.page-content {
  display: none;
}

.page-content.active {
  display: block;
}

/* 카드 스타일 */
.stat-card {
  background: white;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: transform 0.2s;
}

.stat-card:hover {
  transform: translateY(-2px);
}

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

.stat-card .icon.primary { background: rgba(67, 97, 238, 0.15); color: var(--primary-color); }
.stat-card .icon.success { background: rgba(6, 214, 160, 0.15); color: var(--success-color); }
.stat-card .icon.warning { background: rgba(255, 209, 102, 0.15); color: #cc9a00; }
.stat-card .icon.danger { background: rgba(239, 71, 111, 0.15); color: var(--danger-color); }

.stat-card .value {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 5px;
}

.stat-card .label {
  color: #666;
  font-size: 0.9rem;
}

.stat-card .change {
  font-size: 0.85rem;
  margin-top: 8px;
}

.stat-card .change.up { color: var(--success-color); }
.stat-card .change.down { color: var(--danger-color); }

/* 테이블 컨테이너 */
.table-container {
  background: white;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.table-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  flex-wrap: wrap;
  gap: 10px;
}

.table-header h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0;
}

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

/* DataTables 커스텀 */
.dataTables_wrapper .dataTables_filter input {
  border-radius: 8px;
  border: 1px solid #ddd;
  padding: 6px 12px;
}

.dataTables_wrapper .dataTables_length select {
  border-radius: 8px;
  border: 1px solid #ddd;
  padding: 4px 8px;
}

table.dataTable {
  border-collapse: collapse !important;
}

table.dataTable thead th {
  background: #f8f9fa;
  font-weight: 600;
  font-size: 0.9rem;
  border-bottom: 2px solid #dee2e6 !important;
}

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

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

.badge-status.active { background: rgba(6, 214, 160, 0.15); color: #059669; }
.badge-status.inactive { background: rgba(156, 163, 175, 0.15); color: #6b7280; }
.badge-status.pending { background: rgba(255, 209, 102, 0.15); color: #b45309; }
.badge-status.shipping { background: rgba(67, 97, 238, 0.15); color: var(--primary-color); }
.badge-status.completed { background: rgba(6, 214, 160, 0.15); color: #059669; }

/* 모달 커스텀 */
.modal-content {
  border-radius: 16px;
  border: none;
}

.modal-header {
  border-bottom: 1px solid #eee;
  padding: 20px 25px;
}

.modal-body {
  padding: 25px;
}

.modal-footer {
  border-top: 1px solid #eee;
  padding: 15px 25px;
}

/* 폼 스타일 */
.form-label {
  font-weight: 500;
  font-size: 0.9rem;
  margin-bottom: 6px;
}

.form-control, .form-select {
  border-radius: 8px;
  padding: 10px 14px;
  border: 1px solid #ddd;
}

.form-control:focus, .form-select:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.15);
}

/* 버튼 스타일 */
.btn {
  border-radius: 8px;
  padding: 8px 16px;
  font-weight: 500;
  transition: all 0.2s;
}

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

.btn-primary:hover {
  background: var(--secondary-color);
  border-color: var(--secondary-color);
}

.btn-success {
  background: var(--success-color);
  border-color: var(--success-color);
}

/* 탭 스타일 */
.nav-tabs {
  border-bottom: 2px solid #eee;
}

.nav-tabs .nav-link {
  border: none;
  color: #666;
  font-weight: 500;
  padding: 12px 20px;
}

.nav-tabs .nav-link.active {
  color: var(--primary-color);
  border-bottom: 2px solid var(--primary-color);
  margin-bottom: -2px;
}

/* 차트 컨테이너 */
.chart-container {
  background: white;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.chart-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 15px;
}

/* 파일 업로드 */
.file-upload-zone {
  border: 2px dashed #ddd;
  border-radius: 12px;
  padding: 40px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}

.file-upload-zone:hover {
  border-color: var(--primary-color);
  background: rgba(67, 97, 238, 0.05);
}

.file-upload-zone.dragover {
  border-color: var(--primary-color);
  background: rgba(67, 97, 238, 0.1);
}

.file-upload-zone i {
  font-size: 3rem;
  color: #999;
  margin-bottom: 15px;
}

/* 로딩 오버레이 */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

/* 플랫폼 아이콘 색상 */
.platform-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 500;
}

.platform-badge.naver { background: #03c75a20; color: #03c75a; }
.platform-badge.coupang { background: #f5363620; color: #f53636; }
.platform-badge.gmarket { background: #00a63e20; color: #00a63e; }
.platform-badge.st11 { background: #ff500020; color: #ff5000; }
.platform-badge.auction { background: #ff980020; color: #ff9800; }

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

  .sidebar.show {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
  }

  .stat-card .value {
    font-size: 1.4rem;
  }

  .table-header {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* 필터 섹션 */
.filter-section {
  background: white;
  border-radius: 12px;
  padding: 15px 20px;
  margin-bottom: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.filter-row {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
  align-items: flex-end;
}

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

/* 빠른 액션 버튼 */
.quick-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.quick-action-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: white;
  border: 1px solid #ddd;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.quick-action-btn:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

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

/* 버전 뱃지 */
.version-badge {
  display: inline-block;
  padding: 2px 8px;
  background: #e0e7ff;
  color: #4338ca;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
}

/* 액션 드롭다운 */
.action-dropdown .dropdown-toggle::after {
  display: none;
}

.action-dropdown .btn {
  padding: 4px 8px;
}
