/* =========================================================================
   AnotAI 2 · ponte com o financeiro.css (só na base_2.html)
   As telas continuam com as classes fin-* (testes e partials compartilhados
   com as telas que ainda usam a base.html). Aqui os tokens --fx-* passam a
   valer os --ax-* e os componentes fin-* ganham o desenho do visual novo.
   Ordem: financeiro.css → anotai-2.css → este arquivo.
   ========================================================================= */

:root {
  --fx-ink: var(--ax-ink);
  --fx-muted: var(--ax-muted);
  --fx-bg: var(--ax-bg);
  --fx-surface: var(--ax-surface);
  --fx-surface-2: var(--ax-surface-2);
  --fx-border: var(--ax-line-2);
  --fx-border-soft: var(--ax-line);

  --fx-primary: var(--ax-primary);   --fx-primary-hover: var(--ax-primary-600); --fx-primary-soft: var(--ax-primary-soft); --fx-primary-strong: var(--ax-primary-700);
  --fx-success: var(--ax-receita);   --fx-success-hover: var(--ax-receita-ink); --fx-success-soft: var(--ax-receita-soft); --fx-success-strong: var(--ax-receita-ink);
  --fx-danger: var(--ax-despesa);    --fx-danger-hover: var(--ax-despesa-ink);  --fx-danger-soft: var(--ax-despesa-soft);  --fx-danger-strong: var(--ax-despesa-ink);
  --fx-warning: var(--ax-aviso);     --fx-warning-hover: var(--ax-aviso-ink);   --fx-warning-soft: var(--ax-aviso-soft);   --fx-warning-strong: var(--ax-aviso-ink);
  --fx-info: var(--ax-info);         --fx-info-hover: var(--ax-info-ink);       --fx-info-soft: var(--ax-info-soft);       --fx-info-strong: var(--ax-info-ink);
  --fx-secondary: var(--ax-muted);   --fx-secondary-hover: var(--ax-ink-2);     --fx-secondary-soft: var(--ax-surface-3);  --fx-secondary-strong: var(--ax-ink-2);

  --fx-radius: var(--ax-r);
  --fx-radius-sm: var(--ax-r-sm);
  --fx-shadow-sm: var(--ax-shadow-sm);
  --fx-shadow: var(--ax-shadow);
  --fx-nav-h: var(--ax-top-h);
  --fx-ease: var(--ax-ease);
}

/* ===== Botões: sem o "pulo" e a altura fixa do tema antigo ===== */
.ax-body .btn { min-height: 0; }
.ax-body .btn:not(:disabled):hover, .ax-body .btn:not(:disabled):active { transform: none; }
.ax-body .btn-sm { font-size: var(--bs-btn-font-size); }
.ax-body :is(.btn-primary, .btn-success, .btn-danger, .btn-warning, .btn-info, .btn-secondary) { box-shadow: var(--ax-shadow-xs); }
.ax-body :is(.btn-warning, .btn-info, .btn-secondary):not(:disabled):hover { box-shadow: 0 4px 12px -6px rgba(15, 29, 46, 0.35); }
.ax-body [class*="btn-outline-"] { --bs-btn-border-width: 1px; }

/* ===== Menus: os itens ricos do base.html no tamanho do visual novo ===== */
.ax-body .dropdown-item,
.ax-body .dropdown-item strong,
.ax-body .fin-menu-rico strong,
.ax-body .ax-menu-rico strong,
.ax-body .ax-side-link,
.ax-body .ax-side-link.ativo,
.ax-body .ax-conta-texto strong,
.ax-body .fin-navbar .nav-link,
.ax-body .fin-fab-menu .dropdown-item,
.ax-body .ax-baixo-opcao { font-weight: 500; }
.ax-body .dropdown-item i { font-size: calc(1.05rem * var(--ax-fs, 1)); }
.ax-body .dropdown-header { color: var(--ax-subtle); }
.ax-body .fin-menu-titulo { padding: 0.45rem 0.65rem 0.2rem; font-size: calc(0.7rem * var(--ax-fs, 1)); letter-spacing: 0.08em; color: var(--ax-subtle); }
.ax-body .fin-menu-rico { min-width: 18.5rem; }
.ax-body .fin-menu-rico .dropdown-item { gap: 0.6rem; padding-block: 0.45rem; padding-inline: calc(var(--bs-dropdown-item-padding-x, 1rem) + 1.5px); }
.ax-body .fin-menu-rico .fin-item-icon { width: 1.6rem; height: 1.6rem; margin-top: 0.05rem; border-radius: 7px; font-size: calc(0.85rem * var(--ax-fs, 1)); transition: transform 0.15s var(--ax-ease); }
.ax-body .fin-menu-rico .fin-item-icon i { font-size: inherit; }
.ax-body .fin-menu-rico .dropdown-item:hover .fin-item-icon { transform: scale(1.06); }
.ax-body .fin-menu-rico strong { color: var(--ax-ink); }
.ax-body .fin-menu-rico span.d-block { font-size: calc(0.8rem * var(--ax-fs, 1)); }
.ax-body .fin-conta-menu { min-width: 17rem; }
@media (max-width: 575.98px) { .ax-body .fin-menu-rico { min-width: min(18.5rem, calc(100vw - 2rem)); } }

