/*
 * Tablet y móvil: la barra superior se iba con el scroll porque #header
 * estaba en el flujo normal (position: relative). Al bajar para trabajar
 * desaparecía y, al jalar hacia abajo, solo se veía un momento.
 * En estas medidas queda fija y el menú lateral se desplaza dentro de sí.
 */
@media (max-width: 1366px) {
  #header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1030;
  }

  #wrapper {
    padding-top: 57px;
  }

  #menu.sidebar {
    position: fixed;
    z-index: 1020;
  }

  #menu.sidebar #side-menu {
    max-height: calc(100vh - 150px);
    max-height: calc(100dvh - 150px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  #setup-menu-wrapper.sidebar {
    position: fixed;
    z-index: 1025;
  }
}

/* En vertical el buscador de 350px empuja Ajustes y los iconos fuera de la barra. */
@media (min-width: 769px) and (max-width: 1100px) {
  #search_input {
    width: 180px;
    max-width: 180px;
  }

  .navbar-nav.navbar-right {
    margin-right: 10px;
  }
}

.tooltip-inner:has(.staff-tip-cargo) {
  max-width: 240px;
  white-space: normal;
}

.staff-tip-cargo,
.staff-tip-name,
.staff-tip-extra {
  display: block;
  line-height: 1.3;
}

.staff-tip-cargo {
  font-size: 1em;
  font-weight: 600;
}

.staff-tip-name,
.staff-tip-extra {
  font-size: 0.85em;
  font-weight: 400;
  opacity: 0.9;
}

.staff-tip-extra {
  margin-top: 2px;
}

.staff-impersonation-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #92400e;
  color: #fff;
  padding: 8px 16px;
  font-size: 13px;
  position: relative;
  z-index: 98;
}

.staff-impersonation-bar a {
  color: #fff;
  font-weight: 600;
  text-decoration: underline;
  white-space: nowrap;
}

@media (max-width: 1366px) {
  .staff-impersonation-bar {
    position: fixed;
    top: 57px;
    left: 0;
    right: 0;
    z-index: 1028;
  }

  body.staff-impersonating #wrapper {
    padding-top: 97px;
  }
}
