/* ==================== DASHBOARD DE VENDAS ==================== */

.content-section {
  display: none;
  padding: 0;
  background: #f8fafc;
  min-height: calc(100vh - 80px);
}

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

.main-content {
  margin-left: 240px;
  padding: 0;
  min-height: 100vh;
  background: #f8fafc;
}

#dashboard-section {
  padding: 0;
  background: #f8fafc;
  min-height: calc(100vh - 80px);
}

.section-header {
  background: white;
  padding: 24px 32px;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.section-title h1 {
  font-size: 28px;
  font-weight: 700;
  color: #1e293b;
  margin: 0 0 8px 0;
}

.section-subtitle {
  font-size: 14px;
  color: #64748b;
  margin: 0;
}

.section-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

#dashboard-content {
  padding: 32px;
  max-width: 1600px;
  margin: 0 auto;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.stat-box {
  background: white;
  padding: 20px;
  border-radius: 12px;
  border-left: 4px solid #6366f1;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  transition: all 0.3s ease;
}

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

.stat-box-label {
  font-size: 12px;
  color: #64748b;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.stat-box-value {
  font-size: 24px;
  font-weight: 700;
  color: #1e293b;
  line-height: 1.2;
}

.kpi-card {
  background: white;
  border-radius: 12px;
  padding: 20px;
  border: 1px solid #e2e8f0;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.kpi-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: #6366f1;
}

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

.kpi-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  color: #64748b;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

.kpi-value {
  font-size: 32px;
  font-weight: 700;
  color: #6366f1;
  margin-bottom: 8px;
  line-height: 1.2;
}

.kpi-subtitle {
  font-size: 12px;
  color: #64748b;
}

.kpi-icon {
  position: absolute;
  top: 16px;
  right: 16px;
  font-size: 32px;
  opacity: 0.1;
  color: #6366f1;
}

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

.chart-card {
  background: white;
  border-radius: 12px;
  padding: 24px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  transition: all 0.3s ease;
}

.chart-card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.chart-card h3 {
  margin-bottom: 20px;
  font-weight: 700;
  font-size: 18px;
  color: #1e293b;
}

.chart-container {
  position: relative;
  height: 300px;
}

.table-section {
  background: white;
  border-radius: 12px;
  padding: 24px;
  border: 1px solid #e2e8f0;
  margin-bottom: 32px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.table-section h3 {
  margin-bottom: 20px;
  font-weight: 700;
  font-size: 18px;
  color: #1e293b;
}

.table-wrapper {
  overflow-x: auto;
  max-height: 600px;
  overflow-y: auto;
  border-radius: 8px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.data-table thead {
  background: #f8fafc;
  position: sticky;
  top: 0;
  z-index: 10;
}

.data-table th {
  padding: 14px 16px;
  text-align: left;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0.5px;
  color: #475569;
  border-bottom: 2px solid #e2e8f0;
}

.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid #f1f5f9;
  color: #64748b;
}

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

.data-table tbody tr:nth-child(even) {
  background: rgba(99, 102, 241, 0.02);
}

.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: #64748b;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #e2e8f0;
  border-top-color: #6366f1;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 16px;
}

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

.loading-state p {
  font-size: 14px;
  color: #64748b;
  margin: 0;
}

/* Filtros do Dashboard */
.dashboard-filters {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
  align-items: center;
}

.dashboard-filters select {
  padding: 10px 16px;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  font-size: 14px;
  background: white;
  color: #1e293b;
  cursor: pointer;
  transition: all 0.2s;
}

.dashboard-filters select:hover {
  border-color: #c7d2fe;
}

.dashboard-filters select:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Responsivo */
@media (max-width: 1024px) {
  #dashboard-content {
    padding: 24px 20px;
  }

  .section-header {
    padding: 20px 24px;
  }

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

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

@media (max-width: 640px) {
  #dashboard-content {
    padding: 16px;
  }

  .section-header {
    padding: 16px;
    flex-direction: column;
    align-items: flex-start;
  }

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

  .chart-card {
    padding: 16px;
  }

  .chart-container {
    height: 250px;
  }
}

/* ========================================
   TABELAS COM MEDALHAS E DESTAQUES
   ======================================== */

/* Position cell (coluna com medalhas) */
.position-cell {
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 80px;
}

.position-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background-color: #e2e8f0;
  color: #475569;
  font-size: 0.9em;
  font-weight: 700;
}

.currency-cell {
  font-weight: 600;
  color: #0891b2;
}

/* ✅ OURO (1º lugar) */
.row-gold {
  background: linear-gradient(
    90deg,
    rgba(251, 191, 36, 0.08) 0%,
    transparent 100%
  );
  border-left: 4px solid #fbbf24;
  font-weight: 500;
}

.row-gold .position-badge {
  background-color: #fbbf24;
  color: #78350f;
  box-shadow: 0 2px 8px rgba(251, 191, 36, 0.3);
}

.row-gold .currency-cell {
  color: #d97706;
  font-weight: 700;
}

.row-gold td {
  padding: 14px 12px !important;
}

/* ✅ PRATA (2º lugar) */
.row-silver {
  background: linear-gradient(
    90deg,
    rgba(209, 213, 219, 0.08) 0%,
    transparent 100%
  );
  border-left: 4px solid #d1d5db;
  font-weight: 500;
}

.row-silver .position-badge {
  background-color: #e5e7eb;
  color: #374151;
  box-shadow: 0 2px 8px rgba(209, 213, 219, 0.3);
}

.row-silver .currency-cell {
  color: #6b7280;
  font-weight: 700;
}

.row-silver td {
  padding: 14px 12px !important;
}

/* ✅ BRONZE (3º lugar) */
.row-bronze {
  background: linear-gradient(
    90deg,
    rgba(217, 119, 6, 0.08) 0%,
    transparent 100%
  );
  border-left: 4px solid #d97706;
  font-weight: 500;
}

.row-bronze .position-badge {
  background-color: #d97706;
  color: #fff;
  box-shadow: 0 2px 8px rgba(217, 119, 6, 0.3);
}

.row-bronze .currency-cell {
  color: #b45309;
  font-weight: 700;
}

.row-bronze td {
  padding: 14px 12px !important;
}

/* Hover effects mantêm a identidade */
.row-gold:hover {
  background: linear-gradient(
    90deg,
    rgba(251, 191, 36, 0.12) 0%,
    transparent 100%
  );
}

.row-silver:hover {
  background: linear-gradient(
    90deg,
    rgba(209, 213, 219, 0.12) 0%,
    transparent 100%
  );
}

.row-bronze:hover {
  background: linear-gradient(
    90deg,
    rgba(217, 119, 6, 0.12) 0%,
    transparent 100%
  );
}

/* Responsive */
@media (max-width: 768px) {
  .position-cell {
    min-width: 60px;
    font-size: 0.95em;
  }

  .position-badge {
    width: 24px;
    height: 24px;
    font-size: 0.85em;
  }

  .data-table td {
    padding: 12px 8px !important;
    font-size: 0.9em;
  }

  .row-gold td,
  .row-silver td,
  .row-bronze td {
    padding: 12px 8px !important;
  }
}
