/* =====================================================
   AGENTS PAGE — VERSION PREMIUM + AVATAR BUILDER
===================================================== */

/* =====================================================
   1. Variables
===================================================== */
:root {
  --agents-bg: #f3f6ff;
  --agents-bg-2: #eef2ff;
  --agents-surface: rgba(255, 255, 255, 0.72);
  --agents-surface-strong: rgba(255, 255, 255, 0.84);
  --agents-border: rgba(255, 255, 255, 0.52);

  --agents-text: #1a1f36;
  --agents-text-soft: #66708f;
  --agents-text-muted: #8891ad;

  --agents-primary: #4a6cf7;
  --agents-primary-dark: #2744b9;
  --agents-violet: #7c4dff;
  --agents-success: #22c55e;
  --agents-danger: #ef4444;

  --agents-shadow-lg: 0 30px 80px rgba(26, 31, 54, 0.10);
  --agents-shadow-md: 0 16px 40px rgba(38, 52, 104, 0.08);
  --agents-shadow-sm: 0 10px 24px rgba(38, 52, 104, 0.06);

  --agents-radius-xl: 30px;
  --agents-radius-lg: 24px;
  --agents-radius-md: 18px;
  --agents-radius-sm: 14px;

  --agents-blur: 20px;
  --agents-ease: cubic-bezier(.22, 1, .36, 1);
}

/* =====================================================
   2. Base page
===================================================== */
html,
body {
  min-height: 100%;
  padding-top: 70px;
}

body.agents-page {
  font-family: 'Poppins', sans-serif;
  color: var(--agents-text);
  background: linear-gradient(180deg, #f6f8ff 0%, #f3f6ff 48%, #edf2ff 100%);
  padding-top: 0;
}
body.create-agent-page {
  padding-top: 0;
}

/* =====================================================
   3. Navbar / Footer
===================================================== */
.navbar,
.navbar.nav-elegant,
.bg-dark.navbar {
  min-height: 70px !important;
  height: 70px !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  display: flex;
  align-items: center;
}

.bg-dark,
.nav-elegant {
  background: linear-gradient(180deg, rgba(24, 28, 47, 0.96), rgba(26, 31, 54, 0.94)) !important;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 6px 20px rgba(15, 22, 50, 0.16);
}

#nav-actions {
  align-items: center !important;
  height: 100%;
  min-height: 42px;
}

.navbar-brand {
  font-size: 1.5rem;
}

.btn-nav-icon {
  background: rgba(74, 108, 247, 0.12);
  color: #dfe6ff;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: none;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .18s, color .18s, transform .16s, box-shadow .16s;
  margin-top: 4px;
}

.btn-nav-icon:hover,
.btn-nav-icon:focus {
  background: linear-gradient(135deg, #4a6cf7, #7c4dff);
  color: #fff;
  transform: translateY(-2px) scale(1.08);
  box-shadow: 0 8px 22px rgba(74, 108, 247, 0.18);
}

.btn-nav-avatar {
  background: none;
  border: none;
  padding: 0 10px 0 0;
  border-radius: 20px;
  min-width: 0;
  font-size: 1rem;
  transition: background .16s;
}

.btn-nav-avatar:focus,
.btn-nav-avatar:hover {
  background: rgba(74, 108, 247, 0.11);
}

.avatar svg {
  display: block;
}

.footer {
  font-size: 0.9rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
  width: 100%;
}

.footer-link {
  color: rgba(255, 255, 255, 0.72) !important;
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer-link:hover {
  color: #ffffff !important;
  text-decoration: underline;
  filter: brightness(1.2);
}

/* =====================================================
   4. Layout général
===================================================== */
.agents-home {
  position: relative;
  overflow: clip;
  padding: 28px 0 56px;
}

.agents-home__bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.bg-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(55px);
  opacity: 0.52;
}

.bg-orb--one {
  width: 320px;
  height: 320px;
  top: -30px;
  left: -80px;
  background: rgba(74, 108, 247, 0.22);
}

.bg-orb--two {
  width: 300px;
  height: 300px;
  top: 180px;
  right: -80px;
  background: rgba(124, 77, 255, 0.18);
}

.bg-orb--three {
  width: 380px;
  height: 380px;
  bottom: 40px;
  left: 18%;
  background: rgba(99, 102, 241, 0.10);
}

.bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(104, 123, 191, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(104, 123, 191, 0.07) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(circle at center, rgba(0,0,0,0.85), transparent 88%);
  -webkit-mask-image: radial-gradient(circle at center, rgba(0,0,0,0.85), transparent 88%);
  opacity: 0.55;
}

/* =====================================================
   5. Effet glass / spotlight
===================================================== */
.glass-spotlight {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border: 1px solid var(--agents-border);
  background: linear-gradient(180deg, rgba(255,255,255,0.78), rgba(246,249,255,0.68));
  backdrop-filter: blur(var(--agents-blur));
  -webkit-backdrop-filter: blur(var(--agents-blur));
  box-shadow: var(--agents-shadow-lg);
}

.glass-spotlight::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(
      420px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
    rgba(74, 108, 247, 0.16),
      transparent 38%
    );
  pointer-events: none;
  z-index: 0;
  opacity: 0;
  transition: opacity .22s ease;
}

.glass-spotlight:hover::before {
  opacity: 1;
}

.glass-spotlight > * {
  position: relative;
  z-index: 1;
}

/* Variante pour les panneaux à contenu CROISSANT (ex. liste de prompts spécifiques) :
   on retire le backdrop-filter (très coûteux à recomposer au scroll quand le panneau
   devient grand -> lag) ainsi que l'overlay spotlight animé, et on opacifie le fond
   pour conserver la lisibilité. Bordure + ombre sont conservées. */
.glass-spotlight--solid {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  background: linear-gradient(180deg, rgba(255,255,255,0.97), rgba(246,249,255,0.95));
}
.glass-spotlight--solid::before {
  display: none;
}

/* =====================================================
   6. Toolbar / pilotage
===================================================== */
.agents-toolbar {
  border-radius: var(--agents-radius-xl);
  padding: 28px;
  margin-bottom: 26px;
}

.toolbar-kicker {
  display: inline-block;
  margin-bottom: 8px;
  color: var(--agents-primary);
  font-weight: 700;
  font-size: 0.88rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.agents-toolbar__title {
  margin: 0 0 8px;
  font-size: clamp(1.6rem, 2vw, 2.25rem);
  line-height: 1.1;
  font-weight: 700;
  color: var(--agents-text);
}

.agents-toolbar__description {
  margin: 0 0 20px;
  color: var(--agents-text-soft);
  line-height: 1.7;
}

.agents-toolbar__controls {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.agents-searchbox {
  position: relative;
  flex: 1 1 420px;
  min-width: 280px;
}

.agents-searchbox__icon {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: #7480a6;
  font-size: 1rem;
  pointer-events: none;
  z-index: 2;
}

.agents-searchbox__input {
  height: 58px;
  width: 100%;
  border-radius: 18px;
  border: 1px solid rgba(220, 228, 255, 0.95);
  background: rgba(255, 255, 255, 0.84);
  padding-left: 52px !important;
  padding-right: 18px !important;
  font-size: 1rem;
  color: var(--agents-text);
  box-shadow: 0 10px 24px rgba(37, 52, 103, 0.05);
}

.agents-searchbox__input::placeholder {
  color: #8690af;
}

.agents-searchbox__input:focus {
  border-color: rgba(74, 108, 247, 0.44);
  box-shadow: 0 0 0 0.25rem rgba(74, 108, 247, 0.10);
  background: rgba(255,255,255,0.94);
}

.agents-toolbar__meta {
  flex: 0 0 auto;
}

.meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255,255,255,0.72);
  color: #526084;
  border: 1px solid rgba(223, 230, 255, 0.95);
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
}

.meta-chip__separator {
  opacity: 0.5;
}

/* =====================================================
   7. Boutons premium
===================================================== */
.btn-create-agent,
.btn-agent-primary,
.btn-agent-secondary,
.btn-danger-soft {
  border: none;
  border-radius: 16px;
  padding: 12px 18px;
  font-weight: 600;
  font-size: 0.96rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  transition:
    transform .18s ease,
    box-shadow .18s ease,
    background .18s ease,
    color .18s ease,
    border-color .18s ease;
  text-decoration: none;
}

