/* ═══════════════════════════════════════════════════
   CAMPUS237 — Feuille de style complète (Module 5)
   Mobile-first · Thème orange
═══════════════════════════════════════════════════ */

/* ── Variables ── */
:root {
  --orange:        #ff7a00;
  --orange-hover:  #e66900;
  --orange-light:  #fff4ec;
  --orange-border: #ffd9b3;
  --text:          #1a1a1a;
  --text-light:    #6b7280;
  --text-xlight:   #9ca3af;
  --white:         #ffffff;
  --bg:            #f3f4f6;
  --border:        #e5e7eb;
  --shadow-sm:     0 1px 3px rgba(0,0,0,0.08);
  --shadow:        0 4px 16px rgba(0,0,0,0.08);
  --shadow-lg:     0 8px 32px rgba(0,0,0,0.12);
  --radius:        14px;
  --radius-sm:     9px;
  --radius-xs:     6px;
  --navbar-h:      58px;
  --transition:    0.18s ease;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Segoe UI', system-ui, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.6;
 /* padding-top: var(--navbar-h);*/
}

a { color: var(--orange); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--orange-hover); }

img { max-width: 100%; display: block; }

/* ═══════════════════════════════════════════════════════
   NAVBAR — Design original Campus237 + badges dynamiques
═══════════════════════════════════════════════════════ */

/* ── Barre principale ── */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    width: 100%;
    height: var(--navbar-h, 58px);
    background: var(--white);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 16px;
}

/* ── Logo ── */
.nav-logo {
    display: flex;
    align-items: center;
    gap: 7px;
    text-decoration: none;
    flex-shrink: 0;
    user-select: none;
}

.nav-logo-icon {
    font-size: 1.45rem;
    line-height: 1;
}

.nav-logo-text {
    font-size: 1.15rem;
    font-weight: 900;
    color: var(--text);
    letter-spacing: -0.5px;
    line-height: 1;
}

.nav-logo-accent {
    color: var(--orange);
}

/* ── Barre de recherche desktop ── */
.nav-search {
    flex: 1;
    max-width: 340px;
    margin: 0 8px;
}

.nav-search-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.nav-search-icon {
    position: absolute;
    left: 12px;
    font-size: 0.85rem;
    pointer-events: none;
    opacity: 0.55;
}

.nav-search-input {
    width: 100%;
    padding: 8px 12px 8px 36px;
    border: 1.5px solid var(--border);
    border-radius: 22px;
    font-size: 0.88rem;
    background: #f5f5f5;
    color: var(--text);
    outline: none;
    transition: border-color 0.2s, background 0.2s;
    font-family: inherit;
}
.nav-search-input:focus {
    border-color: var(--orange);
    background: var(--white);
}
.nav-search-input::placeholder { color: var(--text-xlight); }

/* ── Liens desktop ── */
.nav-links {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
    flex-shrink: 0;
}

/* Lien / bouton générique de la navbar */
.nav-link {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--text-light);
    font-size: 0.78rem;
    font-weight: 600;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
    cursor: pointer;
    border: none;
    background: none;
    font-family: inherit;
    line-height: 1;
}
.nav-link:hover,
.nav-link:focus-visible {
    background: var(--orange-light);
    color: var(--orange);
    text-decoration: none;
    outline: none;
}
.nav-link--active {
    color: var(--orange) !important;
    background: var(--orange-light);
}
/* Variante bouton (notifications) */
.nav-link--btn {
    cursor: pointer;
}

/* Icône + badge dans un lien */
.nav-link-icon-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
}

.nav-link-icon {
    font-size: 1.25rem;
    line-height: 1;
    display: block;
}

.nav-link-label {
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.2px;
    text-transform: uppercase;
    color: inherit;
    line-height: 1;
}
.nav-link--active .nav-link-label { color: var(--orange); }
.nav-link:hover .nav-link-label   { color: var(--orange); }

/* Lien Déconnexion */
.nav-link--logout { font-size: 1.1rem; }
.nav-link--logout:hover { background: #fef2f2; color: #dc2626; }

/* Lien profil */
.nav-link--profil { min-width: 60px; }
.nav-profil-name  {
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.62rem;
}

/* ── Avatar navbar ── */
.nav-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--orange), #ffb347);
    flex-shrink: 0;
}
.nav-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.nav-avatar-fallback {
    color: #fff;
    font-size: 0.85rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

/* ── Badges ── */
.nav-badge {
    position: absolute;
    top: -4px;
    right: -7px;
    min-width: 17px;
    height: 17px;
    background: #ef4444;
    color: #fff;
    font-size: 0.58rem;
    font-weight: 800;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
    border: 2px solid var(--white);
    pointer-events: none;
    z-index: 2;
    line-height: 1;
}

/* Badge sur le burger */
.nav-badge--burger {
    top: -6px;
    right: -6px;
    background: var(--orange);
}

/* Animation pop quand valeur change */
@keyframes badge-pop {
    0%   { transform: scale(0.4); opacity: 0; }
    60%  { transform: scale(1.3); }
    100% { transform: scale(1);   opacity: 1; }
}
.badge--pop { animation: badge-pop 0.3s cubic-bezier(0.34,1.56,0.64,1) forwards; }

/* ── Zone notif (dropdown parent) ── */
.nav-notif-wrap {
    position: relative;
}

/* ── Dropdown notifications ── */
.notif-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: -8px;
    width: 320px;
    max-width: calc(100vw - 24px);
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 8px 32px rgba(0,0,0,0.13);
    z-index: 200;
    display: none;
    flex-direction: column;
    overflow: hidden;
}
.notif-dropdown--open { display: flex; }

.notif-dropdown--mobile {
    position: fixed;
    top: var(--navbar-h, 58px);
    right: 8px;
    left: 8px;
    width: auto;
}

.notif-dropdown-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px 10px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.notif-dropdown-title {
    font-size: 0.88rem;
    font-weight: 800;
    color: var(--text);
}
.notif-mark-all {
    background: none;
    border: none;
    color: var(--orange);
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    padding: 0;
    font-family: inherit;
}
.notif-mark-all:hover { text-decoration: underline; }

.notif-dropdown-list {
    overflow-y: auto;
    max-height: 340px;
    scrollbar-width: thin;
}
.notif-dropdown-empty {
    padding: 24px 16px;
    text-align: center;
    font-size: 0.82rem;
    color: var(--text-xlight);
}

/* Item notification dans le dropdown */
.notif-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 11px 16px;
    text-decoration: none;
    color: var(--text);
    border-bottom: 1px solid #f5f5f5;
    transition: background 0.15s;
    position: relative;
}
.notif-item:hover  { background: #f9fafb; text-decoration: none; color: var(--text); }
.notif-item--unread{ background: var(--orange-light); }
.notif-item--unread:hover { background: #fff0e0; }

.notif-item-icon { font-size: 1.1rem; flex-shrink: 0; margin-top: 1px; }
.notif-item-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.notif-item-msg  { font-size: 0.82rem; line-height: 1.4; color: var(--text); }
.notif-item-time { font-size: 0.7rem;  color: var(--text-xlight); }
.notif-item-dot  {
    position: absolute;
    top: 50%; right: 14px;
    transform: translateY(-50%);
    width: 8px; height: 8px;
    background: var(--orange);
    border-radius: 50%;
    flex-shrink: 0;
}

.notif-dropdown-footer {
    display: block;
    text-align: center;
    padding: 11px;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--orange);
    text-decoration: none;
    border-top: 1px solid var(--border);
    transition: background 0.15s;
    flex-shrink: 0;
}
.notif-dropdown-footer:hover { background: var(--orange-light); text-decoration: none; }

/* ── Mobile : icônes à droite du burger ── */
.nav-mobile-right {
    display: none;   /* masqué sur desktop */
    align-items: center;
    gap: 4px;
    margin-left: auto;
}

.nav-mobile-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-light);
    font-size: 1.2rem;
    position: relative;
    transition: background 0.15s;
    text-decoration: none;
}
.nav-mobile-icon-btn:hover { background: var(--orange-light); }

/* ── Burger ── */
.nav-burger {
    display: none;   /* masqué sur desktop */
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: none;
    border: none;
    cursor: pointer;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0;
    position: relative;
    transition: background 0.15s;
    flex-shrink: 0;
}
.nav-burger:hover { background: var(--orange-light); }

.nav-burger-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    position: relative;
    width: 20px;
}

.burger-line {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: transform 0.28s ease, opacity 0.28s ease, width 0.28s ease;
    transform-origin: center;
}

/* Burger ouvert → croix */
.burger--open .burger-line:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.burger--open .burger-line:nth-child(2) { opacity: 0; width: 0; }
.burger--open .burger-line:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Overlay mobile ── */
.nav-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 98;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}
.nav-overlay--active { display: block; }

/* ── Scroll to top ── */
.scroll-top-btn {
    position: fixed;
    bottom: 22px;
    right: 16px;
    z-index: 90;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--orange);
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(255,122,0,0.35);
    opacity: 0;
    transform: translateY(12px);
    pointer-events: none;
    transition: opacity 0.25s, transform 0.25s, background 0.15s;
}
.scroll-top-btn--visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}
.scroll-top-btn:hover { background: var(--orange-hover); }

/* ── Recherche mobile (barre sous navbar) ── */
.nav-search-mobile {
    position: sticky;
    top: var(--navbar-h, 58px);
    z-index: 99;
    background: var(--white);
    padding: 8px 14px;
    border-bottom: 1px solid var(--border);
}

/* ── Liens guest (non connecté) ── */
.nav-links--guest {
    margin-left: auto;
    gap: 8px;
}
.nav-btn-login {
    width: auto !important;
    padding: 8px 18px !important;
}

/* ═══════════════════════════════════════════════════════
   RESPONSIVE — TABLETTE (≤ 900px)
═══════════════════════════════════════════════════════ */
@media (max-width: 900px) {

    .nav-search { max-width: 220px; }

    .nav-link-label { display: none; }   /* masquer les labels texte */
    .nav-profil-name{ display: none; }

}

/* ═══════════════════════════════════════════════════════
   RESPONSIVE — MOBILE (≤ 700px)
   Le menu passe en drawer latéral
═══════════════════════════════════════════════════════ */
@media (max-width: 700px) {

    .navbar { padding: 0 12px; gap: 8px; }

    /* Masquer recherche et liens desktop */
    .nav-search  { width: max-content; }
    .nav-links   {
        /* Drawer latéral droit */
        position: fixed;
        top: 60px;
        right: -100%;
        bottom: 0;
        width: min(280px, 82vw);
        background: var(--white);
        flex-direction: column;
        align-items: stretch;
        gap: 2px;
        padding: 0px 12px 20px;
        overflow-y: auto;
        z-index: 99;
        transition: right 0.3s cubic-bezier(0.4,0,0.2,1);
        box-shadow: -4px 0 24px rgba(0,0,0,0.12);
        border-left: 1px solid var(--border);
        margin-left: 0;
    }
    .nav-links--open { right: 0; }

    /* Dans le drawer : liens en ligne pleine largeur */
    .nav-links .nav-link {
        flex-direction: row;
        justify-content: flex-start;
        gap: 12px;
        padding: 13px 16px;
        border-radius: var(--radius-sm);
        font-size: 0.92rem;
        width: 100%;
    }
    .nav-links .nav-link-label  { display: block; font-size: 0.92rem; text-transform: none; letter-spacing: 0; font-weight: 600; }
    .nav-links .nav-profil-name { display: block; font-size: 0.92rem; max-width: none; }
    .nav-links .nav-link-icon   { font-size: 1.3rem; }
    .nav-links .nav-link-icon-wrap { width: 32px; height: 32px; }

    /* Dropdown notif dans le drawer */
    .nav-links .nav-notif-wrap { width: 100%; }
    .nav-links .nav-link--btn  {
        flex-direction: row;
        justify-content: flex-start;
        gap: 12px;
        width: 100%;
        padding: 13px 16px;
    }

    /* Icônes mobiles visibles */
    .nav-mobile-right { display: flex; }
    .nav-burger       { display: flex; }

    /* Dropdown notif mobile : plein écran */
    .notif-dropdown--mobile {
        position: fixed;
        top: var(--navbar-h, 58px);
        right: 8px;
        left: 8px;
        width: auto;
        z-index: 200;
    }

    /* Recherche mobile */
    .nav-search-mobile { display: block; }

}

/* ═══════════════════════════════════════════════════════
   RESPONSIVE — TRÈS PETIT MOBILE (≤ 380px)
═══════════════════════════════════════════════════════ */
@media (max-width: 380px) {
    .navbar { padding: 0 8px; }
    .nav-logo-text { font-size: 1rem; }
    .nav-mobile-icon-btn { width: 34px; height: 34px; }
    .nav-burger          { width: 36px; height: 36px; }
}

/* ═══════════════════════════════════════════════════
   NAVBAR
═══════════════════════════════════════════════════ */
.navbar {
  position: sticky;
  top: 0; left: 0; right: 0;
  height: var(--navbar-h);
  background: var(--white);
  border-bottom: 2px solid var(--orange);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 200;
  box-shadow: var(--shadow-sm);
}

/* Logo */
.navbar-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.35rem;
  font-weight: 900;
  color: var(--text);
  letter-spacing: -0.5px;
  text-decoration: none;
}
.brand-icon  { font-size: 1.5rem; }
.brand-text  { color: var(--text); }
.brand-accent{ color: var(--orange); }

/* Liens desktop */
.navbar-links {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  border-radius: 20px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-light);
  transition: background var(--transition), color var(--transition);
  text-decoration: none;
}
.nav-link:hover,
.nav-link.active {
  background: var(--orange-light);
  color: var(--orange);
}

/* Bouton logout */
.btn-logout {
  background: var(--orange-light);
  color: var(--orange);
  border: 1.5px solid var(--orange-border);
  padding: 7px 14px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition);
  white-space: nowrap;
}
.btn-logout:hover {
  background: #fde0c0;
  border-color: var(--orange);
}

/* ── Burger (mobile) ── */
.navbar-burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-xs);
  transition: background var(--transition);
}
.navbar-burger:hover { background: var(--orange-light); }
.navbar-burger span {
  display: block;
  width: 22px;
  height: 2.5px;
  background: var(--text);
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}

/* Burger → croix */
.navbar-burger.open span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
.navbar-burger.open span:nth-child(2) { opacity: 0; }
.navbar-burger.open span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

/* Overlay mobile */
.nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  z-index: 150;
}
.nav-overlay.active { display: none; }

/* ═══════════════════════════════════════════════════
   LAYOUT
═══════════════════════════════════════════════════ */
.main-container {
  max-width: 660px;
  margin: 24px auto;
  padding: 0 14px;
}

/* Card générique */
.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  margin-bottom: 14px;
  transition: box-shadow var(--transition);
}
.card:hover { box-shadow: var(--shadow); }

/* ═══════════════════════════════════════════════════
   PAGES AUTH (login / register)
═══════════════════════════════════════════════════ */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: linear-gradient(135deg, #ff7a00, #ffb347);
}

.auth-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 36px 32px;
  width: 100%;
  max-width: 420px;
}

.auth-logo { text-align: center; margin-bottom: 28px; }
.auth-logo h1 {
  font-size: 2rem;
  font-weight: 900;
  color: var(--orange);
  letter-spacing: -1px;
}
.auth-logo p { color: var(--text-light); font-size: 0.88rem; margin-top: 4px; }

.auth-title {
  font-size: 1.2rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 20px;
}

/* Champs formulaire */
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 6px;
}
.form-group input,
.form-group select {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.97rem;
  color: var(--text);
  background: #fafafa;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
  appearance: none;
}
.form-group input:focus,
.form-group select:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(255,122,0,0.12);
  background: var(--white);
}
.form-group input::placeholder { color: #c0c0c0; }

.form-row { display: flex; gap: 12px; }
.form-row .form-group { flex: 1; }

/* Bouton principal */
.btn-primary {
  display: block;
  width: 100%;
  padding: 13px;
  background: var(--orange);
  color: var(--white);
  border: none;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--transition), transform 0.1s, box-shadow var(--transition);
  text-align: center;
  letter-spacing: 0.2px;
}
.btn-primary:hover  {
  background: var(--orange-hover);
  box-shadow: 0 4px 14px rgba(255,122,0,0.35);
}
.btn-primary:active { transform: scale(0.98); }

.auth-switch { text-align: center; margin-top: 20px; font-size: 0.9rem; color: var(--text-light); }

/* Messages flash */
.flash {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  font-size: 0.9rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
}
.flash.error   { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.flash.success { background: #f0fdf4; color: #16a34a; border: 1px solid #bbf7d0; }
.flash.info    { background: var(--orange-light); color: var(--orange); border: 1px solid var(--orange-border); }

/* ═══════════════════════════════════════════════════
   FORMULAIRE DE POST
═══════════════════════════════════════════════════ */
.post-form-card { padding: 18px 20px; }

.post-form-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  color: var(--text-light);
  font-size: 0.93rem;
}

/* Sélecteur de type (chips radio) */
.type-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 12px;
}

.type-chip input[type="radio"] { display: none; }

.type-chip span {
  display: inline-block;
  padding: 5px 12px;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-light);
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition), color var(--transition);
  user-select: none;
}

.type-chip input:checked + span {
  border-color: var(--orange);
  background: var(--orange-light);
  color: var(--orange);
}

.type-chip span:hover { border-color: var(--orange); color: var(--orange); }

/* Textarea */
.post-textarea {
  width: 100%;
  min-height: 90px;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-family: inherit;
  color: var(--text);
  resize: vertical;
  outline: none;
  background: #fafafa;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.post-textarea:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(255,122,0,0.10);
  background: var(--white);
}
.post-textarea::placeholder { color: #c0c0c0; }

/* Compteur caractères */
.char-counter {
  text-align: right;
  font-size: 0.75rem;
  color: var(--text-xlight);
  margin: 4px 0 10px;
  transition: color var(--transition);
}
.char-counter.warn { color: #f59e0b; }
.char-counter.over { color: #dc2626; }

/* Zone upload */
.file-upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-bottom: 14px;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
}
.file-upload-zone:hover,
.file-upload-zone.dragover {
  border-color: var(--orange);
  background: var(--orange-light);
}

.file-input-hidden { display: none; }

.file-upload-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  color: var(--text-light);
  font-size: 0.88rem;
}
.file-icon { font-size: 1.1rem; }

/* Pied formulaire */
.post-form-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.file-hint { font-size: 0.75rem; color: var(--text-xlight); }
.btn-publish { width: auto; padding: 10px 24px; margin-top: 0; font-size: 0.93rem; }

/* ═══════════════════════════════════════════════════
   FILTRES
═══════════════════════════════════════════════════ */
.filters-bar {
  padding: 14px 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.filters-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  flex: 1;
}

.filter-group { display: flex; flex-direction: column; gap: 3px; }
.filter-group label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-xlight);
}
.filter-group select {
  padding: 6px 10px;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  font-size: 0.83rem;
  color: var(--text);
  background: var(--white);
  outline: none;
  cursor: pointer;
  appearance: none;
  transition: border-color var(--transition);
}
.filter-group select:focus { border-color: var(--orange); }

.filter-reset {
  font-size: 0.8rem;
  color: #dc2626;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  transition: background var(--transition);
  align-self: flex-end;
}
.filter-reset:hover { background: #fef2f2; color: #dc2626; }

.filter-summary {
  font-size: 0.78rem;
  color: var(--text-xlight);
  white-space: nowrap;
  margin-left: auto;
}

/* ═══════════════════════════════════════════════════
   POSTS
═══════════════════════════════════════════════════ */
.post-card { padding: 18px 20px; }

/* Avatar */
.avatar-sm {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--orange), #ffb347);
  color: var(--white);
  font-weight: 900;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}
