/* Genesis Web - estilos base compartilhados por todas as telas
   (reset, ribbon/menu, submenu flutuante, modais). Origem: FormPrincipal.html */

        /* ============================================================
           RESET GERAL E ESTRUTURA PRINCIPAL
        ============================================================ */
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        html,
        body {
            height: 100%;
            overflow: hidden;
            font-family: Calibri;
            background: #f0f2f5;
        }

        #app {
            display: flex;
            flex-direction: column;
            height: 100vh;
            overflow: hidden;
        }

        /* ============================================================
           ESTILOS DO MENU (RIBBON)
        ============================================================ */
        .ribbon-container {
            flex-shrink: 0;
            width: 100%;
            background: #fff;
            box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
            border: 1px solid #d0d7e0;
            position: relative;
            max-height: 132px;
            z-index: 1000;
        }

        .ribbon-tabs {
            display: flex;
            background: #3f68a7;  /*#2b579a;*/
            padding: 5px 0px 0px 16px;
            gap: 2px;
            overflow-x: auto;
            white-space: nowrap;
            flex-wrap: nowrap;
            -webkit-overflow-scrolling: touch;
        }
        .ribbon-tabs::-webkit-scrollbar {
            height: 4px;
        }
        .ribbon-tabs::-webkit-scrollbar-thumb {
            background: #c0d0e0;
            border-radius: 4px;
        }

        .ribbon-tab {
            padding: 10px 13px 8px 13px;
            font-size: 12px;
            color: #fff;
            cursor: pointer;
            transition: all 0.2s;
            border-radius: 6px 6px 0 0;
            border-color: #1a5c9e;
            background: transparent;
            border: none;
            flex-shrink: 0;
            user-select: none;
        }
        .ribbon-tab:hover {
            background: rgba(255, 255, 255, 0.6);
            color: #1a3a5c;
        }
        .ribbon-tab.active {
            color: #1a5c9e;
            background: #f0f2f5;
        }
        .ribbon-tab i {
            margin-right: 8px;
        }

        .ribbon-body {
            padding: 8px 13px 0px;
            overflow: visible;
            position: relative;
        }

        .ribbon-panel {
            display: none;
            animation: fadeIn 0.25s;
        }
        .ribbon-panel.active {
            display: block;
        }
        @keyframes fadeIn {
            from {
                opacity: 0;
                transform: translateY(6px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        .ribbon-group {
            display: flex;
            flex-wrap: nowrap;
            align-items: flex-start;
            margin-left: -14px;
            gap: 0px;
            padding: 0px 0px;
            overflow-x: auto;
            -webkit-overflow-scrolling: touch;
            scroll-behavior: smooth;
            height: 81px;
        }
        .ribbon-group::-webkit-scrollbar {
            height: 4px;
        }
        .ribbon-group::-webkit-scrollbar-thumb {
            background: #c0d0e0;
            border-radius: 4px;
        }

        .ribbon-group-divider {
            width: 1px;
            height: 54px;
            background: #dce3ec;
            margin: 0 10px;
            flex-shrink: 0;
        }

        .ribbon-btn {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            min-width: 68px;
            padding: -1px 6px 8px;
            border: none;
            border-radius: 6px;
            background: transparent;
            color: #2c3e50;
            font-size: 11px;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.15s;
            text-align: center;
            line-height: 1.3;
            position: relative;
            gap: 3px;
            font-family: inherit;
            flex-shrink: 0;
        }
        .ribbon-btn i {
            font-size: 11px;
            color: #3a5a7a;
            display: block;
            margin-bottom: 1px;
        }
        .ribbon-btn .btn-label {
            font-size: 11.5px;
            max-width: 71px;
            word-break: break-word;
        }
        .ribbon-btn .btn-sub {
            font-size: 8.5px;
            color: #7a8a9e;
        }
        .ribbon-btn:hover {
            background: #eef3f9;
        }
        .ribbon-btn:hover i {
            color: #1a5c9e;
        }
        .ribbon-btn:active {
            background: #dce6f0;
            transform: scale(0.97);
        }

        /* Ícones personalizados (caminhos locais) */
        .icon-pardini {
            background: url('../files/images/apoio/pardini_mini.png') no-repeat center center;
            background-size: contain;
            width: 16px;
            height: 16px;
            display: inline-block;
        }
        .icon-alvaro {
            background: url('../files/images/apoio/alvaro_mini.png') no-repeat center center;
            background-size: contain;
            width: 16px;
            height: 16px;
            display: inline-block;
        }
        .icon-labchecap {
            background: url('../files/images/apoio/labchecap_mini.png') no-repeat center center;
            background-size: contain;
            width: 16px;
            height: 16px;
            display: inline-block;
        }
        .icon-db {
            background: url('../files/images/apoio/db_mini.png') no-repeat center center;
            background-size: contain;
            width: 16px;
            height: 16px;
            display: inline-block;
        }
        .icon-saomarcos {
            background: url('../files/images/apoio/saomarcos_mini.png') no-repeat center center;
            background-size: contain;
            width: 16px;
            height: 16px;
            display: inline-block;
        }

        /* ===== SUBMENU FLUTUANTE ===== */
        .floating-submenu {
            position: fixed;
            z-index: 99999;
            background: #fff;
            border-radius: 8px;
            box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
            border: 1px solid #dce3ec;
            padding: 6px 0;
            min-width: 210px;
            animation: dropIn 0.18s ease;
            display: none;
        }
        .floating-submenu.open {
            display: block;
        }

        @keyframes dropIn {
            from {
                opacity: 0;
                transform: translateY(-8px) scale(0.97);
            }
            to {
                opacity: 1;
                transform: translateY(0) scale(1);
            }
        }

        .floating-submenu ul {
            list-style: none;
            margin: 0;
            padding: 0;
        }
        .floating-submenu li {
            position: relative;
            list-style: none;
        }
        .floating-submenu a {
            display: flex;
            align-items: center;
           /* justify-content: space-between;*/
            padding: 8px 18px 8px 16px;
            font-size: 13px;
            color: #1e2a3a;
            text-decoration: none;
            font-weight: 450;
            transition: background 0.12s;
            gap: 12px;
            white-space: nowrap;
            cursor: pointer;
            background: transparent;
            border: none;
            width: 100%;
            text-align: left;
        }
        .floating-submenu a:hover {
            background: #eef3f9;
            color: #1a5c9e;
        }
        .floating-submenu a i {
            font-size: 14px;
            color: #5a7a9a;
            width: 20px;
            text-align: center;
        }
        .floating-submenu a .arrow-right {
            margin-left: auto;
            font-size: 11px;
            color: #9aabbe;
        }
        .floating-submenu a:hover .arrow-right {
            transform: translateX(2px);
            color: #1a5c9e;
        }

        /* Subníveis aninhados */
        .floating-submenu .submenu-level {
            display: none;
            position: fixed;
            background: #fff;
            border-radius: 8px;
            box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
            border: 1px solid #dce3ec;
            padding: 6px 0;
            min-width: 200px;
            z-index: 100000;
            animation: subDropIn 0.15s ease;
        }
        .floating-submenu .submenu-level.open {
            display: block;
        }

        @keyframes subDropIn {
            from {
                opacity: 0;
                transform: translateX(-6px) scale(0.98);
            }
            to {
                opacity: 1;
                transform: translateX(0) scale(1);
            }
        }

        .floating-submenu .level-badge {
            font-size: 9px;
            background: #eef3f9;
            color: #5a7a9a;
            padding: 1px 8px;
            border-radius: 10px;
            font-weight: 600;
            margin-left: 6px;
        }

        /* ===== RESPONSIVIDADE DO MENU ===== */
        @media (max-width: 820px) {
            .ribbon-tabs {
                padding: 0 8px;
                gap: 2px;
            }
            .ribbon-tab {
                padding: 8px 14px 6px;
                font-size: 13px;
            }
            .ribbon-btn {
                min-width: 60px;
                padding: 4px 6px 6px;
            }
            .ribbon-btn i {
                font-size: 17px;
            }
            .ribbon-btn .btn-label {
                font-size: 9.5px;
                max-width: 71px;
            }
            .ribbon-group-divider {
                margin: 0 4px;
                height: 44px;
            }
            .floating-submenu {
                min-width: 170px;
            }
            .floating-submenu .submenu-level {
                min-width: 170px;
            }
            .floating-submenu a {
                font-size: 12px;
                padding: 6px 14px 6px 12px;
            }
        }
        @media (max-width: 500px) {
            .ribbon-tab {
                font-size: 11px;
                padding: 6px 10px 4px;
            }
            .ribbon-tab i {
                margin-right: 4px;
                font-size: 11px;
            }
            .ribbon-btn {
                min-width: 48px;
                padding: 3px 4px 4px;
            }
            .ribbon-btn i {
                font-size: 14px;
            }
            .ribbon-btn .btn-label {
                font-size: 8px;
                max-width: 48px;
            }
            .ribbon-btn .btn-sub {
                font-size: 7px;
            }
            .ribbon-group-divider {
                margin: 0 2px;
                height: 34px;
            }
            .ribbon-body {
                padding: 8px 16px 10px;
            }
            .ribbon-group {
                gap: 2px;
            }
        }

                button:disabled 
        {
          opacity: 0.3;
          cursor: not-allowed;
        }
    

/* ============================================================
   MODAL DE CONFIRMAÇÃO
   ============================================================ */
#modais-container .confirm-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(15, 23, 42, 0.4);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  pointer-events: auto;
  opacity: 0;
  transition: opacity 0.15s ease-out;
}

#modais-container .confirm-overlay.aberto {
  opacity: 1;
}

#modais-container .confirm-janela {
  background: white;
  border-radius: 10px;
  width: 100%;
  max-width: 460px;
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.35);
  overflow: hidden;
  transform: translateY(12px) scale(0.97);
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
}

