:root {
  --verde: #8a6d36; --verde-esc: #2e2a25; --verde-claro: #f4efe4; --ouro: #b8955a; --ouro-claro: #f6efe0;
  --fundo: #f7f5f1; --cartao: #ffffff; --texto: #26221d; --suave: #6e675c; --linha: #e6e0d6;
  --vermelho: #c0392b; --vermelho-claro: #fdecea; --laranja: #d9822b; --laranja-claro: #fdf1e4; --azul: #2f6fd6; --azul-claro: #e8f0fd;
  --roxo: #7b4fc2; --sombra: 0 1px 2px rgba(16, 40, 38, .06), 0 4px 14px rgba(16, 40, 38, .06); --raio: 12px;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--texto); font-size: 14px;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--fundo); }
a { color: var(--verde); text-decoration: none; }
button { font: inherit; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: -.01em; }
h1 { font-size: 22px; } h2 { font-size: 17px; } h3 { font-size: 15px; }
.muted { color: var(--suave); } .small { font-size: 12px; } .right { text-align: right; } .nowrap { white-space: nowrap; }
.oculto { display: none !important; }

/* ---------- estrutura ---------- */
.app { display: grid; grid-template-columns: 228px 1fr; min-height: 100vh; }
.lateral { background: var(--verde-esc); color: #dfeeed; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.marca { display: flex; gap: 10px; align-items: center; padding: 18px 18px 14px; }
.marca svg { flex: none; }
.marca b { display: block; color: #fff; font-size: 16px; }
.marca span { font-size: 11px; color: #9fc6c3; }
.menu { list-style: none; margin: 0; padding: 6px 10px; flex: 1; overflow: auto; }
.menu a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 9px; color: #cfe4e2; font-weight: 500; }
.menu a:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.menu a.ativo { background: rgba(255, 255, 255, .13); color: #fff; }
.menu .bolha { margin-left: auto; background: var(--ouro); color: #2b2205; font-size: 11px; font-weight: 700; border-radius: 10px; padding: 1px 7px; }
.menu svg { width: 18px; height: 18px; flex: none; opacity: .9; }
.rodape-lat { padding: 12px 18px; font-size: 11px; color: #8fb8b5; border-top: 1px solid rgba(255, 255, 255, .08); }
.principal { min-width: 0; display: flex; flex-direction: column; }
.topo { display: flex; align-items: center; gap: 12px; padding: 12px 24px; background: var(--cartao); border-bottom: 1px solid var(--linha); position: sticky; top: 0; z-index: 20; }
.busca-global { flex: 1; max-width: 460px; position: relative; }
.busca-global input { width: 100%; border: 1px solid var(--linha); background: var(--fundo); border-radius: 10px; padding: 9px 12px 9px 34px; }
.busca-global svg { position: absolute; left: 10px; top: 10px; width: 16px; height: 16px; color: var(--suave); }
.busca-res { position: absolute; top: 42px; left: 0; right: 0; background: #fff; border: 1px solid var(--linha); border-radius: 10px; box-shadow: var(--sombra); max-height: 380px; overflow: auto; z-index: 30; }
.busca-res a { display: block; padding: 9px 12px; color: var(--texto); border-bottom: 1px solid var(--linha); }
.busca-res a:hover, .busca-res a.sel { background: var(--verde-claro); }
.quem { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--ouro-claro); color: #7a5d16; display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.conteudo { padding: 22px 24px 60px; }
.cabeca { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.cabeca .acoes { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- componentes ---------- */
.cartao { background: var(--cartao); border-radius: var(--raio); box-shadow: var(--sombra); padding: 16px 18px; }
.grade { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-2-1 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.kpi { padding: 14px 16px; }
.kpi .rot { font-size: 12px; color: var(--suave); font-weight: 500; }
.kpi .val { font-size: 24px; font-weight: 700; margin-top: 4px; letter-spacing: -.02em; }
.kpi .sub { font-size: 12px; color: var(--suave); margin-top: 2px; }
.kpi.alerta .val { color: var(--vermelho); }
.btn { border: 1px solid var(--linha); background: #fff; color: var(--texto); border-radius: 9px; padding: 8px 14px; font-weight: 550; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.btn:hover { border-color: #b9c9c7; }
.btn.prim { background: var(--verde); border-color: var(--verde); color: #fff; }
.btn.prim:hover { background: var(--verde-esc); }
.btn.ouro { background: var(--ouro); border-color: var(--ouro); color: #2b2205; }
.btn.zap { background: #1fa855; border-color: #1fa855; color: #fff; }
.btn.perigo { color: var(--vermelho); }
.btn.peq { padding: 4px 10px; font-size: 12.5px; border-radius: 7px; }
.btn:disabled { opacity: .5; cursor: default; }
.tag { display: inline-block; font-size: 11.5px; font-weight: 600; border-radius: 6px; padding: 2px 8px; background: var(--fundo); color: var(--suave); white-space: nowrap; }
.tag.verde { background: var(--verde-claro); color: var(--verde); } .tag.ouro { background: var(--ouro-claro); color: #7a5d16; }
.tag.vermelho { background: var(--vermelho-claro); color: var(--vermelho); } .tag.azul { background: var(--azul-claro); color: var(--azul); }
.tag.laranja { background: var(--laranja-claro); color: var(--laranja); } .tag.roxo { background: #f1ebfa; color: var(--roxo); }
.alerta-clin { display: inline-flex; align-items: center; gap: 4px; background: var(--vermelho-claro); color: var(--vermelho); font-weight: 650; font-size: 12px; border-radius: 6px; padding: 2px 8px; }
.faixa-alerta { background: var(--vermelho-claro); color: var(--vermelho); border: 1px solid #f3c1bb; border-radius: 10px; padding: 10px 14px; font-weight: 600; display: flex; gap: 8px; align-items: center; }
.aviso { background: var(--ouro-claro); border: 1px solid #e8dcc0; border-radius: 10px; padding: 10px 14px; color: #6a5114; }
table.tab { width: 100%; border-collapse: collapse; }
.tab th { text-align: left; font-size: 12px; color: var(--suave); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--linha); white-space: nowrap; }
.tab td { padding: 9px 10px; border-bottom: 1px solid var(--linha); vertical-align: middle; }
.tab tr.clica { cursor: pointer; }
.tab tr.clica:hover td { background: #f7fbfa; }
.tab-wrap { overflow-x: auto; }
.abas { display: flex; gap: 4px; border-bottom: 1px solid var(--linha); margin-bottom: 16px; overflow-x: auto; }
.abas button { border: 0; background: none; padding: 10px 14px; font-weight: 600; color: var(--suave); border-bottom: 2px solid transparent; white-space: nowrap; }
.abas button.ativo { color: var(--verde); border-bottom-color: var(--verde); }
.abas .n { background: var(--fundo); border-radius: 10px; padding: 0 7px; font-size: 11px; margin-left: 4px; }
.campo { display: flex; flex-direction: column; gap: 4px; }
.campo label { font-size: 12px; font-weight: 600; color: var(--suave); }
.campo input, .campo select, .campo textarea, .inp { border: 1px solid var(--linha); border-radius: 9px; padding: 8px 10px; background: #fff; width: 100%; }
.campo input:focus, .campo select:focus, .campo textarea:focus, .inp:focus { outline: 2px solid rgba(15, 110, 106, .25); border-color: var(--verde); }
.form { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form .inteiro { grid-column: 1 / -1; }
.vazio { padding: 30px; text-align: center; color: var(--suave); }
.lista-item { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--linha); }
.lista-item:last-child { border-bottom: 0; }
.lista-item .info { flex: 1; min-width: 0; }
.lista-item .info b { display: block; }
.pilha { display: flex; flex-direction: column; gap: 16px; }
.linha-flex { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.sep { height: 1px; background: var(--linha); margin: 12px 0; }

/* ---------- modal e avisos ---------- */
.fundo-modal { position: fixed; inset: 0; background: rgba(10, 30, 28, .45); display: grid; place-items: center; z-index: 100; padding: 16px; }
.modal { background: #fff; border-radius: 14px; width: min(640px, 100%); max-height: calc(100vh - 32px); overflow: auto; box-shadow: 0 20px 60px rgba(0, 0, 0, .25); }
.modal.largo { width: min(980px, 100%); }
.modal header { display: flex; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--linha); position: sticky; top: 0; background: #fff; z-index: 2; }
.modal header .fechar { margin-left: auto; border: 0; background: none; font-size: 22px; color: var(--suave); line-height: 1; }
.modal .corpo { padding: 18px 20px; }
.modal footer { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--linha); position: sticky; bottom: 0; background: #fff; }
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: #16302e; color: #fff; padding: 11px 18px; border-radius: 10px; z-index: 200; box-shadow: var(--sombra); max-width: 90vw; }
.toast.erro { background: var(--vermelho); }

/* ---------- agenda ---------- */
.agenda-barra { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.agenda-barra .data { font-weight: 650; font-size: 16px; min-width: 220px; }
.agenda { display: grid; background: #fff; border-radius: var(--raio); box-shadow: var(--sombra); overflow: auto; max-height: calc(100vh - 190px); position: relative; }
.ag-cab { position: sticky; top: 0; background: #fff; z-index: 5; padding: 10px 8px; border-bottom: 1px solid var(--linha); border-left: 1px solid var(--linha); font-weight: 650; font-size: 13px; display: flex; align-items: center; gap: 6px; min-width: 0; }
.ag-cab i { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.ag-cab small { display: block; font-weight: 500; color: var(--suave); font-size: 11px; }
.ag-horas { position: sticky; left: 0; background: #fff; z-index: 4; }
.ag-hora { height: 48px; font-size: 11px; color: var(--suave); text-align: right; padding: 2px 8px 0 0; border-top: 1px solid var(--linha); }
.ag-col { position: relative; border-left: 1px solid var(--linha); min-width: 170px; }
.ag-slot { height: 24px; border-top: 1px solid #f0f3f3; }
.ag-slot.cheia { border-top-color: var(--linha); }
.ag-slot:hover { background: var(--verde-claro); cursor: copy; }
.ag-slot.fora { background: repeating-linear-gradient(45deg, #fafbfb, #fafbfb 6px, #f2f4f4 6px, #f2f4f4 12px); cursor: default; }
.ag-ev { position: absolute; left: 3px; right: 3px; border-radius: 7px; padding: 4px 7px; font-size: 12px; overflow: hidden; cursor: pointer; border-left: 4px solid var(--c, var(--verde)); background: color-mix(in srgb, var(--c, #8a6d36) 12%, white); box-shadow: 0 1px 2px rgba(0, 0, 0, .06); line-height: 1.3; }
.ag-ev:hover { z-index: 3; box-shadow: 0 4px 14px rgba(0, 0, 0, .15); }
.ag-ev b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ag-ev .lin { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #44595a; }
.ag-ev.st-faltou, .ag-ev.st-desmarcado { opacity: .55; text-decoration: line-through; }
.ag-ev.st-atendido { background: #f3f6f6; }
.ag-ev.st-chegou { outline: 2px solid var(--ouro); }
.ag-ev.st-em_atendimento { outline: 2px solid var(--azul); }
.ag-ev .icones { position: absolute; right: 5px; top: 4px; display: flex; gap: 3px; }
.ag-ev .ic { font-size: 10px; font-weight: 700; border-radius: 4px; padding: 0 4px; background: #fff; }
.ag-ev .ic.al { color: #fff; background: var(--vermelho); }
.ag-bloq { position: absolute; left: 0; right: 0; background: repeating-linear-gradient(45deg, #f6eede, #f6eede 8px, #efe3c7 8px, #efe3c7 16px); color: #7a5d16; font-size: 12px; font-weight: 600; padding: 6px; z-index: 1; }
.ag-agora { position: absolute; left: 0; right: 0; height: 2px; background: var(--vermelho); z-index: 2; pointer-events: none; }
.ag-agora::before { content: ""; position: absolute; left: -4px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--vermelho); }
.st { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; }
.st::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.st.st-agendado { color: #7d8b8a; } .st.st-confirmado { color: var(--verde); } .st.st-chegou { color: var(--ouro); } .st.st-em_atendimento { color: var(--azul); }
.st.st-atendido { color: #3c8d4f; } .st.st-faltou { color: var(--vermelho); } .st.st-desmarcado, .st.st-remarcado { color: #9aa5a4; }
.semana { display: grid; grid-template-columns: repeat(6, minmax(150px, 1fr)); gap: 10px; overflow-x: auto; }
.semana .dia { background: #fff; border-radius: 10px; box-shadow: var(--sombra); padding: 10px; min-height: 200px; }
.semana .dia h3 { font-size: 13px; margin-bottom: 8px; }
.semana .dia.hoje { outline: 2px solid var(--verde); }
.mini-ev { font-size: 12px; border-left: 3px solid var(--c); padding: 3px 6px; margin-bottom: 4px; border-radius: 4px; background: #f8faf9; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.horarios { display: flex; flex-wrap: wrap; gap: 6px; }
.horarios button { border: 1px solid var(--linha); background: #fff; border-radius: 8px; padding: 6px 10px; font-weight: 600; }
.horarios button.sel { background: var(--verde); color: #fff; border-color: var(--verde); }

/* ---------- paciente ---------- */
.ficha-topo { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.ficha-topo .grande { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; font-size: 20px; font-weight: 700; background: var(--verde-claro); color: var(--verde); }
.dados-linha { display: flex; gap: 18px; flex-wrap: wrap; color: var(--suave); font-size: 13px; margin-top: 4px; }
.linha-tempo { position: relative; padding-left: 18px; }
.linha-tempo::before { content: ""; position: absolute; left: 5px; top: 4px; bottom: 4px; width: 2px; background: var(--linha); }
.lt-item { position: relative; padding: 0 0 14px 8px; }
.lt-item::before { content: ""; position: absolute; left: -17px; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: var(--verde); border: 2px solid #fff; box-shadow: 0 0 0 1px var(--verde); }
.lt-item .q { font-size: 12px; color: var(--suave); }

/* odontograma */
.odonto { display: flex; flex-direction: column; gap: 18px; align-items: safe center; overflow-x: auto; padding: 6px 0; }
.arcada { display: flex; gap: 3px; }
.arcada .meio { width: 10px; border-left: 1px dashed var(--linha); margin-left: 5px; }
.arcada .meio { width: 14px; }
.dente { display: flex; flex-direction: column; align-items: center; gap: 2px; cursor: pointer; }
.dente .num { font-size: 11px; color: var(--suave); font-weight: 600; }
.dente svg { width: 34px; height: 34px; }
.dente .icone svg { width: 34px; height: 51px; display: block; }
.dente:hover .icone svg { filter: drop-shadow(0 0 2px rgba(15,110,106,.5)); }
.dente.sel svg { filter: drop-shadow(0 0 3px var(--ouro)); }
.dente:hover .num { color: var(--verde); }
.legenda { display: flex; flex-wrap: wrap; gap: 10px; font-size: 12px; color: var(--suave); justify-content: center; }
.legenda i { display: inline-block; width: 11px; height: 11px; border-radius: 3px; margin-right: 4px; vertical-align: -1px; }
.condicoes { display: flex; flex-wrap: wrap; gap: 6px; }
.condicoes button { border: 1px solid var(--linha); background: #fff; border-radius: 8px; padding: 6px 10px; font-weight: 600; font-size: 12.5px; }
.condicoes button.sel { outline: 2px solid var(--verde); }
.faces-sel { display: flex; gap: 4px; }
.faces-sel button { width: 34px; height: 30px; border: 1px solid var(--linha); background: #fff; border-radius: 6px; font-weight: 700; }
.faces-sel button.sel { background: var(--verde); color: #fff; }

/* ---------- central ---------- */
.fila-card { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--linha); }
.fila-card:last-child { border-bottom: 0; }
.fila-card .msg { background: #e9f8ee; border-radius: 10px 10px 10px 2px; padding: 8px 10px; font-size: 13px; color: #24402f; margin-top: 6px; white-space: pre-wrap; }
.fila-card textarea { width: 100%; border: 1px solid var(--linha); border-radius: 8px; padding: 8px; font-size: 13px; min-height: 70px; }
.chip-n { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--ouro); color: #2b2205; font-size: 12px; font-weight: 700; }

/* funil kanban */
.kanban { display: grid; grid-template-columns: repeat(5, minmax(200px, 1fr)); gap: 12px; overflow-x: auto; }
.kanban .col { background: #eef2f2; border-radius: 12px; padding: 10px; min-height: 300px; }
.kanban .col h3 { font-size: 13px; margin: 2px 4px 10px; display: flex; justify-content: space-between; }
.kanban .card { background: #fff; border-radius: 9px; padding: 9px 10px; margin-bottom: 8px; box-shadow: 0 1px 2px rgba(0, 0, 0, .06); cursor: grab; }
.kanban .col.sobre { background: var(--verde-claro); }

/* barras simples */
.barra { height: 8px; background: var(--fundo); border-radius: 4px; overflow: hidden; }
.barra i { display: block; height: 100%; background: var(--verde); border-radius: 4px; }

/* entrada */
.entrada { min-height: 100vh; display: grid; place-items: center; background: linear-gradient(140deg, var(--verde-esc), var(--verde) 60%, #1f8b86); padding: 20px; }
.entrada .caixa { background: #fff; border-radius: 18px; padding: 30px; width: min(440px, 100%); box-shadow: 0 30px 80px rgba(0, 0, 0, .25); }
.entrada .perfis { display: grid; gap: 8px; margin-top: 14px; }
.entrada .perfis button { text-align: left; border: 1px solid var(--linha); background: #fff; border-radius: 10px; padding: 10px 12px; display: flex; gap: 10px; align-items: center; }
.entrada .perfis button:hover { border-color: var(--verde); background: var(--verde-claro); }

@media print {
  .lateral, .topo, .nao-imprime, .toast { display: none !important; }
  .app { display: block; } .conteudo { padding: 0; } .cartao { box-shadow: none; }
  .fundo-modal { position: static; background: none; padding: 0; } .modal { box-shadow: none; max-height: none; width: 100%; }
  .modal header, .modal footer { display: none; }
}
@media (max-width: 1100px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g-2-1, .g3 { grid-template-columns: 1fr; } }
@media (max-width: 760px) {
  .app { grid-template-columns: 1fr; }
  .lateral { position: fixed; bottom: 0; top: auto; left: 0; right: 0; height: 60px; z-index: 50; flex-direction: row; }
  .marca, .rodape-lat { display: none; }
  .menu { display: flex; padding: 4px; overflow-x: auto; gap: 2px; }
  .menu a { flex-direction: column; gap: 2px; font-size: 10.5px; padding: 6px 8px; min-width: 64px; }
  .menu .bolha { position: absolute; margin: 0; transform: translate(18px, -4px); font-size: 9px; padding: 0 5px; }
  .menu li { position: relative; }
  .topo { padding: 10px 16px; } .quem .nome { display: none; }
  .conteudo { padding: 16px 16px 90px; }
  .g2, .form { grid-template-columns: 1fr; }
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } .kpi .val { font-size: 19px; }
  .agenda { max-height: calc(100vh - 230px); }
}
.tab th.right { text-align: right; }

/* ---- caixa: foto do recibo */
.foto-recibo { display: flex; align-items: center; gap: 12px; border: 2px dashed var(--linha); border-radius: 12px; padding: 14px; cursor: pointer; background: var(--fundo); }
.foto-recibo:hover { border-color: var(--verde); }
.foto-recibo .icone-foto { font-size: 28px; }
.foto-recibo img { max-height: 180px; max-width: 100%; border-radius: 8px; margin: 0 auto; }

/* ---- WhatsApp */
.wa { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 16px; height: calc(100vh - 210px); min-height: 420px; }
.wa-lista { padding: 6px; overflow-y: auto; }
.wa-lista a { display: flex; gap: 10px; align-items: center; padding: 10px; border-radius: 10px; color: var(--texto); }
.wa-lista a:hover, .wa-lista a.sel { background: var(--verde-claro); }
.wa-lista .info { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.wa-chat { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.wa-topo { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 12px 16px; border-bottom: 1px solid var(--linha); }
.wa-topo > :nth-child(3) { margin-left: auto; }
.wa-msgs { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 8px; background: #efeae2; }
.wa-msgs.mini { height: 300px; flex: none; border-radius: 10px; margin-top: 12px; }
.bolha-msg { max-width: 78%; padding: 8px 12px 6px; border-radius: 10px; background: #fff; box-shadow: 0 1px 1px rgba(0,0,0,.08); line-height: 1.45; }
.bolha-msg.msg-saida { align-self: flex-end; background: #d9fdd3; }
.bolha-msg.msg-entrada { align-self: flex-start; }
.bolha-msg .hora { display: block; text-align: right; font-size: 10.5px; color: var(--suave); margin-top: 2px; }
.wa-resp { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--linha); }
.wa-resp .inp { flex: 1; }

/* ---- nota fiscal */
.espelho-nf { position: relative; border: 1px solid var(--linha); border-radius: 10px; padding: 16px 18px; overflow: hidden; }
.espelho-nf h3 { margin-top: 0; }
.marca-dagua { position: absolute; top: 40%; left: -10%; right: -10%; text-align: center; transform: rotate(-12deg); font-size: 26px; font-weight: 800; color: rgba(192, 57, 43, .13); pointer-events: none; }

@media (max-width: 760px) {
  .wa { grid-template-columns: 1fr; height: auto; }
  .wa-lista { max-height: 260px; }
  .wa-chat { height: 70vh; }
  .bolha-msg { max-width: 90%; }
}

/* ---- fotos e exames */
.im-data { margin: 16px 0 8px; font-size: 14px; color: var(--suave); }
.galeria { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.im { position: relative; margin: 0; border: 1px solid var(--linha); border-radius: 10px; overflow: hidden; cursor: pointer; background: #fff; }
.im.marcada { outline: 3px solid var(--ouro); }
.im img, .im .pdf { width: 100%; height: 140px; object-fit: cover; display: block; background: #111; }
.pdf { display: grid; place-items: center; height: 140px; background: var(--fundo); color: var(--suave); font-weight: 700; }
.im figcaption { padding: 8px 10px; font-size: 13px; line-height: 1.4; }
.im .marca { position: absolute; top: 6px; right: 6px; background: rgba(255,255,255,.9); border-radius: 6px; padding: 2px 4px; }
.visor { background: #111; border-radius: 10px; text-align: center; overflow: auto; max-height: 62vh; }
.visor img { max-width: 100%; max-height: 62vh; }
.comparar { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cmp { margin: 0; } .cmp img { width: 100%; max-height: 60vh; object-fit: contain; background: #111; border-radius: 8px; } .cmp figcaption { font-size: 13px; margin-top: 4px; }
.linha-im { display: flex; gap: 12px; align-items: flex-start; border-top: 1px solid var(--linha); padding-top: 12px; }
.linha-im img, .linha-im .pdf { width: 110px; height: 90px; object-fit: cover; border-radius: 8px; flex: none; }
@media (max-width: 760px) { .comparar { grid-template-columns: 1fr; } .linha-im { flex-direction: column; } }

/* ---- assistente de configuração */
.progresso-cfg { height: 8px; background: var(--linha); border-radius: 4px; overflow: hidden; margin-bottom: 16px; }
.progresso-cfg i { display: block; height: 100%; background: var(--verde); }
.passos-cfg { display: flex; flex-direction: column; gap: 10px; }
.passo { background: var(--cartao); border: 1px solid var(--linha); border-radius: 14px; overflow: hidden; }
.passo header { display: flex; align-items: center; gap: 14px; padding: 14px 16px; cursor: pointer; }
.passo header:hover { background: var(--fundo); }
.passo .num { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; background: var(--fundo); border: 2px solid var(--linha); flex: none; }
.passo.ok .num { background: var(--verde); border-color: var(--verde); color: #fff; }
.passo.aberto { border-color: var(--verde); }
.passo .seta { margin-left: auto; color: var(--suave); }
.corpo-passo { padding: 4px 16px 18px; border-top: 1px solid var(--linha); }
.passo-a-passo { margin: 12px 0; padding-left: 20px; line-height: 1.6; font-size: 14px; }
.passo-a-passo li { margin-bottom: 4px; }
.teste-res { font-size: 13.5px; font-weight: 600; } .teste-res.ok { color: var(--verde); } .teste-res.erro { color: var(--vermelho); }

/* ---- guia ilustrado do WhatsApp */
.guia-intro p { margin: 0 0 6px; }
.guia { list-style: none; padding: 0; margin: 16px 0 0; display: flex; flex-direction: column; gap: 14px; }
.guia-passo { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 22px; align-items: center; }
.guia-txt { display: flex; gap: 14px; }
.guia-txt h2 { margin: 2px 0 4px; font-size: 18px; }
.guia-txt p { line-height: 1.6; }
.guia-num { width: 38px; height: 38px; border-radius: 50%; background: var(--verde); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 17px; flex: none; }
.mt { border: 1px solid var(--linha); border-radius: 12px; overflow: hidden; background: #fff; box-shadow: 0 6px 20px rgba(0,0,0,.06); font-size: 13px; }
.mt-barra { display: flex; align-items: center; gap: 5px; padding: 8px 10px; background: #eef1f2; border-bottom: 1px solid var(--linha); }
.mt-barra i { width: 9px; height: 9px; border-radius: 50%; background: #c9d2d1; }
.mt-barra span { margin-left: 8px; background: #fff; border-radius: 6px; padding: 2px 8px; color: var(--suave); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; }
.mt-corpo { padding: 14px; display: flex; flex-direction: column; gap: 7px; }
.mt-titulo { font-weight: 800; font-size: 15px; color: #1c2b4a; }
.mt-bt { display: inline-block; align-self: flex-start; background: #e7ecf5; color: #1c3d7a; border-radius: 7px; padding: 6px 12px; font-weight: 700; }
.mt-campo { border: 1px solid var(--linha); border-radius: 7px; padding: 5px 9px; display: flex; flex-direction: column; }
.mt-campo small { color: var(--suave); font-size: 10.5px; }
.mt-linha { border: 1px solid var(--linha); border-radius: 7px; padding: 7px 9px; }
.mt-cartoes { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.mt .alvo { outline: 3px solid #f0a020; outline-offset: 2px; position: relative; }
.mt-bt.alvo { background: #1f5fd6; color: #fff; }
.mt-chave { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; color: var(--verde); outline: 3px solid #f0a020; outline-offset: 3px; border-radius: 20px; padding: 2px 10px; }
.mt-chave i { width: 26px; height: 14px; border-radius: 8px; background: var(--verde); position: relative; }
.mt-chave i::after { content: ""; position: absolute; right: 2px; top: 2px; width: 10px; height: 10px; border-radius: 50%; background: #fff; }
.mt-ok { color: var(--verde); font-weight: 700; margin-top: 4px; }
@media (max-width: 900px) { .guia-passo { grid-template-columns: 1fr; } }
@media print { .guia-passo { break-inside: avoid; } .acoes { display: none; } }

/* ---- cadastro em etapas */
.sec-form { margin: 10px 0 0; font-size: 14px; color: var(--verde); border-bottom: 1px solid var(--linha); padding-bottom: 4px; }
.sec-resp { background: var(--ouro-claro); border-radius: 10px; padding: 4px 12px 12px; }
.cad-faixa { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; border-radius: 12px; padding: 10px 14px; background: var(--ouro-claro); border: 1px solid #e8dcc0; }
.cad-faixa.nivel-pre { background: #fff4ec; border-color: #f3d2b5; }
.cad-barra { width: 70px; height: 8px; background: rgba(0,0,0,.08); border-radius: 4px; overflow: hidden; flex: none; }
.cad-barra i { display: block; height: 100%; background: var(--verde); }

/* ---- orçamento */
.orc-opcao { border-left: 4px solid var(--azul); }
.orc-acoes { margin-top: 10px; flex-wrap: wrap; gap: 6px; }
.assinado { margin-top: 8px; font-size: 13px; color: var(--verde); background: var(--verde-claro); border-radius: 8px; padding: 6px 10px; }
.termo-txt { background: var(--fundo); border-radius: 8px; padding: 10px; max-height: 160px; overflow-y: auto; margin: 10px 0; line-height: 1.5; }
.ass-clin { width: 100%; height: 140px; border: 2px dashed var(--linha); border-radius: 10px; touch-action: none; background: #fff; display: block; margin-top: 8px; }

/* ---- agenda: mês */
.mes { background: var(--cartao); border: 1px solid var(--linha); border-radius: 14px; overflow: hidden; }
.mes-cab { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); background: var(--fundo); font-size: 12px; color: var(--suave); text-align: center; padding: 6px 0; }
.mes-grade { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.mes-dia { min-height: 92px; border-top: 1px solid var(--linha); border-left: 1px solid var(--linha); padding: 6px 8px; display: flex; flex-direction: column; gap: 3px; color: var(--texto); font-size: 13px; }
.mes-dia:nth-child(7n+1) { border-left: 0; }
.mes-dia:hover { background: var(--verde-claro); }
.mes-dia.fora { opacity: .35; } .mes-dia.fechado { background: repeating-linear-gradient(45deg, #fafbfb, #fafbfb 6px, #f1f4f4 6px, #f1f4f4 12px); }
.mes-dia.hoje b { background: var(--verde); color: #fff; border-radius: 50%; width: 24px; height: 24px; display: inline-grid; place-items: center; }
.mes-n { font-weight: 700; } .mes-fer { font-size: 11px; color: var(--vermelho); line-height: 1.2; }
.mes-barra { height: 6px; background: var(--linha); border-radius: 3px; overflow: hidden; } .mes-barra i { display: block; height: 100%; }
@media (max-width: 760px) { .mes-dia { min-height: 64px; padding: 4px; font-size: 11px; } .mes-dia .muted { display: none; } }

[hidden] { display: none !important; }

/* ---- financeiro */
.dre td { padding: 7px 8px; }
.dre .dre-sub td { color: var(--suave); font-size: 13px; padding-top: 2px; padding-bottom: 2px; }
.dre .dre-total td { font-weight: 700; border-top: 1px solid var(--linha); }
.dre .dre-menos td:last-child { color: var(--vermelho); }
.dre .dre-final td { font-weight: 800; font-size: 16px; border-top: 2px solid var(--texto); }
.prev-barra { display: flex; height: 10px; background: var(--fundo); border-radius: 5px; overflow: hidden; }
.prev-barra i { display: block; height: 100%; }

/* ---- agenda em lista (celular da equipe) */
.ag-lista { margin-bottom: 12px; padding: 12px; } .ag-lista .bolinha { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.ag-li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--linha); color: var(--texto); }
.ag-li-h { font-weight: 800; font-size: 16px; width: 52px; flex: none; line-height: 1.1; } .ag-li-h small { display: block; font-weight: 400; font-size: 11px; color: var(--suave); }
.ag-li-i { flex: 1; min-width: 0; }

/* abas logo abaixo do título (o conteúdo de cada aba vem embaixo delas) */
.abas-topo { margin: 4px 0 14px; position: sticky; top: 0; z-index: 4; background: var(--fundo); padding-top: 4px; }

/* ---- prontuário */
.pr-nova h2 { margin: 0; } .pr-nova.fechada { padding-bottom: 12px; }
.pr-form { margin-top: 10px; }
.pr-pend { background: var(--verde-claro); border-radius: 10px; padding: 10px 12px; margin: 10px 0; }
.pr-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.pr-chip { display: inline-flex; gap: 6px; align-items: center; background: #fff; border: 1px solid var(--linha); border-radius: 20px; padding: 4px 10px; font-size: 13px; cursor: pointer; }
.pr-barra { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 10px; }
.pr-lista { display: flex; flex-direction: column; }
.pr-item { display: flex; gap: 12px; padding: 12px 0; border-top: 1px solid var(--linha); }
.pr-ic { width: 32px; height: 32px; border-radius: 50%; background: var(--fundo); display: grid; place-items: center; flex: none; }
.pr-evolucao .pr-ic { background: var(--verde-claro); }
.pr-corpo { flex: 1; min-width: 0; }
.pr-cab { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pr-texto { white-space: pre-wrap; line-height: 1.55; margin-top: 4px; }
.pr-procs { margin-top: 4px; display: flex; flex-wrap: wrap; gap: 4px; }
.pr-ass { font-size: 12px; color: var(--suave); margin-top: 4px; }
.pr-retif { margin-top: 8px; border-left: 3px solid var(--ouro); padding: 4px 0 4px 10px; background: var(--ouro-claro); border-radius: 0 8px 8px 0; }

.bloqueio-caixa { z-index: 200; background: rgba(10, 40, 38, .75); }

/* ---- identidade da Clínica Lumière (placa: champanhe, bronze, dourado, serifa espaçada) */
:root { --ok: #2f7d4f; --ok-claro: #e7f3ea; }
.marca b { font-family: Cinzel, Georgia, serif; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; font-size: 13px; color: #e9dcc0; }
.marca span { color: #b9ab93; }
.lateral { background: linear-gradient(180deg, #2e2a25, #36302a); }
.menu a.ativo { background: rgba(201, 164, 95, .18); color: #f1e6cf; }
.menu a.ativo svg { color: #c9a45f; }
.entrada { background: radial-gradient(circle at 30% 20%, #3b342b, #24201c 70%); }
.entrada h1 { font-family: Cinzel, Georgia, serif; letter-spacing: .08em; text-transform: uppercase; font-weight: 600; }
.tag.verde { background: var(--ok-claro); color: var(--ok); }
.btn.prim { box-shadow: 0 1px 0 rgba(0,0,0,.08); }

/* ---- funil do Painel */
.fun { display: flex; flex-direction: column; gap: 2px; }
.fun-linha { display: grid; grid-template-columns: 96px minmax(0, 1fr) 52px; gap: 10px; align-items: center; }
.fun-rot { font-size: 13px; font-weight: 600; }
.fun-trilho { height: 22px; background: var(--fundo); border-radius: 6px; overflow: hidden; }
.fun-trilho i { display: block; height: 100%; border-radius: 6px; }
.fun-n { text-align: right; font-size: 18px; letter-spacing: -.02em; }
.fun-passo { margin: 2px 0 2px 106px; font-size: 12.5px; color: var(--texto); }
.fun-seta { color: var(--ouro); font-weight: 800; margin-right: 4px; }
.fun-resumo { margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: var(--verde-claro); font-size: 13px; line-height: 1.5; }
