/* BrAInSalus — celular primeiro. Menu embaixo no celular, na lateral a partir de 900px. */
:root {
    --verde: #0f766e; --verde-claro: #ccfbf1; --verde-escuro: #115e59;
    --texto: #1f2937; --suave: #6b7280; --linha: #e5e7eb; --fundo: #f5f7f7; --branco: #fff;
    --vermelho: #b91c1c; --vermelho-claro: #fee2e2; --amarelo: #a16207; --amarelo-claro: #fef3c7;
    --azul: #1d4ed8; --azul-claro: #dbeafe; --roxo: #6d28d9;
    --raio: 12px; --sombra: 0 1px 2px rgba(0,0,0,.06), 0 2px 8px rgba(0,0,0,.04);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--texto); background: var(--fundo); }
a { color: var(--verde); }
h1 { font-size: 1.25rem; margin: 0; }
h2 { font-size: 1.05rem; margin: 0 0 .6rem; }
small, .suave { color: var(--suave); }
button { font: inherit; cursor: pointer; }

/* Estrutura */
.app { min-height: 100vh; }
.principal { padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
.topo { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    padding: .7rem 1rem; background: var(--branco); border-bottom: 1px solid var(--linha); }
.topo .clinica { font-size: .8rem; color: var(--suave); }
.conteudo { padding: 1rem; max-width: 1100px; margin: 0 auto; }

.menu { position: fixed; z-index: 10; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-around;
    background: var(--branco); border-top: 1px solid var(--linha); padding: 4px 4px calc(4px + env(safe-area-inset-bottom)); }
.menu .marca { display: none; }
.menu a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px; font-size: .72rem;
    color: var(--suave); text-decoration: none; border-radius: 10px; min-height: 52px; justify-content: center; }
.menu a svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.menu a.ativo { color: var(--verde); background: var(--verde-claro); font-weight: 600; }

