/*
 * src/public/css/material.css
 * Design System — Réseau Social Syndical
 * Inspiré des maquettes Stitch (Material Design 3)
 * Font: Plus Jakarta Sans | Theme: Light, Luminous, Warm
 */

/* ====== SYSTEM FONTS ====== */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700&family=Michroma&display=swap');

/* ====== LOCAL FONTS (CACHABLE) ====== */

@font-face {
    font-family: 'Material Symbols Rounded';
    src: url('../assets/fonts/material-symbols-rounded.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
    font-display: block;
}

/* ====== CUSTOM FONTS ====== */
@font-face {
    font-family: 'Polya';
    src: url('../assets/fonts/Polya.woff2') format('woff2'),
         url('../assets/fonts/Polya.otf') format('opentype');
    unicode-range: U+0052, U+0045, U+005A, U+004F; /* R, E, Z, O uniquement */
    font-weight: normal;
    font-style: normal;
    font-display: block;
}

@font-face {
    font-family: 'Parley';
    src: url('../assets/fonts/Parley.woff2') format('woff2'),
         url('../assets/fonts/parley regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}


/* ====== DYNAMIC BACKGROUNDS ====== */
.dynamic-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
    background: var(--bg);
    overflow: hidden;
    transition: background-color var(--transition);
}

.glow-orb {
    position: absolute;
    width: 650px;
    height: 650px;
    border-radius: 50%;
    filter: blur(85px);
    opacity: 0.15;
    animation: move-orb 30s infinite cubic-bezier(0.4, 0, 0.2, 1);
}

.glow-orb-1 {
    background: radial-gradient(circle, var(--primary) 0%, transparent 70%);
    top: -150px;
    right: -150px;
    animation-duration: 25s;
}

.glow-orb-2 {
    background: radial-gradient(circle, var(--blue) 0%, transparent 70%);
    bottom: -150px;
    left: -150px;
    animation-delay: -7s;
    animation-duration: 35s;
}

.glow-orb-3 {
    background: radial-gradient(circle, var(--teal) 0%, transparent 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 400px;
    height: 400px;
    opacity: 0.1;
    animation-delay: -12s;
    animation-duration: 40s;
}

@keyframes move-orb {
    0% { transform: translate(0, 0) scale(1.0); }
    15% { transform: translate(-25%, 15%) scale(1.3); }
    30% { transform: translate(20%, -25%) scale(0.8); }
    45% { transform: translate(-15%, 40%) scale(1.1); }
    60% { transform: translate(35%, 10%) scale(0.9); }
    80% { transform: translate(-15%, -15%) scale(1.2); }
    100% { transform: translate(0, 0) scale(1.0); }
}

/* ====== LOGIN PAGE DYNAMIC BACKGROUND ====== */
.login-page-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    background: linear-gradient(135deg, 
        var(--teal) 0%, 
        var(--blue) 25%, 
        var(--pink) 50%, 
        var(--orange) 75%,
        var(--teal) 100%
    );
    background-size: 600% 600%;
    animation: gradientMove 40s step-end infinite; /* step-end can be too choppy, let's stick to ease but slower */
    animation: gradientMove 35s ease infinite;
    overflow: hidden;
    filter: saturate(1.4) brightness(1.1);
}

[data-theme="dark"] .login-page-bg {
    filter: brightness(0.4) saturate(1.2);
}

/* ====== SOCIAL ACTIONS ====== */
.post-actions {
    display: flex;
    gap: 8px;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--border-light);
}

.btn-social {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    background: var(--surface-variant);
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    border: none;
    user-select: none;
    text-decoration: none;
}

.btn-social:hover {
    background: var(--surface-inset);
    color: var(--text-primary);
    transform: translateY(-1px);
}

.btn-social.active {
    background: var(--primary-light);
    color: var(--primary);
}

.btn-social.active .material-symbols-rounded {
    font-variation-settings: 'FILL' 1;
}

.support-count {
    font-variant-numeric: tabular-nums;
    min-width: 12px;
}

/* Animation de pulse pour le poing levé ✊ */
@keyframes support-pulse {
    0% { transform: scale(1); }
    40% { transform: scale(1.3); }
    60% { transform: scale(0.95); }
    100% { transform: scale(1); }
}

.btn-support.active .material-symbols-rounded {
    animation: support-pulse 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Theme Toggle Button */
.theme-toggle {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    cursor: pointer;
    transition: all var(--transition);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

[data-theme="dark"] .theme-toggle {
    background: rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.05);
}

:root {
    /* ===== Couleurs Charte Graphique UNSA ===== */
    /* Couleurs Principales */
    --primary: #E74124;
    --on-primary: #FFFFFF;
    --primary-container: rgba(231, 65, 36, 0.1);
    --on-primary-container: #C02C12;
    --primary-light: rgba(231, 65, 36, 0.1);
    --primary-dark: #C02C12;

    --blue: #009FE3;
    --blue-light: rgba(0, 159, 227, 0.1);
    --blue-dark: #007BB0;

    --purple-dark: #25025c;
    --purple-dark-light: rgba(37, 2, 92, 0.1);

    /* Couleurs Secondaires */
    --teal: #00a29b;
    --teal-light: rgba(0, 162, 155, 0.1);
    
    --yellow: #ffcc00;
    --yellow-light: rgba(255, 204, 0, 0.15);
    
    --green: #a4c400;
    --green-light: rgba(164, 196, 0, 0.15);
    
    --pink: #d20073;
    --pink-light: rgba(210, 0, 115, 0.1);
    
    --orange: #f26522;
    --orange-light: rgba(242, 101, 34, 0.1);
    
    --purple: #910068;
    --purple-light: rgba(145, 0, 104, 0.1);

    /* ===== Surfaces (Claires & Lumineuses) ===== */
    --bg: #FAFAFA; /* Gris très clair, laisse exploser la couleur */
    --surface: #FFFFFF; /* Blanc pur */
    --surface-container-low: #F5F5F7;
    --surface-variant: #F0F0F2; 
    --surface-inset: #EDEDF0;

    /* ===== Textes ===== */
    --text-primary: #1A1A2E;
    --text-secondary: #4A4A5A;
    --text-muted: #8E8E9E;

    /* ===== Layout ===== */
    --radius: 28px; /* M3 Extra Large */
    --radius-sm: 16px; /* M3 Medium */
    --radius-full: 9999px;

    /* ===== Layout Heights (Modular) ===== */
    --app-bar-height: 64px;
    --bottom-nav-height: 80px;
    --safe-area-bottom: env(safe-area-inset-bottom, 0px);

    /* ===== Shadows Premium (Ambient Occlusion) ===== */
    --shadow-sm: 0 4px 12px rgba(26, 26, 46, 0.04);
    --shadow: 0 12px 24px rgba(26, 26, 46, 0.06);
    --shadow-md: 0 24px 48px rgba(26, 26, 46, 0.08);
    --shadow-lg: 0 32px 64px rgba(26, 26, 46, 0.12);

    /* ===== Typographie ===== */
    --font: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-logo: 'Michroma', sans-serif;
    --font-brand: 'Polya', 'Michroma', sans-serif; /* Logo REZO page identification uniquement */

    /* ===== Transitions ===== */
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);

    /* ===== Borders (Ghost Borders Only) ===== */
    --border-color: rgba(26, 26, 46, 0.08);
    --border-light: rgba(26, 26, 46, 0.04);
    
    /* ===== Glassy Surfaces (Default Light) ===== */
    --glass-bg: rgba(255, 255, 255, 0.8);
    --glass-border: rgba(255, 255, 255, 0.3);
}

/* ====== DARK MODE TOKENS ====== */
:root[data-theme="dark"] {
    --primary: #FFB4A5;
    --on-primary: #650C01;
    --primary-container: rgba(231, 65, 36, 0.2);
    --on-primary-container: #FFDAD3;
    --primary-light: rgba(231, 65, 36, 0.2);

    /* Surfaces Sombres (Neutres pour contraster les vraies couleurs) */
    --bg: #121218; 
    --surface: #1A1A22;
    --surface-container-low: #20202A;
    --surface-variant: #282834; 
    --surface-inset: #323240;

    --text-primary: #FFFFFF;
    --text-secondary: #B0B0C0;
    --text-muted: #808096;

    --blue-light: rgba(0, 159, 227, 0.15);
    --teal-light: rgba(0, 162, 155, 0.15);
    --yellow-light: rgba(255, 204, 0, 0.15);
    --green-light: rgba(164, 196, 0, 0.15);
    --pink-light: rgba(210, 0, 115, 0.15);
    --orange-light: rgba(242, 101, 34, 0.15);
    --purple-light: rgba(145, 0, 104, 0.15);
    --purple-dark-light: rgba(150, 150, 255, 0.1);
    
    --border-color: rgba(255, 255, 255, 0.1);
    --border-light: rgba(255, 255, 255, 0.05);

    --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow: 0 12px 24px rgba(0, 0, 0, 0.5);

    /* ===== Glassy Surfaces (Dark Mode) ===== */
    --glass-bg: rgba(26, 17, 16, 0.85);
    --glass-border: rgba(255, 255, 255, 0.08);
}

/* ====== RESET & BASE ====== */
* {
    box-sizing: border-box;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text-primary);
    margin: 0;
    padding: 0;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    transition: background-color var(--transition), color var(--transition);
}

