.analytics-container {
  min-height: 100vh;
  background: #000;
  color: #fff;
  padding: 1.5rem 2rem;
  font-family: 'Inter', Arial, sans-serif;
  max-width: 100%;
  width: 100%;
  margin: 0;
  box-sizing: border-box;
  zoom: 0.85;
}

/* ============ NUEVAS SECCIONES NIVEL SENIOR ============ */

/* Dashboard de Alertas */
.analytics-alerts-section {
  margin-bottom: 4rem;
}

.alerts-dashboard {
  background: #111;
  border-radius: 16px;
  padding: 2rem;
  box-shadow: 0 4px 32px rgba(0,0,0,0.26);
  border: 1.5px solid rgba(255,255,255,0.05);
  margin: 0 0 2rem 0;
  overflow: hidden;
}

.alerts-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.alerts-header-title {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.alert-header-icon {
  font-size: 1.5rem;
  color: #F7C04A;
  animation: pulse 2s infinite;
}

.alerts-header h3 {
  font-size: 1.75rem;
  font-weight: 700;
  margin: 0;
  color: #fff;
  letter-spacing: 0.5px;
  line-height: 1.3;
}

.alerts-stats {
  display: flex;
  gap: 1.5rem;
}

.alert-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1rem 1.5rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.alert-stat.critical {
  border-color: #DE4C4A;
  background: rgba(222, 76, 74, 0.1);
}

.alert-stat.warning {
  border-color: #F7C04A;
  background: rgba(247, 192, 74, 0.1);
}

.alert-stat-number {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 0.25rem;
}

.alert-stat.critical .alert-stat-number {
  color: #ff6b6b;
}

.alert-stat.warning .alert-stat-number {
  color: #fff;
}

.alert-stat-label {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 500;
}

.alerts-filters {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 2rem;
  flex-wrap: nowrap !important;
  white-space: nowrap;
  align-items: center;
  justify-content: flex-start;
}

.alert-filter {
  padding: 0.5rem 0.8rem;
  border-radius: 8px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.8);
  font-weight: 600;
  font-size: 0.75rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  text-transform: capitalize;
  white-space: nowrap;
  flex-shrink: 0 !important;
  min-width: auto;
  width: auto;
  display: inline-block;
}

.alert-filter:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  transform: translateY(-2px);
}

.alert-filter.active {
  background: #111;
  border-color: #333;
  color: #fff;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.alerts-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-height: 400px;
  overflow-y: auto;
  padding-right: 0.5rem;
}

.alerts-list::-webkit-scrollbar {
  width: 6px;
}

.alerts-list::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

.alerts-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 3px;
}

.alert-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem;
  border-radius: 12px;
  transition: all 0.3s ease;
  cursor: pointer;
  backdrop-filter: blur(10px);
  color: #fff !important;
}

.alert-item * {
  color: #fff !important;
}

.alert-item:hover {
  transform: translateX(4px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.alert-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
}

.alert-icon i {
  font-size: 1.25rem;
}

.alert-content {
  flex: 1;
  min-width: 0;
}

.alert-title {
  font-weight: 700;
  font-size: 1.1rem;
  color: #fff !important;
  margin-bottom: 0.35rem;
}

.alert-message {
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 0.5rem;
  line-height: 1.5;
}

.alert-meta {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.alert-timestamp {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.6);
}

.alert-amount {
  font-size: 0.875rem;
  font-weight: 700;
  color: #F7C04A;
  background: rgba(247, 192, 74, 0.1);
  padding: 0.25rem 0.75rem;
  border-radius: 6px;
}

.alert-actions {
  display: flex;
  gap: 0.5rem;
}

.alert-action-btn {
  width: 36px;
  height: 36px;
  border-radius: 0px;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.alert-action-btn.primary {
  background: rgba(58, 107, 218, 0.2);
  color: #fff;
}

.alert-action-btn.secondary {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.6);
}

.alert-action-btn:hover {
  transform: scale(1.1);
}

/* Flujo de Caja */

.cash-flow-container {
  padding: 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: 20px;
  font-weight: 700;
  font-size: 0.875rem;
}

.growth-indicator.positive {
  background: rgba(81, 185, 122, 0.2);
  color: #51B97A;
  border: 1px solid rgba(81, 185, 122, 0.3);
}

.growth-indicator.negative {
  background: rgba(222, 76, 74, 0.2);
  color: #DE4C4A;
  border: 1px solid rgba(222, 76, 74, 0.3);
}

.growth-label {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.6);
}

