:root {
  --primary: #0f172a;
  --accent: #3b82f6;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --bg: #f1f5f9;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Inter', system-ui, sans-serif;
  background-color: var(--bg);
  color: #1e293b;
}

/* LOGIN PORTAL MINIMALISTA */
.login-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background-color: #020617; /* Fondo ultra oscuro profundo */
  background-image: radial-gradient(circle at 50% 50%, #1e293b 0%, #020617 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-card {
  width: 100%;
  max-width: 360px; /* Formulario pequeño */
  background: #ffffff;
  padding: 40px 32px;
  border-radius: 24px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  text-align: center;
  animation: fadeIn 0.6s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.login-header h1 {
  font-size: 1.25rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 8px;
  letter-spacing: -0.02em;
}

.login-header p {
  font-size: 0.85rem;
  color: #64748b;
  margin-bottom: 32px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  text-align: left;
}

.login-form label span {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  color: #475569;
  margin-bottom: 6px;
  text-transform: uppercase;
}

.login-form input {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  font-size: 0.95rem;
  transition: all 0.2s;
  background: #f8fafc;
}

.login-form input:focus {
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

.login-button {
  width: 100%;
  padding: 14px;
  background: #0f172a;
  color: white;
  border: none;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  margin-top: 8px;
  transition: opacity 0.2s;
}

.login-button:hover { opacity: 0.9; }

.login-error {
  margin-top: 16px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--danger);
  padding: 10px;
  background: #fef2f2;
  border-radius: 8px;
}

/* RESTO DEL DASHBOARD... (Manteniendo el estilo Pro) */
.page-shell { max-width: 1600px; margin: 0 auto; padding: 24px; display: flex; flex-direction: column; gap: 24px; }

.hero {
  background: #0f172a; padding: 32px 40px; border-radius: 20px; color: white;
  display: flex; justify-content: space-between; align-items: center;
}

.dashboard-grid { display: grid; grid-template-columns: 1fr 400px; gap: 24px; align-items: start; }

.panel { background: #fff; border: 1px solid #e2e8f0; border-radius: 20px; padding: 24px; box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1); }

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
  width: 100%;
}

.kpi-card {
  padding: 24px;
  border-radius: 20px;
  color: white;
  border: none;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 120px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

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

.kpi-card::before {
  content: "";
  position: absolute;
  top: -20%;
  right: -20%;
  width: 140px;
  height: 140px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  pointer-events: none;
}

/* Colores de Alto Impacto */
.kpi-info { background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%); }    /* Azul */
.kpi-success { background: linear-gradient(135deg, #065f46 0%, #10b981 100%); } /* Verde */
.kpi-warning { background: linear-gradient(135deg, #92400e 0%, #f59e0b 100%); } /* Naranja */
.kpi-danger { background: linear-gradient(135deg, #991b1b 0%, #ef4444 100%); }  /* Rojo */
.kpi-neutral { background: linear-gradient(135deg, #334155 0%, #64748b 100%); } /* Gris */

.kpi-value {
  font-size: 2.2rem;
  font-weight: 900;
  display: block;
  margin: 4px 0;
  text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.kpi-label {
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.9);
  letter-spacing: 0.05em;
}

.kpi-note {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.8);
  font-weight: 500;
}

/* BOTÓN EXPORTAR PROFESIONAL */
.action-button {
  background: linear-gradient(135deg, #166534 0%, #15803d 100%); /* Verde Excel Pro */
  color: #ffffff;
  border: none;
  padding: 12px 24px;
  border-radius: 12px;
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px rgba(21, 128, 61, 0.25);
  white-space: nowrap;
}

.action-button::before {
  content: "";
  width: 18px;
  height: 18px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='white'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2.5' d='M9 17v-2m3 2v-4m3 4v-6m2 10H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z'%3E%3C/path%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
}

.action-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(21, 128, 61, 0.35);
  filter: brightness(1.1);
}

.table-wrap { border-radius: 12px; border: 1px solid #e2e8f0; overflow: auto; max-height: 600px; }
table { width: 100%; border-collapse: collapse; min-width: 1000px; }
th { background: #f8fafc; padding: 14px; font-size: 0.75rem; color: #64748b; position: sticky; top: 0; z-index: 10; border-bottom: 2px solid #e2e8f0; text-align: left;}
td { padding: 14px; border-bottom: 1px solid #f1f5f9; font-size: 0.85rem; }
tbody tr:hover { background: #f8fafc; cursor: pointer; }
tbody tr.active { background: #eff6ff; border-left: 4px solid var(--accent); }

.badge { padding: 4px 10px; border-radius: 6px; font-size: 0.7rem; font-weight: 700; text-transform: uppercase; }
.badge-primera { background: #dcfce7; color: #059669; }
.badge-segunda { background: #dbeafe; color: #2563eb; }
.badge-sinvacuna { background: #fee2e2; color: #dc2626; }

.vax-timeline { display: flex; flex-direction: column; gap: 12px; }
.timeline-item { display: flex; gap: 12px; }
.t-dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 4px; background: #e2e8f0; }
.t-title { font-weight: 700; font-size: 0.8rem; }
.t-date { font-size: 0.75rem; color: #94a3b8; }

.progress-container { width: 100%; background: #f1f5f9; height: 6px; border-radius: 3px; margin-top: 6px; }
/* FILTROS PROFESIONALES */
.panel-filters {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  padding: 28px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.filter-grid {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.filter-search input {
  width: 100%;
  padding: 14px 20px;
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 14px;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--primary);
  transition: all 0.2s ease;
}

.filter-search input:focus {
  background: #ffffff;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

.age-pills-container span {
  display: block;
  font-size: 0.72rem;
  font-weight: 800;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
}

.age-pills {
  display: inline-flex;
  background: #f1f5f9;
  padding: 4px;
  border-radius: 14px;
  gap: 4px;
}

.pill {
  padding: 8px 18px;
  border-radius: 10px;
  border: none;
  background: transparent;
  font-size: 0.85rem;
  font-weight: 700;
  color: #64748b;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.pill:hover {
  color: var(--primary);
  background: rgba(255,255,255,0.5);
}

.pill.active {
  background: #ffffff;
  color: var(--primary);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.filter-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

.filter-row label span {
  display: block;
  font-size: 0.7rem;
  font-weight: 800;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.filter-row select {
  width: 100%;
  padding: 12px;
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
  transition: all 0.2s;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
}

.filter-row select:hover {
  border-color: #cbd5e1;
}

.filter-row select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

.page-footer { margin-top: 40px; padding: 32px; text-align: center; font-size: 0.8rem; color: #94a3b8; }

.shake-anim { animation: shake 0.4s ease; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-8px); }
  75% { transform: translateX(8px); }
}

@media (max-width: 1200px) {
  .dashboard-grid { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
}
