/* Alba · painel de gestão — limpo, letra grande, alto contraste */
:root {
  --azul: #1d4ed8; --azul-escuro: #1e3a8a; --azul-claro: #e8efff;
  --texto: #111827; --texto-2: #374151; --cinza: #6b7280; --borda: #cbd5e1; --fundo: #f3f6fb; --branco: #fff;
  --verde: #166534; --verde-claro: #dcfce7; --vermelho: #b91c1c; --vermelho-claro: #fee2e2;
  --amarelo: #92400e; --amarelo-claro: #fef3c7; --roxo: #6b21a8; --roxo-claro: #f3e8ff;
  --raio: 8px; --sombra: 0 1px 3px rgba(15, 23, 42, .12);
}
* { box-sizing: border-box; }
html { font-size: 16px; }
body { margin: 0; font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif; color: var(--texto); background: var(--fundo); line-height: 1.45; }
h1 { font-size: 1.6rem; margin: 0 0 1rem; color: var(--azul-escuro); }
h2 { font-size: 1.25rem; margin: 1.4rem 0 .7rem; color: var(--azul-escuro); }
h3 { font-size: 1.08rem; margin: 1rem 0 .5rem; }
a { color: var(--azul); }
[hidden] { display: none !important; }
small { color: var(--cinza); }

#faixa-teste { background: #fde68a; color: #78350f; text-align: center; font-weight: 700; font-size: .85rem; padding: 3px; letter-spacing: .03em; }
#faixa-teste.faixa-producao { background: #dcfce7; color: #14532d; }

/* entrada */
.tela-login { min-height: calc(100vh - 24px); display: grid; place-items: center; padding: 16px; }
.cartao-login { background: var(--branco); padding: 2rem; border-radius: 12px; box-shadow: var(--sombra); width: 100%; max-width: 400px; }
.cartao-login h1 { font-size: 2.2rem; margin: 0; }
.subtitulo { margin: 0 0 1.5rem; color: var(--cinza); }
.erro-login { color: var(--vermelho); font-weight: 600; min-height: 1.4em; }

