/* ==========================================================================
   LSPD OFFICIAL PORTAL STYLESHEET
   Official police portal design specifications for LSPD
   HIGH-PERFORMANCE OPTIMIZED (GPU Accelerated, Zero-Lag, Content-Visibility)
   ========================================================================== */

:root {
  --navy-header: #012b6d;
  --navy-grid-bg: #002244;
  --navy-dark: #001833;
  --blue-primary: #005596;
  --blue-btn: #0066b2;
  --blue-ribbon: #0066cc;
  --blue-curriculum: #0055b8;
  --orange-accent: #d9441e;
  --discord-color: #5865F2;
  --discord-hover: #4752C4;
  --gray-bg: #f8fafc;
  --gray-border: #e2e8f0;
  --text-dark: #333333;
  --text-muted: #555555;
  --text-color: #0f172a;
  --admin-text: #0f172a;
  --admin-card: #ffffff;
  --admin-card-border: #e2e8f0;
  --admin-input-bg: #f8fafc;
  --font-main: Arial, Helvetica, "Segoe UI", sans-serif;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  overflow-x: hidden;
  max-width: 100vw;
  width: 100%;
}

body {
  font-family: var(--font-main);
  color: var(--text-dark);
  background-color: #ffffff;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  text-decoration: none;
  color: inherit;
}

img, svg {
  display: block;
  max-width: 100%;
}

.container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ==========================================================================
   1. TOP NAVIGATION BAR (Exact match to Image 1 + Hardware Acceleration)
   ========================================================================== */
.site-header {
  background-color: var(--navy-header);
  color: #ffffff;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
  transform: translateZ(0);
  will-change: transform;
  backface-visibility: hidden;
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 74px;
  max-width: 1320px;
  margin: 0 auto;
  width: 100%;
  padding: 0 24px;
  box-sizing: border-box;
}

/* Brand Logo (LSPD) */
.brand-link {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  margin-right: 24px;
}

.brand-logo-img {
  width: 135px;
  height: 48px;
  object-fit: contain;
}

/* Nav Menu - Style fidèle JoinLAPD (Écriture & Marges identiques) */
.nav-menu {
  display: flex;
  align-items: center;
  list-style: none;
  gap: 22px; /* Marges exactes (~21-22px) comme sur la capture JoinLAPD */
  margin: 0;
  padding: 0;
  flex-shrink: 1;
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 4px;
  color: #ffffff !important;
  font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
  font-size: 0.80rem; /* Taille exacte JoinLAPD (hauteur de capitale 9px) */
  font-weight: 800; /* Écriture en gras net */
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 6px 0;
  border-radius: 0;
  border: none !important;
  transition: opacity 0.15s ease;
  white-space: nowrap;
  text-decoration: none;
  line-height: 1;
  cursor: pointer;
}

.nav-link:hover,
.nav-item:hover > .nav-link {
  opacity: 0.82;
  background-color: transparent !important;
  color: #ffffff !important;
}

/* Chevron vectoriel V ouvert avec animation de rotation fluide */
.nav-chevron {
  display: inline-flex;
  align-items: center;
  margin-left: 5px;
  color: #ffffff;
  opacity: 0.95;
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  transform-origin: center center;
}

.nav-chevron svg {
  display: block;
  width: 10px;
  height: 6px;
  stroke: currentColor;
  stroke-width: 2.2;
}

.nav-item:hover .nav-chevron,
.nav-item:focus-within .nav-chevron,
.nav-item.open .nav-chevron,
.lang-selector-nav:hover .nav-chevron,
.lang-selector-nav.open .nav-chevron,
.profile-pill-btn:hover .nav-chevron,
.discord-profile-dropdown.open .nav-chevron {
  transform: rotate(180deg);
}

/* Dropdown Menu */
.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background-color: #001f42;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 4px;
  min-width: 220px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.45);
  list-style: none;
  z-index: 1050;
  margin-top: 8px;
  padding: 6px 0;
}

.dropdown-menu::before {
  content: "";
  position: absolute;
  top: -8px;
  left: 0;
  right: 0;
  height: 10px;
  background: transparent;
}

.nav-item:hover .dropdown-menu {
  display: block;
}

