/*
 * Tokens do redesign (design_handoff_controle_financeiro/README.md).
 * Os nomes antigos (--paper, --ink-2, --accent...) continuam existindo
 * como alias das cores novas mais próximas semanticamente, pra tudo que
 * já usa var(--accent) etc. inline nos templates herdar a paleta nova
 * sem precisar reescrever cada arquivo. Só o vocabulário novo (--brand,
 * --field, --muted...) é usado nas telas refeitas pixel a pixel.
 *
 * O handoff é hi-fi só em modo claro — nenhuma cor de modo escuro é
 * especificada, então o modo escuro foi removido em vez de inventado.
 */
:root {
  --bg: #EEF1F4;
  --surface: #FFFFFF;
  --surface-2: #F7F9FA;
  --field: #F0F3F5;
  --border: #E2E7EC;
  --ink: #0F1720;
  --ink-2: #3B4754;
  --muted: #6B7683;
  --muted-2: #94A0AD;
  --track: #D5DBE1;
  --brand: #6036F9;
  --brand-hover: #4C2AD1;
  --brand-soft: #EEE9FE;
  --brand-deep: #2A1466;
  --mint: #9B7CFC;
  --salmon: #FFB199;
  --danger: #FF5C38;
  --danger-soft: #FFE8E1;
  --warn: #B45309;
  --warn-soft: #FDF0DF;

  /* aliases — nomes antigos usados em vários templates */
  --paper: var(--bg);
  --ink-3: var(--muted);
  --line: var(--border);
  --accent: var(--brand);
  --accent-hover: var(--brand-hover);
  --accent-ink: #FFFFFF;
  --accent-soft: var(--brand-soft);

  --radius: 12px;
  --shadow: 0 1px 2px rgba(15, 23, 32, .05);
}

* {
  box-sizing: border-box;
}

/* Garante que o atributo hidden vença qualquer display:flex/grid de
   classe (ex.: .lanc-acoes, .sheet-overlay) — sem isso, um elemento com
   hidden + uma classe que define display continua visível, porque a
   regra [hidden] do navegador tem prioridade mais baixa que uma classe
   de autor com a mesma especificidade. */
[hidden] {
  display: none !important;
}

/* Safari/iOS dá zoom automático ao focar um campo com font-size menor
   que 16px — vários campos do redesign usam tamanhos do handoff
   (13.5–15px) que disparam isso. Corrige só no mobile (no desktop o
   zoom não acontece, então preserva o tamanho exato do design lá).
   Os campos que já são grandes de propósito (valor do lançamento,
   código de verificação) são reafirmados abaixo — !important entre
   duas regras "!important" ainda respeita especificidade normal, então
   precisam ficar aqui pra continuar vencendo a regra genérica acima. */
@media (max-width: 899px) {
  input,
  select,
  textarea {
    font-size: 16px !important;
  }

  .campo.codigo input {
    font-size: 22px !important;
  }

  .campo-valor input {
    font-size: 38px !important;
  }

  .nl-valor-input {
    font-size: 44px !important;
  }
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  padding-bottom: env(safe-area-inset-bottom);
}

a {
  color: var(--accent);
}

h1, h2, h3 {
  line-height: 1.2;
  margin: 0 0 .5em;
}

p {
  margin: 0 0 1em;
}

/* --- Layout de autenticação: card único centralizado --- */

.tela-auth {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px calc(24px + env(safe-area-inset-bottom));
}

.cartao-auth {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px 24px;
}

.cartao-auth .marca {
  font-size: 13px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 6px;
}

.cartao-auth h1 {
  font-size: 22px;
}

.cartao-auth .subtitulo {
  color: var(--ink-2);
  font-size: 14.5px;
  margin-bottom: 22px;
}

/* --- Formulário --- */

.campo {
  margin-bottom: 16px;
}

.campo label {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-2);
  margin-bottom: 6px;
}

.campo input,
.campo select {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  font-size: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font-family: inherit;
}

.campo select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%236B7683' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 18px;
  padding-right: 38px;
}

.campo input:focus-visible,
.campo select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.campo .ajuda {
  font-size: 12.5px;
  color: var(--ink-3);
  margin-top: 6px;
}

.campo.codigo input {
  font-variant-numeric: tabular-nums;
  letter-spacing: .3em;
  text-align: center;
  font-size: 22px;
}

.botao {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 48px;
  padding: 12px 18px;
  font-size: 16px;
  font-weight: 600;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  background: var(--accent);
  color: var(--accent-ink);
  text-decoration: none;
}

.botao:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.botao.secundario {
  background: transparent;
  color: var(--ink-2);
  border: 1px solid var(--line);
}

