/*
 * Reportes - Estilos Estandarizados
 * FestivalOpen! V2
 */

/* =============================================
   CONTENEDOR PRINCIPAL
   ============================================= */


.report-container {
  min-height: 100vh;
  padding-bottom: 2rem;
}

/* =============================================
   HEADER DEL REPORTE
   ============================================= */

.report-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #e9ecef;
}

.report-header h2 {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 600;
  color: #333;
}

.report-header h2 small {
  display: block;
  font-size: 0.875rem;
  font-weight: 400;
  color: #6c757d;
  margin-top: 0.25rem;
}

.report-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* =============================================
   BOTONES ESTÁNDAR
   ============================================= */

.btn-report-back {
  background-color: #6c757d;
  border-color: #6c757d;
  color: #fff;
}

.btn-report-back:hover {
  background-color: #5a6268;
  border-color: #545b62;
  color: #fff;
}

.btn-report-export {
  background-color: #28a745;
  border-color: #28a745;
  color: #fff;
}

.btn-report-export:hover {
  background-color: #218838;
  border-color: #1e7e34;
  color: #fff;
}

.btn-report-action {
  background-color: #5B9E85;
  border-color: #5B9E85;
  color: #fff;
}

.btn-report-action:hover {
  background-color: #4a8b71;
  border-color: #3d7a5f;
  color: #fff;
}

/* =============================================
   CARDS DE ESTADÍSTICAS / KPIs
   ============================================= */