#modais-container .confirm-overlay.aberto .confirm-janela {
  transform: translateY(0) scale(1);
}

#modais-container .confirm-header {
  padding: 14px 18px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  gap: 10px;
}

#modais-container .confirm-icone {
  width: 28px;
  height: 28px;
  background: #dbeafe;
  color: #2563eb;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
}

#modais-container .confirm-titulo {
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
}

#modais-container .confirm-corpo {
  padding: 20px 18px;
  font-size: 13px;
  color: #334155;
  line-height: 1.5;
}

#modais-container .confirm-rodape {
  padding: 12px 18px;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

#modais-container .btn-confirm {
  padding: 7px 16px;
  border-radius: 6px;
  border: 1px solid transparent;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  min-width: 80px;
}

#modais-container .btn-cancelar {
  background: white;
  color: #64748b;
  border-color: #e2e8f0;
}
#modais-container .btn-cancelar:hover {
  background: #f1f5f9;
  color: #334155;
}

#modais-container .btn-nao {
  background: #fef2f2;
  color: #ef4444;
  border-color: #fecaca;
}
#modais-container .btn-nao:hover {
  background: #fee2e2;
}

#modais-container .btn-sim {
  background: #2563eb;
  color: white;
}
#modais-container .btn-sim:hover {
  background: #1d4ed8;
}



  /* ============================================================
     MODAIS — flutuantes sobre todo o conteúdo
     ============================================================ */
  #modais-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2147483647;   /* máximo z-index possível */
    pointer-events: none;
    display: block !important;
  }

  #modais-container .modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.55);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
    display: flex !important;
    align-items: center;
    justify-content: center;
    padding: 20px;
    pointer-events: auto;
    opacity: 1;
    visibility: visible;
    box-sizing: border-box;
  }

  #modais-container .modal-janela {
    background: #ffffff;
    border-radius: 10px;
    width: 100%;
    height: 100%;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.35);
    display: flex !important;
    flex-direction: column;
    box-sizing: border-box;
  }

  #modais-container .modal-corpo-carregando {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: #94a3b8;
    font-size: 13px;
  }

  #modais-container .spinner {
    width: 24px;
    height: 24px;
    border: 3px solid #e2e8f0;
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: girar 0.8s linear infinite;
  }

  @keyframes girar {
    to { transform: rotate(360deg); }
  }

