/* Visão geral v2 (18/09/2026) — faixa de situação com anel, números com barra de proporção,
   tráfego ↓/↑ separado, novidades agrupadas e pendências ordenadas.
   Cores via tokens do design-system.css (claro/escuro de graça); ajustes de celular no fim. */

.vg { display: flex; flex-direction: column; gap: 16px; padding-bottom: 32px; }
.vg .num { font-variant-numeric: tabular-nums; }
.vg { --vg-in: #0e9f94; --vg-out: var(--blue); --vg-mu: color-mix(in srgb, var(--text-secondary) 55%, transparent); }
html[data-theme="dark"] .vg { --vg-in: #35e0d0; }

/* Cabeçalho */
.vg-cab { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px 16px; flex-wrap: wrap; }
.vg-cab h1 { font-family: var(--font-display); font-size: 26px; font-weight: 800; letter-spacing: -.01em; margin: 0; color: var(--text-primary); }
.vg-cab p { margin: 4px 0 0; color: var(--text-secondary); font-size: 14px; }
.vg-cab__acoes { display: flex; align-items: center; gap: 8px; color: var(--text-secondary); font-size: 12.5px; flex-wrap: wrap; }
.vg-vivo { display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px; border: 1px solid var(--border); border-radius: 999px; white-space: nowrap; }
.vg-vivo i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px color-mix(in srgb, var(--green) 18%, transparent); }
.vg-erro { color: var(--red); font-size: 13px; margin: 6px 0 0; }

/* Faixa de situação */
.vg-situacao { --t: var(--text-secondary); display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 20px; align-items: center;
  padding: 16px 20px; border-radius: 16px; border: 1px solid color-mix(in srgb, var(--t) 30%, var(--border));
  background: linear-gradient(90deg, color-mix(in srgb, var(--t) 10%, var(--bg-card)), var(--bg-card) 50%); color: var(--text-primary); }
.vg-situacao[data-tom="crit"] { --t: var(--red); }
.vg-situacao[data-tom="warn"] { --t: var(--yellow); }
.vg-situacao[data-tom="ok"] { --t: var(--green); }
.vg-anel { position: relative; width: 84px; height: 84px; flex: none; }
.vg-anel svg { width: 84px; height: 84px; transform: rotate(-90deg); }
.vg-anel circle { fill: none; stroke-width: 3.4; }
.vg-anel__fundo { stroke: var(--bg-hover); }
.vg-anel__arco { stroke: var(--green); stroke-linecap: round; transition: stroke-dasharray .6s ease; }
.vg-anel[data-tom="warn"] .vg-anel__arco { stroke: var(--yellow); }
.vg-anel[data-tom="crit"] .vg-anel__arco { stroke: var(--red); }
.vg-anel b { position: absolute; inset: 0; display: grid; place-items: center; padding-bottom: 8px; font-family: var(--font-display); font-size: 18px; font-weight: 800; }
.vg-anel small { position: absolute; left: 0; right: 0; bottom: 20px; text-align: center; font-size: 9.5px; color: var(--text-secondary); letter-spacing: .08em; text-transform: uppercase; }
.vg-situacao__texto { min-width: 0; }
.vg-situacao .vg-frase { margin: 7px 0 0; color: var(--text-primary); font-family: var(--font-display); font-size: 19px; font-weight: 700; line-height: 1.3; text-wrap: balance; }
.vg-situacao .vg-frase b { color: var(--t); font-weight: 700; }
#vgSub { margin: 3px 0 0; color: var(--text-secondary); font-size: 13px; }
.vg-selo { display: inline-flex; align-items: center; gap: 7px; padding: 3px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 700; background: var(--bg-hover); color: var(--text-secondary); }
.vg-selo i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.vg-selo[data-tom="crit"] { background: var(--red-bg); color: var(--red); }
.vg-selo[data-tom="warn"] { background: var(--yellow-bg); color: var(--yellow); }
.vg-selo[data-tom="ok"] { background: var(--green-bg); color: var(--green); }
.vg-mini { display: flex; gap: 22px; }
.vg-mini div { display: flex; flex-direction: column; align-items: flex-end; }
.vg-mini b { font-family: var(--font-display); font-size: 22px; font-weight: 700; line-height: 1.1; }
.vg-mini b[data-tom="crit"] { color: var(--red); }
.vg-mini span { font-size: 11.5px; color: var(--text-secondary); white-space: nowrap; }

/* 6 números */
.vg-numeros { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.vg-tile { --t: var(--text-secondary); position: relative; display: flex; flex-direction: column; gap: 8px; padding: 14px 14px 13px 16px; border-radius: 14px;
  background: var(--bg-card); border: 1px solid var(--border); text-decoration: none; color: var(--text-primary); overflow: hidden; transition: border-color .15s, background .15s; }
.vg-tile::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: transparent; }
.vg-tile[data-tom="crit"] { --t: var(--red); } .vg-tile[data-tom="warn"] { --t: var(--yellow); } .vg-tile[data-tom="ok"] { --t: var(--green); }
.vg-tile[data-tom]:not([data-tom=""])::before { background: var(--t); }
.vg-tile:hover { border-color: var(--border-strong); background: var(--bg-hover); }
.vg-tile:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.vg-tile__topo { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--text-secondary); font-size: 12.5px; font-weight: 600; }
.vg-tile__ic { flex: none; width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; color: var(--t); background: color-mix(in srgb, var(--t) 13%, transparent); }
.vg-tile__ic svg { width: 14px; height: 14px; }
.vg-tile__valor { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.vg-tile__valor b { font-family: var(--font-display); font-size: 32px; font-weight: 800; line-height: 1; letter-spacing: -.02em; }
.vg-tile__valor small { color: var(--text-secondary); font-size: 12.5px; }
.vg-tile[data-tom="crit"] .vg-tile__valor b { color: var(--red); }
.vg-tile[data-tom="warn"] .vg-tile__valor b { color: var(--yellow); }
.vg-tile__det { color: var(--text-secondary); font-size: 12px; line-height: 1.45; }
.vg-tile__det em { font-style: normal; font-weight: 700; color: var(--text-primary); }

/* Barra de proporção (segmentos) e bolinhas de sessão */
.vg-barra { display: flex; gap: 2px; height: 6px; border-radius: 999px; overflow: hidden; background: var(--bg-hover); }
.vg-barra:empty { visibility: hidden; }
.vg-barra i { display: block; height: 100%; min-width: 3px; }
.vg-barra i[data-c="ok"] { background: var(--green); }
.vg-barra i[data-c="warn"] { background: var(--yellow); }
.vg-barra i[data-c="crit"] { background: var(--red); }
.vg-barra i[data-c="info"] { background: var(--blue); }
.vg-barra i[data-c="mu"] { background: var(--vg-mu); }
.vg-barra--sessoes { background: transparent; overflow: visible; height: auto; flex-wrap: wrap; gap: 4px; }
.vg-barra--sessoes i { height: 6px; }
.vg-barra--sessoes i { width: 12px; flex: none; border-radius: 999px; }

/* Painéis */
.vg-painel { background: var(--bg-card); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; color: var(--text-primary); }
.vg-painel__cab { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 13px 18px; border-bottom: 1px solid var(--border); }
.vg-painel__cab h2 { font-family: var(--font-display); font-size: 15px; font-weight: 700; margin: 0; }
.vg-painel__cab p { margin: 2px 0 0; color: var(--text-secondary); font-size: 12px; }
.vg-painel__cab a { font-size: 12.5px; font-weight: 600; color: var(--blue); text-decoration: none; white-space: nowrap; }
.vg-painel__cab a:hover { text-decoration: underline; }
.vg-vazio { padding: 18px; color: var(--text-secondary); font-size: 13px; margin: 0; }

.vg-lista { list-style: none; margin: 0; padding: 0; }
.vg-lista > li { border-bottom: 1px solid var(--border); }
.vg-lista > li:last-child { border-bottom: 0; }
.vg-lista a.vg-linha { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 11px 18px; color: inherit; text-decoration: none; }
.vg-lista a.vg-linha:hover { background: var(--bg-hover); }
.vg-lista a.vg-linha:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }
.vg-lista b { display: block; font-weight: 600; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vg-lista small { display: block; color: var(--text-secondary); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vg-lista time { color: var(--text-secondary); font-size: 12px; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* Tráfego */
.vg-trafego a.vg-linha { grid-template-columns: 24px minmax(0, 1.2fr) minmax(0, 1.8fr) 64px; gap: 16px; }
.vg-pos { font-family: var(--font-display); font-weight: 800; color: var(--text-secondary); font-size: 15px; text-align: center; }
.vg-porta { font-family: ui-monospace, Menlo, monospace; font-size: 11.5px; color: var(--text-primary); }
.vg-cap { font-family: ui-monospace, Menlo, monospace; font-size: 10.5px; border: 1px solid var(--border); border-radius: 6px; padding: 0 5px; margin-left: 6px; color: var(--text-secondary); }
.vg-sentidos { display: flex; flex-direction: column; gap: 5px; }
.vg-sentido { display: grid; grid-template-columns: 14px minmax(0, 1fr) 76px; gap: 8px; align-items: center; font-size: 12px; color: var(--text-secondary); }
.vg-sentido__trilho { height: 6px; border-radius: 999px; background: var(--bg-hover); overflow: hidden; }
.vg-sentido__trilho i { display: block; height: 100%; border-radius: 999px; }
.vg-sentido--in .vg-sentido__trilho i { background: linear-gradient(90deg, color-mix(in srgb, var(--vg-in) 40%, transparent), var(--vg-in)); }
.vg-sentido--out .vg-sentido__trilho i { background: linear-gradient(90deg, color-mix(in srgb, var(--vg-out) 40%, transparent), var(--vg-out)); }
.vg-sentido em { font-style: normal; font-family: ui-monospace, Menlo, monospace; font-size: 11.5px; text-align: right; color: var(--text-primary); white-space: nowrap; }
.vg-pct { font-family: var(--font-display); font-weight: 700; font-size: 16px; text-align: right; }
.vg-pct[data-tom="warn"] { color: var(--yellow); }
.vg-pct[data-tom="crit"] { color: var(--red); }
.vg-pct small { display: block; font-family: inherit; font-size: 10.5px; font-weight: 500; }
.vg-legenda { display: flex; gap: 14px; flex-wrap: wrap; color: var(--text-secondary); font-size: 12px; padding: 10px 18px; border-top: 1px solid var(--border); }
.vg-legenda span { display: inline-flex; align-items: center; gap: 6px; }
.vg-legenda i { width: 14px; height: 6px; border-radius: 999px; display: inline-block; }
.vg-leg-in { background: var(--vg-in); }
.vg-leg-out { background: var(--vg-out); }

/* Novidades */
.vg-marca { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; font-weight: 800; font-size: 13px; font-family: var(--font-display); }
.vg-marca[data-tom="crit"] { background: var(--red-bg); color: var(--red); }
.vg-marca[data-tom="warn"] { background: var(--yellow-bg); color: var(--yellow); }
.vg-marca[data-tom="info"] { background: var(--blue-bg); color: var(--blue); }
.vg-nov b { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.vg-nov .vg-pill { display: inline-flex; align-items: center; font-size: 11px; font-weight: 600; padding: 0 8px; border-radius: 999px; margin-left: 6px; vertical-align: 1px; }
.vg-pill[data-tom="crit"] { color: var(--red); background: var(--red-bg); }
.vg-pill[data-tom="warn"] { color: var(--yellow); background: var(--yellow-bg); }
.vg-nov li.is-grupo { background: color-mix(in srgb, var(--yellow) 5%, transparent); }
.vg-local { display: block; margin-top: 3px; font-size: 12px; color: var(--yellow); }
.vg-nov .vg-nomes { white-space: normal; margin-top: 2px; }

/* Pendências */
.vg-pend a.vg-linha { grid-template-columns: minmax(0, 1fr) auto; row-gap: 8px; }
.vg-pend .vg-barra { grid-column: 1 / -1; height: 4px; }
.vg-pend .vg-qtd { font-family: var(--font-display); font-weight: 800; font-size: 21px; text-align: right; display: block; line-height: 1.1; }
.vg-pend .vg-acao { font-size: 11.5px; font-weight: 700; color: var(--blue); display: block; text-align: right; }

.vg-colunas { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 16px; align-items: start; }

.vg-carregando .vg-tile__valor b, .vg-carregando .vg-tile__det { opacity: .45; }

/* Tablet */
@media (max-width: 1280px) { .vg-numeros { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1000px) {
  .vg-colunas { grid-template-columns: minmax(0, 1fr); }
  .vg-situacao { grid-template-columns: auto minmax(0, 1fr); }
  .vg-mini { grid-column: 1 / -1; justify-content: space-between; border-top: 1px solid var(--border); padding-top: 12px; }
  .vg-mini div { align-items: flex-start; }
}
/* Celular */
@media (max-width: 760px) {
  .vg { gap: 12px; }
  .vg-cab h1 { font-size: 22px; }
  .vg-cab p { font-size: 13px; }
  .vg-cab__acoes { width: 100%; }
  .vg-cab__acoes .vg-vivo { flex: 1 1 100%; justify-content: center; }
  .vg-cab__acoes .btn { flex: 1; justify-content: center; text-align: center; }
  .vg-situacao { gap: 14px; padding: 14px; }
  .vg-anel, .vg-anel svg { width: 70px; height: 70px; }
  .vg-anel b { font-size: 15px; }
  .vg-anel small { bottom: 15px; font-size: 8.5px; }
  .vg-situacao .vg-frase { font-size: 16px; }
  .vg-mini b { font-size: 19px; }
  .vg-numeros { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .vg-tile { padding: 12px 12px 11px 14px; gap: 7px; }
  .vg-tile__valor b { font-size: 27px; }
  .vg-painel__cab { padding: 12px 14px; flex-wrap: wrap; }
  .vg-lista a.vg-linha { padding: 11px 14px; }
  .vg-trafego a.vg-linha { grid-template-columns: 20px minmax(0, 1fr) auto; grid-template-areas: "pos nome pct" "sent sent sent"; row-gap: 8px; gap: 10px; }
  .vg-trafego .vg-pos { grid-area: pos; }
  .vg-trafego .vg-nome { grid-area: nome; }
  .vg-trafego .vg-pct { grid-area: pct; }
  .vg-trafego .vg-sentidos { grid-area: sent; }
  .vg-legenda { padding: 10px 14px; gap: 10px; }
  .vg-nov a.vg-linha { grid-template-columns: auto minmax(0, 1fr); row-gap: 2px; }
  .vg-nov time { grid-column: 2; }
  .vg-nov b { -webkit-line-clamp: 3; }
  .vg-pend small { white-space: normal; }
}
@media (max-width: 360px) { .vg-numeros { grid-template-columns: minmax(0, 1fr); } }
@media (prefers-reduced-motion: reduce) { .vg-tile, .vg-lista a.vg-linha, .vg-anel__arco { transition: none; } }