[data-theme="dark"] .dynamic-bg {
    background: #0A0A12;
}

[data-theme="dark"] .glow-orb-1 { opacity: 0.25; }
[data-theme="dark"] .glow-orb-2 { opacity: 0.2; }
[data-theme="dark"] .glow-orb-3 { opacity: 0.15; }

/* ====== APP SHELL — Modular Layout ====== */
body.app-shell {
    height: 100dvh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.main-content {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    min-height: 0; 
    padding-bottom: calc(var(--bottom-nav-height) + 40px); /* Sécurité pour ne pas être masqué par la nav */
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 600;
    margin-top: 0;
    letter-spacing: -0.01em;
}

a {
    color: var(--blue);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* ====== MATERIAL ICON HELPER ====== */
.material-symbols-rounded {
    font-family: 'Material Symbols Rounded';
    font-weight: normal;
    font-style: normal;
    font-size: 24px;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    display: inline-block;
    white-space: nowrap;
    word-wrap: normal;
    direction: ltr;
    -webkit-font-smoothing: antialiased;
    vertical-align: middle;
}

/* ====== TRANSITIONS DE NAVIGATION (CSS + JS, cross-browser) ====== */

@keyframes nav-enter-fade  { from { opacity: 0; } }
@keyframes nav-enter-right { from { opacity: 0; transform: translateX(22px); } }
@keyframes nav-enter-left  { from { opacity: 0; transform: translateX(-22px); } }

/* Entrée par défaut : fondu simple */
.main-content {
    animation: nav-enter-fade 260ms cubic-bezier(0, 0, 0.2, 1) both;
}
/* Entrée depuis la droite (Flux → Groupes → Annuaire…) */
:root[data-nav-dir="fwd"] .main-content {
    animation: nav-enter-right 280ms cubic-bezier(0, 0, 0.2, 1) both;
}
/* Entrée depuis la gauche (Annuaire → Groupes → Flux…) */
:root[data-nav-dir="bwd"] .main-content {
    animation: nav-enter-left 280ms cubic-bezier(0, 0, 0.2, 1) both;
}

/* ====== APP BAR ====== */
.app-bar {
    background: linear-gradient(90deg, var(--teal) 0%, var(--blue) 35%, var(--pink) 70%, var(--orange) 100%);
    background-size: 400% 400%;
    animation: gradientMove 25s ease infinite;
    color: #FFFFFF;
    padding: 0 1.25rem;
    height: var(--app-bar-height);
    min-height: var(--app-bar-height);
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: none;
    flex-shrink: 0;
}

/* Désactiver l'animation sur l'admin */
.premium-admin .app-bar {
    background-size: 100% 100%;
    animation: none;
}

@keyframes gradientMove {
    0% { background-position: 0% 50%; }
    10% { background-position: 35% 20%; }
    20% { background-position: 90% 10%; }
    30% { background-position: 100% 50%; }
    40% { background-position: 65% 85%; }
    50% { background-position: 10% 100%; }
    60% { background-position: 80% 90%; }
    70% { background-position: 40% 15%; }
    80% { background-position: 50% 0%; }
    90% { background-position: 0% 90%; }
    100% { background-position: 0% 50%; }
}



.app-bar-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

/* ====== ICON-BTN — bouton icône de base ====== */
.icon-btn {
    width: 40px;
    height: 40px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: background var(--transition), color var(--transition);
}

.icon-btn .material-symbols-rounded {
    font-size: 24px;
}

.icon-btn:hover {
    background: var(--surface-variant);
}

/* Harmonisation des boutons icônes dans la barre du haut */
.app-bar-actions .btn-outline,
.app-bar-actions a.btn-outline,
.app-bar-actions a.admin-link,
.app-bar .icon-btn {
    width: 40px;
    height: 40px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.app-bar-actions .btn-outline .material-symbols-rounded,
.app-bar-actions a.btn-outline .material-symbols-rounded,
.app-bar-actions a.admin-link .material-symbols-rounded,
.app-bar .icon-btn .material-symbols-rounded {
    font-size: 24px;
}

#notifBtn {
    display: none; /* Masqué par défaut, affiché via JS si unreadCount > 0 */
    position: relative;
    margin-right: 4px;
}

/* Forcer le texte/icônes en blanc dans le Header Coloré (Anti-Chromostéréopsie) */
.app-bar .btn-outline,
.app-bar .icon-btn,
.app-bar .material-symbols-rounded {
    color: #FFFFFF !important;
    border-color: rgba(255, 255, 255, 0.3);
}

.app-bar .btn-outline:hover,
.app-bar .icon-btn:hover {
    background: rgba(255, 255, 255, 0.2) !important;
    color: #FFFFFF !important;
    border-color: rgba(255, 255, 255, 0.6);
}

.admin-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.15);
    color: #FFFFFF !important;
    font-size: 0.75rem;
    font-weight: 700;
    font-family: var(--font);
    text-decoration: none;
    transition: all var(--transition);
    white-space: nowrap;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.admin-link .material-symbols-rounded {
    font-size: 18px;
    color: #FFFFFF !important;
}

.admin-link:hover {
    background: rgba(255, 255, 255, 0.25);
    color: #FFFFFF !important;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: rgba(255, 255, 255, 0.4);
}

.app-bar h1 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 700;
    color: #FFFFFF;
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

/* Navigation Bureau PC */
.desktop-nav {
    display: none;
    align-items: center;
    gap: 4px;
    margin: 0 auto;
}

@media (min-width: 768px) {
    .desktop-nav {
        display: flex;
    }
}

.desktop-nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: var(--radius-full);
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.88rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    white-space: nowrap;
}