/* ===== Lateral: menus que abrem ao lado (computador) ou embaixo, na gaveta (celular) ===== */
.ax-side .dropdown-toggle::after { display: none; }
.ax-side .ax-side-link.dropdown-toggle { cursor: pointer; }
.ax-side .ax-side-link.show { background: var(--ax-surface-3); color: var(--ax-ink); }
.ax-side .ax-side-link.show .ax-side-caret { rotate: 90deg; }
.ax-side .fin-nav-badge { margin-left: auto; }
.ax-side .fin-nav-badge + .ax-side-caret { margin-left: 0.35rem; }
.ax-side .ax-side-modulos .fin-nav-badge + .fin-caret { margin-left: 0.35rem; }
.ax-side .ax-side-lista > li { min-width: 0; }
/* menus de outros apps (pedidos/_menu.html): mesmo desenho dos itens da lateral */
.ax-side .ax-side-modulos .nav-item { list-style: none; }
.ax-side .ax-side-modulos .ax-side-link > i:first-child { margin-right: 0; }
.ax-side .ax-side-modulos .ax-side-link .fin-caret { margin-left: auto; font-size: calc(0.75rem * var(--ax-fs, 1)); color: var(--ax-subtle); rotate: -90deg; transition: rotate var(--ax-dur) var(--ax-ease); }
.ax-side .ax-side-modulos .ax-side-link.show .fin-caret { rotate: 0deg; }
.ax-side-conta { margin-bottom: 0.25rem; }
.ax-side-conta .ax-conta-seta { margin-left: auto; color: var(--ax-subtle); }
.ax-side-conta .badge { flex: 0 0 auto; }
@media (min-width: 992px) {
  .ax-side .ax-side-lista .dropdown-menu { max-height: calc(100vh - 1rem); overflow-y: auto; }
  .ax-mini .ax-side .ax-side-modulos .ax-side-link { font-size: 0; gap: 0; justify-content: center; padding-inline: 0; }
  /* o seletor de conta também ganha .ax-side-link pelo JS: mantém o ícone da conta à mostra */
  .ax-mini .ax-conta > .ax-conta-icone { display: inline-flex !important; }
  .ax-mini .ax-side .ax-side-modulos .ax-side-link > i:first-child { font-size: calc(1.1rem * var(--ax-fs, 1)); }
  .ax-mini .ax-side .ax-side-modulos .fin-caret, .ax-mini .ax-conta-seta { display: none !important; }
  /* o badge de rascunhos continua à vista no menu recolhido: um contador pequeno no canto do ícone */
  .ax-mini .ax-side .ax-side-link { position: relative; }
  .ax-mini .ax-side .ax-side-link .fin-nav-badge {
    display: inline-flex !important; position: absolute; top: 0.1rem; right: 0.45rem; margin: 0;
    min-width: 1.15rem; padding: 0.2em 0.35em; font-size: calc(0.62rem * var(--ax-fs, 1)); align-items: center; justify-content: center;
  }
}
@media (max-width: 991.98px) {
  .ax-side .ax-side-scroll .dropdown-menu {
    position: static !important; inset: auto !important; transform: none !important;
    width: 100%; min-width: 0; margin: 0.15rem 0 0.5rem; box-shadow: none; animation: none;
    border: 1px solid var(--ax-line); background: var(--ax-surface-2);
  }
  .ax-side .ax-side-scroll .fin-menu-colunas { display: block; }
}

/* ===== Barra de cima ===== */
.ax-top .ax-brand { display: inline-flex; align-items: center; gap: 0.6rem; color: var(--ax-ink); }
.ax-avatar .fin-ponto-aviso { top: 0; right: 0; }

/* ===== Botões flutuantes (voltar ao topo, Loja): acima da barra de baixo no celular ===== */
.ax-body .fin-fab-pilha { right: 1rem; bottom: calc(1rem + env(safe-area-inset-bottom)); }
@media (max-width: 991.98px) {
  .ax-body:has(.ax-baixo) .fin-fab-pilha { bottom: calc(var(--ax-baixo-h) + 1rem + env(safe-area-inset-bottom)); }
  /* "Ações (N)" das listas: na mesma linha da pilha, acima da barra de baixo */
  .ax-body:has(.ax-baixo) .fin-massa-ir { bottom: calc(var(--ax-baixo-h) + 1rem + env(safe-area-inset-bottom)); }
}
.ax-body .fin-fab { border-radius: 16px; box-shadow: var(--ax-shadow-lg); }
.ax-body .fin-fab.fin-fab-secundario, .ax-body .fin-fab.fin-fab-topo { background: var(--ax-surface); color: var(--ax-ink-2); border: 1px solid var(--ax-line-2); }
.ax-body .fin-fab-menu { border-radius: var(--ax-r); }

