/* Shared phone/tablet layout. Desktop rules and table semantics are preserved. */
.sidebar-backdrop[hidden],.mobile-table-hint[hidden]{display:none!important}
.sidebar-backdrop{display:none}
.mobile-table-hint{display:none}
.mobile-table-scroll{max-width:100%;min-width:0}
@media screen and (max-width:991.98px){
  body .app-shell{width:100%;min-height:100vh;min-height:100dvh}
  body .main-column{width:100%;min-width:0}
  body .sidebar{width:min(300px,calc(100vw - 44px));height:100vh;height:100dvh;z-index:1042;overscroll-behavior:contain;padding-bottom:env(safe-area-inset-bottom,0px);box-shadow:10px 0 32px #0f172a26;visibility:hidden}
  body .app-shell.sidebar-open .sidebar{visibility:visible}
  .sidebar-brand{padding-right:58px}
  #sidebarClose{position:absolute;right:10px;top:14px;color:#fff;border-color:#ffffff60;width:44px;height:44px}
  .sidebar-backdrop{position:fixed;inset:0;width:100%;height:100%;padding:0;border:0;background:#0f172a73;z-index:1041;touch-action:none}
  .sidebar-backdrop:not([hidden]){display:block}
  body.nav-mobile-open{overflow:hidden}
  body.nav-mobile-open .owl-widget{visibility:hidden;pointer-events:none}
  body .sidebar .nav-link{min-height:44px;line-height:1.45}
  body .sidebar .nav-link>span{min-width:0;overflow-wrap:anywhere}
  body .topbar{position:sticky;top:0;z-index:1020;gap:10px;padding:10px max(12px,env(safe-area-inset-right,0px)) 10px max(12px,env(safe-area-inset-left,0px));flex-wrap:wrap}
  .content .help-directory,.content .help-toc,.content .permission-users{top:calc(var(--mobile-header-height,64px) + 12px)}
  .content h1,.content h2,.content h3,.content input,.content select,.content textarea{scroll-margin-top:calc(var(--mobile-header-height,64px) + 12px)}
  .topbar-title{min-width:0;flex:1;overflow-wrap:anywhere}
  .topbar-tools,.topbar-user{flex-shrink:0}
  .topbar-user-name{display:inline-block;max-width:120px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;vertical-align:middle}
  body .content{padding:18px max(14px,env(safe-area-inset-right,0px)) 88px max(14px,env(safe-area-inset-left,0px));min-width:0}
  .content .row>[class*="col-"],.content .card,.content .card-body{min-width:0}
  .content .module-header>div{min-width:0;max-width:100%}
  .content .module-header h1{overflow-wrap:anywhere;line-height:1.4}
  .content .module-header p,.content .alert,.content dd{overflow-wrap:anywhere}
  .content .module-header>.d-flex,.content>.d-flex,.content form.d-flex,.content .card-footer.d-flex{flex-wrap:wrap}
  .content form.d-flex>.form-control,.content form.d-flex>.form-select{flex:1 1 160px;min-width:0}
  .content .module-header>.d-flex{gap:8px!important}
  .content .table-responsive,.content .help-table,.mobile-table-scroll{width:100%;max-width:100%;overflow-x:auto;overscroll-behavior-x:contain;-webkit-overflow-scrolling:touch}
  .content .table-responsive table:not(.att-table) th,.mobile-table-scroll table th{white-space:nowrap}
  .content .table-responsive table:not(.att-table) td,.mobile-table-scroll table td{min-width:80px;overflow-wrap:anywhere}
  .content .table-responsive td.num,.content .table-responsive td.text-end,.mobile-table-scroll td.num,.mobile-table-scroll td.text-end{white-space:nowrap;overflow-wrap:normal}
  .content .table .form-control,.content .table .form-select{min-width:100px}
  .mobile-table-hint[data-visible="true"]{display:flex;gap:6px;align-items:center;color:#64748b;font-size:.75rem;padding:8px 12px;margin:0;background:#f5f8fc;border-bottom:1px solid #e5eaf0}
  .content .table-responsive:focus-visible,.mobile-table-scroll:focus-visible{outline:2px solid #3b82f6;outline-offset:2px}
  .content .nav-pills,.content .nav-tabs{gap:4px;flex-wrap:wrap}
  .content .nav-link{min-height:40px;align-items:center;line-height:1.4}
  .entity-quick-dialog{max-height:calc(100dvh - 24px);max-width:calc(100vw - 24px)}
}
@media screen and (max-width:575.98px){
  body .content{padding:14px max(12px,env(safe-area-inset-right,0px)) 84px max(12px,env(safe-area-inset-left,0px));font-size:.9375rem}
  body .topbar{gap:8px}
  body .topbar-title{order:5;flex-basis:100%;font-size:.8rem;line-height:1.5;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
  .topbar-user-name{display:none}
  body .topbar .btn{min-height:44px;min-width:44px;padding:8px 10px}
  body .topbar .dropdown-menu{max-width:calc(100vw - 24px);overflow-wrap:anywhere}
  body .topbar .dropdown-item-text{white-space:normal}
  body .content .module-header{gap:12px;margin-bottom:16px!important}
  body .content .module-header h1{font-size:1.25rem;margin-bottom:6px}
  body .content .module-header>div+div{width:100%}
  body .content .card-body{padding:16px}
  body .content .btn,.entity-quick-dialog .btn{min-height:44px;white-space:normal;line-height:1.4;display:inline-flex;align-items:center;justify-content:center}
  body .content .btn.btn-link{min-height:36px}
  body .content .form-control,body .content .form-select,.entity-quick-dialog .form-control,.entity-quick-dialog .form-select,body.auth-body .form-control,body.auth-body .form-select{font-size:16px;min-height:44px;max-width:100%}
  body .content input[type="file"]{width:100%;min-width:0}
  body .content textarea.form-control{min-height:88px}
  body .content .input-group{min-width:0;flex-wrap:nowrap}
  body .content .input-group>.form-control{min-width:0;width:1%}
  body .content .form-check{min-height:44px;padding-top:6px;padding-bottom:6px}
  body .content .form-check-input{width:20px;height:20px;margin-top:2px}
  body .content .form-label{line-height:1.5}
  body .content .table{font-size:.875rem}
  body .content .table td,body .content .table th{padding:10px 9px;vertical-align:middle}
  body .content .att-table th,body .content .att-table td{padding:6px 4px}
  body .content .att-table .att-name{min-width:132px;max-width:160px;white-space:normal}
  body .content .att-table .att-editable{min-width:44px;height:44px}
  body .content .product-wizard-tab{padding:10px;min-height:56px}
  body .content .product-wizard-actions,body .content .permission-save{padding:12px;bottom:calc(8px + env(safe-area-inset-bottom,0px));gap:8px;flex-wrap:wrap}
  body .content .permission-save>.btn{flex:1}
  body .content .permission-group-heading{flex-wrap:wrap}
  body .content .screen-level{width:100%}
  body .content .owl-hero{gap:12px;align-items:flex-start}
  body .content .owl-hero>.flex-grow-1{min-width:0;overflow-wrap:anywhere}
  body .content .owl-hero .owl{width:64px;height:64px}
  body .content .product-card-image{height:150px}
  body .content .help-directory nav{max-height:200px}
  body .content .help-folder-children a,body .content .help-toc nav a{min-height:40px}
  body .content .help-article{padding:18px;font-size:.9375rem}
  body .content .help-reader-header h1{font-size:1.25rem}
  .entity-quick-dialog{padding:16px}
  .entity-quick-dialog .d-flex{flex-wrap:wrap}
  .entity-quick-dialog #entity-quick-title{font-size:1.1rem}
  .entity-select-actions{gap:12px!important;align-items:center}
  .entity-select-actions a,.entity-select-actions button{min-height:36px;display:inline-flex;align-items:center;font-size:.85rem}
  body .owl-widget{right:max(10px,env(safe-area-inset-right,0px));bottom:calc(var(--mobile-action-clearance,12px) + env(safe-area-inset-bottom,0px));max-width:calc(100vw - 20px)}
  body .owl-button{width:44px;height:44px}
  body .owl-panel,body .owl-bubble{width:min(340px,calc(100vw - 24px));max-height:60dvh}
  body.auth-body{min-height:100dvh;align-items:flex-start;padding:76px 12px 24px}
  .auth-body .auth-card>.card-body{padding:20px!important}
  .auth-body .btn{min-height:44px}
  .auth-body .auth-card a{min-height:36px;display:inline-flex;align-items:center}
  .auth-body .auth-lang{top:calc(12px + env(safe-area-inset-top,0px));right:max(12px,env(safe-area-inset-right,0px));z-index:10}
}
@media (prefers-reduced-motion:reduce){body .sidebar{transition:none}}
@media print{.sidebar-backdrop,.mobile-table-hint,#sidebarClose{display:none!important}.mobile-table-scroll{overflow:visible!important}.nav-mobile-open{overflow:visible!important}}
