/* 대시보드 페이지 전용 스타일 (CSS 변수 적용 - 다크모드 지원) */

/* ========== 메인 레이아웃 ========== */
.dashboard-main {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ========== Hero 섹션 (오늘의 매출) ========== */
.hero-section {
  background: linear-gradient(135deg, var(--color-primary) 0%, #4f46e5 100%);
  border-radius: var(--border-radius-lg, 12px);
  padding: 32px 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: white;
  box-shadow: 0 4px 20px rgba(79, 70, 229, 0.3);
}

.hero-content {
  flex: 1;
}

.hero-label {
  font-size: 14px;
  opacity: 0.9;
  margin-bottom: 8px;
  font-weight: 500;
}

.hero-value {
  font-size: 48px;
  font-weight: 700;
  letter-spacing: -1px;
  margin-bottom: 12px;
}

.hero-meta {
  font-size: 15px;
  opacity: 0.85;
}

.hero-divider {
  margin: 0 8px;
  opacity: 0.5;
}

.hero-trend {
  background: rgba(255, 255, 255, 0.15);
  border-radius: var(--border-radius);
  padding: 16px 24px;
  text-align: center;
  backdrop-filter: blur(10px);
}

.hero-trend .trend-value {
  display: block;
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 4px;
}

.hero-trend .trend-label {
  font-size: 12px;
  opacity: 0.8;
}

.hero-trend.positive .trend-value {
  color: #4ade80;
}

.hero-trend.negative .trend-value {
  color: #fbbf24;
}

/* ========== 핵심 지표 그리드 ========== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.stat-card {
  background: var(--color-bg-card);
  border-radius: var(--border-radius);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--box-shadow);
  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 {
  font-size: 32px;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-gray-100);
  border-radius: var(--border-radius);
}

.stat-info {
  flex: 1;
}

.stat-label {
  font-size: 13px;
  color: var(--color-text-secondary);
  margin-bottom: 4px;
}

.stat-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--color-text-primary);
}

/* ========== 2열 레이아웃 ========== */
.dashboard-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

/* ========== 섹션 공통 ========== */
.activity-section,
.pending-section,
.status-section {
  background: var(--color-bg-card);
  border-radius: var(--border-radius);
  padding: 20px;
  box-shadow: var(--box-shadow);
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--color-border);
}

.section-header h2 {
  font-size: 16px;
  font-weight: 600;
  margin: 0;
  color: var(--color-text-primary);
}

.section-link {
  font-size: 13px;
  color: var(--color-primary);
  text-decoration: none;
}

.section-link:hover {
  text-decoration: underline;
}

/* ========== 실시간 활동 피드 ========== */
.live-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--color-danger);
  text-transform: uppercase;
}

.live-dot {
  width: 8px;
  height: 8px;
  background: var(--color-danger);
  border-radius: 50%;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

.activity-feed {
  max-height: 320px;
  overflow-y: auto;
}

.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--color-table-border);
}

.activity-item:last-child {
  border-bottom: none;
}

.activity-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.activity-icon.payment {
  background: rgba(16, 185, 129, 0.15);
}

.activity-icon.order {
  background: rgba(59, 130, 246, 0.15);
}

.activity-icon.customer {
  background: rgba(139, 92, 246, 0.15);
}

.activity-content {
  flex: 1;
  min-width: 0;
}

.activity-text {
  font-size: 14px;
  color: var(--color-text-primary);
  margin-bottom: 2px;
}

.activity-text strong {
  font-weight: 600;
}

.activity-time {
  font-size: 12px;
  color: var(--color-text-light);
}

.activity-amount {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-success);
  white-space: nowrap;
}

/* ========== 대기중 주문 ========== */
.pending-orders {
  max-height: 320px;
  overflow-y: auto;
}

.pending-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--color-gray-50);
  border-radius: var(--border-radius);
  margin-bottom: 8px;
  transition: background 0.15s;
}

.pending-item:last-child {
  margin-bottom: 0;
}

.pending-item:hover {
  background: var(--color-gray-100);
}

.pending-info {
  flex: 1;
  min-width: 0;
}

.pending-customer {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-primary);
  margin-bottom: 2px;
}

.pending-product {
  font-size: 13px;
  color: var(--color-text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pending-amount {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-primary);
  white-space: nowrap;
}

.pending-action {
  padding: 6px 12px;
  font-size: 12px;
  background: var(--color-primary);
  color: white;
  border: none;
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: background 0.15s;
}

.pending-action:hover {
  background: var(--color-primary-dark, #4338ca);
}

/* ========== 연동 상태 ========== */
.status-grid {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}

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

.status-label {
  font-size: 14px;
  color: var(--color-text-secondary);
}

.status-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}

.status-badge.connected {
  background: rgba(16, 185, 129, 0.15);
  color: var(--color-success);
}

.status-badge.disconnected {
  background: rgba(239, 68, 68, 0.15);
  color: var(--color-danger);
}

.status-badge.pending {
  background: rgba(245, 158, 11, 0.15);
  color: var(--color-warning);
}

/* ========== Empty State ========== */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--color-text-light);
}

.empty-state .empty-icon {
  font-size: 40px;
  margin-bottom: 12px;
  opacity: 0.5;
}

.empty-state p {
  font-size: 14px;
  margin: 0;
}

/* ========== 스켈레톤 로딩 ========== */
.skeleton {
  animation: skeleton-loading 1.5s infinite ease-in-out;
  background: linear-gradient(90deg, var(--color-gray-100) 25%, var(--color-gray-200) 50%, var(--color-gray-100) 75%);
  background-size: 200% 100%;
  border-radius: 4px;
}

@keyframes skeleton-loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-hero-value {
  height: 48px;
  width: 200px;
  margin: 10px 0;
}

.skeleton-stat-value {
  height: 28px;
  width: 80px;
}

.skeleton-row {
  height: 48px;
  width: 100%;
  margin: 8px 0;
}

/* ========== 반응형 ========== */
@media (max-width: 1024px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .hero-section {
    flex-direction: column;
    text-align: center;
    padding: 24px 20px;
  }

  .hero-value {
    font-size: 36px;
  }

  .hero-trend {
    margin-top: 20px;
    width: 100%;
  }

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

  .stat-card {
    padding: 16px;
  }

  .stat-icon {
    width: 44px;
    height: 44px;
    font-size: 24px;
  }

  .stat-value {
    font-size: 20px;
  }

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

  .status-grid {
    flex-direction: column;
    gap: 12px;
  }
}

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

  .stat-card {
    flex-direction: row;
  }
}