/* ===== Cabeçalho da página ===== */
.ax-body .fin-page-head { align-items: flex-end; gap: 1rem 1.5rem; margin-bottom: 1.75rem; }
.ax-body .fin-page-head h1 { font-size: calc(clamp(1.6rem, 1.2rem + 1.2vw, 2.15rem) * var(--ax-fs, 1)); font-weight: 650; letter-spacing: -0.035em; line-height: 1.1; }
.ax-body .fin-page-head p { margin-top: 0.45rem; max-width: 60ch; }
.ax-body .fin-eyebrow { display: inline-flex; align-items: center; gap: 0.45rem; font-size: calc(0.78rem * var(--ax-fs, 1)); font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--ax-muted); margin-bottom: 0.4rem; }
.ax-body .fin-eyebrow::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--ax-primary); box-shadow: 0 0 0 3px var(--ax-primary-soft); }
.ax-body .fin-head-actions { gap: 0.5rem; align-items: center; }
@media (max-width: 575.98px) {
  .ax-body .fin-head-actions { width: 100%; flex-direction: column; align-items: stretch; }
  .ax-body .fin-head-actions > *, .ax-body .fin-head-actions > * > .btn, .ax-body .fin-head-actions > .dropdown > .btn { width: 100%; }
  .ax-body .fin-head-actions > .btn-primary, .ax-body .fin-head-actions > form:has(.btn-primary) { order: -1; }
}

.ax-body .fin-secao-head { border-bottom-color: var(--ax-line); }
.ax-body .fin-secao-titulo { font-size: calc(1.05rem * var(--ax-fs, 1)); font-weight: 600; letter-spacing: -0.02em; }
.ax-body .fin-secao-titulo i { color: var(--ax-primary); }

/* ===== Cartões de total ===== */
.ax-body .fin-kpi {
  padding: 1.1rem 1.2rem 1rem; border: 1px solid var(--ax-line); border-radius: var(--ax-r-lg); box-shadow: var(--ax-shadow-sm);
  transition: border-color 0.2s, box-shadow 0.25s var(--ax-ease), translate 0.25s var(--ax-ease);
}
.ax-body .fin-kpi::before { display: none; }
.ax-body .fin-kpi:hover { transform: none; translate: 0 -2px; border-color: var(--ax-line-2); box-shadow: var(--ax-shadow); }
.ax-body .fin-kpi-icon { width: 2.25rem; height: 2.25rem; border-radius: 10px; font-size: calc(1.05rem * var(--ax-fs, 1)); }
.ax-body .fin-kpi:hover .fin-kpi-icon { transform: scale(1.06); }
.ax-body .fin-kpi-label { font-size: calc(0.86rem * var(--ax-fs, 1)); font-weight: 500; color: var(--ax-muted); }
.ax-body .fin-kpi-sub, .ax-body .fin-kpi-bruto { font-size: calc(0.8rem * var(--ax-fs, 1)); color: var(--ax-subtle); }
.ax-body .fin-kpi-value { margin-top: 0.6rem; font-size: calc(clamp(1.4rem, 1.15rem + 0.7vw, 1.75rem) * var(--ax-fs, 1)); font-weight: 650; letter-spacing: -0.035em; }
.ax-body .fin-kpi-destaque .fin-kpi-value { font-size: calc(clamp(1.8rem, 1.4rem + 1.2vw, 2.4rem) * var(--ax-fs, 1)); }
.ax-body .fin-painel .fin-kpi-value { font-weight: 650; }

/* ===== Painéis ===== */
.ax-body .fin-panel { border: 1px solid var(--ax-line); border-radius: var(--ax-r-lg); box-shadow: var(--ax-shadow-sm); }
.ax-body .fin-panel-head { padding: 0.9rem 1.25rem; background: transparent; border-bottom: 1px solid var(--ax-line); border-radius: var(--ax-r-lg) var(--ax-r-lg) 0 0; }
.ax-body .fin-panel-head h2, .ax-body .fin-panel-head h1 { font-size: calc(1rem * var(--ax-fs, 1)); letter-spacing: -0.015em; }
.ax-body .fin-panel-head p { font-size: calc(0.84rem * var(--ax-fs, 1)); }
.ax-body .fin-panel-head .btn { font-size: calc(0.84rem * var(--ax-fs, 1)); }
.ax-body .fin-panel > :last-child { border-bottom-left-radius: var(--ax-r-lg); border-bottom-right-radius: var(--ax-r-lg); }
.ax-body .fin-panel .list-group-flush > .list-group-item:hover { background: var(--ax-surface-2); box-shadow: none; }
@media (max-width: 575.98px) {
  .ax-body .fin-panel-head { flex-direction: column; align-items: stretch; }
  .ax-body .fin-panel-head > .btn, .ax-body .fin-panel-head > .dropdown > .btn, .ax-body .fin-panel-head > form .btn { width: 100%; }
}

/* ===== Tabelas ===== */
.ax-body .fin-table-wrap { padding: 0; }
.ax-body table.fin-table { font-size: calc(0.92rem * var(--ax-fs, 1)); --bs-table-hover-bg: var(--ax-surface-2); }
.ax-body table.fin-table thead th {
  background: var(--ax-surface-2); color: var(--ax-subtle); font-size: calc(0.74rem * var(--ax-fs, 1)); letter-spacing: 0.06em;
  border-bottom: 1px solid var(--ax-line); padding: 0.65rem 1rem;
}
.ax-body table.fin-table tbody td { padding: 0.75rem 1rem; border-bottom-color: var(--ax-line); }
.ax-body table.fin-table tbody tr:hover > td { background: var(--ax-surface-2); }
.ax-body table.fin-table tbody tr:hover > td:first-child { box-shadow: none; }
.ax-body table.fin-table .fin-col-acoes { padding-inline: 0.25rem 0.75rem; }
.ax-body .fin-row-actions { width: 2rem; height: 2rem; font-size: calc(1.1rem * var(--ax-fs, 1)); color: var(--ax-muted); border-radius: 8px; }
.ax-body .fin-row-actions:hover, .ax-body .fin-row-actions.show { color: var(--ax-ink); background: var(--ax-surface-3); }
.ax-body .fin-money { font-weight: 600; }
.ax-body .badge { font-size: calc(0.76rem * var(--ax-fs, 1)); font-weight: 500; }

