/* X3 Concept — interface Symfony
   Direction : admin monitoring pro (ardoise / teal), sans thème « IA générique ». */

:root {
  --x3-bg: #eef2f6;
  --x3-bg-accent: #e4ebf3;
  --x3-surface: #ffffff;
  --x3-ink: #15202b;
  --x3-muted: #5b6b7c;
  --x3-line: #d5dee8;
  --x3-brand: #0d6e6e;
  --x3-brand-dark: #0a5555;
  --x3-brand-soft: #d8efef;
  --x3-nav: #102a3c;
  --x3-nav-2: #16384f;
  --x3-ok: #1f7a4d;
  --x3-ko: #b42318;
  --x3-radius: 12px;
  --x3-shadow: 0 10px 30px rgba(16, 42, 60, 0.08);
  --x3-font: "Figtree", "Segoe UI", sans-serif;
  --x3-mono: "IBM Plex Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }

html, body {
  min-height: 100%;
}

body.app-body {
  margin: 0;
  font-family: var(--x3-font);
  color: var(--x3-ink);
  background:
    radial-gradient(1200px 500px at 10% -10%, #d9ecec 0%, transparent 55%),
    radial-gradient(900px 400px at 100% 0%, #d7e3f2 0%, transparent 50%),
    linear-gradient(180deg, var(--x3-bg) 0%, var(--x3-bg-accent) 100%);
  background-attachment: fixed;
}

code, pre, .font-mono {
  font-family: var(--x3-mono);
}

a { color: var(--x3-brand-dark); }
a:hover { color: var(--x3-brand); }

/* —— Top bar —— */
.app-topbar {
  /* Au-dessus du contenu (tableaux sticky, etc.) sinon les menus passent derrière */
  position: relative;
  z-index: 1100;
  background: linear-gradient(180deg, var(--x3-nav) 0%, var(--x3-nav-2) 100%);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  box-shadow: 0 8px 24px rgba(8, 24, 38, 0.28);
  padding: 0.55rem 0;
  margin-bottom: 1.5rem;
}

.app-topbar .navbar-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: #fff !important;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-size: 1.05rem;
}

.brand-mark {
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 8px;
  background: linear-gradient(145deg, #2bb5b5, #0d6e6e);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.25);
  display: inline-grid;
  place-items: center;
  font-size: 0.72rem;
  font-weight: 800;
  color: #fff;
}

.app-topbar .nav-link {
  color: rgba(255,255,255,0.72) !important;
  font-weight: 550;
  font-size: 0.92rem;
  padding: 0.45rem 0.75rem !important;
  border-radius: 8px;
  transition: background .15s ease, color .15s ease;
}

.app-topbar .nav-link:hover,
.app-topbar .nav-link.show,
.app-topbar .nav-item.active > .nav-link {
  color: #fff !important;
  background: rgba(255,255,255,0.1);
}

.app-topbar .dropdown-menu {
  z-index: 1100;
  border: 1px solid var(--x3-line);
  border-radius: 12px;
  box-shadow: var(--x3-shadow);
  padding: 0.45rem;
  min-width: 15rem;
  margin-top: 0.4rem !important;
}

.app-topbar .dropdown-header {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--x3-muted);
  font-weight: 700;
  padding: 0.45rem 0.75rem 0.25rem;
}

.app-topbar .dropdown-item {
  border-radius: 8px;
  padding: 0.55rem 0.75rem;
  font-size: 0.9rem;
  color: var(--x3-ink);
}

.app-topbar .dropdown-item:hover {
  background: var(--x3-brand-soft);
  color: var(--x3-brand-dark);
}

.app-topbar .dropdown-item small {
  color: var(--x3-muted);
  font-size: 0.75rem;
  margin-top: 0.1rem;
}

/* Descriptifs masqués par défaut (desktop + mobile) ; au survol souris seulement */
.app-topbar .dropdown-item small,
.app-nav-offcanvas .dropdown-item small {
  display: none;
}
@media (hover: hover) and (pointer: fine) {
  .app-topbar .dropdown-item:hover small,
  .app-topbar .dropdown-item:focus small,
  .app-topbar .dropdown-item:focus-visible small,
  .app-nav-offcanvas .dropdown-item:hover small,
  .app-nav-offcanvas .dropdown-item:focus small,
  .app-nav-offcanvas .dropdown-item:focus-visible small {
    display: block;
    margin-top: 0.2rem;
  }
}

.app-topbar .dropdown-divider {
  margin: 0.35rem 0.4rem;
  opacity: 0.5;
}

.app-shell-meta {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}
.app-shell-meta-offcanvas {
  flex-direction: column;
  align-items: stretch;
}
.app-shell-meta-offcanvas .folder-switch-btn,
.app-shell-meta-offcanvas .folder-switch-static {
  max-width: none;
  width: 100%;
  justify-content: flex-start;
}

/* Menu mobile : panneau sombre superposé (ne pousse pas le contenu) */
.app-nav-offcanvas {
  background: linear-gradient(180deg, var(--x3-nav) 0%, var(--x3-nav-2) 100%);
  color: #e8f1f7;
  max-width: min(20rem, 88vw);
  border-right: 1px solid rgba(255,255,255,0.08);
}
.app-nav-offcanvas .offcanvas-header {
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.app-nav-offcanvas .offcanvas-title {
  color: #fff;
  display: inline-flex;
  align-items: center;
  font-weight: 700;
}
.app-nav-offcanvas .nav-link {
  color: rgba(255,255,255,0.85) !important;
  border-radius: 8px;
  padding: 0.55rem 0.75rem !important;
}
.app-nav-offcanvas .nav-link:hover,
.app-nav-offcanvas .nav-item.active > .nav-link {
  color: #fff !important;
  background: rgba(255,255,255,0.1);
}
.app-nav-offcanvas .dropdown-menu {
  position: static !important;
  transform: none !important;
  float: none;
  width: 100%;
  margin: 0.25rem 0 0.5rem !important;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  box-shadow: none;
}
.app-nav-offcanvas .dropdown-item {
  color: #e8f1f7;
}
.app-nav-offcanvas .dropdown-item:hover {
  background: rgba(255,255,255,0.12);
  color: #fff;
}
.app-nav-offcanvas .dropdown-item small {
  color: rgba(232, 241, 247, 0.65);
}
.app-nav-offcanvas .dropdown-header {
  color: rgba(232, 241, 247, 0.55);
}
.app-nav-offcanvas .dropdown-divider {
  border-color: rgba(255,255,255,0.12);
}
.app-nav-offcanvas .folder-switch-menu {
  /* menu dossier dans l’offcanvas : rester lisible */
  color: var(--x3-ink);
}
.offcanvas-backdrop {
  z-index: 1090;
}
.app-nav-offcanvas {
  z-index: 1105;
}

.folder-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.14);
  color: #e8f1f7;
  border-radius: 999px;
  padding: 0.2rem 0.55rem 0.2rem 0.35rem;
  font-size: 0.78rem;
}

.folder-chip select {
  background: transparent;
  border: 0;
  color: #fff;
  font-size: 0.78rem;
  max-width: 150px;
  padding: 0;
  box-shadow: none !important;
}

.folder-chip select option {
  color: #15202b;
}

.folder-chip .dot {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: #3dcfb0;
  box-shadow: 0 0 0 3px rgba(61, 207, 176, 0.2);
}

/* Sélecteur dossier (navbar) — version design */
.folder-switch {
  position: relative;
}
.folder-switch-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  max-width: min(16rem, 46vw);
  padding: 0.28rem 0.65rem 0.28rem 0.45rem;
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255,255,255,0.12), rgba(255,255,255,0.06));
  color: #f3f8fb;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.folder-switch-btn:hover,
