/* Reino · aba Métricas (telas/MetricasScreen.jsx) e registro de uso (componentes/ConsentimentoUso.jsx).
   Só tokens do design system (design-system/tokens/*.css): ouro só na métrica-norte, ciano nos números
   vivos, magenta só para queda. Alvos de toque de 44 px; texto com contraste de pelo menos 4,5:1. */

/* ---------- topo: abas e períodos ---------- */
.hg-mt-topo { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem; }
.hg-mt-chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.hg-mt-chips button {
  min-height: 44px; padding: 0 1rem; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface-chip); color: var(--text-2); font: 600 .8rem var(--font-d); cursor: pointer; transition: all .2s;
}
.hg-mt-chips button:hover { color: var(--text); border-color: var(--line-2); }
.hg-mt-chips button[aria-pressed="true"] { color: var(--text-strong); border-color: var(--line-2); background: var(--grad-nav-atual); box-shadow: 0 0 14px color-mix(in srgb, var(--blue) 45%, transparent); }
.hg-mt-chips button:focus-visible, .hg-mt-link:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.hg-mt-legenda { margin: 0; color: var(--text-2); font-size: .8rem; }
.hg-mt-painel { display: flex; flex-direction: column; gap: .8rem; min-width: 0; }
/* botões do cabeçalho do painel ficam à direita do título (o título do design system tem order: 1) */
.hg-mt-painel .hg-head > .hg-mt-acoes, .hg-mt-painel .hg-head > .hg-btn { order: 3; }
.hg-mt-secao { display: block; outline: none; }

/* ---------- faixas ---------- */
.hg-mt-faixa, .hg-mt-priv {
  display: flex; align-items: flex-start; gap: .55rem; margin: 0; padding: .7rem .9rem; border-radius: 12px;
  background: var(--surface-sunken); border: 1px solid var(--line); color: var(--text); font-size: .84rem;
}
.hg-mt-faixa svg, .hg-mt-priv svg { width: 18px; height: 18px; flex: none; color: var(--cyan); margin-top: .1rem; }
.hg-mt-priv { color: var(--text-2); }
.hg-mt-link { min-height: 44px; padding: 0 .2rem; border: 0; background: none; color: var(--link); font: inherit; font-weight: 600; text-decoration: underline; cursor: pointer; }
.hg-mt-link:hover { color: var(--link-hover); }