/* selos fin-pill (situacao_parcela, situacao_lancamento, Ativa/Inativa) no desenho do ax-status: fundo suave, texto escuro, ícone */
.ax-body .badge.fin-pill {
  --s-soft: var(--ax-surface-3); --s-ink: var(--ax-muted);
  display: inline-flex; align-items: center; gap: 0.1rem; padding: 0.2rem 0.6rem; border-radius: 99px;
  background: var(--s-soft) !important; color: var(--s-ink) !important; border: 0; box-shadow: none; white-space: nowrap;
}
.ax-body .badge.fin-pill.text-bg-success { --s-soft: var(--ax-receita-soft); --s-ink: var(--ax-receita-ink); }
.ax-body .badge.fin-pill.text-bg-info { --s-soft: var(--ax-info-soft); --s-ink: var(--ax-info-ink); }
.ax-body .badge.fin-pill.text-bg-warning { --s-soft: var(--ax-aviso-soft); --s-ink: var(--ax-aviso-ink); }
.ax-body .badge.fin-pill.text-bg-danger { --s-soft: var(--ax-perigo-soft); --s-ink: var(--ax-perigo-ink); }
.ax-body .badge.fin-pill.text-bg-primary { --s-soft: var(--ax-primary-soft); --s-ink: var(--ax-primary-700); }
.ax-body .badge.fin-pill.text-bg-light, .ax-body .badge.fin-pill.text-bg-secondary { --s-soft: var(--ax-surface-3); --s-ink: var(--ax-muted); }
.ax-body .fin-situacao-detalhe { color: var(--ax-subtle); }

/* ===== Lista no visual 2 (card com barra de filtro, chips, tabela ax-tabela e rodapé) ===== */
.ax-filtros-fim { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; flex: 1 1 260px; justify-content: flex-end; }
.ax-filtros-fim .ax-busca-campo { margin: 0; }
.ax-filtros .fin-filtro .btn { height: 36px; display: inline-flex; align-items: center; gap: 0.35rem; font-size: calc(0.875rem * var(--ax-fs, 1)); padding-block: 0; }
.ax-filtros-ativos { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; padding: 0.6rem 1.25rem; border-bottom: 1px solid var(--ax-line); }
.ax-filtro-ativo a { color: inherit; width: 18px; height: 18px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: calc(0.7rem * var(--ax-fs, 1)); text-decoration: none; }
.ax-filtro-ativo a:hover { background: rgba(34, 100, 143, 0.15); color: inherit; }
.ax-tabela tbody tr.fin-linha-selecionada { background: var(--ax-primary-tint); }
.ax-tabela tbody tr.fin-linha-selecionada > td:first-child { box-shadow: inset 3px 0 0 var(--ax-primary); }
.ax-tabela .ax-col-sel .form-check-input { cursor: pointer; }
.ax-tabela .fin-trunca { max-width: 32ch; }
.ax-tabela .fin-situacao { flex-direction: column; align-items: flex-start; gap: 0.1rem; }
.ax-tabela .fin-situacao-parcela .badge { min-width: 0; }
.ax-tabela .fin-situacao-detalhe { font-size: calc(0.76rem * var(--ax-fs, 1)); padding-left: 0.6rem; }
@media (min-width: 768px) { .ax-tabela td[data-celula="titulo"] { min-width: 15rem; } }
.ax-card > .fin-massa-barra, .ax-card [data-massa] > .fin-massa-barra { margin: 0; border-radius: 0; border: 0; border-top: 1px solid var(--ax-line); background: var(--ax-surface-2); }
.ax-card > .ax-vazio:last-child { border-bottom-left-radius: var(--ax-r-lg); border-bottom-right-radius: var(--ax-r-lg); }
.ax-card .ax-card-foot .pagination { flex-wrap: wrap; }
@media (max-width: 767.98px) {
  /* cartões sem a caixa de marcar (leitor): título e situação na 1ª coluna, valor e ações na 2ª */
  .ax-tabela-cartoes tbody tr:not(:has(> td.ax-col-sel)) { grid-template-columns: minmax(0, 1fr) auto; }
  .ax-tabela-cartoes tbody tr:not(:has(> td.ax-col-sel)) > td[data-celula="titulo"],
  .ax-tabela-cartoes tbody tr:not(:has(> td.ax-col-sel)) > td[data-celula="status"] { grid-column: 1; }
  .ax-tabela-cartoes tbody tr:not(:has(> td.ax-col-sel)) > td[data-celula="valor"],
  .ax-tabela-cartoes tbody tr:not(:has(> td.ax-col-sel)) > td[data-celula="acoes"] { grid-column: 2; }
  .ax-tabela-cartoes tbody td.ax-col-sel { grid-row: 1 / span 2; padding-top: 0.2rem; }
  .ax-tabela-cartoes tbody td[data-celula="status"] .fin-situacao-detalhe { display: none; }
}
@media (max-width: 575.98px) {
  .ax-filtros { padding: 0.75rem 1rem; }
  .ax-filtros > .ax-seg { width: 100%; flex-wrap: wrap; overflow: visible; }
  .ax-filtros > .ax-seg > a { flex: 1 1 auto; text-align: center; }
  .ax-filtros-fim, .ax-filtros-fim .ax-busca-campo { max-width: none; width: 100%; }
  .ax-filtros-fim .fin-filtro, .ax-filtros-fim .fin-filtro .btn { width: 100%; justify-content: center; }
  .ax-card-foot { flex-direction: column; }
  .ax-vazio .btn { width: 100%; }
}