.avatar-sm img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* En-tête post */
.post-header {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  margin-bottom: 12px;
}

.post-meta { flex: 1; display: flex; flex-direction: column; gap: 1px; }
.post-author { font-size: 0.95rem; font-weight: 700; }
.post-submeta { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.post-school  { font-size: 0.78rem; color: var(--text-light); }
.post-level   { font-size: 0.78rem; color: var(--text-xlight); }
.post-date    { font-size: 0.75rem; color: var(--text-xlight); }

/* Badge type */
.post-type-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 20px;
  white-space: nowrap;
  flex-shrink: 0;
}
.post-type-discussion { background: #eff6ff; color: #2563eb; }
.post-type-cours      { background: #f0fdf4; color: #16a34a; }
.post-type-question   { background: #fefce8; color: #ca8a04; }
.post-type-partage    { background: var(--orange-light); color: var(--orange); }

/* Bouton supprimer */
.delete-form { margin-left: 4px; }
.btn-delete {
  width: 30px; height: 30px;
  background: none; border: none;
  color: var(--border);
  font-size: 0.95rem;
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition), color var(--transition);
}
.btn-delete:hover { background: #fef2f2; color: #dc2626; }

/* Contenu */
.post-content {
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--text);
  word-break: break-word;
  margin-bottom: 12px;
}

/* Média */
.post-media { margin-bottom: 10px; }
.post-image {
  width: 100%;
  border-radius: var(--radius-sm);
  max-height: 420px;
  object-fit: cover;
}
.pdf-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--orange-light);
  color: var(--orange);
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.88rem;
  border: 1px solid var(--orange-border);
  transition: background var(--transition);
}
.pdf-link:hover { background: #fde0c0; color: var(--orange); }

/* ── Interactions ── */
.post-interactions { margin-top: 10px; }
.interaction-counts { display: flex; gap: 12px; margin-bottom: 6px; }
.count-badge { font-size: 0.8rem; color: var(--text-light); }
.interaction-divider { height: 1px; background: var(--border); margin-bottom: 4px; }
.interaction-buttons { display: flex; gap: 4px; }

.btn-interact {
  flex: 1;
  background: none;
  border: none;
  padding: 8px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-light);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background var(--transition), color var(--transition);
}
.btn-interact:hover { background: #f5f5f5; color: var(--text); }
.btn-interact.liked { color: #dc2626; }
.btn-interact.liked:hover { background: #fef2f2; }

/* ── Commentaires ── */
.comments-section {
  margin-top: 12px;
  border-top: 1px solid #f3f4f6;
  padding-top: 12px;
}
.comments-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }

.comment-item { display: flex; gap: 10px; }

.avatar-xs {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--orange), #ffb347);
  color: var(--white);
  font-weight: 900;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}
.avatar-xs img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

.comment-body {
  background: #f9fafb;
  border-radius: 0 var(--radius-sm) var(--radius-sm) var(--radius-sm);
  padding: 8px 12px;
  flex: 1;
}
.comment-header {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 2px;
}
.comment-header strong { font-size: 0.83rem; color: var(--text); }
.comment-header time   { font-size: 0.72rem; color: var(--text-xlight); }
.comment-text { font-size: 0.88rem; color: var(--text); line-height: 1.5; word-break: break-word; }

.comment-input-row { display: flex; gap: 10px; align-items: flex-start; }
.comment-input-wrap {
  flex: 1;
  display: flex;
  gap: 8px;
  align-items: flex-end;
  background: #f3f4f6;
  border-radius: 20px;
  padding: 8px 14px;
  border: 1.5px solid transparent;
  transition: border-color var(--transition), background var(--transition);
}
.comment-input-wrap:focus-within { border-color: var(--orange); background: var(--white); }

.comment-textarea {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  font-size: 0.88rem;
  font-family: inherit;
  color: var(--text);
  resize: none;
  min-height: 22px;
  max-height: 100px;
  line-height: 1.45;
}
.comment-textarea::placeholder { color: #c0c0c0; }
.btn-send {
  background: none;
  border: none;
  color: var(--orange);
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  flex-shrink: 0;
  transition: color var(--transition);
  padding: 2px 0;
}
.btn-send:hover { color: var(--orange-hover); }

/* ── Empty state ── */
.empty-state {
  text-align: center;
  padding: 52px 24px;
}
.empty-icon  { font-size: 3.2rem; margin-bottom: 14px; }
.empty-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 8px; color: var(--text); }
.empty-text  { font-size: 0.9rem; color: var(--text-light); line-height: 1.6; }

/* ── Footer ── */
.site-footer {
  padding: 28px 16px;
  text-align: center;
  color: var(--text-xlight);
  font-size: 0.8rem;
  border-top: 1px solid var(--border);
  margin-top: 16px;
  background: var(--white);
}
.footer-inner { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px; }
.footer-brand { font-weight: 700; color: var(--orange); }
.footer-sep   { color: var(--border); }

/* ── Scroll to top ── */
.scroll-top {
  position: fixed;
  bottom: 24px;
  right: 18px;
  width: 42px;
  height: 42px;
  background: var(--orange);
  color: var(--white);
  border: none;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(255,122,0,0.4);
  transition: background var(--transition), transform var(--transition);
  z-index: 100;
}
.scroll-top.visible { display: flex; }
.scroll-top:hover   { background: var(--orange-hover); transform: translateY(-2px); }

/* ═══════════════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════════════ */

/* Mobile : navbar en menu déroulant */
@media (max-width: 640px) {

  .navbar-burger { display: flex; }

  .navbar-links {
    position: fixed;
    top: var(--navbar-h);
    right: 0;
    width: 230px;
    height: calc(100vh - var(--navbar-h));
    background: var(--white);
    flex-direction: column;
    align-items: stretch;
    padding: 16px 12px;
    gap: 4px;
    box-shadow: -4px 0 24px rgba(0,0,0,0.1);
    transform: translateX(100%);
    transition: transform 0.25s ease;
    z-index: 180;
    overflow-y: auto;
  }
  .navbar-links.open { transform: translateX(0); }

  .nav-link  { border-radius: var(--radius-sm); padding: 11px 14px; font-size: 0.95rem; }
  .btn-logout { border-radius: var(--radius-sm); padding: 11px 14px; width: 100%; text-align: left; }

  /* Layout */
  .main-container { padding: 0 10px; margin: 16px auto; }

  /* Formulaire */
  .post-form-footer { flex-direction: column; align-items: stretch; }
  .btn-publish { width: 100%; }
  .file-hint   { text-align: center; }

  /* Filtres */
  .filters-bar { flex-direction: column; align-items: stretch; }
  .filters-form { flex-direction: row; }
  .filter-group select { width: 100%; }
  .filter-summary { text-align: right; }

  /* Post */
  .post-type-badge { display: none; } /* caché sur très petit écran */
  .btn-interact  { font-size: 0.82rem; }
}

/* Tablette */
@media (min-width: 641px) and (max-width: 900px) {
  .main-container { padding: 0 20px; }
}
/* ═══════════════════════════════════════════
   AVATAR UNIVERSEL
═══════════════════════════════════════════ */

.avatar-sm {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ff7a00, #ffb347);
  flex-shrink: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.avatar-xs {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ff7a00, #ffb347);
  flex-shrink: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.avatar-sm img,
.avatar-xs img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

.avatar-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  color: #ffffff;
  border-radius: 50%;
}

.avatar-sm .avatar-fallback { font-size: 1rem; }
.avatar-xs .avatar-fallback { font-size: 0.75rem; }

/* Avatar cliquable (lien vers profil) */
.avatar-link { display: block; flex-shrink: 0; text-decoration: none; }
.avatar-link:hover .avatar-sm,
.avatar-link:hover .avatar-xs {
  opacity: 0.85;
  transform: scale(1.05);
  transition: opacity 0.15s, transform 0.15s;
}

/* Nom auteur cliquable */
.post-author-link { text-decoration: none; color: inherit; }
.post-author-link:hover .post-author { color: var(--orange); }

/* ═══════════════════════════════════════════
   PROFIL
═══════════════════════════════════════════ */

.profile-container { max-width: 680px; }

.profile-card {
  overflow: hidden;
  padding: 0 !important;
  margin-bottom: 18px;
}

.profile-banner {
  height: 120px;
  background: linear-gradient(135deg, #ff7a00, #ffb347);
  position: relative;
  z-index: 0;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 14px 16px;
}

.btn-edit-banner {
  background: rgba(255,255,255,0.25);
  color: #ffffff;
  border: 1.5px solid rgba(255,255,255,0.55);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.18s;
}
.btn-edit-banner:hover {
  background: rgba(255,255,255,0.40);
  color: #ffffff;
  text-decoration: none;
}

.profile-body { padding: 0 24px 24px; }

/* Avatar chevauche la bannière */
.profile-avatar-wrap {
  margin-top: -52px;
  margin-bottom: 14px;
  position: relative;
  z-index: 10;
  width: fit-content;
}

.profile-avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  border: 4px solid #ffffff;
  background: linear-gradient(135deg, #ff7a00, #ffb347);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  position: relative;
  z-index: 10;
}

.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

.profile-avatar .avatar-fallback {
  font-size: 2.4rem;
  font-weight: 900;
}

.profile-name {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 10px;
  letter-spacing: -0.3px;
}

.profile-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 12px;
}

.profile-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
}

.badge-ecole  { background: #eff6ff; color: #1d4ed8; }
.badge-niveau { background: var(--orange-light); color: var(--orange); }

.profile-bio       { font-size: 0.93rem; color: var(--text-light); line-height: 1.7; margin-bottom: 10px; }
.profile-bio-vide  { font-style: italic; color: var(--text-xlight); }
.profile-since     { font-size: 0.78rem; color: var(--text-xlight); margin-bottom: 16px; }

.profile-stats {
  display: flex;
  align-items: center;
  background: #f9fafb;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 0;
  margin-bottom: 18px;
}

.stat-bloc { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; }
.stat-val  { font-size: 1.5rem; font-weight: 800; color: var(--orange); line-height: 1; }
.stat-lbl  { font-size: 0.72rem; color: var(--text-xlight); font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.stat-sep  { width: 1px; height: 40px; background: var(--border); flex-shrink: 0; }

.profile-cta { display: flex; }
.btn-edit-profil {
  width: auto;
  padding: 10px 22px;
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.section-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-xlight);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin: 4px 0 12px 4px;
}

.post-mini-stats {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #f3f4f6;
  font-size: 0.83rem;
  color: var(--text-light);
}

.post-see-link {
  margin-left: auto;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--orange);
}
.post-see-link:hover { color: var(--orange-hover); }

/* ═══════════════════════════════════════════
   EDIT PROFILE
═══════════════════════════════════════════ */

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-light);
  margin-bottom: 14px;
}
.breadcrumb a    { color: var(--orange); font-weight: 600; }
.breadcrumb span { color: var(--text-xlight); }

.edit-card { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; margin-bottom: 24px; }

.edit-card-header { background: linear-gradient(135deg, #ff7a00, #ffb347); padding: 22px 28px 20px; }
.edit-card-title  { font-size: 1.2rem; font-weight: 800; color: #ffffff; margin-bottom: 4px; }
.edit-card-sub    { font-size: 0.82rem; color: rgba(255,255,255,0.80); }

.edit-card-body    { padding: 24px 28px; }
.edit-section      { margin-bottom: 6px; }
.edit-section-label {
  font-size: 0.75rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.7px;
  color: var(--text-xlight); margin-bottom: 14px;
  display: flex; align-items: center; gap: 8px;
}
.label-opt    { font-weight: 400; font-size: 0.75rem; color: var(--text-xlight); text-transform: none; letter-spacing: 0; font-style: italic; }
.label-locked { font-weight: 500; font-size: 0.72rem; color: var(--text-xlight); text-transform: none; letter-spacing: 0; }
.edit-divider { height: 1px; background: var(--border); margin: 20px 0; }

.photo-edit-row   { display: flex; align-items: center; gap: 20px; }
.photo-circle {
  width: 80px; height: 80px; border-radius: 50%;
  background: linear-gradient(135deg, #ff7a00, #ffb347);
  overflow: hidden; position: relative; flex-shrink: 0;
  border: 3px solid var(--orange-border); cursor: pointer;
}
.photo-circle img  { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }
.photo-initiale    { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 1.9rem; font-weight: 900; color: #ffffff; }
.photo-change-overlay {
  position: absolute; inset: 0; background: rgba(0,0,0,0.42);
  border-radius: 50%; display: flex; align-items: center;
  justify-content: center; opacity: 0; transition: opacity 0.18s; cursor: pointer;
}
.photo-circle:hover .photo-change-overlay { opacity: 1; }
.photo-cam-icon  { font-size: 1.3rem; }
.photo-edit-text { display: flex; flex-direction: column; gap: 6px; }
.btn-change-photo {
  display: inline-block; padding: 7px 16px;
  background: var(--orange-light); color: var(--orange);
  border: 1.5px solid var(--orange-border); border-radius: 20px;
  font-size: 0.83rem; font-weight: 700; cursor: pointer;
  transition: background 0.18s; width: fit-content;
}
.btn-change-photo:hover { background: #fde0c0; }
.photo-rules    { font-size: 0.75rem; color: var(--text-xlight); }
.photo-filename { font-size: 0.78rem; color: #16a34a; font-weight: 600; min-height: 16px; }

.required-star { color: #dc2626; }

.input-locked  { opacity: 0.55 !important; cursor: not-allowed !important; background: #f3f4f6 !important; }

.bio-textarea {
  width: 100%; padding: 11px 14px;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  font-size: 0.95rem; font-family: inherit; color: var(--text);
  background: #fafafa; resize: vertical; outline: none; min-height: 80px;
  transition: border-color 0.18s, box-shadow 0.18s;
}
.bio-textarea:focus { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(255,122,0,0.10); background: var(--white); }
.bio-textarea::placeholder { color: #c0c0c0; }
.bio-counter { text-align: right; font-size: 0.75rem; color: var(--text-xlight); margin-top: 5px; }

.edit-actions {
  display: flex; align-items: center; justify-content: flex-end;
  gap: 12px; padding-top: 20px; border-top: 1px solid var(--border); margin-top: 20px;
}
.btn-annuler {
  padding: 10px 20px; border-radius: var(--radius-sm);
  font-size: 0.9rem; font-weight: 600; color: var(--text-light);
  background: #f3f4f6; transition: background 0.18s; text-decoration: none; display: inline-block;
}
.btn-annuler:hover { background: var(--border); color: var(--text); }
.btn-sauver {
  padding: 10px 22px; background: var(--orange); color: #ffffff;
  border: none; border-radius: var(--radius-sm); font-size: 0.9rem;
  font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; gap: 7px;
  transition: background 0.18s, box-shadow 0.18s;
}
.btn-sauver:hover { background: var(--orange-hover); box-shadow: 0 4px 14px rgba(255,122,0,0.30); }
.btn-sauver:active { transform: scale(0.98); }

/* ═══════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════ */

@media (max-width: 480px) {
  .profile-body        { padding: 0 14px 18px; }
  .profile-name        { font-size: 1.25rem; }
  .profile-avatar      { width: 80px; height: 80px; }
  .profile-avatar-wrap { margin-top: -42px; }
  .edit-card-header    { padding: 18px 18px 16px; }
  .edit-card-body      { padding: 18px 16px; }
  .form-row            { flex-direction: column; gap: 0; }
  .edit-actions        { flex-direction: column-reverse; align-items: stretch; }
  .btn-annuler,
  .btn-sauver          { width: 100%; justify-content: center; text-align: center; }
  .photo-edit-row      { flex-direction: column; align-items: flex-start; gap: 14px; }
}

/* ═══════════════════════════════════════════
   V2.1 — GROUPES + FEED SELECTOR
═══════════════════════════════════════════ */

/* ── Sélecteur de feed ── */
.feed-selector {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.feed-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-light);
  background: var(--white);
  border: 1.5px solid var(--border);
  text-decoration: none;
  transition: border-color var(--transition),
              background var(--transition),
              color var(--transition);
  cursor: pointer;
}

.feed-btn:hover {
  border-color: var(--orange);
  color: var(--orange);
  text-decoration: none;
}

.feed-btn-active {
  background: var(--orange);
  border-color: var(--orange);
  color: var(--white) !important;
  box-shadow: 0 4px 12px rgba(255,122,0,0.28);
}

.feed-btn-active:hover {
  background: var(--orange-hover);
  border-color: var(--orange-hover);
  color: var(--white);
}

.feed-btn-groups-link {
  margin-left: auto;
  background: var(--orange-light);
  border-color: var(--orange-border);
  color: var(--orange);
}
.feed-btn-groups-link:hover {
  background: #fde0c0;
  color: var(--orange);
}

/* Badge nb groupes */
.feed-badge {
  background: var(--white);
  color: var(--orange);
  border-radius: 20px;
  padding: 1px 7px;
  font-size: 0.75rem;
  font-weight: 800;
  line-height: 1.5;
}
.feed-btn-active .feed-badge {
  background: rgba(255,255,255,0.3);
  color: var(--white);
}

/* ── En-tête de page ── */
.page-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.page-title    { font-size: 1.4rem; font-weight: 800; color: var(--text); }
.page-subtitle { font-size: 0.85rem; color: var(--text-light); margin-top: 2px; }

.btn-create-group {
  width: auto;
  padding: 10px 20px;
  font-size: 0.9rem;
  white-space: nowrap;
}

/* ── Grille des groupes ── */
.groups-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

/* ── Carte groupe ── */
.group-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px;
  transition: box-shadow var(--transition), transform var(--transition);
}
.group-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.group-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Avatar groupe (initiales) */
.group-avatar {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #ff7a00, #ffb347);
  color: var(--white);
  font-weight: 900;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  letter-spacing: 1px;
}

.group-meta { flex: 1; min-width: 0; }

.group-name {
  display: block;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color var(--transition);
}
.group-name:hover { color: var(--orange); }

.group-members-count {
  font-size: 0.78rem;
  color: var(--text-xlight);
}

.group-desc {
  font-size: 0.88rem;
  color: var(--text-light);
  line-height: 1.55;
  flex: 1;
}
.group-desc-empty { font-style: italic; color: var(--text-xlight); }

.group-creator {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--text-xlight);
}

.group-card-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

/* Bouton rejoindre */
.btn-join {
  flex: 1;
  padding: 8px 14px;
  background: var(--orange);
  color: var(--white);
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--transition);
  text-align: center;
}
.btn-join:hover { background: var(--orange-hover); }

.btn-join-lg {
  padding: 10px 22px;
  font-size: 0.95rem;
}

/* Bouton quitter */
.btn-leave {
  flex: 1;
  padding: 8px 14px;
  background: #f3f4f6;
  color: var(--text-light);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--transition), color var(--transition),
              border-color var(--transition);
  text-align: center;
}
.btn-leave:hover {
  background: #fef2f2;
  color: #dc2626;
  border-color: #fecaca;
}

/* Voir le groupe */
.btn-see-group {
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--orange);
  white-space: nowrap;
  text-decoration: none;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
}
.btn-see-group:hover {
  background: var(--orange-light);
  text-decoration: none;
}

/* ── Page groupe détail ── */
.groupe-detail-card { overflow: hidden; padding: 0 !important; }

.groupe-banner {
  height: 100px;
  background: linear-gradient(135deg, #ff7a00, #ffb347);
  display: flex;
  align-items: center;
  justify-content: center;
}

.groupe-banner-avatar {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.25);
  border: 3px solid rgba(255,255,255,0.6);
  color: var(--white);
  font-size: 1.6rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 2px;
}

.groupe-detail-body    { padding: 20px 24px 24px; }
.groupe-detail-name    { font-size: 1.4rem; font-weight: 800; margin-bottom: 10px; }
.groupe-detail-desc    { font-size: 0.93rem; color: var(--text-light); line-height: 1.7; margin-bottom: 12px; }
.groupe-detail-meta    { display: flex; flex-wrap: wrap; gap: 8px; font-size: 0.82rem; color: var(--text-xlight); margin-bottom: 18px; }
.groupe-detail-actions { display: flex; gap: 10px; }

/* ── Grille membres ── */
.membres-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}

.membre-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  text-decoration: none;
  color: var(--text);
  transition: box-shadow var(--transition), transform var(--transition);
  position: relative;
}
.membre-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-1px);
  text-decoration: none;
  color: var(--text);
}

