/* CEN V153.2 — correction structure responsive admin
   Supprime définitivement la largeur réservée à la sidebar sur petits écrans/tablettes
   et stabilise topbar + contenu sur toute la largeur. */

@media (max-width:1100px){
  html,body{width:100%!important;max-width:100%!important;overflow-x:hidden!important}
  body.admin-layout{
    width:100%!important;max-width:100%!important;margin:0!important;padding-left:0!important;padding-right:0!important;
    overflow-x:hidden!important;
  }
  body.admin-layout .app-shell{
    display:block!important;
    grid-template-columns:none!important;
    width:100%!important;max-width:100%!important;min-width:0!important;
    min-height:100dvh!important;
    margin:0!important;padding:0!important;padding-left:0!important;
    transform:none!important;
  }
  body.admin-layout .workspace{
    display:block!important;
    position:relative!important;
    width:100%!important;max-width:100%!important;min-width:0!important;
    margin:0!important;margin-left:0!important;
    padding-left:0!important;padding-right:0!important;
    transform:none!important;left:0!important;right:auto!important;
  }
  body.admin-layout .main-content.workspace-content,
  body.admin-layout .main-content{
    display:block!important;
    width:100%!important;max-width:100%!important;min-width:0!important;
    margin-left:0!important;margin-right:0!important;
    transform:none!important;left:0!important;right:auto!important;
    box-sizing:border-box!important;
  }

  /* Sidebar = tiroir superposé, jamais une colonne réservée */
  body.admin-layout #main-sidebar,
  body.admin-layout .side-dashboard{
    display:flex!important;
    position:fixed!important;
    top:0!important;bottom:0!important;left:0!important;right:auto!important;
    width:min(88vw,350px)!important;max-width:350px!important;min-width:0!important;
    height:100dvh!important;
    margin:0!important;
    z-index:17000!important;
    transform:translate3d(-105%,0,0)!important;
    transition:transform .2s ease!important;
    pointer-events:none!important;
  }
  body.admin-layout.side-open #main-sidebar,
  body.admin-layout.side-open .side-dashboard,
  body.admin-layout #main-sidebar.is-open{
    transform:translate3d(0,0,0)!important;
    pointer-events:auto!important;
  }

  /* Topbar indépendante du layout parent */
  body.admin-layout .workspace-topbar{
    position:fixed!important;
    top:0!important;left:0!important;right:0!important;
    width:100vw!important;max-width:100vw!important;
    margin:0!important;
    transform:none!important;
    box-sizing:border-box!important;
  }
  body.admin-layout .mobile-sidebar-toggle{
    display:grid!important;
    position:fixed!important;
    transform:none!important;
  }

  /* Dashboard : largeur réelle de l'écran */
  body.page-endpoint-dashboard .dashboard-welcome,
  body.page-endpoint-admin-dashboard .dashboard-welcome,
  body.page-endpoint-dashboard .dashboard-stat-section,
  body.page-endpoint-admin-dashboard .dashboard-stat-section,
  body.page-endpoint-dashboard .dashboard-analytics-section,
  body.page-endpoint-admin-dashboard .dashboard-analytics-section,
  body.page-endpoint-dashboard .communication-hub,
  body.page-endpoint-admin-dashboard .communication-hub{
    width:100%!important;max-width:100%!important;min-width:0!important;
    margin-left:0!important;margin-right:0!important;
    box-sizing:border-box!important;
  }
}

@media (min-width:761px) and (max-width:1100px){
  body.admin-layout{--cen1531-admin-topbar-h:72px!important;--cen148-admin-topbar-h:72px!important}
  body.admin-layout .workspace{padding-top:72px!important}
  body.admin-layout .workspace-topbar{
    height:72px!important;min-height:72px!important;max-height:72px!important;
    display:grid!important;
    grid-template-columns:minmax(120px,150px) minmax(0,1fr)!important;
    gap:10px!important;
    padding:8px 12px 8px 82px!important;
    overflow:hidden!important;
    background:linear-gradient(118deg,#063d6b 0%,#075f96 58%,#0b7eaa 100%)!important;
    border-bottom:4px solid #f4c62d!important;
    z-index:15000!important;
  }
  body.admin-layout .workspace-topbar .history-controls,
  body.admin-layout .workspace-topbar .workspace-welcome,
  body.admin-layout .workspace-topbar .global-search-form{display:none!important}
  body.admin-layout .workspace-topbar .workspace-language-wrap{display:flex!important;min-width:0!important;width:100%!important}
  body.admin-layout .workspace-topbar .language-select{width:100%!important;max-width:150px!important;min-height:44px!important}
  body.admin-layout .workspace-topbar .top-actions{display:flex!important;justify-content:flex-end!important;align-items:center!important;gap:6px!important;overflow:hidden!important}
  body.admin-layout .mobile-sidebar-toggle{top:8px!important;left:10px!important;width:58px!important;height:52px!important;z-index:15100!important}
  body.admin-layout .main-content.workspace-content{padding:12px 14px 78px!important}
  body.page-endpoint-dashboard .dashboard-seal,
  body.page-endpoint-admin-dashboard .dashboard-seal{display:none!important}
}

@media (max-width:760px){
  body.admin-layout .app-shell,
  body.admin-layout .workspace,
  body.admin-layout .main-content.workspace-content{
    width:100vw!important;max-width:100vw!important;min-width:0!important;
    margin-left:0!important;margin-right:0!important;padding-left:0!important;
  }
  body.admin-layout .main-content.workspace-content{padding:10px 10px 78px!important}
  body.page-endpoint-dashboard .dashboard-welcome,
  body.page-endpoint-admin-dashboard .dashboard-welcome{margin-top:0!important}
  body.page-endpoint-dashboard .kpi-grid,
  body.page-endpoint-admin-dashboard .kpi-grid,
  body.page-endpoint-dashboard .dashboard-static-charts-v683,
  body.page-endpoint-admin-dashboard .dashboard-static-charts-v683{
    grid-template-columns:1fr!important;
  }
  body .communique-ticker.enhanced-ticker{
    left:8px!important;right:8px!important;width:auto!important;
    height:40px!important;min-height:40px!important;max-height:40px!important;
  }
  body.has-communique-ticker{padding-bottom:62px!important}
}