.botao.perigo {
  background: var(--danger);
}

.links-auxiliares {
  margin-top: 18px;
  text-align: center;
  font-size: 14px;
  color: var(--ink-2);
}

.alerta {
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 18px;
}

.alerta.erro {
  background: var(--danger-soft);
  color: var(--danger);
}

.alerta.aviso {
  background: var(--warn-soft);
  color: var(--warn);
}

/* --- QR / setup TOTP --- */

.qr-container {
  background: #fff;
  border-radius: 8px;
  padding: 16px;
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}

.qr-container svg {
  width: 200px;
  height: 200px;
}

.segredo-manual {
  font-family: ui-monospace, "SF Mono", monospace;
  font-size: 13px;
  background: var(--accent-soft);
  color: var(--ink);
  padding: 10px 12px;
  border-radius: 6px;
  word-break: break-all;
  margin-bottom: 18px;
}

/* --- Códigos de recuperação --- */

.grade-codigos {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 20px;
}

.grade-codigos code {
  display: block;
  text-align: center;
  padding: 10px;
  background: var(--accent-soft);
  border-radius: 6px;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}

/* --- Área logada --- */

/* --- Casca: sidebar (desktop) / bottom bar + FAB (mobile) --- */

.shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  display: none;
}

.sidebar-marca {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 10px 24px;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.sidebar-logo {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--brand);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 15px;
  flex: none;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
}

.sidebar-item:hover {
  background: #E9EEF1;
}

.sidebar-item.ativo {
  background: var(--brand-soft);
  color: var(--brand);
}

.sidebar-item-icone {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  flex: none;
}

.sidebar-novo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  border-radius: 12px;
  background: var(--brand);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
}

.sidebar-novo:hover {
  background: var(--brand-hover);
  color: #fff;
}

.sidebar-rodape {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 10px 0;
  font-size: 12.5px;
  color: var(--muted);
}

.sidebar-rodape a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
}

.sidebar-rodape a:hover {
  color: var(--ink);
}

.sidebar-sair {
  background: none;
  border: 0;
  padding: 0;
  color: var(--muted);
  font-size: 12.5px;
  cursor: pointer;
  font-family: inherit;
}

.sidebar-sair:hover {
  color: var(--ink);
}

.conteudo {
  flex: 1;
  min-width: 0;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 0 16px calc(120px + env(safe-area-inset-bottom));
}

@media (min-width: 900px) {
  .sidebar {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 248px;
    flex: none;
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 28px 16px;
    border-right: 1px solid var(--border);
    background: var(--surface-2);
  }

  .conteudo {
    padding: 24px 16px calc(48px + env(safe-area-inset-bottom));
  }

  .tabbar,
  .fab {
    display: none !important;
  }
}

.cartao {
  background: var(--surface);
  border-radius: 18px;
  padding: 16px;
  margin-bottom: 10px;
  box-shadow: var(--shadow);
}

.cartao h2 {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.cartao h2 {
  font-size: 16px;
}

.lista-sessoes {
  list-style: none;
  margin: 0;
  padding: 0;
}

.lista-sessoes li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--field);
}

.lista-sessoes li:first-child {
  border-top: none;
}

.lista-sessoes .icone-aparelho {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--field);
  color: var(--ink-2);
  display: grid;
  place-items: center;
  flex: none;
}

.lista-sessoes .info {
  flex: 1;
  min-width: 0;
  font-size: 12px;
  color: var(--muted);
}

.lista-sessoes .info strong {
  display: block;
  color: var(--ink);
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 2px;
}

.pill-atual {
  font-size: 11px;
  font-weight: 700;
  color: var(--brand);
  background: var(--brand-soft);
  padding: 4px 8px;
  border-radius: 999px;
  flex: none;
}

/* --- Menu "Mais" --- */

.menu-lista {
  background: var(--surface);
  border-radius: 18px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 15px 16px;
  border: 0;
  border-bottom: 1px solid var(--field);
  background: var(--surface);
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  text-align: left;
  cursor: pointer;
}

.menu-lista > *:last-child .menu-item,
.menu-lista > .menu-item:last-child {
  border-bottom: 0;
}

.menu-item:hover {
  background: var(--surface-2);
}

.menu-item.perigo {
  color: var(--danger);
}

.menu-item-icone {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  flex: none;
}

.menu-item-label {
  flex: 1;
}

.menu-item-chevron {
  color: var(--muted-2);
  flex: none;
}

.botao-link {
  background: none;
  border: none;
  color: var(--danger);
  font-size: 13.5px;
  cursor: pointer;
  padding: 6px;
  min-height: 44px;
}