.membre-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.membre-nom   { font-size: 0.9rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.membre-ecole { font-size: 0.75rem; color: var(--text-xlight); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.membre-niveau{ font-size: 0.72rem; color: var(--text-xlight); }

.badge-createur {
  position: absolute;
  top: 8px;
  right: 10px;
  background: var(--orange-light);
  color: var(--orange);
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
  border: 1px solid var(--orange-border);
}

/* ── Responsive ── */
@media (max-width: 480px) {
  .groups-grid    { grid-template-columns: 1fr; }
  .membres-grid   { grid-template-columns: 1fr; }
  .page-header-bar{ flex-direction: column; align-items: flex-start; }
  .btn-create-group { width: 100%; justify-content: center; }
  .feed-selector  { gap: 5px; }
  .feed-btn       { padding: 7px 12px; font-size: 0.82rem; }
  .feed-btn-groups-link { margin-left: 0; }
}

/* ═══════════════════════════════════════════
   V2.2 — POSTS DANS GROUPES + EDIT GROUPE
═══════════════════════════════════════════ */

/* ── Badge groupe sur les posts ── */
.post-groupe-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.78rem;
  color: var(--text-xlight);
  margin-bottom: 2px;
}

.post-groupe-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--orange);
  font-weight: 600;
  font-size: 0.78rem;
  padding: 1px 7px;
  background: var(--orange-light);
  border-radius: 20px;
  text-decoration: none;
  transition: background var(--transition);
}
.post-groupe-link:hover {
  background: #fde0c0;
  text-decoration: none;
}

/* ── Bannière groupe avec image ── */
.groupe-banner {
  height: 140px;
  background: linear-gradient(135deg, #ff7a00, #ffb347);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.groupe-banner-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.groupe-banner-avatar {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.22);
  border: 3px solid rgba(255,255,255,0.55);
  color: #ffffff;
  font-size: 1.7rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 2px;
}

/* Bouton modifier dans la bannière groupe */
.groupe-banner .btn-edit-banner {
  position: absolute;
  top: 12px;
  right: 14px;
}

/* ── Membres mini aperçu ── */
.groupe-membres-preview { padding: 16px 18px; }

.groupe-membres-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.btn-toggle-membres {
  background: none;
  border: none;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--orange);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-xs);
  transition: background var(--transition);
}
.btn-toggle-membres:hover { background: var(--orange-light); }

.membres-avatars-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.membres-avatars-row a { display: block; }

/* Avatar "+X" */
.avatar-more {
  background: #f3f4f6;
  color: var(--text-light);
  font-size: 0.75rem;
  font-weight: 700;
  border: 2px solid var(--white);
}

/* ── Badge créateur large ── */
.badge-createur-lg {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--orange-light);
  color: var(--orange);
  border: 1.5px solid var(--orange-border);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 700;
}

/* ── Photo groupe dans edit ── */
.group-photo-circle {
  width: 90px;
  height: 90px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #ff7a00, #ffb347);
  overflow: hidden;
  position: relative;
  flex-shrink: 0;
  border: 3px solid var(--orange-border);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.group-photo-circle img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ── Zone de danger (supprimer groupe) ── */
.danger-zone {
  background: #fff5f5;
  border: 1px solid #fecaca;
  border-radius: var(--radius-sm);
  padding: 16px;
  margin: 20px 0;
}

.btn-danger {
  padding: 8px 16px;
  background: #fef2f2;
  color: #dc2626;
  border: 1.5px solid #fecaca;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition);
}
.btn-danger:hover {
  background: #fee2e2;
  border-color: #dc2626;
}

/* ── Responsive ── */
@media (max-width: 480px) {
  .groupe-banner       { height: 100px; }
  .groupe-detail-body  { padding: 16px; }
  .groupe-detail-name  { font-size: 1.2rem; }
  .groupe-detail-meta  { flex-direction: column; gap: 4px; }
  .membres-avatars-row { gap: 4px; }
}

/* ═══════════════════════════════════════════
   V2.3 — NOTIFICATIONS
═══════════════════════════════════════════ */

/* ── Badge notif dans la navbar ── */
.notif-nav-link {
  position: relative;
  font-size: 1.1rem;
  padding: 7px 10px;
}

.notif-nav-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  background: #dc2626;
  color: #ffffff;
  font-size: 0.62rem;
  font-weight: 800;
  min-width: 17px;
  height: 17px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  line-height: 1;
  border: 2px solid var(--white);
  pointer-events: none;
}

/* Bouton notif sur mobile (hors menu burger) */
.notif-mobile-btn {
  position: relative;
  display: none;
  font-size: 1.2rem;
  text-decoration: none;
  padding: 4px;
  border-radius: var(--radius-xs);
  transition: background var(--transition);
}
.notif-mobile-btn:hover { background: var(--orange-light); }

@media (max-width: 640px) {
  .notif-nav-link  { display: none; } /* caché dans le menu desktop sur mobile */
  .notif-mobile-btn{ display: flex; align-items: center; }
}

/* ── Liste des notifications ── */
.notifs-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Carte notification */
.notif-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: var(--text);
  border: 1.5px solid transparent;
  transition: box-shadow var(--transition),
              border-color var(--transition),
              transform var(--transition);
  position: relative;
}

.notif-card:hover {
  box-shadow: var(--shadow);
  border-color: var(--orange-border);
  transform: translateY(-1px);
  text-decoration: none;
  color: var(--text);
}

/* Non-lu : fond légèrement teinté */
.notif-unread {
  background: #fffaf5;
  border-color: var(--orange-border);
}

/* Avatar + icône type */
.notif-avatar {
  position: relative;
  flex-shrink: 0;
}

.notif-type-icon {
  position: absolute;
  bottom: -4px;
  right: -4px;
  width: 20px;
  height: 20px;
  background: var(--white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
  border: 1.5px solid var(--white);
}

/* Contenu texte */
.notif-content {
  flex: 1;
  min-width: 0;
}

.notif-message {
  font-size: 0.9rem;
  color: var(--text);
  line-height: 1.5;
  margin-bottom: 3px;
  font-weight: 500;
}

.notif-date {
  font-size: 0.75rem;
  color: var(--text-xlight);
}

/* Point rouge = non lu */
.notif-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--orange);
  flex-shrink: 0;
  box-shadow: 0 0 0 2px rgba(255,122,0,0.20);
}

/* ── Responsive ── */
@media (max-width: 480px) {
  .notif-card    { padding: 12px 14px; gap: 10px; }
  .notif-message { font-size: 0.85rem; }
}

/* ═══════════════════════════════════════════
   V2.4 — MESSAGERIE PRIVÉE
═══════════════════════════════════════════ */

/* ── Layout principal messagerie ── */
.messages-layout {
  display: flex;
  height: calc(100vh - var(--navbar-h));
  max-width: 1100px;
  margin: 0 auto;
  overflow: hidden;
}

/* ── Sidebar conversations ── */
.conv-sidebar {
  width: 320px;
  flex-shrink: 0;
  background: var(--white);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.conv-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px 12px;
  border-bottom: 1px solid var(--border);
}

.conv-sidebar-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text);
}

.conv-badge-total {
  background: #dc2626;
  color: var(--white);
  font-size: 0.72rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 20px;
}

/* Bouton nouvelle conversation */
.conv-new-msg {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}

.btn-new-conv {
  display: block;
  text-align: center;
  padding: 8px;
  background: var(--orange-light);
  color: var(--orange);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
  transition: background var(--transition);
}
.btn-new-conv:hover { background: #fde0c0; text-decoration: none; }

/* Liste conversations */
.conv-list {
  list-style: none;
  overflow-y: auto;
  flex: 1;
}

.conv-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  text-decoration: none;
  color: var(--text);
  border-bottom: 1px solid #f5f5f5;
  transition: background var(--transition);
  position: relative;
}
.conv-item:hover { background: #fafafa; text-decoration: none; color: var(--text); }

.conv-item-active {
  background: var(--orange-light) !important;
  border-left: 3px solid var(--orange);
}

.conv-item-unread .conv-name { font-weight: 800; }
.conv-item-unread .conv-preview { color: var(--text); font-weight: 600; }

/* Avatar dans la liste */
.conv-avatar { position: relative; flex-shrink: 0; }

.conv-unread-dot {
  position: absolute;
  top: 0; right: 0;
  width: 10px; height: 10px;
  background: var(--orange);
  border-radius: 50%;
  border: 2px solid var(--white);
}

/* Infos conversation */
.conv-info { flex: 1; min-width: 0; }

.conv-name-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 3px;
}

.conv-name  { font-size: 0.9rem; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-time  { font-size: 0.72rem; color: var(--text-xlight); flex-shrink: 0; }

.conv-preview {
  font-size: 0.8rem;
  color: var(--text-light);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Badge nb non lus */
.conv-count-badge {
  background: var(--orange);
  color: var(--white);
  font-size: 0.68rem;
  font-weight: 800;
  min-width: 18px;
  height: 18px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  flex-shrink: 0;
}

/* Message vide sidebar */
.conv-empty {
  padding: 30px 16px;
  text-align: center;
  color: var(--text-xlight);
  font-size: 0.85rem;
  line-height: 1.7;
}

/* ── Zone principale chat ── */
.chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #f9fafb;
}

/* État vide (aucune conv sélectionnée) */
.chat-empty-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 24px;
  color: var(--text-light);
}

.chat-empty-icon {
  font-size: 3.5rem;
  margin-bottom: 16px;
}

.chat-empty-state h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--text);
}

.chat-empty-state p {
  font-size: 0.9rem;
  line-height: 1.6;
  max-width: 300px;
}

/* En-tête de la conversation */
.chat-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.chat-back-btn {
  font-size: 1.2rem;
  color: var(--text-light);
  text-decoration: none;
  padding: 4px 8px;
  border-radius: var(--radius-xs);
  transition: background var(--transition), color var(--transition);
  display: none; /* visible uniquement mobile */
}
.chat-back-btn:hover { background: #f3f4f6; color: var(--text); }

.chat-header-user {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  text-decoration: none;
  color: var(--text);
}
.chat-header-user:hover { text-decoration: none; }

.chat-user-name { font-size: 0.97rem; font-weight: 700; display: block; }
.chat-user-meta { font-size: 0.75rem; color: var(--text-xlight); }

.btn-see-profile {
  font-size: 1.1rem;
  padding: 6px 10px;
  border-radius: var(--radius-xs);
  color: var(--text-light);
  text-decoration: none;
  transition: background var(--transition);
}
.btn-see-profile:hover { background: #f3f4f6; }

/* ── Fil de messages ── */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  scroll-behavior: smooth;
}

/* Séparateur de date */
.chat-date-sep {
  text-align: center;
  margin: 12px 0 6px;
}
.chat-date-sep span {
  background: #e5e7eb;
  color: var(--text-xlight);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 12px;
  border-radius: 20px;
}

/* Hint début de conversation */
.chat-start-hint {
  text-align: center;
  padding: 30px;
  color: var(--text-xlight);
  font-size: 0.88rem;
}

/* Wrap d'une bulle */
.chat-bubble-wrap {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  max-width: 75%;
}

.bubble-mine   { align-self: flex-end; flex-direction: row-reverse; }
.bubble-theirs { align-self: flex-start; }

.bubble-avatar { flex-shrink: 0; }

/* Bulle de message */
.chat-bubble {
  padding: 10px 14px;
  border-radius: 18px;
  max-width: 100%;
  word-break: break-word;
}

/* Mes messages → orange */
.bubble-mine .chat-bubble {
  background: var(--orange);
  color: var(--white);
  border-bottom-right-radius: 4px;
}

/* Messages reçus → blanc */
.bubble-theirs .chat-bubble {
  background: var(--white);
  color: var(--text);
  border-bottom-left-radius: 4px;
  box-shadow: var(--shadow-sm);
}

.bubble-text {
  font-size: 0.93rem;
  line-height: 1.55;
  margin-bottom: 4px;
}

.bubble-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  font-size: 0.68rem;
  opacity: 0.75;
}

.bubble-mine .bubble-meta   { color: rgba(255,255,255,0.85); }
.bubble-theirs .bubble-meta { color: var(--text-xlight); }

/* ✓ / ✓✓ lu/non-lu */
.bubble-read { font-size: 0.72rem; }

/* ── Zone saisie message ── */
.chat-input-zone {
  padding: 12px 16px;
  background: var(--white);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.chat-form {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  background: #f3f4f6;
  border-radius: 24px;
  padding: 8px 8px 8px 16px;
  border: 1.5px solid transparent;
  transition: border-color var(--transition), background var(--transition);
}
.chat-form:focus-within {
  border-color: var(--orange);
  background: var(--white);
}

.chat-textarea {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  font-size: 0.95rem;
  font-family: inherit;
  color: var(--text);
  resize: none;
  min-height: 24px;
  max-height: 120px;
  line-height: 1.5;
  padding: 2px 0;
}
.chat-textarea::placeholder { color: #c0c0c0; }

.chat-send-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--orange);
  color: var(--white);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background var(--transition), transform 0.1s;
}
.chat-send-btn:hover  { background: var(--orange-hover); }
.chat-send-btn:active { transform: scale(0.94); }
.send-icon { font-size: 0.95rem; }

/* ── Bouton envoyer message (profil) ── */
.btn-send-message {
  width: auto;
  padding: 10px 22px;
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

/* ═══════════════════════════════════════════
   RESPONSIVE MESSAGERIE
═══════════════════════════════════════════ */

@media (max-width: 700px) {

  .messages-layout { flex-direction: column; }

  /* Sur mobile : sidebar = plein écran si pas de conv active */
  .conv-sidebar {
    width: 100%;
    height: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  /* Cache la sidebar quand une conv est ouverte */
  .chat-main-active .conv-sidebar { display: none; }

  .chat-main { height: 100%; }

  /* Bouton retour visible sur mobile */
  .chat-back-btn { display: flex; align-items: center; }

  /* Bulles plus larges sur mobile */
  .chat-bubble-wrap { max-width: 88%; }
}

/* ═══════════════════════════════════════════
   V2.5 — RECHERCHE GLOBALE
═══════════════════════════════════════════ */

/* ── Barre de recherche navbar ── */
.navbar-search {
  flex: 1;
  max-width: 380px;
  margin: 0 16px;
}

.search-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon-left {
  position: absolute;
  left: 12px;
  font-size: 0.9rem;
  pointer-events: none;
  z-index: 1;
}

.search-input {
  width: 100%;
  padding: 8px 36px 8px 36px;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  font-size: 0.88rem;
  color: var(--text);
  background: #f9fafb;
  outline: none;
  transition: border-color var(--transition),
              background var(--transition),
              box-shadow var(--transition);
  font-family: inherit;
}

.search-input:focus {
  border-color: var(--orange);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(255,122,0,0.10);
}

.search-input::placeholder { color: #c0c0c0; }

/* Bouton effacer */
.search-clear {
  position: absolute;
  right: 10px;
  color: var(--text-xlight);
  font-size: 0.8rem;
  text-decoration: none;
  padding: 2px 4px;
  border-radius: 50%;
  transition: color var(--transition), background var(--transition);
  line-height: 1;
}
.search-clear:hover { color: #dc2626; background: #fef2f2; }

/* Bouton recherche mobile */
.mobile-search-btn {
  display: none;
  background: none;
  border: none;
  font-size: 1.15rem;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: var(--radius-xs);
  transition: background var(--transition);
  color: var(--text);
}
.mobile-search-btn:hover { background: var(--orange-light); }

/* Barre de recherche déroulante mobile */
.mobile-search-bar {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 10px 14px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

/* Groupe icônes mobile navbar */
.navbar-mobile-right {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ── Page de recherche ── */
.search-container { max-width: 720px; }

.search-page-header {
  margin-bottom: 20px;
}

.search-term {
  color: var(--orange);
  font-style: italic;
}

/* Card hint état initial */
.search-hint-card {
  padding: 32px 24px;
  text-align: center;
}

.search-hint-icon {
  font-size: 2.5rem;
  margin-bottom: 14px;
}

.search-hint-text {
  font-size: 0.93rem;
  color: var(--text-light);
  line-height: 1.7;
}

/* ── Sections de résultats ── */
.search-section { margin-bottom: 28px; }

.search-section-title {
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.7px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.search-section-count {
  background: var(--orange-light);
  color: var(--orange);
  font-size: 0.72rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 20px;
}

/* Message aucun résultat dans une section */
.search-empty {
  background: var(--white);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  font-size: 0.88rem;
  color: var(--text-xlight);
  border: 1px dashed var(--border);
}

/* Surbrillance du terme trouvé */
.search-highlight {
  background: #fff3cd;
  color: #856404;
  border-radius: 3px;
  padding: 0 2px;
  font-style: normal;
}

/* ── Résultats utilisateurs ── */
.search-users-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
}

.search-user-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  text-decoration: none;
  color: var(--text);
  transition: box-shadow var(--transition), transform var(--transition);
}
.search-user-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-1px);
  text-decoration: none;
  color: var(--text);
}

.search-user-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.search-user-name   { font-size: 0.93rem; font-weight: 700; }
.search-user-ecole  { font-size: 0.78rem; color: var(--text-xlight); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-user-niveau { font-size: 0.75rem; color: var(--text-xlight); }
.search-user-posts  { font-size: 0.72rem; color: var(--text-xlight); }

.search-action-btn {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--orange);
  white-space: nowrap;
  flex-shrink: 0;
}

.search-action-me {
  color: var(--text-xlight);
  font-weight: 400;
}

/* ── Résultats posts ── */
.search-posts-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.search-post-card {
  display: block;
  padding: 16px 18px;
  text-decoration: none;
  color: var(--text);
  transition: box-shadow var(--transition), transform var(--transition);
}
.search-post-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-1px);
  text-decoration: none;
  color: var(--text);
}

.search-post-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.search-post-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.search-post-meta strong { font-size: 0.88rem; font-weight: 700; }

.search-post-content {
  font-size: 0.9rem;
  color: var(--text);
  line-height: 1.6;
  margin-bottom: 10px;
}

/* Miniature image */
.search-post-thumb {
  margin-bottom: 10px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  max-height: 120px;
}
.search-post-thumb img {
  width: 100%;
  height: 120px;
  object-fit: cover;
}

.search-post-stats {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.8rem;
  color: var(--text-light);
  padding-top: 10px;
  border-top: 1px solid #f3f4f6;
}

.search-post-link {
  margin-left: auto;
  color: var(--orange);
  font-weight: 600;
  font-size: 0.8rem;
}

/* ── Résultats groupes ── */
.search-groups-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
}

