/* Login: remove o painel decorativo da direita e centraliza tudo na tela toda */
.grid.min-h-svh.lg\:grid-cols-2 {
  grid-template-columns: 1fr !important;
}

.grid.min-h-svh.lg\:grid-cols-2 > div.relative.hidden.bg-muted {
  display: none !important;
}

.grid.min-h-svh.lg\:grid-cols-2 > div.flex.flex-col.gap-4 {
  align-items: center;
  justify-content: center;
}

.grid.min-h-svh.lg\:grid-cols-2 > div.flex.flex-col.gap-4 > div.flex.justify-center {
  justify-content: center !important;
}

/* Tabelas de resultado (cl.Dataframe) — visual mais compacto, tipo grid de
   BI, em vez do espaçamento largo padrão. Alinhamento por coluna é feito via
   JS em custom.js (o Python não tem como avisar o frontend qual coluna é
   numérica). */
.dataframe table th,
.dataframe table td {
  padding-top: 0.35rem !important;
  padding-bottom: 0.35rem !important;
  font-size: 0.83rem !important;
  white-space: nowrap;
}

/* Linha de Total (sempre a última, gerada em formatacao_tabela.py) em
   destaque — negrito + borda separando do resto, como um rodapé de grid. */
.dataframe table tbody tr:last-child {
  font-weight: 700;
  border-top: 2px solid hsl(var(--border, 0 0% 30%));
}

/* Barrinhas de uso (custom.js → #bia-limites), embaixo do histórico */
#bia-limites {
  margin: 8px 10px 10px;
  padding: 10px 12px;
  border: 1px solid hsl(var(--border));
  border-radius: 8px;
  font-size: 12px;
  color: hsl(var(--muted-foreground));
}
#bia-limites .bia-lim-titulo {
  margin: 6px 0 4px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
}
#bia-limites .bia-lim-titulo:first-child { margin-top: 0; }
#bia-limites .bia-lim-titulo small { font-weight: 400; text-transform: none; letter-spacing: 0; opacity: .7; }
#bia-limites .bia-lim-linha { display: grid; grid-template-columns: 38px 1fr 36px 52px; align-items: center; gap: 6px; margin: 3px 0; }
#bia-limites .bia-lim-trilho { height: 6px; border-radius: 3px; background: hsl(var(--muted)); overflow: hidden; }
#bia-limites .bia-lim-trilho span { display: block; height: 100%; border-radius: 3px; }
#bia-limites .bia-lim-pct { text-align: right; font-variant-numeric: tabular-nums; }
#bia-limites .bia-lim-renova { text-align: right; font-size: 11px; opacity: .7; font-variant-numeric: tabular-nums; }

/* Ícone da Bihand no botão "Paineis" (troca o ícone nativo) e no "Parar de usar o painel" (marcado pelo custom.js) */
#command-Paineis svg { display: none; }
#command-Paineis::before,
button[data-bia-painel]::after {
  content: "";
  display: inline-block;
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  background: url("BIHand.png?v=2") center / contain no-repeat; /* relativo ao custom.css: vale com o prefixo /<slug>/ do túnel */
}
/* "Parar de usar o painel": X vermelho antes, logo da Bihand depois da palavra "painel" */
button[data-bia-painel]::before { content: "✕"; color: #e5484d; font-weight: 700; margin-right: 6px; }
button[data-bia-painel]::after { width: 16px; height: 16px; margin-left: 6px; vertical-align: -3px; }

/* HTML da Bia aberto ao lado do chat (custom.js: abrirHtmlLateral) */
:root { --bia-html-w: clamp(420px, 60vw, 1200px); }
body.bia-html-largo { --bia-html-w: 82vw; }
#bia-html-painel { display: none; position: fixed; top: 0; right: 0; bottom: 0; width: var(--bia-html-w); z-index: 40;
  flex-direction: column; background: hsl(var(--background)); border-left: 1px solid hsl(var(--border)); box-shadow: -6px 0 24px rgba(0,0,0,.12); }
body.bia-html-aberto #bia-html-painel { display: flex; }
body.bia-html-aberto #root { width: calc(100vw - var(--bia-html-w)); }
#bia-html-painel header { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 12px;
  border-bottom: 1px solid hsl(var(--border)); font-size: 13px; }
#bia-html-painel header b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#bia-html-painel header span { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
#bia-html-painel header button, #bia-html-painel header a { cursor: pointer; border: 1px solid hsl(var(--border)); border-radius: 6px;
  background: transparent; color: hsl(var(--foreground)); padding: 2px 8px; font-size: 13px; text-decoration: none; line-height: 20px; }
#bia-html-painel header button:hover, #bia-html-painel header a:hover { background: hsl(var(--accent)); }
#bia-html-painel iframe { flex: 1; width: 100%; border: 0; background: #fff; }
@media (max-width: 767px) { body.bia-html-aberto #root { width: 100vw; } #bia-html-painel { width: 100vw; } }