.cash-flow-summary {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.5rem;
}

.summary-item {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.25rem;
}

.summary-label {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 500;
}

.summary-value {
  font-size: 1.5rem;
  font-weight: 800;
}

.summary-value.primary {
  color: #fff;
}

.cash-flow-chart-container {
  position: relative;
  height: 320px;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

/* ============ ESTILOS ORIGINALES MANTENIDOS ============ */

.analytics-card {
  background: #111;
  border-radius: 16px;
  box-shadow: 0 4px 32px rgba(0,0,0,0.26);
  border: 1.5px solid rgba(255,255,255,0.05);
  margin: 1.5rem 0;
  padding: 1.5rem 1.25rem;
  transition: transform .2s cubic-bezier(.18,.89,.32,1.28), box-shadow .2s;
  overflow: hidden;
}

.analytics-card:hover {
  transform: scale(1.01);
  box-shadow: 0 8px 32px rgba(58,107,218,0.17);
}

/* Flujo de Caja - FLAT como solicitado */
.analytics-card-large {
  background: transparent !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  border: 1px solid rgba(255,255,255,0.05) !important;
  margin-bottom: 3rem;
}

.analytics-card-large:hover {
  transform: none !important;
  box-shadow: none !important;
}

.analytics-chart-title {
  margin-bottom: 1.5rem;
  font-weight: 700;
  font-size: 1.5rem;
  letter-spacing: 0.5px;
  color: #fff;
  line-height: 1.3;
}

.analytics-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  margin: 1.5rem 0;
}

