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

:root {
  --azul-oscuro: #1a3a6b;
  --azul-medio: #2563eb;
  --azul-claro: #e8f0fe;
  --verde: #16a34a;
  --rojo: #dc2626;
  --amarillo: #d97706;
  --gris: #6b7280;
  --fondo: #f5f7fa;
  --blanco: #ffffff;
  --borde: #d1d5db;
  --texto: #1f2937;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: var(--fondo);
  color: var(--texto);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ===== NAVEGACIÓN ===== */
nav {
  background-color: var(--azul-oscuro);
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.nav-logo {
  color: var(--blanco);
  font-size: 1.2rem;
  font-weight: 700;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-links {
  display: flex;
  gap: 1.5rem;
  list-style: none;
}

.nav-links a {
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  font-size: 0.95rem;
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  transition: background 0.2s;
}

.nav-links a:hover,
.nav-links a.activo {
  background-color: rgba(255,255,255,0.15);
  color: var(--blanco);
}

/* ===== CONTENIDO PRINCIPAL ===== */
main {
  flex: 1;
  padding: 2rem;
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
}

/* ===== ENCABEZADO DE PÁGINA ===== */
.page-header {
  margin-bottom: 2rem;
}

.page-header h1 {
  font-size: 1.8rem;
  color: var(--azul-oscuro);
  margin-bottom: 0.4rem;
}

.page-header p {
  color: var(--gris);
  font-size: 0.95rem;
}

/* ===== TARJETAS ===== */
.card {
  background: var(--blanco);
  border-radius: 10px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  padding: 1.5rem;
  border: 1px solid var(--borde);
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.8rem;
}

.card h2 {
  font-size: 1.1rem;
  color: var(--azul-oscuro);
  margin-bottom: 0.3rem;
}

.card .universidad {
  font-size: 0.9rem;
  color: var(--gris);
  margin-bottom: 0.8rem;
}

.card .descripcion {
  font-size: 0.9rem;
  color: var(--texto);
  line-height: 1.5;
  margin-bottom: 1rem;
}

.card .info-row {
  display: flex;
  gap: 1rem;
  font-size: 0.85rem;
  color: var(--gris);
  margin-bottom: 1rem;
}

/* ===== BADGES DE ESTADO ===== */
.badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
}

.badge-verde  { background: #dcfce7; color: var(--verde); }
.badge-rojo   { background: #fee2e2; color: var(--rojo); }
.badge-amarillo { background: #fef3c7; color: var(--amarillo); }
.badge-azul   { background: var(--azul-claro); color: var(--azul-medio); }

/* ===== BOTONES ===== */
.btn {
  display: inline-block;
  padding: 0.6rem 1.4rem;
  border-radius: 7px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  border: none;
  transition: opacity 0.2s, transform 0.1s;
}

.btn:hover { opacity: 0.88; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primario  { background: var(--azul-medio); color: var(--blanco); }
.btn-secundario { background: var(--blanco); color: var(--azul-oscuro); border: 1.5px solid var(--borde); }
.btn-danger    { background: var(--rojo); color: var(--blanco); }
.btn-exito     { background: var(--verde); color: var(--blanco); }
.btn-sm        { padding: 0.35rem 0.9rem; font-size: 0.85rem; }
.btn-bloque    { width: 100%; text-align: center; }

/* ===== FORMULARIOS ===== */
.form-container {
  max-width: 480px;
  margin: 2rem auto;
}

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

.form-group label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--texto);
  margin-bottom: 0.4rem;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.65rem 0.9rem;
  border: 1.5px solid var(--borde);
  border-radius: 7px;
  font-size: 0.95rem;
  color: var(--texto);
  background: var(--blanco);
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--azul-medio);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

.form-group textarea {
  resize: vertical;
  min-height: 90px;
}

.form-fila {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-pie {
  text-align: center;
  margin-top: 1rem;
  font-size: 0.9rem;
  color: var(--gris);
}

.form-pie a {
  color: var(--azul-medio);
  text-decoration: none;
  font-weight: 600;
}

/* ===== ALERTAS ===== */
.alerta {
  padding: 0.8rem 1.2rem;
  border-radius: 7px;
  font-size: 0.9rem;
  margin-bottom: 1.2rem;
}

.alerta-info    { background: var(--azul-claro); color: var(--azul-oscuro); border-left: 4px solid var(--azul-medio); }
.alerta-exito   { background: #dcfce7; color: #14532d; border-left: 4px solid var(--verde); }
.alerta-error   { background: #fee2e2; color: #7f1d1d; border-left: 4px solid var(--rojo); }

/* ===== TABLA ===== */
.tabla-container {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

thead {
  background: var(--azul-claro);
}

thead th {
  padding: 0.8rem 1rem;
  text-align: left;
  font-weight: 700;
  color: var(--azul-oscuro);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

tbody tr {
  border-bottom: 1px solid var(--borde);
  transition: background 0.15s;
}

tbody tr:hover {
  background: #f9fafb;
}

tbody td {
  padding: 0.85rem 1rem;
  color: var(--texto);
}

/* ===== HERO (página principal) ===== */
.hero {
  background: linear-gradient(135deg, var(--azul-oscuro) 0%, var(--azul-medio) 100%);
  color: var(--blanco);
  padding: 3rem 2rem;
  text-align: center;
  margin-bottom: 2.5rem;
}

.hero h1 {
  font-size: 2.2rem;
  margin-bottom: 0.8rem;
}

.hero p {
  font-size: 1.1rem;
  opacity: 0.9;
  margin-bottom: 1.5rem;
}

/* ===== FOOTER ===== */
footer {
  background: var(--azul-oscuro);
  color: rgba(255,255,255,0.6);
  text-align: center;
  padding: 1.2rem;
  font-size: 0.85rem;
  margin-top: auto;
}

/* ===== UTILIDADES ===== */
.text-center { text-align: center; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mt-2 { margin-top: 1rem; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }

/* ===== NOTIFICACIONES — campanita navbar ===== */
.notif-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.notif-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.35rem;
  line-height: 1;
  padding: 0.3rem 0.4rem;
  border-radius: 6px;
  color: rgba(255,255,255,0.85);
  transition: background 0.2s;
  position: relative;
  display: flex;
  align-items: center;
}

.notif-btn:hover {
  background: rgba(255,255,255,0.15);
}

.notif-badge {
  position: absolute;
  top: -2px;
  right: -4px;
  background: #ef4444;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  min-width: 17px;
  height: 17px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  line-height: 1;
  pointer-events: none;
}

.notif-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 340px;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.18);
  border: 1px solid #e5e7eb;
  z-index: 999;
  overflow: hidden;
  animation: notif-aparecer 0.18s ease;
}

@keyframes notif-aparecer {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.notif-dropdown.abierto {
  display: block;
}

.notif-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.85rem 1rem 0.7rem;
  border-bottom: 1px solid #f0f0f0;
}

.notif-header strong {
  font-size: 0.9rem;
  color: #1a3a6b;
}

.notif-leer-todas {
  font-size: 0.78rem;
  color: #2563eb;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  font-weight: 600;
}

.notif-leer-todas:hover { text-decoration: underline; }

.notif-lista {
  max-height: 360px;
  overflow-y: auto;
}

.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid #f3f4f6;
  cursor: pointer;
  transition: background 0.15s;
  text-decoration: none;
  color: inherit;
}

.notif-item:last-child { border-bottom: none; }

.notif-item:hover { background: #f8faff; }

.notif-item.no-leida { background: #eff6ff; }
.notif-item.no-leida:hover { background: #dbeafe; }

.notif-punto {
  width: 8px;
  height: 8px;
  min-width: 8px;
  border-radius: 50%;
  background: #2563eb;
  margin-top: 5px;
}

.notif-item.leida .notif-punto { background: transparent; }

.notif-texto {
  font-size: 0.85rem;
  color: #374151;
  line-height: 1.45;
  flex: 1;
}

.notif-fecha {
  font-size: 0.75rem;
  color: #9ca3af;
  margin-top: 0.25rem;
  display: block;
}

.notif-vacia {
  text-align: center;
  padding: 2rem 1rem;
  color: #9ca3af;
  font-size: 0.88rem;
}