/* ===================================================================
   HUB DO DONO (/hub) — atalhos + bio (configuração e métricas) + FF Análises
   Padrão Infinity: tokens.css e style.css carregam antes; aqui só se USA var(--...).
   Usa as classes do app (.page-head.rain-hero, .section-head, .stat, .card, .segmented, .badge,
   .rank, .progress, .callout, .empty); o que é só do HUB tem prefixo hb-.
   Padrão de tela documentado em design-system/README.md §11 ("HUB do dono").
   =================================================================== */

.hb-body [hidden] { display: none !important; }
.hb-body.auth-mode #view-hub { display: none; }

/* barra do topo: mesmo vidro do editor da bio (.la-top) */
.hb-top {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: calc(12px + var(--safe-t)) 40px 12px;
    border-bottom: 1px solid var(--line);
    background: rgba(6, 6, 7, 0.94);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}
.hb-brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.hb-brand .brand-mark { width: 44px; }
.hb-actions { display: flex; gap: 4px; flex-wrap: nowrap; justify-content: flex-end; flex-shrink: 0; }

.hb-main { max-width: 1320px; margin: 0 auto; padding: 36px 40px calc(64px + var(--safe-b)); }
.hb-main .page-head { margin-bottom: 18px; }

/* ---------- atalhos: blocos clicáveis com hover de card ---------- */
.hb-launch { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.hb-tile {
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 76px;
    padding: 14px 16px;
    border-radius: var(--r-lg);
    border: 1px solid var(--line-2);
    background: var(--surface);
    box-shadow: var(--shadow-1);
    color: var(--text);
    text-align: left;
    text-decoration: none;
    font: inherit;
    cursor: pointer;
    transition: transform 0.2s var(--ease), border-color 0.2s, box-shadow 0.2s;
}
.hb-tile:hover { transform: translateY(-3px); border-color: var(--accent-line); box-shadow: var(--shadow-1), 0 14px 34px -18px var(--accent-glow); color: var(--text); }
.hb-tile:active { transform: translateY(-1px); }
.hb-tile:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.hb-tile-icon { width: 42px; height: 42px; border-radius: var(--r-md); display: grid; place-items: center; flex-shrink: 0; background: var(--surface-3); color: var(--accent); }
.hb-tile-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.hb-tile-text b { font-size: 0.95rem; font-weight: 600; }
.hb-tile-text small { font-size: 0.76rem; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hb-tile-go { color: var(--text-3); flex-shrink: 0; }
.hb-tile:hover .hb-tile-go { color: var(--accent); }
/* o único destaque da área (= .btn-primary): editar a bio */
.hb-tile.is-hot { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); box-shadow: 0 10px 30px -10px var(--accent-glow); }
.hb-tile.is-hot:hover { background: var(--accent-hover); color: var(--accent-ink); }
.hb-tile.is-hot .hb-tile-icon { background: rgba(26, 0, 26, 0.14); color: var(--accent-ink); }
.hb-tile.is-hot .hb-tile-text small, .hb-tile.is-hot .hb-tile-go { color: var(--accent-ink); opacity: 0.75; }

/* ---------- stats (4 em linha) ---------- */
.hb-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.hb-stats .stat { min-height: 124px; }
.hb-stats .stat.skeleton { min-height: 124px; border: 0; }
.hb-stats .stat-value { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.hb-stats .stat-label .status-dot { margin: 0 2px; }
.delta.hb-down { color: var(--danger); }

/* ---------- gráfico de barras por dia ---------- */
.hb-chart-card { margin-top: 12px; }
.hb-legend { display: flex; gap: 14px; font-size: 0.76rem; color: var(--text-2); flex-wrap: wrap; }
.hb-legend span { display: inline-flex; align-items: center; gap: 6px; }
.hb-key { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.hb-key.is-views { background: var(--c-violet); }
.hb-key.is-clicks { background: var(--accent); box-shadow: 0 0 8px var(--accent-glow); }
.hb-chart { position: relative; }
.hb-chart-skel { height: 200px; }
.hb-chart-note { margin-bottom: 14px; }
.hb-svg { display: block; width: 100%; height: 200px; overflow: visible; }
.hb-grid-line { stroke: rgba(255, 255, 255, 0.07); stroke-width: 1; vector-effect: non-scaling-stroke; }
.hb-bar.is-views { fill: var(--c-violet); }
.hb-bar.is-clicks { fill: var(--accent); }
.hb-hit { fill: transparent; }
.hb-svg g:hover .hb-hit { fill: rgba(255, 255, 255, 0.035); }
.hb-axis { display: flex; justify-content: space-between; margin-top: 8px; font-size: 0.7rem; color: var(--text-3); }
.hb-axis-max { position: absolute; top: 0; right: 0; font-size: 0.66rem; color: var(--text-3); font-family: var(--font-mono); }
.hb-chart-note + .hb-svg + .hb-axis + .hb-axis-max { display: none; }

/* ---------- duas colunas: ranking + configuração ---------- */
.hb-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 12px; margin-top: 12px; align-items: start; }
.hb-empty { padding: 32px 16px; }

.hb-rank { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.hb-rank li { display: flex; align-items: center; gap: 12px; }
.hb-rank-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 7px; }
.hb-rank-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.hb-rank-row b { font-size: 0.88rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.hb-rank-num { margin-left: auto; font-family: var(--font-display); font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.hb-rank-num small { color: var(--text-3); font-weight: 500; margin-left: 4px; }

.hb-profile { display: flex; gap: 14px; align-items: center; padding-bottom: 16px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
.hb-logo { object-fit: contain; padding: 10px 7px; background: var(--surface); border-color: var(--accent-line); filter: drop-shadow(0 0 10px var(--accent-glow)); flex-shrink: 0; }
.hb-profile-name { font-family: var(--font-display); font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; }
.hb-profile-bio { margin: 4px 0 0; font-size: 0.84rem; color: var(--text-2); }

/* lista chave → valor (configuração da bio e sistema) */
.hb-kv { margin: 0; display: flex; flex-direction: column; }
.hb-kv > div { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.hb-kv > div:last-child { border-bottom: 0; }
.hb-kv dt { font-size: 0.8rem; color: var(--text-2); }
.hb-kv dd { margin: 0; font-size: 0.86rem; text-align: right; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.hb-redes { gap: 4px; }
.hb-rede { width: 30px; height: 30px; display: grid; place-items: center; border-radius: var(--r-sm); background: var(--surface-3); color: var(--text); }
.hb-muted { color: var(--text-3); }
.hb-mono { font-family: var(--font-mono); font-size: 0.76rem; }

.hb-system { margin-top: 12px; }
.hb-system .hb-kv { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 28px; }
.hb-system .hb-kv > div:nth-last-child(-n+3) { border-bottom: 0; }

/* ---------- responsivo ---------- */
@media (max-width: 1100px) {
    .hb-launch { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .hb-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .hb-system .hb-kv { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .hb-system .hb-kv > div:nth-last-child(-n+3) { border-bottom: 1px solid var(--line); }
    .hb-system .hb-kv > div:nth-last-child(-n+2) { border-bottom: 0; }
}
@media (max-width: 860px) {
    .hb-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
    .hb-top { padding: calc(10px + var(--safe-t)) 16px 10px; }
    .hb-main { padding: 18px 16px calc(48px + var(--safe-b)); }
    .hb-launch { grid-template-columns: 1fr; gap: 8px; }
    .hb-tile { min-height: 64px; }
    .hb-stats { gap: 8px; }
    .hb-stats .stat { padding: 14px; min-height: 112px; }
    .hb-stats .stat-value { font-size: 1.4rem; }
    .hb-svg { height: 160px; }
    .hb-system .hb-kv { grid-template-columns: 1fr; }
    .hb-system .hb-kv > div:nth-last-child(-n+2) { border-bottom: 1px solid var(--line); }
    .hb-system .hb-kv > div:last-child { border-bottom: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .hb-tile, .hb-tile:hover, .hb-tile:active { transition: none; transform: none; }
}