.btn-create-agent {
  color: #fff;
  background: linear-gradient(135deg, #4a6cf7 0%, #5f7cff 45%, #7c4dff 100%);
  box-shadow: 0 18px 34px rgba(74, 108, 247, 0.24);
  white-space: nowrap;
}

.btn-create-agent:hover,
.btn-create-agent:focus {
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 22px 40px rgba(74, 108, 247, 0.28);
}

.btn-agent-primary {
  color: #fff;
  background: linear-gradient(135deg, #4a6cf7 0%, #2744b9 100%);
  box-shadow: 0 14px 28px rgba(74, 108, 247, 0.18);
}

.btn-agent-primary:hover,
.btn-agent-primary:focus {
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 18px 34px rgba(74, 108, 247, 0.22);
}

.btn-agent-secondary {
  color: #34416f;
  background: rgba(255,255,255,0.72);
  border: 1px solid rgba(223, 230, 255, 0.95);
  box-shadow: 0 10px 22px rgba(39, 55, 110, 0.06);
}

.btn-agent-secondary:hover,
.btn-agent-secondary:focus {
  color: #1f2d5b;
  background: #fff;
  transform: translateY(-2px);
}

.btn-danger-soft {
  color: #fff;
  background: linear-gradient(135deg, #ef4444 0%, #d92f2f 100%);
  box-shadow: 0 14px 28px rgba(239, 68, 68, 0.18);
}

.btn-danger-soft:hover,
.btn-danger-soft:focus {
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 18px 34px rgba(239, 68, 68, 0.24);
}

/* =====================================================
   8. Cards agents
===================================================== */
.agents-grid-section {
  position: relative;
  padding-bottom: 8px;
}

.agent-card-col {
  opacity: 0;
  transform: translateY(28px) scale(0.985);
  animation: agentFadeUp 0.7s var(--agents-ease) forwards;
  animation-delay: calc(var(--stagger, 0) * 60ms);
}

@keyframes agentFadeUp {
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.agent-card-premium {
  height: 100%;
  display: flex;
  flex-direction: column;
  border-radius: 26px;
  padding: 20px;
  transition:
    transform .22s ease,
    box-shadow .22s ease,
    border-color .22s ease;
  box-shadow: var(--agents-shadow-md);
}

.agent-card-premium:hover {
  transform: translateY(-6px);
  box-shadow: 0 28px 60px rgba(47, 64, 126, 0.14);
}

.agent-card-premium__header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.agent-card-premium__identity {
  display: flex;
  gap: 14px;
  min-width: 0;
  flex: 1 1 auto;
  align-items: flex-start;
}

.agent-card-premium__avatar-wrap {
  position: relative;
  flex: 0 0 56px;
  width: 56px;
  height: 56px;
}

.agent-card-premium__avatar {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 18px;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 1.08rem;
  color: #fff;
  background: var(--avatar-gradient, linear-gradient(135deg, #4a6cf7 0%, #7c4dff 100%));
  box-shadow: var(--avatar-shadow, 0 14px 28px rgba(74, 108, 247, 0.20));
  border: 1px solid rgba(255, 255, 255, 0.22);
  overflow: hidden;
  transition:
    transform .24s ease,
    box-shadow .24s ease,
    filter .24s ease;
}

.agent-card-premium__avatar::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(145deg, rgba(255,255,255,0.28), transparent 54%),
    radial-gradient(circle at top left, rgba(255,255,255,0.18), transparent 48%);
  pointer-events: none;
}

.agent-card-premium__avatar::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(14, 21, 46, 0.18);
  opacity: 0;
  transition: opacity .24s ease;
  pointer-events: none;
}

.agent-card-premium__avatar-content {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  line-height: 1;
}

.agent-card-premium__avatar-content i {
  font-size: 1.2rem;
}

.agent-card-premium__avatar-edit {
  position: absolute;
  right: -6px;
  bottom: -6px;
  width: 32px;
  height: 32px;
  border: 1px solid rgba(221, 229, 255, 0.95);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.96);
  color: #314bbb;
  display: grid;
  place-items: center;
  box-shadow: 0 12px 24px rgba(41, 58, 119, 0.14);
  opacity: 0;
  transform: translateY(6px) scale(0.92);
  transition:
    opacity .22s ease,
    transform .22s ease,
    background .18s ease,
    color .18s ease,
    box-shadow .18s ease;
  z-index: 2;
}

.agent-card-premium__avatar-edit:hover,
.agent-card-premium__avatar-edit:focus {
  background: #fff;
  color: var(--agents-primary);
  box-shadow: 0 16px 28px rgba(41, 58, 119, 0.18);
}

.agent-card-premium__avatar-wrap:hover .agent-card-premium__avatar-edit,
.agent-card-premium__avatar-wrap:focus-within .agent-card-premium__avatar-edit {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.agent-card-premium__avatar-wrap:hover .agent-card-premium__avatar,
.agent-card-premium__avatar-wrap:focus-within .agent-card-premium__avatar {
  transform: scale(1.04);
  box-shadow: 0 18px 34px rgba(74, 108, 247, 0.24);
}

.agent-card-premium__avatar-wrap:hover .agent-card-premium__avatar::after,
.agent-card-premium__avatar-wrap:focus-within .agent-card-premium__avatar::after {
  opacity: 1;
}

.agent-card-premium__avatar-wrap.is-force-idle .agent-card-premium__avatar-edit {
  opacity: 0 !important;
  transform: translateY(6px) scale(0.92) !important;
  pointer-events: none;
}

.agent-card-premium__avatar-wrap.is-force-idle .agent-card-premium__avatar::after {
  opacity: 0 !important;
}

.agent-card-premium__avatar-wrap.is-force-idle .agent-card-premium__avatar {
  transform: none !important;
}

.agent-card-premium__avatar.is-updated {
  animation: avatarBounce .55s var(--agents-ease);
}

@keyframes avatarBounce {
  0% { transform: scale(1); }
  42% { transform: scale(1.09); }
  100% { transform: scale(1); }
}

.agent-card-premium__titles {
  min-width: 0;
  flex: 1 1 auto;
}

.agent-card-premium__title-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
}

.agent-card-premium__title {
  margin: 0;
  color: #1e2748;
  font-size: 1.12rem;
  font-weight: 700;
  line-height: 1.3;
  min-width: 0;
  flex: 1 1 auto;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}

.agent-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.10);
  color: #149647;
  border: 1px solid rgba(34, 197, 94, 0.12);
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
  flex: 0 0 auto;
  margin-top: 1px;
}

.agent-status-pill__dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: linear-gradient(135deg, #23c36e, #6de67b);
  box-shadow: 0 0 0 5px rgba(35, 195, 110, 0.10);
}

/* Clickable variant: lets the owner/editor toggle the status from the home page */
.agent-status-pill--toggle {
  cursor: pointer;
  transition: transform .15s ease, background .15s ease, border-color .15s ease, box-shadow .15s ease;
}

.agent-status-pill--toggle:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(35, 195, 110, 0.18);
}

.agent-status-pill--toggle:disabled {
  cursor: progress;
  opacity: 0.6;
}

/* Inactive state (grey) */
.agent-status-pill.is-inactive {
  background: rgba(120, 132, 158, 0.12);
  color: #5b6478;
  border-color: rgba(120, 132, 158, 0.18);
}

