/* ==========================================
   Hub Views — Headers e Layout de Telas
   Tokens: var(--hub-*) como fonte da verdade
   ========================================== */

/* --- .hub-view / .beto-view (Containers de Tela) --- */
.hub-view,
.beto-view {
    display: none;
    min-height: 100%;
    gap: var(--hub-view-section-gap, var(--space-s));
    content-visibility: auto;
    contain-intrinsic-size: 900px;
}
.hub-view.is-active,
.beto-view.is-active {
    display: grid;
}

/* Layout por View (data-view) */
.hub-view[data-view="unidades"],
.hub-view[data-view="reservas"],
.hub-view[data-view="relatorios"],
.beto-view[data-view="unidades"],
.beto-view[data-view="reservas"],
.beto-view[data-view="relatorios"] {
    grid-template-rows: auto minmax(0, 1fr);
}

.hub-view-stack,
.beto-view-stack {
    display: grid;
    gap: var(--hub-view-section-gap, var(--space-s));
}

/* --- Unificação de Headers Operacionais (5 Cabeçalhos Consolidados) --- */
.hub-view-heading,
.beto-view-heading,
.beto-home-hero,
.beto-strategy-library__head,
.beto-analysis-heading {
    min-height: 112px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-s);
    padding: var(--space-s);
    border: 1px solid var(--hub-border);
    border-radius: var(--hub-radius);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.018), transparent 64%),
        var(--hub-surface-raised);
    box-shadow: none;
}

.hub-view-heading h1,
.beto-view-heading h1,
.beto-home-hero h1,
.beto-strategy-library__head h1,
.beto-analysis-heading h1 {
    margin: 0;
    color: var(--hub-text);
    font-size: var(--hub-text-heading);
    line-height: 1.1;
    font-weight: var(--hub-weight-medium);
    letter-spacing: 0;
}

.hub-view-heading p,
.beto-view-heading p,
.beto-home-hero p,
.beto-strategy-library__head p,
.beto-analysis-heading p {
    max-width: 720px;
    margin: 5px 0 0;
    color: var(--hub-text-muted);
    font-size: var(--hub-text-table);
    line-height: 1.35;
}

.beto-view-heading .beto-page-cta {
    flex: 0 0 auto;
    min-width: 156px;
}

.beto-view-heading > div:first-child {
    display: grid;
    align-content: center;
    min-height: 56px;
}

/* Breakpoint Desktop - Adaptação de Altura de Headers */
@media (min-width: 861px) {
    .hub-view-heading,
    .beto-view-heading,
    .beto-home-hero,
    .beto-strategy-library__head,
    .beto-analysis-heading {
        height: var(--hub-shell-header-height);
        min-height: var(--hub-shell-header-height);
        max-height: var(--hub-shell-header-height);
        align-items: center;
        padding-top: var(--space-xs);
        padding-bottom: var(--space-xs);
        border-color: var(--hub-border);
        border-radius: var(--hub-radius);
        background:
            linear-gradient(180deg, rgba(255, 255, 255, 0.012), transparent 68%),
            var(--hub-surface-soft);
        overflow: hidden;
    }
    .hub-view-heading h1,
    .beto-view-heading h1,
    .beto-home-hero h1,
    .beto-strategy-library__head h1,
    .beto-analysis-heading h1 {
        font-size: var(--hub-text-page);
        line-height: 1.08;
        font-weight: var(--hub-weight-semibold);
    }
    .hub-view-heading p,
    .beto-view-heading p,
    .beto-home-hero p,
    .beto-strategy-library__head p,
    .beto-analysis-heading p {
        font-size: var(--hub-text-body);
        line-height: 1.35;
    }
}

@media (max-width: 860px) {
    .hub-view-heading,
    .beto-view-heading,
    .beto-home-hero,
    .beto-strategy-library__head,
    .beto-analysis-heading {
        height: auto;
        min-height: auto;
        max-height: none;
        align-items: stretch;
        overflow: visible;
    }
}

@media (max-width: 760px) {
    .hub-view-heading,
    .beto-view-heading,
    .beto-home-hero,
    .beto-strategy-library__head,
    .beto-analysis-heading {
        min-height: auto;
        display: grid;
        align-items: stretch;
        gap: var(--space-s);
    }
}

/* --- .beto-home-hero específico --- */
.beto-home-hero__eyebrow {
    display: block;
    margin-bottom: 8px;
    color: var(--hub-primary-hover);
    font-size: var(--hub-text-eyebrow);
    font-weight: var(--hub-weight-bold)
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

/* --- .beto-view-heading__actions / .beto-home-hero__actions --- */
.beto-view-heading__actions,
.beto-home-hero__actions,
.beto-home-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
}

.beto-view-heading__actions,
.beto-home-hero__actions {
    justify-content: flex-end;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-s);
}

/* Header filter: min-width em contexto de barra de acoes */
.beto-view-heading__actions .hub-field {
    min-width: 132px;
}
.beto-view-heading__actions .hub-field--search {
    min-width: min(28vw, 280px);
}

.beto-top-view-toggle {
    min-width: 154px;
}

.beto-view-heading__actions [data-audit-count] {
    color: var(--hub-text-muted);
    font-size: var(--hub-text-label);
    font-weight: var(--hub-weight-semibold);
    white-space: nowrap;
}

.beto-home-metrics {
    grid-template-columns: repeat(6, minmax(0, 1fr));
}
