/* ============================================================
   NAVBAR / TOPBAR — estilos globales (compartidos por todas
   las plantillas que extienden base.html)
   ============================================================ */

.topbar {
  --topbar-ink: #00333D;
  --topbar-accent: #22AAC6;

  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 28px;
  background: var(--topbar-ink);
  color: #FFFFFF;
  position: relative;
  z-index: 10;
  flex-shrink: 0;
  font-family: 'Montserrat', system-ui, sans-serif;
}

.topbar *,
.topbar *::before,
.topbar *::after { box-sizing: border-box; }

.topbar-left {
  display: flex;
  align-items: center;
  gap: 18px;
}

.topbar-divider {
  width: 1px;
  height: 22px;
  background: rgba(255, 255, 255, 0.15);
}

/* ----- Back link ----- */
.topbar .back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px 7px 10px;
  font-size: 12px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.75);
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  transition: all .2s ease;
}

.topbar .back-link:hover {
  color: #FFFFFF;
  border-color: rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.05);
}

.topbar .back-link svg {
  width: 14px;
  height: 14px;
  transition: transform .2s ease;
}

.topbar .back-link:hover svg { transform: translateX(-2px); }

/* ----- Brand ----- */
.topbar .brand {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.topbar .brand-mark {
  font-style: italic;
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.topbar .brand-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--topbar-accent);
  display: inline-block;
  margin-right: 4px;
  transform: translateY(-3px);
}

.topbar .brand-sub {
  font-weight: 500;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.5);
  text-transform: uppercase;
  letter-spacing: 0.15em;
}

/* ----- Selectors (versión oscura para navbar) ----- */
.topbar .selectors {
  display: flex;
  gap: 10px;
  align-items: center;
}

.topbar .selector { position: relative; }

.topbar .selector label {
  display: block;
  font-weight: 500;
  font-size: 9px;
  color: rgba(255, 255, 255, 0.5);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-bottom: 4px;
  padding-left: 14px;
}

.topbar .selector select {
  appearance: none;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 9px 36px 9px 14px;
  font-size: 13px;
  color: #FFFFFF;
  border-radius: 2px;
  cursor: pointer;
  min-width: 180px;
  transition: border-color .2s, background .2s;
  font-family: inherit;
}

.topbar .selector select:hover {
  border-color: rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.05);
}

.topbar .selector select:focus {
  outline: none;
  border-color: var(--topbar-accent);
}

.topbar .selector select option {
  background: var(--topbar-ink);
  color: #FFFFFF;
}

.topbar .selector::after {
  content: '';
  position: absolute;
  right: 14px;
  bottom: 16px;
  width: 6px;
  height: 6px;
  border-right: 1.5px solid rgba(255, 255, 255, 0.6);
  border-bottom: 1.5px solid rgba(255, 255, 255, 0.6);
  transform: rotate(45deg);
  pointer-events: none;
}

/* ----- Top right link ----- */
.topbar-link {
  font-weight: 500;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  padding: 9px 14px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  transition: color .2s, border-color .2s;
}

.topbar-link:hover {
  color: #FFFFFF;
  border-color: rgba(255, 255, 255, 0.5);
}

/* ============ NAVBAR MOBILE ============ */
@media (max-width: 900px) {
  .topbar {
    padding: 10px 14px;
  }

  .topbar-left {
    gap: 10px;
    min-width: 0;  /* permite que los hijos se compriman si hace falta */
  }

  /* Botón Volver: solo icono, sin texto */
  .topbar .back-link {
    padding: 7px 9px;
    gap: 0;
  }

  .topbar .back-link span {
    display: none;
  }

  /* Quitar el divisor vertical */
  .topbar-divider {
    display: none;
  }

  /* Marca más compacta y ocultar el "Panel" redundante */
  .topbar .brand {
    min-width: 0;
  }

  .topbar .brand-mark {
    font-size: 16px;
  }

  .topbar .brand-sub {
    display: none;
  }

  /* Mi perfil: más pequeño, sin uppercase tan agresiva, sin partir en 2 líneas */
  .topbar-link {
    padding: 7px 10px;
    font-size: 10px;
    letter-spacing: 0.08em;
    white-space: nowrap;
  }
}

/* Pantallas muy estrechas: aún más compacto */
@media (max-width: 420px) {
  .topbar {
    padding: 8px 10px;
  }

  .topbar-link {
    padding: 6px 8px;
    font-size: 9px;
  }

  .topbar .brand-mark {
    font-size: 14px;
  }
}