﻿/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0a0e1a;
  --bg2: #111827;
  --bg3: #1a2235;
  --accent: #6c63ff;
  --accent2: #00d4aa;
  --text: #e2e8f0;
  --text2: #94a3b8;
  --border: #1e2d45;
  --green: #00d4aa;
  --red: #ff4d6d;
  --gold: #f59e0b;
}

[data-theme="light"] {
  --bg: #f0f2f5;
  --bg2: #ffffff;
  --bg3: #e8eaf0;
  --text: #1a1a2e;
  --text2: #5a6478;
  --border: #d1d5e0;
}

[data-theme="light"] body {
  background: var(--bg);
}

[data-theme="light"] .footer {
  background: var(--bg2);
  border-top-color: var(--border);
}

[data-theme="light"] .navbar {
  background: rgba(240,242,245,0.95);
  border-bottom-color: var(--border);
}

@media (min-width: 769px) {
  [data-theme="light"] .navbar {
    background: #ffffff;
    box-shadow: 0 1px 0 var(--border);
  }
}

.theme-toggle-btn {
  position: relative;
  background: rgba(108,99,255,0.12);
  border: 1px solid rgba(108,99,255,0.25);
  color: var(--text2);
  width: 38px; height: 38px;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: background 0.2s, color 0.2s;
  flex-shrink: 0;
}
.theme-toggle-btn:hover { background: rgba(108,99,255,0.22); color: var(--text); }

/* ===== NAVBAR ICÔNES + LABELS ===== */
@media (min-width: 769px) {
  .nav-icon-link {
    flex-direction: column !important;
    gap: 2px !important;
    padding: 0 1rem !important;
    font-size: 0.68rem !important;
    height: 100% !important;
  }
  .nav-icon-link i { font-size: 1.2rem; }
  .nav-icon-link .nav-label { font-size: 0.68rem; line-height: 1; }
}

/* ===== SIDEBAR GAUCHE FIXE ===== */
.left-sidebar {
  position: fixed;
  top: 56px;
  left: 0;
  width: 260px;
  height: calc(100vh - 56px);
  background: var(--bg2);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 400;
  padding: 1rem 0.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  scrollbar-width: none;
}
.left-sidebar::-webkit-scrollbar { display: none; }

/* Décalage du body quand sidebar présente */
/* Right sidebar fixe */
.right-sidebar {
  position: fixed;
  top: 56px;
  right: 0;
  width: 260px;
  height: calc(100vh - 56px);
  background: var(--bg2);
  border-left: 1px solid var(--border);
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 400;
  padding: 1rem 0.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  scrollbar-width: none;
}
.right-sidebar::-webkit-scrollbar { display: none; }
.rsb-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.2rem;
}
.rsb-bottom {
  margin-top: 0;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

@media (min-width: 1101px) {
  body.has-left-sidebar { padding-left: 260px; }
  body.has-left-sidebar .feed-sidebar { display: none !important; }
  body.has-left-sidebar .feed-layout { grid-template-columns: 1fr !important; }
  body.has-right-sidebar { padding-right: 260px; }
}

/* Profil utilisateur */
.lsb-profile { padding: 0.4rem 0.4rem 0.6rem; }
.lsb-profile-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.8rem;
  border-radius: 12px;
  text-decoration: none;
  transition: background 0.15s;
  cursor: pointer;
}
.lsb-profile-user:hover { background: var(--bg3); }
.lsb-avatar {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.9rem;
  flex-shrink: 0;
  overflow: hidden;
}
.lsb-avatar img { width: 100%; height: 100%; object-fit: cover; }
.lsb-profile-info { flex: 1; min-width: 0; }
.lsb-profile-info strong { display: block; font-size: 0.92rem; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lsb-plan-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.1rem 0.5rem;
  border-radius: 50px;
  display: inline-block;
  margin-top: 0.15rem;
}
.lsb-plan-starter { background: rgba(150,150,150,0.15); color: var(--text2); }
.lsb-plan-pro     { background: rgba(108,99,255,0.15);  color: var(--accent); }
.lsb-plan-elite   { background: rgba(245,158,11,0.15);  color: var(--gold); }

.lsb-join-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  color: #fff;
  padding: 0.65rem 1rem;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  transition: opacity 0.2s;
  width: 100%;
  justify-content: center;
}
.lsb-join-btn:hover { opacity: 0.88; }

/* Séparateur */
.lsb-divider {
  height: 1px;
  background: var(--border);
  margin: 0.4rem 0.4rem;
}

/* Navigation items */
.lsb-nav { display: flex; flex-direction: column; gap: 0.15rem; }
.lsb-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.9rem;
  border-radius: 10px;
  color: var(--text2);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
  position: relative;
  cursor: pointer;
}
.lsb-item:hover { background: var(--bg3); color: var(--text); }
.lsb-item.active {
  background: rgba(108,99,255,0.12);
  color: var(--accent);
  font-weight: 700;
}
.lsb-item i { font-size: 1.1rem; width: 22px; text-align: center; flex-shrink: 0; }
.lsb-item.lsb-admin-btn { color: var(--accent2); }
.lsb-item.lsb-admin-btn:hover { background: rgba(0,212,170,0.1); }

/* Badge notifications/messages */
.lsb-badge {
  margin-left: auto;
  background: var(--red);
  color: #fff;
  font-size: 0.62rem;
  font-weight: 700;
  min-width: 18px; height: 18px;
  border-radius: 50px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

/* Section bottom */
.lsb-bottom { display: flex; flex-direction: column; gap: 0.15rem; }

body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: calc(var(--vh, 1vh) * 100);
  overflow-x: hidden;
}
/* Fix: éviter le saut de viewport au premier scroll sur mobile */
@media (max-width: 768px) {
  html {
    height: -webkit-fill-available;
  }
  body {
    min-height: -webkit-fill-available;
  }
}
/* Désactiver animations infinies lourdes sur mobile pour scroll fluide */
@media (max-width: 768px) {
  .coin, .coin-glow, .coin-particles, .coin-particles span {
    animation: none !important;
    transform: none !important;
  }
}

@media (max-width: 768px) {
  html, body {
    overscroll-behavior-y: none;
  }
}



a { text-decoration: none; color: inherit; }
ul { list-style: none; }

/* ===== NAVBAR ===== */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 5%;
  background: rgba(10, 14, 26, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 501;
  will-change: transform;
  transform: translateZ(0);
}

.logo { font-size: 1.5rem; font-weight: 800; color: var(--text); }
.logo span { color: var(--accent); }

.nav-links { display: flex; align-items: center; gap: 2rem; }
.nav-links a { color: var(--text2); font-size: 0.95rem; transition: color 0.2s; }
.nav-links a:hover, .nav-links a.active { color: var(--text); }

/* ===== NAVBAR DESKTOP — style Facebook ===== */
@media (min-width: 769px) {
  .navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    padding: 0 1.5rem;
    height: 56px;
    background: var(--bg2);
    backdrop-filter: none;
    box-shadow: 0 1px 0 var(--border);
    border-bottom: none;
    gap: 0;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: stretch;
    z-index: 501;
  }

  /* Compenser la hauteur fixe de la navbar */
  body { padding-top: 56px; }

  .logo {
    display: flex;
    align-items: center;
    font-size: 1.4rem;
    justify-self: start;
  }

  /* Navigation centrale */
  .nav-links {
    display: flex;
    align-items: stretch;
    gap: 0;
    height: 56px;
    justify-self: center;
  }

  .nav-links li {
    display: flex;
    align-items: stretch;
  }

  .nav-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 1.2rem;
    height: 100%;
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text2);
    border-bottom: 3px solid transparent;
    border-radius: 0;
    transition: color 0.15s, background 0.15s, border-color 0.15s;
    white-space: nowrap;
  }

  .nav-links a:hover {
    background: var(--bg3);
    color: var(--accent);
    border-radius: 8px;
  }

  .nav-links a.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
    font-weight: 700;
    border-radius: 0;
    background: transparent;
  }

  /* Bouton Mon Espace */
  .nav-links a.btn-nav {
    background: var(--accent);
    color: #fff !important;
    border-radius: 8px;
    padding: 0 1rem;
    margin: auto 0.4rem;
    height: 34px;
    border-bottom: none;
    font-weight: 600;
    align-self: center;
  }
  .nav-links a.btn-nav:hover { opacity: 0.88; }
  .nav-links a.btn-nav.active { border-bottom: none; }

  /* Partie droite */
  .nav-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    justify-self: end;
  }
}

.btn-nav {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--accent);
  color: #fff !important;
  padding: 0.4rem 1rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.88rem;
  white-space: nowrap;
  max-width: 160px;
  transition: opacity 0.2s !important;
}
.btn-nav img,
.btn-nav .avatar-circle {
  width: 24px !important;
  height: 24px !important;
  min-width: 24px;
  font-size: 0.65rem !important;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.btn-nav span.nav-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 90px;
}
.btn-nav:hover { opacity: 0.85; }

.hamburger { display: none; cursor: pointer; font-size: 1.4rem; color: var(--text); }
.nav-right { display: flex; align-items: center; gap: 0.6rem; }

/* ===== BUTTONS ===== */
.btn-primary {
  display: inline-block;
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  color: #fff;
  padding: 0.75rem 1.8rem;
  border-radius: 10px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: transform 0.2s, opacity 0.2s;
}
.btn-primary:hover { transform: translateY(-2px); opacity: 0.9; }

.btn-outline {
  display: inline-block;
  border: 2px solid var(--accent);
  color: var(--accent);
  padding: 0.75rem 1.8rem;
  border-radius: 10px;
  font-weight: 600;
  background: transparent;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.btn-outline:hover { background: var(--accent); color: #fff; }

/* ===== COIN BITCOIN ANIMÉ ===== */
.crypto-coin-anim {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.coin-wrapper {
  position: relative;
  width: 140px;
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Halo lumineux derrière le coin */
.coin-glow {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(247,147,26,0.35) 0%, transparent 70%);
  animation: glowPulse 2.5s ease-in-out infinite;
}
@keyframes glowPulse {
  0%, 100% { transform: scale(0.9); opacity: 0.6; }
  50%       { transform: scale(1.2); opacity: 1; }
}

/* Coin 3D qui tourne */
.coin {
  width: 100px;
  height: 100px;
  position: relative;
  transform-style: preserve-3d;
  animation: coinSpin 3s linear infinite;
  z-index: 1;
}
@keyframes coinSpin {
  0%   { transform: rotateY(0deg); }
  100% { transform: rotateY(360deg); }
}

.coin-face {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  backface-visibility: hidden;
}
.coin-front {
  background: radial-gradient(circle at 35% 35%, #ffd166, #f7931a 60%, #c8620a);
  color: #fff;
  box-shadow: inset -4px -4px 12px rgba(0,0,0,0.3), inset 3px 3px 8px rgba(255,255,255,0.25);
  border: 3px solid rgba(255,200,80,0.5);
}
.coin-back {
  background: radial-gradient(circle at 65% 65%, #ffd166, #f7931a 60%, #c8620a);
  color: #fff;
  box-shadow: inset -4px -4px 12px rgba(0,0,0,0.3), inset 3px 3px 8px rgba(255,255,255,0.25);
  border: 3px solid rgba(255,200,80,0.5);
  transform: rotateY(180deg);
}

/* Particules flottantes */
.coin-particles {
  position: absolute;
  inset: 0;
  border-radius: 50%;
}
.coin-particles span {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #f7931a;
  opacity: 0;
  animation: particleFloat 3s ease-in-out infinite;
}
.coin-particles span:nth-child(1) { top: 10%; left: 50%; animation-delay: 0s;    animation-duration: 2.8s; }
.coin-particles span:nth-child(2) { top: 20%; left: 80%; animation-delay: 0.5s;  animation-duration: 3.2s; }
.coin-particles span:nth-child(3) { top: 70%; left: 85%; animation-delay: 1s;    animation-duration: 2.5s; }
.coin-particles span:nth-child(4) { top: 80%; left: 20%; animation-delay: 1.5s;  animation-duration: 3.5s; }
.coin-particles span:nth-child(5) { top: 30%; left: 10%; animation-delay: 0.8s;  animation-duration: 2.9s; }
.coin-particles span:nth-child(6) { top: 55%; left: 50%; animation-delay: 2s;    animation-duration: 3.1s; }
@keyframes particleFloat {
  0%   { transform: translateY(0)   scale(1);   opacity: 0; }
  20%  { opacity: 0.8; }
  80%  { opacity: 0.4; }
  100% { transform: translateY(-40px) scale(0.3); opacity: 0; }
}

@media (max-width: 768px) {
  .crypto-coin-anim { display: none; }
}

/* ===== EN-TÊTE COMPACT ===== */
.site-header {
  background: linear-gradient(135deg, var(--bg2) 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--border);
  padding: 2rem 5%;
  position: relative;
  overflow: hidden;
}
.site-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 80% 50%, rgba(108,99,255,0.12) 0%, transparent 65%);
  pointer-events: none;
}
.site-header-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
  position: relative;
}
.site-header-text { flex: 1; min-width: 0; }
.site-header-text h1 {
  font-size: clamp(1.4rem, 2.8vw, 2.2rem);
  font-weight: 800;
  line-height: 1.25;
  margin: 0.5rem 0 0.6rem;
}
.site-header-text h1 span { color: var(--accent); }
.site-header-text p {
  color: var(--text2);
  font-size: 0.92rem;
  line-height: 1.6;
  margin-bottom: 1.2rem;
  max-width: 520px;
}
.site-header-btns { display: flex; gap: 0.8rem; flex-wrap: wrap; }
.site-header-btns .btn-primary,
.site-header-btns .btn-outline { padding: 0.55rem 1.3rem; font-size: 0.88rem; }

.site-header-stats {
  display: flex;
  gap: 2rem;
  flex-shrink: 0;
}

.badge {
  display: inline-block;
  background: rgba(108, 99, 255, 0.15);
  border: 1px solid rgba(108, 99, 255, 0.4);
  color: var(--accent);
  padding: 0.3rem 0.9rem;
  border-radius: 50px;
  font-size: 0.8rem;
}
.green { color: var(--green); font-weight: 700; }
.red   { color: var(--red);   font-weight: 700; }

/* ===== FEATURES ===== */
.features {
  padding: 5rem 5%;
  text-align: center;
}
.features h2, .plans h2 { font-size: 2rem; font-weight: 800; margin-bottom: 3rem; }
.features h2 span, .plans h2 span { color: var(--accent); }

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
}
.feature-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2rem;
  transition: transform 0.2s, border-color 0.2s;
}
.feature-card:hover { transform: translateY(-4px); border-color: var(--accent); }
.feature-card i { font-size: 2rem; color: var(--accent); margin-bottom: 1rem; }
.feature-card h3 { margin-bottom: 0.5rem; font-size: 1.1rem; }
.feature-card p { color: var(--text2); font-size: 0.9rem; line-height: 1.6; }

/* ===== PLANS ===== */
.plans { padding: 5rem 5%; text-align: center; background: var(--bg2); }
.plans h2 { font-size: 2rem; font-weight: 800; margin-bottom: 0.5rem; }
.plans-subtitle {
  color: var(--text2);
  font-size: 0.9rem;
  margin-bottom: 2.5rem;
  display: block;
}
.plans-subtitle strong { color: var(--text); }

.plans-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
  max-width: 900px;
  margin: 0 auto 2.5rem;
}
.plan-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2rem;
  position: relative;
  transition: transform 0.2s;
}
.plan-card:hover { transform: translateY(-4px); }
.plan-card.featured { border-color: var(--accent); box-shadow: 0 0 30px rgba(108,99,255,0.2); }
.popular {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: #fff;
  padding: 0.2rem 1rem;
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
}
.plan-card h3 { font-size: 1.3rem; margin-bottom: 0.8rem; }
.price {
  font-size: 1.9rem;
  font-weight: 800;
  color: var(--accent2);
  margin-bottom: 0.3rem;
  line-height: 1.1;
}
.price span { font-size: 1rem; color: var(--text2); font-weight: 400; }
.price-currency { font-size: 1.1rem; color: var(--accent2); font-weight: 800; }
.price-note {
  font-size: 0.78rem;
  color: var(--text2);
  margin-bottom: 1.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
}
.price-note i { color: var(--accent); font-size: 0.75rem; }
.plan-card ul { text-align: left; margin-bottom: 1.5rem; }
.plan-card li { padding: 0.4rem 0; font-size: 0.9rem; color: var(--text2); display: flex; align-items: center; gap: 0.5rem; }
.plan-card li i.fa-check { color: var(--green); }
.plan-card li i.fa-times { color: var(--red); }
.plan-card li.disabled { opacity: 0.5; }

/* Info paiement */
.payment-info {
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
  max-width: 800px;
  margin: 0 auto;
  padding: 1.5rem;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 16px;
}
.payment-info-item {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  font-size: 0.85rem;
}
.payment-info-item i {
  font-size: 1.4rem;
  color: var(--accent);
  flex-shrink: 0;
}
.payment-info-item strong { display: block; font-size: 0.88rem; color: var(--text); }
.payment-info-item span { color: var(--text2); font-size: 0.78rem; }

/* ===== PAGE HEADER ===== */
.page-header {
  text-align: center;
  padding: 4rem 5% 2rem;
  background: radial-gradient(ellipse at center, rgba(108,99,255,0.08) 0%, transparent 70%);
}
.page-header h1 { font-size: 2.5rem; font-weight: 800; margin-bottom: 0.5rem; }
.page-header h1 span { color: var(--accent); }
.page-header p { color: var(--text2); }

/* ===== FORMATIONS ===== */
.formations-section { padding: 2rem 5% 5rem; }

.filters { display: flex; gap: 0.8rem; flex-wrap: wrap; margin-bottom: 2rem; }
.filter-btn {
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text2);
  padding: 0.5rem 1.2rem;
  border-radius: 50px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s;
}
.filter-btn.active, .filter-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.courses-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}
.course-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  transition: transform 0.2s, border-color 0.2s;
  cursor: pointer;
}
.course-card:hover { transform: translateY(-4px); border-color: var(--accent); }
.course-thumb {
  position: relative;
  background: linear-gradient(135deg, #1a2235, #0d1b2a);
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.course-thumb i { font-size: 3rem; color: var(--accent); opacity: 0.8; }
.course-thumb .play-overlay {
  position: absolute;
  inset: 0;
  background: rgba(108,99,255,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
}
.course-card:hover .play-overlay { opacity: 1; }
.play-overlay i { font-size: 3rem; color: #fff; }
.course-lock {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0,0,0,0.6);
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
  font-size: 0.75rem;
  color: var(--gold);
}
.course-info { padding: 1.2rem; }
.course-tag {
  display: inline-block;
  background: rgba(108,99,255,0.15);
  color: var(--accent);
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  font-size: 0.75rem;
  margin-bottom: 0.5rem;
}
.course-info h3 { font-size: 1rem; margin-bottom: 0.4rem; }
.course-info p { color: var(--text2); font-size: 0.85rem; line-height: 1.5; }
.course-meta { display: flex; justify-content: space-between; margin-top: 0.8rem; font-size: 0.8rem; color: var(--text2); }

/* MODAL */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  z-index: 1000;
  align-items: flex-start;
  justify-content: center;
  padding: 1rem;
  overflow-y: auto;
}
.modal.open { display: flex; }
.modal-content {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 16px;
  width: 100%;
  max-width: 800px;
  position: relative;
  overflow: hidden;
  margin: auto;
}
.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(0,0,0,0.5);
  border: none;
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1rem;
  z-index: 10;
}
.video-container {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  background: #000;
}
.video-container #ytPlayer,
.video-container #ytPlayer iframe {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  border: none;
}
.video-container iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: none; }
.modal-info { padding: 1.5rem; }
.modal-info h3 { margin-bottom: 0.5rem; }
.modal-info p { color: var(--text2); font-size: 0.9rem; }

/* ===== AFFILIATION ===== */
.affiliation-section { padding: 2rem 5% 5rem; max-width: 1000px; margin: 0 auto; }
body.has-right-sidebar .affiliation-section { margin-right: auto; margin-left: auto; }
body.has-left-sidebar .affiliation-section  { margin-left: auto; margin-right: auto; }

.how-it-works { margin-bottom: 4rem; text-align: center; }
.how-it-works h2, .commission-table-section h2, .affiliate-link-section h2, .aff-stats h2 {
  font-size: 1.6rem; font-weight: 700; margin-bottom: 2rem;
}

.steps { display: flex; align-items: center; justify-content: center; gap: 1rem; flex-wrap: wrap; }
.step {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2rem 1.5rem;
  text-align: center;
  flex: 1;
  min-width: 180px;
  max-width: 220px;
  position: relative;
}
.step-num {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: #fff;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
}
.step i { font-size: 2rem; color: var(--accent2); margin-bottom: 0.8rem; }
.step h3 { margin-bottom: 0.4rem; }
.step p { color: var(--text2); font-size: 0.85rem; }
.step-arrow { color: var(--text2); font-size: 1.2rem; }

.commission-table-section { margin-bottom: 3rem; }
.commission-table { background: var(--bg3); border: 1px solid var(--border); border-radius: 16px; overflow: hidden; }
.comm-header, .comm-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  padding: 1rem 1.5rem;
  gap: 1rem;
}
.comm-header { background: var(--bg2); font-weight: 600; font-size: 0.85rem; color: var(--text2); }
.comm-row { border-top: 1px solid var(--border); font-size: 0.9rem; align-items: center; }
.comm-row.highlight { background: rgba(108,99,255,0.05); }
.comm-row i { margin-right: 0.4rem; color: var(--gold); }

.affiliate-link-section { margin-bottom: 3rem; }
.link-box { display: flex; gap: 0.5rem; margin-bottom: 0.5rem; }
.link-box input {
  flex: 1;
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.75rem 1rem;
  border-radius: 10px;
  font-size: 0.9rem;
}
.link-box button {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 0.75rem 1.2rem;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
  white-space: nowrap;
}
.copy-msg { color: var(--green); font-size: 0.85rem; height: 1.2rem; }

.share-btns { display: flex; gap: 0.8rem; flex-wrap: wrap; margin-top: 1.2rem; }
.share-btn {
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: opacity 0.2s;
}
.share-btn:hover { opacity: 0.85; }
.share-btn.twitter { background: #1da1f2; color: #fff; }
.share-btn.telegram { background: #0088cc; color: #fff; }
.share-btn.whatsapp { background: #25d366; color: #fff; }

.aff-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1rem; }
.aff-stat-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.5rem;
  text-align: center;
}
.aff-stat-card i { font-size: 1.8rem; color: var(--accent); margin-bottom: 0.5rem; }
.aff-stat-card strong { display: block; font-size: 1.5rem; font-weight: 800; color: var(--accent2); }
.aff-stat-card span { font-size: 0.85rem; color: var(--text2); }

/* ===== AUTH ===== */
.auth-section {
  min-height: calc(100vh - 70px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}
.auth-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2.5rem;
  width: 100%;
  max-width: 420px;
}
.auth-card h2 { font-size: 1.5rem; margin-bottom: 1.5rem; }
.form-group { margin-bottom: 1.2rem; }
.form-group label { display: block; font-size: 0.85rem; color: var(--text2); margin-bottom: 0.4rem; }
.form-group input {
  width: 100%;
  background: var(--bg2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.75rem 1rem;
  border-radius: 10px;
  font-size: 0.95rem;
  transition: border-color 0.2s;
}
.form-group input:focus { outline: none; border-color: var(--accent); }
.error-msg { color: var(--red); font-size: 0.85rem; margin-bottom: 0.8rem; min-height: 1.2rem; }
.auth-switch { text-align: center; margin-top: 1.2rem; font-size: 0.9rem; color: var(--text2); }
.auth-switch a { color: var(--accent); }

/* ===== DASHBOARD ===== */
.dashboard-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  justify-content: space-between;
  padding: 2.5rem 5% 1rem;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
}
.dashboard-header h1 { font-size: 1.8rem; font-weight: 800; }
.dashboard-header h1 span { color: var(--accent); }
.dashboard-header p { color: var(--text2); }
.user-plan { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; justify-self: end; }
.plan-badge {
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  color: #fff;
  padding: 0.3rem 1rem;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 600;
}

.dash-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  padding: 1rem 5%;
}
.dash-tabs {
  display: flex;
  gap: 0.3rem;
  padding: 1rem 5% 0;
  border-bottom: 1px solid var(--border);
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
}
.dash-stat {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}
.dash-stat i { font-size: 1.8rem; color: var(--accent); }
.dash-stat strong { display: block; font-size: 1.4rem; font-weight: 800; }
.dash-stat span { font-size: 0.8rem; color: var(--text2); }

.dash-section { padding: 1.5rem 5%; }
#tab-myposts .dash-section { padding: 1.5rem 2%; max-width: 820px; margin-left: auto; margin-right: auto; }
#tab-myposts .user-post-panel,
#tab-myposts #myPostsList .post-card { width: 100%; max-width: 100%; box-sizing: border-box; }

/* Centrer tous les tabs dashboard */
#tab-profile .profile-section { max-width: 900px; margin-left: auto; margin-right: auto; }
#tab-overview .dash-section,
#tab-profile .dash-section,
#tab-wallet .dash-section,
#tab-subscription .dash-section,
#tab-myvideos .dash-section,
#tab-myebooks .dash-section,
#tab-trainer .dash-section {
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}
#tab-admin .dash-section {
  max-width: 100% !important;
  padding: 1.5rem 2rem !important;
  box-sizing: border-box;
}
.dash-section h2 { font-size: 1.3rem; font-weight: 700; margin-bottom: 1.2rem; }

.progress-list { display: flex; flex-direction: column; gap: 0.8rem; }
.progress-item { background: var(--bg3); border: 1px solid var(--border); border-radius: 12px; padding: 1rem 1.2rem; }
.progress-item-header { display: flex; justify-content: space-between; margin-bottom: 0.5rem; font-size: 0.9rem; }
.progress-bar { background: var(--bg2); border-radius: 50px; height: 6px; overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent2)); border-radius: 50px; transition: width 0.5s; }

.quick-links { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; }
.quick-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: transform 0.2s, border-color 0.2s;
}
.quick-card:hover { transform: translateY(-3px); border-color: var(--accent); }
.quick-card i { font-size: 1.8rem; color: var(--accent); margin-bottom: 0.5rem; display: block; }
.quick-card span { font-size: 0.9rem; color: var(--text2); }

.wallet-box {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.5rem;
  max-width: 400px;
}
.wallet-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.8rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
}
.wallet-row:last-of-type { border-bottom: none; }
.wallet-row i { margin-right: 0.5rem; color: var(--gold); }

/* ===== FEED SOCIAL ===== */
.feed-section {
  padding: 2.5rem 5%;
  background: var(--bg);
}
.feed-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 1.5rem;
  max-width: 1100px;
  margin: 0 auto;
  align-items: start;
}
.feed-layout > .feed-main {
  min-width: 0;
  overflow: visible;
}

/* SIDEBAR */
.feed-sidebar { display: flex; flex-direction: column; gap: 1rem; position: sticky; top: 80px; }
.sidebar-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.4rem;
}
.sidebar-logo { font-size: 1.2rem; font-weight: 800; margin-bottom: 0.5rem; }
.sidebar-logo span { color: var(--accent); }
.sidebar-card > p { color: var(--text2); font-size: 0.85rem; line-height: 1.5; margin-bottom: 1rem; }
.sidebar-stats { display: flex; gap: 1rem; flex-wrap: wrap; }
.sidebar-stats div { display: flex; flex-direction: column; }

/* Sidebar identité réseau social malgache */
.sb-identity { overflow: hidden; }

.sb-tagline {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: 0.3rem 0.4rem; margin: 0.6rem 0 0.8rem;
  font-size: 0.9rem; font-weight: 700; line-height: 1.5; color: var(--text);
}
.sb-flag {
  font-size: 1.1rem;
  animation: sbFlagPop 0.6s cubic-bezier(0.34,1.56,0.64,1) both;
  animation-delay: 0.1s;
}
.sb-num1 {
  color: var(--accent); font-size: 1rem; font-weight: 900;
  background: rgba(108,99,255,0.12); border: 1px solid rgba(108,99,255,0.3);
  padding: 0.05rem 0.45rem; border-radius: 6px;
  animation: sbNum1In 0.5s ease both; animation-delay: 0.25s;
}
.sb-malagasy {
  color: var(--accent2); font-weight: 900; font-size: 0.95rem;
  animation: sbMalagasyIn 0.5s ease both; animation-delay: 0.35s;
}
.sb-sub {
  font-size: 0.8rem; color: var(--text2); line-height: 1.55;
  margin-bottom: 1rem;
  animation: sbFadeUp 0.5s ease both; animation-delay: 0.2s;
}
.sb-identity .sidebar-stats {
  animation: sbFadeUp 0.5s ease both; animation-delay: 0.3s;
}
.sb-identity .sidebar-stats strong { color: var(--accent2); }
.sb-identity .sidebar-stats div:last-child strong { color: var(--accent); }

.sb-join-btn {
  width: 100%; text-align: center; display: block;
  margin-top: 1.1rem; padding: 0.7rem 1rem; font-size: 0.92rem;
  animation: sbJoinIn 0.5s cubic-bezier(0.34,1.4,0.64,1) both;
  animation-delay: 0.4s;
}

@keyframes sbFlagPop {
  from { opacity:0; transform: scale(0.5) rotate(-15deg); }
  to   { opacity:1; transform: scale(1) rotate(0deg); }
}
@keyframes sbNum1In {
  from { opacity:0; transform: translateY(-8px); }
  to   { opacity:1; transform: translateY(0); }
}
@keyframes sbMalagasyIn {
  from { opacity:0; letter-spacing: 0.2em; }
  to   { opacity:1; letter-spacing: normal; }
}
@keyframes sbFadeUp {
  from { opacity:0; transform: translateY(10px); }
  to   { opacity:1; transform: translateY(0); }
}
@keyframes sbJoinIn {
  from { opacity:0; transform: scale(0.9); }
  to   { opacity:1; transform: scale(1); }
}
.sidebar-stats strong { font-size: 1.1rem; font-weight: 800; color: var(--accent2); }
.sidebar-stats span { font-size: 0.75rem; color: var(--text2); }
.sidebar-user-info { display: flex; align-items: center; gap: 0.8rem; }
.sidebar-user-info strong { display: block; font-size: 0.95rem; }

/* AVATAR */
.avatar-circle {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.9rem;
  flex-shrink: 0;
}
.avatar-sm { width: 32px; height: 32px; font-size: 0.75rem; }
.avatar-lg { width: 80px; height: 80px; font-size: 1.6rem; }

/* POST CARD */
.post-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 16px;
  margin-bottom: 1.4rem;
  overflow: visible;
  transition: border-color 0.25s, box-shadow 0.25s, transform 0.2s;
}
.post-card:hover {
  border-color: rgba(108,99,255,0.45);
  box-shadow: 0 6px 28px rgba(108,99,255,0.1);
  transform: translateY(-1px);
}
.post-card {
  transition: border-color 0.25s, box-shadow 0.25s, transform 0.2s;
}

/* En-tête du post */
.post-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.2rem 0.7rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.post-author { display: flex; align-items: center; gap: 0.8rem; }
.post-author strong {
  display: block;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.3;
}
.post-time {
  font-size: 0.75rem;
  color: var(--text2);
  margin-top: 0.1rem;
  display: block;
}
.post-header-right { display: flex; align-items: center; gap: 0.5rem; }
.verified-badge { color: var(--accent); font-size: 0.8rem; margin-left: 0.2rem; }

/* Corps du post */
.post-body {
  padding: 0 1.2rem 1rem;
  overflow: visible;
}
.post-title {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.45;
  margin-bottom: 0.7rem;
  color: var(--text);
}

/* Contenu texte : paragraphes et interlignes */
.post-content {
  color: var(--text2);
  font-size: 0.92rem;
  line-height: 1.75;
}
.post-content p {
  margin: 0 0 0.75rem;
}
.post-content p:last-child {
  margin-bottom: 0;
}
.post-content br + br {
  display: block;
  content: '';
  margin-top: 0.4rem;
}

/* Ligne de séparation entre titre et contenu si image présente */
.post-body .post-image-wrap:first-child {
  margin-top: 0;
}

/* Compteurs réactions */
.post-stats {
  display: flex;
  gap: 1.2rem;
  padding: 0.5rem 1.2rem 0.6rem;
  font-size: 0.8rem;
  color: var(--text2);
  border-top: 1px solid var(--border);
}
.post-stats span { display: flex; align-items: center; gap: 0.3rem; transition: transform 0.15s; }
.post-stats span:hover { transform: scale(1.05); }

