/* ==========================================================================
   APP V2 - Modern Mobile-First Design
   Aesthetic: Glassmorphism + Soft gradients + Micro-interactions
   ========================================================================== */

/* --------------------------------------------------------------------------
   CSS Variables & Theme
   -------------------------------------------------------------------------- */
:root {
  /* Core palette - Alsace Red with modern companions */
  --app-primary: #C8102E;
  --app-primary-dark: #9A0C23;
  --app-primary-light: #E84A66;
  /* RGB helpers (override via Paramètres -> Couleurs) */
  --app-primary-rgb: 200,16,46;
  --app-primary-dark-rgb: 154,12,35;
  --app-primary-glow: rgba(var(--app-primary-rgb), 0.25);
  
  /* Accent colors */
  --app-success: #10B981;
  --app-success-soft: rgba(16, 185, 129, 0.12);
  --app-warning: #F59E0B;
  --app-warning-soft: rgba(245, 158, 11, 0.12);
  --app-danger: #EF4444;
  --app-danger-soft: rgba(239, 68, 68, 0.12);
  --app-info: #3B82F6;
  --app-info-soft: rgba(59, 130, 246, 0.12);
  
  /* Neutrals */
  --app-bg: #F8FAFC;
  --app-surface: #FFFFFF;
  --app-surface-2: #F1F5F9;
  --app-surface-3: #E2E8F0;
  --app-text: #0F172A;
  --app-text-secondary: #64748B;
  --app-text-muted: #94A3B8;
  --app-border: rgba(15, 23, 42, 0.08);
  --app-border-strong: rgba(15, 23, 42, 0.15);
  
  /* Shadows */
  --app-shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
  --app-shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.06);
  --app-shadow-md: 0 8px 24px rgba(15, 23, 42, 0.08);
  --app-shadow-lg: 0 16px 48px rgba(15, 23, 42, 0.12);
  --app-shadow-glow: 0 0 40px var(--app-primary-glow);
  
  /* Glass effects */
  --app-glass: rgba(255, 255, 255, 0.7);
  --app-glass-blur: blur(20px);
  --app-glass-border: rgba(255, 255, 255, 0.5);
  
  /* Spacing scale */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  
  /* Border radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;
  
  /* Typography */
  --font-display: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  
  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);
  
  /* Z-index scale */
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-modal: 300;
  --z-toast: 400;
  
  /* Bootstrap overrides */
  --bs-primary: var(--app-primary);
  --bs-link-color: var(--app-primary);
  --bs-link-hover-color: var(--app-primary-dark);
}

/* Dark mode */
body[data-theme="dark"] {
  --app-bg: #0C1222;
  --app-surface: #151D2E;
  --app-surface-2: #1E293B;
  --app-surface-3: #334155;
  --app-text: #F1F5F9;
  --app-text-secondary: #94A3B8;
  --app-text-muted: #64748B;
  --app-border: rgba(255, 255, 255, 0.08);
  --app-border-strong: rgba(255, 255, 255, 0.15);
  --app-glass: rgba(21, 29, 46, 0.8);
  --app-glass-border: rgba(255, 255, 255, 0.1);
  
  color-scheme: dark;
}

/* --------------------------------------------------------------------------
   Base & Typography
   -------------------------------------------------------------------------- */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@500;600;700;800&family=Inter:wght@400;500;600&display=swap');

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  background: var(--app-bg);
  color: var(--app-text);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Animated background gradient */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: 
    radial-gradient(ellipse 80% 50% at 20% -20%, var(--app-primary-glow), transparent 50%),
    radial-gradient(ellipse 60% 40% at 80% 10%, rgba(59, 130, 246, 0.08), transparent 40%),
    radial-gradient(ellipse 50% 30% at 50% 100%, rgba(16, 185, 129, 0.06), transparent 50%);
  pointer-events: none;
  z-index: -1;
}

h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--app-text);
  line-height: 1.3;
}

a {
  color: var(--app-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--app-primary-dark);
}

/* --------------------------------------------------------------------------
   Cards V2 - Glass Morphism
   -------------------------------------------------------------------------- */
.card-v2 {
  background: var(--app-glass);
  backdrop-filter: var(--app-glass-blur);
  -webkit-backdrop-filter: var(--app-glass-blur);
  border: 1px solid var(--app-glass-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--app-shadow-md);
  transition: transform var(--transition-base), box-shadow var(--transition-base);
  overflow: hidden;
}

.card-v2--solid {
  background: var(--app-surface);
  backdrop-filter: none;
}

.card-v2--interactive:hover {
  transform: translateY(-4px);
  box-shadow: var(--app-shadow-lg);
}

.card-v2--glow:hover {
  box-shadow: var(--app-shadow-lg), var(--app-shadow-glow);
}

.card-v2__header {
  padding: var(--space-lg);
  border-bottom: 1px solid var(--app-border);
}

.card-v2__body {
  padding: var(--space-lg);
}

.card-v2__footer {
  padding: var(--space-md) var(--space-lg);
  background: var(--app-surface-2);
  border-top: 1px solid var(--app-border);
}

/* --------------------------------------------------------------------------
   Stats Cards - Hero metrics display
   -------------------------------------------------------------------------- */
.stat-card {
  position: relative;
  padding: var(--space-lg);
  border-radius: var(--radius-xl);
  background: linear-gradient(135deg, var(--app-surface) 0%, var(--app-surface-2) 100%);
  border: 1px solid var(--app-border);
  overflow: hidden;
  transition: all var(--transition-base);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 120px;
  height: 120px;
  background: var(--stat-color, var(--app-primary-glow));
  border-radius: 50%;
  transform: translate(30%, -30%);
  opacity: 0.15;
  transition: transform var(--transition-slow), opacity var(--transition-base);
}

.stat-card:hover::before {
  transform: translate(20%, -20%) scale(1.2);
  opacity: 0.25;
}

.stat-card__icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-lg);
  background: var(--stat-bg, var(--app-primary-glow));
  color: var(--stat-color, var(--app-primary));
  font-size: 1.25rem;
  margin-bottom: var(--space-md);
  transition: transform var(--transition-bounce);
}

.stat-card:hover .stat-card__icon {
  transform: scale(1.1) rotate(-5deg);
}

.stat-card__label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--app-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-xs);
}

.stat-card__value {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 800;
  color: var(--app-text);
  line-height: 1.1;
}

.stat-card__trend {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8125rem;
  font-weight: 600;
  margin-top: var(--space-sm);
  padding: 4px 8px;
  border-radius: var(--radius-full);
}

.stat-card__trend--up {
  color: var(--app-success);
  background: var(--app-success-soft);
}