/* ===== Ficha no visual 2 ===== */
.ax-ficha .ax-eyebrow .ax-tipo { width: 22px; height: 22px; border-radius: 6px; font-size: calc(0.7rem * var(--ax-fs, 1)); }
.ax-ficha-valor .ax-anel { flex-shrink: 0; }
.ax-ficha-valor .ax-ficha-numeros { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; margin-top: 0.5rem; font-size: calc(0.875rem * var(--ax-fs, 1)); }
.ax-chip.ax-chip-info { background: var(--ax-info-soft); color: var(--ax-info-ink); border-color: transparent; }
.ax-chip.ax-chip-primaria { background: var(--ax-primary-soft); color: var(--ax-primary-700); border-color: transparent; }
.ax-chip.ax-chip-receita { background: var(--ax-receita-soft); color: var(--ax-receita-ink); border-color: transparent; }
.ax-chip.ax-chip-despesa { background: var(--ax-despesa-soft); color: var(--ax-despesa-ink); border-color: transparent; }
a.ax-chip { text-decoration: none; }
a.ax-chip:hover { filter: brightness(0.97); color: inherit; }
.ax-ficha-kpis { margin-bottom: 1rem; }
.ax-ficha-kpis .ax-kpi { padding-block: 1rem; }
.ax-ficha-kpis .ax-kpi-valor { font-size: calc(1.3rem * var(--ax-fs, 1)); }
.ax-tempo-valor .dropdown-menu { min-width: 14rem; }
.ax-tempo .fin-situacao-parcela .badge { min-width: 0; }
.ax-tempo-texto a:hover { color: var(--ax-primary) !important; }
.ax-ficha .ax-eyebrow a { color: inherit; text-decoration: underline; text-decoration-color: var(--ax-line-2); text-underline-offset: 3px; }
.ax-ficha .ax-ficha-tags .badge.fin-pill { font-size: calc(0.78rem * var(--ax-fs, 1)); }
/* painel */
.ax-kpis-compactos .ax-kpi-valor { font-size: calc(1.4rem * var(--ax-fs, 1)); }
.ax-donut.ax-donut-sm { height: 170px; }
.ax-donut-sm .ax-donut-centro strong { font-size: calc(1rem * var(--ax-fs, 1)); }
.ax-faixa > a.text-reset { flex: 1; min-width: 0; text-decoration: none; }
.ax-faixa + .ax-faixa { margin-top: -0.5rem; }
.ax-head-secao { margin-bottom: 1rem; align-items: center; }
.ax-head-secao .ax-eyebrow { font-size: calc(0.95rem * var(--ax-fs, 1)); }
.ax-lista-item > .bi-chevron-right { flex-shrink: 0; }
a.ax-rank-nome:hover .d-block { color: var(--ax-primary); }
@media (max-width: 575.98px) { .ax-kpis-compactos .ax-kpi-valor { font-size: calc(1.1rem * var(--ax-fs, 1)); } }
.ax-fatura-nav { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; padding: 0.6rem 0.75rem; }
.ax-fatura-nav .fin-menu-faturas { max-height: 60vh; overflow-y: auto; }
@media (max-width: 575.98px) {
  .ax-ficha-valor { flex-wrap: wrap; }
  .ax-tempo > li { grid-template-columns: 28px 1fr; }
  .ax-tempo-valor { grid-column: 2; justify-content: flex-start; }
  .ax-tempo-valor .ax-linha-acoes { margin-left: auto; }
}

.ax-body .fin-empty { padding: 3rem 1.5rem; }
.ax-body .fin-empty-icon { width: 3.5rem; height: 3.5rem; border-radius: 16px; font-size: calc(1.5rem * var(--ax-fs, 1)); }
.ax-body .fin-empty strong { font-size: calc(1.05rem * var(--ax-fs, 1)); }
@media (max-width: 575.98px) { .ax-body .fin-empty .btn { width: 100%; } }

/* listas dentro de painéis */
.ax-body .fin-list-item:hover { background: var(--ax-surface-2); }
.ax-body .fin-list-item small { font-size: calc(0.82rem * var(--ax-fs, 1)); color: var(--ax-subtle); }