.desktop-nav-link:hover {
    background: rgba(255, 255, 255, 0.18);
    color: #FFFFFF !important;
    text-decoration: none;
    transform: translateY(-1px);
}

.desktop-nav-link.active {
    background: #FFFFFF;
    color: var(--primary) !important;
    font-weight: 700;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
}

.desktop-nav-link .material-symbols-rounded {
    font-size: 20px;
    color: inherit !important;
}

/* ====== BOUTONS (MATERIAL 3) ====== */
.btn-primary {
    background: var(--primary);
    color: var(--on-primary);
    border: none;
    padding: 10px 24px;
    border-radius: var(--radius-full);
    font-size: 0.95rem;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    transition: all var(--transition);
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
    filter: brightness(1.05);
}

.btn-primary:active {
    transform: translateY(0) scale(0.98);
    box-shadow: var(--shadow-sm);
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 1px solid var(--border-color);
    padding: 10px 24px;
    border-radius: var(--radius-full);
    font-size: 0.95rem;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    transition: all var(--transition);
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.btn-outline:hover {
    background: var(--surface-variant);
    color: var(--text-primary);
    border-color: #BDBDBD;
}

.btn-outline:active {
    transform: scale(0.98);
}

.btn-green {
    background: var(--green);
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: var(--radius-full);
    font-size: 0.95rem;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    transition: all var(--transition);
    box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-green:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.btn-green:active {
    transform: scale(0.98);
}

/* ====== CARTES ====== */
.card {
    background: var(--surface-container-low);
    border-radius: var(--radius);
    padding: 1.1rem;
    margin-bottom: 0.85rem;
    box-shadow: none;
    border: none;
    transition: box-shadow var(--transition), transform var(--transition), background-color var(--transition);
}

body:not(.premium-admin) .card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

body.premium-admin .card:hover {
    box-shadow: var(--shadow-md);
}

.card:active {
    transform: scale(0.98);
}

/* ====== FORMULAIRES ====== */
.form-group {
    margin-bottom: 1.2rem;
    display: flex;
    flex-direction: column;
}

.form-group label {
    margin-bottom: 0.4rem;
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.form-control {
    padding: 12px 14px;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-family: var(--font);
    transition: border-color var(--transition), box-shadow var(--transition);
    background: var(--surface-variant);
    color: var(--text-primary);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
    background: var(--surface);
}

.form-control::placeholder {
    color: var(--text-muted);
}

/* ====== LAYOUT MOBILE FIRST & DESKTOP FLUID ====== */
.container {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    padding: 1rem;
    padding-bottom: 1.5rem;
    box-sizing: border-box;
}

@media (min-width: 768px) {
    .container {
        padding: 1.5rem 1.5rem;
        max-width: 820px;
    }
}

@media (min-width: 1024px) {
    .container {
        padding: 2rem 2.5rem;
        max-width: 1120px;
    }
}

@media (min-width: 1440px) {
    .container {
        padding: 2.5rem 3.5rem;
        max-width: 1420px;
    }
}

.text-center {
    text-align: center;
}

/* ====== MESSAGES D'ERREUR ====== */
.error-message {
    color: var(--primary);
    font-size: 0.875rem;
    margin-top: 5px;
    background: var(--primary-light);
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--primary);
    font-weight: 500;
}

/* ====== LOADER ====== */
.loader {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* ====== BOTTOM NAVIGATION ====== */
.bottom-nav {
    width: 100%;
    background: linear-gradient(90deg, var(--teal) 0%, var(--blue) 35%, var(--pink) 70%, var(--orange) 100%);
    background-size: 400% 400%;
    animation: gradientMove 25s ease infinite;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: calc(var(--bottom-nav-height) + var(--safe-area-bottom));
    min-height: var(--bottom-nav-height);
    padding-left: 2px;
    padding-right: 2px;
    padding-bottom: var(--safe-area-bottom);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    z-index: 2000;
    border-top: none;
    box-sizing: border-box;
    flex-shrink: 0;
}

.premium-admin .bottom-nav {
    background-size: 100% 100%;
    animation: none;
}

.nav-item {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    font-size: clamp(0.6rem, 2.2vw, 0.72rem);
    font-weight: 600;
    transition: all var(--transition);
    gap: 2px;
    padding: 4px 2px;
    border-radius: var(--radius-sm);
    box-sizing: border-box;
}

.nav-item span:not(.material-symbols-rounded) {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: block;
    line-height: 1.1;
}

.nav-item .material-symbols-rounded {
    font-size: clamp(22px, 5.5vw, 26px);
    transition: all var(--transition);
}

.nav-item.active {
    color: #FFFFFF;
    text-shadow: 0 0 12px rgba(255, 255, 255, 0.4);
}

.nav-item:hover {
    color: #FFFFFF;
    text-decoration: none;
}

/* ====== CHIPS / BADGES ====== */
.chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.chip-red {
    background: var(--primary-light);
    color: var(--primary);
}

.chip-blue {
    background: var(--blue-light);
    color: var(--blue-dark);
}

.chip-green {
    background: var(--green-light);
    color: var(--green-dark);
}

.chip-purple {
    background: var(--purple-light);
    color: var(--purple);
}

.chip-orange {
    background: var(--orange-light);
    color: var(--orange);
}

/* Legacy chip (backward compat) */
.chip:not([class*="chip-"]) {
    background: var(--primary-light);
    color: var(--primary);
}

/* ====== AVATARS ====== */
.avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.05rem;
    flex-shrink: 0;
    background: linear-gradient(135deg, #FF416C 0%, #FF4B2B 100%);
    color: #FFFFFF;
    box-shadow: 0 4px 10px rgba(255, 65, 108, 0.3);
}

.avatar-blue {
    background: linear-gradient(135deg, #00B4DB 0%, #0083B0 100%);
    color: #FFFFFF;
    box-shadow: 0 4px 10px rgba(0, 180, 219, 0.3);
}

.avatar-green {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: #FFFFFF;
    box-shadow: 0 4px 10px rgba(17, 153, 142, 0.3);
}

.avatar-purple {
    background: linear-gradient(135deg, #8E2DE2 0%, #4A00E0 100%);
    color: #FFFFFF;
    box-shadow: 0 4px 10px rgba(142, 45, 226, 0.3);
}

.avatar-orange {
    background: linear-gradient(135deg, #f12711 0%, #f5af19 100%);
    color: #FFFFFF;
    box-shadow: 0 4px 10px rgba(241, 39, 17, 0.3);
}

.avatar-red {
    background: linear-gradient(135deg, #FF416C 0%, #FF4B2B 100%);
    color: #FFFFFF;
    box-shadow: 0 4px 10px rgba(255, 65, 108, 0.3);
}

/* ====== POST CARDS ====== */
.post-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.author-info {
    display: flex;
    flex-direction: column;
}

.post-meta {
    font-size: 0.78rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.post-content {
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 12px;
    white-space: pre-wrap;
    color: var(--text-primary);
}

.post-actions {
    display: flex;
    gap: 15px;
    border-top: 1px solid var(--border-light);
    padding-top: 10px;
    margin-top: 10px;
}

/* ====== SCOPE BADGES (inline dans les posts) ====== */
.scope-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}

/* Bordure gauche colorée par scope sur les cartes */
.card[data-scope="NATIONAL"] {
    border-left: 3px solid var(--primary);
}

.card[data-scope="REGIONAL"] {
    border-left: 3px solid var(--blue);
}

.card[data-scope="SECTOR"] {
    border-left: 3px solid var(--purple);
}

.card[data-scope="GROUP"] {
    border-left: 3px solid var(--green);
}

.scope-national {
    background: var(--primary-light);
    color: var(--primary);
}

.scope-regional {
    background: var(--blue-light);
    color: var(--blue);
}

.scope-sector {
    background: var(--purple-light);
    color: var(--purple);
}

.scope-group {
    background: var(--green-light);
    color: var(--green);
}

/* ====== SECTION HEADERS ====== */
.section-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 12px;
    margin-top: 20px;
}

/* ====== SPACE CARDS (Groupes page) ====== */
.space-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 1rem;
    margin-bottom: 0.75rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    gap: 14px;
    transition: box-shadow var(--transition);
}

.space-card:hover {
    box-shadow: var(--shadow-md);
}

.member-card:hover {
    background: var(--surface-variant) !important;
    border-color: var(--blue-light) !important;
}

.space-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.space-icon-red {
    background: var(--primary-light);
    color: var(--primary);
}

.space-icon-blue {
    background: var(--blue-light);
    color: var(--blue);
}

.space-icon-purple {
    background: var(--purple-light);
    color: var(--purple);
}

.space-icon-green {
    background: var(--green-light);
    color: var(--green);
}

.space-info {
    flex: 1;
    min-width: 0;
}

.space-info h3 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
}

.space-info p {
    margin: 2px 0 0;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.member-count {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
}

/* ====== GROUPES PAGE — UX ====== */

.groups-section {
    margin-bottom: 8px;
}

.groups-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    margin-top: 20px;
}

.groups-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.groups-section-title .material-symbols-rounded {
    font-size: 18px;
    color: var(--blue);
}

.group-count-badge {
    background: var(--blue-light);
    color: var(--blue);
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    min-width: 20px;
    text-align: center;
}

/* Joined group row */
.my-group-row {
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow);
    margin-bottom: 8px;
    overflow: hidden;
    transition: box-shadow var(--transition);
    animation: fadeInUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.my-group-row:hover {
    box-shadow: var(--shadow-md);
}

.my-group-row-main {
    display: flex;
    align-items: center;
    padding: 12px 14px;
    gap: 12px;
    cursor: pointer;
    transition: background var(--transition);
}

.my-group-row-main:hover {
    background: var(--surface-variant);
}

.my-group-avatar {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--blue), var(--teal));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 700;
    flex-shrink: 0;
}

.my-group-info {
    flex: 1;
    min-width: 0;
}

.my-group-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.my-group-meta {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.my-group-actions {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
}

.my-group-open-arrow {
    color: var(--blue);
    font-size: 20px !important;
}

.my-group-more-btn {
    background: none;
    border: none;
    padding: 6px;
    border-radius: 50%;
    cursor: pointer;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition), color var(--transition);
}

.my-group-more-btn:hover {
    background: var(--surface-variant);
    color: var(--text-secondary);
}

/* Inline leave confirmation panel */
.my-group-leave-panel {
    display: none;
    padding: 12px 14px;
    background: rgba(231, 65, 36, 0.04);
    border-top: 1px solid rgba(231, 65, 36, 0.12);
    animation: slideDown 0.2s ease-out;
}

.my-group-leave-panel.visible {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.my-group-leave-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
    flex: 1;
    min-width: 150px;
}

.my-group-leave-text strong {
    color: var(--text-primary);
}

.my-group-leave-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.btn-leave-confirm {
    background: var(--primary);
    color: white;
    border: none;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font);
    transition: opacity var(--transition);
}

.btn-leave-confirm:hover {
    opacity: 0.82;
}

.btn-leave-cancel {
    background: none;
    border: 1px solid var(--border-light);
    color: var(--text-secondary);
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font);
    transition: background var(--transition);
}

