/* =========================================================
   QUARZEO PILOT V10.4
   Correction largeur et architecture dashboard
   ========================================================= */

html.qz10-pilot-layout-fixed,
html.qz10-pilot-layout-fixed body {
  overflow-x: hidden;
}

html.qz10-pilot-layout-fixed #qz10PilotDashboardHost {
  display: block;
  width: 100%;
  min-width: 0;
  max-width: none;
  margin: 18px 0 0;
  padding: 0;
  clear: both;
}

html.qz10-pilot-layout-fixed #qz10DashboardZone {
  display: block !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
  float: none !important;
  position: relative !important;
  inset: auto !important;
  transform: none !important;
}

html.qz10-pilot-layout-fixed #qz10DashboardZone .qz10-section-heading {
  width: 100%;
  max-width: none;
}

html.qz10-pilot-layout-fixed #qz10DashboardZone .qz10-action-grid {
  display: grid !important;
  width: 100% !important;
  min-width: 0 !important;
  grid-template-columns: repeat(5, minmax(170px, 1fr)) !important;
  gap: 14px !important;
  align-items: stretch !important;
}

html.qz10-pilot-layout-fixed #qz10DashboardZone .qz10-action-card {
  display: flex !important;
  flex-direction: column !important;
  width: auto !important;
  min-width: 0 !important;
  max-width: none !important;
  min-height: 164px !important;
  padding: 18px !important;
  overflow: hidden !important;
  word-break: normal !important;
  overflow-wrap: normal !important;
  white-space: normal !important;
}

html.qz10-pilot-layout-fixed #qz10DashboardZone .qz10-action-card h3 {
  width: 100% !important;
  margin-top: 16px !important;
  font-size: 15px !important;
  line-height: 1.2 !important;
  word-break: normal !important;
  overflow-wrap: normal !important;
}

html.qz10-pilot-layout-fixed #qz10DashboardZone .qz10-action-card p {
  width: 100% !important;
  max-width: none !important;
  flex: 1 1 auto;
  font-size: 11px !important;
  line-height: 1.48 !important;
  word-break: normal !important;
  overflow-wrap: normal !important;
  hyphens: none !important;
}

html.qz10-pilot-layout-fixed #qz10DashboardZone .qz10-card-link {
  margin-top: 14px !important;
}

html.qz10-pilot-layout-fixed #qz10DashboardZone .qz10-dashboard-columns {
  display: grid !important;
  width: 100% !important;
  min-width: 0 !important;
  grid-template-columns:
    minmax(0, 1.35fr)
    minmax(300px, .65fr) !important;
  gap: 14px !important;
}

html.qz10-pilot-layout-fixed #qz10DashboardZone .qz10-dashboard-panel {
  width: auto !important;
  min-width: 0 !important;
  max-width: none !important;
}

html.qz10-pilot-layout-fixed #qz10DashboardZone .qz10-list-item {
  width: 100% !important;
  min-width: 0 !important;
}

html.qz10-pilot-layout-fixed #qz10DashboardZone .qz10-list-copy {
  min-width: 0;
}

html.qz10-pilot-layout-fixed #qz10DashboardZone .qz10-list-copy strong,
html.qz10-pilot-layout-fixed #qz10DashboardZone .qz10-list-copy span {
  word-break: normal !important;
  overflow-wrap: normal !important;
}

/* Évite qu’un ancien parent étroit impose sa largeur */

html.qz10-pilot-layout-fixed .qz9-main,
html.qz10-pilot-layout-fixed main,
html.qz10-pilot-layout-fixed .app-main,
html.qz10-pilot-layout-fixed #app {
  min-width: 0;
}

html.qz10-pilot-layout-fixed .qz9-main > #qz10PilotDashboardHost,
html.qz10-pilot-layout-fixed main > #qz10PilotDashboardHost {
  grid-column: 1 / -1 !important;
}

/* Le hero reste au-dessus, puis le dashboard complet */

html.qz10-pilot-layout-fixed .qz9-hero {
  width: 100% !important;
  max-width: none !important;
}

/* Barre ZÉO compacte et non bloquante */

html.qz10-pilot-layout-fixed .qz9-zeo-dock {
  z-index: 80 !important;
}

html.qz10-pilot-layout-fixed .qz9-zeo-dock:not(.open) .qz9-zeo-panel {
  pointer-events: none;
}

/* Responsive */

@media (max-width: 1500px) {
  html.qz10-pilot-layout-fixed #qz10DashboardZone .qz10-action-grid {
    grid-template-columns: repeat(3, minmax(190px, 1fr)) !important;
  }
}

@media (max-width: 1180px) {
  html.qz10-pilot-layout-fixed #qz10DashboardZone .qz10-action-grid {
    grid-template-columns: repeat(2, minmax(210px, 1fr)) !important;
  }

  html.qz10-pilot-layout-fixed #qz10DashboardZone .qz10-dashboard-columns {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 720px) {
  html.qz10-pilot-layout-fixed #qz10DashboardZone .qz10-action-grid {
    grid-template-columns: 1fr !important;
  }

  html.qz10-pilot-layout-fixed #qz10DashboardZone .qz10-action-card {
    min-height: 138px !important;
  }
}

/* =========================================================
   PILOT V10.5 — Dashboard uniquement après connexion
   ========================================================= */

html:not(.qz10-pilot-authenticated) #qz10PilotDashboardHost,
html:not(.qz10-pilot-authenticated) #qz10DashboardZone {
  display: none !important;
}

html.qz10-pilot-authenticated #qz10PilotDashboardHost {
  display: block !important;
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
}

html.qz10-pilot-authenticated #qz10DashboardZone {
  display: block !important;
}

.qz10-pilot-dashboard-host {
  grid-column: 1 / -1 !important;
  align-self: stretch;
}
