/* =========================================================================
   EconomIA — estilos da dashboard
   Cor de marca: #00674F
   ========================================================================= */

:root {
  /* marca / chrome */
  --brand:        #00674F;
  --brand-700:    #00503D;
  --brand-800:    #003A2C;
  --brand-300:    #18A87F;
  --brand-050:    #E8F2EF;

  /* cores de dado (validadas para contraste e daltonismo) */
  --data-in:      #00875F;   /* receitas */
  --data-out:     #D64545;   /* despesas */
  --data-bar:     #00875F;   /* barras de categoria (série única) */

  /* superfícies e texto */
  --surface:      #F3F6F5;
  --card:         #FFFFFF;
  --ink:          #0E1A16;
  --ink-2:        #556862;
  --ink-3:        #8A9A94;
  --line:         #E4EAE8;
  --line-soft:    #EEF2F1;

  --radius:       16px;
  --radius-sm:    10px;
  --shadow:       0 1px 2px rgba(14,26,22,.05), 0 8px 24px rgba(14,26,22,.06);
  --shadow-lift:  0 2px 6px rgba(14,26,22,.08), 0 18px 40px rgba(14,26,22,.10);

  --sidebar-w:    248px;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--surface);
  color: var(--ink);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p, ul, ol { margin: 0; }
ul { list-style: none; padding: 0; }
button { font: inherit; cursor: pointer; }
a { color: inherit; text-decoration: none; }

.app {
  display: flex;
  min-height: 100%;
  background: linear-gradient(to right, var(--brand-800) 0 var(--sidebar-w), var(--surface) var(--sidebar-w));
}

/* ------------------------------------------------------------- sidebar */
.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  background: var(--brand-800);
  color: #DCEDE7;
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  gap: 26px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand { display: block; padding: 2px 6px 0; }
.brand-logo { display: block; width: 100%; max-width: 186px; height: auto; }
.brand:hover { opacity: .85; }

.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-link {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  font-size: 14.5px; font-weight: 500; color: #B9D6CC;
  transition: background .15s, color .15s;
}
.side-link:hover { background: rgba(255,255,255,.07); color: #fff; }
.side-link.is-active { background: var(--brand); color: #fff; }
.side-link i { width: 18px; height: 18px; display: inline-block; flex: none; }

.side-foot { margin-top: auto; background: rgba(255,255,255,.06); border-radius: var(--radius-sm); padding: 14px; }
.side-foot-title { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--brand-300); font-weight: 600; }
.side-foot-text { font-size: 13px; color: #A9C7BD; margin-top: 4px; }

/* ---------------------------------------------------------------- main */
.main { flex: 1; min-width: 0; padding-bottom: 40px; }

.topbar {
  background: linear-gradient(160deg, var(--brand) 0%, var(--brand-700) 100%);
  color: #fff;
  padding: 22px 28px 76px;
  border-radius: 0 0 22px 22px;
  position: relative;
}

.topbar-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

.greeting { display: flex; align-items: center; gap: 12px; }
.avatar {
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.25);
  display: grid; place-items: center; font-weight: 600; font-size: 17px;
}
.greeting-hi { display: block; font-size: 13px; color: #BFE0D5; line-height: 1.2; }
.greeting-name { font-size: 19px; font-weight: 600; letter-spacing: -.015em; }

.topbar-actions { display: flex; align-items: center; gap: 12px; }
.topbar-date { font-size: 13.5px; color: #C6E3D8; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 50%;
  background: rgba(255,255,255,.14); border: 0; color: #fff;
  display: grid; place-items: center; transition: background .15s;
}
.icon-btn:hover { background: rgba(255,255,255,.24); }

/* cartão de saldo sobreposto */
.balance-card {
  position: absolute;
  left: 28px; right: 28px; bottom: -52px;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lift);
  padding: 18px 22px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px; flex-wrap: wrap;
}
.balance-label {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--ink-2); font-weight: 500;
}
.eye-btn { background: none; border: 0; color: var(--ink-3); padding: 2px; display: grid; place-items: center; border-radius: 6px; }
.eye-btn:hover { color: var(--brand); background: var(--brand-050); }
.balance-value { font-size: 30px; font-weight: 700; letter-spacing: -.03em; margin-top: 2px; color: var(--ink); }
.balance-sub { font-size: 12.5px; color: var(--ink-3); }

.balance-accounts { display: flex; gap: 10px; flex-wrap: wrap; }
.mini-acc {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; padding: 8px 12px;
}
.mini-acc-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.mini-acc-name { font-size: 12px; color: var(--ink-2); display: block; line-height: 1.2; }
.mini-acc-val { display: block; }
.mini-acc-val { font-size: 13.5px; font-weight: 600; letter-spacing: -.01em; }

/* -------------------------------------------------------------- conteúdo */
.content { padding: 76px 28px 0; max-width: 1420px; }

.filters {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; flex-wrap: wrap; margin-bottom: 10px;
}
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  border: 1px solid var(--line); background: var(--card); color: var(--ink-2);
  padding: 8px 15px; border-radius: 999px; font-size: 13.5px; font-weight: 500;
  transition: all .15s;
}
.chip:hover { border-color: var(--brand-300); color: var(--brand); }
.chip.is-active { background: var(--brand); border-color: var(--brand); color: #fff; }

.custom-range { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); }
.custom-range input {
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
  border-radius: 8px; padding: 6px 9px; font: inherit; font-size: 13px; margin-left: 4px;
}
.btn-ghost {
  border: 1px solid var(--line); background: var(--card); color: var(--brand);
  border-radius: 8px; padding: 7px 14px; font-size: 13px; font-weight: 600;
}
.btn-ghost:hover { background: var(--brand-050); border-color: var(--brand-300); }
.btn-sm { padding: 5px 11px; font-size: 12.5px; }