.stat-card {
  background-color: #f8f9fa;
  border-radius: 0.5rem;
  padding: 1.25rem;
  text-align: center;
  height: 100%;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.stat-card .stat-label {
  font-size: 0.875rem;
  color: #6c757d;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.stat-card .stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: #333;
  margin-bottom: 0;
  line-height: 1.2;
}

.stat-card .stat-value small {
  font-size: 0.875rem;
  font-weight: 400;
  color: #6c757d;
}

/* Variantes de color para stat-cards */
.stat-card.stat-primary {
  background-color: #DDF4EB;
  border-left: 4px solid #5B9E85;
}

.stat-card.stat-success {
  background-color: #e8f5e9;
  border-left: 4px solid #4caf50;
}

.stat-card.stat-warning {
  background-color: #fff3e0;
  border-left: 4px solid #ff9800;
}

.stat-card.stat-danger {
  background-color: #ffebee;
  border-left: 4px solid #f44336;
}

.stat-card.stat-info {
  background-color: #DDF4EB;
  border-left: 4px solid #5B9E85;
}

/* =============================================
   CONTENEDORES DE GRÁFICOS
   ============================================= */

.chart-container {
  width: 100%;
  position: relative;
}

.chart-sm {
  height: 300px;
}

.chart-md {
  height: 400px;
}

.chart-lg {
  height: 500px;
}

.chart-xl {
  height: 600px;
}

.chart-responsive {
  width: 100%;
  min-height: 300px;
}

/* Contenedor con scroll horizontal para gráficos anchos */
.chart-scroll-container {
  overflow-x: auto;
  width: 100%;
}

/* =============================================
   TABLAS DE REPORTES
   ============================================= */

.report-table {
  width: 100%;
  margin-bottom: 0;
}

.report-table thead th {
  background-color: #343a40;
  color: #fff;
  font-weight: 600;
  text-align: center;
  vertical-align: middle;
  padding: 0.75rem;
  border: none;
}

.report-table tbody td {
  text-align: center;
  vertical-align: middle;
  padding: 0.75rem;
}

.report-table tbody tr:hover {
  background-color: #f5f5f5;
}

.report-table tfoot td {
  background-color: #e9ecef;
  font-weight: 600;
}

/* Tabla con primera columna alineada a la izquierda */
.report-table.text-left-first tbody td:first-child,
.report-table.text-left-first thead th:first-child {
  text-align: left;
}

/* =============================================
   CARDS DE REPORTE
   ============================================= */

.report-card {
  background: #fff;
  border-radius: 0.5rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  margin-bottom: 1.5rem;
}

.report-card .card-header {
  background-color: #f8f9fa;
  border-bottom: 1px solid #e9ecef;
  padding: 1rem 1.25rem;
  font-weight: 600;
}

.report-card .card-body {
  padding: 1.25rem;
}

/* =============================================
   FORMULARIOS DE FILTRO
   ============================================= */

.report-filters {
  background-color: #f8f9fa;
  border-radius: 0.5rem;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.report-filters .form-label {
  font-weight: 500;
  color: #495057;
}

.report-filters .form-control,
.report-filters .form-select {
  border-radius: 0.375rem;
}

/* =============================================
   BADGES Y ESTADOS
   ============================================= */

.badge-report {
  font-size: 0.75rem;
  padding: 0.35em 0.65em;
  font-weight: 500;
}

.badge-completado {
  background-color: #28a745;
  color: #fff;
}

.badge-pendiente {
  background-color: #ffc107;
  color: #212529;
}

.badge-error {
  background-color: #dc3545;
  color: #fff;
}

/* =============================================
   RESPONSIVE
   ============================================= */

/* Large tablets */
@media (max-width: 992px) {
  .report-card .card-body {
    padding: 1rem;
  }

  .report-filters {
    padding: 1rem;
  }

  .chart-lg {
    height: 400px;
  }

  .chart-xl {
    height: 450px;
  }
}

@media (max-width: 768px) {
  .report-container {
    padding-bottom: 1rem;
  }

  .report-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
  }

  .report-header h2 {
    font-size: 1.5rem;
  }

  .report-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .stat-card {
    padding: 1rem;
  }

  .stat-card .stat-value {
    font-size: 1.5rem;
  }

  .stat-card .stat-label {
    font-size: 0.8125rem;
  }

  .chart-sm {
    height: 250px;
    min-height: 200px;
  }

  .chart-md,
  .chart-lg {
    height: 300px;
    min-height: 250px;
  }

  .chart-xl {
    height: 350px;
    min-height: 300px;
  }

  .chart-responsive {
    min-height: 250px;
  }

  .report-card {
    margin-bottom: 1rem;
  }

  .report-card .card-header {
    padding: 0.75rem 1rem;
    font-size: 0.9375rem;
  }

  .report-card .card-body {
    padding: 1rem;
  }

  .report-filters {
    padding: 1rem;
    margin-bottom: 1rem;
  }

  .report-table thead th,
  .report-table tbody td {
    padding: 0.5rem;
    font-size: 0.8125rem;
  }

  .section-title {
    font-size: 1.125rem;
  }
}

@media (max-width: 576px) {
  .report-header h2 {
    font-size: 1.25rem;
  }

  .report-header h2 small {
    font-size: 0.8125rem;
  }

  .report-actions {
    flex-direction: column;
  }

  .report-actions .btn {
    width: 100%;
    text-align: center;
    justify-content: center;
  }

  .stat-card {
    padding: 0.875rem;
  }

  .stat-card .stat-value {
    font-size: 1.375rem;
  }

  .stat-card .stat-label {
    font-size: 0.75rem;
  }

  .chart-sm,
  .chart-md,
  .chart-lg,
  .chart-xl {
    height: auto;
    min-height: 200px;
    max-height: 280px;
  }

  .chart-responsive {
    min-height: 200px;
  }

  .report-card .card-header {
    padding: 0.625rem 0.875rem;
    font-size: 0.875rem;
  }

  .report-card .card-body {
    padding: 0.875rem;
  }

  .report-filters {
    padding: 0.875rem;
  }

  .report-filters .form-label {
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
  }

  .report-table {
    font-size: 0.75rem;
  }

  .report-table thead th,
  .report-table tbody td {
    padding: 0.375rem 0.5rem;
  }

  .badge-report {
    font-size: 0.6875rem;
    padding: 0.25em 0.5em;
  }

  .section-title {
    font-size: 1rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.375rem;
  }

  .divider {
    margin: 1rem 0;
  }
}

/* Extra small devices */
@media (max-width: 480px) {
  .report-header {
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
  }

  .report-header h2 {
    font-size: 1.125rem;
  }

  .stat-card .stat-value {
    font-size: 1.25rem;
  }

  .chart-sm,
  .chart-md,
  .chart-lg,
  .chart-xl {
    min-height: 180px;
    max-height: 250px;
  }

  .report-card {
    margin-bottom: 0.75rem;
  }

  .report-card .card-header {
    padding: 0.5rem 0.75rem;
  }

  .report-card .card-body {
    padding: 0.75rem;
  }

  .report-filters {
    padding: 0.75rem;
    margin-bottom: 0.75rem;
  }
}

/* =============================================
   GRID DE REPORTES (INDEX)
   ============================================= */

.reportes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  padding: 1rem 0;
}

