/* ================================================================
   PHOENIX UI 2.1.0
   Optimisation globale de la largeur et suppression des scrollbars
   horizontales inutiles.
   ================================================================ */

:root{
  --phoenix-content-gap:clamp(14px,1.35vw,26px);
  --phoenix-wide-drawer:min(1180px,96vw);
  --phoenix-extra-wide-drawer:min(1380px,97vw)
}

/* Évite que les enfants Grid/Flex forcent la page à dépasser l’écran. */
html,
body{
  max-width:100%;
  overflow-x:hidden
}

.os-shell,
.os-main,
.media-app,
.ticket-app,
.rh-app{
  min-width:0
}

.os-main{
  width:auto;
  max-width:none;
  padding-left:var(--phoenix-content-gap);
  padding-right:var(--phoenix-content-gap);
  overflow-x:hidden
}

.os-topbar,
.card,
.ticket-toolbar,
.rh-toolbar,
.media-toolbar{
  min-width:0;
  max-width:100%
}

/* Les formulaires peuvent revenir à la ligne au lieu d’élargir la page. */
.ticket-toolbar form,
.rh-toolbar form,
.media-toolbar nav{
  min-width:0;
  flex-wrap:wrap
}

.ticket-toolbar input,
.ticket-toolbar select,
.rh-toolbar input,
.rh-toolbar select{
  min-width:150px
}

/* ----------------------------------------------------------------
   RH Center
   ---------------------------------------------------------------- */

.rh-drawer{
  width:var(--phoenix-wide-drawer)!important;
  max-width:96vw!important
}

.rh-drawer-body{
  min-width:0;
  overflow-x:hidden
}

/* Les onglets utilisent plusieurs lignes : plus de barre gauche/droite. */
.rh-tabs{
  display:grid!important;
  grid-template-columns:repeat(auto-fit,minmax(125px,1fr));
  gap:6px;
  overflow-x:visible!important;
  overflow-y:visible!important;
  scrollbar-width:none
}

.rh-tabs::-webkit-scrollbar{
  display:none
}

.rh-tabs button{
  width:100%;
  min-width:0!important;
  justify-content:center;
  white-space:normal!important;
  text-align:center;
  line-height:1.25
}

.rh-tab-content,
.rh-section,
.rh-profile-banner,
.rh-inline-form,
.rh-form-grid,
.rh-details-grid{
  min-width:0;
  max-width:100%
}

.rh-form-grid,
.rh-details-grid,
.rh-inline-form .form-row{
  grid-template-columns:repeat(2,minmax(0,1fr))!important
}

.rh-form-grid>*,
.rh-details-grid>*,
.rh-inline-form .form-row>*{
  min-width:0
}

.rh-form-grid input,
.rh-form-grid select,
.rh-details-grid input,
.rh-details-grid select,
.rh-inline-form input,
.rh-inline-form select,
.rh-inline-form textarea{
  width:100%;
  min-width:0;
  box-sizing:border-box
}

.rh-document-status-grid{
  grid-template-columns:repeat(3,minmax(0,1fr))!important
}

.rh-document-card,
.rh-record-card,
.rh-document-upload{
  min-width:0;
  max-width:100%
}

.rh-document-card-body{
  min-width:0
}

.rh-document-card h4,
.rh-document-card p,
.rh-note-content{
  overflow-wrap:anywhere;
  word-break:break-word
}

/* Le coffre documentaire utilise mieux la largeur supplémentaire. */
@media(min-width:1100px){
  .rh-document-grid{
    grid-template-columns:repeat(2,minmax(0,1fr));
    align-items:start
  }

  .rh-document-upload .rh-form-grid{
    grid-template-columns:repeat(2,minmax(0,1fr))!important
  }
}

/* ----------------------------------------------------------------
   Ticket Center
   Le Kanban conserve son défilement interne lorsque cinq colonnes
   ne peuvent réellement pas tenir, sans faire dépasser toute la page.
   ---------------------------------------------------------------- */

.phoenix-kanban{
  max-width:100%;
  overscroll-behavior-inline:contain
}

.phoenix-column,
.phoenix-cards,
.phoenix-ticket{
  min-width:0
}

/* ----------------------------------------------------------------
   Studio Pro et Media Engine
   ---------------------------------------------------------------- */

.studio-shell,
.studio-main,
.rich-editor-shell,
.media-grid{
  min-width:0;
  max-width:100%
}

.rich-toolbar{
  flex-wrap:wrap;
  overflow-x:visible
}

/* ----------------------------------------------------------------
   Responsive
   ---------------------------------------------------------------- */

@media(max-width:900px){
  :root{
    --phoenix-wide-drawer:98vw;
    --phoenix-extra-wide-drawer:98vw
  }

  .os-main{
    padding-left:12px;
    padding-right:12px
  }

  .rh-tabs{
    grid-template-columns:repeat(2,minmax(0,1fr))
  }

  .rh-form-grid,
  .rh-details-grid,
  .rh-inline-form .form-row,
  .rh-document-status-grid{
    grid-template-columns:1fr!important
  }

  .rh-document-grid{
    grid-template-columns:1fr
  }
}

@media(max-width:520px){
  .rh-tabs{
    grid-template-columns:1fr
  }

  .rh-drawer{
    width:100vw!important;
    max-width:100vw!important
  }
}