.stat-card__trend--down {
  color: var(--app-danger);
  background: var(--app-danger-soft);
}

/* Stat card variants */
.stat-card--primary { --stat-color: var(--app-primary); --stat-bg: rgba(var(--app-primary-rgb), 0.12); }
.stat-card--success { --stat-color: var(--app-success); --stat-bg: rgba(16, 185, 129, 0.12); }
.stat-card--warning { --stat-color: var(--app-warning); --stat-bg: rgba(245, 158, 11, 0.12); }
.stat-card--info { --stat-color: var(--app-info); --stat-bg: rgba(59, 130, 246, 0.12); }

/* --------------------------------------------------------------------------
   Member Cards - Visual profiles
   -------------------------------------------------------------------------- */
.member-card-v2 {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: var(--space-lg);
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--app-shadow-sm);
  transition: all var(--transition-base);
  cursor: pointer;
}

.member-card-v2:hover {
  border-color: var(--app-primary);
  box-shadow: var(--app-shadow-md), 0 0 0 4px var(--app-primary-glow);
  transform: translateY(-2px);
}

.member-card-v2__avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--app-surface);
  box-shadow: var(--app-shadow-md);
  margin-bottom: var(--space-md);
  transition: transform var(--transition-bounce);
}

.member-card-v2:hover .member-card-v2__avatar {
  transform: scale(1.08);
}

.member-card-v2__name {
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--app-text);
  margin-bottom: var(--space-xs);
}

.member-card-v2__role {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--app-primary);
  margin-bottom: var(--space-sm);
}

.member-card-v2__company {
  font-size: 0.8125rem;
  color: var(--app-text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.member-card-v2__company i {
  font-size: 0.75rem;
  opacity: 0.7;
}

.member-card-v2__actions {
  display: flex;
  gap: var(--space-sm);
  margin-top: auto;
  padding-top: var(--space-md);
}

.member-card-v2__status {
  position: absolute;
  top: var(--space-md);
  right: var(--space-md);
}

/* En-tête de tuile : avatar + logo société côte à côte */
.member-tile-head {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  width: 100%;
  margin-bottom: var(--space-md);
}

/* Logo société mis en avant sur la tuile */
.member-tile-logo {
  margin-left: auto;
  flex-shrink: 0;
  height: 88px;
  min-width: 88px;
  max-width: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  background: #fff;
  border: 1px solid var(--app-border);
  border-radius: 12px;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.10);
}

.member-tile-logo img {
  max-height: 100%;
  max-width: 100%;
  object-fit: contain;
}

/* Anneau de statut + pastille autour de la photo de profil (libère le coin pour le logo) */
.member-avatar-wrap {
  position: relative;
  display: inline-block;
  flex-shrink: 0;
}
.member-avatar-wrap .member-card-v2__avatar {
  margin-bottom: 0;
}
.member-avatar-wrap--active .member-card-v2__avatar {
  border-color: var(--app-success);
  box-shadow: 0 0 0 3px var(--app-success-soft, rgba(16,185,129,.18));
}
.member-avatar-wrap--pending .member-card-v2__avatar {
  border-color: var(--app-warning);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, .20);
}
.member-avatar-wrap--former .member-card-v2__avatar {
  border-color: var(--app-text-muted);
  box-shadow: 0 0 0 3px rgba(100, 116, 139, .18);
}
.member-status-dot {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: .72rem;
  border: 2px solid var(--app-surface);
  box-shadow: 0 1px 5px rgba(0, 0, 0, .25);
}
.member-status-dot--active  { background: var(--app-success); }
.member-status-dot--pending { background: var(--app-warning); }
.member-status-dot--former  { background: var(--app-text-muted); }

@media (max-width: 576px) {
  .member-tile-logo {
    height: 70px;
    min-width: 70px;
    max-width: 130px;
  }
}

/* --------------------------------------------------------------------------
   Meeting Cards - Event display
   -------------------------------------------------------------------------- */
.meeting-card {
  position: relative;
  display: flex;
  gap: var(--space-md);
  padding: var(--space-lg);
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--app-shadow-sm);
  transition: all var(--transition-base);
  overflow: hidden;
}

.meeting-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--app-primary);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.meeting-card:hover {
  box-shadow: var(--app-shadow-md);
  transform: translateX(4px);
}

.meeting-card__date {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  padding: var(--space-sm);
  background: linear-gradient(135deg, var(--app-primary) 0%, var(--app-primary-dark) 100%);
  border-radius: var(--radius-lg);
  color: white;
  text-align: center;
}

.meeting-card__date-day {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1;
}

.meeting-card__date-month {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.9;
}

.meeting-card__content {
  flex: 1;
  min-width: 0;
}

.meeting-card__title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--app-text);
  margin-bottom: var(--space-xs);
}

.meeting-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  font-size: 0.8125rem;
  color: var(--app-text-secondary);
}

.meeting-card__meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.meeting-card__meta-item i {
  color: var(--app-text-muted);
}

.meeting-card__badges {
  display: flex;
  gap: var(--space-sm);
  margin-top: var(--space-sm);
}

/* --------------------------------------------------------------------------
   Notification Items - Alert style
   -------------------------------------------------------------------------- */
.notif-item {
  display: flex;
  gap: var(--space-md);
  padding: var(--space-md);
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--radius-lg);
  transition: all var(--transition-base);
}

.notif-item--unread {
  background: linear-gradient(90deg, rgba(var(--app-primary-rgb), 0.04), transparent 50%);
  border-left: 3px solid var(--app-primary);
}

.notif-item:hover {
  background: var(--app-surface-2);
}

.notif-item__icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  flex-shrink: 0;
}

.notif-item__icon--message { background: var(--app-info-soft); color: var(--app-info); }
.notif-item__icon--alert { background: var(--app-warning-soft); color: var(--app-warning); }
.notif-item__icon--success { background: var(--app-success-soft); color: var(--app-success); }
.notif-item__icon--reco { background: rgba(var(--app-primary-rgb), 0.1); color: var(--app-primary); }

.notif-item__content {
  flex: 1;
  min-width: 0;
}

.notif-item__title {
  font-weight: 600;
  color: var(--app-text);
  margin-bottom: 2px;
}

.notif-item__body {
  font-size: 0.875rem;
  color: var(--app-text-secondary);
  white-space: pre-wrap;
  word-break: break-word;
}

.notif-item__time {
  font-size: 0.75rem;
  color: var(--app-text-muted);
  margin-top: var(--space-xs);
}

/* --------------------------------------------------------------------------
   Recommendation Cards
   -------------------------------------------------------------------------- */
.reco-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: var(--space-md);
  align-items: center;
  padding: var(--space-md) var(--space-lg);
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--radius-lg);
  transition: all var(--transition-base);
}

