/* Telas 2 da Visão geral: Aquisição, Risco, Casas, MEDs (todas), Gerente e Fila única.
   Carregado depois do v3.css. Só sobrescreve dentro dos cartões e páginas destas telas (classes t2-*).
   Cores e raios repetem os tokens do tema; depois do merge da fundação (vg.css) dá para trocar pelos tokens dela. */

/* —— cabeçalho curto do cartão: título, uma linha e o resto no "?" —— */
.t2-head { align-items: center; }
.t2-head h2, .t2-head h3 { display: flex; align-items: center; gap: 0.4rem; }
.t2-acoes { display: flex; align-items: center; gap: 0.5rem 0.9rem; flex-wrap: wrap; }
.t2-so-cel { display: none; }
.t2-vazio { padding: 0.75rem 0; }
.t2-rodape { margin-top: 0.75rem; font-size: 0.8125rem; }

/* —— ponto de situação —— */
.t2-dot { display: inline-flex; align-items: center; gap: 0.45rem; font-size: 0.8125rem; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.t2-dot i { flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--faint); }
.t2-dot[data-tone="ok"] i { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-bg); }
.t2-dot[data-tone="warn"] { color: var(--warn); }
.t2-dot[data-tone="warn"] i { background: var(--warn); box-shadow: 0 0 0 3px var(--warn-bg); }
.t2-dot[data-tone="danger"] { color: var(--danger); }
.t2-dot[data-tone="danger"] i { background: var(--danger); box-shadow: 0 0 0 3px var(--danger-bg); }
.t2-dot[data-tone="info"] i { background: #3987e5; }
th .t2-dot { margin-left: 0.6rem; font-size: 0.6875rem; font-weight: 500; letter-spacing: 0; text-transform: none; }
.vg-erro .t2-dot { white-space: normal; }
.t2-vivo .t2-dot[data-tone="ok"] i { animation: t2-pulso 2s ease-out infinite; }
@keyframes t2-pulso { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 55%, transparent); } 100% { box-shadow: 0 0 0 8px transparent; } }

