:root {
  /* Colores de Impacto (80/20) */
  --impacto-5: #dc2626; /* Crítico */
  --impacto-4: #ea580c; /* Alto */
  --impacto-3: #f59e0b; /* Medio */
  --impacto-2: #84cc16; /* Bajo */
  --impacto-1: #64748b; /* Mínimo */
  
  /* Estados */
  --completado: #22c55e;
  --en-progreso: #3b82f6;
  --bloqueado: #ef4444;
  
  /* Neutrales */
  --bg-primary: #ffffff;
  --bg-secondary: #f9fafb;
  --bg-dark: #111827;
  --text-primary: #111827;
  --text-secondary: #6b7280;
  --border-color: #e5e7eb;
  
  /* Financiero */
  --gap-color: #dc2626;
  --meta-color: #22c55e;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  line-height: 1.6;
}

/* Navbar */
.navbar {
  background-color: var(--bg-primary);
  border-bottom: 2px solid var(--border-color);
  padding: 1rem 2rem;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.navbar-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1400px;
  margin: 0 auto;
}

.navbar-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.5rem;
  font-weight: bold;
}

.navbar-menu {
  display: flex;
  gap: 2rem;
}

.nav-link {
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 500;
}

/* Dashboard Financiero */
.dashboard-financiero {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem;
}

.financial-header {
  text-align: center;
  margin-bottom: 3rem;
}

.financial-header h1 {
  font-size: 3rem;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.subtitle {
  font-size: 1.25rem;
  color: var(--text-secondary);
}

/* Gap Meter */
.gap-meter {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 16px;
  padding: 3rem;
  margin-bottom: 3rem;
  color: white;
}

.gap-visual {
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: 50px;
  height: 60px;
  position: relative;
  margin-bottom: 2rem;
  overflow: hidden;
}

.gap-progress {
  background: linear-gradient(90deg, #22c55e, #16a34a);
  height: 100%;
  border-radius: 50px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 1rem;
  transition: width 0.5s ease;
}

.progress-label {
  font-weight: bold;
  font-size: 1.25rem;
}

.gap-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  margin-bottom: 2rem;
}

.stat-item {
  text-align: center;
}

.stat-label {
  display: block;
  font-size: 0.875rem;
  opacity: 0.9;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-value {
  display: block;
  font-size: 2rem;
  font-weight: bold;
}

.stat-value.critical {
  color: #fca5a5;
}

/* Proyectos Grid */
.proyectos-grid {
  margin-bottom: 3rem;
}

.proyectos-grid h2 {
  font-size: 2rem;
  margin-bottom: 1.5rem;
}

.proyectos-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 2rem;
}

.proyecto-card {
  background-color: var(--bg-primary);
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transition: transform 0.2s, box-shadow 0.2s;
}

.proyecto-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.proyecto-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.proyecto-header h3 {
  font-size: 1.5rem;
}

.proyecto-estado {
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.875rem;
  font-weight: 600;
}

.proyecto-estado.en-progreso {
  background-color: #dbeafe;
  color: #1e40af;
}

.proyecto-objetivo {
  background-color: #fef3c7;
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 1.5rem;
  border-left: 4px solid #f59e0b;
}

.proyecto-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-box {
  background-color: var(--bg-secondary);
  padding: 1rem;
  border-radius: 8px;
  text-align: center;
}

.stat-box .label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
}

.stat-box .value {
  display: block;
  font-size: 1.75rem;
  font-weight: bold;
}

.value.cerradas {
  color: var(--completado);
}

.value.abiertas {
  color: var(--en-progreso);
}

/* Botones */
.btn {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  display: inline-block;
  text-align: center;
}

.btn-primary {
  background-color: #3b82f6;
  color: white;
}

.btn-primary:hover {
  background-color: #2563eb;
  transform: translateY(-2px);
}

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

.btn-outline:hover {
  background-color: var(--bg-secondary);
}

.btn-large {
  padding: 1rem 2rem;
  font-size: 1.125rem;
}

.btn-cerrar {
  background-color: var(--completado);
  color: white;
  width: 100%;
  font-size: 1.125rem;
}

.btn-cerrar:hover {
  background-color: #16a34a;
}

/* Reglas Anti-Bloqueo */
.reglas-bloqueo {
  background-color: var(--bg-primary);
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.reglas-bloqueo h2 {
  margin-bottom: 1.5rem;
  color: var(--bloqueado);
}

.reglas-list {
  list-style: none;
  padding: 0;
}

.reglas-list li {
  padding: 1rem;
  margin-bottom: 0.75rem;
  background-color: #fef2f2;
  border-left: 4px solid var(--bloqueado);
  border-radius: 4px;
  font-weight: 500;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  z-index: 200;
  overflow-y: auto;
}

.modal-content {
  background-color: var(--bg-primary);
  margin: 5% auto;
  padding: 2rem;
  border-radius: 12px;
  max-width: 600px;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 2rem;
  cursor: pointer;
  color: var(--text-secondary);
}

.modal-subtitle {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.75rem;
  border: 2px solid var(--border-color);
  border-radius: 6px;
  font-size: 1rem;
  font-family: inherit;
}

.form-group small {
  display: block;
  margin-top: 0.5rem;
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.form-actions {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
}

/* Alertas */
.alerta-limite {
  background-color: #fef2f2;
  border: 2px solid var(--bloqueado);
  border-radius: 8px;
  padding: 1rem;
  margin-top: 1rem;
  color: var(--bloqueado);
  font-weight: 500;
}