/* ===== Ficha (detalhe): cabeçalho vira o cartão da ficha do visual novo ===== */
.ax-body .fin-ficha-head {
  position: relative; overflow: visible; gap: 1.25rem 2rem; align-items: center;
  padding: 1.5rem; margin-bottom: 1.5rem;
  --faixa: var(--ax-primary);
  background: linear-gradient(90deg, var(--faixa), transparent 80%) top / 100% 3px no-repeat, var(--ax-surface);
  border: 1px solid var(--ax-line); border-radius: var(--ax-r-lg); box-shadow: var(--ax-shadow-sm);
}
.ax-body .fin-tipo-receita .fin-ficha-head, .ax-body .fin-ficha-head.fin-tipo-receita { --faixa: var(--ax-receita); }
.ax-body .fin-tipo-despesa .fin-ficha-head, .ax-body .fin-ficha-head.fin-tipo-despesa { --faixa: var(--ax-despesa); }
@media (min-width: 992px) { .ax-body .fin-ficha-head { padding: 1.75rem 2rem; } }
.ax-body .fin-ficha-head h1 { font-size: calc(clamp(1.45rem, 1.1rem + 1vw, 1.9rem) * var(--ax-fs, 1)); font-weight: 650; letter-spacing: -0.035em; margin-bottom: 0.75rem; }
.ax-body .fin-ficha-tags { gap: 0.4rem; }
@media (max-width: 575.98px) {
  .ax-body .fin-ficha-head { padding: 1.25rem; }
  .ax-body .fin-ficha-head > div:last-child:not(:first-child) { width: 100%; }
}

/* faixa de totais e lista de dados */
.ax-body .fin-resumo > div { padding: 1rem 1.25rem; border-color: var(--ax-line); }
.ax-body .fin-resumo dt { font-size: calc(0.72rem * var(--ax-fs, 1)); color: var(--ax-subtle); letter-spacing: 0.06em; }
.ax-body .fin-resumo dd { font-size: calc(1.2rem * var(--ax-fs, 1)); font-weight: 650; letter-spacing: -0.03em; }
.ax-body .fin-dl > div { border-bottom: 1px dashed var(--ax-line-2); font-size: calc(0.92rem * var(--ax-fs, 1)); }
.ax-body .fin-dl dt { font-weight: 400; }
.ax-body .fin-dl dd { font-weight: 500; }
.ax-body .fin-extrato th, .ax-body .fin-extrato td { border-bottom-color: var(--ax-line); }
.ax-body .fin-extrato .fin-total th, .ax-body .fin-extrato .fin-total td { border-top: 1px solid var(--ax-line-2); font-size: calc(1.1rem * var(--ax-fs, 1)); font-weight: 650; }
.ax-body .fin-situacoes li { border-bottom-color: var(--ax-line); }
.ax-body .fin-segmentos a { border-radius: 99px; height: 0.55rem; }

/* ===== Formulários ===== */
.ax-body .form-label { font-weight: 500; }
.ax-body .form-control, .ax-body .form-select { min-height: 2.6rem; border-width: 1px; font-size: calc(0.94rem * var(--ax-fs, 1)); }
.ax-body textarea.form-control { min-height: 6.5rem; }
.ax-body .fin-editor-visual { min-height: 22rem; max-height: 40rem; }
.ax-body .fin-editor-wrap textarea.form-control { height: auto; min-height: 22rem; }
.ax-body .form-control[type="file"]::file-selector-button { background-color: var(--ax-surface-3); }
.ax-body .select2-container--bootstrap-5 .select2-selection {
  min-height: 2.6rem; font-size: calc(0.94rem * var(--ax-fs, 1)); border: 1px solid var(--ax-line-2); border-radius: var(--ax-r-sm); box-shadow: var(--ax-shadow-xs);
}
.ax-body .select2-container--bootstrap-5.select2-container--focus .select2-selection,
.ax-body .select2-container--bootstrap-5.select2-container--open .select2-selection { border-color: var(--ax-primary); box-shadow: var(--ax-ring); }
.ax-body .select2-container--bootstrap-5 .select2-dropdown { border-color: var(--ax-line-2); border-radius: var(--ax-r-sm); box-shadow: var(--ax-shadow-lg); }
.ax-body .fin-form-head-icon { border-radius: 10px; }
.ax-body .fin-form-acoes { border-top-color: var(--ax-line); gap: 0.5rem; }
.ax-body .fin-filtros-form .form-label { font-size: calc(0.84rem * var(--ax-fs, 1)); }

/* ===== Avisos dentro da página ===== */
.ax-body .alert { border-radius: var(--ax-r); border-color: transparent; font-size: calc(0.92rem * var(--ax-fs, 1)); }
.ax-body .fin-alert { box-shadow: var(--ax-shadow-sm); }

/* o visual novo não usa a animação de entrada do tema antigo (ela cobria os menus abertos) */
.ax-body .fin-container > * { animation: none; }

/* ===== Tabelas sem rolagem para o lado =====
   Os níveis das colunas (d-lg-, d-xl-) contam a largura da janela, mas com a lateral aberta a tabela
   fica ~290px mais estreita. Então, com a lateral aberta, as colunas lg e xl entram um nível depois,
   e o que sumiu vai para a linha de apoio do título (.ax-sub-lg / .ax-sub-xl). */
