/* ============================================================
   LPH – Estilos personalizados
   ============================================================ */

:root {
  /* Colores institucionales (azul del logo LPH) */
  --brand:        #1e3a8f;
  --brand-dark:   #142a6b;
  --brand-light:  #e8eefb;
  --brand-rgb:    30,58,143;

  --sidebar-width: 260px;
  --sidebar-bg: #123b2c;
  --sidebar-text: #a7c4b8;
  --sidebar-active: #ffffff;
  --sidebar-active-bg: rgba(255,255,255,.10);
  --sidebar-hover-bg: rgba(255,255,255,.06);
  --accent: #1e3a8f;
  --accent-dark: #142a6b;
  --danger-color: #e53e3e;
  --warning-color: #ed8936;
  --success-color: #38a169;
  --info-color: #3182ce;

  /* Bootstrap: repinta primarios y enlaces con el azul institucional */
  --bs-primary: #1e3a8f;
  --bs-primary-rgb: 30,58,143;
  --bs-link-color: #1e3a8f;
  --bs-link-color-rgb: 30,58,143;
  --bs-link-hover-color: #142a6b;
  /* Tonos "subtle" del primario (usados por .alert-primary, .bg-primary-subtle, etc.) */
  --bs-primary-bg-subtle: #e8eefb;
  --bs-primary-border-subtle: #b9cbf0;
  --bs-primary-text-emphasis: #142a6b;
}

/* ---- Tema institucional: componentes Bootstrap ---- */
.btn-primary {
  --bs-btn-bg: var(--brand); --bs-btn-border-color: var(--brand);
  --bs-btn-hover-bg: var(--brand-dark); --bs-btn-hover-border-color: var(--brand-dark);
  --bs-btn-active-bg: var(--brand-dark); --bs-btn-active-border-color: var(--brand-dark);
  --bs-btn-disabled-bg: var(--brand); --bs-btn-disabled-border-color: var(--brand);
}
.btn-outline-primary {
  --bs-btn-color: var(--brand); --bs-btn-border-color: var(--brand);
  --bs-btn-hover-bg: var(--brand); --bs-btn-hover-border-color: var(--brand);
  --bs-btn-active-bg: var(--brand); --bs-btn-active-border-color: var(--brand);
}
.bg-primary        { background-color: var(--brand) !important; }
.text-primary      { color: var(--brand) !important; }
.badge.bg-primary  { background-color: var(--brand) !important; }
.page-link         { color: var(--brand); }
.page-item.active .page-link { background-color: var(--brand); border-color: var(--brand); }
.nav-tabs .nav-link.active { color: var(--brand); }
.form-control:focus, .form-select:focus {
  border-color: #5b82d6;
  box-shadow: 0 0 0 .2rem rgba(var(--brand-rgb), .18);
}
.form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }
a { color: var(--brand); }

/* ---- Layout ---- */
body { background: #f4f6fa; font-family: 'Segoe UI', system-ui, sans-serif; }

#app { display: flex; min-height: 100vh; }

/* ---- Sidebar ---- */
#sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: transform .25s ease;
}
#sidebar .brand {
  padding: 1.5rem 1.25rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
#sidebar .brand h5 { color: #fff; font-weight: 700; margin: 0; font-size: .95rem; }
#sidebar .brand small { color: var(--sidebar-text); font-size: .75rem; }

#sidebar nav { flex: 1; overflow-y: auto; padding: .75rem 0; }
#sidebar nav a {
  display: flex; align-items: center; gap: .7rem;
  padding: .6rem 1.25rem;
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: .875rem;
  border-radius: 0;
  transition: background .15s, color .15s;
}
#sidebar nav a:hover { background: var(--sidebar-hover-bg); color: #fff; }
#sidebar nav a.active { background: var(--sidebar-active-bg); color: var(--sidebar-active); }
#sidebar nav a .bi { font-size: 1.05rem; }
#sidebar .nav-section {
  padding: .5rem 1.25rem .25rem;
  font-size: .65rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: rgba(255,255,255,.3);
}
#sidebar .sidebar-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid rgba(255,255,255,.08);
}
#sidebar .sidebar-footer .user-info { color: #fff; font-size: .8rem; }
#sidebar .sidebar-footer .user-info small { color: var(--sidebar-text); }

