/****************************************************
 * ProsoftMed - CSS PWA
 * Objetivo:
 * - Remover barras de rolagem globais
 * - Permitir rolagem SOMENTE interna e controlada
 * - Comportamento de aplicativo nativo
 ****************************************************/

/* ===============================
   RESET GLOBAL
================================ */
html, body {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;

    /* Remove qualquer rolagem da página */
    overflow: hidden !important;

    /* Remove efeito elástico (mobile) */
    overscroll-behavior: none;

    /* Evita resize estranho no iOS */
    position: fixed;
}

/* ===============================
   CONTAINERS PRINCIPAIS SCRIPTCASE
================================ */
.scContainer,
.scBodyPage,
.scAppDiv,
.scAppContainer {
    width: 100%;
    height: 100%;
    overflow: hidden !important;
}

/* ===============================
   IFRAMES (Scriptcase usa bastante)
================================ */
iframe {
    width: 100%;
    height: 100%;
    border: none;
    overflow: hidden !important;
}

/* ===============================
   ÁREA DE CONTEÚDO COM SCROLL CONTROLADO
   (USE SOMENTE ONDE PRECISAR)
================================ */

/* Formulários */
.scFormTable {
    overflow-y: auto !important;
    overflow-x: hidden !important;

    /* Ajuste de altura:
       diminua/aumente conforme cabeçalho */
    max-height: calc(100vh - 120px);

    -webkit-overflow-scrolling: touch;
}

/* Grids */
.scGridBody,
.scGridTabela {
    overflow-y: auto !important;
    overflow-x: hidden !important;
    max-height: calc(100vh - 120px);

    -webkit-overflow-scrolling: touch;
}

/* Dashboards */
.scDashboard,
.scDashContainer {
    overflow-y: auto !important;
    overflow-x: hidden !important;
    max-height: calc(100vh - 120px);
}

/* ===============================
   TOUCH / MOBILE
================================ */
body {
    /* Evita scroll por gesto fora das áreas permitidas */
    touch-action: manipulation;

    /* Melhora performance mobile */
    -webkit-text-size-adjust: 100%;
}

/* ===============================
   EVITA SCROLL ACIDENTAL
================================ */
* {
    box-sizing: border-box;
}

/* ===============================
   OCULTA BARRAS VISUAIS (CASO APAREÇAM)
================================ */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

::-webkit-scrollbar-track {
    background: transparent;
}
