:root {
  --bg: #f6f7f9;
  --card: #ffffff;
  --texto: #101828;
  --suave: #5d6676;
  --borda: #e4e7ec;
  --primaria: #0f766e;
  --primaria-esc: #115e59;
  --primaria-clara: #ecfdf8;
  --verde: #067647;
  --vermelho: #b42318;
  --laranja: #b54708;
  --amarelo: #a15c07;
  --lateral: #ffffff;
  --lateral-txt: #475467;
  --raio: 14px;
  --sombra: 0 1px 2px rgba(16, 24, 40, 0.04);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 14px/1.45 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; background: var(--bg); color: var(--texto); }
a { color: var(--primaria); text-decoration: none; }
h1, h2, h3 { margin: 0; }
small { color: var(--suave); }

/* ---------- Layout ---------- */
#layout { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.lateral { background: var(--lateral); color: var(--lateral-txt); border-right: 1px solid var(--borda); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.marca { padding: 20px 20px 14px; font-weight: 800; font-size: 15px; letter-spacing: -0.01em; color: var(--texto); display: flex; gap: 10px; align-items: center; }
.marca-ic { width: 30px; height: 30px; border-radius: 8px; border: 1.5px solid var(--primaria); color: var(--primaria); display: inline-flex; align-items: center; justify-content: center; }
.marca-ic .ic { width: 16px; height: 16px; stroke-width: 2.2; }
.lateral nav { flex: 1; overflow-y: auto; padding: 4px 12px; }
.lateral nav a { display: flex; gap: 10px; align-items: center; padding: 8px 10px; color: var(--lateral-txt); border-radius: 9px; margin-bottom: 2px; font-weight: 500; }
.lateral nav a .rot { flex: 1; }
.lateral nav a .ic { flex: none; }
.lateral nav .cont { font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 99px; background: #f2f4f7; color: #344054; }
.lateral nav .cont:empty { display: none; }
.lateral nav .cont.alerta { background: #fee4e2; color: var(--vermelho); }
.lateral nav a:hover { background: #f2f4f7; color: var(--texto); }
.lateral nav a.ativo { background: var(--primaria-clara); color: #0b5e55; font-weight: 600; box-shadow: inset 0 0 0 1px #99e2d3; }
.lateral nav .sep { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--suave); padding: 16px 10px 6px; }
.lateral .rodape { margin: 10px 12px 14px; padding: 12px; border: 1px solid var(--borda); border-radius: 12px; font-size: 12px; color: var(--texto); }
.lateral .rodape a { color: var(--primaria); font-weight: 600; }
#sinc-info { color: var(--suave) !important; }
.principal { min-width: 0; display: flex; flex-direction: column; }
.topo { background: rgba(246, 247, 249, 0.92); backdrop-filter: blur(6px); border-bottom: 1px solid var(--borda); padding: 14px 28px; display: flex; gap: 12px; align-items: center; position: sticky; top: 0; z-index: 5; }
.topo h1 { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; flex: 1; }
.topo select { max-width: 340px; font-weight: 600; height: 40px; border-color: var(--borda); border-radius: 10px; }
#main { padding: 22px 28px 60px; min-width: 0; }
/* 💬 WhatsApp: a conversa do Whats Web usa a tela toda (largura e altura) */
#main:has(#wa-app) { padding-bottom: 12px; }
.btn.menu-btn { display: none; }
/* Abas do ERP (como no navegador) */
.topo { flex-wrap: wrap; row-gap: 10px; }
.usuario-topo { height: 40px; gap: 8px; white-space: nowrap; }
.usuario-topo .usuario-nome { max-width: 160px; overflow: hidden; text-overflow: ellipsis; color: var(--texto); }
.usuario-topo .usuario-sair { color: var(--primaria); font-weight: 700; padding-left: 8px; border-left: 1px solid var(--borda); }
.abas-erp { flex-basis: 100%; display: flex; align-items: flex-end; gap: 4px; margin: 0 0 -15px; overflow-x: auto; scrollbar-width: none; }
.abas-erp::-webkit-scrollbar { display: none; }
.aba-erp { display: flex; align-items: center; gap: 7px; flex: 0 1 220px; min-width: 110px; padding: 8px 6px 8px 12px; border: 1px solid transparent; border-bottom: none; border-radius: 10px 10px 0 0; color: var(--suave); font-weight: 600; font-size: 13px; cursor: pointer; user-select: none; white-space: nowrap; }
.aba-erp .rot { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.aba-erp .ic { flex: none; width: 15px; height: 15px; }
.aba-erp:hover { background: rgba(16, 24, 40, 0.05); color: var(--texto); }
.aba-erp.ativa { background: var(--bg); border-color: var(--borda); color: var(--texto); position: relative; }
.aba-erp.ativa::after { content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--bg); }
.aba-erp.ativa .ic { color: var(--primaria); }
.aba-x { flex: none; width: 20px; height: 20px; border: none; background: none; border-radius: 6px; color: var(--suave); font-size: 15px; line-height: 1; cursor: pointer; padding: 0; }
.aba-x:hover { background: rgba(16, 24, 40, 0.1); color: var(--texto); }
.aba-mais { flex: none; width: 30px; height: 30px; margin: 0 0 4px 2px; border: none; background: none; border-radius: 8px; color: var(--suave); font-size: 18px; cursor: pointer; }
.aba-mais:hover { background: rgba(16, 24, 40, 0.06); color: var(--texto); }
.menu-ctx { position: fixed; z-index: 80; min-width: 200px; background: var(--card); border: 1px solid var(--borda); border-radius: 10px; box-shadow: 0 10px 30px rgba(16, 24, 40, 0.16); padding: 4px; }
.menu-ctx button { display: block; width: 100%; text-align: left; border: none; background: none; padding: 8px 12px; border-radius: 7px; font: inherit; color: var(--texto); cursor: pointer; }
.menu-ctx button:hover { background: var(--primaria-clara); }

/* ---------- Componentes ---------- */
.card { background: var(--card); border: 1px solid var(--borda); border-radius: var(--raio); box-shadow: var(--sombra); padding: 18px 22px; }
.card + .card { margin-top: 16px; }
.card h3 { font-size: 16px; font-weight: 700; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.grade { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.grade-2 { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); }
.kpi { padding: 18px; display: flex; flex-direction: column; gap: 6px; color: var(--texto); }
a.kpi:hover { border-color: #cfd4dc; }
.kpi .rot { color: var(--suave); font-size: 13px; }
.kpi .val { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.kpi .sub { font-size: 12px; color: var(--suave); }
.kpi.vermelho .val { color: var(--vermelho); }
.kpi.verde .val { color: var(--verde); }
.kpi.azul .val { color: var(--primaria); }
.kpi.laranja .val { color: var(--laranja); }
.barra-ferr { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.barra-ferr .esp { flex: 1; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid var(--borda); background: var(--card); border-radius: 999px; padding: 6px 13px; font-weight: 500; cursor: pointer; font-size: 13px; color: var(--texto); }
.chip.ativo { background: var(--primaria); color: #fff; border-color: var(--primaria); }
.abas { display: flex; gap: 4px; border-bottom: 1px solid var(--borda); margin-bottom: 14px; }
.abas[hidden] { display: none; }
.abas a { padding: 9px 14px; color: var(--suave); border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 500; }
.abas a.ativo { color: var(--primaria); border-color: var(--primaria); }

.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid #d0d5dd; background: var(--card); color: var(--texto); padding: 7px 13px; border-radius: 9px; cursor: pointer; font: inherit; font-weight: 500; white-space: nowrap; }
.btn:hover { background: #f6f7f9; }
.btn:disabled { opacity: 0.55; cursor: default; }
.btn.primario { background: var(--primaria); border-color: var(--primaria); color: #fff; }
.btn.primario:hover { background: var(--primaria-esc); }
.btn.verde { background: var(--verde); border-color: var(--verde); color: #fff; }
.btn.perigo { color: var(--vermelho); }
.btn.peq { padding: 3px 8px; font-size: 12px; border-radius: 6px; }
.btn.icone { padding: 4px 7px; }

input, select, textarea { font: inherit; color: inherit; border: 1px solid #d0d5dd; border-radius: 9px; padding: 7px 10px; background: #fff; width: 100%; }
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(15, 118, 110, 0.18); border-color: var(--primaria); }
input:disabled, select:disabled, textarea:disabled { background: #f2f4f7; color: #667085; cursor: not-allowed; }
.barra-ferr input, .barra-ferr select { width: auto; }
input[type='checkbox'] { width: auto; }
/* Textos sempre em CAIXA ALTA (o valor também é convertido ao digitar e no servidor) */
input:not([type]), input[type='text'], input[type='search'], textarea { text-transform: uppercase; }
[data-sem-caixa] { text-transform: none; }
input[name='chave_pix'], input[name='pluggy_item_id'], input[name='pluggy_account_id'], input[name='lembrete_emails'], textarea[name='codigo_pagamento'] { text-transform: none; }
textarea[name='codigo_pagamento'] { font-family: ui-monospace, Consolas, monospace; font-size: 13px; word-break: break-all; }
input::placeholder, textarea::placeholder { text-transform: none; }
.info-doc { min-height: 1em; }
.form-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 12px; }
.campo { display: flex; flex-direction: column; gap: 4px; }
.campo > span { font-size: 12px; font-weight: 600; color: #374151; }
.chk { display: flex; gap: 8px; align-items: center; cursor: pointer; }
.linha-acao { display: flex; gap: 8px; align-items: flex-end; }
.busca-sel { position: relative; }
.busca-sel input { width: 100%; text-transform: none; }
.busca-sel-lista { position: absolute; left: 0; right: 0; top: calc(100% + 2px); max-height: 260px; overflow-y: auto; background: var(--card); border: 1px solid var(--borda); border-radius: 8px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12); z-index: 60; padding: 4px 0; }
.busca-sel-grupo { padding: 6px 10px 2px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--suave); }
.busca-sel-op { padding: 6px 10px 6px 16px; cursor: pointer; font-weight: 400; color: var(--texto); }
.busca-sel-op.limpar { padding-left: 10px; color: var(--suave); }
.busca-sel-op.ativo { background: var(--primaria-clara); }
.busca-sel-op.criar { padding-left: 10px; border-top: 1px solid var(--borda); margin-top: 4px; color: var(--primaria); font-weight: 600; }
.busca-sel-nada { padding: 6px 10px; color: var(--suave); }

table { width: 100%; border-collapse: collapse; }
.tabela-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--borda); border-radius: var(--raio); box-shadow: var(--sombra); }
th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--suave); font-weight: 600; padding: 11px 12px; border-bottom: 1px solid var(--borda); background: #fafbfc; white-space: nowrap; }
td { padding: 12px; border-bottom: 1px solid #f0f1f4; vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #f9fafb; }
td.num, th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
td.acoes { text-align: right; white-space: nowrap; }
td.acoes .btn { margin-left: 3px; }
tfoot td { font-weight: 700; background: #fafbfc; border-top: 1px solid var(--borda); }
.pos { color: var(--verde); }
.neg { color: var(--vermelho); }
.juros-desconto { display: block; font-weight: 700; margin-top: 4px; }
.juros-desconto.juros { color: var(--vermelho); }
.juros-desconto.desconto { color: #1d4ed8; }
.vazio { text-align: center; padding: 36px; color: var(--suave); }
.tachado { text-decoration: line-through; opacity: 0.6; }
/* Relatórios: pré-visualização com as mesmas linhas de grupo/subtotal/total do PDF */
.rel-kpis > .card + .card { margin-top: 0; }
.rel-tab td { padding: 8px 12px; }
.rel-tab tr.grupo td { font-weight: 700; background: #f2f4f7; }
.rel-tab tr.subtotal td { font-weight: 600; }
.rel-tab tr.total td { font-weight: 700; background: var(--primaria-clara); border-top: 1px solid var(--borda); }
.rel-tab tr.nota td { font-size: 12px; color: var(--suave); font-style: italic; }

.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge.verde { background: #dcfae6; color: #085d3a; }
.badge.vermelho { background: #fee4e2; color: #912018; }
.badge.laranja { background: #ffedd5; color: #9a3412; }
.badge.amarelo { background: #fef9c3; color: #854d0e; }
.badge.azul { background: #ddf7f1; color: #0b5e55; }
.badge.cinza { background: #f3f4f6; color: #4b5563; }
.badge.agendado { background: #2563eb; color: #fff; border: 0; cursor: pointer; font-family: inherit; margin-left: 4px; }
.badge.agendado:hover { background: #1d4ed8; }

.alerta { padding: 12px 16px; border-radius: 12px; margin-bottom: 14px; display: flex; gap: 10px; align-items: center; }
.alerta.info { background: #eff6ff; color: #1e3a8a; border: 1px solid #bfdbfe; }
.alerta.aviso { background: #fffbeb; color: #78350f; border: 1px solid #fde68a; }
.alerta.ok { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.erro { color: var(--vermelho); padding: 20px; }
.carregando { color: var(--suave); padding: 30px; text-align: center; }

/* ---------- Gráfico de fluxo ---------- */
.fluxo { display: flex; gap: 14px; align-items: flex-end; height: 180px; padding-top: 10px; }
.fluxo .mes { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; }
.fluxo .barras { flex: 1; display: flex; gap: 4px; align-items: flex-end; width: 100%; justify-content: center; }
.fluxo .b { width: 40%; max-width: 26px; border-radius: 4px 4px 0 0; min-height: 2px; }
.fluxo .b.r { background: #10b981; }
.fluxo .b.p { background: #f87171; }
.fluxo .lbl { font-size: 12px; color: var(--suave); }
.legenda { display: flex; gap: 14px; font-size: 12px; color: var(--suave); }
.legenda i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 4px; vertical-align: -1px; }

/* ---------- Calendário ---------- */
.cal { display: grid; grid-template-columns: repeat(7, 1fr); border: 1px solid var(--borda); border-radius: var(--raio); overflow: hidden; background: var(--borda); gap: 1px; }
.cal .cab { background: #fafbfc; text-align: center; font-size: 12px; font-weight: 600; color: var(--suave); padding: 8px 0; text-transform: uppercase; }
.cal .dia { background: var(--card); min-height: 112px; padding: 6px; cursor: pointer; display: flex; flex-direction: column; gap: 3px; }
.cal .dia:hover { background: #f9fafb; }
.cal .dia.fora { background: #fafafa; }
.cal .dia.fora .n { color: #c0c4cc; }
.cal .dia.hoje .n { background: var(--primaria); color: #fff; border-radius: 999px; padding: 0 7px; }
.cal .n { font-size: 12px; font-weight: 600; align-self: flex-start; }
.cal .ev { font-size: 11.5px; padding: 2px 6px; border-radius: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal .ev.pagar { background: #fee2e2; color: #991b1b; }
.cal .ev.receber { background: #d1fae5; color: #065f46; }
.cal .ev.pago { background: #f3f4f6; color: #6b7280; text-decoration: line-through; }
.cal .ev.vencido { outline: 1px solid var(--vermelho); }
.cal .mais { font-size: 11px; color: var(--suave); }
.cal .tot { margin-top: auto; font-size: 11px; color: var(--suave); }

/* ---------- Modal ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(15, 23, 42, 0.45); display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px; z-index: 50; overflow-y: auto; }
.modal { background: var(--card); border-radius: 12px; width: 100%; box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2); }
.modal-hd { display: flex; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--borda); }
.modal-hd h3 { flex: 1; font-size: 16px; }
.modal-hd .x { border: 0; background: none; font-size: 22px; cursor: pointer; color: var(--suave); line-height: 1; }
.modal-bd { padding: 16px 18px; }
.modal-ft { padding: 12px 18px; border-top: 1px solid var(--borda); display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }

.sugestao { display: grid; grid-template-columns: 54px 1fr auto auto; gap: 12px; align-items: center; padding: 10px 6px; border-bottom: 1px solid #f1f2f4; }
.sugestao.com-sel { grid-template-columns: 22px 54px 1fr auto auto; }
.sugestao.com-sel input[type='checkbox'] { width: 18px; height: 18px; margin: 0; cursor: pointer; }
.sugestao.marcada { background: #eef6f3; }
.barra-varios { position: sticky; bottom: -1px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin-top: 10px; padding: 10px 12px; background: #fff; border: 1px solid #d6e6df; border-radius: 10px; box-shadow: 0 -4px 12px rgba(0,0,0,.06); }
.barra-varios[hidden] { display: none; }
.score { font-weight: 700; text-align: center; border-radius: 8px; padding: 6px 0; font-size: 13px; }
.score.alto { background: #d1fae5; color: #065f46; }
.score.medio { background: #fef9c3; color: #854d0e; }
.score.baixo { background: #f3f4f6; color: #4b5563; }

#toasts { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 100; }
.toast { background: #111827; color: #fff; padding: 10px 16px; border-radius: 8px; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2); max-width: 420px; animation: entra 0.2s; }
.toast.erro { background: var(--vermelho); }
.toast.ok { background: #065f46; }
@keyframes entra { from { transform: translateY(10px); opacity: 0; } }

/* ---------- Login ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: #0f766e; }
.login { width: 100%; max-width: 440px; }
.login .marca-l { color: #fff; text-align: center; font-size: 26px; font-weight: 700; margin-bottom: 18px; }
.login .card { padding: 22px; }

.conta-banco { display: flex; flex-direction: column; gap: 6px; }
.conta-banco .saldo { font-size: 22px; font-weight: 700; }
.conta-banco .acoes { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }

@media (max-width: 860px) {
  #layout { grid-template-columns: 1fr; }
  .lateral { position: fixed; left: -260px; width: 240px; z-index: 40; transition: left 0.2s; }
  .lateral.aberta { left: 0; box-shadow: 0 20px 50px rgba(16, 24, 40, 0.18); }
  .btn.menu-btn { display: inline-flex; }
  #main { padding: 16px; }
  .topo { padding: 10px 14px; }
  .abas-erp { margin-bottom: -11px; }
  .aba-erp { min-width: 96px; }
  .topo select { max-width: 160px; }
  .usuario-topo .usuario-nome { display: none; }
  .usuario-topo .usuario-sair { padding-left: 0; border-left: 0; }
  .grade-2 { grid-template-columns: 1fr; }
  .cal .dia { min-height: 70px; }
  .cal .ev { font-size: 10px; padding: 1px 3px; }
  .form-grid > * { grid-column: span 12 !important; }
}

/* ---------- Painel ---------- */
.painel-topo { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr)); }
.hero { display: flex; flex-direction: column; gap: 6px; padding: 22px 24px; }
.hero .rot { color: var(--suave); font-size: 13px; }
.hero-val { font-size: 38px; font-weight: 800; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; line-height: 1.15; }
.hero-sub { font-size: 13px; font-weight: 600; }
.hero-sub small { font-weight: 400; }
.hero-contas { display: flex; flex-direction: column; gap: 12px; margin-top: 14px; }
.hc-l { display: flex; gap: 10px; font-size: 13px; margin-bottom: 6px; }
.hc-l span { flex: 1; color: #344054; }
.hc-l b { font-variant-numeric: tabular-nums; }
.trilho { height: 6px; border-radius: 99px; background: #f2f4f7; overflow: hidden; }
.trilho i { display: block; height: 100%; background: var(--primaria); border-radius: 99px; }
.kpis-2 { display: grid; gap: 18px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.kpis-2 .card + .card { margin-top: 0; }
.fluxo-meses { display: grid; gap: 12px; grid-template-columns: repeat(6, minmax(0, 1fr)); }
.fm { border: 1px solid var(--borda); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 10px; background: #fcfcfd; }
.fm-mes { font-size: 12px; font-weight: 600; color: var(--suave); }
.fm-barras { display: flex; align-items: flex-end; gap: 6px; height: 90px; }
.fm-barras i { flex: 1; border-radius: 5px; min-height: 2px; }
.fm-barras i.r { background: var(--primaria); }
.fm-barras i.p { background: #f59e0b; }
.fm-res { font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
@media (max-width: 860px) {
  .fluxo-meses { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kpis-2 { gap: 12px; }
  .hero-val { font-size: 30px; }
}

/* Ordenação por coluna (clique no título) */
th.ordenavel { cursor: pointer; user-select: none; }
th.ordenavel:hover { color: var(--texto); background: #f1f3f6; }
th.ordenavel .seta-ord { display: inline-block; margin-left: 5px; font-size: 10px; opacity: 0.35; }
th.ordenavel:hover .seta-ord { opacity: 0.7; }
th.ord-ativa { color: var(--primaria); }
th.ord-ativa .seta-ord { opacity: 1; }

/* ---------- Logo da empresa, configurações, menu organizável ---------- */
.logo-emp { height: 34px; max-width: 120px; object-fit: contain; border-radius: 6px; background: #fff; }
.logo-mini { height: 28px; max-width: 70px; object-fit: contain; border-radius: 4px; background: #fff; border: 1px solid var(--borda); }
.emp-cel { display: flex; gap: 10px; align-items: center; }
.logo-caixa { border: 1px dashed var(--borda); border-radius: 12px; min-height: 110px; display: flex; align-items: center; justify-content: center; background: #fff; margin-bottom: 10px; padding: 10px; }
.logo-caixa img { max-height: 120px; max-width: 100%; object-fit: contain; }
.logo-caixa span { color: var(--suave); }
.abas-rolagem { overflow-x: auto; white-space: nowrap; scrollbar-width: thin; }
.abas-rolagem a { flex: 0 0 auto; }
.lista-simples { margin: 0; padding-left: 18px; }
.lista-simples li { margin: 4px 0; }
.acesso-linha { display: flex; gap: 6px; align-items: center; margin-top: 6px; }
.acesso-linha select:first-child { flex: 2; min-width: 0; }
.acesso-linha select[data-perfil] { flex: 1; min-width: 0; }
.modulo-linha { display: flex; align-items: center; gap: 10px; padding: 10px 4px; border-bottom: 1px solid var(--borda); cursor: pointer; }
.modulo-linha .esp, .org-cab .esp, .org-lista .esp { flex: 1; }
.switch { position: relative; width: 42px; height: 24px; flex: 0 0 auto; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch i { position: absolute; inset: 0; background: #cbd5e1; border-radius: 999px; transition: background 0.15s; }
.switch i::after { content: ''; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform 0.15s; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2); }
.switch input:checked + i { background: var(--primaria); }
.switch input:checked + i::after { transform: translateX(18px); }
.switch input:focus-visible + i { outline: 2px solid var(--primaria); outline-offset: 2px; }
.org-setor { border: 1px solid var(--borda); border-radius: 12px; padding: 8px 10px; margin-bottom: 10px; }
.org-cab { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.org-lista { list-style: none; margin: 0; padding: 0; }
.org-lista li { display: flex; align-items: center; gap: 8px; padding: 6px 6px; border-radius: 8px; background: #fff; border: 1px solid transparent; cursor: grab; }
.org-lista li:hover { border-color: var(--borda); }
.org-lista li.arrastando { opacity: 0.4; }
.org-alca { color: var(--suave); font-size: 14px; }
@media (max-width: 640px) {
  .logo-emp { height: 26px; max-width: 70px; }
  .acesso-linha { flex-wrap: wrap; }
  .acesso-linha select:first-child { flex: 1 1 100%; }
}
/* Extrato: seleção de várias transações para conciliar juntas */
.barra-selecao { position: sticky; top: 8px; z-index: 5; flex-wrap: wrap; box-shadow: 0 6px 18px rgba(30, 58, 138, 0.12); }
.barra-selecao .esp { flex: 1; }
th.col-sel, td.col-sel { width: 32px; padding-right: 0; text-align: center; }
.col-sel input { width: 17px; height: 17px; cursor: pointer; accent-color: var(--primaria); }
tr.selecionada td { background: #eff6ff; }

/* Cadastro do usuário: caixinhas dos módulos */
.caixas-modulos { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 2px 14px; border: 1px solid var(--borda); border-radius: 10px; padding: 8px 12px; margin-top: 4px; }
.caixas-acoes { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }

/* ---------- Drive e Dropbox inteligente ---------- */
.visor { min-height: 300px; display: flex; align-items: center; justify-content: center; background: #f8fafc; border-radius: 10px; overflow: hidden; }
.visor iframe { width: 100%; height: 75vh; border: 0; background: #fff; }
.visor img { max-width: 100%; max-height: 75vh; object-fit: contain; }
.visor pre { width: 100%; max-height: 75vh; overflow: auto; margin: 0; padding: 14px; font-size: 12px; white-space: pre-wrap; word-break: break-word; }
.drop-zona { border: 2px dashed var(--borda); transition: background 0.15s, border-color 0.15s; }
.drop-zona.soltar { background: var(--primaria-clara); border-color: var(--primaria); }
.cartao-drive + .cartao-drive { margin-top: 12px; }
.miniatura { width: 52px; height: 60px; border: 1px solid var(--borda); border-radius: 8px; background: #f8fafc; font-size: 26px; cursor: pointer; flex: none; }
.miniatura:hover { border-color: var(--primaria); }
.aviso-drive { margin-top: 8px; font-size: 13px; color: #9a3412; }
.acoes-drive { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; margin-top: 10px; }
.trilha { font-weight: 600; display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.sug-drive { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 8px; padding-top: 8px; border-top: 1px solid #bfdbfe; }
.sug-drive .esp { flex: 1; }
@media (max-width: 700px) {
  .visor iframe { height: 65vh; }
  .acoes-drive { justify-content: flex-start; }
}

/* Campos de data em DD/MM/AAAA (o campo nativo fica escondido, só para o calendário) */
.data-br { position: relative; display: inline-flex; align-items: center; width: 100%; }
.barra-ferr .data-br, td .data-br { width: auto; }
.data-br > .data-br-txt { padding-right: 30px; text-transform: none; }
.barra-ferr .data-br > .data-br-txt { width: auto; }
.data-br > .data-br-nativo { position: absolute; left: 0; bottom: 0; width: 100%; height: 1px; opacity: 0; pointer-events: none; padding: 0; border: 0; }
.data-br > .data-br-cal { position: absolute; right: 4px; background: none; border: 0; cursor: pointer; padding: 2px 4px; font-size: 14px; line-height: 1; }
.data-br > .data-br-txt:disabled ~ .data-br-cal { display: none; }

/* Painel: botões PDF / WhatsApp das contas a pagar de hoje */
.dash-hoje { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-weight: 400; margin-right: 8px; }
.dash-hoje small { color: var(--texto-2, #64748b); margin-right: 4px; }
@media (max-width: 700px) { .card h3:has(.dash-hoje) { flex-wrap: wrap; } }

/* Filtro rápido de período (Dia / Semana / Mês) em contas a pagar/receber */
.periodo-rapido .chip { padding: 5px 11px; }
.periodo-rapido .chip:disabled { opacity: .4; cursor: default; }

/* "×" para apagar o texto dos campos de busca dos filtros */
.campo-x { position: relative; display: inline-flex; align-items: center; }
.campo-x > input { padding-right: 26px; }
.campo-x-btn { position: absolute; right: 4px; width: 20px; height: 20px; padding: 0; border: 0; border-radius: 50%; background: #e2e8f0; color: #475569; font-size: 15px; line-height: 20px; cursor: pointer; }
.campo-x-btn:hover { background: #cbd5e1; color: #0f172a; }
.campo-x > input:placeholder-shown + .campo-x-btn { display: none; }