.agent-status-pill.is-inactive .agent-status-pill__dot {
  background: linear-gradient(135deg, #aeb6c7, #cdd3e0);
  box-shadow: 0 0 0 5px rgba(120, 132, 158, 0.10);
}

.agent-status-pill--toggle.is-inactive:hover {
  box-shadow: 0 6px 14px rgba(120, 132, 158, 0.18);
}

/* "Building" / en construction state (amber) */
.agent-status-pill.is-building {
  background: rgba(245, 158, 11, 0.13);
  color: #b4690e;
  border-color: rgba(245, 158, 11, 0.22);
}

.agent-status-pill.is-building .agent-status-pill__dot {
  background: linear-gradient(135deg, #f59e0b, #fbbf24);
  box-shadow: 0 0 0 5px rgba(245, 158, 11, 0.12);
}

.agent-status-pill--toggle.is-building:hover {
  box-shadow: 0 6px 14px rgba(245, 158, 11, 0.2);
}

.agent-card-premium__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.card-icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  border: 1px solid rgba(222, 229, 251, 0.95);
  background: rgba(255,255,255,0.80);
  color: #405082;
  display: grid;
  place-items: center;
  transition:
    transform .18s ease,
    background .18s ease,
    color .18s ease,
    box-shadow .18s ease,
    border-color .18s ease;
}

.card-icon-btn:hover,
.card-icon-btn:focus {
  background: #fff;
  color: var(--agents-primary);
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(52, 69, 129, 0.10);
}

.card-icon-btn--danger:hover,
.card-icon-btn--danger:focus {
  color: var(--agents-danger);
  border-color: rgba(239, 68, 68, 0.16);
  background: rgba(255, 240, 240, 0.9);
}

.card-icon-btn.is-disabled,
.card-icon-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

.agent-card-premium__description {
  margin: 0 0 18px;
  color: var(--agents-text-soft);
  line-height: 1.72;
  font-size: 0.96rem;
  flex: 1 1 auto;
  word-break: break-word;
}

.agent-card-premium__footer {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* =====================================================
   9. États vides
===================================================== */
.agents-empty-state,
.agents-search-empty {
  border-radius: 28px;
  padding: 34px 26px;
  text-align: center;
  max-width: 760px;
  margin: 0 auto;
}

.agents-empty-state__icon,
.agents-search-empty__icon {
  width: 82px;
  height: 82px;
  border-radius: 24px;
  margin: 0 auto 18px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 1.9rem;
  background: linear-gradient(135deg, #4a6cf7 0%, #7c4dff 100%);
  box-shadow: 0 16px 34px rgba(74, 108, 247, 0.22);
}

.agents-empty-state h3,
.agents-search-empty h3 {
  margin-bottom: 10px;
  color: var(--agents-text);
  font-weight: 700;
}

.agents-empty-state p,
.agents-search-empty p {
  margin-bottom: 20px;
  color: var(--agents-text-soft);
  line-height: 1.75;
}

/* =====================================================
   10. Modales premium
===================================================== */
.modal-glass-premium {
  border: 1px solid rgba(255,255,255,0.52);
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(255,255,255,0.86), rgba(246,249,255,0.78));
  box-shadow: 0 30px 80px rgba(26, 31, 54, 0.14);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  overflow: hidden;
}

.modal-header,
.modal-body,
.modal-footer {
  padding-left: 24px;
  padding-right: 24px;
}

.modal-title-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
}

.modal-hero-icon {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 1.1rem;
  background: linear-gradient(135deg, #4a6cf7 0%, #7c4dff 100%);
  box-shadow: 0 12px 24px rgba(74, 108, 247, 0.20);
}

.modal-hero-icon--danger {
  background: linear-gradient(135deg, #ef4444 0%, #d92f2f 100%);
  box-shadow: 0 12px 24px rgba(239, 68, 68, 0.20);
}

.modal-title {
  color: var(--agents-text);
  font-weight: 700;
}

.modal-subtitle {
  color: var(--agents-text-muted);
  font-size: 0.9rem;
  margin-top: 2px;
}

.modal-body-card {
  padding: 18px;
  border-radius: 20px;
  background: rgba(255,255,255,0.62);
  border: 1px solid rgba(224, 231, 255, 0.92);
  color: var(--agents-text);
}

/* =====================================================
   11. Modal partage
===================================================== */
.share-modal-intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.share-selected-count {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(74,108,247,0.10);
  color: #3553d8;
  font-size: 0.85rem;
  font-weight: 700;
}

.share-searchbox {
  position: relative;
}

.share-searchbox__icon {
  position: absolute;
  top: 50%;
  left: 16px;
  transform: translateY(-50%);
  color: #7480a6;
  pointer-events: none;
}

.share-searchbox .form-control {
  min-height: 52px;
  border-radius: 16px;
  padding-left: 46px;
  border: 1px solid rgba(220, 228, 255, 0.95);
  background: rgba(255,255,255,0.84);
  box-shadow: 0 10px 24px rgba(37, 52, 103, 0.05);
}

.share-searchbox .form-control:focus {
  border-color: rgba(74, 108, 247, 0.44);
  box-shadow: 0 0 0 0.25rem rgba(74, 108, 247, 0.10);
}

.share-list {
  display: grid;
  gap: 12px;
  max-height: 420px;
  overflow: auto;
  padding-right: 4px;
}

.share-list::-webkit-scrollbar {
  width: 8px;
}

.share-list::-webkit-scrollbar-thumb {
  background: rgba(141, 157, 207, 0.45);
  border-radius: 999px;
}

.share-list {
  display: grid;
  gap: 12px;
  max-height: 420px;
  overflow: auto;
  padding-right: 4px;
}

.share-list::-webkit-scrollbar {
  width: 8px;
}

.share-list::-webkit-scrollbar-thumb {
  background: rgba(141, 157, 207, 0.45);
  border-radius: 999px;
}

.share-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 14px 16px;
  border-radius: 20px;
  border: 1px solid rgba(224, 231, 255, 0.92);
  background: rgba(255,255,255,0.76);
  transition:
    transform .16s ease,
    border-color .16s ease,
    box-shadow .16s ease,
    background .16s ease;
}

.share-item:hover {
  transform: translateY(-2px);
  background: rgba(255,255,255,0.92);
  border-color: rgba(74, 108, 247, 0.18);
  box-shadow: 0 12px 24px rgba(39, 55, 110, 0.06);
}

.share-item.is-selected {
  border-color: rgba(74, 108, 247, 0.26);
  background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(246,249,255,0.92));
  box-shadow: 0 14px 28px rgba(74, 108, 247, 0.08);
}

.share-item.is-edit {
  border-color: rgba(124, 77, 255, 0.24);
  box-shadow: 0 16px 30px rgba(124, 77, 255, 0.10);
}

.share-item__main {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  width: 100%;
}

.share-item__checkbox {
  margin: 0;
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 7px;
  flex: 0 0 auto;
}

.share-item__checkbox:checked {
  background-color: var(--agents-primary);
  border-color: var(--agents-primary);
}

.share-item__identity {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  margin: 0;
  cursor: pointer;
  flex: 1 1 auto;
}

.avatar-badge {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  flex: 0 0 42px;
  color: #fff;
  font-weight: 700;
  background: linear-gradient(135deg, #4a6cf7 0%, #7c4dff 100%);
  box-shadow: 0 10px 20px rgba(74, 108, 247, 0.16);
}

.share-item__content {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.share-email {
  color: var(--agents-text);
  font-weight: 600;
  word-break: break-word;
}

.share-role {
  color: var(--agents-text-muted);
  font-size: 0.85rem;
  margin-top: 3px;
}

.share-item__permissions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px;
  border-radius: 16px;
  background: rgba(243, 247, 255, 0.92);
  border: 1px solid rgba(224, 231, 255, 0.92);
  flex: 0 0 auto;
  justify-self: end;
  justify-content: flex-end;
}

.share-permission-btn {
  border: none;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 12px;
  background: transparent;
  color: var(--agents-text-soft);
  font-size: 0.88rem;
  font-weight: 600;
  transition:
    transform .16s ease,
    background .16s ease,
    color .16s ease,
    box-shadow .16s ease;
}

.share-permission-btn:hover,
.share-permission-btn:focus {
  color: var(--agents-text);
  background: rgba(255,255,255,0.92);
}

.share-permission-btn[data-mode="read_only"].is-active {
  background: rgba(74, 108, 247, 0.12);
  color: #2f4fdb;
  box-shadow: inset 0 0 0 1px rgba(74, 108, 247, 0.14);
}

.share-permission-btn[data-mode="edit"].is-active {
  background: linear-gradient(135deg, #4a6cf7 0%, #7c4dff 100%);
  color: #fff;
  box-shadow: 0 10px 22px rgba(95, 92, 255, 0.22);
}

@media (max-width: 767px) {
  .share-item {
    display: flex;
    flex-direction: column;
    align-items: stretch;
  }

  .share-item__permissions {
    width: 100%;
    justify-self: stretch;
  }

  .share-permission-btn {
    flex: 1 1 0;
  }
}

/* =====================================================
   12. Modal avatar builder
===================================================== */
.avatar-modal .modal-body {
  padding-top: 8px;
}

.avatar-modal__top {
  margin-bottom: 22px;
}

.avatar-modal__preview-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 20px;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255,255,255,0.70), rgba(248,250,255,0.84));
  border: 1px solid rgba(224, 231, 255, 0.94);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.7);
}

.avatar-live-preview {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.avatar-live-preview__badge {
  position: relative;
  flex: 0 0 74px;
  width: 74px;
  height: 74px;
  border-radius: 24px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--avatar-gradient, linear-gradient(135deg, #4a6cf7 0%, #7c4dff 100%));
  box-shadow: var(--avatar-shadow, 0 18px 34px rgba(74, 108, 247, 0.22));
  border: 1px solid rgba(255,255,255,0.24);
  overflow: hidden;
}

.avatar-live-preview__badge::before,
.avatar-icon-option__badge::before,
.avatar-color-option__preview::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(145deg, rgba(255,255,255,0.28), transparent 54%),
    radial-gradient(circle at top left, rgba(255,255,255,0.18), transparent 48%);
  pointer-events: none;
}

.avatar-live-preview__content,
.avatar-icon-option__content {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  line-height: 1;
}

.avatar-live-preview__content i {
  font-size: 1.56rem;
}

.avatar-live-preview__eyebrow,
.avatar-builder__eyebrow {
  margin: 0 0 6px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--agents-primary);
}

.avatar-live-preview__name {
  margin: 0 0 4px;
  color: var(--agents-text);
  font-weight: 700;
  font-size: 1.08rem;
}

.avatar-live-preview__help {
  margin: 0;
  color: var(--agents-text-soft);
  line-height: 1.55;
}

.avatar-modal__hint {
  display: inline-flex;
  align-items: flex-start;
  gap: 12px;
  max-width: 360px;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(74, 108, 247, 0.08);
  border: 1px solid rgba(74, 108, 247, 0.14);
  color: #50608b;
  font-size: 0.9rem;
  line-height: 1.55;
}

.avatar-modal__hint i {
  color: var(--agents-primary);
  font-size: 1.1rem;
  margin-top: 2px;
}

.avatar-builder {
  display: grid;
  gap: 18px;
}

.avatar-builder__section {
  padding: 20px;
  border-radius: 24px;
  background: rgba(255,255,255,0.62);
  border: 1px solid rgba(224, 231, 255, 0.92);
}

.avatar-builder__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.avatar-builder__title {
  margin: 0;
  color: var(--agents-text);
  font-weight: 700;
  font-size: 1.02rem;
}

.avatar-icon-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
}

.avatar-icon-option {
  position: relative;
  width: 100%;
  border: 1px solid rgba(224, 231, 255, 0.92);
  border-radius: 18px;
  background: rgba(255,255,255,0.76);
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  transition:
    transform .18s ease,
    border-color .18s ease,
    box-shadow .18s ease,
    background .18s ease;
}

