/* ============================================================
   Notificaciones Internas — Aire Bahia
   Componente compartido para todos los modulos
   ============================================================ */

/* ── BELL ICON ─────────────────────────────────────────────── */
.notif-bell {
  position: relative;
  display: flex;
  align-items: center;
}
.notif-bell-btn {
  background: none;
  border: none;
  color: #fff;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 6px;
  transition: background .15s;
  position: relative;
  display: flex;
  align-items: center;
}
.notif-bell-btn:hover { background: rgba(255,255,255,.15); }
.notif-bell-btn:active { background: rgba(255,255,255,.25); }

/* ── BADGE ─────────────────────────────────────────────────── */
.notif-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  background: #ef4444;
  color: #fff;
  font-size: .6rem;
  font-weight: 800;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 99px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  pointer-events: none;
  box-shadow: 0 1px 4px rgba(239,68,68,.5);
}
@keyframes notif-pulse {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.25); }
  100% { transform: scale(1); }
}
.notif-badge-pulse { animation: notif-pulse .4s ease; }

/* ── PANEL DROPDOWN ────────────────────────────────────────── */
.notif-panel {
  position: fixed;
  z-index: 9999;
  width: 380px;
  max-width: calc(100vw - 16px);
  max-height: 480px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 40px rgba(37,100,109,.22), 0 0 0 1px rgba(37,100,109,.08);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: notif-panel-in .15s ease;
}
@keyframes notif-panel-in {
  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: 12px 16px;
  border-bottom: 1px solid #e8f0f1;
  background: #f8fbfb;
}
.notif-panel-header h3 {
  font-size: .85rem;
  font-weight: 700;
  color: #25646d;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}
.notif-panel-action {
  background: none;
  border: none;
  color: #52bdb0;
  font-size: .75rem;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: background .15s;
}
.notif-panel-action:hover { background: rgba(82,189,176,.1); }

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

.notif-empty {
  text-align: center;
  color: #94a3b8;
  font-size: .82rem;
  padding: 32px 16px;
}

/* ── NOTIF ITEM ────────────────────────────────────────────── */
.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid #f1f5f9;
  cursor: default;
  transition: background .12s;
}
.notif-item:hover { background: #f8fbfb; }
.notif-item:last-child { border-bottom: none; }

.notif-leida { opacity: .55; }
.notif-leida .notif-item-titulo { font-weight: 500; }

.notif-item-urgente { border-left: 3px solid #ef4444; }
.notif-item-alta    { border-left: 3px solid #f59e0b; }

.notif-item-icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #e8f5f3;
  color: #25646d;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .9rem;
}
.notif-item-urgente .notif-item-icon { background: #fef2f2; color: #ef4444; }
.notif-item-alta .notif-item-icon    { background: #fffbeb; color: #f59e0b; }

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

.notif-item-titulo {
  font-size: .82rem;
  font-weight: 700;
  color: #1e2d2f;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.notif-item-msg {
  font-size: .75rem;
  color: #637e82;
  margin-top: 2px;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.notif-item-meta {
  font-size: .68rem;
  color: #94a3b8;
  margin-top: 4px;
  display: flex;
  gap: 8px;
  align-items: center;
}
.notif-item-modulo {
  background: #f1f5f9;
  padding: 1px 6px;
  border-radius: 3px;
  font-weight: 600;
  text-transform: uppercase;
  font-size: .62rem;
  letter-spacing: .3px;
}

.notif-item-actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-shrink: 0;
}
.notif-btn-leer, .notif-btn-ir {
  background: none;
  border: 1px solid #e2e8f0;
  color: #64748b;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .75rem;
  transition: all .12s;
  text-decoration: none;
}
.notif-btn-leer:hover { background: #f0fdf4; color: #22c55e; border-color: #22c55e; }
.notif-btn-ir:hover   { background: #eff6ff; color: #3b82f6; border-color: #3b82f6; }

/* ── POPUP TOAST ───────────────────────────────────────────── */
.notif-popup-wrap {
  position: fixed;
  top: 68px;
  right: 16px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  max-width: 360px;
  width: 100%;
}

.notif-popup {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 6px 28px rgba(37,100,109,.2), 0 0 0 1px rgba(37,100,109,.08);
  padding: 12px 14px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  pointer-events: all;
  cursor: pointer;
  animation: notif-popup-in .3s ease;
  border-left: 4px solid #52bdb0;
  transition: opacity .3s, transform .3s;
}
.notif-popup-urgente { border-left-color: #ef4444; }
.notif-popup-alta    { border-left-color: #f59e0b; }

@keyframes notif-popup-in {
  from { opacity: 0; transform: translateX(40px); }
  to   { opacity: 1; transform: translateX(0); }
}
.notif-popup-out {
  opacity: 0 !important;
  transform: translateX(40px) !important;
}

.notif-popup-icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: #e8f5f3;
  color: #25646d;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .85rem;
}
.notif-popup-urgente .notif-popup-icon { background: #fef2f2; color: #ef4444; }
.notif-popup-alta .notif-popup-icon    { background: #fffbeb; color: #f59e0b; }

.notif-popup-body { flex: 1; min-width: 0; }
.notif-popup-titulo {
  font-size: .8rem;
  font-weight: 700;
  color: #1e2d2f;
  line-height: 1.3;
}
.notif-popup-msg {
  font-size: .72rem;
  color: #637e82;
  margin-top: 2px;
  line-height: 1.3;
}
.notif-popup-close {
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 2px;
  font-size: .8rem;
  flex-shrink: 0;
}
.notif-popup-close:hover { color: #ef4444; }

/* ── RESPONSIVE ────────────────────────────────────────────── */
@media (max-width: 480px) {
  .notif-panel { width: calc(100vw - 16px); right: 8px !important; }
  .notif-popup-wrap { right: 8px; max-width: calc(100vw - 16px); }
}
