/* PBA Connect V2 - couche responsive commune Android / iOS / tablettes.
   Volontairement structurelle : les couleurs et l'identité visuelle restent celles de chaque module. */
*,*::before,*::after{box-sizing:border-box}
html{width:100%;max-width:100%;-webkit-text-size-adjust:100%;text-size-adjust:100%}
body{width:100%;max-width:100%;min-height:100vh;min-height:100dvh;margin:0;overflow-x:clip}
img,svg,video,canvas{max-width:100%;height:auto}
iframe,embed,object{max-width:100%}
main,.main,.content,.page-content,.container,.container-fluid,.wrapper,.wrap{max-width:100%}
.pba-table-scroll,.table-responsive,.dataTables_wrapper{max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}
.pba-table-scroll table{margin-bottom:0}

@supports (padding:env(safe-area-inset-left)){
  body{padding-left:env(safe-area-inset-left);padding-right:env(safe-area-inset-right)}
  .modal,.offcanvas{padding-bottom:env(safe-area-inset-bottom)}
}

@media (max-width:1199px){
  body{overflow-x:hidden}
  .row{max-width:100%;margin-left:0;margin-right:0}
  [class*="col-"]{min-width:0}
  .card,.panel,.box,.widget,.table-wrap,.form-card{max-width:100%}
  input,select,textarea,button,.btn{max-width:100%}
  input:not([type="checkbox"]):not([type="radio"]),select,textarea{font-size:16px}
  button,.btn,a.btn,input[type="submit"],input[type="button"]{min-height:42px}
  input,select,textarea{min-height:42px}
  textarea{min-height:96px}
  .modal-dialog{width:auto;max-width:min(94vw,720px);margin:calc(env(safe-area-inset-top,0px) + 12px) auto calc(env(safe-area-inset-bottom,0px) + 12px)}
  .modal-content{max-height:calc(100dvh - env(safe-area-inset-top,0px) - env(safe-area-inset-bottom,0px) - 24px);overflow:auto}
  .dropdown-menu{max-width:calc(100vw - 24px)}
  .pba-responsive-table{font-size:.92rem}
  .pba-table-scroll{width:100%}
  pre,code{white-space:pre-wrap;overflow-wrap:anywhere}
  .btn-group,.d-flex{min-width:0}
}

@media (max-width:767px){
  .container,.container-fluid,.wrapper,.wrap,main,.main,.content,.page-content{padding-left:max(10px,env(safe-area-inset-left));padding-right:max(10px,env(safe-area-inset-right))}
  h1{font-size:clamp(1.35rem,6vw,1.9rem)}
  h2{font-size:clamp(1.15rem,5vw,1.55rem)}
  .btn-group:not(.pba-keep-inline){display:flex;flex-wrap:wrap;gap:6px}
  .btn-group:not(.pba-keep-inline)>.btn{flex:1 1 auto;border-radius:.375rem!important}
}

/* iOS/iPadOS : empêche le zoom automatique des champs et respecte la zone sûre. */
html.pba-ios input,html.pba-ios select,html.pba-ios textarea,
html.pba-ios-app input,html.pba-ios-app select,html.pba-ios-app textarea{font-size:16px!important}
html.pba-ios body,html.pba-ios-app body{-webkit-overflow-scrolling:touch}

/* Les tableaux très larges restent utilisables sans agrandir toute la page. */
@media (max-width:1199px){
  table.pba-cols-7-8,table.pba-cols-9-10,table.pba-cols-11-plus{min-width:760px}
  table.pba-cols-5-6{min-width:620px}
}
