/* ============================================================
   HUF — Componente: Topbar (.hd-topbar) — HVL §6.4
   ------------------------------------------------------------
   No es un "navbar": es la línea de estado del sistema. Altura exacta
   de 48px a sangre. La navegación primaria vive en el sidebar, nunca
   aquí. Orden de contenido: marca compacta · buscador · indicadores en
   vivo · usuario.
   Ejemplos de uso → docs/hednora-ui-framework-guide.md §Topbar.
   ============================================================ */

.hd-topbar {
    display: flex;
    align-items: center;
    gap: var(--hd-space-4);
    height: var(--hd-size-topbar);
    padding: 0 var(--hd-space-4);
    background: var(--hd-color-bg-secondary);
    border-bottom: 1px solid var(--hd-color-border);
}

.hd-topbar__brand {
    display: inline-flex;
    align-items: center;
    gap: var(--hd-space-2);
    font-size: var(--hd-text-base);
    font-weight: 600;
    color: var(--hd-theme-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 0;
}

/* Buscador: input de 36px, ancho máximo 360px, ícono a la izquierda. */
.hd-topbar__search {
    position: relative;
    flex: 1 1 auto;
    max-width: 360px;
}

.hd-topbar__search .hd-input {
    height: var(--hd-size-control-sm);
    padding-left: calc(var(--hd-space-3) + 20px);
}

.hd-topbar__search-icon {
    position: absolute;
    left: var(--hd-space-3);
    top: 50%;
    transform: translateY(-50%);
    color: var(--hd-theme-text-muted);
    font-size: var(--hd-text-base);
    pointer-events: none;
}

/* Indicadores en vivo: micro-etiqueta + valor tabular + punto de
   estado de 6px. */
.hd-topbar__indicators {
    display: inline-flex;
    align-items: center;
    gap: var(--hd-space-5);
    margin-left: auto;
}

.hd-topbar__indicator {
    display: inline-flex;
    align-items: center;
    gap: var(--hd-space-2);
    white-space: nowrap;
}

.hd-topbar__indicator-label {
    font-size: var(--hd-text-micro);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--hd-theme-text-muted);
}

.hd-topbar__indicator-value {
    font-size: var(--hd-text-base);
    font-weight: 600;
    color: var(--hd-theme-text);
    font-variant-numeric: tabular-nums;
}

.hd-topbar__indicator-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--hd-theme-text-muted);
    flex-shrink: 0;
}

.hd-topbar__indicator-dot--success { background: var(--hd-color-success); }
.hd-topbar__indicator-dot--warning { background: var(--hd-color-warning); }
.hd-topbar__indicator-dot--error   { background: var(--hd-color-error); }

/* Usuario — avatar nunca mayor a 32px (HVL §6.4). */
.hd-topbar__user {
    display: inline-flex;
    align-items: center;
    gap: var(--hd-space-2);
    flex-shrink: 0;
}

.hd-topbar__avatar {
    width: 32px;
    height: 32px;
    max-width: 32px;
    max-height: 32px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--hd-color-inset);
    color: var(--hd-theme-text);
    font-size: var(--hd-text-meta);
    font-weight: 600;
}

/* Altura de control completa (44px), no la reducida de 36: es el único
   acceso a la navegación en móvil y se pulsa con el pulgar. */
.hd-topbar__toggle {
    flex-shrink: 0;
    width: var(--hd-size-control);
    height: var(--hd-size-control);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    border-radius: var(--hd-radius-sm);
    color: var(--hd-theme-text);
    cursor: pointer;
}

.hd-topbar__toggle:hover {
    background: rgba(148, 163, 184, 0.08);
}

.hd-topbar__toggle:focus-visible {
    outline: var(--hd-focus-ring);
    outline-offset: var(--hd-focus-offset);
}
