/* ================================================================
   topbar.css
   ================================================================ */

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1.5rem;
  background: var(--green-deep);
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  /* Defensa: que el topbar nunca empuje horizontalmente la página */
  overflow-x: hidden;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-shrink: 0;
  min-width: 0;
}

/* Contenedor blanco — el card. Padding y fondo viven aquí, no en el img. */
.brand-logo-card {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border-radius: 8px;
  padding: 6px 14px;
  flex-shrink: 0;
}

.brand-logo {
  display: block;
  height: 36px;
  width: auto;
  aspect-ratio: 5.35 / 1;
  object-fit: contain;
}

.brand-sub {
  font-family: "Instrument Serif", serif;
  font-size: 22px;
  letter-spacing: 0.005em;
  color: #fff;
  text-transform: none;
  line-height: 1;
  white-space: nowrap;
}

/* ─── Badge "En vivo" ─── */
.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: rgba(34, 197, 94, 0.15);
  border: 1px solid rgba(34, 197, 94, 0.4);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #86efac;
  white-space: nowrap;
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.6);
  animation: live-pulse 1.8s ease-out infinite;
}

@keyframes live-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.6); }
  70%  { box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

/* ─── Lado del usuario ─── */
.topbar-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.12);
  flex-shrink: 0;
}

.user-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  text-align: right;
  min-width: 0;
}

.user-name {
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-email {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.6);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
}

.btn-logout {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: transparent;
  color: #fff;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s ease;
  flex-shrink: 0;
}

.btn-logout:hover {
  background: rgba(255, 255, 255, 0.08);
}

/* ─── Mobile/tablet ─── */
@media (max-width: 900px) {
  .user-email { display: none; }       /* email ocupa demasiado */
  .live-badge .live-text { display: none; }  /* sólo el dot, sin texto */
  .live-badge { padding: 4px 6px; }
}

@media (max-width: 720px) {
  .topbar {
    padding: 0.5rem 0.75rem;
    gap: 0.5rem;
  }
  .brand-logo { height: 30px; }
  .brand-logo-card { padding: 4px 10px; }
  .brand-sub { font-size: 16px; }
  .topbar-brand { gap: 0.5rem; }
  .user-name { font-size: 12px; max-width: 100px; }
}

@media (max-width: 520px) {
  .brand-sub { display: none; }       /* "HUB de Dashboards" se oculta */
  .user-meta { display: none; }       /* nombre y email también */
  /* Quedan: logo + live-dot a la izquierda · avatar + logout a la derecha */
}