/* --- PALETA DE COLORES MODERNA CON MEJOR CONTRASTE --- */
:root {
  --primary: #1e40af;
  --primary-dark: #1e3a8a;
  --secondary: #047857;
  --accent: #c2410c;
  --warning: #b45309;
  --danger: #b91c1c;
  --success: #15803d;
  --bg-light: #f1f5f9;
  --bg-dark: #0f172a;
  --text-main: #0f172a;
  --text-secondary: #475569;
  --card-light: rgba(255, 255, 255, 0.98);
  --card-dark: rgba(30, 41, 59, 0.98);
  --border-light: rgba(71, 85, 105, 0.3);
  --border-dark: rgba(148, 163, 184, 0.2);
  --shadow-light: 0 4px 6px -1px rgba(0, 0, 0, 0.15), 0 2px 4px -1px rgba(0, 0, 0, 0.1);
  --shadow-dark: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -2px rgba(0, 0, 0, 0.3);
  --glass-light: rgba(255, 255, 255, 0.35);
  --glass-dark: rgba(15, 23, 42, 0.35);
}

/* --- MODO OSCURO --- */
body.dark {
  --bg-light: var(--bg-dark);
  --text-main: #f8fafc;
  --text-secondary: #cbd5e1;
  --card-light: var(--card-dark);
  --border-light: var(--border-dark);
  --shadow-light: var(--shadow-dark);
  --glass-light: var(--glass-dark);
}

/* --- ESTILOS BASE --- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: linear-gradient(135deg, #1e40af 0%, #3730a3 100%);
  min-height: 100vh;
  color: var(--text-main);
  transition: all 0.3s ease;
}

body.dark {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
}

/* --- NAVBAR MODERNA --- */
.navbar {
  background: var(--glass-light) !important;
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-light);
  box-shadow: var(--shadow-light);
}

.navbar-brand {
  font-size: 1.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, #1e40af, #3730a3);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* --- CONTENEDOR PRINCIPAL --- */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* --- CARDS GLASSMORPHISM --- */
.card {
  background: var(--card-light);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-light);
  border-radius: 20px;
  box-shadow: var(--shadow-light);
  transition: all 0.3s ease;
  animation: fadeInUp 0.6s ease-out;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2), 0 10px 10px -5px rgba(0, 0, 0, 0.1);
}

.card-body {
  padding: 2rem;
}

.card-title {
  color: var(--text-main);
  font-weight: 700;
  margin-bottom: 1.5rem;
  font-size: 1.5rem;
}

/* --- BOTONES MODERNOS --- */
.btn {
  border-radius: 12px;
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  border: none;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: left 0.5s;
}

.btn:hover::before {
  left: 100%;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  box-shadow: 0 4px 15px rgba(30, 64, 175, 0.4);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(30, 64, 175, 0.5);
  color: white;
}

.btn-success {
  background: linear-gradient(135deg, var(--success), var(--secondary));
  color: white;
  box-shadow: 0 4px 15px rgba(21, 128, 61, 0.4);
}

.btn-success:hover {
  background: linear-gradient(135deg, var(--secondary), var(--success));
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(21, 128, 61, 0.5);
  color: white;
}

.btn-info {
  background: linear-gradient(135deg, #0891b2, #0e7490);
  color: white;
  box-shadow: 0 4px 15px rgba(8, 145, 178, 0.4);
}

.btn-info:hover {
  background: linear-gradient(135deg, #0e7490, #0891b2);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(8, 145, 178, 0.5);
  color: white;
}

.btn-outline-primary {
  background: transparent;
  border: 2px solid var(--primary);
  color: var(--primary);
}

.btn-outline-primary:hover {
  background: var(--primary);
  color: white;
  transform: translateY(-2px);
}

.btn-outline-secondary {
  background: transparent;
  border: 2px solid var(--text-secondary);
  color: var(--text-secondary);
}

.btn-outline-secondary:hover {
  background: var(--text-secondary);
  color: white;
  transform: translateY(-2px);
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

/* --- TABLA MODERNA --- */
.table {
  background: var(--card-light);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-light);
}

.table th {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  font-weight: 600;
  padding: 1rem;
  border: none;
}

.table td {
  padding: 1rem;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
  color: var(--text-main);
}

.table-hover tbody tr:hover {
  background: rgba(30, 64, 175, 0.08);
  transition: background 0.3s ease;
}

.table-responsive {
  border-radius: 16px;
  overflow: hidden;
}

/* --- FORMULARIOS MODERNOS --- */
.form-control, .form-select {
  background: var(--card-light);
  border: 2px solid var(--border-light);
  border-radius: 12px;
  padding: 0.75rem 1rem;
  color: var(--text-main);
  transition: all 0.3s ease;
  font-weight: 500;
}

.form-control:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.15);
  outline: none;
}

