/* Keep the desktop theme; adapt existing layouts to phones and installed windows. */
[data-pwa-install][hidden]{display:none!important}
button.pwa-install-button{display:flex;align-items:center;justify-content:center;gap:8px;min-height:44px;padding:10px 16px;border:1px solid #cbd5e1;border-radius:8px;font:inherit;font-size:.85rem;font-weight:600;background:#fff;color:#0b427b;cursor:pointer}
.sidebar .pwa-install-button,.sidebar-super .pwa-install-button{margin:0 16px 16px;width:calc(100% - 32px);flex-shrink:0}
.login-footer .pwa-install-button{margin:12px auto 0;width:100%}
.pwa-install-dialog{margin:auto;max-width:440px;width:calc(100% - 32px);padding:24px;border:1px solid #e2e8f0;border-radius:16px;background:#fff;color:#0a2540;font-family:Inter,system-ui,sans-serif}
.pwa-install-dialog::backdrop{background:rgba(10,37,64,.55)}
.pwa-install-dialog h2{font-size:1.2rem;margin:0 0 12px}
.pwa-install-dialog p{line-height:1.7;margin:0 0 20px}
.pwa-install-dialog button{min-height:44px;padding:10px 18px;background:#0b427b;color:#fff;border:0;border-radius:8px;font:inherit;cursor:pointer}
@media screen and (max-width:900px){
 body:has(#appSidebar){height:100dvh}
 .main-wrapper{min-height:0!important;height:100%;min-width:0}
 main,.main-content,.content{min-width:0;max-width:100%}
 .sidebar,.sidebar-super{padding-bottom:env(safe-area-inset-bottom,0px)}
 .sidebar-nav,.sidebar-super-nav{overscroll-behavior:contain}
 .sidebar-footer,.sidebar-super-footer{padding:16px!important}
 /* Import and quality pages have no top-header; reserve room for the menu button. */
 body>main:not(.main-content){padding:80px 16px 24px!important}
 .import-card,.quality-card{padding:16px!important;min-width:0}
 .import-grid,.quality-filters{align-items:stretch}
 .import-field,.quality-filters label{width:100%;min-width:0}
 .import-field input,.import-field select,.quality-filters input,.quality-filters select{width:100%;max-width:100%;min-width:0}
 .import-card input[type=file]{max-width:100%;white-space:normal}
 .import-card select[name=placement]{width:100%;min-width:0}
 .import-card label.check{display:flex;align-items:flex-start;gap:10px;line-height:1.6}
 .import-card label.check input{flex-shrink:0;margin-top:4px}
 .table-responsive,.table-wrap{max-width:100%;overflow-x:auto}
 .table-responsive>table,.table-wrap>table{min-width:680px}
 .stats-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
 .stat-card,.card-container,.card{min-width:0}
 .charts-row-2,.charts-row-3,.charts-grid{grid-template-columns:minmax(0,1fr)!important}
 .card-header,.table-title{gap:12px;flex-wrap:wrap}
 .pagination-container{padding-left:16px!important;padding-right:16px!important;gap:16px}
 .pagination-nav{max-width:100%;row-gap:20px!important}
 .page-link{display:inline-flex;align-items:center;justify-content:center;min-height:44px;padding:8px 12px}
 input:not([type=checkbox]):not([type=radio]):not([type=hidden]),select,textarea{font-size:16px!important;min-height:44px}
 .form-control,.form-group,.form-group-modal{min-width:0;max-width:100%}
 .modal-overlay{padding:12px;padding-bottom:max(12px,env(safe-area-inset-bottom,0px))}
 .modal-container{max-height:calc(100dvh - 24px)!important;min-height:0}
 .modal-body{overscroll-behavior:contain}
 .modal-footer{padding-bottom:max(12px,env(safe-area-inset-bottom,0px))!important}
 .confirm-actions{flex-wrap:wrap}
 .confirm-actions button{min-height:44px}
 .login-wrapper{min-width:0}
 .login-header{padding:28px 20px}
 .login-body{padding:24px 20px}
 .login-footer{padding:18px 20px}
}
@media screen and (max-width:480px){
 .stats-grid{grid-template-columns:minmax(0,1fr)!important}
 .stat-value{font-size:1.8rem!important}
 .content-wrapper{padding:12px!important}
 .top-header{padding-right:12px!important}
 .card-container{padding:16px!important}
 .quality-stats{grid-template-columns:repeat(2,minmax(0,1fr))}
 .form-grid{grid-template-columns:minmax(0,1fr)!important}
 .confirm-actions button{flex:1 1 120px}
 .avatar-preview-wrapper+div{min-width:0}
}
@media print{[data-pwa-install],.pwa-install-dialog{display:none!important}}
@media screen and (max-width:900px) and (pointer:coarse){
 .btn-aksi,.btn-edit,.btn-delete,.btn-reset,.quick-btn,.btn-add,.btn-tambah,.quality-action,.rack-link{min-height:44px;display:inline-flex;align-items:center;justify-content:center}
}