.dropdown-item a {
  display: block;
  padding: 10px 18px;
  color: #ffffff;
  font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
  font-size: 0.80rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.dropdown-item a:hover {
  background-color: #002b66;
  color: #38bdf8;
}

/* Language Selector Navigation Item (Next to FAQS) */
.lang-selector-nav {
  position: relative;
  display: flex;
  align-items: center;
}

.lang-selector-nav .lang-toggle-btn {
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
  font-weight: 800;
  font-size: 0.82rem;
  letter-spacing: 0.5px;
  color: #ffffff;
  padding: 6px 0;
}

.lang-dropdown-menu {
  min-width: 170px;
}

.lang-dropdown-menu .dropdown-item a {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.80rem;
  padding: 8px 16px;
}

/* Search Input Pill (Style identique à la capture JoinLAPD) */
.nav-search-form {
  position: relative;
  margin-left: 55px; /* Espace respirant avant la barre de recherche identique à la capture */
  display: flex;
  align-items: center;
}

.search-pill-input {
  background-color: #ffffff;
  color: #333333;
  border: none;
  border-radius: 999px;
  height: 28px;
  padding: 0 16px;
  font-size: 0.78rem;
  font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
  font-weight: 400;
  width: 175px;
  outline: none;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
  transition: width 0.25s ease, box-shadow 0.2s ease;
}

.search-pill-input::placeholder {
  color: #8e8e93;
  font-weight: 400;
  font-size: 0.76rem;
}

.search-pill-input:focus {
  width: 220px;
  box-shadow: 0 0 0 2px #0284c7;
}

/* ==========================================================================
   DISCORD CONNECT BUTTON (To the right of the Search bar)
   ========================================================================== */
.nav-auth-item {
  display: flex;
  align-items: center;
  margin-left: 6px;
  flex-shrink: 0;
}

.btn-discord-login {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background-color: var(--discord-color);
  color: #ffffff;
  font-size: 0.80rem;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(88, 101, 242, 0.4);
  transition: background-color 0.15s ease, transform 0.15s ease;
  letter-spacing: 0.2px;
}

.btn-discord-login:hover {
  background-color: var(--discord-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(88, 101, 242, 0.6);
}

.btn-discord-login:active {
  transform: translateY(0);
}

/* ==========================================================================
   DISCORD PROFILE DROPDOWN MENU (Glisse fluide sans clic & Module partagé)
   ========================================================================== */
.discord-profile-dropdown {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding-bottom: 8px; /* Zone tampon pour une glisse de souris ininterrompue */
  margin-bottom: -8px;
}

.profile-pill-btn {
  background-color: #0b1e38;
  border: 1px solid var(--discord-color);
  border-radius: 999px;
  padding: 3px 10px 3px 3px;
  color: #ffffff;
  font-size: 0.80rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  outline: none;
}

.profile-pill-btn:hover,
.discord-profile-dropdown:hover .profile-pill-btn,
.discord-profile-dropdown.is-open .profile-pill-btn {
  background-color: #001a40;
  border-color: #7289da;
  box-shadow: 0 4px 12px rgba(88, 101, 242, 0.4);
}

.discord-avatar-img {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid var(--discord-color);
  object-fit: cover;
}

.discord-username-text {
  max-width: 105px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-dropdown-menu {
  position: absolute;
  top: 100%;
  margin-top: 2px;
  right: 0;
  left: auto;
  max-width: calc(100vw - 24px);
  box-sizing: border-box;
  background-color: #001433;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-top: 2px solid var(--orange-accent);
  border-radius: 6px;
  min-width: 230px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.6);
  list-style: none;
  padding: 6px 0;
  z-index: 1050;
  display: none;
}

/* Pont invisible permettant au curseur de glisser vers le menu sans le refermer */
.profile-dropdown-menu::before {
  content: "";
  position: absolute;
  top: -12px;
  left: 0;
  right: 0;
  height: 14px;
  background: transparent;
  display: block;
}

.discord-profile-dropdown:hover .profile-dropdown-menu,
.discord-profile-dropdown.is-open .profile-dropdown-menu,
.profile-dropdown-menu.is-active {
  display: block;
  animation: fadeInDown 0.15s ease;
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Carte info utilisateur dans le menu */
.profile-info-item {
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.profile-user-details {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.profile-user-fullname {
  font-weight: 800;
  color: #ffffff;
  font-size: 0.86rem;
  letter-spacing: 0.3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 200px;
}

.profile-user-id {
  font-size: 0.72rem;
  color: #6ee7b7;
  font-weight: 700;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  letter-spacing: 0.4px;
}

.profile-dropdown-menu .dropdown-item a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  font-size: 0.84rem;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0.3px;
  color: #ffffff;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.profile-dropdown-menu .dropdown-item a:hover {
  background-color: #002255;
}

.dropdown-link-portal {
  color: #93c5fd !important;
}

.dropdown-link-portal:hover {
  background-color: rgba(147, 197, 253, 0.12) !important;
  color: #bfdbfe !important;
}

.dropdown-link-admin {
  color: #fbbf24 !important;
}

.dropdown-link-admin:hover {
  background-color: rgba(251, 191, 36, 0.12) !important;
  color: #fef08a !important;
}

.admin-chip {
  background: #fbbf24;
  color: #000000;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: auto;
  letter-spacing: 0.5px;
}

.panel-chip {
  font-size: 0.65rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: auto;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}

.chip-agents {
  background: #0284c7;
  color: #ffffff;
}

.chip-academy {
  background: #f59e0b;
  color: #000000;
}

.chip-rh {
  background: #8b5cf6;
  color: #ffffff;
}

.dropdown-link-panel {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.dropdown-divider {
  height: 1px;
  background-color: rgba(255, 255, 255, 0.1);
  margin: 4px 0;
}

.dropdown-link-logout {
  color: #fca5a5 !important;
}

.dropdown-link-logout:hover {
  background-color: rgba(239, 68, 68, 0.15) !important;
  color: #ef4444 !important;
}

/* Modale Serveurs Discord Publics */
.discord-server-card {
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f8fafc;
  transition: border-color 0.2s;
}

.discord-server-card.is-hq {
  border: 2px solid var(--blue-primary);
  background: #eff6ff;
}

.discord-server-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.discord-server-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--blue-primary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.discord-hq-badge {
  background: #002b66;
  color: #fbbf24;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 4px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.discord-server-id {
  font-size: 0.78rem;
  color: #64748b;
}

.btn-join-discord {
  background: var(--discord-color);
  color: #ffffff;
  padding: 8px 14px;
  border-radius: 4px;
  font-weight: 700;
  font-size: 0.82rem;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.15s;
}

.btn-join-discord:hover {
  background: var(--discord-hover);
}

/* Mobile Toggle */
.mobile-nav-toggle {
  display: none;
  color: #ffffff;
  font-size: 1.8rem;
  background: none;
  border: none;
  cursor: pointer;
}

/* ==========================================================================
   2. HERO 6-CARD GRID (Exact match to Image 3 + Smooth Performance)
   ========================================================================== */
.hero-grid-section {
  background-color: var(--navy-grid-bg);
  padding: 24px 0 32px 0;
  contain: paint;
}

.photo-cards-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.photo-card {
  position: relative;
  height: 240px;
  border-radius: 2px;
  overflow: hidden;
  cursor: pointer;
  background-color: #0b1a2e;
  border: 1px solid rgba(255, 255, 255, 0.08);
  contain: layout paint;
  transform: translateZ(0);
}

.photo-card-bg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: translateZ(0);
  backface-visibility: hidden;
}

.photo-card-overlay {
  position: absolute;
  inset: 0;
  background-color: rgba(0, 24, 51, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  text-align: center;
  transition: background-color 0.2s ease;
  will-change: background-color;
}

.photo-card-title {
  color: #ffffff;
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.8);
  line-height: 1.25;
}

/* Hover effect: Instant & Smooth Blue Overlay (Image 3: "WE'RE HERE TO HELP!") */
.photo-card:hover .photo-card-overlay,
.photo-card.active-blue .photo-card-overlay {
  background-color: rgba(0, 85, 170, 0.78);
}

/* ==========================================================================
   3. LSPD TRAINING SECTION (Exact match to Image 2)
   ========================================================================== */
.training-section {
  background-color: #ffffff;
  padding: 50px 0 40px 0;
  content-visibility: auto;
  contain-intrinsic-size: 400px;
}

.training-row {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 40px;
  align-items: center;
}

.training-content {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.training-heading {
  font-size: 2.15rem;
  font-weight: 800;
  color: var(--blue-primary);
  line-height: 1.15;
  margin-bottom: 4px;
}

.training-paragraph {
  font-size: 0.95rem;
  color: #333333;
  line-height: 1.6;
}

.btn-academy-video {
  display: inline-block;
  align-self: flex-start;
  background-color: var(--blue-btn);
  color: #ffffff;
  font-size: 0.95rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 12px 28px;
  border: none;
  cursor: pointer;
  margin-top: 8px;
  transition: background-color 0.15s ease;
}

.btn-academy-video:hover {
  background-color: #004d85;
}

.training-image-wrapper {
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
  border-radius: 2px;
  overflow: hidden;
  transform: translateZ(0);
}

.training-image {
  width: 100%;
  height: 380px;
  object-fit: cover;
}

/* ==========================================================================
   4. BLUE CURRICULUM BANNER (Exact match to Image 2)
   ========================================================================== */
.curriculum-banner {
  background-color: var(--blue-curriculum, #0055b8);
  color: #ffffff;
  padding: 18px 0;
  text-align: center;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
}

.curriculum-banner-title {
  color: #ffffff;
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  margin: 0;
}

/* ==========================================================================
   5. CURRICULUM DETAILS (Exact match to Image 2)
   ========================================================================== */
.curriculum-detail-section {
  background-color: #ffffff;
  padding: 40px 0 60px 0;
  content-visibility: auto;
  contain-intrinsic-size: 400px;
}

.curriculum-detail-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
}

.curriculum-facility-image {
  width: 100%;
  height: 280px;
  object-fit: cover;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1);
  border-radius: 2px;
}

.curriculum-info {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.curriculum-topic-header {
  display: flex;
  align-items: center;
  gap: 16px;
}

.curriculum-icon {
  width: 44px;
  height: 44px;
  color: var(--blue-primary);
  flex-shrink: 0;
}

.curriculum-topic-title {
  font-size: 1.7rem;
  font-weight: 800;
  color: var(--blue-primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.curriculum-description {
  font-size: 1rem;
  color: #444444;
  line-height: 1.65;
}

/* Interactive Tabs for Curriculum Pillars */
.curriculum-nav-tabs {
  display: flex;
  gap: 12px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.curriculum-tab-btn {
  padding: 8px 16px;
  background-color: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #334155;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.curriculum-tab-btn:hover {
  background-color: #e2e8f0;
}

.curriculum-tab-btn.active {
  background-color: var(--blue-primary);
  color: #ffffff;
  border-color: var(--blue-primary);
}

/* ==========================================================================
   6. CAREER OPPORTUNITIES & SALARY HIGHLIGHTS
   ========================================================================== */
.salary-perks-section {
  background-color: #f8fafc;
  border-top: 1px solid var(--gray-border);
  border-bottom: 1px solid var(--gray-border);
  padding: 48px 0;
  content-visibility: auto;
  contain-intrinsic-size: 200px;
}

.perks-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.perk-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-left: 4px solid var(--blue-primary);
  padding: 24px;
  border-radius: 2px;
}

.perk-number {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--blue-primary);
  margin-bottom: 6px;
}

.perk-label {
  font-size: 0.88rem;
  color: #475569;
  font-weight: 600;
}

/* ==========================================================================
   7. FOOTER
   ========================================================================== */
.site-footer {
  background-color: var(--navy-header);
  color: #ffffff;
  padding: 48px 0 24px 0;
  border-top: 4px solid var(--blue-curriculum);
  content-visibility: auto;
  contain-intrinsic-size: 300px;
}

.footer-row {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 36px;
  margin-bottom: 36px;
}

.footer-logo-wrap {
  margin-bottom: 16px;
}

.footer-text {
  font-size: 0.85rem;
  color: #cbd5e1;
  line-height: 1.6;
}

.footer-heading {
  font-size: 0.95rem;
  font-weight: 800;
  color: #ffffff;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 16px;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-links a {
  color: #cbd5e1;
  font-size: 0.85rem;
  transition: color 0.15s ease;
}

.footer-links a:hover {
  color: #ffffff;
  text-decoration: underline;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  padding-top: 20px;
  text-align: center;
  font-size: 0.8rem;
  color: #94a3b8;
}

/* ==========================================================================
   8. MODALS (ACADEMY VIDEO, MENTORS, DISCORD AUTH) - ULTRA-FLUID & FAST
   ========================================================================== */
.modal-backdrop,
.modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(3, 10, 24, 0.82);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.08s ease-out, visibility 0.08s linear;
  will-change: opacity, visibility;
  transform: translateZ(0);
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.modal-backdrop.show,
.modal-backdrop.is-open,
.modal-overlay.show,
.modal-overlay.is-open,
.modal-backdrop[style*="display: flex"],
.modal-backdrop[style*="display: block"],
.modal-overlay[style*="display: flex"],
.modal-overlay[style*="display: block"] {
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

.modal-dialog {
  background: #ffffff;
  max-width: 650px;
  width: 100%;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
  transform: scale(0.99) translateY(4px);
  transition: transform 0.08s ease-out, opacity 0.08s ease-out;
  will-change: transform, opacity;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.modal-backdrop.show .modal-dialog,
.modal-backdrop.is-open .modal-dialog,
.modal-overlay.show .modal-dialog,
.modal-overlay.is-open .modal-dialog,
.modal-backdrop[style*="display: flex"] .modal-dialog,
.modal-backdrop[style*="display: block"] .modal-dialog,
.modal-overlay[style*="display: flex"] .modal-dialog,
.modal-overlay[style*="display: block"] .modal-dialog {
  transform: scale(1) translateY(0);
}

.modal-header {
  background-color: var(--navy-header);
  color: #ffffff;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 1.15rem;
  font-weight: 800;
  text-transform: uppercase;
}

.modal-close-btn {
  background: none;
  border: none;
  color: #ffffff;
  font-size: 1.6rem;
  cursor: pointer;
  line-height: 1;
}

.modal-body {
  padding: 24px;
}

/* ==========================================================================
   9. RESPONSIVE DESIGN (Adaptive Breakpoints & Clean Mobile Flow)
   ========================================================================== */
@media (max-width: 1180px) {
  .header-container {
    height: 70px;
    padding: 0 16px;
  }
  .mobile-nav-toggle {
    display: block;
  }
  .nav-menu {
    display: none;
    position: absolute;
    top: 70px;
    left: 0;
    right: 0;
    width: 100%;
    background-color: var(--navy-header);
    flex-direction: column;
    align-items: stretch;
    padding: 16px 20px 24px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.6);
    box-sizing: border-box;
    max-height: calc(100vh - 70px);
    overflow-y: auto;
  }
  .nav-menu.mobile-open {
    display: flex;
  }
  .nav-item {
    width: 100%;
  }
  .nav-link {
    padding: 10px 12px;
    font-size: 0.88rem;
    width: 100%;
    justify-content: space-between;
  }
  .dropdown-menu {
    position: static;
    width: 100%;
    box-shadow: none;
    border: none;
    border-left: 3px solid var(--orange-accent);
    padding-left: 14px;
    margin-top: 4px;
    margin-bottom: 8px;
    background-color: #001a40;
  }
  .dropdown-item a {
    padding: 8px 12px;
  }
  .lang-selector-nav {
    width: 100%;
  }
  .lang-toggle-btn {
    width: 100%;
    justify-content: space-between;
    padding: 10px 12px;
  }
  .nav-search-form {
    margin: 14px 0 6px 0;
    width: 100%;
  }
  .search-pill-input {
    width: 100%;
    font-size: 0.88rem;
    padding: 10px 16px;
  }
  .search-pill-input:focus {
    width: 100%;
  }
  .nav-auth-item {
    margin: 8px 0 0 0;
    width: 100%;
  }
  .btn-discord-login {
    width: 100%;
    justify-content: center;
    padding: 10px 16px;
    font-size: 0.88rem;
  }
  .discord-profile-dropdown {
    width: 100%;
  }
  .profile-pill-btn {
    width: 100%;
    justify-content: space-between;
    padding: 8px 14px 8px 8px;
    font-size: 0.88rem;
  }
  .profile-dropdown-menu {
    position: static;
    width: 100%;
    box-shadow: none;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-left: 3px solid var(--orange-accent);
    margin-top: 8px;
    background-color: #001533;
  }
}

@media (max-width: 1024px) {
  .photo-cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .training-row {
    grid-template-columns: 1fr;
  }
  .training-image {
    height: 300px;
  }
  .curriculum-detail-row {
    grid-template-columns: 1fr;
  }
  .perks-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .footer-row {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  .photo-cards-grid {
    grid-template-columns: 1fr;
  }
  .perks-grid {
    grid-template-columns: 1fr;
  }
  .footer-row {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   BOUTON FLOTTANT ANIMÉ DU THÈME (LUNE / SOLEIL) & SYSTÈME SOMBRE / CLAIR
   ========================================================================== */

/* Animation de transition fluide */
html.theme-transitioning,
html.theme-transitioning *,
html.theme-transitioning *::before,
html.theme-transitioning *::after {
  transition: background-color 0.35s ease, border-color 0.35s ease, color 0.35s ease, box-shadow 0.35s ease !important;
  transition-delay: 0s !important;
}

/* =========================================================================
   BOUTON UNIVERSEL DE THÈME (SOLEIL / LUNE) - EN-TÊTE DU SITE (HEADER)
   ========================================================================= */
.theme-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  padding: 0;
  margin: 0;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 50%;
  color: #ffffff;
  cursor: pointer;
  position: relative;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1),
              background-color 0.25s ease,
              border-color 0.25s ease,
              box-shadow 0.25s ease,
              color 0.25s ease;
  vertical-align: middle;
  outline: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  flex-shrink: 0;
}

.theme-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.45);
  color: #ffffff;
  transform: translateY(-1px) scale(1.08);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}

.theme-toggle-btn:active {
  transform: translateY(0) scale(0.92);
}

.theme-toggle-btn:focus-visible {
  outline: 2px solid #38bdf8;
  outline-offset: 2px;
}

/* Conteneur d'icône Soleil / Lune centré */
.theme-toggle-btn .theme-toggle-icon-wrap,
.theme-toggle-btn .theme-btn-icon-wrap {
  position: relative;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.theme-toggle-btn svg,
.theme-toggle-btn .theme-icon,
.theme-toggle-btn .sun-icon,
.theme-toggle-btn .moon-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 19px;
  height: 19px;
  margin-top: -9.5px;
  margin-left: -9.5px;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
              opacity 0.25s ease,
              color 0.25s ease;
  pointer-events: none;
}

/* ÉTAT MODE CLAIR (Par Défaut) : Affiche la Lune */
html:not([data-theme="dark"]) .theme-toggle-btn .sun-icon {
  opacity: 0;
  transform: rotate(-90deg) scale(0);
  pointer-events: none;
}

html:not([data-theme="dark"]) .theme-toggle-btn .moon-icon {
  opacity: 1;
  transform: rotate(0deg) scale(1);
  color: #cbd5e1;
}

html:not([data-theme="dark"]) .theme-toggle-btn:hover .moon-icon {
  color: #ffffff;
  filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.6));
}

/* ÉTAT MODE SOMBRE : Affiche le Soleil Doré */
html[data-theme="dark"] .theme-toggle-btn {
  background: rgba(245, 158, 11, 0.14);
  border-color: rgba(245, 158, 11, 0.38);
  color: #fbbf24;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3), 0 0 10px rgba(245, 158, 11, 0.15);
}

html[data-theme="dark"] .theme-toggle-btn:hover {
  background: rgba(245, 158, 11, 0.24);
  border-color: #f59e0b;
  color: #fef08a;
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.35), 0 0 16px rgba(245, 158, 11, 0.28);
}

html[data-theme="dark"] .theme-toggle-btn .moon-icon {
  opacity: 0;
  transform: rotate(90deg) scale(0);
  pointer-events: none;
}

html[data-theme="dark"] .theme-toggle-btn .sun-icon {
  opacity: 1;
  transform: rotate(0deg) scale(1);
  color: #fbbf24;
  filter: drop-shadow(0 0 5px rgba(245, 158, 11, 0.75));
}

html[data-theme="dark"] .theme-toggle-btn:hover .sun-icon {
  color: #fef08a;
  filter: drop-shadow(0 0 8px rgba(245, 158, 11, 0.95));
}

/* Intégration dans le menu de navigation index.html */
.theme-toggle-nav-item {
  display: flex;
  align-items: center;
  margin-left: 10px;
}

/* Bouton Flottant en Bas à Droite */
.theme-toggle-floating {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  cursor: pointer;
  border: 2px solid #cbd5e1;
  background: #ffffff;
  color: #f59e0b;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.16), 0 2px 6px rgba(0, 0, 0, 0.08);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
              box-shadow 0.3s ease,
              background 0.3s ease,
              border-color 0.3s ease,
              color 0.3s ease;
  outline: none;
  padding: 0;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.theme-toggle-floating:hover {
  transform: scale(1.12) translateY(-3px);
  box-shadow: 0 8px 26px rgba(245, 158, 11, 0.35), 0 4px 10px rgba(0, 0, 0, 0.12);
  border-color: #f59e0b;
}

.theme-toggle-floating:active {
  transform: scale(0.94);
}

.theme-icon-container {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-sun-moon-svg {
  width: 26px;
  height: 26px;
  overflow: visible;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Éléments du SVG en Mode Clair (Soleil) */
.theme-toggle-floating .theme-sun-core {
  fill: #f59e0b;
  stroke: #f59e0b;
  stroke-width: 2;
  transition: r 0.45s cubic-bezier(0.4, 0, 0.2, 1),
              fill 0.35s ease,
              stroke 0.35s ease;
}

.theme-toggle-floating .theme-mask-moon-shadow {
  transition: cx 0.45s cubic-bezier(0.4, 0, 0.2, 1),
              cy 0.45s cubic-bezier(0.4, 0, 0.2, 1),
              r 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}

.theme-toggle-floating .theme-sun-rays {
  transform-origin: 12px 12px;
  transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1),
              opacity 0.3s ease;
  stroke: #f59e0b;
}

.theme-toggle-floating .theme-night-stars {
  transform-origin: 12px 12px;
  transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1),
              opacity 0.35s ease;
  opacity: 0;
  transform: scale(0);
  fill: #38bdf8;
}

/* Info-Bulle / Tooltip Flottant */
.theme-toggle-tooltip {
  position: absolute;
  right: calc(100% + 14px);
  top: 50%;
  transform: translateY(-50%) translateX(8px);
  background: rgba(15, 23, 42, 0.94);
  color: #ffffff;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.theme-toggle-floating:hover .theme-toggle-tooltip {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

/* ==========================================================================
   ÉTAT ACTIF : MODE SOMBRE (LUNE NOCTURNE ANIMÉE)
   ========================================================================== */
html[data-theme="dark"] .theme-toggle-floating {
  background: #111a2e;
  border-color: #38bdf8;
  color: #38bdf8;
  box-shadow: 0 4px 22px rgba(56, 189, 248, 0.35), 0 0 12px rgba(56, 189, 248, 0.2);
}

html[data-theme="dark"] .theme-toggle-floating:hover {
  border-color: #7dd3fc;
  box-shadow: 0 8px 30px rgba(56, 189, 248, 0.55), 0 0 20px rgba(56, 189, 248, 0.3);
}

html[data-theme="dark"] .theme-sun-moon-svg {
  transform: rotate(-30deg);
}

html[data-theme="dark"] .theme-toggle-floating .theme-sun-core {
  r: 9px;
  fill: #38bdf8;
  stroke: #38bdf8;
}

html[data-theme="dark"] .theme-toggle-floating .theme-mask-moon-shadow {
  cx: 16.5px;
  cy: 6.5px;
  r: 7.5px;
}

html[data-theme="dark"] .theme-toggle-floating .theme-sun-rays {
  transform: scale(0) rotate(90deg);
  opacity: 0;
}

html[data-theme="dark"] .theme-toggle-floating .theme-night-stars {
  opacity: 1;
  transform: scale(1);
}

@media (max-width: 600px) {
  .theme-toggle-floating {
    bottom: 18px;
    right: 18px;
    width: 46px;
    height: 46px;
  }
  .theme-sun-moon-svg {
    width: 22px;
    height: 22px;
  }
}

/* ==========================================================================
   PALETTE DE COULEURS EN MODE SOMBRE (THÈME DISPATCH / LSPD NIGHT OPS)
   ========================================================================== */
html[data-theme="dark"] {
  /* Public Portal Variables */
  --navy-header: #090d18;
  --navy-grid-bg: #0b1120;
  --navy-dark: #060912;
  --blue-primary: #38bdf8;
  --blue-curriculum: #0d2847;
  --blue-btn: #0284c7;
  --blue-ribbon: #0369a1;
  --gold-border: #f59e0b;
  --orange-accent: #f97316;
  --white: #151e32;
  --gray-bg: #0b1120;
  --gray-border: #22304d;
  --text-dark: #f1f5f9;
  --text-muted: #94a3b8;
  --text-color: #f1f5f9;
  --color-scheme: dark;
  color-scheme: dark;

  /* Admin & Permissions Variables - Titres & textes clairs et contrastés */
  --admin-navy: #38bdf8;
  --admin-blue-banner: #0d2847;
  --admin-blue-accent: #0284c7;
  --admin-orange: #f97316;
  --admin-bg: #0b1120;
  --admin-card: #151e32;
  --admin-card-border: #22304d;
  --admin-border: #22304d;
  --admin-input-bg: #0f172a;
  --admin-text: #f1f5f9;
  --admin-text-color: #f1f5f9;
  --admin-text-dark: #f1f5f9;
  --admin-text-muted: #94a3b8;
  --admin-gold: #f59e0b;
  --admin-success: #10b981;
  --admin-danger: #ef4444;

  /* Bypass Theme Variables */
  --color-bypass-gold: #f59e0b;
  --color-bypass-bg: #261604;
  --color-bypass-border: #854d0e;
}

/* Fond principal et corps de page */
html[data-theme="dark"] body,
html[data-theme="dark"] body.admin-body,
html[data-theme="dark"] body.perm-body {
  background-color: #0b1120 !important;
  color: #f1f5f9 !important;
}

/* ==========================================================================
   1. NAVIGATION COMMUNE & HEADER
   ========================================================================== */
html[data-theme="dark"] .site-header {
  background-color: #060c18 !important;
  border-bottom: 1px solid #1a263e !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45) !important;
}

html[data-theme="dark"] .nav-link {
  color: #ffffff !important;
}

html[data-theme="dark"] .nav-link:hover {
  background-color: transparent !important;
  opacity: 0.82;
}

html[data-theme="dark"] .nav-chevron {
  color: #ffffff !important;
}

html[data-theme="dark"] .dropdown-menu {
  background-color: #0b1322 !important;
  border: 1px solid #1e2e4a !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5) !important;
}

html[data-theme="dark"] .dropdown-item a {
  color: #e2e8f0 !important;
}

html[data-theme="dark"] .dropdown-item a:hover {
  background-color: #1e2942 !important;
  color: #38bdf8 !important;
}

html[data-theme="dark"] .profile-dropdown-menu {
  background-color: #101728 !important;
  border: 1px solid #22304d !important;
  border-left: 3px solid #f97316 !important;
}

html[data-theme="dark"] .profile-dropdown-item {
  color: #e2e8f0 !important;
}

html[data-theme="dark"] .profile-dropdown-item:hover {
  background-color: #1e2942 !important;
  color: #38bdf8 !important;
}

/* ==========================================================================
   2. PORTAIL PUBLIC (index.html)
   ========================================================================== */
html[data-theme="dark"] .hero-grid-section {
  background-color: #070c16 !important;
}

html[data-theme="dark"] .photo-card {
  background-color: #0c1526 !important;
  border-color: #1e293b !important;
}

html[data-theme="dark"] .photo-card-overlay {
  background-color: rgba(3, 7, 18, 0.6) !important;
}

html[data-theme="dark"] .photo-card:hover .photo-card-overlay {
  background-color: rgba(2, 132, 199, 0.75) !important;
}

html[data-theme="dark"] .training-section {
  background-color: #0b1120 !important;
}

html[data-theme="dark"] .training-heading {
  color: #38bdf8 !important;
}

html[data-theme="dark"] .training-paragraph {
  color: #cbd5e1 !important;
}

html[data-theme="dark"] .btn-academy-video {
  background-color: #0284c7 !important;
  color: #ffffff !important;
}

html[data-theme="dark"] .btn-academy-video:hover {
  background-color: #0369a1 !important;
}

html[data-theme="dark"] .training-image-wrapper {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45) !important;
  border: 1px solid #22304d !important;
}

html[data-theme="dark"] .curriculum-banner {
  background-color: #0d2847 !important;
  border-bottom: 1px solid #1e3a5f !important;
}

html[data-theme="dark"] .curriculum-banner-title {
  color: #ffffff !important;
}

html[data-theme="dark"] .curriculum-detail-section {
  background-color: #0b1120 !important;
}

html[data-theme="dark"] .curriculum-topic-title {
  color: #38bdf8 !important;
}

html[data-theme="dark"] .curriculum-icon {
  color: #38bdf8 !important;
}

html[data-theme="dark"] .curriculum-description {
  color: #cbd5e1 !important;
}

html[data-theme="dark"] .curriculum-facility-image {
  border: 1px solid #22304d !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4) !important;
}

html[data-theme="dark"] .curriculum-tab-btn {
  background-color: #151e32 !important;
  border: 1px solid #22304d !important;
  color: #cbd5e1 !important;
}

html[data-theme="dark"] .curriculum-tab-btn:hover {
  background-color: #1c2740 !important;
  color: #38bdf8 !important;
  border-color: #38bdf8 !important;
}

html[data-theme="dark"] .curriculum-tab-btn.active {
  background-color: #0284c7 !important;
  border-color: #0284c7 !important;
  color: #ffffff !important;
}

html[data-theme="dark"] .salary-perks-section {
  background-color: #070c16 !important;
}

html[data-theme="dark"] .perk-card {
  background-color: #151e32 !important;
  border: 1px solid #22304d !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3) !important;
}

html[data-theme="dark"] .perk-number {
  color: #38bdf8 !important;
}

html[data-theme="dark"] .perk-label {
  color: #94a3b8 !important;
}

html[data-theme="dark"] .site-footer {
  background-color: #060912 !important;
  border-top: 1px solid #1a263e !important;
}

html[data-theme="dark"] .footer-col-title {
  color: #38bdf8 !important;
}

html[data-theme="dark"] .footer-link {
  color: #94a3b8 !important;
}

html[data-theme="dark"] .footer-link:hover {
  color: #ffffff !important;
}

html[data-theme="dark"] .footer-bottom {
  border-top-color: #1a263e !important;
  color: #64748b !important;
}

html[data-theme="dark"] .discord-server-card {
  background-color: #151e32 !important;
  border-color: #22304d !important;
}

html[data-theme="dark"] .discord-server-card.is-hq {
  background-color: #0c1a32 !important;
  border-color: #0284c7 !important;
}

html[data-theme="dark"] .discord-server-name {
  color: #38bdf8 !important;
}

html[data-theme="dark"] .discord-server-id {
  color: #94a3b8 !important;
}

/* ==========================================================================
   3. PANNEAU D'ADMINISTRATION (admin.php)
   ========================================================================== */
html[data-theme="dark"] .admin-top-banner {
  background-color: #0d2847 !important;
  border-bottom: 1px solid #1e3a5f !important;
}

html[data-theme="dark"] .admin-banner-title {
  color: #ffffff !important;
}

html[data-theme="dark"] .admin-banner-subtitle {
  color: #93c5fd !important;
}

html[data-theme="dark"] .admin-tabs {
  background-color: #090d18 !important;
  border: 1px solid #22304d !important;
}

html[data-theme="dark"] .admin-tab-btn {
  color: #94a3b8 !important;
}

html[data-theme="dark"] .admin-tab-btn:hover {
  background-color: rgba(255, 255, 255, 0.08) !important;
  color: #f8fafc !important;
}

html[data-theme="dark"] .admin-tab-btn.active {
  background-color: #0284c7 !important;
  color: #ffffff !important;
}

html[data-theme="dark"] .admin-card {
  background-color: #151e32 !important;
  border: 1px solid #22304d !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3) !important;
}

html[data-theme="dark"] .admin-card-title {
  color: #38bdf8 !important;
}

html[data-theme="dark"] .admin-card-subtitle {
  color: #94a3b8 !important;
}

html[data-theme="dark"] .form-label {
  color: #e2e8f0 !important;
}

html[data-theme="dark"] .form-hint {
  color: #64748b !important;
}

html[data-theme="dark"] .form-input,
html[data-theme="dark"] .form-select,
html[data-theme="dark"] .form-textarea,
html[data-theme="dark"] input[type="text"],
html[data-theme="dark"] select,
html[data-theme="dark"] textarea {
  background-color: #0e1626 !important;
  border: 1px solid #2b3a58 !important;
  color: #f8fafc !important;
}

html[data-theme="dark"] .form-input:focus,
html[data-theme="dark"] .form-select:focus,
html[data-theme="dark"] .form-textarea:focus {
  border-color: #38bdf8 !important;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2) !important;
}

html[data-theme="dark"] .admin-table {
  background-color: #151e32 !important;
  border-color: #22304d !important;
}

html[data-theme="dark"] .admin-table th {
  background-color: #090d18 !important;
  color: #38bdf8 !important;
  border-bottom: 2px solid #0284c7 !important;
}

html[data-theme="dark"] .admin-table td {
  border-color: #22304d !important;
  color: #e2e8f0 !important;
}

html[data-theme="dark"] .admin-table tr:hover td {
  background-color: #1c2740 !important;
}

html[data-theme="dark"] .admin-table .form-input,
html[data-theme="dark"] .admin-table .form-select {
  background-color: #0e1626 !important;
  border-color: #2b3a58 !important;
  color: #f8fafc !important;
}

html[data-theme="dark"] .btn-add-item {
  background-color: #0284c7 !important;
  color: #ffffff !important;
}

html[data-theme="dark"] .btn-add-item:hover {
  background-color: #0369a1 !important;
}

html[data-theme="dark"] .btn-danger-sm {
  background-color: #3b1212 !important;
  border-color: #7f1d1d !important;
  color: #fca5a5 !important;
}

html[data-theme="dark"] .btn-danger-sm:hover {
  background-color: #501717 !important;
}

html[data-theme="dark"] .badge-primary-server {
  background-color: #062319 !important;
  border-color: #065f46 !important;
  color: #6ee7b7 !important;
}

html[data-theme="dark"] .embed-preview-card {
  background-color: #1e1f22 !important;
}

html[data-theme="dark"] .embed-preview-title {
  color: #00a8fc !important;
}

html[data-theme="dark"] .embed-preview-desc {
  color: #dbdee1 !important;
}

html[data-theme="dark"] .footer-preview-box {
  background-color: #060912 !important;
  border-color: #22304d !important;
}

/* ==========================================================================
   4. STUDIO DES PERMISSIONS (permissions.php) - HARMONISATION COMPLETE
   ========================================================================== */
html[data-theme="dark"] .target-tabs-bar {
  border-bottom-color: #22304d !important;
}

html[data-theme="dark"] .target-tab-pill {
  background-color: #151e32 !important;
  border-color: #22304d !important;
  color: #e2e8f0 !important;
}

html[data-theme="dark"] .target-tab-pill:hover {
  background-color: #1c2740 !important;
  border-color: #38bdf8 !important;
}

html[data-theme="dark"] .target-tab-pill.active {
  background-color: #0284c7 !important;
  border-color: #38bdf8 !important;
  color: #ffffff !important;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.4) !important;
}

html[data-theme="dark"] .target-tab-pill:not(.active) .pill-badge {
  background-color: #22304d !important;
  color: #cbd5e1 !important;
}

html[data-theme="dark"] .target-header-card {
  background-color: #151e32 !important;
  border-color: #22304d !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3) !important;
}

html[data-theme="dark"] .target-title-text {
  color: #f8fafc !important;
}

html[data-theme="dark"] .target-id-sub {
  color: #94a3b8 !important;
}

html[data-theme="dark"] #statsCounterText {
  color: #94a3b8 !important;
}

html[data-theme="dark"] .bypass-switch-box {
  background-color: #261604 !important;
  border-color: #854d0e !important;
}

html[data-theme="dark"] .bypass-switch-text {
  color: #fde68a !important;
}

html[data-theme="dark"] .bypass-active-banner,
html[data-theme="dark"] #activeBypassBanner {
  background: linear-gradient(90deg, #241403 0%, #3a1d04 100%) !important;
  border: 1px solid #b45309 !important;
  border-left: 5px solid #f59e0b !important;
  color: #fef3c7 !important;
}

html[data-theme="dark"] .btn-quick-cat {
  background-color: #0e1626 !important;
  border-color: #2b3a58 !important;
  color: #cbd5e1 !important;
}

html[data-theme="dark"] .btn-quick-cat:hover {
  background-color: #1c2740 !important;
  border-color: #38bdf8 !important;
  color: #ffffff !important;
}

html[data-theme="dark"] #btnDeleteActiveTarget {
  background-color: #3b1212 !important;
  border-color: #7f1d1d !important;
  color: #fca5a5 !important;
}

html[data-theme="dark"] #btnDeleteActiveTarget:hover {
  background-color: #501717 !important;
  border-color: #991b1b !important;
}

/* Recherche & Filtres Studio */
html[data-theme="dark"] .perm-search-bar {
  background-color: #151e32 !important;
  border-color: #22304d !important;
}

html[data-theme="dark"] .perm-search-input {
  background-color: #0e1626 !important;
  border-color: #2b3a58 !important;
  color: #f8fafc !important;
}

html[data-theme="dark"] .perm-search-input::placeholder {
  color: #64748b !important;
}

html[data-theme="dark"] .search-icon-pos {
  color: #64748b !important;
}

html[data-theme="dark"] .btn-filter-pill {
  background-color: #0e1626 !important;
  border-color: #2b3a58 !important;
  color: #cbd5e1 !important;
}

html[data-theme="dark"] .btn-filter-pill:hover {
  background-color: #1c2740 !important;
  color: #38bdf8 !important;
}

html[data-theme="dark"] .btn-filter-pill.active {
  background-color: #0284c7 !important;
  border-color: #0284c7 !important;
  color: #ffffff !important;
}

/* Cartes & En-têtes de Catégorie (Résolution du contraste) */
html[data-theme="dark"] .perm-category-card {
  background-color: #151e32 !important;
  border-color: #22304d !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25) !important;
}

html[data-theme="dark"] .perm-category-card:hover {
  border-color: #2b3a58 !important;
}

html[data-theme="dark"] .perm-category-header {
  background-color: #101726 !important;
  border-bottom-color: #22304d !important;
}

html[data-theme="dark"] .perm-category-header:hover {
  background-color: #141d30 !important;
}

html[data-theme="dark"] .category-name-text {
  color: #f1f5f9 !important;
}

html[data-theme="dark"] .category-desc-text {
  color: #94a3b8 !important;
}

html[data-theme="dark"] .category-icon-wrap {
  background-color: rgba(2, 132, 199, 0.2) !important;
  color: #38bdf8 !important;
}

html[data-theme="dark"] .category-count-badge {
  background-color: #22304d !important;
  color: #cbd5e1 !important;
}

html[data-theme="dark"] .category-count-badge.is-full {
  background-color: #064e3b !important;
  color: #6ee7b7 !important;
}

html[data-theme="dark"] .cat-chevron {
  color: #94a3b8 !important;
}

/* Grille & Cartes de Permissions Individuelles */
html[data-theme="dark"] .perm-grid {
  background-color: #151e32 !important;
}

html[data-theme="dark"] .perm-card-item {
  background-color: #0e1626 !important;
  border-color: #22304d !important;
}

html[data-theme="dark"] .perm-card-item:hover {
  background-color: #131d30 !important;
  border-color: #38bdf8 !important;
}

html[data-theme="dark"] .perm-name-label {
  color: #f1f5f9 !important;
}

html[data-theme="dark"] .perm-desc-label {
  color: #94a3b8 !important;
}

html[data-theme="dark"] .perm-code-chip {
  background-color: rgba(2, 132, 199, 0.15) !important;
  border-color: rgba(56, 189, 248, 0.3) !important;
  color: #38bdf8 !important;
}

/* Permission accordée (Vert sombre harmonieux) */
html[data-theme="dark"] .perm-card-item.is-granted {
  background-color: #071f17 !important;
  border-color: #059669 !important;
}

html[data-theme="dark"] .perm-card-item.is-granted .perm-name-label {
  color: #6ee7b7 !important;
}

/* Permission en mode Bypass (Or sombre chaleureux) */
html[data-theme="dark"] .perm-card-item.is-bypass {
  background-color: #241403 !important;
  border-color: #b45309 !important;
}

html[data-theme="dark"] .perm-card-item.is-bypass .perm-name-label {
  color: #fde68a !important;
}

/* Interrupteurs Switch UI en Mode Sombre */
html[data-theme="dark"] .switch-ui-slider {
  background-color: #334155 !important;
}

html[data-theme="dark"] .switch-ui input:checked + .switch-ui-slider {
  background-color: #10b981 !important;
}

html[data-theme="dark"] .switch-gold input:checked + .switch-ui-slider {
  background-color: #f59e0b !important;
}

/* ==========================================================================
   5. MODALES ET ÉCRANS DE VERROUILLAGE
   ========================================================================== */
html[data-theme="dark"] .modal-backdrop {
  background-color: rgba(3, 7, 18, 0.85) !important;
}

html[data-theme="dark"] .modal-dialog {
  background-color: #131b2e !important;
  border: 1px solid #2a3a5a !important;
  color: #f1f5f9 !important;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.7) !important;
}

html[data-theme="dark"] .modal-header {
  background-color: #090d18 !important;
  border-bottom: 1px solid #22304d !important;
}

html[data-theme="dark"] .modal-title {
  color: #f8fafc !important;
}

html[data-theme="dark"] .modal-close-btn {
  color: #94a3b8 !important;
}

html[data-theme="dark"] .modal-close-btn:hover {
  color: #f8fafc !important;
}

html[data-theme="dark"] .modal-body label {
  color: #cbd5e1 !important;
}

html[data-theme="dark"] .modal-body p {
  color: #94a3b8 !important;
}

html[data-theme="dark"] .admin-lockscreen,
html[data-theme="dark"] .perm-lockscreen {
  background: #070c16 !important;
}

html[data-theme="dark"] .lockscreen-card,
html[data-theme="dark"] .perm-lockscreen-card {
  background-color: #151e32 !important;
  border-color: #22304d !important;
  color: #f8fafc !important;
}

html[data-theme="dark"] .lockscreen-title {
  color: #38bdf8 !important;
}

html[data-theme="dark"] .lockscreen-subtitle {
  color: #94a3b8 !important;
}

html[data-theme="dark"] .lockscreen-alert,
html[data-theme="dark"] #lockscreenAlert {
  background-color: #2a1215 !important;
  border-left-color: #ef4444 !important;
  color: #fca5a5 !important;
}