.search-group-card {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: box-shadow var(--transition), transform var(--transition);
}
.search-group-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.search-group-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.search-group-avatar {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #ff7a00, #ffb347);
  color: var(--white);
  font-weight: 900;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  letter-spacing: 1px;
}
.search-group-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.search-group-info { flex: 1; min-width: 0; }

.search-group-name {
  display: block;
  font-size: 0.97rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  transition: color var(--transition);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.search-group-name:hover { color: var(--orange); }

.search-group-members {
  font-size: 0.78rem;
  color: var(--text-xlight);
}

.search-group-desc {
  font-size: 0.85rem;
  color: var(--text-light);
  line-height: 1.55;
}

.search-group-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid #f3f4f6;
}

.search-membre-badge {
  font-size: 0.8rem;
  font-weight: 700;
  color: #16a34a;
  background: #f0fdf4;
  padding: 5px 12px;
  border-radius: 20px;
  border: 1px solid #bbf7d0;
}

/* Aucun résultat global */
.search-no-result {
  padding: 48px 24px;
  text-align: center;
}

/* ── Responsive ── */
@media (max-width: 640px) {
  /* Masquer la barre de recherche dans la navbar sur mobile */
  .navbar-search { display: none; }

  /* Afficher le bouton 🔍 sur mobile */
  .mobile-search-btn { display: flex; align-items: center; }

  /* Grilles en colonne unique */
  .search-users-grid  { grid-template-columns: 1fr; }
  .search-groups-grid { grid-template-columns: 1fr; }
}

@media (min-width: 641px) {
  /* Cacher le bouton mobile et la barre déroulante sur desktop */
  .mobile-search-btn { display: none; }
  .mobile-search-bar { display: none !important; }
}

/* ═══════════════════════════════════════════
   V2.6 — DOCUMENTS
═══════════════════════════════════════════ */

/* ── Layout principal ── */
.docs-container { max-width: 1080px; }

.docs-layout {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

/* ── Stats bar ── */
.docs-stats-bar {
  display: flex;
  align-items: center;
  padding: 14px 0;
  margin-bottom: 18px;
}

.docs-stat {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.docs-stat-val {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--orange);
  line-height: 1;
}

.docs-stat-lbl {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-xlight);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.docs-stat-sep {
  width: 1px;
  height: 36px;
  background: var(--border);
  flex-shrink: 0;
}

/* ── Sidebar ── */
.docs-sidebar {
  width: 240px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.docs-filter-card,
.docs-recents-card { padding: 18px; }

.docs-filter-title {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.docs-filter-group {
  margin-bottom: 12px;
}

.docs-filter-group label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-xlight);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 5px;
}

.docs-filter-input,
.docs-filter-select {
  width: 100%;
  padding: 8px 10px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  color: var(--text);
  background: #fafafa;
  outline: none;
  appearance: none;
  transition: border-color var(--transition);
  font-family: inherit;
}

.docs-filter-input:focus,
.docs-filter-select:focus {
  border-color: var(--orange);
  background: var(--white);
}

.docs-filter-btn {
  width: 100%;
  padding: 9px;
  font-size: 0.88rem;
  margin-top: 4px;
}

.docs-filter-reset {
  display: block;
  text-align: center;
  margin-top: 8px;
  font-size: 0.8rem;
  color: #dc2626;
  font-weight: 600;
  transition: color var(--transition);
}
.docs-filter-reset:hover { color: #b91c1c; }

/* Documents récents sidebar */
.docs-recents-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.docs-recent-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  text-decoration: none;
  color: var(--text);
  padding: 6px;
  border-radius: var(--radius-xs);
  transition: background var(--transition);
}
.docs-recent-item:hover { background: var(--orange-light); text-decoration: none; }

.docs-recent-icon { font-size: 1rem; flex-shrink: 0; }

.docs-recent-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.docs-recent-titre {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}

.docs-recent-meta {
  font-size: 0.72rem;
  color: var(--text-xlight);
}

/* ── Zone principale ── */
.docs-main { width: 100%; }

/* Filtres actifs */
.docs-active-filters {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.docs-filter-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--orange-light);
  color: var(--orange);
  border: 1px solid var(--orange-border);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
}

.docs-filter-tag a {
  color: var(--orange);
  font-weight: 800;
  text-decoration: none;
  opacity: 0.7;
  transition: opacity var(--transition);
}
.docs-filter-tag a:hover { opacity: 1; }

.docs-result-count {
  margin-left: auto;
  font-size: 0.78rem;
  color: var(--text-xlight);
}

/* ── Grille de documents ── */
.docs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}

/* ── Carte document ── */
.doc-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px;
  transition: box-shadow var(--transition), transform var(--transition);
}
.doc-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

/* Top : icône PDF + badges */
.doc-card-top {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

/* Icône PDF stylée */
.doc-pdf-icon {
  width: 46px;
  height: 54px;
  background: #fee2e2;
  border: 2px solid #fca5a5;
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
}

.doc-pdf-icon::before {
  content: '';
  position: absolute;
  top: -2px;
  right: -2px;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 10px 10px 0 0;
  border-color: #fca5a5 transparent transparent transparent;
}

.doc-pdf-label {
  font-size: 0.65rem;
  font-weight: 900;
  color: #dc2626;
  letter-spacing: 0.5px;
}

/* Badges niveau / matière */
.doc-badges {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 0;
}

.doc-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.doc-badge-niveau  { background: var(--orange-light); color: var(--orange); }
.doc-badge-matiere { background: #eff6ff; color: #1d4ed8; }

/* Titre */
.doc-titre {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.4;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Auteur + date */
.doc-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.doc-auteur {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.doc-auteur-nom {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-light);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color var(--transition);
}
.doc-auteur-nom:hover { color: var(--orange); }

.doc-date {
  font-size: 0.72rem;
  color: var(--text-xlight);
  white-space: nowrap;
  flex-shrink: 0;
}

/* Footer carte : stats + boutons */
.doc-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 10px;
  border-top: 1px solid #f3f4f6;
  gap: 8px;
}

.doc-dl-count {
  font-size: 0.78rem;
  color: var(--text-xlight);
  white-space: nowrap;
}

.doc-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-doc-download {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  background: var(--orange);
  color: var(--white);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 700;
  text-decoration: none;
  transition: background var(--transition), box-shadow var(--transition);
  white-space: nowrap;
}
.btn-doc-download:hover {
  background: var(--orange-hover);
  box-shadow: 0 3px 10px rgba(255,122,0,0.28);
  text-decoration: none;
  color: var(--white);
}

.btn-doc-delete {
  background: none;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 5px 8px;
  font-size: 0.85rem;
  cursor: pointer;
  color: var(--text-xlight);
  transition: background var(--transition),
              border-color var(--transition),
              color var(--transition);
}
.btn-doc-delete:hover {
  background: #fef2f2;
  border-color: #fecaca;
  color: #dc2626;
}

/* ── Zone upload PDF ── */
.pdf-upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 24px 16px;
  text-align: center;
  transition: border-color var(--transition), background var(--transition);
  cursor: pointer;
  margin-bottom: 8px;
}

.pdf-upload-zone:hover,
.pdf-zone-drag {
  border-color: var(--orange);
  background: var(--orange-light);
}

.pdf-upload-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.pdf-upload-icon { font-size: 2rem; }

.pdf-upload-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.pdf-upload-text span:first-child {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}

.pdf-upload-hint {
  font-size: 0.78rem;
  color: var(--text-xlight);
}

/* Bouton upload doc navbar */
.btn-upload-doc {
  width: auto;
  padding: 9px 18px;
  font-size: 0.88rem;
  white-space: nowrap;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .docs-layout    { flex-direction: column; }
  .docs-sidebar   { width: 100%; }
  .docs-grid      { grid-template-columns: 1fr; }
  .docs-stats-bar { padding: 12px 0; }
}

@media (max-width: 480px) {
  .doc-card-top   { flex-direction: row; }
  .doc-card-footer{ flex-direction: column; align-items: stretch; }
  .doc-actions    { justify-content: stretch; }
  .btn-doc-download { flex: 1; justify-content: center; }

}

/* ═══════════════════════════════════════════
   V2.7 — GAMIFICATION
═══════════════════════════════════════════ */

/* ── Badges universels ── */
.user-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
}

.badge-sm { font-size: 0.72rem; padding: 3px 9px; }

/* Couleurs par niveau */
.badge-novice   { background: #f3f4f6; color: #6b7280; border: 1px solid #e5e7eb; }
.badge-debutant { background: #fef3c7; color: #92400e; border: 1px solid #fcd34d; }
.badge-actif    { background: #f1f5f9; color: #475569; border: 1px solid #cbd5e1; }
.badge-expert   { background: #fef9c3; color: #854d0e; border: 1px solid #fde047; }
.badge-maitre   { background: #e0f2fe; color: #075985; border: 1px solid #7dd3fc; }
.badge-legende  { background: linear-gradient(135deg, #fff7ed, #fef3c7);
                  color: #92400e; border: 1px solid #fcd34d;
                  box-shadow: 0 0 8px rgba(251,191,36,0.35); }

/* ── Barre de progression ── */
.lb-prog-bar {
  height: 7px;
  background: #f3f4f6;
  border-radius: 20px;
  overflow: hidden;
  flex: 1;
}

.lb-prog-fill {
  height: 100%;
  background: linear-gradient(90deg, #ff7a00, #ffb347);
  border-radius: 20px;
  transition: width 0.6s ease;
  min-width: 4px;
}

/* ── Widget points dashboard ── */
.dash-points-widget {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.dash-pts-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.dash-pts-val {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
}

.dash-pts-right {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 120px;
}

.dash-pts-next {
  font-size: 0.75rem;
  color: var(--text-xlight);
}

.dash-pts-max {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--orange);
}

.dash-pts-link {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--orange);
  white-space: nowrap;
  text-decoration: none;
  margin-left: auto;
  flex-shrink: 0;
  transition: color var(--transition);
}
.dash-pts-link:hover { color: var(--orange-hover); }

/* ── Profil gamification ── */
.profile-gamif {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.profile-points {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text);
}

.profile-prog-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.profile-prog-bar {
  flex: 1;
  height: 7px;
  background: #f3f4f6;
  border-radius: 20px;
  overflow: hidden;
}

.profile-prog-fill {
  height: 100%;
  background: linear-gradient(90deg, #ff7a00, #ffb347);
  border-radius: 20px;
  min-width: 4px;
  transition: width 0.6s ease;
}

.profile-prog-label {
  font-size: 0.75rem;
  color: var(--text-xlight);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════
   LEADERBOARD
═══════════════════════════════════════════ */

.lb-container { max-width: 900px; }

/* Ma position */
.lb-ma-position {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  margin-bottom: 14px;
  background: linear-gradient(135deg, #fff7ed, var(--white));
  border: 1.5px solid var(--orange-border);
}

.lb-ma-pos-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.lb-ma-rang {
  font-size: 2rem;
  font-weight: 900;
  color: var(--orange);
  line-height: 1;
}

.lb-ma-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.lb-ma-label  { font-size: 0.75rem; color: var(--text-xlight); font-weight: 600; text-transform: uppercase; }
.lb-ma-points { font-size: 0.95rem; font-weight: 700; color: var(--text); }

/* Progression */
.lb-progression {
  padding: 14px 18px;
  margin-bottom: 18px;
}

.lb-prog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.lb-prog-label { font-size: 0.85rem; font-weight: 700; color: var(--text); }
.lb-prog-pts   { font-size: 0.78rem; color: var(--text-xlight); }
.lb-prog-pct   { text-align: right; font-size: 0.72rem; color: var(--orange); font-weight: 700; margin-top: 4px; }

.lb-max {
  padding: 14px 18px;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--orange);
  text-align: center;
}

/* Layout */
.lb-layout {
  display: flex;
  gap: 18px;
  align-items: flex-start;
}

.lb-main    { width: 100%; }
.lb-sidebar { width: 260px; flex-shrink: 0; display: flex; flex-direction: column; gap: 14px; }

/* Liste classement */
.lb-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Carte utilisateur */
.lb-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  transition: box-shadow var(--transition), transform var(--transition);
}

.lb-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

/* Mise en avant du podium */
.lb-card-podium { border-left: 4px solid #fcd34d; }
.lb-pos-1 { background: linear-gradient(135deg, #fffbeb, var(--white)); border-left-color: #f59e0b; }
.lb-pos-2 { background: linear-gradient(135deg, #f8fafc, var(--white)); border-left-color: #94a3b8; }
.lb-pos-3 { background: linear-gradient(135deg, #fff7ed, var(--white)); border-left-color: #fb923c; }

/* Moi */
.lb-card-me {
  border: 2px solid var(--orange);
  background: var(--orange-light);
}

/* Rang */
.lb-rang {
  width: 36px;
  text-align: center;
  flex-shrink: 0;
}

.lb-medaille  { font-size: 1.5rem; line-height: 1; }
.lb-numero    { font-size: 0.85rem; font-weight: 800; color: var(--text-xlight); }

/* User info */
.lb-user {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
  text-decoration: none;
  color: var(--text);
  transition: color var(--transition);
}
.lb-user:hover { color: var(--orange); text-decoration: none; }

.lb-user-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.lb-user-nom {
  font-size: 0.92rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 6px;
}

.lb-user-ecole {
  font-size: 0.75rem;
  color: var(--text-xlight);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lb-me-tag {
  font-size: 0.65rem;
  background: var(--orange);
  color: var(--white);
  padding: 1px 6px;
  border-radius: 20px;
  font-weight: 700;
}

/* Score */
.lb-score {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}

.lb-points {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--orange);
  white-space: nowrap;
}

/* Écoles sidebar */
.lb-ecoles-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.lb-ecole-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
}

.lb-ecole-rang {
  width: 24px;
  height: 24px;
  background: var(--orange-light);
  color: var(--orange);
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.lb-ecole-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.lb-ecole-nom {
  font-size: 0.85rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lb-ecole-meta {
  font-size: 0.72rem;
  color: var(--text-xlight);
}

.lb-ecole-pts {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--orange);
  white-space: nowrap;
  flex-shrink: 0;
}

/* Règles des points */
.lb-regles { padding: 16px 18px; }

.lb-regles-title {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.lb-regles-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.lb-regles-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  color: var(--text-light);
}

.lb-regle-pts {
  background: var(--orange);
  color: var(--white);
  font-size: 0.72rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 20px;
  min-width: 36px;
  text-align: center;
  flex-shrink: 0;
}

.lb-paliers-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-xlight);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 8px;
}

.lb-paliers {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.lb-palier { display: flex; }

/* ── Responsive ── */
@media (max-width: 700px) {
  .lb-layout        { flex-direction: column; }
  .lb-sidebar       { width: 100%; }
  .lb-card          { padding: 10px 12px; gap: 8px; }
  .lb-medaille      { font-size: 1.2rem; }
  .dash-points-widget { flex-direction: column; align-items: flex-start; gap: 10px; }
  .dash-pts-right   { width: 100%; }
  .dash-pts-link    { margin-left: 0; }
  .lb-ma-position   { flex-direction: column; align-items: flex-start; gap: 10px; }
}

/* ═══════════════════════════════════════════
   V3.1 — TEMPS RÉEL / ANIMATIONS
═══════════════════════════════════════════ */

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-12px); }
    to   { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.35s ease-out forwards;
}

/* Badge "Nouveau" sur les posts injectés */
.new-post-tag {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    background: #dcfce7;
    color: #16a34a;
    font-size: 0.68rem;
    font-weight: 700;
    border-radius: 20px;
    border: 1px solid #bbf7d0;
    flex-shrink: 0;
}

/* Toast "nouveaux posts" */
.new-post-toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: #1a1a1a;
    color: #ffffff;
    padding: 10px 18px;
    border-radius: 24px;
    font-size: 0.88rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 300;
    box-shadow: 0 4px 18px rgba(0,0,0,0.25);
    white-space: nowrap;
}

.new-post-toast button {
    background: rgba(255,255,255,0.18);
    border: none;
    color: #ffffff;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    padding: 0;
    transition: background 0.15s;
}
.new-post-toast button:hover {
    background: rgba(255,255,255,0.32);
}

/* Point vert polling actif */
@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%       { opacity: 0.45; transform: scale(0.82); }
}

.polling-indicator {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #22c55e;
    margin-left: 6px;
    animation: pulse 2s infinite;
}

@media (max-width: 480px) {
    .new-post-toast {
        bottom: 70px;
        font-size: 0.82rem;
        padding: 9px 14px;
        max-width: calc(100vw - 32px);
    }
}

/* ═══════════════════════════════════════════
   V3.2 — DROPDOWN NOTIFICATIONS
═══════════════════════════════════════════ */

/* ── Wrapper cloche (position relative pour le dropdown) ── */
.notif-dropdown-wrap {
    position: relative;
}

.notif-bell-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    position: relative;
}

/* ── Dropdown desktop ── */
.notif-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 340px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 8px 32px rgba(0,0,0,0.14);
    z-index: 500;
    overflow: hidden;

    /* Masqué par défaut */
    opacity: 0;
    pointer-events: none;
    transform: translateY(-8px);
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.notif-dropdown.notif-dropdown-open {
    opacity: 1;
    pointer-events: all;
    transform: translateY(0);
}

/* Dropdown mobile (pleine largeur sous la navbar) */
.notif-dropdown-mobile {
    position: fixed;
    top: var(--navbar-h);
    left: 0;
    right: 0;
    width: 100%;
    border-radius: 0 0 var(--radius) var(--radius);
    z-index: 190;
    max-height: 70vh;
    overflow-y: auto;
}

/* ── En-tête dropdown ── */
.notif-dropdown-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px 10px;
    border-bottom: 1px solid var(--border);
}

.notif-dropdown-title {
    font-size: 0.9rem;
    font-weight: 800;
    color: var(--text);
}

.notif-mark-all-btn {
    background: none;
    border: none;
    font-size: 0.75rem;
    color: var(--orange);
    font-weight: 700;
    cursor: pointer;
    padding: 3px 6px;
    border-radius: var(--radius-xs);
    transition: background var(--transition);
}
.notif-mark-all-btn:hover { background: var(--orange-light); }

/* ── Liste des notifs ── */
.notif-dropdown-list {
    max-height: 340px;
    overflow-y: auto;
    scrollbar-width: thin;
}

/* ── Item notif ── */
.notif-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 11px 14px;
    text-decoration: none;
    color: var(--text);
    border-bottom: 1px solid #f5f5f5;
    transition: background var(--transition);
    position: relative;
}
.notif-item:hover { background: #fafafa; text-decoration: none; color: var(--text); }

/* Non lu : fond légèrement orangé */
.notif-item-unread {
    background: #fffaf5;
}
.notif-item-unread:hover { background: #fff4ec; }

/* Icône type */
.notif-item-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--orange-light);
    border-radius: 50%;
}

/* Corps */
.notif-item-body {
    flex: 1;
    min-width: 0;
}

.notif-item-msg {
    font-size: 0.83rem;
    color: var(--text);
    line-height: 1.45;
    margin-bottom: 3px;
    font-weight: 500;
}

.notif-item-time {
    font-size: 0.72rem;
    color: var(--text-xlight);
}

/* Point rouge non-lu */
.notif-item-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--orange);
    flex-shrink: 0;
    align-self: center;
}

/* Empty state */
.notif-dropdown-empty {
    padding: 28px 16px;
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-xlight);
}

/* ── Pied dropdown ── */
.notif-dropdown-footer {
    padding: 10px 16px;
    border-top: 1px solid var(--border);
    text-align: center;
}

.notif-dropdown-footer a {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--orange);
    text-decoration: none;
    transition: color var(--transition);
}
.notif-dropdown-footer a:hover { color: var(--orange-hover); }

/* ── Badge navbar (refonte propre) ── */
.notif-nav-badge {
    position: absolute;
    top: 0;
    right: 0;
    background: #dc2626;
    color: var(--white);
    font-size: 0.6rem;
    font-weight: 800;
    min-width: 16px;
    height: 16px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border: 2px solid var(--white);
    pointer-events: none;
    line-height: 1;
}

/* ── Responsive ── */
@media (max-width: 640px) {
    /* Le dropdown desktop est remplacé par le mobile */
    .notif-dropdown-wrap .notif-dropdown:not(.notif-dropdown-mobile) {
        display: none;
    }
}

@media (min-width: 641px) {
    /* Le dropdown mobile est masqué sur desktop */
    .notif-dropdown-mobile { display: none !important; }
}

/* ═══════════════════════════════════════════
   V3.3 — FEED INTELLIGENT
═══════════════════════════════════════════ */

/* Badge score sur les posts */
.post-score-badge {
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--orange);
    background: var(--orange-light);
    border: 1px solid var(--orange-border);
    padding: 2px 7px;
    border-radius: 20px;
    flex-shrink: 0;
    white-space: nowrap;
}

/* Badge "Personnalisé" dans la barre de filtres */
.feed-smart-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--orange);
    background: var(--orange-light);
    border: 1px solid var(--orange-border);
    padding: 2px 8px;
    border-radius: 20px;
    margin-left: 8px;
    white-space: nowrap;
}

