/* Visão geral · telas 1 (capa, GGR e Dinheiro). Carregado depois do v3.css: só sobrescreve e acrescenta, com prefixo vg1-.
   Depois do merge da fundação (vg.css), trocar as cores e raios fixos daqui pelos tokens dela. */

/* ——— peças pequenas, usadas em vários cartões ——— */
.vg1-selo { display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.2rem 0.6rem; border: 1px solid var(--line-strong); border-radius: 999px; color: var(--muted); font-size: 0.75rem; font-weight: 550; white-space: nowrap; }
.vg1-selo.up { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 40%, transparent); }
.vg1-selo.down { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, transparent); }
.vg1-selo[tabindex] { cursor: help; }
.vg1-selo:focus-visible, .vg1-chip:focus-visible { outline: 2px solid var(--g1, var(--accent)); outline-offset: 2px; }
.vg1-ok { display: flex; align-items: center; gap: 0.6rem; margin: 0.25rem 0 0; color: var(--muted); font-size: 0.875rem; }
.vg1-ok i { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); font-style: normal; font-size: 0.75rem; font-weight: 700; flex: none; }
.vg1-total { font-size: 1.25rem; letter-spacing: -0.02em; color: var(--ink); }
.vg-head h2 .v2-tip { margin-left: 0.15rem; }
/* cartão vazio: o estado vazio fica pequeno e centrado, sem tomar a tela */
[data-card] .v2-empty { padding: 1.5rem 1rem; }
[data-card] .v2-empty h3 { font-size: 0.875rem; font-weight: 550; color: var(--muted); }

/* ——— capa: alertas ——— */
.vg1-chips { display: flex; gap: 0.35rem; flex-wrap: wrap; }
.vg1-chip { min-height: 30px; padding: 0.2rem 0.7rem; font-size: 0.75rem; cursor: pointer; font-variant-numeric: tabular-nums; }
.vg1-chip[aria-pressed="true"] { border-color: var(--g1, var(--accent)); color: var(--ink); font-weight: 650; }
.vg1-alertas { gap: 0; margin-bottom: 0.5rem; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.vg1-alertas li, .vg1-alertas li[data-nivel="alto"] { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: none; padding: 0.55rem 0.75rem; min-height: 44px; box-shadow: inset 3px 0 0 var(--warn); transition: background 0.15s; }
.vg1-alertas li[data-nivel="alto"] { box-shadow: inset 3px 0 0 var(--danger); background: color-mix(in srgb, var(--danger) 5%, transparent); }
.vg1-alertas li:last-child { border-bottom: 0; }
.vg1-alertas li:hover { background: var(--hover, rgba(255, 255, 255, 0.04)); }
.vg1-alertas li > b { font-weight: 550; }
.vg1-alerta-casa { margin-right: 0.5rem; color: var(--muted); font-weight: 500; }
.vg1-alertas li.vg1-alerta-vazio { display: block; box-shadow: none; }
.vg1-alertas .btn { white-space: nowrap; }
.vg1-mais { display: block; margin: 0 auto; }

/* ——— capa: áreas ——— */
.vg-pagina { background: rgba(255, 255, 255, 0.015); transition: border-color 0.15s, transform 0.15s, background 0.15s; }
.vg-pagina:hover, .vg-pagina:focus-visible { background: rgba(255, 255, 255, 0.04); }
.vg-pagina-r { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; min-height: 2.7em; }
.vg-pagina-ir { margin-top: auto; font-weight: 550; }

/* ——— GGR ——— */
[data-card="ggr"] .vg-kpi-s { white-space: normal; }
.vg-jogos-t { display: flex; align-items: center; gap: 0.45rem; }
.vg-jogos-t .num { margin-left: auto; font-weight: 500; }
.vg1-ponto { width: 8px; height: 8px; border-radius: 2px; background: var(--ok); flex: none; }
[data-tom="ruim"] .vg1-ponto { background: var(--danger); }
.vg1-jogos td { vertical-align: middle; }
.vg1-jogos td:first-child { position: relative; padding-left: 2rem; }
.vg1-pos { position: absolute; left: 0.5rem; top: 50%; transform: translateY(-50%); color: var(--faint); font-size: 0.75rem; }
.vg1-jogos .vg-jogo-n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 260px; }
.vg1-barra { position: relative; min-width: 120px; }
.vg1-barra::before { content: ""; position: absolute; right: 0.35rem; top: 22%; bottom: 22%; width: var(--w, 0%); max-width: calc(100% - 0.7rem); border-radius: 4px; background: color-mix(in srgb, var(--ok) 16%, transparent); }

[data-tom="ruim"] .vg1-barra::before { background: color-mix(in srgb, var(--danger) 18%, transparent); }
.vg1-barra b { position: relative; font-weight: 600; color: var(--ink); }
[data-tom="ruim"] .vg1-barra b { color: var(--danger); }
.vg1-como summary { cursor: pointer; color: var(--muted); font-size: 0.8125rem; min-height: 28px; }
.vg1-como p { margin: 0.35rem 0 0; }

