/* Identidade do site Dr. Francisco Moura Neto: azul-marinho, laranja, fundo claro. */
:root {
  --bg: #f5f6fa;
  --card: #ffffff;
  --card-2: #f0f2f7;
  --text: #0e213f;
  --muted: #5d6b80;
  --line: #e3e7ef;
  --navy: #0e213f;
  --navy-2: #1b3358;
  --accent: #e8792a;
  --accent-txt: #c25f14;
  --ok: #1f8a4c;
  --ok-bg: #e5f4ea;
  --bad: #d64545;
  --bad-bg: #fde9e9;
  --sel: #0e213f;
  --sel-txt: #ffffff;
  --shadow: 0 1px 2px rgba(14, 33, 63, .05), 0 6px 18px rgba(14, 33, 63, .06);
  --radius: 16px;
  --tab-h: 66px;
  color-scheme: light;
}
/* Tema escuro: automático (aparelho no modo escuro) ou escolhido em Ajustes */
@media (prefers-color-scheme: dark) {
  :root:not([data-tema="claro"]) {
    --bg: #07111f;
    --card: #0f1d33;
    --card-2: #162842;
    --text: #edf1f7;
    --muted: #94a3b8;
    --line: #1f3250;
    --navy: #0b1a2f;
    --navy-2: #1b3358;
    --accent: #f08a3e;
    --accent-txt: #f39a55;
    --ok: #3ccb7f;
    --ok-bg: #123524;
    --bad: #ff6b6b;
    --bad-bg: #3a1618;
    --sel: #ffffff;
    --sel-txt: #0e213f;
    --shadow: none;
    color-scheme: dark;
  }
}
:root[data-tema="escuro"] {
  --bg: #07111f;
  --card: #0f1d33;
  --card-2: #162842;
  --text: #edf1f7;
  --muted: #94a3b8;
  --line: #1f3250;
  --navy: #0b1a2f;
  --navy-2: #1b3358;
  --accent: #f08a3e;
  --accent-txt: #f39a55;
  --ok: #3ccb7f;
  --ok-bg: #123524;
  --bad: #ff6b6b;
  --bad-bg: #3a1618;
  --sel: #ffffff;
  --sel-txt: #0e213f;
  --shadow: none;
  color-scheme: dark;
}
:root[data-tema="claro"] { color-scheme: light; }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
body {
  font: 15px/1.45 "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg); color: var(--text);
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.carregando { min-height: 100vh; display: grid; place-items: center; background: #0e213f; }

/* ---------- Estrutura ---------- */
.shell { min-height: 100vh; padding-bottom: calc(var(--tab-h) + env(safe-area-inset-bottom) + 28px); }
.topo {
  position: sticky; top: 0; z-index: 5; background: var(--navy); color: #fff;
  padding: calc(env(safe-area-inset-top) + 10px) 14px 12px;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px;
}
.topo .esq { display: flex; align-items: center; gap: 10px; min-width: 0; }
.topo .dir { display: flex; justify-content: flex-end; gap: 8px; }
.topo .logo { width: 30px; height: 30px; object-fit: contain; flex: none; }
.topo h1 { margin: 0; font-size: 15px; font-weight: 800; letter-spacing: .02em; text-transform: uppercase; white-space: nowrap; display: flex; align-items: center; gap: 2px; }
.topo h1.normal { text-transform: none; font-size: 17px; letter-spacing: 0; }
.topo h1 button { background: none; border: 0; color: rgba(255,255,255,.7); font-size: 22px; line-height: 1; padding: 2px 6px; }
.pilula {
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.14); color: #fff;
  border-radius: 999px; height: 38px; padding: 0 14px; font-size: 14px; font-weight: 600; white-space: nowrap;
}
.redondo {
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.14); color: #fff;
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-size: 22px; line-height: 1; flex: none; padding: 0;
}
.redondo svg { width: 20px; height: 20px; }
.redondo.ativo, .pilula.ativo { background: var(--accent); border-color: var(--accent); }
main { padding: 14px; max-width: 1180px; margin: 0 auto; }
.eyebrow { color: var(--accent-txt); font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; margin: 6px 2px 8px; }