.btn-leave-cancel:hover {
    background: var(--surface-variant);
}

/* Discover cards (available groups) */
.discover-card {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 14px;
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow);
    margin-bottom: 8px;
    transition: box-shadow var(--transition);
    animation: fadeInUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.discover-card:hover {
    box-shadow: var(--shadow-md);
}

.discover-card-info {
    flex: 1;
    min-width: 0;
}

.discover-card-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 4px;
}

.discover-card-desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin: 0 0 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
}

.discover-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 2px;
}

/* Toast notification */
.ux-toast {
    position: fixed;
    bottom: 84px;
    left: 50%;
    transform: translateX(-50%) translateY(16px);
    background: var(--text-primary);
    color: white;
    padding: 10px 20px;
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 500;
    z-index: 9999;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
    white-space: nowrap;
    box-shadow: var(--shadow-md);
}

.ux-toast.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.ux-toast.success {
    background: #1B5E20;
}

.ux-toast.error {
    background: var(--primary);
}

/* Empty states for groups */
.groups-empty-state {
    padding: 24px 20px;
    text-align: center;
    background: var(--surface-variant);
    border-radius: var(--radius);
    border: 1px dashed rgba(0,0,0,0.08);
}

.groups-empty-state .material-symbols-rounded {
    font-size: 36px;
    color: var(--text-muted);
    display: block;
    margin-bottom: 8px;
}

.groups-empty-state p {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin: 0;
    line-height: 1.5;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Feed composer (group.html) */
.feed-composer {
    margin-bottom: 14px;
}

.feed-composer-inner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: box-shadow var(--transition), border-color var(--transition);
}

.feed-composer-inner:hover {
    box-shadow: var(--shadow-md);
    border-color: rgba(231, 65, 36, 0.25);
}

.feed-composer-prompt {
    color: var(--text-muted);
    font-size: 0.9rem;
    flex: 1;
}

/* ====== LOGO REZO ====== */
.logo-rezo {
    font-family: var(--font-logo);
    background-color: transparent; /* Supprimé fond rouge */
    color: #FFFFFF !important;
    padding: 0; /* Plus de padding nécessaire sans fond */
    border-radius: 0;
    display: inline-block;
    text-transform: uppercase;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1;
    box-shadow: none; /* Supprimé ombre par défaut */
    font-size: 1.25rem; /* Base size */
    transition: var(--transition);
}

/* Specific sizing for contexts */
.login-hero .logo-rezo {
    font-family: var(--font-brand); /* Polya pour le logo REZO de la page d'identification */
    font-size: 4.5rem;
    padding: 0.15em 0.4em;
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(231, 65, 36, 0.25);
}