/* ==========================================================================
   8. MODAL CANDIDATURE DIRECT EDITING
   ========================================================================== */
.btn-modal-perm-edit {
  background: #0284c7;
  color: #ffffff;
  border: none;
  border-radius: 4px;
  padding: 5px 12px;
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-modal-perm-edit:hover {
  background: #0369a1;
}

.btn-sm-action {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
  border-radius: 4px;
  padding: 5px 12px;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-sm-action:hover {
  background: #dbeafe;
}

.btn-cancel-sm {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  padding: 7px 16px;
  font-size: 0.80rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-cancel-sm:hover {
  background: #e2e8f0;
}

.btn-save-sm {
  background: #059669;
  color: #ffffff;
  border: none;
  border-radius: 4px;
  padding: 7px 18px;
  font-size: 0.80rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-save-sm:hover {
  background: #047857;
}

.req-edit-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.req-edit-row .req-input-item {
  flex: 1;
  padding: 7px 12px;
  font-size: 0.85rem;
}

.btn-delete-req-row {
  background: #fee2e2;
  color: #dc2626;
  border: 1px solid #fecaca;
  border-radius: 4px;
  padding: 7px 10px;
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-delete-req-row:hover {
  background: #fecaca;
}

html[data-theme="dark"] .btn-modal-perm-edit {
  background: #0284c7;
}

html[data-theme="dark"] .btn-sm-action {
  background: #0c2d48;
  color: #38bdf8;
  border-color: #0284c7;
}

html[data-theme="dark"] .btn-sm-action:hover {
  background: #0e3b60;
}

html[data-theme="dark"] .btn-cancel-sm {
  background: #1e293b;
  color: #94a3b8;
  border-color: #334155;
}

html[data-theme="dark"] .btn-cancel-sm:hover {
  background: #27354f;
  color: #f1f5f9;
}

html[data-theme="dark"] .btn-delete-req-row {
  background: #3e1b1b;
  color: #fca5a5;
  border-color: #7f1d1d;
}

html[data-theme="dark"] .btn-delete-req-row:hover {
  background: #502323;
}

/* =============================================================================
   SYSTÈME DE GESTION DES CARTES D'ACCUEIL & MODALES MULTI-STYLES
   ============================================================================= */

/* Barre administrative au-dessus des cartes */
.cards-admin-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(90deg, #001f4d 0%, #002b66 100%);
  border: 1px solid #0284c7;
  border-radius: 6px;
  padding: 10px 16px;
  margin-bottom: 16px;
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(0, 43, 102, 0.25);
  flex-wrap: wrap;
  gap: 10px;
}

html[data-theme="dark"] .cards-admin-toolbar {
  background: linear-gradient(90deg, #091322 0%, #0f1f38 100%);
  border-color: #1e3a66;
}

.cards-admin-info {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
}

.cards-admin-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
}

.cards-admin-count {
  background: rgba(255, 255, 255, 0.16);
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  color: #38bdf8;
}

.cards-admin-btns {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-card-add-new {
  background: linear-gradient(180deg, #0284c7 0%, #0369a1 100%);
  border: 1px solid #38bdf8;
  color: #ffffff;
  padding: 6px 14px;
  border-radius: 4px;
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.btn-card-add-new:hover {
  background: linear-gradient(180deg, #0369a1 0%, #075985 100%);
  transform: translateY(-1px);
}

.btn-card-admin-dashboard {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #ffffff;
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.btn-card-admin-dashboard:hover {
  background: rgba(255, 255, 255, 0.22);
}

/* Boutons d'action sur chaque carte */
.photo-card-admin-actions {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  gap: 6px;
  z-index: 10;
  opacity: 0.92;
  transition: opacity 0.15s ease;
}

.photo-card:hover .photo-card-admin-actions {
  opacity: 1;
}

.btn-card-edit-pill,
.btn-card-delete-pill {
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 800;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
  transition: all 0.15s ease;
}

.btn-card-edit-pill {
  background: #0284c7;
  color: #ffffff;
}

.btn-card-edit-pill:hover {
  background: #0369a1;
  transform: scale(1.04);
}

.btn-card-delete-pill {
  background: #dc2626;
  color: #ffffff;
}

.btn-card-delete-pill:hover {
  background: #b91c1c;
  transform: scale(1.04);
}

.photo-card-badge-tag {
  position: absolute;
  top: 14px;
  left: 14px;
  background: rgba(0, 43, 102, 0.85);
  border: 1px solid rgba(56, 189, 248, 0.5);
  color: #38bdf8;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  padding: 3px 8px;
  border-radius: 3px;
  text-transform: uppercase;
  z-index: 5;
}

.photo-card-subtitle {
  font-size: 0.82rem;
  color: #cbd5e1;
  margin-top: 6px;
  font-weight: 600;
  text-shadow: 0 1px 3px rgba(0,0,0,0.8);
  max-width: 90%;
}

/* Modales Multi-Styles */
.modal-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 8px;
}

/* 1. Style Classic (JoinLAPD Éditorial) */
.modal-style-classic .modal-dialog {
  max-width: 680px;
}
.modal-style-classic .classic-quote-box {
  background: #f1f5f9;
  border-left: 4px solid #002b66;
  padding: 16px;
  border-radius: 0 4px 4px 0;
  margin: 16px 0 20px 0;
}
html[data-theme="dark"] .modal-style-classic .classic-quote-box {
  background: #0f172a;
  border-left-color: #38bdf8;
}
.modal-style-classic .classic-highlight-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 10px;
  font-size: 0.9rem;
  line-height: 1.5;
}

/* 2. Style Grid (Spécialités & Unités) */
.modal-style-grid .modal-dialog {
  max-width: 760px;
}
.modal-style-grid .grid-items-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
  margin: 18px 0 22px 0;
}
.modal-style-grid .grid-spec-card {
  border: 1px solid #e2e8f0;
  background: #fafafa;
  border-radius: 4px;
  padding: 14px;
  transition: all 0.15s ease;
}
.modal-style-grid .grid-spec-card:hover {
  border-color: #0284c7;
  background: #f0f9ff;
  transform: translateY(-2px);
}
html[data-theme="dark"] .modal-style-grid .grid-spec-card {
  background: #0b1322;
  border-color: #1e293b;
}
html[data-theme="dark"] .modal-style-grid .grid-spec-card:hover {
  background: #0f1f38;
  border-color: #38bdf8;
}

/* 3. Style Tactical (Dossier Départemental / Fiche Militaire) */
.modal-style-tactical .modal-dialog {
  max-width: 720px;
  border: 2px solid #002b66;
}
html[data-theme="dark"] .modal-style-tactical .modal-dialog {
  border-color: #0284c7;
}
.modal-style-tactical .tactical-header-banner {
  background: #001737;
  color: #ffffff;
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid #d97706;
}
.modal-style-tactical .tactical-stamp {
  border: 2px dashed #dc2626;
  color: #dc2626;
  font-size: 0.72rem;
  font-weight: 900;
  padding: 4px 8px;
  text-transform: uppercase;
  transform: rotate(-2deg);
  letter-spacing: 1px;
}
.modal-style-tactical .tactical-meta-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  background: rgba(0,0,0,0.03);
  padding: 10px 14px;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  margin: 14px 0;
  font-size: 0.78rem;
}
html[data-theme="dark"] .modal-style-tactical .tactical-meta-grid {
  background: #070d19;
  border-color: #1e293b;
}
.modal-style-tactical .tactical-kpis-row {
  display: flex;
  gap: 12px;
  margin: 14px 0;
}
.modal-style-tactical .tactical-kpi-box {
  flex: 1;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-top: 3px solid #0284c7;
  padding: 10px;
  text-align: center;
  border-radius: 3px;
}
html[data-theme="dark"] .modal-style-tactical .tactical-kpi-box {
  background: #0a1120;
  border-color: #1e2e4a;
  border-top-color: #38bdf8;
}

/* 4. Style Showcase (Grande Vitrine Visuelle / Hero Banner) */
.modal-style-showcase .modal-dialog {
  max-width: 800px;
  overflow: hidden;
}
.modal-style-showcase .showcase-hero-banner {
  height: 200px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  padding: 24px;
}
.modal-style-showcase .showcase-hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.65);
}
.modal-style-showcase .showcase-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.1) 0%, rgba(0, 27, 68, 0.95) 100%);
}
.modal-style-showcase .showcase-hero-content {
  position: relative;
  z-index: 2;
  color: #ffffff;
}
.modal-style-showcase .showcase-stats-bar {
  display: flex;
  gap: 16px;
  margin: 18px 0;
  flex-wrap: wrap;
}
.modal-style-showcase .showcase-stat-pill {
  flex: 1;
  min-width: 140px;
  background: linear-gradient(135deg, #002b66 0%, #001737 100%);
  color: #ffffff;
  padding: 14px 16px;
  border-radius: 6px;
  text-align: center;
  border: 1px solid rgba(56, 189, 248, 0.3);
}
.modal-style-showcase .showcase-stat-val {
  font-size: 1.6rem;
  font-weight: 900;
  color: #38bdf8;
  line-height: 1.1;
}
.modal-style-showcase .showcase-stat-lbl {
  font-size: 0.74rem;
  color: #cbd5e1;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 4px;
}

/* ==========================================================================
   ÉDITEUR VISUEL DE MODALES MULTI-STYLES (MODAL EDITOR)
   ========================================================================== */

/* Sélecteur visuel de styles avec cartes cliquables */
.style-picker-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}
@media (max-width: 640px) {
  .style-picker-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
.style-picker-card {
  border: 2px solid #cbd5e1;
  background: var(--admin-card, #ffffff);
  border-radius: 6px;
  padding: 10px 8px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
html[data-theme="dark"] .style-picker-card {
  background: #0f172a;
  border-color: #334155;
  color: #f1f5f9;
}
.style-picker-card:hover {
  border-color: #0284c7;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.15);
}
.style-picker-card.is-active {
  border-color: #0284c7;
  background: rgba(2, 132, 199, 0.08);
  box-shadow: 0 0 0 2px #0284c7;
}
html[data-theme="dark"] .style-picker-card.is-active {
  background: rgba(56, 189, 248, 0.15);
  border-color: #38bdf8;
  box-shadow: 0 0 0 2px #38bdf8;
}
.style-picker-badge {
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 2px 6px;
  border-radius: 3px;
}
.style-picker-name {
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.2;
}

/* Zone de simulation visuelle directe */
.modal-visual-canvas {
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  padding: 20px;
  background: #ffffff;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  margin-bottom: 22px;
  position: relative;
  transition: all 0.25s ease;
}
html[data-theme="dark"] .modal-visual-canvas {
  background: #0b1322;
  border-color: #1e293b;
}

/* En-tête de simulation avec badge éditable */
.editor-visual-header {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}
.editor-input-title {
  width: 100%;
  font-size: 1.30rem;
  font-weight: 900;
  color: #002b66;
  border: 1px dashed #cbd5e1;
  padding: 6px 10px;
  border-radius: 4px;
  background: rgba(248, 250, 252, 0.5);
  transition: all 0.15s;
  box-sizing: border-box;
}
.editor-input-title:hover, .editor-input-title:focus {
  border-color: #0284c7;
  background: rgba(2, 132, 199, 0.05);
  outline: none;
}
html[data-theme="dark"] .editor-input-title {
  color: #38bdf8;
  background: #10192e;
  border-color: #22304d;
}

.editor-input-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  background: #e0f2fe;
  color: #0369a1;
  border: 1px dashed #38bdf8;
  outline: none;
  width: fit-content;
  max-width: 320px;
}
html[data-theme="dark"] .editor-input-badge {
  background: #0f2744;
  color: #38bdf8;
  border-color: #0284c7;
}

.editor-textarea-intro {
  width: 100%;
  font-size: 0.92rem;
  color: #475569;
  line-height: 1.55;
  border: 1px dashed #cbd5e1;
  padding: 8px 12px;
  border-radius: 4px;
  background: rgba(248, 250, 252, 0.5);
  box-sizing: border-box;
  font-family: inherit;
  resize: vertical;
}
.editor-textarea-intro:hover, .editor-textarea-intro:focus {
  border-color: #0284c7;
  background: rgba(2, 132, 199, 0.04);
  outline: none;
}
html[data-theme="dark"] .editor-textarea-intro {
  color: #cbd5e1;
  background: #080f1e;
  border-color: #22304d;
}

/* 1. Éléments interactifs : Boîte de points clés (Classic) */
.editor-quote-box {
  background: #f1f5f9;
  border-left: 4px solid #002b66;
  padding: 16px;
  border-radius: 0 4px 4px 0;
  margin: 16px 0;
}
html[data-theme="dark"] .editor-quote-box {
  background: #0f172a;
  border-left-color: #38bdf8;
}
.editor-bullet-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.editor-bullet-dot {
  color: #0284c7;
  font-weight: 900;
  font-size: 1.1rem;
  line-height: 1;
}
.editor-bullet-input {
  flex: 1;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  padding: 6px 10px;
  font-size: 0.88rem;
  background: #ffffff;
  color: inherit;
  box-sizing: border-box;
}
html[data-theme="dark"] .editor-bullet-input {
  background: #151e32;
  border-color: #22304d;
  color: #f1f5f9;
}
.btn-del-item {
  background: #fee2e2;
  color: #dc2626;
  border: 1px solid #fca5a5;
  width: 28px;
  height: 28px;
  border-radius: 4px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.85rem;
  transition: all 0.15s;
  flex-shrink: 0;
}
.btn-del-item:hover {
  background: #fecaca;
  transform: scale(1.05);
}
.btn-add-visual-item {
  background: #f0fdf4;
  color: #166534;
  border: 1px dashed #86efac;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  transition: all 0.15s;
}
.btn-add-visual-item:hover {
  background: #dcfce7;
  border-color: #22c55e;
}
html[data-theme="dark"] .btn-add-visual-item {
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
  border-color: #059669;
}

/* 2. Éléments interactifs : Grille de Cartes d'Unités (Grid) */
.editor-grid-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
  margin: 16px 0;
}
.editor-unit-card {
  border: 1px solid #cbd5e1;
  background: #fafafa;
  border-radius: 6px;
  padding: 12px;
  position: relative;
  transition: all 0.15s;
}
html[data-theme="dark"] .editor-unit-card {
  background: #0f172a;
  border-color: #1e293b;
}
.editor-unit-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.editor-unit-icon-select {
  padding: 4px 6px;
  border-radius: 4px;
  border: 1px solid #cbd5e1;
  font-size: 0.78rem;
  background: #ffffff;
  color: inherit;
}
html[data-theme="dark"] .editor-unit-icon-select {
  background: #151e32;
  border-color: #22304d;
  color: #f1f5f9;
}
.editor-unit-title-input {
  flex: 1;
  font-weight: 800;
  font-size: 0.88rem;
  color: #002b66;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  padding: 4px 8px;
  background: #ffffff;
  box-sizing: border-box;
}
html[data-theme="dark"] .editor-unit-title-input {
  color: #38bdf8;
  background: #151e32;
  border-color: #22304d;
}
.editor-unit-desc-input {
  width: 100%;
  font-size: 0.82rem;
  color: #64748b;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  padding: 6px 8px;
  font-family: inherit;
  resize: vertical;
  box-sizing: border-box;
  background: #ffffff;
}
html[data-theme="dark"] .editor-unit-desc-input {
  color: #94a3b8;
  background: #151e32;
  border-color: #22304d;
}

/* 3. Éléments interactifs : Fiche Tactique (Tactical) */
.editor-tactical-banner {
  background: #001737;
  color: #ffffff;
  padding: 12px 16px;
  border-radius: 6px 6px 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid #d97706;
  margin: -20px -20px 16px -20px;
}
.editor-tactical-stamp {
  border: 2px dashed #dc2626;
  color: #dc2626;
  font-size: 0.72rem;
  font-weight: 900;
  padding: 3px 6px;
  text-transform: uppercase;
  transform: rotate(-2deg);
  letter-spacing: 1px;
}
.editor-kpis-container {
  display: flex;
  gap: 12px;
  margin: 16px 0;
  flex-wrap: wrap;
}
.editor-kpi-card {
  flex: 1;
  min-width: 110px;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-top: 3px solid #0284c7;
  padding: 8px 10px;
  border-radius: 4px;
  text-align: center;
  position: relative;
}
html[data-theme="dark"] .editor-kpi-card {
  background: #090f1d;
  border-color: #1e2e4a;
  border-top-color: #38bdf8;
}
.editor-kpi-val-input {
  width: 100%;
  text-align: center;
  font-size: 1.25rem;
  font-weight: 900;
  color: #0284c7;
  border: 1px solid #cbd5e1;
  border-radius: 3px;
  padding: 2px 4px;
  background: #ffffff;
  box-sizing: border-box;
}
html[data-theme="dark"] .editor-kpi-val-input {
  background: #151e32;
  border-color: #22304d;
  color: #38bdf8;
}
.editor-kpi-lbl-input {
  width: 100%;
  text-align: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  border: 1px solid #cbd5e1;
  border-radius: 3px;
  padding: 2px 4px;
  margin-top: 4px;
  background: #ffffff;
  box-sizing: border-box;
}
html[data-theme="dark"] .editor-kpi-lbl-input {
  background: #151e32;
  border-color: #22304d;
  color: #94a3b8;
}

/* 4. Éléments interactifs : Grand Format Vitrine (Showcase) */
.editor-showcase-hero {
  position: relative;
  min-height: 160px;
  border-radius: 6px;
  overflow: hidden;
  margin: -20px -20px 16px -20px;
  display: flex;
  align-items: flex-end;
  padding: 18px;
  background-size: cover;
  background-position: center;
  background-color: #001737;
}
.editor-showcase-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.2) 0%, rgba(0, 27, 68, 0.95) 100%);
}
.editor-showcase-content {
  position: relative;
  z-index: 2;
  width: 100%;
  color: #ffffff;
}
.editor-showcase-pills {
  display: flex;
  gap: 12px;
  margin: 16px 0;
  flex-wrap: wrap;
}
.editor-showcase-stat-pill {
  flex: 1;
  min-width: 130px;
  background: linear-gradient(135deg, #002b66 0%, #001737 100%);
  color: #ffffff;
  padding: 10px 12px;
  border-radius: 6px;
  text-align: center;
  border: 1px solid rgba(56, 189, 248, 0.3);
  position: relative;
}
.editor-showcase-val-input {
  width: 100%;
  text-align: center;
  font-size: 1.35rem;
  font-weight: 900;
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.4);
  border-radius: 4px;
  padding: 2px 4px;
  background: rgba(0, 0, 0, 0.3);
  box-sizing: border-box;
}
.editor-showcase-lbl-input {
  width: 100%;
  text-align: center;
  font-size: 0.72rem;
  color: #cbd5e1;
  text-transform: uppercase;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  padding: 2px 4px;
  margin-top: 4px;
  background: rgba(0, 0, 0, 0.3);
  box-sizing: border-box;
}

