/**
 * Dealy - 딜러 대시보드 스타일
 * Phase 2: 프로 딜러 관리 도구
 */

/* ========== 대시보드 모달 ========== */
.admin-dashboard-modal {
  max-width: 800px;
  max-height: 90vh;
}

.admin-dashboard-modal .modal-body {
  padding: 0;
}

/* ========== 로딩 상태 ========== */
.dashboard-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  text-align: center;
}

.dashboard-loading .spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--gray-200);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 1rem;
}

.dashboard-loading p {
  color: var(--text-secondary);
  font-size: 14px;
}

/* ========== 대시보드 섹션 ========== */
.dashboard-section {
  padding: 1.5rem;
  border-bottom: 1px solid var(--gray-200);
}

.dashboard-section:last-child {
  border-bottom: none;
}

.dashboard-section-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

/* ========== 재고 현황 카드 ========== */
.dashboard-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}

.dashboard-stat-card {
  background: var(--gray-50);
  border-radius: var(--radius-lg);
  padding: 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.stat-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-icon-total {
  background: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
}

.stat-icon-selling {
  background: rgba(34, 197, 94, 0.1);
  color: var(--primary);
}

.stat-icon-sold {
  background: rgba(156, 163, 175, 0.1);
  color: var(--gray-600);
}

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

.stat-label {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 0.25rem;
}

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

/* ========== 재무 요약 ========== */
.dashboard-financial-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.financial-card {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  color: white;
}

.financial-card-profit {
  background: linear-gradient(135deg, #00D9A3 0%, #00BF8F 100%);
}

.financial-card-capital {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.financial-label {
  font-size: 13px;
  opacity: 0.9;
  margin-bottom: 0.5rem;
}

.financial-value {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.financial-sub {
  font-size: 11px;
  opacity: 0.75;
}

/* ========== 알림 ========== */
.dashboard-alert {
  background: #fef3c7;
  border: 1px solid #fbbf24;
  border-radius: var(--radius-lg);
  padding: 1rem;
  display: flex;
  gap: 0.75rem;
}

.alert-icon {
  color: #f59e0b;
  flex-shrink: 0;
  margin-top: 0.125rem;
}

.alert-content {
  flex: 1;
}

.alert-text {
  font-size: 14px;
  color: #92400e;
  line-height: 1.5;
}

.alert-text strong {
  font-weight: 700;
  color: #78350f;
}

.missing-buyer-list {
  margin-top: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.missing-buyer-item {
  background: white;
  border-radius: var(--radius-md);
  padding: 0.75rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
}

.missing-buyer-name {
  font-weight: 600;
  color: var(--text-primary);
}

.btn-add-buyer-small {
  background: var(--primary);
  color: white;
  border: none;
  padding: 0.375rem 0.75rem;
  border-radius: var(--radius-md);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-add-buyer-small:hover {
  background: var(--primary-dark);
}

/* ========== 판매 히스토리 ========== */
.sales-history-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.sales-history-item {
  background: var(--gray-50);
  border-radius: var(--radius-lg);
  padding: 1rem;
  display: flex;
  gap: 1rem;
  cursor: pointer;
  transition: all 0.2s;
}

.sales-history-item:hover {
  background: var(--gray-100);
  transform: translateX(2px);
}

.sales-history-date {
  width: 60px;
  flex-shrink: 0;
  text-align: center;
}

.history-day {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
  margin-bottom: 0.25rem;
}

.history-month {
  font-size: 11px;
  color: var(--text-secondary);
}

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

.history-car-name {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.375rem;
  font-size: 14px;
}

.history-details {
  display: flex;
  gap: 1rem;
  font-size: 12px;
  color: var(--text-secondary);
}

.history-detail-item {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.history-profit {
  font-weight: 600;
  color: var(--primary);
}

.history-profit.negative {
  color: #ef4444;
}

/* ========== 빈 상태 ========== */
.empty-state-small {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--text-secondary);
  font-size: 14px;
}

/* ========== 반응형 (모바일) ========== */
@media (max-width: 640px) {
  .dashboard-stats-grid {
    grid-template-columns: 1fr;
  }
  
  .dashboard-financial-grid {
    grid-template-columns: 1fr;
  }
  
  .financial-value {
    font-size: 20px;
  }
}

/* ========== 고해상도 모드 ========== */
body.compact-mode .dashboard-section-title {
  font-size: 14px;
}

body.compact-mode .stat-value {
  font-size: 18px;
}

body.compact-mode .financial-value {
  font-size: 20px;
}

body.compact-mode .history-car-name {
  font-size: 13px;
}
