/* Estilos específicos para el Gráfico de Flujo de Caja */
/* Arquitectura CSS modular - Componente avanzado */

/* ============ CASH FLOW CHART ============ */

.cash-flow-container {
  padding: 0;
  margin-bottom: 2rem;
}

.cash-flow-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.cash-flow-title-section {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.cash-flow-title {
  font-size: 1.75rem;
  font-weight: 700;
  margin: 0;
  color: #fff;
  letter-spacing: 0.5px;
  line-height: 1.3;
}

.cash-flow-growth {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.growth-indicator {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.5rem 1rem;
  border-radius: 0;
  font-weight: 700;
  font-size: 0.875rem;
  border: 2px solid;
}

.growth-indicator.positive {
  background: transparent;
  color: #51B97A;
  border-color: #51B97A;
}

.growth-indicator.negative {
  background: transparent;
  color: #DE4C4A;
  border-color: #DE4C4A;
}

.growth-label {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.6);
  font-weight: 500;
}

.cash-flow-controls {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: flex-end;
}

.period-selector {
  display: flex;
  gap: 0.5rem;
  background: #000000 !important;  /* FONDO NEGRO SÓLIDO FORZADO */
  padding: 0.5rem;
  border-radius: 8px;
  border: 2px solid rgba(255, 255, 255, 0.2);
}

.period-btn {
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 6px;
  background: transparent !important;  /* Botones transparentes */
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.period-btn:hover {
  background: rgba(255, 255, 255, 0.1) !important;
  color: #fff;
}

.period-btn.active {
  background: rgba(255, 255, 255, 0.15) !important;
  color: #fff;
  border: 2px solid rgba(255, 255, 255, 0.4);
}

.cash-flow-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.metric-card {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1.75rem 1.5rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
}

.metric-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.metric-card.primary {
  border-color: #3A6BDA;
  background: rgba(58, 107, 218, 0.1);
}

.metric-card.success {
  border-color: #51B97A;
  background: rgba(81, 185, 122, 0.1);
}

.metric-card.info {
  border-color: #F7C04A;
  background: rgba(247, 192, 74, 0.1);
}

.metric-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.metric-card.primary .metric-icon {
  background: rgba(58, 107, 218, 0.2);
  color: #3A6BDA;
}

.metric-card.success .metric-icon {
  background: rgba(81, 185, 122, 0.2);
  color: #51B97A;
}

.metric-card.info .metric-icon {
  background: rgba(247, 192, 74, 0.2);
  color: #F7C04A;
}

.metric-content {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
}

.metric-label {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 500;
}

.metric-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.2;
}

.cash-flow-chart-container {
  position: relative;
  height: 400px;
  padding: 1.5rem;
  background: transparent;
  border-radius: 0;
  border: 1px solid rgba(255, 255, 255, 0.05);
  margin-bottom: 2rem;
}

.cash-flow-insights {
  background: rgba(255, 255, 255, 0.03);
  border-radius: 16px;
  padding: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.cash-flow-insights h4 {
  font-size: 1.125rem;
  font-weight: 700;
  color: #fff;
  margin: 0 0 1rem 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* .cash-flow-insights h4::before {
  content: '';
  width: 4px;
  height: 20px;
  background: #111;
  border-radius: 2px;
} */

.insights-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
}

.insight-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
}

.insight-item:hover {
  background: rgba(255, 255, 255, 0.08);
  transform: translateX(4px);
}

.insight-item i {
  font-size: 1.125rem;
  color: #F7C04A;
  flex-shrink: 0;
}

.insight-item span {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.8);
  line-height: 1.4;
}

/* Responsive Design para Cash Flow */
@media (max-width: 1200px) {
  .cash-flow-header {
    flex-direction: column;
    gap: 1.5rem;
    align-items: flex-start;
  }
  
  .cash-flow-controls {
    align-items: flex-start;
    align-self: stretch;
  }
  
  .period-selector {
    align-self: flex-start;
  }
}

@media (max-width: 768px) {
  .cash-flow-container {
    padding: 1.5rem;
  }
  
  .cash-flow-title {
    font-size: 1.2rem;
    line-height: 1.4;
    word-wrap: break-word;
    white-space: normal;
  }
  
  .cash-flow-chart-container {
    height: 300px;
    padding: 1rem;
  }
  
  .cash-flow-metrics {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .metric-card {
    padding: 1rem;
  }
  
  .metric-icon {
    width: 40px;
    height: 40px;
  }
  
  .metric-value {
    font-size: 1.25rem;
  }
  
  .growth-indicator {
    padding: 0.375rem 0.75rem;
    font-size: 0.8rem;
  }
  
  .insights-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .cash-flow-header {
    text-align: center;
  }
  
  .cash-flow-title-section {
    align-items: center;
  }
  
  .cash-flow-growth {
    justify-content: center;
  }
  
  .period-selector {
    justify-content: center;
  }
  
  .cash-flow-chart-container {
    height: 280px;
    padding: 0.75rem;
  }
}