.app-bar .logo-rezo {
    font-size: 2.9rem;
    padding: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

@media (max-width: 480px) {
    .app-bar .logo-rezo {
        font-size: 1.3rem;
    }
}

.login-header .logo-rezo, 
.register-header .logo-rezo {
    font-size: 2.2rem;
    margin-bottom: 0.5rem;
}

/* ====== LOGIN HERO ====== */
.login-hero {
    background: transparent;
    color: var(--text-primary);
    padding: 6rem 1.5rem 3rem;
    text-align: center;
    border-radius: 0;
    margin-bottom: 0;
}

.login-hero h1 {
    margin: 0 0 20px;
}

.login-hero .logo-rezo {
    font-size: 10rem; /* Augmenté de 100% (était 5rem) */
    padding: 0;
    border-radius: 0;
    box-shadow: none;
    text-shadow: 0 4px 15px rgba(0, 0, 0, 0.2), 0 0 40px rgba(255, 255, 255, 0.5); /* Effet halo lumineux */
}

@media (max-width: 480px) {
    .login-hero .logo-rezo {
        font-size: 5rem; /* Réduit pour smartphone mais reste imposant */
        text-shadow: 0 4px 10px rgba(0, 0, 0, 0.2), 0 0 25px rgba(255, 255, 255, 0.4);
    }
}

.login-hero p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin: 0;
    font-weight: 500;
}

.login-card {
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: none;
    border-radius: 40px;
    padding: 1.5rem 1.5rem;
    margin: 0 1rem 1rem;
    box-shadow: none;
    position: relative;
    z-index: 10;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    backface-visibility: hidden;
    max-width: 440px;
    width: calc(100% - 2rem);
    box-sizing: border-box;
}

/* ====== LOGIN PAGE NO-SCROLL LAYOUT ====== */
.login-page {
    height: 100dvh !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    align-items: center !important;
    overflow: hidden !important;
    padding: 0 !important;
    padding-left: env(safe-area-inset-left, 0px) !important;
    padding-right: env(safe-area-inset-right, 0px) !important;
    margin: 0 !important;
}

.login-page .login-hero {
    flex: 0 0 auto;
    padding: max(4dvh, calc(env(safe-area-inset-top, 0px) + 1rem)) 1.5rem 2dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #FFFFFF !important; /* Texte Hero en blanc */
}

.login-page .login-hero p {
    color: #FFFFFF !important;
    font-weight: 600;
}

.login-page .login-footer {
    flex: 0 0 auto;
    padding: 2dvh 1rem max(2dvh, env(safe-area-inset-bottom, 0px));
    margin: 0;
    color: #FFFFFF !important; /* Texte Footer en blanc */
}

/* Specific text styles for login readability */
.login-page .form-group label {
    color: #FFFFFF !important;
    font-weight: 600 !important;
}

.login-page .login-card a {
    color: #FFFFFF !important;
    font-weight: 500;
}

.login-page .form-control {
    background: rgba(255, 255, 255, 0.6) !important;
    border: 1px solid rgba(255, 255, 255, 0.4) !important;
    color: var(--text-primary) !important;
    backdrop-filter: blur(10px);
}

.login-page .form-control::placeholder {
    color: var(--text-muted) !important;
}

.login-page .form-control:focus {
    background: rgba(255, 255, 255, 0.2) !important;
    border-color: #FFFFFF !important;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.2) !important;
}

/* Inversion du bouton Se Connecter sur l'accueil */
.login-page .btn-primary {
    background: #FFFFFF !important;
    color: var(--primary) !important;
    font-weight: 700 !important;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15) !important;
}

.login-page .btn-primary:hover {
    background: #FAFAFA !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.2) !important;
}

.login-page .btn-primary .material-symbols-rounded {
    color: var(--primary) !important;
}

.login-page .login-extra {
    flex: 0 0 auto;
    padding: 1dvh 1rem;
    width: 100%;
    display: flex;
    justify-content: center;
}

.login-page .login-extra .btn-outline {
    color: #FFFFFF !important;
    border-color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.login-page .login-extra .btn-outline:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: #FFFFFF;
}

@media (max-height: 720px) {
    .login-page .login-hero .logo-rezo {
        font-size: 5rem; /* Adapté pour écrans courts */
    }
    .login-page .login-hero p {
        font-size: 0.95rem;
        margin-top: -10px;
        color: #FFFFFF !important;
    }
    .login-card {
        padding: 1rem 1.5rem;
        margin-bottom: 0.5rem;
    }
}

@media (max-height: 640px) {
    .login-page .login-hero .logo-rezo {
        font-size: 4rem;
    }
    .login-page .login-hero p {
        display: none; /* Cache le slogan sur écrans très courts pour laisser la place au formulaire */
    }
    .login-card {
        padding: 0.75rem 1.5rem;
    }
    .login-footer {
        padding: 1dvh 1rem;
        font-size: 0.65rem;
    }
}

.login-card.shake {
    animation: shake 0.4s cubic-bezier(.36, .07, .19, .97) both;
    transform: translate3d(0, 0, 0);
    backface-visibility: hidden;
    perspective: 1000px;
    border-color: var(--red);
}

@keyframes shake {
    10%, 90% { transform: translate3d(-1px, 0, 0); }
    20%, 80% { transform: translate3d(2px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
    40%, 60% { transform: translate3d(4px, 0, 0); }
}

@media (min-width: 768px) {
    .login-card {
        margin-left: auto;
        margin-right: auto;
    }
}

.login-footer {
    text-align: center;
    padding: 1rem;
    font-size: 0.72rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* ====== PUBLISH BOX (Feed) ====== */
.publish-box textarea {
    width: 100%;
    border: none;
    resize: none;
    font-size: 0.95rem;
    outline: none;
    box-sizing: border-box;
    background: transparent;
    font-family: var(--font);
    color: var(--text-primary);
    line-height: 1.5;
}

.publish-box textarea::placeholder {
    color: var(--text-muted);
}

.publish-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    border-top: 1px solid var(--border-light);
    padding-top: 10px;
}

.scope-select {
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--border-color);
    background: var(--surface-variant);
    font-family: var(--font);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    transition: border-color var(--transition);
}

.scope-select:focus {
    outline: none;
    border-color: var(--primary);
}

/* ====== FILTER CHIPS ROW ====== */
.filter-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

/* ====== CHIP TABS (Filtre du flux — Material 3) ====== */
.chip-tabs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 2px 0 14px;
    margin: 0 -1rem;
    padding-left: 1rem;
    padding-right: 1rem;
}

.chip-tabs::-webkit-scrollbar {
    display: none;
}

.chip-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    min-height: 40px;
    border-radius: var(--radius-full);
    border: 1.5px solid var(--border-color);
    background: var(--surface);
    font-family: var(--font);
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    white-space: nowrap;
    transition: all var(--transition);
    flex-shrink: 0;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.chip-tab .material-symbols-rounded {
    font-size: 18px;
}

.chip-tab:hover {
    border-color: var(--text-muted);
    background: var(--surface-variant);
}

