/* Shared touch layouts; desktop and printed reports keep their own layout. */
.mobile-bottom-nav{display:none;}
@media screen and (max-width:991.98px){
    body .mobile-bottom-nav{
        display:flex;overflow-x:auto;overscroll-behavior-x:contain;
        scroll-snap-type:x proximity;scrollbar-width:thin;
        position:fixed;bottom:0;left:0;right:0;z-index:1040;
        background:#fff;border-top:1px solid #e6eaee;
        padding:6px 8px calc(6px + env(safe-area-inset-bottom,0px));
        box-shadow:0 -4px 20px #1d34400a;
    }
    body .mobile-bottom-nav a,body .mobile-bottom-nav button{
        display:flex;flex-direction:column;align-items:center;justify-content:center;
        gap:7px;min-height:58px;min-width:88px;flex:0 0 88px;padding:6px 2px;
        scroll-snap-align:center;white-space:nowrap;
        border:0;border-radius:12px;background:transparent;
        color:#72808c;text-decoration:none;font:500 10px var(--app-font-family);
    }
    body .mobile-bottom-nav i{font-size:19px;}
    body .mobile-bottom-nav svg{width:23px;height:23px;flex-shrink:0;}
    body .mobile-bottom-nav a span{
        font-family:"Josefin Sans", var(--app-font-family) !important;
        font-weight:500 !important;font-size:12px !important;
        letter-spacing:.015em !important;line-height:1.3;
    }
    body .mobile-bottom-nav [aria-current="page"],
    body .mobile-bottom-nav [aria-expanded="true"]{background:#edf0f3;color:#233744;}
    body .mobile-bottom-nav :focus-visible{outline:2px solid #587b90;outline-offset:-2px;}
    body:has(.mobile-bottom-nav) .main-content{
        padding-bottom:calc(96px + env(safe-area-inset-bottom,0px)) !important;
    }
    body:has(.mobile-bottom-nav) .btn-outline-black.d-lg-none{display:none !important;}
    body:has(.mobile-bottom-nav) .sidebar{
        display:none !important;
    }
    body:has(.mobile-bottom-nav) .overlay{display:none !important;}
    body:has(.mobile-bottom-nav) .perfil-floating-edit{
        bottom:calc(84px + env(safe-area-inset-bottom,0px)) !important;
    }
}
@media print{.mobile-bottom-nav{display:none !important;}}
@media screen and (max-width: 991.98px){
    body .main-content{
        margin-left:0 !important;
        min-width:0;
        width:100%;
        padding:12px !important;
        padding-bottom:calc(20px + env(safe-area-inset-bottom, 0px)) !important;
    }
    body .sidebar{
        width:min(285px, 88vw) !important;
        height:100dvh !important;
        min-height:0 !important;
        overflow-y:auto;
        overscroll-behavior:contain;
        padding-bottom:env(safe-area-inset-bottom, 0px);
    }
    body .sidebar .nav-link{min-height:48px;}
    body .sidebar .submenu .nav-link{min-height:44px;}
    body .sidebar-user-clean__logout{min-width:44px;min-height:44px;}
    body .main-content .top-bar{gap:10px;flex-wrap:wrap;}
    body .btn-outline-black.d-lg-none{min-width:44px;min-height:44px;}
    body input.form-control,
    body textarea.form-control,
    body select.form-select{
        font-size:16px !important;
        min-height:46px !important;
    }
    body textarea.form-control{min-height:96px !important;}
    body .btn,
    body .tab-btn,
    body .page-link,
    body .system-pagination-toggle{
        min-height:44px !important;
    }
    body .btn-icon, body .btn-close{min-width:44px;min-height:44px;}
    body .table-responsive{
        max-width:100%;
        overflow-x:auto;
        overscroll-behavior-x:contain;
        -webkit-overflow-scrolling:touch;
    }
    body .table-responsive .btn{min-width:44px;}
    body .modal .modal-dialog{
        width:calc(100% - 16px) !important;
        max-width:calc(100% - 16px) !important;
        margin:8px auto !important;
    }
    body .modal .modal-content{max-height:calc(100dvh - 16px);}
    body .modal .modal-body{overflow-y:auto;overscroll-behavior:contain;min-height:0;}
    body .modal .modal-header,
    body .modal .modal-footer{flex-shrink:0;gap:8px;}
    body .modal .modal-footer{flex-wrap:wrap;}
    body .modal-fotos-backdrop{padding:8px;}
    body .modal-fotos{max-height:calc(100dvh - 16px);overflow-y:auto;}
}
@media screen and (max-width: 767.98px){
    body .page-shell{min-width:0;max-width:100%;}
    body .dashboard-grid{grid-template-columns:minmax(0, 1fr) !important;}
    body .dashboard-grid > [class*="col-span-"]{grid-column:1 / -1 !important;min-width:0;}
    body .page-heading{align-items:stretch !important;gap:12px;}
    body .page-heading__actions{display:flex;flex-wrap:wrap;gap:8px;}
    body .lista-toolbar-search,
    body .lista-toolbar-select{min-width:0 !important;max-width:100% !important;flex-basis:100% !important;}
    body .lista-modal-grid{grid-template-columns:minmax(0, 1fr) !important;}
    body .chart-panel__header{flex-wrap:wrap;}
    body .system-pagination{gap:6px;}
    body .system-pagination .page-link{min-width:44px;}
    body.login-page-mobile{
        min-height:100vh;
        min-height:100dvh;
        height:auto !important;
        overflow-y:auto !important;
        padding:24px 16px !important;
        padding-bottom:calc(24px + env(safe-area-inset-bottom, 0px)) !important;
    }
    body.login-page-mobile .login-box{
        min-width:0;
        width:100%;
        padding:28px 22px !important;
        margin:auto;
        flex-shrink:0;
    }
    body.login-page-mobile .login-box .system-title{font-size:clamp(1.7rem, 7vw, 2.4rem);}
}
@media screen and (max-height: 540px) and (max-width: 991.98px){
    body.login-page-mobile{overflow-y:auto !important;padding:16px !important;align-items:flex-start;}
    body.login-page-mobile .login-box{margin:auto;flex-shrink:0;}
}
