/* PORTFLOW AFRICA — adaptations responsive sans réécrire les exports HTML Stitch.
   La navigation bureau d'origine reste inchangée au-delà de 1023px. */
*,*::before,*::after{box-sizing:border-box}
img,svg,video,canvas{max-width:100%}
input,select,textarea,button{max-width:100%}
.pf-table-scroll{width:100%;max-width:100%;overflow-x:auto;overscroll-behavior-inline:contain;-webkit-overflow-scrolling:touch;scrollbar-width:thin}
.pf-table-scroll table{min-width:680px;max-width:none}
.pf-horizontal-nav{min-width:0;max-width:100%;overflow-x:auto!important;overscroll-behavior-inline:contain;-webkit-overflow-scrolling:touch;scrollbar-width:thin;white-space:nowrap}
.pf-horizontal-nav>a,.pf-horizontal-nav>button{flex-shrink:0!important}
.pf-mobilebar,.pf-mobile-backdrop{display:none}
@media(max-width:1023px){
  body.pf-has-shell{min-width:0!important;width:100%!important;max-width:100vw!important;height:100dvh!important;min-height:100dvh!important;overflow:hidden!important;padding-top:55px!important}
  body.pf-has-shell .pf-shell-aside{display:flex!important;position:fixed!important;inset:0 auto 0 0!important;width:min(290px,86vw)!important;min-width:0!important;max-width:min(290px,86vw)!important;height:100dvh!important;min-height:0!important;max-height:100dvh!important;overflow-y:auto!important;overscroll-behavior:contain!important;flex-shrink:0!important;transform:translateX(-105%);transition:transform .22s ease;z-index:10011!important;box-shadow:14px 0 45px #00122f18;pointer-events:none}
  body.pf-has-shell.pf-mobile-nav-open .pf-shell-aside{transform:translateX(0);pointer-events:auto}
  body.pf-has-shell .pf-app{width:100%;height:calc(100dvh - 55px);min-height:0!important;overflow:hidden;}
  body.pf-has-shell .pf-shell-content{min-width:0!important;width:100%!important;max-width:100%!important;flex:1 1 0%!important;overflow-x:hidden!important;}
  .pf-mobilebar{display:flex;position:fixed;inset:0 0 auto 0;height:55px;align-items:center;gap:12px;background:#fff;border-bottom:1px solid #e2eaf3;z-index:10009;padding:0 13px;box-shadow:0 2px 14px #0b2c4f12}
  .pf-mobile-menu{appearance:none;display:inline-flex;flex-shrink:0;align-items:center;justify-content:center;background:#edf5ff;color:#103966;border:1px solid #dbe8f8;width:37px;height:37px;border-radius:10px;cursor:pointer;touch-action:manipulation}
  .pf-mobile-menu svg{width:21px;height:21px;max-width:none}
  .pf-mobilebar-brand{display:flex;align-items:center;gap:9px;min-width:0;line-height:1.1;text-decoration:none;color:#0b2a4d;font:800 12px/1.2 Inter,Montserrat,Arial,sans-serif;letter-spacing:.1px}
  .pf-mobilebar-brand img{width:33px;height:33px;object-fit:contain;flex-shrink:0}
  .pf-mobilebar-brand b{color:#007eff}
  .pf-mobilebar-caption{font:600 10px/1.2 Inter,Arial;color:#7a92ad;margin-left:auto;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-align:right;max-width:31vw}
  .pf-mobile-backdrop{display:block;position:fixed;inset:0;background:rgba(1,17,39,.56);z-index:10010;opacity:0;visibility:hidden;transition:opacity .22s ease,visibility .22s ease;cursor:pointer}
  body.pf-mobile-nav-open .pf-mobile-backdrop{opacity:1;visibility:visible}
  .pf-main-header{min-width:0!important;max-width:100%!important;padding-left:14px!important;padding-right:14px!important;gap:9px!important;}
  .pf-main-header>div{min-width:0}
  .pf-main-header>div:first-child{flex:1 1 auto;min-width:0}
  .pf-main-header>div:first-child input{max-width:100%}
  .pf-main,.pf-has-shell main{min-width:0!important;max-width:100%!important;overflow-x:hidden!important;}
  .pf-has-shell main>section,.pf-has-shell main>div{max-width:100%;min-width:0}
  .pf-has-shell .pf-topbar{max-width:100%;}
  .pf-has-shell .pf-table-scroll table{min-width:680px}
  .pf-has-shell .pf-horizontal-nav{max-width:100%;overflow-x:auto!important}
  .pf-has-shell .pf-header-search{max-width:min(280px,33vw)!important;min-width:0!important;flex:1 1 auto!important}
  .pf-has-shell .pf-header-actions{gap:8px!important;flex:0 0 auto!important}
  .pf-has-shell .pf-header-actions>div{min-width:0}
  .pf-activity-flex{min-width:0!important;overflow-y:auto!important}
  .pf-activity-context{width:100%!important;min-width:0!important;max-height:300px!important;overflow-y:auto!important;flex-shrink:0!important;border-top:1px solid #e5eaf2;border-left:0!important}
  .pf-has-shell.pf-page-activites main{overflow-y:visible!important;flex-shrink:0!important;}
  .pf-activity-flex{display:flex!important;flex-direction:column!important}
  .pf-has-shell .pf-chat-layout{min-width:0!important;max-width:100%!important}
  .pf-has-shell .pf-chat-list,.pf-has-shell .pf-chat-content,.pf-has-shell .pf-chat-participants{min-width:0!important}
  .pf-has-shell .pf-chat-participants{display:none!important}
  .pf-has-shell .pf-dialog{max-height:calc(100dvh - 35px)}
}
@media(max-width:767px){
  .pf-has-shell .pf-main-header{height:52px!important;min-height:52px;}
  .pf-has-shell .pf-main-header .pf-header-search{max-width:min(180px,38vw)!important}
  .pf-has-shell .pf-main-header .pf-header-actions [class*="text-left"]{display:none!important}
  .pf-has-shell main{padding:14px!important;}
  .pf-has-shell .pf-main{padding:15px!important;}
  .pf-has-shell .pf-topbar{padding:0 14px!important}
  .pf-has-shell .pf-grid3{grid-template-columns:repeat(2,minmax(0,1fr))}
  .pf-has-shell :is(.grid.grid-cols-3,.grid.grid-cols-4){grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .pf-has-shell .pf-chat-layout{display:flex!important;flex-direction:column!important;overflow-y:auto!important;gap:10px!important;padding:10px!important;flex:1 1 auto!important;}
  .pf-has-shell .pf-chat-list{width:100%!important;height:183px!important;max-height:183px!important;flex:0 0 183px!important;overflow:hidden!important}
  .pf-has-shell .pf-chat-list>div:last-child{overflow-y:auto!important}
  .pf-has-shell .pf-chat-content{width:100%!important;flex:0 0 auto!important;height:clamp(380px,63dvh,660px)!important;min-height:380px!important;}
  .pf-has-shell .pf-chat-content [class*="max-w-[85%]"]{max-width:92%!important}
  .pf-has-shell .pf-document-row{flex-wrap:wrap;}
  .pf-has-shell .pf-activity-context{max-height:250px!important}
  .pf-has-shell .pf-btn-row{flex-wrap:wrap}
  .pf-has-shell .pf-progress{flex-wrap:wrap;}
  .pf-has-shell .pf-step{flex:1 1 130px!important}
  .pf-has-shell .pf-card{padding:16px}
  .pf-has-shell .pf-auth-page{display:block;min-height:100dvh!important}
  .pf-has-shell .pf-auth-brand{padding:16px}
  .pf-has-shell .pf-auth-brand h1{margin:4px 0!important}
  .pf-has-shell .pf-auth-right{padding:14px!important}
  .pf-has-shell .pf-auth-box{padding:18px!important}
  .pf-has-shell .pf-section-title{font-size:20px!important}
  .pf-has-shell .pf-horizontal-nav{padding-bottom:2px}
  .pf-has-shell .pf-main-header .pf-header-actions>div:first-child:not(:last-child){display:none!important}
  .pf-has-shell .pf-dialog{padding:18px}
}
@media(max-width:520px){
  .pf-has-shell main{padding:12px!important}
  .pf-has-shell .pf-main{padding:13px!important}
  .pf-has-shell .pf-main-header{padding:0 12px!important}
  .pf-has-shell :is(.grid.grid-cols-2,.grid.grid-cols-3,.grid.grid-cols-4,.pf-grid2,.pf-grid3){grid-template-columns:repeat(1,minmax(0,1fr))!important}
  /* Les cartes de statistiques restent compactes tout en conservant leur contenu. */
  .pf-has-shell .pf-kpi-grid{grid-template-columns:repeat(1,minmax(0,1fr))!important;gap:10px!important}
  .pf-has-shell .pf-kpi-grid>div{width:100%;min-width:0;}
  .pf-has-shell .pf-header-search{display:none!important}
  .pf-has-shell .pf-main-header .pf-header-actions{margin-left:auto}
  .pf-has-shell .pf-main-header [class*="gap-5"]{gap:8px!important}
  .pf-has-shell .pf-header-actions>button:nth-child(n+3){display:none}
  .pf-has-shell .pf-table-scroll table{min-width:650px}
  .pf-has-shell .pf-chat-content{height:65dvh!important}
  .pf-has-shell .pf-chat-layout .pf-chat-content .p-5{padding:12px!important}
  .pf-has-shell .pf-chat-list{height:165px!important;max-height:165px!important;flex-basis:165px!important}
  .pf-has-shell .pf-btn-row>*{max-width:100%}
  .pf-has-shell .pf-section-title{font-size:19px!important}
  .pf-mobilebar-caption{max-width:25vw}
  .pf-visual-modal{padding:10px}
  .pf-dialog{max-height:calc(100dvh - 25px);padding:17px}
  .pf-auth-page .pf-auth-brand{padding:16px!important}
  .pf-auth-page .pf-auth-brand h1{font-size:19px!important}
  .pf-auth-page .pf-auth-box{padding:18px!important}
  /* Stitch Connexion : le formulaire doit être accessible rapidement, sans 900px de visuel avant. */
  body.pf-page-connexion>div>section:first-of-type{min-height:auto!important;padding:15px 18px 12px!important;justify-content:flex-start!important}
  body.pf-page-connexion>div>section:first-of-type>div:nth-child(n+2){display:none!important}
  body.pf-page-connexion>div>section:nth-of-type(2){min-height:auto!important;padding:12px 16px 25px!important}
  /* Modale Stitch plein écran utilisable au toucher. */
  body.pf-page-inviter-partenaire{overflow-y:auto!important}
  body.pf-page-inviter-partenaire>div.fixed{padding:8px!important;align-items:flex-start!important;overflow-y:auto!important}
  body.pf-page-inviter-partenaire>div.fixed>div{max-height:calc(100dvh - 16px)!important;max-width:100%!important;width:100%!important;overflow-y:auto!important}
  body.pf-page-inviter-partenaire form{padding:14px!important}
  body.pf-page-inviter-partenaire form .grid{grid-template-columns:1fr!important}
  body.pf-page-inviter-partenaire form input,body.pf-page-inviter-partenaire form select{min-width:0!important;width:100%!important}
}
@media (prefers-reduced-motion:reduce){.pf-shell-aside,.pf-mobile-backdrop{transition:none!important}}
/* Derniers ajustements de lecture et de navigation sur les petites largeurs. */
@media(max-width:1023px){
 html{overflow-x:hidden}
 body.pf-has-shell .pf-app .pf-main-wrap{height:100%;min-height:0;max-height:100%;overflow-y:auto!important;overscroll-behavior-y:contain}
 body.pf-has-shell .pf-dossier-header{flex-wrap:wrap!important;gap:12px!important;align-items:flex-start!important}
 body.pf-has-shell .pf-dossier-buttons{flex-wrap:wrap!important;justify-content:flex-start!important;gap:8px!important}
}
@media(max-width:520px){
 body.pf-has-shell .pf-dossier-header{flex-direction:column!important;align-items:flex-start!important}
 body.pf-has-shell .pf-dossier-buttons{max-width:100%;width:100%;}
 body.pf-has-shell .pf-dossier-buttons :is(a,button){white-space:normal!important;min-width:0!important}
}