/* Boutons actions */
.post-actions {
  display: flex;
  gap: 0.3rem;
  padding: 0.4rem 0.8rem;
  border-top: 1px solid var(--border);
  background: rgba(0,0,0,0.06);
  transition: background 0.2s;
  overflow: visible;
  position: relative;
  z-index: 10;
}
.post-card:hover .post-actions {
  background: rgba(108,99,255,0.04);
}
.reaction-btn, .comment-toggle-btn {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  background: transparent;
  border: none;
  color: var(--text2);
  cursor: pointer;
  padding: 0.5rem 1rem;
  border-radius: 10px;
  font-size: 0.88rem;
  font-family: inherit;
  transition: background 0.2s, color 0.2s, transform 0.15s, box-shadow 0.2s;
  flex: 1;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.reaction-btn::after, .comment-toggle-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle, rgba(255,255,255,0.18) 0%, transparent 70%);
  opacity: 0;
  transform: scale(0);
  transition: transform 0.4s ease, opacity 0.4s ease;
  border-radius: inherit;
  pointer-events: none;
}
.reaction-btn:active::after, .comment-toggle-btn:active::after {
  transform: scale(2.5);
  opacity: 1;
  transition: 0s;
}
.reaction-btn:hover {
  background: rgba(255,77,109,0.12);
  color: var(--red);
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(255,77,109,0.15);
}
.reaction-btn:active { transform: scale(0.95) translateY(0); box-shadow: none; }
.comment-toggle-btn:hover {
  background: rgba(108,99,255,0.12);
  color: var(--accent);
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(108,99,255,0.15);
}
.comment-toggle-btn:active { transform: scale(0.95) translateY(0); box-shadow: none; }
.reaction-btn.liked {
  color: var(--red);
  font-weight: 600;
  background: rgba(255,77,109,0.08);
}
.reaction-btn.liked i { animation: heartPop 0.4s cubic-bezier(0.36,0.07,0.19,0.97) both; }
.reaction-btn.liked:hover { background: rgba(255,77,109,0.18); }
.guest-action { color: var(--text2); text-decoration: none; }
.guest-action:hover { background: rgba(255,77,109,0.08); color: var(--red); transform: translateY(-1px); }
.reaction-label { font-size: 0.84rem; transition: transform 0.15s; }
.reaction-btn:hover .reaction-label, .comment-toggle-btn:hover .reaction-label { transform: scale(1.04); }
.comment-toggle-btn:hover i { animation: commentBounce 0.35s ease; }

@keyframes heartPop {
  0%   { transform: scale(1); }
  25%  { transform: scale(1.4) rotate(-8deg); }
  50%  { transform: scale(1.6) rotate(4deg); }
  75%  { transform: scale(0.9); }
  100% { transform: scale(1); }
}
@keyframes commentBounce {
  0%   { transform: scale(1) rotate(0deg); }
  40%  { transform: scale(1.25) rotate(-10deg); }
  70%  { transform: scale(0.95) rotate(5deg); }
  100% { transform: scale(1) rotate(0deg); }
}

/* Post mis en évidence depuis une notification */
@keyframes postHighlight {
  0%   { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(108,99,255,0.3); }
  50%  { border-color: var(--accent2); box-shadow: 0 0 0 6px rgba(0,212,170,0.2); }
  100% { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(108,99,255,0.3); }
}
.post-highlight {
  animation: postHighlight 1s ease 2;
  border-color: var(--accent) !important;
}

/* Animation d'entrée des posts */
@keyframes postFadeIn {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.post-animate {
  animation: postFadeIn 0.35s ease both;
}

/* Feed vide */
.feed-empty {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text2);
}
.feed-empty i { font-size: 2.5rem; margin-bottom: 0.8rem; display: block; opacity: 0.4; }

/* Scroll infini */
.feed-sentinel { height: 1px; }

.feed-loader {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  padding: 1.5rem 0;
}
.feed-loader span {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  animation: feedDot 1.2s ease-in-out infinite;
  opacity: 0.4;
}
.feed-loader span:nth-child(2) { animation-delay: 0.2s; }
.feed-loader span:nth-child(3) { animation-delay: 0.4s; }
@keyframes feedDot {
  0%, 80%, 100% { transform: scale(0.7); opacity: 0.4; }
  40%            { transform: scale(1.2); opacity: 1; }
}

.feed-end {
  text-align: center;
  padding: 1.5rem;
  font-size: 0.82rem;
  color: var(--text2);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  opacity: 0.6;
}
.feed-end i { color: var(--accent2); }

/* Skeleton */
.skeleton-card { pointer-events: none; }
.skeleton-header { display: flex; align-items: center; gap: 0.8rem; padding: 1rem 1.2rem 0.5rem; }
.skeleton-avatar {
  width: 42px; height: 42px; border-radius: 50%;
  background: linear-gradient(90deg, var(--bg2) 25%, var(--border) 50%, var(--bg2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  flex-shrink: 0;
}
.skeleton-lines { flex: 1; display: flex; flex-direction: column; gap: 0.4rem; }
.skeleton-line {
  height: 10px;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--bg2) 25%, var(--border) 50%, var(--bg2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
}
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* COMMENTAIRES */
.comments-section {
  border-top: 1px solid var(--border);
  padding: 1rem 1.2rem;
  background: rgba(0,0,0,0.15);
}
.comments-list { display: flex; flex-direction: column; gap: 0.8rem; margin-bottom: 0.8rem; }
.comment { display: flex; gap: 0.7rem; align-items: flex-start; }
.comment-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.comment-bubble {
  background: var(--bg2);
  border-radius: 12px;
  padding: 0.6rem 0.9rem;
}
.comment-bubble strong { font-size: 0.85rem; display: block; margin-bottom: 0.2rem; cursor: pointer; transition: color 0.15s; }
.comment-bubble strong:hover { color: var(--accent); }
.comment-bubble p { font-size: 0.88rem; color: var(--text2); margin: 0; }
.comment-footer { display: flex; align-items: center; gap: 0.8rem; margin-top: 0.35rem; }
.comment-time { font-size: 0.72rem; color: var(--text2); opacity: 0.7; }

/* Bouton Répondre */
.reply-btn {
  background: transparent;
  border: none;
  color: var(--text2);
  font-size: 0.72rem;
  font-family: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.15rem 0.5rem;
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
}
.reply-btn:hover { background: rgba(108,99,255,0.1); color: var(--accent); }

/* Mention @user */
.mention {
  color: var(--accent);
  font-weight: 700;
  font-size: 0.85rem;
}

/* Réponses (sous-commentaires) */
.replies-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding-left: 0.8rem;
  border-left: 2px solid var(--border);
  margin-left: 0.2rem;
}
.reply {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
}
.reply-bubble {
  background: rgba(108,99,255,0.06) !important;
  border: 1px solid rgba(108,99,255,0.12);
}

/* Avatar extra-small pour les réponses */
.avatar-xs { width: 26px !important; height: 26px !important; font-size: 0.62rem !important; flex-shrink: 0; }
.avatar-photo.avatar-xs { width: 26px; height: 26px; }

/* Zone de saisie de réponse */
.reply-input-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  padding: 0.4rem 0.6rem;
  background: rgba(108,99,255,0.05);
  border: 1px solid rgba(108,99,255,0.15);
  border-radius: 10px;
  animation: slideDown 0.2s ease;
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.comment-input-row { display: flex; gap: 0.6rem; align-items: center; }
.comment-input-wrap { flex: 1; display: flex; gap: 0.4rem; }
.comment-input-wrap input,
.reply-input-row .comment-input-wrap input {
  flex: 1;
  background: var(--bg2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.55rem 0.9rem;
  border-radius: 50px;
  font-size: 0.88rem;
  font-family: inherit;
}
.comment-input-wrap input:focus { outline: none; border-color: var(--accent); }
.comment-input-wrap button {
  background: var(--accent);
  border: none;
  color: #fff;
  width: 34px; height: 34px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 0.8rem;
  flex-shrink: 0;
}
.login-to-comment { font-size: 0.85rem; color: var(--text2); }
.login-to-comment a { color: var(--accent); }

/* ===== AVATAR PHOTO ===== */
.avatar-photo {
  width: 42px; height: 42px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  flex-shrink: 0;
}
.avatar-photo.avatar-sm { width: 32px; height: 32px; }
.avatar-photo.avatar-xs { width: 26px; height: 26px; }
.avatar-photo.avatar-lg { width: 80px; height: 80px; }

/* Conteneur avatar dans le profil */
.avatar-photo-container {
  position: relative;
  width: 80px;
  height: 80px;
  flex-shrink: 0;
  overflow: visible;
}
.avatar-photo-container .avatar-circle.avatar-lg,
.avatar-photo-container .avatar-photo.avatar-lg {
  width: 80px;
  height: 80px;
  border: 3px solid var(--bg3);
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
}
.avatar-upload-overlay {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(0,0,0,0.6);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  opacity: 0;
  cursor: pointer;
  transition: opacity 0.2s;
  z-index: 1;
}
.avatar-photo-container:hover .avatar-upload-overlay { opacity: 1; }
@media (hover: none) { .avatar-upload-overlay { opacity: 1; } }
.avatar-upload-overlay i   { font-size: 1rem; color: #fff; }
.avatar-upload-overlay span { font-size: 0.58rem; color: #fff; font-weight: 600; }

.avatar-remove-btn {
  position: absolute;
  top: -3px; right: -3px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--red);
  border: 2px solid var(--bg3);
  color: #fff;
  font-size: 0.55rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  z-index: 2;
}
.avatar-remove-btn:hover { transform: scale(1.15); }

/* ===== MODAL RECADRAGE ===== */

.crop-actions button { flex: 1; }

/* ===== PROFIL ===== */
.profile-section { padding: 1.5rem 5%; }
.profile-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 20px;
  overflow: hidden;
  max-width: 700px;
}
.profile-cover {
  height: 120px;
  background: linear-gradient(135deg, var(--accent), #8b5cf6, var(--accent2));
}
.profile-body {
  display: flex;
  align-items: flex-start;
  gap: 1.2rem;
  padding: 0 1.5rem 1.2rem;
  flex-wrap: wrap;
}
.profile-avatar-wrap {
  position: relative;
  margin-top: -40px;
  flex-shrink: 0;
}
.profile-info { flex: 1; padding-top: 0.5rem; }
.profile-name-row { display: flex; align-items: center; gap: 0.8rem; flex-wrap: wrap; margin-bottom: 0.4rem; }
.profile-name-row h2 { font-size: 1.3rem; font-weight: 800; }
.profile-bio-display { color: var(--text2); font-size: 0.9rem; line-height: 1.5; }

.edit-profile-form {
  padding: 1.2rem 1.5rem;
  border-top: 1px solid var(--border);
}
.edit-profile-form textarea {
  width: 100%;
  background: var(--bg2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.75rem 1rem;
  border-radius: 10px;
  font-size: 0.95rem;
  font-family: inherit;
  resize: vertical;
}
.edit-profile-form textarea:focus { outline: none; border-color: var(--accent); }

.profile-stats {
  display: flex;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.profile-stat {
  flex: 1;
  text-align: center;
  padding: 1rem;
  border-right: 1px solid var(--border);
}
.profile-stat:last-child { border-right: none; }
.profile-stat strong { display: block; font-size: 1.3rem; font-weight: 800; color: var(--accent2); }
.profile-stat span { font-size: 0.8rem; color: var(--text2); }

.profile-details {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 1rem 1.5rem;
  font-size: 0.85rem;
  color: var(--text2);
}
.profile-details i { color: var(--accent); margin-right: 0.3rem; }
.profile-details a { color: var(--accent); }

/* TABS DASHBOARD */
.dash-tabs {
  display: flex;
  gap: 0.3rem;
  padding: 1rem 5% 0;
  border-bottom: 1px solid var(--border);
}
.dash-tab {
  background: transparent;
  border: none;
  color: var(--text2);
  padding: 0.6rem 1.2rem;
  border-radius: 8px 8px 0 0;
  cursor: pointer;
  font-size: 0.9rem;
  font-family: inherit;
  transition: color 0.2s, background 0.2s;
  display: flex; align-items: center; gap: 0.4rem;
}
.dash-tab:hover { color: var(--text); background: rgba(108,99,255,0.08); }
.dash-tab.active { color: var(--accent); border-bottom: 2px solid var(--accent); font-weight: 600; }
.admin-tab { color: var(--gold) !important; }
.admin-tab.active { color: var(--gold) !important; border-bottom-color: var(--gold) !important; }

/* ===== PANNEAU ADMIN ===== */
.admin-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 0.8rem;
}
.admin-section-header h2 {
  font-size: 1.3rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.admin-section-header h2 i { color: var(--gold); }

.admin-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}
.admin-kpi {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.2rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: transform 0.2s, border-color 0.2s;
}
.admin-kpi:hover { transform: translateY(-2px); border-color: rgba(108,99,255,0.3); }
.admin-kpi-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.admin-kpi-icon i { font-size: 1.2rem; }
.admin-kpi strong { display: block; font-size: 1.5rem; font-weight: 800; line-height: 1; }
.admin-kpi span { font-size: 0.78rem; color: var(--text2); margin-top: 0.2rem; display: block; }

.admin-plans-bar-section {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.2rem 1.4rem;
  margin-bottom: 2rem;
}
.admin-plans-bar-section h3 { font-size: 0.95rem; font-weight: 700; margin-bottom: 1rem; }
.admin-plans-bar {
  display: flex;
  height: 10px;
  border-radius: 50px;
  overflow: hidden;
  background: var(--bg2);
  margin-bottom: 0.8rem;
}
.admin-bar-segment { height: 100%; transition: width 0.6s ease; min-width: 2px; }
.admin-plans-legend { display: flex; gap: 1.5rem; flex-wrap: wrap; }
.admin-legend-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  color: var(--text2);
}
.admin-legend-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.admin-legend-item strong { color: var(--text); font-weight: 700; }

.admin-recent-section h3 { font-size: 0.95rem; font-weight: 700; margin-bottom: 1rem; }
.admin-users-table {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}
.admin-users-header, .admin-user-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  padding: 0.8rem 1.2rem;
  gap: 1rem;
  align-items: center;
  font-size: 0.85rem;
}
.admin-users-header {
  background: var(--bg2);
  font-weight: 600;
  font-size: 0.78rem;
  color: var(--text2);
}
.admin-user-row { border-top: 1px solid var(--border); }
.admin-user-row:hover { background: rgba(108,99,255,0.04); }
.admin-user-name {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}
.admin-user-name span { display: flex; flex-direction: column; }
.admin-user-name small { font-size: 0.72rem; color: var(--text2); }
.admin-plan-badge {
  display: inline-block;
  color: #fff;
  padding: 0.15rem 0.6rem;
  border-radius: 50px;
  font-size: 0.72rem;
  font-weight: 700;
  opacity: 0.9;
}

@media (max-width: 768px) {
  .admin-kpi-grid { grid-template-columns: repeat(2, 1fr); gap: 0.7rem; }
  .admin-kpi { padding: 0.9rem; }
  .admin-kpi strong { font-size: 1.1rem; }
  .admin-users-header, .admin-user-row { grid-template-columns: 1.5fr 1fr 1fr; }
  .admin-users-header span:nth-child(3), .admin-user-row span:nth-child(3) { display: none; }
  .admin-subnav { overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; scrollbar-width: none; padding-bottom: 2px; }
  .admin-subnav::-webkit-scrollbar { display: none; }
  .admin-subnav-btn { white-space: nowrap; font-size: 0.8rem; padding: 0.5rem 0.8rem; }
  .admin-users-toolbar { flex-direction: column; align-items: stretch; }
  .admin-users-search { max-width: 100%; }
  .admin-users-filters { flex-wrap: wrap; }
}

/* ===== ACTUALITÉS (ancien style conservé pour admin panel) ===== */
.admin-panel {
  background: var(--bg3);
  border: 1px solid var(--accent);
  border-radius: 16px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}
.admin-panel-header {
  display: flex; align-items: center; gap: 0.6rem;
  margin-bottom: 1.2rem; color: var(--accent);
}
.admin-panel-header i { font-size: 1.1rem; }
.admin-panel-header h3 { font-size: 1rem; font-weight: 700; }
.admin-form-row { display: flex; gap: 0.8rem; margin-bottom: 0.8rem; flex-wrap: wrap; }
.admin-form-row input, .admin-panel textarea, .admin-form-row select {
  background: var(--bg2); border: 1px solid var(--border); color: var(--text);
  padding: 0.7rem 1rem; border-radius: 10px; font-size: 0.9rem; font-family: inherit;
}
.admin-form-row input { flex: 1; min-width: 0; }
.admin-form-row select { min-width: 0; }
.admin-panel textarea { width: 100%; resize: vertical; margin-bottom: 0.8rem; }
.admin-form-row input:focus, .admin-panel textarea:focus, .admin-form-row select:focus { outline: none; border-color: var(--accent); }

/* Upload photo post */
.admin-media-row {
  display: flex;
  align-items: flex-start;
  gap: 0.8rem;
  margin-bottom: 0.8rem;
  flex-wrap: wrap;
}
.admin-media-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--bg2);
  border: 1px dashed var(--border);
  color: var(--text2);
  padding: 0.55rem 1rem;
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: border-color 0.2s, color 0.2s;
  white-space: nowrap;
}
.admin-media-btn:hover { border-color: var(--accent); color: var(--accent); }
.post-image-preview {
  position: relative;
  display: flex;
  align-items: center;
}
.post-image-preview img {
  height: 72px;
  width: auto;
  max-width: 200px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--border);
}
.post-image-remove {
  position: absolute;
  top: -6px; right: -6px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--red);
  border: 2px solid var(--bg3);
  color: #fff;
  font-size: 0.55rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}

/* Lien post */
.admin-link-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.8rem;
  flex-wrap: wrap;
}
.admin-link-row i { color: var(--accent); font-size: 0.9rem; flex-shrink: 0; }
.admin-link-row input {
  background: var(--bg2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.6rem 0.9rem;
  border-radius: 10px;
  font-size: 0.85rem;
  font-family: inherit;
  flex: 1;
  min-width: 160px;
}
.admin-link-row input:focus { outline: none; border-color: var(--accent); }

/* Image dans le post card */
.post-image-wrap {
  margin: 0.6rem 0 0.8rem;
  border-radius: 12px;
  overflow: hidden;
  cursor: zoom-in;
}
.post-image {
  width: 100%;
  max-height: 360px;
  object-fit: cover;
  display: block;
  transition: transform 0.2s;
}
.post-image:hover { transform: scale(1.01); }

/* Bouton lien cliquable dans le post */
.post-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.6rem;
  background: rgba(108,99,255,0.12);
  border: 1px solid rgba(108,99,255,0.3);
  color: var(--accent);
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  transition: background 0.2s, border-color 0.2s;
  word-break: break-all;
}
.post-link-btn:hover { background: rgba(108,99,255,0.22); border-color: var(--accent); }
.post-link-btn i { font-size: 0.75rem; flex-shrink: 0; }

.news-tag {
  display: inline-block; background: rgba(108,99,255,0.15); color: var(--accent);
  padding: 0.2rem 0.7rem; border-radius: 50px; font-size: 0.75rem; font-weight: 600;
}
.news-delete {
  background: rgba(255,77,109,0.15); border: none; color: var(--red);
  width: 28px; height: 28px; border-radius: 6px; cursor: pointer; font-size: 0.75rem;
}
.news-delete:hover { background: rgba(255,77,109,0.3); }

/* ===== AFFILIATION AR ===== */
.commission-triggers { margin-bottom: 3rem; }
.commission-triggers h2, .commission-history-section h2, .withdraw-section h2 {
  font-size: 1.6rem; font-weight: 700; margin-bottom: 1.5rem;
}

.triggers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.2rem;
}
.trigger-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.5rem;
  transition: border-color 0.2s, transform 0.2s;
}
.trigger-card:hover { border-color: var(--accent); transform: translateY(-3px); }
.trigger-icon {
  width: 48px; height: 48px;
  background: rgba(108,99,255,0.15);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 1rem;
}
.trigger-icon i { font-size: 1.4rem; color: var(--accent); }
.trigger-card h3 { font-size: 1rem; font-weight: 700; margin-bottom: 0.4rem; }
.trigger-card > p { color: var(--text2); font-size: 0.85rem; margin-bottom: 1rem; }
.trigger-rates { display: flex; flex-direction: column; gap: 0.3rem; }
.rate-row {
  display: flex; justify-content: space-between;
  font-size: 0.82rem; color: var(--text2);
  padding: 0.25rem 0;
  border-bottom: 1px solid var(--border);
}
.rate-row:last-child { border-bottom: none; }

/* Tableau commissions 5 colonnes */
.comm-header, .comm-row { grid-template-columns: 1.2fr 1.4fr 1.4fr 1.2fr 0.8fr; }
.comm-note {
  margin-top: 0.8rem;
  font-size: 0.82rem;
  color: var(--text2);
  padding: 0.6rem 1rem;
  background: rgba(108,99,255,0.06);
  border-radius: 8px;
  border-left: 3px solid var(--accent);
}
.comm-note i { color: var(--accent); margin-right: 0.4rem; }

/* Historique */
.commission-history-section { margin-bottom: 3rem; }
.history-table {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
}
.history-header, .history-row {
  display: grid;
  grid-template-columns: 1fr 1.2fr 1.5fr 1.2fr 1fr;
  padding: 0.9rem 1.2rem;
  gap: 0.8rem;
  align-items: center;
  font-size: 0.88rem;
}
.history-header {
  background: var(--bg2);
  font-weight: 600;
  color: var(--text2);
  font-size: 0.82rem;
}
.history-row { border-top: 1px solid var(--border); }
.history-row:hover { background: rgba(108,99,255,0.04); }
.history-type {
  background: rgba(108,99,255,0.12);
  color: var(--accent);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-size: 0.78rem;
  white-space: nowrap;
}
.status-badge {
  padding: 0.2rem 0.6rem;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 600;
}
.status-paid    { background: rgba(0,212,170,0.15); color: var(--green); }
.status-pending { background: rgba(245,158,11,0.15); color: var(--gold); }
.history-empty {
  text-align: center;
  padding: 2.5rem;
  color: var(--text2);
}
.history-empty i { font-size: 2rem; margin-bottom: 0.5rem; display: block; }

/* Retrait */
.withdraw-section { margin-bottom: 3rem; }
.withdraw-box {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.5rem;
  max-width: 500px;
}
.withdraw-balance {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.8rem 1rem;
  background: rgba(0,212,170,0.08);
  border: 1px solid rgba(0,212,170,0.2);
  border-radius: 10px;
  margin-bottom: 1.2rem;
}
.withdraw-balance span { font-size: 0.85rem; color: var(--text2); }
.withdraw-balance strong { font-size: 1.2rem; font-weight: 800; color: var(--accent2); }
.withdraw-form select {
  width: 100%;
  background: var(--bg2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.75rem 1rem;
  border-radius: 10px;
  font-size: 0.95rem;
  font-family: inherit;
}
.withdraw-form select:focus { outline: none; border-color: var(--accent); }

@media (max-width: 768px) {
  .history-header, .history-row { grid-template-columns: 1fr 1fr 1fr; font-size: 0.78rem; }
  .history-header span:nth-child(2), .history-row span:nth-child(2),
  .history-header span:nth-child(4), .history-row span:nth-child(4) { display: none; }
  .comm-header, .comm-row { grid-template-columns: 1fr 1fr 1fr; }
  .comm-header span:nth-child(3), .comm-row span:nth-child(3),
  .comm-header span:nth-child(5), .comm-row span:nth-child(5) { display: none; }
}

/* ===== PLANS COMPACTS (bande entre header et feed) ===== */
.plans-compact {
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  padding: 1.8rem 5%;
}
.plans-compact-inner {
  max-width: 1100px;
  margin: 0 auto;
}
.plans-compact-title {
  text-align: center;
  margin-bottom: 1.2rem;
}
.plans-compact-title h2 {
  font-size: 1.3rem;
  font-weight: 800;
  margin-bottom: 0.2rem;
}
.plans-compact-title h2 span { color: var(--accent); }
.plans-compact-title p { font-size: 0.82rem; color: var(--text2); }

.plans-compact-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.plan-compact-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.2rem;
  position: relative;
  transition: transform 0.2s, border-color 0.2s;
}
.plan-compact-card:hover { transform: translateY(-3px); border-color: rgba(108,99,255,0.4); }
.plan-compact-card.featured { border-color: var(--accent); box-shadow: 0 0 20px rgba(108,99,255,0.15); }

.plan-compact-badge {
  position: absolute;
  top: -10px; left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.8rem;
  border-radius: 50px;
  white-space: nowrap;
}
.plan-compact-name {
  font-size: 1rem;
  font-weight: 800;
  margin-bottom: 0.3rem;
}
.plan-compact-price {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--accent2);
  margin-bottom: 0.8rem;
  line-height: 1.2;
}
.plan-compact-price span { font-size: 0.85rem; font-weight: 800; }
.plan-compact-price small { font-size: 0.75rem; color: var(--text2); font-weight: 400; }

.plan-compact-list {
  list-style: none;
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.plan-compact-list li {
  font-size: 0.78rem;
  color: var(--text2);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.plan-compact-list li i { color: var(--green); font-size: 0.7rem; flex-shrink: 0; }

.plan-compact-btn {
  display: block;
  text-align: center;
  padding: 0.5rem;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  transition: opacity 0.2s, transform 0.15s;
}
.plan-compact-btn:hover { opacity: 0.85; transform: translateY(-1px); }
.plan-compact-btn.primary {
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  color: #fff;
}
.plan-compact-btn.outline {
  border: 1.5px solid var(--accent);
  color: var(--accent);
}
.plan-compact-btn.outline:hover { background: var(--accent); color: #fff; }

/* Sidebar Pourquoi nous choisir */
.sidebar-why { padding: 1.2rem; }
.sidebar-why-title {
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text);
}
.sidebar-why-title i { color: var(--gold); }
.sidebar-why-list { display: flex; flex-direction: column; gap: 0.8rem; }
.sidebar-why-item {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
}
.sidebar-why-item i {
  font-size: 1rem;
  color: var(--accent);
  margin-top: 0.1rem;
  flex-shrink: 0;
  width: 18px;
  text-align: center;
}
.sidebar-why-item strong { display: block; font-size: 0.82rem; font-weight: 700; }
.sidebar-why-item span   { font-size: 0.75rem; color: var(--text2); }

@media (max-width: 768px) {
  .plans-compact-grid { grid-template-columns: 1fr; gap: 0.8rem; }
  .plans-compact { padding: 1.2rem 5%; }
}

/* CTA discret sidebar */
.sidebar-cta {
  background: linear-gradient(135deg, rgba(108,99,255,0.12), rgba(0,212,170,0.08));
  border-color: rgba(108,99,255,0.25) !important;
  text-align: center;
}
.sidebar-cta p {
  font-size: 0.82rem;
  color: var(--text2);
  line-height: 1.5;
  margin-bottom: 0.8rem;
}
.sidebar-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  color: #fff;
  padding: 0.5rem 1.1rem;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  transition: opacity 0.2s, transform 0.15s;
}
.sidebar-cta-btn:hover { opacity: 0.88; transform: translateY(-1px); }

/* Sidebar plans tarifaires */
.sb-plans { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 0.6rem; }
.sb-plan {
  display: flex; flex-direction: column; gap: 0.2rem;
  padding: 0.7rem 0.9rem; border-radius: 12px;
  border: 1px solid var(--border); background: var(--bg2);
  text-decoration: none; transition: border-color 0.2s, background 0.2s;
}
.sb-plan:hover { border-color: var(--accent); background: rgba(108,99,255,0.06); }
.sb-plan-featured { border-color: rgba(108,99,255,0.4); background: rgba(108,99,255,0.07); }
.sb-plan-name { font-size: 0.88rem; font-weight: 700; color: var(--text); }
.sb-plan-desc { font-size: 0.75rem; color: var(--text2); line-height: 1.4; }
.sb-plan-badge { font-size: 0.72rem; font-weight: 700; padding: 0.15rem 0.5rem; border-radius: 50px; width: fit-content; margin-top: 0.2rem; }
.sb-starter { background: rgba(150,150,150,0.15); color: var(--text2); }
.sb-pro     { background: rgba(108,99,255,0.15);  color: var(--accent); }
.sb-elite   { background: rgba(245,158,11,0.15);  color: var(--gold); }

/* Sidebar membres actifs */
.sb-active-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.6rem;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
}
.sb-active-list::-webkit-scrollbar { width: 4px; }
.sb-active-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 6px; }
.sb-active-member {
  display: flex; align-items: center; gap: 0.7rem;
  text-decoration: none; padding: 0.35rem 0.4rem; border-radius: 10px;
  transition: background 0.15s;
}
.sb-active-member:hover { background: var(--bg2); }
.sb-active-av {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.72rem; font-weight: 700; color: #fff; position: relative;
}
.sb-active-av img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.sb-active-av span:not(.sb-active-dot) { font-size: 0.72rem; font-weight: 700; }
.sb-active-dot {
  position: absolute; bottom: 0; right: 0;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--border); border: 2px solid var(--bg3);
}
.sb-active-dot.online { background: var(--accent2); }
.sb-active-info { display: flex; flex-direction: column; min-width: 0; }
.sb-active-info strong { font-size: 0.82rem; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-active-info span   { font-size: 0.7rem; color: var(--text2); }

/* FAQ Plans */
.plans-faq {
  padding: 3.5rem 5%;
  background: var(--bg2);
  text-align: center;
}
.plans-faq h2 { font-size: 1.6rem; font-weight: 800; margin-bottom: 2rem; }
.faq-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.2rem;
  max-width: 900px;
  margin: 0 auto;
  text-align: left;
}
.faq-item {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.3rem;
  transition: border-color 0.2s;
}
.faq-item:hover { border-color: rgba(108,99,255,0.35); }
.faq-item h3 {
  font-size: 0.92rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.faq-item h3 i { color: var(--accent); font-size: 0.85rem; }
.faq-item p { font-size: 0.83rem; color: var(--text2); line-height: 1.6; }

/* ===== PROFIL PUBLIC ===== */
.public-profile-page {
  max-width: 680px;
  margin: 2.5rem auto;
  padding: 0 1rem;
}
.profile-loading { padding: 3rem 1rem; text-align: center; }
.profile-not-found {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 4rem 1rem; text-align: center; color: var(--text2);
}
.profile-not-found i { font-size: 3rem; margin-bottom: 1rem; opacity: 0.4; }
.profile-not-found h2 { font-size: 1.3rem; color: var(--text); margin-bottom: 0.5rem; }
.profile-not-found p  { font-size: 0.9rem; }
.public-profile-card {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 20px; overflow: hidden;
}
.public-profile-header {
  display: flex; align-items: flex-start; gap: 1.2rem;
  padding: 0 1.5rem 1.5rem; flex-wrap: wrap;
}
.public-avatar-wrap { margin-top: -45px; flex-shrink: 0; }
.public-profile-info { flex: 1; padding-top: 0.6rem; min-width: 0; }
.public-name-row {
  display: flex; align-items: center; gap: 0.6rem;
  flex-wrap: wrap; margin-bottom: 0.4rem;
}
.public-name-row h1 { font-size: 1.4rem; font-weight: 800; margin: 0; }
.public-bio { color: var(--text2); font-size: 0.9rem; line-height: 1.6; margin-bottom: 0.8rem; }
.public-meta { display: flex; flex-wrap: wrap; gap: 0.8rem; font-size: 0.82rem; color: var(--text2); }
.public-meta i { color: var(--accent); margin-right: 0.3rem; }
.public-meta a { color: var(--accent); }
.public-stats { display: flex; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.public-stat { flex: 1; text-align: center; padding: 1rem 0.5rem; border-right: 1px solid var(--border); }
.public-stat:last-child { border-right: none; }
.public-stat strong { display: block; font-size: 1.1rem; font-weight: 800; color: var(--accent2); margin-bottom: 0.3rem; word-break: break-word; }
.public-stat span   { font-size: 0.75rem; color: var(--text2); display: flex; align-items: center; justify-content: center; gap: 0.3rem; }
.public-actions { display: flex; align-items: center; padding: 1.2rem 1.5rem; flex-wrap: wrap; gap: 0.5rem; }
/* Auteur de post cliquable */
.post-author { cursor: pointer; border-radius: 8px; padding: 0.2rem 0.4rem; margin: -0.2rem -0.4rem; transition: background 0.15s; }
.post-author:hover { background: rgba(108,99,255,0.08); }
.post-author:hover strong { color: var(--accent); }

/* ===== NOTIFICATIONS ===== */
.nav-right {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.notif-bell {
  position: relative;
  background: rgba(108,99,255,0.12);
  border: 1px solid rgba(108,99,255,0.25);
  color: var(--text2);
  width: 38px; height: 38px;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: background 0.2s, color 0.2s;
  flex-shrink: 0;
}
.notif-bell:hover { background: rgba(108,99,255,0.22); color: var(--text); }

.notif-badge {
  position: absolute;
  top: -5px; right: -5px;
  background: var(--red);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 700;
  min-width: 18px; height: 18px;
  border-radius: 50px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 4px;
  border: 2px solid var(--bg);
  animation: badgePop 0.3s ease;
}
@keyframes badgePop {
  0%   { transform: scale(0); }
  70%  { transform: scale(1.2); }
  100% { transform: scale(1); }
}

@keyframes bellRing {
  0%,100% { transform: rotate(0deg); }
  10%     { transform: rotate(18deg); }
  20%     { transform: rotate(-16deg); }
  30%     { transform: rotate(14deg); }
  40%     { transform: rotate(-10deg); }
  50%     { transform: rotate(6deg); }
  60%     { transform: rotate(-4deg); }
  70%     { transform: rotate(2deg); }
}

@keyframes badgePulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(255,77,109,0.7); }
  50%     { box-shadow: 0 0 0 6px rgba(255,77,109,0); }
}

.notif-bell.ringing i {
  animation: bellRing 0.8s ease;
  display: inline-block;
  transform-origin: top center;
}

.notif-badge.pulsing {
  animation: badgePulse 1s ease 3;
}

@keyframes badgeFlip {
  0%   { transform: translateY(0)   scale(1);    opacity: 1; }
  40%  { transform: translateY(-6px) scale(1.15); opacity: 0; }
  41%  { transform: translateY(6px)  scale(0.85); opacity: 0; }
  100% { transform: translateY(0)   scale(1);    opacity: 1; }
}

.notif-badge.flip {
  animation: badgeFlip 0.35s cubic-bezier(0.34,1.56,0.64,1);
}

/* Panneau notifications */
.notif-panel {
  position: fixed;
  top: 68px;
  right: 1rem;
  width: min(360px, calc(100vw - 1rem));
  max-width: calc(100vw - 2rem);
  max-height: 520px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.5);
  z-index: 500;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(-8px) scale(0.97);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.notif-panel.open {
  transform: translateY(0) scale(1);
  opacity: 1;
  pointer-events: all;
}

.notif-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.2rem 0.8rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.notif-panel-title {
  font-size: 0.95rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.notif-panel-title i { color: var(--accent); }
.notif-count-badge {
  background: var(--red);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.1rem 0.45rem;
  border-radius: 50px;
}
.notif-panel-actions {
  display: flex;
  gap: 0.4rem;
}
.notif-panel-actions button {
  background: transparent;
  border: none;
  color: var(--text2);
  cursor: pointer;
  width: 28px; height: 28px;
  border-radius: 6px;
  font-size: 0.82rem;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s, color 0.15s;
}
.notif-panel-actions button:hover { background: rgba(108,99,255,0.12); color: var(--text); }

.notif-list {
  overflow-y: auto;
  flex: 1;
}
.notif-list::-webkit-scrollbar { width: 4px; }
.notif-list::-webkit-scrollbar-track { background: transparent; }
.notif-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 0.8rem;
  padding: 0.9rem 1.2rem;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s;
  position: relative;
  text-decoration: none;
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: rgba(108,99,255,0.08); }
.notif-unread { background: rgba(108,99,255,0.04); }

.notif-arrow {
  color: var(--text2);
  font-size: 0.7rem;
  align-self: center;
  flex-shrink: 0;
  opacity: 0.5;
  transition: opacity 0.15s, transform 0.15s;
}
.notif-item:hover .notif-arrow { opacity: 1; transform: translateX(2px); }

.notif-icon {
  width: 38px; height: 38px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.95rem;
  flex-shrink: 0;
}
.notif-content { flex: 1; min-width: 0; }
.notif-content strong { display: block; font-size: 0.85rem; font-weight: 700; margin-bottom: 0.2rem; }
.notif-content p {
  font-size: 0.8rem;
  color: var(--text2);
  line-height: 1.45;
  margin: 0;
  white-space: normal;
  word-break: break-word;
}
.notif-time { font-size: 0.7rem; color: var(--text2); margin-top: 0.3rem; display: block; opacity: 0.7; }

.notif-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
  margin-top: 4px;
}