.reco-card:hover {
  border-color: var(--app-border-strong);
  box-shadow: var(--app-shadow-sm);
}

.reco-card__avatar-stack {
  display: flex;
}

.reco-card__avatar-stack img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid var(--app-surface);
  object-fit: cover;
}

.reco-card__avatar-stack img:not(:first-child) {
  margin-left: -12px;
}

.reco-card__info {
  min-width: 0;
}

.reco-card__contact {
  font-weight: 600;
  color: var(--app-text);
}

.reco-card__flow {
  font-size: 0.8125rem;
  color: var(--app-text-secondary);
}

.reco-card__stats {
  text-align: right;
}

.reco-card__amount {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--app-text);
}

/* --------------------------------------------------------------------------
   Guest Cards
   -------------------------------------------------------------------------- */
.guest-card {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--radius-lg);
  transition: all var(--transition-base);
}

.guest-card:hover {
  background: var(--app-surface-2);
}

.guest-card__avatar {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--app-surface-2);
  border-radius: 50%;
  color: var(--app-text-muted);
  font-size: 1.25rem;
}

.guest-card__info {
  flex: 1;
  min-width: 0;
}

.guest-card__name {
  font-weight: 600;
  color: var(--app-text);
}

.guest-card__contact {
  font-size: 0.8125rem;
  color: var(--app-text-secondary);
}

.guest-card__visits {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--app-surface-2);
  border-radius: var(--radius-full);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--app-text-secondary);
}

/* --------------------------------------------------------------------------
   Buttons V2
   -------------------------------------------------------------------------- */
.btn-v2 {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.4;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
}

.btn-v2:focus {
  outline: none;
  box-shadow: 0 0 0 3px var(--app-primary-glow);
}

.btn-v2--primary {
  background: linear-gradient(135deg, var(--app-primary) 0%, var(--app-primary-dark) 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(var(--app-primary-rgb), 0.3);
}

.btn-v2--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(var(--app-primary-rgb), 0.4);
  color: white;
}

.btn-v2--secondary {
  background: var(--app-surface);
  color: var(--app-text);
  border: 1px solid var(--app-border-strong);
}

.btn-v2--secondary:hover {
  background: var(--app-surface-2);
  color: var(--app-text);
}

.btn-v2--ghost {
  background: transparent;
  color: var(--app-text-secondary);
}

.btn-v2--ghost:hover {
  background: var(--app-surface-2);
  color: var(--app-text);
}

.btn-v2--sm {
  padding: 6px 12px;
  font-size: 0.8125rem;
}

.btn-v2--lg {
  padding: 14px 28px;
  font-size: 1rem;
}

.btn-v2--icon {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 50%;
}

.btn-v2--icon.btn-v2--sm {
  width: 32px;
  height: 32px;
}

/* --------------------------------------------------------------------------
   Badges V2
   -------------------------------------------------------------------------- */
.badge-v2 {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.4;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.badge-v2--primary { background: rgba(var(--app-primary-rgb), 0.12); color: var(--app-primary); }
.badge-v2--success { background: var(--app-success-soft); color: var(--app-success); }
.badge-v2--warning { background: var(--app-warning-soft); color: var(--app-warning); }
.badge-v2--danger { background: var(--app-danger-soft); color: var(--app-danger); }
.badge-v2--info { background: var(--app-info-soft); color: var(--app-info); }
.badge-v2--neutral { background: var(--app-surface-2); color: var(--app-text-secondary); }

.badge-v2--solid {
  color: white;
}
.badge-v2--solid.badge-v2--primary { background: var(--app-primary); }
.badge-v2--solid.badge-v2--success { background: var(--app-success); }
.badge-v2--solid.badge-v2--warning { background: var(--app-warning); }
.badge-v2--solid.badge-v2--danger { background: var(--app-danger); }

/* Pulse animation for notifications */
.badge-v2--pulse {
  position: relative;
}

.badge-v2--pulse::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: inherit;
  animation: badge-pulse 2s ease-out infinite;
}

@keyframes badge-pulse {
  0% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(1.5); opacity: 0; }
  100% { transform: scale(1.5); opacity: 0; }
}

/* Group badges - small variant */
.badge.small {
  font-size: 0.65rem;
  padding: 2px 6px;
}

/* --------------------------------------------------------------------------
   Search Bar V2
   -------------------------------------------------------------------------- */
.search-v2 {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--radius-full);
  padding: 8px 16px;
  transition: all var(--transition-base);
}

.search-v2:focus-within {
  border-color: var(--app-primary);
  box-shadow: 0 0 0 4px var(--app-primary-glow);
}

.search-v2__icon {
  color: var(--app-text-muted);
  margin-right: 10px;
}

.search-v2__input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 0.9375rem;
  color: var(--app-text);
  outline: none;
}

.search-v2__input::placeholder {
  color: var(--app-text-muted);
}

.search-v2__clear {
  display: none;
  padding: 4px;
  background: var(--app-surface-2);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  color: var(--app-text-muted);
}

.search-v2__input:not(:placeholder-shown) ~ .search-v2__clear {
  display: flex;
}

/* --------------------------------------------------------------------------
   Empty States
   -------------------------------------------------------------------------- */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-2xl);
  text-align: center;
}

.empty-state__icon {
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--app-surface-2);
  border-radius: 50%;
  color: var(--app-text-muted);
  font-size: 2rem;
  margin-bottom: var(--space-lg);
}

.empty-state__title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--app-text);
  margin-bottom: var(--space-sm);
}

.empty-state__desc {
  color: var(--app-text-secondary);
  max-width: 320px;
  margin-bottom: var(--space-lg);
}

/* --------------------------------------------------------------------------
   Page Header V2
   -------------------------------------------------------------------------- */
.page-header-v2 {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  margin-bottom: var(--space-xl);
}

@media (min-width: 768px) {
  .page-header-v2 {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-lg);
  }
}

.page-header-v2__title {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--app-text);
  margin: 0;
}

.page-header-v2__subtitle {
  color: var(--app-text-secondary);
  margin: 0;
}