.tabs {
  position: fixed; z-index: 6; left: 12px; right: 12px; bottom: calc(env(safe-area-inset-bottom) + 10px);
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 6px;
  background: var(--card); border: 1px solid var(--line); border-radius: 26px; box-shadow: 0 8px 28px rgba(14,33,63,.16);
}
.tabs button {
  height: 54px; border: 0; background: none; color: var(--muted); border-radius: 20px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11px; font-weight: 700;
}
.tabs button svg { width: 23px; height: 23px; }
.tabs button.ativo { color: var(--accent-txt); background: var(--card-2); }
.tabs .marca { display: none; }

@media (min-width: 900px) {
  .shell { padding-left: 240px; padding-bottom: 32px; }
  .tabs {
    left: 0; top: 0; bottom: 0; right: auto; width: 240px; border-radius: 0; border: 0; border-right: 1px solid var(--line);
    grid-template-columns: 1fr; align-content: start; padding: 0 14px; gap: 4px; box-shadow: none;
  }
  .tabs .marca { display: flex; gap: 10px; align-items: center; padding: 22px 8px 26px; }
  .tabs .marca img { width: 38px; height: 38px; flex: none; background: #0e213f; border-radius: 10px; padding: 5px; }
  .tabs .marca b { display: block; font-size: 14px; line-height: 1.2; color: var(--text); }
  .tabs .marca small { display: block; font-size: 11px; color: var(--muted); }
  .tabs button { flex-direction: row; justify-content: flex-start; gap: 12px; height: 46px; padding: 0 14px; font-size: 14px; border-radius: 12px; }
  .topo { padding-left: 24px; padding-right: 24px; }
  .topo .logo { display: none; }
  main { padding: 22px 24px; }
}

/* ---------- Cartões ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin-bottom: 14px; }
.card h2 { font-size: 15px; margin: 0 0 10px; font-weight: 800; }
.vazio { color: var(--muted); text-align: center; padding: 22px 10px; font-size: 14px; }
.duas-col { display: grid; gap: 14px; }
@media (min-width: 900px) { .duas-col { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); align-items: start; } .duas-col > .card { margin-bottom: 0; } }

/* ---------- Calendário ---------- */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); row-gap: 2px; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.cal .sem { text-align: center; font-size: 13px; font-weight: 700; color: var(--muted); padding: 2px 0 8px; }
.cal .dia { border: 0; background: none; padding: 4px 0 6px; min-height: 60px; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 5px; }
.cal .dia .n { width: 34px; height: 34px; line-height: 34px; border-radius: 50%; text-align: center; font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; }
.cal .dia.fora .n { color: var(--muted); opacity: .55; }
.cal .dia.hoje .n { background: var(--accent); color: #fff; }
.cal .dia.sel .n { background: var(--sel); color: var(--sel-txt); }
.cal .dia.hoje.sel .n { box-shadow: 0 0 0 3px var(--accent); }
.cal .pts { display: flex; gap: 4px; justify-content: center; flex-wrap: wrap; max-width: 46px; min-height: 8px; }
.cal .pts i { width: 8px; height: 8px; border-radius: 50%; display: block; }
.cal .rotulos { display: none; }
@media (min-width: 900px) {
  .cal .dia { min-height: 92px; align-items: stretch; padding: 4px; border-radius: 10px; }
  .cal .dia:hover { background: var(--card-2); }
  .cal .dia .n { align-self: center; width: 30px; height: 30px; line-height: 30px; font-size: 14px; }
  .cal .pts { display: none; }
  .cal .rotulos { display: flex; flex-direction: column; gap: 2px; }
  .cal .rotulos span { font-size: 10.5px; color: #fff; border-radius: 5px; padding: 1px 5px; text-align: left; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-weight: 600; }
}
.dica-swipe { text-align: center; font-size: 11px; color: var(--muted); margin-top: 4px; }
@media (min-width: 900px) { .dica-swipe { display: none; } }

/* ---------- Lista de compromissos ---------- */
.lista { display: flex; flex-direction: column; }
.item {
  display: grid; grid-template-columns: 6px minmax(0, 1fr) auto 14px; gap: 12px; align-items: center;
  padding: 12px 0; border: 0; border-bottom: 1px solid var(--line); background: none; width: 100%; text-align: left;
}
.item:last-child { border-bottom: 0; }
.item .faixa { align-self: stretch; border-radius: 4px; min-height: 44px; }
.item .hr { font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.item .tit { font-weight: 700; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; align-items: center; gap: 6px; }
.item .tit svg { width: 15px; height: 15px; flex: none; color: var(--muted); }
.item .sub { font-size: 14px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .dir { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; }
.item .valor { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.item .seta { color: var(--muted); font-size: 20px; }
.item.com-check { grid-template-columns: 26px 6px minmax(0, 1fr) auto; }
.check { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; color: #fff; font-size: 14px; }
.check.on { background: var(--accent); border-color: var(--accent); }
.dia-cab { font-size: 18px; font-weight: 800; padding: 18px 0 2px; }
.dia-cab small { font-size: 13px; color: var(--muted); font-weight: 600; margin-left: 6px; }

.pill { font-size: 12px; font-weight: 800; letter-spacing: .03em; padding: 4px 10px; border-radius: 8px; white-space: nowrap; }
.pill.pago { background: var(--ok); color: #fff; }
.pill.pendente { background: var(--bad); color: #fff; }
.pill.parcial { background: var(--accent); color: #fff; }

/* ---------- Detalhes ---------- */
.det-tit { display: grid; grid-template-columns: 6px 1fr; gap: 14px; align-items: stretch; margin: 6px 0 18px; }
.det-tit .faixa { border-radius: 4px; }
.det-tit h2 { margin: 0; font-size: 26px; line-height: 1.2; font-weight: 800; }
.det-tit .tipo { font-size: 12px; color: var(--accent-txt); font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.linha-info { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--line); }
.linha-info:last-child { border-bottom: 0; }
.linha-info svg { width: 22px; height: 22px; color: var(--muted); flex: none; margin-top: 1px; }
.linha-info b { display: block; font-size: 17px; }
.linha-info span { color: var(--muted); font-size: 14px; display: block; }
.parte { padding: 14px 0; border-bottom: 1px solid var(--line); }
.parte:last-child { border-bottom: 0; }
.parte .lin { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.parte .rot { font-size: 16px; font-weight: 600; }
.parte .num { font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; }
.parte .mini { font-size: 13px; color: var(--muted); margin-top: 2px; }
.parte .lin + .lin { margin-top: 10px; }
.total-linha { display: flex; justify-content: space-between; font-weight: 800; font-size: 18px; padding-top: 14px; }
.excluir-txt { display: block; margin: 22px auto 8px; background: none; border: 0; color: var(--bad); font-size: 17px; font-weight: 600; }

/* Interruptor */
.switch { position: relative; width: 56px; height: 32px; flex: none; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--card-2); border: 1px solid var(--line); transition: background .2s; }
.switch span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s; }
.switch input:checked + span { background: var(--ok); border-color: var(--ok); }
.switch input:checked + span::after { transform: translateX(24px); }

/* ---------- Pagamentos ---------- */
.segmento { display: flex; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.14); border-radius: 999px; padding: 3px; }
.segmento button { border: 0; background: none; color: rgba(255,255,255,.8); border-radius: 999px; height: 32px; padding: 0 12px; font-size: 13px; font-weight: 700; white-space: nowrap; }
.segmento button.ativo { background: #fff; color: var(--navy); }
.mesnav { display: flex; align-items: center; justify-content: space-between; margin: 4px 2px 12px; }
.mesnav h2 { margin: 0; font-size: 26px; font-weight: 800; }
.mesnav div { display: flex; gap: 4px; }
.mesnav button { border: 0; background: none; color: var(--accent-txt); font-size: 30px; line-height: 1; padding: 0 10px; }
.resumo-pag .topo-res { display: flex; justify-content: space-between; color: var(--muted); font-size: 16px; font-weight: 600; background: none; border: 0; width: 100%; padding: 0; text-align: left; }
.barra { display: flex; align-items: center; gap: 12px; margin: 14px 0 16px; }
.barra .trilho { flex: 1; height: 6px; border-radius: 3px; background: var(--card-2); overflow: hidden; }
.barra .trilho i { display: block; height: 100%; background: var(--ok); border-radius: 3px; }
.barra small { color: var(--muted); font-weight: 700; font-size: 14px; }
.tot { display: flex; justify-content: space-between; font-size: 19px; font-weight: 800; margin: 6px 0; font-variant-numeric: tabular-nums; }
.tot .rosa { color: var(--bad); }
.tot .verde { color: var(--ok); }
.media { color: var(--muted); font-size: 14px; margin-top: 10px; display: flex; gap: 8px; align-items: center; }
.media svg { width: 18px; height: 18px; }
.porlocal { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 6px; }
.porlocal .lin { display: grid; grid-template-columns: 12px 1fr auto; gap: 10px; align-items: center; padding: 8px 0; font-size: 14px; }
.porlocal .lin b { font-variant-numeric: tabular-nums; }
.porlocal .lin small { grid-column: 2 / -1; color: var(--muted); margin-top: -6px; }
.bolinha { width: 12px; height: 12px; border-radius: 50%; display: inline-block; flex: none; }
.barra-acao {
  position: fixed; z-index: 8; left: 12px; right: 12px; bottom: calc(env(safe-area-inset-bottom) + 86px);
  display: flex; gap: 8px; background: var(--navy); color: #fff; border-radius: 18px; padding: 10px; align-items: center; box-shadow: 0 8px 28px rgba(0,0,0,.25);
}
.barra-acao span { flex: 1; font-weight: 700; padding-left: 6px; }
@media (min-width: 900px) { .barra-acao { left: 260px; right: 24px; bottom: 24px; } }
.filtro-ativo { font-size: 13px; color: var(--muted); margin: -4px 2px 10px; }
.filtro-ativo button { background: none; border: 0; color: var(--accent-txt); font-weight: 700; }

/* ---------- Formulários ---------- */
.modal { position: fixed; inset: 0; z-index: 20; background: rgba(5, 12, 24, .5); display: flex; align-items: flex-end; justify-content: center; }
.escolha { z-index: 25; }
.folha {
  background: var(--bg); width: 100%; max-width: 640px; max-height: 100%; height: 100%; overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: calc(env(safe-area-inset-top) + 12px) 14px calc(env(safe-area-inset-bottom) + 24px);
}
@media (min-width: 700px) { .modal { align-items: center; } .folha { height: auto; max-height: 92vh; border-radius: 22px; padding-top: 14px; } }
.folha-topo { display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 10px; margin-bottom: 14px; position: sticky; top: calc(-12px - env(safe-area-inset-top)); background: var(--bg); padding: 6px 0; z-index: 2; }
.folha-topo h3 { margin: 0; text-align: center; font-size: 18px; font-weight: 800; }
.btn-x { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: var(--card); font-size: 22px; line-height: 1; padding: 0; }
.btn-salvar { height: 44px; border-radius: 999px; border: 0; background: var(--accent); color: #fff; font-weight: 800; padding: 0 18px; font-size: 15px; }
.btn-salvar:disabled { opacity: .6; }
.grupo { background: var(--card); border: 1px solid var(--line); border-radius: 18px; margin-bottom: 12px; overflow: hidden; }
.grupo .cel { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 6px 16px; border-bottom: 1px solid var(--line); }
.grupo .cel:last-child { border-bottom: 0; }
.grupo .cel > label:not(.switch), .grupo .cel > span.r { flex: 1; font-size: 16px; font-weight: 500; }
.grupo .cel > label:not(.switch) { white-space: nowrap; }
.grupo .cel input[type=date] { font-size: 15px; }
.grupo .cel input:not([type=checkbox]):not([type=radio]), .grupo .cel select {
  border: 0; background: transparent; text-align: right; font-size: 16px; min-width: 0; flex: 1.2; padding: 8px 0; outline: none; color: var(--text);
}
.grupo .cel input[type=date], .grupo .cel input[type=time] { flex: none; text-align: right; }
.grupo .cel select { direction: rtl; }
.grupo .cel select option { direction: ltr; }
.grupo .cel.full input { text-align: left; font-size: 17px; font-weight: 600; flex: 1; }
.grupo textarea { width: 100%; border: 0; background: transparent; min-height: 90px; padding: 14px 16px; font-size: 16px; resize: vertical; outline: none; }
.grupo .cel .sufixo { color: var(--muted); font-size: 15px; }
.nota { font-size: 13px; color: var(--muted); margin: -4px 8px 12px; }
.cab-grupo { font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--accent-txt); margin: 16px 8px 6px; }
.tipos { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.tipos::-webkit-scrollbar { display: none; }
.tipos label { position: relative; }
.tipos input { position: absolute; opacity: 0; pointer-events: none; }
.tipos span { display: block; padding: 9px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); font-size: 14px; font-weight: 700; white-space: nowrap; }
.tipos input:checked + span { background: var(--navy); border-color: var(--navy); color: #fff; }
@media (prefers-color-scheme: dark) { :root:not([data-tema="claro"]) .tipos input:checked + span { background: #fff; color: var(--navy); } }
:root[data-tema="escuro"] .tipos input:checked + span { background: #fff; color: var(--navy); }
.cores { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; flex: 1; }
.cores button { width: 26px; height: 26px; border-radius: 50%; border: 2px solid transparent; padding: 0; }
.cores button.on { border-color: var(--text); box-shadow: inset 0 0 0 2px var(--card); }
.cores.travado { opacity: .35; pointer-events: none; }
.chips-pct { display: flex; gap: 6px; }
.chips-pct button { border: 1px solid var(--line); background: var(--card-2); border-radius: 999px; padding: 6px 12px; font-weight: 700; font-size: 14px; }
.chips-pct button.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.rapidos { display: flex; gap: 6px; flex-wrap: wrap; margin: -4px 4px 12px; }
.rapidos button { border: 1px dashed var(--line); background: var(--card); border-radius: 999px; padding: 7px 12px; font-size: 13px; font-weight: 700; color: var(--accent-txt); }
.calc { color: var(--muted); font-size: 14px; }
.calc b { color: var(--text); }

/* Folha de escolha (ações) */
.opcoes { background: var(--card); width: 100%; max-width: 460px; border-radius: 22px 22px 0 0; padding: 18px 14px calc(env(safe-area-inset-bottom) + 18px); }
@media (min-width: 700px) { .opcoes { border-radius: 22px; } }
.opcoes h4 { margin: 0 0 4px; text-align: center; font-size: 17px; }
.opcoes p { margin: 0 0 14px; text-align: center; color: var(--muted); font-size: 14px; }
.opcoes button { display: block; width: 100%; border: 0; border-radius: 14px; background: var(--card-2); padding: 15px; font-size: 16px; font-weight: 700; margin-bottom: 8px; }
.opcoes button.perigo { color: var(--bad); }
.opcoes button.pri { background: var(--accent); color: #fff; }
.opcoes button.cancelar { background: none; color: var(--muted); }
.opcoes .grupo { text-align: left; }

/* ---------- Login ---------- */
.login { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px 16px; background: var(--navy); color: #fff; }
.login img { width: 84px; margin-bottom: 14px; }
.login .nome { font-size: 20px; font-weight: 800; text-align: center; }
.login .esp { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: #f39a55; font-weight: 700; margin: 4px 0 26px; text-align: center; }
.login form { width: 100%; max-width: 380px; background: var(--card); color: var(--text); border-radius: 22px; padding: 22px; }
.login label { display: block; font-size: 13px; font-weight: 700; color: var(--muted); margin-bottom: 12px; }
.login input { display: block; width: 100%; margin-top: 6px; font-size: 16px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); }
.login .btn-salvar { width: 100%; margin-top: 6px; height: 50px; }
.erro { background: var(--bad-bg); color: var(--bad); border-radius: 12px; padding: 10px 12px; font-size: 13px; margin-bottom: 12px; }
.aviso { background: #fff3e6; color: #9a4a0e; border-radius: 12px; padding: 10px 12px; font-size: 13px; margin-bottom: 12px; }

/* ---------- Locais / Ajustes ---------- */
.local-item { display: grid; grid-template-columns: 16px 1fr 14px; gap: 12px; align-items: center; padding: 14px 0; border: 0; border-bottom: 1px solid var(--line); width: 100%; background: none; text-align: left; }
.local-item:last-child { border-bottom: 0; }
.local-item b { display: block; font-size: 16px; }
.local-item small { color: var(--muted); font-size: 13px; }
.inativo { opacity: .5; }
.perfil { display: flex; gap: 14px; align-items: center; }
.perfil img { width: 54px; height: 54px; border-radius: 16px; background: var(--navy); padding: 8px; }
.perfil b { display: block; font-size: 17px; }
.perfil small { color: var(--muted); }
.acao-lista button { display: flex; justify-content: space-between; width: 100%; background: none; border: 0; border-bottom: 1px solid var(--line); padding: 15px 0; font-size: 16px; font-weight: 600; text-align: left; }
.acao-lista button:last-child { border-bottom: 0; }
.acao-lista button.perigo { color: var(--bad); }

.toast {
  position: fixed; left: 50%; transform: translateX(-50%); z-index: 40;
  bottom: calc(var(--tab-h) + env(safe-area-inset-bottom) + 34px);
  background: var(--navy); color: #fff; padding: 11px 18px; border-radius: 14px; font-size: 14px; font-weight: 700;
  box-shadow: 0 8px 24px rgba(0,0,0,.25); max-width: 90vw; text-align: center;
}
.seg-tema { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; background: var(--card-2); border-radius: 14px; padding: 4px; }
.seg-tema button { border: 0; background: none; border-radius: 10px; padding: 10px 4px; font-weight: 700; font-size: 14px; color: var(--muted); }
.seg-tema button.ativo { background: var(--card); color: var(--text); box-shadow: var(--shadow); }

/* ---------- Faturamento (Neurotech) ---------- */
.filtros { display: flex; gap: 6px; overflow-x: auto; margin: 0 -14px 10px; padding: 0 14px 2px; scrollbar-width: none; }
.filtros::-webkit-scrollbar { display: none; }
.filtros button { flex: none; border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 8px 14px; font-size: 14px; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.filtros button.on { background: var(--navy); border-color: var(--navy); color: #fff; }
@media (prefers-color-scheme: dark) { :root:not([data-tema="claro"]) .filtros button.on { background: #fff; color: var(--navy); } }
:root[data-tema="escuro"] .filtros button.on { background: #fff; color: var(--navy); }
.seg-claro { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; background: var(--card-2); border-radius: 14px; padding: 4px; margin-bottom: 10px; }
.seg-claro button { border: 0; background: none; border-radius: 10px; padding: 9px 4px; font-weight: 700; font-size: 14px; color: var(--muted); }
.seg-claro button.ativo { background: var(--card); color: var(--text); box-shadow: var(--shadow); }
.busca { width: 100%; border: 1px solid var(--line); background: var(--card); border-radius: 14px; padding: 11px 14px; font-size: 16px; margin-bottom: 10px; outline: none; }
.resumo-filtro { display: flex; justify-content: space-between; font-size: 14px; color: var(--muted); font-weight: 600; margin: 0 4px 6px; }
.resumo-filtro b { color: var(--text); font-variant-numeric: tabular-nums; }
.clip { font-size: 12px; color: var(--muted); display: inline-flex; align-items: center; gap: 2px; font-weight: 700; }
.clip svg { width: 13px; height: 13px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 14px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; }
.kpi small { display: block; color: var(--muted); font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.kpi b { display: block; font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; margin-top: 4px; }
.kpi span { color: var(--muted); font-size: 13px; }
.kpi.alerta b { color: var(--bad); }
.kpi.bom b { color: var(--ok); }
.tabela-wrap { overflow-x: auto; margin: 0 -16px; padding: 0 16px; }
.tabela { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.tabela th { text-align: right; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 800; padding: 6px 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tabela th:first-child, .tabela td:first-child { text-align: left; padding-left: 0; }
.tabela td { text-align: right; padding: 10px 6px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tabela tr:last-child td { border-bottom: 0; }
.tabela tr.clicavel { cursor: pointer; }
.tabela tr.clicavel:hover td { background: var(--card-2); }
.tabela tfoot td { font-weight: 800; border-top: 2px solid var(--line); }
.tabela .pend { color: var(--bad); font-weight: 700; }
.tabela .ok { color: var(--ok); font-weight: 700; }
.tabela .zero { color: var(--muted); font-weight: 400; }
.anexo-slot { padding: 12px 0; border-bottom: 1px solid var(--line); }
.anexo-slot:last-child { border-bottom: 0; }
.anexo-slot .cab { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.anexo-slot .cab b { font-size: 15px; }
.anexo-slot .cab small { color: var(--muted); font-size: 12px; font-weight: 600; }
.btn-anexar { position: relative; overflow: hidden; border: 1px dashed var(--accent); color: var(--accent-txt); background: none; border-radius: 999px; padding: 7px 14px; font-size: 13px; font-weight: 800; white-space: nowrap; cursor: pointer; }
.btn-anexar input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.arquivo { display: flex; align-items: center; gap: 10px; margin-top: 8px; background: var(--card-2); border-radius: 12px; padding: 8px 10px; }
.arquivo button.abrir { flex: 1; min-width: 0; border: 0; background: none; text-align: left; padding: 0; font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--accent-txt); }
.arquivo small { color: var(--muted); font-size: 12px; white-space: nowrap; }
.arquivo button.tirar { border: 0; background: none; color: var(--bad); font-size: 20px; line-height: 1; padding: 0 4px; }
.status-pag { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 4px 0; }
.status-pag b { font-size: 17px; }
.status-pag input[type=date] { border: 1px solid var(--line); background: var(--card-2); border-radius: 10px; padding: 7px 10px; font-size: 15px; }
.botoes-linha { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin: 18px 0 8px; }
.botoes-linha button { border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 10px 18px; font-size: 15px; font-weight: 700; }
.botoes-linha button.perigo { color: var(--bad); }
.tag { font-size: 12px; font-weight: 800; padding: 4px 9px; border-radius: 8px; white-space: nowrap; }
.tag.familia { background: var(--ok-bg); color: var(--ok); }
.tag.clinica { background: #fff3e6; color: #9a4a0e; }
.tag.aguarda { background: var(--bad-bg); color: var(--bad); }
@media (prefers-color-scheme: dark) { :root:not([data-tema="claro"]) .tag.clinica, :root:not([data-tema="claro"]) .aviso { background: #3a2412; color: #f6b27a; } }
:root[data-tema="escuro"] .tag.clinica, :root[data-tema="escuro"] .aviso { background: #3a2412; color: #f6b27a; }
.sal-linha { display: flex; justify-content: space-between; padding: 9px 0; font-size: 16px; font-variant-numeric: tabular-nums; }
.sal-linha span { color: var(--muted); }
.sal-linha.total { border-top: 2px solid var(--line); margin-top: 4px; padding-top: 12px; font-size: 20px; font-weight: 800; }
.sal-linha.total span { color: var(--text); }
.travado-txt { font-size: 12px; color: var(--muted); }
.item.instr { grid-template-columns: 6px minmax(0, 1fr) auto 14px; }