.ax-sub-lg, .ax-sub-xl { display: none; }
@media (max-width: 1199.98px) { .ax-sub-xl { display: inline; } }
@media (max-width: 991.98px) { .ax-sub-lg { display: inline; } }
@media (min-width: 992px) and (max-width: 1199.98px) {
  html:not(.ax-mini) .ax-tabela .d-lg-table-cell, html:not(.ax-mini) .ax-tabela .d-xl-table-cell { display: none !important; }
  html:not(.ax-mini) .ax-sub-lg { display: inline; }
}
@media (min-width: 1200px) and (max-width: 1399.98px) {
  html:not(.ax-mini) .ax-tabela .d-xl-table-cell { display: none !important; }
  html:not(.ax-mini) .ax-sub-xl { display: inline; }
}
.ax-tabela tbody td, .ax-tabela thead th, .ax-tabela tfoot td, .ax-tabela tfoot th { padding-inline: 0.8rem; }
@media (min-width: 768px) { .ax-tabela td[data-celula="titulo"] { min-width: 12rem; } }

/* listas em card (list-group): fundo branco, como o resto do card */
.ax-card .list-group-flush > .list-group-item { background: var(--ax-surface); border-color: var(--ax-line); padding: 0.7rem 1.25rem; color: var(--ax-ink); }
.ax-card .list-group-flush > .list-group-item:hover { background: var(--ax-surface-2); }