.page-header-v2__actions {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

/* --------------------------------------------------------------------------
   Grid Layouts
   -------------------------------------------------------------------------- */
.grid-stats {
  display: grid;
  gap: var(--space-md);
  grid-template-columns: 1fr;
}

@media (min-width: 576px) {
  .grid-stats {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 992px) {
  .grid-stats {
    grid-template-columns: repeat(4, 1fr);
  }
}

.grid-cards {
  display: grid;
  gap: var(--space-md);
  grid-template-columns: 1fr;
}

@media (min-width: 576px) {
  .grid-cards {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 992px) {
  .grid-cards {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1400px) {
  .grid-cards {
    grid-template-columns: repeat(4, 1fr);
  }
}

.list-stack {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

/* --------------------------------------------------------------------------
   Mobile Navigation Enhancement
   -------------------------------------------------------------------------- */
.mobile-nav-fab {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--app-primary) 0%, var(--app-primary-dark) 100%);
  color: white;
  border: none;
  border-radius: 50%;
  box-shadow: 0 6px 20px rgba(var(--app-primary-rgb), 0.4);
  font-size: 1.5rem;
  cursor: pointer;
  z-index: var(--z-sticky);
  transition: all var(--transition-base);
}

.mobile-nav-fab:hover {
  transform: scale(1.1);
}

@media (min-width: 992px) {
  .mobile-nav-fab {
    display: none;
  }
}

/* --------------------------------------------------------------------------
   Quick Actions Bar (Mobile)
   -------------------------------------------------------------------------- */
.quick-actions {
  display: flex;
  gap: var(--space-sm);
  padding: var(--space-sm);
  background: var(--app-glass);
  backdrop-filter: var(--app-glass-blur);
  border-radius: var(--radius-xl);
  margin-bottom: var(--space-lg);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.quick-actions::-webkit-scrollbar {
  display: none;
}

.quick-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: var(--space-sm) var(--space-md);
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: var(--app-text);
  white-space: nowrap;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.quick-action:hover {
  background: var(--app-primary);
  color: white;
  border-color: var(--app-primary);
}

.quick-action__icon {
  font-size: 1.25rem;
}

.quick-action__label {
  font-size: 0.75rem;
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   Swipeable Cards (Mobile)
   -------------------------------------------------------------------------- */
.swipe-container {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  margin: 0 calc(-1 * var(--space-lg));
  padding: 0 var(--space-lg);
}

.swipe-container::-webkit-scrollbar {
  display: none;
}

.swipe-container > * {
  scroll-snap-align: start;
  flex-shrink: 0;
}

/* --------------------------------------------------------------------------
   Pull to Refresh indicator
   -------------------------------------------------------------------------- */
.ptr-indicator {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%) translateY(-100%);
  padding: 12px 20px;
  background: var(--app-surface);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  box-shadow: var(--app-shadow-md);
  font-size: 0.875rem;
  color: var(--app-text-secondary);
  z-index: var(--z-toast);
  transition: transform var(--transition-base);
}

.ptr-indicator.visible {
  transform: translateX(-50%) translateY(0);
}

/* --------------------------------------------------------------------------
   Skeleton Loading
   -------------------------------------------------------------------------- */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--app-surface-2) 25%,
    var(--app-surface-3) 50%,
    var(--app-surface-2) 75%
  );
  background-size: 200% 100%;
  animation: skeleton-pulse 1.5s ease-in-out infinite;
  border-radius: var(--radius-sm);
}

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

.skeleton--circle {
  border-radius: 50%;
}

.skeleton--text {
  height: 1em;
  margin-bottom: 0.5em;
}

.skeleton--title {
  height: 1.5em;
  width: 60%;
}

/* --------------------------------------------------------------------------
   Utility Classes
   -------------------------------------------------------------------------- */
.text-gradient {
  background: linear-gradient(135deg, var(--app-primary) 0%, var(--app-primary-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.no-scrollbar {
  scrollbar-width: none;
}

.no-scrollbar::-webkit-scrollbar {
  display: none;
}

/* --------------------------------------------------------------------------
   Responsive Utilities
   -------------------------------------------------------------------------- */
@media (max-width: 575.98px) {
  .hide-mobile { display: none !important; }
}

@media (min-width: 576px) {
  .show-mobile-only { display: none !important; }
}

/* Safe area padding for notched devices */
@supports (padding-top: env(safe-area-inset-top)) {
  .safe-area-top { padding-top: env(safe-area-inset-top); }
  .safe-area-bottom { padding-bottom: env(safe-area-inset-bottom); }
}

/* --------------------------------------------------------------------------
   Animation Classes
   -------------------------------------------------------------------------- */
.fade-in {
  animation: fadeIn var(--transition-base) ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.slide-up {
  animation: slideUp var(--transition-base) ease-out;
}

@keyframes slideUp {
  from { 
    opacity: 0;
    transform: translateY(20px);
  }
  to { 
    opacity: 1;
    transform: translateY(0);
  }
}

.scale-in {
  animation: scaleIn var(--transition-bounce);
}

@keyframes scaleIn {
  from { 
    opacity: 0;
    transform: scale(0.9);
  }
  to { 
    opacity: 1;
    transform: scale(1);
  }
}

/* Stagger children animations */
.stagger-children > * {
  animation: slideUp var(--transition-base) ease-out both;
}

.stagger-children > *:nth-child(1) { animation-delay: 0ms; }
.stagger-children > *:nth-child(2) { animation-delay: 50ms; }
.stagger-children > *:nth-child(3) { animation-delay: 100ms; }
.stagger-children > *:nth-child(4) { animation-delay: 150ms; }
.stagger-children > *:nth-child(5) { animation-delay: 200ms; }
.stagger-children > *:nth-child(6) { animation-delay: 250ms; }
.stagger-children > *:nth-child(7) { animation-delay: 300ms; }
.stagger-children > *:nth-child(8) { animation-delay: 350ms; }

/* --------------------------------------------------------------------------
   Disabled module links (consistent when modules are off)
   -------------------------------------------------------------------------- */
.vx-nav__item.is-disabled,
.quick-action.is-disabled,
.btn.disabled {
  opacity: .45;
  filter: grayscale(1);
  cursor: not-allowed;
}
.vx-nav__item.is-disabled:hover,
.quick-action.is-disabled:hover {
  background: inherit !important;
  color: inherit !important;
  border-color: var(--app-border) !important;
}

/* --------------------------------------------------------------------------
   Chart wrapper to prevent infinite resizing (Chart.js + ResizeObserver)
   -------------------------------------------------------------------------- */
.chart-wrap {
  position: relative;
  height: 160px;
  width: 100%;
}
.chart-wrap--lg {
  height: 180px;
}
.chart-wrap canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
}


/* ==========================================================
   Tableau de bord : icône calendrier, KPI, fil des recommandations
   ========================================================== */
.cal-ico { display: flex; flex-direction: column; flex: 0 0 auto; align-self: flex-start; height: auto; width: 52px; border-radius: 12px; overflow: hidden; text-align: center; line-height: 1;
  background: var(--app-surface); box-shadow: 0 6px 16px rgba(var(--app-primary-rgb), .16), 0 0 0 1px var(--app-border); }
.cal-ico__wd { background: linear-gradient(135deg, var(--app-primary) 0%, var(--app-primary-dark) 100%); color: #fff;
  font-size: .62rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; padding: 4px 0 3px; }
.cal-ico__day { font-family: var(--font-display); font-size: 1.35rem; font-weight: 800; color: var(--app-text); padding: 5px 0 1px; }
.cal-ico__mon { font-size: .6rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--app-text-secondary); padding-bottom: 5px; }
.cal-ico--lg { width: 64px; border-radius: 14px; }
.cal-ico--lg .cal-ico__wd { font-size: .68rem; padding: 5px 0 4px; }
.cal-ico--lg .cal-ico__day { font-size: 1.75rem; padding-top: 7px; }
.cal-ico--lg .cal-ico__mon { font-size: .66rem; padding-bottom: 7px; }

.dk-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-md); margin-bottom: var(--space-lg); }
.dk { display: flex; flex-direction: column; gap: 6px; min-width: 0; padding: var(--space-md) var(--space-lg); border-radius: var(--radius-lg);
  background: var(--app-surface); border: 1px solid var(--app-border); box-shadow: var(--app-shadow-xs); color: var(--app-text); text-decoration: none;
  transition: transform .2s ease, box-shadow .2s ease; }
a.dk:hover { transform: translateY(-2px); box-shadow: var(--app-shadow-md); color: var(--app-text); }
.dk__label { font-size: .78rem; font-weight: 600; color: var(--app-text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dk__label i { color: var(--app-primary); margin-right: 3px; }
.dk__value { font-family: var(--font-display); font-size: 1.75rem; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; white-space: nowrap; }
.dk__value small { font-size: .55em; font-weight: 700; color: var(--app-text-muted); }
.dk__foot { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: .78rem; }
.dk__sub { font-size: .76rem; color: var(--app-text-muted); margin-top: auto; padding-top: 2px; }
.dk__sub b { color: var(--app-text-secondary); font-weight: 700; }
.dk__muted { color: var(--app-text-muted); }
.dk-trend { display: inline-flex; align-items: center; gap: 3px; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.dk-trend--up { color: var(--app-success); background: var(--app-success-soft); }
.dk-trend--down { color: var(--app-danger); background: var(--app-danger-soft); }
.dk-trend--flat { color: var(--app-text-secondary); background: var(--app-surface-2); }
.dk--hot { background: linear-gradient(140deg, rgba(var(--app-primary-rgb), .14) 0%, rgba(var(--app-primary-rgb), .03) 100%), var(--app-surface);
  border-color: rgba(var(--app-primary-rgb), .28); }
.dk--hot .dk__value { color: var(--app-primary); }
.dk-meter { height: 6px; border-radius: 6px; background: var(--app-surface-2); overflow: hidden; margin: 4px 0 2px; }
.dk-meter i { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--app-primary-light), var(--app-primary));
  transform-origin: left; animation: dkGrow 1.1s cubic-bezier(.2, .8, .2, 1); }
.dk-meter--ok i { background: linear-gradient(90deg, #34d399, var(--app-success)); }
@keyframes dkGrow { from { transform: scaleX(0); } to { transform: scaleX(1); } }

.dk-split { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: var(--space-md); margin-bottom: var(--space-xl); align-items: start; }
.dk-feed { padding: var(--space-lg); }
.dk-feed__head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: var(--space-md); }
.dk-feed__all { font-size: .82rem; font-weight: 600; white-space: nowrap; color: var(--app-primary); text-decoration: none; }
.dk-feed__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.dk-feed__row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; background: var(--app-surface-2);
  color: var(--app-text); text-decoration: none; transition: background .15s ease; }
.dk-feed__row:hover { background: rgba(var(--app-primary-rgb), .07); color: var(--app-text); }
.dk-feed__row.is-new { background: var(--app-success-soft); }
.dk-feed__txt { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.dk-feed__txt > span { font-size: .86rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--app-text-secondary); }
.dk-feed__txt > span b { color: var(--app-text); }
.dk-feed__txt > span i { font-size: .72rem; color: var(--app-text-muted); }
.dk-feed__txt small { font-size: .74rem; color: var(--app-text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dk-av { width: 34px; height: 34px; border-radius: 50%; flex: none; object-fit: cover; display: grid; place-items: center; font-size: .72rem; font-weight: 800; color: #fff;
  background: linear-gradient(135deg, hsl(var(--h, 350) 68% 52%), hsl(calc(var(--h, 350) + 30) 72% 62%)); }
.dk-pill { flex: none; font-size: .74rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.dk-pill--ok { color: var(--app-success); background: var(--app-success-soft); }
.dk-pill--warn { color: #b45309; background: var(--app-warning-soft); }
.dk-pill--wait { color: var(--app-text-secondary); background: var(--app-surface-3); }
.dk-pill--lost { color: var(--app-danger); background: var(--app-danger-soft); }
body[data-theme="dark"] .dk-pill--warn { color: #fbbf24; }
.dk-new { font-style: normal; font-size: .62rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--app-success); }
.dk-feed__empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: var(--space-lg) 0; text-align: center; color: var(--app-text-secondary); font-size: .9rem; }
.dk-feed__empty > i { font-size: 1.6rem; color: var(--app-text-muted); }
/* Widget « Mes recommandations » (onglets Données / Reçues) */
.dk-my + .dk-my, .dk-feed + .dk-my { margin-top: var(--space-lg); }
.dk-my__tabs { display: inline-flex; gap: 4px; padding: 4px; margin-bottom: var(--space-md); border-radius: 12px; background: var(--app-surface-2); }
.dk-my__tab { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: 0; border-radius: 9px; background: none; cursor: pointer;
  font: inherit; font-size: .82rem; font-weight: 700; color: var(--app-text-secondary); transition: background .2s, color .2s, box-shadow .2s; }
.dk-my__tab span { min-width: 20px; padding: 0 6px; border-radius: 999px; font-size: .7rem; line-height: 18px; text-align: center; background: var(--app-surface-3); color: var(--app-text-secondary); font-variant-numeric: tabular-nums; }
.dk-my__tab:hover { color: var(--app-text); }
.dk-my__tab.is-on { background: var(--app-surface); color: var(--app-text); box-shadow: 0 1px 3px rgba(15, 23, 42, .1); }
.dk-my__tab.is-on span { background: rgba(var(--app-primary-rgb), .12); color: var(--app-primary); }
.dk-my__tab:focus-visible { outline: 2px solid var(--app-primary); outline-offset: 2px; }
.dk-my__pane { animation: dkMyIn .25s ease; }
@keyframes dkMyIn { from { opacity: 0; transform: translateY(4px); } }
@media (prefers-reduced-motion: reduce) { .dk-my__pane { animation: none; } }

@media (max-width: 1199px) {
  .dk-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dk-split { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .dk-grid { gap: 10px; }
  .dk { padding: 12px 14px; }
  .dk__value { font-size: 1.4rem; }
  .dk__label { font-size: .72rem; }
  .dk__lx { display: none; }
  .dk-feed { padding: var(--space-md); }
  .dk-feed__row { align-items: flex-start; padding: 8px; gap: 8px; }
  .dk-av { width: 30px; height: 30px; font-size: .66rem; }
  .dk-feed__txt > span { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .dk-pill { font-size: .68rem; padding: 3px 8px; margin-top: 2px; }
}
@media (prefers-reduced-motion: reduce) {
  .dk-meter i { animation: none; }
  a.dk:hover { transform: none; }
}

/* Raccourcis mobile : les 5 boutons tiennent sur une ligne, sans défilement caché */
@media (max-width: 480px) {
  .quick-actions { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 6px; padding: 6px; }
  .quick-action { padding: 8px 2px; min-width: 0; }
  .quick-action__label { font-size: .68rem; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}


/* 5 indicateurs : 3 + 2 sur une grille de 6 (pas de carte orpheline) */
@media (min-width: 1200px) {
  .dk-grid:has(> :nth-child(5)) { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .dk-grid:has(> :nth-child(5)) > * { grid-column: span 2; }
  .dk-grid:has(> :nth-child(5)) > :nth-child(n+4) { grid-column: span 3; }
}
@media (max-width: 1199px) {
  .dk-grid > :nth-child(5):last-child { grid-column: 1 / -1; }
}

/* ==========================================================
   Module Discussions
   ========================================================== */
.dd-page { max-width: 1100px; margin: 0 auto; }
.dd-layout { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: var(--space-md); margin-bottom: var(--space-xl); align-items: start; }
.dd-form, .dd-side { padding: var(--space-lg); }
.dd-card-title { font-weight: 800; margin-bottom: .8rem; display: flex; align-items: center; gap: .45rem; }
.dd-card-title i { color: var(--app-primary); }
.dd-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.dd-chip { cursor: pointer; margin: 0; }
.dd-chip input { position: absolute; opacity: 0; pointer-events: none; }
.dd-chip span { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; font-size: .84rem; font-weight: 600;
  border: 1px solid var(--app-border-strong); background: var(--app-surface); color: var(--app-text-secondary); transition: all .15s ease; }
.dd-chip input:checked + span { background: rgba(var(--app-primary-rgb), .1); border-color: var(--app-primary); color: var(--app-primary); }
.dd-chip input:focus-visible + span { box-shadow: 0 0 0 3px rgba(var(--app-primary-rgb), .25); }
.dd-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: .5rem; }
.dd-hint { font-size: .82rem; color: var(--app-text-muted); margin: -.3rem 0 .7rem; }
.dd-empty-sm { font-size: .88rem; color: var(--app-text-secondary); display: flex; gap: .5rem; align-items: center; }
.dd-suggest { display: flex; flex-direction: column; gap: 6px; }
.dd-person { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 12px; background: var(--app-surface-2); color: var(--app-text); text-decoration: none; transition: background .15s ease; }
.dd-person:hover { background: rgba(var(--app-primary-rgb), .08); color: var(--app-text); }
.dd-person img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; flex: none; }
.dd-person > span:not(.dd-rank) { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.dd-person b { font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dd-person small { font-size: .75rem; color: var(--app-text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dd-person > i { color: var(--app-primary); font-size: 1.1rem; }
.dd-rank { width: 22px; height: 22px; border-radius: 50%; flex: none; display: grid; place-items: center; font-size: .72rem; font-weight: 800; background: var(--app-surface-3); color: var(--app-text-secondary); }
.dd-person:first-child .dd-rank { background: linear-gradient(135deg, #fbbf24, #f59e0b); color: #fff; }
.dd-list-title { font-weight: 800; font-size: 1.05rem; margin: 0 0 .6rem; display: flex; align-items: center; gap: .45rem; }
.dd-list-title i { color: var(--app-primary); }
.dd-count { font-size: .75rem; font-weight: 700; padding: 2px 9px; border-radius: 999px; background: var(--app-surface-2); color: var(--app-text-secondary); }
.dd-month { font-size: .74rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--app-text-muted); margin: var(--space-md) 0 .5rem; }
.dd-month span { margin-left: 4px; color: var(--app-text-secondary); }
.dd-list { display: flex; flex-direction: column; gap: 8px; }
.dd-item { display: flex; gap: 14px; align-items: flex-start; padding: 12px 14px; }
.dd-item__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.dd-item__who { display: flex; align-items: center; gap: 10px; font-size: .92rem; color: var(--app-text-secondary); }
.dd-item__who a { color: inherit; text-decoration: none; }
.dd-item__who b { color: var(--app-text); }
.dd-item__who i { font-size: .8rem; color: var(--app-text-muted); margin: 0 2px; }
.dd-item__who small { color: var(--app-text-muted); }
.dd-avs { display: inline-flex; flex: none; }
.dd-avs img { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; border: 2px solid var(--app-surface); }
.dd-avs img + img { margin-left: -10px; }
.dd-item__meta { display: flex; flex-wrap: wrap; gap: 6px; }
.dd-tag { display: inline-flex; align-items: center; gap: 5px; font-size: .74rem; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: rgba(var(--app-primary-rgb), .08); color: var(--app-primary); }
.dd-tag--soft { background: var(--app-surface-2); color: var(--app-text-muted); }
.dd-item__notes { font-size: .86rem; color: var(--app-text); background: var(--app-surface-2); border-radius: 10px; padding: 8px 10px; line-height: 1.5; }
.dd-item__del { margin: 0; flex: none; }
@media (max-width: 900px) {
  .dd-layout { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .dd-item { gap: 10px; padding: 10px; }
  .dd-item__who { align-items: flex-start; font-size: .86rem; }
  .dd-row { grid-template-columns: 1fr 1fr; }
}

/* Icône calendrier : construction animée (carte → bandeau → chiffre qui bascule → mois) */
.cal-ico { animation: calPop .5s cubic-bezier(.2, .9, .3, 1.25) both; perspective: 220px; }
.cal-ico__wd { transform-origin: top center; animation: calBand .42s .14s cubic-bezier(.2, .8, .2, 1) both; }
.cal-ico__day { display: block; transform-origin: center top; backface-visibility: hidden; animation: calFlip .6s .32s cubic-bezier(.2, .8, .25, 1.15) both; }
.cal-ico__mon { animation: calRise .4s .58s ease-out both; }
.cal-ico:hover .cal-ico__day { animation: calFlipAgain .55s cubic-bezier(.2, .8, .25, 1.15); }
/* En liste, les icônes se construisent l'une après l'autre */
.dd-list > :nth-child(2) .cal-ico, .dtk__item:nth-child(2) .cal-ico { animation-delay: .08s; }
.dd-list > :nth-child(3) .cal-ico, .dtk__item:nth-child(3) .cal-ico { animation-delay: .16s; }
.dd-list > :nth-child(4) .cal-ico, .dtk__item:nth-child(4) .cal-ico { animation-delay: .24s; }
.dd-list > :nth-child(n+5) .cal-ico, .dtk__item:nth-child(n+5) .cal-ico { animation-delay: .32s; }
@keyframes calPop { from { opacity: 0; transform: translateY(6px) scale(.82); } to { opacity: 1; transform: none; } }
@keyframes calBand { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes calFlip { 0% { opacity: 0; transform: rotateX(-95deg); } 60% { opacity: 1; } 100% { opacity: 1; transform: rotateX(0); } }
@keyframes calFlipAgain { 0% { transform: rotateX(0); } 45% { transform: rotateX(-90deg); } 100% { transform: rotateX(0); } }
@keyframes calRise { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .cal-ico, .cal-ico__wd, .cal-ico__day, .cal-ico__mon, .cal-ico:hover .cal-ico__day { animation: none; }
}

/* ==========================================================
   Fiche membre (member_view_v2.php)
   ========================================================== */
.mv { max-width: 1180px; margin: 0 auto; }
.mv-back { display: inline-flex; align-items: center; gap: 6px; font-size: .88rem; color: var(--app-text-muted); text-decoration: none; margin-bottom: 12px; }
.mv-back:hover { color: var(--app-primary); }
.mv-hero { position: relative; background: var(--app-surface); border: 1px solid var(--app-border); border-radius: 24px; overflow: hidden; box-shadow: var(--app-shadow-sm); margin-bottom: var(--space-lg); }
.mv-cover { height: 120px; background:
  radial-gradient(120% 140% at 0% 0%, rgba(255,255,255,.18), transparent 50%),
  linear-gradient(120deg, var(--app-primary) 0%, var(--app-primary-dark) 60%, #1e1b2e 140%); }
.mv-cover::after { content: ""; display: block; height: 100%; background-image: radial-gradient(rgba(255,255,255,.16) 1px, transparent 1px); background-size: 18px 18px;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 70%); mask-image: linear-gradient(90deg, transparent, #000 70%); }
.mv-hero__body { display: flex; align-items: flex-start; gap: 20px; padding: 0 28px; margin-top: -56px; flex-wrap: wrap; }
.mv-avatar { width: 128px; height: 128px; border-radius: 50%; object-fit: cover; flex: none; border: 5px solid var(--app-surface); box-shadow: 0 12px 30px rgba(15,23,42,.18); background: var(--app-surface-2); }
.mv-id { flex: 1; min-width: 220px; padding-top: 68px; }
.mv-name { font-family: var(--font-display); font-size: clamp(1.6rem, 3vw, 2.1rem); font-weight: 800; margin: 0 0 4px; line-height: 1.15; color: var(--app-text); }
.mv-role { color: var(--app-text-secondary); font-size: 1rem; }
.mv-role span { color: var(--app-text-muted); }
.mv-role b { color: var(--app-text); font-weight: 700; }
.mv-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; align-items: center; }
.mv-tag { display: inline-flex; align-items: center; gap: 5px; font-size: .78rem; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: var(--app-surface-2); color: var(--app-text-secondary); }
.mv-hero__actions { display: flex; gap: 8px; padding-top: 72px; align-items: center; }
.mv-more { padding: 8px 12px; }
.mv-quick { display: flex; flex-wrap: wrap; gap: 8px; padding: 18px 28px 22px; }
.mv-pill { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; padding: 8px 14px; border-radius: 999px; font-size: .86rem; font-weight: 600;
  color: var(--app-text); background: var(--app-surface-2); border: 1px solid var(--app-border); text-decoration: none; transition: background .15s, border-color .15s, transform .15s; }
.mv-pill span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mv-pill i { color: var(--app-primary); }
.mv-pill:hover { color: var(--app-text); border-color: rgba(var(--app-primary-rgb), .4); background: rgba(var(--app-primary-rgb), .06); transform: translateY(-1px); }
.mv-pill--accent { background: rgba(var(--app-primary-rgb), .1); border-color: rgba(var(--app-primary-rgb), .3); color: var(--app-primary); }
.mv-pill--accent:hover { color: var(--app-primary); }

.mv-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: var(--space-lg); align-items: start; }
.mv-main, .mv-side { display: flex; flex-direction: column; gap: var(--space-lg); min-width: 0; }
.mv-side { position: sticky; top: 84px; }
.mv-card { background: var(--app-surface); border: 1px solid var(--app-border); border-radius: 20px; padding: 22px 24px; box-shadow: var(--app-shadow-xs); }
.mv-card__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.mv-card__head h2 { font-size: 1rem; font-weight: 800; margin: 0; display: flex; align-items: center; gap: 8px; color: var(--app-text); }
.mv-card__head h2 > i { color: var(--app-primary); }
.mv-count { font-size: .72rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--app-surface-2); color: var(--app-text-secondary); }
.mv-card--private { border-color: rgba(245,158,11,.35); background: linear-gradient(135deg, rgba(245,158,11,.07), transparent 60%), var(--app-surface); }
.mv-card--private .mv-card__head h2 > i { color: #d97706; }
.mv-flags { display: flex; flex-wrap: wrap; gap: 8px; }
.mv-flag { display: inline-flex; align-items: center; gap: 6px; font-size: .84rem; font-weight: 600; padding: 6px 12px; border-radius: 10px; }
.mv-flag--danger { color: var(--app-danger); background: var(--app-danger-soft); }
.mv-flag--warn { color: #b45309; background: var(--app-warning-soft); }
.mv-flag--ok { color: var(--app-success); background: var(--app-success-soft); }
body[data-theme="dark"] .mv-flag--warn { color: #fbbf24; }
.mv-company { display: flex; align-items: center; gap: 18px; }
.mv-logo { width: 84px; height: 84px; flex: none; border-radius: 18px; background: #fff; border: 1px solid var(--app-border); display: grid; place-items: center; padding: 10px; }
.mv-logo img { max-width: 100%; max-height: 100%; object-fit: contain; }
.mv-logo--empty { background: var(--app-surface-2); color: var(--app-text-muted); font-size: 1.8rem; }
.mv-company__txt { min-width: 0; }
.mv-eyebrow { font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--app-text-muted); }
.mv-company__name { font-size: 1.2rem; font-weight: 800; color: var(--app-text); margin: 2px 0 4px; }
.mv-company__addr { font-size: .88rem; color: var(--app-text-secondary); text-decoration: none; }
.mv-company__addr:hover { color: var(--app-primary); }
.mv-bio { font-size: .97rem; line-height: 1.75; color: var(--app-text); }
.mv-empty { font-size: .9rem; color: var(--app-text-muted); }
.mv-sub { font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--app-text-muted); margin: 20px 0 10px; }
.mv-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.mv-chip { font-size: .86rem; font-weight: 600; padding: 7px 13px; border-radius: 999px; background: rgba(var(--app-primary-rgb), .08); color: var(--app-primary); }
.mv-docs { display: flex; flex-direction: column; gap: 8px; }
.mv-doc { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; background: var(--app-surface-2); }
.mv-doc__ico { width: 40px; height: 40px; flex: none; border-radius: 11px; display: grid; place-items: center; font-size: 1.2rem; color: #dc2626; background: rgba(220,38,38,.1); }
.mv-doc__txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.mv-doc__txt b { font-size: .92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--app-text); }
.mv-doc__txt small { font-size: .76rem; color: var(--app-text-muted); }
.mv-icon-btn { width: 36px; height: 36px; flex: none; border-radius: 10px; display: grid; place-items: center; color: var(--app-text-secondary); background: var(--app-surface); border: 1px solid var(--app-border); text-decoration: none; }
.mv-icon-btn:hover { color: var(--app-primary); border-color: rgba(var(--app-primary-rgb), .4); }
.mv-testis { display: grid; gap: 12px; }
.mv-testi { margin: 0; padding: 18px 18px 14px; border-radius: 16px; background: var(--app-surface-2); position: relative; }
.mv-testi::before { content: "\201C"; position: absolute; top: -6px; left: 14px; font-family: Georgia, serif; font-size: 3.4rem; line-height: 1; color: rgba(var(--app-primary-rgb), .25); }
.mv-testi blockquote { margin: 0 0 12px; padding-top: 10px; white-space: pre-wrap; line-height: 1.65; color: var(--app-text); font-size: .94rem; }
.mv-testi__photos { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.mv-testi__photos img { width: 76px; height: 76px; border-radius: 10px; object-fit: cover; }
.mv-testi figcaption { display: flex; align-items: center; gap: 10px; }
.mv-testi figcaption img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; }
.mv-testi figcaption span { display: flex; flex-direction: column; line-height: 1.25; }
.mv-testi figcaption b { font-size: .88rem; color: var(--app-text); }
.mv-testi figcaption small { font-size: .75rem; color: var(--app-text-muted); }

.mv-qr-wrap { text-align: center; }
.mv-qr { display: inline-block; background: #fff; padding: 12px; border-radius: 18px; border: 1px solid var(--app-border); box-shadow: 0 10px 26px rgba(15,23,42,.08); line-height: 0; }
.mv-qr canvas, .mv-qr img { max-width: 100%; height: auto; }
.mv-hint { font-size: .8rem; color: var(--app-text-muted); margin: 10px 0 12px; line-height: 1.5; }
.mv-btn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }
.mv-btn-row .btn-v2 { justify-content: center; }
.mv-full { width: 100%; justify-content: center; }
.mv-send { margin-top: 12px; border-top: 1px solid var(--app-border); padding-top: 12px; }
.mv-send summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; font-size: .88rem; font-weight: 700; color: var(--app-text-secondary); }
.mv-send summary::-webkit-details-marker { display: none; }
.mv-send summary > i:first-child { color: var(--app-primary); }
.mv-chev { margin-left: auto; transition: transform .2s; }
.mv-send[open] .mv-chev { transform: rotate(180deg); }
.mv-send__row { display: flex; gap: 8px; }
.mv-send__row .form-control { border-radius: 12px; min-width: 0; }
.mv-private { display: inline-flex; align-items: center; gap: 5px; font-size: .72rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--app-surface-2); color: var(--app-text-muted); }
.mv-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mv-stat { padding: 12px; border-radius: 14px; background: var(--app-surface-2); display: flex; flex-direction: column; gap: 2px; }
.mv-stat b { font-family: var(--font-display); font-size: 1.5rem; font-weight: 800; line-height: 1.1; color: var(--app-text); font-variant-numeric: tabular-nums; }
.mv-stat span { font-size: .74rem; color: var(--app-text-muted); }
.mv-stat--hot { background: linear-gradient(135deg, var(--app-primary), var(--app-primary-dark)); }
.mv-stat--hot b, .mv-stat--hot span { color: #fff; }
.mv-meta { list-style: none; margin: 12px 0 0; padding: 0; }
.mv-meta li { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px dashed var(--app-border); font-size: .84rem; }
.mv-meta span { color: var(--app-text-muted); }
.mv-meta b { color: var(--app-text); font-weight: 700; text-align: right; }
.mv-sharers .accordion-item { border: 1px solid var(--app-border); border-radius: 12px !important; overflow: hidden; margin-bottom: 6px; background: var(--app-surface); }
.mv-sharers .accordion-button { padding: 10px 12px; gap: 10px; background: var(--app-surface); color: var(--app-text); box-shadow: none; }
.mv-sharers .accordion-button em { font-style: normal; font-weight: 800; font-size: 1rem; color: var(--app-primary); margin-left: auto; margin-right: 8px; }
.mv-sharer { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.mv-sharer b { font-size: .88rem; }
.mv-sharer small { font-size: .74rem; color: var(--app-text-muted); }
.mv-sharers .accordion-body { padding: 8px 12px; background: var(--app-surface-2); }
.mv-hist { display: flex; justify-content: space-between; gap: 10px; padding: 5px 0; border-bottom: 1px dashed var(--app-border); font-size: .82rem; }
.mv-hist small { color: var(--app-text-muted); white-space: nowrap; }

@media (max-width: 1080px) {
  .mv-grid { grid-template-columns: 1fr; }
  .mv-side { position: static; }
}
@media (max-width: 640px) {
  .mv-cover { height: 96px; }
  .mv-hero__body { padding: 0 18px; margin-top: -48px; gap: 12px; }
  .mv-avatar { width: 100px; height: 100px; border-width: 4px; }
  .mv-id { padding-top: 0; min-width: 100%; }
  .mv-hero__actions { width: 100%; padding-top: 0; }
  .mv-hero__actions .btn-v2--primary { flex: 1; justify-content: center; }
  .mv-quick { padding: 16px 18px 18px; }
  .mv-pill { font-size: .8rem; padding: 7px 12px; }
  .mv-card { padding: 18px; border-radius: 18px; }
  .mv-logo { width: 64px; height: 64px; border-radius: 14px; }
}
