/* HR v108 — Final bugfix layer: mobile UX, toasts, push, KPI, CORS diagnostics */
:root{--v108-mobile-max:480px;--v108-nav-h:76px;--v108-panel:rgba(8,20,40,.96);--v108-border:rgba(0,194,255,.22)}
html,body{max-width:100%;overflow-x:hidden!important}
body.employee-portal{min-height:100svh;background:#050b1b!important}
body.employee-portal .employee-shell{width:100%;max-width:100vw;overflow-x:hidden!important}
body.employee-portal .employee-main{width:min(100%,var(--v108-mobile-max))!important;margin-inline:auto!important;padding-inline:12px!important;padding-bottom:calc(var(--v108-nav-h) + 28px + env(safe-area-inset-bottom))!important;box-sizing:border-box!important}
body.employee-portal .employee-topbar,body.employee-portal .employee-page-head{width:min(100%,var(--v108-mobile-max))!important;margin-inline:auto!important;box-sizing:border-box!important;overflow:hidden!important}
body.employee-portal .employee-card,body.employee-portal .employee-grid,body.employee-portal .employee-form-grid,body.employee-portal form,body.employee-portal .employee-list,body.employee-portal .employee-list-item{min-width:0!important;max-width:100%!important;box-sizing:border-box!important}
body.employee-portal .employee-actions-row,body.employee-portal .employee-actions-stack,body.employee-portal .form-actions{display:flex!important;flex-wrap:wrap!important;gap:9px!important;align-items:stretch!important}
body.employee-portal .employee-actions-row>.button,body.employee-portal .employee-actions-row>button,body.employee-portal .employee-actions-stack>.button,body.employee-portal .employee-actions-stack>button{flex:1 1 150px!important;min-width:0!important;max-width:100%!important;white-space:normal!important;min-height:44px!important}
body.employee-portal .button.full,body.employee-portal button.full{width:100%!important;max-width:100%!important}
/* Bottom nav stable size */
body.employee-portal .employee-bottom-nav{position:fixed!important;left:50%!important;right:auto!important;bottom:0!important;transform:translateX(-50%)!important;width:min(calc(100vw - 18px),var(--v108-mobile-max))!important;height:calc(var(--v108-nav-h) + env(safe-area-inset-bottom))!important;display:grid!important;grid-template-columns:repeat(5,minmax(0,1fr))!important;gap:6px!important;padding:8px 8px calc(8px + env(safe-area-inset-bottom))!important;border-radius:22px 22px 0 0!important;overflow:hidden!important;z-index:850!important}
body.employee-portal .employee-bottom-nav button{width:100%!important;min-width:0!important;max-width:100%!important;padding:7px 3px!important;border-radius:15px!important;overflow:hidden!important;white-space:nowrap!important}
body.employee-portal .employee-bottom-nav button strong{font-size:16px!important;line-height:1!important;display:block!important}
body.employee-portal .employee-bottom-nav button span{display:block!important;font-size:9px!important;line-height:1.1!important;overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important}
/* More drawer must always be reachable */
.more-drawer,.employee-more-sheet{position:fixed!important;left:50%!important;right:auto!important;bottom:calc(var(--v108-nav-h) + 2px + env(safe-area-inset-bottom))!important;transform:translateX(-50%) translateY(110%)!important;width:min(calc(100vw - 16px),440px)!important;max-height:min(68svh,560px)!important;overflow:hidden!important;border-radius:24px!important;z-index:900!important;box-sizing:border-box!important}
.more-drawer.is-open,.employee-more-sheet:not(.hidden){transform:translateX(-50%) translateY(0)!important}
.more-drawer-body,.more-sheet-grid{overflow-y:auto!important;-webkit-overflow-scrolling:touch!important;overscroll-behavior:contain!important;padding-bottom:16px!important}
.more-drawer-body{max-height:calc(min(68svh,560px) - 54px)!important}
.employee-more-sheet{padding:8px 10px 14px!important}
.employee-more-sheet .more-sheet-grid{max-height:calc(min(68svh,560px) - 72px)!important;display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:7px!important}
.more-drawer-grid{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:7px!important}
.more-drawer-item,.more-sheet-grid button{min-height:54px!important;padding:7px 5px!important;border-radius:14px!important;gap:3px!important;overflow:hidden!important}
.more-drawer-item .di-icon,.more-sheet-grid button strong{font-size:19px!important;line-height:1!important}.more-drawer-item .di-label,.more-sheet-grid button span{font-size:9.5px!important;line-height:1.2!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important}
/* Password toggles */
.login-password-field,.password-field,.v108-password-wrap{position:relative!important;display:block!important;width:100%!important}
.login-password-field input,.password-field input,.v108-password-wrap input[type="password"],.v108-password-wrap input[type="text"]{padding-inline-end:86px!important;width:100%!important;box-sizing:border-box!important}
.password-toggle,[data-toggle-password],.v108-password-toggle{position:absolute!important;inset-inline-end:8px!important;top:50%!important;transform:translateY(-50%)!important;width:68px!important;min-width:68px!important;max-width:68px!important;height:34px!important;min-height:34px!important;padding:0!important;display:inline-flex!important;align-items:center!important;justify-content:center!important;border-radius:999px!important;z-index:5!important;font-size:12px!important;line-height:1!important;white-space:nowrap!important;overflow:hidden!important}
/* Toasts / messages never stretch */
.hr-toast,.hr-qc-toast,.online-restored-banner,.offline-banner,.sw-update-banner,.message.compact{position:fixed!important;left:50%!important;right:auto!important;bottom:calc(var(--v108-nav-h) + 16px + env(safe-area-inset-bottom))!important;top:auto!important;transform:translateX(-50%) translateY(16px)!important;width:auto!important;min-width:0!important;max-width:min(calc(100vw - 28px),380px)!important;max-height:20svh!important;overflow:auto!important;padding:10px 14px!important;border-radius:15px!important;text-align:center!important;z-index:1200!important;line-height:1.55!important;font-size:12.5px!important;box-sizing:border-box!important;word-break:break-word!important;white-space:normal!important}.hr-toast.is-visible,.hr-qc-toast.is-visible{transform:translateX(-50%) translateY(0)!important;opacity:1!important}
body.employee-portal .message:not(.compact){max-width:100%!important;min-height:0!important;padding:11px 13px!important;border-radius:15px!important;line-height:1.55!important;white-space:normal!important;word-break:break-word!important}
/* Modal and push explanation */
.modal-backdrop{padding:14px!important;align-items:center!important;justify-content:center!important;z-index:1400!important}.confirm-modal,.push-explain-modal,.hr-qc-confirm-modal{width:min(calc(100vw - 28px),420px)!important;max-width:420px!important;max-height:min(78svh,560px)!important;overflow:auto!important;border-radius:22px!important;box-sizing:border-box!important;padding:18px!important}.push-explain-list{display:grid!important;gap:7px!important;padding:0!important;margin:8px 0!important}.push-explain-list li:nth-child(n+3){display:none!important}.push-explain-modal .form-actions{display:grid!important;grid-template-columns:1fr 1fr!important;gap:8px!important}.push-explain-modal .button{width:100%!important;min-width:0!important}
/* Floating reminder */
.attendance-floating-reminder{width:min(calc(100vw - 24px),390px)!important;max-height:25svh!important;overflow:auto!important;left:50%!important;right:auto!important;bottom:calc(var(--v108-nav-h) + 16px + env(safe-area-inset-bottom))!important;transform:translateX(-50%) translateY(18px)!important;padding:12px!important;border-radius:20px!important;z-index:1180!important;box-sizing:border-box!important}.attendance-floating-reminder.is-visible{transform:translateX(-50%) translateY(0)!important}.attendance-floating-close{position:absolute!important;inset-inline-end:8px!important;top:8px!important;width:28px!important;height:28px!important;min-width:28px!important;border-radius:999px!important;padding:0!important}.attendance-floating-copy{padding-inline-end:26px!important}.attendance-floating-actions{display:grid!important;grid-template-columns:1fr!important}.attendance-floating-actions .button{width:100%!important}.attendance-floating-actions .button:nth-child(n+2){display:none!important}
/* Buttons and ripple containment */
.button,button{box-sizing:border-box!important;max-width:100%;overflow:hidden}.ripple-effect,.v10-ripple{position:absolute!important;pointer-events:none!important;display:block!important;contain:layout paint!important;max-width:none!important;max-height:none!important;min-width:0!important;min-height:0!important}.button:active,button:active{transform:translateY(1px)!important}
/* Calm attendance cards */
.hr-punch-row,.location-history-item,.polished-history-list .employee-list-item{background:linear-gradient(135deg,rgba(8,24,44,.96),rgba(5,15,31,.98))!important;border-color:rgba(0,194,255,.18)!important;color:#eaf6ff!important}.hr-punch-row *,.location-history-item *{color:inherit}.badge.status-out_of_range,.badge.status-خارج,.badge.status-rejected{background:rgba(255,176,32,.14)!important;border-color:rgba(255,176,32,.35)!important;color:#ffd08a!important}
/* KPI */
.v108-kpi-page .kpi-summary-row{display:grid!important;grid-template-columns:1fr!important}.v108-kpi-page .kpi-slider-field{padding:12px!important;border-radius:16px!important}.v108-kpi-page input[type="range"]{width:100%!important}.v108-kpi-actions{display:grid!important;grid-template-columns:1fr 1fr!important}.kpi-total-chip b{font-size:1.05rem;color:#5fffc2}.v108-hr-estimate-note{border-color:rgba(255,176,32,.25)!important;background:rgba(255,176,32,.08)!important}
/* Location list: readable without coordinates being dominant */
.location-history-item small{white-space:normal!important;line-height:1.55!important}.location-history-item small::before{content:'آخر موقع محفوظ: ';color:#7fdcff}.location-history-item small{font-size:0!important}.location-history-item small::before,.location-history-item small::after{font-size:12px!important}.location-history-item small::after{content:'اضغط خريطة لفتح الموقع';color:#d7e8ff}
/* Keep scroll top away from devtools edge */
.v10-scroll-top,.hr-scroll-top,.scroll-top{left:12px!important;right:auto!important;bottom:calc(var(--v108-nav-h) + 14px)!important;width:42px!important;height:42px!important;min-width:42px!important}
@media(max-width:380px){.more-drawer-grid,.employee-more-sheet .more-sheet-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}.v108-kpi-actions{grid-template-columns:1fr!important}body.employee-portal .employee-bottom-nav button span{font-size:8px!important}.confirm-modal,.push-explain-modal{padding:15px!important}}
