/* ============================================================
   NOTIFICACIONES.CSS
   ============================================================ */

/* ── CAMPANA ─────────────────────────────────────────────────── */
.notif-campana {
  position: relative;
  cursor: pointer;
  padding: .3rem .5rem;
  border-radius: 8px;
  display: flex;
  align-items: center;
  transition: background .15s;
  margin-right: .3rem;
}
.notif-campana:hover  { background: rgba(255,255,255,.15); }
.notif-campana.tiene-notif .notif-icono { animation: none; }

.notif-icono { font-size: 1.2rem; line-height: 1; }

.notif-badge {
  position: absolute;
  top: -.1rem;
  right: -.1rem;
  background: #ef4444;
  color: #fff;
  font-size: .62rem;
  font-weight: 800;
  min-width: 17px;
  height: 17px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 .3rem;
  border: 2px solid var(--primario);
  line-height: 1;
}

/* Animación de la campana */
@keyframes ring {
  0%   { transform: rotate(0); }
  10%  { transform: rotate(14deg); }
  20%  { transform: rotate(-10deg); }
  30%  { transform: rotate(12deg); }
  40%  { transform: rotate(-8deg); }
  50%  { transform: rotate(6deg); }
  60%  { transform: rotate(-4deg); }
  70%  { transform: rotate(2deg); }
  80%  { transform: rotate(0); }
  100% { transform: rotate(0); }
}
.campana-ring .notif-icono { animation: ring 1s ease; }

/* ── PANEL ───────────────────────────────────────────────────── */
.notif-panel {
  position: fixed;
  top: 60px;
  right: 1rem;
  width: 360px;
  max-height: 480px;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 8px 40px rgba(0,0,0,.18);
  border: 1px solid var(--borde);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: fadeDown .2s ease;
}

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

.notif-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .9rem 1.1rem .7rem;
  border-bottom: 1px solid var(--borde);
  font-size: .9rem;
  font-weight: 700;
  color: var(--primario);
  background: #f8fafc;
}

.btn-marcar-todas {
  background: none;
  border: 1px solid var(--borde);
  border-radius: 6px;
  padding: .2rem .7rem;
  font-size: .75rem;
  cursor: pointer;
  color: var(--texto-m);
  transition: background .15s;
}
.btn-marcar-todas:hover { background: #f0f4f8; color: var(--primario); }

.notif-lista { overflow-y: auto; flex: 1; }

.notif-item {
  display: flex;
  align-items: flex-start;
  gap: .7rem;
  padding: .85rem 1.1rem;
  border-bottom: 1px solid #f1f5f9;
  cursor: pointer;
  transition: background .15s;
  position: relative;
}
.notif-item:hover      { background: #f8fafc; }
.notif-item.no-leida   { background: #eff6ff; }
.notif-item.no-leida:hover { background: #dbeafe; }
.notif-item:last-child { border-bottom: none; }

.notif-item-icono { font-size: 1.4rem; flex-shrink: 0; margin-top: .1rem; }
.notif-item-cuerpo{ flex: 1; min-width: 0; }
.notif-item-msg   { font-size: .84rem; color: var(--texto); margin: 0 0 .2rem; line-height: 1.4; }
.notif-item-fecha { font-size: .72rem; color: #94a3b8; }
.notif-item.leida .notif-item-msg { color: var(--texto-m); }

.notif-punto {
  width: 8px; height: 8px; background: #3b82f6;
  border-radius: 50%; flex-shrink: 0; margin-top: .35rem;
}

.notif-cargando, .notif-vacia {
  text-align: center;
  color: var(--texto-m);
  padding: 2rem 1rem;
  font-size: .88rem;
}

.notif-panel-footer {
  padding: .6rem 1.1rem;
  border-top: 1px solid var(--borde);
  font-size: .75rem;
  color: var(--texto-m);
  text-align: center;
  background: #f8fafc;
}

/* ── RESPONSIVE ─────────────────────────────────────────────── */
@media (max-width: 480px) {
  .notif-panel { width: calc(100vw - 1rem); right: .5rem; }
}