/* Paramètres de carte d'accueil (Haut de formulaire) */
.editor-card-meta-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 14px 16px;
  margin-bottom: 20px;
}
html[data-theme="dark"] .editor-card-meta-box {
  background: #0f172a;
  border-color: #1e293b;
  color: #e2e8f0;
}
html[data-theme="dark"] .editor-card-meta-box label {
  color: #cbd5e1 !important;
}

/* Barre de configuration d'action en bas */
.editor-action-config-bar {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 14px;
  margin-top: 18px;
}
html[data-theme="dark"] .editor-action-config-bar {
  background: #0f172a;
  border-color: #1e293b;
  color: #e2e8f0;
}
html[data-theme="dark"] .editor-action-config-bar label {
  color: #cbd5e1 !important;
}

/* ==========================================================================
   CORRECTIONS DE CONTRASTE & MODE SOMBRE (ANTI BLANC SUR BLANC)
   ========================================================================== */

/* 1. Éléments select et option natifs */
html[data-theme="dark"] option {
  background-color: #0e1626 !important;
  color: #f8fafc !important;
}

/* 2. Modales générales & Conteneurs */
html[data-theme="dark"] .modal-body {
  color: #f1f5f9;
}
html[data-theme="dark"] .modal-body strong {
  color: #f8fafc;
}

