/* GROW-UP Styles v2 — UID + 거래구분 기반 */

/* ── 사이드바 ── */
.sidebar {
  background: linear-gradient(180deg, #0f172a 0%, #1e3a8a 100%);
}
.logo-text {
  background: linear-gradient(135deg, #60a5fa, #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.sidebar-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 8px;
  color: #94a3b8; font-size: 0.875rem;
  cursor: pointer; transition: all .15s;
}
.sidebar-item:hover { background: rgba(255,255,255,.08); color: #e2e8f0; }
.sidebar-item.active { background: rgba(59,130,246,.25); color: #93c5fd; font-weight: 600; }
.sidebar-item .icon { width: 16px; text-align: center; flex-shrink: 0; }

/* ── 헤더 ── */
.top-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 24px; background: white;
  border-bottom: 1px solid #e2e8f0; flex-wrap: wrap; gap: 8px;
}

/* ── 카드 ── */
.stat-card {
  background: white; border-radius: 12px;
  padding: 20px; border: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(0,0,0,.05);
}
.kpi-card {
  background: white; border-radius: 10px;
  padding: 16px; border: 1px solid #e2e8f0;
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
}
.kpi-card.success { border-left: 3px solid #22c55e; }
.kpi-card.warning { border-left: 3px solid #f59e0b; }

/* ── 인센티브 요약 박스 ── */
.incentive-summary {
  background: linear-gradient(135deg, #1e3a8a 0%, #1d4ed8 50%, #2563eb 100%);
  border-radius: 16px; padding: 24px;
  box-shadow: 0 4px 15px rgba(37,99,235,.3);
}

/* ── 섹션 타이틀 ── */
.section-title {
  font-size: 0.7rem; font-weight: 700; color: #9ca3af;
  text-transform: uppercase; letter-spacing: .05em; margin-bottom: 0.75rem;
}

/* ── 버튼 ── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: 8px; font-size: .875rem;
  font-weight: 500; cursor: pointer; transition: all .15s;
  border: 1px solid transparent; white-space: nowrap;
}
.btn-primary { background: #2563eb; color: white; }
.btn-primary:hover:not(:disabled) { background: #1d4ed8; }
.btn-outline { background: white; color: #374151; border-color: #d1d5db; }
.btn-outline:hover:not(:disabled) { background: #f9fafb; border-color: #9ca3af; }
.btn-sm { padding: 5px 10px; font-size: .8rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ── 배지 ── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 999px;
  font-size: .7rem; font-weight: 600;
}
.badge-info    { background: #dbeafe; color: #1e40af; }
.badge-success { background: #dcfce7; color: #15803d; }
.badge-warning { background: #fef9c3; color: #a16207; }
.badge-danger  { background: #fee2e2; color: #dc2626; }
.badge-gray    { background: #f1f5f9; color: #64748b; }

/* ── 폼 ── */
.form-input {
  padding: 8px 12px; border: 1px solid #d1d5db; border-radius: 8px;
  font-size: .875rem; color: #374151; background: white;
  transition: border-color .15s;
}
.form-input:focus { outline: none; border-color: #2563eb; box-shadow: 0 0 0 2px rgba(37,99,235,.15); }

/* ── 테이블 ── */
.data-table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.data-table thead tr { background: #f8fafc; border-bottom: 2px solid #e2e8f0; }
.data-table thead th { padding: 10px 12px; text-align: left; font-size: .7rem; font-weight: 700; color: #64748b; text-transform: uppercase; white-space: nowrap; }
.data-table tbody tr { border-bottom: 1px solid #f1f5f9; transition: background .1s; }
.data-table tbody tr:hover { background: #f8fafc; }
.data-table td { padding: 10px 12px; color: #374151; }
.data-table tfoot td { padding: 10px 12px; border-top: 2px solid #e2e8f0; }
.data-table .num { text-align: right; font-variant-numeric: tabular-nums; }

/* ── 랭킹 배지 ── */
.rank-badge {
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: .8rem; flex-shrink: 0;
}
.rank-1 { background: linear-gradient(135deg,#fbbf24,#f59e0b); color: white; box-shadow: 0 2px 6px rgba(251,191,36,.4); }
.rank-2 { background: linear-gradient(135deg,#94a3b8,#64748b); color: white; }
.rank-3 { background: linear-gradient(135deg,#cd7c42,#b45309); color: white; }
.rank-other { background: #f1f5f9; color: #64748b; }

/* ── 진행 막대 ── */
.progress-bar { height: 5px; background: #f1f5f9; border-radius: 999px; overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg,#2563eb,#60a5fa); border-radius: 999px; transition: width .4s; }

/* ── 변화율 ── */
.change-up   { color: #16a34a; font-weight: 700; }
.change-down { color: #dc2626; font-weight: 700; }
.change-same { color: #6b7280; font-weight: 600; }

/* ── 스피너 ── */
.spinner {
  width: 2rem; height: 2rem;
  border: 3px solid #e2e8f0; border-top-color: #2563eb;
  border-radius: 50%; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── 토스트 ── */
.toast {
  position: fixed; bottom: 24px; right: 24px; z-index: 9999;
  padding: 12px 18px; border-radius: 10px; font-size: .875rem;
  font-weight: 500; box-shadow: 0 4px 20px rgba(0,0,0,.15);
  animation: toastIn .3s ease;
}
.toast-success { background: #dcfce7; color: #15803d; border: 1px solid #86efac; }
.toast-error   { background: #fee2e2; color: #dc2626; border: 1px solid #fca5a5; }
.toast-info    { background: #dbeafe; color: #1e40af; border: 1px solid #93c5fd; }
.toast-warning { background: #fefce8; color: #a16207; border: 1px solid #fde047; }
@keyframes toastIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ── 업로드 존 ── */
.upload-zone {
  border: 2px dashed #d1d5db; border-radius: 10px;
  padding: 32px 16px; text-align: center; cursor: pointer;
  transition: all .2s; background: #fafafa;
}
.upload-zone:hover, .upload-zone.dragging {
  border-color: #2563eb; background: #eff6ff;
}

/* ── 탭 네비게이션 ── */
.tab-nav {
  display: flex; gap: 4px; border-bottom: 2px solid #e2e8f0;
  margin-bottom: 20px; overflow-x: auto;
}
.tab-item {
  padding: 10px 18px; font-size: .875rem; font-weight: 500;
  color: #6b7280; cursor: pointer; white-space: nowrap;
  border-bottom: 2px solid transparent; margin-bottom: -2px; transition: all .15s;
}
.tab-item:hover { color: #374151; }
.tab-item.active { color: #2563eb; border-bottom-color: #2563eb; font-weight: 600; }

/* ── 빈 상태 ── */
.empty-state {
  text-align: center; padding: 48px 16px; color: #9ca3af;
}
.empty-state i { font-size: 3rem; margin-bottom: 12px; display: block; }

/* ── 반응형 ── */
@media (max-width: 640px) {
  .sidebar { display: none; }
  .top-header { padding: 10px 16px; }
  main { padding: 16px !important; }
  .kpi-card { padding: 12px; }
  .stat-card { padding: 16px; }
}
