/* Shared final layer: readable desktop grids and reachable mobile controls. */
:root{--sam-touch:44px;--sam-safe-bottom:env(safe-area-inset-bottom,0px)}
.mt-main,.mt-content,.mt-content-area,.sam-page-shell{min-width:0}
.mt-header-right{gap:6px;flex-wrap:wrap}
.sam-network-clock{font-variant-numeric:tabular-nums;white-space:nowrap;min-height:34px}
.sam-field-help{color:var(--text-muted,#64748b);font-size:.85rem;line-height:1.8}
.mt-modal input,.mt-modal select,.mt-modal textarea{max-width:100%;box-sizing:border-box}
.mt-modal-footer{gap:8px;flex-wrap:wrap}
.mt-table-container,.table-responsive{max-width:100%;overflow-x:auto;overscroll-behavior-inline:contain}
button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible{outline:3px solid #38bdf8;outline-offset:2px}
@media(min-width:1024px){
 .mt-modal{max-width:min(94vw,1100px)}
 .mt-modal-body{scrollbar-gutter:stable}
 .mt-table th,.mt-table td{line-height:1.6}
}
@media(max-width:767px){
 html[lang="ar"] body .mt-header .mt-btn{min-width:44px!important;min-height:44px!important;height:44px!important;padding:6px 9px!important;flex-shrink:0!important}
 html[lang="ar"] body .mt-modal .mt-btn{min-height:44px!important}
 .mt-header{height:auto!important;min-height:56px;flex-wrap:wrap;gap:8px;padding:8px 12px!important}
 .mt-header-left,.mt-header-right{min-width:0;max-width:100%}
 .mt-header-right{gap:6px;flex:1 1 100%;overflow-x:auto;flex-wrap:nowrap;padding-block:2px 5px}
 .mt-header-right>.mt-btn,.mt-header-right>button{flex-shrink:0;min-height:40px!important}
 .mt-header-right .user-greeting{display:none}
 .mt-content,.mt-content-area{padding:12px!important}
 .mt-btn,.mt-modal button,.mt-nav-item{min-height:var(--sam-touch);touch-action:manipulation}
 .mt-modal-backdrop{padding:8px!important;align-items:center!important}
 .mt-modal{width:100%!important;max-width:100%!important;max-height:calc(100dvh - 16px)!important;border-radius:16px!important;display:flex!important;flex-direction:column!important;overflow:hidden!important}
 .mt-modal-header{flex:0 0 auto;gap:8px;min-height:52px}
 .mt-modal-header::before{display:none!important}
 .mt-modal-body{min-height:0;flex:1 1 auto;overflow-y:auto!important;max-height:none!important;padding:16px!important}
 .mt-modal-footer{flex:0 0 auto;padding:12px 16px calc(12px + var(--sam-safe-bottom))!important;background:var(--bg-window,#fff);border-top:1px solid var(--border-color,#e2e8f0)}
 .mt-modal input:not([type=checkbox]):not([type=radio]),.mt-modal select,.mt-modal textarea{font-size:16px!important;min-height:44px}
 .mt-modal .form-grid,.mt-modal .sam-brand-grid{grid-template-columns:minmax(0,1fr)!important}
 .mt-modal-body>[style*="grid-template-columns"]{grid-template-columns:minmax(0,1fr)!important}
 .mt-table-container,.table-responsive{-webkit-overflow-scrolling:touch}
}
@media(prefers-reduced-motion:reduce){.mt-modal,.mt-sidebar{animation:none!important;transition:none!important}}
@font-face{font-family:SAMArabic;src:url('../fonts/SAMArabic.ttf') format('truetype');font-display:swap}
html[lang="ar"] body,html[lang="ar"] input,html[lang="ar"] button,html[lang="ar"] select,html[lang="ar"] textarea{font-family:SAMArabic,Cairo,Tahoma,sans-serif}