.analytics-card-secondary {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.analytics-card-secondary--full {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.analytics-chart-full {
  flex: 1 1 auto;
  min-height: 180px;
  height: 180px;
  width: 100%;
  margin: 0;
  padding: 0;
}

.analytics-stars-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-top: 1.1rem;
  margin-bottom: 0.1rem;
  gap: 0.25rem;
}

.analytics-stars-label-block {
  color: #fff;
  font-weight: 500;
  font-size: 1rem;
}

.analytics-stars-value-block {
  font-weight: 700;
  font-size: 1.25rem;
  color: #F7C04A;
  vertical-align: middle;
  margin-bottom: 0.2rem;
}

.analytics-stars-icons-block {
  display: flex;
  align-items: center;
  margin-top: 0.15rem;
}

/* Contenedor de gráficos estándar */
.chart-container {
  position: relative;
  height: 300px;
  width: 100%;
  margin: 1rem 0;
}

.chart-container canvas {
  max-height: 300px;
}

@media (max-width: 1200px) {
  .analytics-row {
    grid-template-columns: 1fr;
  }
  
  .analytics-container {
    padding: 2rem 1.5rem;
  }
}

@media (max-width: 768px) {
  .analytics-container {
    padding: 1.5rem 1rem;
  }
  
  .analytics-card {
    padding: 1.5rem 1rem;
    margin: 1.5rem 0;
  }
  
  .chart-container {
    height: 280px;
  }
  
  .chart-container canvas {
    max-height: 280px;
  }
  
  .analytics-chart-title {
    font-size: 1.25rem;
  }
  
  .cash-flow-title,
  .alerts-header h3 {
    font-size: 1.5rem;
  }
}

@media (max-width: 600px) {
  .analytics-card,
  .analytics-card-secondary {
    padding: 1.2rem 0.8rem;
    margin: 1rem 0;
  }
  
  .chart-container {
    height: 250px;
  }
  
  .chart-container canvas {
    max-height: 250px;
  }
  
  .analytics-chart-full {
    min-height: 180px;
    height: 180px;
  }
  
  .analytics-stars-block {
    font-size: 0.95rem;
    margin-top: 0.7rem;
  }
  
  .analytics-row {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

/* ============ ANIMACIONES NIVEL SENIOR ============ */

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

@keyframes slideInFromLeft {
  0% {
    transform: translateX(-50px);
    opacity: 0;
  }
  100% {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes fadeInUp {
  0% {
    transform: translateY(30px);
    opacity: 0;
  }
  100% {
    transform: translateY(0);
    opacity: 1;
  }
}

.alert-item {
  animation: fadeInUp 0.6s ease-out forwards;
}

.alert-item:nth-child(1) { animation-delay: 0.1s; }
.alert-item:nth-child(2) { animation-delay: 0.2s; }
.alert-item:nth-child(3) { animation-delay: 0.3s; }
.alert-item:nth-child(4) { animation-delay: 0.4s; }
.alert-item:nth-child(5) { animation-delay: 0.5s; }

.alerts-dashboard {
  animation: slideInFromLeft 0.8s ease-out;
}

.cash-flow-container {
  animation: fadeInUp 0.8s ease-out 0.2s both;
}

/* ============ RESPONSIVE DESIGN NIVEL SENIOR ============ */

@media (max-width: 1200px) {
  .alerts-header {
    flex-direction: column;
    gap: 1.5rem;
    align-items: flex-start;
  }
  
  .alerts-stats {
    align-self: stretch;
    justify-content: space-around;
  }
  
  .cash-flow-header {
    flex-direction: column;
    gap: 1.5rem;
    align-items: flex-start;
  }
  
  .cash-flow-summary {
    align-items: flex-start;
  }
}

@media (max-width: 768px) {
  .analytics-container {
    padding: 1.5rem 0.75rem;
  }
  
  .alerts-dashboard {
    padding: 1.5rem;
    border-radius: 16px;
  }
  
  .alerts-header h3 {
    font-size: 1.5rem;
  }
  
  .alert-stat {
    padding: 0.75rem 1rem;
  }
  
  .alert-stat-number {
    font-size: 1.5rem;
  }
  
  .alerts-filters {
    gap: 0.4rem;
    flex-wrap: nowrap;
  }
  
  .alert-filter {
    padding: 0.5rem 0.8rem;
    font-size: 0.75rem;
    flex-shrink: 0;
    min-width: fit-content;
  }
  
  .alert-item {
    padding: 1rem;
    gap: 0.75rem;
  }
  
  .alert-icon {
    width: 40px;
    height: 40px;
  }
  
  .alert-icon i {
    font-size: 1rem;
  }
  
  .cash-flow-container {
    padding: 1.5rem;
  }
  
  .cash-flow-title {
    font-size: 1.5rem;
  }
  
  .cash-flow-chart-container {
    height: 280px;
    padding: 0.75rem;
  }
  
  .growth-indicator {
    padding: 0.375rem 0.75rem;
    font-size: 0.8rem;
  }
  
  .summary-value {
    font-size: 1.25rem;
  }
}

@media (max-width: 480px) {
  .alerts-stats {
    flex-direction: column;
    gap: 1rem;
  }
  
  .alert-stat {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
  
  .alerts-filters {
    flex-direction: row;
    gap: 0.3rem;
    flex-wrap: nowrap;
  }
  
  .alert-filter {
    text-align: center;
    flex-shrink: 0;
    padding: 0.4rem 0.6rem;
    font-size: 0.7rem;
    min-width: fit-content;
  }
  
  .alert-item {
    flex-direction: column;
    text-align: center;
  }
  
  .alert-meta {
    justify-content: center;
  }
  
  .alert-actions {
    justify-content: center;
  }
  
  .cash-flow-header {
    text-align: center;
  }
  
  .growth-indicator {
    justify-content: center;
  }
}