/* 3. Encadré de conditions / prérequis modale */
.modal-req-box {
  background: #f1f5f9;
  padding: 14px 16px;
  border-left: 4px solid var(--blue-primary);
  margin-bottom: 20px;
  font-size: 0.85rem;
  color: #334155;
  border-radius: 0 4px 4px 0;
  line-height: 1.55;
}
html[data-theme="dark"] .modal-req-box {
  background: #0f172a !important;
  border-left-color: #38bdf8 !important;
  color: #e2e8f0 !important;
}
html[data-theme="dark"] .modal-req-box strong {
  color: #38bdf8 !important;
}

/* 4. Checkbox / Pills de conditions de recrutement */
.checkbox-pill-label {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 10px 14px;
  font-size: 0.88rem;
  color: #1e293b;
  cursor: pointer;
  transition: all 0.15s ease;
}
.checkbox-pill-label:hover {
  border-color: #0284c7;
  background: #f0f9ff;
}
html[data-theme="dark"] .checkbox-pill-label {
  background: #0e1626 !important;
  border-color: #2b3a58 !important;
  color: #f1f5f9 !important;
}
html[data-theme="dark"] .checkbox-pill-label:hover {
  background: #141f36 !important;
  border-color: #38bdf8 !important;
}

/* 5. Boîtes de points forts Showcase (Grand Format) */
.showcase-highlights-box,
.editor-showcase-highlights-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 14px 18px;
  margin: 16px 0;
}
html[data-theme="dark"] .showcase-highlights-box,
html[data-theme="dark"] .editor-showcase-highlights-box {
  background: #0f172a !important;
  border-color: #1e293b !important;
  color: #e2e8f0 !important;
}
html[data-theme="dark"] .showcase-highlights-box ul li {
  color: #cbd5e1 !important;
}
html[data-theme="dark"] .editor-showcase-highlights-box span {
  color: #cbd5e1 !important;
}