.notif-empty {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--text2);
}
.notif-empty i { font-size: 2rem; display: block; margin-bottom: 0.6rem; opacity: 0.35; }
.notif-empty p { font-size: 0.85rem; }

@media (max-width: 480px) {
  .notif-panel { right: 0.5rem; width: calc(100vw - 1rem); }
}
/* Modal vidéo amélioré */
.video-modal { max-width: 540px; gap: 0.9rem; }

.video-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.video-modal-header h3 {
  font-size: 1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.video-modal-header h3 i { color: var(--accent); }
.video-modal-close {
  background: rgba(255,255,255,0.06);
  border: none;
  color: var(--text2);
  width: 30px; height: 30px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s, color 0.15s;
}
.video-modal-close:hover { background: rgba(255,77,109,0.15); color: var(--red); }

.video-modal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem;
}
@media (max-width: 480px) { .video-modal-grid { grid-template-columns: 1fr; } }

.vselect {
  width: 100%;
  background: var(--bg2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.75rem 1rem;
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.9rem;
}
.vselect:focus { outline: none; border-color: var(--accent); }

.video-modal .form-group textarea {
  width: 100%;
  background: var(--bg2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.75rem 1rem;
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.9rem;
  resize: vertical;
}
.video-modal .form-group textarea:focus { outline: none; border-color: var(--accent); }

.video-preview-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(255,0,0,0.1);
  border: 1px solid rgba(255,0,0,0.25);
  color: #ff4444;
  padding: 0.45rem 1rem;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.2s;
  margin-top: -0.2rem;
}
.video-preview-btn:hover { background: rgba(255,0,0,0.18); }
.video-preview-btn.drive {
  background: rgba(66,133,244,0.1);
  border-color: rgba(66,133,244,0.3);
  color: #4285f4;
}
.video-preview-btn.drive:hover { background: rgba(66,133,244,0.2); }

.video-preview-wrap {
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  margin-top: 0.2rem;
}

/* ===== GESTION VIDÉOS ADMIN ===== */
.video-admin-filters {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-bottom: 1.2rem;
}

.video-admin-stats {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}
.video-stat-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem 1.4rem;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  min-width: 120px;
}
.video-stat-card i { font-size: 1.3rem; }
.video-stat-card strong { display: block; font-size: 1.4rem; font-weight: 800; line-height: 1; }
.video-stat-card span { font-size: 0.75rem; color: var(--text2); }

.video-admin-list {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}
.video-admin-header,
.video-admin-row {
  display: grid;
  grid-template-columns: 2.5fr 1fr 1fr 1.2fr 0.8fr;
  padding: 0.8rem 1.2rem;
  gap: 1rem;
  align-items: center;
  font-size: 0.85rem;
}
.video-admin-header {
  background: var(--bg2);
  font-weight: 600;
  font-size: 0.78rem;
  color: var(--text2);
}
.video-admin-row {
  border-top: 1px solid var(--border);
  transition: background 0.15s;
}
.video-admin-row:hover { background: rgba(108,99,255,0.04); }

.video-admin-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}
.video-admin-title span { display: flex; flex-direction: column; min-width: 0; }
.video-admin-title strong { font-size: 0.88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.video-admin-title small { font-size: 0.72rem; color: var(--text2); }

.access-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.75rem;
  border-radius: 50px;
  border: none;
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 700;
  font-family: inherit;
  transition: opacity 0.2s, transform 0.15s;
}
.access-toggle-btn:hover { opacity: 0.8; transform: scale(1.04); }
.access-toggle-btn.free {
  background: rgba(0,212,170,0.15);
  color: var(--green);
}
.access-toggle-btn.paid {
  background: rgba(245,158,11,0.15);
  color: var(--gold);
}

.video-admin-actions { display: flex; gap: 0.4rem; }
.video-action-btn {
  width: 30px; height: 30px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-size: 0.8rem;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s, color 0.15s;
}
.video-action-btn.edit {
  background: rgba(108,99,255,0.12);
  color: var(--accent);
}
.video-action-btn.edit:hover { background: rgba(108,99,255,0.25); }
.video-action-btn.delete {
  background: rgba(255,77,109,0.12);
  color: var(--red);
}
.video-action-btn.delete:hover { background: rgba(255,77,109,0.25); }

/* Toggle accès dans le modal */
.video-access-toggle {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}
.video-access-label { font-size: 0.85rem; color: var(--text2); font-weight: 600; }
.video-access-options { display: flex; gap: 0.6rem; }
.access-option { cursor: pointer; }
.access-option input { display: none; }
.access-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 1rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  border: 2px solid var(--border);
  color: var(--text2);
  transition: all 0.2s;
  cursor: pointer;
}
.access-option input:checked + .access-btn.free {
  border-color: var(--green);
  color: var(--green);
  background: rgba(0,212,170,0.1);
}
.access-option input:checked + .access-btn.paid {
  border-color: var(--gold);
  color: var(--gold);
  background: rgba(245,158,11,0.1);
}

@media (max-width: 768px) {
  .video-admin-header,
  .video-admin-row { grid-template-columns: 2fr 1fr 1fr; }
  .video-admin-header span:nth-child(3),
  .video-admin-row  span:nth-child(3) { display: none; }
}

/* ===== FOOTER ===== */
.footer {
  background: var(--bg2);
  border-top: 1px solid var(--border);
  padding: 2rem 5%;
  margin-top: 3rem;
}
.footer-content { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem; }
.footer-content p { color: var(--text2); font-size: 0.85rem; }
.social-links { display: flex; gap: 1rem; }
.social-links a { color: var(--text2); font-size: 1.1rem; transition: color 0.2s; }
.social-links a:hover { color: var(--accent); }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  /* ── Navbar ── */
  .navbar { padding: 0.75rem 4%; will-change: auto; transform: none; }
  .nav-links {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    background: var(--bg2);
    padding: 1rem 5%;
    border-bottom: 1px solid var(--border);
    gap: 0.8rem;
    z-index: 500;
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
  }
  .nav-links.open { display: flex; }
  .nav-links a { font-size: 1rem; padding: 0.4rem 0; }
  .hamburger { display: block; }
  .nav-right { gap: 0.4rem; }
  .notif-bell { width: 34px; height: 34px; font-size: 0.9rem; }
  .btn-nav { max-width: 120px; padding: 0.35rem 0.7rem; font-size: 0.82rem; }
  .btn-nav span.nav-name { max-width: 60px; }

  /* ── Header ── */
  .site-header { padding: 1.5rem 4%; }
  .site-header-inner { flex-direction: column; align-items: flex-start; gap: 1rem; }
  .site-header-text h1 { font-size: 1.5rem; }
  .site-header-stats { width: 100%; justify-content: space-between; }
  .site-header-btns { flex-direction: column; width: 100%; }
  .site-header-btns .btn-primary,
  .site-header-btns .btn-outline { width: 100%; text-align: center; justify-content: center; }

  /* ── Affiliation ── */
  .steps { flex-direction: column; align-items: center; }
  .step-arrow { transform: rotate(90deg); }
  .comm-header, .comm-row { grid-template-columns: 1fr 1fr; font-size: 0.8rem; }
  .comm-header span:nth-child(3), .comm-row span:nth-child(3) { display: none; }

  /* ── Dashboard ── */
  .dashboard-header {
    grid-template-columns: 1fr;
    justify-items: start;
    padding: 1.5rem 4% 0.8rem;
  }
  .user-plan { justify-self: start; }
  .dashboard-header h1 { font-size: 1.4rem; }
  .user-plan { flex-wrap: wrap; gap: 0.6rem; }
  .dash-stats { padding: 0.8rem 4%; grid-template-columns: repeat(2, 1fr); gap: 0.7rem; }
  .dash-stat { padding: 1rem; }
  .dash-stat strong { font-size: 1.1rem; }
  .dash-section { padding: 1rem 4%; }

  /* ── Feed ── */
  .feed-section { padding: 1.2rem 4%; }
  .feed-layout { grid-template-columns: 1fr; gap: 1rem; }
  .feed-sidebar { position: static; }
  .sidebar-card { padding: 1rem; }

  /* ── Profil ── */
  .profile-section { padding: 1rem 4%; }
  .profile-body { flex-direction: column; }
  .profile-card { max-width: 100%; }
  .profile-details { padding: 0.8rem 1rem; gap: 0.6rem; }
  .profile-stats { flex-wrap: wrap; }
  .profile-stat { min-width: 80px; }

  /* ── Tabs ── */
  .dash-tabs { overflow-x: auto; padding-bottom: 0; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .dash-tabs::-webkit-scrollbar { display: none; }
  .dash-tab { white-space: nowrap; font-size: 0.8rem; padding: 0.5rem 0.8rem; }

  /* ── Footer ── */
  .footer { padding: 1.5rem 4%; }
  .footer-content { flex-direction: column; align-items: center; text-align: center; gap: 0.8rem; }
}

/* ── Barre d'outils éditeur ─────────────────────────────── */
.editor-toolbar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.4rem 0 0.8rem;
  flex-wrap: wrap;
}
.editor-btn {
  background: rgba(108,99,255,0.1);
  border: 1px solid rgba(108,99,255,0.25);
  color: var(--accent);
  padding: 0.3rem 0.8rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.82rem;
  font-family: inherit;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: background 0.2s;
}
.editor-btn:hover { background: rgba(108,99,255,0.22); }
.editor-hint {
  font-size: 0.75rem;
  color: var(--text2);
  opacity: 0.7;
  margin-left: auto;
}

/* ── Liens auto-détectés dans les posts ─────────────────── */
.post-auto-link {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
  word-break: break-all;
  transition: color 0.2s;
}
.post-auto-link:hover { color: var(--accent2); }

/* ── Onglets éditeur admin ───────────────────────────────── */
.admin-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 1rem;
}
.admin-panel-tabs {
  display: flex;
  gap: 0.4rem;
}
.admin-tab-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text2);
  padding: 0.3rem 0.9rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.82rem;
  font-family: inherit;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.2s;
}
.admin-tab-btn.active {
  background: rgba(108,99,255,0.15);
  border-color: var(--accent);
  color: var(--accent);
}
.admin-tab-btn:hover:not(.active) { background: rgba(255,255,255,0.05); }

/* ── Zone textarea avec compteur ────────────────────────── */
.editor-wrap { position: relative; }
.editor-wrap textarea {
  width: 100%;
  resize: vertical;
  min-height: 120px;
}
.editor-char-count {
  position: absolute;
  bottom: 0.5rem;
  right: 0.8rem;
  font-size: 0.7rem;
  color: var(--text2);
  opacity: 0.6;
  pointer-events: none;
}
.editor-separator {
  width: 1px;
  height: 20px;
  background: var(--border);
  margin: 0 0.2rem;
}

/* ── Aperçu éditeur ─────────────────────────────────────── */
.editor-preview-box {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem 1.2rem;
  min-height: 100px;
  font-size: 0.92rem;
  line-height: 1.7;
  color: var(--text);
}
.editor-preview-box p { margin: 0 0 0.5rem; }
.editor-preview-box p:last-child { margin-bottom: 0; }

/* ── Modal lien & emoji ─────────────────────────────────── */
.link-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: fadeIn 0.15s ease;
}
.link-modal-box {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.4rem;
  width: 100%;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}
.link-modal-box input {
  width: 100%;
  background: var(--bg2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.55rem 0.9rem;
  border-radius: 10px;
  font-size: 0.9rem;
  font-family: inherit;
  box-sizing: border-box;
}
.link-modal-box input:focus { outline: none; border-color: var(--accent); }

/* ── Grille emoji ───────────────────────────────────────── */
.emoji-grid {
  display: grid !important;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.4rem;
  max-width: 280px;
}
.emoji-grid button {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 1.4rem;
  padding: 0.4rem;
  cursor: pointer;
  transition: background 0.15s;
  line-height: 1;
}
.emoji-grid button:hover { background: rgba(108,99,255,0.15); }

/* ── Bouton emoji commentaire ───────────────────────────── */
.comment-emoji-btn {
  background: transparent;
  border: none;
  color: var(--text2);
  cursor: pointer;
  font-size: 1rem;
  padding: 0 0.3rem;
  flex-shrink: 0;
  transition: color 0.2s, transform 0.15s;
  line-height: 1;
}
.comment-emoji-btn:hover { color: var(--accent); transform: scale(1.2); }

/* ── Picker emoji commentaire ───────────────────────────── */
.comment-emoji-picker {
  position: fixed;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.5rem;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.2rem;
  z-index: 9999;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  animation: fadeIn 0.12s ease;
}
.comment-emoji-picker button {
  background: transparent;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 6px;
  transition: background 0.15s;
  line-height: 1;
}
.comment-emoji-picker button:hover { background: rgba(108,99,255,0.15); }

/* ══════════════════════════════════════════════════════════
   FORMATIONS — Design moderne
══════════════════════════════════════════════════════════ */

/* ── Hero ─────────────────────────────────────────────── */
.formations-hero {
  background: linear-gradient(160deg, rgba(108,99,255,0.08) 0%, transparent 60%),
              radial-gradient(ellipse at 80% 50%, rgba(0,212,170,0.06) 0%, transparent 60%);
  border-bottom: 1px solid var(--border);
  padding: 3.5rem 5% 2.5rem;
}
.formations-hero-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 3rem;
  flex-wrap: wrap;
}
.formations-hero-text { flex: 1; min-width: 0; }
.formations-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(108,99,255,0.12);
  border: 1px solid rgba(108,99,255,0.25);
  color: var(--accent);
  padding: 0.35rem 1rem;
  border-radius: 50px;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 1rem;
}
.formations-hero-text h1 {
  font-size: 2.2rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 0.8rem;
}
.formations-hero-text h1 span { color: var(--accent); }
.formations-hero-text p { color: var(--text2); font-size: 1rem; margin-bottom: 1.5rem; }

.formations-hero-stats {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
}
.fh-stat { display: flex; flex-direction: column; }
.fh-stat strong { font-size: 1.6rem; font-weight: 800; color: var(--text); }
.fh-stat span { font-size: 0.78rem; color: var(--text2); }

/* ── Barre de recherche ───────────────────────────────── */
.formations-search-wrap {
  flex: 0 0 340px;
  position: relative;
}
.formations-search-box {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.75rem 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.formations-search-box:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(108,99,255,0.12);
}
.formations-search-box i { color: var(--text2); font-size: 0.95rem; flex-shrink: 0; }
.formations-search-box input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
}
.formations-search-box input::placeholder { color: var(--text2); opacity: 0.6; }
.search-clear {
  background: transparent;
  border: none;
  color: var(--text2);
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  font-size: 0.85rem;
  transition: color 0.2s;
}
.search-clear:hover { color: var(--red); }

/* ── Suggestions ──────────────────────────────────────── */
.search-suggestions {
  position: absolute;
  top: calc(100% + 6px);
  left: 0; right: 0;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  z-index: 200;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  animation: fadeIn 0.12s ease;
}
.search-suggestion-item {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.65rem 1rem;
  cursor: pointer;
  font-size: 0.88rem;
  transition: background 0.15s;
}
.search-suggestion-item:hover { background: rgba(108,99,255,0.1); }
.search-suggestion-item span:first-of-type { flex: 1; }
.sugg-cat {
  font-size: 0.72rem;
  color: var(--text2);
  background: var(--bg2);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
}

/* ── Toolbar ──────────────────────────────────────────── */
.formations-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}
.formations-view-toggle { display: flex; gap: 0.4rem; }
.view-btn {
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text2);
  width: 36px; height: 36px;
  border-radius: 8px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}
.view-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.view-btn:hover:not(.active) { border-color: var(--accent); color: var(--accent); }

/* ── Bannière résultat ────────────────────────────────── */
.search-result-banner {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: rgba(108,99,255,0.08);
  border: 1px solid rgba(108,99,255,0.2);
  border-radius: 10px;
  padding: 0.6rem 1rem;
  font-size: 0.88rem;
  color: var(--text2);
  margin-bottom: 1.2rem;
}
.search-result-banner strong { color: var(--accent); }
.search-result-banner em { color: var(--text); font-style: normal; }

/* ── Grille améliorée ─────────────────────────────────── */
.courses-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 1.4rem;
}
.courses-list-view {
  grid-template-columns: 1fr !important;
  gap: 0.8rem;
}

/* Animation entrée */
@keyframes courseIn {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
.course-animate { animation: courseIn 0.3s ease both; }

/* ── Carte grille ─────────────────────────────────────── */
.course-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
  position: relative;
}
.course-card:hover {
  transform: translateY(-5px);
  border-color: var(--accent);
  box-shadow: 0 12px 32px rgba(108,99,255,0.15);
}
.course-thumb {
  position: relative;
  height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.course-thumb::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 40%, rgba(0,0,0,0.4));
}
.course-thumb i { font-size: 3rem; color: var(--accent); opacity: 0.85; z-index: 1; transition: transform 0.3s; }
.course-card:hover .course-thumb i { transform: scale(1.15); }
.play-overlay {
  position: absolute;
  inset: 0;
  background: rgba(108,99,255,0.2);
  display: flex; align-items: center; justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
  z-index: 2;
}
.course-card:hover .play-overlay { opacity: 1; }
.play-overlay i { font-size: 2.8rem; color: #fff; filter: drop-shadow(0 2px 8px rgba(0,0,0,0.5)); }
.course-lock {
  position: absolute;
  top: 10px; right: 10px;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(4px);
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  font-size: 0.72rem;
  color: var(--gold);
  z-index: 3;
  display: flex; align-items: center; gap: 0.3rem;
}
.course-free-tag {
  position: absolute;
  top: 10px; left: 10px;
  background: rgba(0,212,170,0.85);
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 700;
  color: #fff;
  z-index: 3;
}
.course-info { padding: 1.1rem 1.2rem 1.3rem; }
.course-card-top { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.6rem; flex-wrap: wrap; }
.course-tag {
  display: inline-block;
  background: rgba(108,99,255,0.12);
  color: var(--accent);
  padding: 0.18rem 0.55rem;
  border-radius: 5px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}
.course-level-badge {
  display: inline-block;
  padding: 0.18rem 0.55rem;
  border-radius: 5px;
  font-size: 0.68rem;
  font-weight: 600;
}
.course-info h3 { font-size: 0.97rem; font-weight: 700; margin-bottom: 0.4rem; line-height: 1.4; }
.course-info p { font-size: 0.82rem; color: var(--text2); line-height: 1.5; margin-bottom: 0.8rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.course-meta { display: flex; gap: 1rem; font-size: 0.78rem; color: var(--text2); }
.course-meta span { display: flex; align-items: center; gap: 0.3rem; }
.course-meta i { color: var(--accent); font-size: 0.72rem; }

/* ── Vue liste ────────────────────────────────────────── */
.course-list-item {
  display: flex !important;
  align-items: center;
  gap: 1.2rem;
  padding: 1rem 1.2rem;
  border-radius: 14px !important;
}
.course-list-item:hover { transform: translateX(4px) !important; }
.course-list-icon {
  width: 52px; height: 52px;
  background: rgba(108,99,255,0.1);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.course-list-icon i { font-size: 1.4rem; color: var(--accent); }
.course-list-body { flex: 1; min-width: 0; }
.course-list-top { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.3rem; flex-wrap: wrap; }
.course-list-body h3 { font-size: 0.95rem; font-weight: 700; margin-bottom: 0.2rem; }
.course-list-body p { font-size: 0.82rem; color: var(--text2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin: 0; }
.course-list-action { flex-shrink: 0; }
.course-lock-badge {
  background: rgba(245,158,11,0.12);
  color: var(--gold);
  padding: 0.18rem 0.55rem;
  border-radius: 5px;
  font-size: 0.68rem;
  font-weight: 600;
}
.course-free-badge {
  background: rgba(0,212,170,0.12);
  color: var(--accent2);
  padding: 0.18rem 0.55rem;
  border-radius: 5px;
  font-size: 0.68rem;
  font-weight: 600;
}

/* ── État vide ────────────────────────────────────────── */
.courses-empty {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 4rem 2rem;
  text-align: center;
  color: var(--text2);
}
.courses-empty i { font-size: 3rem; opacity: 0.3; }
.courses-empty h3 { font-size: 1.1rem; color: var(--text); }
.courses-empty p { font-size: 0.9rem; }

/* ── Responsive ───────────────────────────────────────── */
@media (max-width: 768px) {
  .formations-hero-inner { flex-direction: column; gap: 1.5rem; }
  .formations-search-wrap { flex: 1 1 100%; }
  .formations-hero-text h1 { font-size: 1.7rem; }
  .formations-toolbar { flex-direction: column; align-items: flex-start; }
  .course-list-item { flex-wrap: wrap; }
  .course-list-action { width: 100%; }
  .course-list-action .btn-primary { width: 100%; justify-content: center; }
}

/* ── Thumbnail vidéo — formulaire admin ─────────────────── */
.thumbnail-input-wrap { display: flex; flex-direction: column; gap: 0.6rem; }
.thumbnail-preview {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg2);
}
.thumbnail-preview img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.thumbnail-remove {
  position: absolute;
  top: 0.5rem; right: 0.5rem;
  background: rgba(0,0,0,0.65);
  border: none;
  color: #fff;
  width: 28px; height: 28px;
  border-radius: 50%;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem;
  transition: background 0.2s;
}
.thumbnail-remove:hover { background: var(--red); }
.thumbnail-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.thumbnail-actions input[type="url"] {
  background: var(--bg2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.45rem 0.8rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-family: inherit;
}
.thumbnail-actions input[type="url"]:focus { outline: none; border-color: var(--accent); }

/* ── Thumbnail dans les cartes ───────────────────────────── */
.course-thumb { position: relative; overflow: hidden; }
.course-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  position: absolute;
  inset: 0;
  transition: transform 0.3s;
}
.course-card:hover .course-thumb img { transform: scale(1.05); }

/* ── Bouton play visible ─────────────────────────────────── */
.play-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0);
  transition: background 0.25s;
  z-index: 2;
}
.course-card:hover .play-overlay {
  background: rgba(0,0,0,0.25);
}
.play-btn-circle {
  width: 52px;
  height: 52px;
  background: rgba(255,255,255,0.92);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(0,0,0,0.35);
  transition: transform 0.2s, background 0.2s, box-shadow 0.2s;
}
.play-btn-circle i {
  color: #111;
  font-size: 1.1rem;
  margin-left: 3px; /* centrage optique */
}
.course-card:hover .play-btn-circle {
  transform: scale(1.12);
  background: var(--accent);
  box-shadow: 0 6px 24px rgba(108,99,255,0.5);
}
.course-card:hover .play-btn-circle i {
  color: #fff;
}

/* ══════════════════════════════════════════════════════════
   MODALE UPGRADE DE PLAN
══════════════════════════════════════════════════════════ */
.upgrade-modal {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 24px;
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  animation: fadeIn 0.2s ease;
  position: relative;
}
.upgrade-modal-header {
  text-align: center;
  padding: 2rem 2rem 1.2rem;
  border-bottom: 1px solid var(--border);
  position: relative;
}
.upgrade-lock-icon { font-size: 2.8rem; margin-bottom: 0.6rem; }
.upgrade-modal-header h2 { font-size: 1.2rem; font-weight: 800; margin-bottom: 0.4rem; }
.upgrade-modal-header p { color: var(--text2); font-size: 0.9rem; line-height: 1.6; }
.upgrade-modal-close {
  position: absolute;
  top: 1rem; right: 1rem;
  background: var(--bg2);
  border: 1px solid var(--border);
  color: var(--text2);
  width: 32px; height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem;
  transition: all 0.2s;
}
.upgrade-modal-close:hover { background: var(--red); color: #fff; border-color: var(--red); }

/* ── Guest ─────────────────────────────────────────────── */
.upgrade-guest {
  padding: 1.5rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

/* ── Plans ─────────────────────────────────────────────── */
.upgrade-plans {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  padding: 1.5rem;
}
.upgrade-plan {
  background: var(--bg2);
  border: 2px solid var(--border);
  border-radius: 16px;
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.upgrade-plan:hover { border-color: var(--accent); box-shadow: 0 4px 20px rgba(108,99,255,0.15); }
.upgrade-plan-elite { border-color: rgba(245,158,11,0.3); }
.upgrade-plan-elite:hover { border-color: var(--gold); box-shadow: 0 4px 20px rgba(245,158,11,0.15); }
.upgrade-plan-header { display: flex; flex-direction: column; gap: 0.3rem; }
.upgrade-plan-badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 50px;
  font-size: 0.7rem;
  font-weight: 700;
  width: fit-content;
}
.upgrade-plan-badge.popular { background: rgba(108,99,255,0.15); color: var(--accent); }
.upgrade-plan-badge.elite   { background: rgba(245,158,11,0.15); color: var(--gold); }
.upgrade-plan-header h3 { font-size: 1.1rem; font-weight: 800; }
.upgrade-plan-price { font-size: 1.3rem; font-weight: 800; color: var(--text); }
.upgrade-plan-price span { font-size: 0.8rem; color: var(--accent2); }
.upgrade-plan-price small { font-size: 0.75rem; color: var(--text2); font-weight: 400; }
.upgrade-plan-features { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.4rem; }
.upgrade-plan-features li { font-size: 0.8rem; color: var(--text2); display: flex; align-items: center; gap: 0.4rem; }
.upgrade-plan-features li i { color: var(--accent2); font-size: 0.7rem; flex-shrink: 0; }
.upgrade-plan-btn {
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  border: none;
  color: #fff;
  padding: 0.6rem 1rem;
  border-radius: 10px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: opacity 0.2s, transform 0.15s;
  margin-top: auto;
}
.upgrade-plan-btn.elite { background: linear-gradient(135deg, #f59e0b, #ef4444); }
.upgrade-plan-btn:hover { opacity: 0.9; transform: translateY(-1px); }

/* ── Paiement ───────────────────────────────────────────── */
.upgrade-payment { padding: 1.5rem; display: flex; flex-direction: column; gap: 1.2rem; }
.upgrade-payment-header { display: flex; align-items: center; gap: 0.8rem; }
.upgrade-back-btn {
  background: var(--bg2);
  border: 1px solid var(--border);
  color: var(--text2);
  padding: 0.4rem 0.8rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.82rem;
  font-family: inherit;
  display: flex; align-items: center; gap: 0.4rem;
  transition: all 0.2s;
}
.upgrade-back-btn:hover { border-color: var(--accent); color: var(--accent); }
.upgrade-payment-header h3 { font-size: 1rem; font-weight: 700; }
.upgrade-payment-steps { display: flex; flex-direction: column; gap: 1.2rem; }
.upgrade-step {
  display: flex;
  gap: 1rem;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.1rem;
}
.upgrade-step-num {
  width: 28px; height: 28px;
  background: var(--accent);
  color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.82rem;
  font-weight: 700;
  flex-shrink: 0;
}
.upgrade-step strong { font-size: 0.92rem; display: block; margin-bottom: 0.4rem; }
.upgrade-step p { font-size: 0.83rem; color: var(--text2); margin: 0 0 0.6rem; }
.upgrade-mm-options { display: flex; flex-direction: column; gap: 0.4rem; }
.upgrade-mm-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  background: var(--bg3);
  padding: 0.4rem 0.7rem;
  border-radius: 8px;
}
.upgrade-form { display: flex; flex-direction: column; gap: 0.6rem; margin-top: 0.6rem; }
.upgrade-input {
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.6rem 0.9rem;
  border-radius: 10px;
  font-size: 0.88rem;
  font-family: inherit;
  width: 100%;
  box-sizing: border-box;
}
.upgrade-input:focus { outline: none; border-color: var(--accent); }

/* ── Succès ─────────────────────────────────────────────── */
.upgrade-success {
  padding: 2rem;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.8rem;
}
.upgrade-success h3 { font-size: 1.1rem; font-weight: 800; }
.upgrade-success p { color: var(--text2); font-size: 0.9rem; line-height: 1.6; }

@media (max-width: 480px) {
  .upgrade-plans { grid-template-columns: 1fr; }
  .upgrade-modal { border-radius: 16px; }
}

/* ── Sélecteur numéros admin (cartes cliquables) ─────────── */
.upgrade-admin-mm-selector {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.upgrade-admin-mm-option { cursor: pointer; }
.upgrade-admin-mm-option input[type="radio"] { display: none; }
.upgrade-admin-mm-hidden { display: none; }

.upgrade-admin-mm-card {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  background: var(--bg2);
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}
.upgrade-admin-mm-card:hover {
  border-color: var(--accent2);
}
.upgrade-admin-mm-selected {
  border-color: var(--accent2) !important;
  background: rgba(0,212,170,0.07) !important;
  box-shadow: 0 0 0 3px rgba(0,212,170,0.12);
}
.upgrade-admin-mm-icon {
  width: 42px; height: 42px;
  border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}
.upgrade-admin-mm-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}
.upgrade-admin-mm-info strong { font-size: 0.92rem; }
.upgrade-admin-mm-number {
  font-size: 1.05rem !important;
  font-weight: 700;
  color: var(--text) !important;
  letter-spacing: 0.04em;
}
.upgrade-admin-mm-name { font-size: 0.72rem !important; color: var(--text2) !important; }
.upgrade-admin-mm-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent2);
  background: rgba(0,212,170,0.12);
  border: 1px solid rgba(0,212,170,0.25);
  padding: 0.25rem 0.6rem;
  border-radius: 50px;
  white-space: nowrap;
  flex-shrink: 0;
}
.upgrade-admin-mm-change {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: transparent;
  border: 1px dashed var(--border);
  color: var(--text2);
  padding: 0.4rem 0.9rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.78rem;
  font-family: inherit;
  margin-top: 0.3rem;
  transition: border-color 0.2s, color 0.2s;
}
.upgrade-admin-mm-change:hover { border-color: var(--accent); color: var(--accent); }
.upgrade-mm-no-admin {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  color: var(--red);
  background: rgba(255,77,109,0.06);
  border: 1px solid rgba(255,77,109,0.2);
  border-radius: 10px;
  padding: 0.7rem 0.9rem;
}
.upgrade-mm-hint {
  font-size: 0.78rem;
  color: var(--text2);
  margin-top: 0.5rem;
  padding: 0.5rem 0.8rem;
  background: rgba(108,99,255,0.06);
  border-left: 3px solid var(--accent);
  border-radius: 0 8px 8px 0;
  line-height: 1.5;
}

/* ── Instruction envoi MM ────────────────────────────── */
.upgrade-mm-instruction {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  margin-top: 0.7rem;
  padding: 0.65rem 0.9rem;
  background: rgba(108,99,255,0.07);
  border: 1px solid rgba(108,99,255,0.2);
  border-radius: 10px;
  font-size: 0.82rem;
  color: var(--text2);
  line-height: 1.5;
}
.upgrade-mm-instruction strong { color: var(--text); }
.upgrade-mm-instruction em { font-style: normal; }

/* ── Notices (info / warning) ────────────────────────── */
.upgrade-mm-notice {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.82rem;
  color: var(--text2);
  background: rgba(108,99,255,0.06);
  border: 1px solid rgba(108,99,255,0.2);
  border-radius: 10px;
  padding: 0.7rem 0.9rem;
  margin-bottom: 0.6rem;
  line-height: 1.5;
}
.upgrade-mm-notice i { color: var(--accent); flex-shrink: 0; margin-top: 0.1rem; }
.upgrade-mm-notice a { color: var(--accent); }
.upgrade-mm-notice-warn {
  background: rgba(255,77,109,0.06);
  border-color: rgba(255,77,109,0.25);
}
.upgrade-mm-notice-warn i { color: var(--red); }

/* ── Label formulaire ───────────────────────────────── */
.upgrade-form-label {
  display: block;
  font-size: 0.8rem;
  color: var(--text2);
  font-weight: 600;
  margin-bottom: 0.3rem;
}
.upgrade-form-manual { display: flex; flex-direction: column; gap: 0.3rem; }

/* ── Sélecteur compte MM utilisateur ────────────────────────── */
.upgrade-user-mm-selector {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.upgrade-user-mm-option { cursor: pointer; }
.upgrade-user-mm-option input[type="radio"] { display: none; }
.upgrade-user-mm-card {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  background: var(--bg2);
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 0.75rem 0.9rem;
  transition: border-color 0.2s, background 0.2s;
  cursor: pointer;
}
.upgrade-user-mm-option input:checked + .upgrade-user-mm-card {
  border-color: var(--accent);
  background: rgba(108,99,255,0.07);
}
.upgrade-user-mm-card:hover { border-color: var(--accent); }
.upgrade-mm-card-warn { border-color: rgba(245,158,11,0.3) !important; }
.upgrade-user-mm-option input:checked + .upgrade-mm-card-warn {
  border-color: var(--gold) !important;
  background: rgba(245,158,11,0.06) !important;
}
.upgrade-user-mm-icon {
  width: 38px; height: 38px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}
.upgrade-user-mm-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}
.upgrade-user-mm-details strong { font-size: 0.9rem; }
.upgrade-user-mm-details span   { font-size: 0.82rem; color: var(--text2); }
.upgrade-user-mm-name           { font-size: 0.72rem !important; opacity: 0.7; }
.upgrade-user-mm-right {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  flex-shrink: 0;
}
.upgrade-mm-match   { color: var(--green); font-size: 1rem; }
.upgrade-mm-nomatch { color: var(--gold);  font-size: 1rem; }
.upgrade-user-mm-check {
  color: var(--accent);
  font-size: 1.1rem;
  opacity: 0;
  transition: opacity 0.2s;
}
.upgrade-user-mm-option input:checked + .upgrade-user-mm-card .upgrade-user-mm-check { opacity: 1; }

/* Compte unique (pas de sélecteur) */
.upgrade-user-mm-single {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  background: var(--bg2);
  border: 2px solid var(--accent);
  border-radius: 12px;
  padding: 0.75rem 0.9rem;
  margin-bottom: 0.5rem;
}
.upgrade-user-mm-locked {
  font-size: 0.72rem;
  color: var(--accent2);
  display: flex;
  align-items: center;
  gap: 0.3rem;
  flex-shrink: 0;
}
.mm-register-section {
  background: rgba(0,212,170,0.06);
  border: 1px solid rgba(0,212,170,0.2);
  border-radius: 14px;
  padding: 1.1rem;
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}
.mm-register-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--accent2);
}
.mm-register-title i { font-size: 1rem; }
.mm-register-badge {
  background: var(--red);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 50px;
  margin-left: auto;
}
.mm-register-hint {
  font-size: 0.78rem;
  color: var(--text2);
  line-height: 1.5;
  margin: 0;
}
.mm-register-hint strong { color: var(--red); }

