/* ============================================================================
 * topbar-rediseno.css — Refinamiento de la barra superior (Señal).
 *
 * Se carga DESPUÉS de tema-senal.css. Capa aditiva y reversible (quitar el
 * <link>). No toca lógica/JS. Cubre:
 *  1) Navegación "Opción 2": fuera la pastilla redonda; pestaña activa con
 *     tinte índigo sutil, barra inferior índigo e ícono índigo.
 *  2) Oculta la pestaña "Catálogo".
 *  3) Menú de perfil (avatar + desplegable) que arma js/perfil-menu.js: deja
 *     "Panel" como pastilla y mete Mi perfil / Ayuda / Salir en el menú.
 * Los colores Señal: índigo #4F46E5 / #6366F1 / claro #A5A1F7.
 * ==========================================================================*/

/* ---------- 1) Navegación (barra superior de escritorio, .rd-on) ---------- */
.rd-on .rd-left .tabs { gap: 2px !important; }
.rd-on .rd-left .tab {
  border-radius: 6px 6px 0 0 !important;
  padding-top: 9px !important; padding-bottom: 9px !important;
}
.rd-on .rd-left .tab:hover {
  background: rgba(99, 102, 241, .10) !important;
  color: #fff !important;
  box-shadow: inset 0 -2.5px 0 rgba(99, 102, 241, .45) !important;
}
.rd-on .rd-left .tab[aria-selected="true"] {
  background: rgba(99, 102, 241, .16) !important;
  color: #fff !important;
  box-shadow: inset 0 -2.5px 0 #6366F1 !important;
}
.rd-on .rd-left .tab[aria-selected="true"]::before {
  background-color: #A5A1F7 !important;   /* ícono índigo en la activa */
}

/* ---------- 2) Ocultar "Catálogo" (barra superior + lateral/móvil) -------- */
.rd-on .rd-left .tab[data-vista="catalogo"],
.side-nav .tab[data-vista="catalogo"] { display: none !important; }

/* ---------- 3) Menú de perfil (avatar + desplegable) --------------------- */
/* El desplegable debe poder sobresalir del encabezado (que recorta por el glow). */
.rd-on .top, .rd-on .top__bar, .rd-on .rd-right,
.auth-chip.pm-on, .auth-chip.pm-on .pm-wrap { overflow: visible !important; }

/* Centra verticalmente el cluster de la derecha (antes quedaba pegado arriba). */
.rd-on .rd-right { justify-content: center !important; }

.auth-chip .pm-wrap { display: none; }
/* Sin "pastilla exterior": el chip es solo una fila (Panel + avatar), no un pill. */
.auth-chip.pm-on {
  display: inline-flex !important; align-items: center !important; gap: 8px !important;
  background: transparent !important; border: 0 !important; padding: 0 !important; border-radius: 0 !important;
}
.auth-chip.pm-on .pm-wrap { display: inline-flex; position: relative; }
.auth-chip.pm-on #auth-perfil-btn,
.auth-chip.pm-on #auth-ayuda-btn,
.auth-chip.pm-on #auth-logout { display: none !important; }

.pm-trigger {
  display: inline-flex; align-items: center; gap: 7px; min-height: 0;
  background: rgba(255, 255, 255, .08); border: 0; cursor: pointer;
  border-radius: 999px; padding: 3px 8px 3px 11px; color: #fff;
}
.pm-trigger:hover { background: rgba(255, 255, 255, .15); }
.pm-role { font-size: 12.5px; color: rgba(255, 255, 255, .75); }
.pm-avatar {
  width: 28px; height: 28px; border-radius: 50%; background: #4F46E5;
  display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 12.5px;
}
.pm-chev { display: grid; place-items: center; color: rgba(255, 255, 255, .6); }
.pm-chev svg { width: 15px; height: 15px; }