/* 6. Boîtes de notes de briefing Tactical (Fiche Tactique) */
.tactical-notes-box,
.editor-tactical-notes-box {
  background: rgba(0, 0, 0, 0.03);
  border-left: 3px solid #0284c7;
  padding: 12px 14px;
  margin: 14px 0;
  border-radius: 0 4px 4px 0;
}
html[data-theme="dark"] .tactical-notes-box,
html[data-theme="dark"] .editor-tactical-notes-box {
  background: rgba(2, 132, 199, 0.08) !important;
  border-left-color: #38bdf8 !important;
  color: #e2e8f0 !important;
}
html[data-theme="dark"] .tactical-notes-box ul li {
  color: #cbd5e1 !important;
}
html[data-theme="dark"] .editor-tactical-notes-box span {
  color: #cbd5e1 !important;
}

/* 7. Métadonnées tactiques */
html[data-theme="dark"] .tactical-meta-grid {
  background: #090f1d !important;
  border-color: #1e2e4a !important;
  color: #cbd5e1 !important;
}
html[data-theme="dark"] .tactical-meta-grid strong {
  color: #38bdf8 !important;
}

/* 8. Grille de cartes de spécialités (Grid) */
html[data-theme="dark"] .modal-style-grid .grid-spec-card strong {
  color: #38bdf8 !important;
}
html[data-theme="dark"] .modal-style-grid .grid-spec-card span {
  color: #cbd5e1 !important;
}