.chip-tab.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.chip-tab.active .material-symbols-rounded {
    color: white;
}

/* ====== PUBLISH LABEL ====== */
.publish-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 6px;
}

.filter-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 14px;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    border: 1.5px solid transparent;
}

.filter-chip:hover {
    transform: translateY(-1px);
}

.filter-chip-green {
    background: var(--green-light);
    color: var(--green);
    border-color: var(--green-light);
}
.filter-chip-green.active {
    background: var(--green);
    color: white;
}

.filter-chip-blue {
    background: var(--blue-light);
    color: var(--blue);
    border-color: var(--blue-light);
}
.filter-chip-blue.active {
    background: var(--blue);
    color: white;
}

.filter-chip-purple {
    background: var(--purple-light);
    color: var(--purple);
    border-color: var(--purple-light);
}
.filter-chip-purple.active {
    background: var(--purple);
    color: white;
}

/* ====== ANIMATIONS MICRO ====== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card,
.space-card {
    animation: fadeInUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.animation-spin {
    animation: spin 1s linear infinite;
    display: inline-block;
}

/* ====== SKELETON LOADING ====== */
.skeleton {
    background: #eeeeee;
    background: linear-gradient(110deg, #ececec 8%, #f5f5f5 18%, #ececec 33%);
    border-radius: 8px;
    background-size: 200% 100%;
    animation: shine 1.5s linear infinite;
    border: none !important;
    color: transparent !important;
}

.skeleton * {
    visibility: hidden;
}

@keyframes shine {
    to {
        background-position-x: -200%;
    }
}

/* Helper for better touch targets */
.touch-target {
    min-height: 48px;
    min-width: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ====== TOAST / SNACKBAR ====== */
.toast {
    position: fixed;
    bottom: calc(var(--bottom-nav-height) + var(--safe-area-bottom) + 16px);
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #323232;
    color: white;
    padding: 12px 24px;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 500;
    font-family: var(--font);
    box-shadow: var(--shadow-lg);
    z-index: 9999;
    opacity: 0;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.35s ease;
    max-width: calc(100% - 32px);
    text-align: center;
    display: flex;
    align-items: center;
    gap: 8px;
}

.toast.toast-visible {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast-success {
    background: var(--green-dark);
}

.toast-error {
    background: var(--primary);
}

.toast-info {
    background: var(--blue);
}

/* ====== CONFIRM MODAL ====== */
.confirm-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 9998;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.25s ease;
    pointer-events: none;
}

.confirm-overlay.visible {
    opacity: 1;
    pointer-events: all;
}

.confirm-sheet {
    background: var(--surface);
    border-radius: 20px 20px 0 0;
    padding: 24px;
    width: 100%;
    max-width: 500px;
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.confirm-overlay.visible .confirm-sheet {
    transform: translateY(0);
}

.confirm-sheet h3 {
    margin: 0 0 8px;
    font-size: 1.1rem;
}

.confirm-sheet p {
    margin: 0 0 20px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.confirm-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* ====== PUBLISH BOX ENHANCED ====== */
.publish-box {
    background: var(--surface) !important;
    border: 1px solid var(--border-color) !important;
    box-shadow: var(--shadow-sm) !important;
    transition: all var(--transition);
}

.publish-box:hover {
    border-color: var(--primary) !important;
    box-shadow: var(--shadow) !important;
    transform: translateY(-2px);
}

.publish-box-fake-input {
    color: var(--text-secondary);
    font-size: 0.95rem;
    flex: 1;
    border-radius: 24px;
    padding: 12px 16px;
    background: var(--surface-variant);
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all var(--transition);
}

.publish-box:hover .publish-box-fake-input {
    background: var(--surface-inset);
    color: var(--text-primary);
}

.publish-box-row {
    display: flex;
    gap: 12px;
    align-items: center; /* Changed from flex-start to center for better alignment with larger inputs */
}

/* ====== PREMIUM PROFILE MODAL (Bottom Sheet / Modal Hybrid) ====== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 9999;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.modal-sheet {
    background: var(--surface);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    border-radius: 28px 28px 0 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.1);
}

.modal-overlay.visible .modal-sheet {
    transform: translateY(0);
}

.modal-cover {
    height: 100px;
    background: linear-gradient(135deg, var(--primary-light) 0%, #FFD6D6 100%);
    position: relative;
    flex-shrink: 0;
}

.modal-close-fab {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
    z-index: 10;
}

.modal-close-fab:hover {
    background: white;
    transform: scale(1.05);
    color: var(--text-primary);
}

.modal-avatar-wrapper {
    position: absolute;
    bottom: -36px;
    left: 24px;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: white;
    padding: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.modal-avatar-wrapper .avatar {
    width: 100%;
    height: 100%;
    font-size: 1.8rem;
}

.modal-body {
    padding: 48px 24px 24px 24px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.modal-name {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0 0 12px 0;
    letter-spacing: -0.02em;
}

.modal-section-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin: 20px 0 10px 0;
}

.modal-tinted-box {
    background: var(--surface-variant);
    border-left: 4px solid var(--primary);
    padding: 16px;
    border-radius: 0 12px 12px 0;
    color: var(--text-primary);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-top: 8px;
}

.modal-footer {
    padding: 16px 24px;
    background: var(--surface);
    border-top: 1px solid rgba(0, 0, 0, 0.04);
    display: flex;
    flex-shrink: 0;
}

.modal-footer .btn-primary {
    width: 100%;
    justify-content: center;
    padding: 14px;
    font-size: 1rem;
    border-radius: 100px;
    /* Full rounded pill */
}

@media (min-width: 768px) {
    .modal-overlay {
        align-items: center;
        /* Center on desktop */
    }

    .modal-sheet {
        border-radius: 24px;
        transform: translateY(20px) scale(0.95);
    }

    .modal-overlay.visible .modal-sheet {
        transform: translateY(0) scale(1);
    }
}

/* ====== AVATAR SELECTION GRID ====== */
.avatar-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 16px;
    padding: 10px 0;
}

.avatar-option {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-variant);
    color: var(--text-secondary);
    font-size: 1.8rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    border: 2px solid transparent;
}

.avatar-option:hover {
    transform: scale(1.1);
    background: var(--primary-light);
    color: var(--primary);
}

.avatar-option.selected {
    border-color: var(--primary);
    background: var(--primary-light);
    color: var(--primary);
    transform: scale(1.05);
}

.avatar-option-initials {
    font-weight: 700;
    font-family: var(--font);
    font-size: 1.2rem;
}

/* ====== NOTIFICATION BADGE ====== */
.notif-badge {
    display: none;
    position: absolute;
    top: 0;
    right: 0;
    background: var(--red);
    color: white;
    font-size: 10px;
    font-weight: bold;
    border-radius: 10px;
    padding: 2px 5px;
    pointer-events: none;
    line-height: 1.2;
}

/* ====== MODAL UTILITIES ====== */
.modal-overlay--top    { align-items: flex-start; }
.modal-overlay--bottom { align-items: flex-end; }

.modal-overlay--top .modal-sheet {
    border-radius: 0 0 24px 24px;
    max-height: 85vh;
    transform: translateY(-100%);
}

.modal-overlay--top.visible .modal-sheet {
    transform: translateY(0);
}

.modal-sheet--top {
    border-radius: 0 0 24px 24px;
    max-height: 85vh;
    transform: translateY(-100%);
}

.modal-header {
    padding: 16px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    background: var(--surface);
    border-radius: 0 0 24px 24px;
    z-index: 2;
    flex-shrink: 0;
}

.modal-title {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-empty {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 20px;
    padding: 0 16px;
}

.modal-body--scroll {
    padding: 0;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.btn-sm {
    font-size: 0.8rem;
    padding: 4px 8px;
}

/* ====== FULL RESPONSIVE LAYOUT (TABLET & DESKTOP) ====== */
@media (min-width: 768px) {
    body.app-shell {
        display: flex;
        flex-direction: column;
        height: 100dvh;
        overflow: hidden;
    }

    .app-bar {
        position: relative;
        z-index: 100;
        flex-shrink: 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.15);
        padding: 0 24px;
        height: var(--app-bar-height);
    }

    .bottom-nav {
        display: none !important;
    }

    .main-content {
        flex: 1;
        width: 100%;
        overflow-y: auto;
        padding-bottom: 48px;
    }
}

/* ====== RESPONSIVE MULTI-COLUMN GRIDS FOR TABLET & DESKTOP ====== */
@media (min-width: 768px) {
    #myGroupsList,
    #discoverList {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
        gap: 14px;
    }
    .my-group-row,
    .discover-card {
        margin-bottom: 0 !important;
        height: 100%;
        box-sizing: border-box;
    }
}

@media (min-width: 1280px) {
    #myGroupsList,
    #discoverList {
        grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
        gap: 18px;
    }
}

