/* Lemur 2.0 — casca e componentes reutilizáveis (dono: base). Tokens em tokens.css. Mobile primeiro nos componentes; a grade da
   casca abre em 3 colunas no desktop (sidebar · conteúdo · painel Lemur IA), como no design aprovado. */
body.v2 { margin: 0; background: var(--v2-bg); color: var(--v2-ink); font-family: var(--v2-fonte); font-size: var(--v2-t-m); line-height: 1.45;
  -webkit-font-smoothing: antialiased; }
body.v2 * { box-sizing: border-box; }
body.v2 a { color: var(--v2-azul-2); text-decoration: none; }
body.v2 a:hover { text-decoration: underline; }
body.v2 [hidden] { display: none !important; }
.v2-ic { flex: none; }
.v2-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ------------------------------------------------------------------ casca */
.v2-app { display: grid; grid-template-columns: var(--v2-side) minmax(0, 1fr) var(--v2-ia); min-height: 100vh; }
.v2-side { position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--v2-bg-2); border-right: 1px solid var(--v2-linha);
  display: flex; flex-direction: column; padding: 16px 10px 12px; }
.v2-marca { display: flex; align-items: center; gap: 10px; padding: 2px 8px 18px; color: var(--v2-ink); }
.v2-marca:hover { text-decoration: none; }
.v2-marca .v2-logo { width: 30px; height: 30px; border-radius: 8px; background: linear-gradient(135deg, var(--v2-azul), #1b4fb0);
  display: inline-flex; align-items: center; justify-content: center; color: #fff; }
.v2-marca b { display: block; font-size: 19px; letter-spacing: -.3px; }
.v2-marca small { display: block; font-size: 8.5px; letter-spacing: 1.6px; color: var(--v2-muted); text-transform: uppercase; }
.v2-nav { display: flex; flex-direction: column; gap: 2px; }
.v2-nav a.v2-nav-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--v2-raio-p); color: var(--v2-ink-2);
  font-size: 13.5px; }
.v2-nav a.v2-nav-item:hover { background: var(--v2-card); text-decoration: none; color: var(--v2-ink); }
.v2-nav a.v2-nav-item.on { background: var(--v2-azul-soft); color: var(--v2-ink); font-weight: 600; box-shadow: inset 2px 0 0 var(--v2-azul); }
.v2-nav .v2-sub { display: flex; flex-direction: column; margin: 2px 0 6px 30px; border-left: 1px solid var(--v2-linha); }
.v2-nav .v2-sub a { padding: 5px 10px; font-size: 12.5px; color: var(--v2-muted); }
.v2-nav .v2-sub a.on { color: var(--v2-ink); font-weight: 600; }
.v2-nav-sep { flex: 1; min-height: 18px; }
.v2-usuario { display: flex; align-items: center; gap: 10px; padding: 10px; margin-top: 10px; border-top: 1px solid var(--v2-linha); }
.v2-avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--v2-azul); color: #fff; display: inline-flex; align-items: center;
  justify-content: center; font-size: 12px; font-weight: 700; flex: none; }
.v2-usuario b { display: block; font-size: 12.5px; }
.v2-usuario small { display: block; font-size: 11px; color: var(--v2-muted); }

.v2-main { min-width: 0; display: flex; flex-direction: column; }
.v2-topo { position: sticky; top: 0; z-index: 20; height: var(--v2-topo); display: flex; align-items: center; gap: 10px;
  padding: 0 var(--v2-gutter); background: var(--v2-topo-bg); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); border-bottom: 1px solid var(--v2-linha); }
.v2-busca { position: relative; flex: 1; max-width: 640px; }
.v2-busca input { width: 100%; height: 36px; padding: 0 12px 0 36px; border-radius: 9px; border: 1px solid var(--v2-linha); background: var(--v2-card);
  color: var(--v2-ink); font: inherit; font-size: 13px; }
