:root { --mobile-nav-height: 68px; }
.mobile-tabbar,.mobile-more-sheet,.mobile-backdrop,.network-banner,.offline-action,.app-update { display:none; }

@media (max-width:760px) {
    html { width:100%; max-width:100%; min-height:100%; height:auto; overflow-x:hidden; overflow-y:auto; }
    body.erp-body { width:100%; max-width:100%; min-height:100vh; min-height:100dvh; overflow-x:hidden; overflow-y:auto; overscroll-behavior-y:auto; touch-action:pan-y; -webkit-overflow-scrolling:touch; -webkit-tap-highlight-color:transparent; }
    .erp-main,.erp-container { min-height:0; overflow:visible; touch-action:pan-y; }
    .erp-header { position:sticky; top:0; z-index:1035; padding-top:env(safe-area-inset-top); background:rgba(7,9,13,.96); backdrop-filter:blur(18px); }
    .erp-header__inner { min-height:58px; grid-template-columns:1fr auto; grid-template-rows:auto; padding:8px 14px; }
    .erp-brand { grid-column:1; grid-row:1; justify-self:start; }
    .erp-brand img { width:54px; }
    .erp-profile { grid-column:2; grid-row:1; }
    .erp-profile__button { width:42px; height:42px; }
    .erp-nav { display:none; }
    .erp-main { padding-top:18px; padding-bottom:calc(var(--mobile-nav-height) + 34px + env(safe-area-inset-bottom)); }
    .erp-container { width:calc(100% - 20px); }
    .page-heading { margin-bottom:18px; }
    .page-heading p { max-width:100%; }
    .surface-panel,.card,.modal-content { border-radius:14px; }
    .btn:not(.btn-sm),button:not(.btn-sm):not(.erp-profile__button):not(.chat-icon-btn):not(.chat-send) { min-height:44px; }
    .form-control,.form-select { min-height:44px; }
    textarea.form-control { min-height:92px; }
    .row { --bs-gutter-x:14px; --bs-gutter-y:14px; }
    .table-responsive { max-width:100%; overflow-x:auto; border-radius:10px; -webkit-overflow-scrolling:touch; }
    .modal-dialog { display:flex; min-height:calc(100dvh - 12px); align-items:flex-end; margin:6px; }
    .modal-content { max-height:calc(100dvh - 12px); overflow:auto; border-radius:18px 18px 12px 12px; }
    .dropdown-menu { border-radius:13px; box-shadow:0 18px 60px rgba(0,0,0,.55); }

    .mobile-tabbar { position:fixed; right:8px; bottom:calc(8px + env(safe-area-inset-bottom)); left:8px; z-index:1070; display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); min-height:var(--mobile-nav-height); overflow:hidden; padding:6px; border:1px solid rgba(115,137,169,.3); border-radius:17px; background:rgba(12,16,22,.96); box-shadow:0 18px 55px rgba(0,0,0,.55); backdrop-filter:blur(22px); }
    .mobile-tabbar a,.mobile-tabbar button { display:flex; min-width:0; min-height:54px; align-items:center; justify-content:center; flex-direction:column; gap:4px; padding:5px 3px; border:0; border-radius:12px; color:#8794a7; background:transparent; font:750 .61rem/1 "Manrope",sans-serif; text-decoration:none; }
    .mobile-tabbar i { font-size:1.05rem; }
    .mobile-tabbar a.active,.mobile-tabbar button.active,.mobile-tabbar button[aria-expanded="true"] { color:#dce8ff; background:linear-gradient(145deg,rgba(47,107,255,.28),rgba(76,125,221,.12)); }

    .mobile-backdrop { position:fixed; inset:0; z-index:1076; display:block; background:rgba(0,0,0,.68); backdrop-filter:blur(4px); }
    .mobile-backdrop[hidden],.mobile-more-sheet[hidden] { display:none; }
    .mobile-more-sheet { position:fixed; right:8px; bottom:calc(8px + env(safe-area-inset-bottom)); left:8px; z-index:1077; display:block; max-height:calc(100dvh - 28px - env(safe-area-inset-top)); overflow-x:hidden; overflow-y:auto; overscroll-behavior:contain; touch-action:pan-y; -webkit-overflow-scrolling:touch; padding:10px 14px calc(16px + env(safe-area-inset-bottom)); border:1px solid #35404d; border-radius:22px; color:var(--erp-text); background:#11161d; box-shadow:0 30px 90px rgba(0,0,0,.7); animation:mobile-sheet-in .22s ease-out; }
    .mobile-more-sheet__head { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:8px 2px 14px; }
    .mobile-more-sheet__head strong { font-size:1.02rem; }
    .mobile-more-sheet__close { display:grid; width:40px; height:40px; place-items:center; border:1px solid var(--erp-border); border-radius:10px; color:var(--erp-text-secondary); background:rgba(255,255,255,.04); }
    .mobile-more-grid { display:grid; grid-template-columns:1fr 1fr; gap:9px; }
    .mobile-more-grid a,.mobile-more-grid button { display:flex; min-width:0; min-height:64px; align-items:center; gap:11px; padding:12px; border:1px solid var(--erp-border); border-radius:12px; color:var(--erp-text-secondary); background:rgba(255,255,255,.025); font:750 .75rem/1.25 "Manrope",sans-serif; text-align:left; text-decoration:none; }
    .mobile-more-grid a.active { color:#e5edff; border-color:rgba(66,119,220,.55); background:var(--erp-blue-soft); }
    .mobile-more-grid i { display:grid; flex:0 0 35px; width:35px; height:35px; place-items:center; border-radius:9px; color:#a9c7ff; background:rgba(47,107,255,.15); }
    .mobile-more-grid .native-tool[hidden] { display:none; }
    .mobile-more-grid form { display:contents; }
    body.mobile-sheet-open { overflow:hidden !important; touch-action:none; }

    .network-banner { position:fixed; top:calc(6px + env(safe-area-inset-top)); right:50%; z-index:1080; display:flex; min-height:36px; align-items:center; gap:7px; padding:7px 12px; border:1px solid rgba(242,193,78,.4); border-radius:999px; color:#f4d47c; background:#18150d; box-shadow:0 10px 30px rgba(0,0,0,.4); font-size:.65rem; font-weight:800; transform:translateX(50%); white-space:nowrap; }
    .network-banner[hidden] { display:none; }
    .offline-action,.app-update { position:fixed; right:12px; bottom:calc(var(--mobile-nav-height) + 22px + env(safe-area-inset-bottom)); left:12px; z-index:1081; padding:12px 14px; border:1px solid rgba(126,171,255,.4); border-radius:12px; color:#e7efff; background:#17243a; box-shadow:0 18px 50px rgba(0,0,0,.45); font-size:.72rem; font-weight:750; text-align:center; }
    .offline-action[hidden],.app-update[hidden] { display:none; }
    .app-update { border:0; background:#2f6bff; }
    .is-offline img:not([src^="data:"]) { content-visibility:auto; }
    .chat-workspace:not(.chat-workspace--full) { bottom:calc(var(--mobile-nav-height) + 20px + env(safe-area-inset-bottom)); }
    .view-as-exit { bottom:calc(var(--mobile-nav-height) + 18px + env(safe-area-inset-bottom)); }
    @keyframes mobile-sheet-in { from { opacity:0; transform:translateY(24px) scale(.98); } to { opacity:1; transform:none; } }
}

.native-lock { position:fixed; inset:0; z-index:99999; display:grid; place-items:center; padding:24px; color:#eef4ff; background:#090c11; }
.native-lock[hidden] { display:none; }
.native-lock__card { width:min(360px,100%); padding:30px 22px; border:1px solid #303a48; border-radius:22px; background:#11161d; text-align:center; box-shadow:0 30px 90px rgba(0,0,0,.7); }
.native-lock__card i { display:grid; width:68px; height:68px; margin:0 auto 18px; place-items:center; border-radius:20px; color:#a9c7ff; background:rgba(47,107,255,.16); font-size:2rem; }
.native-lock__card button { margin-top:18px; padding:11px 18px; border:0; border-radius:10px; color:#fff; background:#3976f6; font-weight:800; }
.native-toast { position:fixed; right:16px; bottom:calc(86px + env(safe-area-inset-bottom)); left:16px; z-index:100000; max-width:430px; margin:auto; padding:13px 16px; border:1px solid #35404d; border-radius:12px; color:#eef4ff; background:#151b23; box-shadow:0 18px 50px rgba(0,0,0,.55); font:700 .82rem/1.4 "Manrope",sans-serif; animation:mobile-sheet-in .2s ease-out; }
.native-camera-trigger { margin-left:8px; border:1px solid var(--erp-border); border-radius:8px; color:#a9c7ff; background:rgba(47,107,255,.12); }
.is-native-app a[href*="/export/pdf"][aria-busy="true"] { pointer-events:none; opacity:.72; }

@media (min-width:761px) {
    .network-banner:not([hidden]) { position:fixed; right:20px; bottom:20px; z-index:1080; display:flex; padding:10px 14px; border:1px solid rgba(242,193,78,.4); border-radius:10px; color:#f4d47c; background:#18150d; }
}
