/* RevalidaLink V3 - menu drawer + chamada Fase 2 embutida */

/* MENU: os tres risquinhos passam a ser o padrao tambem no desktop. */
.menu-lateral {
    width: min(310px, 88vw) !important;
    transform: translateX(-105%) !important;
    box-shadow: 18px 0 48px rgba(0, 0, 0, .42) !important;
    transition: transform .22s ease !important;
    will-change: transform;
}

.menu-lateral.aberto {
    transform: translateX(0) !important;
}

.conteudo-principal {
    margin-left: 0 !important;
    width: 100% !important;
    max-width: none !important;
}

.botao-abrir-menu,
.botao-fechar-menu {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.menu-sobreposicao {
    position: fixed !important;
    inset: 0 !important;
    z-index: 1190 !important;
    display: block !important;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    background: rgba(2, 6, 12, .7) !important;
    backdrop-filter: blur(3px);
    transition: opacity .2s ease, visibility .2s ease;
}

.menu-sobreposicao.ativo {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}

body.revalidalink-menu-aberto {
    overflow: hidden;
}

/* CHAMADA EMBUTIDA */
.rl-fase2-call {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 2500;
    width: min(390px, calc(100vw - 24px));
    overflow: hidden;
    border: 1px solid #26384a;
    border-radius: 18px;
    background: #0b1420;
    color: #e7eef7;
    box-shadow: 0 22px 70px rgba(0, 0, 0, .48);
    font-family: Inter, Arial, sans-serif;
}

.rl-fase2-call[hidden] { display: none !important; }

.rl-fase2-call__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 11px 12px;
    border-bottom: 1px solid #203043;
    background: #101b28;
}