.v2-busca input:focus { outline: none; border-color: var(--v2-azul-borda); box-shadow: 0 0 0 3px var(--v2-azul-soft); }
.v2-busca .v2-ic { position: absolute; left: 11px; top: 9px; color: var(--v2-muted); }
.v2-busca kbd { position: absolute; right: 10px; top: 9px; font: 10.5px var(--v2-mono); color: var(--v2-muted); border: 1px solid var(--v2-linha);
  border-radius: 4px; padding: 1px 5px; }
.v2-sugestoes { position: absolute; left: 0; right: 0; top: 40px; background: var(--v2-painel); border: 1px solid var(--v2-linha-forte);
  border-radius: 10px; box-shadow: var(--v2-sombra); padding: 6px; max-height: 420px; overflow-y: auto; z-index: 40; }
.v2-sugestoes a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 7px; color: var(--v2-ink); }
.v2-sugestoes a:hover, .v2-sugestoes a.on { background: var(--v2-card-2); text-decoration: none; }
.v2-sugestoes .tipo { font-size: 10.5px; text-transform: uppercase; letter-spacing: .6px; color: var(--v2-azul-2); width: 92px; flex: none; }
.v2-sugestoes .sub { color: var(--v2-muted); font-size: 12px; margin-left: auto; text-align: right; }
.v2-topo-acoes { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.v2-btn { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 13px; border-radius: 9px; border: 1px solid var(--v2-linha);
  background: var(--v2-card); color: var(--v2-ink); font: inherit; font-size: 13px; cursor: pointer; white-space: nowrap; }
.v2-btn:hover { border-color: var(--v2-linha-forte); text-decoration: none; }
.v2-btn.prim { background: var(--v2-azul); border-color: var(--v2-azul); color: #fff; }
.v2-btn.prim:hover { background: #0077ed; }
.v2-btn.peq { height: 28px; padding: 0 10px; font-size: 12px; border-radius: 7px; }
.v2-btn.ic { width: 34px; padding: 0; justify-content: center; }
.v2-conteudo { padding: 18px var(--v2-gutter) 32px; min-width: 0; }
.v2-rodape { margin-top: auto; display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; padding: 10px var(--v2-gutter);
  border-top: 1px solid var(--v2-linha); color: var(--v2-muted-2); font-size: 11px; }
.v2-rodape > span:nth-child(2), .v2-rodape > span:nth-child(3) { display: none; }
.v2-rodape b { color: var(--v2-ink-2); }
.v2-rodape .v2-frescor { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; }
.v2-ponto { width: 7px; height: 7px; border-radius: 50%; background: var(--v2-pos); display: inline-block; }
.v2-ponto.atraso { background: var(--v2-alerta); }

/* painel Lemur IA (slot da casca; conteúdo do construtor ia_saidas) */
.v2-ia { position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--v2-bg-2); border-left: 1px solid var(--v2-linha); padding: 14px 14px 18px; }
.v2-ia-fechar { display: none; }

/* banner "Analisar com IA" (aparece quando o painel está recolhido: telas até 1280 px e celular) */
.v2-ia-banner { display: none; align-items: center; gap: 12px; margin-top: 14px; padding: 10px 14px; border-radius: var(--v2-raio);
  border: 1px solid var(--v2-azul-borda); background: linear-gradient(90deg, rgba(0, 113, 227, .14), rgba(0, 113, 227, .04)); }
.v2-ia-banner b { display: block; font-size: 13.5px; } .v2-ia-banner small { display: block; color: var(--v2-muted); font-size: 12px; }
.v2-ia-banner .v2-btn { margin-left: auto; }
@media (max-width: 1280px) { .v2-ia-banner { display: flex; } }

/* navegação inferior (celular) e gaveta "Mais/Navegação" */
.v2-nav-inferior { display: none; }
.v2-gaveta { position: fixed; inset: 0; z-index: 60; background: rgba(3, 7, 14, .6); }
.v2-gaveta .v2-gaveta-corpo { position: absolute; left: 0; top: 0; bottom: 0; width: min(320px, 86vw); background: var(--v2-bg-2);
  border-right: 1px solid var(--v2-linha); padding: 16px 10px; overflow-y: auto; }

/* ------------------------------------------------------------------ cabeçalho de entidade, abas (Apple Segmented Control), migalhas */
.v2-migalhas { font-size: 12px; color: var(--v2-muted); margin: 2px 0 10px; }
.v2-migalhas a { color: var(--v2-muted); }
.v2-cab { display: flex; gap: 14px; align-items: flex-start; flex-wrap: wrap; }
.v2-cab-logo { width: 52px; height: 52px; border-radius: 12px; background: #fff; display: flex; align-items: center; justify-content: center;
  overflow: hidden; flex: none; }
.v2-cab-logo img { width: 40px; height: 40px; object-fit: contain; }
.v2-cab-logo.sem { background: var(--v2-card-2); color: var(--v2-ink); font-weight: 700; font-size: 18px; }
.v2-cab-tit { flex: 1; min-width: 0; }
.v2-cab-tit h1 { margin: 0; font-size: var(--v2-t-xl); letter-spacing: -.3px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.v2-cab-tit .v2-sub { color: var(--v2-muted); font-size: 13px; margin-top: 2px; }
.v2-ticker { font-size: 11.5px; font-weight: 700; padding: 3px 8px; border-radius: 6px; border: 1px solid var(--v2-linha-forte); color: var(--v2-ink-2); }
.v2-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.v2-chip { font-size: 11.5px; padding: 3px 10px; border-radius: 999px; background: var(--v2-card-2); border: 1px solid var(--v2-linha); color: var(--v2-ink-2); }
.v2-chip.azul { background: var(--v2-azul-soft); border-color: var(--v2-azul-borda); color: var(--v2-azul-2); }
.v2-cab-acoes { display: flex; gap: 8px; }
.v2-abas { display: inline-flex; gap: 2px; margin: 16px 0 14px; padding: 3px; border-radius: 11px; background: var(--v2-card-2);
  border: 1px solid var(--v2-linha); overflow-x: auto; max-width: 100%; scrollbar-width: none; }
.v2-abas a { padding: 6px 15px; border-radius: 8px; border: 1px solid transparent; background: transparent; color: var(--v2-muted);
  font-size: 13px; font-weight: 500; white-space: nowrap; transition: background .15s ease, color .15s ease; }
.v2-abas a:hover { text-decoration: none; color: var(--v2-ink); }
.v2-abas a.on { background: var(--v2-card); border-color: var(--v2-linha-forte); color: var(--v2-ink); font-weight: 600;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .18); }
.v2-subnav { display: flex; gap: 4px; margin: 0 0 14px; overflow-x: auto; border-bottom: 1px solid var(--v2-linha); }
.v2-subnav a { padding: 8px 12px; color: var(--v2-muted); font-size: 13px; white-space: nowrap; border-bottom: 2px solid transparent; }
.v2-subnav a.on { color: var(--v2-ink); border-bottom-color: var(--v2-azul); }

/* ------------------------------------------------------------------ grade e cards */
.v2-grade { display: grid; gap: 14px; }
.v2-grade.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.v2-grade.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.v2-grade.c5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.v2-grade.lado { grid-template-columns: minmax(0, 2.1fr) minmax(0, 1fr); }
.v2-card { background: var(--v2-card); border: 1px solid var(--v2-linha); border-radius: var(--v2-raio); padding: 16px; min-width: 0; }
.v2-card h2, .v2-card h3 { margin: 0 0 10px; font-size: 14.5px; letter-spacing: -.1px; display: flex; align-items: center; gap: 8px; }
.v2-card h2 small, .v2-card h3 small { font-weight: 400; color: var(--v2-muted); font-size: 12px; }
.v2-card .v2-card-sub { color: var(--v2-muted); font-size: 12px; margin: -6px 0 10px; }
.v2-card-rodape { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 12px; font-size: 11.5px; color: var(--v2-muted); }

/* KPI com fonte/data na dica e "—" com motivo */
.v2-kpi { background: var(--v2-card); border: 1px solid var(--v2-linha); border-radius: var(--v2-raio); padding: 12px 14px; min-width: 0; position: relative; }
.v2-kpi .r { font-size: 11.5px; color: var(--v2-muted); display: flex; align-items: center; gap: 5px; }
.v2-kpi .v { font-size: var(--v2-t-kpi); font-weight: 700; letter-spacing: -.3px; font-variant-numeric: tabular-nums; margin: 4px 0 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.v2-kpi .s { font-size: 11px; color: var(--v2-muted-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.v2-kpi .pos { color: var(--v2-pos); } .v2-kpi .neg { color: var(--v2-neg); }
.v2-kpi.indisp .v { color: var(--v2-indisp); }
.v2-kpi .v.texto { font-size: 16.5px; white-space: normal; line-height: 1.25; margin: 5px 0 3px; }
.v2-kpi .motivo { font-size: 11px; color: var(--v2-muted); line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.v2-selo { display: inline-flex; align-items: center; font-size: 9.5px; text-transform: uppercase; letter-spacing: .5px; padding: 1px 6px;
  border-radius: 999px; border: 1px solid; }
.v2-selo.parcial { color: var(--v2-azul-2); border-color: var(--v2-azul-borda); }
.v2-selo.baixa { color: var(--v2-alerta); border-color: rgba(242, 178, 60, .45); background: var(--v2-alerta-soft); }
.v2-selo.indisp { color: var(--v2-indisp); border-color: var(--v2-linha-forte); }
.v2-dica { cursor: help; }
.v2-dica[data-dica]:hover::after { content: attr(data-dica); position: absolute; left: 8px; right: 8px; top: calc(100% + 6px); z-index: 30;
  background: #04080f; color: var(--v2-ink-2); border: 1px solid var(--v2-linha-forte); border-radius: 8px; padding: 8px 10px; font-size: 11.5px;
  font-weight: 400; line-height: 1.4; white-space: normal; box-shadow: var(--v2-sombra); }

/* card de lista ("Emissões de dívida", "Exposição em FIDCs/FIIs", "Comparáveis setoriais") */
.v2-card-lista { display: flex; flex-direction: column; }
.v2-card-lista .cab { display: flex; gap: 10px; align-items: center; }
.v2-card-lista .ic-box { width: 32px; height: 32px; border-radius: 8px; background: var(--v2-azul-soft); color: var(--v2-azul-2); display: inline-flex;
  align-items: center; justify-content: center; flex: none; }
.v2-card-lista .ic-box.verde { background: rgba(52, 199, 123, .14); color: var(--v2-pos); }
.v2-card-lista .ic-box.roxo { background: rgba(139, 108, 246, .16); color: #b3a1ff; }
.v2-card-lista b { display: block; font-size: 13.5px; }
.v2-card-lista p { margin: 2px 0 0; color: var(--v2-muted); font-size: 11.5px; }
.v2-card-lista ul { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.v2-card-lista li { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; }
.v2-card-lista li span:last-child { color: var(--v2-ink-2); white-space: nowrap; }

/* tabela densa ordenável */
.v2-tabela-rolagem { overflow-x: auto; border: 1px solid var(--v2-linha); border-radius: var(--v2-raio-p); }
table.v2-tabela { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.v2-tabela th { text-align: left; font-weight: 600; color: var(--v2-muted); font-size: 11.5px; padding: 8px 10px; background: var(--v2-card-2);
  border-bottom: 1px solid var(--v2-linha); white-space: nowrap; position: sticky; top: 0; }
.v2-tabela th[data-ordenar] { cursor: pointer; user-select: none; }
.v2-tabela th[data-ordenar]::after { content: " ↕"; color: var(--v2-muted-2); font-size: 10px; }
.v2-tabela th.asc::after { content: " ↑"; color: var(--v2-azul-2); } .v2-tabela th.desc::after { content: " ↓"; color: var(--v2-azul-2); }
.v2-tabela td { padding: 7px 10px; border-bottom: 1px solid var(--v2-linha); vertical-align: top; }
.v2-tabela td:first-child { min-width: 120px; }
.v2-tabela td.largo { min-width: 240px; }
.v2-tabela td.nw, .v2-tabela th.nw { white-space: nowrap; }
.v2-tabela tr:last-child td { border-bottom: 0; }
.v2-tabela tr.alvo td { background: rgba(47, 123, 246, .08); }
.v2-tabela tr.morta td { color: var(--v2-muted); }
.v2-tabela td.n, .v2-tabela th.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.v2-vazio { color: var(--v2-muted); font-size: 12.5px; padding: 10px 2px; }
.v2-nota { color: var(--v2-muted-2); font-size: 11px; margin-top: 6px; }
.v2-tabela-rodape { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; }

/* linha do tempo */
.v2-tempo { list-style: none; margin: 0; padding: 0 0 0 14px; border-left: 2px solid var(--v2-linha); }
.v2-tempo li { position: relative; padding: 0 0 12px 12px; }
.v2-tempo li::before { content: ""; position: absolute; left: -20px; top: 4px; width: 10px; height: 10px; border-radius: 50%; background: var(--v2-azul);
  border: 2px solid var(--v2-bg); }
.v2-tempo li.alerta::before { background: var(--v2-alerta); } .v2-tempo li.neg::before { background: var(--v2-neg); }
.v2-tempo .q { font-size: 11.5px; color: var(--v2-muted); }
.v2-tempo .t { font-size: 13px; }

/* gráfico (SVG do servidor — quem_tem/graficos.py) com seletor de período */
.v2-grafico .v2-grafico-cab { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.v2-grafico .v2-grafico-cab h3 { margin: 0; }
.v2-periodos { display: inline-flex; gap: 2px; padding: 2px; border-radius: 8px; background: var(--v2-bg-2); border: 1px solid var(--v2-linha); margin-left: auto; }
.v2-periodos a, .v2-periodos span { font-size: 11.5px; padding: 3px 9px; border-radius: 6px; color: var(--v2-ink-2); }
.v2-periodos a:hover { text-decoration: none; background: var(--v2-card-2); }
.v2-periodos a.on { background: var(--v2-azul); color: #fff; }
.v2-periodos span.off { color: var(--v2-muted-2); cursor: not-allowed; }
.v2-legenda { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: var(--v2-ink-2); margin: 2px 0 6px; }
.v2-legenda i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: 0; }
body.v2 svg.qt-g { width: 100%; height: auto; display: block; }
body.v2 .qt-g-grade { stroke: var(--v2-linha); stroke-width: 1; }
body.v2 .qt-g-eixo { fill: var(--v2-muted); font-size: 10px; font-family: var(--v2-fonte); }
body.v2 .qt-g-valor { fill: var(--v2-ink-2); font-size: 10.5px; font-family: var(--v2-fonte); }
body.v2 .qt-g-rotulo { fill: var(--v2-ink-2); font-size: 11px; }
body.v2 polyline.qt-g-l0 { stroke: var(--v2-serie-1); stroke-width: 2; } body.v2 polyline.qt-g-l1 { stroke: var(--v2-serie-2); stroke-width: 1.6; }
body.v2 polyline.qt-g-l2 { stroke: var(--v2-serie-3); stroke-width: 1.6; } body.v2 polyline.qt-g-l3 { stroke: var(--v2-serie-4); stroke-width: 1.6; }
body.v2 .qt-g-l0-txt { fill: var(--v2-serie-1); } body.v2 .qt-g-l1-txt { fill: var(--v2-serie-2); }
body.v2 rect.qt-g-total { fill: var(--v2-linha-forte); } body.v2 rect.qt-g-parte, body.v2 rect.qt-g-s0 { fill: var(--v2-azul); }
body.v2 rect.qt-g-s1 { fill: var(--v2-serie-2); } body.v2 rect.qt-g-s2 { fill: var(--v2-serie-3); } body.v2 rect.qt-g-s3 { fill: var(--v2-serie-4); }
body.v2 rect.qt-g-barra { fill: var(--v2-azul); }
.v2-grafico details { margin-top: 6px; font-size: 12px; color: var(--v2-muted); }
.v2-resumo-serie { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 8px; }
.v2-resumo-serie div { background: var(--v2-bg-2); border: 1px solid var(--v2-linha); border-radius: 8px; padding: 8px 10px; }
.v2-resumo-serie small { display: block; color: var(--v2-muted); font-size: 11px; }
.v2-resumo-serie b { font-size: 15px; }

/* bloco "quem tem" */
.v2-qt-lista { list-style: none; margin: 0; padding: 0; }
.v2-qt-linha { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; min-width: 0; }
.v2-qt-linha .nome { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.v2-qt-linha .val { white-space: nowrap; }
.v2-quemtem .barra { height: 6px; border-radius: 3px; background: var(--v2-bg-2); overflow: hidden; margin-top: 3px; }
.v2-quemtem .barra i { display: block; height: 100%; background: var(--v2-azul); }

/* perspectiva do usuário (X1) e saídas */
.v2-persp-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 10px 14px; }
.v2-persp-card h3 { margin: 0; font-size: 13px; color: var(--v2-muted); font-weight: 500; }
.v2-perspectivas { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.v2-perspectivas a { display: inline-flex; gap: 7px; align-items: center; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--v2-linha);
  background: var(--v2-bg-2); color: var(--v2-ink-2); }
.v2-perspectivas a:hover { text-decoration: none; border-color: var(--v2-linha-forte); color: var(--v2-ink); }
.v2-perspectivas a.on { border-color: var(--v2-azul); background: var(--v2-azul-soft); color: var(--v2-ink); }
.v2-perspectivas b { display: inline; font-size: 12.5px; } .v2-perspectivas small { display: block; color: var(--v2-muted); font-size: 11.5px; }
.v2-saidas { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.v2-saidas a { display: flex; gap: 10px; align-items: flex-start; padding: 10px; border-radius: 9px; border: 1px solid var(--v2-linha); background: var(--v2-card);
  color: var(--v2-ink); font-size: 12.5px; }
.v2-saidas a:hover { text-decoration: none; border-color: var(--v2-linha-forte); }
.v2-saidas small { display: block; color: var(--v2-muted); font-size: 11px; }

/* página honesta "em construção" e avisos */
.v2-embreve { border: 1px dashed var(--v2-linha-forte); border-radius: var(--v2-raio); padding: 18px; background: var(--v2-painel); }
.v2-embreve h1 { margin: 0 0 6px; font-size: 20px; }
.v2-embreve ul { margin: 6px 0 0; padding-left: 18px; color: var(--v2-ink-2); }
.v2-embreve .dono { font-size: 11px; color: var(--v2-muted); text-transform: uppercase; letter-spacing: .6px; }
.v2-aviso { border: 1px solid rgba(242, 178, 60, .35); background: var(--v2-alerta-soft); color: #f6d48f; border-radius: 9px; padding: 8px 12px;
  font-size: 12.5px; margin: 0 0 12px; }
.v2-aviso.info { border-color: var(--v2-azul-borda); background: var(--v2-azul-soft); color: #cfe0ff; }
.v2-carregando { color: var(--v2-muted); font-size: 12.5px; padding: 18px 0; text-align: center; }
.v2-carregando::before { content: ""; display: inline-block; width: 12px; height: 12px; margin-right: 8px; border-radius: 50%; border: 2px solid var(--v2-linha-forte);
  border-top-color: var(--v2-azul); animation: v2gira 0.9s linear infinite; vertical-align: -2px; }
@keyframes v2gira { to { transform: rotate(360deg); } }
.v2-secao { margin-top: 18px; }

/* ------------------------------------------------------------------ responsivo */
@media (max-width: 1280px) {
  .v2-app { grid-template-columns: var(--v2-side) minmax(0, 1fr); }
  .v2-ia { position: fixed; right: 0; top: 0; bottom: 0; width: min(380px, 92vw); z-index: 70; box-shadow: var(--v2-sombra); transform: translateX(105%);
    transition: transform .18s ease; }
  body.v2.ia-aberto .v2-ia { transform: none; }
  .v2-ia-fechar { display: inline-flex; }
}
@media (max-width: 1024px) { .v2-grade.c5 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .v2-grade.lado { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 900px) {
  .v2-app { grid-template-columns: minmax(0, 1fr); }
  .v2-side { display: none; }
  .v2-topo { padding: 0 12px; }
  .v2-topo .v2-btn .tx { display: none; }
  .v2-busca kbd, .v2-topo-acoes .v2-so-desktop, .v2-so-desktop { display: none !important; }
  .v2-chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .v2-chip { white-space: nowrap; }
  .v2-cab-logo { width: 44px; height: 44px; }
  .v2-conteudo { padding: 12px 16px 86px; }
  .v2-nav-inferior { display: grid; grid-template-columns: repeat(4, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; height: 62px;
    background: rgba(10, 18, 34, .97); border-top: 1px solid var(--v2-linha); padding-bottom: env(safe-area-inset-bottom); }
  .v2-nav-inferior a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--v2-muted); font-size: 11px; }
  .v2-nav-inferior a.on { color: var(--v2-azul-2); }
  .v2-nav-inferior a:hover { text-decoration: none; }
  .v2-grade.c2, .v2-grade.c3 { grid-template-columns: minmax(0, 1fr); }   /* minmax(0,…): tabela larga rola dentro do card, nunca alarga a página */
  .v2-grade.c5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .v2-perspectivas { grid-template-columns: 1fr; }
  .v2-rodape { padding-bottom: 76px; }
  .v2-cab-tit h1 { font-size: 19px; }
  .v2-ia { width: 100vw; }
}
@media (max-width: 420px) { .v2-saidas { grid-template-columns: repeat(2, minmax(0, 1fr)); } .v2-kpi .v { font-size: 18px; } }

/* revisão do integrador (14/10): topo do celular como o design (logo à esquerda, avatar à direita), indicadores em 3 + 2 sem rolagem,
   cabeçalho que nunca alarga a página (chips e abas rolam dentro do próprio contêiner), tabelas densas que quebram o texto longo */
.v2-so-mobile { display: none !important; }
.v2-cab-tit { min-width: 0; }
.v2-cab-tit h1 { overflow-wrap: anywhere; }
.v2-abas, .v2-chips { max-width: 100%; min-width: 0; }
.v2-tabela td:not(.n):not(.nw) { max-width: 34ch; overflow-wrap: anywhere; }
@media (max-width: 900px) {
  .v2-so-mobile { display: inline-flex !important; }
  .v2-topo-logo { align-items: center; gap: 6px; color: var(--v2-ink); font-size: 15px; }
  .v2-topo-logo:hover { text-decoration: none; }
  .v2-topo-logo .v2-logo { width: 26px; height: 26px; border-radius: 7px; display: inline-flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--v2-azul), #1b4fb0); color: #fff; }
  .v2-topo-logo b { display: none; }
  .v2-grade.c5 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .v2-grade.c5 > :nth-child(-n+3) { grid-column: span 2; }
  .v2-grade.c5 > :nth-child(n+4) { grid-column: span 3; }
}
@media (min-width: 420px) and (max-width: 900px) { .v2-topo-logo b { display: inline; } }
.v2-selo { max-width: 100%; white-space: normal; }
@media (max-width: 900px) { .v2-tabela td .v2-selo { display: inline-block; } .v2-card, .v2-secao { min-width: 0; max-width: 100%; } }
/* KPI estreito (3 + 2 no celular): rótulo e selo quebram a linha em vez de passar da largura do card */
.v2-kpi { min-width: 0; overflow-wrap: anywhere; }
.v2-kpi .r { flex-wrap: wrap; min-width: 0; }
@media (max-width: 900px) { .v2-kpi .v2-selo { font-size: 8.5px; padding: 0 4px; letter-spacing: .2px; } }

/* ------------------------------------------------------------------ B04, B05, B08, B12, B18: menus, destaque IA, dicas toque e menu usuário */
.v2-ia.ia-destaque .iap-card, .v2-ia.ia-destaque { border-color: var(--v2-azul-2); box-shadow: 0 0 0 3px var(--v2-azul-soft), var(--v2-sombra);
  transition: box-shadow .2s ease, border-color .2s ease; }
.v2-cab-mais, .v2-usr-menu { position: relative; }
.v2-cab-mais summary, .v2-usr-menu summary { list-style: none; cursor: pointer; }
.v2-cab-mais summary::-webkit-details-marker, .v2-usr-menu summary::-webkit-details-marker { display: none; }
.v2-cab-mais .pop, .v2-usr-menu .pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 50; min-width: 230px; background: #04080f;
  border: 1px solid var(--v2-linha-forte); border-radius: 9px; padding: 6px; box-shadow: var(--v2-sombra); display: flex; flex-direction: column; gap: 2px; }
.v2-cab-mais .pop a, .v2-cab-mais .pop .v2-pop-btn, .v2-usr-menu .pop a { display: flex; align-items: center; gap: 8px; padding: 7px 9px; border-radius: 6px;
  color: var(--v2-ink-2); font: inherit; font-size: 12.5px; white-space: nowrap; background: none; border: 0; width: 100%; text-align: left; cursor: pointer; }
.v2-cab-mais .pop a:hover, .v2-cab-mais .pop .v2-pop-btn:hover, .v2-usr-menu .pop a:hover { background: var(--v2-card-2); color: var(--v2-ink); text-decoration: none; }
.v2-side .v2-usr-menu summary { display: flex; align-items: center; gap: 10px; width: 100%; border-radius: var(--v2-raio-p); padding: 4px; }
.v2-side .v2-usr-menu summary:hover { background: var(--v2-card); }
.v2-side .v2-usr-menu .v2-usr-txt { flex: 1; min-width: 0; }
.v2-side .v2-usr-menu .v2-usr-seta { color: var(--v2-muted); font-size: 11px; margin-left: auto; }
.v2-side .v2-usr-menu .pop { left: 0; right: 0; top: auto; bottom: calc(100% + 6px); min-width: 0; }
.v2-usr-meta { padding: 6px 9px; border-bottom: 1px solid var(--v2-linha); margin-bottom: 3px; color: var(--v2-muted); font-size: 11.5px; overflow-wrap: anywhere; }
.v2-usr-meta b { display: block; color: var(--v2-ink); font-size: 12.5px; }
.v2-usr-menu .pop a.v2-usr-sair { color: var(--v2-neg); border-top: 1px solid var(--v2-linha); margin-top: 3px; padding-top: 8px; }
details.mais[open], details.v2-ac-menu[open], details.iap-info[open], details.v2-usr-menu[open] { z-index: 55; }
.v2-dica[data-dica]:focus::after, .v2-dica.v2-dica-ativa[data-dica]::after { content: attr(data-dica); position: absolute; left: 8px; right: 8px; top: calc(100% + 6px);
  z-index: 45; background: #04080f; color: var(--v2-ink-2); border: 1px solid var(--v2-linha-forte); border-radius: 8px; padding: 8px 10px; font-size: 11.5px;
  font-weight: 400; line-height: 1.4; white-space: normal; box-shadow: var(--v2-sombra); }
.v2-dica-pop { position: absolute; z-index: 80; max-width: min(320px, 90vw); background: #04080f; color: var(--v2-ink-2); border: 1px solid var(--v2-linha-forte);
  border-radius: 8px; padding: 8px 10px; font-size: 11.5px; line-height: 1.4; box-shadow: var(--v2-sombra); pointer-events: none; }
.v2-periodos span.off.v2-dica { cursor: help; position: relative; }


/* Achabilidade (23/10): "Ver os N" de tabela cortada abre o resto ali mesmo (sem identidade nova: reaproveita .v2-btn) */
.v2-ver-todos { margin-top: 6px; }
.v2-ver-todos > summary { list-style: none; cursor: pointer; display: inline-flex; }
.v2-ver-todos > summary::-webkit-details-marker { display: none; }
.v2-ver-todos[open] > summary { margin-bottom: 6px; }
