.nav{
  position: sticky;
  top:0;
  z-index: 10;
  backdrop-filter: blur(12px);
  background: rgba(9,9,13,.70);
  border-bottom: 1px solid var(--border);
}

.nav__inner{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: var(--s-4);
  padding: var(--s-3) var(--s-4);
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.brand{
  display:flex;
  align-items:center;
  gap: var(--s-3);
  font-weight: 800;
  letter-spacing:-0.02em;
  white-space: nowrap;
}

.brand__dot{
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  box-shadow: 0 0 20px rgba(0,255,135,.35);
}

.nav__left{
  display:flex;
  align-items:center;
  gap: var(--s-4);
}

.nav__links{
  display:flex;
  align-items:center;
  gap: var(--s-2);
}

.nav__links a{
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid transparent;
  color: var(--primary);
  font-weight: 200;
  transition: background .15s, border-color .15s;
}

.nav__links a:hover{
  background: rgba(0,255,135,.08);
  border-color: rgba(0,255,135,.20);
  text-decoration: none;
}

.nav__links a.active{
  background: rgba(0,255,135,.12);
  border-color: rgba(0,255,135,.30);
  color: var(--primary);
}

.nav__right{
  display:flex;
  align-items:center;
  gap: var(--s-2);
}

.nav__meta{
  display:flex;
  align-items:center;
  gap: 7px;
}

.nav__meta .sub{
  font-size: 0.82rem;
  color: var(--muted);
  white-space: nowrap;
}

.nav__avatar-link{
  display:flex;
  align-items:center;
  justify-content:center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(0,255,135,.15);
  color: var(--primary);
  font-weight: 900;
  font-size: .85rem;
  text-decoration: none;
  overflow: hidden;
  box-shadow: 0 0 0 2px rgba(0,255,135,.35);
  transition: box-shadow .2s;
  flex-shrink: 0;
}
.nav__avatar-link:hover{
  box-shadow: 0 0 0 2px #00FF87;
}
.nav__avatar-link img{
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.nav__divider{
  width: 1px;
  height: 22px;
  background: rgba(255,255,255,.12);
  flex-shrink: 0;
}

.nav__actions{
  display:flex;
  align-items:center;
}

.nav__logout-btn{
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  color: rgba(255,255,255,.35);
  display: flex;
  align-items: center;
  border-radius: 6px;
  transition: color .2s;
}
.nav__logout-btn:hover{
  color: rgba(255,255,255,.8);
}

/* ===== Hamburger button (solo mobile) ===== */
.nav__hamburger{
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.nav__hamburger span{
  display: block;
  width: 100%;
  height: 2px;
  border-radius: 2px;
  background: var(--primary);
  transition: transform .2s, opacity .2s;
}

/* Logout link dentro del menu mobile (oculto en desktop) */
.nav__mobile-logout{ display: none; }

/* ===== Responsive ===== */
@media (max-width: 768px){
  .nav{ position: relative; }

  /* El dropdown escapa del u-container y cubre todo el ancho */
  .nav__links{
    display: none;
    position: fixed;
    top: 57px; /* altura del nav aprox */
    left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    background: rgba(9,9,13,.98);
    border-bottom: 1px solid var(--border);
    padding: var(--s-3) var(--s-4) var(--s-4);
    gap: var(--s-1);
    z-index: 100;
    max-height: calc(100vh - 57px);
    overflow-y: auto;
  }
  .nav__links a{
    border-radius: 8px;
    padding: 14px 16px;
    font-size: 1rem;
  }
  .nav__mobile-logout{
    display: block;
    margin-top: var(--s-3);
    padding-top: var(--s-3);
    border-top: 1px solid var(--border);
  }
  .nav__mobile-logout button{
    width: 100%;
    padding: 12px;
  }

  .nav--open .nav__links{ display: flex; }

  .nav__meta{ display: none; }
  .nav__actions{ display: none; }
  .nav__hamburger{ display: flex; width: 44px; height: 44px; }
}
/* ── Mis equipos, en la ficha (spec 0026) ────────────────────────────────────
   Vive en el perfil y no en el nav: cambiar de equipo se hace de vez en cuando
   y la barra ya está llena. Solo se dibuja con 2 o más membresías. */
.team-switch__list { display: grid; gap: 6px; }

.team-switch__row {
  display: flex; align-items: center; gap: 10px; margin: 0;
  padding: 10px 12px; border-radius: 10px;
  background: rgba(255, 255, 255, .03);
  border: 1px solid rgba(255, 255, 255, .08);
}
.team-switch__row--current {
  background: rgba(0, 255, 135, .07);
  border-color: rgba(0, 255, 135, .28);
}
.team-switch__check { width: 12px; color: var(--accent); font-weight: 800; }
.team-switch__name { font-weight: 700; font-size: .92rem; }
.team-switch__role {
  font-size: .74rem; text-transform: uppercase; letter-spacing: .04em;
  color: var(--muted); padding: 2px 8px; border-radius: 999px;
  background: rgba(255, 255, 255, .06);
}
.team-switch__row .btn { margin-left: auto; font-size: .78rem; padding: 5px 12px; }

@media (max-width: 560px) {
  .team-switch__row { flex-wrap: wrap; }
  .team-switch__row .btn { margin-left: 0; width: 100%; }
}

/* ── Mis equipos, en la ficha (spec 0026) ────────────────────────────────────
   Vive en el perfil y no en el nav: cambiar de equipo se hace de vez en cuando
   y la barra ya está llena. Solo se dibuja con 2 o más membresías. */
.team-switch__list { display: grid; gap: 6px; }

.team-switch__row {
  display: flex; align-items: center; gap: 10px; margin: 0;
  padding: 10px 12px; border-radius: 10px;
  background: rgba(255, 255, 255, .03);
  border: 1px solid rgba(255, 255, 255, .08);
}
.team-switch__row--current {
  background: rgba(0, 255, 135, .07);
  border-color: rgba(0, 255, 135, .28);
}
.team-switch__check { width: 12px; color: var(--accent); font-weight: 800; }
.team-switch__name { font-weight: 700; font-size: .92rem; }
.team-switch__role {
  font-size: .74rem; text-transform: uppercase; letter-spacing: .04em;
  color: var(--muted); padding: 2px 8px; border-radius: 999px;
  background: rgba(255, 255, 255, .06);
}
.team-switch__row .btn { margin-left: auto; font-size: .78rem; padding: 5px 12px; }

@media (max-width: 560px) {
  .team-switch__row { flex-wrap: wrap; }
  .team-switch__row .btn { margin-left: 0; width: 100%; }
}

/* ── El equipo, pegado a la marca (spec 0026) ────────────────────────────────
   Se lee "EasyRUN, de Pulso": identidad, no navegación, y por eso vive con la
   marca y no en el menú. En mobile es donde tiene que estar — los links se van
   al hamburguesa y la marca queda—, que es justo cuando más falta hace saber
   en qué equipo estás. Solo se dibuja con 2 o más equipos. */
.nav__team {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding-left: 11px;
  margin-left: 2px;
  border-left: 1px solid var(--border, rgba(255, 255, 255, .12));
  color: var(--muted, rgba(255, 255, 255, .55));
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .01em;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}
.nav__team:hover, .nav__team:focus-visible { color: var(--text); }

.nav__team-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

@media (max-width: 900px) {
  /* La marca ya compite con la campana, el avatar y el hamburguesa: se recorta
     el nombre pero el punto no, que es el que se reconoce de un vistazo. */
  .nav__team { padding-left: 8px; font-size: .72rem; }
  .nav__team-name { max-width: 6.5em; overflow: hidden; text-overflow: ellipsis; }
}

@media (max-width: 380px) {
  .nav__team-name { display: none; }
}