.form-control::placeholder {
  color: var(--text-secondary);
}

.form-control.is-valid {
  border-color: var(--success);
  box-shadow: 0 0 0 3px rgba(21, 128, 61, 0.15);
}

.form-control.is-invalid {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(185, 28, 28, 0.15);
}

/* --- ALERTAS MODERNAS --- */
.alert {
  border-radius: 16px;
  border: none;
  padding: 1rem 1.5rem;
  margin-bottom: 1.5rem;
  backdrop-filter: blur(10px);
  animation: slideInDown 0.5s ease-out;
}

.alert-success {
  background: rgba(21, 128, 61, 0.15);
  color: var(--success);
  border-left: 4px solid var(--success);
}

.alert-warning {
  background: rgba(180, 83, 9, 0.15);
  color: var(--warning);
  border-left: 4px solid var(--warning);
}

.alert-danger {
  background: rgba(185, 28, 28, 0.15);
  color: var(--danger);
  border-left: 4px solid var(--danger);
}

.alert-info {
  background: rgba(8, 145, 178, 0.15);
  color: #0891b2;
  border-left: 4px solid #0891b2;
}

/* --- BADGES Y ESTADOS --- */
.badge {
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  font-weight: 600;
  font-size: 0.75rem;
}

.badge-success {
  background: linear-gradient(135deg, var(--success), var(--secondary));
  color: white;
}

.badge-warning {
  background: linear-gradient(135deg, var(--warning), #d97706);
  color: white;
}

.badge-danger {
  background: linear-gradient(135deg, var(--danger), #dc2626);
  color: white;
}

.badge-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
}

/* --- GRÁFICOS --- */
.chart-container {
  position: relative;
  height: 300px;
  margin: 1rem 0;
}

/* --- BOTÓN MODO OSCURO --- */
.dark-mode-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
  background: var(--glass-light);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-light);
  border-radius: 50%;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-light);
}

.dark-mode-toggle:hover {
  transform: scale(1.1);
}

.dark-mode-toggle i {
  font-size: 1.2rem;
  color: var(--text-main);
}

/* --- ANIMACIONES --- */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

/* --- ESTADÍSTICAS --- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--card-light);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  padding: 1.5rem;
  text-align: center;
  transition: all 0.3s ease;
  animation: fadeInUp 0.6s ease-out;
}

.stat-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-light);
}

.stat-number {
  font-size: 2.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.5rem;
}

.stat-label {
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* --- TIMELINE --- */
.timeline {
  position: relative;
  padding-left: 2rem;
}

.timeline-item {
  position: relative;
  margin-bottom: 1.5rem;
}

.timeline-marker {
  position: absolute;
  left: -2rem;
  top: 0.5rem;
  width: 12px;
  height: 12px;
  background: var(--primary);
  border-radius: 50%;
  border: 3px solid var(--card-light);
  box-shadow: 0 0 0 3px var(--border-light);
}

.timeline-item:not(:last-child)::after {
  content: '';
  position: absolute;
  left: -1.4rem;
  top: 1.2rem;
  width: 2px;
  height: calc(100% + 0.5rem);
  background: var(--border-light);
}

.timeline-content {
  background: var(--card-light);
  padding: 1rem;
  border-radius: 12px;
  border: 1px solid var(--border-light);
}

/* --- RESPONSIVIDAD --- */
@media (max-width: 768px) {
  .container {
    padding: 0 15px;
  }
  
  .card-body {
    padding: 1.5rem;
  }
  
  .btn {
    padding: 0.6rem 1.2rem;
    font-size: 0.9rem;
  }
  
  .table th, .table td {
    padding: 0.75rem 0.5rem;
    font-size: 0.9rem;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .stat-number {
    font-size: 2rem;
  }
  
  .dark-mode-toggle {
    top: 15px;
    right: 15px;
    width: 45px;
    height: 45px;
  }
}

@media (max-width: 480px) {
  .card-body {
    padding: 1rem;
  }
  
  .btn {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
  }
  
  .table th, .table td {
    padding: 0.5rem 0.25rem;
    font-size: 0.8rem;
  }
  
  .navbar-brand {
    font-size: 1.2rem;
  }
}

/* --- UTILIDADES --- */
.text-gradient {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.glass-effect {
  background: var(--glass-light);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-light);
}

.shadow-custom {
  box-shadow: var(--shadow-light);
}

/* --- LOADING --- */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
} 