.folder-switch-btn[aria-expanded="true"] {
  background: linear-gradient(180deg, rgba(255,255,255,0.18), rgba(255,255,255,0.1));
  border-color: rgba(255,255,255,0.28);
  box-shadow: 0 0 0 3px rgba(43, 181, 181, 0.15);
}
.folder-switch-static {
  cursor: default;
}
.folder-switch-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  flex-shrink: 0;
  background: #3dcfb0;
  box-shadow: 0 0 0 3px rgba(61, 207, 176, 0.22);
}
.folder-switch-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
  line-height: 1.15;
}
.folder-switch-code {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.folder-switch-label {
  font-size: 0.65rem;
  color: rgba(232, 241, 247, 0.72);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.folder-switch-caret {
  width: 0.4rem;
  height: 0.4rem;
  margin-left: 0.1rem;
  border-right: 1.5px solid rgba(255,255,255,0.75);
  border-bottom: 1.5px solid rgba(255,255,255,0.75);
  transform: rotate(45deg) translateY(-1px);
  flex-shrink: 0;
  opacity: 0.85;
}
.folder-switch-menu {
  min-width: 15.5rem;
  max-width: min(20rem, 92vw);
  padding: 0.35rem;
  border: 0;
  border-radius: 14px;
  box-shadow: 0 18px 40px rgba(16, 42, 60, 0.22);
  overflow: hidden;
}
.folder-switch-menu-head {
  padding: 0.45rem 0.7rem 0.35rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #7b8ea0;
}
.folder-switch-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  text-align: left;
  border: 0;
  background: transparent;
  border-radius: 10px;
  padding: 0.55rem 0.65rem;
  color: #15202b;
  transition: background .12s ease;
}
.folder-switch-item:hover {
  background: #eef6f8;
}
.folder-switch-item.is-active {
  background: linear-gradient(135deg, #128f8f, #0d6e6e);
  color: #fff;
}
.folder-switch-item.is-active .folder-switch-item-label {
  color: rgba(255,255,255,0.78);
}
.folder-switch-item.is-active .folder-switch-item-dot {
  background: #9af0df;
  box-shadow: 0 0 0 3px rgba(154, 240, 223, 0.25);
}
.folder-switch-item-dot {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: #94a3b8;
  flex-shrink: 0;
}
.folder-switch-item-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
  line-height: 1.2;
}
.folder-switch-item-code {
  font-size: 0.86rem;
  font-weight: 700;
}
.folder-switch-item-label {
  font-size: 0.72rem;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.folder-switch-check {
  font-size: 0.85rem;
  font-weight: 700;
  opacity: 0.95;
}

.btn-logout {
  border: 1px solid rgba(255,255,255,0.28);
  color: #fff;
  background: transparent;
  border-radius: 8px;
  font-size: 0.8rem;
  padding: 0.28rem 0.7rem;
}

.btn-logout:hover {
  background: rgba(255,255,255,0.12);
  color: #fff;
  border-color: rgba(255,255,255,0.4);
}

.badge-auth {
  font-weight: 600;
  font-size: 0.72rem;
  border-radius: 999px;
  padding: 0.35em 0.7em;
}

/* —— Layout content —— */
.app-main {
  max-width: 1180px;
}

.page-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}

.page-hero h1 {
  font-size: 1.55rem;
  font-weight: 750;
  letter-spacing: -0.03em;
  margin: 0 0 0.25rem;
}

.page-hero .lede {
  color: var(--x3-muted);
  margin: 0;
  font-size: 0.95rem;
}

.surface {
  background: var(--x3-surface);
  border: 1px solid var(--x3-line);
  border-radius: var(--x3-radius);
  box-shadow: var(--x3-shadow);
}

.surface-pad {
  padding: 1.15rem 1.25rem;
}

/* Dashboard tiles */
.home-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 1rem;
}