.ax-ficha > .min-w-0 { min-width: 0; }
.ax-ficha-valor { min-width: 0; }
.ax-top-migalha .atual { display: inline-block; max-width: min(40ch, 45vw); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
.ax-celula-titulo > .min-w-0 { flex: 1 1 auto; }

/* O amarelo do visual 2 é um âmbar escuro (--ax-aviso): texto e ícone escuros sobre ele quase somem, então o cheio leva texto claro.
   O fundo fica um pouco mais fechado para o branco passar de 4,5:1 (leitura); o hover usa o âmbar mais escuro. */
.ax-body .btn-warning { --k: #966a0b; --kt: #fff; }
.ax-body .fin-form-head-icon.pagar { background: #966a0b; color: #fff; }

/* relatórios: variação e nota do KPI (relatorios/_kpi.html) */
.ax-kpi-delta { display: inline-flex; align-items: center; font-size: calc(0.82rem * var(--ax-fs, 1)); font-weight: 550; font-variant-numeric: tabular-nums; margin-top: 0.15rem; }
.ax-kpi-delta .bi { font-size: 1.1em; margin-left: -0.15rem; }
.ax-kpi-nota { display: block; margin-top: 0.15rem; font-size: calc(0.8rem * var(--ax-fs, 1)); color: var(--ax-subtle); overflow-wrap: anywhere; }
/* relatórios no celular: cards em duas colunas sem estourar o valor */
@media (max-width: 575.98px) {
  .fin-relatorio-kpis .ax-kpi { padding: 0.85rem; gap: 0.35rem; }
  .fin-relatorio-kpis .ax-kpi-top { font-size: calc(0.85rem * var(--ax-fs, 1)); gap: 0.4rem; }
  .fin-relatorio-kpis .ax-kpi-valor { font-size: calc(1.15rem * var(--ax-fs, 1)); overflow-wrap: anywhere; }
  .fin-relatorio-kpis .ax-kpi-rodape { font-size: calc(0.76rem * var(--ax-fs, 1)); }
}
/* variação que o celular não mostra como coluna: vai sob o nome (relatorios) */
.fin-var-mobile { font-size: calc(0.78rem * var(--ax-fs, 1)); font-variant-numeric: tabular-nums; }
@media (min-width: 768px) { .fin-var-mobile { display: none; } }
.ax-kpi-hero .ax-kpi-delta, .ax-kpi-hero .ax-kpi-nota { color: rgba(255, 255, 255, 0.85) !important; }
.ax-kpi-hero .ax-kpi-valor { color: #fff !important; }

/* matrizes de relatório: sombra nas bordas indica que há mais colunas para o lado */
.ax-tabela-wrap:has(.fin-tabela-matriz) {
  background:
    linear-gradient(to right, var(--ax-surface) 30%, transparent) left center / 24px 100% no-repeat local,
    linear-gradient(to left, var(--ax-surface) 30%, transparent) right center / 24px 100% no-repeat local,
    linear-gradient(to right, rgba(20, 40, 60, 0.14), transparent) left center / 10px 100% no-repeat scroll,
    linear-gradient(to left, rgba(20, 40, 60, 0.14), transparent) right center / 10px 100% no-repeat scroll;
}

/* impressão dos relatórios: só o conteúdo, sem menus nem botões */
@media print {
  .ax-side, .ax-top, .ax-baixo, .fin-fab-pilha, .ax-head-acoes, .ax-filtros-ativos, .ax-seg, .fin-filtro,
  .ax-seta, #ax-cmd, nav[aria-label="Período"], nav[aria-label="Links do rodapé"], .btn { display: none !important; }
  .ax-shell, .ax-content { display: block !important; margin: 0 !important; padding: 0 !important; width: auto !important; }
  body { background: #fff !important; }
  .ax-card, .ax-kpi { box-shadow: none !important; border: 1px solid #c9d1da !important; break-inside: avoid; translate: none !important; }
  .ax-kpi-hero { background: #fff !important; color: #000 !important; }
  .ax-kpi-hero .ax-kpi-top, .ax-kpi-hero .ax-kpi-rodape, .ax-kpi-hero .ax-kpi-valor,
  .ax-kpi-hero .ax-kpi-delta, .ax-kpi-hero .ax-kpi-nota { color: #000 !important; }
  .ax-tabela-wrap { overflow: visible !important; background: none !important; }
  table.fin-tabela-matriz th, table.fin-tabela-matriz td { white-space: normal; position: static !important; }
  .fin-chart { height: 240px; }
  a { color: inherit !important; text-decoration: none !important; }
}

/* relatórios no celular: ícones do cabeçalho lado a lado, valor sem quebrar o sinal e rodapé em até 2 linhas */
@media (max-width: 575.98px) {
  .ax-head-acoes.fin-acoes-icones { flex-direction: row; align-items: center; }
  .ax-head-acoes.fin-acoes-icones > .btn { width: auto; flex: 0 0 auto; }
  .fin-relatorio-kpis .ax-kpi-num { white-space: nowrap; }
  .fin-relatorio-kpis .ax-kpi-valor { font-size: calc(1.05rem * var(--ax-fs, 1)); overflow-wrap: normal; }
  .fin-relatorio-kpis .ax-kpi-rodape { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
}
.fin-lista-quebra { white-space: normal !important; overflow: visible !important; text-overflow: clip !important; }

/* listas e fichas no celular: ação principal na largura toda e as demais lado a lado; KPIs deslizam em vez de empilhar */
@media (max-width: 575.98px) {
  .ax-head-acoes.ax-acoes-linha, .ax-ficha-acoes.ax-acoes-linha { flex-direction: row; flex-wrap: wrap; align-items: stretch; }
  .ax-acoes-linha > .btn-primary, .ax-acoes-linha > .dropdown:has(> .btn-primary) { flex: 1 1 100%; }
  .ax-acoes-linha > .btn:not(.btn-primary), .ax-acoes-linha > .dropdown:not(:has(> .btn-primary)), .ax-acoes-linha > form { flex: 1 1 auto; width: auto; }
  .ax-acoes-linha > .btn:not(.btn-primary), .ax-acoes-linha > .dropdown:not(:has(> .btn-primary)) > .btn { width: auto; justify-content: center; }
  .ax-kpis { display: flex; gap: 0.75rem; overflow-x: auto; scroll-snap-type: x mandatory; margin-inline: -1rem; padding: 0.25rem 1rem 0.5rem; scrollbar-width: none; }
  .ax-kpis { scroll-padding-inline: 1rem; }
  .ax-kpis::-webkit-scrollbar { display: none; }
  .ax-kpis > .ax-kpi { flex: 0 0 78%; scroll-snap-align: start; }
  .ax-kpis > .ax-kpi:only-child { flex-basis: 100%; }
}

/* ficha no celular: o valor (o que a pessoa veio ver) sobe para antes dos botões */
@media (max-width: 575.98px) {
  .ax-ficha:has(> .ax-ficha-valor) > :first-child { display: contents; }
  .ax-ficha:has(> .ax-ficha-valor) > .ax-ficha-valor { order: 4; }
  .ax-ficha:has(> .ax-ficha-valor) .ax-ficha-acoes { order: 5; margin-top: 0; }
  .ax-ficha:has(> .ax-ficha-valor) .ax-ficha-valor { padding-top: 0.25rem; }
}
@media (max-width: 575.98px) {
  .ax-ficha:has(> .ax-ficha-valor) { gap: 0.6rem; padding: 1.25rem; }
  .ax-ficha:has(> .ax-ficha-valor) h1 { margin-bottom: 0.25rem; }
  .ax-ficha-valor { gap: 0.75rem; }
  .ax-ficha-valor .ax-anel { width: 72px; height: 72px; }
  .ax-ficha-valor .ax-anel span { font-size: calc(0.9rem * var(--ax-fs, 1)); }
  .ax-ficha-valor > div:not(.ax-anel) { flex: 1 1 10rem; min-width: 0; }
  .ax-ficha-valor .valor { font-size: calc(1.6rem * var(--ax-fs, 1)); }
}

/* tabela em cartões (celular): a linha acompanha a largura do card em vez da do conteúdo, e o título corta com reticências */
@media (max-width: 767.98px) {
  .ax-tabela-cartoes, .ax-tabela-cartoes tbody { display: block; width: 100%; }
  .ax-tabela-cartoes tbody td[data-celula="titulo"] { overflow: hidden; }
}
@media (max-width: 767.98px) {
  .ax-tabela-cartoes td[data-celula="titulo"] .fin-trunca { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
@media (max-width: 767.98px) {
  /* tabela comum no celular: o nome longo corta antes de empurrar a coluna de ações para fora */
  .ax-tabela:not(.ax-tabela-cartoes) .fin-trunca { max-width: min(32ch, calc(100vw - 9.5rem)); }
}
@media (max-width: 575.98px) {
  /* botão só de ícone (ajuda) não cresce para preencher a linha */
  .ax-acoes-linha > .btn:has(> .visually-hidden:last-child):not(.btn-primary) { flex: 0 0 auto; }
}