/* ═══════════════════════════════════════════
   V3.4 — DASHBOARD LAYOUT + SIDEBAR RECO
═══════════════════════════════════════════ */

/* ── Layout 2 colonnes ── */
.dashboard-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 20px;
    align-items: flex-start;
    max-width: 1100px;
}

/* Colonne principale */
.dashboard-feed {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* ── Sidebar droite ── */
.right-sidebar {
    display: flex;
    flex-direction: column;
    gap: 14px;
    position: sticky;
    top: calc(var(--navbar-h) + 16px);
    max-height: calc(100vh - var(--navbar-h) - 32px);
    overflow-y: auto;
    scrollbar-width: none;
    padding-bottom: 20px;
}
.right-sidebar::-webkit-scrollbar { display: none; }

/* ── Bloc sidebar ── */
.sidebar-block {
    padding: 16px;
}

.sidebar-block-title {
    font-size: 0.88rem;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sidebar-empty {
    font-size: 0.8rem;
    color: var(--text-xlight);
    line-height: 1.5;
    text-align: center;
    padding: 8px 0;
}

/* ── Liste items sidebar ── */
.sidebar-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 10px;
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-item-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sidebar-item-name {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text);
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color var(--transition);
}
.sidebar-item-name:hover { color: var(--orange); }

.sidebar-item-meta {
    font-size: 0.72rem;
    color: var(--text-xlight);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Avatar groupe sidebar */
.sidebar-group-avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-xs);
    background: linear-gradient(135deg, #ff7a00, #ffb347);
    color: var(--white);
    font-weight: 900;
    font-size: 0.82rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    letter-spacing: 0.5px;
}
.sidebar-group-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Bouton rejoindre sidebar */
.sidebar-btn-join {
    background: var(--orange);
    color: var(--white);
    border: none;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: background var(--transition);
}
.sidebar-btn-join:hover { background: var(--orange-hover); }

/* Bouton message sidebar */
.sidebar-btn-msg {
    font-size: 1rem;
    padding: 4px 8px;
    border-radius: var(--radius-xs);
    text-decoration: none;
    flex-shrink: 0;
    transition: background var(--transition);
}
.sidebar-btn-msg:hover { background: var(--orange-light); }

/* Voir tout */
.sidebar-see-all {
    display: block;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--orange);
    text-align: center;
    text-decoration: none;
    padding: 6px;
    border-radius: var(--radius-xs);
    transition: background var(--transition);
    margin-top: 4px;
}
.sidebar-see-all:hover { background: var(--orange-light); text-decoration: none; }

/* ── Posts suggérés ── */
.sidebar-post-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 8px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--text);
    transition: background var(--transition);
    border-bottom: 1px solid #f5f5f5;
}
.sidebar-post-item:last-child { border-bottom: none; }
.sidebar-post-item:hover { background: #f9fafb; text-decoration: none; color: var(--text); }

.sidebar-post-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sidebar-post-author {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text);
}

.sidebar-post-content {
    font-size: 0.75rem;
    color: var(--text-light);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.sidebar-post-likes {
    font-size: 0.70rem;
    color: var(--text-xlight);
}

/* ── Liens rapides ── */
.sidebar-links { padding: 14px 16px; }

.sidebar-quick-links {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin-bottom: 12px;
}

.sidebar-quick-links a {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-light);
    text-decoration: none;
    padding: 7px 8px;
    border-radius: var(--radius-xs);
    background: #f9fafb;
    border: 1px solid var(--border);
    text-align: center;
    transition: background var(--transition), color var(--transition);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sidebar-quick-links a:hover {
    background: var(--orange-light);
    color: var(--orange);
    border-color: var(--orange-border);
    text-decoration: none;
}

.sidebar-footer-text {
    font-size: 0.72rem;
    color: var(--text-xlight);
    text-align: center;
}

/* ═══════════════════════════════════════════
   RESPONSIVE — sidebar en bas sur mobile
═══════════════════════════════════════════ */
@media (max-width: 900px) {
    .dashboard-layout {
        grid-template-columns: 1fr;
    }

    .right-sidebar {
        position: static;
        max-height: none;
        overflow-y: visible;
        /* Sidebar en bas sur mobile = ordre naturel du DOM */
    }

    /* Sur tablette, sidebar en ligne horizontale scrollable */
    .right-sidebar {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 12px;
    }
}

@media (max-width: 480px) {
    .right-sidebar {
        grid-template-columns: 1fr;
    }
}

/* ═══════════════════════════════════════════
   V3.4.5 — FOLLOW + CARROUSELS
═══════════════════════════════════════════ */

/* ── Boutons follow profil ── */
.btn-follow {
    background: var(--orange);
    color: var(--white);
    border: none;
    padding: 10px 22px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: background var(--transition), box-shadow var(--transition);
}
.btn-follow:hover {
    background: var(--orange-hover);
    box-shadow: 0 4px 12px rgba(255,122,0,0.30);
}

.btn-following {
    background: #f3f4f6;
    color: var(--text-light);
    border: 1.5px solid var(--border);
    padding: 10px 22px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: background var(--transition), color var(--transition);
}
.btn-following:hover {
    background: #fef2f2;
    color: #dc2626;
    border-color: #fecaca;
}

.btn-message-profil {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    background: #f3f4f6;
    color: var(--text);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    border: 1.5px solid var(--border);
    transition: background var(--transition);
}
.btn-message-profil:hover {
    background: var(--orange-light);
    color: var(--orange);
    border-color: var(--orange-border);
    text-decoration: none;
}

/* Compteurs follow sur profil */
.profile-follow-counts {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    font-size: 0.88rem;
    color: var(--text-light);
}

.follow-count-item strong {
    color: var(--text);
    font-weight: 800;
}

.follow-count-sep {
    color: var(--text-xlight);
}

/* Actions profil (plusieurs boutons) */
.profile-cta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* ══════════════════════════════════════
   CARROUSELS DANS LE FEED
══════════════════════════════════════ */

.carousel-block {
    margin: 8px 0;
    padding: 16px 16px 12px;
    overflow: hidden;
}

.carousel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.carousel-title {
    font-size: 0.9rem;
    font-weight: 800;
    color: var(--text);
}

.carousel-see-all {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--orange);
    text-decoration: none;
    transition: color var(--transition);
}
.carousel-see-all:hover { color: var(--orange-hover); }

/* Piste scrollable horizontalement */
.carousel-track {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 8px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.carousel-track::-webkit-scrollbar { display: none; }

/* Carte dans le carrousel */
.carousel-card {
    flex-shrink: 0;
    width: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 14px 10px 12px;
    background: #fafafa;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-align: center;
    scroll-snap-align: start;
    transition: box-shadow var(--transition), transform var(--transition);
}
.carousel-card:hover {
    box-shadow: 0 4px 14px rgba(0,0,0,0.09);
    transform: translateY(-2px);
}

/* Avatar dans carrousel (taille fixe) */
.carousel-avatar-link {
    display: block;
    text-decoration: none;
}

.carousel-card .avatar-sm {
    width: 52px;
    height: 52px;
    font-size: 1.2rem;
}

/* Avatar groupe dans carrousel */
.carousel-group-avatar {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, #ff7a00, #ffb347);
    color: var(--white);
    font-weight: 900;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    letter-spacing: 1px;
}
.carousel-group-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Nom dans carrousel */
.carousel-name {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text);
    text-decoration: none;
    line-height: 1.3;
    transition: color var(--transition);
    display: block;
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.carousel-name:hover { color: var(--orange); }

.carousel-meta {
    font-size: 0.70rem;
    color: var(--text-xlight);
    line-height: 1.3;
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.carousel-meta-secondary {
    font-size: 0.68rem;
    color: var(--text-xlight);
}

/* Bouton follow dans carrousel */
.carousel-btn-follow {
    background: var(--orange);
    color: var(--white);
    border: none;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 700;
    cursor: pointer;
    width: 100%;
    transition: background var(--transition);
    margin-top: 2px;
}
.carousel-btn-follow:hover { background: var(--orange-hover); }

.carousel-btn-join {
    background: #f0fdf4;
    color: #16a34a;
    border: 1px solid #bbf7d0;
}
.carousel-btn-join:hover {
    background: #dcfce7;
}

/* ── Responsive ── */
@media (max-width: 900px) {
    .dashboard-layout {
        grid-template-columns: 1fr;
    }
    .right-sidebar {
        position: static;
        max-height: none;
        overflow-y: visible;
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 12px;
    }
}

@media (max-width: 480px) {
    .right-sidebar { grid-template-columns: 1fr; }
    .carousel-card { width: 105px; }
    .profile-cta   { flex-direction: column; }
    .btn-follow,
    .btn-following,
    .btn-message-profil { width: 100%; justify-content: center; }
}

/* ═══════════════════════════════════════════
   V3.5 — UPLOAD AVANCÉ + MÉDIAS + UX
═══════════════════════════════════════════ */

/* ── Zone upload V3.5 ── */
.upload-zone-v35 {
    margin-bottom: 14px;
}

.upload-zone-btns {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.upload-btn-img,
.upload-btn-vid,
.upload-btn-pdf {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 7px 14px;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition), border-color var(--transition);
    border: 1.5px solid var(--border);
    background: #fafafa;
    color: var(--text-light);
    user-select: none;
}

.upload-btn-img:hover { background: #fff0f0; border-color: #fca5a5; color: #dc2626; }
.upload-btn-vid:hover { background: #eff6ff; border-color: #93c5fd; color: #1d4ed8; }
.upload-btn-pdf:hover { background: var(--orange-light); border-color: var(--orange-border); color: var(--orange); }

/* Aperçus fichiers */
.upload-previews {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}

.upload-preview-item {
    position: relative;
    width: 72px;
    height: 72px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: #f3f4f6;
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.upload-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.upload-preview-name {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0,0,0,0.55);
    color: #fff;
    font-size: 0.55rem;
    padding: 2px 3px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.upload-preview-remove {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 18px;
    height: 18px;
    background: rgba(0,0,0,0.55);
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 0.6rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Barre de progression */
.upload-progress-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
}

.upload-progress-bar {
    flex: 1;
    height: 6px;
    background: #f3f4f6;
    border-radius: 20px;
    overflow: hidden;
}

.upload-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #ff7a00, #ffb347);
    border-radius: 20px;
    transition: width 0.3s ease;
    min-width: 4px;
}

.upload-progress-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--orange);
    min-width: 40px;
    text-align: right;
}

/* ── Vidéo ── */
.post-video {
    width: 100%;
    border-radius: var(--radius-sm);
    max-height: 420px;
    background: #000;
    display: block;
}

/* ── Grille multi-images ── */
.post-images-grid {
    display: grid;
    gap: 3px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    max-height: 420px;
}

.post-images-1 { grid-template-columns: 1fr; }
.post-images-2 { grid-template-columns: 1fr 1fr; }
.post-images-3 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.post-images-3 .post-grid-img:first-child { grid-row: 1 / 3; }
.post-images-4 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }

.post-grid-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    min-height: 120px;
    max-height: 210px;
    display: block;
    cursor: pointer;
}

/* Overlay "+X" */
.post-grid-more {
    position: relative;
    display: block;
}

.post-grid-more img {
    filter: brightness(0.45);
}

.post-grid-more-count {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    font-weight: 800;
    color: #fff;
}

/* ── "Voir plus" texte ── */
.btn-voir-plus {
    background: none;
    border: none;
    color: var(--orange);
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    padding: 0;
    margin-left: 4px;
    transition: color var(--transition);
}
.btn-voir-plus:hover { color: var(--orange-hover); }

/* ── "Voir tous les commentaires" ── */
.btn-voir-tous-comments {
    background: none;
    border: none;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-light);
    cursor: pointer;
    padding: 6px 0 8px;
    display: block;
    transition: color var(--transition);
}
.btn-voir-tous-comments:hover { color: var(--orange); }

/* ── Responsive ── */
@media (max-width: 480px) {
    .upload-zone-btns { gap: 6px; }
    .upload-btn-img,
    .upload-btn-vid,
    .upload-btn-pdf { padding: 6px 10px; font-size: 0.78rem; }
    .post-images-grid { max-height: 280px; }
    .post-grid-img  { min-height: 80px; max-height: 140px; }
}

/* ═══════════════════════════════════════════
   V3.5 — POSTS UNIFIÉS + MÉDIAS + UX
═══════════════════════════════════════════ */

/* ── "Voir plus" ── */
.post-text-short { display: inline; }
.post-text-full  { display: none;   }

.btn-voir-plus {
    background: none;
    border: none;
    color: var(--orange);
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    padding: 0 0 0 4px;
    transition: color var(--transition);
}
.btn-voir-plus:hover { color: var(--orange-hover); }

/* ── "Voir tous les commentaires" ── */
.btn-voir-tous-comments {
    background: none;
    border: none;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-light);
    cursor: pointer;
    padding: 6px 0 8px;
    display: block;
    transition: color var(--transition);
}
.btn-voir-tous-comments:hover { color: var(--orange); }

/* ── Vidéo ── */
.post-video {
    width: 100%;
    border-radius: var(--radius-sm);
    max-height: 420px;
    background: #000;
    display: block;
}

/* ── Grille multi-images ── */
.post-images-grid {
    display: grid;
    gap: 3px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    max-height: 420px;
}
.post-images-1 { grid-template-columns: 1fr; }
.post-images-2 { grid-template-columns: 1fr 1fr; }
.post-images-3 {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
}
.post-images-3 .post-grid-img:first-child { grid-row: 1 / 3; }
.post-images-4 {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
}

.post-grid-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    min-height: 120px;
    max-height: 210px;
    display: block;
    cursor: pointer;
    transition: opacity var(--transition);
}
.post-grid-img:hover { opacity: 0.92; }

/* Overlay "+X" sur la dernière vignette */
.post-grid-more {
    position: relative;
    display: block;
    cursor: pointer;
    overflow: hidden;
}
.post-grid-more img { filter: brightness(0.45); }
.post-grid-more-count {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    font-weight: 800;
    color: #fff;
}

/* ── Lightbox ── */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.fade-in { animation: fadeIn 0.3s ease-out forwards; }

.lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.92);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
    animation: fadeIn 0.2s ease;
}
.lightbox-img {
    max-width: 95vw;
    max-height: 92vh;
    object-fit: contain;
    border-radius: var(--radius-sm);
    box-shadow: 0 8px 40px rgba(0,0,0,0.6);
    cursor: default;
}
.lightbox-close {
    position: fixed;
    top: 16px;
    right: 20px;
    color: #fff;
    font-size: 1.8rem;
    cursor: pointer;
    background: rgba(0,0,0,0.5);
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition);
    z-index: 1001;
}
.lightbox-close:hover { background: rgba(255,255,255,0.2); }

/* ── Like AJAX — pas de saut de page ── */
/* Le bouton like est maintenant un <button onclick> sans <form>
   donc la page ne rechargera jamais */

/* ── Badge "Nouveau" sur posts injectés en temps réel ── */
.new-post-tag {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    background: #dcfce7;
    color: #16a34a;
    font-size: 0.68rem;
    font-weight: 700;
    border-radius: 20px;
    border: 1px solid #bbf7d0;
    flex-shrink: 0;
}

