/* ISFAD — responsive global (anti scroll horizontal + grilles flexibles) */

html {
  overflow-x: clip;
  max-width: 100%;
}

body {
  overflow-x: clip;
  max-width: 100%;
}

img,
video,
iframe,
svg,
canvas {
  max-width: 100%;
  height: auto;
}

/* Conteneurs flex/grid : évite le débordement horizontal (sans écraser max-width des pages centrées) */
.page-layout,
.page-body,
.page-wrap,
.main-area,
.main-content,
.main-wrap,
.content-grid,
.dept-grid,
.why-grid,
.settings-grid,
.fields-grid,
.hero-meta,
.card-actions,
.action-bar,
.toolbar,
.filter-row {
  min-width: 0;
}

/* Pages à colonne étroite centrée (gestionnaire devoir, etc.) */
.page-wrap--narrow {
  max-width: 780px !important;
  margin-left: auto !important;
  margin-right: auto !important;
  width: 100%;
}

/* Zone « aucun résultat » pour filtres / recherche */
.isfad-filter-empty {
  display: none;
  text-align: center;
  padding: 48px 20px;
  background: var(--white, #ffffff);
  border-radius: 16px;
  border: 1.5px dashed var(--border, #dde4ed);
  color: var(--text-muted, #6b7c93);
  margin-top: 12px;
}
.isfad-filter-empty.isfad-filter-empty--show {
  display: block;
}
.isfad-filter-empty i {
  font-size: 2.5rem;
  color: var(--border, #dde4ed);
  display: block;
  margin-bottom: 12px;
}
.isfad-filter-empty h3 {
  font-size: 1rem;
  color: var(--text, #1a2535);
  margin-bottom: 6px;
  font-weight: 700;
}
.isfad-filter-empty p {
  font-size: 0.875rem;
  line-height: 1.5;
}

/* Tables larges : scroll interne uniquement */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
}

/* Navbar fixe : espace sous la barre */
body.isfad-has-navbar {
  padding-top: 64px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* La navbar n'est pas affectée par les resets CSS des pages */
nav.isfad-navbar,
nav.isfad-navbar * {
  box-sizing: border-box;
}

/* ── Navbar : dropdown notifications mobile ── */
@media (max-width: 768px) {
  nav {
    padding-left: 12px !important;
    padding-right: 12px !important;
    gap: 8px !important;
    min-width: 0;
  }

  .nav-logo {
    min-width: 0;
  }

  .nav-right {
    min-width: 0;
    flex-shrink: 1;
    gap: 4px !important;
  }

  .notif-dropdown {
    position: fixed !important;
    top: 72px !important;
    left: 12px !important;
    right: 12px !important;
    width: auto !important;
    max-width: none !important;
    max-height: calc(100vh - 88px);
    display: flex;
    flex-direction: column;
  }

  .notif-dropdown.show {
    opacity: 1;
    transform: none !important;
    pointer-events: auto;
  }

  .notif-list {
    max-height: min(340px, calc(100vh - 160px)) !important;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .notif-dropdown-header {
    flex-shrink: 0;
  }

  .nav-lang-menu {
    right: 0;
    left: auto;
    max-width: calc(100vw - 24px);
  }
}

@media (max-width: 480px) {
  .nav-right .btn-nav span {
    display: none !important;
  }

  .nav-right > div[style*="width:1px"] {
    display: none !important;
  }
}

/* ── Page notifications détail ── */
.notif-page-layout {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 300px) minmax(0, 1fr);
  min-height: calc(100vh - 64px);
  max-width: 100%;
}

.notif-mobile-bar {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px;
  background: var(--white, #fff);
  border-bottom: 1.5px solid var(--border, #dde4ed);
  position: sticky;
  top: 64px;
  z-index: 150;
  max-width: 100%;
}

.notif-mobile-bar button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 10px;
  border: 1.5px solid var(--border, #dde4ed);
  background: var(--primary-light, #e8f0f7);
  color: var(--primary, #40739e);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}

.notif-sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 64px 0 0 0;
  background: rgba(15, 25, 35, 0.45);
  z-index: 400;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.notif-sidebar-backdrop.show {
  opacity: 1;
  pointer-events: auto;
}

@media (max-width: 992px) {
  .notif-page-layout {
    grid-template-columns: 1fr;
  }

  .notif-mobile-bar {
    display: flex;
  }

  .notif-sidebar {
    position: fixed !important;
    top: 64px !important;
    left: 0 !important;
    bottom: 0 !important;
    width: min(100%, 320px) !important;
    max-width: 100% !important;
    height: auto !important;
    z-index: 450 !important;
    transform: translateX(-105%);
    transition: transform 0.28s ease;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.18);
  }

  .notif-sidebar.open {
    transform: translateX(0);
    display: flex !important;
  }

  .notif-sidebar-backdrop {
    display: block;
  }

  .notif-page-main {
    padding: 16px !important;
    height: auto !important;
    min-height: calc(100vh - 64px - 52px);
    overflow-x: clip;
  }

  .notif-fab {
    display: none !important;
  }
}

/* Admin dashboard — dropdown notifications */
@media (max-width: 768px) {
  .dash-header .notif-dropdown {
    width: min(290px, calc(100% - 24px)) !important;
    max-width: calc(100% - 24px) !important;
  }
}

@media (max-width: 600px) {
  .notif-page-main {
    padding: 12px !important;
  }

  .notif-page-main .page-hero {
    flex-direction: column;
    padding: 18px 16px !important;
  }

  .notif-page-main .hero-title {
    font-size: 1.1rem !important;
    word-break: break-word;
  }

  .notif-page-main .notif-section {
    padding: 16px !important;
  }

  .notif-page-main .card-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .notif-page-main .btn-action {
    justify-content: center;
  }
}
