/* ==========================================================
   ComptaAsso — Overrides d'intégration WordPress
   ========================================================== */

/* 1. Body */
body.compta-page {
  display: block !important;
  overflow: hidden !important;
  background: var(--bg) !important;
}

/* 2. L'app est sortie du flux WP et fixée directement dans le viewport.
      Plus aucune dépendance aux conteneurs intermédiaires du thème. */
body.compta-page #comptabilite-app {
  position: fixed !important;
  top: var(--wp-header-h, 62px) !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  display: flex !important;
  overflow: hidden !important;
  z-index: 200 !important;
  width: 100% !important;
}

/* 3. Sidebar dans le flux flex du wrapper */
body.compta-page #sidebar {
  position: relative !important;
  top: auto !important;
  left: auto !important;
  height: 100% !important;
  min-height: unset !important;
  overflow-y: auto !important;
  flex-shrink: 0 !important;
}

/* 4. Main */
body.compta-page #main {
  margin-left: 0 !important;
  flex: 1 !important;
  height: 100% !important;
  overflow-y: auto !important;
  min-width: 0 !important;
}

/* 5. Topbar sticky dans #main */
body.compta-page #topbar {
  position: sticky !important;
  top: 0 !important;
  z-index: 50 !important;
}

/* 6. Modales — positionnées dans #comptabilite-app (déjà fixé sous le header) */
body.compta-page .modal-overlay {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  z-index: 9999 !important;
  overflow-y: auto !important;
  align-items: flex-start !important;
  padding-top: 40px !important;
  padding-bottom: 40px !important;
}

/* 7. Toasts */
body.compta-page #toast-container {
  position: fixed !important;
  bottom: 24px !important;
  right: 24px !important;
  z-index: 10000 !important;
}

/* 8. Masquer les éléments WP inutiles */
body.compta-page .entry-header,
body.compta-page .entry-content,
body.compta-page .entry-footer,
body.compta-page .site-footer,
body.compta-page footer.site-footer,
body.compta-page #colophon {
  display: none !important;
}

/* 9. Page d'accès refusé */
.compta-access-denied {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 60vh !important;
  text-align: center !important;
  padding: 40px 20px !important;
  font-family: 'DM Sans', sans-serif !important;
}
.compta-access-denied .denied-icon { font-size: 4rem; margin-bottom: 20px; }
.compta-access-denied h2 { font-size: 1.8rem; font-weight: 700; margin-bottom: 12px; color: #1e2537; }
.compta-access-denied p { color: #525e82; font-size: 1rem; max-width: 480px; line-height: 1.6; margin-bottom: 32px; }
.compta-access-denied .btn-home {
  display: inline-block; background: #4f7cff; color: #fff !important;
  padding: 12px 28px; border-radius: 8px; text-decoration: none !important;
  font-weight: 600; font-size: .95rem; transition: background .2s !important;
}
.compta-access-denied .btn-home:hover { background: #3563e9; }