/* ── Sélecteur opérateur ─────────────────────────────────── */
.mm-operator-select {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.mm-op-option { cursor: pointer; }
.mm-op-option input[type="radio"] { display: none; }
.mm-op-btn {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--bg2);
  border: 2px solid var(--border);
  color: var(--text2);
  padding: 0.4rem 0.9rem;
  border-radius: 10px;
  font-size: 0.82rem;
  font-weight: 600;
  transition: all 0.2s;
  white-space: nowrap;
}
.mm-op-option input:checked + .mm-op-btn {
  border-color: var(--accent2);
  color: var(--accent2);
  background: rgba(0,212,170,0.1);
}
.mm-op-btn:hover { border-color: var(--accent2); }

/* ── Affichage MM verrouillé ─────────────────────────────── */
.mm-locked-display {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
  color: var(--accent2);
  margin-top: 0.4rem;
  padding: 0.4rem 0.7rem;
  background: rgba(0,212,170,0.08);
  border-radius: 8px;
}
.mm-locked-display i { flex-shrink: 0; }

/* ── Section comptes Mobile Money profil ────────────────── */
.mm-accounts-section {
  border-top: 1px solid var(--border);
  padding: 1.4rem 1.5rem;
}
.mm-accounts-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.mm-accounts-header h3 {
  font-size: 0.95rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
}
.mm-accounts-header h3 i { color: var(--accent2); }
.mm-accounts-hint {
  font-size: 0.72rem;
  color: var(--text2);
  background: rgba(255,77,109,0.08);
  border: 1px solid rgba(255,77,109,0.2);
  padding: 0.2rem 0.6rem;
  border-radius: 50px;
}

/* ── Ligne compte MM ─────────────────────────────────────── */
.mm-account-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  margin-bottom: 0.6rem;
  border: 1px solid var(--border);
  transition: border-color 0.2s;
}
.mm-filled { background: var(--bg2); }
.mm-empty  { background: rgba(255,255,255,0.02); border-style: dashed; }
.mm-account-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}
.mm-account-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.mm-account-info strong { font-size: 0.88rem; }
.mm-account-info span { font-size: 0.8rem; color: var(--text2); }
.mm-account-name { font-size: 0.75rem !important; opacity: 0.7; }
.mm-account-empty { font-style: italic; opacity: 0.5; }
.mm-account-status { flex-shrink: 0; }
.mm-locked-badge {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.72rem;
  color: var(--accent2);
  background: rgba(0,212,170,0.1);
  border: 1px solid rgba(0,212,170,0.2);
  padding: 0.25rem 0.6rem;
  border-radius: 50px;
}
.mm-add-btn {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(108,99,255,0.1);
  border: 1px solid rgba(108,99,255,0.25);
  color: var(--accent);
  padding: 0.35rem 0.8rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.8rem;
  font-family: inherit;
  font-weight: 600;
  transition: all 0.2s;
}
.mm-add-btn:hover { background: rgba(108,99,255,0.2); }

/* ── Sélecteur MM retrait ────────────────────────────────── */
.withdraw-mm-selector {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.withdraw-mm-option { cursor: pointer; }
.withdraw-mm-option input[type="radio"] { display: none; }
.withdraw-mm-card {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  background: var(--bg2);
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  transition: all 0.2s;
  position: relative;
}
.withdraw-mm-option input:checked + .withdraw-mm-card {
  border-color: var(--accent);
  background: rgba(108,99,255,0.06);
}
.withdraw-mm-card:hover { border-color: var(--accent); }
.withdraw-mm-op-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}
.withdraw-mm-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}
.withdraw-mm-details strong { font-size: 0.9rem; }
.withdraw-mm-details span { font-size: 0.82rem; color: var(--text2); }
.withdraw-mm-name { font-size: 0.75rem !important; opacity: 0.7; }
.withdraw-mm-check {
  color: var(--accent);
  font-size: 1.1rem;
  opacity: 0;
  transition: opacity 0.2s;
}
.withdraw-mm-option input:checked + .withdraw-mm-card .withdraw-mm-check { opacity: 1; }
.withdraw-mm-none {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.83rem;
  color: var(--text2);
  background: rgba(255,77,109,0.06);
  border: 1px solid rgba(255,77,109,0.2);
  border-radius: 10px;
  padding: 0.7rem 1rem;
}
.withdraw-mm-none i { color: var(--red); }
.withdraw-mm-none a { color: var(--accent); }

/* ── Highlight section MM quand navigué depuis affiliation ── */
@keyframes mmHighlight {
  0%   { box-shadow: 0 0 0 3px rgba(108,99,255,0.5); }
  100% { box-shadow: none; }
}
.mm-highlight {
  animation: mmHighlight 2s ease forwards;
  border-radius: 14px;
}

/* ── Section comptes paiement admin ─────────────────────── */
.admin-payment-section {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.4rem;
  margin-top: 1.5rem;
}
.admin-payment-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--border);
}
.admin-payment-row:last-of-type { border-bottom: none; }
.admin-payment-op {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-width: 160px;
}
.admin-payment-icon {
  width: 36px; height: 36px;
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}
.admin-payment-fields {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.admin-payment-info {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  flex: 1;
}
.admin-payment-info span { font-size: 0.88rem; }
.admin-payment-name { font-size: 0.75rem; color: var(--text2); }
.admin-payment-empty { font-size: 0.82rem; color: var(--text2); font-style: italic; flex: 1; }
.admin-payment-edit-btn {
  background: rgba(108,99,255,0.1);
  border: 1px solid rgba(108,99,255,0.25);
  color: var(--accent);
  padding: 0.3rem 0.8rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.78rem;
  font-family: inherit;
  display: flex; align-items: center; gap: 0.3rem;
  transition: all 0.2s;
  white-space: nowrap;
}
.admin-payment-edit-btn:hover { background: rgba(108,99,255,0.2); }
.admin-payment-edit-form {
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.8rem;
  background: var(--bg3);
  border-radius: 10px;
  margin-bottom: 0.5rem;
  border: 1px solid rgba(108,99,255,0.2);
  width: 100%;
}

.admin-pay-saved {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.72rem;
  color: var(--green);
  background: rgba(0,212,170,0.1);
  border: 1px solid rgba(0,212,170,0.2);
  padding: 0.2rem 0.6rem;
  border-radius: 50px;
}

/* ══════════════════════════════════════════════════════════
   ADMIN — Navigation interne + tableau utilisateurs complet
══════════════════════════════════════════════════════════ */

/* Sous-navigation admin */
.admin-subnav {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0;
  flex-wrap: wrap;
}

/* Masquer la subnav horizontale sur desktop (remplacée par la sidebar) */
@media (min-width: 1101px) {
  .admin-subnav { display: none; }
}
.admin-subnav-btn {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text2);
  padding: 0.6rem 1.1rem;
  cursor: pointer;
  font-size: 0.88rem;
  font-family: inherit;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  transition: color 0.2s, border-color 0.2s;
  margin-bottom: -1px;
  white-space: nowrap;
}
.admin-subnav-btn:hover { color: var(--text); }
.admin-subnav-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: 700;
}

/* Section admin (contenu sous la subnav) */
.admin-sub-section { animation: fadeIn 0.2s ease; padding: 1.2rem 2rem; }

/* KPI compacts (6 au lieu de 8) */
.admin-kpi-grid {
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  margin-bottom: 1.2rem;
}
.admin-kpi { padding: 1rem; }
.admin-kpi strong { font-size: 1.3rem; }
.admin-kpi span { font-size: 0.72rem; }

/* Toolbar recherche + filtres */
.admin-users-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.admin-users-search {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.5rem 0.9rem;
  flex: 1;
  max-width: 320px;
  transition: border-color 0.2s;
}
.admin-users-search:focus-within { border-color: var(--accent); }
.admin-users-search i { color: var(--text2); font-size: 0.85rem; flex-shrink: 0; }
.admin-users-search input {
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 0.88rem;
  font-family: inherit;
  outline: none;
  width: 100%;
}
.admin-users-search input::placeholder { color: var(--text2); opacity: 0.6; }

.admin-users-filters { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.admin-filter-pill {
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text2);
  padding: 0.3rem 0.8rem;
  border-radius: 50px;
  cursor: pointer;
  font-size: 0.78rem;
  font-family: inherit;
  font-weight: 600;
  transition: all 0.2s;
}
.admin-filter-pill.active,
.admin-filter-pill:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* Tableau utilisateurs complet (7 colonnes) */
.admin-users-header-full,
.admin-user-row-full {
  display: grid;
  grid-template-columns: 2fr 0.9fr 1.1fr 0.7fr 1fr 0.7fr 1fr;
  padding: 0.75rem 1.2rem;
  gap: 0.8rem;
  align-items: center;
  font-size: 0.82rem;
}
.admin-users-header-full {
  background: var(--bg2);
  font-weight: 600;
  font-size: 0.75rem;
  color: var(--text2);
  border-radius: 14px 14px 0 0;
}
.admin-user-row-full {
  border-top: 1px solid var(--border);
  transition: background 0.15s;
}
.admin-user-row-full:hover { background: rgba(108,99,255,0.04); }

/* Actions utilisateur */
.admin-user-actions {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}
.admin-action-btn {
  width: 28px; height: 28px;
  border-radius: 7px;
  border: none;
  cursor: pointer;
  font-size: 0.75rem;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s, transform 0.1s;
  flex-shrink: 0;
}
.admin-action-btn:hover { transform: scale(1.1); }
.admin-action-btn.view   { background: rgba(108,99,255,0.12); color: var(--accent); }
.admin-action-btn.view:hover { background: rgba(108,99,255,0.25); }
.admin-action-btn.plan   { background: rgba(245,158,11,0.12); color: var(--gold); }
.admin-action-btn.plan:hover { background: rgba(245,158,11,0.25); }
.admin-action-btn.toggle { background: rgba(0,212,170,0.12); color: var(--accent2); }
.admin-action-btn.toggle:hover { background: rgba(0,212,170,0.25); }
.admin-action-btn.del    { background: rgba(255,77,109,0.12); color: var(--red); }
.admin-action-btn.del:hover { background: rgba(255,77,109,0.25); }

/* Modal commissions utilisateur */
.user-comm-summary {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.2rem;
  flex-wrap: wrap;
}
.user-comm-stat {
  flex: 1;
  min-width: 100px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.8rem 1rem;
  text-align: center;
}
.user-comm-stat strong { display: block; font-size: 1.1rem; font-weight: 800; color: var(--accent2); }
.user-comm-stat span { font-size: 0.72rem; color: var(--text2); }

/* Choix de plan dans la modal */
.admin-plan-choice {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--bg2);
  border: 2px solid var(--border);
  color: var(--text);
  padding: 0.7rem 1.2rem;
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.9rem;
  font-family: inherit;
  font-weight: 600;
  transition: all 0.2s;
  width: 100%;
  justify-content: center;
}
.admin-plan-choice:hover { border-color: var(--accent); color: var(--accent); background: rgba(108,99,255,0.08); }
.admin-plan-choice.pro   { border-color: rgba(108,99,255,0.3); }
.admin-plan-choice.pro:hover { border-color: var(--accent); background: rgba(108,99,255,0.1); color: var(--accent); }
.admin-plan-choice.elite { border-color: rgba(245,158,11,0.3); }
.admin-plan-choice.elite:hover { border-color: var(--gold); background: rgba(245,158,11,0.1); color: var(--gold); }

/* Responsive tableau utilisateurs */
@media (max-width: 900px) {
  .admin-users-header-full,
  .admin-user-row-full {
    grid-template-columns: 2fr 0.9fr 1fr 0.7fr 1fr;
  }
  .admin-users-header-full span:nth-child(4),
  .admin-user-row-full > *:nth-child(4),
  .admin-users-header-full span:nth-child(5),
  .admin-user-row-full > *:nth-child(5) { display: none; }
}
@media (max-width: 600px) {
  .admin-users-header-full,
  .admin-user-row-full { grid-template-columns: 2fr 0.9fr 1fr; }
  .admin-users-header-full span:nth-child(3),
  .admin-user-row-full > *:nth-child(3),
  .admin-users-header-full span:nth-child(6),
  .admin-user-row-full > *:nth-child(6) { display: none; }
  .admin-users-search { max-width: 100%; }
}

/* ══════════════════════════════════════════════════════════
   COMPTES DE PAIEMENT ADMIN — états désactivé / actif
══════════════════════════════════════════════════════════ */

/* Badge désactivé */
.pay-disabled-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--red);
  background: rgba(255,77,109,0.1);
  border: 1px solid rgba(255,77,109,0.3);
  padding: 0.22rem 0.65rem;
  border-radius: 50px;
  white-space: nowrap;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Ligne désactivée — fond légèrement teinté */
.admin-payment-row:has(.pay-disabled-badge) {
  background: rgba(255,77,109,0.03);
  border-left: 3px solid rgba(255,77,109,0.35);
  border-radius: 0 10px 10px 0;
}

/* Groupe de boutons actions paiement */
.admin-payment-actions {
  display: flex;
  gap: 0.35rem;
  flex-shrink: 0;
}

/* Boutons preset raison */
.pay-reason-presets {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.pay-reason-pill {
  background: var(--bg2);
  border: 1px solid var(--border);
  color: var(--text2);
  padding: 0.3rem 0.7rem;
  border-radius: 50px;
  cursor: pointer;
  font-size: 0.75rem;
  font-family: inherit;
  transition: all 0.2s;
  white-space: nowrap;
}
.pay-reason-pill:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(108,99,255,0.08);
}

/* ══════════════════════════════════════════════════════════
   ADMIN — Section Abonnements
══════════════════════════════════════════════════════════ */

/* Badge compteur sur l'onglet subnav */
.admin-subnav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--red);
  color: #fff;
  font-size: 0.62rem;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 50px;
  padding: 0 4px;
  margin-left: 0.2rem;
  animation: badgePop 0.3s ease;
}

/* Carte demande d'abonnement */
.sub-request-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 16px;
  margin-bottom: 1rem;
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.sub-request-card:hover {
  border-color: rgba(108,99,255,0.3);
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}
.sub-pending {
  border-left: 3px solid var(--gold);
}

/* En-tête de la carte */
.sub-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.2rem 0.8rem;
  flex-wrap: wrap;
  gap: 0.8rem;
  border-bottom: 1px solid var(--border);
}
.sub-card-user {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}
.sub-card-user strong { display: block; font-size: 0.95rem; font-weight: 700; }
.sub-card-user small  { font-size: 0.75rem; color: var(--text2); }
.sub-card-meta {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

/* Badge plan */
.sub-plan-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.8rem;
  border-radius: 50px;
  font-size: 0.78rem;
  font-weight: 700;
}

/* Badge statut rejeté */
.status-rejected {
  background: rgba(255,77,109,0.12);
  color: var(--red);
}

/* Détails de la demande */
.sub-card-details {
  display: flex;
  gap: 0;
  flex-wrap: wrap;
  padding: 0.8rem 1.2rem;
  border-bottom: 1px solid var(--border);
}
.sub-detail-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.4rem 1.2rem 0.4rem 0;
  min-width: 130px;
  flex: 1;
}
.sub-detail-item i { font-size: 1rem; flex-shrink: 0; width: 18px; text-align: center; }
.sub-detail-item span { display: flex; flex-direction: column; gap: 0.05rem; }
.sub-detail-item strong { font-size: 0.88rem; font-weight: 700; }
.sub-detail-item small  { font-size: 0.72rem; color: var(--text2); }

/* Zone preuve */
.sub-card-proof {
  padding: 0.7rem 1.2rem;
  border-bottom: 1px solid var(--border);
  background: rgba(0,0,0,0.06);
}
.sub-proof-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(0,212,170,0.1);
  border: 1px solid rgba(0,212,170,0.3);
  color: var(--accent2);
  padding: 0.4rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.82rem;
  font-family: inherit;
  font-weight: 600;
  transition: background 0.2s;
}
.sub-proof-btn:hover { background: rgba(0,212,170,0.2); }

/* Actions */
.sub-card-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.6rem;
  padding: 0.8rem 1.2rem;
  flex-wrap: wrap;
}
.sub-card-actions-done {
  justify-content: space-between;
}
.sub-action-approve {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: linear-gradient(135deg, var(--accent2), #00a884);
  border: none;
  color: #fff;
  padding: 0.55rem 1.3rem;
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.88rem;
  font-family: inherit;
  font-weight: 700;
  transition: opacity 0.2s, transform 0.15s;
}
.sub-action-approve:hover { opacity: 0.88; transform: translateY(-1px); }
.sub-action-reject {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(255,77,109,0.1);
  border: 1px solid rgba(255,77,109,0.3);
  color: var(--red);
  padding: 0.55rem 1.1rem;
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.88rem;
  font-family: inherit;
  font-weight: 600;
  transition: background 0.2s;
}
.sub-action-reject:hover { background: rgba(255,77,109,0.2); }

@media (max-width: 600px) {
  .sub-card-actions { justify-content: stretch; }
  .sub-action-approve, .sub-action-reject { flex: 1; justify-content: center; }
  .sub-detail-item { min-width: 100px; }
}

/* ══════════════════════════════════════════════════════════
   ABONNEMENTS — Modales inline approbation / rejet
══════════════════════════════════════════════════════════ */

/* Conteneur modale inline */
.sub-inline-modal {
  border-radius: 12px;
  padding: 1rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  animation: slideDown 0.2s ease;
  width: 100%;
}
.sub-inline-approve {
  background: rgba(0,212,170,0.07);
  border: 1px solid rgba(0,212,170,0.25);
}
.sub-inline-reject {
  background: rgba(255,77,109,0.06);
  border: 1px solid rgba(255,77,109,0.2);
}

/* En-tête de la modale inline */
.sub-inline-header {
  display: flex;
  align-items: flex-start;
  gap: 0.8rem;
}
.sub-inline-header > i { flex-shrink: 0; margin-top: 0.1rem; }
.sub-inline-header strong { display: block; font-size: 0.92rem; font-weight: 700; margin-bottom: 0.2rem; }
.sub-inline-header p { font-size: 0.83rem; color: var(--text2); margin: 0; line-height: 1.5; }

/* Raisons prédéfinies rejet */
.sub-reject-reason-wrap { display: flex; flex-direction: column; gap: 0.5rem; }
.sub-reject-presets { display: flex; gap: 0.4rem; flex-wrap: wrap; }

/* Boutons d'action inline */
.sub-inline-actions {
  display: flex;
  gap: 0.6rem;
  justify-content: flex-end;
  flex-wrap: wrap;
}
.sub-inline-cancel {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text2);
  padding: 0.5rem 1rem;
  border-radius: 9px;
  cursor: pointer;
  font-size: 0.83rem;
  font-family: inherit;
  transition: all 0.2s;
}
.sub-inline-cancel:hover { border-color: var(--accent); color: var(--accent); }

.sub-inline-confirm {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: none;
  color: #fff;
  padding: 0.5rem 1.2rem;
  border-radius: 9px;
  cursor: pointer;
  font-size: 0.85rem;
  font-family: inherit;
  font-weight: 700;
  transition: opacity 0.2s, transform 0.15s;
}
.sub-inline-confirm:hover { opacity: 0.88; transform: translateY(-1px); }
.sub-inline-confirm.approve { background: linear-gradient(135deg, var(--accent2), #00a884); }
.sub-inline-confirm.reject  { background: linear-gradient(135deg, var(--red), #c0392b); }

@media (max-width: 500px) {
  .sub-inline-actions { justify-content: stretch; }
  .sub-inline-cancel, .sub-inline-confirm { flex: 1; justify-content: center; }
}

/* ══════════════════════════════════════════════════════════
   ONGLET ABONNEMENT UTILISATEUR
══════════════════════════════════════════════════════════ */

/* En-tête */
.sub-user-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.2rem;
  flex-wrap: wrap;
}
.sub-user-header h2 {
  font-size: 1.3rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
}

/* Plan actuel */
.sub-current-plan { margin-bottom: 1.5rem; }
.sub-current-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.2rem 1.4rem;
  flex-wrap: wrap;
}
.sub-current-icon {
  width: 52px; height: 52px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}
.sub-current-info { flex: 1; min-width: 0; }
.sub-current-label { font-size: 0.75rem; color: var(--text2); font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.2rem; }
.sub-current-name  { font-size: 1.3rem; font-weight: 800; line-height: 1.2; }
.sub-current-desc  { font-size: 0.82rem; color: var(--text2); margin-top: 0.2rem; }

/* État vide */
.sub-user-empty {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text2);
}
.sub-user-empty i { font-size: 2.5rem; display: block; margin-bottom: 0.8rem; opacity: 0.3; }
.sub-user-empty p { font-size: 0.9rem; }

/* Carte demande utilisateur */
.sub-user-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 16px;
  margin-bottom: 1rem;
  overflow: hidden;
  transition: box-shadow 0.2s;
}
.sub-user-card:hover { box-shadow: 0 4px 20px rgba(0,0,0,0.15); }
.sub-user-approved { border-left: 3px solid var(--green); }
.sub-user-rejected { border-left: 3px solid var(--red); }
.sub-user-pending  { border-left: 3px solid var(--gold); }

/* En-tête carte */
.sub-user-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.2rem 0.8rem;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* Détails paiement */
.sub-user-details {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  padding: 0.8rem 1.2rem;
  border-bottom: 1px solid var(--border);
}
.sub-user-detail {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.3rem 1.2rem 0.3rem 0;
  min-width: 130px;
  flex: 1;
}
.sub-user-detail i { font-size: 1rem; flex-shrink: 0; width: 18px; text-align: center; }
.sub-user-detail span { display: flex; flex-direction: column; gap: 0.05rem; }
.sub-user-detail strong { font-size: 0.88rem; font-weight: 700; }
.sub-user-detail small  { font-size: 0.72rem; color: var(--text2); }

/* Message de statut */
.sub-user-status-msg {
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
  padding: 0.9rem 1.2rem;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.sub-user-status-msg > i { font-size: 1.2rem; flex-shrink: 0; margin-top: 0.1rem; }
.sub-user-status-msg > div { flex: 1; min-width: 0; }
.sub-user-status-msg strong { display: block; font-size: 0.92rem; font-weight: 700; margin-bottom: 0.2rem; }
.sub-user-status-msg p { font-size: 0.83rem; color: var(--text2); margin: 0; line-height: 1.5; }

.sub-user-status-msg.approved {
  background: rgba(0,212,170,0.06);
  border-bottom-color: rgba(0,212,170,0.15);
}
.sub-user-status-msg.approved > i { color: var(--green); }
.sub-user-status-msg.approved strong { color: var(--green); }

.sub-user-status-msg.rejected {
  background: rgba(255,77,109,0.05);
  border-bottom-color: rgba(255,77,109,0.15);
}
.sub-user-status-msg.rejected > i { color: var(--red); }
.sub-user-status-msg.rejected strong { color: var(--red); }

.sub-user-status-msg.pending {
  background: rgba(245,158,11,0.05);
  border-bottom-color: rgba(245,158,11,0.15);
}
.sub-user-status-msg.pending > i { color: var(--gold); }
.sub-user-status-msg.pending strong { color: var(--gold); }

/* Zone actions */
.sub-user-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 0.8rem 1.2rem;
  flex-wrap: wrap;
  background: rgba(0,0,0,0.06);
}

/* Bouton relancer */
.sub-retry-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  border: none;
  color: #fff;
  padding: 0.55rem 1.3rem;
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.88rem;
  font-family: inherit;
  font-weight: 700;
  transition: opacity 0.2s, transform 0.15s;
  white-space: nowrap;
}
.sub-retry-btn:hover { opacity: 0.88; transform: translateY(-1px); }

@media (max-width: 500px) {
  .sub-user-actions { flex-direction: column; align-items: stretch; }
  .sub-retry-btn { justify-content: center; }
  .sub-user-status-msg { flex-direction: column; }
  .sub-user-status-msg > a { width: 100%; justify-content: center; }
}

/* ══════════════════════════════════════════════════════════
   HIGHLIGHT TRANSACTION — notification abonnement
══════════════════════════════════════════════════════════ */

/* Animation commune admin + utilisateur */
@keyframes subHighlight {
  0%   { box-shadow: 0 0 0 3px rgba(108,99,255,0.7), 0 0 24px rgba(108,99,255,0.35); border-color: var(--accent); }
  25%  { box-shadow: 0 0 0 5px rgba(0,212,170,0.5),  0 0 32px rgba(0,212,170,0.3);  border-color: var(--accent2); }
  50%  { box-shadow: 0 0 0 3px rgba(108,99,255,0.6), 0 0 20px rgba(108,99,255,0.25); border-color: var(--accent); }
  75%  { box-shadow: 0 0 0 4px rgba(0,212,170,0.4),  0 0 28px rgba(0,212,170,0.2);  border-color: var(--accent2); }
  100% { box-shadow: none; border-color: var(--border); }
}

.sub-highlight {
  animation: subHighlight 3.5s ease forwards !important;
  position: relative;
  z-index: 1;
}

/* Trait coloré à gauche pendant le highlight */
.sub-highlight::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, var(--accent), var(--accent2));
  border-radius: 4px 0 0 4px;
  animation: subHighlight 3.5s ease forwards;
}

/* ══════════════════════════════════════════════════════════
   ADMIN — Gestion des Tarifs
══════════════════════════════════════════════════════════ */
.pricing-admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}
.pricing-admin-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}
.pricing-admin-card-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.92rem;
  font-weight: 700;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--border);
}
.pricing-admin-row {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.pricing-admin-row label {
  font-size: 0.78rem;
  color: var(--text2);
  font-weight: 600;
}
.pricing-admin-row label small {
  font-weight: 400;
  opacity: 0.7;
}
.pricing-admin-row .upgrade-input {
  padding: 0.5rem 0.8rem;
  font-size: 0.9rem;
}

/* ══════════════════════════════════════════════════════════
   ACHAT VIDÉO À L'UNITÉ
══════════════════════════════════════════════════════════ */

/* Badge prix unitaire sur les cartes formations */
.course-unit-price-tag {
  position: absolute;
  bottom: 10px; left: 10px;
  background: rgba(0,212,170,0.9);
  backdrop-filter: blur(4px);
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  color: #fff;
  z-index: 3;
  display: flex; align-items: center; gap: 0.3rem;
}
.course-unit-price-badge {
  background: rgba(0,212,170,0.12);
  color: var(--accent2);
  padding: 0.18rem 0.55rem;
  border-radius: 5px;
  font-size: 0.68rem;
  font-weight: 600;
  display: inline-flex; align-items: center; gap: 0.3rem;
}

/* Modale achat vidéo */
.buy-video-modal {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 24px;
  width: 100%;
  max-width: 620px;
  max-height: 90vh;
  overflow-y: auto;
  animation: fadeIn 0.2s ease;
  position: relative;
}
.buy-video-header {
  text-align: center;
  padding: 2rem 2rem 1.2rem;
  border-bottom: 1px solid var(--border);
  position: relative;
}
.buy-video-icon { font-size: 2.5rem; margin-bottom: 0.5rem; }
.buy-video-header h2 { font-size: 1.15rem; font-weight: 800; margin-bottom: 0.4rem; }
.buy-video-desc { color: var(--text2); font-size: 0.88rem; line-height: 1.5; margin-bottom: 0.8rem; }
.buy-video-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.2rem;
  font-size: 0.82rem;
  color: var(--text2);
  flex-wrap: wrap;
}
.buy-video-meta span { display: flex; align-items: center; gap: 0.35rem; }
.buy-video-meta i { color: var(--accent); font-size: 0.78rem; }

/* Options d'achat */
.buy-video-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  padding: 1.5rem;
}
@media (max-width: 480px) { .buy-video-options { grid-template-columns: 1fr; } }

.buy-video-option {
  background: var(--bg2);
  border: 2px solid var(--border);
  border-radius: 16px;
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  position: relative;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.buy-video-option:hover { border-color: var(--accent); }
.buy-video-option.featured {
  border-color: var(--accent);
  box-shadow: 0 4px 20px rgba(108,99,255,0.15);
}
.buy-option-popular {
  position: absolute;
  top: -11px; left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.8rem;
  border-radius: 50px;
  white-space: nowrap;
}
.buy-option-header { display: flex; flex-direction: column; gap: 0.3rem; }
.buy-option-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.6rem;
  border-radius: 50px;
  font-size: 0.7rem;
  font-weight: 700;
  width: fit-content;
}
.buy-option-badge.unit { background: rgba(0,212,170,0.15); color: var(--accent2); }
.buy-option-badge.pro  { background: rgba(108,99,255,0.15); color: var(--accent); }
.buy-option-price {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text);
}
.buy-option-price span  { font-size: 0.8rem; color: var(--accent2); }
.buy-option-price small { font-size: 0.75rem; color: var(--text2); font-weight: 400; }
.buy-option-header p { font-size: 0.8rem; color: var(--text2); margin: 0; line-height: 1.4; }

.buy-option-features {
  list-style: none;
  padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 0.35rem;
}
.buy-option-features li {
  font-size: 0.8rem;
  color: var(--text2);
  display: flex; align-items: center; gap: 0.4rem;
}
.buy-option-features li i.fa-check { color: var(--accent2); font-size: 0.7rem; flex-shrink: 0; }
.buy-option-features li i.fa-times  { color: var(--red); font-size: 0.7rem; flex-shrink: 0; }
.buy-option-features li.muted { opacity: 0.5; }

.buy-option-btn {
  border: none;
  color: #fff;
  padding: 0.6rem 1rem;
  border-radius: 10px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  display: flex; align-items: center; justify-content: center; gap: 0.5rem;
  transition: opacity 0.2s, transform 0.15s;
  margin-top: auto;
}
.buy-option-btn:hover { opacity: 0.9; transform: translateY(-1px); }
.buy-option-btn.unit { background: linear-gradient(135deg, var(--accent2), #00a884); }
.buy-option-btn.pro  { background: linear-gradient(135deg, var(--accent), #8b5cf6); }

/* Cartes vidéo unitaires sur plans.html */
.unit-video-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.unit-video-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: 0 8px 24px rgba(108,99,255,0.12);
}
.unit-video-card.owned { border-color: rgba(0,212,170,0.4); }
.unit-video-thumb {
  position: relative;
  height: 130px;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.unit-video-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  position: absolute; inset: 0;
}
.unit-owned-badge {
  position: absolute;
  top: 8px; right: 8px;
  background: rgba(0,212,170,0.9);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  display: flex; align-items: center; gap: 0.3rem;
}
.unit-video-info { padding: 1rem 1.1rem 1.2rem; }
.unit-buy-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: linear-gradient(135deg, rgba(0,212,170,0.15), rgba(0,212,170,0.08));
  border: 1.5px solid rgba(0,212,170,0.4);
  color: var(--accent2);
  padding: 0.6rem 0.9rem;
  border-radius: 10px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
  gap: 0.5rem;
}
.unit-buy-btn:hover {
  background: rgba(0,212,170,0.22);
  border-color: var(--accent2);
  transform: translateY(-1px);
}
.unit-buy-btn strong { margin-left: auto; font-size: 0.9rem; }

/* Bouton voir plus / voir moins videos unitaires */
.unit-videos-showmore {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin: 1.4rem auto 0;
  padding: 0.65rem 2rem;
  background: transparent;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  color: var(--text2);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}
.unit-videos-showmore:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(108,99,255,0.06);
}
.unit-videos-showmore i { transition: transform 0.25s; }
.unit-videos-showmore.open i { transform: rotate(180deg); }

/* ══════════════════════════════════════════════════════════
   ADMIN — Onglets Tarifs
══════════════════════════════════════════════════════════ */
.pricing-tabs {
  display: flex;
  gap: 0.3rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.pricing-tab {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text2);
  padding: 0.55rem 1.1rem;
  cursor: pointer;
  font-size: 0.88rem;
  font-family: inherit;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: color 0.2s, border-color 0.2s;
  margin-bottom: -1px;
  white-space: nowrap;
}
.pricing-tab:hover { color: var(--text); }
.pricing-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: 700;
}
.pricing-tab-content { animation: fadeIn 0.2s ease; }