/* ── Statut en ligne ── */
.status-online  { color: #16a34a; }
.status-recent  { color: #f59e0b; }
.status-offline { color: var(--text-xlight); }

.profile-avatar-wrap { position: relative; width: fit-content; }

.profile-status-dot {
    position: absolute;
    bottom: 2px; right: 2px;
    width: 14px; height: 14px;
    border-radius: 50%;
    border: 3px solid var(--white);
}
.profile-status-dot.status-online  { background: #22c55e; }
.profile-status-dot.status-recent  { background: #f59e0b; }
.profile-status-dot.status-offline { background: #d1d5db; }

.profile-status-label {
    font-size: 0.72rem;
    font-weight: 400;
    margin-left: 8px;
}

/* ── Breadcrumb ── */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 14px;
    flex-wrap: wrap;
}
.breadcrumb a     { color: var(--orange); font-weight: 600; text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb span  { color: var(--text-xlight); }

/* ── Upload zone V3.5 ── */
.upload-zone-v35 { margin-bottom: 14px; }

.upload-zone-btns {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.upload-btn-img,
.upload-btn-vid,
.upload-btn-pdf {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 7px 14px;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    border: 1.5px solid var(--border);
    background: #fafafa;
    color: var(--text-light);
    user-select: none;
    transition: background var(--transition), border-color var(--transition);
}
.upload-btn-img:hover { background: #fff0f0; border-color: #fca5a5; color: #dc2626; }
.upload-btn-vid:hover { background: #eff6ff; border-color: #93c5fd; color: #1d4ed8; }
.upload-btn-pdf:hover { background: var(--orange-light); border-color: var(--orange-border); color: var(--orange); }

.upload-previews {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}

.upload-preview-item {
    position: relative;
    width: 72px; height: 72px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: #f3f4f6;
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}
.upload-preview-item img { width: 100%; height: 100%; object-fit: cover; }

.upload-preview-name {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    background: rgba(0,0,0,0.55);
    color: #fff;
    font-size: 0.55rem;
    padding: 2px 3px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.upload-preview-remove {
    position: absolute;
    top: 2px; right: 2px;
    width: 18px; height: 18px;
    background: rgba(0,0,0,0.55);
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 0.6rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.upload-progress-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
}
.upload-progress-bar {
    flex: 1;
    height: 6px;
    background: #f3f4f6;
    border-radius: 20px;
    overflow: hidden;
}
.upload-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #ff7a00, #ffb347);
    border-radius: 20px;
    transition: width 0.3s ease;
    min-width: 4px;
}
.upload-progress-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--orange);
    min-width: 40px;
    text-align: right;
}

/* ── Responsive ── */
@media (max-width: 480px) {
    .post-images-grid  { max-height: 280px; }
    .post-grid-img     { min-height: 80px; max-height: 140px; }
    .post-video        { max-height: 260px; }
    .lightbox-img      { border-radius: 0; }
    .upload-zone-btns  { gap: 6px; }
    .upload-btn-img,
    .upload-btn-vid,
    .upload-btn-pdf    { padding: 6px 10px; font-size: 0.78rem; }
}

/* ═══════════════════════════════════════════
   SLIDER MULTI-IMAGES
═══════════════════════════════════════════ */

.post-slider {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-sm);
    background: #000;
    user-select: none;
    touch-action: pan-y;
}

/* Piste : toutes les slides côte à côte */
.slider-track {
    display: flex;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

.slider-slide {
    min-width: 100%;
    flex-shrink: 0;
}

.slider-img {
    width: 100%;
    max-height: 420px;
    object-fit: contain;
    display: block;
    cursor: zoom-in;
    background: #000;
}

/* Flèches gauche / droite */
.slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.55);
    color: #fff;
    border: none;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: background 0.15s, opacity 0.15s;
    opacity: 0.75;
}
.slider-btn:hover { background: rgba(0,0,0,0.82); opacity: 1; }

.slider-prev { left: 10px; }
.slider-next { right: 10px; }

/* Compteur numérique "1 / 5" */
.slider-counter {
    position: absolute;
    top: 10px;
    right: 12px;
    background: rgba(0,0,0,0.55);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 20px;
    z-index: 10;
    pointer-events: none;
}

/* Points de navigation */
.slider-dots {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    z-index: 10;
}

.slider-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.55);
    cursor: pointer;
    padding: 0;
    transition: background 0.2s, transform 0.2s;
}
.slider-dot.dot-active {
    background: #fff;
    transform: scale(1.3);
}

/* ── Vidéo ── */
.post-video {
    width: 100%;
    max-height: 420px;
    border-radius: var(--radius-sm);
    background: #000;
    display: block;
    outline: none;
}

/* ── Responsive ── */
@media (max-width: 480px) {
    .slider-img  { max-height: 280px; }
    .slider-btn  { width: 32px; height: 32px; font-size: 1.1rem; }
    .post-video  { max-height: 260px; }
}

/* ── Navigation lightbox slider ── */
.lightbox-nav {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.55);
    color: #fff;
    border: none;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    font-size: 1.8rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1002;
    transition: background 0.15s;
}
.lightbox-nav:hover { background: rgba(255,255,255,0.2); }
.lightbox-nav-prev  { left: 16px; }
.lightbox-nav-next  { right: 16px; }

.lightbox-counter {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.55);
    color: #fff;
    font-size: 0.85rem;
    font-weight: 700;
    padding: 4px 14px;
    border-radius: 20px;
    z-index: 1002;
    pointer-events: none;
}

@media (max-width: 480px) {
    .lightbox-nav { width: 38px; height: 38px; font-size: 1.4rem; }
    .lightbox-nav-prev { left: 6px; }
    .lightbox-nav-next { right: 6px; }
}

/* ═══════════════════════════════════════════
   VIDÉO — affichage correct
═══════════════════════════════════════════ */

.post-video-wrap {
    position: relative;
    background: #000;
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.post-video {
    width: 100%;
    max-height: 480px;
    display: block;
    border-radius: var(--radius-sm);
    background: #000;
    outline: none;
}

.video-unsupported {
    color: #aaa;
    padding: 20px;
    text-align: center;
    font-size: 0.85rem;
}
.video-unsupported a { color: var(--orange); }

/* ═══════════════════════════════════════════
   DOCUMENTS — cartes modernes
═══════════════════════════════════════════ */

/* Grille desktop */
.docs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 14px;
}

/* Carte */
.doc-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: var(--radius);
    background: var(--white);
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: box-shadow 0.2s, transform 0.2s;
    padding: 0;
}
.doc-card:hover {
    box-shadow: 0 6px 24px rgba(0,0,0,0.12);
    transform: translateY(-3px);
}

/* Bande colorée (haut desktop, gauche mobile) */
.doc-bande {
    background: linear-gradient(135deg, #ff7a00, #ffb347);
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 80px;
}

.doc-pdf-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    filter: drop-shadow(0 2px 6px rgba(0,0,0,0.2));
}

/* Corps */
.doc-corps {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 14px 16px 16px;
    flex: 1;
}

.doc-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.doc-badge {
    display: inline-block;
    padding: 3px 9px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 600;
}
.doc-badge-niveau  { background: var(--orange-light); color: var(--orange); }
.doc-badge-matiere { background: #eff6ff; color: #1d4ed8; }

.doc-titre {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.4;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

.doc-auteur {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-wrap: wrap;
}

.doc-auteur-nom {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-light);
    text-decoration: none;
}
.doc-auteur-nom:hover { color: var(--orange); }

.doc-date {
    font-size: 0.72rem;
    color: var(--text-xlight);
    margin-left: auto;
}

.doc-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 10px;
    border-top: 1px solid #f3f4f6;
    gap: 8px;
    flex-wrap: wrap;
}

.doc-dl-count {
    font-size: 0.75rem;
    color: var(--text-xlight);
}

.doc-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-doc-download {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    background: var(--orange);
    color: var(--white);
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    font-weight: 700;
    text-decoration: none;
    transition: background 0.15s, box-shadow 0.15s;
    white-space: nowrap;
}
.btn-doc-download:hover {
    background: var(--orange-hover);
    box-shadow: 0 3px 10px rgba(255,122,0,0.3);
    text-decoration: none;
    color: var(--white);
}

.btn-doc-delete {
    background: none;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 5px 8px;
    font-size: 0.85rem;
    cursor: pointer;
    color: var(--text-xlight);
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.btn-doc-delete:hover {
    background: #fef2f2;
    border-color: #fecaca;
    color: #dc2626;
}

/* ── Mobile : cartes horizontales ── */
@media (max-width: 768px) {
    .docs-grid {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }
    .doc-card  { flex-direction: row; min-height: 110px; }
    .doc-bande {
        width: 70px;
        min-width: 70px;
        padding: 0;
        align-self: stretch;
        border-radius: 0;
        align-items: center;
        justify-content: center;
    }
    .doc-corps { padding: 10px 12px; }
    .doc-titre { font-size: 0.88rem; }
    .btn-doc-download-text { display: none; }
}

/* ═══════════════════════════════════════════
   CLASSEMENT — TOP 5 + Voir plus
═══════════════════════════════════════════ */

/* Masquer les rangs > 5 par défaut */
.lb-hidden {
    display: none !important;
}

/* Bouton "Voir plus" */
.lb-voir-plus-wrap {
    text-align: center;
    margin-top: 12px;
}

.btn-lb-voir-plus {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    background: var(--orange-light);
    color: var(--orange);
    border: 1.5px solid var(--orange-border);
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s, box-shadow 0.15s;
}
.btn-lb-voir-plus:hover {
    background: var(--orange);
    color: var(--white);
    box-shadow: 0 4px 12px rgba(255,122,0,0.28);
}

/* ═══════════════════════════════════════════
   PHOTOS GROUPES
═══════════════════════════════════════════ */

/* Carte liste groupes */
.groupe-card-banner {
    height: 100px;
    background: linear-gradient(135deg, #ff7a00, #ffb347);
    border-radius: var(--radius) var(--radius) 0 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.groupe-card-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.groupe-card-initiales {
    font-size: 1.8rem;
    font-weight: 900;
    color: rgba(255,255,255,0.9);
    letter-spacing: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

/* Reste du contenu carte */
.groupe-card-body { padding: 14px 16px 10px; flex: 1; }
.groupe-card-nom  { font-size: 1rem; font-weight: 800; margin-bottom: 5px; }
.groupe-card-nom a { color: var(--text); text-decoration: none; }
.groupe-card-nom a:hover { color: var(--orange); }
.groupe-card-desc { font-size: 0.82rem; color: var(--text-light); margin-bottom: 8px; line-height: 1.4; }
.groupe-card-meta { font-size: 0.75rem; color: var(--text-xlight); display: flex; gap: 6px; }
.groupe-card-footer {
    padding: 10px 16px 14px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 8px;
}

.btn-voir-groupe {
    display: inline-flex;
    align-items: center;
    padding: 7px 14px;
    background: var(--orange-light);
    color: var(--orange);
    border: 1.5px solid var(--orange-border);
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-weight: 700;
    text-decoration: none;
    transition: background var(--transition);
}
.btn-voir-groupe:hover {
    background: var(--orange);
    color: var(--white);
    text-decoration: none;
}

/* Grille groupes */
.groupes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}

.groupe-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: box-shadow var(--transition), transform var(--transition);
    padding: 0;
}
.groupe-card:hover {
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}

/* ═══════════════════════════════════════════
   CLASSEMENT — toggle Voir plus/moins
═══════════════════════════════════════════ */

.lb-voir-plus-wrap {
    text-align: center;
    margin-top: 12px;
}

.btn-lb-voir-plus {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    background: var(--orange-light);
    color: var(--orange);
    border: 1.5px solid var(--orange-border);
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s, box-shadow 0.15s;
}
.btn-lb-voir-plus:hover {
    background: var(--orange);
    color: var(--white);
    box-shadow: 0 4px 12px rgba(255,122,0,0.28);
}

/* ═══════════════════════════════════════════
   NOTIFICATION — bouton effacer
═══════════════════════════════════════════ */

.btn-notif-clear {
    background: none;
    border: 1.5px solid #fecaca;
    color: #dc2626;
    padding: 7px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.btn-notif-clear:hover {
    background: #fef2f2;
}

/* ═══════════════════════════════════════════
   DOCUMENTS — alerte upload
═══════════════════════════════════════════ */

.docs-upload-info {
    padding: 11px 16px;
    font-size: 0.85rem;
    color: var(--text-light);
    background: #fffbf0;
    border-left: 3px solid var(--orange);
    margin-bottom: 14px;
}

/* ═══════════════════════════════════════════
   MESSAGE ERREUR UX (post sans description)
═══════════════════════════════════════════ */

.flash.error {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    font-size: 0.88rem;
    font-weight: 600;
    margin-bottom: 14px;
}

.flash.success {
    background: #f0fdf4;
    color: #16a34a;
    border: 1px solid #bbf7d0;
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    font-size: 0.88rem;
    font-weight: 600;
    margin-bottom: 14px;
}

.flash.info {
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    font-size: 0.88rem;
    font-weight: 600;
    margin-bottom: 14px;
}

/* ═══════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════ */

@media (max-width: 600px) {
    .groupes-grid { grid-template-columns: 1fr; }
}

/* ═══════════════════════════════════════════
   MESSAGERIE AVANCÉE
═══════════════════════════════════════════ */

/* Layout global */
.messages-layout {
    display: grid;
    grid-template-columns: 300px 1fr;
    height: calc(100vh - var(--navbar-h));
    max-height: calc(100vh - var(--navbar-h));
    overflow: hidden;
    background: var(--white);
}

/* ── Sidebar conversations ── */
.conv-sidebar {
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border);
    overflow: hidden;
    background: var(--white);
}

.conv-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 16px 10px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.conv-sidebar-title {
    font-size: 1rem;
    font-weight: 800;
    color: var(--text);
    margin: 0;
}

.conv-badge-total {
    background: var(--orange);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 800;
    min-width: 20px;
    height: 20px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
}

/* Recherche */
.conv-search-wrap {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.conv-search-results {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-top: 6px;
    max-height: 220px;
    overflow-y: auto;
    z-index: 10;
}

.conv-search-result-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    text-decoration: none;
    color: var(--text);
    border-bottom: 1px solid #f5f5f5;
    transition: background var(--transition);
    font-size: 0.85rem;
}
.conv-search-result-item:hover {
    background: var(--orange-light);
    text-decoration: none;
    color: var(--text);
}
.conv-search-result-item:last-child { border-bottom: none; }

/* Liste conversations */
.conv-list {
    flex: 1;
    overflow-y: auto;
    list-style: none;
    margin: 0;
    padding: 0;
    scrollbar-width: thin;
}

.conv-empty {
    padding: 30px 16px;
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-xlight);
}
.conv-empty p { margin-bottom: 6px; }

.conv-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    text-decoration: none;
    color: var(--text);
    border-bottom: 1px solid #f9f9f9;
    transition: background var(--transition);
    position: relative;
}
.conv-item:hover         { background: #f9fafb; text-decoration: none; color: var(--text); }
.conv-item-active        { background: var(--orange-light); }
.conv-item-unread        { background: #fffbf5; }

.conv-avatar { position: relative; flex-shrink: 0; }

.conv-unread-dot {
    position: absolute;
    top: 0; right: 0;
    width: 10px; height: 10px;
    background: var(--orange);
    border-radius: 50%;
    border: 2px solid var(--white);
}

.conv-info  { flex: 1; min-width: 0; }

.conv-name-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2px;
}

.conv-name {
    font-size: 0.88rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text);
    max-width: 130px;
}

.conv-time {
    font-size: 0.7rem;
    color: var(--text-xlight);
    flex-shrink: 0;
}

.conv-preview {
    font-size: 0.78rem;
    color: var(--text-xlight);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0;
}

.conv-count-badge {
    background: var(--orange);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 800;
    min-width: 18px;
    height: 18px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    flex-shrink: 0;
}

/* ── Zone chat principale ── */
.chat-main {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #f7f7f8;
    position: relative;
}

.chat-empty-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: var(--text-xlight);
    text-align: center;
    padding: 40px;
}
.chat-empty-icon { font-size: 3rem; }
.chat-empty-state h3 { font-size: 1.1rem; font-weight: 700; color: var(--text-light); }
.chat-empty-state p  { font-size: 0.85rem; }

/* Header chat */
.chat-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--white);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.chat-back-btn {
    font-size: 1.2rem;
    color: var(--orange);
    text-decoration: none;
    padding: 4px 8px;
    border-radius: var(--radius-xs);
    transition: background var(--transition);
    flex-shrink: 0;
}
.chat-back-btn:hover { background: var(--orange-light); }

.chat-header-user {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text);
    flex: 1;
    min-width: 0;
}
.chat-header-user:hover { text-decoration: none; }

.chat-user-name   { font-size: 0.95rem; font-weight: 700; color: var(--text); display: block; }
.chat-user-status { font-size: 0.75rem; display: block; }
.chat-user-status.status-online { color: #16a34a; }
.chat-user-status.status-recent { color: #f59e0b; }
.chat-user-status.status-offline{ color: var(--text-xlight); }

.btn-see-profile {
    font-size: 1.1rem;
    padding: 6px 10px;
    border-radius: var(--radius-xs);
    text-decoration: none;
    color: var(--text-light);
    transition: background var(--transition);
    flex-shrink: 0;
}
.btn-see-profile:hover { background: var(--orange-light); }

/* Messages scrollables */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    scrollbar-width: thin;
}

/* Séparateur date */
.chat-date-sep {
    text-align: center;
    margin: 12px 0;
}
.chat-date-sep span {
    background: rgba(0,0,0,0.08);
    color: var(--text-xlight);
    font-size: 0.72rem;
    font-weight: 600;
    padding: 3px 12px;
    border-radius: 20px;
}

/* Indication "début" */
.chat-start-hint {
    text-align: center;
    padding: 20px;
    color: var(--text-xlight);
    font-size: 0.85rem;
}

/* Bulles messages */
.chat-bubble-wrap {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    max-width: 75%;
}

.bubble-mine   { align-self: flex-end;  flex-direction: row-reverse; }
.bubble-theirs { align-self: flex-start; }

.bubble-avatar { flex-shrink: 0; }

.chat-bubble {
    padding: 10px 14px;
    border-radius: 18px;
    max-width: 100%;
    position: relative;
    word-break: break-word;
}

.bubble-mine   .chat-bubble {
    background: var(--orange);
    color: #fff;
    border-bottom-right-radius: 4px;
}
.bubble-theirs .chat-bubble {
    background: var(--white);
    color: var(--text);
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.bubble-text { margin: 0; font-size: 0.9rem; line-height: 1.45; }

/* Image dans bulle */
.bubble-image {
    max-width: 220px;
    max-height: 220px;
    border-radius: 10px;
    object-fit: cover;
    display: block;
    cursor: zoom-in;
    margin: 4px 0;
}

/* Fichier dans bulle */
.bubble-file {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: rgba(0,0,0,0.08);
    border-radius: 10px;
    text-decoration: none;
    color: inherit;
    margin: 4px 0;
    transition: background var(--transition);
}
.bubble-file:hover { background: rgba(0,0,0,0.15); text-decoration: none; color: inherit; }
.bubble-file-icon  { font-size: 1.2rem; }
.bubble-file-name  { font-size: 0.8rem; font-weight: 600; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bubble-file-dl    { font-size: 0.9rem; }

/* Méta (heure + vu) */
.bubble-meta {
    display: flex;
    align-items: center;
    gap: 4px;
    justify-content: flex-end;
    margin-top: 4px;
}
.bubble-meta time { font-size: 0.68rem; opacity: 0.7; }
.bubble-read      { font-size: 0.7rem; opacity: 0.8; }

/* Typing indicator */
.chat-typing {
    padding: 6px 16px;
    font-size: 0.78rem;
    color: var(--text-xlight);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    background: #f7f7f8;
}

.typing-dots { display: flex; gap: 3px; }
.typing-dots span {
    width: 6px; height: 6px;
    background: var(--text-xlight);
    border-radius: 50%;
    animation: typingBounce 1.2s infinite ease-in-out;
}
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
    0%,60%,100% { transform: translateY(0); }
    30%          { transform: translateY(-5px); }
}

/* Zone saisie */
.chat-input-zone {
    padding: 10px 14px;
    background: var(--white);
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}

/* Aperçu fichier sélectionné */
.chat-file-preview {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    background: var(--orange-light);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    font-size: 0.8rem;
    color: var(--orange);
    font-weight: 600;
}
.chat-file-remove {
    background: none;
    border: none;
    color: var(--orange);
    cursor: pointer;
    font-size: 0.9rem;
    margin-left: auto;
    padding: 0;
}

.chat-form {
    display: flex;
    align-items: flex-end;
    gap: 8px;
}

.chat-attach-btn {
    font-size: 1.2rem;
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-xs);
    color: var(--text-light);
    flex-shrink: 0;
    transition: background var(--transition), color var(--transition);
    line-height: 1;
}
.chat-attach-btn:hover { background: var(--orange-light); color: var(--orange); }

.chat-textarea {
    flex: 1;
    padding: 10px 14px;
    border: 1.5px solid var(--border);
    border-radius: 22px;
    font-size: 0.9rem;
    font-family: inherit;
    resize: none;
    outline: none;
    max-height: 120px;
    line-height: 1.45;
    transition: border-color var(--transition);
    background: #fafafa;
}
.chat-textarea:focus { border-color: var(--orange); background: var(--white); }

.chat-send-btn {
    background: var(--orange);
    color: var(--white);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background var(--transition), box-shadow var(--transition);
}
.chat-send-btn:hover    { background: var(--orange-hover); box-shadow: 0 3px 10px rgba(255,122,0,0.3); }
.chat-send-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Pastille statut (petite) */
.status-dot-sm {
    position: absolute;
    bottom: -1px; right: -1px;
    width: 10px; height: 10px;
    border-radius: 50%;
    border: 2px solid var(--white);
}
.status-dot-sm.status-online  { background: #22c55e; }
.status-dot-sm.status-recent  { background: #f59e0b; }
.status-dot-sm.status-offline { background: #d1d5db; }

/* ── Responsive mobile ── */
@media (max-width: 700px) {
    .messages-layout {
        grid-template-columns: 1fr;
        grid-template-rows: 1fr;
    }

    .conv-sidebar {
        display: none;
    }
    .messages-layout.chat-active .conv-sidebar {
        display: none;
    }
    .chat-main { height: calc(100vh - var(--navbar-h)); }

    .chat-bubble-wrap { max-width: 88%; }
}

@media (max-width: 700px) and (min-width: 0px) {
    /* Sur mobile, afficher sidebar si pas de chat actif */
    .messages-layout:not(.chat-active) .conv-sidebar { display: flex; width: 100%; }
    .messages-layout:not(.chat-active) .chat-main    { display: none; }
    .messages-layout.chat-active .chat-main          { display: flex; width: 100%; }
}

/* ═══════════════════════════════════════════
   UPLOAD DOCUMENT — Zone drop + progress
═══════════════════════════════════════════ */

.doc-drop-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 32px 20px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    position: relative;
    background: #fafafa;
}
.doc-drop-zone:hover,
.doc-drop-zone.drop-zone-hover {
    border-color: var(--orange);
    background: var(--orange-light);
}
.doc-drop-zone.drop-zone-ready {
    border-color: #22c55e;
    background: #f0fdf4;
}

.doc-drop-zone input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
}

.doc-drop-icon { font-size: 2.5rem; margin-bottom: 10px; }
.doc-drop-text { font-size: 0.95rem; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.doc-drop-hint { font-size: 0.78rem; color: var(--text-xlight); }

.doc-file-info {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    padding: 8px 12px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
}
.doc-file-name { font-weight: 700; color: var(--text); flex: 1; }
.doc-file-size { color: var(--text-xlight); flex-shrink: 0; }

.doc-upload-progress {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}
.doc-progress-bar {
    flex: 1;
    height: 6px;
    background: #f3f4f6;
    border-radius: 20px;
    overflow: hidden;
}
.doc-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--orange), #ffb347);
    border-radius: 20px;
    width: 0%;
    transition: width 0.3s ease;
}
.doc-progress-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--orange);
    min-width: 38px;
    text-align: right;
}