/* ——— tabelas largas: rolam de lado com a primeira coluna presa ——— */
.vg1-rola { margin: 0 -0.25rem; padding: 0 0.25rem; scrollbar-width: thin; }
.vg1-fixa th, .vg1-fixa td { white-space: nowrap; }
.vg1-fixa tbody th[scope="row"], .vg1-fixa tfoot th[scope="row"] { font-size: 0.8125rem; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--ink); }
.vg1-fixa tfoot th, .vg1-fixa tfoot td { border-top: 1px solid var(--line-strong); border-bottom: 0; }
.vg1-fixa .v2-status { font-variant-numeric: tabular-nums; }

/* ——— Dinheiro ——— */
.vg1-escala { display: inline-flex; align-items: center; gap: 0.4rem; color: var(--faint); font-size: 0.6875rem; }
.vg1-escala i { width: 72px; height: 8px; border-radius: 4px; background: linear-gradient(90deg, rgb(230, 103, 103), rgb(56, 56, 53), rgb(57, 135, 229)); }
.vg1-nums { display: flex; gap: 1.25rem; }
.vg1-num { display: grid; gap: 0.1rem; text-align: right; }
.vg1-num > span { display: inline-flex; align-items: center; justify-content: flex-end; gap: 0.35rem; color: var(--faint); font-size: 0.6875rem; }
.vg1-num i { width: 8px; height: 8px; border-radius: 2px; }
.vg1-num b { font-size: 1.0625rem; letter-spacing: -0.02em; color: var(--ink); }
[data-card="mix"] .sp-s:empty { display: none; }

/* ——— celular ——— */
@media (max-width: 760px) {
  .vg1-alertas li { grid-template-columns: auto minmax(0, 1fr) auto; row-gap: 0.15rem; }
  .vg1-alertas li > :nth-child(3) { grid-column: 1 / -1; grid-row: 2; }
  .vg1-alertas li > :nth-child(4) { grid-column: 3; grid-row: 1; }
  .vg1-alertas li > b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .vg1-alerta-casa { margin-right: 0.35rem; }
  .vg1-nums { width: 100%; justify-content: space-between; gap: 0.5rem; }
  .vg1-num { text-align: left; }
  .vg1-num > span { justify-content: flex-start; }
  .vg1-fixa th:first-child { position: sticky; left: 0; z-index: 1; background: var(--card, #15151b); box-shadow: 1px 0 0 var(--line); }
}
@media (max-width: 560px) {
  .vg1-so-largo { display: none; }
  .vg1-jogos .vg-jogo-n, .vg1-jogos .vg-jogo-p { max-width: 38vw; }
  .vg1-barra { min-width: 0; }
  .vg1-chip { min-height: 36px; }
  .vg-paginas { grid-template-columns: minmax(0, 1fr); }
  .vg-pagina-r { min-height: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .vg1-alertas li, .vg-pagina { transition: none; }
}

/* ——— segunda passada ——— */
/* 5 KPIs no celular: o total ocupa a linha inteira em vez de sobrar um cartão órfão */
@media (max-width: 760px) { [data-card="ggr"] .vg-kpis-5 > :first-child { grid-column: 1 / -1; } }
/* jogos no celular: colunas de número com largura fixa, o nome do jogo fica com o resto */
@media (max-width: 560px) {
  .vg1-jogos { table-layout: fixed; }
  .vg1-jogos th:nth-last-child(2) { width: 104px; }
  .vg1-jogos th:last-child { width: 58px; }
  .vg1-jogos .vg-jogo-n, .vg1-jogos .vg-jogo-p { max-width: none; }
  .vg1-jogos td, .vg1-jogos th { padding-left: 0.4rem; padding-right: 0.4rem; }
  .vg1-jogos td:first-child { padding-left: 1.6rem; }
  .vg1-pos { left: 0.3rem; }
}
/* balão de ajuda no celular: vira uma faixa presa no pé da tela (antes saía pela lateral e alargava a página) */
@media (max-width: 760px) {
  :is([data-card="pulso"], [data-card="alertas"], [data-card="ggr"], [data-card="jogos"], [data-card="fatura"], [data-card="quadrante"], [data-card="mix"], [data-card="conciliacao"], [data-card="identidade"]) .v2-tip [role="tooltip"] { position: fixed; left: 16px; right: 16px; bottom: 16px; width: auto; max-width: none; transform: none; padding: 0.7rem 0.85rem; font-size: 0.8125rem; }
}

/* ——— terceira passada (celular) ——— */
@media (max-width: 760px) {
  /* alerta em 3 linhas: nível e atalho, o que é (inteiro), o número */
  .vg1-alertas li > b:nth-child(2) { grid-column: 1 / -1; grid-row: 2; white-space: normal; }
  .vg1-alertas li > :nth-child(3) { grid-row: 3; }
  .vg1-alertas li > :nth-child(3):empty { display: none; }
  .vg1-alertas li > :nth-child(4) { min-height: 32px; }
}
@media (max-width: 560px) {
  .vg1-jogos th:nth-last-child(2) { width: 92px; }
  .vg1-jogos th:last-child { width: 50px; }
  .vg1-jogos .vg-jogo-n { white-space: normal; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; }
}