/* 9. Boutons de suppression d'éléments dans l'éditeur */
html[data-theme="dark"] .btn-del-item {
  background: rgba(220, 38, 38, 0.2) !important;
  color: #f87171 !important;
  border-color: rgba(220, 38, 38, 0.4) !important;
}
html[data-theme="dark"] .btn-del-item:hover {
  background: rgba(220, 38, 38, 0.35) !important;
  color: #ffffff !important;
}

/* 10. Bouton de suppression des conditions */
html[data-theme="dark"] .btn-delete-req-row {
  background: rgba(220, 38, 38, 0.2) !important;
  color: #f87171 !important;
  border-color: rgba(220, 38, 38, 0.4) !important;
}
html[data-theme="dark"] .btn-delete-req-row:hover {
  background: rgba(220, 38, 38, 0.35) !important;
  color: #ffffff !important;
}

/* 11. Canevas de prévisualisation dans l'éditeur */
html[data-theme="dark"] .modal-visual-canvas {
  background: #0b1322 !important;
  border-color: #1e293b !important;
  color: #f1f5f9 !important;
}
html[data-theme="dark"] .modal-visual-canvas label {
  color: #94a3b8 !important;
}

/* 12. Badges de style et tableau dans le panneau d'administration */
.admin-card-style-pill {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  background: rgba(0, 43, 102, 0.08);
  color: #002b66;
  border: 1px solid #cbd5e1;
}
html[data-theme="dark"] .admin-card-style-pill {
  background: rgba(56, 189, 248, 0.15) !important;
  color: #38bdf8 !important;
  border-color: rgba(56, 189, 248, 0.3) !important;
}