/* Erreurs upload */
.upload-errors {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    margin: 0 24px 16px;
}
.upload-error-item {
    font-size: 0.85rem;
    color: #dc2626;
    margin-bottom: 4px;
    font-weight: 600;
}
.upload-error-item:last-child { margin-bottom: 0; }

/* Notice PHP config */
.docs-php-notice {
    margin-top: 20px;
    padding: 12px 14px;
    background: #fffbf0;
    border-left: 3px solid var(--orange);
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    color: var(--text-light);
    line-height: 1.8;
}
.docs-php-notice code {
    background: rgba(0,0,0,0.06);
    padding: 1px 5px;
    border-radius: 4px;
    font-family: monospace;
}

/* ═══════════════════════════════════════════
   BADGE NAVBAR — messages + notifications
═══════════════════════════════════════════ */

/* Badge générique sur icône navbar */
.nav-badge {
    position: absolute;
    top: -4px;
    right: -6px;
    min-width: 18px;
    height: 18px;
    background: #ef4444;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 800;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border: 2px solid var(--white);
    pointer-events: none;
    transition: opacity 0.2s;
    z-index: 2;
}

/* Masqué si vide */
.nav-badge.badge-hidden {
    display: none;
}

/* Position relative sur le bouton/lien qui porte le badge */
.nav-icon-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}


/* ═══════════════════════════════════════════
   NAVBAR — BADGES TEMPS RÉEL
═══════════════════════════════════════════ */

/* Chaque lien navbar peut porter un badge */
.nav-icon-btn {
    position: relative;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
}

/* Label texte sous l'icône (desktop) */
.nav-label {
    font-size: 0.62rem;
    font-weight: 600;
    color: var(--text-light);
    line-height: 1;
    letter-spacing: 0.2px;
}
.nav-link-active .nav-label { color: var(--orange); }

/* Badge générique */
.nav-badge {
    position: absolute;
    top: -4px;
    right: -8px;
    min-width: 18px;
    height: 18px;
    background: #ef4444;
    color: #fff;
    font-size: 0.62rem;
    font-weight: 800;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border: 2px solid var(--white);
    pointer-events: none;
    z-index: 2;
    transition: transform 0.2s, opacity 0.2s;
    transform-origin: top right;
}

/* Apparition du badge avec animation */
.nav-badge:not(.badge-hidden) {
    animation: badgePop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes badgePop {
    0%   { transform: scale(0); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

/* Masqué */
.badge-hidden {
    display: none !important;
}

/* ═══════════════════════════════════════════
   UPLOAD DOCUMENT — zone drop + progression
═══════════════════════════════════════════ */

/* Étape */
.doc-upload-step {
    margin-bottom: 20px;
}

.doc-step-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.doc-step-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--orange);
    color: #fff;
    font-size: 0.82rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.doc-step-num-ok {
    background: #22c55e;
}

.doc-step-label {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--text);
}

/* Zone drop */
.doc-drop-zone {
    border: 2.5px dashed var(--border);
    border-radius: var(--radius);
    padding: 36px 20px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s, transform 0.2s;
    position: relative;
    background: #fafafa;
    margin-bottom: 12px;
}

.doc-drop-zone input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
}

.doc-drop-zone:hover,
.doc-drop-zone.drop-zone-hover {
    border-color: var(--orange);
    background: var(--orange-light);
    transform: scale(1.005);
}

.doc-drop-zone.drop-zone-ready {
    border-color: #22c55e;
    background: #f0fdf4;
}

.doc-drop-icon   { font-size: 2.8rem; margin-bottom: 10px; }
.doc-drop-text   { font-size: 0.95rem; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.doc-drop-hint   { font-size: 0.78rem; color: var(--text-xlight); }

/* Info fichier sélectionné */
.doc-file-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: var(--radius-sm);
    margin-bottom: 14px;
}

.doc-file-icon    { font-size: 1.4rem; flex-shrink: 0; }
.doc-file-details { flex: 1; min-width: 0; }
.doc-file-name    { display: block; font-weight: 700; font-size: 0.88rem; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc-file-size    { display: block; font-size: 0.75rem; color: var(--text-xlight); margin-top: 2px; }
.doc-file-remove  {
    background: none;
    border: 1.5px solid #fecaca;
    color: #dc2626;
    border-radius: 50%;
    width: 26px; height: 26px;
    font-size: 0.75rem;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    transition: background 0.15s;
}
.doc-file-remove:hover { background: #fef2f2; }

/* Bouton démarrer upload */
.doc-btn-upload {
    width: 100%;
    padding: 12px;
    font-size: 0.95rem;
    border-radius: var(--radius-sm);
    transition: background 0.2s, box-shadow 0.2s, opacity 0.2s;
}
.doc-btn-upload:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    box-shadow: none;
}

/* Section progression */
.doc-progress-section {
    background: #fafafa;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 20px;
}

/* Barre de progression */
.doc-progress-outer {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 14px 0 10px;
}

.doc-progress-bar {
    flex: 1;
    height: 10px;
    background: #e5e7eb;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.08);
}

.doc-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--orange), #ffb347);
    border-radius: 20px;
    transition: width 0.35s ease;
    position: relative;
    overflow: hidden;
}

/* Effet brillant animé sur la barre */
.doc-progress-fill::after {
    content: '';
    position: absolute;
    top: 0; left: -60%;
    width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: progressShine 1.5s infinite;
}

@keyframes progressShine {
    0%   { left: -60%; }
    100% { left: 110%; }
}

.doc-progress-pct {
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--orange);
    min-width: 40px;
    text-align: right;
    flex-shrink: 0;
}

.doc-progress-detail {
    font-size: 0.78rem;
    color: var(--text-xlight);
    margin-bottom: 8px;
}

.doc-chunk-counters {
    font-size: 0.75rem;
    color: var(--text-xlight);
    font-weight: 600;
}

/* Résumé fichier uploadé (étape 2) */
.doc-uploaded-summary {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #f0fdf4;
    border: 1.5px solid #86efac;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
}

.doc-uploaded-icon { font-size: 1.6rem; flex-shrink: 0; }

.doc-uploaded-name {
    font-weight: 700;
    font-size: 0.88rem;
    color: var(--text);
    margin: 0 0 2px;
}

.doc-uploaded-size {
    font-size: 0.75rem;
    color: var(--text-xlight);
    margin: 0;
}

.doc-uploaded-ok {
    margin-left: auto;
    font-size: 0.78rem;
    font-weight: 700;
    color: #16a34a;
    background: #dcfce7;
    padding: 4px 10px;
    border-radius: 20px;
    flex-shrink: 0;
}

/* ═══════════════════════════════════════════
   CARROUSELS — boutons follow/join AJAX
   (pas de rechargement, scroll conservé)
═══════════════════════════════════════════ */

.carousel-btn-follow,
.carousel-btn-join {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    border: none;
    transition: background 0.15s, color 0.15s, transform 0.15s;
}

.carousel-btn-follow {
    background: var(--orange);
    color: #fff;
}
.carousel-btn-follow:hover:not(:disabled) {
    background: var(--orange-hover);
    transform: scale(1.04);
}
.carousel-btn-follow.btn-following {
    background: #f0fdf4;
    color: #16a34a;
    border: 1.5px solid #86efac;
}

.carousel-btn-join {
    background: #eff6ff;
    color: #1d4ed8;
    border: 1.5px solid #bfdbfe;
}
.carousel-btn-join:hover:not(:disabled) {
    background: #1d4ed8;
    color: #fff;
    transform: scale(1.04);
}
.carousel-btn-join.btn-joined {
    background: #f0fdf4;
    color: #16a34a;
    border: 1.5px solid #86efac;
}

button:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none !important;
}

/* ═══════════════════════════════════════════
   ANIMATION FADE-IN (posts, commentaires)
═══════════════════════════════════════════ */

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.3s ease-out forwards;
}

/* ═══════════════════════════════════════════
   DOCS PHP NOTICE
═══════════════════════════════════════════ */

.docs-php-notice {
    margin-top: 20px;
    padding: 12px 14px;
    background: #fffbf0;
    border-left: 3px solid var(--orange);
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    color: var(--text-light);
    line-height: 1.8;
}
.docs-php-notice code {
    background: rgba(0,0,0,0.07);
    padding: 1px 5px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.82rem;
}

/* ═══════════════════════════════════════════
   UPLOAD ERRORS
═══════════════════════════════════════════ */

.upload-errors {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: var(--radius-sm);
    padding: 12px 16px;
}
.upload-error-item {
    font-size: 0.85rem;
    color: #dc2626;
    font-weight: 600;
    margin-bottom: 4px;
}
.upload-error-item:last-child { margin-bottom: 0; }




/* ═══════════════════════════════════════════
   NAVBAR — ITEMS + BADGES TEMPS RÉEL
═══════════════════════════════════════════ */

/* Conteneur de chaque lien/bouton navbar */
.nav-item {
    position: relative;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
}

/* Wrapper interne (icône + badge) */
.nav-item-inner {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

/* Bouton navbar sans style natif */
.nav-item-inner-btn {
    background: none;
    border: none;
    cursor: pointer;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 6px 8px;
    border-radius: var(--radius-sm);
    color: var(--text-light);
    font-size: 1.2rem;
    transition: background var(--transition), color var(--transition);
    position: relative;
}
.nav-item-inner-btn:hover { background: var(--orange-light); color: var(--orange); }

/* Libellé texte sous l'icône */
.nav-label {
    font-size: 0.6rem;
    font-weight: 600;
    color: var(--text-xlight);
    letter-spacing: 0.2px;
    line-height: 1;
}
.nav-link-active .nav-label { color: var(--orange); }

/* ── Badge générique ── */
.nav-badge {
    position: absolute;
    top: -5px;
    right: -10px;
    min-width: 17px;
    height: 17px;
    background: #ef4444;
    color: #fff;
    font-size: 0.6rem;
    font-weight: 800;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border: 2px solid var(--white);
    pointer-events: none;
    z-index: 5;
    line-height: 1;
}

/* Badge sur burger menu (position légèrement différente) */
.nav-badge-burger {
    top: -6px;
    right: -6px;
    background: var(--orange);
}

/* Animation pop au changement de valeur */
@keyframes badgePop {
    0%   { transform: scale(0.5); opacity: 0; }
    60%  { transform: scale(1.25); }
    100% { transform: scale(1);   opacity: 1; }
}
.badge-pop {
    animation: badgePop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* Burger bars custom (pour compatibilité avec le badge) */
.nav-burger .burger-bar {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--text-light);
    border-radius: 2px;
    margin: 2px 0;
    transition: transform 0.3s, opacity 0.3s;
}
.nav-burger.open .burger-bar:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-burger.open .burger-bar:nth-child(2) { opacity: 0; }
.nav-burger.open .burger-bar:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ═══════════════════════════════════════════
   SLIDER MULTI-IMAGES — complet + swipe
═══════════════════════════════════════════ */

.post-slider {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-sm);
    background: #000;
    user-select: none;
    touch-action: pan-y;
}

.slider-track {
    display: flex;
    transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

.slider-slide {
    min-width: 100%;
    flex-shrink: 0;
}

/* ✅ Images cliquables dans le slider */
.slider-img {
    width: 100%;
    max-height: 480px;
    object-fit: contain;
    display: block;
    background: #000;
    cursor: zoom-in;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

/* Flèches */
.slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.52);
    color: #fff;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: background 0.15s, opacity 0.15s;
    opacity: 0.8;
    -webkit-tap-highlight-color: transparent;
}
.slider-btn:hover { background: rgba(0,0,0,0.78); opacity: 1; }
.slider-prev { left: 10px; }
.slider-next { right: 10px; }

/* Compteur "1 / 5" */
.slider-counter {
    position: absolute;
    top: 10px;
    right: 12px;
    background: rgba(0,0,0,0.55);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 20px;
    z-index: 10;
    pointer-events: none;
}

/* Dots */
.slider-dots {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    z-index: 10;
}
.slider-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.45);
    cursor: pointer;
    padding: 0;
    transition: background 0.2s, transform 0.2s;
    -webkit-tap-highlight-color: transparent;
}
.slider-dot.dot-active {
    background: #fff;
    transform: scale(1.35);
}

/* ─── Image unique cliquable ─── */
.post-image {
    width: 100%;
    max-height: 480px;
    object-fit: contain;
    display: block;
    border-radius: var(--radius-sm);
    background: #000;
}

/* ─── Responsive ─── */
@media (max-width: 480px) {
    .slider-img  { max-height: 280px; }
    .post-image  { max-height: 280px; }
    .slider-btn  { width: 34px; height: 34px; font-size: 1.2rem; }
}

/* ═══════════════════════════════════════════
   LIGHTBOX navigable
═══════════════════════════════════════════ */

.lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.93);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

.lightbox-img {
    max-width: 95vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.5);
    cursor: default;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.lightbox-close {
    position: fixed;
    top: 14px;
    right: 16px;
    background: rgba(0,0,0,0.55);
    color: #fff;
    border: none;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    font-size: 1.4rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1002;
    transition: background 0.15s;
}
.lightbox-close:hover { background: rgba(255,255,255,0.18); }

.lightbox-nav {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.52);
    color: #fff;
    border: none;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    font-size: 1.8rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1002;
    transition: background 0.15s;
    -webkit-tap-highlight-color: transparent;
}
.lightbox-nav:hover { background: rgba(255,255,255,0.18); }
.lightbox-nav-prev { left: 14px; }
.lightbox-nav-next { right: 14px; }

.lightbox-counter {
    position: fixed;
    bottom: 70px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.55);
    color: #fff;
    font-size: 0.82rem;
    font-weight: 700;
    padding: 4px 14px;
    border-radius: 20px;
    z-index: 1002;
    pointer-events: none;
}

.lightbox-dots {
    position: fixed;
    bottom: 22px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 1002;
}

.lightbox-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,0.4);
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
}
.lightbox-dot--active {
    background: #fff;
    transform: scale(1.3);
}

@media (max-width: 480px) {
    .lightbox-nav { width: 40px; height: 40px; font-size: 1.4rem; }
    .lightbox-nav-prev { left: 6px; }
    .lightbox-nav-next { right: 6px; }
}

/* ═══════════════════════════════════════════
   ADMIN / CERTIFIÉ
═══════════════════════════════════════════ */

/* Badge "Certifié" sur le profil */
.admin-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 12px;
    background: #1d4ed8;
    color: #fff;
    font-size: 0.78rem;
    font-weight: 800;
    border-radius: 20px;
    letter-spacing: 0.3px;
    user-select: none;
}

.admin-badge--sm {
    padding: 2px 8px;
    font-size: 0.68rem;
}

/* Icône ✓ compacte sur les posts */
.verified-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    background: #1d4ed8;
    color: #fff;
    border-radius: 50%;
    font-size: 0.6rem;
    font-weight: 900;
    margin-left: 4px;
    flex-shrink: 0;
    vertical-align: middle;
    cursor: default;
}

/* Post épinglé / admin */
.post-card--admin {
    border-left: 3px solid #1d4ed8;
    background: linear-gradient(to right, #eff6ff 0%, var(--white) 60px);
}

/* En-tête du lien auteur */
.post-author-line {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
}

/* ═══════════════════════════════════════════
   ANIMATIONS
═══════════════════════════════════════════ */

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.fade-in {
    animation: fadeIn 0.28s ease-out forwards;
}

/* ═══════════════════════════════════════════
   POST — tag "Nouveau"
═══════════════════════════════════════════ */

.new-post-tag {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    background: #dcfce7;
    color: #16a34a;
    font-size: 0.65rem;
    font-weight: 700;
    border-radius: 20px;
    border: 1px solid #bbf7d0;
    flex-shrink: 0;
}

/* ═══════════════════════════════════════════
   AUTH PAGES — login + register
═══════════════════════════════════════════ */

.auth-container {
    min-height: calc(100vh - var(--navbar-h, 58px));
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    background: linear-gradient(135deg, #ff7a00 40%, #fff 60%);
}

.auth-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: 0 4px 32px rgba(0,0,0,0.10);
    padding: 36px 32px;
    width: 100%;
    max-width: 420px;
}

.auth-card--register { max-width: 520px; }

.auth-logo {
    text-align: center;
    margin-bottom: 28px;
}

.auth-logo-icon {
    font-size: 2.4rem;
    display: block;
    margin-bottom: 6px;
    line-height: 1;
}

.auth-logo-title {
    font-size: 1.7rem;
    font-weight: 900;
    color: var(--text);
    margin: 0 0 6px;
    letter-spacing: -1px;
}

.auth-accent { color: var(--orange); }

.auth-subtitle {
    font-size: 0.82rem;
    color: var(--text-xlight);
    margin: 0;
}

.auth-form    { display: flex; flex-direction: column; gap: 16px; }
.auth-submit  { margin-top: 6px; }

.auth-switch {
    text-align: center;
    font-size: 0.84rem;
    color: var(--text-xlight);
    margin: 20px 0 0;
}
.auth-switch a { color: var(--orange); font-weight: 700; text-decoration: none; }
.auth-switch a:hover { text-decoration: underline; }

/* Input password avec bouton voir */
.input-password-wrap {
    position: relative;
    display: flex;
    align-items: center;
}
.input-password-wrap input { flex: 1; padding-right: 44px; }
.btn-toggle-pw {
    position: absolute;
    right: 10px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    padding: 4px;
    color: var(--text-xlight);
    transition: color 0.15s;
    user-select: none;
}
.btn-toggle-pw:hover { color: var(--orange); }

/* Ligne double champs */
.form-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.label-hint {
    font-size: 0.72rem;
    font-weight: 400;
    color: var(--text-xlight);
    margin-left: 6px;
}

.field-hint {
    margin: 4px 0 0;
    font-size: 0.78rem;
}

@media (max-width: 480px) {
    .auth-card  { padding: 24px 18px; }
    .form-row-2 { grid-template-columns: 1fr; }
}

/* ═══════════════════════════════════════════
   ADMIN / CERTIFIÉ
═══════════════════════════════════════════ */

/* Badge "Certifié" bleu sur le profil */
.admin-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 12px;
    background: #1d4ed8;
    color: #fff;
    font-size: 0.78rem;
    font-weight: 800;
    border-radius: 20px;
    letter-spacing: 0.3px;
    user-select: none;
}
.admin-badge--sm {
    padding: 2px 8px;
    font-size: 0.65rem;
}