/* ── Prix par vidéo ─────────────────────────────────────── */
.pricing-video-header {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.2rem;
  margin-bottom: 1.5rem;
}
.pricing-video-global { display: flex; flex-direction: column; gap: 0.3rem; }

.video-price-list {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}
.video-price-header,
.video-price-row {
  display: grid;
  grid-template-columns: 2.5fr 1fr 1.2fr 1.4fr 0.4fr;
  padding: 0.75rem 1.2rem;
  gap: 0.8rem;
  align-items: center;
  font-size: 0.85rem;
}
.video-price-header {
  background: var(--bg2);
  font-weight: 600;
  font-size: 0.78rem;
  color: var(--text2);
}
.video-price-row {
  border-top: 1px solid var(--border);
  transition: background 0.15s;
}
.video-price-row:hover { background: rgba(108,99,255,0.04); }
.video-price-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 768px) {
  .video-price-header,
  .video-price-row { grid-template-columns: 2fr 1fr 1.2fr 0.4fr; }
  .video-price-header span:nth-child(3),
  .video-price-row  span:nth-child(3) { display: none; }
}

/* ── Prix par module ────────────────────────────────────── */
.module-pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}
.module-price-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  transition: border-color 0.2s;
}
.module-price-card:hover { border-color: rgba(108,99,255,0.3); }
.module-price-header {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding-bottom: 0.7rem;
  border-bottom: 1px solid var(--border);
}
.module-price-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}
.module-price-header strong { display: block; font-size: 0.92rem; font-weight: 700; }
.module-price-header span   { font-size: 0.75rem; color: var(--text2); }
.module-price-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: var(--text2);
  background: var(--bg2);
  padding: 0.4rem 0.7rem;
  border-radius: 8px;
}
.module-price-row {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.module-price-row label {
  font-size: 0.78rem;
  color: var(--text2);
  font-weight: 600;
}
.module-price-row label small { font-weight: 400; opacity: 0.7; }

/* ── Commissions ────────────────────────────────────────── */
.comm-pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 1.2rem;
}
.comm-pricing-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}
.comm-pricing-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.92rem;
  font-weight: 700;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--border);
}
.comm-pricing-row {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.comm-pricing-row label {
  font-size: 0.78rem;
  color: var(--text2);
  font-weight: 600;
}
.comm-pricing-row label small { font-weight: 400; opacity: 0.7; }
.comm-input-wrap {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.comm-input-wrap .upgrade-input { padding: 0.4rem 0.7rem; }
.comm-pct-badge {
  background: rgba(108,99,255,0.12);
  color: var(--accent);
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 700;
  flex-shrink: 0;
}
.comm-pricing-example {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  color: var(--text2);
  background: var(--bg2);
  padding: 0.4rem 0.7rem;
  border-radius: 8px;
  margin-top: auto;
}
.comm-pricing-withdraw {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.2rem;
  margin-bottom: 1rem;
}

/* ── Badge accès achat unitaire ─────────────────────────── */
.access-toggle-btn.unit {
  background: rgba(0,212,170,0.12);
  color: var(--accent2);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}
.access-toggle-btn.unit small {
  font-size: 0.68rem;
  font-weight: 600;
  opacity: 0.85;
}
.access-toggle-btn.unit:hover { opacity: 0.8; transform: scale(1.04); }

/* ── Menu contextuel changement d'accès vidéo ──────────── */
.access-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  z-index: 100;
  min-width: 200px;
  overflow: hidden;
  animation: fadeIn 0.12s ease;
}
.access-menu button {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  background: transparent;
  border: none;
  color: var(--text);
  padding: 0.6rem 1rem;
  font-size: 0.82rem;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s;
}
.access-menu button:hover { background: rgba(108,99,255,0.1); }
.access-menu button + button { border-top: 1px solid var(--border); }

/* Position relative sur la cellule accès */
.video-admin-row span:nth-child(4) { position: relative; }

/* ── Badge acc\u00e8s Abonnement Pro+ dans le modal vid\u00e9o ──── */
.access-option input:checked + .access-btn.paid {
  border-color: var(--gold);
  color: var(--gold);
  background: rgba(245,158,11,0.1);
}
.access-option input:checked + .access-btn[style*="gold"] {
  box-shadow: 0 0 0 2px rgba(245,158,11,0.3);
}

/* ── Badge prix unitaire sur les cartes (dashboard) ─────── */
.course-lock[style*="accent2"] {
  background: rgba(0,212,170,0.15);
  backdrop-filter: blur(4px);
  font-weight: 700;
}

/* ═══════════════════════════════════════════════════════════════
   VALIDATION ACHAT VIDÉO — DESIGN DYNAMIQUE ADMIN
   ═══════════════════════════════════════════════════════════════ */

/* Animations keyframes */
@keyframes vp-slide-in {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes vp-pulse-gold {
  0%, 100% { box-shadow: 0 0 0 0 rgba(245,158,11,0); }
  50%       { box-shadow: 0 0 0 6px rgba(245,158,11,0.18); }
}
@keyframes vp-approve-flash {
  0%   { background: rgba(0,212,170,0.25); }
  100% { background: transparent; }
}
@keyframes vp-reject-flash {
  0%   { background: rgba(255,77,109,0.2); }
  100% { background: transparent; }
}
@keyframes vp-spin {
  to { transform: rotate(360deg); }
}
@keyframes vp-badge-pop {
  0%   { transform: scale(0.5); opacity: 0; }
  70%  { transform: scale(1.2); }
  100% { transform: scale(1);   opacity: 1; }
}
@keyframes vp-shimmer {
  0%   { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}
@keyframes vp-check-draw {
  from { stroke-dashoffset: 60; }
  to   { stroke-dashoffset: 0; }
}

/* ── Carte principale ── */
.vp-card {
  background: var(--bg3);
  border: 1.5px solid var(--border);
  border-radius: 18px;
  margin-bottom: 1.1rem;
  overflow: hidden;
  transition: border-color 0.25s, box-shadow 0.25s, transform 0.2s;
  animation: vp-slide-in 0.3s ease both;
}
.vp-card:hover {
  border-color: rgba(108,99,255,0.35);
  box-shadow: 0 6px 28px rgba(0,0,0,0.18);
  transform: translateY(-1px);
}

/* États de la carte */
.vp-card.vp-pending {
  border-left: 4px solid var(--gold);
  animation: vp-slide-in 0.3s ease both, vp-pulse-gold 2.5s ease-in-out infinite;
}
.vp-card.vp-approved {
  border-left: 4px solid var(--accent2);
  animation: vp-slide-in 0.3s ease both;
}
.vp-card.vp-rejected {
  border-left: 4px solid var(--red);
  animation: vp-slide-in 0.3s ease both;
  opacity: 0.85;
}

/* Flash après action */
.vp-card.vp-just-approved { animation: vp-approve-flash 0.8s ease forwards; }
.vp-card.vp-just-rejected  { animation: vp-reject-flash  0.8s ease forwards; }

/* ── En-tête de la carte ── */
.vp-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.2rem 0.85rem;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 0.7rem;
}
.vp-card-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.vp-card-user strong { display: block; font-size: 0.95rem; font-weight: 700; }
.vp-card-user small  { font-size: 0.73rem; color: var(--text2); }

.vp-card-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* Badge "Nouveau" animé */
.vp-new-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: linear-gradient(135deg, var(--gold), #f59e0b);
  color: #000;
  font-size: 0.62rem;
  font-weight: 800;
  padding: 0.2rem 0.55rem;
  border-radius: 50px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  animation: vp-badge-pop 0.4s cubic-bezier(0.34,1.56,0.64,1) both;
}
.vp-new-badge::before {
  content: '';
  width: 6px; height: 6px;
  background: #000;
  border-radius: 50%;
  animation: vp-pulse-gold 1s ease-in-out infinite;
}

/* Horodatage relatif */
.vp-time-ago {
  font-size: 0.73rem;
  color: var(--text2);
  display: flex;
  align-items: center;
  gap: 0.3rem;
  white-space: nowrap;
}
.vp-time-ago.vp-urgent { color: var(--gold); font-weight: 600; }

/* ── Détails ── */
.vp-card-details {
  display: flex;
  flex-wrap: wrap;
  padding: 0.75rem 1.2rem;
  gap: 0;
  border-bottom: 1px solid var(--border);
}
.vp-detail-item {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.35rem 1.2rem 0.35rem 0;
  min-width: 130px;
  flex: 1;
}
.vp-detail-item i { font-size: 0.95rem; flex-shrink: 0; width: 18px; text-align: center; }
.vp-detail-item span { display: flex; flex-direction: column; gap: 0.03rem; }
.vp-detail-item strong { font-size: 0.88rem; font-weight: 700; }
.vp-detail-item small  { font-size: 0.7rem; color: var(--text2); }

/* Montant mis en valeur */
.vp-amount-highlight {
  font-size: 1.05rem !important;
  font-weight: 800 !important;
  color: var(--accent2) !important;
  letter-spacing: 0.02em;
}

/* ── Zone preuve ── */
.vp-proof-zone {
  padding: 0.65rem 1.2rem;
  border-bottom: 1px solid var(--border);
  background: rgba(0,0,0,0.04);
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
}
.vp-proof-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(0,212,170,0.1);
  border: 1px solid rgba(0,212,170,0.3);
  color: var(--accent2);
  padding: 0.38rem 0.95rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.82rem;
  font-family: inherit;
  font-weight: 600;
  transition: background 0.2s, transform 0.15s;
}
.vp-proof-btn:hover { background: rgba(0,212,170,0.2); transform: translateY(-1px); }

/* Miniature preuve inline */
.vp-proof-thumb {
  width: 44px; height: 44px;
  border-radius: 8px;
  object-fit: cover;
  border: 2px solid rgba(0,212,170,0.3);
  cursor: pointer;
  transition: transform 0.2s, border-color 0.2s;
  flex-shrink: 0;
}
.vp-proof-thumb:hover { transform: scale(1.08); border-color: var(--accent2); }

/* ── Proof modal ── */
.proof-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(8,12,20,0.65);
  backdrop-filter: blur(6px);
  animation: proofFadeIn 0.18s ease;
}
.proof-modal {
  background: linear-gradient(180deg, rgba(18,24,40,0.98), var(--bg3));
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 24px 70px rgba(0,0,0,0.5);
  animation: proofPop 0.22s ease;
}
.proof-modal-header {
  background: linear-gradient(90deg, rgba(0,212,170,0.15), rgba(108,99,255,0.10));
}
.proof-modal-body {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}
.proof-modal-info {
  font-size: 0.82rem;
  color: var(--text2);
  background: rgba(0,0,0,0.18);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.6rem 0.8rem;
}
.proof-modal-image-wrap {
  background: rgba(0,0,0,0.25);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.6rem;
}
.proof-modal-img {
  width: 100%;
  max-height: 65vh;
  object-fit: contain;
  border-radius: 10px;
  background: #0b0f1b;
  display: block;
  transition: transform 0.2s ease;
}
.proof-modal-img:hover { transform: scale(1.01); }
.proof-modal-actions {
  display: flex;
  justify-content: flex-end;
}
.proof-modal-download {
  background: rgba(0,0,0,0.1);
  border-color: rgba(0,212,170,0.35);
}
.proof-modal-download:hover { border-color: var(--accent2); }

@keyframes proofFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes proofPop {
  from { transform: translateY(6px) scale(0.98); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

/* ── Zone actions ── */
.vp-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.6rem;
  padding: 0.85rem 1.2rem;
  flex-wrap: wrap;
  background: rgba(0,0,0,0.03);
}

/* Bouton Approuver */
.vp-btn-approve {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: linear-gradient(135deg, #00d4aa, #00a884);
  border: none;
  color: #fff;
  padding: 0.6rem 1.4rem;
  border-radius: 11px;
  cursor: pointer;
  font-size: 0.88rem;
  font-family: inherit;
  font-weight: 700;
  transition: opacity 0.2s, transform 0.15s, box-shadow 0.2s;
  box-shadow: 0 3px 12px rgba(0,212,170,0.3);
  position: relative;
  overflow: hidden;
}
.vp-btn-approve::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
  transform: translateX(-100%);
  transition: transform 0.4s;
}
.vp-btn-approve:hover::after { transform: translateX(100%); }
.vp-btn-approve:hover { opacity: 0.92; transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,212,170,0.4); }
.vp-btn-approve:active { transform: translateY(0); }

/* Bouton Rejeter */
.vp-btn-reject {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(255,77,109,0.1);
  border: 1.5px solid rgba(255,77,109,0.35);
  color: var(--red);
  padding: 0.6rem 1.1rem;
  border-radius: 11px;
  cursor: pointer;
  font-size: 0.88rem;
  font-family: inherit;
  font-weight: 600;
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
}
.vp-btn-reject:hover {
  background: rgba(255,77,109,0.18);
  border-color: var(--red);
  transform: translateY(-1px);
}

/* État loading des boutons */
.vp-btn-approve.vp-loading,
.vp-btn-reject.vp-loading {
  pointer-events: none;
  opacity: 0.7;
}
.vp-btn-approve.vp-loading i,
.vp-btn-reject.vp-loading i {
  animation: vp-spin 0.7s linear infinite;
}

/* Boutons secondaires (annuler approbation, etc.) */
.vp-btn-sm-approve {
  display: inline-flex; align-items: center; gap: 0.35rem;
  background: rgba(0,212,170,0.1); border: 1px solid rgba(0,212,170,0.3);
  color: var(--accent2); padding: 0.35rem 0.85rem; border-radius: 8px;
  cursor: pointer; font-size: 0.78rem; font-family: inherit; font-weight: 600;
  transition: background 0.2s;
}
.vp-btn-sm-approve:hover { background: rgba(0,212,170,0.2); }

.vp-btn-sm-reject {
  display: inline-flex; align-items: center; gap: 0.35rem;
  background: rgba(255,77,109,0.08); border: 1px solid rgba(255,77,109,0.25);
  color: var(--red); padding: 0.35rem 0.85rem; border-radius: 8px;
  cursor: pointer; font-size: 0.78rem; font-family: inherit; font-weight: 600;
  transition: background 0.2s;
}
.vp-btn-sm-reject:hover { background: rgba(255,77,109,0.16); }

/* ── Statut résultat (après action) ── */
.vp-status-done {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
  color: var(--text2);
}
.vp-status-done.approved { color: var(--accent2); }
.vp-status-done.rejected { color: var(--red); }

/* ── Modale de rejet inline ── */
.vp-reject-modal {
  padding: 1rem 1.2rem;
  background: rgba(255,77,109,0.06);
  border-top: 1px solid rgba(255,77,109,0.2);
  animation: vp-slide-in 0.2s ease both;
}
.vp-reject-modal-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.8rem;
}
.vp-reject-modal-header i { color: var(--red); font-size: 1rem; }
.vp-reject-modal-header strong { font-size: 0.9rem; font-weight: 700; color: var(--red); }
.vp-reject-presets {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-bottom: 0.6rem;
}
.vp-reject-preset {
  background: var(--bg2);
  border: 1px solid var(--border);
  color: var(--text2);
  padding: 0.28rem 0.7rem;
  border-radius: 50px;
  font-size: 0.74rem;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
  white-space: nowrap;
}
.vp-reject-preset:hover,
.vp-reject-preset.selected {
  border-color: var(--red);
  color: var(--red);
  background: rgba(255,77,109,0.08);
}
.vp-reject-input {
  width: 100%;
  background: var(--bg2);
  border: 1.5px solid rgba(255,77,109,0.3);
  border-radius: 9px;
  padding: 0.5rem 0.8rem;
  color: var(--text);
  font-size: 0.85rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
  box-sizing: border-box;
  margin-bottom: 0.7rem;
}
.vp-reject-input:focus { border-color: var(--red); }
.vp-reject-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}
.vp-reject-cancel {
  display: inline-flex; align-items: center; gap: 0.35rem;
  background: transparent; border: 1px solid var(--border);
  color: var(--text2); padding: 0.45rem 1rem; border-radius: 9px;
  cursor: pointer; font-size: 0.83rem; font-family: inherit;
  transition: border-color 0.2s, color 0.2s;
}
.vp-reject-cancel:hover { border-color: var(--accent); color: var(--accent); }
.vp-reject-confirm {
  display: inline-flex; align-items: center; gap: 0.4rem;
  background: linear-gradient(135deg, var(--red), #c0392b);
  border: none; color: #fff; padding: 0.45rem 1.1rem; border-radius: 9px;
  cursor: pointer; font-size: 0.85rem; font-family: inherit; font-weight: 700;
  transition: opacity 0.2s, transform 0.15s;
  box-shadow: 0 3px 10px rgba(255,77,109,0.3);
}
.vp-reject-confirm:hover { opacity: 0.9; transform: translateY(-1px); }

/* ── Compteur en-tête section ── */
.vp-section-counter {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.vp-counter-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.85rem;
  border-radius: 50px;
  font-size: 0.78rem;
  font-weight: 700;
  border: 1.5px solid;
}
.vp-counter-pill.pending  { background: rgba(245,158,11,0.12); color: var(--gold);    border-color: rgba(245,158,11,0.3); }
.vp-counter-pill.approved { background: rgba(0,212,170,0.1);   color: var(--accent2); border-color: rgba(0,212,170,0.25); }
.vp-counter-pill.rejected { background: rgba(255,77,109,0.1);  color: var(--red);     border-color: rgba(255,77,109,0.25); }

/* ── Skeleton loader ── */
.vp-skeleton {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 1.2rem;
  margin-bottom: 1rem;
  overflow: hidden;
}
.vp-skeleton-line {
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--bg2) 25%, rgba(255,255,255,0.06) 50%, var(--bg2) 75%);
  background-size: 400px 100%;
  animation: vp-shimmer 1.4s ease-in-out infinite;
  margin-bottom: 0.6rem;
}

/* ── Toast notification ── */
.vp-toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.75rem 1.2rem;
  border-radius: 12px;
  font-size: 0.88rem;
  font-weight: 600;
  box-shadow: 0 8px 32px rgba(0,0,0,0.35);
  animation: vp-slide-in 0.3s ease both;
  max-width: 320px;
  pointer-events: none;
}
.vp-toast.success { background: linear-gradient(135deg, #00d4aa, #00a884); color: #fff; }
.vp-toast.error   { background: linear-gradient(135deg, var(--red), #c0392b); color: #fff; }
.vp-toast.fade-out { opacity: 0; transform: translateY(8px); transition: opacity 0.4s, transform 0.4s; }

@media (max-width: 600px) {
  .vp-actions { justify-content: stretch; }
  .vp-btn-approve, .vp-btn-reject { flex: 1; justify-content: center; }
  .vp-card-details { gap: 0; }
  .vp-detail-item { min-width: 100px; }
  .vp-toast { left: 1rem; right: 1rem; bottom: 1rem; }
}


/* ===== MODALE CONFIRMATION ACHAT VIDÉO ===== */
@keyframes vp-confirm-in {
  from { opacity:0; transform:scale(0.85) translateY(20px); }
  to   { opacity:1; transform:scale(1)    translateY(0); }
}
@keyframes vp-confirm-icon-pop {
  0%   { transform:scale(0) rotate(-15deg); }
  60%  { transform:scale(1.2) rotate(5deg); }
  100% { transform:scale(1) rotate(0); }
}
@keyframes vp-confirm-shake {
  0%,100% { transform:translateX(0); }
  20%     { transform:translateX(-6px); }
  40%     { transform:translateX(6px); }
  60%     { transform:translateX(-4px); }
  80%     { transform:translateX(4px); }
}

#vpConfirmModal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 4000;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
#vpConfirmModal.vp-confirm-open {
  display: flex;
}

.vp-confirm-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.72);
  backdrop-filter: blur(4px);
}

.vp-confirm-box {
  position: relative;
  background: var(--bg2);
  border-radius: 20px;
  padding: 2rem 1.8rem 1.6rem;
  max-width: 380px;
  width: 100%;
  text-align: center;
  box-shadow: 0 24px 60px rgba(0,0,0,0.5);
  animation: vp-confirm-in 0.3s cubic-bezier(0.34,1.56,0.64,1) forwards;
  border: 1px solid var(--border);
}
.vp-confirm-box.vp-confirm-approve { border-top: 3px solid #22c55e; }
.vp-confirm-box.vp-confirm-reject  { border-top: 3px solid var(--red); }

.vp-confirm-icon {
  font-size: 2.8rem;
  margin-bottom: 0.8rem;
  animation: vp-confirm-icon-pop 0.45s cubic-bezier(0.34,1.56,0.64,1) 0.1s both;
  display: block;
}

.vp-confirm-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0 0 0.4rem;
  color: var(--text);
}

.vp-confirm-subtitle {
  font-size: 0.82rem;
  color: var(--text2);
  margin: 0 0 1rem;
  line-height: 1.5;
}

.vp-confirm-user {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.65rem 0.9rem;
  margin-bottom: 1.4rem;
  text-align: left;
}
.vp-confirm-user:empty { display: none; }
.vp-confirm-user-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.82rem; font-weight: 700; color: #fff;
  flex-shrink: 0;
}
.vp-confirm-user-info strong { display: block; font-size: 0.88rem; }
.vp-confirm-user-info small  { font-size: 0.75rem; color: var(--text2); }

.vp-confirm-btns {
  display: flex;
  gap: 0.7rem;
}

.vp-confirm-btn-cancel {
  flex: 1;
  padding: 0.7rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text2);
  font-size: 0.88rem;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.vp-confirm-btn-cancel:hover {
  background: var(--bg);
  color: var(--text);
}

.vp-confirm-btn-ok {
  flex: 2;
  padding: 0.7rem;
  border-radius: 10px;
  border: none;
  font-size: 0.88rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: filter 0.2s, transform 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}
.vp-confirm-btn-ok:hover  { filter: brightness(1.12); transform: translateY(-1px); }
.vp-confirm-btn-ok:active { transform: scale(0.97); }

.vp-confirm-box.vp-confirm-approve .vp-confirm-btn-ok {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: #fff;
  box-shadow: 0 4px 14px rgba(34,197,94,0.35);
}
.vp-confirm-box.vp-confirm-reject .vp-confirm-btn-ok {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff;
  box-shadow: 0 4px 14px rgba(239,68,68,0.35);
}

/* Ligne décorative sous l'icône */
.vp-confirm-box.vp-confirm-approve .vp-confirm-title { color: #22c55e; }
.vp-confirm-box.vp-confirm-reject  .vp-confirm-title { color: var(--red); }

/* ── POST IMAGE LAZY ─────────────────────────────── */
.post-image-wrap { margin: 0.8rem 0; border-radius: 10px; overflow: hidden; }
.post-image-lazy { display: block; width: 100%; border-radius: 10px; transition: opacity 0.3s; }
.post-image-lazy[src=""] { opacity: 0; }

/* -- MODULE BUY BANNER -- */
.module-buy-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: linear-gradient(135deg, rgba(0,212,170,0.08), rgba(108,99,255,0.08));
  border: 1.5px solid rgba(0,212,170,0.25);
  border-radius: 12px;
  padding: 0.8rem 1.2rem;
  margin-bottom: 1.2rem;
  flex-wrap: wrap;
}

/* ── Mur de connexion affiliation ───────────────────────── */
.aff-login-wall {
  text-align: center;
  padding: 3.5rem 2rem;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 20px;
  margin: 2rem 0;
}
.aff-login-wall-icon {
  font-size: 3rem;
  color: var(--accent);
  margin-bottom: 1rem;
  opacity: 0.7;
}
.aff-login-wall h2 {
  font-size: 1.4rem;
  font-weight: 800;
  margin-bottom: 0.6rem;
}
.aff-login-wall > p {
  color: var(--text2);
  font-size: 0.92rem;
  line-height: 1.6;
  max-width: 420px;
  margin: 0 auto 1.8rem;
}
.aff-login-wall-btns {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* ══════════════════════════════════════════════════════════
   MESSAGERIE PRIVÉE
══════════════════════════════════════════════════════════ */

/* Conteneur principal */
.msg-layout {
  display: flex;
  height: 520px;
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
  background: var(--bg3);
  box-shadow: 0 4px 24px rgba(0,0,0,0.18);
}

/* ── Colonne conversations ── */
.msg-conv-col {
  width: 280px;
  min-width: 240px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border);
  background: var(--bg2);
}
.msg-conv-header {
  padding: 1rem 1rem 0.7rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.msg-conv-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.msg-conv-title i { color: var(--accent); font-size: 0.8rem; }
.msg-conv-list {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem;
}
.msg-conv-list::-webkit-scrollbar { width: 3px; }
.msg-conv-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* Item conversation */
.msg-conv-item {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.65rem 0.7rem;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.15s;
  position: relative;
  margin-bottom: 0.2rem;
}
.msg-conv-item:hover { background: rgba(108,99,255,0.08); }
.msg-conv-item.active {
  background: rgba(108,99,255,0.14);
  border: 1px solid rgba(108,99,255,0.2);
}
.msg-conv-avatar { position: relative; flex-shrink: 0; }
.msg-conv-avatar .avatar-circle,
.msg-conv-avatar img {
  width: 40px; height: 40px;
  border-radius: 50%;
  object-fit: cover;
  font-size: 0.82rem;
}
.msg-conv-unread-dot {
  position: absolute;
  top: -2px; right: -2px;
  background: var(--accent);
  color: #fff;
  border-radius: 50px;
  min-width: 16px; height: 16px;
  font-size: 0.58rem;
  font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  padding: 0 3px;
  border: 2px solid var(--bg2);
  animation: badgePop 0.3s ease;
}
.msg-conv-info { flex: 1; min-width: 0; }
.msg-conv-name {
  font-size: 0.88rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text);
}
.msg-conv-preview {
  font-size: 0.75rem;
  color: var(--text2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 0.1rem;
}
.msg-conv-item.active .msg-conv-name { color: var(--accent); }
.msg-conv-empty {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--text2);
  font-size: 0.82rem;
}
.msg-conv-empty i { font-size: 1.8rem; display: block; margin-bottom: 0.5rem; opacity: 0.3; }

/* ── Zone chat ── */
.msg-chat-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--bg3);
}

/* En-tête chat */
.msg-chat-header {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.85rem 1.2rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg2);
  flex-shrink: 0;
  min-height: 60px;
}
.msg-chat-header-avatar .avatar-circle,
.msg-chat-header-avatar img {
  width: 36px; height: 36px;
  border-radius: 50%;
  object-fit: cover;
  font-size: 0.75rem;
}
.msg-chat-header-info { flex: 1; min-width: 0; }
.msg-chat-header-name {
  font-size: 0.95rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.msg-chat-header-status {
  font-size: 0.72rem;
  color: var(--accent2);
  display: flex;
  align-items: center;
  gap: 0.3rem;
}
.msg-chat-header-status::before {
  content: '';
  width: 6px; height: 6px;
  background: var(--accent2);
  border-radius: 50%;
  display: inline-block;
}
.msg-chat-back-btn {
  display: none;
  background: transparent;
  border: none;
  color: var(--text2);
  cursor: pointer;
  font-size: 1rem;
  padding: 0.3rem;
  border-radius: 8px;
  transition: color 0.2s, background 0.2s;
}
.msg-chat-back-btn:hover { color: var(--accent); background: rgba(108,99,255,0.1); }

/* État vide (aucune conv sélectionnée) */
.msg-chat-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  color: var(--text2);
  text-align: center;
  padding: 2rem;
}
.msg-chat-empty i { font-size: 3rem; opacity: 0.2; }
.msg-chat-empty p { font-size: 0.88rem; }

/* Zone messages */
.msg-messages-wrap {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  scroll-behavior: smooth;
}
.msg-messages-wrap::-webkit-scrollbar { width: 3px; }
.msg-messages-wrap::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* Bulle de message */
.msg-bubble-row {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
  animation: postFadeIn 0.2s ease both;
}
.msg-bubble-row.mine { flex-direction: row-reverse; }

.msg-bubble {
  max-width: 68%;
  padding: 0.55rem 0.9rem;
  border-radius: 16px;
  font-size: 0.88rem;
  line-height: 1.5;
  word-break: break-word;
  position: relative;
}
.msg-bubble.theirs {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
  color: var(--text);
}
.msg-bubble.mine {
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  color: #fff;
  border-bottom-right-radius: 4px;
  box-shadow: 0 2px 10px rgba(108,99,255,0.3);
}
.msg-bubble-time {
  font-size: 0.65rem;
  opacity: 0.6;
  margin-top: 0.25rem;
  display: block;
  text-align: right;
}
.msg-bubble.theirs .msg-bubble-time { text-align: left; }

/* Avatar mini dans le chat */
.msg-bubble-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  flex-shrink: 0;
  font-size: 0.6rem;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  color: #fff;
  overflow: hidden;
}
.msg-bubble-avatar img { width: 100%; height: 100%; object-fit: cover; }
.msg-bubble-row.mine .msg-bubble-avatar { display: none; }

/* Groupe de messages consécutifs */
.msg-bubble-row + .msg-bubble-row.mine .msg-bubble.mine { border-bottom-right-radius: 16px; }
.msg-bubble-row + .msg-bubble-row:not(.mine) .msg-bubble.theirs { border-bottom-left-radius: 16px; }

/* Séparateur de date */
.msg-date-sep {
  text-align: center;
  font-size: 0.72rem;
  color: var(--text2);
  margin: 0.5rem 0;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.msg-date-sep::before,
.msg-date-sep::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* Zone de saisie */
.msg-input-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.8rem 1rem;
  border-top: 1px solid var(--border);
  background: var(--bg2);
  flex-shrink: 0;
}
.msg-input {
  flex: 1;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 50px;
  color: var(--text);
  padding: 0.6rem 1rem;
  font-size: 0.88rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.msg-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(108,99,255,0.12);
}
.msg-input::placeholder { color: var(--text2); opacity: 0.6; }
.msg-send-btn {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  border: none;
  color: #fff;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.9rem;
  flex-shrink: 0;
  transition: transform 0.15s, box-shadow 0.2s;
  box-shadow: 0 2px 10px rgba(108,99,255,0.3);
}
.msg-send-btn:hover { transform: scale(1.08); box-shadow: 0 4px 16px rgba(108,99,255,0.45); }
.msg-send-btn:active { transform: scale(0.95); }

/* Loader messages */
.msg-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 2rem;
  flex: 1;
}
.msg-loading span {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
  animation: feedDot 1.2s ease-in-out infinite;
  opacity: 0.4;
}
.msg-loading span:nth-child(2) { animation-delay: 0.2s; }
.msg-loading span:nth-child(3) { animation-delay: 0.4s; }

/* ── Page messages dédiée (messages.html) ── */
.msg-page-body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow-x: hidden;
}
.msg-page-body .footer { margin-top: auto; }

/* Layout plein écran */
.msg-page-layout {
  flex: 1;
  display: flex;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 1.5rem 5% 0;
  gap: 0;
  height: calc(100vh - 140px);
  min-height: 500px;
  overflow: hidden;
}

/* Sidebar conversations */
.msg-page-sidebar {
  width: 320px;
  min-width: 260px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-right: none;
  border-radius: 18px 0 0 18px;
  overflow: hidden;
}
.msg-page-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.2rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.msg-page-sidebar-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 1rem;
}
.msg-page-sidebar-title i { color: var(--accent); }
.msg-new-btn {
  width: 34px; height: 34px;
  border-radius: 10px;
  background: rgba(108,99,255,0.12);
  border: 1px solid rgba(108,99,255,0.25);
  color: var(--accent);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.9rem;
  transition: background 0.2s, transform 0.15s;
}
.msg-new-btn:hover { background: rgba(108,99,255,0.22); transform: scale(1.05); }
.msg-page-conv-list {
  flex: 1;
  overflow-y: auto;
  padding: 0.6rem;
}
.msg-page-conv-list::-webkit-scrollbar { width: 3px; }
.msg-page-conv-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* Zone chat principale */
.msg-page-chat {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 0 18px 18px 0;
  overflow: hidden;
  min-width: 0;
}

/* En-tête chat page dédiée */
.msg-page-chat-header {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 1rem 1.4rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg2);
  flex-shrink: 0;
}
.msg-profile-link {
  margin-left: auto;
  color: var(--text2);
  font-size: 1.2rem;
  transition: color 0.2s;
  flex-shrink: 0;
}
.msg-profile-link:hover { color: var(--accent); }

/* État vide page dédiée */
.msg-page-empty {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}
.msg-page-empty-inner {
  text-align: center;
  max-width: 340px;
}
.msg-page-empty-icon {
  width: 80px; height: 80px;
  border-radius: 50%;
  background: rgba(108,99,255,0.1);
  border: 2px solid rgba(108,99,255,0.2);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 1.2rem;
  font-size: 2rem;
  color: var(--accent);
  opacity: 0.7;
}
.msg-page-empty-inner h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: 0.5rem; }
.msg-page-empty-inner p { font-size: 0.88rem; color: var(--text2); line-height: 1.6; }