.admin-card-badge-pill {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 0.74rem;
  font-weight: 700;
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #cbd5e1;
}
html[data-theme="dark"] .admin-card-badge-pill {
  background: #1e293b !important;
  color: #cbd5e1 !important;
  border-color: #334155 !important;
}

/* 13. Titres de style dans le panneau d'administration */
.admin-style-preview-title {
  color: #002b66;
  font-size: 0.85rem;
  font-weight: 800;
  display: block;
  margin-bottom: 4px;
}
html[data-theme="dark"] .admin-style-preview-title {
  color: #38bdf8 !important;
}

/* 14. Carte des pièces jointes officielles (Permis, CNI) */
.doc-attachment-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 10px;
  text-align: center;
  transition: all 0.15s ease;
}
html[data-theme="dark"] .doc-attachment-card {
  background: #090f1d !important;
  border-color: #1e2e4a !important;
  color: #e2e8f0 !important;
}
html[data-theme="dark"] .doc-attachment-card div {
  color: #94a3b8 !important;
}

/* ==========================================================================
   15. FIVEM NUI (CHROMIUM EMBEDDED FRAMEWORK - CEF) ENGINE OPTIMIZATIONS
   ==========================================================================
   Optimisations spécifiques pour l'affichage in-game dans GTA V (FiveM) :
   - Zéro lag GPU : suppression de backdrop-filter: blur() et des ombres lourdes
   - Gestion de la transparence alpha (?transparent=1 ou .nui-transparent)
   - Désactivation de la sélection de texte accidentelle en jeu
   - Barres de défilement immersives ultra-fines
   - Adaptation responsive 720p, 1080p, 4K et ratios 4:3 étirés
   ========================================================================== */

/* Mode NUI Global */
html.nui-mode,
body.nui-mode {
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  scroll-behavior: smooth;
}

/* Autoriser la sélection dans les champs de saisie et textes de code */
.nui-mode input,
.nui-mode textarea,
.nui-mode select,
.nui-mode [contenteditable="true"],
.nui-mode .selectable-text {
  user-select: text !important;
  -webkit-user-select: text !important;
}

/* Transparence Alpha pour incrustation en jeu */
html.nui-transparent,
body.nui-transparent {
  background: transparent !important;
  background-color: transparent !important;
}

/* SUPPRESSION RADICALE DU BACKDROP-FILTER BLUR DANS FIVEM (Gain massif de FPS) */
.nui-mode *,
.nui-mode *::before,
.nui-mode *::after {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

/* Remplacements opaques haute performance pour les éléments floutés */
.nui-mode .avatar-cropper-modal-overlay {
  background-color: rgba(15, 23, 42, 0.92) !important;
}

.nui-mode .cropper-preview-container {
  background-color: #1e293b !important;
}

.nui-mode .toast {
  background-color: #0f172a !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4) !important;
}

.nui-mode .modal-backdrop,
.nui-mode .modal-overlay {
  background-color: rgba(10, 15, 28, 0.88) !important;
}

/* Barres de défilement fines et immersives */
.nui-mode ::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.nui-mode ::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.08);
}

.nui-mode[data-theme="dark"] ::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.04);
}

.nui-mode ::-webkit-scrollbar-thumb {
  background: #0284c7;
  border-radius: 4px;
}

.nui-mode ::-webkit-scrollbar-thumb:hover {
  background: #0369a1;
}

/* Optimisation Responsive pour résolutions FiveM (720p, 1080p, 4:3 et 5:4) */
@media screen and (max-width: 1280px) {
  .nui-mode .container {
    max-width: 100% !important;
    padding: 0 12px !important;
  }
  
  .nui-mode .site-header .container {
    padding: 0 10px !important;
  }

  .nui-mode .modal-container,
  .nui-mode .modal-content,
  .nui-mode .avatar-cropper-modal {
    max-width: 95vw !important;
    max-height: 90vh !important;
  }
}

@media screen and (max-height: 768px) {
  .nui-mode .site-header {
    position: relative !important;
  }

  .nui-mode .modal-body,
  .nui-mode .cropper-body-wrapper {
    max-height: 70vh !important;
    overflow-y: auto !important;
  }
}