/* estrutura */
.painel { display: grid; grid-template-columns: 220px 1fr; min-height: calc(100vh - 24px); }
.menu { background: var(--azul-escuro); color: #fff; display: flex; flex-direction: column; padding: 1rem .75rem; position: sticky; top: 0; height: calc(100vh - 24px); }
.marca { font-size: 1.6rem; font-weight: 700; padding: 0 .5rem 1rem; }
.marca small { display: block; font-size: .85rem; font-weight: 400; color: #c7d2fe; }
.menu nav { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.menu nav a { color: #e0e7ff; text-decoration: none; padding: .45rem .75rem; border-radius: var(--raio); font-size: 1rem; }
.menu-grupo { display: block; margin: .7rem .75rem .15rem; font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #a5b4fc; }
.menu nav a:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.menu nav a.ativo { background: #fff; color: var(--azul-escuro); font-weight: 700; }
.menu-rodape { margin-top: auto; padding-top: 1rem; font-size: .88rem; color: #c7d2fe; }
.menu-rodape .btn { width: 100%; margin-top: .5rem; }
.quem { word-break: break-all; }
.quem strong { color: #fff; }
.conteudo { padding: 1.5rem 2rem 4rem; min-width: 0; outline: none; }

/* botões */
.btn { font: inherit; font-size: 1rem; border-radius: var(--raio); padding: .55rem 1rem; border: 2px solid transparent; cursor: pointer; font-weight: 600; line-height: 1.2; }
.btn:disabled { opacity: .55; cursor: wait; }
.btn.primario { background: var(--azul); color: #fff; }
.btn.primario:hover { background: var(--azul-escuro); }
.btn.secundario { background: #fff; color: var(--azul-escuro); border-color: var(--borda); }
.btn.secundario:hover { border-color: var(--azul); }
.btn.perigo { background: #fff; color: var(--vermelho); border-color: #fca5a5; }
.btn.perigo:hover { background: var(--vermelho-claro); }
.btn.sucesso { background: var(--verde); color: #fff; }
.btn.pequeno { padding: .3rem .6rem; font-size: .9rem; }
.btn.grande { width: 100%; padding: .8rem; font-size: 1.1rem; }
.link { background: none; border: 0; color: var(--azul); text-decoration: underline; cursor: pointer; font: inherit; padding: .2rem 0; }
.btn-fechar { background: none; border: 0; font-size: 2rem; line-height: 1; cursor: pointer; color: var(--cinza); }
.acoes { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
td.acoes { display: table-cell; min-width: 13.5rem; }
td.acoes > .btn, td.acoes > a.btn { margin: .15rem .3rem .15rem 0; }
#fin-abas { margin-bottom: 1rem; border-bottom: 2px solid var(--borda); }
.abas-mini button.ativa { background: var(--azul-claro); border-radius: var(--raio) var(--raio) 0 0; }
.cabecalho { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.cabecalho h1 { margin: 0; }

/* formulários */
.campo { display: flex; flex-direction: column; gap: .25rem; margin-bottom: .8rem; flex: 1; min-width: 140px; }
.campo label, .rotulo { font-weight: 600; color: var(--texto-2); font-size: .95rem; }
input, select, textarea { font: inherit; font-size: 1rem; padding: .5rem .6rem; border: 2px solid var(--borda); border-radius: var(--raio); background: #fff; color: var(--texto); width: 100%; }
input:focus, select:focus, textarea:focus, .btn:focus-visible, a:focus-visible { outline: 3px solid #93c5fd; outline-offset: 1px; border-color: var(--azul); }
textarea { min-height: 90px; resize: vertical; }
.linha { display: flex; gap: .8rem; flex-wrap: wrap; }
.dica { color: var(--cinza); font-size: .92rem; margin: .2rem 0 .6rem; }
.filtros { display: flex; flex-wrap: wrap; gap: .6rem; align-items: flex-end; margin-bottom: 1rem; background: #fff; padding: .8rem; border-radius: var(--raio); box-shadow: var(--sombra); }
.filtros .campo { margin: 0; flex: 0 1 auto; }
.check { display: flex; align-items: center; gap: .4rem; font-weight: 500; }
.check input { width: auto; }
.faces { display: flex; gap: .3rem; flex-wrap: wrap; }
.faces label { border: 2px solid var(--borda); border-radius: 6px; padding: .2rem .5rem; cursor: pointer; font-weight: 700; }
.faces input { display: none; }
.faces label:has(input:checked) { background: var(--azul); color: #fff; border-color: var(--azul); }

/* cartões */
.cartoes { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.cartao { background: #fff; border-radius: 10px; padding: 1rem 1.2rem; box-shadow: var(--sombra); border-left: 6px solid var(--azul); }
.cartao .rotulo { display: block; margin-bottom: .3rem; }
.cartao .valor { font-size: 1.8rem; font-weight: 700; color: var(--texto); }
.cartao .det { color: var(--cinza); font-size: .9rem; }
.cartao.alerta { border-left-color: var(--vermelho); }
.cartao.verde { border-left-color: var(--verde); }
.cartao.roxo { border-left-color: var(--roxo); }
.cartao.funil { border-left-color: #0e7490; }
.sem-dado { color: var(--cinza); font-style: italic; font-weight: 500; font-size: 1rem; }
.cartao .valor .sem-dado { font-size: 1.2rem; }
.bloco { background: #fff; border-radius: 10px; padding: 1rem 1.2rem; box-shadow: var(--sombra); margin-bottom: 1.2rem; }
.bloco > h2:first-child, .bloco > h3:first-child { margin-top: 0; }
.aviso-simulado { background: var(--amarelo-claro); color: var(--amarelo); border: 2px solid #fcd34d; padding: .7rem 1rem; border-radius: var(--raio); font-weight: 600; margin-bottom: 1rem; }

/* tabelas */
.tabela-caixa { overflow-x: auto; background: #fff; border-radius: 10px; box-shadow: var(--sombra); }
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: .6rem .75rem; border-bottom: 1px solid #e5e7eb; vertical-align: middle; }
th { background: #f1f5f9; font-size: .9rem; color: var(--texto-2); white-space: nowrap; }
tr.clicavel { cursor: pointer; }
tr.clicavel:hover td { background: var(--azul-claro); }
td.num, th.num { text-align: right; white-space: nowrap; }
tfoot td { font-weight: 700; background: #f8fafc; }
.riscado td { color: var(--cinza); text-decoration: line-through; }

.selo { display: inline-block; padding: .12rem .55rem; border-radius: 999px; font-size: .85rem; font-weight: 700; white-space: nowrap; }
.selo-azul { background: var(--azul-claro); color: var(--azul-escuro); }
.selo-verde { background: var(--verde-claro); color: var(--verde); }
.selo-vermelho { background: var(--vermelho-claro); color: var(--vermelho); }
.selo-amarelo { background: var(--amarelo-claro); color: var(--amarelo); }
.selo-cinza { background: #e5e7eb; color: #374151; }
.selo-roxo { background: var(--roxo-claro); color: var(--roxo); }

/* abas */
.abas { display: flex; gap: .3rem; border-bottom: 2px solid var(--borda); margin-bottom: 1rem; flex-wrap: wrap; }
.abas button { font: inherit; font-size: 1rem; font-weight: 600; background: none; border: 0; padding: .6rem 1rem; cursor: pointer; color: var(--texto-2); border-bottom: 4px solid transparent; margin-bottom: -2px; }
.abas button.ativa { color: var(--azul); border-bottom-color: var(--azul); }

/* janela */
.janela-fundo { position: fixed; inset: 0; background: rgba(15, 23, 42, .55); display: grid; place-items: center; z-index: 50; padding: 16px; }
.janela { background: #fff; border-radius: 12px; width: 100%; max-width: 560px; max-height: calc(100vh - 32px); display: flex; flex-direction: column; box-shadow: 0 10px 40px rgba(0, 0, 0, .3); }
.janela.larga { max-width: 900px; }
.janela-topo { display: flex; justify-content: space-between; align-items: center; padding: .8rem 1.2rem; border-bottom: 1px solid #e5e7eb; }
.janela-topo h2 { margin: 0; }
.janela-corpo { padding: 1rem 1.2rem; overflow-y: auto; }
.janela-rodape { display: flex; gap: .5rem; justify-content: flex-end; padding: .8rem 1.2rem; border-top: 1px solid #e5e7eb; flex-wrap: wrap; }

/* busca de paciente */
.campo-paciente .resultados { display: flex; flex-direction: column; max-height: 230px; overflow-y: auto; }
.resultado { text-align: left; background: #fff; border: 1px solid #e5e7eb; border-top: 0; padding: .5rem .6rem; cursor: pointer; font: inherit; }
.resultado:first-child { border-top: 1px solid #e5e7eb; }
.resultado:hover, .resultado:focus { background: var(--azul-claro); }
.paciente-escolhido { padding: .5rem .6rem; background: var(--azul-claro); border-radius: var(--raio); }

/* avisos */
.avisos { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: .5rem; z-index: 100; max-width: 420px; }
.aviso { padding: .8rem 1rem; border-radius: var(--raio); box-shadow: 0 4px 14px rgba(0, 0, 0, .2); font-weight: 600; }
.aviso-ok { background: var(--verde); color: #fff; }
.aviso-erro { background: var(--vermelho); color: #fff; }
.aviso-info { background: var(--azul-escuro); color: #fff; }
.carregando, .vazio { color: var(--cinza); padding: 1rem 0; }
.caixa-erro { background: var(--vermelho-claro); color: var(--vermelho); padding: 1rem; border-radius: var(--raio); font-weight: 600; }

/* agenda */
.agenda-dia { display: grid; background: #fff; border-radius: 10px; box-shadow: var(--sombra); overflow-x: auto; }
.agenda-cab { position: sticky; top: 0; background: #f1f5f9; font-weight: 700; padding: .5rem; text-align: center; border-bottom: 2px solid var(--borda); z-index: 2; }
.agenda-horas { position: relative; border-right: 1px solid #e5e7eb; }
.agenda-hora { position: absolute; left: 0; right: 0; font-size: .85rem; color: var(--cinza); padding: 0 .4rem; text-align: right; transform: translateY(-.6em); }
.agenda-col { position: relative; border-right: 1px solid #e5e7eb; min-width: 200px; }
.agenda-slot { position: absolute; left: 0; right: 0; border-top: 1px solid #f1f5f9; cursor: pointer; }
.agenda-slot.cheia { border-top-color: #e2e8f0; }
.agenda-slot:hover { background: var(--azul-claro); }
.consulta { position: absolute; left: 4px; right: 4px; border-radius: 6px; padding: .2rem .45rem; font-size: .88rem; overflow: hidden; cursor: pointer; border-left: 5px solid; box-shadow: 0 1px 2px rgba(0, 0, 0, .15); line-height: 1.25; z-index: 1; }
.consulta strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.consulta.st-cancelado, .consulta.st-remarcado, .consulta.st-expirada { opacity: .5; text-decoration: line-through; }
.consulta.st-faltou { background-image: repeating-linear-gradient(45deg, transparent 0 6px, rgba(185, 28, 28, .12) 6px 12px); }
.consulta.st-bloqueio { background: repeating-linear-gradient(45deg, #e5e7eb 0 8px, #f3f4f6 8px 16px) !important; color: #374151; }
.agenda-semana { display: grid; grid-template-columns: repeat(7, minmax(140px, 1fr)); gap: .5rem; overflow-x: auto; }
.dia-semana { background: #fff; border-radius: 10px; box-shadow: var(--sombra); min-height: 260px; display: flex; flex-direction: column; }
.dia-semana.hoje { outline: 3px solid var(--azul); }
.dia-semana h3 { margin: 0; padding: .5rem; background: #f1f5f9; border-radius: 10px 10px 0 0; font-size: .98rem; text-align: center; cursor: pointer; }
.dia-semana .lista { padding: .4rem; display: flex; flex-direction: column; gap: .3rem; flex: 1; }
.dia-semana .consulta { position: static; }
.dia-semana .novo { margin: .4rem; }
.legenda { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: .8rem; font-size: .92rem; }
.legenda span::before { content: ""; display: inline-block; width: 12px; height: 12px; border-radius: 3px; background: var(--c); margin-right: .35rem; vertical-align: -1px; }

/* odontograma */
.odonto { display: flex; flex-direction: column; gap: .8rem; align-items: center; }
.arcada { display: flex; gap: 1.2rem; flex-wrap: wrap; justify-content: center; }
.quadrante { display: flex; gap: 4px; }
.dente { width: 46px; height: 58px; border: 2px solid var(--borda); border-radius: 8px 8px 14px 14px; background: #fff; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: space-between; padding: 3px 0; font: inherit; font-size: .85rem; font-weight: 700; }
.dente .est { font-size: .65rem; font-weight: 600; text-transform: uppercase; }
.dente:hover { border-color: var(--azul); }
.legenda-odonto { display: flex; flex-wrap: wrap; gap: .4rem; justify-content: center; font-size: .85rem; }
.legenda-odonto span { padding: .1rem .5rem; border-radius: 4px; border: 1px solid var(--borda); }

/* evolução */
.evolucao { border: 1px solid #e5e7eb; border-radius: var(--raio); padding: .8rem 1rem; margin-bottom: .7rem; background: #fff; }
.evolucao.assinada { border-left: 6px solid var(--verde); }
.evolucao.rascunho { border-left: 6px solid var(--amarelo); }
.evolucao .cab { display: flex; justify-content: space-between; gap: .5rem; flex-wrap: wrap; font-size: .92rem; color: var(--texto-2); margin-bottom: .4rem; }
.evolucao .texto { white-space: pre-wrap; }
.evolucao.adendo { margin-left: 2rem; }
.alertas-clinicos { display: flex; gap: .4rem; flex-wrap: wrap; margin: .3rem 0 .8rem; }

.barra { height: 14px; background: var(--azul); border-radius: 4px; min-width: 2px; }
.resumo-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; }
.cod { font-family: Consolas, "Courier New", monospace; font-size: .95rem; word-break: break-all; }

/* bloco 2: seletor de clínica, fluxo, resultado, documentos */
.seletor-clinica { padding: 0 .5rem 1rem; }
.seletor-clinica label { display: block; font-size: .85rem; color: #c7d2fe; margin-bottom: .2rem; }
.seletor-clinica select { font-size: .92rem; padding: .35rem .4rem; }
.negativo { color: var(--vermelho); font-weight: 700; }
tr.grupo th { background: var(--azul-claro); color: var(--azul-escuro); font-size: 1rem; }
tr.subgrupo td { font-weight: 700; background: #f8fafc; }
tr.subtotal td { font-weight: 700; border-top: 2px solid var(--borda); }
.bolinha { display: inline-block; width: 18px; height: 18px; border-radius: 50%; border: 1px solid var(--borda); vertical-align: middle; }
.aviso-juridico { background: var(--vermelho-claro); color: var(--vermelho); border: 2px solid #fca5a5; padding: .7rem 1rem; border-radius: var(--raio); font-weight: 700; margin-bottom: 1rem; }
.variaveis { display: flex; flex-wrap: wrap; gap: .3rem; margin: .5rem 0; }
.var { font-family: Consolas, "Courier New", monospace; font-size: .85rem; background: #fff; border: 1px solid var(--borda); border-radius: 6px; padding: .2rem .45rem; cursor: pointer; }
.var:hover { border-color: var(--azul); background: var(--azul-claro); }
.doc-texto { white-space: pre-wrap; background: #f8fafc; padding: .8rem; border-radius: var(--raio); font-family: inherit; max-height: 260px; overflow: auto; }
.alterna { display: flex; gap: .4rem; }
details summary { cursor: pointer; font-weight: 600; margin: .6rem 0; }

@media (max-width: 900px) {
  .painel { grid-template-columns: 1fr; }
  .menu { position: sticky; top: 0; height: auto; z-index: 30; padding: .5rem .75rem; }
  .menu .marca { display: flex; align-items: center; justify-content: space-between; padding: 0; font-size: 1.3rem; }
  .btn-menu { display: inline-flex !important; }
  /* tablet/celular: só a marca, a busca e o botão Menu ficam à mostra; o resto abre no botão */
  .menu:not(.aberto) #seletor-clinica, .menu:not(.aberto) nav, .menu:not(.aberto) .menu-rodape { display: none; }
  .menu.aberto { max-height: 100vh; overflow-y: auto; }
  .menu nav { flex-direction: column; }
  #menu-busca .btn-busca { margin: .4rem 0 0; }
  .conteudo { padding: 1rem; }
}
.btn-menu { display: none; align-items: center; gap: .4rem; min-height: 2.4rem; padding: .3rem .8rem; border-radius: var(--raio); border: 1px solid rgba(255,255,255,.4);
  background: transparent; color: #fff; font: inherit; font-size: 1rem; font-weight: 600; cursor: pointer; }

/* ---------- gráficos ---------- */
.graf { position: relative; }
.graf svg { display: block; overflow: visible; }
.graf-dica { position: absolute; pointer-events: none; background: #111827; color: #fff; padding: .45rem .65rem; border-radius: 6px; font-size: .9rem; line-height: 1.35; white-space: nowrap; box-shadow: 0 4px 12px rgba(0,0,0,.2); z-index: 5; }
.graf-ponto { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: .4rem; vertical-align: middle; }
.graf-legenda { display: flex; gap: 1.2rem; flex-wrap: wrap; color: var(--texto-2); font-size: .95rem; margin: .2rem 0 .6rem; }
.graf-h { display: flex; flex-direction: column; gap: .55rem; }
.graf-h-linha { display: grid; grid-template-columns: minmax(120px, 220px) 1fr auto; gap: .8rem; align-items: center; }
.graf-h-nome { color: var(--texto-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.graf-h-trilho { background: #f1f5f9; border-radius: 4px; height: 14px; overflow: hidden; }
.graf-h-barra { display: block; height: 100%; background: #2a78d6; border-radius: 0 4px 4px 0; }
.graf-h-barra.neg { background: #eb6834; }
.graf-h-valor { font-weight: 700; min-width: 8.5em; text-align: right; font-variant-numeric: tabular-nums; }
.ver-tabela { margin-top: .8rem; }
.ver-tabela summary { cursor: pointer; color: var(--azul); font-weight: 600; }
.cartao .valor.grande { font-size: 2.2rem; }
.graf-h-det { display: block; font-weight: 400; color: var(--cinza); font-size: .82rem; }
.mini-graficos { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; margin-bottom: 1.2rem; }
.mini-graficos .bloco { margin: 0; }
.mini-graficos h3 { margin: 0 0 .2rem; font-size: 1.05rem; color: var(--azul-escuro); }
.mini-graficos .dica { margin: 0 0 .4rem; }
.ficha-anam td { padding: .3rem .4rem; vertical-align: middle; }
.ficha-anam select, .ficha-anam input { padding: .3rem .4rem; }

/* extrato do banco (v1.12) */
.ajuda { color: var(--cinza); font-size: .95rem; }
.extrato-envio { border-left-color: var(--azul); }
.extrato-envio h3 { margin: 0 0 .3rem; }
.extrato-resumo { display: flex; flex-wrap: wrap; gap: 1.5rem; margin: .8rem 0; }
.extrato-resumo div { display: flex; flex-direction: column; }
.extrato-resumo span { color: var(--cinza); font-size: .9rem; }
.extrato-resumo b { font-size: 1.25rem; }
.extrato-resumo small { color: var(--cinza); }
.valor-entra { color: var(--verde); font-weight: 600; white-space: nowrap; }
.valor-sai { color: var(--vermelho); font-weight: 600; white-space: nowrap; }
.abas-mini { border-bottom: 0; margin-bottom: 0; }
.abas-mini button { padding: .4rem .8rem; }
.lista-escolha { max-height: 50vh; overflow: auto; border: 1px solid var(--borda); border-radius: var(--raio); padding: .3rem; }
.opcao-lista { display: flex; gap: .6rem; align-items: flex-start; padding: .5rem; border-radius: 6px; cursor: pointer; }
.opcao-lista:hover { background: var(--azul-claro); }
.opcao-lista input { width: auto; flex: 0 0 auto; margin: .25rem 0 0; }

/* ---------- busca rápida, atalhos e tamanho da letra (29/11) ---------- */
.btn-busca { display: flex; align-items: center; justify-content: space-between; gap: .5rem; width: 100%; margin: 0 0 .5rem; padding: .45rem .7rem; border-radius: var(--raio);
  border: 1px solid rgba(255,255,255,.25); background: rgba(255,255,255,.08); color: #e0e7ff; font: inherit; font-size: .95rem; cursor: pointer; }
.btn-busca:hover { background: rgba(255,255,255,.16); color: #fff; }
.btn-busca kbd, .busca-dica kbd, .atalhos kbd { font: inherit; font-size: .75rem; padding: .05rem .35rem; border-radius: 4px; border: 1px solid currentColor; opacity: .8; }
.tam-letra { display: flex; align-items: center; gap: .35rem; margin-bottom: .5rem; font-size: .85rem; color: #c7d2fe; }
.tam-letra button { min-width: 2.2rem; min-height: 1.9rem; border-radius: 6px; border: 1px solid rgba(255,255,255,.3); background: transparent; color: #fff; font: inherit; font-weight: 700; cursor: pointer; }
.tam-letra button:hover { background: rgba(255,255,255,.15); }
.busca-fundo { place-items: start center; padding-top: 12vh; }
.busca-caixa { background: #fff; width: 100%; max-width: 640px; border-radius: 12px; box-shadow: 0 10px 40px rgba(0,0,0,.3); overflow: hidden; }
.busca-campo { width: 100%; border: 0; border-bottom: 1px solid var(--borda); padding: 1rem 1.1rem; font: inherit; font-size: 1.1rem; outline: none; }
.busca-lista { list-style: none; margin: 0; padding: .35rem; max-height: 55vh; overflow-y: auto; }
.busca-lista li { display: flex; align-items: baseline; gap: .6rem; padding: .55rem .7rem; border-radius: 8px; cursor: pointer; }
.busca-lista li.sel { background: var(--azul-claro); }
.busca-lista li small { color: var(--texto-2); margin-left: auto; }
.busca-tipo { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--texto-2); min-width: 5.5rem; }
.busca-txt { font-weight: 600; }
.vazio-busca { color: var(--texto-2); cursor: default; }
.busca-dica { margin: 0; padding: .5rem 1rem; font-size: .8rem; color: var(--texto-2); border-top: 1px solid var(--borda); background: var(--fundo); }
.atalhos td { padding: .35rem .6rem; border-bottom: 1px solid var(--borda); }
:focus-visible { outline: 3px solid #f59e0b; outline-offset: 2px; }

/* ---------- metas do mês (29/11) ---------- */
.metas { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: .9rem 1.4rem; }
.meta-topo { display: flex; justify-content: space-between; gap: .5rem; font-size: .95rem; margin-bottom: .3rem; }
.meta-barra { position: relative; height: 12px; background: #e5e7eb; border-radius: 999px; overflow: visible; }
.meta-barra span { display: block; height: 100%; border-radius: 999px; background: var(--azul); }
.meta-barra span.ok { background: var(--verde); }
.meta-barra span.atras { background: #f59e0b; }
.meta-barra i { position: absolute; top: -3px; width: 2px; height: 18px; background: var(--texto); opacity: .55; }

/* ---------- funil de orçamentos (29/11) ---------- */
.funil-orc { display: grid; gap: .45rem; }
.funil-etapa { position: relative; background: #eef2ff; border-radius: 8px; min-height: 2.3rem; overflow: hidden; }
.funil-barra { position: absolute; inset: 0 auto 0 0; background: #c7d2fe; border-radius: 8px; }
.funil-etapa span { position: relative; display: block; padding: .5rem .8rem; }

@media (hover: none) { .btn-busca kbd { display: none; } }   /* tela de toque: sem dica de teclado */

/* ---------- verificação em duas etapas (29/11) ---------- */
.link-seguranca { display: block; min-height: 28px; margin: 0 0 .5rem; padding: .2rem 0; background: none; border: 0; color: #c7d2fe; font: inherit; font-size: .85rem; text-decoration: underline; cursor: pointer; }
.link-seguranca:hover { color: #fff; }
.mfa-qr { display: grid; place-items: center; padding: .5rem; }
.mfa-qr img { width: 200px; height: 200px; background: #fff; }
.passos-mfa { padding-left: 1.2rem; margin: 0 0 .5rem; }

.ponto-novo { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #f59e0b; margin-left: .3rem; vertical-align: middle; }

/* v1.24 · grupos de campos (aprovar orçamento) */
fieldset.grupo { border: 1px solid var(--borda, #dfe3ea); border-radius: 8px; padding: .4rem .8rem .2rem; margin: 0 0 .8rem; }
fieldset.grupo legend { font-weight: 600; padding: 0 .3rem; }

/* v1.28 · seletor de período e linhas futuras no fluxo */
form.periodo .atalhos { display: flex; flex-wrap: wrap; gap: .3rem; flex-basis: 100%; }
form.periodo .erro-periodo { color: var(--vermelho); font-weight: 600; }
tr.futuro td { color: var(--texto-2); font-style: italic; }

/* nome Alba no menu leva ao Início */
.marca-link { color: inherit; text-decoration: none; display: block; border-radius: 6px; }
.marca-link:hover { text-decoration: none; }
.marca-link:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.marca { display: flex; align-items: flex-start; gap: .5rem; }
.marca .marca-link { flex: 0 1 auto; min-width: 0; }
.marca .btn-menu { margin-left: auto; }
.btn-inicio { align-self: center; font-size: .8rem; font-weight: 600; color: #fff; text-decoration: none; border: 1px solid rgba(255,255,255,.55); border-radius: 999px; padding: .15rem .6rem; white-space: nowrap; }
.btn-inicio:hover, .btn-inicio:focus-visible { background: rgba(255,255,255,.15); }

/* ---------- agenda no celular (v1.32, jeito Google Agenda) ---------- */
.agc { position: relative; margin: -1rem -1rem 0; background: #fff; min-height: calc(100vh - 120px); }
.agc-topo { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .6rem .8rem .3rem; position: relative; }
.agc-mes { white-space: nowrap; background: none; border: 0; font: inherit; font-size: 1.2rem; font-weight: 700; text-transform: capitalize; color: var(--texto, #111827); padding: .2rem 0; cursor: pointer; }
.agc-mes span { font-size: .9rem; color: var(--cinza); }
.agc-data-oculta { position: absolute; left: .8rem; top: 2.4rem; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.agc-acoes { display: flex; gap: .4rem; align-items: center; }
.agc-alterna { display: flex; border: 1px solid var(--borda); border-radius: 999px; overflow: hidden; }
.agc-btn { background: #fff; border: 1px solid var(--borda); border-radius: 999px; padding: .4rem .8rem; font: inherit; font-size: .92rem; font-weight: 600; color: #334155; min-height: 2.3rem; cursor: pointer; }
.agc-alterna .agc-btn { border: 0; border-radius: 0; }
.agc-alterna .agc-btn.ativo { background: var(--azul-claro, #dbeafe); color: var(--azul-escuro, #1e3a8a); }
.agc-semana { display: grid; grid-template-columns: repeat(7, 1fr); padding: .1rem .4rem .5rem; border-bottom: 1px solid #e5e7eb; }
.agc-dia { background: none; border: 0; display: flex; flex-direction: column; align-items: center; gap: .15rem; padding: .25rem 0; font: inherit; color: #475569; cursor: pointer; }
.agc-dia small { font-size: .75rem; font-weight: 600; }
.agc-dia b { width: 2.2rem; height: 2.2rem; display: grid; place-items: center; border-radius: 50%; font-size: 1.05rem; }
.agc-dia.hoje b { color: var(--azul, #2563eb); }
.agc-dia.sel b { background: var(--azul, #2563eb); color: #fff; }
.agc-dia i { width: 5px; height: 5px; border-radius: 50%; }
.agc-dia i.tem { background: #94a3b8; }
.agc-chips { display: flex; gap: .4rem; overflow-x: auto; padding: .5rem .8rem; scrollbar-width: none; }
.agc-chips::-webkit-scrollbar { display: none; }
.agc-chip { flex: 0 0 auto; border: 1px solid var(--borda); background: #fff; border-radius: 999px; padding: .35rem .8rem; font: inherit; font-size: .9rem; color: #334155; cursor: pointer; }
.agc-chip::before { content: ""; display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--c); margin-right: .35rem; }
.agc-chip.ativo { background: #1e293b; color: #fff; border-color: #1e293b; }
.agc-corpo { padding-bottom: 5.5rem; }
.agc-titulo-dia { padding: .5rem .9rem .2rem; font-weight: 700; color: #334155; }
.agc-nada { color: var(--cinza); padding: .3rem .9rem; margin: 0; }
.agc-grade { height: calc(100vh - 290px); min-height: 340px; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.agc-trilho { position: relative; margin-left: 3.4rem; border-left: 1px solid #e5e7eb; }
.agc-hora { position: absolute; left: 0; right: 0; border-top: 1px solid #eef2f7; }
.agc-hora span { position: absolute; left: -3.2rem; top: -.6em; width: 2.9rem; text-align: right; font-size: .75rem; color: #94a3b8; }
.agc-vago { position: absolute; left: 0; right: 0; }
.agc-vago:active { background: var(--azul-claro, #dbeafe); }
.agc-eventos { position: absolute; inset: 0 .3rem 0 .2rem; pointer-events: none; }
.agc-ev { pointer-events: auto; position: absolute; text-align: left; border: 0; border-radius: 6px; background: var(--c); color: #fff; padding: .2rem .4rem; font: inherit; font-size: .85rem; line-height: 1.2; overflow: hidden; cursor: pointer; box-shadow: 0 1px 2px rgba(0,0,0,.18); }
.agc-ev b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.agc-ev span { display: block; font-size: .78rem; opacity: .92; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.agc-ev.st-pre_reserva, .agc-ev.st-agendado { background: #fff; color: #1f2937; border: 2px solid var(--c); }
.agc-ev.st-compareceu { filter: saturate(.55); }
.agc-ev.st-faltou { background: #fee2e2; color: #991b1b; border: 2px solid #dc2626; text-decoration: line-through; }
.agc-ev.st-bloqueio { background: repeating-linear-gradient(45deg, #e5e7eb 0 8px, #f3f4f6 8px 16px); color: #475569; box-shadow: none; }
.agc-agora { position: absolute; left: -6px; right: 0; height: 2px; background: #ea4335; z-index: 3; }
.agc-agora::before { content: ""; position: absolute; left: 0; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: #ea4335; }
.agc-grupo { display: grid; grid-template-columns: 3.6rem 1fr; gap: .2rem; padding: .7rem .8rem .2rem; border-bottom: 1px solid #f1f5f9; }
.agc-grupo h3 { margin: 0; display: flex; flex-direction: column; align-items: center; font-weight: 400; color: #475569; }
.agc-grupo h3 b { font-size: 1.45rem; line-height: 1.1; }
.agc-grupo h3 span { display: flex; flex-direction: column; align-items: center; font-size: .78rem; }
.agc-grupo h3 small { font-size: .7rem; color: #94a3b8; }
.agc-grupo h3.hoje b { color: #fff; background: var(--azul, #2563eb); border-radius: 50%; width: 2.3rem; height: 2.3rem; display: grid; place-items: center; font-size: 1.15rem; }
.agc-grupo > div { display: flex; flex-direction: column; gap: .4rem; }
.agc-item { display: grid; grid-template-columns: 3.2rem 1fr; gap: .5rem; align-items: center; text-align: left; width: 100%; background: #fff; border: 1px solid #e5e7eb; border-left: 5px solid var(--c); border-radius: 8px; padding: .5rem .6rem; font: inherit; cursor: pointer; }
.agc-item-hora { font-weight: 700; font-size: .92rem; display: flex; flex-direction: column; }
.agc-item-hora small { font-weight: 400; color: #94a3b8; font-size: .78rem; }
.agc-item-txt { min-width: 0; display: flex; flex-direction: column; }
.agc-item-txt b, .agc-item-txt small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.agc-item-txt small { color: #64748b; }
.agc-item.st-faltou { background: #fef2f2; }
.agc-item.st-bloqueio { background: #f3f4f6; }
.agc-fab { position: fixed; right: 1.1rem; bottom: calc(1.1rem + env(safe-area-inset-bottom)); width: 3.6rem; height: 3.6rem; border-radius: 1.1rem; border: 0; background: var(--azul, #2563eb); color: #fff; font-size: 2rem; line-height: 1; box-shadow: 0 4px 14px rgba(37,99,235,.45); z-index: 20; cursor: pointer; }

/* janelas no celular: sobem de baixo, largura toda (vale para o painel inteiro) */
@media (max-width: 700px) {
  .janela-fundo { padding: 0; place-items: end stretch; }
  .janela, .janela.larga { max-width: none; border-radius: 16px 16px 0 0; max-height: 92vh; }
  .janela-rodape { position: sticky; bottom: 0; background: #fff; padding-bottom: calc(.8rem + env(safe-area-inset-bottom)); }
  .janela-rodape .btn { flex: 1 1 auto; min-height: 2.8rem; }
  .janela .linha { flex-direction: column; }
  .janela input, .janela select, .janela textarea { font-size: 16px; } /* evita o zoom automático do iPhone */
}
.agc-item-txt .selo { align-self: flex-start; margin-top: .25rem; font-size: .75rem; }
.autoria { display: block; color: #64748b; margin: .2rem 0; } .autoria + .autoria { margin-top: 0; }

/* odontograma clicável no orçamento (v1.32) */
.oc { background: #fff; border: 1px solid var(--borda); border-radius: 10px; padding: .4rem; margin: .3rem 0 .8rem; }
.oc-svg { width: 100%; height: auto; display: block; touch-action: manipulation; user-select: none; }
.oc-dente { cursor: pointer; outline: none; }
.oc-area, .oc-num { fill: transparent; }
.oc-dente text { font-size: 15px; font-weight: 700; fill: transparent; pointer-events: none; }
.oc-dente:hover .oc-area, .oc-dente:focus-visible .oc-area { fill: rgba(37, 99, 235, .12); stroke: #2563eb; stroke-width: 2; }
.oc-dente.no-plano .oc-area { fill: rgba(37, 99, 235, .22); mix-blend-mode: multiply; }
.oc-dente.no-plano .oc-num { fill: #93c5fd; }
.oc-dente.no-plano text { fill: #1e3a8a; }
.oc-dente.sel .oc-area { fill: rgba(234, 88, 12, .38); stroke: #ea580c; stroke-width: 3; mix-blend-mode: multiply; }
.oc-dente.sel .oc-num { fill: #ea580c; }
.oc-dente.sel text { fill: #fff; }
.oc-barra { display: flex; justify-content: space-between; align-items: center; gap: .5rem; flex-wrap: wrap; padding: .4rem .2rem 0; }

/* celular (v1.32): tabelas viram cartões (o rótulo vem do cabeçalho, via app.js) */
@media (max-width: 700px) {
  .tabela-caixa:has(table.tab-cel) { background: transparent; box-shadow: none; overflow: visible; }
  table.tab-cel, table.tab-cel tbody, table.tab-cel tfoot, table.tab-cel tr, table.tab-cel td { display: block; width: 100%; }
  table.tab-cel thead { display: none; }
  table.tab-cel tr { background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; padding: .5rem .8rem; margin: 0 0 .6rem; box-shadow: 0 1px 2px rgba(0,0,0,.05); }
  table.tab-cel tr.clicavel:active { background: var(--azul-claro); }
  table.tab-cel td { border: 0; padding: .25rem 0; display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; text-align: right; min-width: 0; white-space: normal; }
  table.tab-cel td::before { content: attr(data-rotulo); font-weight: 600; font-size: .85rem; color: #64748b; text-align: left; flex: 0 0 auto; }
  table.tab-cel td:not([data-rotulo])::before { content: none; }
  table.tab-cel td:empty { display: none; }
  table.tab-cel td.cel-larga { display: block; text-align: left; }
  table.tab-cel td.acoes { justify-content: flex-start; flex-wrap: wrap; text-align: left; min-width: 0; }
  table.tab-cel td.acoes::before { width: 100%; }
  table.tab-cel tr.riscado { opacity: .6; }
  table.tab-cel tfoot tr { background: #f8fafc; }
}