/* ============================================================
   RIBBON - botão de módulo sem acesso (ACESSO_MODULOS)
   ============================================================ */
.ribbon-btn.sem-acesso,
.ribbon-btn.sem-acesso:hover { opacity: 1; background: transparent; cursor: not-allowed; transform: none; }
.ribbon-btn.sem-acesso img { filter: grayscale(1); opacity: .35; }
.ribbon-btn.sem-acesso .btn-label { color: #a0aec0; }
.ribbon-btn.sem-acesso .cadeado {
    position: absolute; top: 0; right: 14px; font-size: 9px; color: #94a3b8;
    background: #fff; border-radius: 50%; padding: 2px;
}

/* janela de tamanho médio (ex.: impressão do pedido) */
#modais-container .modal-janela.janela-grande { width: min(1180px, calc(100% - 24px)); height: min(790px, calc(100% - 24px)); }
#modais-container .modal-janela.janela-compacta { width: min(760px, calc(100% - 24px)); height: min(300px, calc(100% - 24px)); }
#modais-container .modal-janela.janela-reduzida { width: min(900px, calc(100% - 24px)); height: min(570px, calc(100% - 24px)); }
#modais-container .modal-janela.janela-pequena { width: min(720px, calc(100% - 24px)); height: min(380px, calc(100% - 24px)); }
#modais-container .modal-janela.janela-media { width: min(980px, calc(100% - 24px)); height: min(680px, calc(100% - 24px)); }

/* ---------- Visualizador de impressão (Genesis.visualizarImpressao) ---------- */
#modais-container .modal-overlay.visualizador { z-index: 1200; }
#modais-container .vis-janela { display: flex; flex-direction: column; overflow: hidden; }
.vis-barra { display: flex; align-items: center; gap: 6px; padding: 8px 10px; background: #f8fafc; border-bottom: 1px solid #e2e8f0; flex-wrap: wrap; font: 13px Arial, sans-serif; }
.vis-barra .vis-titulo { font-size: 14px; color: #0f172a; }
.vis-barra .vis-esp { flex: 1; }
.vis-bt { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 7px; border: 1px solid #cbd5e1; background: #fff; color: #334155; font: 600 12.5px Arial, sans-serif; cursor: pointer; }
.vis-bt:hover:not(:disabled) { background: #f1f5f9; }
.vis-bt:disabled { opacity: .45; cursor: not-allowed; }
.vis-bt.prim { background: #2563eb; border-color: #2563eb; color: #fff; }
.vis-bt.prim:hover:not(:disabled) { background: #1d4ed8; }
.vis-bt .fa-whatsapp { color: #16a34a; }
.vis-x { width: 32px; height: 30px; border: 0; background: transparent; color: #64748b; font-size: 16px; cursor: pointer; border-radius: 7px; }
.vis-x:hover { background: #fee2e2; color: #b91c1c; }
.vis-corpo { flex: 1; min-height: 0; position: relative; }

/* visualizador: envio pelo WhatsApp */
.vis-zap { display: inline-flex; align-items: center; gap: 4px; border: 1px solid #bbf7d0; background: #f0fdf4; border-radius: 8px; padding: 2px 4px 2px 8px; }
.vis-zap > i { color: #16a34a; font-size: 15px; }
.vis-zap.off { border-color: var(--g-borda, #e2e8f0); background: #f8fafc; }
.vis-zap.off > i { color: #94a3b8; }
.vis-zap-num { width: 130px; height: 26px; border: 1px solid var(--g-borda, #e2e8f0); border-radius: 6px; padding: 0 6px; font-size: 12.5px; }
/* aviso de WhatsApp desconectado (rodapé do painel principal) */
.aviso-zap { display: inline-flex; align-items: center; gap: 6px; background: #fee2e2; color: #b91c1c; border: 1px solid #fecaca; border-radius: 999px;
  padding: 4px 12px; font-size: 12px; font-weight: 700; cursor: pointer; animation: avisoZap 2s ease-in-out infinite; }
.aviso-zap[hidden] { display: none; }
/* "Meus boletos" só para administrador: o .btn-acao (inline-flex) venceria o atributo hidden */
.btn-boletos[hidden] { display: none !important; }
/* painel, bloco Agendamento: agendamento feito pelo site aguardando conferência (pisca até alguém confirmar) */
.ag-site-alerta { margin-left: auto; align-self: center; display: flex; flex-direction: column; align-items: center; gap: 1px; border: 1px solid #f59e0b; background: #fff7ed; color: #9a3412; border-radius: 10px; padding: 5px 10px; font: 600 11.5px Arial, sans-serif; cursor: pointer; animation: agSitePisca 1.2s ease-in-out infinite; }
.ag-site-alerta i { font-size: 15px; color: #ea580c; }
.ag-site-alerta small { font-size: 10px; text-decoration: underline; }
.ag-site-alerta[hidden] { display: none !important; }
@keyframes agSitePisca { 50% { background: #fed7aa; box-shadow: 0 0 0 4px rgba(234, 88, 12, .25); } }
.ag-site-dlg { position: fixed; inset: 0; z-index: 9000; background: rgba(15, 23, 42, .45); display: grid; place-items: center; padding: 16px; }
.ag-site-dlg .cx { background: #fff; border-radius: 14px; width: min(560px, 100%); max-height: 80vh; display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0,0,0,.3); font: 13px Arial, sans-serif; }
.ag-site-dlg .cab { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid #e2e8f0; font-weight: 700; }
.ag-site-dlg .cab button { margin-left: auto; border: 0; background: none; font-size: 18px; cursor: pointer; color: #64748b; }
.ag-site-dlg .txt { padding: 8px 14px 0; color: #64748b; font-size: 12px; }
.ag-site-dlg .lst { overflow: auto; padding: 8px 14px; }
.ag-site-dlg label { display: flex; gap: 8px; align-items: flex-start; padding: 7px 4px; border-bottom: 1px dashed #e2e8f0; cursor: pointer; }
.ag-site-dlg label small { display: block; color: #64748b; }
.ag-site-dlg .rod { display: flex; gap: 8px; justify-content: flex-end; padding: 10px 14px; border-top: 1px solid #e2e8f0; }
.ag-site-dlg .rod button { border: 1px solid #cbd5e1; background: #fff; border-radius: 8px; padding: 6px 12px; cursor: pointer; font-weight: 700; }
.ag-site-dlg .rod button.pri { background: #2563eb; border-color: #2563eb; color: #fff; }
@keyframes avisoZap { 50% { box-shadow: 0 0 0 4px rgba(220, 38, 38, .15); } }

/* aviso de pagamento / bloqueio do cliente (validação na VPS) - canto inferior direito */
.licenca-aviso { position: fixed; right: 18px; bottom: 18px; z-index: 9999; width: 360px; max-width: calc(100vw - 36px); display: flex; gap: 10px; align-items: flex-start;
  background: #fff; border: 1px solid #fde68a; border-left: 5px solid #f59e0b; border-radius: 12px; box-shadow: 0 14px 40px rgba(15,23,42,.25); padding: 12px 12px 12px 14px;
  transform: translateY(20px); opacity: 0; transition: .35s; font-size: 13px; }
.licenca-aviso.aberto { transform: none; opacity: 1; }
.licenca-aviso.bloq { border-color: #fecaca; border-left-color: #dc2626; }
.licenca-aviso .ic { font-size: 22px; color: #f59e0b; margin-top: 2px; }
.licenca-aviso.bloq .ic { color: #dc2626; }
.licenca-aviso b { display: block; margin-bottom: 3px; font-size: 14px; }
.licenca-aviso p { margin: 0; color: #334155; line-height: 1.45; }
.licenca-aviso > div { flex: 1; }
.licenca-aviso button { border: 0; background: transparent; color: #94a3b8; cursor: pointer; font-size: 14px; padding: 2px; }

/* status do exame / pedido (ícones do desktop: bolinha colorida com a letra) - Genesis.iconeStatus */
.bola { display: inline-grid; place-items: center; width: 19px; height: 19px; border-radius: 50%; font: 800 12px/1 Calibri; color: #fff; letter-spacing: -.5px; flex-shrink: 0; box-shadow: inset 0 -1px 0 rgba(0,0,0,.18); }
.bola.s-B { background: #9b9b9b; }
.bola.s-E { background: #1f9e1a; }
.bola.s-F { background: #ff3600; }
.bola.s-H { background: #f7a01f; font-size: 8.5px; }
.bola.s-J { background: #ff1799; font-size: 9px; }
.bola.s-K { background: #ac00d2; }
.bola.s-L { background: #1a1917; }
.bola.s-P { background: #0d6eb5; }
.bola.s-Q { background: #f7a724; }
.bola.s-R { background: #a0023c; }
.bola.s-X { background: #e98bf0; font-size: 8.5px; }
.bola.s-C { background: #fff; color: #990000; font-size: 13px; box-shadow: none; }
.bola.s-vazio { background: #fff; border: 1.5px solid #cbd5e1; box-shadow: none; }
.bola.s-outro { background: #e2e8f0; color: #475569; }

/* tabela de preço: ícone do tipo de valor (CH ou R$) e exame bloqueado (vermelho com cadeado) */
.ic-tab { display: inline-grid; place-items: center; min-width: 20px; height: 18px; padding: 0 4px; border-radius: 5px; font-size: 10px; font-weight: 800; vertical-align: middle; }
.ic-tab.ch { background: #ede9fe; color: #6d28d9; }
.ic-tab.rs { background: #dcfce7; color: #15803d; }
.tb-bloq td:first-child, .tb-bloq .nome-ex { color: var(--g-vermelho, #dc2626); }
.tb-bloq .fa-lock, .ex-bloq .fa-lock { color: var(--g-vermelho, #dc2626); }
.ex-bloq .nome-ex { color: var(--g-vermelho, #dc2626); font-weight: 700; }