.pm-menu {
  position: absolute; top: calc(100% + 7px); right: 0; z-index: 70;
  width: 224px; background: #fff; border: 1px solid var(--line, #E7E7E2); border-radius: 12px;
  box-shadow: 0 16px 36px -14px rgba(21, 23, 28, .5); padding: 6px;
}
.pm-head { display: flex; align-items: center; gap: 10px; padding: 8px 9px 11px; border-bottom: 1px solid #F0F0EC; margin-bottom: 5px; }
.pm-head__av { width: 34px; height: 34px; border-radius: 50%; background: #4F46E5; color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: 0 0 auto; }
.pm-head__txt { display: flex; flex-direction: column; min-width: 0; }
.pm-head__name { font-size: 13px; font-weight: 700; color: #15171C; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pm-head__role { font-size: 11.5px; color: #5F6673; margin-top: 1px; }
.pm-item {
  display: flex !important; align-items: center; gap: 10px; width: 100%;
  background: transparent !important; border: 0 !important; cursor: pointer;
  padding: 9px 10px !important; border-radius: 8px !important; text-align: left;
  font-size: 13px !important; color: #15171C !important; font-weight: 500 !important;
  min-height: 0 !important; font-family: inherit !important;
}
.pm-item:hover { background: #EEEDFB !important; }
.pm-item svg { width: 17px; height: 17px; color: #4F46E5; flex: 0 0 auto; }
.pm-item--danger { color: #A32D2D !important; }
.pm-item--danger svg { color: #A32D2D; }
.pm-sep { height: 1px; background: #F0F0EC; margin: 4px 6px; }

/* "Panel" como pastilla índigo-outline (en el chip, fuera del menú) */
.auth-chip.pm-on #auth-panel-btn.pm-panel {
  background: transparent !important; color: #C7C5F5 !important;
  border: 1px solid rgba(124, 120, 240, .5) !important; border-radius: 9px !important;
  padding: 6px 12px !important; font-weight: 600 !important; min-height: 0 !important;
  box-shadow: none !important;
}
.auth-chip.pm-on #auth-panel-btn.pm-panel:hover { background: rgba(79, 70, 229, .18) !important; }

/* ---------- 4) Banner MÓVIL: logo + autor a la izquierda, perfil a la derecha ---------- */
@media (max-width: 900px) {
  .top, .top__bar { overflow: visible !important; }
  .top .top__bar {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 8px 10px !important;
  }
  /* Mostrar el logo + título + "© Iván Gómez · v5.4.0" a la izquierda en móvil */
  .top .brand-lockup {
    display: inline-flex !important;
    align-items: center !important;
    flex: 0 1 auto !important;
    min-width: 0 !important;
    max-width: none !important;
    width: auto !important;
    padding: 0 !important;
    margin: 0 !important;
    order: 1 !important;
  }
  .top .brand-lockup__mark {
    width: 34px !important;
    height: 34px !important;
    max-width: 34px !important;
    max-height: 34px !important;
    margin-right: 9px !important;
    flex: 0 0 34px !important;
  }
  .top .brand-lockup__txt {
    display: flex !important;
    flex-direction: column !important;
    line-height: 1.1 !important;
    min-width: 0 !important;
  }
  .top .brand-lockup__txt strong {
    font-size: 16.5px !important;
    color: #fff !important;
  }
  .top .brand-lockup__txt small {
    display: inline-flex !important;
    align-items: center !important;
    gap: 3px !important;
    font-size: 10px !important;
    color: rgba(255, 255, 255, .56) !important;
    margin-top: 1px !important;
    white-space: nowrap !important;
  }
  .top .brand-lockup__txt small b {
    color: #A5B4FC !important;
    font-weight: 600 !important;
  }

  /* El chip (Panel + avatar) se acomoda a la derecha en la MISMA fila que el logo */
  .top .top__bar > #auth-chip.pm-on,
  .auth-chip.pm-on {
    order: 2 !important;
    flex: 0 0 auto !important;
    width: auto !important;
    max-width: none !important;
    margin-left: auto !important;
    margin-top: 0 !important;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    flex-wrap: nowrap !important;
    gap: 8px !important;
  }
  .auth-chip.pm-on #auth-panel-btn.pm-panel {
    flex: 0 0 auto !important;
    height: 34px !important;
    min-height: 34px !important;
    padding: 0 12px !important;
    font-size: 12.5px !important;
    border-radius: 999px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
  }
  .auth-chip.pm-on .pm-trigger {
    height: 34px !important;
    min-height: 34px !important;
    padding: 3px 8px 3px 4px !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 5px !important;
  }
  .auth-chip.pm-on .pm-role {
    font-size: 11.5px !important;
    max-width: 110px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  /* En celulares (<=640px) ocultamos el texto largo "Administrador ·..." dentro del botón
     para que [Panel] + [IG ▾] queden SIEMPRE en la misma línea superior a la derecha del logo */
  @media (max-width: 640px) {
    .auth-chip.pm-on .pm-role { display: none !important; }
    .auth-chip.pm-on .pm-trigger { padding: 3px 7px 3px 3px !important; }
  }
  @media (max-width: 380px) {
    .top .brand-lockup__mark { width: 30px !important; height: 30px !important; max-width: 30px !important; max-height: 30px !important; margin-right: 7px !important; flex: 0 0 30px !important; }
    .top .brand-lockup__txt strong { font-size: 15px !important; }
    .top .brand-lockup__txt small { font-size: 9.5px !important; }
  }
  /* El desplegable se ancla a la derecha y no debe salirse de la pantalla. */
  .auth-chip.pm-on .pm-menu { right: 0; max-width: calc(100vw - 24px); }
}

/* ---------- 5) Nota sutil: Última actualización de la lista --------------- */
.rd-on .rd-right {
  justify-content: space-between !important;
  gap: 8px !important;
}
.rd-on .rd-right > #auth-chip {
  order: 1 !important;
}
.rd-on .rd-right > .top-lista-actualizada {
  order: 2 !important;
}
.top-lista-actualizada {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  line-height: 1.25;
  color: rgba(255, 255, 255, .56);
  letter-spacing: .01em;
  text-align: right;
  white-space: nowrap;
  padding: 2px 2px 1px;
  user-select: none;
}
.top-lista-actualizada[hidden] {
  display: none !important;
}
.top-lista-actualizada__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #818CF8;
  box-shadow: 0 0 0 2px rgba(129, 140, 248, .22);
  flex: 0 0 auto;
}
.top-lista-actualizada__lbl {
  color: rgba(255, 255, 255, .52);
  font-weight: 400;
}
.top-lista-actualizada__val {
  color: rgba(255, 255, 255, .82);
  font-weight: 600;
}

@media (max-width: 900px) {
  .top .top__bar > .top-lista-actualizada {
    order: 4;
    width: 100%;
    justify-content: flex-end;
    font-size: 10.5px;
    margin-top: 2px;
    white-space: normal;
  }
}

/* ---------- 6) Insignias de notificación en "Lista de precios" y "Panel" -- */
.nav-notif-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5.5px;
  margin-left: 6px;
  border-radius: 999px;
  background: #EF4444;
  color: #FFFFFF !important;
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0;
  box-shadow: 0 0 0 2px rgba(23, 24, 29, 0.85);
  vertical-align: middle;
  flex: 0 0 auto;
}
#editar-fotos .nav-notif-badge {
  box-shadow: none;
}
/* En barra móvil inferior, colocar la burbuja como globo sobre el ícono de Lista de precios */
@media (max-width: 900px) {
  .side-nav .tab[data-vista="lista"] {
    position: relative !important;
  }
  .side-nav .tab[data-vista="lista"] .nav-notif-badge {
    position: absolute;
    top: 4px;
    right: calc(50% - 24px);
    margin-left: 0;
    min-width: 16px;
    height: 16px;
    padding: 0 4.5px;
    font-size: 9.5px;
  }
}

