:root {
    --sb-bg: #1c3550;
    --sb-bg-2: #142840;
    --sb-fg: #c9d6e3;
    --sb-active: #2f80c9;
    --topbar-h: 40px;
    --sb-w: 215px;
    --bs-body-bg: #e6eaef;
    --linha: #c5d0da;          /* bordas de painéis e campos */
    --campo-borda: #98a9ba;
    --campo-obrig: #fffbe6;    /* fundo de campo obrigatório */
    --titulo: #1f3a55;
}

body { background: var(--bs-body-bg); font-size: .925rem; }

/* ---------------- Layout */
.sidebar {
    position: fixed; inset: 0 auto 0 0; width: var(--sb-w); overflow-y: auto;
    background: linear-gradient(180deg, var(--sb-bg), var(--sb-bg-2)); color: var(--sb-fg); z-index: 1030;
}
.sidebar-voltar { display: flex; align-items: center; gap: .5rem; margin: .6rem .75rem; padding: .55rem .8rem; color: #fff; text-decoration: none;
    font-size: .88rem; font-weight: 600; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.25); border-radius: .4rem; }
.sidebar-voltar i { font-size: 1rem; }
.sidebar-voltar:hover { color: #fff; background: rgba(255,255,255,.22); border-color: rgba(255,255,255,.4); }
.sidebar-modulo { display: flex; align-items: center; gap: .7rem; padding: 1rem; color: #fff; border-bottom: 1px solid rgba(255,255,255,.08); }
.sidebar-modulo .mod-icone { width: 2.4rem; height: 2.4rem; font-size: 1.2rem; }
.sidebar .nav-header { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: #7fa3af; padding: 1rem 1rem .35rem; }
.sidebar .nav-link { color: var(--sb-fg); padding: .45rem 1rem; border-left: 3px solid transparent; }
.sidebar .nav-link i { width: 1.4rem; display: inline-block; }
.sidebar .nav-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.sidebar .nav-link.active { background: rgba(27,163,156,.18); border-left-color: var(--mod-cor, var(--sb-active)); color: #fff; font-weight: 600; }

.main { margin-left: var(--sb-w); min-height: 100vh; }
.topbar {
    height: var(--topbar-h); background: #fff; border-bottom: 1px solid #e3e8ec; display: flex; align-items: center;
    gap: 1rem; padding: 0 1.25rem; position: sticky; top: 0; z-index: 1020;
}
body.sem-lateral .main { margin-left: 0; }
.topbar-marca { align-items: center; gap: .45rem; color: var(--sb-bg); font-weight: 700; }
.topbar-marca i { font-size: 1.35rem; color: var(--sb-active); }
.migalha { font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex-shrink: 0; max-width: 34vw; }
.migalha a { color: #6c7a86; text-decoration: none; }
.migalha a:hover { color: var(--sb-active); }
.migalha i { font-size: .7rem; color: #aab6bf; margin: 0 .2rem; }
.menu-modulos { width: 330px; gap: .25rem; }
.menu-modulos.show { display: grid; grid-template-columns: repeat(3, 1fr); }
.menu-modulo { display: flex; flex-direction: column; align-items: center; gap: .25rem; padding: .6rem .3rem; border-radius: .5rem;
    text-decoration: none; color: #333; font-size: .75rem; text-align: center; line-height: 1.15; }
.menu-modulo i { font-size: 1.4rem; }
.menu-modulo:hover, .menu-modulo.ativo { background: #eef3f6; }
.busca-rapida { position: relative; flex: 0 1 340px; min-width: 140px; }
.busca-rapida i { position: absolute; left: .6rem; top: 50%; transform: translateY(-50%); color: #8a98a3; }
.busca-rapida input { padding-left: 2rem; }
.conteudo { padding: 1.25rem; }

@media (max-width: 991.98px) {
    .sidebar { transform: translateX(-100%); transition: transform .2s; }
    body.menu-aberto .sidebar { transform: none; }
    .main { margin-left: 0; }
}

body.sem-menu { display: flex; align-items: center; justify-content: center; min-height: 100vh;
    background: linear-gradient(160deg, #1c3550, #142840); } /* mesmo azul do menu lateral */

/* ---------------- Tela de módulos */
.mod-icone { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 3rem; height: 3rem;
    border-radius: .75rem; background: var(--mod-cor, #0f3d4c); color: #fff; font-size: 1.45rem; }
.inicio { max-width: 1180px; margin: 0 auto; padding-top: .5rem; }
.busca-modulos { position: relative; width: min(360px, 100%); }
.busca-modulos i { position: absolute; left: .75rem; top: 50%; transform: translateY(-50%); color: #8a98a3; }
.busca-modulos input { padding-left: 2.2rem; border-radius: 2rem; }
/* Módulos como lançador de ícones (ordem alfabética; a descrição aparece ao passar o mouse) */
.modulos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: .6rem; }
.modulo-card { position: relative; display: flex; flex-direction: column; background: #fff; border: 1px solid #e3e8ec; border-radius: .75rem;
    box-shadow: 0 1px 2px rgba(16,24,40,.04); transition: transform .15s, box-shadow .15s, border-color .15s; }
.modulo-card:hover, .modulo-card:focus-within { transform: translateY(-2px); border-color: color-mix(in srgb, var(--mod-cor) 45%, #fff);
    box-shadow: 0 8px 18px color-mix(in srgb, var(--mod-cor) 22%, transparent); }
.modulo-card::after { content: ""; position: absolute; bottom: -1px; left: 32%; right: 32%; height: 3px; border-radius: 3px 3px 0 0; background: var(--mod-cor); opacity: .75; }
.modulo-topo { flex-grow: 1; display: flex; flex-direction: column; align-items: center; text-align: center; gap: .45rem; padding: .85rem .5rem .75rem;
    text-decoration: none; color: inherit; }
.modulo-topo .mod-ilustra { width: 60px; height: 60px; }
/* Grupo (pasta) na tela de módulos: miniaturas 2×2 dos módulos de dentro */
.mod-pasta { width: 60px; height: 60px; display: grid; grid-template-columns: 1fr 1fr; gap: 3px; padding: 5px; border-radius: 14px; background: color-mix(in srgb, var(--mod-cor) 12%, #fff); border: 1px solid color-mix(in srgb, var(--mod-cor) 25%, #fff); }
.mod-pasta .mod-ilustra, .mod-pasta .mod-icone-sobrio { width: 100%; height: 100%; border-radius: 6px; font-size: .8rem; }
.mod-pasta .mod-ilustra-sm { background: transparent; }
.ui-sobrio .mod-pasta .mod-icone-sobrio.pequeno { background: #fff; color: #35506b; }
.modulo-topo .mod-ilustra svg { transition: transform .2s; }
.modulo-card:hover .mod-ilustra svg { transform: scale(1.08); }
.modulo-nome { font-weight: 600; font-size: .8rem; color: #14222b; line-height: 1.2;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.modulo-nome mark { padding: 0 1px; background: #ffe58a; border-radius: 2px; }
.modulo-letra { position: absolute; top: .3rem; left: .5rem; font-size: .68rem; font-weight: 800; color: #b9c6d3; pointer-events: none; }
.modulo-ind { position: absolute; top: .35rem; right: .4rem; min-width: 1.35rem; height: 1.35rem; padding: 0 .35rem; border-radius: 1rem;
    background: var(--mod-cor); color: #fff; font-size: .7rem; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.modulo-estrela { position: absolute; top: .2rem; right: .25rem; border: 0; background: none; padding: .15rem .25rem; line-height: 1;
    color: #b3bfcb; font-size: .85rem; opacity: 0; transition: opacity .15s, color .15s; }
.modulo-card:has(.modulo-ind) .modulo-estrela { right: 1.9rem; }
.modulo-card:hover .modulo-estrela, .modulo-estrela:focus-visible, .modulo-estrela.on { opacity: 1; }
.modulo-estrela:hover, .modulo-estrela.on { color: #f5a700; }
@media (hover: none) { .modulo-estrela { opacity: .7; } }
/* Funções do módulo encontradas pela busca (atalho direto para a tela) */
.modulo-links { padding: 0 .4rem; }
.modulo-links:has(.modulo-funcao:not(.d-none)) { padding-bottom: .45rem; }
.modulo-funcao { display: block; margin-top: .2rem; padding: .15rem .35rem; border-radius: .3rem; font-size: .7rem; text-decoration: none;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: color-mix(in srgb, var(--mod-cor) 50%, #111); background: color-mix(in srgb, var(--mod-cor) 10%, #fff); }
.modulo-funcao:hover { background: var(--mod-cor); color: #fff; }
/* Meus favoritos (por usuário) */
.modulos-favs { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .75rem; margin-bottom: 1rem; }
.modulos-favs-tit { display: flex; align-items: center; gap: .35rem; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: #6c7a86; }
.modulos-favs-tit .bi { color: #f5a700; }
.modulos-favs-lista { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.modulo-fav { display: inline-flex; align-items: center; gap: .45rem; padding: .2rem .8rem .2rem .25rem; background: #fff; border: 1px solid #e3e8ec; border-radius: 2rem;
    font-size: .82rem; font-weight: 600; color: #14222b; text-decoration: none; transition: border-color .15s, box-shadow .15s; }
.modulo-fav:hover { border-color: var(--mod-cor); box-shadow: 0 2px 8px rgba(16,24,40,.08); color: #14222b; }
.modulo-fav .mod-ilustra-sm { width: 28px; height: 28px; }
.modulos-favs-dica { font-size: .78rem; color: #8a98a3; }

/* ---------------- Componentes */
.card { border: 1px solid #e3e8ec; box-shadow: 0 1px 2px rgba(16,24,40,.04); }
.card-header { background: #fff; font-weight: 600; }
.table > :not(caption) > * > * { padding: .5rem .6rem; }
.table thead th { font-size: .75rem; text-transform: uppercase; letter-spacing: .03em; color: #5b6b77; background: #f7f9fa; }
.form-label { font-size: .8rem; font-weight: 600; color: #44525c; margin-bottom: .2rem; }
.required::after { content: " *"; color: #dc3545; }
fieldset.secao { border: 1px solid #e3e8ec; border-radius: .5rem; padding: 1rem; margin-bottom: 1rem; background: #fff; }
fieldset.secao > legend { float: none; width: auto; font-size: .85rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .04em; color: #0f3d4c; padding: 0 .4rem; margin-bottom: 0; }

.kpi { border-radius: .6rem; padding: 1rem 1.1rem; background: #fff; border: 1px solid #e3e8ec; height: 100%; }
.kpi .valor { font-size: 1.8rem; font-weight: 700; line-height: 1.1; }
.kpi .rotulo { font-size: .8rem; color: #5b6b77; text-transform: uppercase; letter-spacing: .03em; }
.kpi i { font-size: 1.6rem; opacity: .35; }

.paciente-card .avatar { width: 52px; height: 52px; border-radius: 50%; background: #e6f4f3; color: #0f7c76;
    display: flex; align-items: center; justify-content: center; font-size: 1.6rem; }

/* Tipo de atendimento (tela Novo atendimento) */
.tipo-opcao input { display: none; }
.tipo-opcao label { display: block; border: 2px solid #e3e8ec; border-radius: .6rem; padding: .9rem; cursor: pointer; background: #fff; text-align: center; }
.tipo-opcao label i { font-size: 1.8rem; display: block; }
.tipo-opcao input:checked + label { border-color: var(--sb-active); background: #e9f7f6; }

/* ---------------- Classificação de risco (Manchester) */
.risco-vermelho { background: #d62828 !important; color: #fff !important; }
.risco-laranja  { background: #f77f00 !important; color: #fff !important; }
.risco-amarelo  { background: #fcbf49 !important; color: #3a2a00 !important; }
.risco-verde    { background: #2a9d4b !important; color: #fff !important; }
.risco-azul     { background: #1d6fd1 !important; color: #fff !important; }
.risco-sem      { background: #adb5bd; color: #fff; }
.risco-borda-VERMELHO { border-left: 6px solid #d62828 !important; }
.risco-borda-LARANJA  { border-left: 6px solid #f77f00 !important; }
.risco-borda-AMARELO  { border-left: 6px solid #fcbf49 !important; }
.risco-borda-VERDE    { border-left: 6px solid #2a9d4b !important; }
.risco-borda-AZUL     { border-left: 6px solid #1d6fd1 !important; }
.risco-borda-        { border-left: 6px solid #adb5bd !important; }
.cor-risco input { display: none; }
.cor-risco label { border-radius: .5rem; padding: .6rem .9rem; cursor: pointer; opacity: .55; font-weight: 600; min-width: 130px; text-align: center; }
.cor-risco input:checked + label { opacity: 1; outline: 3px solid #0f3d4c; outline-offset: 2px; }
.tempo-estourado { color: #d62828; font-weight: 700; }

/* ---------------- Mapa de leitos */
.mapa-setor { margin-bottom: 1.5rem; }
.leitos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .6rem; }
.leito { border-radius: .5rem; background: #fff; border: 1px solid #e3e8ec; border-top: 5px solid; padding: .55rem .7rem; font-size: .82rem; min-height: 108px; position: relative; }
.leito .codigo { font-weight: 700; font-size: .95rem; }
.leito .paciente { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.leito.LIVRE { border-top-color: #2a9d4b; }
.leito.OCUPADO { border-top-color: #0d6efd; }
.leito.HIGIENIZACAO { border-top-color: #ffc107; background: #fffbea; }
.leito.MANUTENCAO { border-top-color: #6c757d; background: #f4f5f6; }
.leito.BLOQUEADO { border-top-color: #212529; background: #eceeef; }
.leito.RESERVADO { border-top-color: #0dcaf0; background: #effbfe; }
.leito .acoes { position: absolute; top: .35rem; right: .35rem; }

.badge-conv { font-weight: 600; }
.text-pre { white-space: pre-wrap; }
dl.dados dt { font-size: .75rem; color: #5b6b77; font-weight: 600; text-transform: uppercase; }
dl.dados dd { margin-bottom: .6rem; }

.autocomplete-lista { position: fixed; z-index: 1085; background: #fff; border: 1px solid #ced4da; border-radius: .4rem;
    max-height: 380px; overflow-y: auto; width: 560px; box-shadow: 0 8px 24px rgba(0,0,0,.14); }
.autocomplete-lista .item .fw-semibold { white-space: normal; word-break: break-word; }
.autocomplete-lista .item { padding: .45rem .7rem; cursor: pointer; border-bottom: 1px solid #f1f3f5; }
.autocomplete-lista .item:hover, .autocomplete-lista .item.ativo { background: #e9f7f6; }

/* ---------------- Impressão */
@media print {
    body { background: #fff; font-size: 11pt; }
    .main { margin: 0; }
    .conteudo { padding: 0; }
    .card { border: none; box-shadow: none; }
}
.folha { background: #fff; max-width: 900px; margin: 0 auto; padding: 1.5rem; border: 1px solid #dde3e8; }
.folha h2 { font-size: 1.1rem; text-align: center; text-transform: uppercase; margin: .5rem 0 1rem; }
.folha .bloco { border: 1px solid #333; margin-bottom: .6rem; }
.folha .bloco-titulo { background: #e9ecef; font-weight: 700; font-size: .8rem; padding: .15rem .4rem; border-bottom: 1px solid #333; text-transform: uppercase; }
.folha .campos { display: grid; grid-template-columns: repeat(12, 1fr); }
.folha .campo { padding: .2rem .4rem; border-right: 1px solid #999; border-bottom: 1px solid #999; min-height: 2.2rem; }
.folha .campo small { display: block; font-size: .65rem; color: #555; text-transform: uppercase; }
.folha .area { min-height: 6rem; padding: .4rem; }
.folha .assinaturas { display: flex; gap: 2rem; margin-top: 3rem; }
.folha .assinaturas div { flex: 1; border-top: 1px solid #333; text-align: center; font-size: .8rem; padding-top: .2rem; }
@media print { .folha { border: none; padding: 0; } }

/* ---------------- Alergias */
.alergia-grave    { background: #d62828; color: #fff; }
.alergia-moderada { background: #f77f00; color: #fff; }
.alergia-leve     { background: #fcbf49; color: #3a2a00; }

/* ---------------- Kiosk: totem e painel de TV */
body.kiosk { background: #0f3d4c; color: #fff; min-height: 100vh; }
.totem { max-width: 1100px; margin: 0 auto; padding: 2rem 1rem; text-align: center; }
.totem-filas { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1rem; }
.totem-fila { background: rgba(255,255,255,.08); border-radius: 1rem; padding: 1rem; display: grid; gap: .6rem; align-content: start; }
.totem-fila .nome { font-size: 1.5rem; font-weight: 700; }
.totem-fila .btn-lg { padding: 1rem; font-size: 1.25rem; }
.ticket { background: #fff; color: #000; width: 300px; margin: 0 auto; padding: 1rem; border-radius: .5rem; text-align: center; }
.ticket .fila { font-weight: 700; text-transform: uppercase; }
.ticket .codigo { font-size: 3.2rem; font-weight: 800; letter-spacing: .05em; line-height: 1.1; }
@media print {
    body.kiosk { background: #fff; }
    body.kiosk .totem > *:not(.ticket) { display: none !important; }
    .ticket { width: 72mm; border: none; padding: 0; }
}

/* Painel de TV: chamada atual em destaque (esquerda) e as anteriores em coluna, uma por senha/paciente (direita) */
.tv { height: 100vh; overflow: hidden; display: grid; grid-template-rows: auto minmax(0, 1fr); background: linear-gradient(160deg, #0b2440 0%, #0e3358 55%, #0b2a4a 100%); color: #fff; }
.tv-topo { display: flex; justify-content: space-between; align-items: center; padding: 1rem 2.5rem; font-size: 1.6rem; font-weight: 600;
    background: rgba(0,0,0,.25); border-bottom: 1px solid rgba(255,255,255,.08); }
.tv-topo #tv-relogio { font-variant-numeric: tabular-nums; font-size: 2rem; }
.tv-corpo { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(320px, 1fr); gap: 1.5rem; padding: 1.5rem 2.5rem 2rem; min-height: 0; }
.tv-atual { display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; padding: 2rem;
    border-radius: 1.5rem; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1); box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.tv-atual .rotulo { font-size: clamp(1.2rem, 2vw, 2rem); text-transform: uppercase; letter-spacing: .12em; opacity: .75; }
.tv-atual .texto { font-size: clamp(3rem, 9vw, 9rem); font-weight: 800; line-height: 1.05; margin: .5rem 0 1rem; word-break: break-word; }
.tv-atual .local { display: inline-flex; align-items: center; gap: .6rem; font-size: clamp(1.8rem, 4.2vw, 4.2rem); font-weight: 700; color: #0b2440;
    background: #5ee0d6; padding: .25em .8em; border-radius: 999px; }
.tv-atual .local:empty { display: none; }
.tv-atual.pisca { animation: pisca 1s ease-in-out 3; }
@keyframes pisca { 50% { background: rgba(94,224,214,.35); } }
.tv-anteriores { display: flex; flex-direction: column; min-height: 0; border-radius: 1.5rem; background: rgba(0,0,0,.22); border: 1px solid rgba(255,255,255,.08); overflow: hidden; }
.tv-anteriores .rotulo { padding: .9rem 1.5rem; font-size: 1.15rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; opacity: .8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    border-bottom: 1px solid rgba(255,255,255,.1); }
.tv-anteriores ol { list-style: none; margin: 0; padding: 0; flex: 1; min-height: 0; overflow: hidden; display: flex; flex-direction: column; }
.tv-anteriores li { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "cod hora" "loc hora"; align-items: center; column-gap: 1rem;
    padding: .65rem 1.5rem; border-bottom: 1px solid rgba(255,255,255,.08); animation: tv-entra .4s ease-out; }
.tv-anteriores li:nth-child(odd) { background: rgba(255,255,255,.03); }
.tv-anteriores .cod { grid-area: cod; font-size: clamp(1.6rem, 2.6vw, 2.6rem); font-weight: 800; line-height: 1.1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tv-anteriores .loc { grid-area: loc; font-size: clamp(1rem, 1.5vw, 1.5rem); color: #5ee0d6; font-weight: 600; }
.tv-anteriores .hora { grid-area: hora; font-size: clamp(1rem, 1.6vw, 1.6rem); opacity: .65; font-variant-numeric: tabular-nums; }
.tv-anteriores .vazio { padding: 1.5rem; opacity: .6; font-size: 1.3rem; }
@keyframes tv-entra { from { opacity: 0; transform: translateY(-6px); } }
@media (max-width: 900px) { .tv-corpo { grid-template-columns: 1fr; } }
#tv-som { position: fixed; bottom: 1rem; right: 1rem; }

/* ---------------- PEP */
.pep-cabecalho { border-left: 5px solid #1ba39c; }
.pep-cabecalho.pep-alergico { border-left-color: #d62828; }
.pep-abas .nav-link { padding: .45rem .8rem; }
.doc-card .card-header { background: #f7f9fa; }
.doc-conteudo dt { font-size: .75rem; text-transform: uppercase; color: #5b6b77; margin-top: .4rem; }
.doc-conteudo dd { margin-bottom: .2rem; }
.item-suspenso { text-decoration: line-through; opacity: .6; }
.apraz { display: inline-flex; flex-direction: column; align-items: center; min-width: 58px; padding: .2rem .35rem; border-radius: .4rem;
    border: 1px solid #dee2e6; font-size: .78rem; line-height: 1.15; background: #fff; }
.apraz.PENDENTE { border-color: #adb5bd; }
.apraz.PENDENTE.atrasado { border-color: #d62828; background: #fdecec; }
.apraz.PENDENTE.agora { border-color: #f77f00; background: #fff4e5; }
.apraz.REALIZADO { border-color: #2a9d4b; background: #eaf7ee; }
.apraz.NAO_REALIZADO { border-color: #d62828; background: #fbe9e9; }
.apraz.SUSPENSO { opacity: .5; text-decoration: line-through; }
button.apraz { cursor: pointer; }
.badge-mpp { background: #6f42c1; color: #fff; }
.badge-ctrl { background: #212529; color: #fff; }

/* =====================================================================
   Tema "sistema" (telas internas): fonte menor, controles compactos, campos destacados,
   painéis com barra de título e grades densas — no estilo dos sistemas hospitalares (MV, Tasy).
   Totem, painel de TV, login e impressões não usam este tema.
   ===================================================================== */
html:has(body.com-menu) { font-size: 13px; }
body.com-menu { font-family: "Segoe UI", Tahoma, Arial, sans-serif; font-size: 1rem; color: #1d2a36; }
.com-menu h1, .com-menu .h1, .com-menu h2, .com-menu .h2, .com-menu h3, .com-menu .h3 { font-size: 1.3rem; font-weight: 600; }
.com-menu h4, .com-menu .h4 { font-size: 1.15rem; font-weight: 600; }
.com-menu h5, .com-menu .h5 { font-size: 1.05rem; font-weight: 600; }
.com-menu h6, .com-menu .h6 { font-size: .95rem; font-weight: 700; color: var(--titulo); }
.com-menu .conteudo a:not(.btn):not(.nav-link):not(.dropdown-item):not(.list-group-item):not(.badge):not(.recente):not(.modulo-topo):not(.modulo-fav):not(.modulo-funcao):not(.menu-modulo):not(.sub-aba) { color: #1b5fa6; }
.com-menu .busca-rapida .form-control { padding-left: 1.8rem; }
.com-menu .busca-modulos .form-control { padding-left: 2rem; min-height: 30px; }
.com-menu .conteudo { padding: .6rem .75rem 1rem; }

/* Barra superior escura */
.com-menu .topbar { background: linear-gradient(180deg, #24507a, #1c3f62); border-bottom: 1px solid #12304d; gap: .6rem; padding: 0 .75rem; color: #e8eff6; }
.com-menu .topbar-marca { color: #fff; font-size: 1rem; }
.com-menu .topbar-marca i { color: #7fc4ff; font-size: 1.2rem; }
.com-menu .topbar .migalha a { color: #b9cfe4; }
.com-menu .topbar .migalha a:hover { color: #fff; }
.com-menu .topbar .migalha span { color: #fff; font-weight: 600; }
.com-menu .topbar .migalha i { color: #7f9bb6; }
.com-menu .topbar .text-body { color: #fff !important; }
.com-menu .topbar .text-muted { color: #b9cfe4 !important; }
.com-menu .topbar .btn-light { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.25) !important; color: #fff; }
.com-menu .topbar .btn-light:hover { background: rgba(255,255,255,.22); }
.com-menu .topbar .form-control, .com-menu .topbar .form-select { background-color: #f4f7fa; border-color: #12304d; min-height: 26px; }
.com-menu .topbar .dropdown-menu { color: #1d2a36; }
.com-menu .topbar .badge { font-size: .7rem; }

/* Menu lateral compacto */
.com-menu .sidebar .nav-header { font-size: .68rem; padding: .7rem .8rem .2rem; color: #8ea6bd; }
.com-menu .sidebar .nav-link { padding: .3rem .8rem; font-size: .95rem; }
.com-menu .sidebar .nav-link i { width: 1.3rem; }
.com-menu .sidebar .nav-link.active { background: rgba(47,128,201,.28); }
.com-menu .sidebar-voltar { padding: .5rem .8rem; }
.com-menu .sidebar-modulo { padding: .6rem .8rem; }
.com-menu .sidebar-modulo .mod-icone { width: 1.9rem; height: 1.9rem; font-size: 1rem; border-radius: .35rem; }

/* Cabeçalho da página como barra de ferramentas */
.com-menu .page-header { background: #fff; border: 1px solid var(--linha); border-left: 4px solid var(--sb-active); border-radius: 3px;
    padding: .4rem .6rem; margin-bottom: .6rem !important; gap: .4rem !important; }
.com-menu .page-header h1 { font-size: 1.15rem; font-weight: 700; color: var(--titulo); }
.com-menu .page-header .text-muted { font-size: .85rem; }

/* Botões compactos, cantos quase retos */
.com-menu .btn { --bs-btn-padding-y: .2rem; --bs-btn-padding-x: .6rem; --bs-btn-font-size: .95rem; --bs-btn-border-radius: 3px; font-weight: 500; }
.com-menu .btn-sm { --bs-btn-padding-y: .1rem; --bs-btn-padding-x: .45rem; --bs-btn-font-size: .85rem; }
.com-menu .btn-lg { --bs-btn-padding-y: .35rem; --bs-btn-padding-x: .9rem; --bs-btn-font-size: 1.05rem; }
.com-menu .btn-primary { --bs-btn-bg: #2466a8; --bs-btn-border-color: #1d5793; --bs-btn-hover-bg: #1d5793; --bs-btn-hover-border-color: #174a7e; }
.com-menu .btn-success { --bs-btn-bg: #23834a; --bs-btn-border-color: #1c6f3e; --bs-btn-hover-bg: #1c6f3e; }

/* Campos bem destacados: borda forte, obrigatório com fundo amarelado, foco com contorno azul */
.com-menu .form-control, .com-menu .form-select {
    font-size: .95rem; padding: .18rem .45rem; min-height: 26px; border: 1px solid var(--campo-borda); border-radius: 2px; background-color: #fff; color: #1d2a36; }
.com-menu .form-select { padding-right: 1.7rem; background-position: right .4rem center; background-size: 12px 10px; }
.com-menu .form-control-sm, .com-menu .form-select-sm { font-size: .85rem; min-height: 22px; padding-top: .08rem; padding-bottom: .08rem; }
.com-menu .form-control-lg { font-size: 1.05rem; min-height: 30px; padding: .3rem .6rem; }
/* Obrigatório: vazio em amarelo forte com faixa laranja; preenchido fica amarelo claro */
.com-menu .form-control:required, .com-menu .form-select:required { background-color: var(--campo-obrig); border-color: #c9a227; box-shadow: inset 3px 0 0 #f0a500; }
.com-menu .form-control:required:invalid, .com-menu .form-select:required:invalid { background-color: #ffe98a; border-color: #d4a000; box-shadow: inset 4px 0 0 #e8590c; }
.com-menu .form-control:required:invalid::placeholder { color: #8a6d00; }
.com-menu .required { color: #1d2a36; }
.com-menu .required::after { content: " *"; color: #d6336c; font-weight: 800; font-size: 1.1em; }
.com-menu .form-control:focus, .com-menu .form-select:focus {
    border-color: #2f80c9; box-shadow: 0 0 0 2px rgba(47,128,201,.3); background-color: #fff; }
.com-menu .form-control:disabled, .com-menu .form-control[readonly], .com-menu .form-select:disabled { background-color: #eef1f4; color: #55636f; }
.com-menu .form-label { font-size: .82rem; font-weight: 600; color: #2b3d4f; margin-bottom: 1px; }
.com-menu .form-text { font-size: .8rem; margin-top: 1px; }
.com-menu .form-check { min-height: 1.2rem; }
.com-menu .form-check-input { border-color: var(--campo-borda); }
.com-menu .input-group-text { padding: .18rem .45rem; font-size: .9rem; border-color: var(--campo-borda); border-radius: 2px; }

/* Painéis com barra de título */
.com-menu .card { border: 1px solid var(--linha); border-radius: 3px; box-shadow: 0 1px 1px rgba(20,40,60,.04); }
.com-menu .card-header { background: linear-gradient(180deg, #f5f8fb, #e2e9f0); border-bottom: 1px solid var(--linha); padding: .32rem .6rem;
    font-size: .92rem; font-weight: 700; color: var(--titulo); }
.com-menu .card-body { padding: .6rem .7rem; }
.com-menu .card-footer { padding: .4rem .6rem; background: #f3f6f9; border-top: 1px solid var(--linha); }
.com-menu .card.card-body { padding: .6rem .7rem; }
.com-menu fieldset.secao { border: 1px solid var(--linha); border-radius: 3px; padding: .55rem .7rem .7rem; margin-bottom: .6rem; }
.com-menu fieldset.secao > legend { font-size: .82rem; color: var(--titulo); background: linear-gradient(180deg, #f5f8fb, #e2e9f0);
    border: 1px solid var(--linha); border-radius: 2px; padding: .05rem .6rem; letter-spacing: .03em; }
.com-menu .list-group-item { padding: .35rem .6rem; }

/* Grades densas com zebra e cabeçalho marcado */
.com-menu .table { font-size: .93rem; --bs-table-striped-bg: rgba(31,58,85,.035); --bs-table-hover-bg: rgba(47,128,201,.12); }
.com-menu .table > :not(caption) > * > * { padding: .26rem .5rem; border-bottom-color: #dfe5eb; }
.com-menu .table > tbody > tr:nth-of-type(even) > * { --bs-table-bg-type: var(--bs-table-striped-bg); }
.com-menu .table thead th { background: #dde5ec; color: #2b3d4f; font-size: .78rem; font-weight: 700; letter-spacing: .02em;
    border-bottom: 1px solid #b7c5d2; white-space: nowrap; }
.com-menu .table-sm > :not(caption) > * > * { padding: .18rem .45rem; }
.com-menu .table tfoot td { background: #eef2f6; }

/* Demais componentes */
.com-menu .badge { font-size: .75em; font-weight: 600; border-radius: 2px; padding: .28em .5em; }
.com-menu .alert { padding: .4rem .7rem; font-size: .93rem; border-radius: 3px; margin-bottom: .6rem; }
.com-menu .alert-dismissible .btn-close { padding: .55rem .7rem; }
.com-menu .nav-tabs .nav-link { padding: .3rem .7rem; font-size: .93rem; border-radius: 3px 3px 0 0; }
.com-menu .dropdown-menu { font-size: .93rem; border-radius: 3px; }
.com-menu .dropdown-item { padding: .25rem .8rem; }
.com-menu .modal-content { border-radius: 4px; }
.com-menu .modal-header { background: linear-gradient(180deg, #f5f8fb, #e2e9f0); padding: .45rem .8rem; }
.com-menu .modal-title { font-size: 1rem; font-weight: 700; color: var(--titulo); }
.com-menu .kpi { border-radius: 3px; padding: .5rem .7rem; border-color: var(--linha); }
.com-menu .kpi .valor { font-size: 1.45rem; }
.com-menu .kpi .rotulo { font-size: .72rem; }
.com-menu .kpi i { font-size: 1.25rem; }
.com-menu .paciente-card .avatar { width: 38px; height: 38px; font-size: 1.2rem; }
.com-menu .paciente-card .card-body { gap: 1rem !important; }
.com-menu .tipo-opcao label { padding: .45rem; border-radius: 3px; border-width: 1px; }
.com-menu .tipo-opcao label i { font-size: 1.3rem; }
.com-menu .tipo-opcao input:checked + label { border-color: var(--sb-active); background: #e6f0fa; box-shadow: inset 0 0 0 1px var(--sb-active); }
.com-menu .leito { border-radius: 3px; font-size: .88rem; min-height: 92px; }
.com-menu .apraz { border-radius: 2px; }
.com-menu .autocomplete-lista { border-radius: 2px; font-size: .93rem; }
.com-menu .autocomplete-lista .item { padding: .3rem .6rem; }

/* Tela de módulos no tema */
.mod-ilustra { flex-shrink: 0; width: 54px; height: 54px; display: inline-block; }
.mod-ilustra svg { width: 100%; height: 100%; display: block; }
.mod-ilustra-sm { width: 36px; height: 36px; background: #fff; border-radius: 50%; }
.com-menu .mod-icone { border-radius: .4rem; }
.com-menu .busca-modulos input { border-radius: 3px; }
.com-menu .recente { border-radius: 3px; border-color: var(--linha); }

/* Pedido de exames recolhível (PEP) */
.pedido-toggle { cursor: pointer; user-select: none; }
.pedido-toggle:hover { background: linear-gradient(180deg, #eef4fa, #dbe6f0) !important; }
.pedido-seta { transition: transform .15s; display: inline-block; }
.pedido-toggle:not(.collapsed) .pedido-seta { transform: rotate(90deg); }

/* Worklist agrupada por pedido */
.worklist-pedidos .pedido-linha { cursor: pointer; }
.worklist-pedidos .pedido-linha:hover > * { --bs-table-bg-type: rgba(47,128,201,.10); }
.worklist-pedidos .pedido-linha.aberto .pedido-seta { transform: rotate(90deg); }
.worklist-pedidos .pedido-detalhe > td { background: #f7f9fb; border-left: 3px solid var(--sb-active); }

/* Digitação de resultados do laboratório */
.grupo-resultado > td { background: #e2e9f0 !important; font-weight: 700; color: var(--titulo); font-size: .82rem; text-transform: uppercase; letter-spacing: .03em; }
.campo-calculado { background-color: #eef3f8 !important; color: #1f3a55; font-weight: 600; }

/* ---------------- Impressão de relatórios: formulário contínuo de impressora matricial (estilo MS-DOS)
   Vale para as telas do sistema impressas pelo navegador; documentos (.folha) e etiquetas ficam com o layout próprio. */
@page matricial {
    size: A4 portrait; margin: 12mm 10mm 12mm 10mm;
    @top-right { content: "PÁG.: " counter(page, decimal-leading-zero); font: 8pt "Courier New", Courier, monospace; }
}
@media print {
    body.com-menu:not(:has(.folha, .etiqueta)) {
        page: matricial;
        font: 8.5pt/1.35 "Courier New", Courier, "Lucida Console", monospace !important;
        text-transform: uppercase;
        background: #fff !important;
        -webkit-text-stroke: .2px #000; /* traço mais cheio, lembrando a fita da matricial */
        & * { font-family: inherit !important; color: #000 !important; background: transparent !important; box-shadow: none !important;
              border-radius: 0 !important; text-shadow: none !important; font-size: inherit; }
        & .bi, & canvas, & .avatar, & .mod-ilustra, & .mod-icone-sobrio { display: none !important; }
        & a { text-decoration: none !important; }
        & .conteudo, & .main { padding: 0 !important; margin: 0 !important; }
        & .card, & .kpi, & .alert { border: 0 !important; padding: 0 !important; margin: 0 !important; }
        & .card-header, & .card-body { padding: 0 !important; border: 0 !important; }
        & .card-header { font-weight: 700; margin-top: 2mm !important; }
        & .card-header::before { content: "» "; }

        /* Cabeçalho: linhas de "=" como no relatório de texto */
        & .rel-cab::before, & .rel-cab::after, & .page-header::after, & .rel-fim::before {
            content: "================================================================================================================================================================";
            display: block; white-space: nowrap; overflow: hidden; letter-spacing: 0; }
        & .rel-linha { display: flex; justify-content: space-between; font-weight: 700; }
        & .page-header { display: block !important; text-align: center; margin: 1mm 0 2mm !important; border: 0 !important; padding: 0 !important; }
        & .page-header h1 { font-size: 10.5pt !important; font-weight: 700; letter-spacing: .15em; margin: 0 !important; }
        & .page-header .text-muted { font-size: 8.5pt !important; }
        & .page-header::after { content: "--------------------------------------------------------------------------------------------------------------------------------------------------------"; }
        & .rel-fim { text-align: center; margin-top: 4mm; }
        & .rel-fim::before { margin-bottom: 1mm; }

        /* Indicadores: "RÓTULO....: VALOR" em linha */
        & .row:has(> [class*="col"] > .kpi) { display: flex !important; flex-wrap: wrap; gap: 0 8mm; margin: 0 0 2mm !important;
              border-bottom: 1px dashed #000; padding-bottom: 1mm; }
        & .row:has(> [class*="col"] > .kpi) > [class*="col"] { width: auto !important; flex: 0 0 auto !important; padding: 0 !important; margin: 0 !important; }
        & .kpi { display: flex; align-items: baseline; gap: 1ch; }
        & .kpi .rotulo { font-size: inherit !important; letter-spacing: 0; }
        & .kpi .rotulo::after { content: ".....:"; }
        & .kpi .valor { font-size: inherit !important; font-weight: 700; line-height: inherit; }

        /* Tabelas: sem grade, cabeçalho e total entre tracejados, papel zebrado (formulário contínuo) */
        & .table-responsive { overflow: visible !important; }
        & table { width: 100% !important; border-collapse: collapse !important; margin: 0 0 2mm !important; font-size: 8pt; }
        & table > :not(caption) > * > * { border: 0 !important; padding: .2mm 1.2mm !important; vertical-align: top !important; }
        & thead th { font-weight: 700; white-space: nowrap; border-top: 1px dashed #000 !important; border-bottom: 1px dashed #000 !important; }
        & tfoot td, & tfoot th { font-weight: 700; border-top: 1px dashed #000 !important; border-bottom: 3px double #000 !important; }
        & tbody tr { break-inside: avoid; }
        & tbody tr:nth-child(6n+1) > *, & tbody tr:nth-child(6n+2) > *, & tbody tr:nth-child(6n+3) > * {
              background: #e4f1e4 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
        & small, & .small, & .text-muted { font-size: inherit !important; }
        & .fw-bold, & b, & strong, & .text-danger { font-weight: 700 !important; }
        & .badge { border: 0 !important; padding: 0 !important; font-weight: 700; }
        & .badge::before { content: "["; } & .badge::after { content: "]"; }
        & .nav-tabs, & .btn, & .progress { display: none !important; }
        & p.small, & .form-text { margin-top: 1mm; font-style: normal; }
    }
}

/* ---------------- Telas com abas: faixa de guias + painel do conteúdo colado à aba ativa (visual de pasta).
   Uso: <ul class="nav nav-tabs abas-pasta"> seguido do conteúdo; o app.js envolve o conteúdo em .painel-abas
   (o prontuário já gera o painel no servidor). */
.com-menu .pep-cabecalho { margin-bottom: .6rem !important; }
.com-menu .abas-pasta { background: #dfe5ec; border: 1px solid var(--linha); border-bottom: 1px solid var(--linha); border-radius: 4px 4px 0 0;
    padding: .35rem .4rem 0; margin-bottom: 0 !important; gap: 2px; }
.com-menu .abas-pasta .nav-link { background: #eef2f6; color: #3d5266; border: 1px solid #cfd8e2; border-bottom: 0; white-space: nowrap; }
.com-menu .abas-pasta .nav-link:hover { background: #fff; color: var(--titulo); }
.com-menu .abas-pasta .nav-link.active { background: #fff; color: var(--titulo); font-weight: 600; border-color: var(--linha);
    box-shadow: inset 0 3px 0 #198754; position: relative; z-index: 1; border-bottom: 1px solid #fff; margin-bottom: -1px; }
.painel-abas { background: #fff; border: 1px solid var(--linha); border-top: 0; border-radius: 0 0 4px 4px; padding: .75rem;
    margin-bottom: 1rem; box-shadow: 0 1px 2px rgba(20,40,60,.05); }
.painel-abas > :last-child { margin-bottom: 0 !important; }
.painel-abas .card { box-shadow: none; }
.painel-abas .card-header { background: #f3f6f9; }
/* Sub-abas (segundo nível, ex.: Enfermagem > SAE / Escalas / Balanço / Dispositivos): faixa no topo do painel */
.sub-abas { display: flex; flex-wrap: wrap; gap: .25rem; margin: -.75rem -.75rem .75rem; padding: .4rem .75rem; background: #f3f6f9;
    border-bottom: 1px solid #dfe5ec; }
.com-menu .sub-abas a { padding: .2rem .7rem; border-radius: 3px; color: #3d5266; text-decoration: none; font-size: .9rem; border: 1px solid transparent; }
.sub-abas a:hover { background: #fff; border-color: #cfd8e2; }
.com-menu .sub-abas a.active, .com-menu .sub-abas a.active:hover { background: #198754; border-color: #198754; color: #fff; font-weight: 600; }
.sub-abas .badge { font-size: .7rem; }
@media print { .painel-abas { border: 0; padding: 0; box-shadow: none; } .sub-abas { display: none; } }

/* ---------------- Cabeçalho timbrado dos documentos (Administração > Dados da instituição) */
.doc-cab { display: flex; align-items: center; gap: 1.1rem; padding-bottom: .55rem; margin-bottom: .9rem; border-bottom: 3px solid var(--inst-cor, #1f3a55); }
.doc-cab-logo { height: 64px; width: auto; max-width: 230px; object-fit: contain; }
.doc-cab-nome { font-weight: 700; font-size: 1.1rem; color: var(--inst-cor, #1f3a55); }
.doc-cab-dados { flex: 1; font-size: .74rem; line-height: 1.35; color: #3b3b3b; text-align: center; }
.doc-cab-razao { font-weight: 700; font-size: .92rem; color: var(--inst-cor, #1f3a55); letter-spacing: .02em; margin-bottom: .1rem; }
.doc-cab > .text-end, .doc-cab-dir { font-size: .74rem; text-align: right; white-space: nowrap; line-height: 1.35; }
.doc-rodape { border-top: 1px solid #bbb; margin-top: .8rem; padding-top: .3rem; font-size: .68rem; text-align: center; color: #555; }
@media print { .doc-cab { -webkit-print-color-adjust: exact; print-color-adjust: exact; } }

/* ---------------- Documentos impressos (padrão da receita): folha A4, timbre, assinatura no pé e rodapé institucional */
@page { size: A4 portrait; margin: 12mm 14mm; }
.doc-body { background: #e9edf1; }
.doc-body .folha { width: 210mm; max-width: none; min-height: 297mm; margin: 0 auto 1.2rem; padding: 12mm 14mm; border: 0;
    box-shadow: 0 1px 6px rgba(0,0,0,.14); display: flex; flex-direction: column; font-family: 'Segoe UI', Arial, sans-serif; color: #222; }
.doc-body .folha h2 { font-size: 1.05rem; font-weight: 700; letter-spacing: .12em; color: var(--inst-cor, #1f3a55); margin: .2rem 0 .9rem; }
.doc-body .folha .bloco { border-color: #aab4bf; border-radius: 3px; }
.doc-body .folha .bloco-titulo { background: #eef2f5; color: var(--inst-cor, #1f3a55); border-bottom-color: #aab4bf; letter-spacing: .04em; }
.doc-body .folha .campo { border-color: #d3d9df; }
.doc-body .folha .campo small { color: #6b7680; letter-spacing: .03em; }
.doc-body .folha table.table { font-size: .85rem; }
.doc-body .folha table.table thead th { background: #eef2f5; color: var(--inst-cor, #1f3a55); }
.doc-body .folha > .assinaturas { margin-top: auto; padding-top: 2.5rem; }
.doc-body .folha > .assinaturas div { border-top-color: #222; font-weight: 600; }
.doc-body .folha > .folha-fim { margin-top: auto; padding-top: 1rem; }
.doc-body .folha > .assinaturas ~ .folha-fim { margin-top: .6rem; padding-top: 0; }
.doc-body .folha .folha-fim > p { text-align: center; font-size: .68rem !important; }
@media print {
    .doc-body { background: #fff; }
    .doc-body .folha { width: auto; min-height: calc(297mm - 24mm - 3mm); margin: 0; padding: 0; box-shadow: none; }
    .doc-body .folha ~ .folha { break-before: page; }
    .doc-body .folha { font-size: 9.5pt; }
    .doc-body .folha .campo { min-height: 1.75rem; padding: .1rem .4rem; }
    .doc-body .folha .bloco { margin-bottom: .45rem; }
    .doc-body .folha h2 { margin: 0 0 .6rem; }
    .doc-body .folha > .assinaturas { padding-top: 1.5rem; }
    .doc-body .folha .area { min-height: 3.5rem; }
    .doc-body .folha .area[style*="10rem"] { min-height: 5.5rem !important; }
    .doc-body .folha .area[style*="8rem"] { min-height: 4.5rem !important; }
    .doc-body .doc-cab-logo { height: 54px; }
    .doc-body .doc-cab-dados { font-size: .68rem; }
    .doc-body .doc-rodape { margin-top: .35rem; padding-top: .2rem; }
    .doc-body .folha .folha-fim > p { margin-top: .4rem !important; }
    .doc-body .folha > .assinaturas ~ .folha-fim { margin-top: .3rem; }
    .doc-body .folha .bloco-titulo, .doc-body .folha table.table thead th { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* Prescrição: lista de itens padronizados por categoria */
.itens-padrao { max-height: 220px; overflow-y: auto; }
.itens-padrao .list-group-item.active { background: #e7f1ff; color: #0b3d74; border-color: #b6d4fe; font-weight: 600; }

/* Prescrição: aditivos do soro recuados sob a solução base */
tr.item-aditivo td { border-top: 0; padding-top: 0; }
/* Prescrição: soro e aditivos agrupados no frasco */
.soro-frasco { border: 1px solid var(--bs-primary-border-subtle); border-left: 4px solid var(--bs-primary); border-radius: .375rem; background: var(--bs-primary-bg-subtle); padding: .35rem .6rem; }
.soro-oculto { display: none !important; } /* campo escondido no soro que ainda vai no envio */
/* Soro no formulário da prescrição: frasco 1 e frascos seguintes no mesmo formato (campos do mesmo tamanho) */
.soro-frasco-edit { padding: .55rem .7rem .6rem; background: color-mix(in srgb, var(--bs-primary-bg-subtle) 55%, #fff); }
.soro-frasco-edit .form-label { font-size: .78rem; margin-bottom: .15rem; font-weight: 600; color: var(--bs-primary-text-emphasis); }
.soro-frasco-edit .form-control, .soro-frasco-edit .form-select, .soro-frasco-edit .input-group-text { font-size: .875rem; padding-top: .3rem; padding-bottom: .3rem; min-height: 0; }
.soro-frasco-edit .input-group-text { padding-left: .45rem; padding-right: .45rem; color: #5b6b80; }
.soro-frasco-edit .aditivo .form-control, .soro-frasco-edit .aditivo .form-select { font-size: .82rem; }
.soro-frasco-tit { font-size: .8rem; color: var(--bs-primary-text-emphasis); margin-bottom: .15rem; }
.soro-frasco-itens { list-style: none; margin: 0; padding: 0; }
.soro-frasco-itens li { padding: .1rem 0; border-bottom: 1px dashed var(--bs-primary-border-subtle); }
.soro-frasco-itens li:last-child { border-bottom: 0; }
.soro-frasco-itens .soro-qtd { font-weight: 600; white-space: nowrap; }
.soro-frasco-adm { font-size: .8rem; margin-top: .2rem; padding-top: .2rem; border-top: 1px solid var(--bs-primary-border-subtle); font-weight: 600; }
/* Soro alternado: grupo de frascos em sequência e o trilho Frasco 1 → Frasco 2 → … */
.soro-grupo { border: 1px solid var(--bs-primary-border-subtle); border-radius: .375rem; padding: .35rem; }
.soro-grupo-tit { font-size: .85rem; font-weight: 600; color: var(--bs-primary-text-emphasis); margin-bottom: .25rem; }
.soro-grupo .soro-frasco + .soro-frasco { margin-top: .35rem; }
.soro-trilho { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem; font-size: .8rem; margin: .15rem 0 .35rem; }
.soro-trilho-passo { border: 1px solid var(--bs-primary-border-subtle); border-radius: 1rem; padding: 0 .55rem; background: var(--bs-body-bg); white-space: nowrap; }
.soro-trilho-passo.atual { background: var(--bs-primary); border-color: var(--bs-primary); color: #fff; font-weight: 600; }
.soro-trilho-seta { color: var(--bs-secondary-color); }

/* ---------------- Assinatura da VorqX Tecnologia (quem desenvolve o sistema) */
.sidebar { display: flex; flex-direction: column; }
.sidebar > .nav { flex: 1 0 auto; }
.sidebar-vorqx { flex: none; display: flex; align-items: center; gap: .5rem; padding: .65rem 1rem .8rem; margin-top: .5rem;
    border-top: 1px solid rgba(255,255,255,.08); text-decoration: none; font-size: .62rem; letter-spacing: .08em; text-transform: uppercase; color: #8ea6bd; }
.sidebar-vorqx img { height: 21px; width: auto; opacity: .85; transition: opacity .15s; }
.sidebar-vorqx:hover { color: #fff; } .sidebar-vorqx:hover img { opacity: 1; }
/* Rodapé preso na parte de baixo da tela: a área de conteúdo cresce e empurra o rodapé para o fim */
.main { display: flex; flex-direction: column; }
.main > .conteudo { flex: 1 0 auto; }
.rodape-vorqx { flex: none; display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin: 0 .75rem; padding: .55rem 0 .6rem;
    border-top: 1px solid rgba(0,0,0,.08); font-size: .75rem; color: #7b8794; }
.footer-vorqx { margin-left: auto; display: inline-flex; align-items: center; gap: .4rem; color: #7b8794; text-decoration: none; }
.footer-vorqx img { height: 24px; width: auto; }
.footer-vorqx span { text-transform: uppercase; letter-spacing: .08em; font-size: .62rem; }
.rodape-inst { display: inline-flex; align-items: center; gap: .6rem; }
.rodape-inst img { height: 30px; width: auto; }
.rodape-inst img + span { padding-left: .6rem; border-left: 1px solid rgba(0,0,0,.12); }
.footer-vorqx:hover { color: #1362a5; }
.login-vorqx { display: flex; flex-direction: column; align-items: center; gap: .35rem; margin-top: 1.1rem; font-size: .78rem; color: rgba(255,255,255,.72); }
/* ---------------- Tela de login: vitrine no azul do menu + painel branco com o formulário */
body.sem-menu:has(.login-tela) { display: block; background: #fff; }
.login-tela { display: flex; min-height: 100vh; }
.login-vitrine { flex: 1 1 56%; display: flex; flex-direction: column; justify-content: space-between; padding: 2.2rem 3rem; color: #fff;
    background: radial-gradient(circle at 85% 15%, rgba(47,128,201,.35), transparent 45%), linear-gradient(160deg, #1c3550, #142840); }
.login-vitrine-topo { font-weight: 700; font-size: 1.15rem; letter-spacing: .02em; display: flex; align-items: center; gap: .5rem; }
.login-vitrine-topo i { color: #8fc5ff; }
.login-vitrine-meio { max-width: 560px; }
.login-vitrine h1 { font-size: 2rem; font-weight: 700; line-height: 1.2; margin-bottom: .6rem; }
.login-vitrine p { color: #b9cbe0; font-size: 1rem; margin-bottom: 1.8rem; }
.login-mods { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .8rem; }
.login-mod { display: flex; flex-direction: column; align-items: center; gap: .45rem; padding: .9rem .4rem; border-radius: .8rem;
    background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.08); font-size: .78rem; color: #dbe6f3; text-align: center; }
.login-mod .mod-ilustra { width: 48px; height: 48px; background: #fff; border-radius: 50%; padding: 4px; }
.login-vitrine-pe { font-size: .8rem; color: #8ea6bd; }
/* Variante "destaques" da vitrine: lista com ícones e ECG decorativo */
.login-vitrine { position: relative; overflow: hidden; }
.login-vitrine > * { position: relative; z-index: 1; }
.login-ecg { position: absolute !important; z-index: 0 !important; left: 0; right: 0; bottom: 14%; width: 100%; height: 160px; color: rgba(143,197,255,.13); }
.login-destaques { list-style: none; padding: 0; margin: 0; display: grid; gap: 1.15rem; }
.login-destaques li { display: flex; gap: 1rem; align-items: flex-start; }
.login-destaque-ic { flex: none; width: 2.6rem; height: 2.6rem; border-radius: .7rem; display: inline-flex; align-items: center; justify-content: center;
    background: rgba(143,197,255,.14); border: 1px solid rgba(143,197,255,.25); color: #8fc5ff; font-size: 1.2rem; }
.login-destaques b { display: block; font-size: 1rem; color: #fff; }
.login-destaques span { font-size: .88rem; color: #aebfd3; }
/* Variante "clean": só a marca, uma frase e o ECG */
.login-v-clean .login-clean-tit { font-size: 2.6rem; font-weight: 300; letter-spacing: -.01em; margin: 0; }
.login-v-clean .login-ecg { bottom: 16%; color: rgba(143,197,255,.18); }
.login-painel { flex: 1 1 44%; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 2rem 1.5rem; background: #fff; }
.login-caixa { width: 100%; max-width: 380px; }
.login-inst { margin-bottom: 1.6rem; }
.login-inst img { max-height: 64px; max-width: 240px; }
.login-inst i { font-size: 2rem; color: #2466a8; margin-right: .4rem; }
.login-caixa h2 { font-size: 1.45rem; font-weight: 700; color: #1c3550; margin-bottom: .2rem; }
.login-sub { color: #6c7a89; margin-bottom: 1.4rem; }
.login-caixa .form-label { font-weight: 600; font-size: .85rem; color: #34495e; }
.login-caixa .input-group-text { background: #f4f7fa; color: #6c7a89; }
.login-caixa .form-control { padding: .6rem .75rem; }
.login-btn { --bs-btn-bg: #2466a8; --bs-btn-border-color: #2466a8; --bs-btn-hover-bg: #1d5793; --bs-btn-hover-border-color: #1d5793; padding: .65rem; font-weight: 600; }
.login-ajuda { margin-top: 1.1rem; font-size: .8rem; color: #8795a3; }
.login-painel .login-vorqx { margin-top: 2.5rem; color: #8795a3; }
.login-painel .login-vorqx a { color: #8795a3; } .login-painel .login-vorqx a:hover { color: #1362a5; }
@media (max-width: 991.98px) {
    .login-tela { flex-direction: column; }
    .login-vitrine { flex: none; padding: 1.4rem 1.5rem; }
    .login-vitrine-meio, .login-vitrine-pe { display: none; }
}
.login-vorqx-marca { display: inline-flex; align-items: center; gap: .45rem; text-transform: uppercase; letter-spacing: .08em; font-size: .66rem; }
.login-vorqx-marca img { height: 27px; width: auto; }
.login-vorqx a { color: rgba(255,255,255,.72); text-decoration: none; } .login-vorqx a:hover { color: #fff; }

/* ---------------- Tela de login, versão "regula": foto de hospital em azul ao fundo, apresentação do Córtex à esquerda, acesso à direita */
body.sem-menu:has(.lg2-tela) { display: block; background: #0b3a78; overflow-x: hidden; }
.lg2-tela { position: relative; min-height: 100vh; display: grid; grid-template-columns: minmax(0, 57fr) minmax(0, 43fr); isolation: isolate; overflow: hidden;
    font-family: 'Inter Variable', Inter, system-ui, -apple-system, 'Segoe UI', sans-serif; color: #1d2b3e; background: #0b3a78; }
.lg2-tela::before { content: ""; position: absolute; inset: -12px; z-index: -2; pointer-events: none;
    background: url('../img/login-fundo.jpg') center / cover no-repeat; filter: blur(3px) saturate(.85); }
.lg2-tela::after { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
    background: linear-gradient(90deg, rgba(4,40,98,.93) 0%, rgba(6,52,120,.86) 28%, rgba(12,78,158,.62) 52%, rgba(24,104,190,.42) 76%, rgba(34,118,200,.34) 100%),
                linear-gradient(0deg, rgba(4,34,84,.55) 0%, rgba(4,34,84,0) 35%); }
.lg2-ic { width: 1.15em; height: 1.15em; flex: none; }

/* Lado esquerdo: identidade do Córtex */
.lg2-apresentacao { position: relative; display: flex; flex-direction: column;
    padding: clamp(2rem, 5.5vh, 3.6rem) clamp(2rem, 6vw, 7rem) 1.8rem; color: #fff; }
.lg2-marca { display: inline-flex; align-self: flex-start; }
.lg2-logo { height: clamp(80px, 7.6vw, 132px); width: auto; filter: brightness(0) invert(1); }
.lg2-meio { max-width: 34rem; margin-top: clamp(2.5rem, 12vh, 8.5rem); }
.lg2-titulo { font-size: clamp(2.1rem, 3.1vw, 3.3rem); font-weight: 700; line-height: 1.12; letter-spacing: -.02em; color: #fff; margin: 0 0 1.3rem; }
.lg2-titulo span { color: #3fd6c6; }
.lg2-rodape-esq { font-size: .8rem; color: rgba(226,238,252,.8); margin: auto 0 0; padding-top: 1.8rem; }

/* Rede de setores em colmeia entre o texto e o cartão, com o símbolo do Córtex no núcleo (pulsa de leve) */
.lg2-rede { position: absolute; z-index: 0; left: 38.5%; top: 15%; width: 19.5%; height: 58%; pointer-events: none; overflow: visible; }
.lg2-rede-ligacoes { opacity: .7; }
.lg2-rede-setor { opacity: .78; }
.lg2-rede-nucleo { opacity: .95; }
.lg2-rede-linha { fill: none; stroke: rgba(150,222,255,.7); stroke-width: 1.3; }
.lg2-rede-eco { fill: none; stroke: rgba(150,222,255,.22); stroke-width: 1; stroke-dasharray: 2 5; }
.lg2-rede-ponto { fill: #a8ecff; }
.lg2-rede-ponto-luz { fill: #7fe3ff; opacity: .55; }
.lg2-rede-halo { fill: none; stroke: #5cc8ff; stroke-width: 5; opacity: .55; }
.lg2-rede-halo-forte { stroke-width: 8; opacity: .8; }
.lg2-rede-bola { stroke: rgba(170,232,255,.95); stroke-width: 1.6; }
.lg2-rede-centro { stroke: rgba(190,240,255,1); stroke-width: 2; }
.lg2-rede-anel { fill: none; stroke: rgba(255,255,255,.22); stroke-width: 1; }
.lg2-rede-anel-azul { stroke: rgba(26,100,180,.25); }
.lg2-rede-ic { fill: none; stroke: #fff; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.lg2-rede-aura, .lg2-rede-halo-forte, .lg2-rede-simbolo { transform-box: fill-box; transform-origin: center; animation: 3.2s ease-in-out infinite; }
.lg2-rede-aura { animation-name: lg2-pulso-aura; }
.lg2-rede-halo-forte { animation-name: lg2-pulso-halo; }
.lg2-rede-simbolo { animation-name: lg2-pulso-v; }
@keyframes lg2-pulso-aura { 0%, 100% { opacity: .45; transform: scale(.92); } 50% { opacity: 1; transform: scale(1.08); } }
@keyframes lg2-pulso-halo { 0%, 100% { opacity: .45; } 50% { opacity: .95; } }
@keyframes lg2-pulso-v { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }
@media (prefers-reduced-motion: reduce) { .lg2-rede-aura, .lg2-rede-halo-forte, .lg2-rede-simbolo { animation: none; } }

/* Lado direito: cartão de acesso */
.lg2-acesso { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.8rem;
    padding: 2.5rem clamp(1.5rem, 4vw, 6rem) 1.6rem 1rem; }
.lg2-cartao { width: 100%; max-width: 560px; background: #fff; border-radius: 16px; padding: clamp(2rem, 4.5vh, 2.9rem) clamp(1.8rem, 3vw, 3rem) 1.4rem;
    box-shadow: 0 30px 70px -28px rgba(2,22,55,.55); animation: lg2-sobe .45s ease-out both; }
@keyframes lg2-sobe { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .lg2-cartao { animation: none; } }
.lg2-instituicao { text-align: center; margin-bottom: 1.9rem; }
.lg2-instituicao img { max-width: 220px; max-height: 76px; width: auto; height: auto; }
.lg2-bemvindo { font-size: 1.8rem; font-weight: 700; letter-spacing: -.02em; color: #0c2d5e; margin: 0; }
.lg2-sub { font-size: .95rem; color: #3f6590; margin: .35rem 0 1.8rem; }
.lg2-rotulo { display: block; font-size: .86rem; font-weight: 650; color: #0c2d5e; margin: 0 0 .5rem; }
.lg2-campo { position: relative; margin-bottom: 1.35rem; }
.lg2-campo > .lg2-ic { position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); color: #5a7597; pointer-events: none; }
.lg2-campo input { width: 100%; height: 52px; border: 1.5px solid #d3e0ef; border-radius: 10px; background: #f6f9fd; padding: 0 3rem 0 2.9rem;
    font: inherit; font-size: .95rem; color: #1d2b3e; outline: none; transition: border-color .15s, box-shadow .15s, background .15s; }
.lg2-campo input::placeholder { color: #93a6bd; }
.lg2-campo input:focus { border-color: #1a64b4; background: #fff; box-shadow: 0 0 0 4px rgba(26,100,180,.13); }
.lg2-campo:focus-within > .lg2-ic { color: #1a64b4; }
.lg2-olho { position: absolute; right: .6rem; top: 50%; transform: translateY(-50%); border: 0; background: none; color: #1d4f8a; cursor: pointer; padding: .4rem; border-radius: 8px; display: grid; }
.lg2-olho:hover, .lg2-olho.ativo { color: #1a64b4; background: #eaf2fb; }
.lg2-linha { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin: .1rem 0 1.5rem; }
.lg2-lembrar { display: flex; align-items: center; gap: .55rem; font-size: .9rem; color: #0c2d5e; cursor: pointer; }
.lg2-lembrar input { width: 17px; height: 17px; accent-color: #1a64b4; cursor: pointer; }
.lg2-esqueci { font-size: .88rem; color: #1a64b4; text-decoration: none; font-weight: 500; }
.lg2-esqueci:hover { text-decoration: underline; }
.lg2-entrar { width: 100%; height: 54px; border: 0; border-radius: 10px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: .6rem;
    background: linear-gradient(90deg, #1b56b0 0%, #1a7fb0 50%, #22a078 100%); color: #fff; font: inherit; font-size: 1.05rem; font-weight: 600;
    box-shadow: 0 12px 24px -14px rgba(20,90,170,.8); transition: filter .15s, transform .15s; }
.lg2-entrar:hover { filter: brightness(1.07); }
.lg2-entrar:active { transform: translateY(1px); }
.lg2-entrar .lg2-ic { transition: transform .15s; }
.lg2-entrar:hover .lg2-ic { transform: translateX(3px); }
.lg2-alerta { font-size: .86rem; line-height: 1.45; border-radius: 10px; padding: .75rem .95rem; margin-bottom: 1.1rem; border: 1px solid #f3cfcf; background: #fdf1f1; color: #9b2c2c; }

/* Rodapé fora do cartão: autoria, versão e suporte */
.lg2-autoria { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .5rem 1rem; font-size: .78rem; color: rgba(236,244,255,.88); }
.lg2-autoria-marca { display: inline-flex; align-items: center; gap: .5rem; }
.lg2-autoria-marca img { height: 24px; width: auto; filter: brightness(0) invert(1); }
.lg2-versao { font-size: .74rem; color: rgba(236,244,255,.7); }
.lg2-suporte { display: inline-flex; align-items: center; gap: .45rem; color: #fff; font-weight: 500; text-decoration: none; white-space: nowrap;
    padding-left: 1rem; border-left: 1px solid rgba(255,255,255,.3); }
.lg2-suporte .lg2-ic { color: #8fe3f0; }
.lg2-suporte:hover { color: #8fe3f0; }

/* Aviso "Esqueceu sua senha?" */
.lg2-diag { max-width: 420px; width: calc(100% - 2rem); border: 0; border-radius: 20px; padding: 1.7rem 1.7rem 1.4rem;
    box-shadow: 0 30px 60px -20px rgba(13,35,64,.35); font-family: 'Inter Variable', Inter, system-ui, sans-serif; color: #1d2b3e; }
.lg2-diag::backdrop { background: rgba(5,28,58,.55); backdrop-filter: blur(2px); }
.lg2-diag h2 { font-size: 1.15rem; font-weight: 700; color: #0c2d5e; margin: 0 0 .7rem; }
.lg2-diag p { font-size: .9rem; line-height: 1.55; color: #50627a; margin: 0 0 .9rem; }
.lg2-diag .lg2-entrar { height: 44px; font-size: .92rem; }

@media (max-width: 1200px) { .lg2-rede { display: none; } .lg2-tela { grid-template-columns: minmax(0, 52fr) minmax(0, 48fr); } .lg2-acesso { padding-left: 1.5rem; } }
@media (max-width: 900px) {
    .lg2-tela { grid-template-columns: 1fr; }
    .lg2-tela::after { background: linear-gradient(180deg, rgba(4,40,98,.93) 0%, rgba(8,62,135,.78) 100%); }
    .lg2-apresentacao { padding: 1.4rem 1.25rem .25rem; gap: .8rem; }
    .lg2-logo { height: 52px; }
    .lg2-meio { margin-top: .6rem; }
    /* no celular o cartão de acesso sobe: só a frase curta */
    .lg2-rodape-esq { display: none; }
    .lg2-titulo { font-size: 1.3rem; margin-bottom: 0; }
    .lg2-titulo br { display: none; }
    .lg2-acesso { padding: 1rem 1rem 2rem; }
}
/* Aviso de sessão expirando (inatividade): cronômetro em anel que esvazia, pergunta e botões */
.sessao-aviso-dialogo { max-width: 380px; }
.sessao-aviso { border: 0; border-radius: 1rem; box-shadow: 0 20px 50px rgba(8,40,90,.28); }
.sessao-aviso .modal-body { padding: 1.9rem 1.6rem 1.5rem; }
.sessao-aviso-tit { font-size: 1.15rem; font-weight: 700; color: #0b3d7a; margin: 0 0 .35rem; }
.sessao-aviso-txt { font-size: .85rem; color: #5b6b80; margin: 0 0 1.2rem; }
.sessao-relogio { position: relative; width: 132px; height: 132px; margin: 0 auto 1.1rem; }
.sessao-relogio svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.sessao-relogio circle { fill: none; stroke-width: 8; }
.sessao-relogio-fundo { stroke: #e6edf6; }
.sessao-relogio-anel { stroke: #1f6fd1; stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: 0; transition: stroke-dashoffset 1s linear, stroke .3s; }
.sessao-relogio span { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 1.9rem; font-weight: 700; color: #0b3d7a; font-variant-numeric: tabular-nums; }
.sessao-urgente .sessao-relogio-anel { stroke: #d9480f; }
.sessao-urgente .sessao-relogio span { color: #d9480f; }
.sessao-aviso-perg { font-weight: 600; color: #1d2b3a; margin: 0 0 1rem; }
.sessao-aviso-botoes { display: grid; grid-template-columns: 1fr 1.6fr; gap: .6rem; }
@media (prefers-reduced-motion: reduce) { .sessao-relogio-anel { transition: none; } }
@media (max-width: 480px) { .lg2-cartao { padding: 1.8rem 1.3rem 1.3rem; } .lg2-suporte { padding-left: 0; border-left: 0; } }

/* Símbolo do Córtex no topo */
.topbar-cortex { height: 38px; width: auto; }
.topbar-cortex-claro, .com-menu .topbar-cortex-escuro { display: none; }
.com-menu .topbar-cortex-claro { display: inline; }
@media (max-width: 575.98px) { .topbar-cortex { height: 32px; } }

/* Visual sóbrio dos módulos (parâmetro ui_estilo_modulos = sobrio): ícone monocromático, cartões neutros */
.mod-icone-sobrio { flex-shrink: 0; width: 44px; height: 44px; border-radius: .55rem; background: #eef2f6; color: #35506b;
    display: inline-flex; align-items: center; justify-content: center; font-size: 1.3rem; transition: background .15s, color .15s; }
.mod-icone-sobrio.pequeno { width: 34px; height: 34px; font-size: 1.05rem; background: rgba(255,255,255,.12); color: #fff; }
.ui-sobrio .modulo-card::after { display: none; }
.ui-sobrio .modulo-card:hover, .ui-sobrio .modulo-card:focus-within { transform: none; border-color: #9fb3c8; box-shadow: 0 4px 12px rgba(16,24,40,.06); }
.ui-sobrio .modulo-card:hover .mod-icone-sobrio { background: #1f3a5f; color: #fff; }
.ui-sobrio .modulo-ind { background: #1f3a5f; }
.ui-sobrio .modulo-funcao { color: #35506b; background: #eef2f6; }
.ui-sobrio .modulo-funcao:hover { background: #1f3a5f; color: #fff; }
.ui-sobrio .modulo-fav:hover { border-color: #9fb3c8; }
.ui-sobrio .modulo-fav .mod-icone-sobrio.pequeno { width: 26px; height: 26px; font-size: .85rem; background: #eef2f6; color: #35506b; }

/* Menu lateral: seções recolhíveis (a seção da tela atual abre sozinha) */
.sidebar .nav-grupo-titulo { display: flex; align-items: center; gap: .4rem; width: 100%; background: none; border: 0; text-align: left; cursor: pointer; }
.sidebar .nav-grupo-titulo:hover { color: #fff; }
.sidebar .nav-grupo-titulo .bi-chevron-down { margin-left: auto; font-size: .7rem; transition: transform .15s; }
.sidebar .nav-grupo.aberto .nav-grupo-titulo .bi-chevron-down { transform: rotate(180deg); }
.sidebar .nav-grupo-qtd { font-size: .62rem; background: rgba(255,255,255,.1); border-radius: 1rem; padding: 0 .4rem; letter-spacing: 0; }
.sidebar .nav-grupo.aberto .nav-grupo-qtd { display: none; }
.sidebar .nav-grupo .nav-sub { display: none; }
.sidebar .nav-grupo.aberto .nav-sub { display: flex; }
.sidebar .nav-grupo-titulo:focus-visible { outline: 2px solid #8ec5ff; outline-offset: -2px; }

/* Dicas dos campos (substituem o placeholder): ícone ⓘ com a explicação ao passar o mouse */
.dica-ic { color: #6c7a86; cursor: help; font-size: .85em; font-weight: normal; }
.dica-ic:hover, .dica-ic:focus { color: var(--bs-primary); outline: none; }
.dica-wrap { display: flex; align-items: center; gap: .35rem; min-width: 0; }
.dica-wrap > .form-control, .dica-wrap > .form-select, .dica-wrap > input, .dica-wrap > textarea { flex: 1 1 auto; min-width: 0; }
.dica-wrap.dica-topo { align-items: flex-start; }
.dica-wrap.dica-topo > .dica-ic { padding-top: .45rem; }
.input-group-text.dica-ig { background: transparent; padding-left: .45rem; padding-right: .45rem; }


/* ---------------- Documentos impressos · padrão Córtex (o mesmo do laudo laboratorial) */
@page { size: A4 portrait; margin: 12mm 14mm; @bottom-right { content: "Página " counter(page) " de " counter(pages); font: 7pt Arial, sans-serif; color: #5f6b78; } }
.doc-body .folha { font-family: "Inter Variable", "Segoe UI", Arial, sans-serif; color: #1d2530; font-size: 10pt; line-height: 1.4; }
.doc-cab { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; padding-bottom: 8px; margin-bottom: 10px; border-bottom: 2.5px solid var(--inst-cor, #1f3a55); }
.doc-cab-logo { height: 54px; max-width: 170px; }
.doc-cab-nome { font-weight: 800; font-size: 1.15rem; }
.doc-cab-dados { text-align: left; font-size: 8pt; line-height: 1.4; color: #5f6b78; }
.doc-cab-razao { color: #1d2530; font-size: 9.5pt; font-weight: 700; letter-spacing: .02em; margin: 0; }
.doc-cab > .text-end, .doc-cab-dir { font-size: 7.8pt; line-height: 1.4; color: #5f6b78; border-left: 1px solid #d5dbe1; padding-left: 12px; }
.doc-cab > .text-end b, .doc-cab-dir b { color: #1d2530; }
.doc-rodape { border-top: 1px solid #d5dbe1; font-size: 7.2pt; color: #5f6b78; }
.doc-body .folha h2 { font-size: 11pt; font-weight: 800; letter-spacing: .14em; color: #1d2530; margin: .1rem 0 .7rem; }
.doc-body .folha .bloco { border: 1px solid #d5dbe1; border-radius: 6px; overflow: hidden; margin-bottom: .55rem; background: #fff; }
.doc-body .folha .bloco-titulo { background: #f3f5f7; color: var(--inst-cor, #1f3a55); border-bottom: 1px solid #d5dbe1; font-size: 7.4pt; font-weight: 700;
    letter-spacing: .1em; padding: .25rem .6rem; }
.doc-body .folha .campo { border-color: #d5dbe1; padding: .2rem .6rem; min-width: 0; overflow-wrap: anywhere; font-size: 9pt; }
.doc-body .folha .campo small { font-size: 6.6pt; letter-spacing: .08em; color: #5f6b78; line-height: 1.35; }
.doc-body .folha .bloco-paciente { background: #f3f5f7; }
.doc-body .folha .bloco-paciente .campo-nome { font-size: 10.5pt; font-weight: 700; }
.doc-body .folha table.table { font-size: 8.8pt; }
.doc-body .folha table.table thead th { background: transparent; color: #5f6b78; font-size: 6.8pt; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
    border-bottom: 1px solid #d5dbe1; }
.doc-body .folha table.table td { border-bottom: 1px dotted #e1e6ea; }
.doc-body .folha > .assinaturas div { border-top-color: #1d2530; font-size: 8.5pt; }
.doc-body .folha .folha-fim > p { color: #5f6b78; }
@media print {
    .doc-body .folha { font-size: 9.5pt; }
    .doc-body .folha .campo { min-height: 0; padding: .12rem .55rem; font-size: 8.8pt; }
    .doc-body .folha { min-height: calc(297mm - 24mm - 9mm); }
    .doc-body .folha .bloco-paciente { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* Versão do sistema no rodapé */
.rodape-versao { margin-left: .4rem; padding: 0 .4rem; border-radius: .6rem; background: rgba(0,0,0,.06); font-size: .72rem; color: #5b6b78; white-space: nowrap; }


/* ---------------- Escalas: grade mensal (planilha de plantões) */
.esc-chip { display: inline-flex; align-items: center; gap: .25rem; border: 1px solid #dee2e6; border-left: 4px solid var(--cor); border-radius: 4px; padding: 0 .4rem; background: #fff; font-size: .78rem; }
.esc-grade-wrap { overflow: auto; max-height: calc(100vh - 260px); }
.esc-grade { border-collapse: separate; border-spacing: 0; font-size: .78rem; min-width: 100%; }
.esc-grade th, .esc-grade td { border-right: 1px solid #e3e8ec; border-bottom: 1px solid #e3e8ec; padding: 0; text-align: center; background: #fff; }
.esc-grade thead th { position: sticky; top: 0; z-index: 2; background: #f3f6f9; font-weight: 600; padding: .2rem 0; min-width: 2.35rem; line-height: 1.1; }
.esc-grade thead th small { display: block; font-weight: 400; color: #6c7a86; font-size: .68rem; }
.esc-grade thead th.esc-fds { background: #e9eef3; }
.esc-grade thead th.esc-feriado { background: #ffe8cc; color: #a0522d; }
.esc-grade thead th.esc-hoje { box-shadow: inset 0 -3px 0 #0d6efd; }
.esc-grade .esc-nome { position: sticky; left: 0; z-index: 1; text-align: left; padding: .2rem .5rem; min-width: 200px; max-width: 220px; background: #fff; font-weight: 500; line-height: 1.15; }
.esc-grade thead .esc-nome { z-index: 3; background: #f3f6f9; }
.esc-grade .esc-tot { padding: .2rem .45rem; white-space: nowrap; font-weight: 600; background: #f8fafc; min-width: 3.4rem; }
.esc-grade td { position: relative; }
.esc-cel { width: 2.35rem; height: 1.9rem; border: 0; text-align: center; font-weight: 700; font-size: .76rem; text-transform: uppercase; background: transparent; padding: 0; }
.esc-cel:focus { outline: 2px solid #0d6efd; outline-offset: -2px; position: relative; z-index: 1; }
.esc-grade td.esc-afast { background: repeating-linear-gradient(135deg, #fff, #fff 4px, #f1f3f5 4px, #f1f3f5 8px); }
.esc-af-sigla { position: absolute; inset: 0; display: grid; place-items: center; font-size: .62rem; color: #868e96; font-weight: 700; pointer-events: none; }
.esc-grade td.esc-erro { box-shadow: inset 0 0 0 2px #e03131; }
.esc-grade td.esc-aviso { box-shadow: inset 0 0 0 2px #f59f00; }
.esc-marca { position: absolute; top: 1px; right: 1px; width: 0; height: 0; border-left: 6px solid transparent; border-top: 6px solid #212529; pointer-events: none; }
.esc-grade tfoot td { font-weight: 600; padding: .15rem 0; background: #f8fafc; }
.esc-grade tfoot td small { font-weight: 400; color: #6c7a86; }
.esc-grade tfoot td.esc-falta { background: #ffe3e3; color: #c92a2a; }
.esc-grade tfoot .esc-nome { background: #f8fafc; }

/* ---------------- Escalas: escala da equipe por turno (Data | Diurno | Noturno) */
.esc-turnos { font-size: .88rem; }
.esc-turnos thead th { position: sticky; top: 0; z-index: 2; background: #f3f0ff; font-weight: 600; white-space: nowrap; }
.esc-turnos td { vertical-align: top; background: #fff; }
.esc-turnos .esc-t-data { width: 9.5rem; white-space: nowrap; }
.esc-turnos tr.esc-t-fds td { background: #f7f5ff; }
.esc-turnos tr.esc-t-hoje td { background: #f1ecff; }
.esc-turnos tr.esc-t-hoje td.esc-t-data { box-shadow: inset 4px 0 0 #7048e8; }
.esc-t-dsem { display: block; color: #6c7a86; font-size: .78rem; }
.esc-t-badge-hoje { background: #7048e8; color: #fff; font-size: .66rem; }
.esc-t-selo { background: #e6fcf5; color: #087f5b; border: 1px solid #96f2d7; font-weight: 600; font-size: .68rem; }
.esc-t-feriado { display: block; color: #c2410c; font-size: .72rem; }
.esc-t-bloco { display: flex; flex-wrap: wrap; align-items: center; gap: .15rem .4rem; padding: .1rem 0; }
.esc-t-bloco + .esc-t-bloco { border-top: 1px dotted #dee2e6; }
.esc-t-hora { border: 1px solid #e3e8ec; border-left: 3px solid var(--cor); border-radius: 999px; padding: 0 .45rem; font-size: .7rem; color: #495057; background: #fff; white-space: nowrap; }
.esc-t-nome { font-weight: 600; }
.esc-t-func { display: inline-block; font-size: .72rem; color: #495057; background: #eef1f4; border-radius: 4px; padding: 0 .35rem; margin-right: .2rem; white-space: nowrap; }
.esc-t-jornada { color: #e8590c; cursor: help; }
.esc-t-rot { font-size: .64rem; font-weight: 700; }
.esc-t-rot-troca { background: #fd7e14; color: #fff; }
.esc-t-rot-alterado { background: #fab005; color: #3b2f00; }
.esc-t-rot-extra { background: #e7f5ff; color: #1864ab; border: 1px solid #a5d8ff; }
.esc-t-subst { flex-basis: 100%; color: #868e96; font-size: .74rem; text-decoration: line-through; }
.esc-t-descoberto { color: #c92a2a; font-weight: 600; }
.esc-eu { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 30' preserveAspectRatio='none'%3E%3Cpath d='M4 8C22 3 58 6 97 4c2 6 1 12 0 18-26 5-62 4-94 2C1 18 2 13 4 8z' fill='%23ffc21a' fill-opacity='.45' stroke='%23ffd84d' stroke-opacity='.4'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-size: 110% 104%; background-position: center 60%; padding: .04em .42em .12em; border-radius: 2px; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.esc-t-aviso { margin: .3rem 0 .2rem; padding-bottom: .2rem; border-bottom: 1px solid #7048e8; font-size: 6.8pt; }
.esc-turnos .esc-t-acao { width: 3rem; text-align: center; }
.esc-t-editar-txt { display: none; }
.esc-turnos tr.esc-t-pendente td { background: #fff4e6 !important; }
.esc-t-pend { background: #fd7e14; color: #fff; font-size: .64rem; }
.esc-t-barra { position: fixed; left: 50%; bottom: 1rem; transform: translateX(-50%); z-index: 1040; display: flex; flex-wrap: wrap; align-items: center; gap: .6rem;
    max-width: calc(100vw - 2rem); padding: .55rem .9rem; border-radius: .7rem; background: #c2410c; color: #fff; box-shadow: 0 6px 20px rgba(0, 0, 0, .25); }
.esc-t-barra[hidden] { display: none; }
.esc-t-acoes { display: flex; gap: .25rem; justify-content: center; }
.esc-t-tag { font-size: .64rem; font-weight: 600; white-space: normal; text-align: left; }
.esc-t-tag-aguarda { background: #ffe3e3; color: #c92a2a; border: 1px solid #ffc9c9; }
.esc-t-tag-pend { background: #fff4e6; color: #d9480f; border: 1px solid #ffd8a8; }
.esc-t-tag-convite { background: #e7f5ff; color: #1864ab; border: 1px solid #a5d8ff; text-decoration: none; }
@media screen and (max-width: 767.98px) {
    .esc-turnos thead { display: none; }
    .esc-turnos, .esc-turnos tbody, .esc-turnos tr, .esc-turnos td { display: block; width: 100%; }
    .esc-turnos tr { border: 1px solid #e5dbff; border-radius: .9rem; margin: 0 0 .8rem; overflow: hidden; background: #fff; box-shadow: 0 2px 8px rgba(80, 60, 160, .08); }
    .esc-turnos td { border: 0; border-top: 1px dashed #e3e8ec; padding: .55rem .8rem; }
    .esc-turnos td.esc-t-data { width: auto; border-top: 0; background: linear-gradient(90deg, #f3f0ff, #fff) !important; display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; font-size: 1.05rem; }
    .esc-turnos td.esc-t-data .esc-t-dsem, .esc-turnos td.esc-t-data .esc-t-feriado { display: inline; }
    .esc-turnos td[data-label]::before { content: attr(data-label); display: block; font-size: .7rem; font-weight: 600; color: #6c7a86; text-transform: uppercase; margin-bottom: .15rem; }
    .esc-turnos tr.esc-t-hoje { border: 2px solid #7048e8; box-shadow: 0 4px 14px rgba(112, 72, 232, .25); }
    .esc-turnos tr.esc-t-hoje td.esc-t-data { box-shadow: none; }
    .esc-turnos td.esc-t-acao { width: auto; padding: .5rem .8rem; }
    .esc-t-editar { width: 100%; }
    .esc-t-acoes > .btn { flex: 1; }
    .esc-t-editar-txt { display: inline; }
    .card:has(> .esc-turnos) { background: transparent; border: 0; }
}
@media print {
    @page { size: A4 portrait; margin: 8mm; }
    .esc-turnos { font-size: 8.4pt; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .esc-turnos thead th { position: static; background: #e5dbff !important; border: 1px solid #555; }
    .esc-turnos td { border: 1px solid #bbb; padding: .08rem .3rem; }
    .esc-turnos tr { page-break-inside: avoid; }
    .esc-turnos tr:nth-child(even) td { background: #faf8ff !important; }
    .esc-turnos tr.esc-t-hoje td { background: inherit; box-shadow: none !important; }
    body:has(.esc-t-impressao) .page-header { display: none !important; }
    .esc-t-badge-hoje, .esc-t-hora-inteiro { display: none !important; }
    .esc-t-hora { border: 0; padding: 0; font-size: 7pt; }
    .esc-eu { background: none !important; padding: 0 !important; }
    .esc-t-dsem { display: inline; margin-left: .2rem; }
    .esc-t-bloco { padding: 0; }
}
/* Escalas — sino de trocas no topo do módulo e faixa na tela de módulos (sinalização no lugar do e-mail) */
.esc-sinal-botao { position: relative; }
.esc-sinal-botao.tem .bi { color: #ffd43b; }
.esc-sinal-n { position: absolute; top: -.45rem; right: -.5rem; font-size: .62rem !important; }
.esc-sinal-botao.novo { animation: esc-sinal-pulsa 1s ease-in-out 3; }
@keyframes esc-sinal-pulsa { 50% { box-shadow: 0 0 0 .35rem rgba(255, 212, 59, .45); } }
.esc-sinal-painel { width: min(370px, calc(100vw - 2.5rem)); max-height: 72vh; overflow-y: auto; font-size: .875rem; }
.com-menu .topbar .esc-sinal-painel { background: #fff; }
.com-menu .topbar .esc-sinal-painel .text-muted { color: #6c757d !important; } /* a barra escura clareia o text-muted; no painel volta ao normal */
.esc-sinal-sec + .esc-sinal-sec { border-top: 1px solid var(--bs-border-color); }
.esc-sinal-tit { padding: .5rem .75rem .2rem; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: #7048e8; }
.esc-sinal-item { padding: .4rem .75rem; }
.esc-sinal-item + .esc-sinal-item { border-top: 1px dashed var(--bs-border-color); }
.esc-sinal-mais { display: block; padding: .2rem .75rem .5rem; font-size: .8rem; }
.esc-sinal-vazio { padding: 1rem .75rem; text-align: center; color: var(--bs-secondary-color); }
.esc-sinal-rodape { display: block; padding: .5rem .75rem; border-top: 1px solid var(--bs-border-color); text-align: center; font-size: .8rem; background: var(--bs-tertiary-bg); }
.esc-faixa-aviso { margin-top: .35rem; padding-top: .35rem; border-top: 1px dashed rgba(0, 0, 0, .12); }
.esc-faixa > .esc-faixa-aviso:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
@media print { .esc-sinal, .esc-faixa { display: none !important; } }
/* Escalas — Meus plantões (extrato do mês), comentários de plantão, controle de plantões e histórico */
.mp-card { border-radius: 1rem; }
.mp-quem { color: #6c757d; font-size: .9rem; }
.mp-total { font-size: 1.1rem; color: #495057; margin: .1rem 0 .5rem; }
.mp-num { font-size: 2.4rem; font-weight: 700; color: #5f3dc4; line-height: 1; letter-spacing: -.02em; }
.mp-conf { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .9rem; }
.mp-selo { font-size: .78rem; padding: .2rem .6rem; border-radius: 999px; background: #f3f0ff; border: 1px solid #e5dbff; color: #495057; }
.mp-selo b { color: #1d2a36; }
.mp-selo-neutro { background: #f8f9fa; border-color: #e9ecef; }
.mp-escala { display: flex; justify-content: space-between; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: #7048e8; margin: .6rem 0 .3rem; }
.mp-lista { list-style: none; padding: 0; margin: 0; display: grid; gap: .35rem; }
.mp-item { display: grid; grid-template-columns: 1.4rem 3.2rem 1fr auto; align-items: center; gap: .5rem; padding: .5rem .7rem; border: 1px solid #ece8f7; border-radius: .6rem; background: #fff; }
.mp-item-neutro { opacity: .7; }
.mp-tipo-ic { color: #7048e8; display: flex; }
.mp-ic { display: block; }
.mp-data { font-weight: 700; font-variant-numeric: tabular-nums; }
.mp-dia { color: #495057; font-size: .9rem; }
.mp-tipo { text-align: right; font-weight: 600; font-size: .9rem; }
.mp-tipo small { display: block; font-weight: 400; color: #6c757d; font-size: .72rem; }
.mp-rodape { margin-top: .8rem; padding-top: .6rem; border-top: 1px dashed #dee2e6; font-size: .82rem; color: #495057; display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
@media (max-width: 380px) { .mp-item { grid-template-columns: 1.2rem 2.8rem 1fr; } .mp-tipo { grid-column: 2 / -1; text-align: left; } }
.esc-turnos td { position: relative; }
.esc-t-coment { position: absolute; top: .2rem; right: .25rem; border: 0; background: none; padding: 0 .15rem; line-height: 1; color: #adb5bd; font-size: .85rem; opacity: 0; }
.esc-turnos td:hover .esc-t-coment, .esc-t-coment:focus-visible, .esc-t-coment.tem { opacity: 1; }
.esc-t-coment.tem, .esc-t-coment-leg { color: #f08c00; }
@media (hover: none) { .esc-t-coment { opacity: 1; } }
.esc-coment-texto { white-space: pre-wrap; }
.esc-historico-val { white-space: pre-line; max-width: 22rem; word-break: break-word; }
.ctl-assinatura { margin-top: 2.5rem; text-align: center; }
.ctl-linha-ass { width: 18rem; margin: 0 auto .3rem; border-top: 1px solid #333; }
@media print {
    .esc-t-coment { display: none !important; }
    body:has(.ctl-doc) .page-header, body:has(.ctl-doc) .rel-cab { display: none !important; }
    .ctl-doc .card { border: 0; box-shadow: none; }
    .ctl-prof { page-break-inside: avoid; }
}
/* Escalas — Plantão agora por setor (centenas de profissionais: busca, categorias, grupos recolhidos e lista) */
.pa-coord { display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; padding: .45rem .75rem; background: #fff; border: 1px solid var(--bs-border-color); border-radius: .5rem; }
.pa-barra { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-bottom: .6rem; }
.pa-busca { position: relative; flex: 1 1 280px; }
.pa-busca > .bi { position: absolute; left: .7rem; top: 50%; transform: translateY(-50%); color: #6c757d; z-index: 2; }
.pa-busca .form-control { padding-left: 2.1rem; }
.pa-cats { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: .8rem; }
.pa-cat { border: 1px solid var(--bs-border-color); background: #fff; border-radius: 999px; padding: .15rem .7rem; font-size: .82rem; color: #495057; }
.pa-cat span { color: #6c757d; margin-left: .15rem; }
.pa-cat.active { background: #7048e8; border-color: #7048e8; color: #fff; }
.pa-cat.active span { color: #e5dbff; }
.pa-grade { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: .75rem; align-items: start; }
.pa-setor { background: #fff; border: 1px solid var(--bs-border-color); border-radius: .6rem; padding: .55rem .8rem .4rem; }
.pa-setor.pa-meu { border-color: #b197fc; }
.pa-cab { display: flex; flex-wrap: wrap; align-items: baseline; gap: .4rem; margin-bottom: .25rem; }
.pa-n { font-size: .8rem; color: #6c757d; }
.pa-troca { margin-left: auto; font-size: .75rem; color: #6c757d; }
.pa-linha { display: grid; grid-template-columns: 7.2rem minmax(0, 1fr); gap: .5rem; padding: .3rem 0; border-top: 1px solid #f1f3f5; font-size: .86rem; }
.pa-rot { color: #6c757d; font-size: .8rem; padding-top: .1rem; }
.pa-cont { display: inline-block; min-width: 1.3rem; text-align: center; background: #f1f3f5; border-radius: 999px; font-size: .72rem; color: #495057; }
.pa-nomes { display: flex; flex-wrap: wrap; gap: .1rem .9rem; }
.pa-p { white-space: nowrap; }
.pa-p b { font-weight: 600; }
.pa-meta { font-size: .74rem; color: #6c757d; }
.pa-meta .esc-chip { font-size: .68rem; padding: 0 .3rem; }
.pa-tel { font-size: .8rem; margin-left: .1rem; text-decoration: none; }
.pa-extra, .pa-fora { display: none; }
.pa-aberta .pa-extra:not(.pa-fora) { display: inline; }
.pa-aberta .pa-mais { display: none; }
.pa-mais { border: 0; background: none; padding: 0; font-size: .78rem; color: #5f3dc4; }
.pa-rodape { border-top: 1px solid #f1f3f5; padding-top: .3rem; margin-top: .1rem; }
.pa-tabela th[data-ord] { cursor: pointer; white-space: nowrap; }
.pa-tabela th[data-dir="asc"]::after { content: " ▲"; font-size: .65rem; }
.pa-tabela th[data-dir="desc"]::after { content: " ▼"; font-size: .65rem; }
.pa-afast summary { cursor: pointer; }
@media (max-width: 575.98px) { .pa-grade { grid-template-columns: minmax(0, 1fr); } .pa-linha { grid-template-columns: 5.6rem minmax(0, 1fr); } .pa-p { white-space: normal; } }
@media print { .pa-extra:not(.pa-fora) { display: inline !important; } .pa-mais, .pa-tel { display: none !important; } .pa-setor { break-inside: avoid; } }
/* Escalas — Escala da equipe: navegação por área (equipe) → categoria → setor */
.ev-topo { display: flex; gap: .5rem; margin-bottom: .6rem; }
.ev-minhas { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin-bottom: .8rem; }
.ev-rot { font-size: .8rem; color: #6c757d; margin-right: .2rem; }
.ev-migalha { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; font-size: .85rem; margin-bottom: .6rem; color: #6c757d; }
.ev-migalha .bi { font-size: .7rem; }
.ev-migalha span { color: #212529; font-weight: 600; }
.ev-grade { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: .6rem; margin-bottom: .8rem; }
.ev-area, .ev-escala { display: flex; flex-direction: column; gap: .15rem; background: #fff; border: 1px solid var(--bs-border-color); border-radius: .6rem; padding: .65rem .85rem; text-decoration: none; color: inherit; }
.ev-area { border-left: 4px solid var(--cor, #adb5bd); padding: .85rem 1rem; }
.ev-area:hover, .ev-escala:hover { border-color: #7048e8; color: inherit; }
.ev-area .ev-nome { font-size: 1.05rem; font-weight: 600; }
.ev-escala .ev-nome { font-weight: 600; }
.ev-info { font-size: .8rem; color: #6c757d; }
.ev-escala[hidden] { display: none; }
.com-menu h3.ev-setor { font-size: .85rem; font-weight: 600; color: #495057; margin: .6rem 0 .4rem; }
.ev-setor span { font-weight: 400; color: #6c757d; }

/* ---------------- Menu do módulo no topo (opção do usuário: Menu no topo / Menu na lateral) */
.menubar { position: sticky; top: var(--topbar-h); z-index: 1019; background: #fff; border-bottom: 1px solid var(--linha);
    box-shadow: 0 1px 3px rgba(20, 40, 64, .08); padding: 0 .5rem; }
.menubar-lista { display: flex; flex-wrap: wrap; align-items: stretch; gap: .1rem; list-style: none; margin: 0; padding: 0; }
.menubar-modulo { display: flex; align-items: center; gap: .45rem; padding: .25rem .7rem .25rem .2rem; margin-right: .3rem;
    border-right: 1px solid var(--linha); font-weight: 700; color: var(--titulo); white-space: nowrap; }
.menubar-modulo .mod-ilustra-sm { width: 26px; height: 26px; background: #eef3f8; }
.menubar-modulo .mod-icone-sobrio.pequeno { width: 1.6rem; height: 1.6rem; }
.menubar-link { display: flex; align-items: center; gap: .3rem; height: 100%; padding: .45rem .55rem; border: 0; background: none;
    color: #2b4560; font-size: .92rem; text-decoration: none; white-space: nowrap; border-bottom: 3px solid transparent; }
.menubar-link:hover, .menubar-link.show { color: #12304d; background: #eef3f8; }
.menubar-link.active { color: #12304d; font-weight: 600; border-bottom-color: var(--mod-cor, var(--sb-active)); }
.menubar-link i { color: #5a7590; }
.menubar .dropdown-menu { font-size: .92rem; max-height: 70vh; overflow-y: auto; }
.menubar .dropdown-item.active, .menubar .dropdown-item:active { background: var(--sb-active); }
@media (max-width: 1499.98px) { .menubar-modulo > span:last-child { display: none; } }
@media (max-width: 991.98px) {
    .menubar { position: static; }
    .menubar-link { padding: .4rem .5rem; font-size: .88rem; }
}
.menubar .mod-icone-sobrio { color: var(--mod-cor, var(--sb-active)); background: #eef3f8; border: 1px solid var(--linha); }
/* Item do menu com subitens (ex.: Central de relatórios -> grupos): abre ao lado */
.menubar .dropdown-menu.tem-sub { overflow: visible; max-height: none; }
.menubar-sub { position: relative; }
.menubar-sub > .dropdown-item { display: flex; align-items: center; }
.menubar-sub > .dropdown-menu { top: -.5rem; left: 100%; margin-left: .1rem; }
.menubar-sub:hover > .dropdown-menu, .menubar-sub:focus-within > .dropdown-menu { display: block; }
@media (max-width: 991.98px) { .menubar-sub > .dropdown-menu { position: static; box-shadow: none; border: 0; padding-left: 1rem; } }
.sidebar .nav-link.nav-subitem { padding-left: 2.1rem; font-size: .88rem; }
/* PEP: seção de formulário clínico configurável no documento registrado */
.doc-secao { font-weight: 700; color: var(--titulo, #1f3a55); border-bottom: 1px solid #d4dce4; margin: .5rem 0 .25rem; font-size: .9rem; }

/* Relatórios contábeis (balancete, razão, diário, demonstrações) — tela e impressão */
.ctb-rel { font-size: .82rem; width: 100%; border-collapse: collapse; }
.ctb-rel th, .ctb-rel td { padding: .18rem .45rem; border-bottom: 1px solid #e3e7ec; }
.ctb-rel thead th { border-bottom: 1px solid #333; white-space: nowrap; }
.ctb-rel td.n, .ctb-rel th.text-end { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; min-width: 6.5rem; }
.ctb-rel tr.dest td { font-weight: 700; border-top: 1px solid #333; }
.ctb-dmpl thead th, .ctb-dmpl thead th.text-end { white-space: normal; vertical-align: bottom; } .ctb-dmpl td:first-child { min-width: 14rem; }

/* Editor da prescrição: painel lateral "Incluir item" */
.presc-oc { --bs-offcanvas-width: min(600px, 100vw); }
.presc-oc .offcanvas-body { overflow-y: auto; flex: 1 1 auto; }

/* Aba Prescrição do PEP: cada prescrição bem separada (faixa e cabeçalho pela situação) e itens em linhas alternadas */
.presc-card { border-left: 5px solid var(--bs-secondary-border-subtle); box-shadow: 0 1px 3px rgba(0, 0, 0, .08); }
.presc-card > .card-header { border-bottom: 1px solid var(--bs-border-color); }
.presc-card.presc-vigente { border-color: var(--bs-success-border-subtle); border-left-color: var(--bs-success); }
.presc-card.presc-vigente > .card-header { background: var(--bs-success-bg-subtle); }
.presc-card.presc-rascunho { border-left-color: var(--bs-warning); }
.presc-card.presc-rascunho > .card-header { background: var(--bs-warning-bg-subtle); }
.presc-card.presc-encerrada > .card-header { background: var(--bs-secondary-bg); }
.presc-card.presc-encerrada .presc-itens { opacity: .8; }
.presc-itens > tbody > tr > td { border-bottom: 1px solid var(--bs-border-color-translucent); padding-top: .45rem; padding-bottom: .45rem; }
.presc-itens > tbody > tr:nth-of-type(even) > td { background-color: rgba(var(--bs-emphasis-color-rgb), .045); }
.presc-itens > tbody > tr:hover > td { background-color: rgba(var(--bs-emphasis-color-rgb), .085); }

/* Endoscopia: fotos do laudo estruturado (imagem/laudo) */
.endo-fotos { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 6px; }
.endo-foto { position: relative; aspect-ratio: 4 / 3; border-radius: 6px; overflow: hidden; background: #000; display: block; margin: 0; }
.endo-foto img { width: 100%; height: 100%; object-fit: cover; }
.endo-foto .n { position: absolute; top: 3px; left: 3px; background: rgba(0,0,0,.6); color: #fff; font-size: .7rem; border-radius: 4px; padding: 0 4px; }
.endo-foto .st { position: absolute; top: 3px; right: 3px; background: rgba(0,0,0,.6); border: 0; color: #fff; border-radius: 4px; padding: 0 4px; font-size: .8rem; }
.endo-foto .st.on { color: #ffc107; }
.endo-foto .leg { position: absolute; left: 0; right: 0; bottom: 0; color: #fff; font-size: .68rem; padding: 1px 4px; background: linear-gradient(transparent, rgba(0,0,0,.8)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.endo-fotos.sel .endo-foto { cursor: pointer; }
.endo-fotos.sel .endo-foto input { position: absolute; bottom: 18px; right: 4px; z-index: 1; }
.endo-fotos.sel .endo-foto:has(input:checked) { outline: 3px solid var(--bs-primary); }
.endo-mini { width: 48px; height: 36px; object-fit: cover; border-radius: 4px; }

/* Grade da escala: edição visual (pincel, arrastar, menu da célula, painel do profissional) */
.esc-pincel-bt { border: 1px solid #dee2e6; border-left: 4px solid var(--cor, #adb5bd); border-radius: 4px; background: #fff; padding: 0 .5rem; font-size: .78rem; line-height: 1.5rem; cursor: pointer; }
.esc-pincel-bt.on { background: var(--cor, #adb5bd); color: #fff; border-color: var(--cor, #adb5bd); box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--cor, #adb5bd); }
.esc-pincel-apagar.on { background: #495057; border-color: #495057; }
.esc-grade.esc-pintando .esc-cel { cursor: cell; caret-color: transparent; }
.esc-grade td[draggable="true"] { cursor: grab; }
.esc-grade td.esc-arrastando { opacity: .4; }
.esc-grade td.esc-sobre { box-shadow: inset 0 0 0 2px #0d6efd; }
.esc-grade tbody th.esc-nome-bt { cursor: pointer; }
.esc-grade tbody th.esc-nome-bt:hover { background: #eef4ff; }
.esc-menu { position: absolute; z-index: 1060; display: none; min-width: 220px; background: #fff; border: 1px solid #ced4da; border-radius: 6px; box-shadow: 0 6px 20px rgba(0,0,0,.15); padding: .25rem 0; }
.esc-menu.on { display: block; }
.esc-menu-t { font-size: .75rem; color: #6c7a86; padding: .25rem .6rem; border-bottom: 1px solid #e9ecef; margin-bottom: .2rem; }
.esc-menu button { display: flex; align-items: center; gap: .4rem; width: 100%; border: 0; background: none; text-align: left; padding: .3rem .6rem; font-size: .82rem; }
.esc-menu button:hover { background: #f1f3f5; }
.esc-flutuante { position: fixed; right: 20px; bottom: 20px; z-index: 1040; display: none; align-items: center; gap: .75rem; background: #fff; border: 1px solid #0d6efd; border-radius: 999px; padding: .4rem .5rem .4rem 1rem; font-size: .85rem; }
.esc-flutuante.on { display: flex; }
.esc-ep-dia { background: var(--cor); font-size: .72rem; }
.esc-ep-dia small { font-weight: 400; opacity: .9; }
/* Grade: ausências, extras e conferência em tempo real */
.esc-grade td.esc-ausente .esc-cel { text-decoration: line-through; opacity: .55; cursor: not-allowed; }
.esc-grade td.esc-ausente .esc-af-sigla { position: absolute; right: 1px; bottom: 0; font-size: .58rem; font-weight: 700; color: #c92a2a; z-index: 1; pointer-events: none; }
.esc-grade td.esc-aus-licenca_medica .esc-af-sigla { color: #1864ab; }
.esc-grade .esc-marca-extra { border-top-color: #2b8a3e; border-left-width: 8px; border-top-width: 8px; }
.esc-grade td.esc-rt { box-shadow: inset 0 0 0 2px #f59f00; }
.esc-grade td.esc-rt::after { content: '!'; position: absolute; top: -1px; left: 2px; font-size: .6rem; font-weight: 700; color: #e67700; }
.esc-grade tr.esc-acima > th.esc-nome { box-shadow: inset 4px 0 0 #e03131; }
.esc-grade tr.esc-abaixo > th.esc-nome { box-shadow: inset 4px 0 0 #f59f00; }
.esc-menu-sep { border-top: 1px solid #e9ecef; margin: .2rem 0; }
.esc-barra { flex: 1; height: 8px; background: #f1f3f5; border-radius: 4px; overflow: hidden; min-width: 60px; }
.esc-barra span { display: block; height: 100%; }

/* ------------------------------------------------------------------ Módulos, visual colorido: blocos de ícone em degradê
   (substituem as ilustrações desenhadas; estilo de painel corporativo). --tile = cor do módulo. */
.mod-tile { flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; width: 52px; height: 52px; border-radius: 14px;
    color: #fff; font-size: 1.45rem; position: relative; overflow: hidden;
    background: linear-gradient(145deg, color-mix(in srgb, var(--tile) 82%, #fff) 0%, var(--tile) 48%, color-mix(in srgb, var(--tile) 72%, #000) 100%);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.28), 0 4px 10px color-mix(in srgb, var(--tile) 28%, transparent); }
.mod-tile::before { content: ""; position: absolute; inset: 0 0 50% 0; background: linear-gradient(180deg, rgba(255,255,255,.18), rgba(255,255,255,0)); pointer-events: none; }
.mod-tile .bi { position: relative; line-height: 1; }
.mod-tile.pequeno { width: 34px; height: 34px; border-radius: 9px; font-size: 1rem; box-shadow: inset 0 1px 0 rgba(255,255,255,.25); }
body:not(.ui-sobrio) .modulo-card { border-color: #e4e9ef; border-radius: .7rem; box-shadow: 0 1px 2px rgba(16,24,40,.05); }
body:not(.ui-sobrio) .modulo-card::after { display: none; }
body:not(.ui-sobrio) .modulo-card:hover, body:not(.ui-sobrio) .modulo-card:focus-within { transform: translateY(-1px);
    border-color: color-mix(in srgb, var(--mod-cor) 40%, #dfe5eb); box-shadow: 0 6px 16px rgba(16,24,40,.08); }
body:not(.ui-sobrio) .modulo-topo { gap: .55rem; padding: 1rem .55rem .85rem; }
body:not(.ui-sobrio) .modulo-card:hover .mod-tile { filter: saturate(1.1) brightness(1.04); }
body:not(.ui-sobrio) .modulo-nome { font-weight: 600; color: #1d2b36; }
body:not(.ui-sobrio) .modulo-letra { color: #c8d2dc; font-weight: 700; }
body:not(.ui-sobrio) .modulo-ind { background: #d92d20; box-shadow: 0 0 0 2px #fff; }
/* pasta: os módulos de dentro em blocos pequenos, sobre fundo neutro */
body:not(.ui-sobrio) .mod-pasta { width: 52px; height: 52px; padding: 4px; gap: 3px; grid-template-rows: 1fr 1fr; align-content: center; border-radius: 14px; background: #f1f4f8; border: 1px solid #e1e7ee; }
.mod-pasta .mod-tile.pequeno { width: 100%; height: 100%; border-radius: 6px; font-size: .72rem; box-shadow: none; }
.mod-pasta .mod-tile.pequeno::before { display: none; }
.modulo-fav .mod-tile.pequeno { width: 26px; height: 26px; border-radius: 50%; font-size: .8rem; }
.menubar-modulo .mod-tile.pequeno { width: 1.6rem; height: 1.6rem; border-radius: .4rem; font-size: .85rem; }
.login-mod .mod-tile.pequeno { width: 44px; height: 44px; border-radius: 12px; font-size: 1.2rem; }

/* Ficha do usuário (cadastros/usuarios) */
.usu-ficha .nav-tabs .nav-link { font-size: .85rem; padding: .45rem .8rem; }
.usu-avatar { width: 40px; height: 40px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 700;
    color: #fff; background: linear-gradient(145deg, #3b82c4, #1f4e79); }
.usu-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .1rem .75rem; max-height: 220px; overflow: auto;
    padding: .5rem .75rem; border: 1px solid #e3e8ec; border-radius: .5rem; background: #fafbfc; font-size: .85rem; }

/* Chamada de senhas (recepcao/painel): escolha da fila e indicadores da fila de trabalho */
.sen-fila-card { transition: border-color .15s, box-shadow .15s; }
.sen-fila-card:hover { border-color: #9fb3c8; box-shadow: 0 6px 16px rgba(16,24,40,.08); }
.sen-fila-total { display: inline-flex; flex-direction: column; align-items: center; min-width: 4.2rem; padding: .3rem .5rem; border-radius: .6rem;
    background: #eef2f6; color: #4a5a68; font-size: 1.4rem; font-weight: 700; line-height: 1.1; }
.sen-fila-total small { font-size: .65rem; font-weight: 500; }
.sen-fila-total.tem { background: #e7f0ff; color: #1f5fbf; }
.sen-kpi { display: flex; flex-direction: column; font-size: .75rem; color: #6c7a86; }
.sen-kpi span { font-size: 1.45rem; font-weight: 700; color: #1d2b36; line-height: 1.15; }
.sen-kpi.pref span { color: #b25e00; }
