/* app-premium.css — identidade visual "app premium" no celular (≤768px).
   Carregado depois de app-mobile.css. Ideia: fundo com brilhos suaves, vidro, cantos grandes, números em destaque. */
/* o logo/saudação do topo e o indicador dentro do cartão são só do celular */
#hdr-sub, .cv-uso { display: none; }
/* resumo de Cartões: aparece em todas as telas (4 colunas fora do celular) */
#cartoes-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) !important; gap: 12px; margin-bottom: 24px; }
@media (max-width: 1100px) { #cartoes-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; } }

@media (max-width: 768px) {
  :root { --bn-h: 66px; --raio: 22px; }
  body { --border: rgba(255, 255, 255, 0.08); background-color: #0a0b10; }
  body.light { --border: rgba(15, 23, 42, 0.07); background-color: #f3f4fa; background-image: none; }

  /* ---------- fundo com brilho (atrás de tudo) ---------- */
  body::before {
    content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
    background:
      radial-gradient(70% 42% at 100% -6%, rgba(249, 115, 22, 0.26), transparent 70%),
      radial-gradient(60% 40% at -12% 38%, rgba(139, 92, 246, 0.18), transparent 70%),
      radial-gradient(70% 40% at 90% 106%, rgba(59, 130, 246, 0.14), transparent 70%);
  }
  body.light::before {
    background:
      radial-gradient(70% 42% at 100% -6%, rgba(249, 115, 22, 0.16), transparent 70%),
      radial-gradient(60% 40% at -12% 38%, rgba(139, 92, 246, 0.12), transparent 70%),
      radial-gradient(70% 40% at 90% 106%, rgba(59, 130, 246, 0.12), transparent 70%);
  }
  .app-layout { background: transparent !important; }
  #tela-app { background: transparent !important; }
  .main-content { background: transparent !important; padding-bottom: calc(var(--bn-h) + 44px + env(safe-area-inset-bottom, 0px)) !important; }

  /* ---------- topo limpo: avatar e saudação, título grande ---------- */
  .content-header {
    display: grid !important; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "sub act" "tit tit";
    align-items: center; gap: 12px 12px;
    position: static !important; margin: 0 0 18px !important; padding: 4px 0 0 !important;
    background: none !important; border: 0 !important; border-radius: 0 !important; box-shadow: none !important;
    overflow: visible !important; -webkit-backdrop-filter: none !important; backdrop-filter: none !important;
  }
  .content-header::before, .content-header::after { display: none !important; }
  .header-left { display: contents !important; }
  #hdr-sub { grid-area: sub; display: flex !important; flex-direction: row !important; align-items: center; gap: 11px; min-width: 0; text-transform: none; }
  #hdr-sub .hs-logo { width: 42px; height: 42px; border-radius: 13px; flex-shrink: 0; box-shadow: 0 8px 20px rgba(249, 115, 22, 0.35); }
  #hdr-sub .hs-txt { display: flex; flex-direction: column; min-width: 0; line-height: 1.15; }
  #hdr-sub .hs-saud { font-size: 12px; font-weight: 500; color: var(--muted) !important; }
  #hdr-sub .hs-ola { font-size: 17px; font-weight: 800; color: var(--txt) !important; letter-spacing: -0.3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .content-header .page-title { grid-area: tit; color: var(--txt) !important; font-size: 34px !important; line-height: 1.05; letter-spacing: -1.2px; font-weight: 800; text-shadow: none !important; margin: 0; }
  .header-actions { grid-area: act; display: flex; gap: 10px !important; align-items: center; margin: 0 !important; }
  .content-header .btn-action-top:not(#btn-perfil-header) {
    width: 40px !important; height: 40px !important; min-width: 40px !important; border-radius: 14px !important;
    background: rgba(255, 255, 255, 0.07) !important; border: 1px solid var(--border) !important; color: var(--txt) !important;
    -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  }
  body.light .content-header .btn-action-top:not(#btn-perfil-header) { background: var(--mn-card) !important; box-shadow: none; }
  #btn-perfil-header { width: 42px !important; height: 42px !important; min-width: 42px !important; border-radius: 50% !important; border: 0 !important;
    background: linear-gradient(135deg, #f97316, #ffa45c) !important; box-shadow: 0 0 0 2px var(--bg), 0 0 0 3.5px rgba(249, 115, 22, 0.6), 0 8px 18px rgba(249, 115, 22, 0.35) !important; }

  /* ---------- barra inferior flutuante ---------- */
  #bottom-nav.visivel {
    left: 12px; right: 12px; bottom: calc(10px + env(safe-area-inset-bottom, 0px)); height: var(--bn-h); padding: 0 6px;
    border-radius: 28px; border: 1px solid rgba(255, 255, 255, 0.1); align-items: center;
    background: rgba(22, 23, 33, 0.74); -webkit-backdrop-filter: blur(28px) saturate(1.7); backdrop-filter: blur(28px) saturate(1.7);
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  }
  body.light #bottom-nav.visivel { background: rgba(255, 255, 255, 0.82); border-color: rgba(15, 23, 42, 0.06); box-shadow: 0 16px 40px rgba(30, 41, 80, 0.16), inset 0 1px 0 #fff; }
  .bn-item { height: var(--bn-h); gap: 2px; font-size: 10px; }
  .bn-item.on::before { display: none; }
  .bn-item i { font-size: 22px; padding: 4px 16px; border-radius: 14px; box-sizing: content-box; width: 22px; height: 22px; display: flex; align-items: center; justify-content: center; }
  .bn-item.on i { background: rgba(249, 115, 22, 0.16); transform: none; }
  .bn-add { align-self: center; margin-top: -30px; width: 56px; height: 56px; box-shadow: 0 10px 26px rgba(249, 115, 22, 0.5), 0 0 0 5px rgba(22, 23, 33, 0.74); }
  body.light .bn-add { box-shadow: 0 10px 26px rgba(249, 115, 22, 0.45), 0 0 0 5px rgba(255, 255, 255, 0.85); }
  .bn-add.sem-acao { box-shadow: 0 0 0 5px rgba(22, 23, 33, 0.74); }
  #mais-folha { padding-bottom: calc(var(--bn-h) + 36px + env(safe-area-inset-bottom, 0px)); }

  /* ---------- cartões de vidro ---------- */
  .card, .receber-card, .dw, .ativo-card, .meta-card, .card-cartao, .resumo-card {
    border-radius: var(--raio) !important; border: 1px solid var(--border) !important;
    -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 10px 28px rgba(0, 0, 0, 0.22);
  }
  body.light .card, body.light .receber-card, body.light .dw, body.light .ativo-card, body.light .meta-card, body.light .resumo-card {
    background: rgba(255, 255, 255, 0.86) !important; box-shadow: 0 1px 0 #fff inset, 0 10px 30px rgba(30, 41, 80, 0.08);
  }

  /* KPIs: ícone em caixa colorida, rótulo pequeno, número em destaque */
  .receber-card { padding: 13px 14px !important; gap: 11px !important; align-items: center !important; }
  .receber-card .icone { width: 36px !important; height: 36px !important; min-width: 36px; border-radius: 12px !important; font-size: 18px !important; display: flex !important; align-items: center; justify-content: center; background: color-mix(in srgb, currentColor 16%, transparent) !important; }
  .receber-card .icone i { font-size: 18px !important; }
  .receber-card .rotulo { font-size: 10px !important; font-weight: 700 !important; letter-spacing: 0.7px; text-transform: uppercase; color: var(--muted) !important; }
  .receber-card .valor { font-size: 17px !important; font-weight: 800 !important; letter-spacing: -0.3px; font-variant-numeric: tabular-nums; }

  /* ---------- Início: Patrimônio vira o cartão principal (sem carrossel) ---------- */
  .carrossel-widgets > div:first-child { display: none !important; }
  .carrossel-widgets { height: auto !important; min-height: 0 !important; border-radius: 28px !important; padding: 0 !important; border: 1px solid rgba(255, 255, 255, 0.14) !important; color: #fff;
    background:
      radial-gradient(90% 130% at 100% 0%, rgba(249, 115, 22, 0.5), transparent 60%),
      radial-gradient(80% 110% at 0% 100%, rgba(139, 92, 246, 0.5), transparent 62%),
      linear-gradient(150deg, #1d1f3b, #11121e) !important;
    box-shadow: 0 22px 50px rgba(12, 12, 40, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.18) !important; }
  body.light .carrossel-widgets, body.light .card-patrimonio {
    background:
      radial-gradient(90% 130% at 100% 0%, rgba(249, 115, 22, 0.5), transparent 60%),
      radial-gradient(80% 110% at 0% 100%, rgba(139, 92, 246, 0.5), transparent 62%),
      linear-gradient(150deg, #1d1f3b, #11121e) !important;
    color: #fff !important; border-color: rgba(255, 255, 255, 0.14) !important;
    box-shadow: 0 22px 44px rgba(30, 41, 80, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.18) !important;
  }
  body.light #patrimonio-valor, body.light #patr-subtitulo { color: #fff !important; }
  body.light #patr-titulo { color: rgba(255, 255, 255, 0.7) !important; }
  #carrossel-track { width: 100% !important; transform: none !important; transition: none !important; height: auto !important; }
  #carrossel-track > div:not(:first-child) { display: none !important; }
  #carrossel-track > div:first-child { width: 100% !important; padding: 24px 22px !important; align-items: flex-start; }
  #patr-titulo { font-size: 11px !important; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: rgba(255, 255, 255, 0.7) !important; margin-bottom: 6px; }
  #patrimonio-valor { font-size: 38px !important; font-weight: 800; letter-spacing: -1.4px; color: #fff !important; font-variant-numeric: tabular-nums; line-height: 1.05; }
  #patr-subtitulo { margin-top: 12px !important; padding: 7px 12px; border-radius: 12px; background: rgba(255, 255, 255, 0.1); font-size: 12px !important; color: rgba(255, 255, 255, 0.85) !important; }

  /* rótulos de seção */
  #tab-metas h2, #tab-assinaturas h2 { font-size: 12px !important; font-weight: 700 !important; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); margin: 4px 2px 0 !important; }

  /* ---------- Metas ---------- */
  .meta-card { padding: 16px !important; }
  .meta-icone { width: 44px !important; height: 44px !important; border-radius: 14px !important; font-size: 22px !important; display: flex; align-items: center; justify-content: center; }
  .meta-titulo { font-size: 15px !important; font-weight: 700; }
  .meta-prazo { font-size: 11.5px !important; color: var(--muted); }
  .meta-barra-fundo { height: 8px !important; border-radius: 8px !important; background: rgba(148, 163, 184, 0.18) !important; overflow: hidden; }
  .meta-barra-fill { border-radius: 8px !important; }
  .meta-valor-atual { font-size: 16px !important; font-weight: 800; font-variant-numeric: tabular-nums; }
  .meta-valor-alvo, .meta-porcentagem { font-size: 12px !important; color: var(--muted); }
  #tab-metas [style*="dashed"] { padding: 34px 20px !important; border-radius: var(--raio) !important; }
  #tab-metas [style*="dashed"] > i { font-size: 30px !important; width: 64px; height: 64px; display: inline-flex !important; align-items: center; justify-content: center; border-radius: 50%; background: rgba(249, 115, 22, 0.12); color: var(--accent) !important; margin-bottom: 14px !important; }
  #tab-metas [style*="dashed"] h3 { font-size: 16px !important; text-transform: none !important; letter-spacing: 0 !important; color: var(--txt) !important; margin: 0 0 6px !important; }
  #tab-metas [style*="dashed"] p { font-size: 13px !important; }

  /* ---------- Assinaturas e Investimentos ---------- */
  #tab-assinaturas #grid-assinaturas, #tab-assinaturas [id*="grid"] { display: grid; grid-template-columns: 1fr; gap: 10px; }
  .ativo-card { padding: 14px 16px !important; }
  .ativo-ticker { font-size: 15px !important; font-weight: 800; }
  .ativo-nome { font-size: 12px !important; color: var(--muted); }
  .alocacao-item { padding: 2px 0; }
  .alocacao-barra-fundo { height: 6px !important; border-radius: 6px !important; }
  .alocacao-barra-fill { border-radius: 6px !important; }

  /* ---------- Documentos ---------- */
  #doc-tbody tr { border-radius: 18px !important; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05); }
  #doc-drawer { background: var(--sheet-bg, #14151d) !important; border-radius: 26px 26px 0 0 !important; }
  body.light #doc-drawer { background: #fff !important; }

  /* ---------- folhas (modais, filtros, Mais) com cantos e brilho ---------- */
  #mais-folha, .mf-painel, .drawer-detalhes { border-radius: 28px 28px 0 0 !important; }
  .mf-painel { background: var(--sheet-bg, #14151d) !important; }
  body.light .mf-painel { background: #fff !important; }
  .modal-content { border-radius: 28px 28px 0 0 !important; }

  /* ---------- barras de busca e botões ---------- */
  input, select, textarea { border-radius: 14px !important; }
  .btn-nova-transacao, button.primary, #tab-usuarios #btn-grupos { border-radius: 14px; }

  /* ---------- Mais: cartão do usuário sem listras ---------- */
  .mais-perfil { background: radial-gradient(110% 160% at 100% 0%, rgba(249, 115, 22, 0.45), transparent 60%), linear-gradient(150deg, #1d1f3b, #12131f) !important; border: 1px solid rgba(255, 255, 255, 0.12); }

  /* ---------- folhas opacas e animadas (todas abrem de baixo, do mesmo jeito) ---------- */
  #rec-drawer, #pag-drawer, #agenda-drawer, #doc-drawer, .drawer { background: var(--sheet-bg, #14151d) !important; border: 0 !important; border-top: 1px solid rgba(255, 255, 255, 0.1) !important; -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
  body.light #rec-drawer, body.light #pag-drawer, body.light #agenda-drawer, body.light #doc-drawer, body.light .drawer { background: #fff !important; border-top-color: rgba(15, 23, 42, 0.06) !important; }
  .drawer { top: auto !important; left: 0 !important; right: 0 !important; bottom: 0 !important; width: 100% !important; max-width: 100% !important; height: auto !important; max-height: 82dvh; border-radius: 28px 28px 0 0 !important; transform: translateY(110%); transition: transform 0.38s cubic-bezier(0.22, 1, 0.36, 1) !important; box-shadow: 0 -20px 60px rgba(0, 0, 0, 0.5) !important; overflow-y: auto; padding-bottom: env(safe-area-inset-bottom, 0px); }
  .drawer.ativo { transform: none; }
  #rec-drawer, #pag-drawer, #agenda-drawer, #doc-drawer { padding-top: 22px !important; }
  #rec-drawer::before, #pag-drawer::before, #agenda-drawer::before, #doc-drawer::before { position: absolute; left: 50%; top: 8px; transform: translateX(-50%); margin: 0 !important; }
  .drawer::before, #rec-drawer::before, #pag-drawer::before, #agenda-drawer::before, #doc-drawer::before { content: ""; display: block; width: 38px; height: 4px; border-radius: 4px; background: rgba(148, 163, 184, 0.35); margin: 8px auto 0; flex-shrink: 0; }
  .drawer-header { padding: 14px 20px 14px !important; }
  body #drawer-lanc.drawer, body .drawer { background-color: var(--sheet-bg, #14151d) !important; -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
  body.light #drawer-lanc.drawer, body.light .drawer { background-color: #fff !important; }
  .drawer-overlay { z-index: 1500; background: rgba(5, 6, 12, 0.6) !important; -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
  #sheet-backdrop { background: rgba(5, 6, 12, 0.6) !important; -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }

  /* ---------- KPIs padronizados: 2 colunas, o último (ímpar) ocupa a linha toda ---------- */
  .receber-resumo, .resumo-cards { display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 10px !important; }
  .receber-resumo > :last-child:nth-child(odd), .resumo-cards > :last-child:nth-child(odd) { grid-column: 1 / -1 !important; }
  .receber-card .info { min-width: 0; }
  .receber-card .valor { overflow: hidden; text-overflow: ellipsis; }

  /* ---------- Assinaturas e Metas: 2 por linha, compactas ---------- */
  #grid-assinaturas, #grid-metas { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 10px !important; }
  #grid-assinaturas .meta-card { padding: 14px !important; min-height: 0 !important; border-radius: 20px !important; }
  #grid-assinaturas .meta-card > div:first-of-type { font-size: 26px !important; margin-bottom: 8px !important; }
  #grid-assinaturas .meta-card [style*="font-size: 16px"] { font-size: 14px !important; }
  #grid-assinaturas .meta-card [style*="margin-bottom: 20px"] { margin-bottom: 10px !important; font-size: 11px !important; }
  #grid-assinaturas .meta-card [style*="font-size: 22px"] { font-size: 16px !important; }
  #grid-assinaturas .meta-card [style*="font-size: 12px; color: var(--muted); font-weight: 400"] { font-size: 10px !important; }
  #grid-assinaturas .meta-card > div:last-child { flex-wrap: wrap; gap: 6px; align-items: flex-end; }
  #grid-assinaturas .meta-card button[onclick*="excluir"] { top: 10px !important; right: 10px !important; width: 36px !important; height: 36px !important; }
  #grid-assinaturas .meta-card button i, #grid-metas .meta-card button[onclick*="excluir"] i { font-size: 18px !important; }
  #grid-metas .meta-card { padding: 14px !important; min-height: 0 !important; border-radius: 20px !important; }
  #grid-metas .meta-card button[onclick*="excluirMeta"] { width: 36px !important; height: 36px !important; min-width: 36px !important; }
  #grid-metas .meta-icone { width: 40px !important; height: 40px !important; font-size: 20px !important; }
  #grid-metas .meta-titulo { font-size: 14px !important; }
  #grid-metas .meta-valores { flex-direction: column !important; align-items: flex-start !important; gap: 0 !important; margin-bottom: 8px; }
  #grid-metas .meta-valor-atual { font-size: 15px !important; }
  #grid-metas .meta-valor-alvo { font-size: 11px !important; }
  #grid-metas .meta-card button[onclick*="Aporte"] { font-size: 0 !important; width: 40px !important; height: 40px !important; min-width: 40px; padding: 0 !important; border-radius: 50% !important; display: flex !important; align-items: center; justify-content: center; background: color-mix(in srgb, currentColor 15%, transparent) !important; gap: 0 !important; }
  #grid-metas .meta-card button[onclick*="Aporte"] i { font-size: 22px !important; }

  /* ---------- Investimentos: um gráfico por linha ---------- */
  #chart-evolucao-inv { min-height: 190px !important; }
  #tab-investimentos .coluna-esquerda > .bloco { margin-bottom: 12px; }

  /* ---------- Cartões: 2 por linha, indicadores, resumo no topo ---------- */
  #cartoes-kpis { display: grid !important; margin-bottom: 14px; }
  #tab-cartoes .grid-cartoes { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 16px 12px !important; }
  #tab-cartoes .cartao-visual { min-height: 132px !important; height: auto !important; padding: 12px 12px 10px !important; border-radius: 20px !important; display: flex; flex-direction: column; justify-content: space-between; box-shadow: 0 12px 26px rgba(0, 0, 0, 0.3); }
  #tab-cartoes .cartao-visual .cv-uso { display: block; margin-top: 6px; }
  .cv-uso-barra { height: 5px; border-radius: 5px; background: rgba(255, 255, 255, 0.28); overflow: hidden; }
  .cv-uso-barra i { display: block; height: 100%; border-radius: 5px; background: #fff; }
  .cv-uso-txt { font-size: 10px; margin-top: 4px; color: rgba(255, 255, 255, 0.92); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .cv-uso-txt b { font-weight: 800; }
  #tab-cartoes .cartao-visual.selecionado { box-shadow: 0 0 0 2px #fff, 0 14px 30px rgba(0, 0, 0, 0.4); }

  /* ---------- acabamento: transições e toque ---------- */
  .tela-entra { animation: telaEntra 0.42s cubic-bezier(0.22, 1, 0.36, 1) backwards; }
  @keyframes telaEntra { from { opacity: 0; transform: translateY(14px) scale(0.995); } to { opacity: 1; transform: none; } }
  .tela-entra > *, .tela-entra .receber-resumo > * { animation: itemEntra 0.5s cubic-bezier(0.22, 1, 0.36, 1) backwards; }
  .tela-entra > *:nth-child(2) { animation-delay: 0.04s; } .tela-entra > *:nth-child(3) { animation-delay: 0.08s; } .tela-entra > *:nth-child(4) { animation-delay: 0.12s; }
  @keyframes itemEntra { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
  .receber-card, .meta-card, .ativo-card, #doc-tbody tr, #tab-usuarios tbody tr, .cartao-visual, #rec-tbody tr, #pag-tbody tr, #tbody-lanc tr { transition: transform 0.18s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.2s; }
  .meta-card:active, .ativo-card:active, #doc-tbody tr:active, #tab-usuarios tbody tr:active, .cartao-visual:active, #rec-tbody tr:active, #pag-tbody tr:active, #tbody-lanc tr:active { transform: scale(0.975); }
}
@media (max-width: 768px) and (prefers-reduced-motion: reduce) { .tela-entra, .tela-entra > *, .drawer { animation: none !important; transition: none !important; }
}

@media (max-width: 768px) {
  /* ---------- modais: folha fosca (sem vidro), formulário bem acabado ---------- */
  .modal-overlay { background: rgba(5, 6, 12, 0.6) !important; -webkit-backdrop-filter: none !important; backdrop-filter: none !important; align-items: flex-end !important; }
  .modal-overlay .modal-content {
    background: var(--sheet-bg, #14151d) !important; -webkit-backdrop-filter: none !important; backdrop-filter: none !important;
    border: 0 !important; border-top: 1px solid rgba(255, 255, 255, 0.1) !important; border-radius: 28px 28px 0 0 !important;
    width: 100% !important; max-width: 100% !important; max-height: 92dvh !important; margin: 0 !important;
    padding: 26px 20px calc(20px + env(safe-area-inset-bottom, 0px)) !important; box-shadow: 0 -20px 60px rgba(0, 0, 0, 0.5) !important; position: relative;
  }
  body.light .modal-overlay .modal-content { background: #fff !important; border-top-color: rgba(15, 23, 42, 0.06) !important; }
  .modal-overlay .modal-content::before { content: ""; position: absolute; top: 8px; left: 50%; transform: translateX(-50%); width: 38px; height: 4px; border-radius: 4px; background: rgba(148, 163, 184, 0.35); }
  .modal-overlay .modal-content h2 { font-size: 22px !important; font-weight: 800 !important; letter-spacing: -0.5px; margin: 6px 0 4px !important; }
  .modal-overlay .modal-content > p { font-size: 13px !important; color: var(--muted); margin: 0 0 18px !important; }
  .modal-overlay .modal-content label { display: block; font-size: 11px !important; font-weight: 700 !important; letter-spacing: 0.7px; text-transform: uppercase; color: var(--muted) !important; margin: 14px 2px 6px !important; }
  .modal-overlay .modal-content input, .modal-overlay .modal-content select, .modal-overlay .modal-content textarea {
    width: 100%; min-height: 50px; padding: 13px 14px !important; margin: 0 !important; font-size: 16px !important; border-radius: 14px !important;
    background: rgba(255, 255, 255, 0.05) !important; border: 1px solid var(--border) !important; color: var(--txt); box-sizing: border-box;
  }
  body.light .modal-overlay .modal-content input, body.light .modal-overlay .modal-content select, body.light .modal-overlay .modal-content textarea { background: #f4f5fa !important; border-color: rgba(15, 23, 42, 0.08) !important; }
  .modal-overlay .modal-content input:focus, .modal-overlay .modal-content select:focus, .modal-overlay .modal-content textarea:focus { outline: none; border-color: var(--accent) !important; box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.18); }
  .modal-overlay .modal-content .form-row { display: grid !important; grid-template-columns: 1fr 1fr; gap: 12px; }
  .modal-overlay .modal-content .form-row > * { min-width: 0; }
  .modal-overlay .modal-content .modal-actions { display: grid !important; grid-template-columns: 1fr 1.4fr; gap: 10px !important; margin-top: 22px !important; padding-top: 16px !important; border-top: 1px solid var(--border); }
  .modal-overlay .modal-content .modal-actions button { min-height: 52px; padding: 0 16px !important; font-size: 15px !important; font-weight: 700; border-radius: 16px !important; }
  .modal-overlay .modal-content .modal-actions button.ghost { background: transparent; border: 1px solid var(--border); color: var(--txt); }

  /* ---------- Cartões: detalhe estilizado ---------- */
  .cartoes-detalhes { margin-top: 2px !important; }
  .cartao-detalhe { padding: 18px 16px 8px !important; border-radius: 22px !important; font-size: 13px !important; background: rgba(255, 255, 255, 0.045) !important; border: 1px solid rgba(255, 255, 255, 0.09) !important; box-shadow: 0 14px 34px rgba(0, 0, 0, 0.3); }
  body.light .cartao-detalhe { background: #fff !important; border-color: rgba(15, 23, 42, 0.07) !important; box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08); }
  .cartao-detalhe .cd-cab { display: flex !important; align-items: center; gap: 12px; margin-bottom: 14px; }
  .cartao-detalhe .cd-cab > div { flex: 1; min-width: 0; }
  .cartao-detalhe .cd-ponto { width: 38px; height: 26px; border-radius: 8px; flex: none; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3); }
  .cartao-detalhe .cd-nome { font-size: 17px; font-weight: 800; letter-spacing: -0.2px; }
  .cartao-detalhe .cd-sub2 { font-size: 12px; color: var(--muted); margin-top: 2px; }
  .cartao-detalhe .cd-pct { font-size: 20px; font-weight: 800; }
  .cartao-detalhe .cd-stats { display: grid !important; grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .cartao-detalhe .cd-stats > div { background: rgba(255, 255, 255, 0.05); border-radius: 14px; padding: 10px 10px; min-width: 0; }
  body.light .cartao-detalhe .cd-stats > div { background: #f4f5fa; }
  .cartao-detalhe .cd-stats span { display: block; font-size: 10px; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase; color: var(--muted); margin-bottom: 3px; }
  .cartao-detalhe .cd-stats b { font-size: 13px; font-weight: 800; white-space: nowrap; }
  .cartao-detalhe .cd-topo, .cartao-detalhe .cd-info { display: none !important; }
  .cartao-detalhe .cd-barra { height: 8px !important; border-radius: 8px !important; margin: 14px 0 16px !important; }
  .cartao-detalhe .cd-acoes { display: grid !important; grid-template-columns: 1fr 1fr; gap: 10px; }
  .cartao-detalhe .cd-acoes button { min-height: 46px; font-size: 14px !important; font-weight: 700; border-radius: 14px !important; padding: 0 12px !important; justify-content: center; }
  .cartao-detalhe .cd-acoes button:first-child { background: linear-gradient(135deg, var(--accent), #ff9a44) !important; color: #fff !important; border: 0 !important; }
  .cartao-detalhe .cd-titulo { font-size: 11px !important; letter-spacing: 0.8px; margin: 20px 0 4px !important; }
  .cartao-detalhe .cd-transacao { font-size: 14px !important; padding: 12px 0 !important; }
  .cartao-detalhe .cd-desc { font-size: 14px; font-weight: 600; }
  .cartao-detalhe .cd-data { font-size: 11px !important; }
  .cartao-detalhe .cd-fantasma { display: none !important; }

  /* ---------- nada foge da tela ao arrastar para os lados ---------- */
  html, body { max-width: 100vw; overflow-x: hidden !important; overscroll-behavior: none; }
  .app-layout, .main-content { max-width: 100vw; overflow-x: hidden !important; overscroll-behavior-x: none; }
  .modal-overlay .modal-content, .drawer, #rec-drawer, #pag-drawer, #agenda-drawer, #doc-drawer, #mais-folha, .mf-painel { max-width: 100vw !important; overflow-x: hidden !important; overscroll-behavior: contain; }
  .modal-overlay, .drawer-overlay, #sheet-backdrop { touch-action: pan-y; }
  .modal-overlay .modal-content { overflow-y: auto !important; overflow-x: hidden !important; touch-action: pan-y; overscroll-behavior: contain; }
  .modal-overlay .modal-content > input, .modal-overlay .modal-content > select, .modal-overlay .modal-content > textarea, .modal-overlay .modal-content > div[style*="display: flex"], .modal-overlay .modal-content > .form-row { margin-bottom: 12px !important; }
  .modal-overlay .modal-content > div[style*="display: flex"] > input, .modal-overlay .modal-content > div[style*="display: flex"] > select { min-width: 0; flex: 1; }
  .modal-overlay .modal-content input::placeholder { text-overflow: ellipsis; }

  /* ---------- iPhone: campos de data não passam da coluna ---------- */
  .modal-overlay .modal-content input[type="date"], .modal-overlay .modal-content input[type="datetime-local"], .modal-overlay .modal-content input[type="month"] {
    -webkit-appearance: none; appearance: none; display: block; width: 100% !important; min-width: 0 !important; max-width: 100% !important;
    text-align: left; line-height: 1.2; box-sizing: border-box;
  }
  .modal-overlay .modal-content input[type="date"]::-webkit-date-and-time-value { text-align: left; margin: 0; min-height: 1.2em; }
  .modal-overlay .modal-content .form-row > *, .modal-overlay .modal-content div[style*="display: flex"] > *, .modal-overlay .modal-content div[style*="display:flex"] > * { min-width: 0; }
  .modal-overlay .modal-content .form-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important; }

  /* folhas ficam no <body> no celular: margem interna própria */
  #rec-drawer, #pag-drawer, #agenda-drawer { padding-left: 20px !important; padding-right: 20px !important; box-sizing: border-box; }

  /* folhas fechadas não deixam sombra vazando na borda de baixo da tela */
  html body .drawer:not(.ativo), html body #drawer-lanc:not(.ativo), html body #drawer-notificacoes:not(.ativo), #rec-drawer:not(.sheet-aberto), #pag-drawer:not(.sheet-aberto), #agenda-drawer:not(.sheet-aberto), #doc-drawer:not(.ativo):not(.sheet-aberto) { box-shadow: none !important; }
  html body #mais-folha, html body .mf-painel, html body #doc-drawer, html body .drawer, html body #rec-drawer, html body #pag-drawer, html body #agenda-drawer, html body .modal-overlay .modal-content { box-shadow: none !important; }
}

/* ============================================================
   MEIA-NOITE · todas as telas (só celular)
   ============================================================ */
.dl-av, .lanc-av, .lanc-foot, #cartoes-celular, #agenda-celular, #metas-resumo, #ass-resumo, #usr-chips, #cfg-perfil-card, #cfg-voltar, .mt-cel, .as-cel, .lanc-sub, .usr-av, #hero-celular, #dash-kpis, #saude-fundo, #saude-folha { display: none; }

@media (max-width: 768px) {
  :root { --mn-card: #15161f; --mn-borda: rgba(255,255,255,.07); --mn-verde: #2ee6a0; --mn-verm: #ff5c6c; --mn-laranja: #ff6a1a; }
  body.light { --mn-card: #ffffff; --mn-borda: #e9ebf1; --mn-verde: #0f9d6b; --mn-verm: #e0344a; }

  /* ---------- Início: Últimas transações (linhas em cartão) ---------- */
  #tab-dashboard .dash-grid.dg12 > .dw.carrossel-widgets { order: 0; }
  #tab-dashboard .dash-grid.dg12 > #dash-kpis { order: 1; }
  #tab-dashboard .dash-grid.dg12 > .dw.bloco-transacoes { order: 2; }
  #tab-dashboard .dash-grid.dg12 > .dw.bloco-orcamento-kpi { order: 3; }
  #tab-dashboard .dash-grid.dg12 > .dw.bloco-cartoes { order: 4; }
  #tab-dashboard .dash-grid.dg12 > .dw.bloco-fluxo { order: 5; }
  #tab-dashboard .dash-grid.dg12 > .dw.bloco-transacoes { max-height: none !important; overflow: visible !important; background: transparent !important; border: none !important; box-shadow: none !important; padding: 2px 0 !important; backdrop-filter: none !important; }
  #tab-dashboard .bloco-transacoes h3 { font-size: 17px !important; font-weight: 800; margin: 4px 2px 10px !important; }
  #tab-dashboard .bloco-transacoes h3 a { color: var(--mn-laranja) !important; font-size: 12px !important; font-weight: 700; }
  #tab-dashboard .bloco-transacoes .tabela-mini, #tab-dashboard .bloco-transacoes tbody { display: block; width: 100%; }
  #tab-dashboard .bloco-transacoes .tabela-mini tr { display: flex; align-items: center; gap: 10px; padding: 12px; margin-bottom: 8px; background: var(--mn-card); border: 1px solid var(--mn-borda); border-radius: 18px; }
  #tab-dashboard .bloco-transacoes .tabela-mini td { padding: 0 !important; border: none !important; font-size: 14px !important; }
  #tab-dashboard .bloco-transacoes .tabela-mini td:first-child { flex: 1; min-width: 0; }
  #tab-dashboard .bloco-transacoes .tabela-mini td:last-child { white-space: nowrap; font-weight: 800 !important; font-size: 14px !important; }
  .lanc-av { width: 40px; height: 40px; border-radius: 50%; place-items: center; color: #fff; font-weight: 800; font-size: 13px; }
  .dl-icone { display: none !important; }
  .dl-av { display: grid !important; place-items: center; width: 40px; height: 40px; border-radius: 50%; color: #fff; font-weight: 800; font-size: 13px; flex: none; }
  .dl-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
  .dl-txt b { font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .dl-txt i { font-style: normal; font-size: 11px; color: var(--muted); }

  /* ---------- Transações: avatar + título/categoria + valor/data ---------- */
  #tbody-lanc tr.linha-clicavel {
    grid-template-columns: minmax(0, 1fr) auto !important; gap: 2px 10px !important; padding: 12px !important; margin-bottom: 8px !important;
    background: var(--mn-card) !important; border: 1px solid var(--mn-borda) !important; border-radius: 18px !important;
  }
  #tbody-lanc tr.linha-clicavel td:nth-child(2) { grid-column: 1 !important; grid-row: 1 / 3 !important; display: grid !important; grid-template-columns: 40px minmax(0, 1fr); column-gap: 12px; align-items: center; }
  #tbody-lanc tr.linha-clicavel td:nth-child(2) .lanc-av { display: grid; grid-row: 1 / 3; }
  #tbody-lanc tr.linha-clicavel td:nth-child(2) > div { grid-column: 2; min-width: 0; }
  #tbody-lanc tr.linha-clicavel td:nth-child(2) > div:nth-of-type(1) { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; align-self: end; }
  #tbody-lanc tr.linha-clicavel td:nth-child(2) > div:nth-of-type(2) { display: none !important; }
  #tbody-lanc tr.linha-clicavel td:nth-child(2) > .lanc-sub { display: block; font-size: 11px; color: var(--muted); align-self: start; }
  #tbody-lanc tr.linha-clicavel td:nth-child(6) { grid-column: 2 !important; grid-row: 1 !important; font-size: 14px !important; font-weight: 800; align-self: end; }
  #tbody-lanc tr.linha-clicavel td:nth-child(1) { grid-column: 2 !important; grid-row: 2 !important; text-align: right; font-size: 10px; color: var(--muted); align-self: start; }
  #tbody-lanc tr.linha-clicavel td:nth-child(4), #tbody-lanc tr.linha-clicavel td:nth-child(5) { display: none !important; }
  #tab-lancamentos > div > div:has(> #tabela-lanc), #tab-lancamentos div:has(> #tabela-lanc) { background: transparent !important; border: none !important; padding: 0 !important; box-shadow: none !important; }

  /* ---------- A receber / A pagar: cartão por cobrança ---------- */
  #rec-tbody tr:not(.grupo-cabecalho), #pag-tbody tr:not(.grupo-cabecalho) {
    grid-template-columns: minmax(0, 1fr) auto !important; gap: 8px 0 !important; padding: 14px !important; margin-bottom: 10px !important;
    background: var(--mn-card) !important; border: 1px solid var(--mn-borda) !important; border-radius: 20px !important;
  }
  #rec-tbody tr:not(.grupo-cabecalho) td:nth-child(1), #pag-tbody tr:not(.grupo-cabecalho) td:nth-child(1) { grid-column: 1 !important; grid-row: 1 !important; }
  #rec-tbody tr:not(.grupo-cabecalho) td:nth-child(1) .avatar-cliente, #pag-tbody tr:not(.grupo-cabecalho) td:nth-child(1) .avatar-cliente { width: 40px !important; height: 40px !important; font-size: 13px !important; }
  #rec-tbody tr:not(.grupo-cabecalho) td:nth-child(1) > div > div > div:first-child, #pag-tbody tr:not(.grupo-cabecalho) td:nth-child(1) > div > div > div:first-child { font-size: 15px; }
  #rec-tbody tr:not(.grupo-cabecalho) td:nth-child(5), #pag-tbody tr:not(.grupo-cabecalho) td:nth-child(5) { grid-column: 2 !important; grid-row: 1 !important; justify-self: end !important; align-self: start; }
  #rec-tbody tr:not(.grupo-cabecalho) td:nth-child(4), #pag-tbody tr:not(.grupo-cabecalho) td:nth-child(4) { grid-column: 1 !important; grid-row: 2 !important; text-align: left !important; font-size: 22px !important; font-weight: 800 !important; letter-spacing: -.3px; }
  #rec-tbody tr:not(.grupo-cabecalho) td:nth-child(4) { color: var(--mn-verde); }
  #pag-tbody tr:not(.grupo-cabecalho) td:nth-child(4) { color: var(--mn-verm); }
  #rec-tbody tr:not(.grupo-cabecalho) td:nth-child(6), #pag-tbody tr:not(.grupo-cabecalho) td:nth-child(6) { display: block !important; grid-column: 2 !important; grid-row: 2 !important; justify-self: end; }
  #rec-tbody td:nth-child(6) > div, #pag-tbody td:nth-child(6) > div { gap: 0 !important; justify-content: flex-end !important; }
  #rec-tbody tr:not(.grupo-cabecalho) td:nth-child(6), #pag-tbody tr:not(.grupo-cabecalho) td:nth-child(6) { width: max-content !important; min-width: max-content !important; }
  #tab-receber div:has(> .tabela-receber), #tab-pagar div:has(> .tabela-receber) { background: transparent !important; border: none !important; padding: 0 !important; box-shadow: none !important; }
  #rec-tbody td:nth-child(6) button:not(.btn-receber-linha):not(.btn-ver-linha), #pag-tbody td:nth-child(6) button:not(.btn-receber-linha):not(.btn-ver-linha) { display: none !important; }
  #rec-tbody td:nth-child(6) .btn-receber-linha, #pag-tbody td:nth-child(6) .btn-receber-linha, #rec-tbody td:nth-child(6) .btn-ver-linha, #pag-tbody td:nth-child(6) .btn-ver-linha {
    height: 38px; padding: 0 20px !important; border-radius: 12px !important; font-weight: 800; font-size: 13px;
    background: linear-gradient(135deg, #ff6a1a, #ffa04a) !important; color: #fff !important; border: none !important; box-shadow: 0 6px 16px rgba(255,106,26,.28);
  }
  #rec-tbody tr:not(.grupo-cabecalho) td:nth-child(2), #pag-tbody tr:not(.grupo-cabecalho) td:nth-child(2) { grid-column: 1 !important; grid-row: 3 !important; font-size: 11px !important; }
  #rec-tbody tr:not(.grupo-cabecalho) td:nth-child(3), #pag-tbody tr:not(.grupo-cabecalho) td:nth-child(3) { grid-column: 2 !important; grid-row: 3 !important; justify-self: end; font-size: 11px !important; }
  #rec-tbody tr:not(.grupo-cabecalho) td:nth-child(2), #pag-tbody tr:not(.grupo-cabecalho) td:nth-child(2),
  #rec-tbody tr:not(.grupo-cabecalho) td:nth-child(3), #pag-tbody tr:not(.grupo-cabecalho) td:nth-child(3) { padding-top: 8px !important; border-top: 1px solid var(--mn-borda) !important; }
  .status-pill { border-radius: 999px !important; font-size: 10px !important; font-weight: 800; padding: 4px 9px !important; }

  /* ---------- Agenda: calendário compacto, hoje em círculo laranja ---------- */
  #tab-agenda .receber-resumo > .receber-card:nth-child(3) { display: none !important; }
  #tab-agenda .receber-resumo { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .agenda-dia { min-height: 0 !important; height: 44px !important; border: none !important; background: transparent !important; border-radius: 50% !important; justify-content: center; }
  .agenda-dia.hoje, .agenda-dia.selecionado { background: var(--mn-laranja) !important; box-shadow: 0 6px 16px rgba(255,106,26,.35) !important; }
  .agenda-dia.hoje .agenda-dia-numero, .agenda-dia.selecionado .agenda-dia-numero { color: #fff !important; font-weight: 800; }
  .agenda-dia-numero { font-size: 13px !important; font-weight: 600; }

  /* ---------- Usuários: avatar com iniciais ---------- */
  #tab-usuarios tbody tr { background: var(--mn-card) !important; border: 1px solid var(--mn-borda) !important; border-radius: 20px !important; }
  #tab-usuarios tbody td:nth-child(1) { display: flex !important; align-items: center; gap: 12px; }
  #tab-usuarios .usr-av { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; color: #fff; font-weight: 800; font-size: 13px; flex: none; }
  #tab-usuarios tbody td:nth-child(2) { padding-left: 52px !important; color: var(--muted); font-size: 12px; }
  #tab-usuarios tbody td:nth-child(3) span { background: rgba(255,106,26,.14) !important; color: var(--mn-laranja); border: none !important; font-size: 10px !important; }

  /* ---------- Documentos: 2 indicadores ---------- */
  #tab-documentos .receber-resumo > .receber-card:nth-child(3) { display: none !important; }
  #tab-documentos .receber-resumo { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }

  /* ---------- Início: patrimônio em destaque + Receitas/Despesas ---------- */
  #tab-dashboard .dash-grid.dg12 > .dw.carrossel-widgets {
    height: auto !important; max-height: none !important; min-height: 180px !important; padding: 0 !important; border-radius: 26px !important; position: relative;
    background: linear-gradient(160deg, rgba(255,106,26,.28), var(--mn-card) 62%) !important; border: 1px solid rgba(255,106,26,.22) !important;
  }
  #tab-dashboard .carrossel-widgets > div:first-child { display: none !important; }
  #tab-dashboard .carrossel-widgets .carrossel-track { width: 100% !important; height: auto !important; transform: none !important; }
  #tab-dashboard .carrossel-widgets .carrossel-track > div { width: 100% !important; height: auto !important; }
  #tab-dashboard .carrossel-widgets .carrossel-track > div:not(:first-child) { display: none !important; }
  #tab-dashboard .carrossel-widgets .carrossel-track > div:first-child { padding: 20px 20px 64px !important; }
  #tab-dashboard #patr-titulo { font-size: 11px !important; letter-spacing: 1.2px; text-transform: uppercase; color: var(--muted); font-weight: 700; margin: 0 0 6px !important; }
  #tab-dashboard .card-patrimonio .valor-principal { font-size: 34px !important; font-weight: 800; letter-spacing: -1px; }
  #tab-dashboard #patr-subtitulo { display: none !important; }
  #hero-celular { display: block; }
  .hc-var { position: absolute; left: 20px; top: 112px; font-size: 12px; font-weight: 700; z-index: 2; }
  .hc-var .up { color: var(--mn-verde); } .hc-var .down { color: var(--mn-verm); }
  .hc-spark { position: absolute; left: 0; right: 0; bottom: 0; height: 64px; pointer-events: none; }
  .hc-spark svg { width: 100%; height: 100%; display: block; }
  #dash-kpis { display: grid; grid-column: 1 / -1; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .dk { background: var(--mn-card); border: 1px solid var(--mn-borda); border-radius: 22px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
  .dk-t { display: flex; align-items: center; gap: 8px; font-size: 10px; font-weight: 800; letter-spacing: 1.2px; color: var(--muted); }
  .dk-ic { font-style: normal; width: 26px; height: 26px; border-radius: 9px; display: grid; place-items: center; font-size: 13px; }
  .dk-rec .dk-ic { background: rgba(46,230,160,.14); color: var(--mn-verde); }
  .dk-desp .dk-ic { background: rgba(255,92,108,.14); color: var(--mn-verm); }
  .dk b { font-size: 20px; font-weight: 800; letter-spacing: -.4px; }
  body.light #tab-dashboard .card-patrimonio .valor-principal { color: #171a26 !important; }
  body.light #tab-dashboard #patr-titulo { color: #6b7185 !important; }

  /* ---------- Início: só patrimônio, receitas/despesas e últimas transações ---------- */
  #tab-dashboard .dash-grid.dg12 > .dw.bloco-cartoes, #tab-dashboard .dash-grid.dg12 > .dw.bloco-orcamento-kpi { display: none !important; }
  #tab-dashboard .carrossel-widgets { cursor: pointer; }
  .hc-spark { height: 52px; }
  body.light #tab-dashboard .dash-grid.dg12 > .dw.carrossel-widgets { background: linear-gradient(160deg, #ffefe4, #ffffff 70%) !important; border: 1px solid #ffd9c2 !important; box-shadow: 0 10px 28px rgba(255,106,26,.10) !important; }

  /* ---------- Folha "saúde financeira" ---------- */
  #saude-fundo { display: block; position: fixed; inset: 0; background: rgba(5,6,12,.6); opacity: 0; pointer-events: none; transition: opacity .25s; z-index: 190; }
  #saude-folha {
    display: block; position: fixed; left: 0; right: 0; bottom: 0; max-height: 88dvh; overflow-y: auto; z-index: 191; box-sizing: border-box;
    background: var(--sheet-bg, #14151d); border-radius: 28px 28px 0 0; padding: 10px 20px calc(28px + env(safe-area-inset-bottom));
    transform: translateY(105%); transition: transform .35s cubic-bezier(.2,.8,.2,1); overscroll-behavior: contain;
  }
  body.light #saude-folha { background: #fff; }
  body.saude-aberta #saude-fundo { opacity: 1; pointer-events: auto; }
  body.saude-aberta #saude-folha { transform: none; }
  body.saude-aberta #bottom-nav, body.saude-aberta #fab-adicionar { visibility: hidden; }
  .sf-puxador { width: 44px; height: 5px; border-radius: 3px; background: rgba(128,130,150,.45); margin: 0 auto 16px; }
  .sf-saude { border-radius: 20px; padding: 16px; display: flex; flex-direction: column; gap: 4px; margin-bottom: 14px; }
  .sf-saude b { font-size: 17px; font-weight: 800; }
  .sf-saude span { font-size: 13px; opacity: .85; }
  .sf-saude.boa { background: rgba(46,230,160,.13); color: var(--mn-verde); }
  .sf-saude.atencao { background: rgba(255,170,40,.14); color: #f5a623; }
  .sf-saude.ruim { background: rgba(255,92,108,.14); color: var(--mn-verm); }
  .sf-saude.neutra { background: rgba(128,130,150,.14); color: var(--muted); }
  .sf-saude span { color: var(--txt); }
  .sf-chips { display: flex; gap: 8px; margin-bottom: 14px; }
  .sf-chips button { flex: 1; height: 38px; border-radius: 999px; border: 1px solid var(--mn-borda); background: var(--mn-card); color: var(--muted); font-weight: 700; font-size: 13px; }
  .sf-chips button.on { background: linear-gradient(135deg, #ff6a1a, #ffa04a); color: #fff; border-color: transparent; }
  .sf-bloco { background: var(--mn-card); border: 1px solid var(--mn-borda); border-radius: 22px; padding: 14px; margin-bottom: 12px; }
  .sf-bloco h4 { margin: 0 0 8px; font-size: 14px; font-weight: 800; }
  .sf-svg { width: 100%; height: auto; display: block; }
  .sf-eixo { font-size: 9px; fill: var(--muted); }
  .sf-uso { font-size: 13px; margin-bottom: 10px; display: flex; flex-direction: column; gap: 8px; }
  .sf-barra { height: 8px; border-radius: 4px; background: rgba(128,130,150,.2); overflow: hidden; }
  .sf-barra i { display: block; height: 100%; border-radius: 4px; }
  .sf-barra i.boa { background: var(--mn-verde); } .sf-barra i.atencao { background: #f5a623; } .sf-barra i.ruim { background: var(--mn-verm); }
  .sf-trio { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 8px; }
  .sf-trio small { display: block; font-size: 10px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .6px; }
  .sf-trio b { font-size: 14px; } .sf-trio b.v { color: var(--mn-verde); } .sf-trio b.d { color: var(--mn-verm); }
  .sf-leg { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); justify-content: center; }
  .sf-leg i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; margin-left: 8px; }
  .sf-leg i.v { background: var(--mn-verde); } .sf-leg i.d { background: var(--mn-verm); }

  /* ---------- Transações: indicadores maiores ---------- */
  #tab-lancamentos .resumo-cards { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 10px !important; }
  #tab-lancamentos .resumo-card {
    display: grid !important; grid-template-columns: 32px minmax(0, 1fr); grid-template-rows: auto auto; align-items: center; column-gap: 10px !important; row-gap: 14px;
    padding: 16px !important; border-radius: 22px !important; background: var(--mn-card) !important; border: 1px solid var(--mn-borda) !important;
  }
  #tab-lancamentos .resumo-card > div:last-child { display: contents; }
  #tab-lancamentos .resumo-card .icone { grid-column: 1; grid-row: 1; width: 32px; height: 32px; border-radius: 11px; display: grid; place-items: center; font-size: 16px !important; background: rgba(255,106,26,.14); }
  #tab-lancamentos .resumo-card.receita .icone { background: rgba(46,230,160,.14); }
  #tab-lancamentos .resumo-card.despesa .icone { background: rgba(255,92,108,.14); }
  #tab-lancamentos .resumo-card .label { grid-column: 2; grid-row: 1; font-size: 11px !important; font-weight: 800; letter-spacing: 1.2px; text-transform: uppercase; color: var(--muted); }
  #tab-lancamentos .resumo-card .valor { grid-column: 1 / -1; grid-row: 2; font-size: 22px !important; font-weight: 800; letter-spacing: -.5px; }
  #tab-lancamentos .resumo-card:nth-child(3) { grid-column: 1 / -1; }

  /* ---------- A receber / A pagar: indicadores grandes (modelo Meia-noite) ---------- */
  #tab-receber .receber-resumo, #tab-pagar .receber-resumo { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 10px !important; margin-bottom: 14px !important; }
  #tab-receber .receber-card, #tab-pagar .receber-card {
    display: grid !important; grid-template-columns: 32px minmax(0, 1fr); grid-template-rows: auto auto; align-items: center; column-gap: 10px !important; row-gap: 14px;
    padding: 16px 12px !important; border-radius: 22px !important; background: var(--mn-card) !important; border: 1px solid var(--mn-borda) !important; min-height: 0;
  }
  #tab-receber .receber-card .info, #tab-pagar .receber-card .info { display: contents; }
  #tab-receber .receber-card .icone, #tab-pagar .receber-card .icone {
    grid-column: 1; grid-row: 1; width: 32px !important; height: 32px !important; min-width: 32px !important; border-radius: 11px !important; display: grid !important; place-items: center; background: rgba(255,106,26,.14) !important;
  }
  #tab-receber .receber-card:nth-child(2) .icone, #tab-pagar .receber-card:nth-child(2) .icone { background: rgba(46,230,160,.14) !important; }
  #tab-receber .receber-card:nth-child(3) .icone, #tab-pagar .receber-card:nth-child(3) .icone { background: rgba(255,92,108,.14) !important; }
  #tab-receber .receber-card:nth-child(4) .icone, #tab-pagar .receber-card:nth-child(4) .icone { background: rgba(245,166,35,.16) !important; }
  #tab-receber .receber-card .icone i, #tab-pagar .receber-card .icone i { font-size: 16px !important; }
  #tab-receber .receber-card .rotulo, #tab-pagar .receber-card .rotulo { grid-column: 2; grid-row: 1; font-size: 9.5px !important; font-weight: 800; letter-spacing: .2px; text-transform: uppercase; color: var(--muted) !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  #tab-receber .receber-card .valor, #tab-pagar .receber-card .valor { grid-column: 1 / -1; grid-row: 2; font-size: 22px !important; font-weight: 800; letter-spacing: -.5px; }

  /* busca: 16px evita o zoom automático do Safari do iPhone ao tocar no campo */
  #rec-busca, #pag-busca, #filtro-busca { font-size: 16px !important; }

  /* ---------- Cartões: KPIs grandes + cartões deslizantes + fatura e compras ---------- */
  #tab-cartoes #lista-cartoes { display: none !important; }
  #cartoes-celular { display: block; }
  #cartoes-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 10px !important; margin-bottom: 16px !important; }
  #cartoes-kpis .receber-card {
    display: grid !important; grid-template-columns: 32px minmax(0, 1fr); grid-template-rows: auto auto; align-items: center; column-gap: 10px !important; row-gap: 14px;
    padding: 16px 12px !important; border-radius: 22px !important; background: var(--mn-card) !important; border: 1px solid var(--mn-borda) !important; min-height: 0;
  }
  #cartoes-kpis .receber-card .info { display: contents; }
  #cartoes-kpis .receber-card .icone { grid-column: 1; grid-row: 1; width: 32px !important; height: 32px !important; min-width: 32px !important; border-radius: 11px !important; display: grid !important; place-items: center; background: rgba(255,106,26,.14) !important; }
  #cartoes-kpis .receber-card:nth-child(2) .icone { background: rgba(255,92,108,.14) !important; }
  #cartoes-kpis .receber-card:nth-child(3) .icone { background: rgba(46,230,160,.14) !important; }
  #cartoes-kpis .receber-card:nth-child(4) .icone { background: rgba(245,166,35,.16) !important; }
  #cartoes-kpis .receber-card .icone i { font-size: 16px !important; }
  #cartoes-kpis .receber-card .rotulo { grid-column: 2; grid-row: 1; font-size: 9.5px !important; font-weight: 800; letter-spacing: .2px; text-transform: uppercase; color: var(--muted) !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  #cartoes-kpis .receber-card .valor { grid-column: 1 / -1; grid-row: 2; font-size: 22px !important; font-weight: 800; letter-spacing: -.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

  .cc-trilho { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-left: 12px; margin: 0 -12px; padding: 4px 12px 14px; scrollbar-width: none; -webkit-overflow-scrolling: auto; }
  .cc-trilho::-webkit-scrollbar { display: none; }
  .cc-cartao { flex: 0 0 82%; scroll-snap-align: start; aspect-ratio: 1.62 / 1; border-radius: 26px; padding: 20px; color: #fff; position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; box-sizing: border-box; box-shadow: 0 14px 30px rgba(0,0,0,.3); }
  .cc-cartao::after { content: ""; position: absolute; right: -40px; top: -40px; width: 170px; height: 170px; border-radius: 50%; background: rgba(255,255,255,.16); }
  .cc-nome { font-size: 19px; font-weight: 800; position: relative; z-index: 1; }
  .cc-chip { width: 42px; height: 30px; border-radius: 8px; background: rgba(255,255,255,.35); position: relative; z-index: 1; }
  .cc-rodape { display: flex; justify-content: space-between; font-size: 12px; position: relative; z-index: 1; }
  .cc-rodape b { font-weight: 800; }
  .cc-fatura { background: var(--mn-card); border: 1px solid var(--mn-borda); border-radius: 24px; padding: 18px; margin-bottom: 18px; }
  .cc-fat-t { font-size: 10px; font-weight: 800; letter-spacing: 1.2px; text-transform: uppercase; color: var(--muted); }
  .cc-fat-v { font-size: 30px; font-weight: 800; letter-spacing: -.8px; margin: 6px 0 12px; }
  .cc-fat-barra { height: 8px; border-radius: 4px; background: rgba(128,130,150,.2); overflow: hidden; }
  .cc-fat-barra i { display: block; height: 100%; border-radius: 4px; }
  .cc-fat-s { font-size: 12px; color: var(--muted); margin-top: 10px; }
  .cc-fat-acoes { display: flex; gap: 8px; margin-top: 14px; }
  .cc-fat-acoes button { flex: 1; height: 38px; border-radius: 12px; border: 1px solid var(--mn-borda); background: transparent; color: var(--txt); font-weight: 700; font-size: 13px; display: flex; align-items: center; justify-content: center; gap: 6px; }
  .cc-fat-acoes button.perigo { color: var(--mn-verm); }
  .cc-tit { display: flex; justify-content: space-between; align-items: baseline; margin: 2px 2px 8px; }
  .cc-tit b { font-size: 17px; font-weight: 800; }
  .cc-tit a { color: var(--mn-laranja); font-size: 12px; font-weight: 700; }
  .cc-compra { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 13px 2px; border-bottom: 1px solid var(--mn-borda); }
  .cc-compra > div { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
  .cc-compra b { font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .cc-compra i { font-style: normal; font-size: 11px; color: var(--muted); }
  .cc-compra span { font-weight: 800; font-size: 14px; white-space: nowrap; }
  .cc-compra span.pos { color: var(--mn-verde); }
  .cc-vazio { padding: 16px; text-align: center; color: var(--muted); font-size: 13px; }

  /* ---------- Metas ---------- */
  #tab-metas > div:first-child { display: none !important; }
  #metas-resumo { display: flex; justify-content: space-between; align-items: flex-end; background: var(--mn-card); border: 1px solid var(--mn-borda); border-radius: 22px; padding: 16px 18px; margin-bottom: 12px; }
  #metas-resumo small, #ass-resumo small { display: block; font-size: 10px; font-weight: 800; letter-spacing: 1.2px; color: var(--muted); }
  #metas-resumo b { font-size: 26px; font-weight: 800; letter-spacing: -.6px; }
  #metas-resumo .mr-d { text-align: right; } #metas-resumo .mr-d b { color: var(--muted); }
  #grid-metas { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 10px !important; }
  #grid-metas .meta-card { background: var(--mn-card) !important; border: 1px solid var(--mn-borda) !important; border-radius: 22px !important; padding: 14px !important; min-height: 0 !important; }
  #grid-metas .meta-card > :not(.mt-cel) { display: none !important; }
  .mt-cel { display: block; }
  .mt-l1 { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
  .mt-l1 b { font-size: 17px; font-weight: 800; }
  .mt-ic { width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; font-size: 19px; }
  .mt-nome { font-size: 15px; font-weight: 800; line-height: 1.2; min-height: 36px; }
  .mt-barra { height: 6px; border-radius: 3px; background: rgba(128,130,150,.22); overflow: hidden; margin: 10px 0 8px; }
  .mt-barra i { display: block; height: 100%; border-radius: 3px; }
  .mt-val { font-size: 11px; color: var(--muted); margin-bottom: 12px; }
  .mt-bt { display: grid; grid-template-columns: 1fr 42px; gap: 8px; }
  .mt-bt button { height: 38px; border: none; border-radius: 12px; display: grid; place-items: center; font-size: 17px; }
  .mt-mais { background: linear-gradient(135deg, #ff6a1a, #ff8a3d); color: #fff; }
  .mt-del { background: rgba(128,130,150,.14); color: var(--mn-verm); }

  /* ---------- Assinaturas ---------- */
  #tab-assinaturas > .receber-resumo, #tab-assinaturas h3 { display: none !important; }
  #ass-resumo { display: block; background: var(--mn-card); border: 1px solid var(--mn-borda); border-radius: 22px; padding: 16px 18px; margin-bottom: 12px; }
  #ass-resumo b { display: block; font-size: 30px; font-weight: 800; letter-spacing: -.8px; margin: 4px 0 2px; }
  #ass-resumo i { font-style: normal; font-size: 11px; color: var(--muted); }
  #grid-assinaturas, #tab-assinaturas > div:last-child:not(.receber-resumo) { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 10px !important; }
  #tab-assinaturas .meta-card { background: var(--mn-card) !important; border: 1px solid var(--mn-borda) !important; border-radius: 22px !important; padding: 14px !important; }
  #tab-assinaturas .meta-card > :not(.as-cel) { display: none !important; }
  .as-cel { display: flex; flex-direction: column; gap: 2px; }
  .as-av { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 15px; margin-bottom: 10px; }
  .as-cel b { font-size: 14px; font-weight: 800; }
  .as-cel small { font-size: 11px; color: var(--muted); margin-bottom: 8px; }
  .as-cel strong { font-size: 18px; font-weight: 800; letter-spacing: -.4px; }

  /* ---------- Usuários ---------- */
  #tab-usuarios > div:has(> #btn-novo-usuario) { display: none !important; }
  #usr-chips { display: flex; gap: 8px; overflow-x: auto; margin: 0 -12px 12px; padding: 0 12px; scrollbar-width: none; }
  #usr-chips::-webkit-scrollbar { display: none; }
  #usr-chips button { flex: none; height: 36px; padding: 0 16px; border-radius: 999px; border: none; background: rgba(128,130,150,.16); color: var(--muted); font-weight: 700; font-size: 13px; }
  #usr-chips button.on { background: linear-gradient(135deg, #ff6a1a, #ffa04a); color: #fff; }
  #tab-usuarios tbody tr { grid-template-columns: minmax(0, 1fr) auto !important; row-gap: 2px !important; padding: 14px !important; }
  #tab-usuarios tbody td:nth-child(1) { grid-column: 1 !important; grid-row: 1 !important; }
  #tab-usuarios tbody td:nth-child(2) { grid-column: 1 !important; grid-row: 2 !important; padding-left: 52px !important; margin-top: -22px; }
  #tab-usuarios tbody td:nth-child(3) { grid-column: 2 !important; grid-row: 1 / 3 !important; align-self: center; }
  #tab-usuarios tbody td:nth-child(4), #tab-usuarios tbody td:nth-child(5) { display: none !important; grid-column: 1 / -1 !important; grid-row: auto !important; text-align: left !important; }
  #tab-usuarios tbody tr.aberto td:nth-child(4), #tab-usuarios tbody tr.aberto td:nth-child(5) { display: block !important; margin-top: 10px; }
  #tab-usuarios tbody td:nth-child(1) .usr-nome { font-size: 16px; font-weight: 800; }
  #tab-usuarios tr[data-grupo="Administrador"] td:nth-child(3) span { background: rgba(255,106,26,.16) !important; color: #ff6a1a !important; }
  #tab-usuarios tr[data-grupo="Usuário comum"] td:nth-child(3) span { background: rgba(79,107,255,.18) !important; color: #6b86ff !important; }
  #tab-usuarios tr[data-grupo="Fornecedor"] td:nth-child(3) span { background: rgba(46,230,160,.15) !important; color: var(--mn-verde) !important; }
  #tab-usuarios tr[data-grupo="Cliente"] td:nth-child(3) span { background: rgba(124,77,255,.18) !important; color: #9a7bff !important; }

  /* ---------- Configurações: menu em linhas ---------- */
  #tab-config .receber-layout { display: block !important; }
  #cfg-perfil-card { display: flex; align-items: center; gap: 14px; background: var(--mn-card); border: 1px solid var(--mn-borda); border-radius: 22px; padding: 16px; margin-bottom: 12px; cursor: pointer; }
  .cfg-av { width: 52px; height: 52px; border-radius: 50%; background: linear-gradient(135deg, #ff6a1a, #ffa04a); color: #fff; font-weight: 800; font-size: 18px; display: grid; place-items: center; flex: none; }
  #cfg-perfil-card > div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
  #cfg-perfil-card b { font-size: 16px; font-weight: 800; }
  #cfg-perfil-card small { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
  .cfg-seta { font-style: normal; font-size: 24px; color: var(--muted); }
  #tab-config .receber-layout > div:first-child { background: var(--mn-card) !important; border: 1px solid var(--mn-borda) !important; border-radius: 22px !important; padding: 6px 14px !important; gap: 0 !important; flex-direction: column !important; overflow: visible !important; }
  #tab-config .config-tab-btn { display: flex !important; align-items: center; gap: 14px; width: 100% !important; text-align: left; padding: 14px 0 !important; border: none !important; border-bottom: 1px solid var(--mn-borda) !important; border-radius: 0 !important; background: transparent !important; color: var(--txt) !important; font-weight: 700; font-size: 15px; white-space: normal !important; }
  #tab-config .config-tab-btn:last-child { border-bottom: none !important; }
  #tab-config .config-tab-btn i { width: 36px; height: 36px; border-radius: 12px; background: rgba(255,106,26,.14); color: #ff6a1a; display: grid; place-items: center; font-size: 17px; flex: none; }
  #tab-config .config-tab-btn::after { content: "›"; margin-left: auto; font-size: 22px; color: var(--muted); font-weight: 400; }
  #tab-config.cfg-menu #config-content { display: none !important; }
  #tab-config:not(.cfg-menu) .receber-layout > div:first-child, #tab-config:not(.cfg-menu) #cfg-perfil-card { display: none !important; }
  #tab-config:not(.cfg-menu) #config-content { padding: 18px !important; }
  #cfg-voltar { display: none; background: none; border: none; color: var(--mn-laranja); font-weight: 800; font-size: 15px; padding: 4px 0 12px; }
  #tab-config:not(.cfg-menu) #cfg-voltar { display: block; }

  .mt-bt button { width: 100% !important; min-width: 0 !important; padding: 0 !important; }
  .mt-mais { background: linear-gradient(135deg, #ff6a1a, #ff8a3d) !important; color: #fff !important; border-radius: 12px !important; }
  .mt-del { background: rgba(128,130,150,.14) !important; border-radius: 12px !important; }
  #tab-assinaturas > *:not(#ass-resumo):not(#grid-assinaturas) { display: none !important; }
  #tab-usuarios > div:has(> table) { background: none !important; border: none !important; padding: 0 !important; }
  #tab-usuarios tbody td:nth-child(2) { margin-top: 0 !important; }
  #tab-config .config-tab-btn.ativo { background: transparent !important; color: var(--txt) !important; }

  #grid-metas .meta-card .mt-bt button { width: 100% !important; height: 38px !important; min-width: 0 !important; border-radius: 12px !important; padding: 0 !important; display: grid !important; place-items: center; font-size: 17px !important; }
  #grid-metas .meta-card .mt-bt button i { font-size: 17px !important; }
  #grid-metas .meta-card .mt-bt .mt-mais { background: linear-gradient(135deg, #ff6a1a, #ff8a3d) !important; color: #fff !important; }
  #grid-metas .meta-card .mt-bt .mt-del { background: rgba(128,130,150,.14) !important; color: var(--mn-verm) !important; }

  #usr-chips button { flex: 0 0 auto !important; width: auto !important; min-width: 0 !important; height: 36px !important; padding: 0 16px !important; border-radius: 999px !important; }
  #tab-usuarios h3 { display: none !important; }

  /* ---------- Agenda: KPIs, calendário que desliza e próximos pagamentos ---------- */
  #tab-agenda .receber-layout > div:first-child > :not(.receber-resumo):not(#agenda-celular) { display: none !important; }
  #tab-agenda .receber-resumo { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 10px !important; margin-bottom: 14px !important; }
  #tab-agenda .receber-card, #tab-investimentos .receber-card {
    display: grid !important; grid-template-columns: 32px minmax(0, 1fr); grid-template-rows: auto auto; align-items: center; column-gap: 10px !important; row-gap: 14px;
    padding: 16px 12px !important; border-radius: 22px !important; background: var(--mn-card) !important; border: 1px solid var(--mn-borda) !important; min-height: 0;
  }
  #tab-agenda .receber-card .info, #tab-investimentos .receber-card .info { display: contents; }
  #tab-agenda .receber-card .icone, #tab-investimentos .receber-card .icone { grid-column: 1; grid-row: 1; width: 32px !important; height: 32px !important; min-width: 32px !important; border-radius: 11px !important; display: grid !important; place-items: center; background: rgba(255,106,26,.14) !important; }
  #tab-agenda .receber-card:nth-child(1) .icone, #tab-investimentos .receber-card:nth-child(3) .icone { background: rgba(46,230,160,.14) !important; }
  #tab-agenda .receber-card:nth-child(2) .icone { background: rgba(255,92,108,.14) !important; }
  #tab-investimentos .receber-card:nth-child(1) .icone { background: rgba(124,77,255,.16) !important; }
  #tab-investimentos .receber-card:nth-child(2) .icone { background: rgba(79,107,255,.16) !important; }
  #tab-agenda .receber-card .icone i, #tab-investimentos .receber-card .icone i { font-size: 16px !important; }
  #tab-agenda .receber-card .rotulo, #tab-investimentos .receber-card .rotulo { grid-column: 2; grid-row: 1; font-size: 9.5px !important; font-weight: 800; letter-spacing: .2px; text-transform: uppercase; color: var(--muted) !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  #tab-agenda .receber-card .valor, #tab-investimentos .receber-card .valor { grid-column: 1 / -1; grid-row: 2; font-size: 22px !important; font-weight: 800; letter-spacing: -.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  #tab-investimentos .receber-resumo { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 10px !important; margin-bottom: 14px !important; }

  #agenda-celular { display: block; }
  .ag-cal { background: var(--mn-card); border: 1px solid var(--mn-borda); border-radius: 26px; padding: 14px 12px 12px; margin-bottom: 18px; overflow: hidden; touch-action: pan-y; }
  .ag-cab { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; padding: 0 4px; }
  .ag-titulo { background: none; border: none; color: var(--txt); font-size: 18px; font-weight: 800; padding: 6px 0; display: flex; align-items: center; gap: 6px; width: auto; }
  .ag-titulo em { font-style: normal; color: var(--mn-laranja); font-size: 22px; line-height: 1; }
  .ag-nav { display: flex; align-items: center; gap: 6px; }
  .ag-nav button { width: 34px; height: 34px; border-radius: 50%; border: none; background: rgba(128,130,150,.14); color: var(--txt); font-size: 20px; line-height: 1; padding: 0; display: grid; place-items: center; }
  .ag-nav .ag-hoje { width: auto; padding: 0 14px; border-radius: 999px; font-size: 13px; font-weight: 800; color: var(--mn-laranja); }
  .ag-sem { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; font-size: 11px; font-weight: 800; color: var(--muted); margin-bottom: 4px; }
  .ag-dias { display: grid; grid-template-columns: repeat(7, 1fr); row-gap: 2px; }
  .ag-dias > i { height: 46px; }
  .ag-dias button { height: 46px; background: none; border: none; color: var(--txt); padding: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; position: relative; width: auto; }
  .ag-dias button b { font-size: 15px; font-weight: 600; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; }
  .ag-dias button.hoje b { background: var(--mn-laranja); color: #fff; font-weight: 800; box-shadow: 0 6px 14px rgba(255,106,26,.35); }
  .ag-dias button.sel:not(.hoje) b { box-shadow: inset 0 0 0 2px var(--mn-laranja); }
  .ag-dias button span { position: absolute; bottom: 1px; display: flex; gap: 3px; height: 6px; }
  .ag-dias button u { width: 6px; height: 6px; border-radius: 50%; display: block; }
  .ag-dias button u.r { background: var(--mn-verde); } .ag-dias button u.p { background: var(--mn-verm); }
  .ag-dias button.hoje span { bottom: -1px; }
  .ag-grade { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 6px 0 4px; }
  .ag-grade button { height: 64px; border-radius: 18px; border: none; background: rgba(128,130,150,.1); color: var(--txt); font-size: 16px; font-weight: 700; width: auto; }
  .ag-grade button.hoje { color: var(--mn-laranja); }
  .ag-grade button.sel { background: linear-gradient(135deg, #ff6a1a, #ffa04a); color: #fff; }
  .ag-corpo.dir { animation: agDir .28s ease; } .ag-corpo.esq { animation: agEsq .28s ease; } .ag-corpo.zoom { animation: agZoom .25s ease; }
  @keyframes agDir { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
  @keyframes agEsq { from { transform: translateX(-40px); opacity: 0; } to { transform: none; opacity: 1; } }
  @keyframes agZoom { from { transform: scale(.94); opacity: 0; } to { transform: none; opacity: 1; } }
  .ag-tit { margin: 2px 2px 10px; } .ag-tit b { font-size: 17px; font-weight: 800; }
  .ag-prox { display: flex; align-items: center; gap: 12px; padding: 12px; margin-bottom: 8px; background: var(--mn-card); border: 1px solid var(--mn-borda); border-radius: 18px; }
  .ag-prox i { width: 4px; align-self: stretch; border-radius: 2px; flex: none; }
  .ag-prox i.r { background: var(--mn-verde); } .ag-prox i.p { background: var(--mn-verm); }
  .ag-prox > div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
  .ag-prox b { font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .ag-prox small { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .ag-prox span { font-weight: 800; font-size: 14px; white-space: nowrap; }
  .ag-prox span.r { color: var(--mn-verde); } .ag-prox span.p { color: var(--mn-verm); }
  .ag-vazio { padding: 16px; text-align: center; color: var(--muted); font-size: 13px; }

  /* ---------- Investimentos: blocos e gráficos refinados ---------- */
  #tab-investimentos .bloco { background: var(--mn-card) !important; border: 1px solid var(--mn-borda) !important; border-radius: 24px !important; padding: 16px !important; box-shadow: none !important; }
  #tab-investimentos .bloco h3 { font-size: 16px !important; font-weight: 800; text-transform: none !important; letter-spacing: 0 !important; color: var(--txt) !important; margin: 0 0 12px !important; display: flex; justify-content: space-between; align-items: baseline; }
  #tab-investimentos .bloco h3 span { font-size: 11px !important; font-weight: 700 !important; color: var(--mn-laranja) !important; background: rgba(255,106,26,.12); padding: 4px 10px; border-radius: 999px; }
  #tab-investimentos #chart-evolucao-inv { min-height: 190px !important; margin: 0 -6px; }
  #tab-investimentos #chart-carteira-inv { width: 150px !important; height: 150px !important; flex: none; }
  #tab-investimentos .alocacao-info { font-size: 12px; font-weight: 700; }
  #tab-investimentos .ativo-card { background: var(--mn-card) !important; border: 1px solid var(--mn-borda) !important; border-radius: 20px !important; }

  /* ===== Menu lateral (gaveta) ===== */
  html body #mais-folha { left: 0 !important; right: auto !important; top: 0 !important; bottom: 0 !important; width: min(82vw, 320px) !important; max-height: none !important; height: 100dvh !important; border-radius: 0 28px 28px 0 !important; border: 0 !important; border-right: 1px solid var(--mn-borda) !important; background: var(--sheet-bg, var(--mn-card)) !important; padding: calc(env(safe-area-inset-top, 0px) + 22px) 14px calc(env(safe-area-inset-bottom, 0px) + 16px) !important; transform: translateX(-105%) !important; display: flex !important; flex-direction: column; overflow-y: auto !important; z-index: 950; }
  html body.mais-aberto #mais-folha { transform: none !important; box-shadow: 18px 0 50px rgba(0,0,0,.45) !important; }
  html body.mais-aberto #bottom-nav { z-index: 900 !important; }
  #mais-folha .mais-alca { display: none !important; }
  #mais-grade { display: flex; flex-direction: column; flex: 1; min-height: 0; }
  .mg-topo { display: flex; align-items: center; gap: 12px; padding: 2px 4px 14px; }
  .mg-topo .mp-avatar { width: 46px; height: 46px; flex: none; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 800; color: #fff; background: linear-gradient(135deg, #ff6a1a, #ffa04a); }
  .mg-topo .mp-info { flex: 1; min-width: 0; }
  .mg-topo .mp-nome { font-weight: 800; font-size: 15px; color: var(--txt); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .mg-topo .mp-papel { font-size: 11px; color: var(--muted); }
  .mg-marca { margin-left: auto; font-weight: 900; font-size: 26px; line-height: 1; letter-spacing: -1px; background: linear-gradient(135deg, #ff6a1a, #ffa04a); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: #ff6a1a; }
  .mg-secao { font-size: 10.5px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; color: var(--muted); margin: 16px 12px 6px; }
  .mg-item { all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 12px; border-radius: 14px; font-size: 14.5px; font-weight: 600; color: var(--txt); cursor: pointer; -webkit-tap-highlight-color: transparent; }
  .mg-item i { font-size: 20px; color: var(--muted); }
  .mg-item:active { background: rgba(255,255,255,.06); }
  .mg-item.ativo { color: #fff; background: linear-gradient(135deg, #ff6a1a, #ffa04a); box-shadow: 0 8px 20px rgba(255,106,26,.3); }
  .mg-item.ativo i { color: #fff; }
  .mg-rodape { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--mn-borda); }
  .mg-sair, .mg-sair i { color: var(--mn-verm) !important; }
  body.light .mg-item:active { background: rgba(0,0,0,.05); }

  /* ===== Barra inferior só com o "+" ; menu pelo ☰ do cabeçalho ===== */
  #bn-menu { display: none; }
  #bn-menu.visivel { all: unset; box-sizing: border-box; position: fixed; left: 18px; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); z-index: 900; width: 58px; height: 58px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 28px; color: #ff6a1a; background: var(--mn-card); border: 0; box-shadow: 0 12px 28px rgba(0,0,0,.35); cursor: pointer; -webkit-tap-highlight-color: transparent; }
  #bn-menu.visivel i { color: #ff6a1a; font-weight: 700; }
  #bn-menu.visivel:active { transform: scale(.93); }
  body.mais-aberto #bn-menu, body.saude-aberta #bn-menu, body.sheet-aberto-body #bn-menu { visibility: hidden; }
  html body #bottom-nav.visivel { left: auto !important; right: 18px !important; bottom: calc(18px + env(safe-area-inset-bottom, 0px)) !important; width: auto !important; height: auto !important; padding: 0 !important; background: transparent !important; border: 0 !important; box-shadow: none !important; -webkit-backdrop-filter: none !important; backdrop-filter: none !important; pointer-events: none; display: block !important; }
  #bottom-nav .bn-item { display: none !important; }
  html body #bottom-nav .bn-add { pointer-events: auto; margin-top: 0 !important; width: 58px; height: 58px; box-shadow: 0 12px 28px rgba(255,106,26,.5) !important; }
  html body #bottom-nav .bn-add.sem-acao { display: none !important; }
  html body.mais-aberto #bottom-nav { visibility: hidden; }
  .main-content { padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)) !important; }

  /* ---------- Documentos no padrão Meia-noite ---------- */
  #tab-documentos .receber-resumo { gap: 10px !important; margin-bottom: 16px !important; }
  #tab-documentos .receber-resumo .receber-card {
    display: grid !important; grid-template-columns: 32px minmax(0, 1fr); grid-template-rows: auto auto; align-items: center; column-gap: 10px !important; row-gap: 14px;
    padding: 16px 12px !important; border-radius: 22px !important; background: var(--mn-card) !important; border: 1px solid var(--mn-borda) !important; min-height: 0;
  }
  #tab-documentos .receber-card .info { display: contents; }
  #tab-documentos .receber-card .icone { grid-column: 1; grid-row: 1; width: 32px !important; height: 32px !important; min-width: 32px !important; border-radius: 11px !important; display: grid !important; place-items: center; background: rgba(255,106,26,.14) !important; }
  #tab-documentos .receber-card:nth-child(2) .icone { background: rgba(46,230,160,.14) !important; }
  #tab-documentos .receber-card .icone i { font-size: 16px !important; }
  #tab-documentos .receber-card .rotulo { grid-column: 2; grid-row: 1; font-size: 8.5px !important; font-weight: 800; letter-spacing: .2px; text-transform: uppercase; color: var(--muted) !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  #tab-documentos .receber-card .valor { grid-column: 1 / -1; grid-row: 2; font-size: 22px !important; font-weight: 800; letter-spacing: -.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  #tab-documentos .receber-layout > div:first-child > div:has(> table) { background: transparent !important; border: 0 !important; padding: 0 !important; border-radius: 0 !important; }
  #tab-documentos .filtros-bar { margin-bottom: 14px !important; }
  #doc-tbody tr:not(:has(td[colspan])) { background: var(--mn-card) !important; border: 1px solid var(--mn-borda) !important; border-radius: 22px !important; padding: 14px 16px !important; margin-bottom: 10px !important; gap: 3px 10px !important; box-shadow: none !important; }
  #doc-tbody td:nth-child(3) { font-size: 15px !important; font-weight: 800 !important; color: var(--txt); }
  #doc-tbody td:nth-child(5) { font-size: 15px !important; font-weight: 800 !important; color: var(--mn-verde) !important; letter-spacing: -.3px; }
  #doc-tbody td:nth-child(2) { font-size: 12px !important; }
  #doc-tbody td:nth-child(1) { align-self: center; padding-top: 6px !important; }
  #doc-tbody td:nth-child(1) .badge-origem { background: rgba(255,106,26,.14) !important; color: var(--mn-laranja) !important; border: 0 !important; font-size: 10px !important; font-weight: 800; padding: 4px 10px !important; border-radius: 99px !important; }
  #doc-tbody td:nth-child(6) { padding-top: 6px !important; display: flex; justify-content: flex-end; gap: 8px; }
  #doc-tbody .btn-ver-linha { width: 40px !important; height: 36px !important; min-width: 40px !important; max-height: 36px !important; box-sizing: border-box !important; padding: 0 !important; margin: 0 !important; border-radius: 12px !important; display: grid !important; place-items: center; background: var(--mn-card) !important; border: 1px solid var(--mn-borda) !important; color: var(--txt) !important; }
  #doc-tbody .btn-ver-linha[title="Excluir"] { background: rgba(255,92,108,.1) !important; border-color: rgba(255,92,108,.3) !important; color: var(--mn-verm) !important; }
  #doc-tbody tr:has(td[colspan]) { background: transparent !important; border: 0 !important; }

  /* ---------- KPIs: só o ícone (sem caixa ao redor) ---------- */
  html body .receber-card .icone, html body .resumo-card .icone, html body #cartoes-kpis .receber-card .icone, html body #tab-documentos .receber-card .icone, html body #tab-agenda .receber-card .icone, html body #tab-investimentos .receber-card .icone, html body #tab-receber .receber-card .icone, html body #tab-pagar .receber-card .icone, html body #tab-lancamentos .resumo-card .icone, html body .dk .dk-ic {
    background: transparent !important; border: 0 !important; box-shadow: none !important; border-radius: 0 !important;
  }
  html body .receber-card .icone i, html body .resumo-card .icone i { font-size: 20px !important; }
  html body .dk .dk-ic { font-size: 17px; width: 22px; height: 22px; }
  html body #doc-tbody td:nth-child(6) { justify-self: end !important; width: auto !important; margin: 0 !important; padding: 6px 0 0 !important; display: flex !important; justify-content: flex-end !important; gap: 8px; }

  html body [id^="tab-"] .receber-card:nth-child(n) .icone, html body #cartoes-kpis .receber-card:nth-child(n) .icone, html body [id^="tab-"] .resumo-card.resumo-card.resumo-card .icone { background: transparent !important; border: 0 !important; box-shadow: none !important; border-radius: 0 !important; }

  html body #tab-receber .receber-card:nth-child(n):nth-child(n) .icone,html body #tab-pagar .receber-card:nth-child(n):nth-child(n) .icone,html body #tab-agenda .receber-card:nth-child(n):nth-child(n) .icone,html body #tab-investimentos .receber-card:nth-child(n):nth-child(n) .icone,html body #tab-documentos .receber-card:nth-child(n):nth-child(n) .icone,html body #tab-cartoes .receber-card:nth-child(n):nth-child(n) .icone,html body #tab-lancamentos .receber-card:nth-child(n):nth-child(n) .icone { background: transparent !important; border: 0 !important; box-shadow: none !important; border-radius: 0 !important; }

  /* ---------- Sino de notificações com bolinha vermelha ---------- */
  html body #btn-notificacoes { display: flex !important; position: relative; align-items: center; justify-content: center; }
  html body #btn-notificacoes #badge-notificacoes { display: none !important; }
  html body #btn-notificacoes[data-pend="1"]::after { content: ""; position: absolute; top: 7px; right: 8px; width: 10px; height: 10px; border-radius: 50%; background: #ff3b4e; box-shadow: 0 0 0 2px var(--bg); }
  html body .toast-alerta { display: none !important; }

  /* ---------- Filtro de período personalizado: datas cabem na tela ---------- */
  .mf-datas { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important; gap: 10px !important; }
  .mf-datas label { min-width: 0; font-size: 11px !important; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; }
  .mf-datas input[type="date"] { -webkit-appearance: none; appearance: none; display: block; width: 100% !important; min-width: 0 !important; max-width: 100%; box-sizing: border-box; height: 50px; padding: 0 10px !important; font-size: 16px !important; text-align: left; text-transform: none; letter-spacing: 0; border-radius: 14px !important; margin: 0; }
  .mf-datas input[type="date"]::-webkit-date-and-time-value { text-align: left; min-width: 0; }

  /* ---------- Logo do cabeçalho clicável ---------- */
  #hdr-sub .hs-logo { cursor: pointer; -webkit-tap-highlight-color: transparent; }
  #hdr-sub .hs-logo:active { transform: scale(.92); }

  /* ---------- Dica: instalar como app ---------- */
  #dica-app { position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); z-index: 2000; padding: 18px 16px 14px; border-radius: 26px; background: var(--mn-card); border: 1px solid rgba(255,106,26,.35); box-shadow: 0 24px 60px rgba(0,0,0,.55); color: var(--txt); transform: translateY(130%); transition: transform .4s cubic-bezier(.22,1,.36,1); }
  #dica-app.aberta { transform: none; }
  #dica-app .da-x { all: unset; position: absolute; top: 12px; right: 12px; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: rgba(148,163,184,.14); color: var(--muted); cursor: pointer; font-size: 14px; }
  #dica-app .da-topo { display: flex; gap: 12px; align-items: center; padding-right: 34px; }
  #dica-app .da-topo img { width: 46px; height: 46px; border-radius: 14px; flex: none; }
  #dica-app .da-tit { font-weight: 800; font-size: 16px; letter-spacing: -.3px; }
  #dica-app .da-sub { font-size: 12px; color: var(--muted); margin-top: 2px; line-height: 1.35; }
  #dica-app .da-passos { list-style: none; margin: 14px 0 12px; padding: 0; display: flex; flex-direction: column; gap: 10px; }
  #dica-app .da-passos li { display: flex; gap: 12px; align-items: center; font-size: 13px; line-height: 1.4; }
  #dica-app .da-ic { flex: none; width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; background: rgba(255,106,26,.14); color: #ff6a1a; font-size: 18px; }
  #dica-app .da-acoes { display: flex; gap: 10px; }
  #dica-app .da-ok { all: unset; flex: 1.4; box-sizing: border-box; height: 48px; border-radius: 16px; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 14px; color: #fff; background: linear-gradient(135deg, #ff6a1a, #ffa04a); box-shadow: 0 8px 20px rgba(255,106,26,.3); cursor: pointer; }
  #dica-app .da-nao { all: unset; flex: 1; box-sizing: border-box; height: 48px; border-radius: 16px; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; border: 1px solid var(--mn-borda); color: var(--txt); cursor: pointer; }
  #dica-app .da-nunca { all: unset; display: block; margin: 10px auto 0; font-size: 11.5px; color: var(--muted); text-decoration: underline; cursor: pointer; text-align: center; }
  body.light #dica-app { box-shadow: 0 24px 60px rgba(30,41,80,.22); }

  /* ---------- KPIs: ícones e números maiores ---------- */
  html body [id^="tab-"] .receber-card:nth-child(n) .icone, html body #cartoes-kpis .receber-card .icone, html body #tab-lancamentos .resumo-card .icone { font-size: 24px !important; }
  html body [id^="tab-"] .receber-card .icone i, html body #cartoes-kpis .receber-card .icone i, html body #tab-lancamentos .resumo-card .icone i { font-size: 25px !important; }
  html body #tab-lancamentos .resumo-card .valor, html body #tab-receber .receber-card .valor, html body #tab-pagar .receber-card .valor, html body #cartoes-kpis .receber-card .valor, html body #tab-agenda .receber-card .valor, html body #tab-investimentos .receber-card .valor, html body #tab-documentos .receber-card .valor { font-size: 25px !important; }
  html body .dk b { font-size: 25px; white-space: nowrap; overflow: hidden; text-overflow: clip; }
  html body .dk .dk-ic { width: 24px; height: 24px; background: transparent !important; flex: none; }
  html body .dk-rec .dk-ic { color: var(--mn-verde); } html body .dk-desp .dk-ic { color: var(--mn-verm); }
  html body .dk-t { font-size: 11px; letter-spacing: 1.2px; }

  /* ---------- Painel de notificações igual aos outros modais ---------- */
  html body #drawer-notificacoes { background: var(--sheet-bg, #14151d) !important; background-color: var(--sheet-bg, #14151d) !important; -webkit-backdrop-filter: none !important; backdrop-filter: none !important; border: 0 !important; border-top: 1px solid rgba(255,255,255,.1) !important; border-radius: 28px 28px 0 0 !important; padding: 26px 0 calc(16px + env(safe-area-inset-bottom, 0px)) !important; z-index: 1600; }
  html body.light #drawer-notificacoes { background: #fff !important; background-color: #fff !important; border-top-color: rgba(15,23,42,.06) !important; }
  #drawer-notificacoes .drawer-header { padding: 6px 20px 10px !important; border-bottom: 0 !important; position: relative; }
  #drawer-notificacoes .drawer-header h2 { font-size: 22px !important; font-weight: 800 !important; letter-spacing: -.5px; margin: 0 0 2px !important; padding-right: 44px; }
  #drawer-notificacoes .drawer-body { padding: 4px 16px 12px !important; }
  html body #btn-fechar-notif { position: absolute; top: 4px; right: 14px; width: 34px !important; height: 34px !important; min-width: 34px !important; border-radius: 50% !important; background: rgba(148,163,184,.14) !important; border: 0 !important; color: var(--muted) !important; font-size: 16px !important; }

  /* ---------- KPIs: títulos maiores e ícones maiores ---------- */
  html body #tab-receber .receber-card .rotulo,html body #tab-pagar .receber-card .rotulo,html body #tab-agenda .receber-card .rotulo,html body #tab-investimentos .receber-card .rotulo,html body #tab-documentos .receber-card .rotulo,html body #tab-cartoes .receber-card .rotulo,html body #cartoes-kpis .receber-card .rotulo { font-size: 11px !important; letter-spacing: .1px !important; white-space: normal !important; line-height: 1.15; overflow: visible !important; text-overflow: clip !important; }
  html body #tab-lancamentos .resumo-card .label { font-size: 12px !important; letter-spacing: .6px !important; }
  html body .dk-t { font-size: 12px; }
  html body [id^="tab-"] .receber-card:nth-child(n) .icone, html body #cartoes-kpis .receber-card .icone, html body #tab-lancamentos .resumo-card .icone { width: 34px !important; height: 34px !important; min-width: 34px !important; font-size: 30px !important; }
  html body [id^="tab-"] .receber-card .icone i, html body #cartoes-kpis .receber-card .icone i, html body #tab-lancamentos .resumo-card .icone i { font-size: 30px !important; }
  html body #tab-receber .receber-resumo .receber-card, html body #tab-pagar .receber-resumo .receber-card, html body #cartoes-kpis .receber-card, html body #tab-documentos .receber-resumo .receber-card, html body #tab-agenda .receber-resumo .receber-card, html body #tab-investimentos .receber-resumo .receber-card, html body #tab-lancamentos .resumo-card { grid-template-columns: 34px minmax(0, 1fr) !important; }
  html body .dk .dk-ic { width: 30px; height: 30px; }

  /* ---------- KPIs: tudo igual à tela de Transações ---------- */
  html body #tab-receber .receber-card .rotulo,html body #tab-pagar .receber-card .rotulo,html body #tab-agenda .receber-card .rotulo,html body #tab-investimentos .receber-card .rotulo,html body #tab-documentos .receber-card .rotulo,html body #cartoes-kpis .receber-card .rotulo { font-size: 12px !important; font-weight: 800 !important; letter-spacing: .6px !important; text-transform: uppercase; white-space: normal !important; line-height: 1.15; overflow: visible !important; text-overflow: clip !important; }
  html body #tab-receber .receber-resumo .receber-card,html body #tab-pagar .receber-resumo .receber-card,html body #tab-agenda .receber-resumo .receber-card,html body #tab-investimentos .receber-resumo .receber-card,html body #tab-documentos .receber-resumo .receber-card,html body #cartoes-kpis .receber-card { padding: 16px !important; column-gap: 10px !important; row-gap: 14px !important; border-radius: 22px !important; }
  html body .receber-card .valor, html body .resumo-card .valor { white-space: nowrap; overflow: hidden; text-overflow: clip; }

  /* ---------- Ícones dos KPIs: mesmo tamanho da tela de Transações (30px) em todas as telas ---------- */
  html body #tab-receber .receber-resumo .receber-card:nth-child(n) .icone,html body #tab-pagar .receber-resumo .receber-card:nth-child(n) .icone,html body #tab-agenda .receber-resumo .receber-card:nth-child(n) .icone,html body #tab-investimentos .receber-resumo .receber-card:nth-child(n) .icone,html body #tab-documentos .receber-resumo .receber-card:nth-child(n) .icone { width: 34px !important; height: 34px !important; min-width: 34px !important; font-size: 30px !important; }
  html body #tab-receber .receber-resumo .receber-card:nth-child(n) .icone i,html body #tab-pagar .receber-resumo .receber-card:nth-child(n) .icone i,html body #tab-agenda .receber-resumo .receber-card:nth-child(n) .icone i,html body #tab-investimentos .receber-resumo .receber-card:nth-child(n) .icone i,html body #tab-documentos .receber-resumo .receber-card:nth-child(n) .icone i { font-size: 30px !important; width: 30px !important; height: 30px !important; line-height: 1 !important; }

  /* ---------- Cartão do patrimônio: visual premium ---------- */
  html body #tab-dashboard .dash-grid.dg12 > .dw.carrossel-widgets {
    background: radial-gradient(120% 100% at 100% 0%, rgba(255,106,26,.12), transparent 55%), var(--mn-card) !important;
    border: 1px solid var(--mn-borda) !important; box-shadow: 0 14px 34px rgba(0,0,0,.28) !important; min-height: 214px !important;
  }
  html body #tab-dashboard .carrossel-widgets .carrossel-track > div:first-child { padding: 20px 20px 96px !important; }
  .hc-var { top: 100px; }
  .hc-var span { display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 99px; font-size: 11.5px; font-weight: 800; }
  .hc-var .up { background: rgba(46,230,160,.12); } .hc-var .down { background: rgba(255,92,108,.12); }
  .hc-plus { position: absolute; top: 14px; right: 14px; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: var(--mn-laranja); background: rgba(255,106,26,.12); border: 1px solid rgba(255,106,26,.38); z-index: 3; }
  .hc-spark { left: 20px !important; right: 20px !important; bottom: 18px !important; height: 58px !important; color: var(--txt); }
  .hc-dot { position: absolute; right: -4px; width: 9px; height: 9px; margin-top: -4.5px; border-radius: 50%; background: #ff7a2e; box-shadow: 0 0 0 4px rgba(255,106,26,.22), 0 0 14px rgba(255,106,26,.6); }
  html body.light #tab-dashboard .dash-grid.dg12 > .dw.carrossel-widgets { background: radial-gradient(120% 100% at 100% 0%, rgba(255,106,26,.10), transparent 55%), var(--mn-card) !important; border: 1px solid var(--mn-borda) !important; box-shadow: none !important; }

  body.light #bn-menu.visivel { box-shadow: 0 10px 26px rgba(30,41,80,.18); }

  /* ===== TEMAS: Preto OLED (escuro) e Branco Puro (claro) ===== */
  html body { --bg: #000; --card: #0e0e10; --card-hover: #18181b; --txt: #fff; --muted: #85858f; --border: rgba(255,255,255,.1); --mn-card: #0e0e10; --mn-borda: rgba(255,255,255,.1); --sheet-bg: #0e0e10; background-color: #000; background-image: none; }
  html body::before { display: none; }
  html body.light { --bg: #fff; --card: #f6f7f9; --card-hover: #eceef2; --txt: #0b0c10; --muted: #737887; --border: rgba(11,12,16,.09); --mn-card: #f6f7f9; --mn-borda: rgba(11,12,16,.09); --mn-verde: #0f9d6b; --mn-verm: #e5334b; --sheet-bg: #fff; background-color: #fff; }
  html body .main-content, html body .app-layout, html body #tela-app { background: transparent !important; }
  html body.light .receber-card, html body.light .resumo-card, html body.light .dk { box-shadow: none !important; }
  html body.light #bn-menu.visivel { background: var(--mn-card); }

  /* ---------- Cartão do patrimônio fixo: nada rola nem arrasta dentro dele ---------- */
  html body #tab-dashboard .dash-grid.dg12 > .dw.carrossel-widgets, html body #tab-dashboard .carrossel-widgets .carrossel-track, html body #tab-dashboard .carrossel-widgets .carrossel-track > div { overflow: hidden !important; overscroll-behavior: none; }
  html body #tab-dashboard .carrossel-widgets { touch-action: pan-y; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; }
  html body #tab-dashboard .carrossel-widgets * { -webkit-user-drag: none; }

  /* ---------- Filtro "Personalizado" (Pagar/Receber): duas datas lado a lado, sem sobrepor (iOS) ---------- */
  html body .mf-corpo [id$="-periodo-box"] { display: grid !important; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important; grid-auto-flow: row; column-gap: 10px !important; row-gap: 6px !important; align-items: end; width: 100% !important; max-width: 100% !important; overflow: hidden; }
  html body .mf-corpo [id$="-periodo-box"][style*="display: none"], html body .mf-corpo [id$="-periodo-box"][style*="display:none"] { display: none !important; }
  html body .mf-corpo [id$="-periodo-box"] span { display: block !important; grid-row: 1; font-size: 11px !important; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; color: var(--muted, #8b8fa3) !important; }
  html body .mf-corpo [id$="-periodo-box"] span:nth-of-type(1) { grid-column: 1; }
  html body .mf-corpo [id$="-periodo-box"] span:nth-of-type(2) { grid-column: 2; }
  html body .mf-corpo [id$="-periodo-box"] input[type="date"] { grid-row: 2; display: block; -webkit-appearance: none; appearance: none; box-sizing: border-box; width: 100% !important; min-width: 0 !important; max-width: 100% !important; height: 50px; margin: 0 !important; padding: 0 12px !important; font-size: 16px !important; border-radius: 14px !important; text-align: left; }
  html body .mf-corpo [id$="-periodo-box"] input[type="date"]:nth-of-type(1) { grid-column: 1; }
  html body .mf-corpo [id$="-periodo-box"] input[type="date"]:nth-of-type(2) { grid-column: 2; }
  html body .mf-corpo [id$="-periodo-box"] input[type="date"]::-webkit-date-and-time-value { text-align: left; min-width: 0; }
  html body .mf-corpo .mf-datas input[type="date"], html body .mf-corpo .mf-datas label { min-width: 0 !important; max-width: 100%; }

  /* ---------- Botão do menu (canto inferior esquerdo) mais visível ---------- */
  html body #bn-menu.visivel { background: #1d1f2b !important; border: 1px solid rgba(255,255,255,.14) !important; box-shadow: 0 10px 26px rgba(0,0,0,.55), 0 0 0 4px rgba(255,106,26,.10) !important; }
  html body #bn-menu.visivel i { color: #ff8a3d !important; }
  html body.light #bn-menu.visivel { background: #fff !important; border: 1px solid rgba(20,24,40,.14) !important; box-shadow: 0 10px 26px rgba(30,41,80,.22), 0 0 0 4px rgba(255,106,26,.10) !important; }

  /* ---------- Transações: ícone da categoria maior e leitura mais rica ---------- */
  html body #tbody-lanc tr.linha-clicavel td:nth-child(2) { grid-template-columns: 52px minmax(0, 1fr) !important; column-gap: 12px !important; }
  html body #tbody-lanc tr.linha-clicavel td:nth-child(2) .lanc-av { width: 52px !important; height: 52px !important; border-radius: 16px !important; border: 1px solid transparent; font-size: 26px !important; display: grid; place-items: center; }
  html body #tbody-lanc tr.linha-clicavel td:nth-child(2) .lanc-av i { font-size: 26px; line-height: 1; }
  html body #tbody-lanc tr.linha-clicavel td:nth-child(2) > div:nth-of-type(1) { font-size: 15px !important; font-weight: 700; }
  html body #tbody-lanc tr.linha-clicavel td:nth-child(2) > .lanc-sub { font-size: 12px !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  html body #tbody-lanc tr.linha-clicavel td:nth-child(6) { font-size: 15px !important; }
  html body #tbody-lanc tr.linha-clicavel td:nth-child(1) { font-size: 11px !important; }
  html body #tbody-lanc tr.linha-clicavel { padding: 14px 12px !important; }

  /* ---------- Transações: cartão detalhado (igual Contas a Pagar/Receber) ---------- */
  html body #tbody-lanc tr.linha-clicavel { grid-template-columns: minmax(0, 1fr) auto !important; gap: 0 !important; padding: 14px !important; border-radius: 20px !important; margin-bottom: 10px !important; align-items: center; }
  html body #tbody-lanc tr.linha-clicavel td:nth-child(2) { grid-column: 1 !important; grid-row: 1 !important; grid-template-columns: 44px minmax(0, 1fr) !important; }
  html body #tbody-lanc tr.linha-clicavel td:nth-child(2) .lanc-av { width: 44px !important; height: 44px !important; border-radius: 50% !important; }
  html body #tbody-lanc tr.linha-clicavel td:nth-child(2) .lanc-av i { font-size: 22px; }
  html body #tbody-lanc tr.linha-clicavel td:nth-child(3) { display: flex !important; grid-column: 2 !important; grid-row: 1 !important; align-self: start; justify-self: end; padding: 0 !important; border: 0 !important; }
  html body #tbody-lanc tr.linha-clicavel td:nth-child(3) .badge-origem { font-size: 11px !important; padding: 4px 10px !important; border-radius: 999px !important; white-space: nowrap; }
  html body #tbody-lanc tr.linha-clicavel td:nth-child(3) .badge-origem i { display: none; }
  html body #tbody-lanc tr.linha-clicavel td:nth-child(6) { grid-column: 1 / 3 !important; grid-row: 2 !important; text-align: left !important; font-size: 24px !important; font-weight: 800 !important; padding: 10px 0 12px !important; align-self: center; }
  html body #tbody-lanc tr.linha-clicavel td:nth-child(6) .valor-alerta { display: inline-flex; align-items: center; gap: 8px; }
  html body #tbody-lanc tr.linha-clicavel td.lanc-foot { display: flex !important; grid-column: 1 !important; grid-row: 3 !important; align-items: center; gap: 6px; padding: 10px 0 0 !important; border: 0 !important; border-top: 1px solid var(--mn-borda) !important; font-size: 12px; color: var(--muted); }
  html body #tbody-lanc tr.linha-clicavel td:nth-child(1) { grid-column: 2 !important; grid-row: 3 !important; text-align: right !important; font-size: 12px !important; color: var(--muted); align-self: stretch; padding: 10px 0 0 !important; border: 0 !important; border-top: 1px solid var(--mn-borda) !important; display: flex; align-items: center; justify-content: flex-end; }

  /* ---------- Pagar/Receber: botão de filtro por item (mostra só as parcelas daquele item) ---------- */
  html body #rec-tbody td:nth-child(6) button[title="Filtrar"]:not(.btn-receber-linha):not(.btn-ver-linha), html body #pag-tbody td:nth-child(6) button[title="Filtrar"]:not(.btn-receber-linha):not(.btn-ver-linha) { display: flex !important; width: 40px !important; height: 40px !important; flex: none; border-radius: 50% !important; font-size: 18px; align-items: center; justify-content: center; margin-right: 8px; background-color: transparent; -webkit-tap-highlight-color: transparent; }
  html body #rec-tbody td:nth-child(6) > div, html body #pag-tbody td:nth-child(6) > div { flex-direction: row-reverse !important; align-items: center; }
  html body #rec-tbody td:nth-child(6) > div > button[title="Filtrar"], html body #pag-tbody td:nth-child(6) > div > button[title="Filtrar"] { margin-right: 0; margin-left: 0; }
  html body #rec-tbody td:nth-child(6) .btn-receber-linha, html body #pag-tbody td:nth-child(6) .btn-receber-linha, html body #rec-tbody td:nth-child(6) .btn-ver-linha, html body #pag-tbody td:nth-child(6) .btn-ver-linha { margin-left: 8px; }

  /* ---------- Pagar/Receber: filtro, editar e excluir em uma linha própria no cartão ---------- */
  .acoes-ico { display: contents; }
  html body #rec-tbody tr:not(.grupo-cabecalho), html body #pag-tbody tr:not(.grupo-cabecalho) { grid-template-rows: auto auto auto auto; }
  html body #rec-tbody tr:not(.grupo-cabecalho) td:nth-child(6), html body #pag-tbody tr:not(.grupo-cabecalho) td:nth-child(6) { display: contents !important; width: auto !important; min-width: 0 !important; }
  html body #rec-tbody td:nth-child(6) > div, html body #pag-tbody td:nth-child(6) > div { display: contents !important; }
  html body #rec-tbody td:nth-child(6) .btn-receber-linha, html body #pag-tbody td:nth-child(6) .btn-receber-linha, html body #rec-tbody td:nth-child(6) .btn-ver-linha, html body #pag-tbody td:nth-child(6) .btn-ver-linha { grid-column: 2 !important; grid-row: 2 !important; justify-self: end; margin-left: 0 !important; }
  html body #rec-tbody tr:not(.grupo-cabecalho) .acoes-ico, html body #pag-tbody tr:not(.grupo-cabecalho) .acoes-ico { display: flex !important; grid-column: 1 / 3; grid-row: 4; justify-content: flex-end; align-items: center; gap: 10px; padding-top: 12px; margin-top: 0; }
  html body #rec-tbody td:nth-child(6) .acoes-ico button:not(.btn-receber-linha):not(.btn-ver-linha), html body #pag-tbody td:nth-child(6) .acoes-ico button:not(.btn-receber-linha):not(.btn-ver-linha) { display: flex !important; width: 44px !important; height: 44px !important; flex: none; border-radius: 50% !important; align-items: center; justify-content: center; font-size: 19px; margin: 0 !important; -webkit-tap-highlight-color: transparent; }

  /* ---------- Pagar/Receber: sem a linha entre o valor e a parcela ---------- */
  html body #rec-tbody tr:not(.grupo-cabecalho) td:nth-child(2), html body #pag-tbody tr:not(.grupo-cabecalho) td:nth-child(2),
  html body #rec-tbody tr:not(.grupo-cabecalho) td:nth-child(3), html body #pag-tbody tr:not(.grupo-cabecalho) td:nth-child(3) { border-top: 0 !important; padding-top: 2px !important; }

  /* ---------- Pagar/Receber: ações empilhadas na lateral direita do cartão ---------- */
  html body #rec-tbody tr:not(.grupo-cabecalho), html body #pag-tbody tr:not(.grupo-cabecalho) { grid-template-columns: minmax(0, 1fr) auto 38px !important; grid-template-rows: auto auto auto; column-gap: 0 !important; }
  html body #rec-tbody tr:not(.grupo-cabecalho) .acoes-ico, html body #pag-tbody tr:not(.grupo-cabecalho) .acoes-ico { grid-column: 3 !important; grid-row: 1 / 4 !important; flex-direction: column !important; justify-content: center !important; align-items: center !important; gap: 8px !important; padding: 0 !important; margin: 0 0 0 12px !important; border: 0 !important; }
  html body #rec-tbody td:nth-child(6) .acoes-ico button:not(.btn-receber-linha):not(.btn-ver-linha), html body #pag-tbody td:nth-child(6) .acoes-ico button:not(.btn-receber-linha):not(.btn-ver-linha) { width: 38px !important; height: 38px !important; font-size: 17px; }
  html body #rec-tbody tr:not(.grupo-cabecalho) td:nth-child(5), html body #pag-tbody tr:not(.grupo-cabecalho) td:nth-child(5) { grid-column: 2 !important; }
  html body #rec-tbody tr:not(.grupo-cabecalho) td:nth-child(4), html body #pag-tbody tr:not(.grupo-cabecalho) td:nth-child(4) { grid-column: 1 !important; }
  html body #rec-tbody td:nth-child(6) .btn-receber-linha, html body #pag-tbody td:nth-child(6) .btn-receber-linha, html body #rec-tbody td:nth-child(6) .btn-ver-linha, html body #pag-tbody td:nth-child(6) .btn-ver-linha { grid-column: 2 !important; grid-row: 2 !important; justify-self: end; }
  html body #rec-tbody tr:not(.grupo-cabecalho) td:nth-child(3), html body #pag-tbody tr:not(.grupo-cabecalho) td:nth-child(3) { grid-column: 2 !important; justify-self: end; }

  html body #rec-tbody tr:not(.grupo-cabecalho), html body #pag-tbody tr:not(.grupo-cabecalho) { grid-template-columns: minmax(0, 1fr) auto 34px !important; padding: 16px 14px !important; row-gap: 4px !important; }
  html body #rec-tbody td:nth-child(6) .acoes-ico button:not(.btn-receber-linha):not(.btn-ver-linha), html body #pag-tbody td:nth-child(6) .acoes-ico button:not(.btn-receber-linha):not(.btn-ver-linha) { width: 34px !important; height: 34px !important; font-size: 16px; }
  html body #rec-tbody tr:not(.grupo-cabecalho) .acoes-ico, html body #pag-tbody tr:not(.grupo-cabecalho) .acoes-ico { gap: 6px !important; margin-left: 14px !important; }

  /* ---------- Transações: linha divisória inteira, título alinhado à tag ---------- */
  html body #tbody-lanc tr.linha-clicavel { grid-template-rows: auto auto auto; }
  html body #tbody-lanc tr.linha-clicavel td.lanc-foot, html body #tbody-lanc tr.linha-clicavel td:nth-child(1) { border-top: 0 !important; }
  html body #tbody-lanc tr.linha-clicavel::after { content: ""; display: block; grid-column: 1 / 3; grid-row: 3; align-self: start; height: 0; border-top: 1px solid var(--mn-borda); }
  html body #tbody-lanc tr.linha-clicavel td:nth-child(2) { align-self: start; align-items: start !important; }
  html body #tbody-lanc tr.linha-clicavel td:nth-child(2) > div:nth-of-type(1) { align-self: start !important; white-space: normal !important; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.25; padding-right: 8px; }
  html body #tbody-lanc tr.linha-clicavel td:nth-child(3) { align-self: start; }
  html body #tbody-lanc tr.linha-clicavel td:nth-child(3) .badge-origem { font-size: 10.5px !important; padding: 4px 9px !important; }

  /* ---------- Título da página fixo no topo ao rolar (fundo transparente) ---------- */
  html body .content-header { position: sticky !important; top: calc(-58px + var(--seguro-t, 0px)); z-index: 40; }
  html body #hdr-sub, html body .header-actions { transition: opacity .18s ease; }
  html body.cab-fixo #hdr-sub, html body.cab-fixo .header-actions { opacity: 0; pointer-events: none; }
  html body .content-header, html body.cab-fixo .content-header { background: transparent !important; -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
  /* desfoque só atrás do título, com borda inferior suave (sem aspecto de vidro) */
  html body .content-header::before { content: "" !important; display: block !important; position: absolute; left: -16px; right: -16px; top: -60px; height: calc(60px + 58px + 50px + var(--seguro-t, 0px)); z-index: -1; pointer-events: none; opacity: 0; transition: opacity .18s ease; background: rgba(0, 0, 0, .42); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); -webkit-mask-image: linear-gradient(to bottom, #000 78%, transparent); mask-image: linear-gradient(to bottom, #000 78%, transparent); }
  html body.cab-fixo .content-header::before { opacity: 1; }
  html body.light .content-header::before { background: rgba(245, 246, 250, .55); }
}