.rl-fase2-call__title { min-width: 0; }
.rl-fase2-call__title strong { display: block; font-size: 13px; }
.rl-fase2-call__title span { display: block; margin-top: 2px; color: #91a4b9; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rl-fase2-call__header-actions { display: flex; gap: 6px; }
.rl-fase2-call__icon-btn {
    width: 34px; height: 34px; display: inline-grid; place-items: center;
    border: 1px solid #2b3d51; border-radius: 9px; background: #142131;
    color: #dce7f4; cursor: pointer;
}
.rl-fase2-call__icon-btn:hover { background: #1c2d41; }

.rl-fase2-call__body { padding: 10px; }
.rl-fase2-call.minimizada .rl-fase2-call__body { display: none; }

.rl-fase2-call__remote {
    position: relative; aspect-ratio: 16/9; overflow: hidden;
    border: 1px solid #24374c; border-radius: 13px; background: #03070c;
}
.rl-fase2-call__remote video { width: 100%; height: 100%; object-fit: cover; }
.rl-fase2-call__empty {
    position: absolute; inset: 0; display: grid; place-content: center;
    gap: 5px; padding: 18px; color: #91a4b9; text-align: center;
}
.rl-fase2-call__empty strong { color: #e7eef7; }
.rl-fase2-call__local {
    position: absolute; right: 10px; bottom: 10px; width: 94px; aspect-ratio: 4/3;
    overflow: hidden; border: 2px solid #344b64; border-radius: 10px; background: #111c28;
}
.rl-fase2-call__local video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.rl-fase2-call__local span { position: absolute; inset: 0; display: grid; place-items: center; color: #9fb0c2; font-size: 11px; }
.rl-fase2-call__audio { display: none; }

.rl-fase2-call__meta {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    margin-top: 9px; color: #a6b6c8; font-size: 11px;
}
.rl-fase2-call__status { display: inline-flex; align-items: center; gap: 6px; }
.rl-fase2-call__dot { width: 8px; height: 8px; border-radius: 50%; background: #f59e0b; }
.rl-fase2-call.conectada .rl-fase2-call__dot { background: #17d990; box-shadow: 0 0 0 4px rgba(23,217,144,.12); }
.rl-fase2-call.erro .rl-fase2-call__dot { background: #f87171; }

.rl-fase2-call__notice {
    margin: 8px 0 0; padding: 7px 9px; border-radius: 9px;
    background: #101e2b; color: #9eb1c5; font-size: 10px; line-height: 1.35;
}

.rl-fase2-call__controls { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-top: 9px; }
.rl-fase2-call__controls button {
    min-height: 38px; padding: 7px 9px; border: 1px solid #2b3d51; border-radius: 9px;
    background: #142131; color: #e4edf7; font-weight: 750; cursor: pointer;
}
.rl-fase2-call__controls button:hover:not(:disabled) { background: #1c2d41; }
.rl-fase2-call__controls button:disabled { opacity: .48; cursor: default; }
.rl-fase2-call__controls .perigo { border-color: #6b2b31; background: #35191d; color: #ffd1d5; }
.rl-fase2-call__controls .perigo:hover:not(:disabled) { background: #4a2026; }
.rl-fase2-call__audio-button { grid-column: 1 / -1; }

/* Botao explicito de encerramento na espera neutra do medico. */
.espera-neutra-acoes-v3 { display: flex; justify-content: center; margin-top: 16px; }
.espera-neutra-encerrar-v3 {
    min-height: 42px; padding: 9px 15px; border: 1px solid #6c2c33; border-radius: 10px;
    background: #35191e; color: #ffd0d5; font-weight: 800; cursor: pointer;
}
.espera-neutra-encerrar-v3:hover { background: #4a2027; }
.espera-neutra-encerrar-v3:disabled { opacity: .55; cursor: wait; }

@media (max-width: 620px) {
    .rl-fase2-call { right: 8px; bottom: 8px; width: calc(100vw - 16px); border-radius: 14px; }
    .rl-fase2-call__controls { grid-template-columns: 1fr; }
    .rl-fase2-call__audio-button { grid-column: auto; }
}

/* Garante que o sidebar antigo fique sempre fora da tela ate o hamburger abrir. */
html:not(.revalidalink-menu-aberto) body > .menu-lateral:not(.aberto),
html:not(.revalidalink-menu-aberto) .menu-lateral:not(.aberto) {
    transform: translateX(-105%) !important;
}

/* ==========================================================
   RevalidaLink V3.2.2 — botão "Ver detalhes" nos cards
   ========================================================== */
.botao-estacao-detalhes-v322,
.botao-checklist-detalhes-v322 {
    min-height: 48px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 9px !important;
    padding: 12px 18px !important;
    border: 1px solid rgba(66, 200, 232, .34) !important;
    border-radius: 11px !important;
    background: rgba(16, 42, 59, .92) !important;
    color: #dff8ff !important;
    font: inherit !important;
    font-weight: 800 !important;
    line-height: 1.1 !important;
    cursor: pointer !important;
    text-decoration: none !important;
    box-shadow: none !important;
    transition: background .18s ease, border-color .18s ease, transform .18s ease !important;
}

.botao-estacao-detalhes-v322:hover,
.botao-checklist-detalhes-v322:hover {
    background: rgba(22, 61, 82, .98) !important;
    border-color: rgba(71, 213, 238, .68) !important;
    transform: translateY(-1px);
}

.botao-estacao-detalhes-v322 i,
.botao-checklist-detalhes-v322 i {
    color: #58d9ec !important;
}

/* ==========================================================
   RevalidaLink V3.2.2 — detalhes completos do checklist
   ========================================================== */
body.rl-detalhes-aberto {
    overflow: hidden !important;
}

.rl-detalhes-modal[hidden] {
    display: none !important;
}

.rl-detalhes-modal {
    position: fixed;
    inset: 0;
    z-index: 7000;
    display: grid;
    place-items: center;
    padding: 22px;
}

.rl-detalhes-fundo {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    background: rgba(3, 8, 14, .78);
    backdrop-filter: blur(5px);
    cursor: default;
}

.rl-detalhes-painel {
    position: relative;
    z-index: 1;
    width: min(1080px, 96vw);
    max-height: min(900px, 92vh);
    display: grid;
    grid-template-rows: auto auto auto minmax(0, 1fr);
    overflow: hidden;
    border: 1px solid rgba(124, 160, 193, .24);
    border-radius: 20px;
    background: #0b1520;
    color: #eaf2f8;
    box-shadow: 0 28px 90px rgba(0, 0, 0, .58);
}

.rl-detalhes-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    padding: 22px 24px 18px;
    border-bottom: 1px solid rgba(124, 160, 193, .16);
}

.rl-detalhes-header > div {
    min-width: 0;
}

.rl-detalhes-kicker {
    display: block;
    margin-bottom: 5px;
    color: #42d8b5;
    font-size: .72rem;
    font-weight: 900;
    letter-spacing: .08em;
}

.rl-detalhes-header h2 {
    margin: 0;
    color: #f4f8fb;
    font-size: clamp(1.25rem, 2.5vw, 1.8rem);
}

.rl-detalhes-header p {
    margin: 7px 0 0;
    color: #93a7ba;
    line-height: 1.5;
}

.rl-detalhes-fechar {
    flex: 0 0 auto;
    width: 42px;
    height: 42px;
    display: inline-grid;
    place-items: center;
    border: 1px solid #2b4052;
    border-radius: 11px;
    background: #132332;
    color: #eef5fa;
    cursor: pointer;
}

.rl-detalhes-abas {
    display: flex;
    gap: 7px;
    overflow-x: auto;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(124, 160, 193, .14);
    scrollbar-width: thin;
}

.rl-detalhes-abas button {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    padding: 9px 12px;
    border: 1px solid #273c4d;
    border-radius: 10px;
    background: #111f2c;
    color: #aec0cf;
    font-weight: 750;
    cursor: pointer;
}

.rl-detalhes-abas button.ativa {
    border-color: rgba(51, 218, 180, .45);
    background: rgba(25, 92, 76, .3);
    color: #dffcf5;
}

.rl-detalhes-estado {
    padding: 28px 24px;
    color: #a9bac8;
}

.rl-detalhes-conteudo {
    overflow: auto;
    padding: 20px 22px 28px;
}

.rl-detalhes-secao {
    display: grid;
    gap: 14px;
}

.rl-detalhes-secao > h3,
.rl-detalhes-subgrupo > h3 {
    margin: 0 0 2px;
    color: #f0f6fa;
    font-size: 1.18rem;
}

.rl-detalhes-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.rl-detalhes-grid-item,
.rl-detalhes-bloco,
.rl-detalhes-card {
    border: 1px solid rgba(118, 151, 180, .16);
    border-radius: 13px;
    background: #101c28;
}

.rl-detalhes-grid-item {
    display: grid;
    gap: 5px;
    padding: 12px;
}

.rl-detalhes-grid-item span {
    color: #8197a9;
    font-size: .76rem;
    font-weight: 700;
}

.rl-detalhes-grid-item strong {
    color: #eaf2f8;
    overflow-wrap: anywhere;
}

.rl-detalhes-bloco {
    padding: 14px 15px;
}

.rl-detalhes-bloco h4 {
    margin: 0 0 7px;
    color: #a9c4d8;
    font-size: .82rem;
}

.rl-detalhes-bloco p {
    margin: 0;
    color: #d7e1e8;
    line-height: 1.6;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.rl-detalhes-card {
    display: grid;
    gap: 12px;
    padding: 15px;
}

.rl-detalhes-card > h4,
.rl-detalhes-card-topo h4,
.rl-detalhes-secao-titulo {
    margin: 0;
    color: #eef5f9;
}

.rl-detalhes-card-topo {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.rl-detalhes-selo {
    flex: 0 0 auto;
    padding: 5px 8px;
    border-radius: 999px;
    background: rgba(48, 209, 173, .12);
    color: #69e3c6;
    font-size: .72rem;
    font-weight: 800;
}

.rl-detalhes-subgrupo,
.rl-detalhes-criterios {
    display: grid;
    gap: 10px;
}

.rl-detalhes-criterio {
    display: grid;
    gap: 5px;
    padding: 10px 12px;
    border-left: 3px solid #31495d;
    background: rgba(8, 17, 25, .48);
}

.rl-detalhes-criterio strong {
    color: #c9d9e5;
}

.rl-detalhes-criterio span {
    color: #9eb1c0;
    line-height: 1.5;
    white-space: pre-wrap;
}

.rl-detalhes-abrir-material {
    justify-self: start;
    min-height: 40px;
    padding: 9px 13px;
    border: 1px solid #2d5970;
    border-radius: 9px;
    background: #133148;
    color: #dff6ff;
    font-weight: 800;
    cursor: pointer;
}

.rl-detalhes-viewer {
    overflow: hidden;
    border: 1px solid #263d50;
    border-radius: 11px;
    background: #050a0e;
}

.rl-detalhes-imagem {
    display: block;
    width: 100%;
    max-height: 70vh;
    object-fit: contain;
}

.rl-detalhes-frame {
    display: block;
    width: 100%;
    min-height: 560px;
    border: 0;
    background: #fff;
}

.rl-detalhes-erro {
    margin: 0;
    padding: 12px;
    color: #ffb7be;
}

@media (max-width: 820px) {
    .rl-detalhes-modal { padding: 8px; }
    .rl-detalhes-painel { width: 100%; max-height: 96vh; border-radius: 14px; }
    .rl-detalhes-header { padding: 16px; }
    .rl-detalhes-conteudo { padding: 14px; }
    .rl-detalhes-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .rl-detalhes-frame { min-height: 420px; }
}

@media (max-width: 520px) {
    .rl-detalhes-grid { grid-template-columns: 1fr; }
}

/* ==========================================================
   RevalidaLink V3.2.3 — drawer privado professor/admin isolado
   ========================================================== */

/* O <details> antigo fica somente como fonte de links/permissões. */
#prof-menu-gestao[data-drawer-source-v323="true"] {
    display: none !important;
}

.botao-abrir-menu-gestao-v323 {
    flex: 0 0 auto !important;
    width: 44px !important;
    height: 44px !important;
    display: inline-grid !important;
    place-items: center !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 1px solid rgba(132, 164, 193, .28) !important;
    border-radius: 12px !important;
    background: #132130 !important;
    color: #f2f7fb !important;
    font-size: 1rem !important;
    line-height: 1 !important;
    cursor: pointer !important;
    box-shadow: none !important;
    transition: background .18s ease, border-color .18s ease, transform .18s ease !important;
}

.botao-abrir-menu-gestao-v323:hover {
    background: #1b3044 !important;
    border-color: rgba(94, 234, 171, .52) !important;
    transform: translateY(-1px);
}

.botao-abrir-menu-gestao-v323[hidden] {
    display: none !important;
}

.rl-gestao-overlay-v323 {
    position: fixed !important;
    inset: 0 !important;
    z-index: 6998 !important;
    display: block !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
    background: rgba(3, 8, 14, .72) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    transition: opacity .18s ease, visibility .18s ease !important;
}

.rl-gestao-overlay-v323.ativo {
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
}

.rl-gestao-drawer-v323 {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    bottom: 0 !important;
    right: auto !important;
    z-index: 7000 !important;
    width: min(350px, 90vw) !important;
    height: 100dvh !important;
    display: flex !important;
    flex-direction: column !important;
    margin: 0 !important;
    padding: 0 0 22px !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior: contain !important;
    border: 0 !important;
    border-right: 1px solid rgba(139, 169, 196, .19) !important;
    border-radius: 0 !important;
    background: #0d1824 !important;
    color: #eaf2f9 !important;
    box-shadow: 24px 0 70px rgba(0, 0, 0, .5) !important;
    filter: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    transform: translate3d(-105%, 0, 0) !important;
    visibility: hidden !important;
    pointer-events: none !important;
    transition: transform .2s ease, visibility .2s ease !important;
    isolation: isolate !important;
}

.rl-gestao-drawer-v323.aberto {
    transform: translate3d(0, 0, 0) !important;
    visibility: visible !important;
    pointer-events: auto !important;
}

.rl-gestao-drawer-v323,
.rl-gestao-drawer-v323 * {
    filter: none !important;
}

.rl-gestao-drawer-v323__cabecalho {
    position: sticky !important;
    top: 0 !important;
    z-index: 2 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 14px !important;
    padding: 19px 17px !important;
    border-bottom: 1px solid rgba(139, 169, 196, .14) !important;
    background: #0d1824 !important;
}

.rl-gestao-drawer-v323__cabecalho > div {
    min-width: 0 !important;
    display: grid !important;
    gap: 3px !important;
}

.rl-gestao-drawer-v323__cabecalho strong {
    color: #f5f9fc !important;
    font-size: 1rem !important;
    font-weight: 850 !important;
}

.rl-gestao-drawer-v323__cabecalho span {
    color: #8ea4b8 !important;
    font-size: .76rem !important;
    line-height: 1.35 !important;
}

.rl-gestao-drawer-v323__fechar {
    flex: 0 0 auto !important;
    width: 39px !important;
    height: 39px !important;
    display: inline-grid !important;
    place-items: center !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 1px solid rgba(139, 169, 196, .22) !important;
    border-radius: 10px !important;
    background: #152638 !important;
    color: #edf4fa !important;
    cursor: pointer !important;
}

.rl-gestao-drawer-v323__links {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 6px !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 10px 13px !important;
    position: static !important;
    inset: auto !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    overflow: visible !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

.rl-gestao-drawer-v323__base {
    padding-top: 14px !important;
    padding-bottom: 12px !important;
    border-bottom: 1px solid rgba(139, 169, 196, .11) !important;
}

.rl-gestao-drawer-v323__secao {
    padding: 15px 18px 5px !important;
    color: #71879b !important;
    font-size: .68rem !important;
    font-weight: 850 !important;
    letter-spacing: .11em !important;
    text-transform: uppercase !important;
}

.rl-gestao-drawer-v323__secao[hidden] {
    display: none !important;
}

.rl-gestao-drawer-v323__links a {
    position: relative !important;
    min-height: 45px !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 11px !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 10px 12px !important;
    border: 1px solid transparent !important;
    border-radius: 11px !important;
    background: transparent !important;
    color: #dbe7f1 !important;
    font-size: .86rem !important;
    font-weight: 760 !important;
    line-height: 1.25 !important;
    text-align: left !important;
    text-decoration: none !important;
    transform: none !important;
}

.rl-gestao-drawer-v323__links a:hover,
.rl-gestao-drawer-v323__links a.ativo {
    background: rgba(82, 142, 187, .13) !important;
    border-color: rgba(90, 230, 170, .2) !important;
    color: #f5fbff !important;
    transform: none !important;
}

.rl-gestao-drawer-v323__links a > i {
    flex: 0 0 21px !important;
    width: 21px !important;
    color: #37d996 !important;
    font-size: .94rem !important;
    text-align: center !important;
}

.rl-gestao-drawer-v323__links .badge-admin-pendente {
    margin-left: auto !important;
    position: static !important;
}

body.rl-gestao-drawer-aberto {
    overflow: hidden !important;
}

@media (max-width: 560px) {
    .rl-gestao-drawer-v323 {
        width: min(340px, 94vw) !important;
    }
}

/* Botão de envio de material: contraste maior e leitura imediata. */
.botao-enviar-material-paciente:not(:disabled) {
    border-color: #2f75ff !important;
    background: #245fd1 !important;
    color: #ffffff !important;
    box-shadow: 0 7px 18px rgba(36, 95, 209, .24) !important;
}

.botao-enviar-material-paciente:not(:disabled) i {
    color: #ffffff !important;
}

.botao-enviar-material-paciente:hover:not(:disabled) {
    border-color: #4f8cff !important;
    background: #1d4fb2 !important;
    color: #ffffff !important;
}

.item-material-paciente.enviado .botao-enviar-material-paciente {
    border-color: rgba(34, 197, 94, .48) !important;
    background: rgba(22, 101, 52, .34) !important;
    color: #d7ffe5 !important;
    box-shadow: none !important;
}