/* ---- Main content ---- */
#main {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
#topbar {
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  padding: .75rem 1.5rem;
  display: flex;
  align-items: center;
  gap: .75rem;
  position: sticky;
  top: 0;
  z-index: 99;
}
#topbar h4 { margin: 0; font-size: 1.05rem; font-weight: 600; flex: 1; }
#page-content { padding: 1.5rem; flex: 1; }

/* ============================================================
   Login (rediseño: split-panel + glassmorphism + aurora animada)
   ============================================================ */
#view-login {
  min-height: 100vh;
  position: relative;
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  padding: 1.5rem;
  background: radial-gradient(130% 130% at 100% 0%, #2a54c6 0%, #142a6b 55%, #0a1533 100%);
}

/* Aurora animada de fondo */
.login-aurora { position: absolute; inset: 0; overflow: hidden; z-index: 0; }
.login-aurora .blob {
  position: absolute; border-radius: 50%; filter: blur(70px); opacity: .5;
  mix-blend-mode: screen; animation: blobMove 20s ease-in-out infinite;
}
.login-aurora .b1 { width: 440px; height: 440px; background: #29abe2; top: -90px; left: -70px; }
.login-aurora .b2 { width: 380px; height: 380px; background: #3b6fe0; bottom: -120px; right: -50px; animation-delay: -7s; }
.login-aurora .b3 { width: 320px; height: 320px; background: #7cc7f2; top: 42%; left: 52%; opacity: .3; animation-delay: -13s; }
@keyframes blobMove {
  0%, 100% { transform: translate(0,0) scale(1); }
  33%      { transform: translate(45px,-35px) scale(1.12); }
  66%      { transform: translate(-35px,28px) scale(.94); }
}

.login-card {
  position: relative; z-index: 1;
  width: 100%; max-width: 860px;
  display: flex; overflow: hidden;
  border-radius: 22px;
  background: rgba(255,255,255,.94);
  backdrop-filter: blur(12px);
  box-shadow: 0 30px 80px rgba(0,0,0,.38);
  border: 1px solid rgba(255,255,255,.45);
  animation: cardIn .6s cubic-bezier(.2,.8,.2,1) both;
}
@keyframes cardIn { from { opacity: 0; transform: translateY(26px) scale(.98); } to { opacity: 1; transform: none; } }

/* Panel de marca (izquierda) */
.login-brand {
  flex: 0 0 44%;
  position: relative; overflow: hidden;
  padding: 2.4rem 2rem;
  color: #fff;
  background: linear-gradient(150deg, #142a6b 0%, #1e3a8f 55%, #2a54c6 100%);
  display: flex; flex-direction: column; gap: 1.4rem;
}
.login-brand::before, .login-brand::after { content: ""; position: absolute; border-radius: 50%; }
.login-brand::before { width: 240px; height: 240px; top: -90px; right: -70px; background: rgba(255,255,255,.08); }
.login-brand::after  { width: 170px; height: 170px; bottom: -60px; left: -50px; background: rgba(41,171,226,.18); }
.login-brand .brand-top { display: flex; align-items: center; gap: .8rem; position: relative; }
.login-brand .brand-logo {
  width: 52px; height: 52px; border-radius: 14px; background: #fff; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; overflow: hidden; padding: 5px;
  color: var(--brand); box-shadow: 0 8px 20px rgba(0,0,0,.22);
  animation: floaty 4s ease-in-out infinite;
}
.login-brand .brand-logo img { width: 100%; height: 100%; object-fit: contain; }
@keyframes floaty { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.login-brand .brand-title { font-weight: 800; font-size: 1.5rem; margin: 0; letter-spacing: .02em; }
.login-brand .brand-sub { margin: 0; opacity: .8; font-size: .8rem; }
.login-brand .brand-mid { position: relative; margin-top: auto; }
.login-brand .brand-mid h2 { font-weight: 700; font-size: 1.45rem; line-height: 1.2; margin: 0 0 .5rem; }
.login-brand .brand-mid p { opacity: .85; font-size: .86rem; line-height: 1.55; margin: 0; }
.login-brand .brand-feats { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .5rem; position: relative; }
.login-brand .brand-feats li { font-size: .8rem; display: flex; align-items: center; gap: .55rem; opacity: .92; }
.login-brand .brand-feats i { color: #7cc7f2; font-size: .95rem; }

/* Panel de formulario (derecha) */
.login-form-panel { flex: 1; padding: 2.6rem 2.4rem; background: #fff; }
.login-form-panel .lf-title { font-weight: 700; margin: 0 0 .25rem; color: #1e293b; }
.login-form-panel .lf-sub { color: #64748b; font-size: .85rem; margin: 0 0 1.4rem; }
.login-form-panel .lf-field { margin-bottom: 1rem; }
.login-form-panel .lf-field > label { display: block; font-size: .8rem; font-weight: 600; color: #334155; margin-bottom: .35rem; }
.login-form-panel .lf-input {
  display: flex; align-items: center; gap: .6rem;
  border: 1.5px solid #e2e8f0; border-radius: 12px; padding: .7rem .85rem;
  background: #f8fafc; transition: border-color .15s, box-shadow .15s, background .15s;
}
.login-form-panel .lf-input:focus-within { border-color: var(--brand); background: #fff; box-shadow: 0 0 0 4px rgba(30,58,143,.13); }
.login-form-panel .lf-input > i { color: #94a3b8; font-size: 1rem; }
.login-form-panel .lf-input input { border: 0; outline: 0; background: transparent; flex: 1; font-size: .95rem; color: #1e293b; }
.login-form-panel .lf-toggle { border: 0; background: transparent; color: #94a3b8; cursor: pointer; padding: 0 .1rem; line-height: 1; }
.login-form-panel .lf-toggle:hover { color: var(--brand); }
.login-form-panel .lf-submit {
  width: 100%; margin-top: .6rem; border: 0; border-radius: 12px; padding: .8rem 1rem;
  font-weight: 700; color: #fff; cursor: pointer;
  background: linear-gradient(135deg, #1e3a8f, #2a54c6);
  display: flex; align-items: center; justify-content: center; gap: .5rem;
  box-shadow: 0 10px 24px rgba(30,58,143,.35);
  transition: transform .15s, box-shadow .15s, filter .15s;
}
.login-form-panel .lf-submit:hover { transform: translateY(-2px); box-shadow: 0 14px 30px rgba(30,58,143,.45); filter: brightness(1.06); }
.login-form-panel .lf-submit i { transition: transform .2s; }
.login-form-panel .lf-submit:hover i { transform: translateX(4px); }
.login-form-panel .lf-foot { text-align: center; color: #94a3b8; font-size: .72rem; margin: 1.4rem 0 0; }

/* Responsive: colapsar el panel de marca en móvil */
@media (max-width: 640px) {
  .login-card { flex-direction: column; max-width: 420px; }
  .login-brand { flex-basis: auto; padding: 1.5rem 1.6rem 1.3rem; gap: .9rem; }
  .login-brand .brand-mid, .login-brand .brand-feats { display: none; }
  .login-form-panel { padding: 1.8rem 1.6rem 2rem; }
}
@media (prefers-reduced-motion: reduce) {
  .login-aurora .blob, .login-brand .brand-logo, .login-card { animation: none; }
}

/* Logo institucional en la barra lateral (chip blanco para que resalte sobre el azul) */
#sidebar .brand-logo-chip {
  width: 38px; height: 38px; border-radius: 9px; background: #fff;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; padding: 3px; flex-shrink: 0; color: var(--brand);
}
#sidebar .brand-logo-chip img { width: 100%; height: 100%; object-fit: contain; }

/* ---- Stat cards ---- */
.stat-card {
  background: #fff;
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
  display: flex; align-items: center; gap: 1rem;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
  border-left: 4px solid transparent;
}
.stat-card.blue   { border-left-color: var(--brand); }
.stat-card.green  { border-left-color: var(--success-color); }
.stat-card.yellow { border-left-color: var(--warning-color); }
.stat-card.red    { border-left-color: var(--danger-color); }
.stat-card > div  { min-width: 0; }
.stat-card .icon {
  width: 48px; height: 48px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; flex-shrink: 0;
}
.stat-card.blue   .icon { background: var(--brand-light); color: var(--brand); }
.stat-card.green  .icon { background: #f0fff4; color: var(--success-color); }
.stat-card.yellow .icon { background: #fffaf0; color: var(--warning-color); }
.stat-card.red    .icon { background: #fff5f5; color: var(--danger-color); }
.stat-card .value { font-size: 1.8rem; font-weight: 700; line-height: 1; color: #1a202c; }
.stat-card .label { font-size: .78rem; color: #718096; margin-top: .2rem; }

/* Responsivo: en pantallas medianas/estrechas evita que el contenido se corte */
@media (max-width: 1199.98px) {
  .stat-card { padding: 1rem 1.1rem; gap: .75rem; }
  .stat-card .icon { width: 42px; height: 42px; font-size: 1.15rem; }
  .stat-card .value { font-size: 1.5rem; }
}
@media (max-width: 575.98px) {
  .stat-card { padding: .85rem .9rem; }
  .stat-card .value { font-size: 1.35rem; }
  .stat-card .label { font-size: .72rem; }
}

/* Contenedor de altura fija para gráficos: tamaño estable en cualquier ancho */
.chart-box { position: relative; width: 100%; height: 260px; }
.chart-box canvas { max-height: 100%; }

/* ---- Badges de riesgo ---- */
.badge-critico  { background:#c53030; color:#fff; }
.badge-alto     { background:#e53e3e; color:#fff; }
.badge-medio    { background:#ed8936; color:#fff; }
.badge-bajo     { background:#38a169; color:#fff; }
.badge-urgente  { background:#c53030; color:#fff; }
.badge-alta     { background:#e53e3e; color:#fff; }
.badge-media    { background:#ed8936; color:#fff; }
.badge-baja     { background:#718096; color:#fff; }

/* ---- Flags de estudiante ---- */
.flag-badge {
  display: inline-flex; align-items: center; gap: .3rem;
  font-size: .7rem; padding: .2rem .5rem; border-radius: 4px;
  font-weight: 600;
}
.flag-judicial   { background:#fed7d7; color:#c53030; }
.flag-salud      { background:#bee3f8; color:#2b6cb0; }
.flag-conducta   { background:#feebc8; color:#c05621; }
.flag-ausentismo { background:#e9d8fd; color:#6b46c1; }
.flag-repitencia { background:#fefcbf; color:#744210; }
.flag-familia    { background:#c6f6d5; color:#276749; }
.flag-nee        { background:#e2e8f0; color:#4a5568; }
.flag-vulnerable { background:#fed7d7; color:#9b2c2c; }

/* Variables críticas compactas (tabla de alertas) */
.flags-mini { display: flex; flex-wrap: wrap; gap: 3px; }
.flag-mini {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; border-radius: 5px; font-size: .72rem;
}
.flag-mini-activo { outline: 2px solid var(--brand); outline-offset: 1px; box-shadow: 0 0 0 1px #fff inset; }

/* ---- Tabla estudiantes ---- */
.table-students { table-layout: fixed; width: 100%; }
.table-students th {
  font-size: .78rem; text-transform: uppercase;
  letter-spacing: .05em; color: #718096;
  overflow: hidden; white-space: nowrap;
}
.table-students td { vertical-align: middle; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.table-students td:nth-child(5) { white-space: normal; }   /* Flags: allow wrap */
.nombre-link { font-weight: 600; color: #2d3748; cursor: pointer; }
.nombre-link:hover { color: var(--accent); }

/* ---- Curso browser dentro de Estudiantes ---- */
#est-panel-cursos .nivel-header {
  border-bottom: 2px solid rgba(0,0,0,.08);
  padding-bottom: .5rem;
  margin-bottom: 1rem;
}
.curso-card:hover { transform: translateY(-3px); box-shadow: 0 6px 20px rgba(0,0,0,.12) !important; }
.curso-card { transition: transform .15s, box-shadow .15s; }

/* ---- Perfil estudiante ---- */
.profile-header {
  background: linear-gradient(135deg, #142a6b, #2a54c6);
  color: #fff; border-radius: 10px; padding: 1.5rem;
}
.profile-avatar {
  width: 120px; height: 120px; border-radius: 50%;
  background: rgba(255,255,255,.15);
  display: flex; align-items: center; justify-content: center;
  font-size: 2.6rem; font-weight: 700; color: #fff;
  flex: 0 0 100%;
}
.profile-avatar.has-foto { background: transparent; overflow: hidden; }
.profile-avatar.has-foto img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* Contenedor del avatar: foto arriba, botones en fila debajo (sin tapar la foto) */
.profile-avatar-wrap {
  flex-shrink: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-content: flex-start;
  gap: 6px;
  width: 120px;
}
.btn-foto-cambiar, .btn-foto-quitar {
  width: 30px; height: 30px; padding: 0;
  border-radius: 50%; border: 2px solid #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: .8rem; line-height: 1; cursor: pointer;
  color: #fff;
}
.btn-foto-cambiar { background: #2563eb; }
.btn-foto-cambiar:hover { background: #1d4ed8; }
.btn-foto-quitar  { background: #dc2626; }
.btn-foto-quitar:hover  { background: #b91c1c; }

/* Miniatura en la lista de estudiantes */
.est-avatar-mini {
  flex-shrink: 0;
  width: 30px; height: 30px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: #e2e8f0; color: #475569;
  font-size: .68rem; font-weight: 700; letter-spacing: .02em;
  overflow: hidden;
}
.est-avatar-mini.has-foto { background: transparent; }
.est-avatar-mini img { width: 100%; height: 100%; object-fit: cover; }
.obs-item {
  border-left: 4px solid #e2e8f0;
  padding: .75rem 1rem;
  background: #fff;
  border-radius: 0 6px 6px 0;
  margin-bottom: .6rem;
}
.obs-item.critico { border-left-color: #c53030; }
.obs-item.alto    { border-left-color: #e53e3e; }
.obs-item.medio   { border-left-color: #ed8936; }
.obs-item.bajo    { border-left-color: #38a169; }

/* ---- Alertas ---- */
.alerta-item {
  background: #fff; border-radius: 8px; padding: 1rem;
  border-left: 4px solid #e2e8f0; box-shadow: 0 1px 3px rgba(0,0,0,.05);
  margin-bottom: .5rem;
}
.alerta-item.urgente { border-left-color: #c53030; }
.alerta-item.alta    { border-left-color: #e53e3e; }
.alerta-item.media   { border-left-color: #ed8936; }
.alerta-item.baja    { border-left-color: #718096; }

/* ---- Drag & Drop CSV ---- */
.dropzone {
  border: 2px dashed #cbd5e0;
  border-radius: 10px;
  padding: 3rem 2rem;
  text-align: center;
  cursor: pointer;
  transition: all .2s;
  background: #fff;
}
.dropzone:hover, .dropzone.drag-over {
  border-color: var(--accent);
  background: #ebf4ff;
}
.dropzone .bi { font-size: 2.5rem; color: #a0aec0; }

/* ---- Charts ---- */
.chart-card {
  background: #fff; border-radius: 10px; padding: 1.25rem;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}

/* ---- Loaders ---- */
.spinner-overlay {
  position: fixed; inset: 0;
  background: rgba(255,255,255,.7);
  display: flex; align-items: center; justify-content: center;
  z-index: 9999;
}

/* ---- Toast ---- */
#toast-container { position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 10000; }
.toast-msg {
  min-width: 280px; max-width: 380px;
  padding: .85rem 1.2rem;
  border-radius: 8px; color: #fff;
  font-size: .875rem;
  box-shadow: 0 4px 12px rgba(0,0,0,.15);
  margin-top: .5rem;
  animation: slideIn .25s ease;
}
.toast-msg.success { background: var(--success-color); }
.toast-msg.error   { background: var(--danger-color);  }
.toast-msg.info    { background: var(--info-color);    }
.toast-msg.warning { background: var(--warning-color); }

@keyframes slideIn { from { transform: translateX(100%); opacity:0; } to { transform: translateX(0); opacity:1; } }

/* ---- Backdrop móvil ---- */
#sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 999;
  touch-action: manipulation;
  cursor: pointer;
}
#sidebar-backdrop.show { display: block; }

/* ---- Responsive ---- */
@media (max-width: 768px) {
  #sidebar {
    transform: translateX(-100%);
    z-index: 1000;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: var(--sidebar-width);
  }
  #sidebar.open { transform: translateX(0); }
  #main { margin-left: 0; }
}

/* ---- Casos críticos: grid de tarjetas ---- */
.critico-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .6rem;
  padding: .25rem 0;
}

.critico-card {
  background: #fff;
  border: 1px solid #e8ecf0;
  border-radius: 8px;
  padding: .65rem .75rem;
  cursor: pointer;
  transition: box-shadow .15s ease, transform .15s ease, border-color .15s ease;
}

.critico-card:hover {
  box-shadow: 0 4px 14px rgba(0,0,0,.1);
  transform: translateY(-1px);
  border-color: #c8d0db;
}

.critico-card__header {
  display: flex;
  align-items: center;
  gap: .55rem;
  margin-bottom: .45rem;
}

.critico-avatar {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: .8rem;
  letter-spacing: .02em;
}

.critico-card__info {
  flex: 1 1 0;
  min-width: 0;
}

.critico-card__nombre {
  font-size: .8rem;
  font-weight: 600;
  color: #1a202c;
  line-height: 1.25;
  word-break: break-word;
}

.critico-card__curso {
  font-size: .68rem;
  color: #718096;
  margin-top: .1rem;
}

.critico-score {
  flex-shrink: 0;
  min-width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .72rem;
  font-weight: 800;
  line-height: 1;
}

.critico-score--critical {
  background: #9b1c1c;
  color: #fff;
  box-shadow: 0 0 0 2px #fca5a5;
}

.critico-score--high {
  background: #c53030;
  color: #fff;
  box-shadow: 0 0 0 2px #fca5a5;
}

.critico-score--medium {
  background: #ed8936;
  color: #fff;
  box-shadow: 0 0 0 2px #fbd38d;
}

.critico-flags {
  display: flex;
  flex-wrap: wrap;
  gap: .2rem;
}

.critico-flags .flag-badge {
  font-size: .6rem;
  padding: .12rem .35rem;
}

@media (max-width: 500px) {
  .critico-grid {
    grid-template-columns: 1fr;
  }
}

/* ---- Alertas recientes: lista mejorada ---- */
.alerta-row {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .65rem .85rem;
  border-left: 4px solid #e2e8f0;
  border-bottom: 1px solid #f1f5f9;
  cursor: pointer;
  transition: background .15s;
  text-decoration: none;
}
.alerta-row:hover {
  background: #f8fafc;
}
.alerta-row:last-of-type {
  border-bottom: none;
}
.alerta-avatar {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: .75rem;
}
.alerta-body {
  flex: 1 1 0;
  min-width: 0;
}
.alerta-nombre {
  font-weight: 600;
  font-size: .82rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.alerta-tipo {
  font-size: .76rem;
  color: #64748b;
  margin-top: .1rem;
  display: flex;
  align-items: center;
  gap: .3rem;
}
.alerta-meta {
  flex-shrink: 0;
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: .2rem;
}
.alerta-tiempo {
  font-size: .7rem;
  color: #94a3b8;
}
.alerta-ver-todas {
  text-align: center;
  padding: .55rem 0 .25rem;
  border-top: 1px solid #f1f5f9;
}
.alerta-ver-todas a {
  font-size: .78rem;
  color: #4f8ef7;
  text-decoration: none;
}
.alerta-ver-todas a:hover {
  text-decoration: underline;
}

/* ============================================================
   USUARIOS
   ============================================================ */
.usr-avatar {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: .8rem;
  letter-spacing: .02em;
}

/* ─── Restricciones por rol ─────────────────────────────────────────────────
   Solo admin y directivo pueden ver/marcar "Observación privada".
   Esta regla con !important garantiza que docentes y asistentes nunca
   lo vean, incluso si JavaScript falla o si LiteSpeed sirve un app.js viejo.
*/
body:not(.rol-admin):not(.rol-directivo) #obs-privada-wrapper {
  display: none !important;
}

/* Observación / alerta marcada como privada — solo la ven admin/directivo
   (el backend ya las filtra para otros roles) */
.obs-item.obs-privada,
.alerta-item.alerta-privada {
  border-left-style: dashed;
  background: linear-gradient(90deg, rgba(33,37,41,0.04), transparent 60%);
}
