/* Identidade visual DHVida – Saúde Mental: verde-escuro #00261C, verde da folha #5EC23A, verde-menta #CCFFD9, fonte Poligon (servida localmente) */
@font-face { font-family: "Poligon"; src: url(../fonts/poligon-light.woff2) format("woff2"); font-weight: 300 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Poligon"; src: url(../fonts/poligon-medium.woff2) format("woff2"); font-weight: 500 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Poligon"; src: url(../fonts/poligon-bold.woff2) format("woff2"); font-weight: 700 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Poligon"; src: url(../fonts/poligon-regularitalic.woff2) format("woff2"); font-weight: 300 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Poligon"; src: url(../fonts/poligon-mediumitalic.woff2) format("woff2"); font-weight: 500 600; font-style: italic; font-display: swap; }
@font-face { font-family: "Poligon"; src: url(../fonts/poligon-bolditalic.woff2) format("woff2"); font-weight: 700 900; font-style: italic; font-display: swap; }
:root {
    --dhvida: #00261c; --dhvida-claro: #ccffd9; --dhvida-folha: #5ec23a; --dhvida-texto-verde: #2e7a1c;
    --bs-body-font-family: "Poligon", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    --bs-body-color: #1c2b24; --bs-emphasis-color: #00261c;
    --bs-link-color: #2e7a1c; --bs-link-color-rgb: 46, 122, 28; --bs-link-hover-color: #00261c; --bs-link-hover-color-rgb: 0, 38, 28;
    --bs-primary: #00261c; --bs-primary-rgb: 0, 38, 28;
    --bs-success: #2e7a1c; --bs-success-rgb: 46, 122, 28;
    --bs-focus-ring-color: rgba(94, 194, 58, .35);
}
html { font-size: 15px; }
body { background: #f4faf6; }
strong, b { font-weight: 700; }
.bg-dhvida { background: var(--dhvida); }
.navbar.bg-dhvida { border-bottom: 3px solid var(--dhvida-folha); }
.navbar.bg-dhvida .nav-link.active, .navbar.bg-dhvida .nav-link.show { color: var(--dhvida-claro); }
.navbar.bg-dhvida .nav-link:hover { color: var(--dhvida-claro); }
.dropdown-item.active, .dropdown-item:active { background: var(--dhvida); color: #fff; }
.btn-dhvida { background: var(--dhvida); color: #fff; }
.btn-dhvida:hover { background: #0a3628; color: #fff; }
.btn-primary { --bs-btn-bg: #00261c; --bs-btn-border-color: #00261c; --bs-btn-hover-bg: #0a3628; --bs-btn-hover-border-color: #0a3628;
    --bs-btn-active-bg: #001a13; --bs-btn-active-border-color: #001a13; --bs-btn-disabled-bg: #00261c; --bs-btn-disabled-border-color: #00261c; --bs-btn-focus-shadow-rgb: 94, 194, 58; }
.btn-outline-primary { --bs-btn-color: #00261c; --bs-btn-border-color: #00261c; --bs-btn-hover-bg: #00261c; --bs-btn-hover-border-color: #00261c;
    --bs-btn-active-bg: #00261c; --bs-btn-active-border-color: #00261c; --bs-btn-focus-shadow-rgb: 94, 194, 58; }
.btn-success { --bs-btn-bg: #2e7a1c; --bs-btn-border-color: #2e7a1c; --bs-btn-hover-bg: #256516; --bs-btn-hover-border-color: #256516; --bs-btn-active-bg: #256516; }
.text-primary { color: #2e7a1c !important; }
.form-control:focus, .form-select:focus { border-color: #5ec23a; box-shadow: 0 0 0 .25rem rgba(94, 194, 58, .25); }
.form-check-input:checked { background-color: #2e7a1c; border-color: #2e7a1c; }
.form-check-input:focus { border-color: #5ec23a; box-shadow: 0 0 0 .25rem rgba(94, 194, 58, .25); }
.page-link { color: #2e7a1c; }
.active > .page-link, .page-link.active { background-color: #00261c; border-color: #00261c; }
.nav-pills .nav-link.active { background-color: #00261c; }
.nav-tabs .nav-link { color: #2e7a1c; }
.progress-bar { background-color: #2e7a1c; }
.card { border: 0; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.kpi .valor { font-size: 1.6rem; font-weight: 600; }
.kpi .rotulo { font-size: .85rem; color: #6c757d; text-transform: uppercase; letter-spacing: .03em; }
.table td, .table th { vertical-align: middle; }
.table-sm td { font-size: .92rem; }
.etapas .etapa { padding: .35rem .8rem; border-radius: 1rem; background: #e9ecef; color: #6c757d; font-size: .9rem; }
.etapas .etapa.atual { background: var(--dhvida); color: #fff; }
.etapas .etapa.feita { background: var(--dhvida-claro); color: var(--dhvida); }
.candidato { border: 1px solid #dee2e6; border-radius: .4rem; padding: .35rem .6rem; margin-bottom: .3rem; }
.candidato.forte { border-color: #198754; background: #f0faf4; }
.check-ok { color: #198754; font-weight: 600; }
.check-no { color: #adb5bd; }
.descricao { font-size: .85rem; color: #495057; }
.login-box { max-width: 440px; margin: 6vh auto; }
.login-logo { display: block; height: 76px; width: auto; margin: 0 auto 1.25rem; }
.btn-voltar-site { display: flex; align-items: center; justify-content: center; gap: .5rem; width: 100%; margin-top: 1rem;
    padding: .6rem 1rem; border: 2px solid var(--dhvida); border-radius: .4rem; color: var(--dhvida); background: #fff;
    font-weight: 600; text-decoration: none; }
.btn-voltar-site:hover { background: var(--dhvida); color: #fff; }
.navbar-brand img { height: 30px; width: auto; display: block; }

/* ---------- Pacientes (estilo Clínica Ágil) ---------- */
.avatar { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; color: #fff; font-size: .85rem; }
.avatar.grande { width: 150px; height: 150px; font-size: 3.6rem; background: #1e88e5; }
.lista-pacientes td { padding-top: .7rem; padding-bottom: .7rem; }
.btn-redondo { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 50%; border: 0; text-decoration: none; font-size: .95rem; }
.btn-redondo.editar { background: #fdebd0; color: #e67e22; }
.btn-redondo.excluir { background: #fadbd8; color: #e74c3c; }
.btn-redondo.ativo { background: #d5f5e3; color: #1e8449; font-weight: 700; }
.btn-redondo.inativo { background: #eee; color: #999; }
.ficha-menu .list-group-item { border: 0; margin-bottom: .35rem; border-radius: .35rem !important; background: #f3f4f4; }
.ficha-menu .list-group-item.active { background: #d6d6d6; color: #222; }
.ficha-menu .icone { display: inline-block; width: 1.6rem; }
.ficha-topo { background: #f3f4f4; border-radius: .5rem; }
.ficha-topo .col-sep { border-right: 1px solid #ddd; }
.cartao-info { background: #fff; border-radius: .4rem; box-shadow: 0 1px 3px rgba(0,0,0,.1); border-bottom: 5px solid #6b6b4f; padding: 1rem; display: flex; align-items: center; gap: .9rem; height: 100%; }
.cartao-info .circulo { width: 64px; height: 64px; border-radius: 50%; box-shadow: 0 1px 4px rgba(0,0,0,.2); display: flex; align-items: center; justify-content: center; font-size: 1.6rem; flex-shrink: 0; }
.cartao-info .rotulo { color: #888; font-size: .95rem; }
.cartao-info .valor { font-size: 1.35rem; }
details.secao { margin-bottom: .8rem; }
details.secao > summary { background: #f3f4f4; padding: .45rem .8rem; font-size: 1.15rem; cursor: pointer; border-radius: .3rem; }
details.secao .campo { border-bottom: 1px solid #eee; padding: .6rem .5rem; }
details.secao .campo .rotulo { font-size: .8rem; color: #555; }
details.secao .campo .valor { min-height: 1.4rem; }
.circulo-valor { width: 200px; height: 200px; border-radius: 50%; border: 16px solid; display: flex; flex-direction: column; align-items: center; justify-content: center; margin: auto; font-size: 1.3rem; }
.linha-tempo { border-left: 2px solid #ddd; margin-left: 7rem; padding-left: 1.5rem; }
.linha-tempo .item { position: relative; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.1); border-radius: .3rem; padding: .8rem 1rem; margin-bottom: 1rem; }
.linha-tempo .item::before { content: ""; position: absolute; left: -2.05rem; top: 1rem; width: 14px; height: 14px; border-radius: 50%; border: 3px solid #2f6fb5; background: #fff; }
.linha-tempo .data { position: absolute; left: -8.7rem; top: .6rem; width: 5.8rem; text-align: right; font-weight: 600; font-size: .9rem; }
@media print {
    nav.navbar, .ficha-menu, .nao-imprimir, .alert { display: none !important; }
    details.secao { display: block; }
    details.secao > *:not(summary) { display: block !important; }
}
.navbar .nav-link { white-space: nowrap; }
.validation-summary-valid { display: none; }

/* ---------- Menu e cadastros (estilo Clínica Ágil) ---------- */
.menu-principal .nav-link .bi, .dropdown-item .bi { margin-right: .25rem; }
.menu-principal .dropdown-item { padding-top: .35rem; padding-bottom: .35rem; }
.alert { white-space: pre-line; }
.titulo-cadastro { font-size: 2.1rem; font-weight: 300; margin: 0; }
.btn-novo { background: #5ec23a; color: #00261c; border: 0; font-weight: 600; }
.btn-novo:hover { background: #4fae2e; color: #00261c; }
.btn-redondo.acao { background: #e3edf9; color: #2f6fb5; }
.bolinha-cor { display: inline-block; width: 24px; height: 24px; border-radius: 50%; border: 1px solid rgba(0,0,0,.1); vertical-align: middle; }
.lista-cadastro td { padding-top: .75rem; padding-bottom: .75rem; }
.rodape-total { background: #f3f4f4; border-radius: .4rem; padding: 1rem 1.2rem; font-size: .88rem; color: #555; }
.rodape-total .ponto { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: .3rem; }
.foto-prof { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }
.foto-prof.grande { width: 120px; height: 120px; }
.foto-site { width: 150px; height: 180px; border-radius: .5rem; object-fit: cover; display: inline-block; }
.foto-site.vazia { background: #eef2f4; color: #9aa7ae; font-size: 3rem; line-height: 180px; }
.tabela-servicos td { padding: .3rem .4rem; }
.tabela-servicos tr.arrastando { opacity: .4; }
.tabela-servicos .alca { cursor: grab; color: #aaa; font-size: 1.2rem; }
.tabela-servicos tr.desativado input:not([type=checkbox]) { color: #999; text-decoration: line-through; }
.multi-check { max-height: 190px; overflow-y: auto; border: 1px solid #dee2e6; border-radius: .375rem; padding: .4rem .7rem; background: #fff; }
.secao-titulo { font-size: 1.35rem; font-weight: 300; margin: 1.6rem 0 .6rem; }
.assinatura-img { max-height: 90px; max-width: 360px; border: 1px dashed #ccc; padding: .3rem; background: #fff; }
/* Menu cabe em telas de 1280px: itens mais juntos e rótulos secundários só em telas largas */
.menu-principal .navbar-nav .nav-link { padding-left: .5rem; padding-right: .5rem; }
@media (max-width: 1699.98px) {
    .menu-principal .navbar-brand .text-white-50, .menu-principal .asaas-longo { display: none; }
}
@media (min-width: 1200px) and (max-width: 1399.98px) {
    .menu-principal .navbar-nav .nav-link .bi { display: none; }
    .menu-principal .navbar-nav .nav-link { font-size: .95rem; padding-left: .4rem; padding-right: .4rem; }
}
.foto-usuario { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 50%;
    background: #1e88e5; color: #fff; font-size: .85rem; font-weight: 600; overflow: hidden; border: 2px solid rgba(255,255,255,.6); }
.foto-usuario img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.menu-usuario .dropdown-menu { min-width: 230px; }

/* ---------------- Agenda ---------------- */
.agenda { display: grid; grid-template-columns: 250px 1fr; gap: 1.25rem; align-items: start; }
.agenda-lado .prof-item { border-left: 3px solid transparent; }
.agenda-lado .prof-item.ativo { background: #eef5ff; border-left-color: var(--bs-primary); color: var(--bs-primary); }
.legenda { font-size: .8rem; display: grid; grid-template-columns: 1fr 1fr; gap: .2rem .5rem; }
.legenda span { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.agenda-grade { background: #fff; border: 1px solid #dee2e6; border-radius: .5rem; max-height: calc(100vh - 230px); overflow: auto; }
.grade-cabecalho { position: sticky; top: 0; z-index: 5; background: #fff; }
.grade-cabecalho, .grade-corpo { display: grid; grid-template-columns: 56px repeat(var(--dias), minmax(0, 1fr)); }
.grade-cabecalho > div { text-align: center; padding: .4rem 0; font-size: 1.05rem; color: #555; border-bottom: 1px solid #dee2e6; text-transform: lowercase; }
.grade-cabecalho > div.hoje { color: var(--bs-primary); font-weight: 600; }
.grade-horas { position: relative; border-right: 1px solid #dee2e6; }
.grade-horas > div { position: absolute; right: 6px; font-size: .8rem; color: #666; transform: translateY(-1px); }
.grade-dia { position: relative; background: #e3e5e8; border-right: 1px solid #d3d6da; cursor: pointer; }
.grade-dia::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: repeating-linear-gradient(to bottom, transparent 0, transparent calc(var(--linha) - 1px), rgba(0,0,0,.08) calc(var(--linha) - 1px), rgba(0,0,0,.08) var(--linha)); }
.grade-dia .periodo { position: absolute; left: 0; right: 0; background: #fff; }
.grade-dia.hoje .periodo { background: #fbf5e6; }
.grade-dia .rotulo-dia { position: absolute; top: 2px; left: 4px; font-size: .72rem; color: #777; pointer-events: none; }
.evento { position: absolute; z-index: 2; color: #fff; border-radius: 4px; border: 1px solid rgba(255,255,255,.7); padding: 1px 4px; font-size: .74rem; line-height: 1.15; overflow: hidden; cursor: pointer; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.evento:hover { filter: brightness(1.08); z-index: 3; }
.evento-topo { display: flex; gap: 3px; align-items: center; white-space: nowrap; }
.evento-topo i { font-size: .72rem; margin-left: 1px; }
.evento-nome, .evento-servico { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.evento-servico { opacity: .9; font-size: .68rem; }
.evento.desmarcado { color: #555; text-decoration: line-through; opacity: .75; }
.evento.apagado { opacity: .15; }
.detalhes-lista dt { font-weight: 600; }
.detalhes-lista dd { margin-bottom: .15rem; }
body.agenda-cheia nav.navbar, body.agenda-cheia .agenda-lado { display: none !important; }
body.agenda-cheia .agenda { grid-template-columns: 1fr; }
body.agenda-cheia .agenda-grade { max-height: calc(100vh - 130px); }
@media (max-width: 991px) {
    .agenda { grid-template-columns: 1fr; }
    .grade-cabecalho, .grade-corpo { min-width: calc(56px + var(--dias) * 110px); }
}

/* ---------- Configurações (menu lateral como na Clínica Ágil) ---------- */
.menu-config a { display: block; padding: .6rem 1.4rem; color: #2e7a1c; text-decoration: none; }
.menu-config a:hover { background: #effcf2; }
.menu-config a.ativo { font-weight: 600; background: var(--dhvida-claro); color: var(--dhvida); }
.grupo-radio .form-check-input { width: 1.3em; height: 1.3em; }
.acordeao-config .accordion-button:not(.collapsed) { background: #00261c; color: #fff; }
.acordeao-config .item-msg { border-bottom: 1px solid #eee; padding: 1rem .5rem; }
.acordeao-config .item-msg:last-child { border-bottom: 0; }

/* Janelas da agenda: cabeçalho e rodapé (botão Salvar) sempre visíveis, só o miolo rola */
.form-modal { display: flex; flex-direction: column; min-height: 0; max-height: 100%; overflow: hidden; }
.form-modal > .modal-header, .form-modal > .modal-footer { flex-shrink: 0; }
.form-modal > .modal-body { overflow-y: auto; min-height: 0; }
.modal-dialog-scrollable .modal-content { max-height: calc(100vh - 3.5rem); }

/* Agenda: cores de status e lembretes das Configurações da Agenda */
.evento { border-left-width: 4px; border-left-style: solid; }
.evento-topo i { opacity: .85; }
.marca-lembrete { display: inline-block; width: 9px; height: 9px; border-radius: 50%; border: 1px solid; margin-left: 2px; vertical-align: middle; }
.legenda span { border: 1px solid transparent; }
.legenda-titulo { grid-column: 1 / -1; font-weight: 600; color: #555; }
.grade-cabecalho > div.feriado { color: #c62828; }
.grade-dia.feriado .periodo { background: repeating-linear-gradient(45deg, #fff, #fff 6px, #fdecec 6px, #fdecec 12px); }
.evento.arrastando { opacity: .45; }
.grade-dia.alvo { outline: 2px dashed var(--bs-primary); outline-offset: -2px; }
.aviso-agenda { position: fixed; right: 1rem; bottom: 1rem; z-index: 1080; max-width: 420px; }

/* Atendimento: tela dividida (sala/histórico | evolução) */
.atendimento-divisao { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 1rem; height: calc(100vh - 170px); min-height: 480px; }
.atendimento-lado { overflow: auto; }
.atendimento-prontuario { display: flex; flex-direction: column; min-height: 0; }
.atendimento-prontuario .card-body { min-height: 0; overflow: auto; }
#textoProntuario { resize: none; min-height: 300px; font-size: 1rem; line-height: 1.5; }
@media (max-width: 900px) { .atendimento-divisao { grid-template-columns: 1fr; height: auto; } }

/* ---------- Status da Sessão ---------- */
.status-amostra { display: inline-block; padding: .15rem .6rem; border-radius: .35rem; border-left: 4px solid; font-size: .9rem; }
.arrastar { cursor: grab; }
/* Lançamentos (modelo Fluxo de Caixa) */
.lanc-pago td { background: #d9f2df !important; }
.lanc-atrasado td { background: #f8d7da !important; }
.lanc-legenda span { display: inline-block; width: 14px; height: 14px; border: 1px solid #ccc; vertical-align: middle; margin: 0 .25rem 0 .8rem; border-radius: 2px; }
.lanc-tabela th { white-space: nowrap; font-size: .82rem; }
.lanc-tabela td { font-size: .86rem; vertical-align: middle; }
.lanc-barra { position: sticky; bottom: 0; background: #fff; border-top: 1px solid #dee2e6; padding: .6rem 0; z-index: 4; }
.rec-total { font-size: 1.15rem; font-weight: 600; }
