/* ==========================================================================
   header.css — Header principal + menú + notificaciones
   ========================================================================== */

/* Utilidad */
.oculto{
  display: none !important;
}

/* ===================== TOPBAR ===================== */
.topbar{
  position: sticky;
  top: 0;
  z-index: 5000;

  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;

  min-height: 76px;
  padding: 12px 20px 14px;

  background: #0f172a;
  color: #e9f2ff;
  box-shadow: 0 10px 24px rgba(0,0,0,.20);
}

/* brillo inferior */
.topbar::after{
  content:"";
  position:absolute;
  left:0; right:0; bottom:0;
  height: 6px;
  background: linear-gradient(
    180deg,
    rgba(255,255,255,0),
    rgba(255,255,255,.18)
  );
  pointer-events:none;
}

/* ===================== LADO IZQUIERDO ===================== */
.topbar-left{
  display:flex;
  align-items:flex-end;
  gap: 22px;
}

.logo{
  font-size: 26px;
  font-weight: 900;
  letter-spacing: .3px;
  color: #ffffff;
  white-space: nowrap;
}

/* ===================== MENÚ ===================== */
.main-nav{
  display:flex;
  gap: 18px;
  padding-bottom: 6px;
}

.main-nav a{
  color:#e9f2ff;
  text-decoration:none;
  font-weight: 700;
  font-size: 14px;

  padding: 10px 12px;
  border-radius: 10px;
  border-bottom: 2px solid transparent;

  transition: background .15s ease, border-color .15s ease;
}

.main-nav a:hover{
  background: rgba(255,255,255,.12);
  border-bottom-color: rgba(255,255,255,.55);
}

/* ===================== LADO DERECHO ===================== */
.topbar-right{
  display:flex;
  align-items:center;
  gap: 14px;
  padding-bottom: 6px;
}

/* ===================== CAMPANA ===================== */
.notif{
  position: relative;
}

.btn-notif{
  width: 40px;
  height: 40px;
  display:grid;
  place-items:center;

  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.08);

  font-size: 18px;
  color:#ffffff;
  cursor:pointer;

  transition: background .15s ease, transform .15s ease;
}

.btn-notif:hover{
  background: rgba(255,255,255,.16);
  transform: translateY(-1px);
}

/* Badge */
#notif_badge{
  position:absolute;
  top:-6px;
  right:-6px;

  min-width: 18px;
  height: 18px;
  padding: 0 6px;

  border-radius: 999px;
  background:#e11d48;
  color:#fff;

  font-size: 12px;
  font-weight: 900;
  line-height: 18px;
  text-align:center;
}

/* ===================== PANEL DE NOTIFICACIONES ===================== */
.notif-panel{
  position:absolute;
  right:0;
  top: 48px;

  width: 340px;
  max-width: 92vw;

  background:#ffffff;
  color:#0f172a;

  border:1px solid rgba(0,0,0,.12);
  border-radius: 14px;
  box-shadow: 0 18px 50px rgba(0,0,0,.20);
  overflow:hidden;
}

/* Header del panel */
.notif-head{
  display:flex;
  align-items:center;
  justify-content:space-between;

  padding: 10px 12px;
  background:#f8fafc;
  border-bottom:1px solid rgba(0,0,0,.06);
}

.notif-head strong{
  font-size: 14px;
  font-weight: 900;
}

#notif_close{
  border:0;
  background:transparent;
  cursor:pointer;
  font-size: 16px;
  font-weight: 900;
  padding: 6px 8px;
  border-radius: 10px;
}

#notif_close:hover{
  background: rgba(15,23,42,.08);
}

/* Lista */
#notif_list{
  max-height: 320px;
  overflow-y: auto;
}

.notif-item{
  padding: 10px 12px;
  border-bottom:1px solid rgba(0,0,0,.06);
  cursor:pointer;
}

.notif-item:hover{
  background: rgba(37,99,235,.06);
}

.notif-title{
  font-size: 13px;
  font-weight: 900;
}

.notif-sub{
  margin-top: 2px;
  font-size: 13px;
  color: rgba(15,23,42,.85);
}

.notif-meta{
  margin-top: 4px;
  font-size: 12px;
  color: rgba(15,23,42,.55);
}

.notif-empty{
  padding: 12px;
  font-size: 13px;
  color: rgba(15,23,42,.65);
}

/* Acciones del panel */
.notif-actions{
  display:flex;
  gap: 8px;
  padding: 10px 12px;
  background:#f8fafc;
  border-top:1px solid rgba(0,0,0,.06);
}

.notif-actions button{
  flex:1;
  padding: 9px 10px;
  border-radius: 12px;
  font-weight: 900;
  font-size: 13px;
  cursor:pointer;
}

/* Botón limpiar */
#notif_clear_all{
  background:#ffffff;
  border:1px solid rgba(0,0,0,.14);
  color:#0f172a;
}

#notif_clear_all:hover{
  background: rgba(15,23,42,.05);
}

/* Botón abrir tickets */
#notif_open_tickets{
  background:#2563eb;
  border:0;
  color:#ffffff;
}

#notif_open_tickets:hover{
  background:#1d4ed8;
}

/* ===================== USUARIO / LOGOUT ===================== */
.usuario-info{
  font-size: 13px;
  font-weight: 800;
  color: rgba(233,242,255,.90);
  white-space: nowrap;
}

.logout-btn{
  color:#ffffff;
  text-decoration:none;
  font-weight: 900;
  font-size: 13px;

  padding: 8px 10px;
  border-radius: 12px;

  background: rgba(239,68,68,.18);
  border: 1px solid rgba(239,68,68,.35);

  transition: background .15s ease;
}

.logout-btn:hover{
  background: rgba(239,68,68,.30);
}

/* ===================== RESPONSIVE ===================== */
@media (max-width: 720px){
  .topbar{
    min-height: 68px;
    padding: 10px 14px;
  }

  .logo{
    font-size: 22px;
  }

  .main-nav{
    gap: 10px;
  }

  .main-nav a{
    padding: 8px 10px;
    font-size: 13px;
  }

  .usuario-info{
    display:none;
  }

  .notif-panel{
    width: 92vw;
    right: -6px;
  }
}
/* ===== PATCH: header debajo de ventanas del Window Manager ===== */
.topbar{
  position: sticky;
  top: 0;
  z-index: 500; /* más bajo que WM */
}

/* Asegurar WM por encima */
#wm_taskbar{ z-index: 9998 !important; }
#wm_desktop{ z-index: 9997 !important; }
.wm-window{ z-index: 9999 !important; }
.modal{ z-index: 20000 !important; }
