/* Dashboard Corporativo Moderno - Estilo Jira/Admin */

/* Container Principal */
.dashboard-container {
  padding: 24px;
  background: #f8fafc;
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Header Moderno */
.dashboard-header-modern {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
  padding: 20px 24px;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.dashboard-header-modern h2 {
  margin: 0;
  font-size: 24px;
  font-weight: 600;
  color: #1e293b;
}

.dashboard-meta .last-update {
  font-size: 14px;
  color: #64748b;
  font-weight: 500;
}

/* KPIs Cards Modernos */
.dashboard-kpis-modern {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.kpi-card-modern {
  background: #ffffff;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  transition: all 0.2s ease;
  border: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  gap: 16px;
}

.kpi-card-modern:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.kpi-icon-wrapper {
  flex-shrink: 0;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
}

.kpi-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.kpi-card-modern:nth-child(1) .kpi-icon-wrapper {
  background: rgba(59, 130, 246, 0.1); /* Azul para aves */
  color: #2563eb; /* text-blue-600 */
}

.kpi-card-modern:nth-child(2) .kpi-icon-wrapper {
  background: rgba(16, 185, 129, 0.1); /* Verde para peso */
  color: #059669; /* text-emerald-600 */
}

.kpi-card-modern:nth-child(3) .kpi-icon-wrapper {
  background: rgba(239, 68, 68, 0.1); /* Vermelho para mortalidade */
  color: #dc2626; /* text-red-600 */
}

.kpi-card-modern:nth-child(4) .kpi-icon-wrapper {
  background: rgba(251, 146, 60, 0.1); /* Laranja para conversão */
  color: #ea580c; /* text-orange-600 */
}

.kpi-card-modern:nth-child(5) .kpi-icon-wrapper {
  background: rgba(34, 197, 94, 0.1); /* Verde escuro para valor */
  color: #15803d; /* text-green-700 */
}

.kpi-content {
  flex: 1;
  text-align: left;
}

.kpi-value {
  font-size: 24px;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 2px;
  line-height: 1;
}

.kpi-label {
  font-size: 13px;
  color: #64748b;
  font-weight: 500;
}

/* Gráficos Modernos */
.dashboard-charts-modern {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 24px;
  margin-bottom: 32px;
}

.chart-container-modern {
  background: #ffffff;
  padding: 24px;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  border: 1px solid #e2e8f0;
}

.chart-container-modern h3 {
  margin: 0 0 20px 0;
  font-size: 18px;
  font-weight: 600;
  color: #1e293b;
}

.chart-wrapper {
  position: relative;
  min-height: 250px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chart-wrapper canvas {
  max-height: 100%;
  width: 100% !important;
}

/* Empty State para gráficos */
.chart-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 20px;
  color: #64748b;
}

.chart-empty-state .empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.4;
}

.chart-empty-state .empty-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
  color: #475569;
}

.chart-empty-state .empty-description {
  font-size: 14px;
  color: #64748b;
  line-height: 1.5;
}

/* Container central para valor do doughnut */
.doughnut-center-value {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
}

.doughnut-center-value .center-number {
  font-size: 32px;
  font-weight: 700;
  color: #1e293b;
  line-height: 1;
}

.doughnut-center-value .center-label {
  font-size: 12px;
  color: #64748b;
  font-weight: 500;
  margin-top: 4px;
}

/* Alertas Modernos */
.dashboard-alerts-modern {
  background: #ffffff;
  padding: 24px;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  border: 1px solid #e2e8f0;
}

.dashboard-alerts-modern h3 {
  margin: 0 0 20px 0;
  font-size: 18px;
  font-weight: 600;
  color: #1e293b;
}

.alerts-list-modern {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.alert-item-modern {
  display: flex;
  align-items: center;
  padding: 16px;
  border-radius: 8px;
  border-left: 4px solid;
  background: #f8fafc;
}

.alert-item-modern.alert-success {
  border-left-color: #10b981;
  background: #f0fdf4;
}

.alert-item-modern.alert-warning {
  border-left-color: #f59e0b;
  background: #fffbeb;
}

.alert-item-modern.alert-error {
  border-left-color: #ef4444;
  background: #fef2f2;
}

.alert-item-modern.alert-info {
  border-left-color: #3b82f6;
  background: #eff6ff;
}

.alert-item-modern .alert-icon {
  margin-right: 12px;
  font-size: 20px;
  color: #64748b;
}

.alert-item-modern.alert-success .alert-icon {
  color: #10b981;
}

.alert-item-modern.alert-warning .alert-icon {
  color: #f59e0b;
}

.alert-item-modern.alert-error .alert-icon {
  color: #ef4444;
}

.alert-item-modern.alert-info .alert-icon {
  color: #3b82f6;
}

.alert-content .alert-message {
  font-size: 14px;
  color: #374151;
  font-weight: 500;
}

/* Estados de Login e Erro */
.dashboard-login-prompt,
.dashboard-error {
  text-align: center;
  padding: 60px 24px;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  border: 1px solid #e2e8f0;
}

.dashboard-login-prompt .login-icon,
.dashboard-error .error-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.6;
  color: #ffffff;
}

.dashboard-login-prompt h3,
.dashboard-error h3 {
  margin: 0 0 12px 0;
  font-size: 20px;
  font-weight: 600;
  color: #1e293b;
}

.dashboard-login-prompt p,
.dashboard-error p {
  margin: 0 0 24px 0;
  font-size: 16px;
  color: #64748b;
}

.dashboard-error .error-icon {
  color: #ef4444;
}

/* Responsividade */
@media (max-width: 768px) {
  .dashboard-container {
    padding: 16px;
  }
  
  .dashboard-header-modern {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
  }
  
  .dashboard-kpis-modern {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
  }
  
  .kpi-card-modern {
    padding: 16px;
  }
  
  .kpi-card-modern .kpi-value {
    font-size: 24px;
  }
  
  .dashboard-charts-modern {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .chart-container-modern {
    padding: 16px;
  }
  
  .chart-wrapper {
    height: 250px;
  }
  
  .dashboard-alerts-modern {
    padding: 16px;
  }
}

@media (max-width: 480px) {
  .dashboard-kpis-modern {
    grid-template-columns: 1fr;
  }
  
  .dashboard-header-modern h2 {
    font-size: 20px;
  }
  
  .chart-container-modern h3 {
    font-size: 16px;
  }
}

/* Animações Suaves */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.kpi-card-modern,
.chart-container-modern,
.dashboard-alerts-modern {
  animation: fadeInUp 0.6s ease-out;
}

.kpi-card-modern:nth-child(2) {
  animation-delay: 0.1s;
}

.kpi-card-modern:nth-child(3) {
  animation-delay: 0.2s;
}

.kpi-card-modern:nth-child(4) {
  animation-delay: 0.3s;
}

.kpi-card-modern:nth-child(5) {
  animation-delay: 0.4s;
}

.chart-container-modern:nth-child(2) {
  animation-delay: 0.5s;
}

/* Loading States */
.loading {
  position: relative;
  overflow: hidden;
}

.loading::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% {
    left: -100%;
  }
  100% {
    left: 100%;
  }
}
