:root{--mobile-safe-top:env(safe-area-inset-top,0px);--mobile-safe-right:env(safe-area-inset-right,0px);--mobile-safe-bottom:env(safe-area-inset-bottom,0px);--mobile-safe-left:env(safe-area-inset-left,0px)}
html{max-width:100%;min-height:100%;overflow-x:hidden;overflow-y:auto;-webkit-text-size-adjust:100%;text-size-adjust:100%}
body{max-width:100%;min-height:100%;overflow-x:hidden;overflow-y:auto;overscroll-behavior-y:auto}
img,svg,video,canvas{max-width:100%}
button,a,input,select,textarea{-webkit-tap-highlight-color:transparent}
.table-responsive,.tenant-table-wrap,.report-table-wrap{max-width:100%;-webkit-overflow-scrolling:touch;overscroll-behavior-inline:contain}
.mobile-nav-backdrop{position:fixed;inset:0;z-index:1040;background:rgba(2,13,35,.58);backdrop-filter:blur(2px);opacity:0;visibility:hidden;transition:opacity .2s,visibility .2s}
.mobile-nav-backdrop.open{opacity:1;visibility:visible}
.saas-mobile-topbar{display:none}
.location-map{width:100%;height:420px;border:1px solid #dce6f4;border-radius:15px;overflow:hidden;background:#eaf1fb}.location-map.location-map-error{border-color:#dc3545;background:repeating-linear-gradient(135deg,#fff5f5,#fff5f5 12px,#ffe9e9 12px,#ffe9e9 24px)}
.employee-reference-preview{width:112px;height:112px;object-fit:cover;border-radius:16px;border:3px solid #fff;box-shadow:0 8px 24px rgba(7,40,90,.14)}
.proof-comparison img{width:100%;height:min(52vh,520px);object-fit:cover;background:#edf2f8}.place-items-center{place-items:center}
.tenant-topbar-actions{display:flex;align-items:center;gap:5px}.tenant-topbar-link{width:42px;height:42px;display:grid;place-items:center;border-radius:11px;color:#526683;text-decoration:none}.tenant-topbar-link:hover{background:#e8f1ff;color:#075ce5}.schedule-editor{min-width:1050px}.schedule-editor .form-control{min-width:105px}

@media(max-width:820px){
 body.mobile-menu-open{overflow:hidden;touch-action:none}
 button,.btn,.nav-link,.tenant-sidebar nav a,.employee-sidebar nav a,.saas-nav a{min-height:44px}
 input.form-control,select.form-select,textarea.form-control,.portal-input input{font-size:16px}
 .container{--bs-gutter-x:1.5rem}
 .surface,.tenant-card,.portal-card{border-radius:15px}
 .surface.p-4,.tenant-card,.portal-card,.profile-card,.portal-page-card{padding:16px!important}
 h1,.h1{overflow-wrap:anywhere}
 .h2{font-size:clamp(1.45rem,7vw,1.85rem)}
 .tenant-sidebar,.employee-sidebar,.saas-nav{position:fixed!important;inset:0 auto 0 0!important;width:min(86vw,320px)!important;height:100dvh;min-height:100vh!important;padding-top:calc(22px + var(--mobile-safe-top))!important;padding-right:18px!important;padding-bottom:calc(18px + var(--mobile-safe-bottom))!important;padding-left:18px!important;overflow-y:auto;transform:translateX(-105%);transition:transform .25s ease;z-index:1050}
 .tenant-sidebar.open,.employee-sidebar.open,.saas-nav.open{transform:translateX(0)!important;box-shadow:20px 0 50px rgba(0,0,0,.28)}
 .tenant-topbar,.employee-topbar,.saas-mobile-topbar{height:calc(64px + var(--mobile-safe-top));padding-top:var(--mobile-safe-top);padding-right:calc(12px + var(--mobile-safe-right));padding-left:calc(12px + var(--mobile-safe-left))}
 .tenant-mobile-menu,.mobile-menu,.saas-mobile-menu{display:grid!important;place-items:center;width:44px;height:44px;border:0;background:transparent;color:inherit;font-size:1.5rem;border-radius:10px}
 .tenant-content,.employee-content,.saas-main{margin-left:0!important;padding:18px calc(12px + var(--mobile-safe-right)) calc(32px + var(--mobile-safe-bottom)) calc(12px + var(--mobile-safe-left))!important}
 .saas-mobile-topbar{position:sticky;top:0;z-index:900;display:flex;align-items:center;justify-content:space-between;background:rgba(255,255,255,.94);border-bottom:1px solid #ddd6f3;backdrop-filter:blur(12px)}
 .saas-mobile-topbar strong{font-size:.92rem;color:#26105d}
 .saas-main{min-width:0}
 .tenant-welcome,.employee-welcome{gap:12px;align-items:flex-start}
 .tenant-stats,.portal-metrics{grid-template-columns:1fr 1fr}
 .tenant-stats article,.portal-metrics article{padding:13px}
 .tenant-main-grid,.tenant-secondary-grid,.portal-grid-top,.portal-grid-bottom{grid-template-columns:minmax(0,1fr)}
 .quick-card,.plan-card-tenant{grid-column:auto}
 .tenant-card-heading,.card-heading{gap:10px;align-items:flex-start}
 .tenant-link-box{min-width:0}
 .table-responsive,.tenant-table-wrap,.report-table-wrap{margin-inline:-16px;padding-inline:16px}
 .table-responsive table,.tenant-table,.portal-table{min-width:680px}
 .table-responsive::after,.tenant-table-wrap::after,.report-table-wrap::after{content:'Deslize para ver mais →';display:block;padding:8px 2px 0;color:#64748b;font-size:.7rem;text-align:right}
 .pagination{flex-wrap:wrap;gap:4px}
 .pagination .page-link{min-width:42px;text-align:center;border-radius:8px}
 .input-group{flex-wrap:nowrap}
 .input-group>.form-control,.input-group>.form-select{min-width:0}
 .modal{padding:0!important}
 .modal-dialog{width:100%;max-width:none!important;min-height:100%;margin:0;display:flex;align-items:flex-end}
 .modal-content{max-height:calc(100dvh - var(--mobile-safe-top));border:0;border-radius:22px 22px 0 0;overflow:hidden;padding-bottom:var(--mobile-safe-bottom)}
 .modal-body{overflow-y:auto;-webkit-overflow-scrolling:touch}
 .modal-footer{flex-wrap:nowrap}
 .modal-footer .btn{flex:1}
 [data-proof-map]{height:52dvh!important;min-height:300px}
 .location-map{height:55dvh;min-height:320px}
 dialog[aria-label="Capturar foto da marcação"]{margin:auto auto 0!important;width:100%!important;max-width:none!important;border-radius:22px 22px 0 0!important;padding-bottom:var(--mobile-safe-bottom)!important}
 dialog[aria-label="Capturar foto da marcação"]::backdrop{background:rgba(2,13,35,.72);backdrop-filter:blur(3px)}
 .employee-login-wrap,.auth-shell,.clock-shell{min-height:100dvh;padding:calc(16px + var(--mobile-safe-top)) calc(12px + var(--mobile-safe-right)) calc(16px + var(--mobile-safe-bottom)) calc(12px + var(--mobile-safe-left))}
 .employee-login-card,.auth-card,.clock-card{padding:22px 18px;border-radius:18px}
 .time-hero{min-height:auto;padding:18px}
 .time-hero>#server-clock{font-size:clamp(2.8rem,15vw,4.2rem)}
 .hero-clock-button{min-height:54px;position:sticky;bottom:calc(10px + var(--mobile-safe-bottom));z-index:2}
 .chart-wrap,.tenant-chart-wrap{height:210px}
 .profile-grid,.report-metrics{grid-template-columns:1fr 1fr}
 .day-entries{grid-template-columns:1fr}
 .period-filter{align-items:stretch;flex-direction:column}
 .period-filter input,.period-filter button{width:100%}
 footer .container{gap:8px;justify-content:center!important;text-align:center}
}

@media(max-width:520px){
 .tenant-stats,.portal-metrics,.profile-grid,.report-metrics{grid-template-columns:1fr}
 .operation-list,.quick-links{grid-template-columns:1fr}
 .tenant-welcome h1,.employee-welcome h1{font-size:1.55rem}
 .tenant-date,.employee-welcome .outline-action{display:none}
 .d-flex.justify-content-end>.btn,.d-flex.justify-content-between>.btn{width:100%}
 .surface>form.d-flex{flex-direction:column}
 .surface>form.d-flex .form-control{max-width:none!important;width:100%}
 .surface>form.d-flex .btn{width:100%}
 .day-summary{gap:8px;align-items:flex-start}
 .day-summary>div{align-items:flex-start;flex-direction:column}
 .portal-link-actions{align-items:flex-start;gap:7px;flex-direction:column}
 .hero .btn-lg{width:100%}
 .phone-demo{min-height:440px;border-width:7px;border-radius:1.8rem;padding:1rem}
 .impersonation{align-items:stretch;flex-direction:column;gap:6px;text-align:center}
}

@media(max-height:520px) and (orientation:landscape){
 .tenant-sidebar,.employee-sidebar,.saas-nav{padding-top:12px!important;padding-bottom:12px!important}
 .time-hero{min-height:auto}
 .time-hero>#server-clock{font-size:2.8rem}
 .employee-login-wrap,.auth-shell{place-items:start center}
}

@media(prefers-reduced-motion:reduce){*,*::before,*::after{scroll-behavior:auto!important;transition-duration:.01ms!important;animation-duration:.01ms!important;animation-iteration-count:1!important}}