/* Zone de saisie page dédiée */
.msg-page-input-area {
  padding: 1rem 1.2rem;
  border-top: 1px solid var(--border);
  background: var(--bg2);
  flex-shrink: 0;
}
.msg-page-input-wrap {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 50px;
  padding: 0.4rem 0.4rem 0.4rem 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.msg-page-input-wrap:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(108,99,255,0.12);
}
.msg-page-input-wrap .msg-input {
  border: none;
  background: transparent;
  box-shadow: none;
  padding: 0.4rem 0;
}
.msg-page-input-wrap .msg-input:focus { box-shadow: none; }

/* Mur de connexion */
.msg-login-wall {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem;
}
.msg-login-card {
  text-align: center;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 3rem 2rem;
  max-width: 380px;
  width: 100%;
}
.msg-login-card i { font-size: 3rem; color: var(--accent); opacity: 0.6; margin-bottom: 1rem; display: block; }
.msg-login-card h2 { font-size: 1.3rem; font-weight: 800; margin-bottom: 0.5rem; }
.msg-login-card p { color: var(--text2); font-size: 0.9rem; margin-bottom: 1.5rem; }

/* Bouton messages dans la navbar */
.msg-nav-btn {
  position: relative;
  background: rgba(108,99,255,0.12);
  border: 1px solid rgba(108,99,255,0.25);
  color: var(--text2);
  width: 38px; height: 38px;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: background 0.2s, color 0.2s;
  flex-shrink: 0;
  text-decoration: none;
}
.msg-nav-btn:hover,
.msg-nav-btn.active { background: rgba(108,99,255,0.22); color: var(--accent); }

/* Responsive page messages */
@media (max-width: 768px) {
  .msg-page-layout {
    padding: 0.8rem 3% 0;
    height: calc(100vh - 120px);
  }
  .msg-page-sidebar { width: 260px; min-width: 220px; }
}
@media (max-width: 580px) {
  .msg-page-layout {
    padding: 0;
    height: calc(100vh - 70px);
    overflow: hidden;
  }
  .msg-page-sidebar {
    width: 100%;
    min-width: 0;
    border-radius: 0;
    border: none;
    position: relative;
    display: flex;
  }
  .msg-page-sidebar.msg-hidden {
    display: none;
  }
  .msg-page-chat {
    position: absolute;
    inset: 0;
    border-radius: 0;
    border: none;
    display: none;
    z-index: 10;
  }
  .msg-page-chat.msg-visible {
    display: flex;
  }
  .msg-chat-back-btn { display: flex !important; }
  .msg-page-body .footer { display: none; }
}

/* ── Responsive messagerie ── */
@media (max-width: 640px) {
  .msg-layout {
    height: calc(100vh - 200px);
    min-height: 420px;
    border-radius: 14px;
    overflow: hidden;
  }
  .msg-conv-col {
    width: 100%;
    min-width: 0;
    border-right: none;
    position: relative;
    display: flex;
  }
  .msg-conv-col.msg-hidden {
    display: none;
  }
  .msg-chat-col {
    position: absolute;
    inset: 0;
    display: none;
    z-index: 10;
  }
  .msg-chat-col.msg-visible {
    display: flex;
  }
  .msg-chat-back-btn { display: flex; }
  .msg-bubble { max-width: 82%; }
}

/* ══════════════════════════════════════════════════════════
   MESSAGERIE PAGE DÉDIÉE — Design dynamique (mpx-*)
   messages.html
══════════════════════════════════════════════════════════ */

/* Corps */
.msg-page-body { display: flex; flex-direction: column; min-height: 100vh; background: var(--bg); }
.msg-page-body .footer { margin-top: auto; }

/* App container */
.mpx-app {
  flex: 1;
  display: flex;
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
  padding: 1.5rem 5%;
  gap: 0;
  height: calc(100vh - 140px);
  min-height: 480px;
}

/* ── SIDEBAR ── */
.mpx-sidebar {
  width: 300px;
  min-width: 260px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-right: none;
  border-radius: 20px 0 0 20px;
  overflow: hidden;
  position: relative;
}
.mpx-sidebar::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 90px;
  background: linear-gradient(180deg, rgba(108,99,255,0.07) 0%, transparent 100%);
  pointer-events: none;
  z-index: 0;
}
.mpx-sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.2rem 1.2rem 0.8rem;
  position: relative;
  z-index: 1;
  flex-shrink: 0;
}
.mpx-sidebar-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.05rem;
  font-weight: 800;
}
.mpx-sidebar-title i { color: var(--accent); }
.mpx-compose-btn {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  border: none;
  color: #fff;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.88rem;
  transition: transform 0.15s, box-shadow 0.2s;
  box-shadow: 0 2px 10px rgba(108,99,255,0.3);
}
.mpx-compose-btn:hover { transform: scale(1.08); box-shadow: 0 4px 16px rgba(108,99,255,0.45); }

/* Recherche conversations */
.mpx-conv-search {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0.8rem 0.6rem;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.5rem 0.8rem;
  transition: border-color 0.2s;
  position: relative;
  z-index: 1;
  flex-shrink: 0;
}
.mpx-conv-search:focus-within { border-color: var(--accent); }
.mpx-conv-search i { color: var(--text2); font-size: 0.8rem; flex-shrink: 0; }
.mpx-conv-search input {
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 0.85rem;
  font-family: inherit;
  outline: none;
  width: 100%;
}
.mpx-conv-search input::placeholder { color: var(--text2); opacity: 0.6; }

/* Liste conversations */
.mpx-conv-list {
  flex: 1;
  overflow-y: auto;
  padding: 0.3rem 0.5rem 0.8rem;
  position: relative;
  z-index: 1;
}
.mpx-conv-list::-webkit-scrollbar { width: 3px; }
.mpx-conv-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* Item conversation */
.mpx-conv-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0.8rem;
  border-radius: 14px;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  position: relative;
  margin-bottom: 0.15rem;
}
.mpx-conv-item:hover { background: rgba(108,99,255,0.08); transform: translateX(2px); }
.mpx-conv-item.active {
  background: linear-gradient(135deg, rgba(108,99,255,0.15), rgba(139,92,246,0.1));
  border: 1px solid rgba(108,99,255,0.2);
}
.mpx-conv-item.active .mpx-conv-name { color: var(--accent); }

/* Avatar conversation */
.mpx-conv-av { position: relative; flex-shrink: 0; }
.mpx-conv-av--online::after { content: ""; position: absolute; bottom: 1px; right: 1px; width: 10px; height: 10px; background: var(--accent2); border-radius: 50%; border: 2px solid var(--bg2); }
.mpx-conv-av img,
.mpx-conv-av .avatar-circle {
  width: 44px; height: 44px;
  border-radius: 50%;
  object-fit: cover;
  font-size: 0.85rem;
}
.mpx-conv-unread {
  position: absolute;
  top: -2px; right: -2px;
  background: var(--accent);
  color: #fff;
  border-radius: 50px;
  min-width: 18px; height: 18px;
  font-size: 0.6rem;
  font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  padding: 0 3px;
  border: 2px solid var(--bg2);
  animation: badgePop 0.3s ease;
}

/* Infos conversation */
.mpx-conv-body { flex: 1; min-width: 0; }
.mpx-conv-name {
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text);
  margin-bottom: 0.15rem;
}
.mpx-conv-preview {
  font-size: 0.75rem;
  color: var(--text2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mpx-conv-time {
  font-size: 0.68rem;
  color: var(--text2);
  flex-shrink: 0;
  opacity: 0.7;
  align-self: flex-start;
  margin-top: 0.1rem;
}
.mpx-conv-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  flex-shrink: 0;
  gap: 0.2rem;
}
.mpx-conv-presence-slot {
  min-height: 0.9rem;
}
.mpx-pres-online {
  font-size: 0.65rem;
  color: var(--accent2);
  font-weight: 600;
  white-space: nowrap;
}
.mpx-pres-ago {
  font-size: 0.65rem;
  color: var(--text2);
  opacity: 0.75;
  white-space: nowrap;
}

/* État vide liste */
.mpx-conv-empty {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--text2);
}
.mpx-conv-empty i { font-size: 2rem; display: block; margin-bottom: 0.6rem; opacity: 0.25; }
.mpx-conv-empty p { font-size: 0.82rem; line-height: 1.5; }

/* ── ZONE CHAT ── */
.mpx-chat {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 0 20px 20px 0;
  overflow: hidden;
  min-width: 0;
  position: relative;
}

/* En-tête chat */
.mpx-chat-header {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 1rem 1.4rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg2);
  flex-shrink: 0;
  min-height: 64px;
}
.mpx-back-btn {
  display: flex;
  background: transparent;
  border: none;
  color: var(--text2);
  cursor: pointer;
  font-size: 1rem;
  padding: 0.3rem;
  border-radius: 8px;
  transition: color 0.2s, background 0.2s;
  flex-shrink: 0;
}
.mpx-back-btn:hover { color: var(--accent); background: rgba(108,99,255,0.1); }
.mpx-chat-avatar img,
.mpx-chat-avatar .avatar-circle {
  width: 40px; height: 40px;
  border-radius: 50%;
  object-fit: cover;
  font-size: 0.8rem;
  flex-shrink: 0;
}
.mpx-chat-avatar { position: relative; flex-shrink: 0; }
.mpx-chat-avatar-online::after { content: ""; position: absolute; bottom: 1px; right: 1px; width: 10px; height: 10px; background: var(--accent2); border-radius: 50%; border: 2px solid var(--bg2); }
.mpx-chat-info { flex: 1; min-width: 0; }
.mpx-chat-name {
  font-size: 0.98rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mpx-chat-sub {
  font-size: 0.72rem;
  color: var(--text2);
  display: flex;
  align-items: center;
  gap: 0.3rem;
  margin-top: 0.1rem;
}
.mpx-chat-sub--online {
  color: var(--accent2);
}
.mpx-chat-sub--online::before {
  content: '';
  width: 6px; height: 6px;
  background: var(--accent2);
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.mpx-profile-btn {
  color: var(--text2);
  font-size: 1.3rem;
  transition: color 0.2s;
  flex-shrink: 0;
  text-decoration: none;
}
.mpx-profile-btn:hover { color: var(--accent); }

/* Avatar + nom cliquables dans le header chat */
.mpx-chat-avatar[href],
a.mpx-chat-info {
  text-decoration: none;
  transition: opacity 0.2s;
  border-radius: 8px;
}
.mpx-chat-avatar[href]:hover { opacity: 0.8; }
a.mpx-chat-info:hover .mpx-chat-name { color: var(--accent); }

/* État vide chat */
.mpx-empty {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  text-align: center;
}
.mpx-empty-blob {
  width: 88px; height: 88px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(108,99,255,0.12), rgba(0,212,170,0.08));
  border: 2px solid rgba(108,99,255,0.18);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 1.2rem;
  font-size: 2.2rem;
  color: var(--accent);
  animation: glowPulse 3s ease-in-out infinite;
}
.mpx-empty h3 { font-size: 1.15rem; font-weight: 700; margin-bottom: 0.5rem; }
.mpx-empty p { font-size: 0.88rem; color: var(--text2); line-height: 1.6; max-width: 300px; margin: 0 auto; }
.mpx-empty-btn { margin-top: 1.2rem; padding: 0.6rem 1.4rem; font-size: 0.88rem; }

/* Zone messages */
.mpx-messages {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0.8rem 0.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  scroll-behavior: smooth;
}
.mpx-messages::-webkit-scrollbar { width: 3px; }
.mpx-messages::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* Bulle de message */
.mpx-bubble-row {
  display: flex;
  align-items: flex-end;
  gap: 0;
  position: relative;
  width: 100%;
}
.mpx-bubble-row.mpx-bubble-new {
  animation: postFadeIn 0.2s ease both;
}
.mpx-bubble-row.mine { flex-direction: row-reverse; }

.mpx-bubble {
  max-width: 78%;
  display: inline-block;

  padding: 0.6rem 1rem;
  border-radius: 18px;
  font-size: 0.9rem;
  line-height: 1.5;
  word-break: break-word;
  position: relative;
}
.mpx-bubble.theirs {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
  color: var(--text);
}
.mpx-bubble.mine {
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  color: #fff;
  border-bottom-right-radius: 4px;
  box-shadow: 0 2px 12px rgba(108,99,255,0.3);
}
/* mpx-bubble-meta remplace mpx-bubble-time + ticks lecture */
.mpx-bubble-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.25rem;
  margin-top: 0.25rem;
  font-size: 0.65rem;
  opacity: 0.7;
  white-space: nowrap;
}
.mpx-bubble.theirs .mpx-bubble-meta { justify-content: flex-start; }

/* Tick unique : envoy� */
.mpx-tick {
  display: inline-flex;
  align-items: center;
  font-size: 0.65rem;
  opacity: 0.75;
  transition: color 0.3s, opacity 0.3s;
  flex-shrink: 0;
}
/* Double tick bleu : lu */
.mpx-tick.mpx-tick-read {
  color: #56d0ff;
  opacity: 1;
}

/* Conversations non lues en bold dans la sidebar */
.mpx-conv-item.mpx-unread .mpx-conv-name {
  font-weight: 700;
  color: var(--text);
}
.mpx-conv-item.mpx-unread .mpx-conv-preview {
  color: var(--text);
  font-weight: 600;
}

/* Compatibilit�: garder mpx-bubble-time pour ancien code */
.mpx-bubble-time {
  font-size: 0.65rem;
  opacity: 0.55;
  margin-top: 0.3rem;
  display: block;
  text-align: right;
}
.mpx-bubble.theirs .mpx-bubble-time { text-align: left; }

/* Mini avatar dans le chat */
.mpx-bubble-av {
  width: 28px; height: 28px;
  border-radius: 50%;
  flex-shrink: 0;
  font-size: 0.6rem;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  color: #fff;
  overflow: hidden;
}
.mpx-bubble-av img { width: 100%; height: 100%; object-fit: cover; }
.mpx-bubble-row.mine .mpx-bubble-av { display: none; }

/* Séparateur de date */
.mpx-date-sep {
  text-align: center;
  font-size: 0.72rem;
  color: var(--text2);
  margin: 0.6rem 0;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.mpx-date-sep::before,
.mpx-date-sep::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* Zone de saisie */

/* Bouton scroll vers le bas */
.mpx-scroll-down-btn {
  position: absolute;
  bottom: calc(var(--mpx-input-h, 72px) + 12px);
  right: 1.2rem;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg2);
  border: 1.5px solid var(--border);
  color: var(--text2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  box-shadow: 0 4px 16px rgba(0,0,0,0.18);
  transition: background 0.2s, color 0.2s, transform 0.2s, opacity 0.25s;
  z-index: 10;
  opacity: 0;
  pointer-events: none;
  animation: none;
}
.mpx-scroll-down-btn.visible {
  opacity: 1;
  pointer-events: auto;
}
.mpx-scroll-down-btn:hover { background: var(--accent); color: #fff; transform: scale(1.08); }
.mpx-scroll-down-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  background: var(--accent);
  color: #fff;
  font-size: 0.62rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 2px solid var(--bg2);
}

.mpx-input-area {
  padding: 0.9rem 1.2rem;
  border-top: 1px solid var(--border);
  background: var(--bg2);
  flex-shrink: 0;
}
.mpx-input-box {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--bg3);
  border: 1.5px solid var(--border);
  border-radius: 50px;
  padding: 0.45rem 0.45rem 0.45rem 1.1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.mpx-input-box:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(108,99,255,0.12);
}
.mpx-input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
}
.mpx-input::placeholder { color: var(--text2); opacity: 0.6; }
.mpx-send-btn {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  border: none;
  color: #fff;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.88rem;
  flex-shrink: 0;
  transition: transform 0.15s, box-shadow 0.2s;
  box-shadow: 0 2px 10px rgba(108,99,255,0.3);
}
.mpx-send-btn:hover { transform: scale(1.08); box-shadow: 0 4px 16px rgba(108,99,255,0.45); }
.mpx-send-btn:active { transform: scale(0.95); }

/* Loader messages */
.mpx-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 2rem;
  flex: 1;
}
.mpx-loading span {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
  animation: feedDot 1.2s ease-in-out infinite;
  opacity: 0.4;
}
.mpx-loading span:nth-child(2) { animation-delay: 0.2s; }
.mpx-loading span:nth-child(3) { animation-delay: 0.4s; }

/* ── MODAL NOUVEAU MESSAGE ── */
.mpx-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(4px);
  z-index: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: fadeIn 0.15s ease;
}
.mpx-modal {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 20px;
  width: min(460px, 94vw);
  box-shadow: 0 16px 48px rgba(0,0,0,0.45);
  overflow: hidden;
  animation: postFadeIn 0.2s ease both;
}
.mpx-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.2rem 1.4rem 1rem;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(135deg, rgba(108,99,255,0.06), transparent);
}
.mpx-modal-head h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.mpx-modal-head h3 i { color: var(--accent); }
.mpx-modal-close {
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text2);
  width: 30px; height: 30px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1.1rem;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s, color 0.2s;
  line-height: 1;
}
.mpx-modal-close:hover { background: rgba(255,77,109,0.12); color: var(--red); }
.mpx-modal-body { padding: 1.2rem 1.4rem; }
.mpx-modal-search-wrap {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--bg3);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 0.65rem 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
  margin-bottom: 0.8rem;
}
.mpx-modal-search-wrap:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(108,99,255,0.12);
}
.mpx-modal-search-wrap i { color: var(--text2); font-size: 0.85rem; flex-shrink: 0; }
.mpx-modal-search {
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
  width: 100%;
}
.mpx-modal-search::placeholder { color: var(--text2); opacity: 0.6; }
.mpx-modal-results { max-height: 240px; overflow-y: auto; }
.mpx-modal-results::-webkit-scrollbar { width: 3px; }
.mpx-modal-results::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
.mpx-modal-status { font-size: 0.8rem; color: var(--text2); min-height: 1rem; margin: 0.4rem 0 0; }
.mpx-modal-empty {
  text-align: center;
  padding: 1.5rem;
  color: var(--text2);
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

/* Résultats recherche */
.mpx-result-item {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.65rem 0.7rem;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.15s;
}
.mpx-result-item:hover { background: rgba(108,99,255,0.1); }
.mpx-result-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.mpx-result-initials {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 700;
  color: #fff;
}
.mpx-result-info { flex: 1; min-width: 0; }
.mpx-result-name {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mpx-result-plan {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.72rem;
  margin-top: 0.1rem;
}
.mpx-result-arrow {
  color: var(--text2);
  font-size: 0.75rem;
  opacity: 0.4;
  flex-shrink: 0;
  transition: opacity 0.15s, transform 0.15s;
}
.mpx-result-item:hover .mpx-result-arrow { opacity: 1; transform: translateX(2px); }

/* ── Mur de connexion ── */
.mpx-login-wall {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem;
  min-height: calc(100vh - 140px);
}
.mpx-login-card {
  text-align: center;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 3rem 2.5rem;
  max-width: 380px;
  width: 100%;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}
.mpx-login-icon {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: rgba(108,99,255,0.1);
  border: 2px solid rgba(108,99,255,0.2);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 1.2rem;
  font-size: 1.8rem;
  color: var(--accent);
  opacity: 0.8;
}
.mpx-login-card h2 { font-size: 1.3rem; font-weight: 800; margin-bottom: 0.5rem; }
.mpx-login-card p { color: var(--text2); font-size: 0.9rem; margin-bottom: 1.5rem; line-height: 1.6; }

/* ── RESPONSIVE MOBILE ── */
@media (max-width: 860px) {
  .mpx-app { padding: 1rem 3%; height: calc(100dvh - 120px); }
  .mpx-sidebar { width: 260px; min-width: 220px; }
}

@media (max-width: 580px) {
  .mpx-app {
    padding: 0;
    height: auto;
    flex: 1;
    min-height: 0;
    overflow: hidden;
    border-radius: 0;
  }
  /* Sidebar plein �cran sur mobile � visible par d�faut */
  .mpx-sidebar {
    width: 100%;
    min-width: 0;
    border-radius: 0;
    border: none;
    position: relative;
    display: flex;
    flex-shrink: 0;
  }
  .mpx-sidebar.msg-hidden {
    display: none;
  }
  /* Chat plein �cran sur mobile � cach� par d�faut */
  .mpx-chat {
    position: absolute;
    inset: 0;
    border-radius: 0;
    border: none;
    display: none;
    z-index: 10;
  }
  .mpx-chat.msg-visible {
    display: flex;
  }
  /* Bouton retour visible sur mobile */
  .mpx-back-btn { display: flex !important; }
  /* Masquer footer sur mobile pour maximiser l'espace */
  .msg-page-body .footer { display: none; }
  /* Bulles plus larges sur mobile */
  .mpx-bubble { max-width: 82%; }
  /* Input area plus compacte */
  .mpx-input-area { padding: 0.7rem 0.8rem; }
  /* Mobile : padding minimal, bulles plus larges */
  .mpx-messages { padding: 0.5rem 0.3rem; }

}


/* ===== PANNEAU PUBLICATION UTILISATEUR ===== */
.composer-card {
  background: var(--bg3);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  padding: 0.7rem 0.9rem;
  margin-bottom: 1rem;
  box-shadow: 0 14px 34px rgba(0,0,0,0.22);
}
.composer-top {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}
.composer-input {
  flex: 1;
  background: rgba(0,0,0,0.12);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 999px;
  padding: 0.62rem 1rem;
  color: var(--text2);
  font-size: 0.92rem;
  font-family: inherit;
  text-align: left;
  cursor: text;
  transition: border-color 0.2s, background 0.2s;
}
.composer-input:hover { background: rgba(255,255,255,0.04); }
.composer-input:focus { outline: none; border-color: var(--accent); }
.composer-photo-btn {
  background: rgba(0,0,0,0.18);
  border: 1px solid rgba(255,255,255,0.12);
  color: var(--accent2);
  width: 38px;
  height: 38px;
  border-radius: 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, background 0.2s, color 0.2s;
}
.composer-photo-btn:hover { background: rgba(108,99,255,0.14); color: var(--accent); transform: translateY(-1px); }
.composer-photo-btn i { font-size: 0.95rem; }
.admin-composer .composer-input { font-weight: 600; }
.admin-composer-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: rgba(108,99,255,0.15);
  border: 1px solid rgba(108,99,255,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  flex-shrink: 0;
}

.composer-modal {
  position: fixed;
  inset: 0;
  z-index: 1600;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.2rem;
}
.composer-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.65);
}
.composer-modal-card {
  position: relative;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 18px;
  width: min(720px, 94vw);
  max-height: 90vh;
  overflow: auto;
  box-shadow: 0 25px 80px rgba(0,0,0,0.5);
  animation: postFadeIn 0.2s ease both;
}
.composer-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.2rem;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(135deg, rgba(108,99,255,0.12), transparent);
}
.composer-modal-head h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.composer-modal-head h3 i { color: var(--accent); }
.composer-modal-close {
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text2);
  width: 32px;
  height: 32px;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s;
}
.composer-modal-close:hover { background: rgba(255,77,109,0.12); color: var(--red); }
.composer-modal-body { padding: 1rem 1.2rem 1.2rem; }
.composer-modal .user-post-panel {
  margin: 0;
  border: none;
  padding: 0;
  background: transparent;
}
.composer-modal .user-post-header textarea { min-height: 140px; }

body.composer-modal-open { overflow: hidden; }

.user-post-panel {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1rem 1.2rem;
  margin-bottom: 1.2rem;
}
.user-post-header {
  display: flex;
  align-items: flex-start;
  gap: 0.8rem;
}
.user-post-header .avatar-circle.avatar-sm {
  flex-shrink: 0;
  margin-top: 0.2rem;
}
.user-post-header textarea {
  flex: 1;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.7rem 1rem;
  color: var(--text);
  font-size: 0.92rem;
  font-family: inherit;
  resize: none;
  outline: none;
  transition: border-color 0.2s;
  min-height: 70px;
}
.user-post-header textarea:focus {
  border-color: var(--accent);
}
.user-post-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.7rem;
  padding-top: 0.6rem;
  border-top: 1px solid var(--border);
}

@media (max-width: 600px) {
  .composer-card { padding: 0.6rem 0.7rem; border-radius: 14px; }
  .composer-top { gap: 0.5rem; }
  .composer-input { padding: 0.56rem 0.85rem; font-size: 0.88rem; }
  .composer-photo-btn { width: 34px; height: 34px; border-radius: 10px; }
}

/* ===== PUBLICATIONS PROFIL PUBLIC ===== */
.profile-posts-section {
  max-width: 680px;
  margin: 1.5rem auto 0;
  padding: 0 1rem 2rem;
}

/* ===== CONTENEURS POSTS (dashboard + profil) ===== */
#myPostsList { max-width: 820px; }
#profilePostsList { max-width: 680px; }

/* Assurer que les post-cards dans ces contextes ont le même rendu que le feed */
#myPostsList .post-card,
#profilePostsList .post-card {
  margin-bottom: 1.2rem;
}

/* Panneau publication dans le dashboard — fond correct */
#tab-myposts .user-post-panel {
  max-width: 820px;
  background: var(--bg3);
}

#tab-myposts .stories-bar-wrap {
  max-width: 820px;
  margin-left: auto;
  margin-right: auto;
}


/* =====================================================
   RESPONSIVE MOBILE � COMPLEMENT GLOBAL
   Toutes les sections non couvertes ci-dessus
   ===================================================== */

/* -- Formations : hero, filtres, grille -- */
@media (max-width: 768px) {
  .formations-hero { padding: 2rem 4% 1.5rem; }
  .formations-hero-inner { flex-direction: column; gap: 1.2rem; }
  .formations-hero-text h1 { font-size: 1.5rem; }
  .formations-hero-text p { font-size: 0.88rem; }
  .formations-hero-stats { gap: 1.2rem; }
  .fh-stat strong { font-size: 1.2rem; }
  .formations-search-wrap { flex: 1 1 100%; max-width: 100%; }
  .formations-section { padding: 1rem 4% 3rem; }
  .formations-toolbar { flex-direction: column; align-items: flex-start; gap: 0.8rem; width: 100%; }
  .filters { gap: 0.4rem; flex-wrap: wrap; overflow: visible; padding-bottom: 0; width: 100%; }
  .filter-btn { white-space: nowrap; padding: 0.38rem 0.75rem; font-size: 0.78rem; max-width: 48%; overflow: hidden; text-overflow: ellipsis; }
  .filter-btn-module { max-width: 48%; }
  .courses-grid { grid-template-columns: 1fr; gap: 1rem; }
  .courses-grid .course-card { min-width: 0; width: 100%; }
  .page-header { padding: 2rem 4% 1.2rem; }
  .page-header h1 { font-size: 1.8rem; }
}

/* -- Affiliation : steps, tableau commissions, stats -- */
@media (max-width: 768px) {
  .affiliation-section { padding: 1rem 4% 3rem; }
  .how-it-works h2,
  .commission-table-section h2,
  .affiliate-link-section h2,
  .aff-stats h2 { font-size: 1.3rem; }
  .steps { flex-direction: column; align-items: center; gap: 1.5rem; }
  .step { min-width: 100%; max-width: 100%; }
  .step-arrow { transform: rotate(90deg); }
  .comm-header, .comm-row { grid-template-columns: 1fr 1fr; font-size: 0.8rem; padding: 0.7rem 0.8rem; }
  .comm-header span:nth-child(n+3), .comm-row span:nth-child(n+3) { display: none; }
  .link-box { flex-direction: column; }
  .link-box input, .link-box button { width: 100%; }
  .share-btns { flex-direction: column; }
  .share-btn { justify-content: center; }
  .aff-stats { grid-template-columns: repeat(2, 1fr); }
  .history-header, .history-row { grid-template-columns: 1fr 1fr 1fr; font-size: 0.78rem; padding: 0.6rem 0.8rem; }
  .history-header span:nth-child(2), .history-row span:nth-child(2),
  .history-header span:nth-child(4), .history-row span:nth-child(4) { display: none; }
  .withdraw-box { max-width: 100%; }
}

/* -- Plans / Tarifs -- */
@media (max-width: 768px) {
  .plans { padding: 2.5rem 4%; }
  .plans h2 { font-size: 1.5rem; }
  .plans-grid { grid-template-columns: 1fr; max-width: 100%; }
  .payment-info { flex-direction: column; gap: 1rem; padding: 1rem; }
  .plans-faq { padding: 2rem 4%; }
  .faq-grid { grid-template-columns: 1fr; }
  .plans-compact-grid { grid-template-columns: 1fr; gap: 0.8rem; }
  .plans-compact { padding: 1.2rem 4%; }
}

/* -- Profil public -- */
@media (max-width: 768px) {
  .public-profile-page { margin: 1rem auto; padding: 0 4%; }
  .public-profile-header { flex-direction: column; padding: 0 1rem 1rem; gap: 0.8rem; }
  .public-avatar-wrap { margin-top: -35px; }
  .public-name-row h1 { font-size: 1.2rem; }
  .public-stats { flex-wrap: wrap; }
  .public-stat { min-width: 80px; padding: 0.8rem 0.4rem; }
  .public-actions { padding: 0.8rem 1rem; }
}

/* -- Admin : tableau vid�os, tarifs, modules -- */
@media (max-width: 768px) {
  .video-admin-header,
  .video-admin-row { grid-template-columns: 2fr 1fr 1fr; font-size: 0.8rem; padding: 0.6rem 0.8rem; }
  .video-admin-header span:nth-child(3),
  .video-admin-row span:nth-child(3) { display: none; }
  .video-admin-stats { flex-wrap: wrap; gap: 0.6rem; }
  .video-stat-card { min-width: calc(50% - 0.3rem); padding: 0.8rem 1rem; }
  .video-admin-filters { overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; padding-bottom: 4px; }
  .video-admin-filters .filter-btn { white-space: nowrap; }
  .admin-section-header { flex-direction: column; align-items: flex-start; gap: 0.6rem; }
  .admin-kpi-grid { grid-template-columns: repeat(2, 1fr); gap: 0.6rem; }
  .pricing-tabs { overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; }
  .pricing-tab { white-space: nowrap; }
  .pricing-admin-grid { grid-template-columns: 1fr; }
  .module-pricing-grid { grid-template-columns: 1fr; }
  .comm-pricing-grid { grid-template-columns: 1fr; }
  .admin-payment-row { flex-wrap: wrap; gap: 0.6rem; }
  .admin-payment-op { min-width: 100%; }
}

/* -- Abonnements admin et utilisateur -- */
@media (max-width: 768px) {
  .sub-card-header { flex-direction: column; align-items: flex-start; }
  .sub-card-details { flex-direction: column; }
  .sub-detail-item { min-width: 100%; }
  .sub-card-actions { flex-direction: column; }
  .sub-action-approve, .sub-action-reject { width: 100%; justify-content: center; }
  .sub-user-card-header { flex-direction: column; align-items: flex-start; }
  .sub-user-details { flex-direction: column; }
  .sub-user-detail { min-width: 100%; }
  .sub-current-card { flex-direction: column; align-items: flex-start; }
}

/* -- Achats vid�o admin (vp-card) -- */
@media (max-width: 768px) {
  .vp-card-header { flex-direction: column; align-items: flex-start; }
  .vp-card-details { flex-direction: column; }
  .vp-detail-item { min-width: 100%; }
  .vp-actions { flex-direction: column; }
  .vp-btn-approve, .vp-btn-reject { width: 100%; justify-content: center; }
  .vp-section-counter { flex-wrap: wrap; }
}

/* -- Modales upgrade et achat vid�o -- */
@media (max-width: 480px) {
  .upgrade-modal { border-radius: 16px; max-height: 95vh; }
  .upgrade-plans { grid-template-columns: 1fr; padding: 1rem; }
  .upgrade-payment { padding: 1rem; }
  .upgrade-step { flex-direction: column; gap: 0.6rem; }
  .buy-video-modal { border-radius: 16px; }
  .buy-video-options { grid-template-columns: 1fr; padding: 1rem; }
  .buy-video-header { padding: 1.2rem 1rem 0.8rem; }
  .buy-video-meta { gap: 0.8rem; }
}

/* -- Auth card -- */
@media (max-width: 480px) {
  .auth-section { padding: 1rem; align-items: flex-start; padding-top: 2rem; }
  .auth-card { padding: 1.5rem 1.2rem; border-radius: 14px; }
  .mm-operator-select { flex-direction: column; }
  .mm-op-btn { justify-content: center; }
}

/* -- Wallet et commissions -- */
@media (max-width: 480px) {
  .wallet-box { max-width: 100%; }
  .wallet-row { flex-direction: column; align-items: flex-start; gap: 0.3rem; }
  .user-comm-summary { flex-direction: column; }
}

/* -- Post cards sur mobile -- */
@media (max-width: 480px) {
  .post-header { padding: 0.8rem 0.9rem 0.5rem; }
  .post-body { padding: 0 0.9rem 0.8rem; }
  .post-title { font-size: 0.95rem; }
  .post-content { font-size: 0.88rem; }
  .post-actions { padding: 0.3rem 0.5rem; }
  .reaction-btn, .comment-toggle-btn { padding: 0.45rem 0.6rem; font-size: 0.82rem; }
  .comments-section { padding: 0.8rem 0.9rem; }
  .comment-input-row { gap: 0.4rem; }
}

/* -- Dashboard : profil, MM accounts -- */
@media (max-width: 480px) {
  .profile-card { border-radius: 14px; }
  .profile-cover { height: 80px; }
  .profile-body { padding: 0 1rem 1rem; }
  .profile-name-row h2 { font-size: 1.1rem; }
  .profile-stats { flex-wrap: wrap; }
  .profile-stat { min-width: 70px; padding: 0.7rem 0.5rem; }
  .profile-stat strong { font-size: 1rem; }
  .mm-account-row { flex-wrap: wrap; gap: 0.5rem; }
  .mm-account-status { width: 100%; }
  .mm-add-btn { width: 100%; justify-content: center; }
  .edit-profile-form { padding: 1rem; }
}