.reporte-card {
  background: #fff;
  border-radius: 0.75rem;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  padding: 1.5rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
}

.reporte-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  text-decoration: none;
  color: inherit;
}

.reporte-card-icon {
  width: 56px;
  height: 56px;
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  font-size: 1.5rem;
}

.reporte-card-icon.bg-green { background-color: #e8f5e9; color: #4caf50; }
.reporte-card-icon.bg-blue { background-color: #DDF4EB; color: #5B9E85; }
.reporte-card-icon.bg-purple { background-color: #DDF4EB; color: #5B9E85; }
.reporte-card-icon.bg-orange { background-color: #fff3e0; color: #ff9800; }
.reporte-card-icon.bg-teal { background-color: #e0f2f1; color: #009688; }
.reporte-card-icon.bg-pink { background-color: #fce4ec; color: #e91e63; }
.reporte-card-icon.bg-indigo { background-color: #DDF4EB; color: #5B9E85; }
.reporte-card-icon.bg-red { background-color: #ffebee; color: #f44336; }
.reporte-card-icon.bg-cyan { background-color: #DDF4EB; color: #5B9E85; }
.reporte-card-icon.bg-amber { background-color: #fff8e1; color: #ffc107; }
.reporte-card-icon.bg-grey { background-color: #eceff1; color: #607d8b; }

.reporte-card h5 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: #333;
}

.reporte-card p {
  font-size: 0.875rem;
  color: #6c757d;
  margin-bottom: 0;
  flex-grow: 1;
}

/* Reporte destacado */
.reporte-card.featured {
  grid-column: span 2;
  background: linear-gradient(135deg, #5B9E85 0%, #4a8b71 100%);
  color: #fff;
}

.reporte-card.featured h5,
.reporte-card.featured p {
  color: #fff;
}

.reporte-card.featured .reporte-card-icon {
  background-color: rgba(255, 255, 255, 0.2);
  color: #fff;
}

@media (max-width: 992px) {
  .reportes-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
  }

  .reporte-card {
    padding: 1.25rem;
  }

  .reporte-card-icon {
    width: 48px;
    height: 48px;
    font-size: 1.25rem;
  }
}

@media (max-width: 768px) {
  .reportes-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    padding: 0.75rem 0;
  }

  .reporte-card {
    padding: 1rem;
  }

  .reporte-card.featured {
    grid-column: span 2;
  }

  .reporte-card-icon {
    width: 44px;
    height: 44px;
    font-size: 1.125rem;
    margin-bottom: 0.75rem;
  }

  .reporte-card h5 {
    font-size: 1rem;
    margin-bottom: 0.375rem;
  }

  .reporte-card p {
    font-size: 0.8125rem;
  }
}

@media (max-width: 576px) {
  .reportes-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .reporte-card {
    padding: 1rem;
  }

  .reporte-card.featured {
    grid-column: span 1;
    background: linear-gradient(135deg, #5B9E85 0%, #4a8b71 100%);
  }

  .reporte-card-icon {
    width: 40px;
    height: 40px;
    font-size: 1rem;
    border-radius: 0.5rem;
  }

  .reporte-card h5 {
    font-size: 0.9375rem;
  }

  .reporte-card p {
    font-size: 0.8125rem;
    line-height: 1.4;
  }
}

@media (max-width: 480px) {
  .reportes-grid {
    gap: 0.625rem;
  }

  .reporte-card {
    padding: 0.875rem;
  }

  .reporte-card-icon {
    width: 36px;
    height: 36px;
    font-size: 0.9375rem;
    margin-bottom: 0.625rem;
  }

  .reporte-card h5 {
    font-size: 0.875rem;
  }

  .reporte-card p {
    font-size: 0.75rem;
  }
}

/* =============================================
   UTILIDADES
   ============================================= */

.text-truncate-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.divider {
  border-top: 1px solid #e9ecef;
  margin: 1.5rem 0;
}

.section-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: #333;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #5B9E85;
  display: inline-block;
}