/* ---------- cartões ---------- */
.hg-mt-cartoes { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.hg-mt-cartoes .hg-kpi { min-height: 0; }
.hg-mt-cartoes .hg-kpi-foot { display: grid; gap: .25rem; }
.hg-mt-cartoes .hg-bolsa-spark { width: 100%; height: 30px; }
.hg-mt-comp { font-weight: 600; }
.hg-mt-comp.is-sobe { color: var(--green); }
.hg-mt-comp.is-desce { color: var(--magenta); }
.hg-mt-comp.is-igual { color: var(--text-2); }
.hg-mt-motivo, .hg-mt-nota { color: var(--text-2); font-size: .74rem; }
.hg-mt-hoje { color: var(--cyan); font-size: .74rem; font-weight: 600; }
.hg-mt-destaque { margin: .2rem 0 .4rem; color: var(--text); font: 600 .95rem var(--font-d); }

/* ---------- métrica-norte (o único ouro da tela) ---------- */
.hg-mt-norte .hg-mt-norte-corpo { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 1rem; align-items: center; margin-bottom: .6rem; }
.hg-mt-norte-num { display: grid; gap: .3rem; align-content: start; }
.hg-mt-norte-num .hg-glow-num { color: var(--gold); }
.hg-mt-norte-graf { min-width: 0; }
.hg-mt-norte-graf .hg-bolsa-spark { width: 100%; height: 64px; }

/* ---------- gráficos, tabelas e listas ---------- */
.hg-mt-graf { margin: .4rem 0 0; min-width: 0; }
.hg-mt-sub { margin-top: 1rem; display: grid; gap: .5rem; }
.hg-mt-sub > .hg-title, .hg-mt-tres .hg-title, .hg-mt-duas .hg-title { font-size: .88rem; margin-bottom: .3rem; }
.hg-mt-tres { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; margin-top: .8rem; }
.hg-mt-duas { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1rem; }
.hg-mt-tres .hg-table, .hg-mt-sub .hg-table { min-width: 0; }
.hg-mt-tres .hg-table th[scope="row"], .hg-mt-sub .hg-table th[scope="row"] { text-align: left; font-weight: 600; color: var(--text); text-transform: none; letter-spacing: 0; }
.hg-mt-resumo { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: .5rem; margin: 0; }
.hg-mt-resumo > div { padding: .55rem .7rem; border-radius: 12px; background: var(--surface-sunken); border: 1px solid var(--border-soft); }
.hg-mt-resumo dt { color: var(--text-2); font-size: .74rem; }
.hg-mt-resumo dd { margin: .15rem 0 0; color: var(--cyan); font: 600 1.15rem var(--font-d); }
.hg-mt-fontes { display: grid; gap: .45rem; padding: 0 .9rem .8rem; color: var(--text-2); font-size: .8rem; }
.hg-mt-fontes p { margin: 0; }
.hg-mt-fontes b { color: var(--text); }
.hg-mt-falha { display: grid; gap: .5rem; justify-items: start; }
.hg-mt-falha .hg-sub { margin: 0; }
.hg-mt-vazio { display: grid; gap: .6rem; justify-items: center; }
.hg-mt-acoes { display: flex; flex-wrap: wrap; gap: .4rem; }
.hg-mt-mais { display: flex; justify-content: center; margin-top: .6rem; }

/* Meus pré-cadastros */
.hg-mt-leads { list-style: none; margin: .4rem 0 0; padding: 0; display: grid; gap: .5rem; }
.hg-mt-leads > li { display: flex; justify-content: space-between; gap: .8rem; padding: .7rem .9rem; border-radius: 12px; background: var(--surface-row); border: 1px solid var(--border-soft); }
.hg-mt-leads > li > div:first-child { display: grid; gap: .1rem; min-width: 0; }
.hg-mt-leads strong { color: var(--text-strong); font-size: .88rem; }
.hg-mt-leads span { color: var(--text-2); font-size: .78rem; overflow-wrap: anywhere; }
.hg-mt-lead-dir { display: grid; gap: .3rem; justify-items: end; align-content: start; flex: none; }
.hg-mt-lead-dir small { color: var(--text-2); font-size: .74rem; }
.hg-pill.hg-mt-pill-sim { color: var(--green); background: color-mix(in srgb, var(--green) 14%, transparent); border-color: color-mix(in srgb, var(--green) 55%, transparent); box-shadow: none; }

/* ---------- registro de uso (ConsentimentoUso.jsx) ---------- */
.hg-uso-texto { display: grid; gap: .45rem; font-size: .84rem; color: var(--text); }
.hg-uso-texto p { margin: 0; color: var(--text-2); }
.hg-uso-texto strong { color: var(--text); }
.hg-uso-botoes { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-top: .7rem; }
.hg-uso-botoes .hg-btn { min-height: 44px; }
.hg-uso-perigo { border-color: color-mix(in srgb, var(--magenta) 60%, transparent) !important; color: var(--text-strong) !important; }
.hg-uso-confirma { margin-top: .7rem; padding: .8rem .9rem; border-radius: 12px; background: color-mix(in srgb, var(--magenta) 10%, transparent); border: 1px solid color-mix(in srgb, var(--magenta) 45%, transparent); }
.hg-uso-confirma p { margin: 0; color: var(--text); font-size: .84rem; }
.hg-uso-convite { margin-top: .8rem; padding: .9rem; border-radius: 12px; background: var(--surface-sunken); border: 1px solid var(--line); }
.hg-uso-estado { margin: 0 0 .3rem; color: var(--text); }
.hg-uso-estado b { color: var(--text-2); }
.hg-uso-estado b.is-ligado { color: var(--green); }
.hg-uso-painel .hg-acc { margin-top: .8rem; }
.hg-uso-rodape .hg-sub { margin: 0; }
.hg-uso-guardado { margin-top: .7rem; display: grid; gap: .5rem; justify-items: start; }
.hg-uso-lista { list-style: none; margin: 0; padding: 0; display: grid; gap: .35rem; width: 100%; }
.hg-uso-lista li { display: flex; justify-content: space-between; gap: .8rem; padding: .45rem .7rem; border-radius: 10px; background: var(--surface-sunken); font-size: .8rem; color: var(--text); }
.hg-uso-lista small { color: var(--text-2); white-space: nowrap; }
.hg-uso-veu { position: fixed; inset: 0; z-index: 400; display: grid; place-items: center; padding: 1rem; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.hg-uso-janela { width: min(560px, 100%); max-height: calc(100dvh - 2rem); overflow: auto; display: grid; gap: .4rem; }
.hg-uso-janela > .hg-sub { margin: .3rem 0 0; }

/* a caixa do cadastro (CompletarCadastro.jsx), só com o aviso aprovado */
.hg-completar-uso { display: grid; gap: .35rem; margin: .2rem 0 .4rem; font-size: .8rem; color: var(--text); }
.hg-completar-uso label { display: flex; align-items: center; gap: .55rem; min-height: 44px; cursor: pointer; }
.hg-completar-uso input { width: 20px; height: 20px; accent-color: var(--cyan); flex: none; }
.hg-completar-uso summary { cursor: pointer; color: var(--link); min-height: 32px; }
.hg-completar-uso details p { margin: .3rem 0 0; color: var(--text-2); }
.hg-completar-uso details strong { color: var(--text); }

/* Contas no banco: dar e tirar o papel de administrador (AdminScreen.jsx) */
.hg-adm-papel { display: grid; gap: .45rem; min-width: 16rem; white-space: normal; }
.hg-adm-papel p { margin: 0; color: var(--text); font-size: .8rem; }
.hg-adm-papel .hg-uso-botoes { margin-top: 0; }

@media (max-width: 720px) {
  .hg-mt-norte .hg-mt-norte-corpo { grid-template-columns: 1fr; }
  .hg-mt-leads > li { flex-direction: column; }
  .hg-mt-lead-dir { justify-items: start; }
  .hg-uso-lista li { flex-direction: column; gap: .15rem; }
}

/* ---------- começo do Reino (25/09): totais, aviso do período vazio e o que vem depois ---------- */
.hg-mt-comeco { border-color: color-mix(in srgb, var(--cyan) 35%, var(--line)); background: color-mix(in srgb, var(--cyan) 7%, var(--surface-sunken)); }
.hg-mt-comeco b, .hg-mt-espera b { color: var(--text-strong); }
.hg-mt-espera { margin-top: .6rem; }
.hg-mt-proximos { margin: 0; padding-left: 1.1rem; display: grid; gap: .45rem; color: var(--text-2); font-size: .86rem; }
.hg-mt-proximos b { color: var(--text); }
/* Redefinir senha (AdminScreen, passo 35): a senha provisória aparece uma vez, grande e fácil de copiar */
.hg-adm-senha { border: 1px solid rgba(52, 230, 166, .45); border-radius: 14px; padding: .7rem .8rem; background: rgba(52, 230, 166, .06); }
.hg-adm-senha-valor { display: flex; align-items: center; gap: .6rem; }
.hg-adm-senha-valor span { min-width: 4.2rem; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; opacity: .7; }
.hg-adm-senha-valor code { font: 600 1.05rem var(--font-mono, ui-monospace, monospace); color: var(--gold, #f5c76a); letter-spacing: .04em; user-select: all; }