/* --- Navegação inferior (mobile) --- */

.tabbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  padding: 6px 8px calc(8px + env(safe-area-inset-bottom));
  z-index: 20;
}

.tabbar a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px 0 4px;
  min-height: 48px;
  color: var(--muted);
  text-decoration: none;
  font-size: 10.5px;
  font-weight: 600;
}

.tabbar-pill {
  width: 44px;
  height: 26px;
  border-radius: 13px;
  display: grid;
  place-items: center;
}

.tabbar a.ativo {
  color: var(--brand);
}

.tabbar a.ativo .tabbar-pill {
  background: var(--brand-soft);
}

.fab {
  position: fixed;
  right: 18px;
  bottom: calc(86px + env(safe-area-inset-bottom));
  width: 56px;
  height: 56px;
  border-radius: 18px;
  background: var(--brand);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  box-shadow: 0 10px 24px rgba(14, 124, 91, .35);
  z-index: 21;
}

.fab:hover {
  background: var(--brand-hover);
  color: #fff;
}

/* --- Chips de categoria --- */

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 6px;
}

.chip {
  display: inline-flex;
}

.chip input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.chip label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-2);
  font-size: 14px;
  cursor: pointer;
  min-height: 40px;
}

.chip input:checked + label {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--ink);
  font-weight: 600;
}

.chip input:focus-visible + label {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

/* Chip "botão" (categoria-pai que abre subcategorias) e "voltar", nesse
   segundo estilo de chip (páginas de edição sem sheet). */
.chip-botao {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-2);
  font-size: 14px;
  cursor: pointer;
  min-height: 40px;
  font-family: inherit;
}