/* ====== PREMIUM ADMIN DASHBOARD ====== */

.premium-admin {
    background: #0B0E14 !important; /* Deep dark space */
    color: #E2E8F0;
    font-family: var(--font);
}

.premium-admin .dynamic-bg {
    background: radial-gradient(circle at top right, rgba(0, 159, 227, 0.15), transparent 40%),
                radial-gradient(circle at bottom left, rgba(231, 65, 36, 0.15), transparent 40%);
    background-color: #0B0E14;
}

.premium-admin .app-bar {
    background: rgba(11, 14, 20, 0.8) !important;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.glass-card {
    background: rgba(255, 255, 255, 0.03) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-radius: 24px !important;
    padding: 24px !important;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.2) !important;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1) !important;
    position: relative;
    overflow: hidden;
}

.glass-card::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 100%;
    background: linear-gradient(180deg, rgba(255,255,255,0.05) 0%, transparent 100%);
    pointer-events: none;
}

.glass-card:hover {
    transform: translateY(-4px) !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255,255,255,0.05) !important;
}

.bento-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.bento-col-span-2 {
    grid-column: span 2;
}
@media (max-width: 768px) {
    .bento-col-span-2 {
        grid-column: span 1;
    }
}

.text-gradient {
    background: linear-gradient(135deg, #FFF 0%, #A0AABF 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 800;
}

.text-gradient.blue { background: linear-gradient(135deg, #4285F4 0%, #8FB4F8 100%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.text-gradient.green { background: linear-gradient(135deg, #34A853 0%, #81C995 100%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.text-gradient.red { background: linear-gradient(135deg, #EA4335 0%, #F28B82 100%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.text-gradient.yellow { background: linear-gradient(135deg, #FBBC04 0%, #FCE8B2 100%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }

/* Micro-animations d'entrée */
.fade-in-up {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.delay-100 { animation-delay: 100ms; }
.delay-200 { animation-delay: 200ms; }
.delay-300 { animation-delay: 300ms; }

@keyframes fadeInUp {
    to { opacity: 1; transform: translateY(0); }
}

/* Premium Tabs */
.premium-tabs {
    display: flex;
    gap: 12px;
    background: rgba(0,0,0,0.3);
    padding: 6px;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.05);
    margin-bottom: 24px;
    overflow-x: auto;
}

.premium-tab {
    padding: 10px 20px;
    border-radius: 14px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    color: #A0AABF;
    transition: all 0.3s ease;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 8px;
}

.premium-tab:hover {
    color: #FFF;
    background: rgba(255,255,255,0.05);
}

.premium-tab.active {
    background: rgba(0, 159, 227, 0.15);
    color: #009FE3;
    border: 1px solid rgba(0, 159, 227, 0.3);
    box-shadow: 0 0 20px rgba(0, 159, 227, 0.2);
}

/* Resource Meters Premium */
.premium-meter {
    height: 8px;
    background: rgba(255,255,255,0.1);
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.5);
}
.premium-meter-fill {
    height: 100%;
    border-radius: 8px;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}
.premium-meter-fill::after {
    content: "";
    position: absolute;
    top: 0; left: 0; bottom: 0; right: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: shine 2s infinite linear;
}
@keyframes shine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.premium-admin .resource-stats { 
    display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 8px; font-size: 0.85rem; color: #A0AABF;
}
.premium-admin .resource-stats span:last-child {
    font-size: 1.5rem; font-weight: 800; color: #FFF;
}

/* Premium Admin isolation */
@media (min-width: 768px) {
    body.premium-admin.app-shell {
        grid-template-columns: 1fr; /* No side-bar for admin */
    }
    body.premium-admin.app-shell .main-content {
        grid-column: 1 / -1; /* Span full width */
    }
}

/* Split Layout for Premium Admin Desktop */
.admin-split-layout {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

@media (min-width: 1024px) {
    .premium-admin .admin-container {
        max-width: 1400px; /* Allow more width for split screen */
    }
    .admin-split-layout {
        flex-direction: row;
        align-items: flex-start;
    }
    .admin-left-panel {
        flex: 0 0 380px;
        position: sticky;
        top: 24px;
        max-height: calc(100vh - 48px);
        overflow-y: auto;
        border-radius: 24px;
        scrollbar-width: none; /* Firefox */
    }
    .admin-left-panel::-webkit-scrollbar {
        display: none; /* Chrome/Safari */
    }
    .admin-right-panel {
        flex: 1;
        min-width: 0;
    }
    /* Restructure the bento-grid in the left panel to display 2 columns or 1 column */
    .admin-left-panel .bento-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Dark mode overrides for detailed views (Tabs, Modals, Forms) */
.premium-admin .card,
.premium-admin .modal-content {
    background: rgba(255, 255, 255, 0.03) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.2) !important;
    color: #E2E8F0;
}

.premium-admin .form-control,
.premium-admin .poll-md3-field {
    background: rgba(0,0,0,0.2) !important;
    border: 1px solid rgba(255,255,255,0.1) !important;
    color: #FFF !important;
}

.premium-admin .form-control:focus {
    border-color: rgba(0, 159, 227, 0.5) !important;
    box-shadow: 0 0 0 2px rgba(0, 159, 227, 0.2) !important;
}

.premium-admin label,
.premium-admin .section-header {
    color: #F8FAFC !important;
    font-weight: 600 !important;
    letter-spacing: 0.02em;
}

.premium-admin .user-item {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.015);
}

.premium-admin .user-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.premium-admin .text-muted, 
.premium-admin .user-meta {
    color: #CBD5E1 !important;
    font-weight: 500;
}

.premium-admin p {
    color: #F1F5F9 !important;
    line-height: 1.6;
}

/* Premium Back Button */
.premium-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 100px;
    color: #E2E8F0;
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.premium-back-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    color: #FFF;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

.premium-back-btn .material-symbols-rounded {
    font-size: 20px;
    transition: transform 0.3s;
}

.premium-back-btn:hover .material-symbols-rounded {
    transform: translateX(-4px);
}

/* ==========================================================================
   VIBRANT GRADIENT THEME & BENTO GRID SYSTEM (Stitch Source of Truth)
   ========================================================================== */

:root {
    --gradient-vibrant: linear-gradient(135deg, #E74124 0%, #D20073 50%, #009FE3 100%);
    --gradient-primary: linear-gradient(135deg, #F26522 0%, #b51c01 100%);
    --gradient-unsa: linear-gradient(135deg, #E74124 0%, #009FE3 100%);
    --gradient-join: linear-gradient(135deg, #A4C400 0%, #7A9300 100%);
    --gradient-teal: linear-gradient(135deg, #00A29B 0%, #006763 100%);
    --gradient-plum: linear-gradient(135deg, #910068 0%, #5B0041 100%);
    --gradient-card-overlay: linear-gradient(to top, rgba(26, 26, 46, 0.85) 0%, rgba(26, 26, 46, 0.2) 60%, rgba(0,0,0,0) 100%);
    --bento-radius: 24px;
    --bento-gap: 16px;
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
}

/* --- Gradients --- */
.gradient-vibrant { background: var(--gradient-vibrant) !important; color: #FFFFFF !important; }
.gradient-primary { background: var(--gradient-primary) !important; color: #FFFFFF !important; }
.gradient-unsa { background: var(--gradient-unsa) !important; color: #FFFFFF !important; }
.gradient-join { background: var(--gradient-join) !important; color: #FFFFFF !important; }
.gradient-teal { background: var(--gradient-teal) !important; color: #FFFFFF !important; }
.gradient-plum { background: var(--gradient-plum) !important; color: #FFFFFF !important; }

/* --- Hero Banner Vibrant --- */
.hero-vibrant {
    position: relative;
    background: linear-gradient(135deg, #E74124 0%, #910068 45%, #009FE3 100%);
    border-radius: 24px;
    padding: 28px 24px;
    color: #FFFFFF;
    box-shadow: 0 12px 36px rgba(231, 65, 36, 0.2);
    overflow: hidden;
    margin-bottom: 20px;
}

.hero-vibrant::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, rgba(255,255,255,0.25) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    animation: pulseGlow 6s ease-in-out infinite alternate;
}

/* --- Bento Grid Layouts --- */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: var(--bento-gap);
    margin-bottom: 24px;
}

.bento-card {
    background: #FFFFFF;
    border-radius: var(--bento-radius);
    padding: 22px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.05);
    overflow: hidden;
    position: relative;
    transition: transform 0.25s var(--ease-out-expo), box-shadow 0.25s var(--ease-out-expo), border-color 0.25s ease;
}

.bento-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.08);
    border-color: rgba(231, 65, 36, 0.2);
}

.bento-col-12 { grid-column: span 12; }
.bento-col-8  { grid-column: span 12; }
.bento-col-6  { grid-column: span 12; }
.bento-col-4  { grid-column: span 12; }

@media (min-width: 768px) {
    .bento-col-8 { grid-column: span 8; }
    .bento-col-6 { grid-column: span 6; }
    .bento-col-4 { grid-column: span 4; }
}

/* --- Glassmorphism Panels --- */
.glass-panel {
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.65);
    border-radius: 20px;
}

/* --- Scope Badges & Status Halos --- */
.scope-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 100px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.scope-badge.scope-national { background: #009FE3; color: #FFFFFF; }
.scope-badge.scope-regional { background: #00837D; color: #FFFFFF; }
.scope-badge.scope-sector   { background: #D20073; color: #FFFFFF; }
.scope-badge.scope-group    { background: #910068; color: #FFFFFF; }

.avatar-halo {
    position: relative;
    border-radius: 50%;
    padding: 3px;
    background: linear-gradient(135deg, #E74124, #009FE3);
    display: inline-flex;
}

.avatar-halo img, .avatar-halo .avatar-inner {
    border-radius: 50%;
    border: 2px solid #FFFFFF;
}

/* --- Micro-Animations --- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(18px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulseGlow {
    0% { transform: scale(1); opacity: 0.2; }
    100% { transform: scale(1.15); opacity: 0.45; }
}

.animate-fade-in-up {
    animation: fadeInUp 0.45s var(--ease-out-expo) forwards;
}

.delay-100 { animation-delay: 100ms; }
.delay-200 { animation-delay: 200ms; }
.delay-300 { animation-delay: 300ms; }

/* --- Chat Bubbles (Vibrant + Glass) --- */
.chat-bubble-sent {
    background: linear-gradient(135deg, #E74124 0%, #d9371b 100%);
    color: #FFFFFF;
    border-radius: 18px 18px 4px 18px;
    padding: 12px 16px;
    max-width: 80%;
    box-shadow: 0 4px 12px rgba(231, 65, 36, 0.2);
}

.chat-bubble-received {
    background: #FFFFFF;
    color: #1A1A2E;
    border: 1px solid rgba(0,0,0,0.06);
    border-radius: 18px 18px 18px 4px;
    padding: 12px 16px;
    max-width: 80%;
    box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}

/* --- Modern Interactive Toggles --- */
.toggle-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid rgba(0,0,0,0.04);
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #E2E8F0;
    transition: 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    border-radius: 34px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.toggle-switch input:checked + .toggle-slider {
    background: linear-gradient(135deg, #E74124, #009FE3);
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(22px);
}

/* ====== RESPONSIVE UTILITIES ====== */
@media (min-width: 768px) {
    .hide-on-desktop {
        display: none !important;
    }
}

/* ====== FLOATING ACTION BUTTON (FEED SCROLL PUBLISH) ====== */
.floating-publish-fab {
    position: fixed;
    bottom: 32px;
    right: 32px;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: var(--gradient-vibrant);
    color: #FFFFFF;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(231, 65, 36, 0.4), 0 2px 8px rgba(0, 0, 0, 0.12);
    cursor: pointer;
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transform: scale(0.5) translateY(20px);
    transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s, box-shadow 0.2s;
}

.floating-publish-fab.visible {
    opacity: 1;
    visibility: visible;
    transform: scale(1) translateY(0);
}

.floating-publish-fab:hover {
    transform: scale(1.1) translateY(-2px);
    box-shadow: 0 12px 32px rgba(231, 65, 36, 0.6);
}

.floating-publish-fab:active {
    transform: scale(0.95);
}

.floating-publish-fab .material-symbols-rounded {
    font-size: 32px;
    color: #FFFFFF;
    font-variation-settings: 'wght' 700;
}

@media (max-width: 767px) {
    .floating-publish-fab {
        bottom: 84px; /* Au-dessus de la barre de navigation mobile */
        right: 20px;
        width: 52px;
        height: 52px;
    }
    .floating-publish-fab .material-symbols-rounded {
        font-size: 28px;
    }
}