.home-identity {
  grid-column: span 12;
}

.home-tile {
  grid-column: span 12;
  text-decoration: none;
  color: inherit;
  display: block;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}

@media (min-width: 768px) {
  .home-identity { grid-column: span 5; }
  .home-tile { grid-column: span 4; }
  .home-tile.wide { grid-column: span 6; }
}

.home-tile:hover {
  transform: translateY(-2px);
  border-color: #b7cfe0;
  box-shadow: 0 14px 34px rgba(16, 42, 60, 0.12);
  color: inherit;
}

.home-tile .tile-kicker {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--x3-brand);
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.home-tile h2 {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0 0 0.35rem;
}

.home-tile p {
  margin: 0;
  color: var(--x3-muted);
  font-size: 0.88rem;
  line-height: 1.4;
}

/* Tuile disponibilité (accueil) — couleurs bien visibles */
.home-tile-status {
  border: 1px solid transparent;
  border-left: 6px solid #94a3b8 !important;
  transition: background .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.home-tile-status .home-status-count {
  margin-top: 0.75rem;
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1;
}
.home-tile-status .home-status-line {
  min-height: 2.4em;
}
.home-tile-status.status-loading {
  border-left-color: #94a3b8 !important;
  background: #f8fafc !important;
  opacity: 0.9;
}
.home-tile-status.status-ok {
  border-left-color: #16a34a !important;
  border-color: #86efac !important;
  background: #dcfce7 !important;
}
.home-tile-status.status-ok .home-status-count { color: #15803d !important; }
.home-tile-status.status-ok .tile-kicker { color: #15803d !important; }
.home-tile-status.status-warn {
  border-left-color: #ea580c !important;
  border-color: #fdba74 !important;
  background: #ffedd5 !important;
}
.home-tile-status.status-warn .home-status-count { color: #c2410c !important; }
.home-tile-status.status-warn .tile-kicker { color: #c2410c !important; }
.home-tile-status.status-critical {
  border-left-color: #dc2626 !important;
  border-color: #fca5a5 !important;
  background: #fee2e2 !important;
}
.home-tile-status.status-critical .home-status-count { color: #b91c1c !important; }
.home-tile-status.status-critical .tile-kicker { color: #b91c1c !important; }

.home-badge-list {
  margin-top: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.home-badge-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 0.82rem;
  padding: 0.2rem 0;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
}
.home-badge-row span {
  color: var(--x3-muted);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.78rem;
}
.home-badge-row strong { font-weight: 700; }
.home-badge-row.level-ok strong { color: #15803d; }
.home-badge-row.level-warn strong { color: #c2410c; }
.home-badge-row.level-critical strong { color: #b91c1c; }

/* Cloche alertes (navbar) */
.nav-alerts { position: relative; }
.nav-alerts-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border: 0;
  border-radius: 999px;
  background: rgba(255,255,255,0.1);
  color: #fff;
  cursor: pointer;
}
.nav-alerts-btn:hover { background: rgba(255,255,255,0.18); }
.nav-alerts-icon { font-size: 1rem; line-height: 1; }
.nav-alerts-badge {
  position: absolute;
  top: -0.15rem;
  right: -0.15rem;
  min-width: 1.1rem;
  height: 1.1rem;
  padding: 0 0.25rem;
  border-radius: 999px;
  background: #dc2626;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.nav-alerts-menu {
  width: min(22rem, 92vw);
  max-height: min(70vh, 24rem);
  overflow: hidden;
  z-index: 1200;
}
.nav-alerts-list {
  max-height: min(50vh, 16rem);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}
.nav-alert-item {
  padding: 0.65rem 0.9rem;
  border-left: 4px solid #fb923c;
  border-bottom: 1px solid #eef2f6;
  cursor: pointer;
  background: #fff7ed;
}
.nav-alert-item.nav-alert-critical {
  border-left-color: #dc2626;
  background: #fef2f2;
}
.nav-alert-item.nav-alert-ok {
  border-left-color: #16a34a;
  background: #f0fdf4;
}
.nav-alert-item.is-read {
  background: #fff;
  opacity: 0.72;
}
.nav-alert-title { font-size: 0.82rem; font-weight: 700; }
.nav-alert-msg { font-size: 0.78rem; color: #475569; margin-top: 0.15rem; }
.nav-alert-meta { font-size: 0.7rem; color: #94a3b8; margin-top: 0.25rem; }

/* Mobile : panneau alertes lisible (plus de texte coupé dans le menu burger) */
@media (max-width: 991.98px) {
  .app-topbar-tools {
    position: relative;
    z-index: 1201;
  }
  .nav-alerts-menu {
    position: fixed !important;
    top: 3.6rem !important;
    left: 0.75rem !important;
    right: 0.75rem !important;
    width: auto !important;
    max-width: none !important;
    margin: 0 !important;
    transform: none !important;
  }
  .nav-alerts-head {
    flex-wrap: nowrap;
    gap: 0.75rem;
  }
  .nav-alerts-head .btn-link {
    font-size: 0.8rem;
  }
}

.section-label {
  grid-column: span 12;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--x3-muted);
  font-weight: 700;
  margin: 0.4rem 0 0;
}

/* Overlay chargement (connexions / badges) */
.x3-loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(16, 42, 60, 0.45);
  backdrop-filter: blur(2px);
}

.x3-loading-overlay[hidden] {
  display: none !important;
}

.x3-loading-box {
  background: #fff;
  border-radius: 14px;
  padding: 1.4rem 2rem;
  box-shadow: var(--x3-shadow);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--x3-ink);
  text-align: center;
  min-width: 14rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
}

.x3-loading-spinner {
  width: 2rem;
  height: 2rem;
  border: 3px solid #d5dee8;
  border-top-color: var(--x3-brand);
  border-radius: 50%;
  animation: x3-spin 0.75s linear infinite;
}

@keyframes x3-spin {
  to { transform: rotate(360deg); }
}

/* Multi-sélection types ADOTYP */
.x3-multiselect-toggle {
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background-image: none;
  padding-right: 2rem;
  position: relative;
}
.x3-multiselect-toggle::after {
  content: "";
  position: absolute;
  right: 0.75rem;
  top: 50%;
  width: 0.45rem;
  height: 0.45rem;
  border-right: 2px solid #6b7c8f;
  border-bottom: 2px solid #6b7c8f;
  transform: translateY(-60%) rotate(45deg);
}
.x3-multiselect-menu {
  min-width: 100%;
  max-width: 22rem;
  border-radius: 10px;
  border: 1px solid var(--x3-line);
}
.x3-multiselect-list {
  max-height: 240px;
  overflow-y: auto;
}
.x3-multiselect-item {
  display: flex;
  align-items: flex-start;
  gap: 0.15rem;
  white-space: normal;
  border-radius: 8px;
  cursor: pointer;
}
.x3-multiselect-item:hover,
.x3-multiselect-item:active {
  background: var(--x3-brand-soft);
  color: var(--x3-brand-dark);
}

.form-control, .form-select {
  border-color: #c9d5e2;
  border-radius: 10px;
}

.form-control:focus, .form-select:focus {
  border-color: #6db6b6;
  box-shadow: 0 0 0 0.2rem rgba(13, 110, 110, 0.15);
}

.btn-primary {
  --bs-btn-bg: var(--x3-brand);
  --bs-btn-border-color: var(--x3-brand);
  --bs-btn-hover-bg: var(--x3-brand-dark);
  --bs-btn-hover-border-color: var(--x3-brand-dark);
  --bs-btn-active-bg: var(--x3-brand-dark);
  --bs-btn-active-border-color: var(--x3-brand-dark);
  border-radius: 10px;
  font-weight: 600;
}

.btn-outline-secondary, .btn-outline-dark {
  border-radius: 10px;
}

.table > :not(caption) > * > * {
  vertical-align: middle;
}

/* En-têtes sticky : rester sous la barre de navigation (Bootstrap sticky-top = 1020) */
.table-responsive .sticky-top {
  z-index: 2;
}

.nav-tabs .nav-link {
  border-radius: 10px 10px 0 0;
  color: var(--x3-muted);
  font-weight: 600;
}

.nav-tabs .nav-link.active {
  color: var(--x3-brand-dark);
}

/* Login */
.login-shell {
  min-height: calc(100vh - 3rem);
  display: grid;
  place-items: center;
  padding: 2rem 0;
}

.login-card {
  width: min(720px, 100%);
}

.login-brand {
  text-align: center;
  margin-bottom: 1.5rem;
}

.login-brand .brand-mark {
  width: 2.4rem;
  height: 2.4rem;
  margin: 0 auto 0.75rem;
  font-size: 0.9rem;
}

.login-brand h1 {
  font-size: 1.7rem;
  font-weight: 750;
  letter-spacing: -0.03em;
  margin: 0 0 0.25rem;
}

/* Status badges on exploitation */
.badge.text-bg-success { background: var(--x3-ok) !important; }
.badge.text-bg-danger { background: var(--x3-ko) !important; }

.app-footer-note {
  color: var(--x3-muted);
  font-size: 0.78rem;
  text-align: center;
  margin-top: 2rem;
  padding-bottom: 1rem;
}

/*
 * Modales d’aperçu (traces / logs / batch) :
 * placées sous la barre de menu, sans la recouvrir.
 * La topbar reste au-dessus (z-index 1100).
 */
.modal {
  /* Bootstrap défaut 1055 < topbar 1100 → le menu reste visible */
  padding-top: 0 !important;
}
.modal-dialog:not(.modal-dialog-centered) {
  margin-top: 4.75rem; /* hauteur approx. de .app-topbar + marge */
  margin-bottom: 1rem;
  max-height: calc(100vh - 5.75rem);
}
.modal-dialog:not(.modal-dialog-centered) .modal-content {
  max-height: calc(100vh - 5.75rem);
}
.modal-dialog:not(.modal-dialog-centered).modal-dialog-scrollable .modal-body {
  max-height: calc(100vh - 5.75rem - 8rem); /* header + footer */
}

/* Droits d’accès — panneau latéral + cases groupées par serveur */
.access-side {
  overflow: hidden;
  padding: 0;
}

.access-side-head {
  padding: 0.85rem 1rem;
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--x3-muted);
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.access-side-list {
  max-height: min(28rem, 60vh);
  overflow: auto;
}

.access-side-item.active {
  background: rgba(13, 148, 136, 0.12);
  color: var(--x3-brand-dark);
  border-color: transparent;
}

.access-side-note {
  padding: 0.75rem 1rem;
  font-size: 0.8rem;
  color: var(--x3-muted);
  border-top: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(15, 23, 42, 0.02);
}

.access-server-block {
  padding: 0.85rem 0;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
}

.access-server-block:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.access-server-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.access-server-code {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--x3-brand-dark);
}

.access-check {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  height: 100%;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.access-check:hover {
  border-color: rgba(13, 148, 136, 0.45);
  background: rgba(13, 148, 136, 0.04);
}

.access-check input {
  margin-top: 0.2rem;
  flex-shrink: 0;
}

.access-check strong {
  display: block;
  font-size: 0.95rem;
}

.access-check small {
  display: block;
  color: var(--x3-muted);
  font-size: 0.78rem;
  margin-top: 0.1rem;
}