.chip-voltar {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 9px 4px;
  border: 0;
  background: none;
  color: var(--ink-3);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

.link-mais-categorias {
  display: inline-block;
  font-size: 13.5px;
  color: var(--ink-2);
  margin: 4px 0 16px;
}

/* --- Segmented control (tipo entrada/saída) --- */

.segmentado {
  display: flex;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 18px;
}

.segmentado a {
  flex: 1;
  text-align: center;
  padding: 11px 8px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  color: var(--ink-2);
  background: var(--surface);
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.segmentado a.ativo.saida {
  background: var(--danger-soft);
  color: var(--danger);
}

.segmentado a.ativo.entrada {
  background: var(--accent-soft);
  color: var(--accent);
}

/* --- Campo de valor grande, estilo calculadora --- */

.campo-valor {
  margin-bottom: 18px;
}

.campo-valor label {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-2);
  margin-bottom: 8px;
  text-align: center;
}

.campo-valor .prefixo-input {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.campo-valor .prefixo-input span {
  font-size: 22px;
  color: var(--ink-3);
}

.campo-valor input {
  border: none;
  background: none;
  font-size: 38px;
  font-weight: 700;
  text-align: center;
  width: 100%;
  max-width: 220px;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.campo-valor input:focus-visible {
  outline: none;
}

/* --- Extrato --- */

.filtros {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin-bottom: 16px;
}

.filtros select,
.filtros input[type="text"] {
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font-size: 13.5px;
  flex: none;
}

.lista-lancamentos {
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.lista-lancamentos li {
  border-top: 1px solid var(--line);
}

.lista-lancamentos li:first-child {
  border-top: none;
}

.linha-lancamento {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  text-decoration: none;
  color: var(--ink);
}

.linha-lancamento .icone-categoria {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  background: var(--accent-soft);
  flex: none;
}

.linha-lancamento .detalhe {
  flex: 1;
  min-width: 0;
}

.linha-lancamento .detalhe strong {
  display: block;
  font-size: 14.5px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.linha-lancamento .detalhe span {
  display: block;
  font-size: 12.5px;
  color: var(--ink-3);
  margin-top: 2px;
}

.linha-lancamento .valor {
  flex: none;
  font-size: 14.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.linha-lancamento .valor.positivo {
  color: var(--accent);
}

.linha-lancamento .valor.negativo {
  color: var(--danger);
}

.acoes-lancamento {
  display: flex;
  gap: 4px;
  padding: 0 14px 12px 64px;
}

.acoes-lancamento a,
.acoes-lancamento button {
  font-size: 12.5px;
  color: var(--ink-3);
  background: none;
  border: none;
  padding: 6px 8px;
  min-height: 32px;
  cursor: pointer;
  text-decoration: none;
}

.acoes-lancamento .perigo {
  color: var(--danger);
}

.paginacao {
  display: flex;
  justify-content: center;
  gap: 12px;
  font-size: 13.5px;
  margin-bottom: 20px;
}

/* --- Lista de contas / categorias --- */

.lista-itens {
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.lista-itens > li {
  border-top: 1px solid var(--line);
}

.lista-itens > li:first-child {
  border-top: none;
}

.linha-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
}

.linha-item .icone {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
  flex: none;
  background: var(--accent-soft);
}

.linha-item .detalhe {
  flex: 1;
  min-width: 0;
}

.linha-item .detalhe strong {
  display: block;
  font-size: 14.5px;
  font-weight: 600;
}

.linha-item .detalhe span {
  display: block;
  font-size: 12.5px;
  color: var(--ink-3);
  margin-top: 2px;
}

.linha-item .saldo {
  font-size: 14.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.linha-item.arquivada {
  opacity: .55;
}

.subcategoria {
  padding-left: 30px !important;
}

.anexo-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.anexo-preview .item {
  position: relative;
  width: 72px;
  height: 72px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--line);
}

.anexo-preview .item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.anexo-preview .item.pdf {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  background: var(--accent-soft);
}

.anexo-preview form {
  position: absolute;
  top: 2px;
  right: 2px;
  margin: 0;
}

.anexo-preview button {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(0, 0, 0, .55);
  color: #fff;
  border: none;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
}

.campo-arquivo {
  margin-bottom: 18px;
}

.campo-arquivo label.botao-arquivo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 16px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--ink-2);
  font-size: 14px;
  cursor: pointer;
  min-height: 44px;
}

.campo-arquivo input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}

/* --- Relatórios --- */

.pills-nav {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
  margin-bottom: 16px;
}

.pills-nav a {
  flex: none;
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 13px;
  text-decoration: none;
  white-space: nowrap;
}

.pills-nav a.ativo {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
}

.navegacao-periodo {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.navegacao-periodo a {
  color: var(--ink-2);
  text-decoration: none;
  font-size: 20px;
  padding: 4px 10px;
}

.navegacao-periodo h2 {
  font-size: 16px;
  margin: 0;
  text-align: center;
}

.navegacao-periodo .rotulo-hoje {
  display: block;
  font-size: 11px;
  color: var(--accent);
  font-weight: 600;
  margin-top: 2px;
}

.resumo-painel {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 12px;
}

.resumo-painel-rotulo {
  display: block;
  font-size: 11.5px;
  color: var(--ink-3);
  margin-bottom: 3px;
}

.resumo-painel-valor {
  display: block;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

.resumo-painel-valor.positivo {
  color: var(--accent);
}

.resumo-painel-valor.negativo {
  color: var(--danger);
}

.barra-categoria {
  margin-bottom: 14px;
}

.barra-categoria:last-child {
  margin-bottom: 0;
}

.barra-categoria-cabecalho {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  font-size: 13.5px;
  gap: 8px;
}

.barra-categoria-cabecalho .nome {
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.barra-categoria-cabecalho .valor {
  flex: none;
  font-variant-numeric: tabular-nums;
  color: var(--ink-2);
}

.barra-categoria-trilha {
  height: 7px;
  border-radius: 4px;
  background: var(--paper);
  border: 1px solid var(--line);
  overflow: hidden;
  margin-top: 5px;
}

.barra-categoria-preenchimento {
  height: 100%;
  border-radius: 4px;
}

.grafico-barras {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 140px;
  padding-top: 8px;
  margin-bottom: 8px;
}

.grafico-barras-coluna {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
}

.grafico-barras-trilha {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 2px;
}

.grafico-barras-barra {
  flex: 1;
  max-width: 14px;
  min-height: 2px;
  border-radius: 3px 3px 0 0;
}

.grafico-barras-legenda {
  font-size: 10px;
  color: var(--ink-3);
  margin-top: 6px;
  white-space: nowrap;
}

.legenda-series {
  display: flex;
  gap: 16px;
  font-size: 12.5px;
  color: var(--ink-2);
  margin-bottom: 14px;
}

.legenda-series .marcador {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 2px;
  margin-right: 5px;
}

.lista-eventos-fluxo {
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.lista-eventos-fluxo li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-top: 1px solid var(--line);
}

.lista-eventos-fluxo li:first-child {
  border-top: none;
}

.lista-eventos-fluxo .icone-evento {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex: none;
  background: var(--accent-soft);
}

.lista-eventos-fluxo .detalhe {
  flex: 1;
  min-width: 0;
}

.lista-eventos-fluxo .detalhe strong {
  display: block;
  font-size: 14px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lista-eventos-fluxo .detalhe span {
  display: block;
  font-size: 12px;
  color: var(--ink-3);
  margin-top: 2px;
}

.lista-eventos-fluxo .valores {
  text-align: right;
  flex: none;
}

.lista-eventos-fluxo .valores .valor {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.lista-eventos-fluxo .valores .saldo {
  display: block;
  font-size: 11px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
  margin-top: 2px;
}

.estado-vazio {
  padding: 24px 14px;
  text-align: center;
  color: var(--ink-3);
  font-size: 13.5px;
}

/* --- Orçamento --- */

.linha-orcamento {
  display: flex;
  gap: 12px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.linha-orcamento:first-child {
  border-top: none;
}

.linha-orcamento.subcategoria {
  padding-left: 30px;
}

.linha-orcamento .icone-categoria {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex: none;
  margin-top: 2px;
}

.detalhe-orcamento {
  flex: 1;
  min-width: 0;
}

.detalhe-orcamento > strong {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
}

.campo-orcamento-valor {
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 10px;
  background: var(--paper);
  max-width: 180px;
}

.campo-orcamento-valor span {
  color: var(--ink-3);
  font-size: 13px;
}

.campo-orcamento-valor input {
  border: none;
  background: none;
  font-size: 14px;
  width: 100%;
  outline: none;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  min-height: 22px;
}

.legenda-orcamento {
  display: block;
  font-size: 12px;
  color: var(--ink-3);
  margin-top: 7px;
}

.legenda-orcamento.estourado {
  color: var(--danger);
  font-weight: 600;
}

/* --- Início: header, botões redondos, atalhos --- */

.botao-redondo {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 0;
  background: var(--surface);
  box-shadow: var(--shadow);
  cursor: pointer;
  display: grid;
  place-items: center;
  color: var(--ink);
  text-decoration: none;
}

.botao-redondo .icone-ocultar {
  display: none;
}

.botao-redondo.ativo {
  background: var(--ink);
  color: #fff;
}

.botao-redondo.ativo .icone-mostrar {
  display: none;
}

.botao-redondo.ativo .icone-ocultar {
  display: block;
}

.somente-mobile {
  display: grid;
}

@media (min-width: 900px) {
  .somente-mobile {
    display: none !important;
  }
}

.botao-mes-escuro {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 0;
  background: rgba(255, 255, 255, .1);
  color: #fff;
  cursor: pointer;
  display: grid;
  place-items: center;
  text-decoration: none;
}

.botao-mes-escuro:hover {
  background: rgba(255, 255, 255, .18);
  color: #fff;
}

.atalho {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 14px 6px 12px;
  border-radius: 16px;
  border: 0;
  background: var(--surface);
  cursor: pointer;
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  text-align: center;
  box-shadow: var(--shadow);
}

.atalho:hover {
  background: var(--surface-2);
}

.atalho-icone {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--brand-soft);
  color: var(--brand);
  display: grid;
  place-items: center;
}

/* --- Lançamentos (redesign): cabeçalho, busca, segmentador, chips --- */

.lanc-cabecalho {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--bg);
  padding: 22px 0 12px;
  margin: 0 -16px;
  padding-left: 16px;
  padding-right: 16px;
}

.lanc-cabecalho-linha1 {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.lanc-cabecalho-acoes {
  display: flex;
  gap: 8px;
}

.lanc-form {
  margin: 0;
}

.lanc-controles {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
}

.lanc-busca {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border-radius: 12px;
  padding: 0 14px;
  height: 42px;
  box-shadow: var(--shadow);
  min-width: 0;
}

.lanc-busca svg {
  flex: none;
  color: var(--muted);
}

.lanc-busca input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: none;
  font-size: 14px;
  color: var(--ink);
  font-family: inherit;
}

.lanc-segmentado {
  display: flex;
  flex: none;
  background: var(--surface);
  border-radius: 12px;
  padding: 3px;
  box-shadow: var(--shadow);
}

.lanc-segmentado button,
.lanc-segmentado a {
  height: 36px;
  padding: 0 12px;
  border: 0;
  border-radius: 9px;
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 600;
  font-family: inherit;
  background: transparent;
  color: var(--muted);
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lanc-segmentado button.ativo,
.lanc-segmentado a.ativo {
  background: var(--ink);
  color: #fff;
}

.lanc-chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin: 10px -16px 0;
  padding: 0 16px 2px;
}

.lanc-chip-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  flex: none;
  height: 32px;
  padding: 0 30px 0 12px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: 1px solid var(--border);
  background-color: var(--surface);
  color: var(--ink-2);
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236B7683' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 12px;
  max-width: 160px;
  text-overflow: ellipsis;
}

.lanc-chip-select.ativo {
  background-color: var(--ink);
  border-color: var(--ink);
  color: #fff;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
}

.lanc-chip-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
  height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: 1px solid var(--border);
  background-color: var(--surface);
  color: var(--ink-2);
  white-space: nowrap;
}

.lanc-chip-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.lanc-chip-toggle.ativo {
  background-color: var(--danger);
  border-color: var(--danger);
  color: #fff;
}

.lanc-resumo {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 4px 6px;
  font-size: 12.5px;
  color: var(--muted);
}

.lanc-resumo b {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.lanc-grupo {
  margin-top: 12px;
}

.lanc-grupo-cabecalho {
  display: flex;
  justify-content: space-between;
  padding: 0 4px 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .04em;
}

.lanc-grupo-cabecalho span:last-child {
  font-variant-numeric: tabular-nums;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 600;
}

.lanc-grupo-card {
  background: var(--surface);
  border-radius: 18px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.lanc-item {
  border-bottom: 1px solid var(--field);
}

.lanc-item:last-child {
  border-bottom: 0;
}

/* Categorias agrupa categoria+subcategorias num bloco arrastável
   ([data-bloco-categoria]) — sem isso, :last-child acima tira a borda
   do último item de CADA bloco (a categoria de cima "cola" na de
   baixo) em vez de só do último item da lista inteira. */
[data-bloco-categoria] .lanc-item:last-child {
  border-bottom: 1px solid var(--field);
}

[data-bloco-categoria]:last-child .lanc-item:last-child {
  border-bottom: 0;
}

[data-bloco-categoria].arrastando {
  opacity: .85;
  box-shadow: 0 4px 14px rgba(15, 23, 32, .12);
  position: relative;
  z-index: 5;
  background: var(--surface);
}

.lanc-linha {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  border: 0;
  background: var(--surface);
  cursor: pointer;
  text-align: left;
  color: var(--ink);
  font-family: inherit;
}

.lanc-item.aberto .lanc-linha {
  background: var(--surface-2);
}

[data-chevron] {
  display: inline-flex;
  transition: transform .15s;
}

.lanc-item.aberto [data-chevron] {
  transform: rotate(180deg);
}

.lanc-linha:hover {
  background: var(--surface-2);
}

.lanc-avatar {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 14px;
  flex: none;
}

.lanc-linha-titulo {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14.5px;
  font-weight: 600;
}

.lanc-linha-titulo span:first-child {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lanc-badge-parcela {
  flex: none;
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--field);
  color: var(--muted);
}

.lanc-linha-meta {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.lanc-conta-cor {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  flex: none;
}

.lanc-valor {
  font-size: 15px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  flex: none;
}

.lanc-acoes {
  display: flex;
  gap: 8px;
  padding: 0 16px 14px 68px;
  animation: fadeIn .15s ease;
}

.lanc-acoes form {
  margin: 0;
}

.lanc-acoes-botao {
  height: 34px;
  padding: 0 14px;
  border-radius: 9px;
  border: 0;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
}

.lanc-acoes-editar {
  background: var(--brand-soft);
  color: var(--brand);
}

.lanc-acoes-duplicar {
  background: var(--field);
  color: var(--ink-2);
}

.lanc-acoes-excluir {
  background: var(--danger-soft);
  color: var(--danger);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* --- Sheet (overlay + painel) — genérico, reusado por Nova conta e,
   futuramente, por Novo lançamento --- */

@keyframes sheetUp {
  from { transform: translateY(24px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.sheet-overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(15, 23, 32, .45);
  animation: fadeIn .2s ease;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.sheet-painel {
  width: 100%;
  max-width: 520px;
  background: var(--surface);
  border-radius: 24px 24px 0 0;
  padding: 14px 20px calc(24px + env(safe-area-inset-bottom));
  animation: sheetUp .25s ease;
  max-height: 92vh;
  overflow-y: auto;
}

.sheet-handle {
  width: 40px;
  height: 4px;
  border-radius: 2px;
  background: var(--border);
  margin: 0 auto 14px;
}

.sheet-titulo {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin-bottom: 16px;
}

/* --- Contas: resumo, sheet "Nova conta" --- */

.resumo-patrimonio {
  background: var(--surface);
  border-radius: 22px;
  padding: 18px 20px;
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.resumo-patrimonio-rotulo {
  font-size: 12.5px;
  color: var(--muted);
  font-weight: 500;
}

.resumo-patrimonio-valor {
  font-size: clamp(17px, 6vw, 26px);
  font-weight: 800;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  margin-top: 2px;
  white-space: nowrap;
}

.resumo-patrimonio-cartoes {
  border-left: 1px solid var(--field);
  padding-left: 14px;
}

.resumo-patrimonio-cartoes .resumo-patrimonio-valor {
  font-size: clamp(15px, 5vw, 20px);
  color: var(--danger);
}

.badge-conta {
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--warn-soft);
  color: var(--warn);
  flex: none;
}

.af-linha-avatar {
  display: flex;
  align-items: center;
  gap: 14px;
}

.af-avatar {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 20px;
  flex: none;
  transition: background .2s;
}

.af-input-nome {
  flex: 1;
  height: 46px;
  border: 0;
  border-radius: 12px;
  background: var(--field);
  padding: 0 14px;
  font-size: 14.5px;
  outline: 0;
  color: var(--ink);
  font-family: inherit;
}

.af-rotulo {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
  margin: 16px 0 8px;
}

.af-tipos {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.af-tipo {
  height: 44px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 600;
  font-family: inherit;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.af-tipo.ativo {
  border-color: var(--brand);
  background: var(--brand-soft);
}

.af-cores {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.af-cor {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 0;
  cursor: pointer;
  display: grid;
  place-items: center;
  color: #fff;
}

.af-campo-valor {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 46px;
  border-radius: 12px;
  background: var(--field);
  padding: 0 14px;
}

.af-campo-valor span {
  font-size: 14px;
  font-weight: 700;
  color: var(--muted);
}

.af-campo-valor input {
  flex: 1;
  border: 0;
  background: none;
  outline: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  font-family: inherit;
}

.af-ajuda {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 6px;
}

.af-cartao-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
  animation: fadeIn .15s ease;
}

.af-cartao-campo {
  height: 46px;
  border-radius: 12px;
  background: var(--field);
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13.5px;
}

.af-cartao-campo span {
  color: var(--muted);
}

.af-cartao-campo input {
  border: 0;
  background: none;
  outline: 0;
  width: 40px;
  text-align: right;
  font-weight: 700;
  font-size: 13.5px;
  color: var(--ink);
  font-family: inherit;
}

.af-toggle-linha {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 14px;
  padding: 0 4px;
}

.af-toggle-titulo {
  font-size: 13.5px;
  font-weight: 600;
}

.af-toggle-ajuda {
  font-size: 12px;
  color: var(--muted);
}

.toggle {
  width: 42px;
  height: 24px;
  border-radius: 12px;
  border: 0;
  cursor: pointer;
  position: relative;
  background: var(--track);
  flex: none;
}

.toggle.ativo {
  background: var(--brand);
}

.toggle-bola {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: left .15s;
}

.toggle.ativo .toggle-bola {
  left: 21px;
}

.af-salvar {
  width: 100%;
  height: 50px;
  margin-top: 16px;
  border: 0;
  border-radius: 14px;
  background: var(--brand);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}

.af-salvar:hover {
  background: var(--brand-hover);
}

/* --- Sheet "Novo lançamento" (despesa/receita/transferência) --- */

.nl-segmentado {
  display: flex;
  background: var(--field);
  border-radius: 12px;
  padding: 3px;
}

.nl-segmentado button {
  flex: 1;
  height: 36px;
  border: 0;
  border-radius: 9px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  background: transparent;
  color: var(--muted);
}

.nl-segmentado button.ativo {
  background: #fff;
}

.nl-segmentado button[data-nl-tipo="saida"].ativo {
  color: var(--danger);
}

.nl-segmentado button[data-nl-tipo="entrada"].ativo {
  color: var(--brand);
}

.nl-segmentado button[data-nl-tipo="transferencia"].ativo {
  color: #0F1720;
}

.nl-segmentado button[data-pr-tipo="pagar"].ativo {
  color: var(--danger);
}

.nl-segmentado button[data-pr-tipo="receber"].ativo {
  color: var(--brand);
}

.nl-valor {
  text-align: center;
  padding: 22px 0 14px;
}

.nl-valor-rotulo {
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
}

.nl-valor-linha {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 6px;
}

.nl-valor-prefixo {
  font-size: 20px;
  font-weight: 700;
}

.nl-valor-input {
  /* Em ch (não px): 1ch = largura do "0" no tamanho de fonte atual, e
     tabular-nums garante que todo dígito/separador tem essa largura —
     então o campo acompanha o font-size quando o JS encolhe a fonte pra
     valores muito grandes, em vez de cortar o texto numa largura fixa. */
  width: 11ch;
  max-width: 100%;
  border: 0;
  outline: 0;
  background: none;
  font-size: 44px;
  font-weight: 800;
  letter-spacing: -0.03em;
  text-align: center;
  color: inherit;
  font-variant-numeric: tabular-nums;
}

.nl-descricao {
  width: 100%;
  height: 46px;
  border: 0;
  border-radius: 12px;
  background: var(--field);
  padding: 0 14px;
  font-size: 14.5px;
  outline: 0;
  color: var(--ink);
  font-family: inherit;
}

.nl-chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin: 12px -20px 0;
  padding: 2px 20px 4px;
}

.nl-chip input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.nl-chip label {
  flex: none;
  display: flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 12px 0 6px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 600;
  border: 1.5px solid var(--border);
  background: #fff;
  color: var(--ink);
  white-space: nowrap;
}

.nl-chip input:checked + label {
  border-color: var(--brand);
  background: var(--brand-soft);
}

.nl-chip-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 800;
  flex: none;
}

/* Chip "botão" (categoria-pai que abre suas subcategorias) — mesma
   aparência do par input+label de .nl-chip, só que sem radio por trás. */
.nl-chip-botao {
  flex: none;
  display: flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 10px 0 6px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 600;
  border: 1.5px solid var(--border);
  background: #fff;
  color: var(--ink);
  white-space: nowrap;
  font-family: inherit;
}

/* "Voltar" para a lista de categorias, no topo do painel de subcategorias. */
.nl-chip-voltar {
  flex: none;
  display: flex;
  align-items: center;
  gap: 4px;
  height: 34px;
  padding: 0 4px;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
}

.nl-grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}

.nl-select,
.nl-data {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  width: 100%;
  height: 44px;
  border: 0;
  border-radius: 12px;
  background: var(--field);
  padding: 0 34px 0 12px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  font-family: inherit;
  cursor: pointer;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236B7683' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 14px;
}

.nl-data {
  cursor: text;
  background-image: none;
  padding: 0 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.nl-badge-cartao {
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--brand-soft);
  color: var(--brand);
  margin-left: 6px;
}

.nl-parcelas {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  height: 44px;
  border-radius: 12px;
  background: var(--field);
  padding: 0 12px;
}

.nl-parcelas span {
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
  flex: 1;
}

.nl-parcelas select {
  border: 0;
  background: #fff;
  border-radius: 8px;
  height: 30px;
  padding: 0 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  outline: 0;
  cursor: pointer;
  font-family: inherit;
}

.nl-anexo {
  width: 100%;
  margin-top: 8px;
  height: 44px;
  border: 1.5px dashed var(--border);
  border-radius: 12px;
  background: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--muted);
  font-family: inherit;
}

.nl-anexo.ativo {
  border-style: solid;
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand-deep);
}

.nl-anexo span:first-of-type {
  flex: 1;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nl-conta-transferencia {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}

.nl-conta-picker {
  flex: 1;
  height: 52px;
  border-radius: 12px;
  background: var(--field);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
}

.nl-conta-picker-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  flex: none;
}

.nl-conta-picker-campo {
  flex: 1;
  min-width: 0;
}

.nl-conta-picker-legenda {
  display: block;
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
}

.nl-conta-picker select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  width: 100%;
  border: 0;
  background: none;
  outline: 0;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  font-family: inherit;
  cursor: pointer;
  padding: 0;
}

.nl-swap {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand);
  border: 0;
  display: grid;
  place-items: center;
  flex: none;
  cursor: pointer;
}

.nl-salvar {
  width: 100%;
  height: 50px;
  margin-top: 14px;
  border: 0;
  border-radius: 14px;
  background: var(--ink);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}

/* --- Investimentos: FAB local (sheets abrem por cima da tela, sem
   navegar pra outra rota) e animação do ícone de "Atualizar" --- */

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

button.fab {
  border: 0;
  font-family: inherit;
}

/* --- Relatórios: Patrimônio (Tela 5b do handoff) --- */

.patr-chip {
  flex: none;
  height: 28px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  background: var(--field);
  color: var(--ink-2);
  font-size: 11.5px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
}

.patr-chip.ativo {
  background: var(--ink);
  color: #fff;
}

.patr-historico-linha {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border: 0;
  border-bottom: 1px solid var(--field);
  background: transparent;
  cursor: pointer;
  text-align: left;
  color: var(--ink);
  font-family: inherit;
}

.patr-historico-linha:last-child {
  border-bottom: 0;
}

.patr-historico-linha:hover {
  background: var(--surface-2);
}

.patr-historico-linha.ativo {
  background: var(--surface-2);
}

.patr-historico-barra {
  background: #D9CCFC;
}

.patr-historico-barra.ativo {
  background: var(--brand);
}