/* -- Notifications panel -- */
@media (max-width: 480px) {
  .notif-panel { right: 0.3rem; width: calc(100vw - 0.6rem); top: 62px; }
}

/* -- Crop modal -- */
@media (max-width: 480px) {
  .crop-modal { padding: 1rem; border-radius: 14px; }
  .crop-actions { flex-direction: column; }
  .crop-actions button { width: 100%; }
}

/* -- Tr�s petits �crans (320px) -- */
@media (max-width: 360px) {
  .navbar { padding: 0.6rem 3%; }
  .logo { font-size: 1.2rem; }
  .notif-bell { width: 30px; height: 30px; font-size: 0.82rem; }
  .btn-nav { max-width: 100px; font-size: 0.75rem; }
  .dash-stats { grid-template-columns: 1fr; }
  .aff-stats { grid-template-columns: 1fr; }
  .admin-kpi-grid { grid-template-columns: 1fr; }
}

/* =====================================================
   DESIGN AM�LIORATIONS � UX & DYNAMISME
   ===================================================== */

/* -- Navbar scroll effect -- */
.navbar { transition: background 0.3s ease, box-shadow 0.3s ease; }
.logo { transition: opacity 0.2s; cursor: pointer; }
.logo:hover { opacity: 0.85; }
.upgrade-input:focus,
.vselect:focus {
  box-shadow: 0 0 0 3px rgba(108,99,255,0.15);
}

/* -- �tape 4 : Cards � hover plus prononc� -- */
.feature-card:hover,
.plan-card:hover,
.trigger-card:hover,
.faq-item:hover {
  box-shadow: 0 8px 32px rgba(108,99,255,0.12);
}
.dash-stat {
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.dash-stat:hover {
  transform: translateY(-3px);
  border-color: rgba(108,99,255,0.3);
  box-shadow: 0 6px 20px rgba(108,99,255,0.1);
}
.quick-card:hover {
  box-shadow: 0 8px 24px rgba(108,99,255,0.15);
}

/* -- �tape 5 : Footer am�lior� -- */
.footer {
  background: linear-gradient(180deg, var(--bg2) 0%, rgba(10,14,26,0.98) 100%);
  border-top: 1px solid var(--border);
  padding: 2.5rem 5%;
  margin-top: 3rem;
  position: relative;
}
.footer::before {
  content: '';
  position: absolute;
  top: 0; left: 5%; right: 5%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0.4;
}
.footer-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  max-width: 1100px;
  margin: 0 auto;
}
.social-links a {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: rgba(108,99,255,0.1);
  border: 1px solid rgba(108,99,255,0.2);
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s, color 0.2s, transform 0.15s, border-color 0.2s;
}
.social-links a:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  transform: translateY(-3px);
}

/* -- �tape 6 : Sidebar cards � l�g�re am�lioration -- */
.sidebar-card {
  transition: border-color 0.2s, box-shadow 0.2s;
}
.sidebar-card:hover {
  border-color: rgba(108,99,255,0.25);
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

/* -- �tape 7 : Plan cards � badge populaire anim� -- */
.popular {
  animation: badgePop 0.4s ease both;
}
.plan-card.featured {
  position: relative;
}
.plan-card.featured::after {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 17px;
  background: linear-gradient(135deg, var(--accent), #8b5cf6, var(--accent2));
  z-index: -1;
  opacity: 0.5;
  filter: blur(8px);
  transition: opacity 0.3s;
}
.plan-card.featured:hover::after { opacity: 0.8; }

/* -- �tape 8 : Scroll to top button -- */
#scrollTopBtn {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 42px; height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  border: none;
  color: #fff;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
  box-shadow: 0 4px 16px rgba(108,99,255,0.4);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.3s, transform 0.3s;
  z-index: 400;
  pointer-events: none;
}
#scrollTopBtn.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: all;
}
#scrollTopBtn:hover { transform: translateY(-3px); box-shadow: 0 6px 20px rgba(108,99,255,0.5); }
#scrollTopBtn:active { transform: scale(0.95); }

@media (max-width: 480px) {
  #scrollTopBtn { bottom: 1rem; right: 1rem; width: 38px; height: 38px; }
}

/* -----------------------------------------------
   TOGGLE SWITCH (bouton navbar admin)
----------------------------------------------- */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}
.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}
.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--border);
  border-radius: 50px;
  cursor: pointer;
  transition: background 0.2s;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
}
.toggle-switch input:checked + .toggle-slider {
  background: var(--accent);
}
.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(20px);
}

/* -----------------------------------------------
   NAVBAR BUTTON ADMIN PREVIEW
----------------------------------------------- */
.navbar-btn-admin-form {
  max-width: 500px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.navbar-btn-preview {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem 1.2rem;
}
.navbar-btn-preview-inner {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem;
  background: var(--bg3);
  border-radius: 8px;
  width: fit-content;
}
@media (max-width: 580px) {
  body.chat-open .navbar { display: none; }
  body.chat-open .mpx-app { flex: 1; min-height: 0; height: auto; }
}
@media (max-width: 580px) {
  .mpx-chat-header {
    padding: 0.85rem 1rem;
    min-height: 60px;
    background: var(--bg);
    border-bottom: 2px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 20;
  }
  .mpx-chat-name { font-size: 1.05rem; }
  .mpx-chat-avatar img,
  .mpx-chat-avatar .avatar-circle { width: 42px; height: 42px; }
}

/* ===== BOUTON PARTAGE FACEBOOK ===== */
.share-fb-btn {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  background: transparent;
  border: none;
  color: var(--text2);
  cursor: pointer;
  padding: 0.5rem 1rem;
  border-radius: 10px;
  font-size: 0.88rem;
  font-family: inherit;
  transition: background 0.2s, color 0.2s, transform 0.15s;
  flex: 1;
  justify-content: center;
}
.share-fb-btn:hover {
  background: rgba(24,119,242,0.12);
  color: #1877f2;
  transform: translateY(-1px);
}
.share-fb-btn i { font-size: 1rem; }

/* -- MESSAGERIE : bouton photo & images ----------------------- */
.mpx-photo-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  cursor: pointer;
  color: var(--text2);
  font-size: 1.1rem;
  border-radius: 50%;
  transition: color 0.2s, background 0.2s;
}
.mpx-photo-btn:hover { color: var(--accent); background: rgba(108,99,255,0.1); }

.mpx-bubble-img-wrap { margin-bottom: 0.3rem; }
.mpx-bubble-img {
  max-width: 220px;
  max-height: 200px;
  border-radius: 10px;
  object-fit: cover;
  display: block;
  cursor: zoom-in;
}

/* -- Masquer l'�tat vide du chat sur mobile (inutile, la sidebar fait office) -- */
@media (max-width: 580px) {
  #chatEmpty { display: none !important; }
}

@media (max-width: 580px) {
  .mpx-profile-btn { display: none !important; }
}

/* -- Chat : loader pagination (charger messages plus anciens) -- */
.mpx-load-more {
  display: flex;
  justify-content: center;
  padding: 0.6rem 0;
  flex-shrink: 0;
}
.mpx-loading-center {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ===== MENU OPTIONS POST (modifier/supprimer) ===== */
.post-owner-menu { position: relative; }
.post-menu-btn {
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  color: var(--text2);
  width: 28px; height: 28px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.75rem;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s, color 0.15s;
}
.post-menu-btn:hover { background: rgba(108,99,255,0.12); color: var(--accent); }
.post-menu-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  z-index: 200;
  min-width: 160px;
  overflow: hidden;
  animation: fadeIn 0.12s ease;
}
.post-menu-dropdown button {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  background: transparent;
  border: none;
  color: var(--text);
  padding: 0.6rem 1rem;
  font-size: 0.83rem;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s;
}
.post-menu-dropdown button:hover { background: rgba(108,99,255,0.1); }
.post-menu-dropdown button + button { border-top: 1px solid var(--border); }

/* ===== MENU SUPPRESSION MESSAGE ===== */
.mpx-msg-menu {
  position: absolute;
  right: 0;
  bottom: calc(100% + 4px);
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.25);
  z-index: 100;
  overflow: hidden;
  min-width: 140px;
  animation: fadeIn 0.12s ease;
}
.mpx-msg-menu button {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.6rem 1rem;
  background: none;
  border: none;
  color: var(--red);
  font-size: 0.85rem;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
}
.mpx-msg-menu button:hover { background: rgba(255,77,109,0.1); }
.mpx-bubble-row { user-select: none; position: relative; }




/* -- Bouton supprimer message (desktop hover) -- */
.mpx-bubble.mine { position: relative; }
/* -- Pr�sence dans la liste des conversations -- */
.mpx-conv-av { position: relative; flex-shrink: 0; }
.mpx-online-dot {
  position: absolute;
  bottom: 1px; right: 1px;
  width: 10px; height: 10px;
  background: var(--accent2);
  border-radius: 50%;
  border: 2px solid var(--bg2);
  pointer-events: none;
}
.mpx-conv-presence-slot { font-size: 0.68rem; min-height: 0.9rem; }
.mpx-pres-online {
  color: var(--accent2);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.mpx-pres-online::before {
  content: '';
  width: 5px; height: 5px;
  background: var(--accent2);
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}


/* ══════════════════════════════════════════════════════════
   RÉACTIONS SUR LES MESSAGES — Picker + Bulles + Animations
══════════════════════════════════════════════════════════ */

/* ── Keyframes ── */
@keyframes rxPickerIn {
  from { opacity: 0; transform: scale(0.6) translateY(8px); }
  to   { opacity: 1; transform: scale(1)   translateY(0); }
}
@keyframes rxPickerOut {
  from { opacity: 1; transform: scale(1)   translateY(0); }
  to   { opacity: 0; transform: scale(0.6) translateY(8px); }
}
@keyframes rxEmojiHover {
  0%   { transform: scale(1)    translateY(0); }
  40%  { transform: scale(1.45) translateY(-6px); }
  70%  { transform: scale(1.35) translateY(-4px); }
  100% { transform: scale(1.4)  translateY(-5px); }
}
@keyframes rxBadgePop {
  0%   { transform: scale(0) translateY(4px); opacity: 0; }
  60%  { transform: scale(1.2) translateY(-2px); opacity: 1; }
  100% { transform: scale(1)   translateY(0);   opacity: 1; }
}
@keyframes rxBadgeBounce {
  0%,100% { transform: scale(1); }
  30%     { transform: scale(1.3); }
  60%     { transform: scale(0.9); }
}
@keyframes rxRipple {
  from { transform: scale(0); opacity: 0.5; }
  to   { transform: scale(2.5); opacity: 0; }
}

/* ── Wrapper bulle — nécessaire pour positionner le picker ── */
.mpx-bubble-row { position: relative; }

/* ── Picker d'emojis ── */
.mpx-reaction-picker {
  position: absolute;
  bottom: calc(100% + 8px);
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 50px;
  padding: 6px 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.35), 0 2px 8px rgba(0,0,0,0.2);
  z-index: 1000;
  animation: rxPickerIn 0.22s cubic-bezier(0.34,1.56,0.64,1) both;
  white-space: nowrap;
  user-select: none;
}
/* Picker à gauche pour les messages reçus, à droite pour les envoyés */
.mpx-bubble-row:not(.mine) .mpx-reaction-picker { left: 0; }
.mpx-bubble-row.mine       .mpx-reaction-picker { right: 0; }

/* Petite flèche sous le picker */
.mpx-reaction-picker::after {
  content: '';
  position: absolute;
  bottom: -6px;
  width: 10px; height: 6px;
  background: var(--bg2);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
}
.mpx-bubble-row:not(.mine) .mpx-reaction-picker::after { left: 16px; }
.mpx-bubble-row.mine       .mpx-reaction-picker::after { right: 16px; left: auto; }

/* Animation de fermeture */
.mpx-reaction-picker.closing {
  animation: rxPickerOut 0.15s ease forwards;
}

/* ── Bouton emoji dans le picker ── */
.mpx-rx-emoji-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 1.45rem;
  line-height: 1;
  padding: 2px 3px;
  border-radius: 50%;
  transition: transform 0.15s;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.mpx-rx-emoji-btn:hover {
  animation: rxEmojiHover 0.3s ease forwards;
}
/* Ripple au clic */
.mpx-rx-emoji-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(255,255,255,0.25);
  transform: scale(0);
  opacity: 0;
  pointer-events: none;
}
.mpx-rx-emoji-btn:active::after {
  animation: rxRipple 0.35s ease forwards;
}
/* Emoji déjà sélectionné par l'utilisateur */
.mpx-rx-emoji-btn.selected {
  background: rgba(108,99,255,0.18);
  border-radius: 50%;
  transform: scale(1.15);
}

/* ── Zone réactions sous la bulle ── */
.mpx-bubble-reactions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}
/* Alignement selon l'expéditeur */
.mpx-bubble-row:not(.mine) + .mpx-bubble-reactions { justify-content: flex-start; padding-left: 36px; }
.mpx-bubble-row.mine + .mpx-bubble-reactions { justify-content: flex-end; }

/* ── Badge réaction individuel ── */
.mpx-rx-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: var(--bg2);
  border: 1.5px solid var(--border);
  border-radius: 50px;
  padding: 2px 7px 2px 5px;
  font-size: 0.82rem;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.15s;
  animation: rxBadgePop 0.3s cubic-bezier(0.34,1.56,0.64,1) both;
  user-select: none;
  line-height: 1;
}
.mpx-rx-badge:hover {
  border-color: var(--accent);
  background: rgba(108,99,255,0.1);
  transform: scale(1.08);
}
/* Badge sélectionné (l'utilisateur a réagi avec cet emoji) */
.mpx-rx-badge.mine-rx {
  border-color: var(--accent);
  background: rgba(108,99,255,0.15);
}
.mpx-rx-badge.mine-rx:hover {
  background: rgba(108,99,255,0.25);
}
/* Emoji dans le badge */
.mpx-rx-badge-emoji {
  font-size: 0.95rem;
  line-height: 1;
}
/* Compteur dans le badge */
.mpx-rx-badge-count {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text2);
  min-width: 10px;
  text-align: center;
}
.mpx-rx-badge.mine-rx .mpx-rx-badge-count { color: var(--accent); }

/* Animation quand le compteur change */
.mpx-rx-badge-count.bump {
  animation: rxBadgeBounce 0.3s ease;
}

/* ── Bouton déclencheur (hover desktop) ── */
.mpx-rx-trigger {
  position: absolute;
  bottom: 4px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 26px; height: 26px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  font-size: 0.78rem;
  color: var(--text2);
  opacity: 0;
  transition: opacity 0.15s, background 0.15s, transform 0.15s;
  z-index: 5;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
  pointer-events: none;
}
/* Trigger dans la bulle : messages reçus à droite, envoyés à gauche */
.mpx-bubble.theirs .mpx-rx-trigger { right: 4px; }
.mpx-bubble.mine   .mpx-rx-trigger { left: 4px; }

/* Afficher au hover de la ligne */
.mpx-bubble-row:hover .mpx-bubble .mpx-rx-trigger {
  opacity: 1;
  pointer-events: auto;
}
.mpx-rx-trigger:hover {
  background: rgba(108,99,255,0.15);
  border-color: var(--accent);
  color: var(--accent);
  transform: scale(1.15);
  opacity: 1;
}

/* ── Tooltip sur les badges (liste des réacteurs) ── */
.mpx-rx-tooltip {
  position: absolute;
  bottom: calc(100% + 6px);
  background: rgba(15,20,35,0.95);
  color: #fff;
  font-size: 0.72rem;
  padding: 4px 8px;
  border-radius: 6px;
  white-space: nowrap;
  pointer-events: none;
  z-index: 300;
  animation: fadeIn 0.12s ease;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
.mpx-rx-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 4px solid transparent;
  border-top-color: rgba(15,20,35,0.95);
}

/* ── Responsive mobile ── */
@media (max-width: 580px) {
  /* Sur mobile, le trigger est toujours caché (long press à la place) */
  .mpx-rx-trigger { display: none; }

  /* Picker en position fixe centré en bas d'écran sur mobile */
  .mpx-reaction-picker {
    padding: 8px 14px;
    gap: 6px;
    z-index: 600;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  }
  .mpx-reaction-picker::after { display: none; }
  .mpx-rx-emoji-btn { font-size: 1.5rem; }
}

/* ══════════════════════════════════════════════════════════
   REPLY / CITATION — Messagerie privée
══════════════════════════════════════════════════════════ */

/* Barre de prévisualisation de la citation (zone de saisie) */
#chatReplyBar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.4rem 0.8rem 0;
  animation: slideDown 0.18s ease;
}

.mpx-reply-preview {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  background: rgba(108,99,255,0.08);
  border-left: 3px solid var(--accent);
  border-radius: 0 8px 8px 0;
  padding: 0.35rem 0.7rem;
  min-width: 0;
}

.mpx-reply-name {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mpx-reply-text {
  font-size: 0.78rem;
  color: var(--text2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mpx-reply-cancel {
  background: transparent;
  border: none;
  color: var(--text2);
  cursor: pointer;
  font-size: 0.85rem;
  width: 26px; height: 26px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s;
}
.mpx-reply-cancel:hover { background: rgba(255,77,109,0.12); color: var(--red); }

/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   REPLY / CITATION â€” Style WhatsApp
â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */

/* Wrap bulle — prend toute la largeur, bulle alignée par text-align */
.mpx-bubble-wrap {
  position: relative;
  width: 100%;
}
/* Mine : bulle collée à droite */
.mpx-bubble-row.mine .mpx-bubble-wrap {
  text-align: right;
}
/* Theirs : bulle collée à gauche */
.mpx-bubble-row:not(.mine) .mpx-bubble-wrap {
  text-align: left;
  margin-left: 4px;
  width: calc(100% - 4px);
}


/* Bouton reply - inline à côté de la bulle */
.mpx-reply-btn {
  position: static;
  background: var(--bg2);
  border: 1px solid var(--border);
  color: var(--text2);
  cursor: pointer;
  font-size: 0.78rem;
  width: 28px; height: 28px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s, background 0.15s, color 0.15s;
  box-shadow: 0 1px 6px rgba(0,0,0,0.22);
  flex-shrink: 0;
}

/* wrap-inner : bulle + bouton côte à côte */
.mpx-bubble-wrap-inner {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.3rem;
}
.mpx-bubble-row.mine .mpx-bubble-wrap-inner { flex-direction: row-reverse; }

/* Apparaît uniquement au swipe (classe JS) - mobile */
.mpx-reply-btn--active {
  opacity: 1;
  pointer-events: auto;
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* Sur desktop : apparaît discrètement au hover de la row */
@media (hover: hover) {
  .mpx-bubble-row:hover .mpx-reply-btn {
    opacity: 0.5;
    pointer-events: auto;
  }
  .mpx-bubble-row:hover .mpx-reply-btn:hover {
    opacity: 1;
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
  }
}

/* ── Citation dans la bulle (style WhatsApp) ── */
.mpx-bubble-quote {
  display: flex;
  align-items: stretch;
  border-left: 3px solid rgba(255,255,255,0.55);
  border-radius: 6px;
  margin-bottom: 6px;
  cursor: pointer;
  background: rgba(0,0,0,0.15);
  transition: background 0.15s;
}
.mpx-bubble.theirs .mpx-bubble-quote {
  background: rgba(108,99,255,0.1);
  border-left-color: var(--accent);
}
.mpx-bubble-quote:hover {
  background: rgba(0,0,0,0.25);
}
.mpx-bubble.theirs .mpx-bubble-quote:hover {
  background: rgba(108,99,255,0.18);
}

/* Barre colorée à gauche via border-left */
.mpx-bubble.theirs .mpx-bubble-quote::before {
  background: var(--accent);
}

/* Contenu de la citation */
.mpx-bubble-quote-inner {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 5px 8px;
  min-width: 0;
}
.mpx-bubble-quote-name {
  font-size: 0.7rem;
  font-weight: 700;
  color: rgba(255,255,255,0.9);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mpx-bubble.theirs .mpx-bubble-quote-name {
  color: var(--accent);
}
.mpx-bubble-quote-text {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.65);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mpx-bubble.theirs .mpx-bubble-quote-text {
  color: var(--text2);
}

/* â”€â”€ Barre de prÃ©visualisation reply (zone de saisie) â”€â”€ */
#chatReplyBar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 6px 12px 0;
  animation: slideDown 0.18s ease;
}
.mpx-reply-preview {
  flex: 1;
  display: flex;
  align-items: stretch;
  gap: 0;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  min-width: 0;
}
.mpx-reply-preview::before {
  content: '';
  display: block;
  width: 3px;
  flex-shrink: 0;
  background: var(--accent);
  border-radius: 3px 0 0 3px;
}
.mpx-reply-preview-inner {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 5px 8px;
  min-width: 0;
}
.mpx-reply-name {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mpx-reply-text {
  font-size: 0.78rem;
  color: var(--text2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mpx-reply-cancel {
  background: transparent;
  border: none;
  color: var(--text2);
  cursor: pointer;
  font-size: 0.9rem;
  width: 28px; height: 28px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s;
}
.mpx-reply-cancel:hover { background: rgba(255,77,109,0.12); color: var(--red); }

/* â”€â”€ Highlight message citÃ© (scroll vers) â”€â”€ */
@keyframes msgHighlightBubble {
  0%   { box-shadow: 0 0 0 3px rgba(108,99,255,0.55); }
  60%  { box-shadow: 0 0 0 4px rgba(0,212,170,0.3); }
  100% { box-shadow: none; }
}
.mpx-bubble-highlight .mpx-bubble {
  animation: msgHighlightBubble 1.5s ease forwards;
  border-radius: 18px;
}

.mpx-bubble:has(.mpx-bubble-img-wrap):not(:has(.mpx-bubble-img-wrap + *)) .mpx-bubble-img {
  border-radius: 14px;
}

/* Bulle image uniquement — background s'adapte à l'image */
.mpx-bubble.img-only {
  padding: 3px;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}
.mpx-bubble.img-only .mpx-bubble-img {
  border-radius: 14px;
  display: block;
}
.mpx-bubble.img-only .mpx-bubble-meta {
  position: absolute;
  bottom: 6px;
  right: 8px;
  background: rgba(0,0,0,0.45);
  border-radius: 8px;
  padding: 1px 5px;
  opacity: 1;
  color: #fff;
}

/* ══════════════════════════════════════════════════════════
   RÉACTIONS POSTS — Picker style Facebook
══════════════════════════════════════════════════════════ */
:root {
  --reaction-red:    #ff4d6d;
  --reaction-gold:   #f59e0b;
  --reaction-blue:   #3b82f6;
  --reaction-accent: var(--accent);
}

.reaction-btn-wrap { position: relative; flex: 1; z-index: 10; }
.reaction-btn-wrap button,
.reaction-btn-wrap a {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.reaction-btn.reacted { font-weight: 700; }
.reaction-btn.reacted[style*="red"]    { background: rgba(255,77,109,0.1); }
.reaction-btn.reacted[style*="gold"]   { background: rgba(245,158,11,0.1); }
.reaction-btn.reacted[style*="blue"]   { background: rgba(59,130,246,0.1); }
.reaction-btn.reacted[style*="accent"] { background: rgba(108,99,255,0.1); }

.reaction-main-emoji { font-size: 1.1rem; line-height: 1; }

/* Picker flottant */
.reaction-picker {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 50px;
  padding: 0.4rem 0.6rem;
  display: flex;
  gap: 0.2rem;
  z-index: 200;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  animation: reactionPickerIn 0.18s cubic-bezier(0.34,1.56,0.64,1) both;
  white-space: nowrap;
  max-width: calc(100vw - 2rem);
}
@keyframes reactionPickerIn {
  from { opacity: 0; transform: translateX(-50%) scale(0.7) translateY(8px); }
  to   { opacity: 1; transform: translateX(-50%) scale(1)   translateY(0); }
}
@media (max-width: 600px) {
  .reaction-picker {
    left: 0;
    transform: none;
    animation: reactionPickerInMobile 0.18s cubic-bezier(0.34,1.56,0.64,1) both;
  }
  @keyframes reactionPickerInMobile {
    from { opacity: 0; transform: scale(0.7) translateY(8px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
  }
}

.rp-btn {
  background: transparent;
  border: none;
  font-size: 1.6rem;
  cursor: pointer;
  padding: 0.2rem 0.25rem;
  border-radius: 50%;
  transition: transform 0.15s cubic-bezier(0.34,1.56,0.64,1), background 0.15s;
  line-height: 1;
}
.rp-btn:hover { transform: scale(1.45) translateY(-4px); background: rgba(255,255,255,0.08); }
.rp-btn.rp-active { transform: scale(1.2); filter: drop-shadow(0 0 6px rgba(255,255,255,0.4)); }

/* Résumé des réactions */
.reaction-summary {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  padding: 0.3rem 0.6rem;
  border-radius: 50px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  cursor: pointer;
  font-size: 0.88rem;
  transition: background 0.15s;
  flex-shrink: 0;
  align-self: center;
}
.reaction-summary:hover { background: rgba(108,99,255,0.1); border-color: var(--accent); }
.reaction-summary span { font-size: 1rem; line-height: 1; }
.reaction-count { font-size: 0.78rem; color: var(--text2); font-weight: 600; margin-left: 0.2rem; }

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

/* ===== STORIES — Style Facebook (cartes rectangulaires) ===== */
.story-card {
  position: relative;
  width: 110px;
  height: 180px;
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.2s, box-shadow 0.2s;
  animation: storyCardIn 0.35s cubic-bezier(0.34,1.56,0.64,1) both;
}
.story-card:hover {
  transform: translateY(-4px) scale(1.03);
  box-shadow: 0 12px 32px rgba(0,0,0,0.45);
}
@keyframes storyCardIn {
  from { opacity: 0; transform: scale(0.88) translateY(8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* Fond image ou couleur */
.story-card-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transition: transform 0.3s;
}
.story-card:hover .story-card-bg { transform: scale(1.06); }

/* Dégradé sombre en bas */
.story-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.08) 0%, transparent 40%, rgba(0,0,0,0.65) 100%);
}

/* Avatar en haut à gauche avec anneau */
.story-card-avatar-wrap {
  position: absolute;
  top: 10px;
  left: 10px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid var(--bg);
  z-index: 2;
}
.story-card-avatar-wrap img,
.story-card-avatar-wrap .avatar-circle {
  width: 100% !important;
  height: 100% !important;
  border-radius: 50%;
  object-fit: cover;
  font-size: 0.65rem !important;
}
.story-card-avatar-ring {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 2px var(--accent);
}
.story-card-avatar-ring.viewed {
  border-color: var(--border) !important;
  box-shadow: none;
}

/* Bouton + pour créer */
.story-card-create-btn {
  position: absolute;
  bottom: 38px;
  left: 50%;
  transform: translateX(-50%);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 0.85rem;
  z-index: 2;
  transition: transform 0.2s;
}
.story-card-create:hover .story-card-create-btn { transform: translateX(-50%) scale(1.15); }

/* Nom en bas */
.story-card-footer {
  position: absolute;
  bottom: 0;
  left: 0; right: 0;
  padding: 0.5rem 0.5rem 0.55rem;
  z-index: 2;
}
.story-card-footer span {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0,0,0,0.7);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
}

/* Compteur vues (owner) */
.story-card-views {
  position: absolute;
  top: 10px;
  right: 8px;
  font-size: 0.65rem;
  color: #fff;
  background: rgba(0,0,0,0.45);
  padding: 0.15rem 0.4rem;
  border-radius: 50px;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

/* Carte créer : fond dégradé spécial */
.story-card-create .story-card-bg {
  background: linear-gradient(160deg, var(--bg3) 0%, var(--bg2) 100%) !important;
}
.story-card-create .story-card-footer span { color: var(--accent); }

/* Barre stories */
#storiesBar {
  display: flex;
  gap: 0.6rem;
  overflow-x: scroll;
  overflow-y: hidden;
  padding: 0.8rem 0 0.4rem;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  will-change: scroll-position;
}
#storiesBar::-webkit-scrollbar { display: none; }

.stories-bar-wrap {
  overflow: hidden;
  overscroll-behavior-x: contain;
  position: relative;
  padding: 0.5rem 0;
}
@media (max-width: 768px) {
  .stories-bar-wrap {
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .stories-bar-wrap::-webkit-scrollbar { display: none; }
}

/* Flèches navigation stories (desktop uniquement) */
.stories-nav-btn {
  display: none;
}
@media (min-width: 769px) {
  .stories-bar-wrap:hover .stories-nav-btn {
    display: flex;
  }
  .stories-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg2);
    border: 1px solid var(--border);
    color: var(--text);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    transition: opacity 0.2s, background 0.2s, transform 0.2s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  }
  .stories-nav-btn:hover {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
    transform: translateY(-50%) scale(1.08);
  }
  .stories-nav-prev { left: -4px; }
  .stories-nav-next { right: -4px; }
}

/* ── Viewer overlay ── */
.story-viewer-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 3000;
  background: rgba(0,0,0,0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  touch-action: none;
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
}
.story-viewer {
  position: relative;
  width: min(400px, 96vw);
  height: min(700px, 90vh);
  border-radius: 18px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}
.story-progress-bar {
  display: flex;
  gap: 4px;
  padding: 10px 12px 6px;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2;
}
.story-progress-seg {
  flex: 1;
  height: 3px;
  background: rgba(255,255,255,0.3);
  border-radius: 2px;
  overflow: hidden;
}
.story-progress-fill {
  height: 100%;
  background: #fff;
  border-radius: 2px;
}
.story-viewer-header {
  position: absolute;
  top: 22px;
  left: 12px;
  right: 12px;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.story-viewer-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 700;
  color: #fff;
  overflow: hidden;
  flex-shrink: 0;
}
.story-viewer-avatar img { width:100%;height:100%;object-fit:cover;border-radius:50%; }

.story-viewer-profile-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  cursor: pointer;
}
.story-viewer-profile-link:hover 
.story-viewer-profile-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  cursor: pointer;
}
.story-viewer-profile-link:hover .story-viewer-name { text-decoration: underline; }
.story-viewer-name { text-decoration: underline; }
.story-viewer-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0,0,0,0.5);
  flex: 1;
}
.story-viewers-anon {
  padding: 0.75rem 1.2rem;
  font-size: 0.82rem;
  color: var(--text2);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.story-viewer-time {
  font-size: 0.72rem;
  color: rgba(255,255,255,0.75);
}
.story-viewer-close {
  background: rgba(0,0,0,0.35);
  border: none;
  color: #fff;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  transition: background 0.15s;
}
.story-viewer-close:hover { background: rgba(0,0,0,0.6); }

.story-viewer-content {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.story-viewer-content img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.story-viewer-text {
  color: #fff;
  font-size: 1.3rem;
  font-weight: 700;
  text-align: center;
  padding: 2rem;
  text-shadow: 0 2px 8px rgba(0,0,0,0.4);
  line-height: 1.5;
}

.story-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.3);
  border: none;
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
  transition: background 0.15s;
}
.story-nav-btn:hover { background: rgba(0,0,0,0.55); }
.story-nav-prev { left: 10px; }
.story-nav-next { right: 10px; }

.story-delete-btn {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(220,38,38,0.85);
  border: none;
  color: #fff;
  padding: 0.45rem 1.2rem;
  border-radius: 50px;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 600;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: background 0.15s;
}
.story-delete-btn:hover { background: rgba(220,38,38,1); }
/* ── Story viewers modal ── */
.story-viewers-modal {
  position: fixed;
  inset: 0;
  z-index: 4000;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: env(safe-area-inset-bottom);
}
@media (min-width: 600px) {
  .story-viewers-modal { align-items: center; }
}
.story-viewers-box {
  background: var(--bg2);
  border-radius: 20px 20px 0 0;
  width: 100%;
  max-width: 420px;
  max-height: 60vh;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  box-shadow: 0 -8px 32px rgba(0,0,0,0.4);
  overflow: hidden;
}
@media (min-width: 600px) {
  .story-viewers-box { border-radius: 20px; }
}
.story-viewers-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.2rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
  flex-shrink: 0;
}
.story-viewers-list {
  overflow-y: auto;
  padding: 0.5rem 0;
}
.story-viewer-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 1.2rem;
  transition: background 0.15s;
}
.story-viewer-item:hover { background: var(--bg3); }
.story-viewer-av {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.story-viewer-name {
  font-size: 0.88rem;
  color: var(--text);
}


.story-view-count {
  font-size: 0.65rem;
  color: var(--accent2);
  display: flex;
  align-items: center;
  gap: 0.2rem;
  justify-content: center;
}

.story-owner-bar {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 0.8rem;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(6px);
  border-radius: 50px;
  padding: 0.4rem 1rem;
  z-index: 3;
  white-space: nowrap;
}
.story-owner-bar span {
  font-size: 0.82rem;
  color: rgba(255,255,255,0.9);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.story-owner-del {
  background: rgba(220,38,38,0.85);
  border: none;
  color: #fff;
  padding: 0.3rem 0.8rem;
  border-radius: 50px;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  transition: background 0.15s;
}
.story-owner-del:hover { background: rgba(220,38,38,1); }

/* ===== STORY REACTIONS ===== */
.story-react-bar {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  z-index: 3;
}
.story-react-btn {
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(6px);
  border: 2px solid rgba(255,255,255,0.2);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  font-size: 1.3rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s, border-color 0.15s;
  position: relative;
}
.story-react-btn:hover { transform: scale(1.15); }
.story-react-btn.reacted { border-color: #ff4d6d; background: rgba(255,77,109,0.25); }
.story-emoji-picker {
  position: absolute;
  bottom: 54px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 0.4rem;
  background: rgba(15,20,35,0.92);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 50px;
  padding: 0.5rem 0.8rem;
  z-index: 10;
  animation: storyPickerIn 0.18s ease;
}
@keyframes storyPickerIn {
  from { opacity:0; transform: translateX(-50%) scale(0.8) translateY(8px); }
  to   { opacity:1; transform: translateX(-50%) scale(1) translateY(0); }
}
.story-emoji-opt {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  border-radius: 50%;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s, background 0.15s;
}
.story-emoji-opt:hover { transform: scale(1.3); background: rgba(255,255,255,0.1); }
.story-emoji-opt.active { background: rgba(108,99,255,0.3); transform: scale(1.2); }
/* Animation émoji volant */
.story-emoji-fly {
  position: absolute;
  bottom: 70px;
  pointer-events: none;
  font-size: 1.5rem;
  animation: emojiFloat 1s ease-out forwards;
  z-index: 20;
}
@keyframes emojiFloat {
  0%   { opacity: 1; transform: translateY(0) scale(1); }
  60%  { opacity: 1; transform: translateY(-120px) scale(1.3) rotate(10deg); }
  100% { opacity: 0; transform: translateY(-200px) scale(0.6) rotate(-15deg); }
}



/* ── Modal création story ── */
.story-create-modal {
  position: fixed;
  inset: 0;
  z-index: 3000;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: env(safe-area-inset-bottom);
}
@media (min-width: 600px) {
  .story-create-modal { align-items: center; }
}
.story-create-box {
  background: var(--bg2);
  border-radius: 20px 20px 0 0;
  padding: 1.2rem;
  width: 100%;
  max-width: 440px;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  border: 1px solid var(--border);
  box-shadow: 0 -8px 32px rgba(0,0,0,0.4);
}
@media (min-width: 600px) {
  .story-create-box { border-radius: 20px; }
}
.story-create-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.story-create-preview {
  width: 100%;
  aspect-ratio: 9/16;
  max-height: 220px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: background 0.2s;
}
.story-create-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.story-colors {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.story-color-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2.5px solid transparent;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s;
}
.story-color-btn:hover { transform: scale(1.15); }
.story-color-btn.active { border-color: #fff; transform: scale(1.15); }
.story-create-box textarea {
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
  padding: 0.7rem 0.9rem;
  resize: none;
  outline: none;
  transition: border-color 0.15s;
}
.story-create-box textarea:focus { border-color: var(--accent); }
.story-create-actions {
  display: flex;
  gap: 0.6rem;
  align-items: center;
}

.story-viewer-reaction {
  margin-left: auto;
  font-size: 1.2rem;
  line-height: 1;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,0.3));
}

/* ══════════════════════════════════════════════════════════
   STORIES — PAGE MESSAGES
══════════════════════════════════════════════════════════ */

/* Colonne stories desktop (à gauche de la sidebar) */
.mpx-stories-col {
  width: 72px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-right: none;
  border-radius: 20px 0 0 20px;
  padding: 1rem 0;
  overflow: hidden;
  position: relative;
}
.mpx-stories-col::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 60px;
  background: linear-gradient(180deg, rgba(108,99,255,0.07) 0%, transparent 100%);
  pointer-events: none;
}
.mpx-stories-col-label {
  font-size: 0.55rem;
  font-weight: 800;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  margin-bottom: 0.8rem;
  opacity: 0.45;
}
.mpx-stories-col-list {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  overflow-y: auto;
  flex: 1;
  width: 100%;
  padding: 0.2rem 0 0.5rem;
  scrollbar-width: none;
}
.mpx-stories-col-list::-webkit-scrollbar { display: none; }

/* Bulle story desktop */
.mpx-story-bubble {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  cursor: pointer;
  position: relative;
  animation: storyBubbleIn 0.4s cubic-bezier(0.34,1.56,0.64,1) both;
}
@keyframes storyBubbleIn {
  from { opacity: 0; transform: scale(0.5) translateY(10px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.mpx-story-ring {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  padding: 2.5px;
  background: linear-gradient(135deg, #f59e0b, #6c63ff, #00d4aa);
  position: relative;
  transition: transform 0.2s, box-shadow 0.2s;
  flex-shrink: 0;
}
.mpx-story-ring.viewed { background: var(--border); }
.mpx-story-ring:hover {
  transform: scale(1.1);
  box-shadow: 0 0 0 3px rgba(108,99,255,0.25);
}
.mpx-story-ring:not(.viewed)::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f59e0b, #6c63ff, #00d4aa);
  opacity: 0.3;
  animation: storyGlow 2s ease-in-out infinite;
  z-index: -1;
}
@keyframes storyGlow {
  0%, 100% { transform: scale(1);   opacity: 0.3; }
  50%       { transform: scale(1.2); opacity: 0.55; }
}
.mpx-story-ring-inner {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--bg3);
  border: 2px solid var(--bg2);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.mpx-story-ring-inner img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.mpx-story-ring-inner .avatar-circle { width: 100% !important; height: 100% !important; border-radius: 50%; font-size: 0.65rem !important; }
.mpx-story-name {
  font-size: 0.58rem;
  color: var(--text2);
  text-align: center;
  max-width: 58px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mpx-story-new-dot {
  position: absolute;
  top: 0; right: 0;
  width: 11px; height: 11px;
  background: var(--accent);
  border-radius: 50%;
  border: 2px solid var(--bg2);
  animation: badgePop 0.3s ease;
}

/* Bande stories mobile (dans la sidebar) */
.mpx-stories-mobile {
  width: 100%;
  display: none;
  border-bottom: 1px solid var(--border);
  padding: 0.7rem 0 0.5rem;
}
.mpx-stories-mobile-title {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text2);
  margin-bottom: 0.6rem;
  padding: 0 0.8rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.mpx-stories-mobile-title i { color: var(--accent); font-size: 0.7rem; }
.mpx-stories-mobile-list {
  display: flex;
  gap: 0.8rem;
  overflow-x: auto;
  padding: 0.2rem 0.8rem 0.4rem;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.mpx-stories-mobile-list::-webkit-scrollbar { display: none; }

/* Bulle story mobile */
.mpx-story-bubble-mobile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  cursor: pointer;
  flex-shrink: 0;
  animation: storyBubbleIn 0.4s cubic-bezier(0.34,1.56,0.64,1) both;
}
.mpx-story-ring-mobile {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  padding: 2.5px;
  background: linear-gradient(135deg, #f59e0b, #6c63ff, #00d4aa);
  position: relative;
  transition: transform 0.2s;
}
.mpx-story-ring-mobile.viewed { background: var(--border); }
.mpx-story-ring-mobile:not(.viewed)::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f59e0b, #6c63ff, #00d4aa);
  opacity: 0.25;
  animation: storyGlow 2s ease-in-out infinite;
  z-index: -1;
}
.mpx-story-ring-mobile:hover { transform: scale(1.07); }
.mpx-story-ring-mobile-inner {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--bg3);
  border: 2px solid var(--bg2);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.mpx-story-ring-mobile-inner img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.mpx-story-ring-mobile-inner .avatar-circle { width: 100% !important; height: 100% !important; border-radius: 50%; font-size: 0.72rem !important; }
.mpx-story-name-mobile {
  font-size: 0.62rem;
  color: var(--text2);
  text-align: center;
  max-width: 56px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Responsive */
@media (max-width: 580px) {
  .mpx-stories-col { display: none !important; }
  .mpx-stories-mobile { display: block !important; }
}
@media (min-width: 581px) {
  .mpx-stories-mobile { display: none !important; }
  .mpx-stories-col { display: flex; }
}

/* ── Bouton Voir tout notifications ── */
.notif-see-all {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--border);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  transition: background 0.2s;
  flex-shrink: 0;
}
.notif-see-all:hover { background: rgba(108,99,255,0.08); }
.notif-see-all i:last-child { font-size: 0.7rem; opacity: 0.7; transition: transform 0.2s; }
.notif-see-all:hover i:last-child { transform: translateX(3px); }

/* ── Commentaires paginés + tri ── */
.comments-sort-bar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0 0.7rem;
  flex-wrap: wrap;
}
.comments-sort-label {
  font-size: 0.72rem;
  color: var(--text2);
  display: flex;
  align-items: center;
  gap: 0.3rem;
  margin-right: 0.2rem;
}
.comments-sort-btn {
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text2);
  padding: 0.22rem 0.7rem;
  border-radius: 50px;
  cursor: pointer;
  font-size: 0.72rem;
  font-family: inherit;
  transition: all 0.15s;
  white-space: nowrap;
}
.comments-sort-btn:hover { border-color: var(--accent); color: var(--accent); }
.comments-sort-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
}
.comments-load-more {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: transparent;
  border: none;
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  padding: 0.3rem 0;
  margin-bottom: 0.6rem;
  transition: opacity 0.2s;
}
.comments-load-more:hover { opacity: 0.75; }
.comments-load-more i { font-size: 0.7rem; }

/* Animation entrée commentaire */
@keyframes commentIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.comment-animate {
  animation: commentIn 0.25s ease both;
}

/* ── Comments section scroll ── */
.comments-section {
  max-height: 500px;
  overflow-y: auto;
  scroll-behavior: smooth;
}
.comments-section::-webkit-scrollbar { width: 3px; }
.comments-section::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ══════════════════════════════════════════════════════════
   COMMENTAIRES — Style amélioré + champ fixé en bas
══════════════════════════════════════════════════════════ */

/* Section commentaires scrollable sur post.html */
.post-page .comments-section {
  display: flex;
  flex-direction: column;
  max-height: 600px;
  border-radius: 16px;
  background: var(--bg2);
  border: 1px solid var(--border);
  margin-top: 0.8rem;
  overflow: hidden;
}

/* Zone scrollable des commentaires */
.post-page .comments-list {
  flex: 1;
  overflow-y: auto;
  padding: 0.8rem 1rem;
  scroll-behavior: smooth;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.post-page .comments-list::-webkit-scrollbar { width: 3px; }
.post-page .comments-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* Champ de saisie fixé en bas */
.post-page .comment-input-row,
.post-page .guest-comment-cta {
  flex-shrink: 0;
  padding: 0.8rem 1rem;
  border-top: 1px solid var(--border);
  background: var(--bg2);
  position: sticky;
  bottom: 0;
}

/* Bouton Voir précédents — style amélioré */
.comments-load-more {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.6rem 1rem;
  background: rgba(108,99,255,0.06);
  border: 1px dashed rgba(108,99,255,0.25);
  border-radius: 10px;
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  margin-bottom: 0.6rem;
  transition: background 0.2s, border-color 0.2s;
}
.comments-load-more:hover {
  background: rgba(108,99,255,0.12);
  border-color: var(--accent);
}
.comments-load-more i { font-size: 0.72rem; }
.comments-load-more-count {
  font-size: 0.68rem;
  background: rgba(108,99,255,0.15);
  color: var(--accent);
  padding: 0.1rem 0.45rem;
  border-radius: 50px;
  font-weight: 700;
}

/* Barre de tri — style amélioré */
.comments-sort-bar {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.5rem 0 0.7rem;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.6rem;
}
.comments-sort-label {
  font-size: 0.72rem;
  color: var(--text2);
  margin-right: 0.1rem;
}
.comments-sort-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text2);
  padding: 0.25rem 0.7rem;
  border-radius: 50px;
  cursor: pointer;
  font-size: 0.72rem;
  font-family: inherit;
  transition: all 0.15s;
  white-space: nowrap;
}
.comments-sort-btn i { font-size: 0.65rem; }
.comments-sort-btn:hover { border-color: var(--accent); color: var(--accent); }
.comments-sort-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
}

/* Animation entrée commentaire */
@keyframes commentIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.comment-animate { animation: commentIn 0.22s ease both; }

/* ── Items commentaires post.html ─────────────────────── */
.post-page .comments-list { gap: 0.1rem; }

.post-page .comment {
  padding: 0.5rem 0.6rem;
  border-radius: 12px;
  transition: background 0.15s;
}
.post-page .comment:hover { background: rgba(255,255,255,0.03); }

.post-page .comment img.avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 2px solid var(--border);
  flex-shrink: 0;
  object-fit: cover;
}