.avatar-icon-option:hover,
.avatar-icon-option:focus {
  transform: translateY(-2px);
  background: #fff;
  border-color: rgba(74, 108, 247, 0.20);
  box-shadow: 0 18px 30px rgba(37, 52, 103, 0.08);
}

.avatar-icon-option.is-selected {
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(243,247,255,0.94));
  border-color: rgba(74, 108, 247, 0.32);
  box-shadow: 0 18px 30px rgba(74, 108, 247, 0.10);
}

.avatar-icon-option__badge {
  position: relative;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--avatar-gradient, linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%));
  box-shadow: var(--avatar-shadow, 0 16px 30px rgba(99, 102, 241, 0.28));
  overflow: hidden;
}

.avatar-icon-option__content i {
  font-size: 1.15rem;
}

.avatar-icon-option__label {
  color: var(--agents-text);
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.25;
  text-align: center;
}

.avatar-color-section {
  display: grid;
  gap: 18px;
}

.avatar-color-section__block {
  display: grid;
  gap: 12px;
}

.avatar-color-section__label {
  color: var(--agents-text);
  font-weight: 700;
  font-size: 0.92rem;
}

.avatar-color-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
}

.avatar-color-option {
  position: relative;
  border: 1px solid rgba(224, 231, 255, 0.92);
  border-radius: 18px;
  background: rgba(255,255,255,0.76);
  padding: 10px;
  display: grid;
  gap: 10px;
  transition:
    transform .18s ease,
    border-color .18s ease,
    box-shadow .18s ease,
    background .18s ease;
}

.avatar-color-option:hover,
.avatar-color-option:focus {
  transform: translateY(-2px);
  background: #fff;
  border-color: rgba(74, 108, 247, 0.20);
  box-shadow: 0 18px 30px rgba(37, 52, 103, 0.08);
}

.avatar-color-option.is-selected {
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(243,247,255,0.94));
  border-color: rgba(74, 108, 247, 0.32);
  box-shadow: 0 18px 30px rgba(74, 108, 247, 0.10);
}

.avatar-color-option__preview {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 16px;
  background: var(--avatar-gradient, linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%));
  box-shadow: var(--avatar-shadow, 0 16px 30px rgba(99, 102, 241, 0.28));
  overflow: hidden;
}

.avatar-color-option__label {
  color: var(--agents-text);
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
}

.avatar-custom-color-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  border-radius: 20px;
  border: 1px solid rgba(224, 231, 255, 0.92);
  background: rgba(255,255,255,0.76);
}

.avatar-custom-color-card__picker {
  position: relative;
  width: 62px;
  height: 62px;
  flex: 0 0 62px;
  border-radius: 18px;
  overflow: hidden;
  cursor: pointer;
}

.avatar-custom-color-card__picker input[type="color"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.avatar-custom-color-card__swatch {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 18px;
  background: linear-gradient(135deg, #4a6cf7 0%, #7b8cff 100%);
  box-shadow: 0 14px 28px rgba(74, 108, 247, 0.18);
  border: 1px solid rgba(255,255,255,0.22);
}

.avatar-custom-color-card__content {
  min-width: 0;
  flex: 1 1 auto;
}

.avatar-custom-color-card__content strong {
  display: block;
  color: var(--agents-text);
  font-size: 0.95rem;
}

.avatar-custom-color-card__content p {
  margin: 4px 0 0;
  color: var(--agents-text-soft);
  font-size: 0.9rem;
  line-height: 1.5;
}

.avatar-custom-color-card__apply {
  white-space: nowrap;
}

.avatar-modal__footer-note {
  margin-right: auto;
  color: var(--agents-text-muted);
  font-size: 0.88rem;
}

/* =====================================================
   13. Compatibilité styles existants
===================================================== */
.bg-accent {
  background-color: #4a6cf7 !important;
  color: #fff !important;
}

.btn-accent {
  background-color: #4a6cf7;
  color: #fff;
  transition: all 0.3s ease;
}

.btn-accent:hover {
  background-color: #3754bf;
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(74, 108, 247, 0.3);
}

.dropdown-menu {
  border-radius: 14px;
  border: none;
  box-shadow: 0 14px 32px rgba(32,40,81,0.14);
  padding: 0.6rem 0.25rem;
}

.dropdown-item {
  border-radius: 8px;
  margin: 0 0.2rem;
  transition: background .15s;
}

.dropdown-item:active,
.dropdown-item:focus,
.dropdown-item:hover {
  background: #e9eefc;
  color: #1a1f36;
}

.dropdown-divider {
  border-top: 1px solid #d6def7;
}

.menu-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: rgba(74,108,247,0.10);
  color: #4a6cf7;
  transition: background .15s, color .15s, transform .15s, opacity .15s;
  flex: 0 0 28px;
}

.menu-icon i {
  font-size: 1.05rem;
  line-height: 1;
  opacity: .9;
}

.dropdown-item:hover .menu-icon,
.dropdown-item:focus .menu-icon {
  background: #4a6cf7;
  color: #fff;
  transform: translateX(2px);
  opacity: 1;
}

.menu-icon.danger {
  background: rgba(231,76,60,0.12);
  color: #e74c3c;
}

.dropdown-item.text-danger:hover .menu-icon.danger,
.dropdown-item.text-danger:focus .menu-icon.danger {
  background: #e74c3c;
  color: #fff;
}

.btn-help-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1.5px solid #e2e6f9;
  background: rgba(255, 255, 255, 0.7);
  color: #4252a4;
  transition: transform .15s, box-shadow .15s, background .15s, border .15s;
}

.btn-help-icon i {
  font-size: 1.15rem;
  line-height: 1;
}

.btn-help-icon:hover,
.btn-help-icon:focus {
  background: #fff;
  border-color: #4a6cf7;
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(74,108,247,0.13);
}

/* -----------------------------------------------------
   Lien d'aide contextuel « ? » vers /docs (global)
   Petit rond discret placé près d'un titre ou d'un label.
   Ouvre la section de documentation dans un nouvel onglet.
----------------------------------------------------- */
.help-doc-link {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(135deg, #4a6cf7, #7c4dff);
  font-size: 0.72rem;
  line-height: 1;
  text-decoration: none;
  vertical-align: middle;
  flex: 0 0 auto;
  box-shadow: 0 4px 10px rgba(74, 108, 247, 0.25);
  transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
}
.help-doc-link i { font-size: 0.72rem; line-height: 1; }
.help-doc-link:hover,
.help-doc-link:focus-visible {
  color: #fff;
  transform: translateY(-1px) scale(1.06);
  box-shadow: 0 6px 14px rgba(74, 108, 247, 0.35);
}
/* Variante sobre pour les en-têtes de page sur fond clair. */
.help-doc-link--soft {
  color: #4252a4;
  background: rgba(255, 255, 255, 0.75);
  border: 1.5px solid #e2e6f9;
  box-shadow: none;
}
.help-doc-link--soft:hover,
.help-doc-link--soft:focus-visible {
  color: #4a6cf7;
  background: #fff;
  border-color: #4a6cf7;
  box-shadow: 0 6px 14px rgba(74, 108, 247, 0.18);
}

/* =====================================================
   14. Responsive
===================================================== */
@media (max-width: 1199px) {
  .avatar-icon-grid,
  .avatar-color-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 991px) {
  .agents-toolbar__controls {
    align-items: stretch;
  }

  .agents-toolbar__meta {
    order: 2;
  }

  .btn-create-agent {
    order: 3;
    width: 100%;
  }

  .avatar-modal__preview-card {
    flex-direction: column;
    align-items: stretch;
  }

  .avatar-modal__hint {
    max-width: none;
  }

  .avatar-icon-grid,
  .avatar-color-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .avatar-custom-color-card {
    flex-wrap: wrap;
  }
}

@media (max-width: 767px) {
  .agents-home {
    padding: 20px 0 42px;
  }

  .agents-toolbar {
    padding: 22px;
  }

  .agent-card-premium {
    padding: 18px;
  }

  .agent-card-premium__header {
    flex-direction: column;
    align-items: stretch;
  }

  .agent-card-premium__actions {
    justify-content: flex-end;
  }

  .agent-card-premium__footer {
    flex-direction: column;
    align-items: stretch;
  }

  .agent-card-premium__footer .btn-agent-primary,
  .agent-card-premium__footer .btn-agent-secondary {
    width: 100%;
  }

  .share-modal-intro {
    flex-direction: column;
    align-items: flex-start;
  }

  .avatar-modal__footer-note {
    display: none;
  }

  .agent-card-premium__title {
    font-size: 1.05rem;
  }
}

@media (max-width: 575px) {
  .agents-toolbar__controls {
    flex-direction: column;
    align-items: stretch;
  }

  .agents-searchbox {
    min-width: 100%;
  }

  .agents-toolbar__meta {
    width: 100%;
  }

  .meta-chip {
    width: 100%;
    justify-content: center;
  }

  .agent-card-premium__identity {
    align-items: flex-start;
  }

  .agent-card-premium__title-row {
    gap: 8px;
  }

  .agent-status-pill {
    padding: 6px 9px;
    font-size: 0.72rem;
  }

  .avatar-icon-grid,
  .avatar-color-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .avatar-custom-color-card {
    align-items: flex-start;
  }

  .avatar-custom-color-card__apply {
    width: 100%;
  }

  .modal-header,
  .modal-body,
  .modal-footer {
    padding-left: 18px;
    padding-right: 18px;
  }
}

/* =====================================================
   15. Réduction de mouvement
===================================================== */
@media (prefers-reduced-motion: reduce) {
  .glass-spotlight::before,
  .agent-card-col,
  .agent-card-premium,
  .btn-create-agent,
  .btn-agent-primary,
  .btn-agent-secondary,
  .btn-danger-soft,
  .card-icon-btn,
  .agent-card-premium__avatar,
  .agent-card-premium__avatar-edit,
  .avatar-icon-option,
  .avatar-color-option {
    transition: none !important;
    animation: none !important;
  }
}

/* =====================================================
   HEADER 2026 — Premium + Responsive
===================================================== */
:root {
  --nav-h: 72px;
  --nav-border-soft: rgba(255, 255, 255, 0.10);
  --nav-glass:
    linear-gradient(180deg, rgba(18, 24, 46, 0.88), rgba(24, 31, 58, 0.82));
  --nav-glass-mobile:
    linear-gradient(180deg, rgba(18, 24, 46, 0.98), rgba(24, 31, 58, 0.94));
}

/* important : on casse la hauteur fixe existante */
.navbar.nav-elegant.fixed-top,
.bg-dark.navbar.nav-elegant.fixed-top {
  min-height: var(--nav-h) !important;
  height: auto !important;
  padding: 0 !important;
  background: var(--nav-glass) !important;
  border-bottom: 1px solid var(--nav-border-soft);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 10px 28px rgba(9, 15, 35, 0.18);
  position: fixed;
  isolation: isolate;
}

.navbar.nav-elegant.fixed-top::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.22), transparent);
  pointer-events: none;
}