.marca { display: flex; align-items: center; gap: .5rem; font-size: 1.15rem; color: var(--verde-escuro); }
.marca b { color: var(--verde); }
.logo { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: var(--verde); color: #fff; font-weight: 700; }
.marca.grande { font-size: 1.6rem; justify-content: center; }
.marca.grande .logo { width: 44px; height: 44px; font-size: 1.3rem; }

@media (min-width: 900px) {
    .app { display: grid; grid-template-columns: 220px 1fr; }
    .principal { padding-bottom: 0; }
    .menu { position: sticky; top: 0; height: 100vh; flex-direction: column; justify-content: flex-start; gap: 4px;
        border-top: 0; border-right: 1px solid var(--linha); padding: 1rem .75rem; }
    .menu .marca { display: flex; margin: 0 .5rem 1.25rem; }
    .menu a { flex: none; flex-direction: row; gap: .7rem; font-size: .95rem; padding: .6rem .75rem; min-height: 0; justify-content: flex-start; }
    .conteudo { padding: 1.5rem; }
}

/* Conta */
.conta { position: relative; }
.conta summary { list-style: none; width: 38px; height: 38px; border-radius: 50%; background: var(--verde); color: #fff;
    display: grid; place-items: center; font-weight: 700; cursor: pointer; }
.conta summary::-webkit-details-marker { display: none; }
.conta-menu { position: absolute; right: 0; top: 46px; width: 260px; background: var(--branco); border: 1px solid var(--linha);
    border-radius: var(--raio); box-shadow: var(--sombra); padding: .9rem; display: grid; gap: .75rem; }
.conta-menu .simular { display: grid; gap: .2rem; max-height: 220px; overflow: auto; }
.faixa-simulacao { background: var(--roxo); color: #fff; padding: .5rem 1rem; display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; justify-content: center; font-size: .9rem; }
.faixa-simulacao form { display: inline; }
.faixa-simulacao button { background: #fff; color: var(--roxo); border: 0; border-radius: 8px; padding: .25rem .6rem; font-weight: 600; }

/* Componentes */
.cartao { background: var(--branco); border: 1px solid var(--linha); border-radius: var(--raio); box-shadow: var(--sombra); padding: 1rem; }
.cartao + .cartao, .pilha > * + * { margin-top: .9rem; }
.botao { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: 44px; padding: .55rem 1rem;
    border-radius: 10px; border: 1px solid var(--verde); background: var(--verde); color: #fff; font-weight: 600; text-decoration: none; }
.botao.secundario { background: var(--branco); color: var(--verde); }
.botao.perigo { background: var(--branco); color: var(--vermelho); border-color: #fca5a5; }
.botao.pequeno { min-height: 34px; padding: .25rem .65rem; font-size: .85rem; }
.botao.largo { width: 100%; }
.link { background: none; border: 0; color: var(--verde); padding: .3rem 0; text-align: left; }
.aviso { padding: .7rem .9rem; border-radius: 10px; margin-bottom: 1rem; }
.aviso.ok { background: var(--verde-claro); color: var(--verde-escuro); }
.aviso.erro { background: var(--vermelho-claro); color: var(--vermelho); }
.vazio { text-align: center; color: var(--suave); padding: 2rem 1rem; }
.linha-acoes { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.entre { display: flex; justify-content: space-between; align-items: center; gap: .75rem; }

.etiqueta { display: inline-block; padding: .1rem .5rem; border-radius: 999px; font-size: .75rem; font-weight: 600; background: var(--linha); color: var(--texto); white-space: nowrap; }
.etiqueta.agendado { background: var(--azul-claro); color: var(--azul); }
.etiqueta.confirmado, .etiqueta.realizado, .etiqueta.ia { background: var(--verde-claro); color: var(--verde-escuro); }
.etiqueta.cancelado, .etiqueta.faltou { background: var(--vermelho-claro); color: var(--vermelho); }
.etiqueta.humano { background: var(--amarelo-claro); color: var(--amarelo); }

/* Formulários */
.form { display: grid; gap: .8rem; }
.form.colunas { grid-template-columns: 1fr; }
@media (min-width: 640px) { .form.colunas { grid-template-columns: repeat(2, 1fr); } .form .inteiro { grid-column: 1 / -1; } }
label { display: grid; gap: .3rem; font-size: .9rem; font-weight: 600; }
label.check { display: flex; align-items: center; gap: .5rem; font-weight: 400; }
input, select, textarea { font: inherit; width: 100%; min-height: 44px; padding: .55rem .7rem; border: 1px solid #d1d5db; border-radius: 10px; background: #fff; color: var(--texto); }
input[type=checkbox] { width: 20px; min-height: 20px; }
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--verde); outline-offset: 1px; border-color: var(--verde); }
details.abrir > summary { cursor: pointer; list-style: none; }
details.abrir > summary::-webkit-details-marker { display: none; }

/* Entrar */
.tela-entrar { min-height: 100vh; display: grid; place-items: center; padding: 1rem; background: linear-gradient(160deg, var(--verde-claro), var(--fundo)); }
.entrar { width: 100%; max-width: 380px; padding: 1.75rem 1.5rem; }
.entrar .sub { text-align: center; color: var(--suave); margin: .3rem 0 1.25rem; }

/* Agenda */
.dia-nav { display: flex; align-items: center; gap: .5rem; margin-bottom: 1rem; flex-wrap: wrap; }
.dia-nav .hoje { font-weight: 700; font-size: 1.05rem; flex: 1; min-width: 160px; }
.profissionais { display: grid; gap: 1rem; }
@media (min-width: 900px) { .profissionais { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); } }
.consulta { display: grid; grid-template-columns: 56px 1fr; gap: .25rem .6rem; padding: .7rem 0; border-top: 1px solid var(--linha); }
.consulta:first-of-type { border-top: 0; }
.consulta .hora { font-weight: 700; color: var(--verde-escuro); }
.consulta .acoes { grid-column: 2; display: flex; flex-wrap: wrap; gap: .35rem; }
.consulta .acoes form { display: inline; }
.livres { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .6rem; }
.livres a { padding: .3rem .55rem; border-radius: 8px; border: 1px dashed var(--verde); text-decoration: none; font-size: .85rem; }

/* Conversas */
.caixa { display: grid; gap: 1rem; }
@media (min-width: 900px) { .caixa { grid-template-columns: 340px 1fr; align-items: start; } }
.lista-conversas { padding: 0; overflow: hidden; }
.lista-conversas a { display: grid; grid-template-columns: 1fr auto; gap: .15rem .5rem; padding: .8rem 1rem; border-top: 1px solid var(--linha); color: inherit; text-decoration: none; }
.lista-conversas a:first-child { border-top: 0; }
.lista-conversas a.ativa { background: var(--verde-claro); }
.lista-conversas .previa { grid-column: 1 / -1; color: var(--suave); font-size: .88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filtros { display: flex; gap: .4rem; margin-bottom: .75rem; flex-wrap: wrap; }
.filtros a { padding: .35rem .8rem; border-radius: 999px; border: 1px solid var(--linha); background: var(--branco); text-decoration: none; color: var(--texto); font-size: .9rem; }
.filtros a.ativo { background: var(--verde); border-color: var(--verde); color: #fff; }
.thread { display: flex; flex-direction: column; gap: .45rem; padding: .5rem 0; max-height: 60vh; overflow-y: auto; }
.bolha { max-width: 85%; padding: .5rem .75rem; border-radius: 14px; white-space: pre-wrap; word-wrap: break-word; }
.bolha small { display: block; font-size: .7rem; margin-top: .2rem; }
.bolha.entrada { align-self: flex-start; background: #fff; border: 1px solid var(--linha); border-bottom-left-radius: 4px; }
.bolha.saida { align-self: flex-end; background: #dcf8c6; border-bottom-right-radius: 4px; }
.bolha.saida.ia { background: var(--verde-claro); }
.bolha.saida.sistema { background: #eef2ff; }
.responder { display: grid; grid-template-columns: 1fr auto; gap: .5rem; align-items: end; margin-top: .75rem; }
.responder textarea { min-height: 48px; }

.so-celular { display: inline-block; }
.so-computador { display: none; }
@media (min-width: 900px) { .so-celular { display: none; } .so-computador { display: block; } }

/* Funil de pacientes */
.funil { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(240px, 82vw); gap: .9rem; overflow-x: auto; padding-bottom: .5rem; scroll-snap-type: x mandatory; }
@media (min-width: 900px) { .funil { grid-auto-columns: minmax(220px, 1fr); } }
.coluna { background: #eef2f2; border-radius: var(--raio); padding: .75rem; scroll-snap-align: start; }
.coluna h2 { display: flex; justify-content: space-between; }
.paciente { background: var(--branco); border-radius: 10px; padding: .65rem .75rem; box-shadow: var(--sombra); margin-top: .5rem; }
.paciente select { min-height: 34px; padding: .2rem .4rem; font-size: .85rem; margin-top: .4rem; }

/* Simulador de WhatsApp */
.simulador { display: grid; gap: 1rem; }
@media (min-width: 900px) { .simulador { grid-template-columns: 380px 1fr; align-items: start; } }
.celular { border-radius: 28px; overflow: hidden; border: 8px solid #1f2937; background: #efeae2; display: flex; flex-direction: column; height: min(640px, 75vh); }
.celular-topo { display: flex; gap: .6rem; align-items: center; padding: .6rem .8rem; background: #075e54; color: #fff; }
.celular-topo small { display: block; opacity: .8; font-size: .75rem; }
.celular-topo .logo { background: #fff; color: #075e54; }
.celular-conversa { flex: 1; max-height: none; padding: .75rem; }
.celular-escrever { display: flex; gap: .4rem; padding: .5rem; background: #f0f0f0; }
.celular-escrever input { border-radius: 999px; }
.celular-escrever .botao { border-radius: 50%; width: 44px; padding: 0; background: #075e54; border-color: #075e54; }
.botoes-wa { display: flex; flex-direction: column; gap: 4px; margin-top: .5rem; }
.botoes-wa form { display: block; }
.botoes-wa button { width: 100%; background: #fff; border: 1px solid #d1d5db; border-radius: 8px; padding: .4rem; color: #027eb5; font-weight: 600; }

/* Área do cliente (assinatura) */
.uso { margin-top: .8rem; }
.barra { height: 10px; background: var(--linha); border-radius: 999px; overflow: hidden; margin-top: .3rem; }
.barra span { display: block; height: 100%; background: var(--verde); border-radius: 999px; }
.barra span.alerta { background: var(--amarelo); }
.modulos-cliente { display: grid; gap: .75rem; }
@media (min-width: 700px) { .modulos-cliente { grid-template-columns: 1fr 1fr; } }
.modulo-cliente { border: 1px solid var(--linha); border-radius: 10px; padding: .75rem .9rem; display: grid; gap: .25rem; }
.modulo-cliente.fora { background: #fafafa; }
.modulo-cliente.fora strong { color: var(--suave); }
.planos-escolha { display: grid; gap: .75rem; }
@media (min-width: 700px) { .planos-escolha { grid-template-columns: repeat(4, 1fr); } }
.plano-opcao { position: relative; border: 2px solid var(--linha); border-radius: 12px; padding: .9rem; display: grid; gap: .2rem; cursor: pointer; font-weight: 400; }
.plano-opcao input { position: absolute; opacity: 0; }
.plano-opcao:has(input:checked) { border-color: var(--verde); background: var(--verde-claro); }
.plano-opcao span { color: var(--verde-escuro); font-weight: 700; }
.plano-opcao em { font-size: .75rem; color: var(--suave); }

.especialidades-escolha { display: grid; gap: .6rem; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }

/* Configurar */
.abas { display: flex; gap: .4rem; overflow-x: auto; margin-bottom: 1rem; }
.tabela { width: 100%; border-collapse: collapse; }
.tabela td, .tabela th { text-align: left; padding: .55rem .4rem; border-top: 1px solid var(--linha); vertical-align: top; }
.tabela th { font-size: .8rem; color: var(--suave); border-top: 0; }
.faixas { display: flex; flex-wrap: wrap; gap: .35rem; margin: .4rem 0; }
.faixas form { display: inline; }

/* Menu Sistema da equipe (grupos com subitens, como no InventAI) */
.menu-sistema-chave { display: none; }
.menu-sistema-botao { font-size: 1.4rem; cursor: pointer; padding: .2rem .5rem; border-radius: 8px; }
.menu-sistema-titulo { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--suave); margin: .9rem .75rem .3rem; font-weight: 700; }
.menu-sistema a { position: relative; }
.menu-sistema .contador { margin-left: auto; font-style: normal; background: #dc2626; color: #fff; border-radius: 999px; font-size: .72rem; padding: 0 .45rem; min-width: 1.3rem; text-align: center; }
.menu-sistema .submenu { display: grid; gap: 2px; margin: 2px 0 6px 2.1rem; border-left: 2px solid var(--verde-claro); }
.menu-sistema .submenu a { min-height: 0; padding: .4rem .7rem; font-size: .88rem; color: var(--texto); border-radius: 0 8px 8px 0; }
.menu-sistema .submenu a.ativo { background: var(--verde-claro); color: var(--verde-escuro); font-weight: 600; }
.menu-sistema-fechar { display: none; margin-left: auto; cursor: pointer; font-size: 1.1rem; }
.menu-sistema-fundo { display: none; }
/* celular: o menu Sistema abre por cima, pelo botão ☰ */
@media (max-width: 899px) {
    .app-sistema .principal { padding-bottom: 0; }
    .menu.menu-sistema { position: fixed; inset: 0 auto 0 0; width: min(320px, 86vw); height: 100vh; overflow-y: auto; flex-direction: column; justify-content: flex-start;
        gap: 2px; padding: 1rem .75rem; border-right: 1px solid var(--linha); border-top: 0; transform: translateX(-105%); transition: transform .2s; z-index: 30; }
    .menu.menu-sistema .marca { display: flex; margin: 0 .5rem 1rem; }
    .menu.menu-sistema a { flex: none; flex-direction: row; gap: .7rem; font-size: .95rem; padding: .6rem .75rem; min-height: 0; justify-content: flex-start; }
    .menu-sistema-chave:checked ~ .menu-sistema { transform: none; }
    .menu-sistema-chave:checked ~ .menu-sistema-fundo { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 20; }
    .menu-sistema-fechar { display: inline; }
}
@media (min-width: 900px) {
    .menu-sistema-botao { display: none; }
    .menu.menu-sistema { overflow-y: auto; }
}

/* Telas do Sistema */
.kpis { display: grid; gap: .8rem; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 900px) { .kpis { grid-template-columns: repeat(4, 1fr); } }
.kpi { background: var(--branco); border: 1px solid var(--linha); border-radius: var(--raio); padding: .9rem 1rem; box-shadow: var(--sombra); }
.kpi small { color: var(--suave); display: block; }
.kpi strong { font-size: 1.45rem; color: var(--verde-escuro); display: block; margin-top: .15rem; }
.kpi span { font-size: .8rem; color: var(--suave); }
.grade2 { display: grid; gap: 1rem; }
@media (min-width: 900px) { .grade2 { grid-template-columns: 1fr 1fr; } }
.barras { display: grid; gap: .5rem; }
.barras .linha { display: grid; grid-template-columns: minmax(90px, 160px) 1fr auto; gap: .6rem; align-items: center; font-size: .9rem; }
.barras .trilho { height: 12px; background: var(--linha); border-radius: 999px; overflow: hidden; }
.barras .trilho span { display: block; height: 100%; background: var(--verde); border-radius: 999px; }
.barras .trilho span.saida { background: #f59e0b; }
.colunas-caixa { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: .5rem; align-items: end; height: 180px; padding-top: 1rem; }
.colunas-caixa div { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; align-items: end; height: 100%; position: relative; }
.colunas-caixa i { display: block; border-radius: 4px 4px 0 0; background: var(--verde); min-height: 2px; }
.colunas-caixa i.saida { background: #f59e0b; }
.colunas-caixa b { position: absolute; bottom: -1.4rem; left: 0; right: 0; text-align: center; font-weight: 400; font-size: .75rem; color: var(--suave); }
.legenda { display: flex; gap: 1rem; font-size: .82rem; color: var(--suave); margin-top: 1.8rem; }
.legenda i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; background: var(--verde); margin-right: .3rem; }
.legenda i.saida { background: #f59e0b; }
.pendencias { display: grid; gap: .4rem; }
.pendencias a { display: flex; justify-content: space-between; padding: .55rem .7rem; border: 1px solid var(--linha); border-radius: 10px; text-decoration: none; color: var(--texto); }
.pendencias a strong { color: var(--verde-escuro); }
.pendencias a.alerta strong { color: #dc2626; }
.funil-crm { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 82vw); gap: .9rem; overflow-x: auto; padding-bottom: .5rem; }
@media (min-width: 900px) { .funil-crm { grid-auto-columns: minmax(230px, 1fr); } }
.tabela-rolagem { overflow-x: auto; }
.num { text-align: right; white-space: nowrap; }
/* Ajuda e Avisos */
.menu a .contador { margin-left: auto; font-style: normal; background: #dc2626; color: #fff; border-radius: 999px; font-size: .72rem; padding: 0 .45rem; }
.conta summary { position: relative; }
.contador-conta { position: absolute; top: -4px; right: -4px; font-style: normal; background: #dc2626; color: #fff; border-radius: 999px; font-size: .68rem; padding: 0 .35rem; line-height: 1.3rem; min-width: 1.3rem; text-align: center; }
@media (max-width: 899px) { .menu a.so-lateral { display: none; } }
.conversa-chamado { display: grid; gap: .6rem; }
.msg-chamado { border: 1px solid var(--linha); border-radius: 12px; padding: .7rem .9rem; background: #fff; }
.msg-chamado.equipe { background: var(--verde-claro); border-color: #99f6e4; }
.msg-chamado.interna { background: #fef9c3; border-style: dashed; }
.msg-chamado .mudou { font-size: .8rem; color: var(--suave); }
.texto-livre { white-space: pre-wrap; }

/* Menu Sistema em árvore: Painel (nível 1) › áreas (2) › itens (3) › sub-itens (4) */
.menu-sistema .submenu-2 { margin: 2px 0 6px 1.1rem; padding-left: .2rem; border-left: 2px solid var(--verde-claro); } /* itens abaixo do menu principal, recuados */
.menu-sistema .submenu-2 > .menu-no > a { font-size: .93rem; }
.menu-sistema .submenu-3 { margin: 2px 0 6px 2.3rem; border-left: 2px solid var(--verde-claro); }
.menu-sistema .submenu-4 { margin: 0 0 4px .9rem; border-left: 2px dotted var(--verde-claro); }
.menu-sistema .submenu-4 a { font-size: .84rem; padding: .3rem .6rem; }
.menu-sistema a.no-caminho { color: var(--verde-escuro); font-weight: 600; }
.menu-sistema a.nivel-1 { font-weight: 700; }
/* item com filhos: o nome abre a página; a seta (summary) mostra/oculta os itens de dentro, como no InventAI */
.menu-sistema .menu-no { position: relative; }
.menu-sistema .menu-no.tem-filhos > a { padding-right: 2.4rem; }
.menu-sistema .menu-ramo { display: block; }
.menu-sistema .sub-seta { list-style: none; position: absolute; top: 0; right: 0; width: 2.2rem; height: 2.4rem; display: flex; align-items: center; justify-content: center; cursor: pointer; border-radius: 8px; color: var(--suave); }
.menu-sistema .sub-seta::-webkit-details-marker { display: none; }
.menu-sistema .sub-seta:hover { background: var(--verde-claro); color: var(--verde-escuro); }
.menu-sistema .sub-seta svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; transition: transform .2s; }
.menu-sistema .menu-ramo[open] > .sub-seta svg { transform: rotate(90deg); }
.menu-sistema .submenu .sub-seta { height: 2rem; }
.menu-sair { margin: 0; }
.menu-sair button { display: flex; align-items: center; gap: .7rem; width: 100%; padding: .6rem .75rem; border: 0; background: none; color: #b91c1c; font: inherit; font-size: .95rem; border-radius: 10px; text-align: left; }
.menu-sair button:hover { background: #fee2e2; }
.menu-sair svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
/* Caminho de navegação no topo */
.caminho { display: flex; flex-wrap: wrap; align-items: center; gap: .15rem .35rem; font-size: .8rem; color: var(--suave); margin-bottom: .1rem; }
.caminho a { color: var(--suave); text-decoration: none; }
.caminho a:hover { color: var(--verde); text-decoration: underline; }
.caminho .sep { color: #cbd5e1; }
.caminho .aqui { color: var(--texto); font-weight: 600; }
@media (max-width: 899px) { .menu .menu-sair.so-lateral { display: none; } }
@media (min-width: 900px) { .menu .menu-sair.so-lateral { margin-top: auto; } }

/* Funil de vendas (Sistema › CRM), igual ao do InventAI: filtros, Por fase (kanban), Por mês e Resumo */
.sub-titulo { margin: -.3rem 0 .8rem; font-size: .9rem; }
.filtros-funil { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin-bottom: .8rem; }
.filtros-funil select, .filtros-funil input { width: auto; min-height: 40px; padding: .4rem .7rem; }
.filtros-funil .total-funil { margin-left: auto; font-size: .85rem; }
.dica { font-size: .85rem; margin: .8rem 0 0; }
.pilula { display: inline-block; border-radius: 999px; padding: 1px 7px; font-size: .68rem; font-weight: 600; }
.crm-origem { background: color-mix(in srgb, var(--cor) 14%, #fff); color: color-mix(in srgb, var(--cor) 75%, #000); border: 1px solid color-mix(in srgb, var(--cor) 35%, #fff); }
.crm-atrasado { color: #C0392B !important; font-weight: 600; }
.pm-alternar { display: inline-flex; flex-wrap: wrap; max-width: 100%; border: 1px solid var(--linha); border-radius: 10px; overflow: hidden; margin: .2rem 0 .9rem; background: #fff; }
.pm-alternar a { padding: .5rem 1rem; font-weight: 600; font-size: .85rem; color: var(--suave); text-decoration: none; }
.pm-alternar a + a { border-left: 1px solid var(--linha); }
.pm-alternar a.ativo { background: var(--verde); color: #fff; }
.kanban-wrap { overflow-x: auto; padding-bottom: 8px; }
.kanban { display: grid; grid-template-columns: repeat(var(--colunas), minmax(230px, 1fr)); gap: 10px; min-width: calc(var(--colunas) * 240px); }
.kanban-col { background: #EDEFF3; border-radius: 12px; padding: 8px; display: flex; flex-direction: column; min-height: 200px; transition: background .15s; }
.kanban-col.alvo { background: var(--verde-claro); outline: 2px dashed var(--verde); }
.kanban-col header { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; padding: 4px 4px 8px; }
.kanban-col header strong { font-size: .85rem; }
.kanban-col header small { width: 100%; color: var(--suave); font-size: .72rem; }
.kanban-n { background: #fff; border-radius: 999px; padding: 0 8px; font-size: .75rem; font-weight: 700; }
.kanban-cards { display: grid; gap: 8px; align-content: start; }
.kanban-card { background: #fff; border-radius: 10px; padding: 10px; border-left: 4px solid #9AA5B8; box-shadow: 0 1px 2px rgba(15,30,63,.08); display: grid; gap: 3px; font-size: .78rem; }
.kanban-card[draggable="true"] { cursor: grab; }
.kanban-card.arrastando { opacity: .5; }
.kanban-card.movendo { opacity: .6; pointer-events: none; }
.kanban-card.t-quente { border-left-color: #E5484D; }
.kanban-card.t-morna { border-left-color: #F2A900; }
.kanban-card.t-fria { border-left-color: #4DA3FF; }
.kanban-nome { font-weight: 600; font-size: .85rem; color: var(--texto); text-decoration: none; }
.kanban-nome:hover { text-decoration: underline; }
.kanban-card small { color: var(--suave); }
.kanban-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 2px; }
.kanban-rodape { display: flex; justify-content: space-between; gap: 6px; margin-top: 4px; font-size: .72rem; color: var(--suave); }
.kanban-mover-form { margin: 0; }
.kanban-mover { margin-top: 4px; font-size: .72rem; padding: 3px 6px; min-height: 0; border: 1px solid var(--linha); border-radius: 6px; background: #f8fafc; width: 100%; }
.kanban-vazio { color: var(--suave); font-size: .75rem; text-align: center; margin: 12px 0; }
.pm-painel { margin-bottom: 1rem; }
.pm-legenda { font-size: .75rem; color: var(--suave); margin-bottom: 8px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pm-sw { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-left: 8px; }
.pm-sw.e, .pm-barra.e { background: #2563EB; }
.pm-sw.g, .pm-barra.g { background: #16A34A; }
.pm-grafico { display: flex; align-items: flex-end; gap: 6px; height: 200px; padding: 8px 2px 0; border-bottom: 1px solid var(--linha); overflow-x: auto; }
.pm-col { flex: 1 0 36px; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; min-width: 0; }
.pm-col small { font-size: .7rem; color: var(--suave); margin-top: 6px; white-space: nowrap; }
.pm-col.atual small { color: var(--texto); font-weight: 700; }
.pm-barras { display: flex; align-items: flex-end; gap: 3px; height: 160px; }
.pm-barra { width: 11px; border-radius: 4px 4px 0 0; }
.pm-col.prev .pm-barra { opacity: .4; outline: 1px dashed #1F2A44; }
.pm-previsao td { background: #F8FAFF; color: var(--suave); }
.pm-atual td { background: #FFF7ED; }
.pm-topo { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.pm-setas { display: inline-flex; align-items: center; gap: 10px; }
.pm-setas a { display: inline-flex; align-items: center; justify-content: center; min-width: 34px; height: 34px; border: 1px solid var(--linha); border-radius: 10px; text-decoration: none; color: var(--texto); font-weight: 700; font-size: 1.1rem; background: #fff; }
.pm-setas a:hover { border-color: var(--verde); color: var(--verde); }
.pm-setas a.pm-hoje { width: auto; padding: 0 12px; font-size: .85rem; }
.pm-setas strong { min-width: 110px; text-align: center; }
.pm-resumo { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.pm-card { background: #fff; border: 1px solid var(--linha); border-radius: 12px; padding: 18px 20px; }
.pm-titulo { margin: 0 0 14px; font-size: 1.05rem; }
.pm-titulo small { font-weight: 400; font-size: .8rem; color: var(--suave); margin-left: 6px; }
.pm-funil { border: 1px solid #DDE3EC; border-radius: 6px; overflow-x: auto; }
.pm-linha { display: grid; grid-template-columns: 150px 170px repeat(4, minmax(120px, 1fr)); min-width: 780px; border-top: 1px solid #DDE3EC; }
.pm-linha:first-child { border-top: 0; }
.pm-cab { background: #F4F7FB; font-weight: 600; font-size: .82rem; }
.pm-temp { display: flex; align-items: center; justify-content: center; padding: 6px 0; }
.pm-temp .pm-trap { display: flex; align-items: center; justify-content: center; width: 130px; height: 50px; color: #fff; font-weight: 700; text-shadow: 0 1px 2px rgba(0,0,0,.35); }
.pm-cab .pm-temp { color: var(--suave); }
.pm-nome { display: flex; align-items: center; padding: 0 12px; font-weight: 500; color: #2D3A55; }
.pm-col-h { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 8px; border-left: 1px solid #DDE3EC; text-align: center; }
.pm-cel { display: flex; align-items: center; justify-content: center; gap: 6px; border-left: 1px solid #DDE3EC; padding: 14px 8px; color: #1F6FD1; }
.pm-cel b { font-weight: 600; }
.pm-cel span { font-size: .8rem; }
.pm-cel.vazio { color: #6B7A90; }
.pm-cel-link { text-decoration: none; cursor: pointer; transition: background .15s; }
.pm-cel-link:hover { background: #EEF4FC; }
.pm-cel-link.sel { background: #E3EEFB; box-shadow: inset 0 -3px 0 #1F6FD1; }
.pm-acoes { display: flex; gap: 10px; flex-wrap: wrap; margin: 14px 0 10px; }
.pm-btn-azul { background: #1F6FD1; color: #fff; text-decoration: none; border-radius: 8px; padding: 9px 16px; font-weight: 600; font-size: .88rem; }
.pm-btn-azul:hover { background: #185BB2; }
.pm-saude-grid { display: grid; grid-template-columns: minmax(0, 1fr) 70px minmax(0, 1fr); gap: 10px; align-items: center; }
.pm-vel-wrap { grid-column: 1 / -1; display: flex; justify-content: center; }
.pm-velocimetro { width: 100%; max-width: 300px; height: auto; }
.pm-coluna { display: grid; gap: 10px; }
.pm-caixa { display: flex; align-items: center; gap: 8px; background: #F1F3F6; border: 1px solid #DDE3EC; border-radius: 4px; padding: 10px 12px; }
.pm-caixa span { flex: 1; min-width: 0; font-weight: 500; font-size: .75rem; color: #2D3A55; }
.pm-caixa .pm-op { font-weight: 700; font-size: 1.1rem; color: #2D3A55; width: 14px; text-align: center; }
.pm-caixa strong { white-space: nowrap; text-align: right; font-weight: 600; color: #2D3A55; }
.pm-seta-x4 { display: flex; flex-direction: column; align-items: center; gap: 4px; color: #2D3A55; font-weight: 600; font-size: .88rem; }
.pm-seta-x4 svg { width: 60px; height: 120px; }
.pm-drill { margin-top: 18px; }
.pm-drill-topo { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.pm-tab-drill a { color: #1F6FD1; text-decoration: none; }
.resumo-lead { display: flex; flex-wrap: wrap; gap: .3rem .9rem; margin-top: .35rem; font-size: .85rem; color: var(--suave); }
.etapas-lead { display: flex; flex-wrap: wrap; gap: 4px; margin-top: .9rem; }
.etapas-lead form { flex: 1 1 120px; margin: 0; }
.etapas-lead button { width: 100%; border: 1px solid var(--linha); background: #f1f5f9; color: var(--texto); padding: .45rem .5rem; font: inherit; font-size: .8rem; cursor: pointer; border-radius: 6px; }
.etapas-lead button small { color: var(--suave); }
.etapas-lead button.feita { background: var(--verde-claro); border-color: #99f6e4; }
.etapas-lead button.atual { background: var(--verde); color: #fff; border-color: var(--verde); font-weight: 600; }
.etapas-lead button.atual small { color: #e0f2f1; }
.etapas-lead button:hover:not(.atual) { border-color: var(--verde); }
.pm-resumo > *, .principal, .conteudo { min-width: 0; }
@media (max-width: 1000px) { .pm-resumo { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) { .pm-saude-grid { grid-template-columns: 1fr; } .pm-seta-x4 { display: none; } .filtros-funil .total-funil { margin-left: 0; width: 100%; } }

/* ===== Painel do cliente (fase 1): menu, painel, agenda em calendário, pacientes e prontuário ===== */
.menu-breve-item { display: flex; align-items: center; gap: .7rem; padding: .6rem .75rem; color: var(--suave); cursor: default; }
.menu-breve-item svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.menu-breve { margin-left: auto; font-style: normal; font-size: .68rem; background: #f1f5f9; border: 1px solid var(--linha); border-radius: 999px; padding: 0 .45rem; }
.selo-wa { display: inline-block; font-size: .66rem; font-weight: 700; color: #fff; background: #16a34a; border-radius: 999px; padding: 0 .45rem; line-height: 1.5; vertical-align: middle; }
.ponto-wa { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #16a34a; vertical-align: middle; }
.agenda-barra { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1rem; margin-bottom: .8rem; }
.agenda-barra .pm-alternar { margin: 0; }
.legenda-wa { font-size: .8rem; margin-left: auto; }
.consulta-link { text-decoration: none; color: inherit; border-radius: 8px; }
.consulta-link:hover { background: #f8fafc; }
.alerta-clinico { border: 2px solid #dc2626; background: #fef2f2; color: #7f1d1d; border-radius: 10px; padding: .55rem .8rem; margin-top: .7rem; }
.alerta-clinico ul { margin: .25rem 0 0; padding-left: 1.2rem; }
.modulos-plano { display: grid; gap: .5rem; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.modulo { border: 1px solid var(--linha); border-radius: 10px; padding: .55rem .7rem; display: grid; gap: .2rem; }
.modulo.fora { opacity: .65; }
.modulo .etiqueta { justify-self: start; }
/* semana */
.semana-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--linha); border-radius: var(--raio); }
.semana { display: grid; grid-template-columns: 54px repeat(7, minmax(120px, 1fr)); min-width: 900px; }
.semana-cab { padding: .45rem .3rem; text-align: center; font-size: .8rem; color: var(--suave); border-bottom: 1px solid var(--linha); text-decoration: none; }
.semana-cab strong { display: block; font-size: 1.05rem; color: var(--texto); }
.semana-cab.hoje strong { color: #fff; background: var(--verde); border-radius: 999px; width: 2rem; margin: 0 auto; }
.semana-horas div { height: var(--altura-hora); font-size: .7rem; color: var(--suave); text-align: right; padding-right: .35rem; transform: translateY(-.45rem); }
.semana-dia { position: relative; height: calc(var(--horas) * var(--altura-hora)); border-left: 1px solid var(--linha);
    background: repeating-linear-gradient(to bottom, transparent 0 calc(var(--altura-hora) - 1px), #eef2f2 calc(var(--altura-hora) - 1px) var(--altura-hora)); }
.semana-dia.hoje { background-color: #f0fdfa; }
.bloco { position: absolute; left: 3px; right: 3px; overflow: hidden; border-radius: 6px; padding: 2px 5px; font-size: .72rem; line-height: 1.25; text-decoration: none; color: var(--texto);
    background: color-mix(in srgb, var(--cor) 14%, #fff); border-left: 4px solid var(--cor); }
.bloco:hover { background: color-mix(in srgb, var(--cor) 24%, #fff); z-index: 2; }
.bloco strong, .bloco small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bloco .selo-wa { position: absolute; right: 3px; bottom: 2px; }
.bloco.st-confirmado { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--cor) 50%, #fff); }
.bloco.st-realizado { opacity: .7; } .bloco.st-faltou { opacity: .55; text-decoration: line-through; } .bloco.st-cancelado { opacity: .4; text-decoration: line-through; }
/* mês */
.mes-wrap { overflow-x: auto; }
.mes { display: grid; grid-template-columns: repeat(7, minmax(96px, 1fr)); min-width: 700px; background: var(--linha); gap: 1px; border: 1px solid var(--linha); border-radius: var(--raio); overflow: hidden; }
.mes-cab { background: #f8fafc; text-align: center; font-size: .78rem; color: var(--suave); padding: .35rem 0; }
.mes-dia { background: #fff; min-height: 104px; padding: .25rem .3rem; display: flex; flex-direction: column; gap: 2px; }
.mes-dia.fora { background: #fafafa; } .mes-dia.fora .mes-num { color: #cbd5e1; }
.mes-dia.hoje .mes-num { background: var(--verde); color: #fff; border-radius: 999px; }
.mes-num { align-self: flex-end; font-size: .8rem; text-decoration: none; color: var(--texto); min-width: 1.6rem; text-align: center; }
.mes-item { font-size: .72rem; text-decoration: none; color: var(--texto); border-left: 3px solid var(--cor); background: color-mix(in srgb, var(--cor) 10%, #fff); padding: 0 .3rem; border-radius: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mes-item.st-cancelado, .mes-item.st-faltou { text-decoration: line-through; opacity: .6; }
.mes-mais { font-size: .7rem; color: var(--verde); }
.legenda-profs { display: flex; flex-wrap: wrap; gap: .3rem 1rem; } .legenda-profs i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: .3rem; }
/* ficha do paciente */
.abas-ficha { display: flex; gap: .25rem; overflow-x: auto; margin: 1rem 0; border-bottom: 2px solid var(--linha); }
.abas-ficha a { padding: .55rem .85rem; text-decoration: none; color: var(--suave); font-weight: 600; font-size: .9rem; white-space: nowrap; border-bottom: 3px solid transparent; margin-bottom: -2px; }
.abas-ficha a.ativo { color: var(--verde-escuro); border-bottom-color: var(--verde); }
.grupo-campos { border: 1px solid var(--linha); border-radius: 10px; padding: .7rem .9rem; margin: 0 0 .9rem; }
.grupo-campos legend { font-weight: 700; padding: 0 .3rem; color: var(--verde-escuro); }
.pergunta { padding: .45rem 0; border-top: 1px dashed var(--linha); display: grid; gap: .3rem; }
.pergunta:first-of-type { border-top: 0; }
.pergunta .rotulo { font-weight: 500; }
.sim-nao { display: flex; flex-wrap: wrap; gap: .4rem 1rem; align-items: center; border: 0; padding: 0; margin: 0; }
.sim-nao legend { font-weight: 500; margin-bottom: .2rem; }
.sim-nao label { display: inline-flex; align-items: center; gap: .3rem; }
.sim-nao input[type=radio] { width: auto; min-height: 0; }
.sim-nao input:not([type]) { flex: 1; min-width: 180px; min-height: 36px; }
.respostas { display: grid; grid-template-columns: minmax(180px, 45%) 1fr; gap: .2rem .8rem; font-size: .88rem; }
.respostas dt { color: var(--suave); } .respostas dd { margin: 0; }
.barra-progresso { height: 10px; background: var(--linha); border-radius: 999px; overflow: hidden; margin: .4rem 0 .2rem; }
.barra-progresso span { display: block; height: 100%; background: var(--verde); }
.lista-simples { list-style: none; padding: 0; margin: .6rem 0 0; display: grid; gap: .35rem; }
.registro-curto { border-top: 1px solid var(--linha); padding: .5rem 0; }
.registro { margin-bottom: .8rem; border-left: 4px solid var(--verde); }
.registro.rascunho { border-left-color: #f59e0b; background: #fffbeb; }
.registro-texto { margin: .5rem 0 .3rem; }
.adendo { border-left: 3px solid #f59e0b; background: #fffbeb; padding: .4rem .6rem; margin-top: .5rem; border-radius: 0 8px 8px 0; }
.modelos-registro { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; }
.riscado td { text-decoration: line-through; color: var(--suave); }
.tabela tfoot td { border-top: 2px solid var(--linha); }
/* odontograma */
.odonto-layout { display: grid; gap: 1rem; grid-template-columns: minmax(0, 1fr); }
.odonto-layout > * { min-width: 0; }
@media (min-width: 1500px) { .odonto-layout { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; } }
.odontograma { overflow-x: auto; padding: .5rem 0; }
.arcada { display: flex; justify-content: center; gap: 2px; min-width: 720px; }
.arcada.deciduos { margin: .2rem 0; }
.arcada:not(.inferior) + .arcada.inferior { margin-top: 1.4rem; border-top: 2px solid var(--linha); padding-top: 1rem; }
.dente { display: flex; flex-direction: column; align-items: center; width: 42px; }
.arcada.inferior .dente { flex-direction: column-reverse; }
.dente svg { width: 40px; height: 60px; overflow: visible; }
.dente .face { stroke: #64748b; stroke-width: 1.2; cursor: pointer; }
.dente .face:hover { stroke: var(--verde); stroke-width: 2.5; }
.dente .face.face-escolhida { stroke: #f59e0b; stroke-width: 3.5; }
.dente.escolhido .num-dente { background: #f59e0b; color: #fff; }
.num-dente { border: 0; background: #f1f5f9; border-radius: 6px; font: inherit; font-size: .72rem; font-weight: 700; padding: 1px 5px; cursor: pointer; min-height: 0; margin: 2px 0; }
.dente.marcado .num-dente { background: #e0e7ff; }
.linha-media { width: 2px; background: #94a3b8; margin: 0 4px; align-self: stretch; }
.legenda-odonto { display: flex; flex-wrap: wrap; gap: .3rem 1rem; } .legenda-odonto i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: .3rem; }
.faces-campo { border: 0; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: .2rem .6rem; }
.faces-campo legend { font-weight: 500; margin-bottom: .2rem; }
.faces-campo[disabled] { opacity: .45; }
/* arquivos */
.galeria-docs { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.doc { margin: 0; border: 1px solid var(--linha); border-radius: 10px; overflow: hidden; display: flex; flex-direction: column; background: #fff; }
.doc.arquivado { opacity: .6; }
.doc-previa { display: flex; align-items: center; justify-content: center; height: 130px; background: #f1f5f9; text-decoration: none; }
.doc-previa img { width: 100%; height: 100%; object-fit: cover; }
.doc-icone { font-weight: 800; font-size: 1.3rem; color: #64748b; border: 2px solid #cbd5e1; border-radius: 8px; padding: .5rem .7rem; }
.doc figcaption { padding: .5rem .6rem; display: grid; gap: .15rem; font-size: .85rem; }
/* linha do tempo */
.linha-tempo { list-style: none; margin: 0; padding: 0; }
.linha-tempo li { display: grid; grid-template-columns: 2rem 1fr; gap: .5rem; padding: .55rem 0; border-top: 1px solid var(--linha); }
.linha-tempo li:first-child { border-top: 0; }
.lt-icone { font-size: 1.1rem; text-align: center; }
.lt-acesso { opacity: .75; font-size: .9rem; }
/* medidas (fase 2) */
.graficos-medidas { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.grafico-medida { margin: 0; }
.grafico-medida figcaption { font-size: .88rem; gap: .5rem; flex-wrap: wrap; }
.grafico-medida svg { width: 100%; height: auto; display: block; }

/* Simular por especialidade */
.simular-especialidades { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); margin-top: .75rem; }
.simular-esp { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .3rem .75rem; align-items: start; margin: 0; }
.simular-esp h3 { margin: 0 0 .15rem; font-size: 1.05rem; }
.simular-esp small { display: block; }
.simular-esp form, .simular-esp > .aviso { grid-column: 1 / -1; }
.simular-esp form .botao { width: 100%; }
.simular-esp-icone { font-size: 1.8rem; line-height: 1; }
.painel-especialidade { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .75rem; align-items: center; margin-bottom: 1rem; border-left: 4px solid var(--verde); }
.painel-especialidade .icone-grande { font-size: 2.2rem; line-height: 1; }
.painel-especialidade h2 { margin: 0 0 .2rem; }
.atalhos-esp { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .5rem; }
.ferramentas-esp { margin: .5rem 0 0; padding-left: 1.1rem; }
.ferramentas-esp li { margin: .15rem 0; }
@media (max-width: 600px) {
    .painel-especialidade { grid-template-columns: minmax(0, 1fr); }
    .painel-especialidade .icone-grande { display: none; }
}

/* CRM de pacientes */
.kpi-link { color: inherit; text-decoration: none; }
.kpi-link:hover { outline: 2px solid var(--verde-claro); }
.pm-sw.a, .pm-barra.a { background: #D97706; }
.kanban-col[style*="--cor-etapa"] header { border-top: 4px solid var(--cor-etapa); border-radius: 6px 6px 0 0; padding-top: 8px; }
.barras-funil { display: grid; gap: .45rem; }
.barra-funil { display: grid; grid-template-columns: minmax(0, 11rem) minmax(0, 1fr) auto; gap: .6rem; align-items: center; font-size: .9rem; }
.barra-funil-trilho { height: 14px; background: #EDEFF3; border-radius: 999px; overflow: hidden; }
.barra-funil-trilho > span { display: block; height: 100%; border-radius: 999px; }
.linha-fina { padding: .4rem 0; border-top: 1px solid var(--linha); gap: .6rem; }
.linha-fina:first-of-type { border-top: 0; }
.linha-atividade { display: grid; grid-template-columns: 1.6rem minmax(0, 1fr); gap: .4rem; padding: .55rem 0; border-top: 1px solid var(--linha); color: inherit; text-decoration: none; }
a.linha-atividade:hover { background: var(--fundo, #f8fafc); }
.orcamento-crm, .retorno-crm { margin-bottom: .8rem; }
.orcamento-valor { text-align: right; display: grid; gap: .25rem; justify-items: end; }
.orcamento-valor strong { font-size: 1.15rem; }
.orcamento-status { display: flex; flex-wrap: wrap; gap: .3rem 1rem; margin: .45rem 0; font-size: .88rem; }
.acao-crm { display: block; }
.acao-crm[open] { flex-basis: 100%; order: 10; }
.acao-crm[open] > form, .acao-crm[open] > p { background: #F8FAFC; border: 1px solid var(--linha); border-radius: 10px; padding: .75rem; margin: .4rem 0 0; }
.acao-crm > summary { list-style: none; cursor: pointer; }
.acao-crm > summary::-webkit-details-marker { display: none; }
.tarefa-crm { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem; padding: .6rem 0; border-top: 1px solid var(--linha); }
.tarefa-crm:first-of-type { border-top: 0; }
.tarefa-concluir, .adiar-crm { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }
.tarefa-concluir input { min-width: 0; width: 14rem; max-width: 100%; }
.previa-wa { background: #E7F8EE; border-radius: 10px; padding: .6rem .8rem; margin: .6rem 0; }
.previa-wa p { margin: .2rem 0 0; white-space: pre-line; }
.relacionamento > div { min-width: 0; }
@media (max-width: 600px) {
    .barra-funil { grid-template-columns: minmax(0, 1fr) auto; }
    .barra-funil-trilho { grid-column: 1 / -1; grid-row: 2; }
    .orcamento-crm > .entre { flex-wrap: wrap; }
    .orcamento-valor { justify-items: start; text-align: left; }
}
.adiar-crm select { width: auto; min-width: 0; }
.adiar-crm { flex-wrap: nowrap; }
.form [hidden], .form label[hidden] { display: none !important; }

/* Gestão Financeira */
.pm-sw.s, .pm-barra.s { background: #DC2626; }
.filtro-data { display: flex; align-items: center; gap: .3rem; font-size: .88rem; white-space: nowrap; }
.filtro-data input { width: auto; }
.pix-bloco { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 1rem; align-items: start; }
.pix-qr { width: 190px; height: 190px; border: 1px solid var(--linha); border-radius: 8px; }
.pix-copia { width: 100%; font-family: ui-monospace, monospace; font-size: .78rem; word-break: break-all; resize: none; }
.cobrar-consulta { margin: .5rem 0; background: #F8FAFC; border: 1px solid var(--linha); border-radius: 10px; padding: .75rem; }
.form label.check, label.check { display: flex; flex-direction: row; align-items: center; gap: .4rem; }
.form label.check input, label.check input { width: auto; }
@media (max-width: 600px) {
    .pix-bloco { grid-template-columns: minmax(0, 1fr); justify-items: center; }
}
.linha-atividade .entre > strong, .linha-fina > strong, .orcamento-valor strong { white-space: nowrap; }
@media (max-width: 600px) { .adiar-crm { flex-wrap: wrap; } .adiar-crm select { max-width: 100%; } }

/* Logotipo BrAInSalus (imagem) */
.marca .logo-simbolo { width: 40px; height: 40px; object-fit: contain; flex: none; }
.marca .logo-nome { width: 132px; height: auto; flex: none; }
.marca.grande { flex-direction: column; }
.marca .logo-completo { width: 220px; max-width: 70vw; height: auto; display: block; margin: 0 auto .25rem; }
.menu.menu-sistema .marca { gap: .35rem; align-items: center; }

/* Periograma */
.perio-grade { display: grid; gap: .8rem; }
.perio-secao { border: 1px solid var(--linha); border-radius: 10px; }
.perio-tabela { border-collapse: collapse; font-size: .78rem; }
.perio-tabela th, .perio-tabela td { border: 1px solid #eef0f3; padding: 1px; text-align: center; min-width: 22px; }
.perio-tabela th { background: #f8fafc; font-weight: 600; }
.perio-tabela th.perio-rot { text-align: left; padding: 2px 6px; min-width: 104px; position: sticky; left: 0; z-index: 1; white-space: nowrap; }
.perio-tabela td.ausente, .perio-tabela th.ausente { background: repeating-linear-gradient(45deg, #f1f5f9, #f1f5f9 4px, #e2e8f0 4px, #e2e8f0 8px); }
.perio-tabela select { font-size: .72rem; padding: 0 2px; width: 100%; min-width: 0; border: 0; background: transparent; }
.perio-num { width: 22px; height: 22px; padding: 0; text-align: center; font-size: .8rem; border: 1px solid #e2e8f0; border-radius: 4px; }
.perio-num.ps4 { background: #fee2e2; border-color: #fca5a5; }
.perio-num.ps6 { background: #dc2626; color: #fff; }
.perio-num:disabled { background: transparent; border-color: transparent; color: inherit; }
.perio-num.ps4:disabled { color: #b91c1c; font-weight: 700; background: transparent; }
.perio-num.ps6:disabled { color: #fff; background: #dc2626; }
.perio-toggle { width: 16px; height: 16px; border-radius: 50%; border: 1px solid #cbd5e1; background: #fff; padding: 0; cursor: pointer; }
.perio-toggle:disabled { cursor: default; }
.perio-toggle.sang.on { background: #dc2626; border-color: #dc2626; }
.perio-toggle.sup.on { background: #eab308; border-color: #eab308; }
.perio-toggle.placa.on { background: #2563eb; border-color: #2563eb; }
.perio-nic { color: #475569; }
.perio-nic.alto { color: #b91c1c; font-weight: 700; }
.perio-graf { padding: 0 !important; }
.perio-legenda { display: inline-block; width: 10px; height: 10px; border-radius: 50%; vertical-align: middle; }
.perio-legenda.sang { background: #dc2626; } .perio-legenda.sup { background: #eab308; } .perio-legenda.placa { background: #2563eb; }
.perio-melhor { color: #15803d; }
.orto-procs { display: flex; flex-wrap: wrap; gap: .3rem 1rem; border: 1px solid var(--linha); border-radius: 8px; padding: .5rem .7rem; }
.orto-procs legend { font-size: .85rem; padding: 0 .3rem; }
.orto-manut { display: block; }

/* Pop-up (dialog) */
.popup { border: 0; border-radius: 14px; padding: 0; width: min(640px, calc(100vw - 1.5rem)); max-height: calc(100vh - 2rem); box-shadow: 0 20px 50px rgba(15, 23, 42, .25); }
.popup::backdrop { background: rgba(15, 23, 42, .45); }
.popup-topo { display: flex; justify-content: space-between; align-items: center; gap: .6rem; padding: .8rem 1rem; border-bottom: 1px solid var(--linha); position: sticky; top: 0; background: #fff; z-index: 1; }
.popup-fechar { background: none; border: 0; font-size: 1.1rem; cursor: pointer; padding: .2rem .4rem; border-radius: 6px; }
.popup-fechar:hover { background: #f1f5f9; }
.popup-corpo { padding: 1rem; overflow: auto; }
.popup-corpo:empty::before { content: 'Carregando…'; color: var(--suave); }
.kpi strong b[data-ind] { font: inherit; }
.perio-tabela select:disabled { appearance: none; -webkit-appearance: none; color: inherit; text-align: center; text-align-last: center; opacity: 1; }

/* Implantes */
.implante-dente { display: inline-grid; place-items: center; min-width: 2.2rem; height: 2.2rem; border-radius: 8px; background: #e0f2fe; color: #075985; font-size: 1rem; margin-right: .3rem; }
.implante-perdido { opacity: .75; }
.implante-perdido .implante-dente { background: #fee2e2; color: #991b1b; }
.implante-fases { list-style: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .3rem; padding: 0; margin: .7rem 0 .3rem; }
.implante-fases li { border-top: 4px solid #e2e8f0; padding-top: .3rem; font-size: .82rem; display: grid; }
.implante-fases li.feita { border-color: #0f766e; }
.implante-fases li.atual { border-color: #2563eb; }
.implante-fases li small { color: var(--suave); }
.implante-grupo label { flex: 1 1 11rem; }
.orto-procs { min-width: 0; }
.implante-grupo label { min-width: 0; }
.implante-grupo input, .implante-grupo select { width: 100%; min-width: 0; }

/* Topo: nome e perfil de quem está usando, ao lado do botão da conta */
.conta-quem { margin-left: auto; display: grid; text-align: right; line-height: 1.2; min-width: 0; max-width: 40vw; }
.conta-quem strong { font-size: .92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conta-quem small { color: var(--suave); font-size: .78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conta-quem + .conta { margin-left: -.4rem; }
@media (max-width: 600px) { .conta-quem { max-width: 30vw; } .conta-quem strong { display: none; } .conta-quem small { font-size: .72rem; white-space: normal; line-height: 1.15; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; } }
@media (max-width: 600px) { .conta-quem { max-width: 36vw; } .conta-quem small { text-overflow: clip; overflow-wrap: anywhere; } }

/* ===== Cash Flow (fluxo de caixa), no modelo do IronTeam ===== */
.marcar { display: inline-flex; align-items: center; gap: .4rem; font-size: .85rem; cursor: pointer; }
.marcar input { width: auto; min-height: 0; }
:is(.conf-contas, .fluxo-tabela, .fluxo-extrato, .det-extrato) .entrada, .det-total.entrada { color: #12784A; }
:is(.conf-contas, .fluxo-tabela, .fluxo-extrato, .det-extrato) .saida, .det-total.saida { color: #A42323; }
.conferencia { border-left: 4px solid var(--linha); padding: .8rem 1rem; margin-bottom: 1rem; }
.conferencia.conf-ok { border-left-color: #16a34a; background: #F4FBF7; }
.conferencia.conf-aviso { border-left-color: #D69E2E; background: #FFFBF1; }
.conferencia.conf-erro { border-left-color: var(--vermelho); background: #FFF6F6; }
.conf-cab { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: baseline; }
.conf-cab strong { font-size: 1rem; }
.conf-ok .conf-cab strong { color: #15803d; } .conf-erro .conf-cab strong { color: var(--vermelho); } .conf-aviso .conf-cab strong { color: #8A5A12; }
.conf-cab span { color: var(--suave); font-size: .82rem; }
.conf-lista { margin: .5rem 0 .25rem; padding-left: 1.1rem; font-size: .86rem; display: grid; gap: 3px; }
.conf-lista li.erro { color: #9B2323; }
.conf-contas { display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: .8rem; color: var(--suave); margin-top: .4rem; }
.conf-contas b { color: var(--texto); font-weight: 600; }
.fluxo-filtros .vis-escala, .fluxo-filtros .vis-nav { display: inline-flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.fluxo-filtros .botao.pequeno { min-height: 32px; padding: .2rem .6rem; font-size: .8rem; }
.fluxo-filtros .botao.ativo { background: var(--verde); color: #fff; border-color: var(--verde); }
.fluxo-rot { font-size: .78rem; color: var(--suave); margin-right: 2px; }
.fluxo-janela { color: var(--suave); font-size: .82rem; margin-left: auto; }
.fluxo-kpis { margin-bottom: 1rem; }
@media (min-width: 900px) { .fluxo-kpis { grid-template-columns: repeat(5, 1fr); } }
.kpi strong.entrada { color: #12784A; } .kpi strong.saida { color: #A42323; }
.kpi.alerta { border-color: #F3B1B3; background: #FFF8F8; } .kpi.alerta strong { color: #A42323; }
.fluxo-legenda { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .8rem; color: var(--suave); margin-bottom: 8px; }
.fluxo-legenda i { display: inline-block; width: 14px; height: 10px; margin-right: 5px; vertical-align: -1px; border-radius: 2px; }
.lg-ent { background: #18A058; } .lg-sai { background: #E5484D; }
.lg-saldo { background: #334155; height: 3px !important; vertical-align: 3px !important; }
.lg-hoje { background: #FEF3C7; border: 1px solid #FCD34D; }
.lg-prev { background: repeating-linear-gradient(45deg, #18A058 0 2px, #DDF3E6 2px 5px); }
.fluxo-dica { margin-left: auto; font-size: .76rem; color: var(--suave); }
.fluxo-area { position: relative; width: 100%; }
.fluxo-svg { display: block; width: 100%; height: 320px; user-select: none; }
.fluxo-barra { cursor: pointer; transition: opacity .12s; }
.fluxo-barra:hover { opacity: .8; }
.fluxo-barra.sel { stroke: #1f2937; stroke-width: 2; }
.fluxo-faixa { cursor: pointer; }
.fluxo-tip { position: absolute; z-index: 5; width: 250px; pointer-events: none; background: #1f2937; color: #fff; border-radius: 8px; padding: 8px 10px; font-size: .8rem; box-shadow: 0 6px 18px rgba(0,0,0,.2); }
.fluxo-tip small { color: #cbd5e1; }
.fluxo-tip div { display: flex; justify-content: space-between; gap: 8px; }
.fluxo-tip .e span::before, .fluxo-tip .s span::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; }
.fluxo-tip .e span::before { background: #18A058; } .fluxo-tip .s span::before { background: #E5484D; }
.fluxo-tip .ativo { font-weight: 700; color: #99f6e4; }
.fluxo-tip .sd { border-top: 1px solid #475569; margin-top: 4px; padding-top: 4px; }
.fluxo-tip em { display: block; color: #cbd5e1; font-size: .74rem; margin-top: 4px; }
.fluxo-cursor { display: block; width: 100%; height: 64px; margin: 4px 0 14px; cursor: grab; touch-action: none; user-select: none; }
.fluxo-cursor:focus-visible { outline: 2px solid var(--verde); outline-offset: 2px; border-radius: 4px; }
.fluxo-cursor .cur-sel { cursor: grab; } .fluxo-cursor .cur-alca { cursor: ew-resize; }
.fluxo-detalhe { border: 1px solid var(--linha); border-left: 4px solid var(--verde); border-radius: 8px; padding: .8rem .9rem; margin: 6px 0 14px; background: #fff; }
.fluxo-detalhe .det-cab { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.fluxo-detalhe .det-cab small { color: var(--suave); }
.fluxo-detalhe .det-total { font-size: 1.35rem; font-weight: 700; }
.fluxo-detalhe .det-total small { font-size: .8rem; font-weight: 400; }
.fluxo-detalhe .det-acoes { display: flex; flex-wrap: wrap; gap: 6px; align-items: flex-start; }
.det-marca { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 8px; vertical-align: 1px; }
.det-marca.ent { background: #18A058; } .det-marca.sai { background: #E5484D; }
.det-marca.pent { background: repeating-linear-gradient(45deg, #18A058 0 2px, #DDF3E6 2px 5px); }
.det-marca.psai { background: repeating-linear-gradient(45deg, #E5484D 0 2px, #FBE3E3 2px 5px); }
.det-cats { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 4px 0 8px; font-size: .82rem; color: var(--suave); }
.det-cat { border: 1px solid var(--linha); background: #fff; border-radius: 14px; padding: 3px 10px; font: inherit; font-size: .8rem; cursor: pointer; color: var(--texto); min-height: 0; }
.det-cat small { color: var(--suave); }
.det-cat.ativa { background: #FFE27A; border-color: #E0B400; }
.det-so { margin: 2px 0 6px; }
.det-extrato tr.det-dest td { background: #FFE27A; font-weight: 600; }
.det-extrato tr.det-dest-ent td:first-child { box-shadow: inset 4px 0 0 #18A058; }
.det-extrato tr.det-dest-sai td:first-child { box-shadow: inset 4px 0 0 #E5484D; }
.det-extrato tr.det-apagada td, .det-extrato tr.det-apagada td a, .det-extrato tr.det-apagada .favorecido { color: #9AA1AB; }
.det-extrato tr.det-prev td { font-style: italic; }
.fluxo-tabela a { color: inherit; } .fluxo-tabela a:hover { text-decoration: underline; }
.fluxo-tabela tr.linha-sel td { background: #FEF3C7; }
.fluxo-tabela td.prev { opacity: .8; font-style: italic; }
tr.fluxo-hoje td { background: #FEF3C7; color: #A16207; font-weight: 600; font-size: .82rem; }
tr.fluxo-prev td { color: var(--suave); }
tr.fluxo-atrasado td, tr.fluxo-atrasado td a { color: #A42323; }
tr.saldo-ant td { background: #F8FAFC; }
@media (max-width: 640px) {
    .fluxo-dica, .fluxo-janela { display: none; }
    .fluxo-tip { width: 200px; }
    .fluxo-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .fluxo-kpis .kpi { min-width: 0; padding: .7rem .75rem; }
    .fluxo-kpis .kpi strong { font-size: 1.1rem; overflow-wrap: anywhere; }
    .fluxo-detalhe .det-total { font-size: 1.1rem; }
}

/* ===== Implantação de clientes (Painel do sistema) ===== */
.impl-trilho { display: block; height: 8px; background: #eef2f2; border-radius: 6px; overflow: hidden; flex: 1; min-width: 60px; }
.impl-trilho i { display: block; height: 100%; background: var(--verde); border-radius: 6px; }
.impl-etapas-barras { display: grid; gap: .35rem; margin-top: .6rem; }
.impl-etapa-linha { display: grid; grid-template-columns: minmax(120px, 220px) 1fr 2.5rem; gap: .6rem; align-items: center; text-decoration: none; color: inherit; padding: .2rem .3rem; border-radius: 8px; }
.impl-etapa-linha:hover { background: var(--fundo); }
.impl-etapa-linha strong { text-align: right; }
.impl-pend { display: flex; justify-content: space-between; gap: .6rem; padding: .55rem 0; border-top: 1px solid var(--linha); }
.impl-cabeca { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; align-items: flex-start; }
.impl-progresso { display: grid; justify-items: end; gap: .2rem; min-width: 200px; }
.impl-progresso strong { font-size: 1.6rem; color: var(--verde-escuro); line-height: 1; }
.impl-progresso .impl-trilho { width: 200px; flex: none; }
.impl-passos { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; gap: .5rem; }
.impl-passo { display: flex; gap: .75rem; align-items: flex-start; background: var(--branco); border: 1px solid var(--linha); border-radius: var(--raio); padding: .7rem .9rem; }
.impl-passo.atual { border-color: var(--verde); box-shadow: 0 0 0 2px var(--verde-claro); }
.impl-passo.feita { background: #f6fbfa; }
.impl-passo.feita .impl-icone { background: var(--verde); color: #fff; }
.impl-passo.vazia { opacity: .55; }
.impl-icone { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: #eef2f2; color: var(--verde-escuro); }
.impl-icone svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.impl-falta { margin: .4rem 0 0; padding-left: 1.1rem; font-size: .88rem; }
.impl-check { margin-bottom: .8rem; }
.impl-item { display: grid; grid-template-columns: 1.6rem 1fr auto; gap: .6rem; align-items: start; padding: .6rem 0; border-top: 1px solid var(--linha); }
.impl-marca { font-weight: 700; color: var(--suave); text-align: center; }
.impl-item.feito .impl-marca { color: var(--verde); }
.impl-item.feito strong, .impl-item.dispensado strong { color: var(--suave); }
.impl-item.dispensado strong { text-decoration: line-through; }
.impl-item .etiqueta { margin-left: .3rem; }
.impl-tempo { list-style: none; margin: 0; padding: 0 0 0 1rem; border-left: 2px solid var(--verde-claro); display: grid; gap: .55rem; }
.impl-ev { position: relative; background: var(--branco); border: 1px solid var(--linha); border-radius: 10px; padding: .5rem .75rem; }
.impl-ev::before { content: ""; position: absolute; left: calc(-1rem - 6px); top: .8rem; width: 10px; height: 10px; border-radius: 50%; background: var(--verde); }
.impl-ev.pendencia::before { background: #dc2626; } .impl-ev.nota::before, .impl-ev.contato::before { background: var(--azul); } .impl-ev.etapa::before { background: #f59e0b; }
.impl-pendencia { margin-bottom: .7rem; }
.impl-pendencia.atrasada { border-color: #fca5a5; }
.impl-pendencia.resolvida { opacity: .75; }
.impl-editar input, .impl-editar select { width: 100%; min-height: 38px; }
.impl-editar td:nth-child(1) { min-width: 200px; } .impl-editar td:nth-child(2) { min-width: 260px; }
.impl-subtitulo { font-size: .95rem; margin: .9rem 0 .3rem; }
.impl-comuns { margin: 0; padding-left: 1.1rem; display: grid; gap: .35rem; font-size: .9rem; }
@media (max-width: 640px) {
    .impl-item { grid-template-columns: 1.4rem 1fr; }
    .impl-item form { grid-column: 2; }
    .impl-progresso { justify-items: start; }
    .impl-etapa-linha { grid-template-columns: minmax(90px, 1fr) 1fr 2rem; }
}

/* Implantação, fase 2: Primeiros passos da clínica, assistente de IA e lembretes */
.passos-titulo { font-size: 1.05rem; margin: 1rem 0 .5rem; }
.passos-proximos { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); margin-bottom: 1rem; }
.passo-card h3 { margin: .45rem 0 .2rem; font-size: 1rem; }
.passo-card p { margin: 0 0 .6rem; font-size: .9rem; }
.passos-grade { display: grid; gap: 1rem; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1000px) { .passos-grade { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; } }
.passos-sugestoes { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .5rem; }
.chip { border: 1px solid var(--linha); background: var(--branco); border-radius: 999px; padding: .3rem .7rem; font-size: .85rem; cursor: pointer; color: var(--texto); font: inherit; font-size: .85rem; }
.chip:hover { border-color: var(--verde); color: var(--verde-escuro); }
.passos-etapa { margin-bottom: .6rem; }
.passos-etapa summary { cursor: pointer; display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }
.passos-pedidos { list-style: none; padding: 0; margin: 0; display: grid; gap: .45rem; font-size: .9rem; }
.bolha.entrada.equipe, .bolha.saida.equipe { background: #eef2ff; }
.bolha.saida.assistente { background: var(--verde-claro); }
.bolha a { word-break: break-all; }
.impl-lembrete { border-top: 1px solid var(--linha); padding: .45rem 0; }
.impl-lembrete summary { cursor: pointer; }
.impl-lembrete-texto { white-space: pre-wrap; font-size: .88rem; background: #f7f9f9; padding: .6rem; border-radius: 8px; margin-top: .4rem; word-break: break-word; }

/* Implantação, fase 3: Treinamento (trilhas de vídeos por perfil e especialidade) */
.treino-kpis .kpi.ok { border-color: #A8DCC1; background: #F3FBF7; }
.treino-busca { display: flex; gap: .5rem; margin: 0 0 .7rem; }
.treino-busca input { flex: 1; min-width: 0; }
.treino-lista { display: grid; gap: .55rem; }
.treino-aula { display: grid; grid-template-columns: 2.6rem minmax(0, 1fr); gap: .8rem; align-items: start; color: inherit; text-decoration: none; padding: .75rem .9rem; }
.treino-aula:hover { outline: 2px solid var(--verde-claro); }
.treino-aula strong { display: block; }
.treino-capa { width: 2.6rem; height: 2.6rem; border-radius: 10px; background: var(--verde-claro); color: var(--verde-escuro); display: grid; place-items: center; font-weight: 700; }
.treino-aula.feita .treino-capa { background: var(--verde); color: #fff; }
.treino-texto { display: grid; gap: .15rem; min-width: 0; }
.treino-meta { display: flex; gap: .35rem; flex-wrap: wrap; align-items: center; margin-top: .2rem; }
.treino-grade { display: grid; gap: 1rem; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1000px) { .treino-grade { grid-template-columns: minmax(0, 1fr) 300px; align-items: start; } }
.treino-player { position: relative; aspect-ratio: 16 / 9; background: #0f2a2a; border-radius: var(--raio); overflow: hidden; }
.treino-player iframe, .treino-player video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #000; }
.treino-producao { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: .5rem; color: #e6f2f2; text-align: center; padding: 1rem; }
.treino-producao > span { font-size: 2.4rem; opacity: .6; }
.treino-producao small { color: #b9d3d3; max-width: 32rem; }
.treino-player.sem-video { aspect-ratio: auto; min-height: 10rem; }
.treino-passos { margin: 0; padding-left: 1.3rem; display: grid; gap: .35rem; }
.treino-indice { list-style: none; margin: 0; padding: 0; display: grid; gap: .2rem; font-size: .9rem; }
.treino-indice li { padding: .3rem .4rem; border-radius: 8px; }
.treino-indice li a { color: inherit; text-decoration: none; }
.treino-indice li.atual { background: var(--verde-claro); font-weight: 600; }
.treino-indice li.feita span { color: var(--verde); }
.treino-fonte { border: 1px solid var(--linha); border-radius: var(--raio); padding: .6rem .8rem; display: grid; gap: .5rem; }
tr.apagado { opacity: .55; }

/* Menu lateral: nada passa da largura do menu (as setas de mostrar/ocultar de todos os submenus ficam sempre à vista)
   e a largura é ajustável pelo divisor (arrastar; duplo clique volta ao padrão) */
.menu-sistema .submenu { grid-template-columns: minmax(0, 1fr); }
.menu-sistema .menu-no, .menu-sistema .menu-ramo { min-width: 0; }
.menu-sistema a > span { min-width: 0; overflow-wrap: anywhere; }
@media (min-width: 900px) {
    .app.app-sistema { grid-template-columns: var(--menu-largura, 260px) minmax(0, 1fr); }
    .menu.menu-sistema { overflow-x: hidden; }
    .menu-divisor { position: fixed; top: 0; bottom: 0; left: calc(var(--menu-largura, 260px) - 4px); width: 8px; cursor: col-resize; z-index: 15; touch-action: none; }
    .menu-divisor::after { content: ""; position: absolute; top: 0; bottom: 0; left: 3px; width: 2px; background: transparent; transition: background .15s; }
    .menu-divisor:hover::after, .menu-divisor:focus-visible::after, .arrastando-menu .menu-divisor::after { background: var(--verde); }
    .menu-divisor:focus-visible { outline: none; }
    .arrastando-menu { cursor: col-resize; user-select: none; }
}
@media (max-width: 899px) { .menu-divisor { display: none; } }
/* duas colunas: o conteúdo largo (tabelas) rola dentro do cartão em vez de alargar a página */
.grade2 { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .grade2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }

/* Simular acesso: linhas de pessoas e o link "Simular outro" na faixa roxa */
.simular-linha { border-top: 1px solid var(--linha); padding: .45rem 0; gap: .6rem; flex-wrap: wrap; }
.simular-linha span { min-width: 0; overflow-wrap: anywhere; }
.faixa-simulacao .faixa-outro { color: #fff; text-decoration: underline; font-weight: 600; }
.filtros-funil select, .filtros-funil input { max-width: 100%; } /* nomes longos (ex.: clínicas) não alargam a página no celular */

/* Alertas do menu: o que o número vermelho conta, no topo da tela, e os itens contados marcados */
.aviso.alerta-menu { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; display: flex; gap: .6rem; align-items: flex-start; }
.aviso.alerta-menu .contador { flex: none; font-style: normal; background: #dc2626; color: #fff; border-radius: 999px; font-size: .78rem; padding: .05rem .5rem; min-width: 1.4rem; text-align: center; margin-top: .1rem; }
.aviso.alerta-menu small { color: #b91c1c; }
.cartao.alerta-item { box-shadow: 0 0 0 2px #fca5a5; border-left: 4px solid #dc2626; }
tr.alerta-item > td { background: #fef2f2; }
tr.alerta-item > td:first-child { box-shadow: inset 3px 0 0 #dc2626; }
.menu-sistema .contador[title] { cursor: help; }