.post-page .comment-bubble {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 0 14px 14px 14px;
  padding: 0.5rem 0.85rem;
}

.post-page .comment-bubble strong {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text1);
  margin-bottom: 0.15rem;
}
.post-page .comment-bubble strong:hover { color: var(--accent); }

.post-page .comment-bubble p {
  font-size: 0.86rem;
  color: var(--text2);
  line-height: 1.45;
  margin: 0;
  word-break: break-word;
}

.post-page .comment-footer {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.28rem;
}

.post-page .comment-time {
  font-size: 0.7rem;
  color: var(--text2);
  opacity: 0.6;
}

.post-page .reply-btn {
  font-size: 0.72rem;
  color: var(--text2);
  opacity: 0.65;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  transition: color 0.15s, opacity 0.15s;
}
.post-page .reply-btn:hover { color: var(--accent); opacity: 1; }

/* Réponses imbriquées */
.post-page .replies-list {
  margin-top: 0.35rem;
  margin-left: 1rem;
  padding-left: 0.75rem;
  border-left: 2px solid rgba(108,99,255,0.2);
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}
.post-page .replies-list .comment-bubble {
  background: rgba(108,99,255,0.05);
  border-color: rgba(108,99,255,0.15);
}


/* Champ de saisie amélioré */
.post-page .comment-input-wrap {
  background: var(--bg3);
  border: 1.5px solid var(--border);
  border-radius: 50px;
  padding: 0.3rem 0.3rem 0.3rem 0.9rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.post-page .comment-input-wrap:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(108,99,255,0.1);
}
.post-page .comment-input-wrap input {
  border: none;
  background: transparent;
  padding: 0.4rem 0;
}
.post-page .comment-input-wrap input:focus { outline: none; }
.post-page .comment-input-wrap button {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  box-shadow: 0 2px 8px rgba(108,99,255,0.3);
}
.post-page .comment-input-wrap button:hover {
  transform: scale(1.08);
  box-shadow: 0 4px 14px rgba(108,99,255,0.45);
}

@media (max-width: 580px) {
  .post-page .comments-section { max-height: 70vh; }
}

/* ===== MENTIONS @ ===== */
.post-mention {
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  background: rgba(108,99,255,0.12);
  border-radius: 4px;
  padding: 0 3px;
  transition: background 0.2s;
  display: inline;
}
.post-mention:hover { background: rgba(108,99,255,0.25); }

/* ===== RESPONSIVE GLOBAL FIXES ===== */

/* Base : empêcher tout débordement horizontal */
html, body {
  max-width: 100vw;
  overflow-x: hidden;
}
* { box-sizing: border-box; }

/* ── Corrections petits écrans (≤ 480px) ── */
/* ===== STORY REPLY BAR ===== */
.story-bottom-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 4;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  padding-bottom: max(1rem, env(safe-area-inset-bottom, 1rem));
  background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.3) 60%, transparent 100%);
}
@media (max-width: 480px) {

  /* Navbar */
  .navbar { padding: 0.6rem 3%; }
  .btn-nav { max-width: 110px; font-size: 0.78rem; padding: 0.3rem 0.6rem; }
  .btn-nav span.nav-name { max-width: 55px; }

  /* Header site */
  .site-header { padding: 1.2rem 3%; }
  .site-header-text { min-width: 0; width: 100%; }
  .site-header-text h1 { font-size: 1.3rem; }
  .site-header-stats { gap: 1rem; }

  /* Feed */
  .feed-section { padding: 0.8rem 3%; }
  .feed-layout { grid-template-columns: 1fr; }
  .feed-main { overflow-x: hidden; box-sizing: border-box; }
  .user-post-panel { box-sizing: border-box; max-width: 100%; }
  .admin-panel { box-sizing: border-box; max-width: 100%; overflow-x: hidden; }
  .post-card { border-radius: 12px; box-sizing: border-box; }
  .post-header { padding: 0.8rem 0.9rem 0.5rem; }
  .post-body { padding: 0 0.9rem 0.8rem; }
  .post-stats { padding: 0.4rem 0.9rem; font-size: 0.75rem; gap: 0.8rem; }
  .post-actions { padding: 0.3rem 0.5rem; gap: 0.2rem; }
  .reaction-btn, .comment-toggle-btn { padding: 0.45rem 0.5rem; font-size: 0.8rem; }
  .reaction-label { font-size: 0.75rem; }
  .share-fb-btn { padding: 0.45rem 0.5rem; font-size: 0.8rem; }

  /* Commentaires */
  .comments-section { padding: 0.8rem 0.9rem; }
  .comment-input-wrap input { font-size: 0.82rem; padding: 0.45rem 0.7rem; }

  /* Stories */
  .story-card { width: 95px; height: 155px; }
  #storiesBar { padding: 0.6rem 0 0.3rem; gap: 0.5rem; }

  /* Dashboard */
  .dashboard-header { padding: 1.2rem 3% 0.6rem; }
  .dash-stats { padding: 0.6rem 3%; grid-template-columns: repeat(2, 1fr); gap: 0.5rem; }
  .dash-stat { padding: 0.8rem; }
  .dash-stat strong { font-size: 1rem; }
  .dash-section { padding: 0.8rem 3%; }
  .dash-tabs { padding: 0 3%; }
  .dash-tab { font-size: 0.75rem; padding: 0.45rem 0.6rem; }

  /* Profil */
  .profile-section { padding: 0.8rem 3%; }
  .profile-card { max-width: 100%; }
  .profile-cover { height: 90px; }
  .profile-body { padding: 0 1rem 1rem; }
  .profile-stats { flex-wrap: wrap; }
  .profile-stat { min-width: 70px; padding: 0.6rem 0.4rem; }
  .profile-stat strong { font-size: 1rem; }
  .profile-details { padding: 0.6rem 1rem; font-size: 0.78rem; gap: 0.5rem; }

  /* Profil public */
  .public-profile-page { padding: 0 0.5rem; margin: 1rem auto; }
  .public-profile-header { padding: 0 1rem 1rem; gap: 0.8rem; }
  .public-name-row h1 { font-size: 1.15rem; }
  .public-stat { padding: 0.7rem 0.3rem; }
  .public-stat strong { font-size: 0.95rem; }
  .public-actions { padding: 0.8rem 1rem; gap: 0.4rem; flex-wrap: wrap; }

  /* Notifications */
  .notif-panel { right: 0.3rem; left: 0.3rem; width: auto; top: 62px; }
  .notif-item { padding: 0.7rem 0.9rem; }

  /* Formations */
  .formations-hero { padding: 2rem 3% 1.5rem; }
  .formations-hero-text h1 { font-size: 1.4rem; }
  .formations-hero-text { min-width: 0; }
  .formations-search-wrap { flex: 1 1 100%; }
  .courses-grid { grid-template-columns: 1fr; gap: 0.8rem; }
  .course-card { border-radius: 12px; }

  /* Plans */
  .plans-compact-grid { grid-template-columns: 1fr; }
  .plans-compact { padding: 1rem 3%; }
  .plans-grid { grid-template-columns: 1fr; }

  /* Affiliation */
  .affiliation-section { padding: 1rem 3% 3rem; }
  .steps { flex-direction: column; align-items: center; }
  .step { min-width: 100%; max-width: 100%; }
  .comm-header, .comm-row { grid-template-columns: 1fr 1fr; font-size: 0.75rem; padding: 0.6rem 0.8rem; }
  .comm-header span:nth-child(3), .comm-row span:nth-child(3),
  .comm-header span:nth-child(4), .comm-row span:nth-child(4),
  .comm-header span:nth-child(5), .comm-row span:nth-child(5) { display: none; }

  /* Messagerie */
  .mpx-app { padding: 0; height: calc(100dvh - 70px); }
  .mpx-sidebar { width: 100%; min-width: 0; border-radius: 0; border: none; }
  .mpx-chat { border-radius: 0; border: none; }

  /* Modales */
  .upgrade-modal { border-radius: 14px; max-height: 95vh; }
  .upgrade-plans { grid-template-columns: 1fr; padding: 1rem; }
  .upgrade-payment { padding: 1rem; }
  .story-viewer { border-radius: 0; width: 100vw; height: var(--story-vh, 100vh); max-height: none; }
  .story-viewer-overlay { align-items: stretch; justify-content: stretch; padding: 0; background: #000; }

  /* Admin */
  .admin-kpi-grid { grid-template-columns: repeat(2, 1fr); gap: 0.5rem; }
  .admin-kpi { padding: 0.8rem; }
  .admin-kpi strong { font-size: 1rem; }
  .admin-form-row { flex-direction: column; }
  .admin-form-row input, .admin-form-row select { min-width: 0; width: 100%; }

  /* Footer */
  .footer { padding: 1.2rem 3%; }
}

/* ── Corrections très petits écrans (≤ 360px) ── */
@media (max-width: 360px) {
  .navbar { padding: 0.5rem 2.5%; }
  .btn-nav { max-width: 95px; font-size: 0.72rem; }
  .btn-nav span.nav-name { max-width: 45px; }
  .notif-bell { width: 30px; height: 30px; font-size: 0.82rem; }
  .msg-nav-btn { width: 30px; height: 30px; font-size: 0.82rem; }

  .feed-section { padding: 0.6rem 2.5%; }
  .post-header { padding: 0.7rem 0.7rem 0.4rem; }
  .post-body { padding: 0 0.7rem 0.7rem; }
  .post-title { font-size: 0.95rem; }
  .post-content { font-size: 0.85rem; }

  .story-card { width: 82px; height: 138px; }
  .story-card-footer span { font-size: 0.65rem; }

  .dash-stats { grid-template-columns: 1fr 1fr; gap: 0.4rem; }
  .dash-stat { padding: 0.65rem; }
  .dash-stat strong { font-size: 0.9rem; }
  .dash-tab { font-size: 0.7rem; padding: 0.4rem 0.5rem; }

  .profile-stat strong { font-size: 0.88rem; }
  .profile-stat span { font-size: 0.68rem; }

  .courses-grid { grid-template-columns: 1fr; }
  .course-info h3 { font-size: 0.9rem; }

  .admin-kpi-grid { grid-template-columns: 1fr 1fr; }
  .admin-kpi strong { font-size: 0.9rem; }
}

/* ── Corrections tablettes (481px – 768px) ── */
@media (min-width: 481px) and (max-width: 768px) {
  .feed-section { padding: 1rem 4%; }
  .feed-layout { grid-template-columns: 1fr; }
  .site-header { padding: 1.5rem 4%; }
  .dashboard-header { padding: 1.5rem 4% 0.8rem; }
  .dash-stats { padding: 0.8rem 4%; }
  .dash-section { padding: 1rem 4%; }
  .profile-section { padding: 1rem 4%; }
  .formations-hero { padding: 2.5rem 4% 2rem; }
  .affiliation-section { padding: 1.5rem 4% 4rem; }
  .courses-grid { grid-template-columns: repeat(2, 1fr); }
  .plans-compact-grid { grid-template-columns: repeat(2, 1fr); }
  .admin-kpi-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ── Empêcher les images de déborder ── */
img, video, iframe, embed, object {
  max-width: 100%;
}

/* ── Tableaux responsives ── */
.history-table, .admin-users-table, .video-admin-list, .video-price-list {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* ── Textes longs ── */
.post-title, .post-content p, .comment-bubble p, .notif-content p {
  overflow-wrap: break-word;
  word-break: break-word;
}

/* ── Plans compact sur mobile ── */
@media (max-width: 480px) {
  .plans-compact-grid { grid-template-columns: 1fr; }
  .plan-compact-card { padding: 1rem; }
  .plan-compact-price { font-size: 1rem; }
}

/* ===== STORY REPLY BAR ===== */

.story-react-btn {
  flex-shrink: 0;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.story-react-btn:hover { background: rgba(255,255,255,0.25); transform: scale(1.1); }
.story-react-btn.reacted { background: rgba(255,77,109,0.3); border-color: rgba(255,77,109,0.6); }
.story-reply-input {
  flex: 1;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.35);
  border-radius: 50px;
  color: #fff;
  padding: 0.6rem 1rem;
  font-size: 0.88rem;
  font-family: inherit;
  outline: none;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  transition: background 0.2s, border-color 0.2s;
  min-width: 0;
}
.story-reply-input::placeholder { color: rgba(255,255,255,0.6); }
.story-reply-input:focus {
  background: rgba(255,255,255,0.25);
  border-color: rgba(255,255,255,0.7);
}
.story-reply-send {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--accent);
  border: none;
  color: #fff;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.88rem;
  flex-shrink: 0;
  transition: transform 0.15s, background 0.2s;
}
.story-reply-send:hover { transform: scale(1.08); background: #8b5cf6; }
.story-reply-send:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
.story-reply-sent {
  font-size: 0.78rem;
  color: var(--accent2);
  font-weight: 600;
  animation: fadeIn 0.2s ease;
  white-space: nowrap;
  padding-left: 0.3rem;
}
@keyframes storyMsgFly {
  0%   { opacity: 1; transform: translateY(0) scale(1); }
  60%  { opacity: 1; transform: translateY(-28px) scale(1.05); }
  100% { opacity: 0; transform: translateY(-52px) scale(0.85); }
}
.story-msg-fly {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,212,170,0.9);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.35rem 0.9rem;
  border-radius: 50px;
  white-space: nowrap;
  pointer-events: none;
  animation: storyMsgFly 1.1s ease forwards;
  will-change: transform, opacity;
}

/* ── Story reply thumbnail in message ── */
.mpx-story-reply-wrap {
  position: relative;
  display: block;
  margin-bottom: 0.4rem;
  border-radius: 10px;
  overflow: hidden;
  width: 110px;
  max-width: 110px;
  flex-shrink: 0;
  cursor: pointer;
}
.mpx-story-reply-thumb {
  width: 110px;
  height: 150px;
  max-width: 110px;
  object-fit: cover;
  display: block;
  border-radius: 10px;
}
.mpx-story-reply-label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, transparent 100%);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 8px 6px 4px;
  text-align: center;
}

/* ── Avatar preview modal ── */
.avatar-preview-popup {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2rem 2rem 1.8rem;
  width: 100%;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  transform: scale(0.88) translateY(16px);
  transition: transform 0.28s cubic-bezier(0.34,1.56,0.64,1);
}
.avatar-preview-overlay.visible .avatar-preview-popup {
  transform: scale(1) translateY(0);
}
.avatar-preview-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}
.avatar-preview-circle-wrap {
  position: relative;
  width: 140px;
  height: 140px;
}
.avatar-preview-img {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  border: 3px solid var(--accent);
  animation: avatarPreviewPop 0.35s cubic-bezier(0.34,1.56,0.64,1) 0.1s both;
}
.avatar-preview-ring {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  opacity: 0.3;
  animation: avatarRingPulse 1.8s ease-in-out infinite;
}
@keyframes avatarPreviewPop {
  from { transform: scale(0.5); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}
@keyframes avatarRingPulse {
  0%, 100% { opacity: 0.3; transform: scale(1); }
  50%       { opacity: 0.08; transform: scale(1.1); }
}
.avatar-preview-hint {
  font-size: 0.78rem;
  color: var(--text2);
  text-align: center;
  margin: -0.3rem 0 0;
  line-height: 1.5;
}
.avatar-preview-actions {
  display: flex;
  gap: 0.7rem;
  width: 100%;
}
.avatar-preview-btn-cancel,
.avatar-preview-btn-confirm {
  flex: 1;
  border: none;
  border-radius: 10px;
  padding: 0.6rem 0.5rem;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  transition: opacity 0.15s;
}
.avatar-preview-btn-cancel {
  background: var(--bg3);
  color: var(--text2);
  border: 1px solid var(--border);
}
.avatar-preview-btn-confirm {
  background: var(--accent);
  color: #fff;
}
.avatar-preview-btn-cancel:hover { opacity: 0.8; }
.avatar-preview-btn-confirm:hover { opacity: 0.88; }

/* Reaction picker attaché au body — évite d'être caché sous les post-cards */
.reaction-picker--body {
  position: fixed;
  z-index: 9999;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 50px;
  padding: 0.4rem 0.6rem;
  display: flex;
  gap: 0.2rem;
  box-shadow: 0 8px 32px rgba(0,0,0,0.45);
  animation: fadeIn 0.15s ease;
}
.reaction-picker--body .rp-btn {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.2rem 0.3rem;
  border-radius: 50%;
  transition: transform 0.15s, background 0.15s;
  line-height: 1;
}
.reaction-picker--body .rp-btn:hover { transform: scale(1.35); background: rgba(108,99,255,0.12); }
.reaction-picker--body .rp-btn.rp-active { transform: scale(1.2); }

/* ===== DASHBOARD SIDEBAR VERTICALE (desktop uniquement) ===== */
@media (min-width: 1101px) {

  body.dash-sidebar-mode .dash-tabs {
    position: fixed;
    top: 56px;
    left: 0;
    width: 220px;
    height: calc(100vh - 56px);
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    padding: 1rem 0.7rem 1.5rem;
    border-bottom: none;
    border-right: 1px solid var(--border);
    overflow-y: auto;
    background: var(--bg2);
    scrollbar-width: none;
    z-index: 399;
    /* Dégradé subtil en haut */
    background-image: linear-gradient(180deg, rgba(108,99,255,0.06) 0%, transparent 120px);
  }
  body.dash-sidebar-mode .dash-tabs::-webkit-scrollbar { display: none; }

  /* Label section */
  body.dash-sidebar-mode .dash-tabs::before {
    content: 'MON ESPACE';
    display: block;
    font-size: 0.65rem;
    font-weight: 800;
    color: var(--text2);
    letter-spacing: 0.1em;
    padding: 0 0.5rem 0.8rem;
    opacity: 0.6;
  }

  body.dash-sidebar-mode .dash-tab {
    border-radius: 10px;
    border-bottom: none;
    padding: 0.65rem 0.9rem;
    justify-content: flex-start;
    font-size: 0.875rem;
    gap: 0.75rem;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s, transform 0.15s;
    border-left: 3px solid transparent;
  }
  body.dash-sidebar-mode .dash-tab:hover {
    background: rgba(108,99,255,0.08);
    color: var(--text);
    transform: translateX(2px);
  }
  body.dash-sidebar-mode .dash-tab i {
    width: 18px;
    text-align: center;
    font-size: 0.95rem;
    flex-shrink: 0;
  }
  body.dash-sidebar-mode .dash-tab.active {
    background: rgba(108,99,255,0.14);
    border-left-color: var(--accent);
    color: var(--accent);
    font-weight: 700;
  }
  body.dash-sidebar-mode .dash-tab.active i {
    color: var(--accent);
  }
  body.dash-sidebar-mode .admin-tab {
    margin-top: 0.5rem;
    border-top: 1px solid var(--border);
    padding-top: 0.8rem;
  }
  body.dash-sidebar-mode .admin-tab.active {
    background: rgba(245,158,11,0.12);
    border-left-color: var(--gold) !important;
    color: var(--gold) !important;
  }
  body.dash-sidebar-mode .admin-tab.active i {
    color: var(--gold) !important;
  }

  /* Decaler tout le contenu du dashboard */
  body.dash-sidebar-mode #dashboardSection {
    padding-left: 220px;
  }
}

/* ===== DASHBOARD ADMIN SIDEBAR ===== */
@media (min-width: 1101px) {

  .dash-admin-sidebar {
    position: fixed;
    top: 56px;
    left: 0;
    width: 220px;
    height: calc(100vh - 56px);
    background: var(--bg2);
    background-image: linear-gradient(180deg, rgba(245,158,11,0.05) 0%, transparent 100px);
    border-right: 1px solid var(--border);
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 399;
    padding: 0.8rem 0.6rem 2rem;
    scrollbar-width: none;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
  }
  .dash-admin-sidebar::-webkit-scrollbar { display: none; }

  /* Header admin */
  .das-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0.6rem 0.8rem;
    font-size: 0.88rem;
    font-weight: 800;
    color: var(--gold);
    border-bottom: 1px solid var(--border);
    margin-bottom: 0.5rem;
  }
  .das-header i { font-size: 1rem; }

  /* Label de groupe */
  .das-group-label {
    font-size: 0.6rem;
    font-weight: 800;
    color: var(--text2);
    letter-spacing: 0.1em;
    padding: 0.8rem 0.6rem 0.3rem;
    opacity: 0.55;
  }

  /* Item de navigation */
  .das-item {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.6rem 0.9rem;
    border-radius: 9px;
    border: none;
    border-left: 3px solid transparent;
    background: transparent;
    color: var(--text2);
    font-size: 0.85rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    text-align: left;
    width: 100%;
    transition: background 0.15s, color 0.15s, transform 0.12s;
    white-space: nowrap;
  }
  .das-item i {
    width: 16px;
    text-align: center;
    font-size: 0.88rem;
    flex-shrink: 0;
    opacity: 0.8;
  }
  .das-item:hover {
    background: rgba(245,158,11,0.07);
    color: var(--text);
    transform: translateX(2px);
  }
  .das-item.active {
    background: rgba(245,158,11,0.12);
    border-left-color: var(--gold);
    color: var(--gold);
    font-weight: 700;
  }
  .das-item.active i { opacity: 1; color: var(--gold); }

  /* Decaler le contenu quand sidebar admin presente */
  body.dash-sidebar-mode #dashboardSection {
    padding-left: 220px;
  }
}

/* Masquer la sous-nav admin horizontale sur desktop (remplacée par la sidebar) */
@media (min-width: 1101px) {
  body.dash-sidebar-mode .admin-subnav { display: none !important; }
}

/* Masquer la sous-nav admin horizontale sur desktop (remplacée par la sidebar) */
@media (min-width: 1101px) {
  body.dash-sidebar-mode .admin-subnav { display: none !important; }
}

/* Tabs admin hors de #dashboardSection — appliquer le décalage sidebar */
@media (min-width: 1101px) {
  body.dash-sidebar-mode #tab-videos,
  body.dash-sidebar-mode #tab-ebooks {
    padding-left: 220px;
  }
}