.nav-shell {
  min-height: var(--nav-h);
  padding-inline: clamp(0.75rem, 1vw + 0.5rem, 1.4rem);
  position: relative;
}

.nav-brand {
  flex-shrink: 0;
  margin-right: 0.75rem;
}

.nav-brand__logo {
  height: 40px;
  width: auto;
  display: block;
  filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.18));
  transition: transform .18s ease, filter .18s ease, opacity .18s ease;
}

.nav-brand:hover .nav-brand__logo,
.nav-brand:focus-visible .nav-brand__logo {
  transform: translateY(-1px) scale(1.02);
  filter: drop-shadow(0 10px 20px rgba(74, 108, 247, 0.26));
}

.nav-toggler {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
  transition: background .18s ease, transform .18s ease, box-shadow .18s ease;
}

.nav-toggler:hover,
.nav-toggler:focus-visible {
  background: rgba(74, 108, 247, 0.18);
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(25, 35, 70, 0.26);
}

.nav-toggler:focus {
  box-shadow: 0 0 0 .22rem rgba(74, 108, 247, 0.18) !important;
}

#navbarContent {
  flex-grow: 0;
}

.nav-panel {
  display: flex;
  align-items: center;
}

.nav-actions {
  display: flex;
  align-items: center !important;
  gap: 0.65rem;
}