.period-note { font-size: 13px; color: var(--ink-3); margin-bottom: 16px; }

/* ------------------------------------------------------------------ KPIs */
.kpis {
  display: grid; gap: 14px; margin-bottom: 16px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.kpi { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; }
.kpi-label { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--ink-2); font-weight: 500; }
.kpi-value { font-size: 23px; font-weight: 700; letter-spacing: -.025em; margin-top: 6px; }
.kpi-in  { color: var(--data-in); }
.kpi-out { color: var(--data-out); }
.kpi-delta { font-size: 12.5px; color: var(--ink-3); margin-top: 3px; }
.kpi-delta b { font-weight: 600; }
.up   { color: var(--data-in); }
.down { color: var(--data-out); }

.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: none; }
.dot-in  { background: var(--data-in); }
.dot-out { background: var(--data-out); }
.dot-net { background: var(--brand); }
.dot-avg { background: var(--ink-3); }

/* ----------------------------------------------------------------- cards */
.grid {
  display: grid; gap: 14px; margin-bottom: 16px;
  align-items: start;
  grid-template-columns: 1.45fr 1fr;
}
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px 20px; min-width: 0; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.card-title { font-size: 15.5px; font-weight: 600; letter-spacing: -.015em; }
.card-sub { font-size: 12.5px; color: var(--ink-3); margin-top: 2px; }

.legend { display: flex; gap: 14px; flex-wrap: wrap; }
.legend-item { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-2); }
.swatch { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }

.chart { width: 100%; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }

/* tabela alternativa (acessibilidade) */
.table-wrap { margin-top: 14px; overflow-x: auto; }
.table-wrap table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table-wrap th, .table-wrap td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--line-soft); }
.table-wrap th { color: var(--ink-2); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }
.table-wrap td.num, .table-wrap th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* --------------------------------------------------------------- contas */
.accounts { display: flex; flex-direction: column; }
.acc-item { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line-soft); }
.acc-item:last-child { border-bottom: 0; }
.acc-badge { background: var(--ink-3); width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; color: #fff; font-weight: 600; font-size: 14px; flex: none; }
.acc-name { font-size: 14px; font-weight: 500; display: block; line-height: 1.3; }
.acc-inst { font-size: 12px; color: var(--ink-3); display: block; line-height: 1.3; }
.acc-val { margin-left: auto; font-weight: 600; font-size: 14.5px; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }

/* --------------------------------------------------------- lançamentos */
.tx { display: flex; flex-direction: column; }
.tx-item { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.tx-item:last-child { border-bottom: 0; }
.tx-icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none; font-size: 13px; font-weight: 700; color: #fff; }
.tx-body { min-width: 0; flex: 1; }
.tx-desc { display: block; font-size: 14px; font-weight: 500; line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tx-meta { display: block; font-size: 12px; color: var(--ink-3); line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tx-val { font-weight: 600; font-size: 14px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tx-val.in  { color: var(--data-in); }
.tx-val.out { color: var(--ink); }

.foot { padding: 8px 0 24px; font-size: 12.5px; color: var(--ink-3); }

/* -------------------------------------------------------------- tooltip */
.tooltip {
  position: fixed; z-index: 60; pointer-events: none;
  background: #0E1A16; color: #fff; border-radius: 10px;
  padding: 8px 11px; font-size: 12.5px; line-height: 1.45;
  box-shadow: 0 10px 30px rgba(0,0,0,.22);
  max-width: 240px; transform: translate(-50%, -100%);
}
.tooltip b { font-weight: 600; }
.tooltip .t-row { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.tooltip .t-sw { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }

/* ------------------------------------------------------------ nav mobile */
.bottom-nav { display: none; }

/* --------------------------------------------------------- responsivo */
@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .app { background: var(--surface); }
  .sidebar { display: none; }
  .content { padding: 74px 16px 0; }
  .topbar { padding: 18px 16px 72px; border-radius: 0 0 20px 20px; }
  .balance-card { left: 16px; right: 16px; bottom: -54px; padding: 16px; }
  .balance-value { font-size: 26px; }
  .topbar-date { display: none; }
  .balance-accounts { display: none; }
  .main { padding-bottom: 92px; }

  .bottom-nav {
    display: flex; align-items: center; justify-content: space-around;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
    background: var(--card); border-top: 1px solid var(--line);
    padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
  }
  .bn-item { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 10.5px; color: var(--ink-3); flex: 1; }
  .bn-item i { width: 20px; height: 20px; display: block; }
  .bn-item.is-active { color: var(--brand); font-weight: 600; }
  .bn-fab {
    width: 50px; height: 50px; border-radius: 50%; border: 0;
    background: var(--brand); color: #fff; font-size: 26px; line-height: 1;
    box-shadow: 0 6px 18px rgba(0,103,79,.35); flex: none; margin-top: -20px;
  }
}

@media (max-width: 560px) {
  .kpis { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi-value { font-size: 19px; }
  .card { padding: 16px 14px 18px; }
  .balance-accounts { width: 100%; }
  .mini-acc { flex: 1 1 calc(50% - 5px); }
  .custom-range { width: 100%; }
  .custom-range input { width: 100%; }
  .custom-range label { flex: 1; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* =========================================================================
   Telas internas: importação, lançamentos e categorias
   ========================================================================= */

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.sem-scroll { overflow: hidden; }

/* ------------------------------------------------------------ topbar slim */
.topbar-slim { padding: 20px 28px 22px; border-radius: 0 0 22px 22px; }
.topbar-slim .topbar-row { align-items: flex-end; }
.page-title { font-size: 21px; font-weight: 600; letter-spacing: -.02em; }
.page-sub { font-size: 13.5px; color: #C6E3D8; margin-top: 3px; max-width: 70ch; }

/* --------------------------------------------------------------- botões */
.btn {
  border: 0; background: var(--brand); color: #fff;
  border-radius: 10px; padding: 10px 18px; font-size: 14px; font-weight: 600;
  transition: background .15s, transform .05s;
}
.btn:hover { background: var(--brand-700); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-claro { background: #fff; color: var(--brand); text-decoration: none; display: inline-block; }
.btn-claro:hover { background: #E8F2EF; }
.btn-perigo { color: var(--data-out); }
.btn-perigo:hover { background: #FDECEC; border-color: #F3C9C9; }

.icone-btn {
  width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--card); color: var(--ink-2); display: inline-grid; place-items: center; padding: 6px;
}
.icone-btn:hover { border-color: var(--brand-300); color: var(--brand); background: var(--brand-050); }
.icone-btn i { width: 16px; height: 16px; display: block; }
.icone-btn-perigo:hover { border-color: #F3C9C9; color: var(--data-out); background: #FDECEC; }
.icon-btn-ghost { background: transparent; color: var(--ink-2); font-size: 15px; }
.icon-btn-ghost:hover { background: var(--surface); }

/* -------------------------------------------------- segmented / chips */
.seg { display: inline-flex; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 3px; }
.seg-btn {
  border: 0; background: transparent; color: var(--ink-2);
  padding: 7px 14px; border-radius: 8px; font-size: 13.5px; font-weight: 500;
}
.seg-btn.is-active { background: var(--card); color: var(--brand); box-shadow: 0 1px 3px rgba(14,26,22,.10); font-weight: 600; }
.seg-sm .seg-btn { padding: 5px 11px; font-size: 12.5px; }

/* ------------------------------------------------------------ formulários */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid-3 { grid-template-columns: 1fr 1fr auto; align-items: end; }
.campo { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--ink-2); }
.campo-full { grid-column: 1 / -1; }
.campo-acao { justify-content: flex-end; }
.campo > span { font-weight: 500; }
.campo input, .campo select, .campo textarea,
.campo-inline input, .campo-inline select {
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
  border-radius: 9px; padding: 9px 11px; font: inherit; font-size: 14px; width: 100%;
}
.campo input:focus, .campo select:focus, .campo-inline input:focus, .campo-inline select:focus {
  outline: 2px solid var(--brand-300); outline-offset: -1px; border-color: var(--brand-300);
}
.campo-inline { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--ink-2); }
.campo-inline span { white-space: nowrap; }
.campo-inline input, .campo-inline select { width: auto; padding: 7px 10px; font-size: 13.5px; }
.campo-busca input { min-width: 220px; }
.campo-busca-larga { display: flex; margin-bottom: 12px; }
.campo-busca-larga input { width: 100%; max-width: 420px; }
.check { flex-direction: row; align-items: center; gap: 8px; font-size: 13.5px; color: var(--ink-2); }
.check input { width: auto; }

.cores { display: flex; flex-wrap: wrap; gap: 7px; }
.cor-bola { width: 24px; height: 24px; border-radius: 50%; border: 2px solid transparent; padding: 0; }
.cor-bola.is-active { border-color: var(--ink); box-shadow: 0 0 0 2px #fff inset; }

/* --------------------------------------------------------------- dropzone */
.form-envio { display: flex; flex-direction: column; gap: 16px; }
.dropzone {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  border: 2px dashed var(--line); border-radius: 14px; padding: 30px 20px;
  background: var(--surface); color: var(--ink-2); cursor: pointer; text-align: center;
  transition: border-color .15s, background .15s;
}
.dropzone:hover, .dropzone.is-over { border-color: var(--brand-300); background: var(--brand-050); }
.dz-ico { color: var(--brand); }
.dz-texto { font-size: 14px; }
.dz-nome { font-size: 13px; color: var(--brand); font-weight: 600; }

.ajuda { margin-top: 16px; border-top: 1px solid var(--line-soft); padding-top: 14px; }
.ajuda summary { cursor: pointer; font-size: 13.5px; font-weight: 600; color: var(--brand); }
.ajuda-lista { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; font-size: 13.5px; color: var(--ink-2); }
.ajuda-lista li { padding-left: 14px; position: relative; }
.ajuda-lista li::before { content: ''; position: absolute; left: 0; top: 9px; width: 5px; height: 5px; border-radius: 50%; background: var(--brand-300); }
.ajuda-nota { margin-top: 10px; font-size: 12.5px; color: var(--ink-3); }

/* ---------------------------------------------------------------- avisos */
.aviso {
  background: #FFF8E6; border: 1px solid #F2E0AE; color: #6B5412;
  border-radius: 10px; padding: 9px 12px; font-size: 13px; margin-bottom: 8px;
}

/* --------------------------------------------------------- blocos resumo */
.resumo-import { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0; }
.rb {
  flex: 1 1 130px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; padding: 10px 13px; display: flex; flex-direction: column; gap: 2px;
}
.rb-rot { font-size: 12px; color: var(--ink-2); }
.rb-val { font-size: 17px; font-weight: 700; letter-spacing: -.02em; }
.rb.in .rb-val { color: var(--data-in); }
.rb.out .rb-val { color: var(--data-out); }
.rb.alerta { background: #FFF8E6; border-color: #F2E0AE; }

/* ------------------------------------------------------------ barra ações */
.barra-acoes {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 10px 0; border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft);
  margin-bottom: 12px;
}
.barra-espaco { flex: 1; }
.barra-info { font-size: 13px; font-weight: 600; color: var(--brand); }

/* --------------------------------------------------------------- tabelas */
.tabela-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tabela { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 720px; }
.tabela th {
  text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--ink-3); font-weight: 600; padding: 8px 8px; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; background: var(--card); z-index: 1;
}
.tabela td { padding: 7px 8px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.tabela tr:last-child td { border-bottom: 0; }
.tabela .num, .tabela th.num { text-align: right; font-variant-numeric: tabular-nums; }
.tabela input[type="text"], .tabela input[type="date"], .tabela select {
  border: 1px solid transparent; background: transparent; color: var(--ink);
  border-radius: 7px; padding: 5px 7px; font: inherit; font-size: 13.5px; width: 100%;
}
.tabela input:hover, .tabela select:hover { border-color: var(--line); background: var(--card); }
.tabela input:focus, .tabela select:focus { outline: 2px solid var(--brand-300); outline-offset: -1px; background: var(--card); }
.tabela .col-check { width: 34px; }
.tabela .col-data { width: 132px; }
.tabela .col-cat { width: 190px; }
.tabela .col-tipo { width: 118px; }
.tabela .col-conta { width: 110px; }
.tabela .col-valor { width: 130px; }
.tabela .col-acoes { width: 120px; text-align: right; white-space: nowrap; }
.tabela .col-acoes .icone-btn + .icone-btn { margin-left: 4px; }
.tabela .col-valor input { text-align: right; }
.linha-dup { background: #FFFBF0; }
.vazio { text-align: center; color: var(--ink-3); padding: 26px 8px; font-size: 13.5px; }

.tabela-lanc .col-desc { display: flex; align-items: center; gap: 9px; }
.desc-txt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 34ch; }
.tx-icon-mini {
  width: 26px; height: 26px; border-radius: 8px; display: inline-grid; place-items: center;
  font-size: 13px; flex: none; color: var(--ink);
}
.val-in { color: var(--data-in); font-weight: 600; }
.val-out { color: var(--ink); font-weight: 600; }

.tag {
  display: inline-block; margin-left: 7px; padding: 2px 7px; border-radius: 999px;
  font-size: 10.5px; font-weight: 600; background: var(--surface); color: var(--ink-3);
  border: 1px solid var(--line); vertical-align: middle;
}
.tag-dup { background: #FFF1DB; color: #8A5A00; border-color: #F0D9AE; }
/* etiqueta que é botão: "importar mesmo assim" na linha repetida da prévia */
.tag-acao {
  cursor: pointer; font-family: inherit; background: var(--card); color: var(--brand-700);
  border-color: var(--brand-300); -webkit-tap-highlight-color: transparent;
}
.tag-acao:hover { background: var(--brand-050); }
.tag-acao:focus-visible { outline: 2px solid var(--brand-300); outline-offset: 1px; }
.nota-dup { background: #FFF8EC; border: 1px solid #F0D9AE; border-radius: 10px; padding: 9px 11px; }
.pill { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 12.5px; font-weight: 600; }
.padrao { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 2px 7px; font-size: 12.5px; }

.card-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  flex-wrap: wrap; padding-top: 14px; margin-top: 4px; border-top: 1px solid var(--line-soft);
}
.paginacao { display: flex; gap: 8px; }

/* ------------------------------------------------------------- filtros */
.filtros { display: flex; flex-direction: column; gap: 12px; margin-bottom: 4px; }
.filtros-linha { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: center; }

/* -------------------------------------------------------- grade categorias */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.cat-card {
  display: flex; align-items: center; gap: 11px;
  border: 1px solid var(--line); border-radius: 12px; padding: 11px 12px; background: var(--card);
}
.cat-card.is-arquivada { opacity: .5; }
.cat-ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-size: 16px; flex: none; color: var(--ink); }
.cat-corpo { flex: 1; min-width: 0; }
.cat-nome { display: block; font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat-meta { display: block; font-size: 12px; color: var(--ink-3); }
.cat-acoes { display: flex; gap: 5px; }

/* ---------------------------------------------------------- lista simples */
.lista-simples { display: flex; flex-direction: column; }
.item-simples {
  display: flex; align-items: center; gap: 11px;
  padding: 11px 0; border-bottom: 1px solid var(--line-soft);
}
.item-simples:last-child { border-bottom: 0; }
.item-simples.is-inativo { opacity: .55; }
.is-corpo { flex: 1; min-width: 0; }
.is-corpo b { display: block; font-size: 14px; font-weight: 600; }
.is-meta { display: block; font-size: 12px; color: var(--ink-3); }
.is-valor { font-weight: 600; font-variant-numeric: tabular-nums; }

/* --------------------------------------------------------------- modal */
.modal-back {
  position: fixed; inset: 0; z-index: 80; background: rgba(14,26,22,.45);
  display: flex; align-items: center; justify-content: center; padding: 18px;
  backdrop-filter: blur(2px);
}
/* modal aberto em cima de outro (criar categoria no meio de uma importação):
   o fundo é mais leve, para o que ficou atrás continuar visível */
.modal-back-cima { background: rgba(14,26,22,.22); backdrop-filter: none; }
.modal-back-cima .modal { box-shadow: 0 30px 80px rgba(0,0,0,.38); }
.modal {
  background: var(--card); border-radius: 16px; width: min(560px, 100%);
  max-height: calc(100vh - 36px); display: flex; flex-direction: column;
  box-shadow: 0 24px 70px rgba(0,0,0,.28);
}
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px 10px; }
.modal-head h2 { font-size: 16.5px; font-weight: 600; letter-spacing: -.015em; }
.modal-body { padding: 4px 18px 8px; overflow-y: auto; }
.modal-foot { display: flex; align-items: center; gap: 8px; padding: 12px 18px 16px; }
.modal-espaco { flex: 1; }
.modal-texto { font-size: 14px; color: var(--ink-2); margin-bottom: 12px; }
.modal-nota { font-size: 12.5px; color: var(--ink-3); margin-top: 10px; }
.modal code { background: var(--surface); border-radius: 5px; padding: 1px 5px; font-size: 12.5px; }

/* -------------------------------------------------------------- toasts */
.toasts { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 90; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast {
  background: #0E1A16; color: #fff; border-radius: 10px; padding: 10px 15px;
  font-size: 13.5px; box-shadow: 0 10px 30px rgba(0,0,0,.25); max-width: 90vw;
  animation: sobe .18s ease-out;
}
.toast-ok { background: #0B5741; }
.toast-erro { background: #9A2C2C; }
.toast.is-out { opacity: 0; transition: opacity .45s; }
@keyframes sobe { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------------------------------------------------------- responsivo */
@media (max-width: 900px) {
  .topbar-slim { padding: 16px 16px 18px; }
  .page-title { font-size: 18.5px; }
  .form-grid-3 { grid-template-columns: 1fr; }
  .campo-acao .btn { width: 100%; }
  .cat-grid { grid-template-columns: 1fr; }
  .campo-busca input { min-width: 0; width: 100%; }
  .filtros-linha { gap: 10px; }
  .filtros-linha .campo-inline { flex: 1 1 44%; }
  .campo-busca { flex-basis: 100%; }
  .toasts { bottom: 84px; }
}

@media (max-width: 560px) {
  .form-grid { grid-template-columns: 1fr; }
  .modal { max-height: calc(100vh - 24px); }
  .resumo-import .rb { flex-basis: calc(50% - 5px); }
}

/* ajustes finais */
[hidden] { display: none !important; }
.topbar-slim ~ .content { padding-top: 20px; }
.regras-mais { display: flex; justify-content: center; padding-top: 12px; }

.modal-body .seg { margin-bottom: 14px; }

/* =========================================================================
   Gastos fixos
   ========================================================================= */

.mes-nav { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.mes-nav .icone-btn { font-size: 18px; line-height: 1; padding: 0; }
.mes-nav .card-title { min-width: 11ch; }

.fixas { display: flex; flex-direction: column; }
.fixa-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 0; border-bottom: 1px solid var(--line-soft);
}
.fixa-item:last-child { border-bottom: 0; }
.fixa-item.is-inativo { opacity: .6; }
.fixa-corpo { flex: 1; min-width: 0; }
.fixa-nome { display: block; font-size: 14.5px; font-weight: 600; }
.fixa-meta { display: block; font-size: 12px; color: var(--ink-3); margin-top: 1px; }
.fixa-valor { font-weight: 600; font-size: 15px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.fixa-acoes { display: flex; align-items: center; gap: 6px; flex: none; }

.tag-ok { background: #E4F4ED; color: #0B5741; border-color: #BFE3D5; }
.tag-previsto { background: #FFF1DB; color: #8A5A00; border-color: #F0D9AE; }
.icone-btn-ok:hover { border-color: #BFE3D5; color: var(--data-in); background: #E4F4ED; }

/* escolha de escopo (só este mês / daqui em diante) */
.escopo { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }
.escopo-titulo { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.escopo .check {
  display: flex; align-items: flex-start; gap: 10px; border: 1px solid var(--line);
  border-radius: 11px; padding: 11px 13px; font-size: 13.5px; color: var(--ink);
  line-height: 1.45; cursor: pointer;
}
.escopo .check > span { display: block; }
.escopo .check input { flex: none; }
.escopo .check:hover { border-color: var(--brand-300); background: var(--brand-050); }
.escopo .check input { margin-top: 3px; }
.escopo-nota { color: var(--ink-3); font-size: 12.5px; }

/* card de fixas na dashboard */

.fixas-chips {
  display: grid; gap: 9px;
  grid-template-columns: repeat(auto-fill, minmax(268px, 1fr));
}
.fixa-chip {
  display: grid; align-items: center;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  gap: 1px 10px;
  border: 1px solid var(--line); border-radius: 12px; padding: 9px 12px;
  background: var(--card);
}
.fixa-chip.is-paga { background: var(--card); opacity: .5; }
.fixa-chip.is-paga:hover { opacity: .8; }
.fc-ico { grid-area: 1 / 1 / 3 / 2; width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; font-size: 15px; }
.fc-nome { grid-area: 1 / 2 / 2 / 4; font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fc-meta { grid-area: 2 / 2 / 3 / 3; font-size: 11.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fc-valor { font-size: 12.5px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.fc-ok { grid-area: 2 / 3 / 3 / 4; color: var(--data-in); font-weight: 600; font-size: 12px; white-space: nowrap; }
.fc-acoes { grid-area: 2 / 3 / 3 / 4; display: flex; align-items: center; gap: 6px; }
.fc-btn { grid-area: 2 / 3 / 3 / 4; }
.fc-acoes .fc-btn { grid-area: auto; }
.fc-btn {
  border: 1px solid var(--line); background: var(--card); color: var(--brand);
  border-radius: 8px; padding: 4px 10px; font-size: 12px; font-weight: 600; white-space: nowrap;
}
.fc-btn:hover { background: var(--brand-050); border-color: var(--brand-300); }
.fc-btn:disabled { opacity: .5; }
/* "Abater" fica discreto ao lado de "Pagar": é a saída para quando a despesa
   já entrou pela fatura com outro nome */
.fc-btn-fraco { color: var(--ink-3); border-color: transparent; padding: 4px 6px; }
.fc-btn-fraco:hover { color: var(--brand); }

/* bloco "Abater um gasto fixo" dentro dos modais */
.abater { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line-soft); }

@media (max-width: 640px) {
  .fixa-item { flex-wrap: wrap; }
  .fixa-acoes { width: 100%; justify-content: flex-end; }
  .fixa-chip { min-width: 0; flex-basis: 100%; }
  .mes-nav { width: 100%; }
}

/* linha de gasto fixo já pago: confirmada, não desabilitada */
.linha-paga td:first-child { box-shadow: inset 3px 0 0 #8FD3BB; }
.linha-paga .desc-txt { color: var(--ink); }

/* =========================================================================
   Ajustes de espaçamento, aba Contas e menu "Mais"
   ========================================================================= */

/* respiro uniforme entre os blocos de qualquer tela */
.content > .card,
.content > .grid,
.content > section { margin-bottom: 16px; }
.content > .foot { margin-bottom: 0; }
.content > .card:last-of-type { margin-bottom: 24px; }

/* aba Contas */
.acc-badge-sm { width: 28px; height: 28px; border-radius: 9px; font-size: 12.5px; }
.conta-inst { display: block; font-size: 11.5px; color: var(--ink-3); font-weight: 400; }
.tabela-lanc .col-desc .desc-txt { white-space: normal; line-height: 1.3; }
.linha-inativa { opacity: .6; }
.val-neg { color: var(--data-out); }

/* opção destrutiva na escolha de escopo */
.escopo .check-perigo { border-color: #F0CFCF; }
.escopo .check-perigo:hover { border-color: var(--data-out); background: #FDECEC; }
.escopo .check-perigo b { color: #8E2C2C; }

/* menu "Mais" do rodapé no celular */
.bn-mais { border: 0; background: none; font: inherit; }
.menu-mais { display: none; }

@media (max-width: 900px) {
  .menu-mais {
    display: flex; flex-direction: column;
    position: fixed; right: 10px; z-index: 55;
    bottom: calc(68px + env(safe-area-inset-bottom));
    background: var(--card); border: 1px solid var(--line); border-radius: 14px;
    box-shadow: 0 14px 40px rgba(14,26,22,.18); padding: 6px; min-width: 190px;
  }
  .mm-item {
    display: flex; align-items: center; gap: 10px;
    padding: 11px 12px; border-radius: 10px;
    font-size: 14.5px; font-weight: 500; color: var(--ink);
  }
  .mm-item i { width: 18px; height: 18px; display: block; flex: none; color: var(--ink-2); }
  .mm-item:hover { background: var(--surface); }
  .mm-item.is-active { background: var(--brand-050); color: var(--brand); }
  .mm-item.is-active i { color: var(--brand); }
}

/* aviso de arquivo que não chegou ao servidor */
.falta-arquivo {
  background: #FDECEC; border: 1px solid #F0CFCF; color: #8E2C2C;
  border-radius: 12px; padding: 12px 15px; font-size: 13.5px; margin-bottom: 16px;
}
.falta-arquivo code { background: #fff; border-radius: 5px; padding: 1px 6px; }

/* checkbox alinhado com o campo ao lado no formulário de conta */
.campo-check { align-self: end; padding-bottom: 10px; }

/* =========================================================================
   Barra de meses (Início e Lançamentos)
   ========================================================================= */

.mes-nav-barra {
  display: flex; align-items: center; gap: 6px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 999px; padding: 4px; flex-wrap: nowrap;
  max-width: 100%;
}
.mes-seta {
  flex: none; width: 30px; height: 32px; border: 0; background: transparent;
  color: var(--ink-2); font-size: 20px; line-height: 1; border-radius: 999px;
  cursor: pointer; display: grid; place-items: center;
}
.mes-seta:hover { background: var(--brand-050); color: var(--brand); }
.mes-trilha { display: flex; gap: 2px; min-width: 0; flex: 0 1 auto; }
.mes-btn {
  flex: 0 0 auto; min-width: 0; border: 0; background: transparent; color: var(--ink-2);
  padding: 7px 10px; border-radius: 999px; font: inherit; font-size: 13.5px;
  font-weight: 500; cursor: pointer; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; transition: background .15s, color .15s;
}
.mes-btn:hover { background: var(--brand-050); color: var(--brand); }
.mes-btn.is-active { background: var(--brand); color: #fff; font-weight: 600; }
.mes-btn.is-active:hover { background: var(--brand-700); color: #fff; }
.mes-curto { display: none; }
.mes-ano { font-size: 10.5px; opacity: .7; margin-left: 3px; vertical-align: super; }

@media (max-width: 900px) {
  .mes-longo { display: none; }
  .mes-curto { display: inline; }
  .mes-nav-barra { width: 100%; }
  .mes-trilha { flex: 1 1 auto; }
  .mes-btn { flex: 1 1 0; padding: 7px 6px; text-align: center; }
}

/* =========================================================================
   Gráfico de pizza (despesas por categoria)
   ========================================================================= */

.pizza-caixa { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.pizza-grafico { flex: none; display: grid; place-items: center; }
.pizza .fatia { cursor: default; transition: opacity .12s; }
.pizza-legenda {
  list-style: none; margin: 0; padding: 0; flex: 1 1 260px; min-width: 240px;
  display: flex; flex-direction: column; gap: 2px;
}
.pl-item {
  display: grid; grid-template-columns: 10px minmax(0, 1fr) auto auto;
  align-items: center; gap: 10px; padding: 6px 0;
  border-bottom: 1px solid var(--line-soft); font-size: 13.5px;
}
.pl-item:last-child { border-bottom: 0; }
.pl-cor { width: 10px; height: 10px; border-radius: 3px; }
.pl-nome { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); }
.pl-pct { color: var(--ink-3); font-size: 12.5px; font-variant-numeric: tabular-nums; min-width: 5ch; text-align: right; }
.pl-valor { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }

@media (max-width: 640px) {
  .pizza-caixa { gap: 14px; }
  .pizza-legenda { min-width: 0; flex-basis: 100%; }
}

/* faixa de período da tela de lançamentos */
.filtros-periodo { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.filtros-periodo .mes-nav-barra { flex: 0 1 auto; }
.filtros-periodo .chip { flex: none; margin-left: auto; }

@media (max-width: 640px) {
  .custom-range { flex-wrap: wrap; width: 100%; }
  .custom-range label { flex: 1 1 140px; display: flex; align-items: center; }
  .custom-range input { flex: 1 1 auto; min-width: 0; }
  .custom-range .btn-ghost { flex: none; }
}

/* =========================================================================
   A pagar por conta (Início) e mês da importação
   ========================================================================= */

.pagar-contas {
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}
.pc-conta {
  border: 1px solid var(--line); border-radius: 13px; padding: 12px 14px;
  background: var(--card); min-width: 0;
}
.pc-conta.is-quitada { background: linear-gradient(0deg, var(--brand-050) 0%, var(--card) 60%); }
.pc-head {
  display: grid; grid-template-columns: 28px minmax(0, 1fr);
  align-items: center; gap: 2px 10px;
}
.pc-badge {
  grid-area: 1 / 1 / 3 / 2; width: 28px; height: 28px; border-radius: 9px;
  display: grid; place-items: center; color: #fff; font-size: 13px; font-weight: 700;
}
.pc-nome { grid-area: 1 / 2 / 2 / 3; font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pc-tot { grid-area: 2 / 2 / 3 / 3; font-size: 12.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pc-tot b { font-variant-numeric: tabular-nums; }
.pc-acao { display: flex; justify-content: flex-end; padding-top: 10px; }
.pc-acao .btn-ghost { white-space: nowrap; }

.pc-itens { list-style: none; margin: 10px 0 0; padding: 0; }
.pc-item {
  display: grid; grid-template-columns: 44px minmax(0, 1fr) 14px auto;
  align-items: center; gap: 10px; padding: 5px 0; font-size: 13px;
  border-top: 1px solid var(--line-soft);
}
.pc-item.is-paga { color: var(--ink-2); }
.pc-marca { font-size: 12px; text-align: center; }
.pc-item.is-paga .pc-marca { color: var(--data-in); }
.pc-item.is-aberta .pc-marca { color: #C08A00; }
.pc-item.is-aberta .pc-valor { color: var(--data-out); }
.pc-dia { color: var(--ink-3); font-size: 12px; font-variant-numeric: tabular-nums; }
.pc-desc { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pc-valor { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pc-mais { padding: 6px 0 0; font-size: 12px; color: var(--ink-3); border-top: 1px solid var(--line-soft); }

/* mês escolhido na importação */
.import-mes {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  border: 1px solid var(--line); border-radius: 12px;
  padding: 11px 14px; margin-bottom: 12px; background: var(--brand-050);
}
.import-mes select { min-width: 220px; }
.import-mes .card-sub { margin: 0; flex: 1 1 320px; }

@media (max-width: 640px) {
  .pagar-contas { grid-template-columns: 1fr; }
  .pc-acao .btn-ghost { width: 100%; }
  .import-mes select { min-width: 0; width: 100%; }
}

.pc-vazio {
  margin: 0; grid-column: 1 / -1; font-size: 13.5px; color: var(--ink-2); line-height: 1.55;
}
.pc-vazio .btn-ghost { display: inline-block; margin-top: 10px; }

/* =========================================================================
   Tela de entrada
   ========================================================================= */

body.tela-login {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(120% 120% at 50% 0%, #00805F 0%, var(--brand) 42%, var(--brand-800) 100%);
}
.login-caixa {
  width: 100%; max-width: 420px; background: var(--card); border-radius: 20px;
  padding: 32px 30px 26px; box-shadow: 0 24px 60px rgba(0, 40, 30, .35);
  text-align: center;
}
.login-logo { width: 190px; height: auto; margin: 0 auto 22px; display: block; }
.login-titulo { margin: 0 0 8px; font-size: 20px; font-weight: 700; color: var(--ink); }
.login-texto { margin: 0 0 20px; font-size: 14px; line-height: 1.6; color: var(--ink-2); }

.btn-google {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; padding: 12px 16px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--card); color: var(--ink); font-size: 15px; font-weight: 600;
  text-decoration: none; transition: border-color .15s, box-shadow .15s;
}
.btn-google:hover { border-color: var(--brand-300); box-shadow: var(--shadow); }

.login-aviso {
  margin: 0 0 18px; padding: 11px 13px; border-radius: 11px; text-align: left;
  background: #FFF6E5; border: 1px solid #F0D9AE; color: #7A5200;
  font-size: 13px; line-height: 1.55;
}
.login-aviso-ok { background: var(--brand-050); border-color: #BFE3D5; color: #0B5741; }
.login-aviso-extra { display: block; margin-top: 6px; opacity: .85; }
.login-teste { display: inline-block; margin-top: 14px; }
.login-rodape { margin: 20px 0 0; font-size: 12px; line-height: 1.55; color: var(--ink-3); }

@media (max-width: 420px) {
  .login-caixa { padding: 26px 20px 22px; }
}

/* bloco da conta no menu lateral */
.side-conta {
  display: flex; align-items: center; gap: 10px; margin: 0 12px 10px;
  padding: 9px 10px; border-radius: 12px; text-decoration: none;
  background: rgba(255, 255, 255, .07); color: #fff; transition: background .15s;
}
.side-conta:hover { background: rgba(255, 255, 255, .13); }
.sc-foto { width: 34px; height: 34px; border-radius: 50%; flex: none; object-fit: cover; }
.sc-letra {
  display: grid; place-items: center; background: rgba(255, 255, 255, .18);
  font-size: 14px; font-weight: 700;
}
.sc-corpo { min-width: 0; display: grid; }
.sc-nome { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sc-email { font-size: 11.5px; opacity: .72; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar-foto { object-fit: cover; padding: 0; }
.sc-foto-sm { width: 24px; height: 24px; }
.aviso-ok { background: var(--brand-050); border-color: #BFE3D5; color: #0B5741; }

/* tela Minha conta */
.conta-topo { display: flex; align-items: center; gap: 16px; }
.conta-foto { width: 64px; height: 64px; border-radius: 50%; flex: none; object-fit: cover; }
.conta-letra {
  display: grid; place-items: center; background: var(--brand); color: #fff;
  font-size: 26px; font-weight: 700;
}
.conta-corpo { min-width: 0; }
.conta-corpo .card-title { margin: 0 0 3px; }
.conta-corpo .card-sub { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* =========================================================================
   Importação: leitura no navegador (PDF com senha, imagem por OCR)
   ========================================================================= */

.leitura { margin: 14px 0 4px; }
.leitura-barra {
  height: 6px; border-radius: 999px; background: var(--line-soft); overflow: hidden;
}
.leitura-barra span {
  display: block; height: 100%; width: 0%; border-radius: inherit;
  background: var(--brand); transition: width .25s ease;
}
.leitura-texto { margin: 7px 0 0; font-size: 13px; color: var(--ink-2); }

.avancada {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  border: 1px solid var(--line); border-radius: 12px; padding: 11px 14px;
  margin-bottom: 12px; background: var(--card);
}
.avancada.is-destaque { border-color: #F0D9AE; background: #FFF6E5; }
.avancada-corpo { flex: 1 1 320px; display: grid; gap: 2px; font-size: 13px; color: var(--ink-2); line-height: 1.5; }
.avancada-corpo b { color: var(--ink); font-size: 13.5px; }

@media (max-width: 640px) {
  .avancada .btn-ghost { width: 100%; }
}

/* =========================================================================
   Célula clicável (data, descrição e valor abrem a edição)
   ========================================================================= */

.celula-editar {
  border: 0; background: none; padding: 4px 2px; margin: 0; font: inherit; color: inherit;
  text-align: inherit; cursor: pointer; border-radius: 6px; -webkit-tap-highlight-color: transparent;
}
.celula-editar:hover { background: var(--brand-050); }
.celula-editar:focus-visible { outline: 2px solid var(--brand-300); outline-offset: 1px; }
.tabela .col-data .celula-editar { white-space: nowrap; font-variant-numeric: tabular-nums; }
.tabela .col-valor .celula-editar { white-space: nowrap; font-weight: 600; font-variant-numeric: tabular-nums; }
.celula-editar.desc-txt { display: block; max-width: none; white-space: normal; line-height: 1.3; text-align: left; }

/* prévia da importação: mesmo desenho da aba Lançamentos */
#tabelaPrevia .col-data { width: 104px; }
#tabelaPrevia .col-desc { min-width: 240px; }
#tabelaPrevia .desc-linha { display: flex; align-items: center; gap: 9px; }
#tabelaPrevia .desc-corpo { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 0; min-width: 0; max-width: 34ch; }
/* a etiqueta do repetido pode ser comprida: quebra em duas linhas em vez de
   esticar a coluna (no celular a tabela já rola de lado) */
#tabelaPrevia .desc-corpo .tag { max-width: 24ch; white-space: normal; text-align: left; line-height: 1.35; }
#tabelaPrevia .desc-corpo .tag { margin-left: 0; margin-right: 6px; }
#tabelaPrevia .desc-corpo .celula-editar { width: 100%; }

@media (max-width: 640px) {
  .barra-acoes .campo-inline { flex-wrap: wrap; width: 100%; }
  .barra-acoes .campo-inline select { flex: 1 1 180px; min-width: 0; max-width: 100%; }
}

.campo textarea { resize: vertical; min-height: 64px; line-height: 1.45; }
.campo textarea:focus { outline: 2px solid var(--brand-300); outline-offset: -1px; border-color: var(--brand-300); }
.modal-nota code { white-space: normal; word-break: break-word; font-size: 12px; }