/* Icône ✓ ronde sur les posts */
.verified-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    background: #1d4ed8;
    color: #fff;
    border-radius: 50%;
    font-size: 0.58rem;
    font-weight: 900;
    margin-left: 4px;
    flex-shrink: 0;
    vertical-align: middle;
    cursor: default;
    user-select: none;
}

/* Post admin : bordure + fond teinté */
.post-card--admin {
    border-left: 3px solid #1d4ed8;
    background: linear-gradient(to right, #eff6ff 0%, var(--white) 70px);
}

/* Ligne auteur + badge */
.post-author-line {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
}

/* ═══════════════════════════════════════════
   BADGE CERTIFIÉ — renderUserName()
═══════════════════════════════════════════ */

/* Badge standard (profil, classement, recherche) */
.badge-verified {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: #1DA1F2;
    color: #fff;
    font-size: 0.68rem;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 12px;
    margin-left: 5px;
    vertical-align: middle;
    white-space: nowrap;
    user-select: none;
    letter-spacing: 0.2px;
    line-height: 1.4;
}

/* Version compacte (posts, commentaires, dropdown) */
.badge-verified--sm {
    font-size: 0.58rem;
    padding: 1px 5px;
    border-radius: 10px;
    margin-left: 3px;
}

/* ═══════════════════════════════════════════
   ADMIN — Icône ✓ dans les posts (legacy)
═══════════════════════════════════════════ */

.verified-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    background: #1DA1F2;
    color: #fff;
    border-radius: 50%;
    font-size: 0.55rem;
    font-weight: 900;
    margin-left: 4px;
    flex-shrink: 0;
    vertical-align: middle;
    cursor: default;
    user-select: none;
}

/* Badge complet page profil */
.admin-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 14px;
    background: #1DA1F2;
    color: #fff;
    font-size: 0.82rem;
    font-weight: 800;
    border-radius: 20px;
    user-select: none;
}
.admin-badge--sm {
    padding: 3px 9px;
    font-size: 0.68rem;
}

/* Post admin : filet bleu discret */
.post-card--admin {
    border-left: 3px solid #1DA1F2;
    background: linear-gradient(to right, #f0f9ff 0%, var(--white) 70px);
}

/* Post épinglé */
.post-card--pinned {
    border-top: 2px solid #f59e0b;
}
.post-pin-badge {
    background: #fffbeb;
    color: #b45309;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 5px 14px;
    border-bottom: 1px solid #fde68a;
}

/* Ligne auteur dans post */
.post-author-line {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
}

/* ═══════════════════════════════════════════
   BADGE CERTIFIÉ — renderUserName() central
═══════════════════════════════════════════ */

.badge-verified {
    display: inline-flex;
    align-items: center;
    background: #1DA1F2;
    color: #fff;
    font-size: 0.68rem;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 12px;
    margin-left: 5px;
    vertical-align: middle;
    white-space: nowrap;
    user-select: none;
    letter-spacing: 0.2px;
    line-height: 1.5;
    cursor: default;
}

.badge-verified--sm {
    font-size: 0.58rem;
    padding: 1px 5px;
    border-radius: 10px;
    margin-left: 3px;
}

/* Icône ✓ ronde compacte (legacy posts) */
.verified-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px; height: 16px;
    background: #1DA1F2;
    color: #fff;
    border-radius: 50%;
    font-size: 0.55rem;
    font-weight: 900;
    margin-left: 4px;
    flex-shrink: 0;
    vertical-align: middle;
    cursor: default;
    user-select: none;
}

/* Badge page profil */
.admin-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 14px;
    background: #1DA1F2;
    color: #fff;
    font-size: 0.82rem;
    font-weight: 800;
    border-radius: 20px;
    user-select: none;
}
.admin-badge--sm { padding: 3px 9px; font-size: 0.68rem; }

/* ═══════════════════════════════════════════
   POSTS ADMIN / ÉPINGLÉS
═══════════════════════════════════════════ */

/* Filet bleu discret, fond très légèrement teinté */
.post-card--admin {
    border-left: 3px solid #1DA1F2;
    background: linear-gradient(to right, #f0f9ff 0%, var(--white) 80px);
}

/* Post épinglé */
.post-card--pinned { border-top: 2px solid #f59e0b; }
.post-pin-badge {
    background: #fffbeb;
    color: #b45309;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 5px 14px;
    border-bottom: 1px solid #fde68a;
}

/* Ligne auteur */
.post-author-line {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
}

/* ── Correction dropdown notifications ── */
/* Le dropdown est contrôlé par JS (display:flex/none)
   Ces règles garantissent le bon rendu quand ouvert */

#notifDropdown,
#notifDropdownM,
#notifDropdownMobile,
.nav-notif-dropdown {
    /* Fermé par défaut — le JS met display:flex */
    flex-direction: column;
    position: absolute;
    top: calc(100% + 8px);
    right: -6px;
    width: 320px;
    max-width: calc(100vw - 24px);
    max-height: 480px;
    background: var(--white, #fff);
    border: 1px solid var(--border, #e8e8e8);
    border-radius: var(--radius, 12px);
    box-shadow: 0 8px 32px rgba(0,0,0,0.13);
    z-index: 9999;   /* ← valeur haute pour ne jamais être caché */
    overflow: hidden;
}

/* Dropdown mobile : position fixe sous la navbar */
#notifDropdownM,
#notifDropdownMobile,
.notif-dropdown--mobile,
.nav-notif-dropdown--mobile {
    position: fixed;
    top: var(--navbar-h, 58px);
    left: 8px;
    right: 8px;
    width: auto;
    z-index: 9999;
}

/* Parent relatif obligatoire pour que absolute fonctionne */
.nav-notif-wrap,
.nav-notif-root,
.notif-bell-wrap {
    position: relative;
}

/* ── Badge certifié ── */
.badge-verified {
    display: inline-flex;
    align-items: center;
    background: #1DA1F2;
    color: #fff;
    font-size: 0.68rem;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 12px;
    margin-left: 5px;
    vertical-align: middle;
    white-space: nowrap;
    user-select: none;
    cursor: default;
    line-height: 1.5;
}
.badge-verified--sm { font-size: 0.6rem;  padding: 1px 5px; border-radius: 10px; margin-left: 3px; }
.badge-verified--xs { font-size: 0.55rem; padding: 1px 4px; border-radius: 8px;  margin-left: 2px; }

/* ═══════════════════════════════════════════════════════
   PAGE NOTIFICATIONS — Design complet
═══════════════════════════════════════════════════════ */

.notif-page-container {
    max-width: 680px;
    margin: 0 auto;
    padding: 0 16px 40px;
}

/* ── En-tête ── */
.notif-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 0 14px;
    gap: 12px;
    flex-wrap: wrap;
}

.notif-page-title-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}

.notif-page-title {
    font-size: 1.4rem;
    font-weight: 900;
    color: var(--text);
    margin: 0;
}

.notif-page-count {
    background: var(--orange);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 800;
    padding: 2px 9px;
    border-radius: 20px;
    line-height: 1.6;
}

/* Bouton tout effacer */
.btn-notif-clear {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    background: #fef2f2;
    color: #dc2626;
    border: 1.5px solid #fecaca;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    font-family: inherit;
}
.btn-notif-clear:hover {
    background: #dc2626;
    color: #fff;
    border-color: #dc2626;
}

/* ── Séparateur de date ── */
.notif-date-sep {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 20px 0 8px;
}
.notif-date-sep::before,
.notif-date-sep::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}
.notif-date-label {
    font-size: 0.72rem;
    font-weight: 800;
    color: var(--text-xlight);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    white-space: nowrap;
    padding: 0 4px;
}

/* ── Liste notifications (card) ── */
.notif-full-list {
    padding: 0;
    overflow: hidden;
    border-radius: var(--radius);
}

/* ── Item notification ── */
.notif-full-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    text-decoration: none;
    color: var(--text);
    border-bottom: 1px solid var(--border);
    transition: background 0.15s;
    position: relative;
}
.notif-full-item:last-child { border-bottom: none; }
.notif-full-item:hover      { background: #f9fafb; text-decoration: none; color: var(--text); }

/* Item non lu */
.notif-full-item--unread {
    background: linear-gradient(to right, var(--orange-light) 0%, #fff 80px);
}
.notif-full-item--unread:hover {
    background: linear-gradient(to right, #ffe4cc 0%, #f9fafb 80px);
}

/* ── Avatar + badge type ── */
.notif-full-avatar-wrap {
    position: relative;
    flex-shrink: 0;
}

.notif-full-type-badge {
    position: absolute;
    bottom: -3px;
    right: -3px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--white);
    box-shadow: 0 1px 4px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    border: 1.5px solid var(--white);
}

/* Couleurs selon le type */
.notif-type-like       .notif-full-type-badge,
.notif-full-type-badge.notif-type-like       { background: #fef2f2; }
.notif-type-comment    .notif-full-type-badge,
.notif-full-type-badge.notif-type-comment    { background: #eff6ff; }
.notif-type-group_post .notif-full-type-badge,
.notif-full-type-badge.notif-type-group_post { background: #f0fdf4; }
.notif-type-message    .notif-full-type-badge,
.notif-full-type-badge.notif-type-message    { background: #fff7ed; }
.notif-type-follow     .notif-full-type-badge,
.notif-full-type-badge.notif-type-follow     { background: #fdf4ff; }

/* ── Corps ── */
.notif-full-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.notif-full-msg {
    font-size: 0.88rem;
    line-height: 1.45;
    color: var(--text);
    margin: 0;
    /* Tronquer si trop long */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.notif-full-time {
    font-size: 0.72rem;
    color: var(--text-xlight);
    font-weight: 500;
}

/* ── Dot non lu ── */
.notif-full-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--orange);
    flex-shrink: 0;
    box-shadow: 0 0 0 2px var(--orange-light);
}

/* ── État vide ── */
.notif-empty-state {
    text-align: center;
    padding: 48px 24px;
    margin-top: 8px;
}
.notif-empty-icon  { font-size: 3rem; margin-bottom: 14px; display: block; }
.notif-empty-title { font-size: 1.05rem; font-weight: 800; color: var(--text); margin: 0 0 8px; }
.notif-empty-text  { font-size: 0.84rem; color: var(--text-xlight); margin: 0; line-height: 1.6; }

/* ── Responsive ── */
@media (max-width: 480px) {
    .notif-page-container    { padding: 0 10px 32px; }
    .notif-full-item         { padding: 12px 14px; gap: 10px; }
    .notif-page-title        { font-size: 1.15rem; }
}

/* ═══════════════════════════════════════════════════════
   PAGE GROUPE — Corrections et améliorations
═══════════════════════════════════════════════════════ */

/* Header groupe */
.groupe-detail-card { overflow: hidden; padding: 0; }

.groupe-banner {
    position: relative;
    height: 160px;
    background: linear-gradient(135deg, var(--orange) 0%, #ffb347 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.groupe-banner-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.groupe-banner-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(255,255,255,0.25);
    color: #fff;
    font-size: 1.8rem;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid rgba(255,255,255,0.5);
    letter-spacing: 1px;
}

.btn-edit-banner {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(0,0,0,0.45);
    color: #fff;
    border-radius: var(--radius-sm);
    padding: 6px 12px;
    font-size: 0.78rem;
    font-weight: 700;
    text-decoration: none;
    transition: background 0.15s;
    backdrop-filter: blur(4px);
}
.btn-edit-banner:hover { background: rgba(0,0,0,0.65); text-decoration: none; color: #fff; }

.groupe-detail-body  { padding: 20px 24px 24px; }
.groupe-detail-name  { font-size: 1.35rem; font-weight: 900; color: var(--text); margin: 0 0 8px; }
.groupe-detail-desc  { font-size: 0.88rem; color: var(--text-light); line-height: 1.6; margin: 0 0 12px; }

.groupe-detail-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 0.8rem;
    color: var(--text-xlight);
    margin-bottom: 16px;
}

.groupe-detail-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ── Membres ── */
.groupe-membres-preview { padding: 16px 20px; }

.groupe-membres-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.btn-toggle-membres {
    background: none;
    border: 1.5px solid var(--border);
    color: var(--text-light);
    font-size: 0.78rem;
    font-weight: 700;
    padding: 5px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s;
    font-family: inherit;
}
.btn-toggle-membres:hover { border-color: var(--orange); color: var(--orange); }

.membres-avatars-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

/* Badge Campus237 dans la liste membres */
.badge-createur--campus {
    background: #1DA1F2;
    color: #fff;
    font-size: 0.6rem;
    padding: 2px 7px;
    border-radius: 20px;
    font-weight: 800;
    margin-left: auto;
    white-space: nowrap;
}

/* ── CTA rejoindre ── */
.groupe-join-cta {
    text-align: center;
    padding: 20px;
    color: var(--text-light);
    font-size: 0.9rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

/* ── Compteur posts ── */
.groupe-posts-header { display: flex; align-items: center; gap: 12px; }

.groupe-posts-count {
    background: var(--orange-light);
    color: var(--orange);
    font-size: 0.75rem;
    font-weight: 800;
    padding: 2px 9px;
    border-radius: 20px;
    border: 1px solid var(--orange-border);
}

/* ── Responsive ── */
@media (max-width: 600px) {
    .groupe-banner        { height: 120px; }
    .groupe-detail-body   { padding: 16px; }
    .groupe-detail-name   { font-size: 1.15rem; }
    .groupe-detail-meta   { gap: 6px; }
}

/* ═══════════════════════════════════════════════════════
   PAGE NOTIFICATIONS
═══════════════════════════════════════════════════════ */

.notif-page-container {
    max-width: 680px;
    margin: 0 auto;
    padding: 0 16px 48px;
}

/* ── En-tête ── */
.notif-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 0 16px;
    gap: 12px;
    flex-wrap: wrap;
}

.notif-page-title-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}

.notif-page-title {
    font-size: 1.45rem;
    font-weight: 900;
    color: var(--text);
    margin: 0;
    letter-spacing: -0.3px;
}

.notif-page-count {
    background: var(--orange);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 800;
    padding: 2px 9px;
    border-radius: 20px;
    line-height: 1.7;
}

/* ── Bouton tout effacer ── */
.btn-notif-clear {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: #fef2f2;
    color: #dc2626;
    border: 1.5px solid #fecaca;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    font-family: inherit;
    white-space: nowrap;
}
.btn-notif-clear:hover {
    background: #dc2626;
    color: #fff;
    border-color: #dc2626;
}

/* ── Séparateur de date ── */
.notif-date-sep {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 22px 0 8px;
}
.notif-date-sep::before,
.notif-date-sep::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}
.notif-date-label {
    font-size: 0.7rem;
    font-weight: 800;
    color: var(--text-xlight);
    text-transform: uppercase;
    letter-spacing: 0.7px;
    white-space: nowrap;
    padding: 0 4px;
}

/* ── Card liste ── */
.notif-full-list {
    padding: 0;
    overflow: hidden;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

/* ── Item ── */
.notif-full-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    text-decoration: none;
    color: var(--text);
    background: var(--white);
    border-bottom: 1px solid var(--border);
    transition: background 0.15s;
    position: relative;
    cursor: pointer;
}
.notif-full-item:last-child {
    border-bottom: none;
}
.notif-full-item:hover {
    background: #f9fafb;
    text-decoration: none;
    color: var(--text);
}

/* Item non lu */
.notif-full-item--unread {
    background: linear-gradient(to right, #fff5ec 0%, var(--white) 90px);
}
.notif-full-item--unread:hover {
    background: linear-gradient(to right, #ffe8d0 0%, #f9fafb 90px);
}

/* ── Avatar + badge type ── */
.notif-full-avatar-wrap {
    position: relative;
    flex-shrink: 0;
    width: 42px;
    height: 42px;
}

/* On force l'avatar à remplir le wrapper */
.notif-full-avatar-wrap .avatar-sm {
    width: 42px;
    height: 42px;
}

.notif-full-type-badge {
    position: absolute;
    bottom: -4px;
    right: -4px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--white);
    box-shadow: 0 1px 4px rgba(0,0,0,0.14);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.68rem;
    border: 2px solid var(--white);
    line-height: 1;
}

/* Fond coloré selon le type */
.notif-type-like       .notif-full-type-badge { background: #fef2f2; }
.notif-type-comment    .notif-full-type-badge { background: #eff6ff; }
.notif-type-group_post .notif-full-type-badge { background: #f0fdf4; }
.notif-type-message    .notif-full-type-badge { background: #fff7ed; }
.notif-type-follow     .notif-full-type-badge { background: #fdf4ff; }

/* ── Corps texte ── */
.notif-full-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.notif-full-msg {
    font-size: 0.87rem;
    line-height: 1.45;
    color: var(--text);
    margin: 0;
    word-break: break-word;
}
.notif-full-msg strong {
    font-weight: 700;
    color: var(--text);
}

.notif-full-time {
    display: block;
    font-size: 0.72rem;
    color: var(--text-xlight);
    font-weight: 500;
    margin-top: 2px;
}

/* ── Dot non lu ── */
.notif-full-dot {
    width: 10px;
    height: 10px;
    min-width: 10px;
    border-radius: 50%;
    background: var(--orange);
    flex-shrink: 0;
    box-shadow: 0 0 0 3px var(--orange-light);
}

/* ── État vide ── */
.notif-empty-state {
    text-align: center;
    padding: 52px 24px;
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}
.notif-empty-icon {
    font-size: 3.2rem;
    line-height: 1;
    display: block;
    margin-bottom: 6px;
    opacity: 0.7;
}
.notif-empty-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--text);
    margin: 0;
}
.notif-empty-text {
    font-size: 0.84rem;
    color: var(--text-xlight);
    line-height: 1.65;
    margin: 0;
}

/* ── Responsive ── */
@media (max-width: 600px) {
    .notif-page-container { padding: 0 10px 36px; }
    .notif-page-title     { font-size: 1.2rem; }
    .notif-full-item      { padding: 12px 14px; gap: 10px; }
    .notif-full-avatar-wrap,
    .notif-full-avatar-wrap .avatar-sm { width: 38px; height: 38px; }
    .notif-full-msg       { font-size: 0.83rem; }
    .notif-date-sep       { margin: 16px 0 6px; }
}