/* Fontes locais (sem Google): Roboto Slab (Apache-2.0) e Montserrat (OFL-1.1) */
@font-face { font-family: "Roboto Slab"; font-style: normal; font-weight: 600; font-display: swap; src: url("/fonts/roboto-slab-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Roboto Slab"; font-style: normal; font-weight: 700; font-display: swap; src: url("/fonts/roboto-slab-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Montserrat"; font-style: normal; font-weight: 600; font-display: swap; src: url("/fonts/montserrat-latin-600-normal.woff2") format("woff2"); }
:root {
  /* Espaçamento (múltiplos de 4px), raios e tipografia — ver Guia de estilo (#/guia) */
  --esp-1: 4px; --esp-2: 8px; --esp-3: 12px; --esp-4: 16px; --esp-5: 24px; --esp-6: 32px;
  --raio-p: 8px; --raio-m: 12px; --raio-pill: 999px;
  --fs-xs: .76rem; --fs-s: .86rem; --fs-m: 1rem; --fs-l: 1.25rem; --fs-xl: 1.7rem;
  /* Identidade Âncora Condominium: azul-marinho da âncora, areia dourada, papel creme */
  --navy: #1f3d5e;
  --areia: #c2a15b;
  --oliva: #6b6f2e;
  --madeira: #7a5233;
  --bg: #f4efe4;
  --surface: #fffdf8;
  --surface-2: #efe7d8;
  --text: #1d2b3a;
  --muted: #6d6455;
  --border: #e2d7c3;
  --primary: var(--navy);
  --primary-ink: #ffffff;
  --primary-soft: #e4ebf3;
  --accent: var(--areia);
  --accent-soft: #f4ead3;
  --pos: #4f7a2a;
  --neg: #a8432a;
  --warn-bg: #f8eed6;
  --warn: #8a5a1f;
  --shadow: 0 1px 2px rgb(31 61 94 / .06), 0 6px 18px rgb(31 61 94 / .06);
  --radius: 14px;
  --serif: "Roboto Slab", "Rockwell", Georgia, serif;
  --espacada: "Montserrat", system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1722; --surface: #13212f; --surface-2: #1a2b3d; --text: #ede6d6; --muted: #a79d89;
    --border: #283a4e; --primary: #d0b06a; --primary-ink: #13212f; --primary-soft: #2a3341; --accent: #d0b06a; --accent-soft: #2b2a24;
    --pos: #8fbf5a; --neg: #e57c5f; --warn-bg: #2c2414; --warn: #e3b55c;
    --shadow: 0 1px 2px rgb(0 0 0 / .4); color-scheme: dark;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-font-smoothing: antialiased;
  background-image: radial-gradient(rgb(122 82 51 / .035) 1px, transparent 1px); background-size: 4px 4px; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--primary); }
h1 { font: 700 1.55rem/1.2 var(--serif); margin: 0 0 4px; color: var(--primary); }
h2 { font: 600 1.05rem/1.3 var(--serif); margin: 0 0 12px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.num { font-variant-numeric: tabular-nums; }
.pos { color: var(--pos); } .neg { color: var(--neg); }

/* topo */
header#topo { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 16px; padding: 10px 20px; padding-top: max(10px, env(safe-area-inset-top));
  background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.marca { display: flex; align-items: center; gap: 8px; font-weight: 700; white-space: nowrap; }
.marca img { border-radius: 7px; }
nav#menu { display: flex; gap: 4px; flex: 1; }
nav#menu a { padding: 7px 12px; border-radius: 999px; text-decoration: none; color: var(--muted); font-weight: 550; }
nav#menu a:hover { background: var(--surface-2); color: var(--text); }
nav#menu a.ativo { background: var(--primary-soft); color: var(--primary); }
.usuario { display: flex; align-items: center; gap: 8px; border: 1px solid var(--border); background: var(--surface); border-radius: 999px; padding: 4px 12px 4px 4px; cursor: pointer; }

main { max-width: 1180px; margin: 0 auto; padding: 24px 20px 96px; }
.cabecalho { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.grade { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); min-width: 0; }
.card + .card { margin-top: 16px; }
.grade > .card + .card { margin-top: 0; }

.avatar { --c: var(--primary); width: 28px; height: 28px; border-radius: 50%; background: var(--c); color: #fff; display: inline-grid; place-items: center; font-size: .78rem; font-weight: 700; flex: none; }
.avatar.g { width: 56px; height: 56px; font-size: 1.2rem; }
.tag { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 999px; background: var(--surface-2); font-size: .8rem; color: var(--muted); }
.tag i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); }

/* botões e formulários */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--border); background: var(--surface); padding: 8px 14px; border-radius: 10px; cursor: pointer; font-weight: 600; text-decoration: none; color: var(--text); white-space: nowrap; }
.btn:hover { background: var(--surface-2); }
.btn.prim { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.btn.prim:hover { filter: brightness(1.08); }
.btn.perigo { color: var(--neg); }
.btn.peq { padding: 4px 10px; font-size: .85rem; border-radius: 8px; }
.btn:disabled { opacity: .5; cursor: default; }
.linha { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
label.campo { display: grid; gap: 4px; font-size: .85rem; color: var(--muted); font-weight: 550; }
.campo input, .campo select, .campo textarea { width: 100%; padding: 9px 11px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: 1rem; }
.campo input:focus, .campo select:focus, .campo textarea:focus { outline: 2px solid var(--primary); outline-offset: -1px; }
.form { display: grid; gap: 12px; }
.form .dupla { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.check { display: flex; gap: 8px; align-items: center; font-size: .9rem; }
.aviso { background: var(--warn-bg); color: var(--warn); padding: 10px 12px; border-radius: 10px; font-size: .9rem; }

/* tabelas */
.tabela-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 650; }
td.num, th.num { text-align: right; }
tr:last-child td { border-bottom: 0; }
tfoot td { font-weight: 700; border-top: 2px solid var(--border); }

/* lista */
.lista { list-style: none; margin: 0; padding: 0; }
.lista li { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.lista li:last-child { border-bottom: 0; }
.lista .cresce { flex: 1; min-width: 0; }
.vazio { color: var(--muted); padding: 16px 0; text-align: center; }

/* saldos */
.saldo { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.saldo:last-child { border-bottom: 0; }
.saldo .barra { flex: 1; height: 8px; background: var(--surface-2); border-radius: 4px; position: relative; overflow: hidden; }
.saldo .barra span { position: absolute; top: 0; bottom: 0; border-radius: 4px; }
.kpi { font-size: 1.8rem; font-weight: 750; letter-spacing: -.02em; }

/* calendário */
.cal-nav { display: flex; align-items: center; gap: 8px; }
.cal-nav strong { min-width: 150px; text-align: center; }
.cal { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.cal table { border-collapse: separate; border-spacing: 0; width: max-content; min-width: 100%; }
.cal th, .cal td { padding: 0; border-bottom: 1px solid var(--border); border-right: 1px solid var(--border); text-align: center; }
.cal thead th { position: sticky; top: 0; background: var(--surface); font-size: .72rem; padding: 6px 0; width: 34px; min-width: 34px; text-transform: none; letter-spacing: 0; }
.cal thead th small { display: block; font-weight: 500; color: var(--muted); }
.cal th.fds { background: var(--surface-2); }
.cal th.hoje { color: var(--primary); box-shadow: inset 0 -3px 0 var(--primary); }
.cal .rec { position: sticky; left: 0; z-index: 2; background: var(--surface); text-align: left; padding: 6px 12px; min-width: 150px; max-width: 190px; font-size: .88rem; font-weight: 600; text-transform: none; letter-spacing: 0; color: var(--text); }
.cal .rec small { display: block; color: var(--muted); font-weight: 500; }
.cal tr.grupo th { background: var(--surface-2); text-align: left; padding: 6px 12px; font-size: .74rem; color: var(--muted); position: sticky; left: 0; }
.cal td.dia { height: 38px; cursor: pointer; }
.cal td.dia:hover { background: var(--primary-soft); }
.cal td.dia.fds { background: color-mix(in srgb, var(--surface-2) 55%, transparent); }
.cal td.dia.passado { cursor: default; opacity: .55; }
.cal td.dia.passado:hover { background: none; }
.cal td.ocup { padding: 3px 0; cursor: pointer; }
.cal td.ocup div { height: 30px; background: var(--c); color: #fff; font-size: .7rem; font-weight: 700; display: grid; place-items: center; overflow: hidden; white-space: nowrap; }
.cal td.ocup.ini div { margin-left: 3px; border-top-left-radius: 8px; border-bottom-left-radius: 8px; }
.cal td.ocup.fim div { margin-right: 3px; border-top-right-radius: 8px; border-bottom-right-radius: 8px; }
.cal td.ocup.minha div { box-shadow: inset 0 0 0 2px rgb(255 255 255 / .7); }
.legenda { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0; }

/* login */
.login { max-width: 520px; margin: 8vh auto 0; text-align: center; }
.login .socios { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; margin-top: 24px; }
.login .socio { display: grid; justify-items: center; gap: 8px; padding: 18px 10px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); cursor: pointer; font-weight: 600; box-shadow: var(--shadow); }
.login .socio:hover { border-color: var(--primary); }
.pin { font-size: 1.8rem; letter-spacing: .5em; text-align: center; width: 220px; padding: 10px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); }

/* modal e toast */
dialog { border: 0; border-radius: 18px; padding: 0; width: min(480px, calc(100vw - 32px)); background: var(--surface); color: var(--text); box-shadow: 0 20px 60px rgb(0 0 0 / .3); }
dialog::backdrop { background: rgb(10 20 22 / .45); backdrop-filter: blur(2px); }
dialog form { padding: 22px; display: grid; gap: 14px; }
dialog .acoes { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
dialog .acoes .esq { margin-right: auto; }
#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); opacity: 0; background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 999px; font-weight: 600; transition: .25s; pointer-events: none; z-index: 50; max-width: calc(100vw - 32px); }
#toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.erro { background: var(--neg); color: #fff; }

@media (max-width: 760px) {
  header#topo { flex-wrap: wrap; gap: 8px; padding: 8px 16px; backdrop-filter: none; background: var(--surface); }
  nav#menu { position: fixed; bottom: 0; left: 0; right: 0; justify-content: space-around; background: var(--surface); border-top: 1px solid var(--border); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); z-index: 20; }
  nav#menu a { padding: 8px 10px; font-size: .85rem; }
  .marca { flex: 1; }
  main { padding: 16px 16px 110px; }
  .grade { grid-template-columns: 1fr; }
  .form .dupla { grid-template-columns: 1fr; }
  .esconde-mobile { display: none; }
}

/* chamados */
.botoes-grandes { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 8px; }
.botoes-grandes .btn { justify-content: flex-start; padding: 12px 14px; white-space: normal; text-align: left; }
.chamados { display: grid; gap: 12px; }
a.chamado { display: flex; gap: 14px; align-items: center; text-decoration: none; color: var(--text); padding: 12px; }
a.chamado + a.chamado { margin-top: 0; }
a.chamado:hover { border-color: var(--primary); }
a.chamado img, a.chamado .sem-foto { width: 76px; height: 76px; border-radius: 10px; object-fit: cover; flex: none; background: var(--surface-2); }
a.chamado .sem-foto { display: grid; place-items: center; font-size: 1.8rem; }
a.chamado .cresce { flex: 1; min-width: 0; display: grid; gap: 3px; }
a.chamado strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tag.neg { color: var(--neg); }
.fotos { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; margin-top: 12px; }
.fotos figure { margin: 0; }
.fotos img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; display: block; background: var(--surface-2); }
.fotos figcaption { font-size: .72rem; color: var(--muted); margin-top: 4px; }
.lnk { background: none; border: 0; padding: 0; color: var(--neg); cursor: pointer; font-size: .72rem; text-decoration: underline; }
.campo-inline { padding: 9px 11px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); min-width: 0; }
.cresce { flex: 1; }
label.btn input[type=file] { display: none; }

/* ===================== v2 ===================== */
h3 { font-size: .95rem; margin: 0 0 10px; }
.entre { justify-content: space-between; }
.logo { border-radius: 16px; }
.btn.grande { padding: 12px 16px; font-size: 1rem; }
.login { padding: 28px; }
.login .form { text-align: left; margin: 18px 0; }
a.marca { text-decoration: none; color: var(--text); }
.busca input { width: 190px; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); }
.busca input:focus { outline: 2px solid var(--primary); background: var(--surface); }
nav#menu .ic { display: none; }
a.usuario { text-decoration: none; color: var(--text); }

/* KPIs */
.kpis { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.kpi-card { display: grid; gap: 4px; text-decoration: none; color: var(--text); margin: 0 !important; }
.kpi-card .rotulo { font-size: .8rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.kpi-card.destaque { background: url("logo-marca.svg") right -18px bottom -26px / 150px no-repeat, linear-gradient(135deg, #1f3d5e, #183049 60%, #132639); color: #fff; border: 0; }
.kpi-card.destaque .kpi { font-family: var(--serif); }
.kpi-card.destaque .rotulo, .kpi-card.destaque .small { color: rgb(255 255 255 / .8); }
a.kpi-card:hover { border-color: var(--primary); }

/* abas do financeiro */
.abas { display: flex; gap: 4px; overflow-x: auto; margin: -4px 0 18px; padding-bottom: 4px; border-bottom: 1px solid var(--border); scrollbar-width: none; }
.abas a { padding: 8px 14px; border-radius: 10px 10px 0 0; text-decoration: none; color: var(--muted); font-weight: 600; white-space: nowrap; border-bottom: 2px solid transparent; }
.abas a.ativo { color: var(--primary); border-bottom-color: var(--primary); }
.abas a:hover { color: var(--text); }
.barra-mes { margin-bottom: 14px; }

/* detalhes */
.det { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px 16px; }
.det > div { display: grid; gap: 2px; font-size: .92rem; }
.det span:first-child { font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; }
.det .larga { grid-column: 1 / -1; }
details summary { cursor: pointer; color: var(--primary); font-weight: 600; font-size: .9rem; }
a.prot { font: 600 .74rem/1 ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--surface-2); color: var(--muted); padding: 3px 7px; border-radius: 6px; text-decoration: none; white-space: nowrap; border: 1px solid var(--border); }
a.prot:hover { color: var(--primary); border-color: var(--primary); }
tr.clicavel { cursor: pointer; }
tr.clicavel:hover td { background: var(--surface-2); }
.riscado, tr.riscado td { opacity: .5; text-decoration: line-through; }
tr.pendente td { background: var(--warn-bg); }
.timeline { list-style: none; padding: 0 0 0 14px; margin: 0; border-left: 2px solid var(--border); }
.timeline li { padding: 4px 0 8px; position: relative; }
.timeline li::before { content: ''; position: absolute; left: -20px; top: 9px; width: 10px; height: 10px; border-radius: 50%; background: var(--primary); }
dialog.largo { width: min(680px, calc(100vw - 32px)); }
dialog form h3 { margin-top: 6px; }

/* gráficos simples */
.barras { display: flex; align-items: flex-end; gap: 10px; height: 150px; padding-top: 8px; }
.barra-col { flex: 1; display: grid; grid-template-rows: 1fr auto; height: 100%; text-align: center; gap: 4px; }
.pares { display: flex; align-items: flex-end; justify-content: center; gap: 3px; }
.pares .b { width: 40%; max-width: 18px; border-radius: 5px 5px 0 0; min-height: 2px; }
.b.desp { background: var(--neg); opacity: .85; } .b.ent { background: var(--pos); opacity: .85; }
.barra-col small { color: var(--muted); font-size: .72rem; text-transform: capitalize; }
.cats { display: grid; gap: 8px; margin-top: 12px; }
.cat { display: grid; grid-template-columns: minmax(90px, 1fr) 2fr auto; gap: 10px; align-items: center; font-size: .85rem; }
.trilho { height: 8px; background: var(--surface-2); border-radius: 4px; overflow: hidden; }
.trilho span { display: block; height: 100%; background: var(--primary); border-radius: 4px; }
table.resumo td { padding: 6px 0; }

/* cobrança / reembolso */
.cobranca { display: flex; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); }
.cobranca:last-of-type { border-bottom: 0; }
.lista li.bloco { align-items: flex-start; }
.lista .dir { display: grid; gap: 6px; justify-items: end; text-align: right; }
.emoji { font-size: 1.3rem; width: 32px; text-align: center; flex: none; }
.pix { display: grid; gap: 6px; padding: 12px; border-radius: 12px; background: var(--primary-soft); }
.pix textarea, dialog textarea#lnk { width: 100%; font: .78rem ui-monospace, Menlo, monospace; padding: 8px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text); resize: none; }
.opcoes, .perfis { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.opcao { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; cursor: pointer; }
.opcao:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.opcao div { display: grid; gap: 2px; }
.opcao.desab { opacity: .5; cursor: default; }
.fotos .pdf { aspect-ratio: 1; border-radius: 10px; background: var(--surface-2); display: grid; place-content: center; text-align: center; font-weight: 800; color: var(--neg); gap: 4px; }
.fotos .pdf small { color: var(--muted); font-weight: 500; font-size: .7rem; padding: 0 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 120px; }

/* ambientes e atalhos */
.ambientes { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.card.amb { text-align: left; cursor: pointer; padding: 0; overflow: hidden; display: grid; margin: 0 !important; font: inherit; color: var(--text); }
.card.amb > div:last-child { padding: 12px 14px; }
.card.amb img, .card.amb .sem-foto { width: 100%; aspect-ratio: 16/9; object-fit: cover; background: var(--surface-2); display: grid; place-items: center; font-size: 2rem; }
.card.amb.inativo { opacity: .55; }
.card.amb:hover, .atalho:hover { border-color: var(--primary); }
.atalho { display: flex; gap: 12px; align-items: center; text-decoration: none; color: var(--text); text-align: left; cursor: pointer; font: inherit; margin: 0 !important; width: 100%; }

/* impressão (prestação de contas → PDF) */
.so-impressao { display: none; }
@media print {
  header#topo, .abas, .cabecalho, .barra-mes, #toast, nav#menu { display: none !important; }
  body { background: #fff; color: #000; }
  main { padding: 0; max-width: none; }
  .card { box-shadow: none; break-inside: avoid; border-color: #ccc; }
  .so-impressao { display: block; margin-bottom: 12px; }
  a.prot { border: 0; background: none; padding: 0; color: #333; }
}

@media (max-width: 760px) {
  .busca { display: none; }
  nav#menu a { display: grid; justify-items: center; gap: 1px; font-size: .72rem; padding: 6px 8px; border-radius: 12px; }
  nav#menu .ic { display: block; font-size: 1.1rem; line-height: 1; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .kpi-card .kpi { font-size: 1.25rem; }
  .kpi-card.destaque { grid-column: 1 / -1; }
  .kpi-card.destaque .kpi { font-size: 1.8rem; }
}

/* ---------- marca ---------- */
.marca { gap: 10px; }
.marca img { border-radius: 0; }
.marca .nome { display: grid; line-height: 1; }
.marca .nome b { font: 700 1.15rem/1 var(--serif); color: var(--primary); letter-spacing: .02em; }
.marca .nome small { font: 600 .56rem/1.2 var(--espacada); letter-spacing: .32em; color: var(--accent); margin-top: 3px; }
.wordmark { display: grid; justify-items: center; gap: 2px; margin: 6px 0 4px; }
.wordmark b { font: 700 2.3rem/1 var(--serif); color: var(--primary); letter-spacing: .04em; }
.wordmark small { font: 600 .82rem/1 var(--espacada); letter-spacing: .38em; color: var(--accent); padding-left: .38em; }
.login .logo-grande { width: 170px; height: auto; display: block; margin: 0 auto; }
.login { border-top: 4px solid var(--accent); }
.kpi { font-family: var(--serif); }
.btn.prim { box-shadow: 0 1px 0 rgb(0 0 0 / .1); }
.abas a.ativo { border-bottom-color: var(--accent); }
nav#menu a.ativo { background: var(--accent-soft); color: var(--primary); }
.cabecalho h1::after { content: ''; display: block; width: 36px; height: 3px; background: var(--accent); border-radius: 2px; margin-top: 6px; }
.timeline li::before { background: var(--accent); }
.trilho span { background: linear-gradient(90deg, var(--primary), #345a82); }
.so-impressao img { width: 60px; vertical-align: middle; margin-right: 10px; }
@media (prefers-color-scheme: dark) { .marca .nome b, .wordmark b, h1 { color: var(--text); } .trilho span { background: var(--accent); } }
@media (max-width: 760px) { .marca .nome small { display: none; } .wordmark b { font-size: 1.9rem; } }

/* auditoria */
.selo { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; font-size: .82rem; font-weight: 600; }
.selo.ok { background: color-mix(in srgb, var(--pos) 14%, transparent); color: var(--pos); }
.selo.erro { background: color-mix(in srgb, var(--neg) 14%, transparent); color: var(--neg); }
.filtros { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); align-items: end; margin-bottom: 16px; }
.log { list-style: none; margin: 0; padding: 0; }
.log li { display: flex; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.log li:last-child { border-bottom: 0; }
.log li.alerta { box-shadow: inset 3px 0 0 var(--neg); padding-left: 10px; }
.log .quando { font: .8rem ui-monospace, Menlo, monospace; color: var(--muted); white-space: nowrap; padding-top: 2px; min-width: 112px; }
.diff { margin-top: 4px; font-size: .82rem; display: grid; gap: 2px; }
.diff span { color: var(--muted); }
.diff del { color: var(--neg); text-decoration: line-through; }
.diff ins { color: var(--pos); text-decoration: none; font-weight: 600; }
@media (max-width: 760px) { .log li { flex-direction: column; gap: 2px; } }

/* ======================= Reservas v3: linha do tempo animada ======================= */
@keyframes sobe { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes cresce { from { opacity: 0; transform: scaleX(.2); } to { opacity: 1; transform: none; } }
@keyframes daDireita { from { opacity: 0; transform: translateX(28px); } to { opacity: 1; transform: none; } }
@keyframes daEsquerda { from { opacity: 0; transform: translateX(-28px); } to { opacity: 1; transform: none; } }
@keyframes pulsa { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--c) 55%, transparent); } 50% { box-shadow: 0 0 0 5px color-mix(in srgb, var(--c) 0%, transparent); } }
@keyframes anel { from { stroke-dasharray: 0 100; } }

.res-topo { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.mes-nav { display: flex; align-items: center; gap: 6px; }
.mes-titulo { font: 700 1.15rem var(--serif); min-width: 170px; text-align: center; color: var(--primary); }
.btn.icone { width: 36px; height: 36px; padding: 0; border-radius: 50%; font-size: 1.2rem; }
.btn { transition: transform .12s ease, background .2s, box-shadow .2s; }
.btn:active { transform: scale(.96); }
.segmentado { display: inline-flex; background: var(--surface-2); border-radius: 999px; padding: 3px; border: 1px solid var(--border); }
.segmentado button { border: 0; background: none; padding: 7px 16px; border-radius: 999px; font-weight: 600; color: var(--muted); cursor: pointer; transition: all .2s; }
.segmentado button.ativo { background: var(--surface); color: var(--primary); box-shadow: 0 1px 4px rgb(0 0 0 / .12); }

.res-resumo { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 16px; margin-bottom: 14px; box-shadow: var(--shadow); animation: sobe .4s ease both; }
.anel { position: relative; width: 52px; height: 52px; flex: none; }
.anel svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.anel circle { fill: none; stroke: var(--surface-2); stroke-width: 3.6; }
.anel circle.v { stroke: var(--accent); stroke-linecap: round; stroke-dasharray: var(--p) 100; animation: anel 1s cubic-bezier(.2,.8,.2,1) both; }
.anel b { position: absolute; inset: 0; display: grid; place-items: center; font-size: .78rem; }
.res-resumo .prox { margin-left: auto; display: grid; text-align: right; padding-left: 14px; border-left: 1px solid var(--border); }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 10px; margin-bottom: 4px; scrollbar-width: none; }
.chip { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--border); background: var(--surface); padding: 5px 13px 5px 6px; border-radius: 999px; font-weight: 600; font-size: .86rem; cursor: pointer; white-space: nowrap; color: var(--text); transition: all .2s; }
.chip:first-child { padding-left: 13px; }
.chip.ativo { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.foto-local { width: 34px; height: 34px; border-radius: 10px; object-fit: cover; flex: none; }
.foto-local.vazia { display: grid; place-items: center; background: linear-gradient(135deg, var(--accent-soft), var(--surface-2)); color: var(--primary); font: 700 .74rem var(--serif); }
.foto-local.mini { width: 24px; height: 24px; border-radius: 50%; font-size: .6rem; }

.entra-1 { animation: daDireita .35s ease both; } .entra--1 { animation: daEsquerda .35s ease both; } .entra-0 { animation: sobe .35s ease both; }

/* grade da linha do tempo */
.tl { --col: 44px; --nome: 190px; overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow); scroll-behavior: smooth; user-select: none; }
.tl-cab, .tl-linha { display: grid; grid-template-columns: var(--nome) calc(var(--n) * var(--col)); }
.tl-cab { position: sticky; top: 0; z-index: 3; background: var(--surface); border-bottom: 1px solid var(--border); }
.tl-local { position: sticky; left: 0; z-index: 2; background: var(--surface); display: flex; align-items: center; gap: 10px; padding: 8px 12px; font-weight: 650; font-size: .92rem; border-right: 1px solid var(--border); box-shadow: 6px 0 12px -10px rgb(0 0 0 / .25); }
.tl-local span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-grade { display: grid; grid-template-columns: repeat(var(--n), var(--col)); position: relative; }
.tl-dia { grid-row: 1; display: grid; justify-items: center; padding: 8px 0 6px; font-size: .7rem; color: var(--muted); }
.tl-dia b { font-size: .95rem; color: var(--text); width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; margin-top: 2px; }
.tl-dia.fds { color: var(--accent); }
.tl-dia.hoje b { background: var(--accent); color: #1d2b3a; box-shadow: 0 4px 10px -2px color-mix(in srgb, var(--accent) 70%, transparent); }
.tl-linha { border-bottom: 1px solid var(--border); animation: sobe .4s ease both; animation-delay: calc(var(--i) * 45ms); }
.tl-linha:last-child { border-bottom: 0; }
.tl-cel { grid-row: 1; height: 56px; border-right: 1px dashed color-mix(in srgb, var(--border) 70%, transparent); cursor: pointer; transition: background .15s; }
.tl-cel.fds { background: color-mix(in srgb, var(--accent-soft) 45%, transparent); }
.tl-cel.hoje { background: color-mix(in srgb, var(--accent) 12%, transparent); box-shadow: inset 2px 0 0 var(--accent); }
.tl-cel:hover { background: var(--primary-soft); }
.tl-cel.passado { cursor: default; background-image: repeating-linear-gradient(135deg, transparent 0 6px, color-mix(in srgb, var(--border) 45%, transparent) 6px 7px); }
.tl-cel.passado:hover { background-color: transparent; }
.tl-barra { grid-row: 1; align-self: center; z-index: 1; height: 38px; margin: 0 3px; border: 0; border-radius: 12px; cursor: pointer; display: flex; align-items: center; gap: 6px; padding: 0 8px 0 4px; overflow: hidden; color: #fff; font: 600 .8rem system-ui, sans-serif; text-align: left;
  background: linear-gradient(135deg, var(--c), color-mix(in srgb, var(--c) 70%, #000)); box-shadow: 0 6px 14px -6px color-mix(in srgb, var(--c) 80%, transparent);
  transform-origin: left center; animation: cresce .5s cubic-bezier(.2,.9,.25,1.1) both; animation-delay: calc(120ms + var(--i) * 60ms); transition: transform .18s, box-shadow .18s, filter .18s; }
.tl-barra:hover { transform: translateY(-2px); filter: brightness(1.08); box-shadow: 0 10px 20px -8px color-mix(in srgb, var(--c) 90%, transparent); }
.tl-barra.corta-esq { border-top-left-radius: 0; border-bottom-left-radius: 0; margin-left: 0; }
.tl-barra.corta-dir { border-top-right-radius: 0; border-bottom-right-radius: 0; margin-right: 0; }
.tl-barra.minha { outline: 2px solid color-mix(in srgb, var(--accent) 85%, #fff); outline-offset: 1px; }
.tl-barra.agora { animation: cresce .5s cubic-bezier(.2,.9,.25,1.1) both, pulsa 2.4s ease-in-out 1s infinite; }
.tl-barra .barra-av { width: 28px; height: 28px; font-size: .68rem; border: 1.5px solid rgb(255 255 255 / .55); background: rgb(255 255 255 / .18); }
.tl-nome { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-dur { margin-left: auto; font-weight: 500; font-size: .72rem; opacity: .85; white-space: nowrap; }
.tl-sel { grid-row: 1; z-index: 1; align-self: center; height: 40px; margin: 0 3px; border-radius: 12px; border: 2px dashed var(--primary); background: color-mix(in srgb, var(--primary) 12%, transparent); display: grid; place-items: center; font-size: .75rem; font-weight: 700; color: var(--primary); pointer-events: none; }

/* lista */
.lista-res { display: grid; gap: 12px; }
.res-card { display: flex; gap: 14px; align-items: stretch; text-align: left; font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 12px; cursor: pointer; box-shadow: var(--shadow); position: relative; overflow: hidden;
  animation: sobe .45s ease both; animation-delay: calc(var(--i) * 55ms); transition: transform .2s, box-shadow .2s, border-color .2s; }
.res-card::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 5px; background: var(--c); }
.res-card:hover { transform: translateY(-3px); box-shadow: 0 14px 30px -14px rgb(31 61 94 / .35); border-color: color-mix(in srgb, var(--c) 50%, var(--border)); }
.res-card.passou { opacity: .6; }
.res-data { display: grid; justify-items: center; align-content: center; min-width: 58px; padding: 6px 4px; border-radius: 14px; background: color-mix(in srgb, var(--c) 12%, var(--surface)); color: var(--c); margin-left: 4px; }
.res-data b { font: 700 1.7rem/1 var(--serif); }
.res-data small { font-size: .68rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
.res-info { flex: 1; min-width: 0; display: grid; gap: 4px; align-content: center; }
.res-local { font: 700 1.05rem var(--serif); color: var(--primary); }
.res-quem { display: flex; align-items: center; gap: 8px; font-size: .88rem; }
.res-quem .avatar { width: 24px; height: 24px; font-size: .62rem; }
.prot-txt { margin-left: auto; font: .7rem ui-monospace, Menlo, monospace; color: var(--muted); }
.res-foto { width: 92px; border-radius: 12px; object-fit: cover; flex: none; }
.pilula { font-size: .7rem; font-weight: 700; padding: 2px 9px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.pilula.agora { background: color-mix(in srgb, var(--pos) 16%, transparent); color: var(--pos); }
.pilula.breve { background: var(--accent-soft); color: var(--warn); }
.pilula.sua { background: var(--primary); color: var(--primary-ink); }
.vazio-grande { text-align: center; padding: 40px 20px; display: grid; justify-items: center; gap: 6px; animation: sobe .4s ease both; }
.emoji-grande { font-size: 3rem; }

/* detalhe e formulário */
.res-det-topo { display: flex; gap: 14px; align-items: center; margin: -22px -22px 0; padding: 22px; background: linear-gradient(135deg, color-mix(in srgb, var(--c) 18%, var(--surface)), var(--surface)); border-bottom: 1px solid var(--border); }
.res-det-topo img { width: 84px; height: 84px; border-radius: 16px; object-fit: cover; }
.res-det-topo h2 { margin: 6px 0; font-size: 1.3rem; }
.res-periodo { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 14px; border-radius: 16px; background: var(--surface-2); }
.res-periodo > div { display: grid; }
.res-periodo small { font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; }
.res-periodo b { font: 700 1.05rem var(--serif); }
.res-periodo .seta { color: var(--accent); font-size: 1.3rem; }
.res-dur { margin-left: auto; background: var(--primary); color: var(--primary-ink); padding: 6px 12px; border-radius: 999px; font-weight: 700; font-size: .85rem; }
.escolha-local { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; max-height: 240px; overflow-y: auto; padding: 2px; }
.local-op { display: flex; align-items: center; gap: 10px; padding: 8px; border: 1.5px solid var(--border); border-radius: 14px; cursor: pointer; transition: all .15s; }
.local-op input { position: absolute; opacity: 0; pointer-events: none; }
.local-op span { display: grid; font-weight: 650; font-size: .9rem; line-height: 1.2; }
.local-op small { font-weight: 500; color: var(--muted); font-size: .74rem; }
.local-op:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 15%, transparent); }
.local-op:has(input:focus-visible) { outline: 2px solid var(--primary); }
.resumo-res { padding: 10px 14px; border-radius: 12px; background: var(--accent-soft); font-size: .92rem; min-height: 22px; animation: sobe .25s ease; }
dialog[open] { animation: sobe .25s ease; }
.btn.fab span { font-size: 1.1rem; line-height: 1; }

@media (max-width: 760px) {
  .tl { --col: 40px; --nome: 116px; border-radius: 14px; }
  .tl-local { padding: 8px; gap: 7px; font-size: .8rem; }
  .tl-local .foto-local { width: 26px; height: 26px; border-radius: 8px; }
  .res-resumo .prox { margin-left: 0; text-align: left; border-left: 0; padding-left: 0; width: 100%; }
  .res-foto { display: none; }
  .btn.fab { position: fixed; right: 16px; bottom: calc(78px + env(safe-area-inset-bottom)); z-index: 15; border-radius: 999px; padding: 13px 18px; box-shadow: 0 10px 24px -8px rgb(31 61 94 / .6); }
  .res-topo { flex-direction: column; align-items: stretch; }
  .mes-nav { justify-content: space-between; }
  .segmentado { align-self: center; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ======================= Chegadas / aviso ao caseiro ======================= */
.alerta-caseiro { display: block; padding: 12px 16px; border-radius: 14px; background: var(--warn-bg); color: var(--warn); margin-bottom: 14px; text-decoration: none; border: 1px solid color-mix(in srgb, var(--warn) 25%, transparent); animation: sobe .4s ease both; }
.dia-chegada { margin-bottom: 18px; animation: sobe .4s ease both; animation-delay: calc(var(--i) * 60ms); }
.dia-titulo { display: flex; align-items: baseline; gap: 8px; font: 700 1rem var(--serif); color: var(--primary); margin: 0 0 8px; }
.dia-titulo span { font: 500 .78rem system-ui, sans-serif; color: var(--muted); }
.aviso-card { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 14px 16px 14px 20px; margin-bottom: 10px; box-shadow: var(--shadow); position: relative; overflow: hidden; display: grid; gap: 8px; animation: sobe .4s ease both; animation-delay: calc(var(--i) * 50ms); }
.aviso-card::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 5px; background: var(--c); }
.aviso-card.pendente { border-color: color-mix(in srgb, var(--warn) 35%, var(--border)); }
.aviso-topo { display: flex; gap: 10px; align-items: center; }
.pilula-st { font-size: .72rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.pilula-st.pendente { background: var(--warn-bg); color: var(--warn); }
.pilula-st.ciente { background: var(--primary-soft); color: var(--primary); }
.pilula-st.pronto { background: color-mix(in srgb, var(--pos) 16%, transparent); color: var(--pos); }
.pilula-st.reserva { background: var(--surface-2); color: var(--muted); }
.preparo { display: flex; flex-wrap: wrap; gap: 6px; }
.preparo span { font-size: .78rem; padding: 3px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--text); }
.preparo span::before { content: '✓ '; color: var(--accent); font-weight: 700; }
.recado { margin: 0; font-style: italic; color: var(--muted); }
.aviso-acoes { margin-top: 2px; }
.btn.ok { color: var(--pos); border-color: color-mix(in srgb, var(--pos) 40%, var(--border)); }
.preparo-op { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.preparo-op label { cursor: pointer; }
.preparo-op input { position: absolute; opacity: 0; pointer-events: none; }
.preparo-op span { display: inline-block; padding: 6px 12px; border-radius: 999px; border: 1.5px solid var(--border); font-size: .85rem; color: var(--text); font-weight: 500; transition: all .15s; }
.preparo-op input:checked + span { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.preparo-op input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }
.tres { display: grid; grid-template-columns: 1fr 110px 1fr; gap: 12px; }
.card.amb .pilula { margin-left: 6px; }
@media (max-width: 760px) { .tres { grid-template-columns: 1fr 1fr; } .tres label:nth-child(2) { order: 3; } .aviso-topo { flex-wrap: wrap; } }

dialog form { overflow-x: hidden; }
.campo input, .campo select, .campo textarea { min-width: 0; }

/* conectar ao Claude */
.claude-card { border-top: 3px solid #d97757; }
textarea.codigo { width: 100%; font: .76rem ui-monospace, Menlo, monospace; padding: 8px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); resize: none; margin-bottom: 6px; }

/* saldo negativo */
.kpi-card.destaque.negativo { background: url("logo-marca.svg") right -18px bottom -26px / 150px no-repeat, linear-gradient(135deg, #8f2f1c, #6e2416 60%, #4f1a10); }

/* contas a pagar / receber */
.kpis-4 { margin-bottom: 14px; }
.filtros-linha { margin: 4px 0 10px; flex-wrap: wrap; gap: 8px; }
.filtros-linha .chips { padding-bottom: 0; margin-bottom: 0; }
tr.linha-vencida td:first-child { box-shadow: inset 3px 0 0 var(--neg); }
.barra-lote { position: sticky; top: 64px; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; margin-bottom: 10px; border-radius: 12px; background: var(--primary); color: var(--primary-ink); animation: sobe .2s ease; }
.barra-lote .btn { background: var(--accent); border-color: var(--accent); color: #1d2b3a; }
.caixa-baixa { padding: 12px; border-radius: 12px; background: var(--surface-2); }
.destaque-check { padding: 10px 12px; border-radius: 12px; border: 1.5px dashed var(--border); }
.total-baixa { display: grid; gap: 2px; padding: 12px 14px; border-radius: 12px; background: var(--accent-soft); }
.total-baixa b { font: 700 1.4rem var(--serif); color: var(--primary); }
.barras.fluxo .pares .b { width: 22%; }
.b.prev { opacity: .45; background-image: repeating-linear-gradient(45deg, rgb(255 255 255 / .5) 0 3px, transparent 3px 6px); }
td .linha { flex-wrap: nowrap; }

/* compartilhar */
.compartilhar { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.btn.whats { background: #1a7f4b; border-color: #1a7f4b; color: #fff; } /* verde WhatsApp escurecido para contraste AA */
.vinculo { padding: 8px 12px; border-radius: 10px; background: var(--primary-soft); font-size: .88rem; }

/* alcance da alteração em séries */
fieldset.escopo { border: 1.5px solid var(--accent); border-radius: 12px; padding: 10px 12px; display: grid; gap: 6px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); background: var(--accent-soft); }
fieldset.escopo legend { font-weight: 650; font-size: .86rem; padding: 0 6px; }

/* ======================= Relatórios ======================= */
.rel-conjuntos { margin-bottom: 8px; }
.rel-conjuntos .chip { text-decoration: none; }
.rel-filtros { display: grid; gap: 12px; margin-bottom: 14px; }
.rel-linha1 { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; }
.rel-linha1 .campo { min-width: 150px; }
.rel-acoes { margin-left: auto; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.rel-acoes select { padding: 7px 10px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text); }
.rel-linha2 { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding-top: 10px; border-top: 1px dashed var(--border); }
.rel-chips { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; flex: 1; }
.chip-filtro { display: inline-flex; align-items: center; border-radius: 999px; background: var(--primary-soft); border: 1px solid color-mix(in srgb, var(--primary) 30%, var(--border)); animation: sobe .25s ease; }
.chip-filtro .lnk-chip { border: 0; background: none; padding: 5px 4px 5px 12px; font: 600 .82rem system-ui, sans-serif; color: var(--primary); cursor: pointer; }
.chip-filtro .x { border: 0; background: none; padding: 5px 10px 5px 4px; cursor: pointer; color: var(--muted); }
.chip-filtro .x:hover { color: var(--neg); }
.conj { font-size: .72rem; font-weight: 700; color: var(--accent); text-transform: uppercase; }
.rel-kpis { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin-bottom: 14px; }
.rel-kpis .kpi { font-size: 1.35rem; }
.rel-graficos { display: grid; gap: 14px; grid-template-columns: 2fr 1fr 1fr; margin-bottom: 14px; }
.rel-graf { margin: 0 !important; min-width: 0; }
.rel-graf h3 { margin-bottom: 4px; }
.echart { width: 100%; height: 280px; }
.rel-barra-tabela { margin-bottom: 10px; gap: 10px; }
.campo-inline-rot { display: flex; align-items: center; gap: 6px; }
.campo-inline-rot select { padding: 6px 8px; }
.exportar { display: inline-flex; gap: 4px; padding: 3px; border-radius: 12px; background: var(--surface-2); }
.lista-valores { grid-column: 1 / -1; }
.lista-valores .preparo-op { max-height: 180px; overflow-y: auto; }
#modalForm .tres:has(.lista-valores) { grid-template-columns: 1fr 1fr; }
/* Tabulator no tema Âncora */
#relTabela .tabulator { border: 1px solid var(--border); border-radius: 12px; background: var(--surface); font-size: .86rem; }
#relTabela .tabulator .tabulator-header { background: var(--surface-2); border-bottom: 2px solid var(--primary); color: var(--text); }
#relTabela .tabulator .tabulator-header .tabulator-col { background: transparent; border-right: 1px solid var(--border); }
#relTabela .tabulator .tabulator-header .tabulator-col input { padding: 4px 6px; border-radius: 6px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: .78rem; }
#relTabela .tabulator-row { background: var(--surface); color: var(--text); border-bottom: 1px solid var(--border); }
#relTabela .tabulator-row.tabulator-row-even { background: color-mix(in srgb, var(--surface-2) 55%, var(--surface)); }
#relTabela .tabulator-row:hover { background: var(--primary-soft) !important; }
#relTabela .tabulator-row .tabulator-cell { border-right: 1px solid color-mix(in srgb, var(--border) 50%, transparent); }
#relTabela .tabulator-calcs-holder, #relTabela .tabulator-row.tabulator-calcs { background: var(--accent-soft) !important; font-weight: 700; }
#relTabela .tabulator-group { background: var(--surface-2); border-top: 1px solid var(--border); color: var(--primary); font-weight: 700; }
#relTabela .tabulator-footer { background: var(--surface-2); border-top: 1px solid var(--border); color: var(--text); }
#relTabela .tabulator-footer .tabulator-page { border-radius: 8px; background: var(--surface); color: var(--text); }
#relTabela .tabulator-footer .tabulator-page.active { background: var(--primary); color: var(--primary-ink); }
@media (max-width: 1000px) { .rel-graficos { grid-template-columns: 1fr 1fr; } .rel-graficos .rel-graf:first-child { grid-column: 1 / -1; } }
@media (max-width: 760px) { .rel-graficos { grid-template-columns: 1fr; } .rel-acoes { margin-left: 0; } .echart { height: 240px; } }
@media print { .rel-filtros, .rel-barra-tabela .exportar { display: none !important; } }

/* ======================= Onda 1: ícones, acessibilidade, carregamento ======================= */
:root { --accent-texto: #8a6a26; }
@media (prefers-color-scheme: dark) { :root { --accent-texto: #d6b871; } }
.ic { width: 1.15em; height: 1.15em; flex: none; vertical-align: -0.2em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
:not(.btn):not(.chip):not(.tag):not(.pilula):not(.pilula-st) > .ic:not(:last-child) { margin-right: .3em; }
.btn .ic, .chip .ic, .tag .ic { width: 1.05em; height: 1.05em; }
.emoji .ic { width: 22px; height: 22px; color: var(--primary); }
.sem-foto .ic, .emoji-grande .ic { width: 34px; height: 34px; color: var(--accent); }
.emoji-grande .ic { width: 48px; height: 48px; }
nav#menu a .ic { width: 20px; height: 20px; }
@media (min-width: 761px) { nav#menu a { display: inline-flex; align-items: center; gap: 6px; } nav#menu .ic { display: inline-block; width: 17px; height: 17px; } }
.kpi-card .rotulo .ic { margin-right: .3em; }
.alerta-caseiro .ic { color: var(--warn); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
/* contraste: texto dourado sobre creme fica legível (AA) */
.marca .nome small, .wordmark small, .conj, .tl-dia.fds, .tl-dia small { color: var(--accent-texto); }
h1.wordmark { margin: 6px 0 4px; }
/* foco visível consistente */
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 80%, transparent); outline-offset: 2px; border-radius: 6px; }
tr[tabindex]:focus-visible td { background: var(--primary-soft); }
.chip-filtro .x { min-width: 28px; min-height: 28px; }
h2.titulo-card { font-size: .95rem; margin: 0 0 4px; }
h2.dia-titulo { font-size: 1rem; }
/* toques maiores em telas de toque */
@media (pointer: coarse) {
  .btn { min-height: 44px; }
  .btn.peq, .chip, .segmentado button { min-height: 40px; }
  .lnk { padding: 6px 4px; }
}
/* esqueleto de carregamento */
.esqueleto .sk { border-radius: 8px; background: linear-gradient(90deg, var(--surface-2) 25%, color-mix(in srgb, var(--surface-2) 40%, var(--surface)) 50%, var(--surface-2) 75%); background-size: 200% 100%; animation: brilho 1.2s ease-in-out infinite; }
.sk-titulo { height: 28px; width: 220px; margin-bottom: 10px; }
.sk-sub { height: 14px; width: 320px; max-width: 80%; margin-bottom: 20px; }
.sk-linha { height: 12px; width: 60%; margin-bottom: 10px; }
.sk-kpi { height: 26px; width: 80%; }
.sk-item { height: 18px; margin: 14px 0; }
@keyframes brilho { from { background-position: 200% 0; } to { background-position: -200% 0; } }
/* transição de entrada das telas */
#app.tela-entra > * { animation: sobe .3s cubic-bezier(.2,.8,.2,1) both; }
/* barra inferior do celular: no máximo 5 itens */
@media (max-width: 760px) {
  nav#menu .ic { display: block; }
  body.tem-fin nav#menu a[data-secundario] { display: none; }
  nav#menu a { min-width: 0; flex: 1; padding: 6px 2px; }
}

/* ======================= Onda 2: paleta, calendário, selects, cartões, dicas, tour, galeria ======================= */
/* Toast com "Desfazer" */
#toast.com-acao { pointer-events: auto; display: flex; align-items: center; gap: 12px; padding: 8px 8px 8px 18px; }
.toast-acao { display: inline-flex; align-items: center; gap: 4px; border: 0; border-radius: 999px; padding: 6px 12px; min-height: 36px; background: var(--accent); color: #1d2b3a; font: inherit; font-weight: 700; cursor: pointer; }
.toast-acao:hover { filter: brightness(1.05); }

/* Paleta de comandos (Ctrl+K) */
dialog.paleta { width: min(620px, calc(100vw - 24px)); max-height: min(560px, calc(100vh - 80px)); margin: 10vh auto auto; padding: 0; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); color: var(--text); box-shadow: 0 24px 60px rgb(0 0 0 / .25); overflow: hidden; display: flex; flex-direction: column; }
dialog.paleta:not([open]) { display: none; }
dialog.paleta::backdrop { background: rgb(15 25 40 / .45); backdrop-filter: blur(2px); }
.paleta-busca { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.paleta-busca .ic { color: var(--muted); width: 20px; height: 20px; margin: 0; }
.paleta-busca input { flex: 1; border: 0; background: none; font: inherit; font-size: 1.05rem; color: var(--text); outline: none; min-width: 0; }
kbd { font: 600 .72rem/1 var(--espacada); padding: 3px 6px; border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 6px; background: var(--surface-2); color: var(--text); }
dialog.paleta ul { list-style: none; margin: 0; padding: 6px; overflow-y: auto; flex: 1; }
dialog.paleta li[role=option] { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 10px; cursor: pointer; }
dialog.paleta li[role=option] .ic { color: var(--primary); width: 18px; height: 18px; margin: 0; }
dialog.paleta li[role=option] b { display: block; font-weight: 600; }
dialog.paleta li[role=option] small { color: var(--muted); }
dialog.paleta li[aria-selected=true] { background: var(--primary-soft); }
dialog.paleta li.paleta-grupo { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 10px 12px 4px; font-weight: 700; }
dialog.paleta li.vazio { padding: 16px; color: var(--muted); }
.paleta-rodape { margin: 0; padding: 8px 16px; border-top: 1px solid var(--border); display: flex; gap: 6px; align-items: center; }
.btn-paleta { display: none; }
@media (max-width: 760px) {
  .btn-paleta { display: grid; place-items: center; width: 40px; height: 40px; margin-left: auto; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--text); cursor: pointer; }
  .btn-paleta .ic { margin: 0; width: 19px; height: 19px; }
  .btn-paleta + .usuario { margin-left: 0; }
  dialog.paleta { margin-top: 12px; max-height: calc(100vh - 100px); }
  .paleta-rodape { display: none; }
}

/* Calendário de período */
.abre-cal { display: inline-flex; align-items: center; gap: 4px; align-self: flex-start; font-weight: 600; }
.cal-periodo { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--surface); }
.cal-periodo .vc { --vc-font-family: inherit; width: 100%; border-radius: 0; box-shadow: none; background: var(--surface); }
.cal-periodo .vc { --vc-date-selected-bg: var(--primary); --vc-date-selected-color: var(--primary-ink); --vc-date-weekend-selected-bg: var(--primary); --vc-date-weekend-selected-color: var(--primary-ink);
  --vc-date-range-middle-bg: var(--primary-soft); --vc-date-range-middle-color: var(--text); --vc-date-range-middle-weekend-bg: var(--primary-soft); --vc-date-range-middle-weekend-color: var(--neg);
  --vc-date-hover-edge-bg: var(--primary); --vc-date-weekend-hover-edge-bg: var(--primary); --vc-date-today-color: var(--accent-texto); --vc-date-weekend-color: var(--neg); }
.cal-periodo [data-vc-date-disabled] button { text-decoration: line-through; opacity: .45; }

/* Selects pesquisáveis (Tom Select) com as cores do sistema */
.ts-wrapper { width: 100%; }
.ts-wrapper .ts-control { min-height: 42px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text); padding: 8px 12px; font: inherit; box-shadow: none; }
.ts-wrapper.focus .ts-control { outline: 2px solid var(--primary); outline-offset: 0; }
.ts-wrapper .ts-control input { color: var(--text); font: inherit; }
.ts-wrapper.single .ts-control::after { border-color: var(--muted) transparent transparent; }
.ts-dropdown { border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text); box-shadow: var(--shadow); margin-top: 4px; z-index: 60; }
.ts-dropdown .option, .ts-dropdown .create, .ts-dropdown .no-results { padding: 9px 12px; }
.ts-dropdown .active { background: var(--primary-soft); color: var(--text); }
.ts-dropdown .create b { color: var(--primary); }

/* Dicas de termos (Popover API) */
.dica { display: inline-grid; place-items: center; width: 20px; height: 20px; min-height: 20px; padding: 0; margin-left: 4px; border: 1px solid var(--border); border-radius: 50%; background: var(--surface-2); color: var(--muted); font: 700 .72rem/1 var(--espacada); cursor: help; vertical-align: middle; }
.dica:hover, .dica:focus-visible { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); }
@media (pointer: coarse) { .dica { width: 26px; height: 26px; min-height: 26px; } }
.dica-pop { position: fixed; inset: auto; margin: 0; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--text); color: var(--bg); font-size: .88rem; font-weight: 400; line-height: 1.45; text-transform: none; letter-spacing: 0; box-shadow: 0 12px 30px rgb(0 0 0 / .25); text-align: left; }
.dica-pop b { display: block; margin-bottom: 2px; color: var(--accent); font-family: var(--serif); }

/* Tour guiado (Driver.js) com a identidade */
.driver-popover.tour-ancora { background: var(--surface); color: var(--text); border-radius: 14px; border: 1px solid var(--border); font-family: inherit; max-width: 320px; }
.driver-popover.tour-ancora .driver-popover-title { font-family: var(--serif); font-size: 1.1rem; color: var(--primary); }
.driver-popover.tour-ancora .driver-popover-description { color: var(--text); line-height: 1.5; }
.driver-popover.tour-ancora .driver-popover-progress-text { color: var(--muted); }
.driver-popover.tour-ancora button { font: 600 .9rem/1 inherit; text-shadow: none; border-radius: 999px; padding: 8px 14px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); }
.driver-popover.tour-ancora .driver-popover-next-btn { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); }
.driver-popover.tour-ancora .driver-popover-close-btn { border: 0; background: none; padding: 4px 8px; }
.driver-popover.tour-ancora .driver-popover-arrow-side-bottom { border-bottom-color: var(--surface); }
.driver-popover.tour-ancora .driver-popover-arrow-side-top { border-top-color: var(--surface); }
.driver-popover.tour-ancora .driver-popover-arrow-side-left { border-left-color: var(--surface); }
.driver-popover.tour-ancora .driver-popover-arrow-side-right { border-right-color: var(--surface); }

/* Aviso de nova versão */
.nova-versao { position: fixed; left: 12px; right: 12px; margin: 0 auto; width: fit-content; top: max(12px, env(safe-area-inset-top)); z-index: 70; display: flex; align-items: center; gap: 10px; padding: 8px 10px 8px 16px; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 999px; box-shadow: 0 10px 30px rgb(0 0 0 / .18); animation: sobe .3s both; max-width: calc(100vw - 24px); }
.nova-versao .ic { color: var(--accent); }

/* Contas a pagar/receber: no celular, cada linha vira um cartão (sem rolagem lateral) */
@media (max-width: 760px) {
  .cartoes { overflow: visible; padding: 4px 0; }
  .cartoes table, .cartoes tbody, .cartoes tr, .cartoes td { display: block; }
  .cartoes thead, .cartoes td.esconde-mobile { display: none; }
  .cartoes tbody tr { display: grid; grid-template-columns: auto 1fr auto; grid-template-areas: "sel desc valor" "sel venc sit" "sel acao acao"; gap: 4px 10px; padding: 12px 14px; border-bottom: 1px solid var(--border); align-items: center; }
  .cartoes tbody tr:last-child { border-bottom: 0; }
  .cartoes td { padding: 0; border: 0; text-align: left; }
  .cartoes td.num { text-align: left; }
  .cartoes .c-sel { grid-area: sel; align-self: start; padding-top: 2px; }
  .cartoes .c-desc { grid-area: desc; min-width: 0; }
  .cartoes .c-valor { grid-area: valor; text-align: right; font-weight: 700; }
  .cartoes .c-venc { grid-area: venc; font-size: .85rem; color: var(--muted); }
  .cartoes .c-venc::before { content: attr(data-rot) " "; }
  .cartoes .c-sit { grid-area: sit; justify-self: end; }
  .cartoes .c-acao { grid-area: acao; display: flex; flex-wrap: wrap; gap: 6px; }
  .cartoes .c-acao:empty { display: none; }
  .cartoes td.vazio { grid-column: 1 / -1; padding: 16px; }
  .cartoes tr:has(td.vazio) { display: block; }
}

/* ======================= Onda 3: o que fazer agora, notificações ======================= */
.agora-card { margin-bottom: 16px; }
.agora-card h2 { margin: 0; }
.agora-card.vazio-ok h2 { color: var(--pos); }
.agora-lista { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; }
.agora-lista a, .agora-lista button { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--text); text-decoration: none; font: inherit; text-align: left; cursor: pointer; min-height: 56px; }
.agora-lista a:hover, .agora-lista button:hover { background: var(--surface-2); }
.agora-lista b { display: block; font-weight: 600; }
.agora-lista small { display: block; color: var(--muted); font-size: .85rem; }
.agora-ic { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--primary-soft); color: var(--primary); flex: none; }
.agora-ic .ic { margin: 0; width: 19px; height: 19px; }
.agora-lista li.p1 a, .agora-lista li.p1 button { border-color: color-mix(in srgb, var(--neg) 45%, var(--border)); box-shadow: inset 3px 0 0 var(--neg); }
.agora-lista li.p1 .agora-ic { background: color-mix(in srgb, var(--neg) 14%, transparent); color: var(--neg); }
.agora-lista li.p3 .agora-ic { background: var(--surface-2); color: var(--muted); }
.agora-lista > li > * > .ic:last-child { color: var(--muted); margin: 0; }
.agora-urg { --c: var(--neg); flex: none; }
.prefs-notif { border: 1px solid var(--border); border-radius: 12px; padding: 8px 14px 4px; margin: 12px 0 8px; display: grid; gap: 2px; }
.prefs-notif legend { font-weight: 650; padding: 0 6px; }
.prefs-notif .check { align-items: flex-start; padding: 8px 0; gap: 10px; }
.prefs-notif .check input { margin-top: 3px; }
.prefs-notif .check b { display: block; font-weight: 600; }
.prefs-notif .check small { display: block; color: var(--muted); }

/* Sino de alertas */
.btn-sino { position: relative; display: grid; place-items: center; width: 40px; height: 40px; flex: none; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--text); cursor: pointer; }
.btn-sino:hover { background: var(--surface-2); }
.btn-sino .ic { margin: 0; width: 19px; height: 19px; }
.sino-num { position: absolute; top: -4px; right: -4px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 999px; background: var(--neg); color: #fff; font: 700 .7rem/19px var(--espacada); text-align: center; box-shadow: 0 0 0 2px var(--surface); }
.painel-sino { position: fixed; inset: auto; margin: 0; width: 380px; max-height: min(560px, calc(100vh - 90px)); padding: 0; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); color: var(--text); box-shadow: 0 20px 50px rgb(0 0 0 / .2); overflow: auto; }
.sino-topo { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 14px 16px 8px; position: sticky; top: 0; background: var(--surface); z-index: 1; }
.sino-topo h2 { margin: 0; font-size: 1.1rem; }
.sino-lista { list-style: none; margin: 0; padding: 0 8px 8px; }
.sino-lista a { display: flex; align-items: flex-start; gap: 12px; padding: 10px 8px; border-radius: 12px; color: var(--text); text-decoration: none; }
.sino-lista a:hover { background: var(--surface-2); }
.sino-lista li.nova a { background: color-mix(in srgb, var(--primary-soft) 70%, transparent); }
.sino-lista b { display: block; font-weight: 600; line-height: 1.3; }
.sino-lista small { display: block; color: var(--muted); font-size: .86rem; line-height: 1.35; margin-top: 2px; }
.sino-lista time { display: block; color: var(--muted); font-size: .76rem; margin-top: 4px; }
.sino-ic { display: grid; place-items: center; width: 34px; height: 34px; flex: none; border-radius: 10px; background: var(--primary-soft); color: var(--primary); }
.sino-ic .ic { margin: 0; width: 18px; height: 18px; }
.sino-ponto { width: 9px; height: 9px; flex: none; margin-top: 6px; border-radius: 50%; background: var(--primary); }
.sino-vazio { text-align: center; padding: 18px 24px 22px; }
.sino-vazio > .ic { width: 34px; height: 34px; color: var(--accent); margin: 0; }
.sino-vazio p { margin: 6px 0 0; }
.sino-rodape { display: flex; align-items: center; gap: 6px; padding: 12px 16px; border-top: 1px solid var(--border); color: var(--primary); font-weight: 600; text-decoration: none; position: sticky; bottom: 0; background: var(--surface); }
@media (max-width: 760px) {
  .btn-sino { margin-left: auto; }
  .btn-sino ~ .btn-paleta { margin-left: 0; }
  .painel-sino { left: 8px; right: 8px; width: auto; max-height: calc(100vh - 160px); }
}
/* Topo em telas médias (notebook/tablet deitado): tudo cabe sem cortar o sino */
@media (min-width: 761px) and (max-width: 1280px) {
  header#topo { gap: 10px; }
  .busca input { width: 140px; }
  #btnUsuario .esconde-mobile { display: none; }
  #btnUsuario { padding: 3px; }
  nav#menu .ic { display: none !important; }
}
@media (min-width: 761px) and (max-width: 1100px) {
  .busca { display: none; }
  .btn-paleta { display: grid; place-items: center; width: 40px; height: 40px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--text); cursor: pointer; }
  .btn-paleta .ic { margin: 0; width: 19px; height: 19px; }
  .btn-sino { margin-left: auto; }
}
@media (max-width: 760px) { .agora-urg { display: none; } }

/* Contas bancárias, PIX e conciliação */
.outras-chaves { margin-top: 10px; }
.outras-chaves summary { cursor: pointer; font-weight: 600; font-size: .9rem; }
.outras-chaves ul { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.outras-chaves li { display: flex; align-items: center; gap: 10px; }
.outras-chaves small { display: block; color: var(--muted); word-break: break-all; }
.contas-banc li { align-items: flex-start; }
tr.conciliado td { background: color-mix(in srgb, var(--pos) 7%, transparent); }

/* Ícone da pessoa: foto ou emoji */
.avatar.foto { background: var(--surface-2); overflow: hidden; padding: 0; }
.avatar.foto img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar.emoji-av { background: color-mix(in srgb, var(--c) 18%, var(--surface)); font-size: 1rem; box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--c) 45%, transparent); }
.avatar.emoji-av.g { font-size: 1.9rem; }
.icone-escolha { margin-top: 14px; }
.grade-emoji { display: grid; grid-template-columns: repeat(auto-fill, minmax(42px, 1fr)); gap: 6px; margin: 10px 0; }
.grade-emoji button { font-size: 1.4rem; min-height: 42px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); cursor: pointer; }
.grade-emoji button:hover, .grade-emoji button.ativo { border-color: var(--primary); background: var(--primary-soft); }
#icOp { margin-top: 10px; }
.icone-fs { border: 1px solid var(--border); border-radius: 12px; padding: 10px 14px 12px; margin: 0; } .icone-fs legend { font-weight: 650; padding: 0 6px; }

/* Interdição de chalé */
.tl-interd { position: relative; z-index: 1; grid-row: 1; align-self: stretch; margin: 6px 1px; display: flex; align-items: center; gap: 6px; padding: 0 10px; border: 1px dashed color-mix(in srgb, var(--neg) 55%, transparent); border-radius: 10px; color: var(--neg); font: 600 .78rem/1.1 inherit; overflow: hidden; white-space: nowrap; cursor: pointer;
  background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--neg) 12%, var(--surface)) 0 8px, color-mix(in srgb, var(--neg) 4%, var(--surface)) 8px 16px); }
.tl-interd span { overflow: hidden; text-overflow: ellipsis; }
.tl-interd .ic { margin: 0; flex: none; }
.int-agora { display: block; color: var(--neg); font-weight: 700; font-size: .7rem; text-transform: uppercase; letter-spacing: .04em; }
.local-op.interditado { color: var(--muted); cursor: not-allowed; background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--neg) 7%, var(--surface)) 0 8px, var(--surface) 8px 16px); }
.local-op.interditado input { cursor: not-allowed; }
.int-info { display: block; color: var(--neg); font-weight: 600; white-space: normal; }
.lista-int { display: grid; gap: 8px; margin-bottom: 12px; }
.int-card { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; border: 1px dashed color-mix(in srgb, var(--neg) 55%, transparent); border-radius: 12px; color: var(--text); text-align: left; font: inherit; cursor: pointer;
  background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--neg) 8%, var(--surface)) 0 10px, var(--surface) 10px 20px); }
.int-card .ic { color: var(--neg); margin: 0; width: 20px; height: 20px; }
.int-card small { display: block; color: var(--muted); }
.int-topo { display: flex; gap: 12px; align-items: center; }
.int-topo h2 { margin: 4px 0; }
.pilula.int { background: color-mix(in srgb, var(--neg) 14%, transparent); color: var(--neg); }
.local-op.interditado .foto-local { opacity: .5; }

/* Perfis de acesso */
.perfis-lista { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.perfil-card { text-align: left; font: inherit; color: var(--text); cursor: pointer; display: grid; gap: 4px; }
.perfil-card:hover { border-color: var(--primary); }
.perfil-card p { margin: 0; }
.matriz-wrap { margin: 8px 0; }
.matriz th[scope=row] { font-weight: 600; text-transform: none; letter-spacing: 0; color: var(--text); font-size: .9rem; }
.matriz th.c, .matriz td.c { text-align: center; }
.matriz input[type=checkbox] { width: 20px; height: 20px; cursor: pointer; }
.matriz .na { color: var(--border); }

/* ======================= Utilitários do design system (substituem estilos no HTML) ======================= */
.m-0 { margin: 0 !important; } .mt-0 { margin-top: 0 !important; } .mt-n2 { margin-top: calc(var(--esp-2) * -1) !important; }
.mt-2 { margin-top: var(--esp-2) !important; } .mt-3 { margin-top: var(--esp-3) !important; } .mt-4 { margin-top: var(--esp-4) !important; }
.mb-2 { margin-bottom: var(--esp-2) !important; } .mb-3 { margin-bottom: var(--esp-3) !important; } .mb-4 { margin-bottom: var(--esp-4) !important; }
.px-4 { padding-left: var(--esp-4); padding-right: var(--esp-4); } .pb-4 { padding-bottom: var(--esp-4); }
.pre { white-space: pre-wrap; } .larg-560 { max-width: 560px; } .larg-760 { max-width: 760px; }
/* Guia de estilo */
.guia section { margin-bottom: var(--esp-5); }
.guia h2 { margin: 0 0 var(--esp-3); }
.guia .amostras { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--esp-3); }
.guia .cor { border: 1px solid var(--border); border-radius: var(--raio-m); overflow: hidden; background: var(--surface); }
.guia .cor i { display: block; height: 56px; background: var(--c); }
.guia .cor div { padding: var(--esp-2) var(--esp-3); font-size: var(--fs-s); }
.guia .cor code { display: block; color: var(--muted); font-size: var(--fs-xs); }
.guia .vitrine { display: flex; flex-wrap: wrap; gap: var(--esp-2); align-items: center; }
.guia .icones { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: var(--esp-2); }
.guia .icones div { display: grid; justify-items: center; gap: 4px; padding: var(--esp-2); border: 1px solid var(--border); border-radius: var(--raio-p); font-size: var(--fs-xs); color: var(--muted); }
.guia .icones .ic { width: 22px; height: 22px; color: var(--text); margin: 0; }
.guia table code, .guia p code { font-size: var(--fs-xs); background: var(--surface-2); padding: 1px 6px; border-radius: 6px; }
/* Texto verde com contraste AA sobre fundo verde-claro (etiquetas "Agora", "Chalé pronto") */
:root { --pos-texto: #3b5e1f; }
@media (prefers-color-scheme: dark) { :root { --pos-texto: #a9d37a; } }
.pilula.agora, .pilula-st.pronto { color: var(--pos-texto); }
/* Caixas de seleção com área de toque adequada */
.check input[type=checkbox], .check input[type=radio] { width: 22px; height: 22px; flex: none; margin: 1px; }

/* ======================= Ver como (administrador simulando um perfil) ======================= */
.faixa-ver-como { display: flex; align-items: center; gap: var(--esp-3); flex-wrap: wrap;
  padding: var(--esp-2) var(--esp-4); background: var(--warn-bg); color: var(--warn); border-bottom: 1px solid var(--border); font-size: var(--fs-s); }
.faixa-ver-como .ic { width: 18px; height: 18px; }
.ver-como-card h2 .ic { margin-right: 6px; }
.perm-resumo { list-style: none; padding: 0; margin: var(--esp-3) 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: var(--esp-2); }
.perm-resumo li { display: grid; gap: 4px; padding: var(--esp-2) var(--esp-3); border: 1px solid var(--border); border-radius: var(--raio-p); background: var(--surface-2); font-size: var(--fs-s); }
.perm-resumo li span { display: flex; flex-wrap: wrap; gap: 4px; }
.faixa-ver-como .btn { min-height: 32px; }
.perm-resumo .chip { font-size: var(--fs-xs); padding: 1px 8px; }

/* ======================= Onda 4: interação viva (celular primeiro) ======================= */
/* Transições entre telas (View Transitions): o topo e a barra inferior ficam parados; só o conteúdo troca */
header#topo { view-transition-name: topo; }
nav#menu { view-transition-name: menu; }
#app { view-transition-name: conteudo; }
::view-transition-group(conteudo) { animation-duration: .32s; animation-timing-function: cubic-bezier(.2, .8, .2, 1); }
::view-transition-old(conteudo) { animation: vt-sai .2s cubic-bezier(.4, 0, 1, 1) both; }
::view-transition-new(conteudo) { animation: vt-entra .32s cubic-bezier(.2, .8, .2, 1) both; }
html[data-vt=avanca]::view-transition-old(conteudo) { animation-name: vt-sai-esq; }
html[data-vt=avanca]::view-transition-new(conteudo) { animation-name: vt-entra-dir; }
html[data-vt=volta]::view-transition-old(conteudo) { animation-name: vt-sai-dir; }
html[data-vt=volta]::view-transition-new(conteudo) { animation-name: vt-entra-esq; }
@keyframes vt-sai { to { opacity: 0; transform: scale(.985); filter: blur(2px); } }
@keyframes vt-entra { from { opacity: 0; transform: translateY(12px) scale(.99); } }
@keyframes vt-sai-esq { to { opacity: 0; transform: translateX(-18%); } }
@keyframes vt-entra-dir { from { opacity: 0; transform: translateX(28%); } }
@keyframes vt-sai-dir { to { opacity: 0; transform: translateX(18%); } }
@keyframes vt-entra-esq { from { opacity: 0; transform: translateX(-28%); } }

/* Resposta ao toque: o botão "afunda" de leve e volta com mola */
.btn, .lnk, nav#menu a, .chip, .segmentado button, .agora-lista a, .agora-lista button { transition: transform .35s cubic-bezier(.34, 1.56, .64, 1), background .2s, box-shadow .2s, color .2s; -webkit-tap-highlight-color: transparent; }
.apertado { transform: scale(.94) !important; transition-duration: .08s !important; }
.btn.prim { background-image: linear-gradient(180deg, rgb(255 255 255 / .12), rgb(255 255 255 / 0)); box-shadow: 0 1px 0 rgb(0 0 0 / .1), 0 6px 16px -8px color-mix(in srgb, var(--primary) 70%, transparent); }
.btn.prim:hover { box-shadow: 0 1px 0 rgb(0 0 0 / .1), 0 10px 24px -10px color-mix(in srgb, var(--primary) 80%, transparent); }

/* Topo de vidro (fica translúcido sobre o conteúdo ao rolar) */
@supports (backdrop-filter: blur(1px)) {
  header#topo { background: color-mix(in srgb, var(--surface) 78%, transparent); backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px); }
  @media (max-width: 760px) {
    /* no celular o topo não pode ter backdrop-filter: ele prenderia a barra inferior (position: fixed) dentro do topo */
    header#topo { background: var(--surface); backdrop-filter: none; -webkit-backdrop-filter: none; }
    nav#menu { background: color-mix(in srgb, var(--surface) 80%, transparent); backdrop-filter: saturate(1.6) blur(16px); -webkit-backdrop-filter: saturate(1.6) blur(16px); }
  }
}
/* Item ativo da barra inferior: pílula que "acende" */
@media (max-width: 760px) {
  nav#menu a.ativo .ic { animation: acende .45s cubic-bezier(.34, 1.56, .64, 1); }
  @keyframes acende { 0% { transform: scale(.7) translateY(3px); } 100% { transform: none; } }
}

/* Bottom sheet: no celular os formulários sobem de baixo e fecham arrastando para baixo */
dialog#modal .alca { display: none; }
@media (max-width: 760px) {
  dialog#modal { position: fixed; inset: auto 0 0 0; margin: 0; width: 100%; max-width: 100%; max-height: 92dvh; border-radius: 22px 22px 0 0; overflow-y: auto; overscroll-behavior: contain;
    padding-bottom: env(safe-area-inset-bottom); box-shadow: 0 -12px 40px rgb(0 0 0 / .25); touch-action: pan-y; }
  dialog#modal.largo { width: 100%; }
  dialog#modal[open] { animation: sheet-sobe .38s cubic-bezier(.2, .9, .25, 1); }
  dialog#modal::backdrop { animation: some-fundo .3s ease; }
  dialog#modal .alca { display: block; position: sticky; top: 0; z-index: 2; height: 26px; margin-bottom: -14px; background: linear-gradient(var(--surface) 60%, transparent); cursor: grab; touch-action: none; }
  dialog#modal .alca::before { content: ""; position: absolute; left: 50%; top: 9px; width: 42px; height: 5px; margin-left: -21px; border-radius: 99px; background: var(--border); }
  dialog#modal form .acoes { position: sticky; bottom: 0; background: var(--surface); padding: 10px 0 4px; margin-bottom: -8px; }
  dialog#modal form .acoes .btn { flex: 1; min-height: 44px; }
}
@keyframes sheet-sobe { from { transform: translateY(100%); } to { transform: none; } }
@keyframes some-fundo { from { opacity: 0; } }

/* Deslizar para a ação principal: o rótulo aparece por trás do item */
.deslizavel { position: relative; touch-action: pan-y; }
@media (pointer: coarse) {
  .deslizavel::before { content: "✓ " var(--rotulo); position: absolute; inset: 0 auto 0 0; display: flex; align-items: center; justify-content: flex-end; padding-right: 18px; box-sizing: border-box; width: 160px; transform: translateX(-100%);
    color: #fff; font-weight: 700; font-size: var(--fs-s); background: linear-gradient(90deg, var(--pos), color-mix(in srgb, var(--pos) 70%, transparent)); border-radius: inherit; opacity: .55; transition: opacity .15s; pointer-events: none; }
  .deslizavel.pronto-deslizar::before { opacity: 1; }
}

/* Puxar para atualizar */
.puxar { position: fixed; top: calc(env(safe-area-inset-top) + 64px); left: 50%; z-index: 40; width: 40px; height: 40px; margin-left: -20px; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface); color: var(--primary); box-shadow: 0 6px 20px rgb(0 0 0 / .18); opacity: 0; pointer-events: none;
  transform: translateY(calc(var(--p, 0) * 40px - 30px)) rotate(calc(var(--p, 0) * 270deg)) scale(calc(.6 + var(--p, 0) * .4)); transition: opacity .15s; }
.puxar.on { opacity: 1; }
.puxar.pronto { color: var(--pos); }
.puxar.girando { opacity: 1; transform: translateY(10px); }
.puxar.girando .ic { animation: gira .8s linear infinite; }
.puxar .ic { width: 20px; height: 20px; margin: 0; }
@keyframes gira { to { transform: rotate(360deg); } }

/* Ditado por voz */
.ditar { justify-self: start; margin-top: calc(var(--esp-2) * -1); }
.ditar.gravando { color: #fff; background: var(--neg); border-color: var(--neg); animation: pulsa 1.2s ease-in-out infinite; }
@keyframes pulsa { 50% { box-shadow: 0 0 0 8px color-mix(in srgb, var(--neg) 20%, transparent); } }

/* Vibração no iPhone: chave nativa escondida */
.vibra-ios { position: fixed; width: 1px; height: 1px; overflow: hidden; opacity: 0; pointer-events: none; left: -99px; }

/* Cartões com brilho sutil ao passar o dedo/mouse */
.card.kpi-card, .agora-lista li a, .agora-lista li button { transition: transform .35s cubic-bezier(.34, 1.56, .64, 1), box-shadow .25s; }
@media (hover: hover) { a.card.kpi-card:hover { transform: translateY(-2px); box-shadow: 0 12px 28px -14px rgb(0 0 0 / .35); } }

@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
  .apertado { transform: none !important; }
}

/* Pessoa convidada que ainda não concluiu o cadastro */
.tag.aguardando { --c: var(--warn); background: var(--warn-bg); color: var(--warn); }

/* Assistentes de IA: escolha e passo a passo */
.escolha-ia { border: 0; padding: 0; margin: 0; display: grid; gap: var(--esp-2); }
.escolha-ia legend { font-weight: 600; margin-bottom: var(--esp-2); }
.como-conectar { border: 1px solid var(--border); border-radius: var(--raio-m); padding: var(--esp-3); background: var(--surface); }
.como-conectar[open] { border-color: var(--primary); }
.como-conectar summary { font-weight: 700; cursor: pointer; min-height: 32px; display: flex; align-items: center; }
.como-conectar .passos { padding-left: 1.2em; margin: var(--esp-2) 0; display: grid; gap: 4px; }
.como-conectar .codigo { margin-top: var(--esp-2); }

/* Reembolsos: total por sócio */
.reemb-socios { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--esp-2); }
.reemb-socio { display: flex; align-items: center; gap: var(--esp-3); width: 100%; text-align: left; padding: var(--esp-3); border: 1px solid var(--border); border-radius: var(--raio-m);
  background: var(--surface); color: var(--text); font: inherit; cursor: pointer; min-height: 56px; transition: border-color .2s, background .2s, transform .35s cubic-bezier(.34, 1.56, .64, 1); }
.reemb-socio:hover { border-color: var(--primary); }
.reemb-socio.ativo { border-color: var(--primary); background: var(--primary-soft); box-shadow: inset 0 0 0 1px var(--primary); }
.reemb-socio small { display: block; color: var(--muted); font-size: var(--fs-xs); }
.reemb-socio .valor { font-weight: 700; font-size: var(--fs-l); color: var(--neg); white-space: nowrap; }
.reemb-socio.zerado .valor { color: var(--muted); font-weight: 600; font-size: var(--fs-m); }
