/* ==========================================================================
   HSSE - Gestion & Suivi des EPI
   Styles spécifiques & Design System
   ========================================================================== */

:root {
  --color-valora-accent: #0D1B2A;
  --color-valora-accent-light: #4A6785;
  --color-valora-accent-dark: #07111C;
  --color-valora-navy: #0D1B2A;
  --color-valora-navy-dark: #07111C;
  --color-valora-navy-light: #4A6785;
  --color-valora-charcoal: #262626;
  --color-brand-navy: #0D1B2A;
  --color-brand-navy-dark: #07111C;
  --color-brand-navy-light: #4A6785;
  --color-brand-green: #0D1B2A;
  --color-brand-green-light: #4A6785;
  --color-success: #2F7D5B;
  --color-danger: #DC2626;
  --color-warning: #D97706;
  --color-info: #2563EB;
}

body {
  background-color: #F8FAFC;
  color: #0F172A;
  font-family: 'Jost', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

code, kbd, samp, pre, .font-mono {
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace !important;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
::-webkit-scrollbar-track {
  background: #F8FAFC;
}
::-webkit-scrollbar-thumb {
  background: #CBD5E1;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94A3B8;
}

/* Pulse animation for status */
@keyframes pulse-subtle {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.75;
    transform: scale(1.05);
  }
}

.animate-pulse-subtle {
  animation: pulse-subtle 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Badge dot */
.status-indicator {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

/* Sidebar styling - Studio Light Corporate Valora Dotations */
.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #334155;
  background-color: transparent;
  transition: all 0.15s ease-in-out;
  cursor: pointer;
  border: 1px solid transparent;
  width: 100%;
  text-align: left;
  user-select: none;
}

.sidebar-nav-item span {
  color: inherit;
  font-weight: inherit;
  transition: color 0.15s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-nav-item svg {
  width: 1.15rem;
  height: 1.15rem;
  color: #64748B;
  flex-shrink: 0;
  transition: color 0.15s ease;
}

.sidebar-nav-item:hover:not(.active) {
  background-color: #F1F5F9 !important;
  color: #0F172A !important;
  border-color: #E2E8F0 !important;
}

.sidebar-nav-item:hover:not(.active) span {
  color: #0F172A !important;
}

.sidebar-nav-item:hover:not(.active) svg {
  color: #0D1B2A !important;
}

.sidebar-nav-item.active {
  background: #0D1B2A !important;
  color: #FFFFFF !important;
  font-weight: 700 !important;
  border: 1px solid #07111C !important;
  box-shadow: 0 2px 6px rgba(13, 27, 42, 0.28) !important;
}

.sidebar-nav-item.active span {
  color: #FFFFFF !important;
}

.sidebar-nav-item.active svg {
  color: #FFFFFF !important;
}

/* Card elevation - Studio Light */
.kpi-card {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 0.75rem;
  padding: 1rem 1.15rem;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.02);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.kpi-card:hover {
  transform: translateY(-2px);
  border-color: #CBD5E1;
  box-shadow: 0 6px 14px -2px rgba(0, 0, 0, 0.04);
}


/* Modals */
.modal-overlay {
  background-color: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
}

/* Table styles - Lisibilité épurée, en-têtes collants et alignements parfaits */
.data-table {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
}

.data-table thead th {
  position: sticky;
  top: 0;
  z-index: 10;
  background-color: #F8FAFC;
  color: #334155;
  font-size: 0.725rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
  padding: 0.8rem 1rem;
  border-bottom: 2px solid #E2E8F0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  white-space: nowrap;
}

.data-table tbody td {
  padding: 0.8rem 1rem;
  font-size: 0.84rem;
  border-bottom: 1px solid #F1F5F9;
  color: #1E293B;
  vertical-align: middle;
  transition: background-color 0.12s ease-in-out;
}

.data-table tbody tr:hover td {
  background-color: #F8FAFC;
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

/* Badges - Alignement géométrique précis avec micro-points vectoriels */
.badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.2rem 0.65rem;
  border-radius: 9999px;
  font-size: 0.735rem;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  vertical-align: middle;
}

.badge-dot {
  display: inline-block;
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  flex-shrink: 0;
}

.badge-dot-success { background-color: #7F95AB; }
.badge-dot-warning { background-color: #F59E0B; }
.badge-dot-danger  { background-color: #EF4444; }
.badge-dot-info    { background-color: #3B82F6; }
.badge-dot-neutral { background-color: #94A3B8; }

/* Boutons d'action de tableau - Alignement icône + texte irréprochable */
.btn-action-table {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.35rem 0.65rem;
  border-radius: 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: all 0.15s ease-in-out;
  white-space: nowrap;
}

.btn-action-table svg {
  flex-shrink: 0;
}

/* Bouton Remplacement Épuré & Lisible */
.btn-renew-dotation {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.35rem !important;
  padding: 0.35rem 0.65rem !important;
  border-radius: 0.5rem !important;
  background: linear-gradient(135deg, #F97316 0%, #EA580C 100%) !important;
  color: #FFFFFF !important;
  font-size: 0.75rem !important;
  font-weight: 700 !important;
  line-height: 1 !important;
  box-shadow: 0 1px 3px rgba(234, 88, 12, 0.25) !important;
  transition: all 0.15s ease-in-out !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  cursor: pointer !important;
  white-space: nowrap !important;
}

.btn-renew-dotation:hover {
  background: linear-gradient(135deg, #EA580C 0%, #C2410C 100%) !important;
  box-shadow: 0 3px 8px rgba(234, 88, 12, 0.35) !important;
  transform: translateY(-1px);
}

.btn-renew-dotation svg {
  flex-shrink: 0 !important;
}

/* ==========================================================================
   Boutons d'action : Rapprochement & Consultation Décharges
   ========================================================================== */
.btn-rapprocher,
.btn-upload-doc,
.btn-pending-upload {
  background: linear-gradient(135deg, #F97316 0%, #EA580C 100%) !important;
  color: #FFFFFF !important;
  border: 1px solid #C2410C !important;
  padding: 0.35rem 0.75rem !important;
  border-radius: 0.375rem !important;
  font-size: 0.75rem !important;
  font-weight: 700 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.375rem !important;
  cursor: pointer !important;
  box-shadow: 0 1px 3px rgba(234, 88, 12, 0.35), 0 1px 2px rgba(0, 0, 0, 0.08) !important;
  transition: all 0.15s ease-in-out !important;
  text-decoration: none !important;
  white-space: nowrap !important;
}

.btn-rapprocher:hover,
.btn-upload-doc:hover,
.btn-pending-upload:hover {
  background: linear-gradient(135deg, #EA580C 0%, #C2410C 100%) !important;
  color: #FFFFFF !important;
  border-color: #9A3412 !important;
  box-shadow: 0 3px 6px rgba(234, 88, 12, 0.45) !important;
  transform: translateY(-1px);
}

.btn-rapprocher:active,
.btn-upload-doc:active,
.btn-pending-upload:active {
  transform: translateY(0);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15) !important;
}

.btn-rapprocher svg,
.btn-upload-doc svg,
.btn-pending-upload svg {
  width: 0.875rem !important;
  height: 0.875rem !important;
  stroke: #FFFFFF !important;
  stroke-width: 2.5 !important;
}

/* Bouton Consultation / Voir scan */
.btn-consulter-doc,
.btn-view-doc {
  background: #FFFFFF !important;
  color: #1E293B !important;
  border: 1px solid #CBD5E1 !important;
  padding: 0.35rem 0.75rem !important;
  border-radius: 0.375rem !important;
  font-size: 0.75rem !important;
  font-weight: 600 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.375rem !important;
  cursor: pointer !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) !important;
  transition: all 0.15s ease-in-out !important;
  text-decoration: none !important;
  white-space: nowrap !important;
}

.btn-consulter-doc:hover,
.btn-view-doc:hover {
  background: #F1F5F9 !important;
  color: #0284C7 !important;
  border-color: #94A3B8 !important;
  transform: translateY(-1px);
}

.btn-consulter-doc svg,
.btn-view-doc svg {
  width: 0.875rem !important;
  height: 0.875rem !important;
  stroke: #0284C7 !important;
}

/* Modale de rapprochement - Bouton d'action principal */
#btn-confirm-upload-decharge {
  background-color: #1B365D !important;
  color: #FFFFFF !important;
  transition: all 0.2s ease;
}

#btn-confirm-upload-decharge:hover:not(:disabled) {
  background-color: #0F172A !important;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

#btn-confirm-upload-decharge:disabled {
  opacity: 0.5 !important;
  cursor: not-allowed !important;
}

/* ==========================================================================
   Boutons d'Action Principaux & Charte Graphique Valora Dotations
   ========================================================================== */
#btn-load-pack,
.btn-pack-standard {
  background: linear-gradient(135deg, #0D1B2A 0%, #4A6785 100%) !important;
  color: #FFFFFF !important;
  border: 1px solid #07111C !important;
  padding: 0.6rem 1.25rem !important;
  border-radius: 0.5rem !important;
  font-size: 0.8rem !important;
  font-weight: 700 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.5rem !important;
  cursor: pointer !important;
  box-shadow: 0 2px 4px rgba(13, 27, 42, 0.3), 0 1px 2px rgba(0, 0, 0, 0.08) !important;
  transition: all 0.15s ease-in-out !important;
  text-decoration: none !important;
  white-space: nowrap !important;
}

#btn-load-pack *,
.btn-pack-standard * {
  color: #FFFFFF !important;
}

#btn-load-pack:hover,
.btn-pack-standard:hover {
  background: linear-gradient(135deg, #07111C 0%, #37506B 100%) !important;
  color: #FFFFFF !important;
  border-color: #005A22 !important;
  box-shadow: 0 4px 10px rgba(13, 27, 42, 0.4) !important;
  transform: translateY(-1px);
}

#btn-load-pack:active,
.btn-pack-standard:active {
  transform: translateY(0);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15) !important;
}

#btn-load-pack svg,
.btn-pack-standard svg {
  width: 1rem !important;
  height: 1rem !important;
  stroke: #FFFFFF !important;
  stroke-width: 2.2 !important;
}

/* Bouton Impression Décharge & Connexion Dossier */
#btn-print-decharge,
.btn-connect-dir {
  background: linear-gradient(135deg, #0D1B2A 0%, #4A6785 100%) !important;
  color: #FFFFFF !important;
  border: 1px solid #07111C !important;
  box-shadow: 0 2px 4px rgba(13, 27, 42, 0.3) !important;
  transition: all 0.15s ease-in-out !important;
}

#btn-print-decharge:hover,
.btn-connect-dir:hover {
  background: linear-gradient(135deg, #07111C 0%, #37506B 100%) !important;
  color: #FFFFFF !important;
  transform: translateY(-1px);
}

/* Utilitaires harmonisés avec la charte Valora Dotations (Bleu nuit, Bleu acier & Gris) */
.bg-orange-50 { background-color: #ECFDF5 !important; }
.bg-orange-100 { background-color: #D1FAE5 !important; }
.bg-orange-200 { background-color: #A7F3D0 !important; }
.bg-orange-500 { background-color: #7F95AB !important; }
.bg-orange-600 { background-color: #0D1B2A !important; }
.bg-orange-700 { background-color: #07111C !important; }

.hover\:bg-orange-50:hover { background-color: #ECFDF5 !important; }
.hover\:bg-orange-100:hover { background-color: #D1FAE5 !important; }
.hover\:bg-orange-500:hover { background-color: #7F95AB !important; }
.hover\:bg-orange-600:hover { background-color: #0D1B2A !important; }
.hover\:bg-orange-700:hover { background-color: #07111C !important; }

.text-orange-400 { color: #34D399 !important; }
.text-orange-500 { color: #7F95AB !important; }
.text-orange-600 { color: #0D1B2A !important; }
.text-orange-700 { color: #07111C !important; }
.text-orange-800 { color: #064E3B !important; }
.text-orange-900 { color: #064E3B !important; }
.text-orange-950 { color: #022C22 !important; }

.border-orange-200 { border-color: #A7F3D0 !important; }
.border-orange-300 { border-color: #6EE7B7 !important; }
.border-orange-500 { border-color: #7F95AB !important; }
.border-orange-600 { border-color: #0D1B2A !important; }
.focus\:border-orange-500:focus { border-color: #0D1B2A !important; }
.focus\:ring-orange-500:focus { --tw-ring-color: #0D1B2A !important; }

/* ==========================================================================
   Module Réceptions Fournisseurs
   ========================================================================== */
.btn-valider-entree {
  background: linear-gradient(135deg, #4A6785 0%, #37506B 100%) !important;
  color: #FFFFFF !important;
  padding: 0.65rem 1.5rem !important;
  border-radius: 0.5rem !important;
  font-size: 0.8rem !important;
  font-weight: 700 !important;
  border: 1px solid #065F46 !important;
  box-shadow: 0 2px 4px rgba(5, 150, 105, 0.35) !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.5rem !important;
  cursor: pointer !important;
  transition: all 0.15s ease-in-out !important;
  white-space: nowrap !important;
}

.btn-valider-entree:hover:not(:disabled) {
  background: linear-gradient(135deg, #37506B 0%, #065F46 100%) !important;
  box-shadow: 0 4px 8px rgba(5, 150, 105, 0.45) !important;
  transform: translateY(-1px);
}

.btn-valider-entree:active:not(:disabled) {
  transform: translateY(0);
}

.btn-valider-entree:disabled {
  background: #94A3B8 !important;
  border-color: #64748B !important;
  color: #F1F5F9 !important;
  opacity: 0.65 !important;
  cursor: not-allowed !important;
  box-shadow: none !important;
  transform: none !important;
}

.btn-valider-entree svg {
  width: 1.1rem !important;
  height: 1.1rem !important;
  stroke: #FFFFFF !important;
  stroke-width: 2.2 !important;
}

/* Zone Drag & Drop Bon de Livraison */
#bl-dropzone.dragover {
  border-color: #EA580C !important;
  background-color: #FFEDD5 !important;
  transform: scale(1.01);
}

/* Bouton Voir le BL dans l'historique */
.btn-view-bl {
  background: #FFFFFF !important;
  color: #1E293B !important;
  border: 1px solid #CBD5E1 !important;
  padding: 0.35rem 0.75rem !important;
  border-radius: 0.375rem !important;
  font-size: 0.75rem !important;
  font-weight: 600 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.375rem !important;
  cursor: pointer !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) !important;
  transition: all 0.15s ease-in-out !important;
  text-decoration: none !important;
  white-space: nowrap !important;
}

.btn-view-bl:hover {
  background: #EFF6FF !important;
  color: #2563EB !important;
  border-color: #93C5FD !important;
  transform: translateY(-1px);
}

.btn-view-bl svg {
  width: 0.875rem !important;
  height: 0.875rem !important;
  stroke: #2563EB !important;
}

/* ==========================================================================
   Module Inventaire & Ajustements de Stock
   ========================================================================== */
.btn-inventaire-tab {
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: #475569;
  background: transparent;
  transition: all 0.2s ease;
  cursor: pointer;
  border: 1px solid transparent;
}

.btn-inventaire-tab:hover {
  background: #F1F5F9;
  color: #0F172A;
}

.btn-inventaire-tab.active {
  background: #1B365D !important;
  color: #FFFFFF !important;
  font-weight: 700 !important;
  box-shadow: 0 2px 4px rgba(27, 54, 93, 0.25);
}

/* Badges d'écart dynamique */
.badge-ecart-negatif {
  background-color: #FEE2E2 !important;
  color: #991B1B !important;
  border: 1px solid #FCA5A5 !important;
  font-weight: 800 !important;
}

.badge-ecart-positif {
  background-color: #D1FAE5 !important;
  color: #065F46 !important;
  border: 1px solid #6EE7B7 !important;
  font-weight: 800 !important;
}

.badge-ecart-neutre {
  background-color: #F3F4F6 !important;
  color: #4B5563 !important;
  border: 1px solid #E5E7EB !important;
  font-weight: 600 !important;
}

/* Lignes d'audit d'écart négatif (Contrôle interne HSSE) */
.row-ecart-negatif {
  background-color: #FFF5F5 !important;
  border-left: 4px solid #DC2626 !important;
}

.row-ecart-negatif:hover {
  background-color: #FEE2E2 !important;
}

.row-ecart-positif {
  background-color: #F0FDF4 !important;
  border-left: 4px solid #4A6785 !important;
}

/* ==========================================================================
   Module Référentiels : Sous-onglets & Cartes de Packs
   ========================================================================== */
.subtab-referentiel {
  padding: 0.6rem 1.1rem;
  border-radius: 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: #64748B;
  transition: all 0.2s ease;
  cursor: pointer;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.subtab-referentiel:hover {
  background: #F1F5F9;
  color: #0F172A;
}

.subtab-referentiel.active {
  background: #1B365D !important;
  color: #FFFFFF !important;
  font-weight: 700 !important;
  box-shadow: 0 2px 4px rgba(27, 54, 93, 0.25);
}

.pack-card {
  transition: all 0.2s ease;
  border: 1px solid #E2E8F0;
}

.pack-card:hover {
  border-color: #CBD5E1;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.pack-card-header-1 {
  background: linear-gradient(135deg, #1E3A8A 0%, #172554 100%);
  color: #FFFFFF;
}

.pack-card-header-2 {
  background: linear-gradient(135deg, #065F46 0%, #064E3B 100%);
  color: #FFFFFF;
}

.pack-card-header-3 {
  background: linear-gradient(135deg, #9A3412 0%, #7C2D12 100%);
  color: #FFFFFF;
}

.pack-card-header-4 {
  background: linear-gradient(135deg, #581C87 0%, #3B0764 100%);
  color: #FFFFFF;
}

/* ==========================================================================
   Styles Module Rapports & Statistiques HSSE (Étape 8)
   ========================================================================== */
.progress-bar-container {
  width: 100%;
  height: 8px;
  background-color: #E2E8F0;
  border-radius: 9999px;
  overflow: hidden;
  position: relative;
}

.progress-bar-fill {
  height: 100%;
  border-radius: 9999px;
  transition: width 0.4s ease;
}

.progress-bar-fill-primary {
  background: linear-gradient(90deg, #1B365D 0%, #0284C7 100%);
}

.progress-bar-fill-warning {
  background: linear-gradient(90deg, #D97706 0%, #F59E0B 100%);
}

.progress-bar-fill-danger {
  background: linear-gradient(90deg, #DC2626 0%, #EF4444 100%);
}

.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 800;
}

.rank-1 {
  background: #FEF3C7;
  color: #B45309;
  border: 1px solid #FCD34D;
}

.rank-2 {
  background: #F1F5F9;
  color: #475569;
  border: 1px solid #CBD5E1;
}

.rank-3 {
  background: #FFEDD5;
  color: #C2410C;
  border: 1px solid #FDBA74;
}

.rank-other {
  background: #F8FAFC;
  color: #64748B;
  border: 1px solid #E2E8F0;
}

/* ==========================================================================
   UI / UX POLISH - DESIGN SYSTEM V2.0 (CLIENT-SERVEUR VALORA DOTATIONS HSSE)
   ========================================================================== */

/* 1. Animations & Micro-interactions */
@keyframes fadeInScale {
  0% {
    opacity: 0;
    transform: scale(0.96) translateY(8px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes pulseGlow {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
  }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.modal-animate-in {
  animation: fadeInScale 0.28s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.pulse-glow-green {
  animation: pulseGlow 2.5s infinite;
}

/* 2. Glassmorphism Utilities */
.glass-panel {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(226, 232, 240, 0.8);
}

.glass-panel-dark {
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.glass-modal {
  background: rgba(17, 24, 39, 0.94);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.05);
}

/* 4. Carte Utilisateur Sidebar (Profile Card - Light Studio) */
.user-profile-badge {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 0.75rem;
  padding: 0.75rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.user-profile-badge:hover {
  border-color: #CBD5E1;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.06);
}

.avatar-circle {
  width: 2rem;
  height: 2rem;
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  flex-shrink: 0;
  font-family: 'JetBrains Mono', monospace;
}

.avatar-admin {
  background: #FEF3C7;
  color: #B45309;
  border: 1px solid #FDE68A;
}

.avatar-hsse {
  background: #ECFDF5;
  color: #37506B;
  border: 1px solid #A7F3D0;
}

.avatar-mag {
  background: #EFF6FF;
  color: #1D4ED8;
  border: 1px solid #BFDBFE;
}


/* 5. Cartes KPI Modernisées (Dashboard) */
.kpi-card-enhanced {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 1rem;
  padding: 1.25rem;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.04), 0 1px 2px -1px rgba(0, 0, 0, 0.04);
  transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.kpi-card-enhanced::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: transparent;
  transition: background 0.2s ease;
}

.kpi-card-enhanced:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
  border-color: #CBD5E1;
}

.kpi-card-emerald:hover::after { background: linear-gradient(90deg, #7F95AB, #4A6785); }
.kpi-card-blue:hover::after { background: linear-gradient(90deg, #3B82F6, #1D4ED8); }
.kpi-card-amber:hover::after { background: linear-gradient(90deg, #F59E0B, #D97706); }
.kpi-card-red:hover::after { background: linear-gradient(90deg, #EF4444, #DC2626); }
.kpi-card-purple:hover::after { background: linear-gradient(90deg, #A855F7, #7E22CE); }
.kpi-card-indigo:hover::after { background: linear-gradient(90deg, #6366F1, #4338CA); }

/* Sélecteur de mode de stockage (écran de connexion) */
.auth-mode-switch {
  display: flex;
  gap: 0.25rem;
  padding: 0.25rem;
  border-radius: 0.75rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.auth-mode-btn {
  flex: 1;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.45rem 0.5rem;
  border-radius: 0.55rem;
  color: #94A3B8;
  cursor: pointer;
  transition: all 0.15s ease;
}
.auth-mode-btn:hover {
  color: #E2E8F0;
}
.auth-mode-btn.active {
  background: rgba(16, 185, 129, 0.18);
  color: #34D399;
  box-shadow: inset 0 0 0 1px rgba(16, 185, 129, 0.4);
}

/* 6. Boutons CTA Élégants */
.btn-cta-primary {
  background: linear-gradient(135deg, #4A6785 0%, #37506B 100%);
  color: #FFFFFF;
  font-weight: 600;
  border-radius: 0.65rem;
  padding: 0.55rem 1.1rem;
  box-shadow: 0 2px 6px rgba(5, 150, 105, 0.3);
  transition: all 0.18s ease-in-out;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-cta-primary:hover {
  background: linear-gradient(135deg, #7F95AB 0%, #4A6785 100%);
  box-shadow: 0 4px 14px rgba(5, 150, 105, 0.4);
  transform: translateY(-1px);
}

.btn-cta-primary:active {
  transform: translateY(0);
}

/* 7. Badges d'état raffinés */
.badge-status-dot {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.65rem;
  border-radius: 9999px;
  font-size: 0.725rem;
  font-weight: 600;
}

.badge-status-dot::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
}

.badge-conforme {
  background: #ECFDF5;
  color: #37506B;
  border: 1px solid #A7F3D0;
}
.badge-conforme::before { background: #7F95AB; }

.badge-attente {
  background: #FFFBEB;
  color: #B45309;
  border: 1px solid #FDE68A;
}
.badge-attente::before { background: #F59E0B; }

.badge-alerte {
  background: #FEF2F2;
  color: #B91C1C;
  border: 1px solid #FECACA;
}
.badge-alerte::before { background: #EF4444; }

.badge-archive {
  background: #F8FAFC;
  color: #475569;
  border: 1px solid #E2E8F0;
}
.badge-archive::before { background: #94A3B8; }

/* ==========================================================================
   Design System Corporate Enterprise - Valora Dotations HSSE
   ========================================================================== */

/* Case à cocher vectorielle pour impression fiches officielles */
.print-box {
  display: inline-block;
  width: 10px;
  height: 10px;
  border: 1.2px solid #1e293b;
  border-radius: 2px;
  background-color: #ffffff;
  vertical-align: middle;
  margin: 0 3px 2px 2px;
}

/* Chiffres tabulaires alignés pour une lisibilité financière et logistique */
.tabular-nums {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}

/* Boutons Corporate sobres et statutaires */
.btn-corp-primary {
  background-color: #0D1B2A;
  color: #FFFFFF;
  font-weight: 600;
  font-size: 0.8125rem;
  padding: 0.45rem 0.9rem;
  border-radius: 0.5rem;
  border: 1px solid #00702c;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: background-color 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}
.btn-corp-primary:hover {
  background-color: #00752e;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-corp-secondary {
  background-color: #FFFFFF;
  color: #334155;
  font-weight: 600;
  font-size: 0.8125rem;
  padding: 0.45rem 0.9rem;
  border-radius: 0.5rem;
  border: 1px solid #CBD5E1;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.15s ease;
}
.btn-corp-secondary:hover {
  background-color: #F8FAFC;
  border-color: #94A3B8;
  color: #0F172A;
}

/* Densification des tableaux de données */
.data-table thead th {
  padding: 0.6rem 0.85rem !important;
  font-size: 0.7rem !important;
  letter-spacing: 0.04em !important;
  background-color: #F1F5F9 !important;
  border-bottom: 1.5px solid #CBD5E1 !important;
}

.data-table tbody td {
  padding: 0.6rem 0.85rem !important;
  font-size: 0.8125rem !important;
  border-bottom: 1px solid #F1F5F9 !important;
}

.data-table tbody tr:hover td {
  background-color: #F8FAFC !important;
}

/* ==========================================================================
   Typographie d'Auteur /colorize - Valora Dotations Studio Light
   ========================================================================== */

/* Titres statutaires */
h1, h2, h3, .heading-corp {
  color: #0A1938;
  font-family: 'Jost', sans-serif;
  letter-spacing: -0.02em;
}

/* Tokens de données Monospace colorés */
.token-ref {
  font-family: 'JetBrains Mono', monospace !important;
  font-size: 0.725rem !important;
  font-weight: 600 !important;
  padding: 0.15rem 0.45rem !important;
  border-radius: 0.35rem !important;
  background-color: #F0F9FF !important;
  color: #0284C7 !important;
  border: 1px solid #BAE6FD !important;
  display: inline-block !important;
}

.token-mat {
  font-family: 'JetBrains Mono', monospace !important;
  font-size: 0.725rem !important;
  font-weight: 600 !important;
  padding: 0.15rem 0.45rem !important;
  border-radius: 0.35rem !important;
  background-color: #EEF2FF !important;
  color: #4338CA !important;
  border: 1px solid #C7D2FE !important;
  display: inline-block !important;
}

.token-epi {
  font-family: 'JetBrains Mono', monospace !important;
  font-size: 0.725rem !important;
  font-weight: 600 !important;
  padding: 0.15rem 0.45rem !important;
  border-radius: 0.35rem !important;
  background-color: #F8FAFC !important;
  color: #334155 !important;
  border: 1px solid #E2E8F0 !important;
  display: inline-block !important;
}

.token-date {
  font-family: 'JetBrains Mono', monospace !important;
  font-size: 0.725rem !important;
  color: #475569 !important;
}

/* Chiffres KPI avec typographie colorée */
.kpi-num-blue { color: #0284C7 !important; }
.kpi-num-indigo { color: #4338CA !important; }
.kpi-num-emerald { color: #37506B !important; }
.kpi-num-purple { color: #7C3AED !important; }
.kpi-num-rose { color: #BE123C !important; }
.kpi-num-amber { color: #B45309 !important; }

/* ========================================================================== */
/* VISITE GUIDÉE INTÉGRÉE (IN-PAGE SPOTLIGHT WALKTHROUGH)                     */
/* ========================================================================== */

/* Halo de surbrillance lors des étapes de visite */
.guide-spotlight-active {
  position: relative !important;
  z-index: 30 !important;
  outline: 2.5px solid #0D1B2A !important;
  outline-offset: 4px !important;
  box-shadow: 0 0 0 4px rgba(13, 27, 42, 0.2), 0 10px 25px -5px rgba(13, 27, 42, 0.15) !important;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
  border-radius: 0.75rem !important;
}

/* Overlay plein écran avec occlusion douce */
#integrated-tour-overlay {
  position: fixed;
  inset: 0;
  z-index: 9990;
  pointer-events: auto;
  background: transparent;
  transition: opacity 0.3s ease;
}

/* Trou de lumière / Spotlight découpé autour de l'élément cible */
#tour-spotlight-hole {
  position: fixed;
  z-index: 9991;
  pointer-events: none;
  border-radius: 0.75rem;
  border: 2.5px solid #0D1B2A;
  box-shadow: 0 0 0 9999px rgba(15, 23, 42, 0.74), 0 0 25px rgba(13, 27, 42, 0.45);
  transition: top 0.32s cubic-bezier(0.16, 1, 0.3, 1),
              left 0.32s cubic-bezier(0.16, 1, 0.3, 1),
              width 0.32s cubic-bezier(0.16, 1, 0.3, 1),
              height 0.32s cubic-bezier(0.16, 1, 0.3, 1),
              border-radius 0.32s ease;
}

/* Pulsation douce du contour pour attirer le regard sans agressivité */
@keyframes tour-pulse-border {
  0%, 100% {
    border-color: #0D1B2A;
    box-shadow: 0 0 0 9999px rgba(15, 23, 42, 0.74), 0 0 20px rgba(13, 27, 42, 0.35);
  }
  50% {
    border-color: #4A6785;
    box-shadow: 0 0 0 9999px rgba(15, 23, 42, 0.74), 0 0 32px rgba(16, 185, 129, 0.55);
  }
}

#tour-spotlight-hole.animating {
  animation: tour-pulse-border 2.4s infinite ease-in-out;
}

/* Carte popover explicative ancrée directement près de l'élément cible */
#integrated-tour-popover {
  position: fixed;
  z-index: 9995;
  width: 440px;
  max-width: calc(100vw - 32px);
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 1.25rem;
  box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.35), 0 0 0 1px rgba(0, 0, 0, 0.05);
  transition: top 0.32s cubic-bezier(0.16, 1, 0.3, 1),
              left 0.32s cubic-bezier(0.16, 1, 0.3, 1),
              opacity 0.25s ease,
              transform 0.25s ease;
  pointer-events: auto;
}

/* Barre de progression fluide de la visite */
.tour-progress-bar {
  transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Points de pagination cliquables (stepper dots) */
.tour-step-dot {
  width: 8px;
  height: 8px;
  border-radius: 9999px;
  background-color: #E2E8F0;
  border: 1px solid #CBD5E1;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
  padding: 0;
}

.tour-step-dot:hover {
  background-color: #94A3B8;
}

.tour-step-dot.active {
  width: 24px;
  background-color: #0D1B2A;
  border-color: #0D1B2A;
}






/* ==========================================================================
   DÉMO VALORA DOTATIONS : palette Valora (bleu nuit #0D1B2A, bleu acier #4A6785,
   gris #B7BEC7) et utilitaires « emerald » / « slate » absents de Tailwind 2.2.
   ========================================================================== */
.shadow-2xs { box-shadow: 0 1px 2px rgba(13, 27, 42, 0.05); }
.bg-emerald-100 { background-color: #E3E9EF; }
.bg-emerald-400 { background-color: #7F95AB; }
.bg-emerald-50 { background-color: #F2F5F8; }
.bg-emerald-50/60 { background-color: rgba(242, 245, 248, 0.6); }
.bg-emerald-500 { background-color: #5C7792; }
.bg-emerald-600 { background-color: #4A6785; }
.bg-emerald-700 { background-color: #37506B; }
.bg-emerald-800 { background-color: #233850; }
.bg-slate-100 { background-color: #F1F5F9; }
.bg-slate-400 { background-color: #94A3B8; }
.bg-slate-50 { background-color: #F8FAFC; }
.bg-slate-50/70 { background-color: rgba(248, 250, 252, 0.7); }
.bg-slate-50/80 { background-color: rgba(248, 250, 252, 0.8); }
.bg-slate-900/95 { background-color: rgba(15, 23, 42, 0.95); }
.border-emerald-200 { border-color: #C9D3DD; }
.border-emerald-200/80 { border-color: rgba(201, 211, 221, 0.8); }
.border-emerald-200/90 { border-color: rgba(201, 211, 221, 0.9); }
.border-emerald-300 { border-color: #A7B6C5; }
.border-emerald-500/50 { border-color: rgba(92, 119, 146, 0.5); }
.border-slate-100 { border-color: #F1F5F9; }
.border-slate-200 { border-color: #E2E8F0; }
.border-slate-200/60 { border-color: rgba(226, 232, 240, 0.6); }
.border-slate-200/80 { border-color: rgba(226, 232, 240, 0.8); }
.border-slate-200/90 { border-color: rgba(226, 232, 240, 0.9); }
.border-slate-300 { border-color: #CBD5E1; }
.border-slate-700 { border-color: #334155; }
.focus:ring-emerald-500:focus { --tw-ring-color: #5C7792; }
.from-emerald-600 { --tw-gradient-from: #4A6785; --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, rgba(74, 103, 133, 0)); }
.group:hover .group-hover:bg-emerald-700 { background-color: #37506B; }
.hover:bg-emerald-50:hover { background-color: #F2F5F8; }
.hover:bg-emerald-500:hover { background-color: #5C7792; }
.hover:bg-emerald-600:hover { background-color: #4A6785; }
.hover:bg-emerald-700:hover { background-color: #37506B; }
.hover:bg-emerald-800:hover { background-color: #233850; }
.hover:bg-slate-100:hover { background-color: #F1F5F9; }
.hover:bg-slate-200:hover { background-color: #E2E8F0; }
.hover:bg-slate-200/60:hover { background-color: rgba(226, 232, 240, 0.6); }
.hover:bg-slate-50/70:hover { background-color: rgba(248, 250, 252, 0.7); }
.hover:bg-slate-50/80:hover { background-color: rgba(248, 250, 252, 0.8); }
.hover:from-emerald-500:hover { --tw-gradient-from: #5C7792; --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, rgba(92, 119, 146, 0)); }
.hover:text-emerald-900:hover { color: #0D1B2A; }
.hover:text-slate-700:hover { color: #334155; }
.hover:to-emerald-400:hover { --tw-gradient-to: #7F95AB; }
.text-emerald-200 { color: #C9D3DD; }
.text-emerald-400 { color: #7F95AB; }
.text-emerald-600 { color: #4A6785; }
.text-emerald-700 { color: #37506B; }
.text-emerald-800 { color: #233850; }
.text-emerald-900 { color: #0D1B2A; }
.text-emerald-950 { color: #08121C; }
.text-slate-100 { color: #F1F5F9; }
.text-slate-400 { color: #94A3B8; }
.text-slate-500 { color: #64748B; }
.text-slate-600 { color: #475569; }
.text-slate-700 { color: #334155; }
.text-slate-800 { color: #1E293B; }
.text-slate-900 { color: #0F172A; }
.to-emerald-500 { --tw-gradient-to: #5C7792; }

.brand-wordmark { letter-spacing: 0.08em; }

/* Comptes de démonstration (écran de connexion) */
.demo-account-btn {
  display: flex; flex-direction: column; align-items: flex-start; gap: 1px;
  padding: 0.45rem 0.6rem; border-radius: 0.6rem; text-align: left;
  background: rgba(74, 103, 133, 0.18); border: 1px solid rgba(183, 190, 199, 0.25);
  color: #FFFFFF; font-size: 0.72rem; transition: background 0.15s ease, border-color 0.15s ease;
}
.demo-account-btn strong { font-family: 'JetBrains Mono', monospace; font-weight: 600; }
.demo-account-btn span { color: #B7BEC7; font-size: 0.65rem; }
.demo-account-btn:hover, .demo-account-btn.active { background: rgba(74, 103, 133, 0.45); border-color: #B7BEC7; }

/* Tailles arbitraires de type Tailwind 3 utilisées dans les gabarits (absentes de Tailwind 2.2) */
.text-\[9px\] { font-size: 9px; line-height: 1.35; }
.text-\[10px\] { font-size: 10px; line-height: 1.4; }
.text-\[11px\] { font-size: 11px; line-height: 1.45; }
.max-h-\[620px\] { max-height: 620px; }
.max-h-\[92vh\] { max-height: 92vh; }
.max-h-\[90vh\] { max-height: 90vh; }
.max-h-\[68vh\] { max-height: 68vh; }
.h-\[68vh\] { height: 68vh; }
.min-h-\[60vh\] { min-height: 60vh; }
.max-w-\[210mm\] { max-width: 210mm; }

/* Champs de l'écran de connexion (fond sombre : opacités Tailwind 3 absentes de Tailwind 2.2) */
#modal-auth-login input[type="text"],
#modal-auth-login input[type="password"] {
  background-color: rgba(13, 27, 42, 0.85);
  border: 1px solid #4A6785;
  color: #FFFFFF;
}
#modal-auth-login input::placeholder { color: #8FA3B8; }
#modal-auth-login input:focus { outline: none; border-color: #B7BEC7; box-shadow: 0 0 0 2px rgba(183, 190, 199, 0.35); }