/* Sélecteur de langue (préférences du compte) */
.account-lang {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.account-lang__btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 140px;
  padding: 12px 16px;
  border-radius: 14px;
  border: 1.5px solid rgba(39, 68, 185, 0.18);
  background: #fff;
  color: #1f2a44;
  text-decoration: none;
  font-weight: 500;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.account-lang__btn:hover {
  border-color: rgba(39, 68, 185, 0.45);
  transform: translateY(-1px);
}
.account-lang__btn.is-active {
  border-color: #2744b9;
  background: rgba(39, 68, 185, 0.06);
  box-shadow: 0 0 0 2px rgba(39, 68, 185, 0.12);
}
.account-lang__code {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(39, 68, 185, 0.10);
  color: #2744b9;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}
.account-lang__btn.is-active .account-lang__code { background: #2744b9; color: #fff; }
.account-lang__name { font-size: 0.95rem; }
.account-lang__check { margin-left: auto; color: #2744b9; font-size: 1.05rem; }

/* Actions — barre d'accès phares (icône + libellé visibles) */
.nav-action {
  position: relative;
  height: 44px;
  padding: 0 1.05rem;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: linear-gradient(180deg, rgba(255,255,255,0.10), rgba(255,255,255,0.055));
  color: #e7ecff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  font-weight: 600;
  white-space: nowrap;
  text-decoration: none;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition:
    transform .18s ease,
    background .18s ease,
    border-color .18s ease,
    box-shadow .18s ease,
    color .18s ease;
}

.nav-action:hover,
.nav-action:focus-visible {
  color: #fff;
  transform: translateY(-2px);
  background: linear-gradient(135deg, rgba(74,108,247,0.95), rgba(124,77,255,0.92));
  border-color: rgba(255,255,255,0.16);
  box-shadow: 0 14px 28px rgba(74, 108, 247, 0.30);
}

.nav-action__icon {
  display: grid;
  place-items: center;
  line-height: 1;
  font-size: 1.12rem;
}

.nav-action__label {
  display: inline-flex;
  font-size: 0.92rem;
  font-weight: 600;
  white-space: nowrap;
}

/* Accent rempli (mauve) — indique la page active */
.nav-action.is-active {
  background: linear-gradient(135deg, #4a6cf7 0%, #7c4dff 100%);
  border-color: rgba(255, 255, 255, 0.20);
  color: #fff;
  box-shadow: 0 10px 24px rgba(74, 108, 247, 0.34);
}

.nav-action.is-active:hover,
.nav-action.is-active:focus-visible {
  transform: translateY(-2px);
  background: linear-gradient(135deg, #5a78ff 0%, #8a5cff 100%);
  border-color: rgba(255, 255, 255, 0.28);
  box-shadow: 0 16px 32px rgba(74, 108, 247, 0.45);
}

/* Badge "New" — inline, à la suite du libellé */
.nav-action__badge {
  display: inline-flex;
  align-items: center;
  padding: 0.12rem 0.42rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.24);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  line-height: 1.25;
  margin-left: 0.15rem;
  pointer-events: none;
}

/* Prompt selector shared by agent create/edit pages */
.agent-prompt-picker {
  display: grid;
  gap: 1rem;
}

.prompt-source-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
  padding: 0.4rem;
  border-radius: 16px;
  background: rgba(74, 108, 247, 0.06);
  border: 1px solid rgba(74, 108, 247, 0.10);
}

.prompt-source-switch__button {
  min-height: 46px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--agents-text-soft, #66708f);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  transition: background .18s ease, color .18s ease, box-shadow .18s ease;
}

.prompt-source-switch__button.is-active {
  background: #fff;
  color: var(--agents-primary, #4a6cf7);
  box-shadow: 0 8px 22px rgba(49, 67, 136, 0.10);
}

.prompt-source-switch__button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.prompt-source-panel {
  display: grid;
  gap: 0.9rem;
}

.prompt-save-option {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 0.85rem 1rem;
  border-radius: 14px;
  background: rgba(74, 108, 247, 0.06);
  border: 1px solid rgba(74, 108, 247, 0.11);
  cursor: pointer;
}

.prompt-save-option .form-check-input {
  margin-top: 0.2rem;
  flex: 0 0 auto;
}

.prompt-save-option span {
  display: grid;
  gap: 0.18rem;
}

.prompt-save-option small,
.prompt-library-preview p,
.prompt-library-empty p {
  color: var(--agents-text-soft, #66708f);
  font-size: 0.84rem;
  margin: 0;
}

.prompt-title-field {
  display: grid;
  gap: 0.45rem;
}

.prompt-library-preview {
  padding: 1rem;
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(74, 108, 247, 0.07), rgba(124, 77, 255, 0.04));
  border: 1px solid rgba(74, 108, 247, 0.12);
}

.prompt-library-preview__head {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.55rem;
}

.prompt-library-preview__badge {
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  color: #4a46a8;
  background: rgba(124, 77, 255, 0.12);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
}

.prompt-library-preview pre {
  max-height: 190px;
  overflow: auto;
  margin: 0.8rem 0 0;
  padding: 0.85rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.78);
  color: #333b5d;
  font-family: inherit;
  font-size: 0.86rem;
  white-space: pre-wrap;
}

.prompt-library-empty {
  display: flex;
  gap: 0.8rem;
  align-items: center;
  padding: 1rem;
  border-radius: 16px;
  background: rgba(74, 108, 247, 0.05);
  border: 1px dashed rgba(74, 108, 247, 0.22);
}

.prompt-library-empty > i {
  color: var(--agents-primary, #4a6cf7);
  font-size: 1.35rem;
}

.prompt-studio-link {
  color: var(--agents-primary, #4a6cf7);
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.prompt-studio-link:hover {
  color: var(--agents-primary-dark, #2744b9);
}

/* Compact call-to-action that opens the Prompt Studio library modal */
.prompt-library-cta {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.15rem;
  padding: 0.9rem 1rem;
  border: 1px solid rgba(74, 108, 247, 0.14);
  border-radius: 18px;
  background:
    radial-gradient(circle at 100% 0%, rgba(124, 77, 255, 0.09), transparent 35%),
    rgba(248, 250, 255, 0.92);
}

.prompt-library-cta__icon {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(135deg, #4a6cf7, #7c4dff);
  box-shadow: 0 12px 24px rgba(74, 108, 247, 0.2);
  font-size: 1.15rem;
}

.prompt-library-cta__text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.prompt-library-cta__text strong {
  color: var(--agents-text, #1a1f36);
  font-size: 0.95rem;
}

.prompt-library-cta__text span {
  color: var(--agents-text-soft, #66708f);
  font-size: 0.82rem;
}

.prompt-library-cta__actions {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex: 0 0 auto;
}

/* Library picker modal (self-contained, no Bootstrap modal dependency) */
.library-modal {
  position: fixed;
  inset: 0;
  z-index: 1080;
  display: grid;
  place-items: center;
  padding: 1.25rem;
  opacity: 0;
  transition: opacity .2s ease;
}

.library-modal.is-open {
  opacity: 1;
}

.library-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 27, 56, 0.5);
  backdrop-filter: blur(3px);
}

.library-modal__dialog {
  position: relative;
  width: min(640px, 100%);
  max-height: min(86vh, 760px);
  display: flex;
  flex-direction: column;
  border-radius: 22px;
  background: #fff;
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 34px 90px rgba(30, 40, 80, 0.28);
  overflow: hidden;
  transform: translateY(12px) scale(0.98);
  transition: transform .2s ease;
}

.library-modal.is-open .library-modal__dialog {
  transform: none;
}

.library-modal__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 1.25rem 0.8rem;
}

.library-modal__header h3 {
  margin: 0.25rem 0 0;
  color: var(--agents-text, #1a1f36);
  font-size: 1.1rem;
  font-weight: 700;
}

.library-modal__close {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 10px;
  color: var(--agents-text-soft, #66708f);
  background: rgba(74, 108, 247, 0.07);
}

.library-modal__close:hover {
  color: #d43a4c;
  background: rgba(212, 58, 76, 0.1);
}

.library-modal__header-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.library-modal__refresh {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 10px;
  color: var(--agents-text-soft, #66708f);
  background: rgba(74, 108, 247, 0.07);
  transition: color 0.15s ease, background 0.15s ease;
}

.library-modal__refresh:hover {
  color: #4a6cf7;
  background: rgba(74, 108, 247, 0.14);
}

.library-modal__refresh:disabled {
  cursor: progress;
  opacity: 0.85;
}

.library-modal__refresh.is-loading i {
  display: inline-block;
  animation: library-refresh-spin 0.7s linear infinite;
}

@keyframes library-refresh-spin {
  to { transform: rotate(360deg); }
}

.library-modal__search {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0 1.25rem 0.85rem;
  padding: 0 0.9rem;
  border-radius: 13px;
  background: #f7f8ff;
  border: 1px solid rgba(74, 108, 247, 0.14);
}

.library-modal__search i {
  color: var(--agents-primary, #4a6cf7);
}

.library-modal__search input {
  width: 100%;
  min-height: 44px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--agents-text, #1a1f36);
}

/* Barre d'outils du modal : recherche + filtre catégorie + tout ajouter */
.library-modal__toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 0 1.25rem 0.85rem;
}
.library-modal__toolbar .library-modal__search {
  margin: 0;
  flex: 1 1 200px;
}
.library-modal__select-all {
  flex: 0 0 auto;
  white-space: nowrap;
}
.library-modal__select-all:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Combobox catégorie (cherchable) */
.library-cat {
  position: relative;
  flex: 0 0 auto;
}
.library-cat__toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0 0.85rem;
  border-radius: 13px;
  border: 1px solid rgba(74, 108, 247, 0.14);
  background: #f7f8ff;
  color: var(--agents-text, #1a1f36);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}
.library-cat__toggle > .bi-tag {
  color: var(--agents-primary, #4a6cf7);
}
.library-cat__value {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.library-cat__caret {
  font-size: 0.7rem;
  color: var(--agents-text-muted, #8891ad);
  transition: transform 0.15s ease;
}
.library-cat.is-open .library-cat__caret {
  transform: rotate(180deg);
}
.library-cat__menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 20;
  width: 260px;
  max-width: 80vw;
  background: #fff;
  border: 1px solid rgba(74, 108, 247, 0.18);
  border-radius: 13px;
  box-shadow: 0 18px 40px rgba(39, 55, 110, 0.16);
  padding: 0.55rem;
}
.library-cat__search {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0 0.6rem;
  margin-bottom: 0.45rem;
  border-radius: 10px;
  background: #f7f8ff;
  border: 1px solid rgba(74, 108, 247, 0.14);
}
.library-cat__search i {
  color: var(--agents-primary, #4a6cf7);
  font-size: 0.85rem;
}
.library-cat__search input {
  width: 100%;
  min-height: 36px;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 0.82rem;
  color: var(--agents-text, #1a1f36);
}
.library-cat__options {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 220px;
  overflow-y: auto;
}
.library-cat__option {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.45rem 0.6rem;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--agents-text, #1a1f36);
  font-size: 0.83rem;
  cursor: pointer;
}
.library-cat__option:hover {
  background: rgba(74, 108, 247, 0.08);
}
.library-cat__option.is-active {
  background: rgba(74, 108, 247, 0.14);
  color: var(--agents-primary-dark, #2744b9);
  font-weight: 600;
}
.library-cat__empty {
  padding: 0.5rem 0.6rem;
  color: var(--agents-text-muted, #8891ad);
  font-size: 0.8rem;
}

.library-modal__list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: grid;
  gap: 0.7rem;
  padding: 0 1.25rem 0.5rem;
}

.library-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.9rem;
  border: 1px solid rgba(74, 108, 247, 0.12);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.9);
}

.library-card.is-added {
  border-color: rgba(34, 197, 94, 0.3);
  background: rgba(34, 197, 94, 0.05);
}

.library-card__main {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.library-card__head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.library-card__head strong {
  color: var(--agents-text, #1a1f36);
  font-size: 0.92rem;
}

.library-card__desc {
  margin: 0;
  color: var(--agents-text-soft, #66708f);
  font-size: 0.8rem;
}

.library-card__excerpt {
  margin: 0;
  max-height: 3.2em;
  overflow: hidden;
  padding: 0.5rem 0.65rem;
  border-radius: 10px;
  background: #f7f8ff;
  color: #48516d;
  font-size: 0.76rem;
  line-height: 1.5;
  white-space: pre-line;
}

.library-card__owner {
  color: var(--agents-text-soft, #66708f);
  font-size: 0.72rem;
}

.library-card__add {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 40px;
  padding: 0.5rem 0.85rem;
  border: 0;
  border-radius: 12px;
  color: #fff;
  background: var(--agents-primary, #4a6cf7);
  font-size: 0.8rem;
  font-weight: 600;
}

.library-card__add:hover {
  filter: brightness(0.96);
}

.library-card__add:disabled {
  color: #24754b;
  background: rgba(34, 197, 94, 0.14);
  cursor: default;
}

.library-modal__empty {
  padding: 1.5rem 1.25rem 2rem;
  text-align: center;
  color: var(--agents-text-soft, #66708f);
}

.library-modal__empty i {
  font-size: 1.4rem;
  color: var(--agents-primary, #4a6cf7);
}

.library-modal__empty p {
  margin: 0.4rem 0 0;
  font-size: 0.85rem;
}

.library-modal__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1.25rem;
  border-top: 1px solid rgba(74, 108, 247, 0.1);
}

body.library-modal-open {
  overflow: hidden;
}

/* Read-only list of prompts selected from Prompt Studio (create/edit agent) */
.selected-prompt-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.selected-prompt {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.95rem 1.05rem;
  border: 1px solid rgba(74, 108, 247, 0.16);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(244, 247, 255, 0.92));
  box-shadow: 0 10px 22px rgba(39, 55, 110, 0.05);
}

.selected-prompt__main {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

/* Poignée de réordonnancement (drag-and-drop) */
.selected-prompt__drag {
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  color: var(--agents-text-muted, #8891ad);
  cursor: grab;
  transition: background 0.15s ease, color 0.15s ease;
}
.selected-prompt__drag:hover {
  background: rgba(74, 108, 247, 0.1);
  color: var(--agents-primary, #4a6cf7);
}
.selected-prompt__drag:active {
  cursor: grabbing;
}
.selected-prompt.is-dragging {
  opacity: 0.55;
  border-color: rgba(74, 108, 247, 0.5);
  box-shadow: 0 14px 30px rgba(39, 55, 110, 0.18);
}

.selected-prompt__head {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.selected-prompt__label {
  color: var(--agents-text, #1a1f36);
  font-size: 0.94rem;
  font-weight: 700;
}

.selected-prompt__question {
  margin: 0;
  color: var(--agents-text-soft, #66708f);
  font-size: 0.82rem;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.selected-prompt__actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.selected-prompt__edit,
.selected-prompt__remove {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  border: 1px solid transparent;
  text-decoration: none;
}

.selected-prompt__edit {
  color: var(--agents-primary, #4a6cf7);
  background: rgba(74, 108, 247, 0.09);
  border-color: rgba(74, 108, 247, 0.14);
}

.selected-prompt__edit:hover {
  color: var(--agents-primary, #4a6cf7);
  background: rgba(74, 108, 247, 0.16);
}

.selected-prompt__remove {
  color: #df3b3b;
  background: rgba(255, 246, 246, 0.9);
  border-color: rgba(239, 68, 68, 0.16);
  cursor: pointer;
}

.selected-prompt__remove:hover {
  background: rgba(239, 68, 68, 0.12);
}

.prompt-format-pill,
.linked-prompt-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  width: fit-content;
  padding: 0.3rem 0.55rem;
  border-radius: 999px;
  color: #4d43a6;
  background: rgba(124, 77, 255, 0.1);
  border: 1px solid rgba(124, 77, 255, 0.13);
  font-size: 0.7rem;
  font-weight: 700;
}

.linked-prompt-badge {
  margin-top: 0.45rem;
  color: #3156c3;
  background: rgba(74, 108, 247, 0.09);
  border-color: rgba(74, 108, 247, 0.13);
}

.is-linked-prompt {
  border-color: rgba(74, 108, 247, 0.22);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(242, 246, 255, 0.9));
}

.prompt-row__save-option {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-top: 0.65rem;
  color: var(--agents-text-soft, #66708f);
  font-size: 0.76rem;
  cursor: pointer;
}

.prompt-row__save-option .form-check-input {
  flex: 0 0 auto;
  margin: 0;
}

@media (max-width: 575px) {
  .prompt-source-switch {
    grid-template-columns: 1fr;
  }

  .prompt-library-cta {
    flex-direction: column;
    align-items: flex-start;
  }

  .prompt-library-cta__actions {
    width: 100%;
    flex-wrap: wrap;
  }
}

/* Profil */
.nav-profile {
  margin-left: 0.2rem;
}

.nav-profile__trigger {
  min-height: 46px;
  padding: 6px 10px 6px 6px;
  border: none;
  border-radius: 18px;
  background: rgba(255,255,255,0.04);
  color: #eef2ff;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  transition: background .18s ease, transform .18s ease, box-shadow .18s ease;
}

.nav-profile__trigger:hover,
.nav-profile__trigger:focus-visible {
  background: rgba(74, 108, 247, 0.14);
  transform: translateY(-1px);
}

.nav-profile__trigger::after {
  margin-left: 0.1rem;
  opacity: 0.72;
}

.nav-profile__avatar {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 10px 24px rgba(16, 24, 56, 0.26);
}

.nav-profile__avatar svg {
  width: 100%;
  height: 100%;
  display: block;
}

.nav-profile__text {
  display: none;
  text-align: left;
  line-height: 1.15;
}

.nav-profile__eyebrow {
  display: block;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #aeb8dc;
}

.nav-profile__label {
  display: block;
  font-weight: 600;
  color: #fff;
}

.nav-profile__menu {
  min-width: 290px;
  margin-top: 0.9rem !important;
  padding: 0.5rem;
  border: 1px solid rgba(223,230,255,0.85);
  border-radius: 22px;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 26px 60px rgba(18, 27, 58, 0.18);
  /* Menu long (admin) : borne la hauteur et permet le défilement. */
  max-height: min(70vh, 520px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.nav-profile__menu .dropdown-header {
  padding: 0.65rem 0.9rem 0.45rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #7b87ac;
}

.navbar .dropdown-item {
  min-height: 46px;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.72rem 0.8rem;
}

/* Desktop */
@media (min-width: 992px) {
  .nav-actions {
    flex-wrap: nowrap;
  }
}

/* Tablet / mobile */
@media (max-width: 991.98px) {
  .navbar.nav-elegant.fixed-top,
  .bg-dark.navbar.nav-elegant.fixed-top {
    min-height: var(--nav-h) !important;
  }

  .nav-shell {
    padding-block: 12px;
  }

  #navbarContent {
    position: absolute;
    top: calc(100% + 10px);
    left: 0.75rem;
    right: 0.75rem;
    z-index: 1030;
    /* Navbar repliée trop haute (admin) : on borne et on scrolle. */
    max-height: calc(100vh - var(--nav-h) - 18px);
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  #navbarContent .nav-panel {
    width: 100%;
    padding: 14px;
    border-radius: 24px;
    background: var(--nav-glass-mobile);
    border: 1px solid rgba(255,255,255,0.10);
    box-shadow: 0 24px 60px rgba(9, 15, 35, 0.34);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
  }

  .nav-actions {
    width: 100%;
    flex-direction: column;
    align-items: stretch !important;
    gap: 0.75rem;
    height: auto;
  }

  .nav-action {
    width: 100%;
    min-height: 54px;
    justify-content: flex-start;
    border-radius: 18px;
    padding: 0.9rem 1rem;
  }

  .nav-action__badge {
    margin-left: auto;
  }

  .nav-profile {
    margin-left: 0;
  }

  .nav-profile__trigger {
    width: 100%;
    justify-content: space-between;
    padding: 0.65rem 0.9rem 0.65rem 0.55rem;
    border: 1px solid rgba(255,255,255,0.08);
    background: linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.04));
  }

  .nav-profile__text {
    display: block;
    margin-right: auto;
  }

  .nav-profile__menu {
    width: 100%;
    min-width: 100%;
    margin-top: 0.75rem !important;
    /* En navbar repliée, c'est #navbarContent qui scrolle : pas de double scroll. */
    max-height: none;
    overflow: visible;
  }

  .navbar .dropdown-menu {
    position: static !important;
    transform: none !important;
  }
}

/* Petit mobile */
@media (max-width: 575.98px) {
  :root {
    --nav-h: 68px;
  }

  .nav-brand__logo {
    height: 36px;
  }

  .nav-toggler {
    width: 44px;
    height: 44px;
    border-radius: 14px;
  }

  #navbarContent {
    left: 0.5rem;
    right: 0.5rem;
  }

  #navbarContent .nav-panel {
    padding: 12px;
    border-radius: 20px;
  }

  .nav-action {
    min-height: 52px;
    padding: 0.85rem 0.9rem;
  }

  .nav-profile__menu {
    padding: 0.4rem;
    border-radius: 18px;
  }
}
.nav-toggler {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.nav-toggler .navbar-toggler-icon {
  display: block;
  width: 1.35rem;
  height: 1.35rem;
  margin: 0 auto;
  background-position: center;
  background-size: 100% 100%;
  flex-shrink: 0;
}
/* Réduction de mouvement */
@media (prefers-reduced-motion: reduce) {
  .nav-brand__logo,
  .nav-toggler,
  .nav-action,
  .nav-profile__trigger {
    transition: none !important;
  }
}

/* =====================================================
   FOOTER PREMIUM 2026 — FULL WIDTH
===================================================== */
.site-footer {
  position: relative;
  margin-top: 4rem;
  color: #edf2ff;
}

.footer-shell {
  position: relative;
  width: 100%;
  border-top: 1px solid rgba(255,255,255,0.08);
  background:
    linear-gradient(180deg, rgba(20, 26, 48, 0.96), rgba(17, 23, 43, 0.98));
  box-shadow: 0 -8px 30px rgba(9, 15, 35, 0.10);
  overflow: hidden;
}

.footer-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(500px circle at 10% 0%, rgba(74,108,247,0.16), transparent 38%),
    radial-gradient(420px circle at 100% 20%, rgba(124,77,255,0.14), transparent 34%);
  pointer-events: none;
}

.footer-inner {
  position: relative;
  z-index: 1;
  padding-top: 34px;
  padding-bottom: 24px;
}

.footer-top,
.footer-bottom {
  position: relative;
  z-index: 1;
}

.footer-top {
  display: grid;
  grid-template-columns: minmax(280px, 1.1fr) minmax(0, 1.6fr);
  gap: 36px;
}

.footer-brand {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  min-width: 0;
}

.footer-brand__logo-wrap {
  flex: 0 0 56px;
  width: 56px;
  height: 56px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}

.footer-brand__logo-wrap:hover,
.footer-brand__logo-wrap:focus-visible {
  transform: translateY(-2px);
  background: rgba(74,108,247,0.16);
  box-shadow: 0 14px 28px rgba(74,108,247,0.20);
}

.footer-brand__logo {
  width: 34px;
  height: auto;
  display: block;
}

.footer-brand__content {
  min-width: 0;
}

.footer-brand__title {
  margin: 0 0 10px;
  color: #fff;
  font-size: 1.28rem;
  font-weight: 700;
}

.footer-brand__text {
  margin: 0;
  color: rgba(232, 238, 255, 0.76);
  line-height: 1.75;
  max-width: 460px;
}

.footer-links-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.footer-col {
  min-width: 0;
}

.footer-col__title {
  margin: 0 0 14px;
  color: #ffffff;
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}

.footer-link-premium {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 8px 0;
  color: rgba(230, 236, 255, 0.78);
  text-decoration: none;
  transition: color .18s ease, transform .18s ease;
}

.footer-link-premium i {
  width: 20px;
  text-align: center;
  color: #9fb0ff;
  transition: color .18s ease, transform .18s ease;
}

.footer-link-premium:hover,
.footer-link-premium:focus-visible {
  color: #fff;
  transform: translateX(3px);
}

.footer-link-premium:hover i,
.footer-link-premium:focus-visible i {
  color: #fff;
  transform: scale(1.06);
}

.footer-col--highlight {
  display: flex;
  flex-direction: column;
}

.footer-news-card {
  height: 100%;
  padding: 18px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255,255,255,0.10), rgba(255,255,255,0.06));
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
}

.footer-news-card__badge {
  display: inline-flex;
  margin-bottom: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, #4a6cf7, #7c4dff);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.footer-news-card h5 {
  margin: 0 0 10px;
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.4;
}

.footer-news-card p {
  margin: 0 0 14px;
  color: rgba(232, 238, 255, 0.74);
  line-height: 1.65;
  font-size: 0.94rem;
}

.footer-news-card__cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #ffffff;
  font-weight: 600;
  text-decoration: none;
  transition: gap .18s ease, opacity .18s ease;
}

.footer-news-card__cta:hover,
.footer-news-card__cta:focus-visible {
  gap: 11px;
  opacity: 0.95;
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.footer-copy {
  color: rgba(230,236,255,0.62);
  font-size: 0.9rem;
}

.footer-bottom__right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.footer-version {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.08);
  color: rgba(240,244,255,0.76);
  font-size: 0.82rem;
  font-weight: 600;
}

.footer-bottom__link {
  color: #c8d4ff;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  transition: color .18s ease;
}

.footer-bottom__link:hover,
.footer-bottom__link:focus-visible {
  color: #fff;
}

@media (min-width: 992px) {
  .footer-inner {
    padding-left: 24px;
    padding-right: 24px;
  }
}

@media (max-width: 991px) {
  .footer-top {
    grid-template-columns: 1fr;
  }

  .footer-links-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 767px) {
  .footer-top {
    gap: 28px;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
  }

  .footer-links-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 575px) {
  .footer-inner {
    padding-top: 26px;
    padding-bottom: 20px;
  }

  .footer-brand {
    flex-direction: column;
  }

  .footer-bottom__right {
    width: 100%;
  }
}

/* =====================================================
   Popup d'avertissement environnement non-production
===================================================== */
.env-warning {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: grid;
  place-items: center;
  padding: 1.25rem;
  opacity: 0;
  transition: opacity .25s ease;
}

.env-warning.is-visible {
  opacity: 1;
}

.env-warning__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(17, 22, 42, 0.62);
  backdrop-filter: blur(4px);
}

.env-warning__dialog {
  position: relative;
  width: min(520px, 100%);
  padding: 2rem 1.75rem 1.75rem;
  border-radius: 22px;
  background: #fff;
  border: 1px solid rgba(245, 158, 11, 0.25);
  box-shadow: 0 36px 90px rgba(30, 40, 80, 0.32);
  text-align: center;
  transform: translateY(14px) scale(0.98);
  transition: transform .25s ease;
}

.env-warning.is-visible .env-warning__dialog {
  transform: none;
}

.env-warning__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.13);
  color: #b4690e;
  border: 1px solid rgba(245, 158, 11, 0.22);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.env-warning__icon {
  width: 64px;
  height: 64px;
  margin: 1.1rem auto 0.9rem;
  display: grid;
  place-items: center;
  border-radius: 20px;
  font-size: 1.7rem;
  color: #b4690e;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.18), rgba(251, 191, 36, 0.12));
}

.env-warning__dialog h2 {
  margin: 0 0 0.6rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: #1a1f36;
}

.env-warning__dialog p {
  margin: 0 0 1.2rem;
  color: #586087;
  font-size: 0.92rem;
  line-height: 1.6;
}

.env-warning__check {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  margin-bottom: 1.2rem;
  padding: 0.85rem 0.95rem;
  border-radius: 14px;
  background: #f7f8ff;
  border: 1px solid rgba(74, 108, 247, 0.12);
  text-align: left;
  cursor: pointer;
}

.env-warning__check input {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin-top: 2px;
}

.env-warning__check span {
  color: #3a4263;
  font-size: 0.85rem;
  line-height: 1.5;
}

.env-warning__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  min-height: 48px;
  border: 0;
  border-radius: 14px;
  color: #fff;
  font-weight: 600;
  background: linear-gradient(135deg, #f59e0b, #f97316);
  box-shadow: 0 12px 26px rgba(245, 158, 11, 0.3);
  transition: transform .15s ease, opacity .15s ease;
}

.env-warning__btn:hover:not(:disabled) {
  transform: translateY(-1px);
}

.env-warning__btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

body.env-warning-open {
  overflow: hidden;
}

/* =====================================================
   Catégories d'agents : chip sur carte + filtres
===================================================== */
.agent-card-premium__category {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.4rem;
  padding: 0.22rem 0.6rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  color: #554ca5;
  background: rgba(124, 77, 255, 0.09);
  border: 1px solid rgba(124, 77, 255, 0.14);
}

.agents-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 0 1.25rem;
}

.agents-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--agents-border, rgba(74, 108, 247, 0.14));
  background: rgba(255, 255, 255, 0.75);
  color: var(--agents-text-soft, #66708f);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s ease, color .15s ease, border-color .15s ease, transform .15s ease;
}

.agents-filter-chip:hover {
  transform: translateY(-1px);
  border-color: rgba(74, 108, 247, 0.3);
}

.agents-filter-chip.is-active {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, #4a6cf7, #7c4dff);
  box-shadow: 0 10px 22px rgba(74, 108, 247, 0.22);
}

.agents-filter-chip i {
  font-size: 0.78rem;
}


/* ==== Pagination de liste réutilisable (liste de prompts edit-agent, résultats auto-run) ==== */
.list-pager{
  display:flex; align-items:center; justify-content:center; gap:.5rem;
  margin-top:.9rem; flex-wrap:wrap;
}
.list-pager.d-none{ display:none !important; }
.list-pager__btn{
  display:inline-flex; align-items:center; gap:.35rem;
  border:1px solid rgba(74,108,247,.28); background:#fff; color:#4a6cf7;
  border-radius:999px; padding:.34rem .85rem; font-size:.85rem; font-weight:600;
  line-height:1; cursor:pointer;
  transition:background .15s ease, border-color .15s ease, opacity .15s ease, box-shadow .15s ease;
}
.list-pager__btn:hover:not(:disabled){ background:rgba(74,108,247,.09); border-color:rgba(74,108,247,.5); box-shadow:0 2px 6px rgba(74,108,247,.12); }
.list-pager__btn:disabled{ opacity:.4; cursor:default; box-shadow:none; }
.list-pager__info{ font-size:.85rem; color:#5a6a8a; padding:0 .4rem; white-space:nowrap; }

/* =====================================================
   Bannière d'information globale (admin)
   Fixée juste sous la navbar, fermable, très visible.
   Le décalage du contenu est piloté par la classe
   `has-app-banner` posée sur <html> par app-banner.js
   (le padding-top de <html> = 70px réserve déjà la navbar
   sur toutes les pages).
===================================================== */
.app-banner{
  position: fixed;
  top: 70px;
  left: 0;
  right: 0;
  z-index: 1025; /* sous la navbar (fixed-top = 1030), au-dessus du contenu */
  color: #fff;
  box-shadow: 0 8px 22px rgba(15, 22, 50, 0.18);
  border-bottom: 1px solid rgba(255, 255, 255, 0.22);
  animation: app-banner-in .28s ease;
}
@keyframes app-banner-in{
  from{ transform: translateY(-6px); opacity: 0; }
  to{ transform: translateY(0); opacity: 1; }
}
.app-banner__inner{
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .7rem clamp(0.9rem, 2vw, 1.6rem);
}
.app-banner__icon{
  flex-shrink: 0;
  font-size: 1.15rem;
  line-height: 1;
}
.app-banner__text{
  flex: 1 1 auto;
  min-width: 0;
  font-size: .95rem;
  font-weight: 500;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.app-banner__close{
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  font-size: .85rem;
  cursor: pointer;
  transition: background .16s ease, transform .16s ease;
}
.app-banner__close:hover,
.app-banner__close:focus-visible{
  background: rgba(255, 255, 255, 0.32);
  transform: scale(1.08);
  outline: none;
}

/* Niveaux de gravité */
.app-banner--info{
  background: linear-gradient(135deg, #2563eb, #4a6cf7);
}
.app-banner--warning{
  background: linear-gradient(135deg, #d97706, #f59e0b);
}
.app-banner--danger{
  background: linear-gradient(135deg, #b91c1c, #ef4444);
}

/* Décalage du contenu quand la bannière est visible (JS règle --app-banner-h). */
html.has-app-banner{
  padding-top: calc(70px + var(--app-banner-h, 46px));
}

@media (max-width: 575.98px){
  .app-banner__inner{ padding: .6rem .8rem; gap: .5rem; }
  .app-banner__text{ font-size: .88rem; }
}
