/* Contabilidade — Rabêlo Odonto
   Calmo e claro, de clínica: fundo creme, cartões quase brancos, sálvia escura
   para ação e saldo, terracota só no login e em detalhes. */
:root {
  --creme: #f5ead8;
  --cartao: #fdf9f2;       /* cartões e campos: quase branco-creme */
  --cartao-2: #f8f1e5;     /* hover suave, linhas alternadas */
  --linha: #eadcc6;
  --linha-forte: #ddcbb0;
  --tinta: #201e1d;
  --suave: #786e65;        /* cinza quente */
  --salvia: #55633f;
  --salvia-esc: #46522f;
  --salvia-media: #7a8a5e;
  --salvia-claro: #e6ead9;
  --salvia-claro-2: #d7dec5;
  --terra: #c67139;
  --terra-txt: #9a4c1c;
  --creme-claro: #fbf3e6;
  --sombra: 0 1px 2px rgb(90 60 30 / .05), 0 6px 20px -10px rgb(90 60 30 / .14);
  --sombra-alta: 0 4px 12px rgb(60 40 20 / .08), 0 30px 70px -20px rgb(60 40 20 / .3);
  --r-cartao: 22px;
  --r-janela: 28px;
  --fonte: "Nunito Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --barra-h: 0px;
  color-scheme: light;
}
body.electron { --barra-h: 36px; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html.animando { overflow: hidden; } /* sem barra de rolagem por cima da animação de entrada */
.so-cel { display: none; }
body {
  margin: 0; background: var(--creme); color: var(--tinta);
  font: 400 15px/1.45 var(--fonte); font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
h1, h2, h3 { margin: 0; font-weight: 800; letter-spacing: -0.02em; line-height: 1.15; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
:focus-visible { outline: 2px solid var(--salvia); outline-offset: 2px; }
input:focus-visible, select:focus-visible { outline-offset: 0; }
img { display: block; max-width: 100%; }
svg.lucide { width: 18px; height: 18px; flex: none; }
.suave { color: var(--suave); font-weight: 600; letter-spacing: 0; font-size: 14px; }

/* ------------------------------------------------------------ barra da janela */
.barra-janela {
  position: fixed; inset: 0 0 auto; height: var(--barra-h); z-index: 200; display: flex; align-items: center;
  background: var(--creme); -webkit-app-region: drag; user-select: none; border-bottom: 1px solid var(--linha);
}
.login ~ .barra-janela, body.na-login .barra-janela { background: transparent; border-color: transparent; }
.bj-tit { display: flex; align-items: center; gap: 8px; padding-left: 12px; font-size: 12.5px; font-weight: 700; color: var(--suave); }
.bj-tit img { width: 18px; height: 18px; border-radius: 999px; }
.bj-bts { margin-left: auto; display: flex; height: 100%; -webkit-app-region: no-drag; }
.bj-bts button { width: 46px; height: 100%; display: grid; place-items: center; color: var(--suave); }
.bj-bts button svg { width: 15px; height: 15px; }
.bj-bts button:hover { background: rgb(32 30 29 / .07); color: var(--tinta); }
.bj-bts .bj-x:hover { background: #c42b1c; color: #fff; }
body.na-login .bj-tit { color: rgb(253 249 242 / .9); }
body.na-login .bj-bts button { color: var(--tinta); }

/* ------------------------------------------------------------ botões */
.bt {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 20px; border-radius: 999px; font-weight: 800; white-space: nowrap;
  transition: background .15s, color .15s, border-color .15s, transform .1s;
}
.bt:active { transform: scale(.98); }
.bt:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.bt-pri { background: var(--salvia); color: #fff; }
.bt-pri:hover:not(:disabled) { background: var(--salvia-esc); }
.bt-sec { background: var(--cartao); border: 1.5px solid var(--linha-forte); }
.bt-sec:hover:not(:disabled) { background: var(--salvia-claro); border-color: var(--salvia-claro-2); }
.bt-perigo { color: var(--terra-txt); padding: 0 14px; }
.bt-perigo:hover { background: #f6e3d4; }
.bt-perigo.armado { background: var(--terra); color: #fff; }
.bt-grande { height: 54px; font-size: 17px; width: 100%; }
.bt-ic { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 999px; transition: background .15s; }
.bt-ic:hover { background: var(--salvia-claro); }
.link { color: var(--salvia); font-weight: 800; font-size: 14px; border-radius: 999px; padding: 4px 8px; margin: -4px -8px; }
.link:hover { background: var(--salvia-claro); }

/* ------------------------------------------------------------ campos */
.campo { display: grid; gap: 6px; min-width: 0; align-content: start; }
.campo > span, .campo-top label { font-size: 13px; font-weight: 700; color: var(--suave); padding-left: 16px; }
.campo-top { display: flex; justify-content: space-between; align-items: center; padding-right: 10px; }
.campo input, .campo select, .pilula {
  height: 48px; width: 100%; min-width: 0; padding: 0 18px; border-radius: 999px;
  border: 1.5px solid var(--linha-forte); background: var(--cartao); font-size: 15.5px; font-weight: 600;
  transition: border-color .15s, box-shadow .15s;
}
.campo select, .ad-lin select {
  appearance: none; padding-right: 40px; background-repeat: no-repeat; background-position: right 15px center;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23786e65' stroke-width='2.75' stroke-linecap='round' stroke-linejoin='round' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}
.campo input:hover, .campo select:hover, .pilula:hover { border-color: var(--salvia-claro-2); }
.campo input:focus, .campo select:focus { border-color: var(--salvia); box-shadow: 0 0 0 4px rgb(85 99 63 / .13); outline: none; }
.pilula { display: flex; align-items: center; gap: 10px; text-align: left; cursor: pointer; }
.pilula span { flex: 1; }
.pilula svg { color: var(--suave); }
.senha { position: relative; }
.senha input { padding-right: 56px; }
.olho { position: absolute; right: 5px; top: 50%; translate: 0 -50%; width: 38px; height: 38px; border-radius: 999px; display: grid; place-items: center; color: var(--suave); }
.olho:hover { background: var(--salvia-claro); color: var(--tinta); }
.erro { color: var(--terra-txt); font-weight: 700; font-size: 14px; padding-left: 16px; }
.ok { color: var(--salvia); font-weight: 700; font-size: 14px; padding-left: 16px; }

.check { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; cursor: pointer; user-select: none; }
.check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.check .caixa { width: 24px; height: 24px; border-radius: 999px; border: 1.5px solid var(--linha-forte); background: var(--cartao); display: grid; place-items: center; color: transparent; transition: .15s; flex: none; }
.check .caixa svg { width: 14px; height: 14px; }
.check input:checked + .caixa { background: var(--salvia); border-color: var(--salvia); color: #fff; }
.check input:focus-visible + .caixa { outline: 2px solid var(--salvia); outline-offset: 2px; }
.check:hover .caixa { border-color: var(--salvia-claro-2); }

.seg { display: inline-flex; background: var(--cartao-2); border: 1px solid var(--linha); border-radius: 999px; padding: 3px; gap: 2px; }
.seg button { padding: 6px 14px; border-radius: 999px; font-weight: 700; font-size: 14px; color: var(--suave); }
.seg button:hover { color: var(--tinta); }
.seg button.on { background: var(--cartao); color: var(--salvia); box-shadow: var(--sombra); }

/* ============================================================ LOGIN */
.login { min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.lp {
  position: relative; overflow: hidden; background: var(--terra); color: var(--creme-claro);
  display: flex; flex-direction: column; justify-content: space-between; padding: calc(var(--barra-h) + 40px) 48px 52px;
}
.lp-marca, .lp-texto { position: relative; }
.lp-marca { display: flex; align-items: center; gap: 14px; }
.lp-marca img { width: 56px; height: 56px; border-radius: 999px; box-shadow: 0 0 0 3px rgb(251 243 230 / .85); }
.lp-marca strong { display: block; font-size: 20px; font-weight: 800; letter-spacing: -0.02em; }
.lp-marca span { font-weight: 600; opacity: .85; }
.lp-texto h1 { font-size: clamp(36px, 4.2vw, 54px); font-weight: 800; letter-spacing: -0.03em; line-height: 1.05; max-width: 12ch; }
.lp-texto p { margin-top: 14px; font-size: 17px; opacity: .88; max-width: 34ch; }
.bola { position: absolute; border-radius: 999px; pointer-events: none; }
.lp .b1 { width: 460px; height: 460px; right: -150px; top: -120px; background: #cf8250; }
.lp .b2 { width: 260px; height: 260px; right: 60px; bottom: 120px; background: #b9662f; }

.lf { display: grid; place-items: center; padding: calc(var(--barra-h) + 24px) 24px 24px; }
.lf-in { width: 100%; max-width: 380px; display: grid; gap: 18px; }
.lf-in h2 { font-size: 34px; }
.lf-sub { color: var(--suave); font-weight: 600; margin-top: 6px; }
.nota { color: var(--suave); font-size: 14px; text-align: center; }
.link-voltar { display: inline-flex; align-items: center; gap: 6px; justify-self: center; }

/* ============================================================ ANIMAÇÃO */
.ov {
  position: fixed; inset: 0; z-index: 150; background: var(--terra); color: var(--creme-claro); overflow: hidden;
  display: grid; place-items: center; padding: 24px; clip-path: circle(0px at var(--x, 50%) var(--y, 50%));
}
.ov.abre { clip-path: circle(150vmax at var(--x, 50%) var(--y, 50%)); transition: clip-path .9s cubic-bezier(.7, 0, .2, 1); }
.ov.some { opacity: 0; transition: opacity .45s ease; }
.ov-in { position: relative; display: grid; justify-items: center; gap: 20px; text-align: center; }
.ov-logo { width: 96px; height: 96px; border-radius: 999px; box-shadow: 0 0 0 4px rgb(251 243 230 / .85); }
.ov-clin { font-weight: 700; font-size: 17px; opacity: .88; }
.ov-ola { font-size: clamp(34px, 6vw, 50px); font-weight: 800; letter-spacing: -0.03em; margin-top: 2px; }
.ov-card { background: var(--creme-claro); color: var(--tinta); border-radius: var(--r-cartao); padding: 18px 32px; box-shadow: 0 20px 50px -20px rgb(70 30 5 / .5); display: grid; gap: 2px; min-width: 250px; }
.ov-card span { font-weight: 700; color: var(--suave); font-size: 15px; }
.ov-card b { font-size: 36px; font-weight: 800; letter-spacing: -0.03em; color: var(--salvia); }
.ov-card b.neg { color: var(--tinta); }
.ov-msg { font-weight: 700; opacity: .9; }
.ov .f1 { width: 520px; height: 520px; left: -180px; top: -200px; background: #cf8250; }
.ov .f2 { width: 360px; height: 360px; right: -120px; bottom: -110px; background: #b9662f; }
.ov .f3 { width: 140px; height: 140px; right: 18%; top: 14%; background: #d89565; opacity: .55; }
.ov.mostra .f1 { animation: flutua 9s ease-in-out infinite alternate; }
.ov.mostra .f2 { animation: flutua 11s ease-in-out infinite alternate-reverse; }
.ov.mostra .f3 { animation: flutua 7s ease-in-out infinite alternate; }
.ov .s1, .ov .s2, .ov .s3, .ov .s4 { opacity: 0; }
.ov.mostra .s1 { animation: sobe .6s cubic-bezier(.2, .7, .2, 1) .05s both; }
.ov.mostra .s2 { animation: sobe .6s cubic-bezier(.2, .7, .2, 1) .25s both; }
.ov.mostra .s3 { animation: sobe .6s cubic-bezier(.2, .7, .2, 1) .55s both; }
.ov.mostra .s4 { animation: sobe .6s cubic-bezier(.2, .7, .2, 1) .85s both; }
@keyframes sobe { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }
@keyframes flutua { from { transform: translate(0, 0); } to { transform: translate(36px, 28px); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ============================================================ APP */
.app { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100dvh; padding-top: var(--barra-h); }
.menu {
  position: sticky; top: var(--barra-h); height: calc(100dvh - var(--barra-h)); display: flex; flex-direction: column;
  padding: 20px 14px 14px; gap: 22px;
}
.menu-marca { display: flex; align-items: center; gap: 10px; padding: 4px 8px; }
.menu-marca img { width: 40px; height: 40px; border-radius: 999px; }
.menu-marca strong { display: block; font-size: 16px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.2; }
.menu-marca span { font-size: 13px; color: var(--suave); font-weight: 600; }
.menu-itens { display: grid; gap: 4px; }
.menu-itens a { display: flex; align-items: center; gap: 12px; height: 44px; padding: 0 14px; border-radius: 999px; font-weight: 700; color: var(--suave); transition: background .15s, color .15s; }
.menu-itens a:hover { background: var(--cartao-2); color: var(--tinta); }
.menu-itens a.on { background: var(--cartao); color: var(--salvia); box-shadow: var(--sombra); }
.menu-rod { margin-top: auto; display: flex; align-items: center; gap: 6px; padding: 8px 6px 8px 8px; border-radius: 999px; background: var(--cartao-2); border: 1px solid var(--linha); }
.menu-eu { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; }
.bt-sair { width: 38px; height: 38px; border-radius: 999px; display: grid; place-items: center; color: var(--terra); flex: none; transition: background .15s; }
.bt-sair:hover { background: #f6e3d4; }
.bt-sair-m { display: none; }
.menu-eu-tx { flex: 1; min-width: 0; line-height: 1.2; }
.menu-eu-tx strong { display: block; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-eu-tx span { font-size: 12.5px; color: var(--suave); font-weight: 600; }
.menu-eu svg { color: var(--suave); width: 16px; height: 16px; }
.av { width: 38px; height: 38px; border-radius: 999px; background: var(--salvia); color: #fff; display: grid; place-items: center; font-weight: 800; flex: none; }

.conteudo { min-width: 0; padding: 22px 28px 48px 12px; }
.cab { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.cab-m { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.cab-logo, .av-m { display: none; }
.cab-tx { min-width: 0; flex: 1; }
.cab-tx h1, .cab-tx p { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cab h1 { font-size: 28px; }
.cab p { color: var(--suave); font-weight: 600; margin-top: 2px; }
.cab-acoes { display: flex; align-items: center; gap: 10px; }
.periodo { display: flex; align-items: center; gap: 2px; background: var(--cartao); border: 1px solid var(--linha); border-radius: 999px; padding: 3px; }
.per-rot { height: 36px; padding: 0 12px; border-radius: 999px; font-weight: 700; min-width: 150px; text-align: center; white-space: nowrap; }
.per-rot:hover { background: var(--salvia-claro); }
.aviso { background: #f6e3d4; color: var(--terra-txt); font-weight: 700; border-radius: 999px; padding: 10px 20px; margin-bottom: 16px; }

.cartao { background: var(--cartao); border-radius: var(--r-cartao); padding: 20px 22px; box-shadow: var(--sombra); border: 1px solid rgb(234 220 198 / .6); min-width: 0; }
.cartao h2 { font-size: 17px; margin-bottom: 14px; }
.cartao-cab { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.cartao-cab h2 { margin: 0 auto 0 0; }
/* colunas minmax(0, …): texto sem quebra (nome longo, valor grande) não alarga a grade */
.pag { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }

/* números do mês */
.cards3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.num-rot { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--suave); font-size: 14px; }
.num-rot svg { width: 16px; height: 16px; }
.num-v { font-size: 30px; font-weight: 800; letter-spacing: -0.03em; margin: 6px 0 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.num-v.ent { color: var(--salvia); }
.num-sub { color: var(--suave); font-size: 13.5px; font-weight: 600; }
.saldo { background: var(--salvia-claro); border-color: var(--salvia-claro-2); }
.saldo .num-v { color: var(--salvia); }
.saldo .num-v.neg { color: var(--tinta); }
.saldo .num-rot, .saldo .num-sub { color: #5d6650; }

.duas { display: grid; grid-template-columns: minmax(0, 1fr) 270px; gap: 16px; align-items: start; }
.col-dir { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }

/* tabela */
.tabela { width: 100%; border-collapse: collapse; table-layout: fixed; }
.tabela th { font-size: 12.5px; font-weight: 700; color: var(--suave); text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--linha); white-space: nowrap; }
.tabela td { padding: 11px 10px; border-bottom: 1px solid var(--linha); vertical-align: middle; }
.tabela tr:last-child td { border-bottom: 0; }
.tabela tbody tr { cursor: pointer; transition: background .12s; }
.tabela tbody tr:hover td { background: var(--cartao-2); }
.tabela tbody tr:focus-visible { outline: 2px solid var(--salvia); outline-offset: -2px; }
.tabela td:first-child, .tabela th:first-child { padding-left: 12px; border-radius: 0; }
.tabela .c-data { width: 64px; color: var(--suave); font-weight: 700; }
.tabela .c-cat { width: 190px; }
.tabela .c-pag { width: 92px; color: var(--suave); font-weight: 600; }
.tabela .c-val { width: 156px; text-align: right; font-weight: 800; white-space: nowrap; }
.tabela .c-val.e { color: var(--salvia); }
.tabela .ds { display: block; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tabela .por { display: block; font-size: 12.5px; color: var(--suave); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.etq { display: inline-flex; align-items: center; gap: 7px; max-width: 100%; height: 28px; padding: 0 11px; border-radius: 999px; background: var(--cartao-2); border: 1px solid var(--linha); font-size: 13px; font-weight: 700; }
.etq span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.etq::before { content: ""; width: 8px; height: 8px; border-radius: 999px; background: var(--c); flex: none; }
.dia-tab td { background: var(--cartao-2); font-size: 13px; font-weight: 800; color: var(--suave); padding-top: 7px; padding-bottom: 7px; cursor: default; }
.dia-tab td b { font-weight: 800; }
.dia-tab td b.pos { color: var(--salvia); }
tbody tr.dia-tab:hover td { background: var(--cartao-2); }

/* lista do celular */
.lista-m { display: none; }
.lm { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 11px 6px; border-bottom: 1px solid var(--linha); }
.lm:last-child { border-bottom: 0; }
.lm .ds { display: block; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lm .mt { display: block; font-size: 13px; color: var(--suave); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lm .vl { font-weight: 800; white-space: nowrap; }
.lm .vl.e { color: var(--salvia); }
.lm-dia { display: flex; justify-content: space-between; font-size: 13px; font-weight: 800; color: var(--suave); padding: 14px 6px 4px; }
.lm-dia b.pos { color: var(--salvia); }
.vazio { text-align: center; color: var(--suave); padding: 32px 16px; font-weight: 600; }
.rodape-lista { color: var(--suave); font-size: 13.5px; font-weight: 600; padding: 12px 12px 0; }
.rodape-lista:empty { display: none; }

.busca { display: flex; align-items: center; gap: 6px; height: 38px; padding: 0 14px; border-radius: 999px; background: var(--cartao-2); border: 1px solid var(--linha); }
.busca svg { color: var(--suave); width: 16px; height: 16px; }
.busca input { border: 0; background: none; width: 140px; outline: none; font-weight: 600; min-width: 0; }
.busca:focus-within { outline: 2px solid var(--salvia); }
.filtro { display: inline-flex; align-items: center; gap: 8px; height: 38px; border-radius: 999px; border: 1px solid var(--linha); background: var(--cartao-2); padding: 0 12px 0 14px; font-weight: 700; max-width: 240px; min-width: 0; }
.filtro:hover { background: var(--salvia-claro); }
.filtro .op-tx, .escolha .op-tx { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; }
.filtro .pt { width: 10px; height: 10px; border-radius: 999px; flex: none; }
.filtro svg, .escolha svg { color: var(--suave); width: 16px; height: 16px; }
.ferramentas .busca { flex: 1 1 220px; }
.ferramentas .busca input { width: 100%; }

/* barras e pessoas */
.barras { display: grid; grid-template-columns: minmax(0, 1fr); gap: 13px; }
.barras .t { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; font-weight: 700; min-width: 0; }
.barras .t span { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.barras .t b { flex: none; white-space: nowrap; }
.barras .k { height: 6px; background: var(--cartao-2); border: 1px solid var(--linha); border-radius: 999px; margin-top: 6px; overflow: hidden; }
.barras .k div { height: 100%; border-radius: 999px; background: var(--salvia-media); }
.barras.cor .k div { background: var(--c); }
.barras.cor .t span::before { content: ""; display: inline-block; width: 9px; height: 9px; border-radius: 999px; background: var(--c); margin-right: 8px; }
.pessoas { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.pessoa { display: flex; align-items: center; gap: 10px; }
img.av.foto { object-fit: cover; background: var(--cartao-2); }
.foto-bt { position: relative; cursor: pointer; flex: none; border-radius: 999px; }
.foto-bt .av { width: 44px; height: 44px; background: var(--salvia-claro); color: var(--salvia); }
.foto-bt input { position: absolute; inset: 0; opacity: 0; width: 100%; cursor: pointer; }
.foto-bt .foto-ic { position: absolute; right: -3px; bottom: -3px; width: 22px; height: 22px; border-radius: 999px; background: var(--salvia); color: #fff; display: grid; place-items: center; border: 2px solid var(--cartao); }
.foto-bt .foto-ic svg { width: 11px; height: 11px; }
.foto-bt:hover .av { box-shadow: 0 0 0 3px var(--salvia-claro-2); }
.foto-bt:focus-within { outline: 2px solid var(--salvia); outline-offset: 2px; }
.pessoa .av { width: 32px; height: 32px; font-size: 13px; background: var(--salvia-claro); color: var(--salvia); }
.pessoa > span:not(.av) { flex: 1; min-width: 0; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pessoa b { flex: none; font-weight: 800; white-space: nowrap; }
.vz { color: var(--suave); font-weight: 600; font-size: 14px; }

/* fechamento */
.grade-fech { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.linhas { display: grid; grid-template-columns: minmax(0, 1fr); }
.linhas .l { display: flex; align-items: baseline; gap: 8px; padding: 7px 0; }
.linhas .l i { flex: 1; border-bottom: 2px dotted var(--linha-forte); translate: 0 -4px; min-width: 12px; }
.linhas .l b { white-space: nowrap; font-weight: 800; }
.linhas .l.sub { color: var(--suave); font-size: 14px; padding: 3px 0 3px 16px; }
.linhas .l.sub b { font-weight: 700; }
.linhas .l.tot { margin-top: 10px; padding: 13px 18px; background: var(--salvia-claro); border-radius: 999px; font-size: 17px; font-weight: 800; }
.linhas .l.tot i { border: 0; }
.linhas .pos { color: var(--salvia); }
.saidas { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.saidas .bt { flex: 1 1 auto; height: 42px; padding: 0 14px; }
.msg { font-weight: 700; font-size: 14px; padding: 8px 0 0 8px; }
.msg:empty { display: none; }
.msg.ok { color: var(--salvia); } .msg.err { color: var(--terra-txt); }

/* repasse */
.rep-total .num-v { color: var(--salvia); }
.rep-grade { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.rep-cab { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.rep-cab .av { background: var(--salvia-claro); color: var(--salvia); }
.rep-cab div { flex: 1; min-width: 0; }
.rep-cab strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rep-cab span { font-size: 13px; color: var(--suave); font-weight: 600; }
.rep-sub { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-top: 1px; }
.rep-sub b { font-size: 18px; font-weight: 800; white-space: nowrap; }
.rep-it { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; padding: 7px 4px; border-top: 1px solid var(--linha); width: 100%; text-align: left; border-radius: 0; }
.rep-it:hover { background: var(--cartao-2); }
.rep-it span { color: var(--suave); font-weight: 600; }
.rep-it b { font-weight: 700; }

/* admin */
.dica { color: var(--suave); font-size: 14px; margin: -6px 0 12px; }
.ad-novo { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; background: var(--cartao-2); border: 1px solid var(--linha); border-radius: var(--r-cartao); padding: 14px; margin-bottom: 12px; }
.ad-novo .campo { flex: 1 1 180px; }
.ad-novo .campo-p { flex: 0 1 150px; }
.ad-novo .campo input, .ad-novo .campo select, .ad-novo .pilula { height: 44px; }
.cor-bt { width: 44px; height: 44px; border-radius: 999px; background: var(--c, #b3a899); border: 3px solid var(--cartao); box-shadow: 0 0 0 1px var(--linha-forte); flex: none; cursor: pointer; transition: box-shadow .15s; }
.cor-bt:hover, .cor-bt[aria-expanded=true] { box-shadow: 0 0 0 1px var(--linha-forte), 0 0 0 4px var(--salvia-claro-2); }
.escolha { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 12px 0 14px; border-radius: 999px; border: 1.5px solid var(--linha-forte); background: var(--cartao); font-weight: 700; min-width: 0; }
.escolha:hover { border-color: var(--salvia-claro-2); background: var(--cartao-2); }
.ad-acoes { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ad-lista { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; }
.ad-lin { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 6px; border-bottom: 1px solid var(--linha); }
.ad-lin:last-child { border-bottom: 0; }
.ad-lin .tx { flex: 1 1 200px; min-width: 0; }
.ad-lin .nm { font-weight: 800; }
.ad-lin .em { color: var(--suave); font-size: 13px; font-weight: 600; }
.ad-lin input[type=text] { height: 40px; border-radius: 999px; border: 1.5px solid var(--linha-forte); background: var(--cartao); padding: 0 14px; font-weight: 700; min-width: 0; flex: 1 1 160px; }
.ad-lin .cor-bt { width: 36px; height: 36px; }
.ad-lin select { height: 40px; border-radius: 999px; border: 1.5px solid var(--linha-forte); background-color: var(--cartao); padding: 0 36px 0 12px; font-weight: 700; }
.ad-lin .bt { height: 38px; padding: 0 14px; font-size: 14px; }
.ad-lin .bt svg { width: 16px; height: 16px; }
.ad-lin .escolha { width: 120px; flex: none; }
.ad-lin .tot { font-weight: 800; white-space: nowrap; min-width: 110px; text-align: right; }
.ad-lin .pt { width: 12px; height: 12px; border-radius: 999px; flex: none; }
.ad-lin.inativa .nm, .ad-lin.inativa input[type=text] { opacity: .55; }
.tag { display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 800; background: var(--cartao-2); border: 1px solid var(--linha); color: var(--suave); }
.tag.ok { background: var(--salvia-claro); border-color: var(--salvia-claro-2); color: var(--salvia); padding: 0 10px; }
.tag.alerta { background: #f6e3d4; border-color: #efcfb5; color: var(--terra-txt); }
.ad-link { display: flex; gap: 8px; align-items: center; background: var(--salvia-claro); border-radius: 999px; padding: 6px 6px 6px 18px; margin-bottom: 6px; }
.ad-link code { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 700; color: var(--salvia); }
.ad-link + .dica { margin: 0 0 12px 18px; }
.msg-pag { position: sticky; bottom: 16px; }

/* ============================================================ MENU FLUTUANTE */
.pop {
  position: fixed; z-index: 160; min-width: 220px; max-width: min(320px, calc(100vw - 32px)); max-height: min(440px, 70vh); overflow: auto;
  background: var(--cartao); border-radius: 22px; box-shadow: var(--sombra-alta); padding: 8px; border: 1px solid var(--linha);
}
.pop .op { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 14px; border-radius: 999px; font-weight: 700; text-align: left; }
.pop .op:hover, .pop .op:focus-visible { background: var(--salvia-claro); }
.pop .op.on { color: var(--salvia); background: var(--cartao-2); }
.pop .op.sair svg { color: var(--terra); }
.pop .op .pt { width: 10px; height: 10px; border-radius: 999px; flex: none; }
.pop .op .op-tx { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pop .op svg { color: var(--salvia); }
.pop .op .av { width: 28px; height: 28px; font-size: 12px; background: var(--salvia-claro); color: var(--salvia); }
.pilula .pt { width: 12px; height: 12px; border-radius: 999px; flex: none; }
.pilula .av { width: 28px; height: 28px; font-size: 12px; background: var(--salvia-claro); color: var(--salvia); margin-left: -6px; }
.pilula #lcDentAv { flex: none; display: flex; }
#lcDentAv:empty { display: none; }
#lcCatTx, #lcDentTx { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.pop .paleta { display: grid; grid-template-columns: repeat(5, 36px); gap: 6px; padding: 4px 8px 8px; }
.pop .op.op-cor { width: 36px; height: 36px; padding: 0; justify-content: center; background: var(--c); color: #fff; border-radius: 999px; }
.pop .op.op-cor:hover, .pop .op.op-cor:focus-visible { background: var(--c); box-shadow: 0 0 0 3px var(--cartao), 0 0 0 5px var(--salvia-media); outline: none; }
.pop .op.op-cor.on { background: var(--c); box-shadow: 0 0 0 3px var(--cartao), 0 0 0 5px var(--salvia); }
.pop .op.op-cor svg { color: #fff; width: 16px; height: 16px; }

.per-datas { display: grid; gap: 6px; padding: 4px 4px 8px; }
.per-datas .pilula { height: 44px; font-size: 14.5px; }
.pop .op:disabled { opacity: .45; cursor: not-allowed; }

/* calendário */
.cal { padding: 4px 4px 2px; width: 290px; max-width: 100%; }
.cal-atalhos { display: flex; gap: 6px; padding: 2px 0 10px; }
.cal-atalhos button { flex: 1; height: 36px; border-radius: 999px; background: var(--cartao-2); border: 1px solid var(--linha); font-weight: 700; font-size: 13.5px; }
.cal-atalhos button:hover { background: var(--salvia-claro); }
.cal-atalhos button.on { background: var(--salvia); border-color: var(--salvia); color: #fff; }
.cal-cab { display: flex; align-items: center; justify-content: space-between; padding: 2px 0 6px; }
.cal-cab strong { font-weight: 800; }
.cal-sem, .cal-dias { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
.cal-sem span { font-size: 12px; font-weight: 800; color: var(--suave); padding: 4px 0; }
.cal-dias button { aspect-ratio: 1; border-radius: 999px; font-weight: 700; font-size: 14px; display: grid; place-items: center; }
.cal-dias button:hover { background: var(--salvia-claro); }
.cal-dias button.fora { color: #b9ad9f; font-weight: 600; }
.cal-dias button.hoje { box-shadow: inset 0 0 0 1.5px var(--salvia); color: var(--salvia); }
.cal-dias button.on { background: var(--salvia); color: #fff; box-shadow: none; }
.pop .gr { font-size: 12px; font-weight: 800; color: var(--suave); text-transform: uppercase; letter-spacing: .04em; padding: 10px 14px 4px; }
.pop .campo { padding: 6px 4px; }
.pop .campo input { height: 44px; }
.pop hr { border: 0; border-top: 1px solid var(--linha); margin: 6px 8px; }
.pop .quem { padding: 8px 14px 10px; }
.pop .quem strong { display: block; }
.pop .quem span { font-size: 13px; color: var(--suave); font-weight: 600; }

/* ============================================================ JANELAS */
.dlg { border: 0; padding: 0; background: transparent; width: min(580px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); color: var(--tinta); overflow: visible; }
.dlg::backdrop { background: rgb(40 30 20 / .4); backdrop-filter: blur(2px); }
.dlg-in { background: var(--cartao); border-radius: var(--r-janela); padding: 24px; display: grid; gap: 16px; box-shadow: var(--sombra-alta); max-height: calc(100dvh - 24px); overflow: auto; }
.dlg-cab { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.dlg-cab h2 { font-size: 22px; }
.dlg-rod { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding-top: 4px; }
.esp { flex: 1; }
.dica-tecla { color: var(--suave); font-size: 13px; font-weight: 600; }
.meta { color: var(--suave); font-size: 13px; padding-left: 16px; }
.aviso-ler { display: flex; align-items: center; gap: 8px; background: var(--cartao-2); border: 1px solid var(--linha); color: var(--suave); font-weight: 700; font-size: 14px; border-radius: 999px; padding: 10px 16px; }
.aviso-ler svg { width: 16px; height: 16px; }
/* só para ver: campos sem cara de clicáveis */
.so-ler .tipo-alt span, .so-ler .formas span, .so-ler .pilula, .so-ler .check { cursor: default; }
.so-ler .tipo-alt input:not(:checked) + span, .so-ler .formas input:not(:checked) + span { opacity: .45; }
.so-ler .pilula:hover, .so-ler .formas span:hover { border-color: var(--linha-forte); background: var(--cartao); }
.so-ler .pilula > svg:last-child { visibility: hidden; }
.so-ler #lcValor:disabled, .so-ler #lcDesc:disabled { color: var(--tinta); opacity: 1; -webkit-text-fill-color: var(--tinta); }

.tipo-alt { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; background: var(--cartao-2); border: 1px solid var(--linha); border-radius: 999px; padding: 4px; }
.tipo-alt label { position: relative; }
.tipo-alt input { position: absolute; opacity: 0; }
.tipo-alt span { display: flex; align-items: center; justify-content: center; gap: 8px; height: 48px; border-radius: 999px; font-weight: 800; font-size: 16px; color: var(--suave); cursor: pointer; transition: background .15s, color .15s; }
.tipo-alt small { font-size: 14px; font-weight: 600; }
.tipo-alt span:hover { color: var(--tinta); }
.tipo-alt input:checked + span { background: var(--salvia); color: #fff; }
.tipo-alt input:focus-visible + span { outline: 2px solid var(--salvia); outline-offset: 2px; }

.lc-linha { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 12px; }
.lc-linha:has(.lc-valor) { grid-template-columns: 200px minmax(0, 1fr); }
.rs { display: flex; align-items: center; height: 56px; border-radius: 999px; border: 1.5px solid var(--linha-forte); background: var(--cartao); padding: 0 18px; transition: border-color .15s, box-shadow .15s; }
.rs:focus-within { border-color: var(--salvia); box-shadow: 0 0 0 4px rgb(85 99 63 / .13); }
.rs b { color: var(--suave); font-weight: 800; margin-right: 6px; }
/* um respiro à direita: com o texto alinhado à direita o cursor cortava o último dígito */
.campo .rs input { border: 0; height: 100%; padding: 0 3px 0 0; font-size: 24px; font-weight: 800; background: none; box-shadow: none; text-align: right; }
.lc-desc input { height: 56px; }
.lc-desc > label { font-size: 13px; font-weight: 700; color: var(--suave); padding-left: 16px; }
.sug-wrap { position: relative; }
.sug {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 20; background: var(--cartao);
  border: 1px solid var(--linha); border-radius: 22px; box-shadow: var(--sombra-alta); padding: 6px; display: grid; gap: 2px;
}
.sug button { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 999px; text-align: left; font-weight: 700; font-size: 14.5px; min-width: 0; }
.sug button:hover, .sug button.on { background: var(--salvia-claro); }
.sug .pt { width: 10px; height: 10px; border-radius: 999px; flex: none; }
.sug .op-tx { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sug .sug-cat { font-size: 12.5px; color: var(--suave); font-weight: 600; white-space: nowrap; }

.usados { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.usados:empty { display: none; }
.usados .rot { font-size: 13px; font-weight: 700; color: var(--suave); margin-right: 2px; }
.usados button { height: 34px; padding: 0 14px; border-radius: 999px; background: var(--cartao-2); border: 1px solid var(--linha); font-weight: 700; font-size: 13.5px; white-space: nowrap; transition: background .15s; }
.usados button:hover { background: var(--salvia-claro); border-color: var(--salvia-claro-2); }

.formas { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.formas label { position: relative; }
.formas input { position: absolute; opacity: 0; }
.formas span { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; height: 64px; border-radius: 20px; border: 1.5px solid var(--linha-forte); background: var(--cartao); font-weight: 700; font-size: 13.5px; cursor: pointer; transition: .15s; }
.formas span svg { color: var(--suave); }
.formas span:hover { border-color: var(--salvia-claro-2); background: var(--cartao-2); }
.formas input:checked + span { background: var(--salvia-claro); border-color: var(--salvia); color: var(--salvia); }
.formas input:checked + span svg { color: var(--salvia); }
.formas input:focus-visible + span { outline: 2px solid var(--salvia); outline-offset: 2px; }

.toast {
  position: fixed; left: 50%; bottom: 28px; translate: -50% 0; z-index: 170;
  background: var(--tinta); color: #fff; font-weight: 700; padding: 12px 22px; border-radius: 999px; box-shadow: var(--sombra-alta); max-width: calc(100vw - 32px);
}

.nav-m { display: none; }

/* ============================================================ TELAS MÉDIAS */
@media (max-width: 1180px) {
  .duas { grid-template-columns: minmax(0, 1fr); }
  .col-dir { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .tabela .c-pag { display: none; }
}

/* ============================================================ CELULAR */
@media (max-width: 860px) {
  /* login */
  .login { display: block; padding-bottom: calc(132px + env(safe-area-inset-bottom)); } /* o texto final não fica atrás do botão fixo */
  .so-pc { display: none; }
  .so-cel { display: inline; }
  .lp { height: 300px; border-radius: 0 0 36px 36px; padding: calc(24px + env(safe-area-inset-top)) 24px 28px; }
  .lp-texto { display: none; }
  .lp-marca { flex-direction: column; align-items: flex-start; justify-content: space-between; height: 100%; }
  .lp-marca img { width: 64px; height: 64px; }
  .lp-marca strong { font-size: 44px; font-weight: 800; letter-spacing: -0.03em; line-height: 1; }
  .lp-marca div { display: flex; flex-direction: column-reverse; }
  .lp-marca span { font-size: 18px; font-weight: 700; margin-bottom: 4px; }
  .lp .b1 { width: 320px; height: 320px; right: -110px; top: -110px; }
  .lp .b2 { width: 160px; height: 160px; right: 30px; bottom: 30px; }
  .lf { display: block; padding: 26px 20px 0; }
  .lf-in { margin: 0 auto; }
  .lf-in h2 { font-size: 30px; }
  .lf-rodape { position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: linear-gradient(to top, var(--creme) 72%, rgb(245 234 216 / 0)); }

  /* app */
  .app { display: block; }
  .menu { display: none; }
  .conteudo { padding: calc(14px + env(safe-area-inset-top)) 16px calc(112px + env(safe-area-inset-bottom)); }
  .cab { display: grid; gap: 12px; margin-bottom: 16px; }
  .cab-logo { display: block; width: 42px; height: 42px; border-radius: 999px; }
  .av-m { display: grid; width: 40px; height: 40px; }
  .bt-sair-m { display: grid; margin-left: -6px; }
  .cab-m { gap: 10px; }
  .cab h1 { font-size: 21px; }
  .cab p { font-size: 13.5px; }
  .cab-tx p { white-space: normal; overflow: visible; } /* "Resumo de novembro de 2026" pode ir para a 2ª linha */
  .cab-acoes { justify-content: space-between; }
  .periodo { flex: 1; justify-content: space-between; }
  .per-rot { min-width: 0; flex: 1; }
  .bt-novo { display: none; }

  .cards3 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
  .cards3 .saldo { grid-column: 1 / -1; order: -1; padding: 22px; }
  .cards3 .saldo .num-v { font-size: 38px; }
  .cards3 .num { padding: 16px; }
  .cards3 .num:not(.saldo) .num-v { font-size: 20px; }
  .cards3 .num:not(.saldo) .num-sub { font-size: 12.5px; }
  .col-dir { grid-template-columns: minmax(0, 1fr); }
  .cartao { padding: 16px; }

  .tabela-wrap { display: none; }
  .lista-m { display: block; }
  .ultimos .busca { display: none; }
  .ferramentas .seg { width: 100%; }
  .ferramentas .seg button { flex: 1; }
  .ferramentas .busca { flex: 1 1 150px; }
  .filtro { max-width: none; flex: 1 1 140px; } /* busca e filtro dividem a linha */
  .grade-fech { grid-template-columns: minmax(0, 1fr); }
  .ad-lin .tot { min-width: 0; }
  /* dentista: foto e nome na 1ª linha, ações embaixo do nome */
  .ad-lin[data-tipo=dentista] input[type=text] { flex: 1 1 0; }
  .ad-lin[data-tipo=dentista] .ad-acoes { flex: 1 0 100%; padding-left: 54px; }
  .ad-lin[data-tipo=dentista] .ad-acoes .check { margin-left: auto; }

  /* barra flutuante */
  .nav-m {
    display: grid; grid-template-columns: repeat(5, 1fr); align-items: center; position: fixed; z-index: 40;
    left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); height: 68px; padding: 0 6px;
    background: var(--cartao); border-radius: 999px; box-shadow: 0 10px 30px -8px rgb(60 40 20 / .3), 0 0 0 1px var(--linha);
  }
  .nav-m a { display: grid; justify-items: center; gap: 2px; font-size: 11px; font-weight: 700; color: var(--suave); padding: 8px 0; border-radius: 999px; }
  .nav-m a.on { color: var(--salvia); }
  .nav-m a svg { width: 21px; height: 21px; }
  .nav-mais { justify-self: center; width: 56px; height: 56px; border-radius: 999px; background: var(--salvia); color: #fff; display: grid; place-items: center; box-shadow: 0 8px 18px -6px rgb(85 99 63 / .7); }
  .nav-mais svg { width: 26px; height: 26px; }
  .toast { bottom: calc(96px + env(safe-area-inset-bottom)); }
  .msg-pag { bottom: calc(96px + env(safe-area-inset-bottom)); }

  /* novo lançamento em tela cheia */
  .dlg-lanc { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; }
  .dlg-lanc .dlg-in { border-radius: 0; height: 100dvh; max-height: 100dvh; padding: calc(16px + env(safe-area-inset-top)) 16px 0; align-content: start; }
  .dlg-lanc .dlg-rod { position: sticky; bottom: 0; background: var(--cartao); padding: 12px 0 calc(12px + env(safe-area-inset-bottom)); margin-top: auto; }
  .dlg-lanc .dica-tecla { display: none; }
  .dlg-lanc .dlg-rod .bt-pri { flex: 1; height: 52px; }
  .lc-linha, .lc-linha:has(.lc-valor) { grid-template-columns: 1fr; }
  .tipo-alt small { display: none; }
  .formas span { height: 58px; font-size: 12.5px; border-radius: 18px; }
  .dlg:not(.dlg-lanc) { width: 100vw; max-width: 100vw; margin: auto 0 0; }
  .dlg:not(.dlg-lanc) .dlg-in { border-radius: 28px 28px 0 0; padding-bottom: calc(20px + env(safe-area-inset-bottom)); }
}
@media (max-width: 380px) {
  .nav-m a span { font-size: 10px; }
}
/* celular baixo: faixa do login menor para o formulário caber acima do botão fixo */
@media (max-width: 860px) and (max-height: 780px) {
  .lp { height: 236px; }
  .lp-marca strong { font-size: 38px; }
}