/* —— blocos de número —— */
.t2-bloco, [data-card="operacao"] .vg-stat { position: relative; min-width: 0; }
.t2-bloco .sp-v { overflow-wrap: anywhere; }
a.t2-bloco::after, [data-card="operacao"] a.vg-stat::after { content: "›"; position: absolute; top: 0.55rem; right: 0.85rem; color: var(--faint); font-size: 1rem; transition: transform 0.2s, color 0.2s; }
a.t2-bloco:hover::after, [data-card="operacao"] a.vg-stat:hover::after { transform: translateX(2px); color: var(--ink); }
a.t2-bloco:focus-visible, [data-card="operacao"] a.vg-stat:focus-visible { outline: none; box-shadow: var(--focus); }
.vg-odds.t2-seis { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.vg-odds.t2-cinco, .vg-odds.t2-risco { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.vg-odds.t2-tres { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.t2-seis .sp-v { font-size: 1.25rem; }
.t2-esqueleto { display: grid; gap: 0.6rem; min-height: 5.25rem; align-content: center; }
.t2-esqueleto .skeleton { height: 10px; width: 55%; }
.t2-esqueleto .skeleton + .skeleton { height: 18px; width: 38%; }
@media (max-width: 1180px) {
  .vg-odds.t2-seis, .vg-odds.t2-cinco, .vg-odds.t2-risco { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .vg-odds.t2-seis, .vg-odds.t2-cinco, .vg-odds.t2-risco, .t2-meds .vg-odds { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.5rem; }
  .vg-odds.t2-cinco > :last-child:nth-child(odd), .vg-odds.t2-risco > :last-child:nth-child(odd), .t2-meds .vg-odds > :last-child:nth-child(odd), .vg-ops > :last-child:nth-child(odd) { grid-column: 1 / -1; }
  .vg-odds.t2-tres { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.5rem; }
  .t2-tres .vg-odd { padding: 0.7rem 0.75rem; }
  .t2-tres .sp-v, .t2-cinco .sp-v, .t2-risco .sp-v, .t2-seis .sp-v { font-size: 1.125rem; }
}

/* —— dica ("?"): abre para baixo, presa no bloco, para não vazar da tela no celular —— */
:is(.t2-head > div, .t2-pagina .v2-sub, .t2-alerta .v2-label, .t2-seis .vg-odd, .t2-metas li) { position: relative; }
:is(.t2-head, .t2-pagina .v2-sub, .t2-alerta .v2-label, .t2-bloco, .t2-seis, .t2-metas) .v2-tip { position: static; }
:is(.t2-head, .t2-pagina .v2-sub, .t2-alerta .v2-label, .t2-bloco, .t2-seis, .t2-metas) .v2-tip [role="tooltip"] { top: calc(100% + 4px); bottom: auto; left: 0; transform: none; max-width: min(260px, calc(100vw - 3rem)); font-family: var(--font); font-size: 0.75rem; font-weight: 400; letter-spacing: 0; text-transform: none; white-space: normal; }
:is(.t2-seis, .t2-cinco, .t2-risco, .t2-tres, .t2-metas) > :nth-child(even) .v2-tip [role="tooltip"], .t2-tres > :last-child .v2-tip [role="tooltip"] { left: auto; right: 0; }

/* —— barras: crescem ao aparecer —— */
.t2-metas .vg-bar i, .t2-safras .vg-bar i, .t2-gerente .vg-bar i { transform-origin: left; animation: t2-cresce 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
@keyframes t2-cresce { from { transform: scaleX(0); } }
.t2-safras .vg-bar, .t2-gerente .vg-bar { display: inline-block; width: 72px; vertical-align: middle; margin-right: 0.55rem; }
.t2-gerente .vg-bar i { background: linear-gradient(90deg, color-mix(in srgb, var(--ok) 55%, transparent), var(--ok)); }

/* —— metas do mês: um bloco por meta, lado a lado —— */
.vg-metas.t2-metas { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0.75rem; }
.t2-metas li { --tc: #3987e5; min-width: 0; padding: 0.85rem 1rem 0.8rem; border: 1px solid var(--line); border-radius: 16px; background: rgba(255, 255, 255, 0.025); box-shadow: inset 0 1px 0 color-mix(in srgb, var(--tc) 40%, transparent); }
.t2-metas li[data-tone="ok"] { --tc: var(--ok); }
.t2-metas li[data-tone="warn"] { --tc: var(--warn); }
.t2-metas li[data-tone="bad"] { --tc: var(--danger); }
.t2-meta-v { margin: 0.25rem 0 0; font-family: var(--display); font-size: 1.375rem; font-weight: 600; color: var(--ink); line-height: 1.2; }
.t2-meta-v .v2-faint { font-family: var(--font); font-size: 0.8125rem; font-weight: 400; }
.t2-metas .vg-meta-bar { position: relative; overflow: visible; margin: 0.65rem 0 0.45rem; }
.t2-metas .vg-meta-bar i { background: linear-gradient(90deg, color-mix(in srgb, var(--tc) 50%, transparent), var(--tc)); }
.t2-meta-proj { position: absolute; top: -3px; bottom: -3px; width: 2px; margin-left: -2px; border-radius: 2px; background: var(--ink); }
.t2-sem-meta { opacity: 0.45; }

/* —— liga das casas —— */
.t2-liga .t2-mais { display: none; }
@media (min-width: 721px) {
  /* a casa fica presa na esquerda enquanto as 15 colunas rolam */
  .t2-liga thead th:nth-child(2), .t2-liga tbody th[scope="row"], .t2-liga tfoot th[scope="row"] { position: sticky; left: 0; z-index: 1; background: var(--card, #15151b); box-shadow: 10px 0 12px -12px rgba(0, 0, 0, 0.9); }
}
@media (max-width: 720px) {
  .t2-so-cel { display: block; min-height: 44px; max-width: 11rem; }
  .t2-liga-wrap { overflow: visible; }
  .t2-liga, .t2-liga tbody, .t2-liga tfoot { display: block; width: 100%; }
  .t2-liga thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .t2-liga tr { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0.65rem 0.75rem; align-items: start; margin-bottom: 0.6rem; padding: 0.85rem 0.9rem; border: 1px solid var(--line); border-radius: 16px; background: rgba(255, 255, 255, 0.025); }
  .t2-liga tr.vg-liga-pequena { opacity: 1; }
  .t2-liga tbody tr:hover { background: rgba(255, 255, 255, 0.025); }
  .v2-table.t2-liga tr > * { grid-column: span 2; min-width: 0; padding: 0; border: 0; text-align: left; white-space: normal; }
  .t2-liga .hoje-vs { display: none; }
  .v2-table.t2-liga tr > .t2-pos { grid-column: span 1; order: -3; align-self: center; font-size: 0.8125rem; white-space: nowrap; }
  .t2-liga tr > th[scope="row"] { grid-column: span 3; order: -2; align-self: center; }
  .t2-liga tbody th::before { display: none; }
  .t2-liga .vg-liga-casa { min-height: 44px; padding-left: 0; }
  .t2-liga .t2-leitura { order: -1; align-self: center; justify-self: end; }
  .t2-liga td[data-l]::before { content: attr(data-l); display: block; margin-bottom: 0.15rem; font-size: 0.625rem; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--faint); }
  .t2-liga td[data-l="Depósitos"] { font-family: var(--display); font-size: 0.9375rem; color: var(--ink); white-space: nowrap; }
  .t2-liga td .vg-bar { display: block; width: 100%; margin: 0.35rem 0 0.2rem; }
  .t2-liga tr:not(.aberta) .t2-sec, .t2-liga .t2-nada { display: none; }
  .t2-liga .vg-liga-spark { width: auto; }
  .t2-liga .vg-liga-spark svg { width: 100%; }
  .t2-liga td.t2-mais { display: block; grid-column: 1 / -1; order: 9; margin: -0.35rem -0.4rem -0.6rem; }
  .t2-liga td.t2-mais .btn { width: 100%; min-height: 44px; justify-content: center; }
  .t2-liga tfoot tr { border-style: dashed; }
  .t2-liga-paradas tr { display: block; padding: 0; border: 0; background: none; }
  .t2-liga-paradas td { display: block; }
  .t2-liga-paradas .btn { min-height: 44px; }
}

/* —— tabela que vira cartão no celular (rotular() põe o título da coluna em data-l) —— */
@media (max-width: 720px) {
  table.t2-cards, .t2-cards tbody, .t2-cards tfoot { display: block; width: 100%; min-width: 0; }
  .t2-cards thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .t2-cards tr { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.55rem 0.75rem; padding: 0.85rem 0; border-bottom: 1px solid var(--line); }
  .t2-cards tbody tr:first-child { padding-top: 0.25rem; }
  .t2-cards tbody:last-child tr:last-child, .t2-cards tfoot tr:last-child { border-bottom: 0; padding-bottom: 0.25rem; }
  .t2-cards tbody tr:hover { background: none; }
  .v2-table.t2-cards tr > * { min-width: 0; padding: 0; border: 0; text-align: left; white-space: normal; }
  .t2-cards tr > :first-child { grid-column: 1 / -1; font-weight: 600; color: var(--ink); }
  .t2-cards td:empty, .t2-cards .t2-nada { display: none; }
  .t2-cards td[data-l]:not(:first-child)::before { content: attr(data-l); display: block; margin-bottom: 0.15rem; font-size: 0.625rem; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--faint); }
  .t2-cards td .vg-bar { display: block; width: 100%; margin: 0.3rem 0 0.2rem; }
  /* células largas: texto corrido e ação ocupam a linha toda */
  .t2-odds td:nth-child(2), .t2-odds td:last-child, .vg-jogos.t2-cards td:last-child, .t2-sistema td.vg-erro, .t2-fila .t2-nota, .t2-fila .t2-acao { grid-column: 1 / -1; }
  .t2-cards.t2-odds td:nth-child(2)::before, .t2-cards.t2-fila .t2-acao::before { display: none; }
  .vg-jogos.t2-cards td:nth-child(2) { grid-column: span 2; }
  .t2-fila tr { grid-template-columns: auto minmax(0, 1fr); }
  [data-card="odds"] .vg-odds { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.5rem; }
  [data-card="odds"] .vg-odds > :last-child:nth-child(odd) { grid-column: 1 / -1; }
  [data-card="odds"] .vg-odds .sp-v { font-size: 1.125rem; }
  .t2-odds td:nth-child(2) a { display: inline-block; padding: 0.2rem 0; font-weight: 600; }
  .t2-mov th, .t2-mov td { padding: 0.5rem 0.3rem; font-size: 0.8125rem; }
  .t2-mov td:nth-child(2) { max-width: 5.5rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  /* alvos de toque nos cartões destas telas */
  :is([data-card="liga"], [data-card="metas"], [data-card="odds"], [data-card="operacao"], .t2-pagina) :is(.btn, .chip, select) { min-height: 44px; }
  :is([data-card="odds"], .t2-pagina) .vg-chips { display: flex; flex-wrap: nowrap; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
  :is([data-card="odds"], .t2-pagina) .vg-chips .chip { flex: none; white-space: nowrap; }
  [data-card="odds"] .vg-odds-bar select { width: 100%; }
  .vg-metas-form input { width: 7rem; min-height: 44px; }
}

/* —— risco —— */
.t2-ec-risco { margin-bottom: 0.75rem; }
.vg-jogos .t2-dot { color: var(--ink); }

/* —— sistema —— */
.t2-sistema td, .t2-sistema th { white-space: nowrap; }

/* —— páginas (MEDs, Gerente, Fila) —— */
.t2-pagina { display: grid; gap: 1rem; align-content: start; }
.t2-pagina > * { min-width: 0; }
.t2-pagina > :not(.v2-head) { margin-top: 0; margin-bottom: 0; }
.t2-pagina > .v2-head { margin-bottom: 0.25rem; }
.t2-pagina .v2-head { flex-wrap: wrap; gap: 0.5rem 1rem; }
.t2-pagina .v2-sub { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; }
.t2-pagina .vg-ec { margin-top: 0.25rem; }
.t2-filtro .chip { display: inline-flex; align-items: center; gap: 0.4rem; text-decoration: none; }
.t2-detalhe { margin-top: 0.75rem; border-top: 1px solid var(--line); padding-top: 0.5rem; }
.t2-detalhe summary { display: inline-flex; align-items: center; min-height: 44px; cursor: pointer; color: var(--muted); font-size: 0.8125rem; font-weight: 600; border-radius: 6px; }
.t2-detalhe summary:hover { color: var(--ink); }
.t2-detalhe summary:focus-visible { outline: none; box-shadow: var(--focus); }

/* gerente: alertas em cartões com a borda do escopo */
.t2-alertas { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 0.75rem; align-items: start; }
.t2-alerta { --tc: var(--warn); display: grid; gap: 0.45rem; border-left: 3px solid var(--tc); }
.t2-alerta[data-escopo="plataforma"] { --tc: var(--danger); }
.t2-alerta p, .t2-alerta ul { margin: 0; }
.t2-alerta-topo { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.t2-alerta-topo > :last-child { margin-left: auto; font-size: 0.75rem; }
.t2-alerta-casas { font-size: 0.8125rem; color: var(--muted); }
.t2-alerta-lista { list-style: none; padding: 0; display: grid; gap: 0.25rem; font-size: 0.875rem; }
.t2-alerta-nota { font-size: 0.8125rem; }
.t2-alerta textarea { width: 100%; min-height: 4.5rem; }
.t2-aviso { margin: 0.25rem 0 0; padding: 0.5rem 0.75rem; border-left: 2px solid var(--line-strong); border-radius: 0 8px 8px 0; background: rgba(255, 255, 255, 0.03); color: var(--ink); font-size: 0.875rem; }
.t2-aviso-linha { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem 1rem; padding: 0.6rem 0; border-top: 1px solid var(--line); }
.t2-aviso-linha p { margin: 0; }
.t2-aviso-linha > div { min-width: 0; flex: 1; }

/* fila: a espera puxa o olho */
.t2-fila tr[data-tone="danger"] th[scope="row"] { color: var(--ink); }
.t2-fila .t2-nota { min-width: 18rem; max-width: 42rem; white-space: normal; }
.t2-fila .t2-acao { text-align: right; white-space: nowrap; }
@media (max-width: 720px) {
  .t2-fila .t2-nota { min-width: 0; color: var(--ink); }
  .t2-fila .t2-acao .btn { width: 100%; justify-content: center; }
  .t2-fila tr > :first-child { grid-column: auto; }
  .t2-fila tr > th[scope="row"] { align-self: center; justify-self: end; }
  .t2-alerta .btn, .t2-aviso-linha .btn { min-height: 44px; }
  .t2-alerta .v2-actions-row .btn { width: 100%; justify-content: center; }
  .t2-med-dia > :first-child { flex: none; }
}

@media (prefers-reduced-motion: reduce) {
  .t2-metas .vg-bar i, .t2-safras .vg-bar i, .t2-gerente .vg-bar i, .t2-vivo .t2-dot i { animation: none; }
  a.t2-bloco::after, [data-card="operacao"] a.vg-stat::after { transition: none; }
}

/* —— ajustes finos —— */
.t2-bloco .sp-l, .t2-seis .sp-l, .t2-metas .sp-l { display: block; }
.t2-bloco .sp-l .v2-tip, .t2-seis .sp-l .v2-tip, .t2-metas .sp-l .v2-tip { margin-left: 0.25rem; }
.t2-pagina .v2-sub { display: block; }
@media (max-width: 720px) {
  .t2-cinco .sp-l, .t2-risco .sp-l, .t2-seis .sp-l, .t2-tres .sp-l { font-size: 0.625rem; letter-spacing: 0.04em; }
  /* movimentos grandes: o tipo vira só o ponto colorido (azul depósito, vermelho saque) para caber sem rolar */
  .t2-mov .t2-dot { font-size: 0; gap: 0; }
  .t2-mov th { font-size: 0.625rem; letter-spacing: 0.02em; }
  .t2-mov td:nth-child(2) { max-width: 4.8rem; }
  .t2-mov th, .t2-mov td { padding-inline: 0.2rem; }
  /* fatura, conciliação e identidade do caixa em cartões: sem coluna presa */
  .t2-cards.vg1-fixa th:first-child { position: static; background: none; box-shadow: none; }
  .t2-cards.vg1-fixa .v2-status { padding-inline: 0.4rem; letter-spacing: 0; }
  /* MEDs em análise por dia: quantidade e valor numa linha só */
  .t2-med-dia > :last-child { flex: none; white-space: nowrap; }
  .t2-med-dia > :nth-child(2) { flex: 0 1 auto; }
}
@media (max-width: 380px) {
  .t2-mov th, .t2-mov td { padding-inline: 0.15rem; font-size: 0.75rem; }
  .t2-mov td:nth-child(2) { max-width: 4rem; }
}
@media (max-width: 720px) {
  .v2-table.t2-liga tr > td[data-l] { white-space: nowrap; }
  .v2-table.t2-liga tr > td[data-l="Depósitos"], .v2-table.t2-liga tr > td[data-l="Depósitos"] + td { grid-column: span 3; }
  .v2-table.t2-liga tr > td.t2-mais { grid-column: 1 / -1; }
}
.t2-filtro { width: fit-content; max-width: 100%; }
@media (max-width: 720px) {
  .v2-table.t2-liga tr > td[data-l]::before { white-space: normal; letter-spacing: 0.03em; }
  .v2-table.t2-liga tr > td.vg-liga-spark { grid-column: span 4; }
  .t2-meds .vg-odd .sp-v { font-size: 1.0625rem; }
}
