/* ============================================
   NOTIFICACIONES · Panel desplegable de la campana
   ============================================ */

.notif-btn {
  position: relative;
  background: none;
  border: none;
  font-size: 22px;          /* campana bien visible */
  cursor: pointer;
  color: var(--marron);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: background 0.2s;
}

.notif-btn:hover {
  background: var(--nude-light);
}

.notif-badge {
  position: absolute;
  top: 2px;
  right: 0;
  background: var(--error);
  color: white;
  font-size: 9px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  border: 1.5px solid white;
  box-sizing: border-box;
  line-height: 1;
  pointer-events: none;     /* clicks pasan al botón */
}

/* Si no hay notificaciones, ocultar la badge */
.notif-badge:empty,
.notif-badge[data-count="0"] {
  display: none;
}

/* ===== Panel ===== */
.notif-panel {
  position: fixed;
  top: 70px;
  right: 24px;
  width: 380px;
  max-width: calc(100vw - 24px);
  max-height: calc(100vh - 90px);
  background: white;
  border-radius: 14px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.18), 0 0 0 1px var(--borde);
  z-index: 300;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: notif-aparecer 0.2s ease;
}

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

.notif-panel-header {
  background: linear-gradient(135deg, var(--marron) 0%, var(--negro) 100%);
  color: white;
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.notif-panel-titulo {
  font-family: var(--font-titulo);
  font-size: 16px;
  letter-spacing: 0.5px;
}

.notif-panel-subtitulo {
  font-size: 11px;
  color: var(--tierra);
  margin-top: 2px;
}

.notif-panel-cerrar {
  background: none;
  border: none;
  color: var(--tierra);
  font-size: 18px;
  cursor: pointer;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.notif-panel-cerrar:hover {
  background: rgba(180, 159, 139, 0.2);
}

.notif-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}

.notif-panel-footer {
  padding: 8px 16px;
  background: var(--nude-light);
  border-top: 1px solid var(--borde);
  text-align: center;
  color: var(--texto-suave);
  font-size: 10px;
}

/* ===== Grupos por importancia ===== */
.notif-grupo {
  margin-bottom: 12px;
}

.notif-grupo-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--texto-suave);
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 6px 10px 4px;
}

/* ===== Item individual ===== */
.notif-item {
  display: flex;
  gap: 10px;
  padding: 10px;
  border-radius: 8px;
  transition: background 0.15s;
  align-items: center;
  border-left: 3px solid transparent;
  margin-bottom: 4px;
}

.notif-item:hover {
  background: var(--nude-light);
}

.notif-item .notif-content {
  cursor: pointer;
}

.notif-item.notif-alta  { border-left-color: var(--error); }
.notif-item.notif-media { border-left-color: var(--aviso); }
.notif-item.notif-baja  { border-left-color: var(--exito); }

.notif-icon {
  font-size: 22px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--nude-light);
  border-radius: 50%;
  flex-shrink: 0;
}

.notif-content {
  flex: 1;
  min-width: 0;
}

.notif-title {
  font-weight: 600;
  font-size: 13px;
  color: var(--marron);
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.notif-desc {
  font-size: 11px;
  color: var(--texto-suave);
  margin-top: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.notif-arrow {
  color: var(--texto-suave);
  font-size: 18px;
  flex-shrink: 0;
}

/* Botón ✓ para descartar la notificación */
.notif-action {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--nude-light);
  color: var(--marron);
  border: 1px solid var(--borde);
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.notif-action:hover {
  background: var(--exito);
  color: white;
  border-color: var(--exito);
  transform: scale(1.08);
}

/* Botón restore en el footer */
.notif-restore-btn {
  background: var(--nude-light);
  border: 1px solid var(--borde);
  color: var(--marron);
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  transition: all 0.15s;
}

.notif-restore-btn:hover {
  background: var(--tierra);
  color: white;
  border-color: var(--tierra);
}

.notif-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--texto-suave);
  font-size: 13px;
  line-height: 1.7;
}

.notif-empty small {
  font-size: 11px;
  color: var(--tierra);
}

/* ===== Móvil ===== */
@media (max-width: 600px) {
  .notif-panel {
    position: fixed;
    top: 60px;
    right: 6px;
    left: 6px;
    width: auto;
    max-width: none;
  }
}
