:root { --cor: #0f6e6e; --fundo: #f4f6f7; --texto: #1d2428; --sutil: #5b666c;
  --borda: #d5dcdf; --erro: #b42318; --ok: #067647; }
* { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, sans-serif; background: var(--fundo); color: var(--texto); }
a { color: var(--cor); }
.faixa-lab { background: #fff4ce; color: #6b4e00; text-align: center; font-size: .85rem; padding: .3rem; }
.caixa-login { max-width: 360px; margin: 10vh auto; background: #fff; padding: 2rem;
  border-radius: 10px; box-shadow: 0 2px 12px rgba(0,0,0,.08); }
.caixa-login h1 { margin-top: 0; color: var(--cor); text-align: center; }
.caixa-login button { width: 100%; }
label { display: block; margin-bottom: .9rem; font-size: .9rem; }
input, select { display: block; width: 100%; margin-top: .3rem; padding: .55rem; font-size: 1rem;
  border: 1px solid #c9d1d5; border-radius: 6px; background: #fff; }
input:disabled, select:disabled { background: #eef1f2; color: var(--sutil); }
label.check { display: flex; gap: .5rem; align-items: center; }
label.check input, .grade input { width: auto; margin: 0; }
button, .botao { display: inline-block; padding: .6rem 1.1rem; font-size: 1rem; background: var(--cor);
  color: #fff; border: 0; border-radius: 6px; cursor: pointer; text-decoration: none; }
button.perigo { background: var(--erro); }
button.link { background: transparent; text-decoration: underline; padding: 0; }
.erro { background: #fee4e2; color: var(--erro); padding: .6rem .8rem; border-radius: 6px; }
.erro p { margin: .2rem 0; }
.ok { background: #dcfae6; color: var(--ok); padding: .6rem .8rem; border-radius: 6px; }
.topo { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; background: var(--cor);
  color: #fff; padding: .6rem 1rem; }
.topo a { color: #fff; text-decoration: none; }
.topo .marca { font-weight: 700; }
.topo nav { display: flex; gap: 1rem; flex: 1; }
.topo .quem { display: flex; gap: .7rem; align-items: center; margin: 0; }
.conteudo { padding: 1.2rem 1.5rem; max-width: 1100px; }
.sutil { color: var(--sutil); font-size: .9rem; }
.titulo-acao { display: flex; justify-content: space-between; align-items: center; }
.etiqueta { font-size: .75rem; background: #e3e8ea; color: var(--sutil); padding: .15rem .5rem;
  border-radius: 99px; vertical-align: middle; }
table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 8px; overflow: hidden; }
th, td { text-align: left; padding: .55rem .7rem; border-bottom: 1px solid var(--borda); font-size: .93rem; }
th { background: #eaf2f2; }
tr.inativo td { color: var(--sutil); }
table.grade td:not(:first-child), table.grade th:not(:first-child) { text-align: center; }
table.compacta select { margin: 0; padding: .3rem; }
.ficha { margin-bottom: 1.2rem; }
fieldset { background: #fff; border: 1px solid var(--borda); border-radius: 8px; margin: 0 0 1rem;
  padding: 1rem; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0 1rem; }
fieldset legend { font-weight: 600; padding: 0 .3rem; }
fieldset > table, fieldset > p, fieldset > .largo { grid-column: 1 / -1; }
.logo { max-height: 80px; grid-column: 1 / -1; margin-bottom: .8rem; }
button.principal { min-width: 160px; }
@media (max-width: 600px) { .conteudo { padding: 1rem; } th, td { padding: .45rem; } }
.cor { display: inline-block; width: 14px; height: 14px; border-radius: 50%; vertical-align: middle; }
input[type=color] { padding: .15rem; height: 2.4rem; }
[hidden] { display: none !important; }
textarea { display: block; width: 100%; margin-top: .3rem; padding: .55rem; font: inherit;
  border: 1px solid #c9d1d5; border-radius: 6px; }
.busca { display: flex; gap: .7rem; align-items: center; margin: 0 0 1rem; flex-wrap: wrap; }
.busca input[name=q] { flex: 1; min-width: 220px; margin: 0; }
.busca label { margin: 0; }
.topo .busca-topo { margin: 0; }
.topo .busca-topo input { margin: 0; padding: .35rem .6rem; font-size: .9rem; width: 220px; }
.abas { display: flex; flex-wrap: wrap; gap: .3rem; margin: 1rem 0 .6rem; }
.abas button { background: #e3eded; color: var(--texto); padding: .45rem .8rem; font-size: .9rem; }
.abas button[aria-selected=true] { background: var(--cor); color: #fff; }
.cabecalho-paciente { display: flex; gap: 1rem; align-items: center; }
.cabecalho-paciente h1 { margin: .3rem 0; }
.foto { width: 72px; height: 72px; object-fit: cover; border-radius: 50%; }
.idade { font-size: 1rem; font-weight: 500; background: #eaf2f2; color: var(--cor);
  padding: .15rem .6rem; border-radius: 99px; vertical-align: middle; }
.nome-civil { font-size: .6em; color: var(--sutil); font-weight: 400; }
td .nome-civil { font-size: .85em; }
.alerta-forte { background: #fee4e2; border: 2px solid var(--erro); color: #55160c;
  padding: .8rem 1rem; border-radius: 8px; margin-bottom: 1rem; }
.alerta { background: #fff4ce; border: 1px solid #e0b100; color: #4d3800;
  padding: .8rem 1rem; border-radius: 8px; margin-bottom: 1rem; }
.alerta-forte ul, .alerta ul { margin: .4rem 0 .6rem; }
.linha { display: flex; gap: .5rem; align-items: center; }
.linha input { margin: 0; } .linha button { padding: .5rem .8rem; }
.opcoes { display: flex; gap: 1.2rem; flex-wrap: wrap; }
.grupo-resp { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0 1rem; }
.resultados { list-style: none; padding: 0; margin: 0 0 .8rem; grid-column: 1 / -1; }
.resultados button { background: #eef4f4; color: var(--texto); margin: .15rem 0; padding: .35rem .7rem; }
.filtros { display: flex; flex-wrap: wrap; gap: .6rem; align-items: flex-end; margin-bottom: 1rem; }
.filtros label { margin: 0; min-width: 140px; }
.filtros button { margin-bottom: 1px; }
.nowrap { white-space: nowrap; }
.motivo { margin: 0 0 .3rem; font-weight: 600; }
tr.acao-acesso_negado td, tr.acao-login_falhou td { background: #fff6f5; }
details summary { cursor: pointer; color: var(--cor); }
.paginas { display: flex; justify-content: space-between; margin: 1rem 0; }
.cartao { background: #fff; border: 1px solid var(--borda); border-radius: 8px; padding: .8rem 1rem; margin-bottom: .8rem; }
.cartao ul { margin: .4rem 0 0; }
.ok-etiqueta { background: #dcfae6; color: var(--ok); }
h2 { font-size: 1.15rem; margin-top: 1.5rem; }
/* ---- agenda */
.botao.leve, button.leve { background: #e3eded; color: var(--texto); }
.barra-agenda { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: .5rem 0; }
.barra-agenda input, .barra-agenda select { width: auto; margin: 0; }
.visoes { display: flex; gap: .2rem; margin-left: auto; }
.visoes a { padding: .45rem .8rem; border-radius: 6px; background: #e3eded; color: var(--texto); text-decoration: none; }
.visoes a.ativa { background: var(--cor); color: #fff; }
.data-agenda { font-weight: 600; margin: .3rem 0; }
.legenda { display: flex; gap: 1rem; font-size: .85rem; color: var(--sutil); margin-bottom: .5rem; flex-wrap: wrap; }
.legenda i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: .3rem; }
.grade-agenda { display: flex; background: #fff; border: 1px solid var(--borda); border-radius: 8px; overflow-x: auto; }
.horas { flex: 0 0 52px; border-right: 1px solid var(--borda); }
.hora { height: var(--slot); font-size: .75rem; color: var(--sutil); text-align: right; padding-right: 6px;
  border-top: 1px solid #f0f2f3; box-sizing: border-box; }
.col-cab { height: 34px; font-weight: 600; font-size: .9rem; padding: .45rem .5rem; border-bottom: 1px solid var(--borda);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: #f7fafa; }
.coluna { flex: 1 0 170px; border-right: 1px solid var(--borda); }
.col-corpo { position: relative; }
.slot { display: block; height: var(--slot); border-top: 1px solid #f0f2f3; box-sizing: border-box; }
a.slot:hover { background: #eef6f6; }
.ag { position: absolute; left: 3px; right: 3px; overflow: hidden; border-radius: 5px; padding: 2px 5px;
  font-size: .78rem; line-height: 1.2; color: #fff; text-decoration: none; background: var(--cor);
  border-left: 5px solid var(--status); box-shadow: 0 1px 2px rgba(0,0,0,.15); z-index: 2; }
.ag:hover { z-index: 3; filter: brightness(1.08); }
.ag-livre { opacity: .45; text-decoration: line-through; z-index: 1; }
.ag-hora { font-weight: 700; margin-right: .2rem; }
.ag-nome { font-weight: 600; }
.ag-idade { background: rgba(255,255,255,.25); border-radius: 99px; padding: 0 .35rem; font-size: .72rem; }
.ag-info { display: block; opacity: .9; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bloq { position: absolute; left: 0; right: 0; background: repeating-linear-gradient(45deg, #eceff1, #eceff1 6px, #f6f7f8 6px, #f6f7f8 12px);
  color: var(--sutil); font-size: .75rem; padding: 2px 6px; z-index: 1; pointer-events: none; }
.mes { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; background: var(--borda); border: 1px solid var(--borda); border-radius: 8px; overflow: hidden; }
.mes-cab { background: #eaf2f2; padding: .4rem; font-weight: 600; font-size: .85rem; text-align: center; }
.mes-dia { background: #fff; min-height: 96px; padding: .3rem; font-size: .75rem; overflow: hidden; }
.mes-dia.fora { background: #f7f8f9; color: var(--sutil); }
.mes-dia.hoje .mes-num { background: var(--cor); color: #fff; border-radius: 99px; padding: 0 .4rem; }
.mes-dia.bloq { background-image: repeating-linear-gradient(45deg, transparent, transparent 8px, #f3f4f5 8px, #f3f4f5 14px); }
.mes-num { font-weight: 700; text-decoration: none; display: inline-block; margin-bottom: .2rem; }
.mes-ag { display: block; border-left: 3px solid var(--cor); padding-left: .3rem; margin: 1px 0; color: var(--texto);
  text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.resumo { position: absolute; z-index: 50; background: #fff; border: 1px solid var(--borda); border-radius: 8px; padding: .6rem .8rem;
  box-shadow: 0 6px 20px rgba(0,0,0,.15); font-size: .85rem; max-width: 290px; line-height: 1.45; }
.alerta-txt { color: var(--erro); }
.status-pill { background: var(--status); color: #fff; padding: .3rem .8rem; border-radius: 99px; font-weight: 600; }
.botoes { display: flex; flex-wrap: wrap; gap: .5rem; }
.btn-status { background: var(--status); }
.acoes-status fieldset, .acoes-status label { max-width: 520px; }
.livres div { margin: .3rem 0; }
.chip { padding: .25rem .6rem; font-size: .85rem; margin: .15rem; background: #eef4f4; color: var(--texto); }
.chip:hover { background: var(--cor); color: #fff; }
@media (max-width: 700px) { .visoes { margin-left: 0; } .coluna { flex-basis: 140px; } }
.prio { padding: .1rem .5rem; border-radius: 99px; font-size: .8rem; font-weight: 600; }
.prio-alta { background: #fee4e2; color: var(--erro); } .prio-media { background: #fff4ce; color: #6b4e00; }
.prio-normal { background: #e3eded; } .prio-baixa { background: #f2f4f5; color: var(--sutil); }
td.botoes form { margin: 0; }
.status-pill.pequeno { padding: .1rem .55rem; font-size: .8rem; }
tr.espera-longa td { background: #fff4ce; }
.btn-iniciar { background: #16a34a; }
.contador { background: #fff; color: var(--cor); border-radius: 99px; padding: 0 .45rem; font-size: .8rem; font-weight: 700; margin-left: .2rem; }
body.publico { background: #eef4f4; }
.caixa-publica { max-width: 460px; margin: 6vh auto; background: #fff; padding: 1.6rem; border-radius: 12px;
  box-shadow: 0 2px 14px rgba(0,0,0,.08); }
.caixa-publica h1 { color: var(--cor); margin-top: 0; font-size: 1.4rem; }
.destaque { font-size: 1.3rem; font-weight: 700; background: #eaf2f2; padding: .8rem; border-radius: 8px; text-align: center; }
.botoes-publicos { display: flex; flex-direction: column; gap: .6rem; }
.botoes-publicos button { width: 100%; }
.btn-whats { background: #128c4a; }
.horarios { display: flex; flex-wrap: wrap; gap: .4rem; }
.chip-radio input { position: absolute; opacity: 0; }
.chip-radio span { display: inline-block; padding: .45rem .8rem; border-radius: 6px; background: #eef4f4; cursor: pointer; }
.chip-radio input:checked + span { background: var(--cor); color: #fff; }
.chip-radio input:focus-visible + span { outline: 2px solid var(--cor); }
.linha-quebra { display: flex; flex-wrap: wrap; gap: .6rem; align-items: flex-end; margin: .5rem 0; }
.linha-quebra label { margin: 0; flex: 1; min-width: 220px; }
/* ---- chat */
#chat-raiz { position: fixed; right: 16px; bottom: 16px; z-index: 100; display: flex; align-items: flex-end; gap: 10px; }
.chat-botao { border-radius: 99px; padding: .7rem 1.2rem; box-shadow: 0 4px 14px rgba(0,0,0,.25); position: relative; }
.chat-contador { position: absolute; top: -6px; right: -6px; background: var(--erro); color: #fff; border-radius: 99px;
  font-size: .75rem; padding: 0 .4rem; min-width: 1.2rem; text-align: center; }
.chat-painel, .chat-janela { width: 280px; background: #fff; border: 1px solid var(--borda); border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,.18); display: flex; flex-direction: column; overflow: hidden; }
.chat-painel { position: absolute; right: 0; bottom: 56px; max-height: 70vh; }
.chat-janelas { display: flex; gap: 10px; align-items: flex-end; margin-right: 0; }
.chat-janela { height: 380px; }
.chat-janela.min { height: auto; }
.chat-janela.min .chat-msgs, .chat-janela.min .chat-form { display: none; }
.chat-janela.novo .chat-cab { background: #d97706; }
.chat-cab { display: flex; align-items: center; gap: .4rem; background: var(--cor); color: #fff; padding: .5rem .7rem; cursor: pointer; }
.chat-cab strong { flex: 1; font-size: .92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-x { background: transparent; padding: 0 .35rem; font-size: 1.1rem; line-height: 1; }
.chat-lista { overflow-y: auto; padding: .3rem 0; }
.chat-secao { margin: .4rem .8rem .2rem; font-size: .75rem; text-transform: uppercase; color: var(--sutil); }
.chat-item { display: flex; align-items: center; gap: .5rem; width: 100%; background: transparent; color: var(--texto);
  padding: .45rem .8rem; border-radius: 0; text-align: left; font-size: .9rem; }
.chat-item:hover { background: #eef4f4; }
.chat-nome { flex: 1; }
.chat-bola { width: 9px; height: 9px; border-radius: 50%; }
.chat-bola.on { background: #16a34a; } .chat-bola.off { background: #c4cbd0; }
.chat-grupo-ic { font-weight: 700; color: var(--cor); width: 9px; }
.chat-nl { background: var(--erro); color: #fff; border-radius: 99px; font-size: .72rem; padding: 0 .4rem; }
.chat-msgs { flex: 1; overflow-y: auto; padding: .5rem; display: flex; flex-direction: column; gap: .35rem; background: #f6f8f8; }
.chat-balao { max-width: 85%; padding: .35rem .6rem; border-radius: 10px; font-size: .88rem; word-wrap: break-word; white-space: pre-wrap; }
.chat-balao.meu { align-self: flex-end; background: #d7efee; }
.chat-balao.outro { align-self: flex-start; background: #fff; border: 1px solid var(--borda); }
.chat-autor { display: block; font-weight: 600; color: var(--cor); font-size: .72rem; }
.chat-hora { display: block; text-align: right; color: var(--sutil); font-size: .68rem; }
.chat-mais { background: transparent; color: var(--cor); font-size: .8rem; padding: .2rem; }
.chat-form { border-top: 1px solid var(--borda); padding: .4rem; }
.chat-form input { margin: 0; padding: .45rem; font-size: .9rem; }
@media (max-width: 700px) { .chat-janela { width: 240px; } .chat-janelas .chat-janela:not(:last-child) { display: none; } }
/* ---- prontuário */
.pront-cab { position: sticky; top: 0; z-index: 5; background: #fff; border: 1px solid var(--borda); border-radius: 10px;
  padding: .7rem 1rem; display: flex; flex-wrap: wrap; gap: .5rem 2rem; justify-content: space-between; margin-bottom: 1rem; }
.pront-id { display: flex; gap: .8rem; align-items: center; }
.pront-id h1 { margin: 0; font-size: 1.3rem; } .pront-id h1 a { color: inherit; text-decoration: none; }
.pront-id p { margin: .2rem 0 0; }
.pront-foto { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; }
.pront-alertas p { margin: .2rem 0; }
.pront-alergia { color: var(--erro); font-weight: 600; }
.atend-barra { display: flex; align-items: center; justify-content: space-between; gap: 1rem; background: #e0f2f1;
  border-radius: 8px; padding: .5rem .9rem; margin-bottom: 1rem; }
.atend-barra form { margin: 0; }
.pront-grade { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 1.5rem; }
@media (max-width: 900px) { .pront-grade { grid-template-columns: 1fr; } }
.novos { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1rem; }
.botao { display: inline-block; padding: .5rem .9rem; border-radius: 6px; background: var(--cor); color: #fff; text-decoration: none; }
.botao.leve { background: #e6f0f0; color: var(--cor); }
.filtros { display: flex; flex-wrap: wrap; gap: .6rem; align-items: flex-end; margin-bottom: .8rem; }
.filtros label { margin: 0; }
.reg, .reg-cheio { border: 1px solid var(--borda); border-left: 5px solid; border-radius: 8px; padding: .6rem .9rem; margin-bottom: .6rem; background: #fff; }
.reg header { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.reg-cancelado { opacity: .6; } .reg-cancelado b { text-decoration: line-through; }
.reg-rascunho { border-style: dashed; }
.reg-texto { white-space: pre-wrap; margin: .4rem 0 0; }
.etiqueta.rascunho { background: #b45309; color: #fff; } .etiqueta.cancelado { background: #4b5563; color: #fff; }
.etiqueta.restrito { background: #334155; color: #fff; }
.etiqueta.cid { background: #e6f0f0; color: var(--texto); }
.etiqueta.cid button { background: transparent; color: var(--texto); padding: 0 .2rem; }
.pront-dia { margin: 1rem 0 .4rem; font-size: 1rem; color: var(--sutil); }
.lista-simples { list-style: none; padding: 0; } .lista-simples li { padding: .3rem 0; border-bottom: 1px solid var(--borda); }
.inline { display: inline; } .mini { padding: 0 .4rem; font-size: .85rem; }
.mini-form { display: flex; flex-direction: column; gap: .3rem; margin-bottom: 1rem; }
.mini-form input, .mini-form select { margin: 0; }
.adendo { margin-left: 1.5rem; border-left-color: #94a3b8; }
.respostas dt { font-weight: 600; margin-top: .5rem; } .respostas dd { margin: 0; white-space: pre-wrap; }
.colunas { columns: 2; }
.exames-grupos { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .8rem; }
.exame-grupo { display: flex; flex-direction: column; }
.cid-campo { position: relative; }
.cid-sugestoes { list-style: none; padding: 0; margin: 0; position: absolute; z-index: 10; background: #fff; border: 1px solid var(--borda);
  max-height: 220px; overflow-y: auto; width: 100%; }
.cid-sugestoes:empty { display: none; }
.cid-sugestoes li { padding: .4rem .6rem; cursor: pointer; } .cid-sugestoes li:hover, .cid-sugestoes li:focus { background: #eef4f4; }
.pergunta { margin-bottom: .6rem; }
.botoes { display: flex; flex-wrap: wrap; gap: .5rem; margin: .8rem 0; }
.pergunta-edit { display: grid; grid-template-columns: 2fr 1fr 1.5fr auto; gap: .4rem; align-items: center; padding: .5rem; }
.pergunta-edit input, .pergunta-edit select { margin: 0; }
@media (max-width: 700px) { .pergunta-edit { grid-template-columns: 1fr; } }
.galeria { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: .8rem; margin-bottom: .8rem; }
.foto { position: relative; display: flex; flex-direction: column; gap: .3rem; font-size: .82rem; cursor: pointer; }
.foto img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; border: 3px solid transparent; }
.foto input { position: absolute; top: 8px; left: 8px; width: 20px; height: 20px; }
.foto input:checked + img { border-color: var(--cor); }
.comparar { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.comparar img { width: 100%; border-radius: 8px; }
.comparar figure { margin: 0; }
.ok-txt { color: #15803d; }
/* ---- teleconsulta */
.tele-grade { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 1rem; }
@media (max-width: 1000px) { .tele-grade { grid-template-columns: 1fr; } }
.tele-video { position: relative; background: #111; border-radius: 10px; aspect-ratio: 4 / 3; overflow: hidden; }
.tele-video #video-remoto { width: 100%; height: 100%; object-fit: cover; }
.tele-video #video-local { position: absolute; right: 10px; bottom: 10px; width: 28%; border-radius: 8px; border: 2px solid #fff; background: #333; }
.tele-status { font-weight: 600; }
.tele-pront iframe { width: 100%; height: 85vh; border: 1px solid var(--borda); border-radius: 10px; }
.caixa-publica .tele-video { aspect-ratio: 3 / 4; }
.termo { white-space: pre-wrap; font-family: inherit; background: #f6f8f8; padding: .8rem; border-radius: 8px; font-size: .9rem; }
body.embutido header.topo, body.embutido nav, body.embutido #chat-raiz { display: none !important; }
.grande { font-size: 2rem; margin: .2rem 0; }
.barra-meta { background: #e3e8ea; border-radius: 6px; height: 14px; overflow: hidden; max-width: 600px; }
.barra-meta span { display: block; height: 100%; background: var(--ok, #16a34a); }
.atalhos { display: flex; flex-wrap: wrap; gap: .4rem 1rem; margin: .2rem 0 .8rem; }
