/* ========================================
   ANALYTICS - SECCIÓN DE REPORTES
   ========================================
   Estilos para la sección de reportes integrada
   Migrado y adaptado desde el sistema Reports independiente
*/

/* ========================================
   1. CONTENEDOR PRINCIPAL
   ======================================== */

.analytics-reports-container {
  margin: 3rem 0 2rem 0;
  padding: 0;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
}

.analytics-reports-section {
  background: transparent !important;
  border-radius: 0 !important;
  padding: 2rem 0;
  margin: 0;
  border: none !important;
  box-shadow: none !important;
}

/* ========================================
   2. HEADER DE LA SECCIÓN
   ======================================== */

.reports-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 2px solid #fff;
  position: relative;
}

.reports-section-header::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 60px;
  height: 4px;
  background: #fff;
  border-radius: 2px;
}

.section-title-container {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.section-title {
  color: #fff;
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.section-icon {
  color: #666;
  font-size: 1.3rem;
}

.section-subtitle {
  color: #bbb;
  font-size: 0.9rem;
  margin: 0;
  font-weight: 400;
}

.reports-controls {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.period-selector-container {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.reports-period-selector-container {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  position: relative;
}

.reports-period-selector-container::after {
  content: '▼';
  position: absolute;
  right: 0.8rem;
  color: #fff;
  font-size: 0.8rem;
  pointer-events: none;
  z-index: 1;
}

.period-label {
  color: #fff;
  font-weight: 600;
  font-size: 0.95rem;
}

.period-selector {
  background: #333;
  color: #fff;
  border: 2px solid #555;
  border-radius: 8px;
  padding: 0.6rem 2.5rem 0.6rem 1.2rem;
  font-size: 0.95rem;
  font-weight: 500;
  transition: all 0.3s ease;
  cursor: pointer;
  appearance: none;
  position: relative;
}

/* Flecha solo para el select de reportes, no para botones de cashflow */
.reports-period-selector-container .period-selector::after {
  content: '▼';
  position: absolute;
  right: 0.8rem;
  top: 50%;
  transform: translateY(-50%);
  color: #fff;
  font-size: 0.8rem;
  pointer-events: none;
}

.period-selector:hover {
  border-color: #666;
  background: #444;
}

.period-selector:focus {
  outline: none !important;
  border-color: #666 !important;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.15) !important;
  background: #444;
}

.quick-export-btn {
  background: #444;
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 0.8rem 1.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.quick-export-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(255, 255, 255, 0.1);
  background: #555;
}

/* ========================================
   3. RESUMEN EJECUTIVO
   ======================================== */

.reports-executive-summary {
  margin-bottom: 3rem;
}

.summary-title {
  color: #fff;
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  position: relative;
  padding-left: 15px;
}

.summary-title::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 20px;
  background: #fff;
  border-radius: 2px;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}

.summary-metric-card {
  background: #000000 !important;
  border-radius: 12px;
  padding: 1.5rem;
  border: 2px solid #444;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.summary-metric-card:hover {
  transform: translateY(-3px);
  border-color: #666;
  box-shadow: 0 10px 30px rgba(255, 255, 255, 0.1);
}

.metric-icon-container {
  margin-bottom: 1rem;
  display: flex;
  justify-content: center;
  align-items: center;
}

.metric-icon {
  font-size: 2rem;
  color: #666;
}

.metric-content {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  text-align: center;
  align-items: center;
}

/* Estilos específicos para iconos del Resumen Ejecutivo */
.summary-icon-container {
  margin-bottom: 1rem;
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  text-align: center !important;
}

.summary-icon {
  font-size: 2rem;
  color: #666;
  display: block !important;
  text-align: center !important;
}

.metric-label {
  color: #bbb;
  font-size: 0.9rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.metric-value {
  color: #fff;
  font-size: 1.8rem;
  font-weight: 700;
}

.metric-trend {
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.metric-trend.positive {
  color: #bbb;
}

.metric-trend.negative {
  color: #DE4C4A;
}

/* ========================================
   4. TIPOS DE REPORTES
   ======================================== */

.reports-types-container {
  margin-bottom: 3rem;
}

.types-title {
  color: #fff;
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  position: relative;
}

/* Línea vertical eliminada del título "Tipos de Reportes Disponibles" */
/* .types-title::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 25px;
  background: #fff;
  border-radius: 2px;
} */

.types-title::after {
  content: '';
  flex: 1;
  height: 2px;
  background: #fff;
  margin-left: 1rem;
}

.reports-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  align-items: stretch;
}

.report-card {
  background: #000000 !important;
  border-radius: 12px;
  padding: 1.5rem;
  border: 2px solid #444 !important;
  transition: all 0.4s ease;
  position: relative;
  overflow: hidden;
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* IMPORTANTE: Los colores se aplican via style inline en cada card */
.report-card[style*="border-color: rgb(247, 192, 74)"] {
  border-color: #F7C04A !important; /* Amarillo - Financiero */
}

.report-card[style*="border-color: rgb(81, 185, 122)"] {
  border-color: #51B97A !important; /* Verde - Inquilinos */
}

.report-card[style*="border-color: rgb(58, 107, 218)"] {
  border-color: #3A6BDA !important; /* Azul - Apartamentos */
}

.report-card[style*="border-color: rgb(222, 76, 74)"] {
  border-color: #DE4C4A !important; /* Rojo - Operacional */
}

.report-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  background: transparent;
  border-radius: 5px 5px 0 0;
  opacity: 0;
}

.report-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
}

.report-card.selected {
  box-shadow: 0 0 0 3px rgba(58, 107, 218, 0.3);
}

.report-card-header {
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}

.report-icon-container {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.report-icon {
  font-size: 1.4rem;
}

.report-title-container {
  flex: 1;
}

.report-title {
  color: #fff;
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 0 0.35rem 0;
}

.report-description {
  color: #bbb;
  font-size: 0.85rem;
  margin: 0;
  line-height: 1.3;
}

.report-metrics {
  margin-bottom: 1.5rem;
  flex: 1;
}

.report-metric-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0;
  border-bottom: 1px solid #333;
}

.report-metric-item:last-child {
  border-bottom: none;
}

.metric-item-label {
  color: #bbb;
  font-size: 0.8rem;
  font-weight: 500;
}

.metric-item-value {
  color: #fff;
  font-size: 0.95rem;
  font-weight: 700;
}

.report-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-top: auto;
}

.report-action-btn {
  flex: 1;
  background: #444;
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 0.9rem 1.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
}

.report-action-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(255, 255, 255, 0.1);
  background: #555;
}

.report-action-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.export-options {
  display: flex;
  gap: 0.6rem;
}

.export-btn {
  background: #444;
  color: #fff;
  border: 2px solid #555;
  border-radius: 8px;
  padding: 0.8rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.export-btn:hover {
  background: #555;
  border-color: #666;
  transform: translateY(-1px);
}

.export-btn.pdf:hover {
  border-color: #DE4C4A;
  color: #DE4C4A;
}

.export-btn.excel:hover {
  border-color: #666;
  color: #666;
}

/* ========================================
   5. ACTIVIDAD DE REPORTES
   ======================================== */

.reports-activity-section {
  margin-top: 2.5rem;
}

.activity-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.activity-card {
  background: #000000 !important;
  border-radius: 12px;
  padding: 1.5rem;
  border: none;
}

.activity-title {
  color: #fff;
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.activity-title i {
  color: #F7C04A;
}

.activity-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.activity-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.85rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  border: none;
  transition: all 0.3s ease;
}

.activity-item:hover {
  background: rgba(255, 255, 255, 0.08);
}

.activity-info {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  flex: 1;
}

.activity-name {
  color: #fff;
  font-weight: 600;
  font-size: 0.95rem;
}

.activity-date {
  color: #bbb;
  font-size: 0.85rem;
}

.activity-action {
  background: transparent;
  color: #666;
  border: none;
  border-radius: 8px;
  padding: 0.6rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.activity-action:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #999;
  transform: translateY(-1px);
}

.activity-action i {
  color: #666;
}

.activity-action:hover i {
  color: #999;
}

/* ========================================
   6. RESPONSIVE DESIGN
   ======================================== */

@media (max-width: 768px) {
  .analytics-reports-section {
    padding: 1.5rem;
    margin: 1rem 0;
  }

  .reports-section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1.5rem;
  }

  .reports-controls {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
    width: 100%;
  }

  .summary-grid {
    grid-template-columns: 1fr;
  }

  .reports-grid {
    grid-template-columns: 1fr;
  }

  .activity-grid {
    grid-template-columns: 1fr;
  }

  .section-title {
    font-size: 1.5rem;
  }

  .types-title {
    font-size: 1.3rem;
  }
}

@media (max-width: 480px) {
  .analytics-reports-section {
    padding: 1rem;
  }

  .report-card {
    padding: 1.5rem;
  }

  .report-actions {
    flex-direction: column;
    gap: 1rem;
  }

  .export-options {
    justify-content: center;
    width: 100%;
  }
}
