/* ============================================================
   Plateforme familiale « KOUASSI AKABLA ODETTE »
   Design moderne — violet & corail · sans-serif · doux & arrondi
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,500;9..144,600;9..144,700;9..144,800&family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    /* Marque — espace membre (marron patrimonial · Annexe A) */
    --bordeaux:   #5D4037;   /* primaire membre (marron) */
    --bordeaux-2: #3E2723;
    /* Admin (surchargé par .app--admin) */
    --emeraude:   #2F7A5B;
    --emeraude-2: #245C46;
    /* Accent doré */
    --or:         #C9A24B;
    --or-2:       #B0872F;
    --or-pale:    #F2E7CE;

    /* Neutres chauds (ivoire / brun) */
    --ink:      #2A1E18;
    --ink-2:    #7C6A5F;
    --ink-3:    #AA9A8E;
    --bg:       #FAF6F2;
    --surface:  #FFFFFF;
    --surface-2:#F5EEE8;
    --line:     #E8DDD6;
    --line-2:   #F1E9E2;

    /* États harmonisés */
    --ok:      #2F7A5B;  --ok-bg:   #E2F0E9;
    --warn:    #C98A2B;  --warn-bg: #F8EEDA;
    --danger:  #B23A3A;  --danger-bg:#F6E3E1;
    --info:    #5D4037;  --info-bg: #F0E7E1;

    --r-lg: 20px; --r: 16px; --r-sm: 12px; --r-pill: 999px;
    --sh-1: 0 1px 2px rgba(61,39,35,.05), 0 5px 14px rgba(61,39,35,.07);
    --sh-2: 0 10px 30px rgba(61,39,35,.12);
    --sh-3: 0 24px 60px rgba(61,39,35,.18);
    --sidebar-w: 264px;
    --tabbar-h: 66px;
    --topbar-h: 66px;

    --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --serif: 'Fraunces', Georgia, 'Times New Roman', serif;
    --ease: cubic-bezier(.22,.61,.36,1);

    /* Alias de compatibilité (anciens noms en styles inline) */
    --or-clair: var(--or-pale);
    --ivoire: var(--bg);
    --ivoire-2: var(--surface-2);
    --papier: var(--surface);
    --encre: var(--ink);
    --encre-doux: var(--ink-2);
    --text-muted: var(--ink-2);
    --ligne: var(--line);
    --radius: var(--r);
    --radius-sm: var(--r-sm);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: var(--sans);
    background: var(--bg);
    color: var(--ink);
    line-height: 1.6;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}
h1, h2, h3, .serif { font-family: var(--serif); font-weight: 700; letter-spacing: -.01em; }
h1, h2, h3 { text-wrap: balance; }
p { text-wrap: pretty; }
a { color: var(--bordeaux); text-decoration: none; }
img { max-width: 100%; display: block; }

/* ============================================================
   AUTHENTIFICATION & ACCUEIL
   ============================================================ */
.auth-body {
    min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 20px;
    background:
        radial-gradient(1100px 620px at 8% -10%, rgba(61,39,35,.20), transparent 60%),
        radial-gradient(900px 620px at 108% 115%, rgba(201,162,75,.16), transparent 55%),
        var(--bg);
}
.auth-shell {
    width: 100%; max-width: 960px; display: grid; grid-template-columns: 1fr;
    background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--sh-3);
    overflow: hidden; animation: rise .55s var(--ease) both;
}
@media (min-width: 820px) { .auth-shell { grid-template-columns: 1.05fr .95fr; } }
.auth-panel { padding: clamp(28px, 5vw, 48px); position: relative; }
.auth-back { position: absolute; top: 20px; left: 22px; font-size: 13px; color: var(--ink-2); font-weight: 700; }
.auth-back:hover { color: var(--bordeaux); }

.crest {
    width: 66px; height: 66px; margin: 6px 0 20px; display: grid; place-items: center;
    background: linear-gradient(135deg, #795548, var(--bordeaux)); color: #fff;
    border-radius: 20px; font-size: 30px; box-shadow: 0 12px 26px rgba(61,39,35,.40);
}
.crest--admin { background: linear-gradient(135deg, #1BC79A, var(--emeraude)); box-shadow: 0 12px 26px rgba(14,169,122,.40); }

.auth-kicker { display: inline-block; font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--or-2); margin-bottom: 10px; }
.auth-kicker--admin { color: var(--emeraude); }
.auth-title { font-size: clamp(25px, 4vw, 32px); margin: 0 0 8px; color: var(--ink); line-height: 1.1; letter-spacing: -.03em; }
.auth-sub { color: var(--ink-2); margin: 0 0 26px; }
.auth-form { margin-top: 4px; }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 46px; }
.pw-toggle { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); background: none; border: none; font-size: 18px; cursor: pointer; padding: 6px; line-height: 1; }
.pw-meter { height: 6px; background: var(--line-2); border-radius: 999px; margin-top: 9px; overflow: hidden; }
.pw-meter > span { display: block; height: 100%; width: 0; border-radius: 999px; background: var(--danger); transition: width .28s var(--ease), background .28s; }
.auth-alt { margin-top: 22px; text-align: center; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.auth-alt a { font-weight: 700; color: var(--ink-2); }
.auth-alt a:hover { color: var(--bordeaux); }
.linklike { background: none; border: 0; padding: 0; font: inherit; font-weight: 700; color: var(--ink-2); cursor: pointer; text-decoration: underline; }
.linklike:hover { color: var(--bordeaux); }

/* Boîte de dialogue de confirmation — remplace le confirm() du navigateur */
.confirm-ov { position: fixed; inset: 0; z-index: 600; display: flex; align-items: center; justify-content: center;
    padding: 20px; background: rgba(28,20,16,.5); backdrop-filter: blur(3px); animation: fade .2s var(--ease) both; }
.confirm-ov[hidden] { display: none; }
.confirm-card { width: 100%; max-width: 420px; background: var(--surface); border-radius: var(--r-lg);
    box-shadow: 0 30px 70px rgba(0,0,0,.30); padding: 28px 26px 22px; text-align: center; animation: pop .22s var(--ease) both; }
.confirm-ic { width: 62px; height: 62px; margin: 0 auto 16px; border-radius: 50%; display: grid; place-items: center;
    font-size: 28px; background: var(--or-pale); box-shadow: 0 6px 18px rgba(176,135,47,.22); }
.confirm-title { font-size: 20px; font-weight: 800; color: var(--ink); margin: 0 0 8px; letter-spacing: -.01em; }
.confirm-text { color: var(--ink-2); font-size: 14.5px; line-height: 1.6; margin: 0 0 22px; }
.confirm-text strong { color: var(--ink); }
.confirm-actions { display: flex; gap: 10px; }
.confirm-actions .btn { flex: 1; }

.auth-aside { display: none; position: relative; color: #fff; }
@media (min-width: 820px) { .auth-aside { display: grid; } }
.auth-aside--member { background: linear-gradient(155deg, #6D4C41 0%, #5D4037 55%, #3E2723 100%); }
.auth-aside--admin  { background: linear-gradient(155deg, #17C295 0%, #0EA97A 55%, #0B8B64 100%); }
.auth-aside::after { content: ""; position: absolute; inset: 0; background: radial-gradient(600px 300px at 120% -10%, rgba(255,255,255,.18), transparent 60%); }
.auth-aside__inner { align-self: center; padding: 46px; position: relative; z-index: 1; }
.aside-mark { width: 56px; height: 56px; display: grid; place-items: center; background: rgba(255,255,255,.18); color: #fff; border-radius: 18px; font-size: 24px; margin-bottom: 24px; backdrop-filter: blur(4px); }
.auth-aside blockquote { font-size: 23px; font-weight: 800; line-height: 1.32; margin: 0 0 16px; letter-spacing: -.02em; text-wrap: balance; }
.aside-note { color: rgba(255,255,255,.86); font-size: 14px; margin: 0; }

/* Landing */
.landing { width: 100%; max-width: 780px; text-align: center; animation: rise .55s var(--ease) both; }
.landing-top .crest { margin: 0 auto 18px; }
.landing-title { font-size: clamp(28px, 6vw, 44px); color: var(--ink); margin: 6px 0 12px; letter-spacing: -.03em; }
.landing-sub { color: var(--ink-2); max-width: 52ch; margin: 0 auto 32px; font-size: 17px; }
.landing-choices { display: grid; gap: 18px; grid-template-columns: 1fr; }
@media (min-width: 620px) { .landing-choices { grid-template-columns: 1fr 1fr; } }
.choice {
    display: block; text-align: left; color: var(--ink); background: var(--surface);
    border: 1px solid var(--line); border-radius: var(--r-lg); padding: 28px 26px; box-shadow: var(--sh-1);
    transition: transform .28s var(--ease), box-shadow .28s var(--ease), border-color .28s;
}
.choice:hover { transform: translateY(-6px); box-shadow: var(--sh-2); border-color: transparent; }
.choice-ico { width: 58px; height: 58px; display: grid; place-items: center; font-size: 27px; border-radius: 18px; margin-bottom: 16px; }
.choice--member .choice-ico { background: var(--info-bg); }
.choice--admin .choice-ico { background: var(--ok-bg); }
.choice h2 { font-size: 21px; margin: 0 0 6px; color: var(--ink); }
.choice p { color: var(--ink-2); font-size: 14.5px; margin: 0 0 16px; }
.choice-cta { font-weight: 800; color: var(--bordeaux); }
.choice--admin .choice-cta { color: var(--emeraude); }
.landing-foot { margin-top: 30px; color: var(--ink-3); font-size: 13px; font-weight: 600; letter-spacing: .03em; }

/* ============================================================
   COQUILLE APPLICATIVE
   ============================================================ */
.shell { display: flex; min-height: 100dvh; }
.sidebar {
    width: var(--sidebar-w); flex-shrink: 0; color: #fff;
    background: linear-gradient(185deg, #6D4C41 0%, #5D4037 60%, #3E2723 100%);
    display: flex; flex-direction: column; position: fixed; inset: 0 auto 0 0; z-index: 60;
    transition: transform .3s var(--ease);
}
.app--admin .sidebar { background: linear-gradient(185deg, #17C295 0%, #0EA97A 60%, #0B8B64 100%); }
.brand { display: flex; align-items: center; gap: 12px; padding: 20px 18px 18px; }
.brand-crest { width: 44px; height: 44px; flex-shrink: 0; display: grid; place-items: center; background: rgba(255,255,255,.20); color: #fff; border-radius: 14px; font-size: 21px; font-weight: 800; backdrop-filter: blur(4px); }
.brand-txt { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-size: 17px; font-weight: 800; color: #fff; letter-spacing: -.01em; }
.brand-sub { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: rgba(255,255,255,.72); }

.nav { flex: 1; overflow-y: auto; padding: 8px 12px 12px; }
.nav-item {
    display: flex; align-items: center; gap: 13px; padding: 12px 14px; margin-bottom: 4px;
    border-radius: 14px; color: rgba(255,255,255,.88); font-weight: 600; font-size: 15px;
    transition: background .18s, color .18s, transform .1s;
}
.nav-item:hover { background: rgba(255,255,255,.14); color: #fff; }
.nav-item.is-active { background: #fff; color: var(--bordeaux); font-weight: 700; box-shadow: 0 6px 16px rgba(0,0,0,.10); }
.app--admin .nav-item.is-active { color: var(--emeraude); }
.nav-ico { width: 24px; text-align: center; font-size: 18px; }
.nav-label { flex: 1; }
.pill { min-width: 20px; height: 20px; padding: 0 6px; border-radius: var(--r-pill); background: var(--or); color: #fff; font-size: 11px; font-weight: 800; display: grid; place-items: center; }
.nav-item.is-active .pill { background: var(--or); color: #fff; }

.sidebar-foot { padding: 12px; border-top: 1px solid rgba(255,255,255,.16); }
.switch-link { display: block; text-align: center; padding: 10px; margin-bottom: 10px; border-radius: 12px; background: rgba(255,255,255,.14); color: #fff; font-size: 13px; font-weight: 700; }
.switch-link:hover { background: rgba(255,255,255,.24); }
.user-chip { display: flex; align-items: center; gap: 10px; }
.avatar { width: 42px; height: 42px; flex-shrink: 0; border-radius: 14px; background: var(--av-bg, var(--info-bg)); color: var(--bordeaux); display: grid; place-items: center; font-weight: 800; font-size: 15px; overflow: hidden; }
.sidebar .avatar { background: rgba(255,255,255,.20); color: #fff; }
.user-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
.user-name { font-weight: 700; font-size: 14px; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 11px; color: rgba(255,255,255,.72); }
.chip-logout { width: 36px; height: 36px; flex-shrink: 0; border-radius: 11px; display: grid; place-items: center; background: rgba(255,255,255,.14); color: #fff; font-size: 16px; }
.chip-logout:hover { background: rgba(255,255,255,.26); }

.scrim { position: fixed; inset: 0; background: rgba(20,18,40,.45); z-index: 55; opacity: 0; visibility: hidden; transition: opacity .3s; backdrop-filter: blur(2px); }

.shell > .main { flex: 1; margin-left: var(--sidebar-w); min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 15px 26px; background: rgba(255,255,255,.80); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 40; backdrop-filter: saturate(1.5) blur(12px); }
.topbar-title { font-size: 20px; margin: 0; color: var(--ink); letter-spacing: -.02em; }
.icon-btn { width: 42px; height: 42px; border: 1px solid var(--line); background: var(--surface); border-radius: 13px; color: var(--ink); font-size: 19px; cursor: pointer; display: grid; place-items: center; }
.icon-btn:hover { background: var(--surface-2); border-color: transparent; box-shadow: var(--sh-1); }
.menu-btn, .brand-crest--sm, .topbar-logout { display: none; }
.topbar-logout { margin-left: auto; }
.bell { margin-left: auto; position: relative; }
.bell-badge { position: absolute; top: -5px; right: -5px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: var(--r-pill); background: var(--or); color: #fff; font-size: 10px; font-weight: 800; line-height: 18px; text-align: center; border: 2px solid var(--surface); }

/* Barre de recherche (topbar admin, façon Volt) */
.topbar-search { flex: 1; max-width: 460px; position: relative; }
.topbar-search .ts-ico { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); font-size: 14px; opacity: .55; pointer-events: none; }
.topbar-search input { width: 100%; padding: 10px 14px 10px 40px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); font-size: 14px; }
.topbar-search input:focus { background: var(--surface); }

/* Fil d'Ariane + titre de page (Volt) */
.breadcrumb { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); margin-bottom: 6px; flex-wrap: wrap; }
.breadcrumb a { color: var(--ink-2); font-weight: 600; display: inline-flex; align-items: center; gap: 5px; }
.breadcrumb a:hover { color: var(--bordeaux); }
.bc-home { font-size: 13px; }
.bc-sep { color: var(--ink-3); }
.bc-current { color: var(--ink); font-weight: 700; }
.page-h1 { font-size: 26px; margin: 2px 0 22px; color: var(--bordeaux); letter-spacing: -.02em; }

/* Avatar : image */
.avatar img { width: 100%; height: 100%; border-radius: inherit; object-fit: cover; display: block; }
.avatar--sm { width: 32px; height: 32px; font-size: 12px; border-radius: 10px; }
.avatar--xs { width: 28px; height: 28px; font-size: 10px; border-radius: 8px; }
.avatar-stack { display: flex; align-items: center; }
.avatar-stack .avatar { border: 2px solid var(--surface); margin-left: -9px; }
.avatar-stack .avatar:first-child { margin-left: 0; }
.avatar-more { margin-left: 7px; font-size: 12px; color: var(--ink-2); font-weight: 700; }

/* En-tête de page avec actions (Partager / Exporter) */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-actions { display: flex; gap: 10px; margin-top: 6px; }

/* Menu profil déroulant (topbar) */
.topbar-user { position: relative; }
.tu-btn { display: flex; align-items: center; gap: 8px; background: none; border: none; cursor: pointer; padding: 4px 8px 4px 4px; border-radius: 12px; }
.tu-btn:hover { background: var(--surface-2); }
.tu-name { font-weight: 700; font-size: 14px; color: var(--ink); }
.tu-caret { color: var(--ink-3); font-size: 12px; }
.tu-menu { position: absolute; top: calc(100% + 8px); right: 0; min-width: 236px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--sh-2); padding: 8px; z-index: 70; opacity: 0; visibility: hidden; transform: translateY(-6px); transition: opacity .18s, transform .18s, visibility .18s; }
.tu-menu.open { opacity: 1; visibility: visible; transform: none; }
.tu-menu a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 11px; color: var(--ink); font-weight: 600; font-size: 14px; }
.tu-menu a:hover { background: var(--surface-2); }
.tu-menu a.tu-danger { color: var(--danger); }
.tu-head { display: flex; align-items: center; gap: 10px; padding: 6px 10px 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.tu-hname { font-weight: 800; font-size: 14px; }
.tu-hrole { font-size: 12px; color: var(--ink-2); }
.tu-sep { height: 1px; background: var(--line); margin: 6px 4px; }

/* Toast */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translate(-50%, 16px); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px; font-weight: 600; font-size: 14px; box-shadow: var(--sh-2); z-index: 220; opacity: 0; transition: opacity .3s, transform .3s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (max-width: 900px) { .toast { bottom: calc(var(--tabbar-h) + 18px); } }

/* Aperçu de la photo de profil */
.avatar-xl { width: 96px; height: 96px; border-radius: 24px; font-size: 34px; }
.photo-upload { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }

/* Impression (bouton Exporter) */
@media print {
    .sidebar, .tabbar, .topbar, .scrim, .no-print, .page-actions, .breadcrumb { display: none !important; }
    .shell > .main { margin-left: 0 !important; }
    .content { padding: 0 !important; }
    body { background: #fff !important; }
    .card, .stat { box-shadow: none !important; border: 1px solid #ddd !important; break-inside: avoid; }
}

.content { padding: clamp(18px, 2.4vw, 34px); width: 100%; animation: fade .4s var(--ease) both; }

/* Barre d'onglets (mobile, façon Android) */
.tabbar { display: none; }
@media (max-width: 900px) {
    .tabbar {
        display: flex; position: fixed; inset: auto 0 0 0; z-index: 50;
        height: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
        background: rgba(255,255,255,.94); border-top: 1px solid var(--line); backdrop-filter: saturate(1.5) blur(14px);
    }
    .tab { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--ink-3); font-size: 11px; font-weight: 700; position: relative; transition: color .18s; }
    .tab-ico { width: 42px; height: 30px; display: grid; place-items: center; font-size: 20px; border-radius: 12px; position: relative; transition: background .2s, transform .2s var(--ease); }
    .tab.is-active { color: var(--bordeaux); }
    .app--admin .tab.is-active { color: var(--emeraude); }
    .tab.is-active .tab-ico { background: var(--info-bg); transform: translateY(-1px); }
    .app--admin .tab.is-active .tab-ico { background: var(--ok-bg); }
    .tab-dot { position: absolute; top: 2px; right: 4px; width: 8px; height: 8px; border-radius: 50%; background: var(--or); border: 1.5px solid #fff; }
}

/* ============================================================
   COMPOSANTS
   ============================================================ */
.page-intro { color: var(--ink-2); margin: 0 0 22px; max-width: 70ch; font-size: 15.5px; }

/* Hero d'accueil (tableau de bord membre) */
.hero { position: relative; overflow: hidden; border-radius: 22px; padding: 28px 32px; color: #fff; margin-bottom: 20px;
    background: linear-gradient(135deg, #6D4C41 0%, #5D4037 55%, #3E2723 100%); box-shadow: 0 18px 40px rgba(61,39,35,.28); }
.hero::after { content: ""; position: absolute; right: -60px; top: -60px; width: 240px; height: 240px; border-radius: 50%; background: rgba(255,255,255,.10); }
.hero::before { content: ""; position: absolute; right: 80px; bottom: -90px; width: 180px; height: 180px; border-radius: 50%; background: rgba(255,255,255,.07); }
.hero-in { position: relative; z-index: 1; display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.hero .avatar { width: 66px; height: 66px; font-size: 24px; background: rgba(255,255,255,.22); color: #fff; }
.hero h1 { font-size: clamp(22px, 3vw, 28px); margin: 0 0 4px; color: #fff; letter-spacing: -.02em; }
.hero .sub { color: rgba(255,255,255,.85); font-size: 14.5px; }
.hero-actions { position: relative; z-index: 1; display: flex; gap: 10px; margin-top: 20px; flex-wrap: wrap; }
.hero-actions a { display: inline-flex; align-items: center; gap: 7px; background: rgba(255,255,255,.16); color: #fff; padding: 10px 16px; border-radius: 13px; font-weight: 700; font-size: 14px; }
.hero-actions a:hover { background: rgba(255,255,255,.28); }

/* Anneau de progression */
.ring-wrap { display: flex; align-items: center; gap: 18px; }
.ring { --p: 0; --c: var(--emeraude); width: 116px; height: 116px; border-radius: 50%; flex-shrink: 0; position: relative;
    background: conic-gradient(var(--c) calc(var(--p) * 1%), var(--line-2) 0); display: grid; place-items: center; }
.ring::before { content: ""; position: absolute; width: 84px; height: 84px; background: var(--surface); border-radius: 50%; }
.ring .rv { position: relative; z-index: 1; text-align: center; }
.ring .rv b { font-size: 24px; font-weight: 800; color: var(--ink); display: block; line-height: 1; }
.ring .rv span { font-size: 11px; color: var(--ink-2); }
.ring.big { width: 152px; height: 152px; }
.ring.big::before { width: 112px; height: 112px; }
.ring.big .rv b { font-size: 32px; }
.ring.big .rv span { font-size: 12px; }

/* Récapitulatif cotisation */
.cotis-hero { display: flex; align-items: center; gap: 30px; flex-wrap: wrap; }
.cotis-figs { flex: 1; min-width: 260px; display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 18px 16px; }
.fig span { display: block; font-size: 12.5px; color: var(--ink-2); font-weight: 600; margin-bottom: 3px; }
.fig b { font-size: 21px; font-weight: 800; color: var(--ink); letter-spacing: -.01em; }
.fig b.danger { color: var(--danger); }
.fig b.ok { color: var(--emeraude); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 24px; box-shadow: var(--sh-1); }
.card + .card { margin-top: 18px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.card-title { font-size: 18px; margin: 0; color: var(--ink); letter-spacing: -.02em; }

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }

/* Statistiques */
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; box-shadow: var(--sh-1); position: relative; transition: transform .22s var(--ease), box-shadow .22s var(--ease); }
.stat:hover { transform: translateY(-3px); box-shadow: var(--sh-2); }
.stat .val, .stat-val { font-size: 28px; font-weight: 800; color: var(--ink); line-height: 1.05; letter-spacing: -.02em; }
.stat .lbl, .stat-lbl { color: var(--ink-2); font-size: 13.5px; margin-top: 5px; font-weight: 500; }
.stat:has(.stat-ico) { display: flex; align-items: center; gap: 15px; }
.stat-ico { width: 52px; height: 52px; flex-shrink: 0; border-radius: 16px; display: grid; place-items: center; font-size: 24px; background: var(--info-bg); color: var(--bordeaux); }
.stat.emeraude .stat-ico { background: var(--ok-bg); color: var(--emeraude); }
.stat.rose .stat-ico { background: var(--danger-bg); color: var(--danger); }
.stat.emeraude .val { color: var(--emeraude); }
.stat-body { min-width: 0; }

/* Boutons */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 11px 20px; border: none; border-radius: var(--r-sm); font-weight: 700; font-size: 15px;
    font-family: inherit; cursor: pointer; transition: transform .14s var(--ease), box-shadow .2s, filter .18s; white-space: nowrap;
}
.btn:active { transform: translateY(1px) scale(.99); }
.btn-primary { background: linear-gradient(135deg, #795548, var(--bordeaux)); color: #fff; box-shadow: 0 8px 20px rgba(61,39,35,.34); }
.btn-primary:hover { box-shadow: 0 10px 26px rgba(61,39,35,.44); filter: brightness(1.04); transform: translateY(-1px); }
.btn-emeraude { background: linear-gradient(135deg, #1BC79A, var(--emeraude)); color: #fff; box-shadow: 0 8px 20px rgba(14,169,122,.32); }
.btn-emeraude:hover { box-shadow: 0 10px 26px rgba(14,169,122,.42); filter: brightness(1.04); transform: translateY(-1px); }
.btn-or { background: linear-gradient(135deg, #DEBE72, var(--or)); color: #fff; box-shadow: 0 8px 20px rgba(201,162,75,.30); }
.btn-or:hover { filter: brightness(1.04); transform: translateY(-1px); }
.btn-ghost { background: var(--surface-2); color: var(--ink); border: 1px solid var(--line); }
.btn-ghost:hover { background: var(--line-2); border-color: transparent; box-shadow: var(--sh-1); }
.btn-danger { background: var(--danger); color: #fff; box-shadow: 0 8px 20px rgba(240,70,110,.28); }
.btn-danger:hover { filter: brightness(1.04); transform: translateY(-1px); }
.btn-sm { padding: 7px 13px; font-size: 13px; border-radius: 10px; box-shadow: none; }
.btn-lg { padding: 14px 22px; font-size: 16px; }
.btn-block { width: 100%; }

/* Formulaires */
.field, .form-group { margin-bottom: 16px; }
.form-row { display: flex; gap: 14px; flex-wrap: wrap; }
.form-row .form-group, .form-row .field { flex: 1; min-width: 150px; }
label { display: block; font-weight: 700; font-size: 13.5px; margin-bottom: 7px; color: var(--ink); }
input, select, textarea {
    width: 100%; padding: 12px 14px; font-size: 15px; font-family: inherit; font-weight: 500;
    background: var(--surface-2); border: 1.5px solid var(--line); border-radius: var(--r-sm); color: var(--ink);
    transition: border-color .16s, box-shadow .16s, background .16s;
}
input::placeholder, textarea::placeholder { color: var(--ink-3); font-weight: 500; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--bordeaux); background: var(--surface); box-shadow: 0 0 0 4px rgba(61,39,35,.14); }
textarea { resize: vertical; min-height: 88px; }
.hint { font-size: 13px; color: var(--ink-2); margin-top: 6px; }

/* Champs fichier — bouton moderne (au lieu du natif) */
input[type="file"] {
    padding: 8px 10px; font-size: 14px; color: var(--ink-2); cursor: pointer;
    border: 1.5px dashed var(--line); border-radius: var(--r-sm); background: var(--surface-2);
}
input[type="file"]::file-selector-button {
    margin-right: 14px; padding: 10px 18px; border: none; border-radius: 10px; cursor: pointer;
    background: linear-gradient(135deg, #795548, var(--bordeaux)); color: #fff; font-weight: 700;
    font-family: inherit; font-size: 13.5px; transition: filter .15s, transform .08s;
}
input[type="file"]::file-selector-button:hover { filter: brightness(1.08); }
input[type="file"]::file-selector-button:active { transform: translateY(1px); }
.app--admin input[type="file"]::file-selector-button { background: var(--volt-navy); }

/* Alertes */
.alert { padding: 14px 16px; border-radius: var(--r-sm); margin-bottom: 18px; font-size: 14.5px; font-weight: 500; border: 1px solid transparent; }
.alert-success { background: var(--ok-bg);     color: #0a6b4a; border-color: #BEE9D6; }
.alert-error   { background: var(--danger-bg); color: #b31d45; border-color: #F8C4D2; }
.alert-info    { background: var(--info-bg);   color: #4b3fb0; border-color: #D6D1F8; }
.alert-warn    { background: var(--warn-bg);   color: #96560a; border-color: #F5DCA9; }

/* Badges */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 4px 11px; border-radius: var(--r-pill); font-size: 12px; font-weight: 700; }
.badge-ok      { background: var(--ok-bg);     color: #0a6b4a; }
.badge-warn    { background: var(--warn-bg);   color: #96560a; }
.badge-danger  { background: var(--danger-bg); color: #b31d45; }
.badge-or      { background: var(--or-pale);   color: #c33257; }
.badge-muted   { background: var(--line-2);    color: var(--ink-2); }
.badge-emeraude{ background: var(--ok-bg);     color: var(--emeraude); }

/* Tables */
.table-wrap { overflow-x: auto; border-radius: var(--r-sm); }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 13px 15px; text-align: left; border-bottom: 1px solid var(--line); }
th { font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); font-weight: 700; white-space: nowrap; }
tbody tr { transition: background .12s; }
tbody tr:hover { background: var(--surface-2); }
tfoot th { border-top: 2px solid var(--line); color: var(--ink); font-size: 14px; }

/* Listes */
.list { display: flex; flex-direction: column; gap: 10px; }
.list-item { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); transition: border-color .16s, box-shadow .16s, transform .16s; }
.list-item:hover { box-shadow: var(--sh-1); transform: translateY(-1px); border-color: transparent; }
.list-item .main { flex: 1; min-width: 0; }
.list-item .t { font-weight: 700; }
.list-item .s { font-size: 13px; color: var(--ink-2); }
.list-item.done .main { opacity: .55; text-decoration: line-through; }
.list-ico { width: 46px; height: 46px; flex-shrink: 0; border-radius: 14px; display: grid; place-items: center; font-size: 19px; background: var(--info-bg); color: var(--bordeaux); }
.list-ico.cal { flex-direction: column; line-height: 1; gap: 1px; }
.list-ico .m { font-size: 10px; text-transform: uppercase; }
.list-ico .d { font-size: 17px; font-weight: 800; }

.empty { text-align: center; padding: 46px 20px; color: var(--ink-2); }
.empty .ico { font-size: 44px; margin-bottom: 12px; }

.muted { color: var(--ink-2); }
.check-list { list-style: none; padding: 0; line-height: 2; }
.check-list li { color: var(--ok); }
code { background: var(--info-bg); color: var(--bordeaux); padding: 2px 8px; border-radius: 7px; font-size: .9em; font-weight: 600; }
.section-title { font-size: 16px; font-weight: 800; color: var(--ink); margin: 24px 0 12px; letter-spacing: -.02em; }
.divider { height: 1px; background: var(--line); border: 0; margin: 20px 0; }
.divider-or { height: 3px; border: 0; margin: 20px 0; border-radius: 3px; background: linear-gradient(90deg, var(--or), transparent); }
.mb-0 { margin-bottom: 0; }
.bar { height: 9px; background: var(--line-2); border-radius: var(--r-pill); overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: var(--r-pill); }

/* Grille des mois de cotisation */
.grille-annee { margin-bottom: 18px; }
.grille-titre { font-weight: 800; font-size: 15px; margin-bottom: 10px; color: var(--ink); }
.mois-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.mois-cell { border-radius: 13px; padding: 11px 6px; text-align: center; border: 1.5px solid var(--line); background: var(--surface-2); display: flex; flex-direction: column; align-items: center; gap: 3px; transition: transform .15s var(--ease); }
.mois-cell:hover { transform: translateY(-2px); }
.mc-mois { font-size: 12px; font-weight: 700; }
.mc-icon { font-size: 15px; font-weight: 800; line-height: 1; }
.mois-cell.paye { background: var(--ok-bg); border-color: transparent; color: var(--emeraude); }
.mois-cell.du { background: var(--danger-bg); border-color: transparent; color: var(--danger); }
.mois-cell.venir { color: var(--ink-3); }
.grille-legende { display: flex; gap: 18px; margin-top: 14px; font-size: 13px; color: var(--ink-2); flex-wrap: wrap; }
.grille-legende i.lg { display: inline-block; width: 13px; height: 13px; border-radius: 4px; vertical-align: -1px; margin-right: 5px; }
.grille-legende i.lg.paye { background: var(--emeraude); }
.grille-legende i.lg.du { background: var(--danger); }
.grille-legende i.lg.venir { background: var(--line); }
@media (max-width: 520px) { .mois-grid { grid-template-columns: repeat(4, 1fr); } }

/* Messagerie */
.chat { display: grid; grid-template-columns: 320px 1fr; height: calc(100dvh - 156px); min-height: 440px; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--surface); box-shadow: var(--sh-1); }
.chat-list { border-right: 1px solid var(--line); overflow-y: auto; background: var(--surface-2); }
.chat-conv { display: flex; gap: 12px; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line); color: inherit; transition: background .14s; }
.chat-conv:hover { background: var(--line-2); }
.chat-conv.is-active, .chat-conv.active { background: var(--surface); }
.chat-conv.is-active .t, .chat-conv.active .t { color: var(--bordeaux); }
.chat-conv .t { font-weight: 700; font-size: 14px; }
.chat-conv .s { font-size: 12px; color: var(--ink-2); }
.chat-avatar { width: 42px; height: 42px; flex-shrink: 0; border-radius: 14px; display: grid; place-items: center; background: var(--info-bg); color: var(--bordeaux); font-size: 18px; }
.chat-main { display: flex; flex-direction: column; min-width: 0; }
.chat-head { padding: 16px 20px; border-bottom: 1px solid var(--line); font-weight: 800; color: var(--ink); }
.chat-msgs { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 10px; background: var(--surface-2); }
.msg-row { display: flex; align-items: flex-end; gap: 8px; max-width: 80%; animation: pop .2s var(--ease) both; }
.msg-row.mine { align-self: flex-end; flex-direction: row-reverse; }
.chat-msg-av { flex-shrink: 0; }
.msg { max-width: 100%; padding: 10px 14px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--sh-1); }
.msg .who { font-size: 12px; font-weight: 800; color: var(--bordeaux); margin-bottom: 2px; }
.msg .time { font-size: 11px; color: var(--ink-3); margin-top: 3px; text-align: right; }
.msg.mine { align-self: flex-end; background: linear-gradient(135deg, #795548, var(--bordeaux)); color: #fff; border-color: transparent; }
.msg.mine .who { color: rgba(255,255,255,.8); }
.msg.mine .time { color: rgba(255,255,255,.75); }
.chat-form { display: flex; gap: 10px; padding: 14px; border-top: 1px solid var(--line); background: var(--surface); }
.chat-form input { flex: 1; }

/* Généalogie */
.tree { list-style: none; padding-left: 0; margin: 0; }
.tree ul { list-style: none; margin: 0; padding-left: 26px; border-left: 2px dashed var(--or-pale); }
.tree li { padding: 6px 0; position: relative; }
.node { display: inline-flex; align-items: center; gap: 10px; padding: 9px 15px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-pill); box-shadow: var(--sh-1); }
.node.g1 { border: 2px solid var(--bordeaux); background: var(--info-bg); }
.node-av { flex-shrink: 0; }
.node-txt { display: flex; flex-direction: column; line-height: 1.25; }
.node .nom { font-weight: 700; }
.node .nom .dot { display: inline-block; margin-right: 6px; vertical-align: middle; }
.node .meta { font-size: 12px; color: var(--ink-2); }
.node.defunt { opacity: .7; font-style: italic; }
.dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.dot.M { background: var(--bordeaux); } .dot.F { background: var(--or); }

/* Annuaire — cartes-contacts */
.member-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 16px; }
.member-card { position: relative; overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 22px 18px 18px; box-shadow: var(--sh-1); text-align: center; transition: transform .2s var(--ease), box-shadow .2s var(--ease); }
.member-card:hover { transform: translateY(-4px); box-shadow: var(--sh-2); }
.member-card::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px; background: var(--gen-accent, var(--or)); }
.member-card.g1 { --gen-accent: #C9A24B; } .member-card.g2 { --gen-accent: #5D4037; }
.member-card.g3 { --gen-accent: #8D6E63; } .member-card.g4 { --gen-accent: #A1887F; }
.member-card .avatar { width: 66px; height: 66px; font-size: 23px; margin: 0 auto 12px; }
.member-card.g1 .avatar::after { content: "★"; position: absolute; margin-top: -46px; margin-left: 44px; color: #C9A24B; font-size: 15px; }
.mc-nom { font-family: var(--serif); font-weight: 700; font-size: 15px; color: var(--ink); line-height: 1.25; }
.mc-lien { font-size: 12.5px; color: var(--ink-2); margin-top: 3px; }
.mc-badges { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin-top: 12px; }
.mc-contact { display: inline-flex; align-items: center; gap: 6px; margin-top: 13px; font-size: 13px; color: var(--bordeaux); font-weight: 700; text-decoration: none; }
.mc-contact:hover { color: var(--bordeaux-2); }

/* Composer d'annonces */
.composer { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--sh-1); padding: 18px 20px; margin-bottom: 22px; }
.composer:focus-within { border-color: var(--bordeaux); box-shadow: var(--sh-2); }
.composer-top { display: flex; gap: 14px; }
.composer-titre, .composer-txt { border: none !important; background: transparent !important; box-shadow: none !important; padding: 6px 0 !important; width: 100%; }
.composer-titre { font-weight: 700; font-size: 16px; font-family: var(--serif); }
.composer-txt { min-height: 58px; resize: none; font-size: 15px; }
.composer-preview { max-width: 220px; max-height: 200px; border-radius: 12px; margin-top: 10px; object-fit: cover; }
.composer-docchip { display: inline-flex; align-items: center; gap: 8px; margin-top: 10px; padding: 8px 12px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; font-size: 13px; font-weight: 700; color: var(--ink-2); }
.composer-bar { display: flex; align-items: center; gap: 10px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.composer-attach { display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); cursor: pointer; font-size: 13.5px; font-weight: 700; color: var(--ink-2); transition: background .15s, color .15s; }
.composer-attach:hover { background: var(--info-bg); color: var(--bordeaux); border-color: transparent; }
.composer-type { max-width: 210px; }

/* Carte document (téléchargement) */
.doc-card { display: flex; align-items: center; gap: 12px; margin-top: 12px; padding: 12px 14px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; text-decoration: none; transition: border-color .15s, box-shadow .15s; }
.doc-card:hover { border-color: var(--or); box-shadow: var(--sh-1); }
.doc-ico { font-size: 27px; }
.doc-meta { flex: 1; min-width: 0; }
.doc-nom { display: block; font-weight: 700; color: var(--ink); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-sub { font-size: 12px; color: var(--ink-2); }
.doc-dl { width: 36px; height: 36px; flex-shrink: 0; border-radius: 10px; background: var(--bordeaux); color: #fff; display: grid; place-items: center; font-size: 16px; }

/* Publications */
.post { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 20px 22px; box-shadow: var(--sh-1); margin-bottom: 16px; transition: box-shadow .18s, transform .18s; scroll-margin-top: 90px; }
.post:hover { box-shadow: var(--sh-2); }
.post.annonce { border: 1px solid var(--or); background: linear-gradient(135deg, #FBF6EC, #FFFDF9); }
.post-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.post-body { white-space: pre-wrap; }
.post-media { max-width: 100%; max-height: 560px; width: auto; border-radius: 14px; margin-top: 10px; display: block; object-fit: contain; background: var(--surface-2); border: 1px solid var(--line); }
.post-actions { display: flex; gap: 18px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 14px; align-items: center; }
.post-actions form { display: inline; }
.link-btn { background: none; border: none; color: var(--ink-2); cursor: pointer; font-size: 14px; font-family: inherit; font-weight: 600; padding: 0; }
.link-btn:hover { color: var(--bordeaux); }
.hidden { display: none; }

/* Motion */
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; } }

/* ============================================================
   THÈME « VOLT » — ESPACE ADMINISTRATEUR
   (sidebar marine, fond clair, accent cyan, cartes nettes)
   ============================================================ */
.app--admin {
    --bordeaux:   #262B40;   /* accents/titres admin → marine */
    --bordeaux-2: #1A1E2E;
    --bg:         #F0F3F9;
    --info-bg:    #E9F4FE;
    --volt-cyan:  #2FBCE8;
    --volt-navy:  #262B40;
}
.app--admin .sidebar { background: #262B40; box-shadow: none; }
.app--admin .brand-crest { background: var(--volt-cyan); color: #fff; }
.app--admin .brand-name { color: #fff; }
.app--admin .brand-sub { color: #8A93A9; }
.app--admin .nav-item { color: #C4C9D8; font-weight: 600; border-radius: 10px; }
.app--admin .nav-item:hover { background: rgba(255,255,255,.07); color: #fff; }
.app--admin .nav-item.is-active { background: rgba(255,255,255,.12); color: #fff; box-shadow: none; }
.app--admin .nav-item.is-active .nav-ico { filter: none; }
.app--admin .pill { background: var(--volt-cyan); }
.app--admin .sidebar-foot { border-top-color: rgba(255,255,255,.10); }
.app--admin .switch-link { background: rgba(255,255,255,.10); }
.app--admin .switch-link:hover { background: rgba(255,255,255,.20); }
.app--admin .user-role { color: #8A93A9; }

.app--admin h1, .app--admin h2, .app--admin h3, .app--admin .card-title,
.app--admin .topbar-title, .app--admin .page-h1 { font-family: var(--sans); font-weight: 800; letter-spacing: -.02em; }
.app--admin .topbar { background: rgba(255,255,255,.90); border-bottom-color: #E6EAF1; }
.app--admin .topbar-title { color: var(--volt-navy); }
.app--admin .card-title { color: var(--volt-navy); }

.app--admin .card,
.app--admin .stat { border: 1px solid #E7EBF2; border-radius: 12px; box-shadow: 0 .5rem 1.3rem rgba(38,43,64,.07); }
.app--admin .stat:hover { box-shadow: 0 .75rem 1.6rem rgba(38,43,64,.10); }
.app--admin .stat-ico { background: #EEF1F7; color: var(--volt-navy); }
.app--admin .stat .val, .app--admin .stat-val { color: var(--volt-navy); }

/* Boutons façon Volt : CTA cyan, secondaire marine */
.app--admin .btn-emeraude { background: var(--volt-cyan); box-shadow: 0 6px 16px rgba(47,188,232,.28); }
.app--admin .btn-emeraude:hover { background: #22A9D6; }
.app--admin .btn-primary { background: var(--volt-navy); box-shadow: none; }
.app--admin .btn-primary:hover { background: #1A1E2E; }
.app--admin .btn-ghost { background: #fff; border-color: #D9DEE9; }

.app--admin th { color: #8A94A6; }
.app--admin tbody tr:hover { background: #F7F9FC; }
.app--admin .badge-ok { background: #E3F7EF; color: #05A677; }
.app--admin .badge-warn { background: #FDF3E2; color: #D9911F; }
.app--admin .badge-danger { background: #FDE7EC; color: #E63757; }

.app--admin .tab.is-active { color: var(--volt-cyan); }
.app--admin .tab.is-active .tab-ico { background: var(--info-bg); }
.app--admin .brand-crest--sm { background: var(--volt-cyan) !important; color: #fff; }

/* ============================================================
   AVATARS — photos de profil circulaires PARTOUT (membre + admin)
   ============================================================ */
.avatar { border-radius: 50% !important; }
.avatar img { border-radius: 50% !important; object-fit: cover; object-position: center 28%; }

/* ============================================================
   MESSAGERIE façon IMOVI+ / WhatsApp
   ============================================================ */
:root { --imv-navy: #0E1A33; --imv-green: #E4FCD4; --imv-green-b: #C9F2B0; --imv-bubble: #FFFFFF; --imv-wall: #ECE5DD; }

.imv { display: grid; grid-template-columns: 340px 1fr; height: calc(100dvh - 150px); min-height: 460px; border-radius: var(--r); overflow: hidden; box-shadow: var(--sh-2); background: var(--surface); border: 1px solid var(--line); }
.imv-list { border-right: 1px solid var(--line); overflow-y: auto; background: var(--surface); display: flex; flex-direction: column; }
.imv-list-head { padding: 16px 18px; font-weight: 800; color: var(--ink); border-bottom: 1px solid var(--line); }
.imv-conv { display: flex; gap: 12px; align-items: center; padding: 13px 16px; cursor: pointer; color: inherit; border-bottom: 1px solid var(--line-2); transition: background .14s; }
.imv-conv:hover { background: var(--surface-2); }
.imv-conv.is-active { background: var(--info-bg); }
.imv-conv .ci { flex: 1; min-width: 0; }
.imv-conv .cn { font-weight: 700; font-size: 14px; display: flex; justify-content: space-between; gap: 8px; }
.imv-conv .cn .ct { font-size: 11px; color: var(--ink-3); font-weight: 600; }
.imv-conv .cp { font-size: 13px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.imv-conv .cbadge { background: var(--imv-green-b); color: #2e6b12; min-width: 20px; height: 20px; border-radius: 999px; font-size: 11px; font-weight: 800; display: grid; place-items: center; padding: 0 6px; }

.imv-main { display: flex; flex-direction: column; min-width: 0; }
.imv-head { display: flex; align-items: center; gap: 12px; padding: 12px 18px; background: var(--imv-navy); color: #fff; }
.imv-head .hn { font-weight: 700; }
.imv-head .hs { font-size: 12px; color: rgba(255,255,255,.7); }
.imv-head .avatar { background: linear-gradient(135deg, #FF7A45, #F0531E); color: #fff; }
.imv-wall { flex: 1; overflow-y: auto; padding: 20px clamp(14px, 4vw, 60px); display: flex; flex-direction: column; gap: 8px;
    background:
      repeating-linear-gradient(135deg, rgba(14,26,51,.015) 0 2px, transparent 2px 26px),
      var(--imv-wall); }
.imv-date { align-self: center; background: rgba(255,255,255,.9); color: var(--ink-2); font-size: 12px; font-weight: 700; padding: 4px 12px; border-radius: 999px; box-shadow: var(--sh-1); margin: 4px 0; }
.imv-b { max-width: 74%; padding: 8px 11px 6px; border-radius: 12px; background: var(--imv-bubble); box-shadow: 0 1px 1px rgba(0,0,0,.08); position: relative; animation: pop .18s var(--ease) both; }
.imv-b .who { font-size: 12px; font-weight: 800; color: var(--bordeaux); margin-bottom: 1px; }
.imv-b .tx { font-size: 14.5px; color: #111b21; word-wrap: break-word; }
.imv-b .mt { font-size: 10.5px; color: #667781; float: right; margin: 4px 0 0 10px; }
.imv-b.mine { align-self: flex-end; background: var(--imv-green); }
.imv-brow { display: flex; }
.imv-brow.mine { justify-content: flex-end; }
.imv-b.med img { max-width: 240px; border-radius: 9px; display: block; margin-bottom: 4px; }
.imv-bar { display: flex; align-items: center; gap: 8px; padding: 10px 14px; background: var(--surface-2); border-top: 1px solid var(--line); }
.imv-bar .ib-ico { width: 40px; height: 40px; border-radius: 50%; border: none; background: transparent; font-size: 20px; cursor: pointer; color: var(--ink-2); }
.imv-bar .ib-ico:hover { background: var(--line-2); }
.imv-bar input[type=text] { flex: 1; border-radius: 999px; background: var(--surface); padding: 12px 16px; }
.imv-send { width: 46px; height: 46px; border-radius: 50%; border: none; background: var(--emeraude); color: #fff; font-size: 18px; cursor: pointer; flex-shrink: 0; box-shadow: 0 6px 16px rgba(14,169,122,.35); }
.imv-send:hover { filter: brightness(1.05); }
.imv-empty { flex: 1; display: grid; place-items: center; color: var(--ink-2); text-align: center; padding: 30px; }

/* --- Généalogie admin : barres de répartition --- */
.genbar-row { display: flex; align-items: center; gap: 12px; padding: 7px 0; }
.genbar-lbl { flex: 0 0 42%; font-size: 13.5px; font-weight: 600; }
.genbar-track { flex: 1; height: 12px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.genbar-fill { display: block; height: 100%; border-radius: 999px; transition: width .5s var(--ease); }
.genbar-fill.gen-1 { background: #5D4037; } .genbar-fill.gen-2 { background: #8D6E63; }
.genbar-fill.gen-3 { background: #A1887F; } .genbar-fill.gen-4 { background: #C9A24B; }
.app--admin .genbar-fill.gen-1 { background: #2FBCE8; } .app--admin .genbar-fill.gen-2 { background: #4A90D9; }
.app--admin .genbar-fill.gen-3 { background: #5E72E4; } .app--admin .genbar-fill.gen-4 { background: #11CDEF; }
.genbar-val { flex: 0 0 34px; text-align: right; font-weight: 800; }
.gen-extremes { display: flex; flex-direction: column; gap: 6px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 13px; color: var(--ink-2); }
.table-compact th, .table-compact td { padding: 8px 10px; font-size: 13.5px; }

/* --- Messagerie pro : recherche, entête, saisie, médias, accusés --- */
.imv-attach-menu[hidden], .imv-preview[hidden], .imv-typing[hidden] { display: none !important; }
.imv-list-head { display: flex; flex-direction: column; gap: 10px; }
.imv-list-title { font-weight: 800; }
.imv-search input, .imv-head-search input { width: 100%; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); padding: 9px 14px; font-size: 13px; }
.imv-head-txt { min-width: 0; }
.imv-head-search { margin-left: auto; width: min(260px, 40%); }
.imv-head-search input { background: rgba(255,255,255,.14); border-color: transparent; color: #fff; }
.imv-head-search input::placeholder { color: rgba(255,255,255,.7); }

/* Accusés de lecture */
.imv-b .ck { margin-left: 3px; font-size: 10px; letter-spacing: -1px; }
.imv-b .ck.seen { color: #34B7F1; }
.imv-b .mt { display: inline-flex; align-items: center; }

/* Indicateur de saisie */
.imv-typing { align-self: flex-start; display: inline-flex; align-items: center; gap: 8px; background: #fff; border-radius: 14px; padding: 9px 14px; box-shadow: var(--sh-1); font-size: 12.5px; color: var(--ink-2); font-weight: 600; }
.imv-typing .dots { display: inline-flex; gap: 3px; }
.imv-typing .dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--imv-navy); opacity: .4; animation: typedot 1.2s infinite; }
.imv-typing .dots i:nth-child(2) { animation-delay: .2s; }
.imv-typing .dots i:nth-child(3) { animation-delay: .4s; }
@keyframes typedot { 0%,60%,100% { transform: translateY(0); opacity: .35; } 30% { transform: translateY(-4px); opacity: 1; } }

/* Recherche : surlignage d'une correspondance */
.imv-brow.search-hit .imv-b { outline: 2px solid var(--or); }

/* Bulles média */
.imv-b .msg-img { max-width: 260px; max-height: 300px; border-radius: 10px; display: block; margin-bottom: 4px; cursor: zoom-in; object-fit: cover; }
.imv-b .msg-vid { max-width: 280px; max-height: 320px; border-radius: 10px; display: block; margin-bottom: 4px; background: #000; }
.imv-b .msg-aud { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.imv-b .msg-aud audio { height: 38px; max-width: 210px; }
.imv-b .msg-aud-ico { font-size: 18px; }
.imv-b .msg-doc { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; padding: 9px 11px; background: rgba(0,0,0,.05); border-radius: 10px; text-decoration: none; color: inherit; min-width: 190px; }
.imv-b .msg-doc-ico { font-size: 22px; }
.imv-b .msg-doc-nom { flex: 1; font-weight: 700; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.imv-b .msg-doc-dl { width: 30px; height: 30px; border-radius: 8px; background: var(--imv-navy); color: #fff; display: grid; place-items: center; }
.imv-b .msg-loc { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; text-decoration: none; color: inherit; padding: 6px; border-radius: 10px; background: rgba(0,0,0,.04); }
.imv-b .msg-loc-ico { font-size: 26px; }
.imv-b .msg-loc-tx { display: flex; flex-direction: column; font-weight: 700; font-size: 13px; }
.imv-b .msg-loc-tx small { font-weight: 500; color: var(--emeraude); font-size: 11px; }

/* Barre de saisie enrichie */
.imv-bar { position: relative; }
.imv-ic { width: 44px; height: 44px; border-radius: 50%; border: none; background: var(--surface); box-shadow: var(--sh-1); font-size: 20px; cursor: pointer; color: var(--ink-2); flex-shrink: 0; display: grid; place-items: center; transition: background .15s, transform .15s; }
.imv-ic:hover { background: var(--info-bg); color: var(--bordeaux); }
.imv-mic.recording { background: var(--danger); color: #fff; animation: pulse-rec 1s infinite; }
@keyframes pulse-rec { 0%,100% { box-shadow: 0 0 0 0 rgba(240,70,110,.5); } 50% { box-shadow: 0 0 0 8px rgba(240,70,110,0); } }
.imv-attach { position: relative; }
.imv-attach-menu { position: absolute; bottom: 54px; left: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--sh-2); padding: 6px; display: flex; flex-direction: column; min-width: 190px; z-index: 20; animation: rise .18s var(--ease) both; }
.imv-attach-menu button { text-align: left; border: none; background: none; padding: 10px 12px; border-radius: 9px; font-size: 14px; font-weight: 600; cursor: pointer; color: var(--ink); }
.imv-attach-menu button:hover { background: var(--surface-2); }

/* Aperçu de pièce jointe avant envoi */
.imv-preview { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; background: var(--info-bg); border-top: 1px solid var(--line); }
.imv-preview .pv-body { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 13px; color: var(--ink); min-width: 0; }
.imv-preview .pv-body img, .imv-preview .pv-body video { width: 54px; height: 54px; border-radius: 10px; object-fit: cover; }
.imv-preview .pv-ic { font-size: 24px; }
.imv-preview .pv-x { width: 32px; height: 32px; border-radius: 50%; border: none; background: var(--surface); box-shadow: var(--sh-1); cursor: pointer; font-size: 14px; flex-shrink: 0; }

/* ============================================================
   CHAT FLOTTANT (widget IMOVI+)
   ============================================================ */
.chat-fab { position: fixed; right: 22px; bottom: 24px; width: 62px; height: 62px; border-radius: 50%; border: none; cursor: pointer; z-index: 120;
    background: linear-gradient(135deg, #FF7A45, #F0531E); color: #fff; font-size: 27px; box-shadow: 0 12px 30px rgba(240,83,30,.45); display: grid; place-items: center; transition: transform .2s var(--ease); }
.chat-fab:hover { transform: scale(1.06); }
.chat-fab .fab-badge { position: absolute; top: -3px; right: -3px; min-width: 22px; height: 22px; padding: 0 5px; border-radius: 999px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 800; display: grid; place-items: center; border: 2px solid #fff; }
.chat-widget { position: fixed; right: 22px; bottom: 24px; width: 380px; max-width: calc(100vw - 30px); height: 560px; max-height: calc(100dvh - 40px); z-index: 130;
    background: var(--surface); border-radius: 20px; box-shadow: 0 30px 70px rgba(10,15,30,.4); overflow: hidden; display: none; flex-direction: column; }
.chat-widget.open { display: flex; animation: rise .3s var(--ease) both; }
.chat-widget.expanded { width: 860px; height: calc(100dvh - 40px); }
.cw-head { display: flex; align-items: center; gap: 11px; padding: 14px 16px; background: var(--imv-navy); color: #fff; }
.cw-head .cwi { width: 40px; height: 40px; border-radius: 50%; background: linear-gradient(135deg, #FF7A45, #F0531E); display: grid; place-items: center; font-size: 19px; }
.cw-title { font-weight: 800; line-height: 1.15; }
.cw-sub { font-size: 11px; color: rgba(255,255,255,.7); }
.cw-actions { margin-left: auto; display: flex; gap: 6px; }
.cw-actions button { width: 34px; height: 34px; border-radius: 10px; border: none; background: rgba(255,255,255,.12); color: #fff; cursor: pointer; font-size: 15px; }
.cw-actions button:hover { background: rgba(255,255,255,.24); }
.cw-search { padding: 10px 12px; border-bottom: 1px solid var(--line); }
.cw-search input { border-radius: 999px; background: var(--surface-2); }
.cw-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.cw-list-view { display: flex; flex-direction: column; height: 100%; }
.cw-list { flex: 1; overflow-y: auto; }
.cw-conv { display: flex; gap: 11px; align-items: center; padding: 12px 14px; cursor: pointer; border-bottom: 1px solid var(--line-2); }
.cw-conv:hover { background: var(--surface-2); }
.cw-conv .ci { flex: 1; min-width: 0; }
.cw-conv .cn { font-weight: 700; font-size: 14px; display: flex; justify-content: space-between; gap: 6px; }
.cw-conv .cn .ct { font-size: 11px; color: var(--ink-3); font-weight: 600; }
.cw-conv .cp { font-size: 12.5px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cw-conv .cbadge { background: var(--imv-green-b); color: #2e6b12; min-width: 19px; height: 19px; border-radius: 999px; font-size: 11px; font-weight: 800; display: grid; place-items: center; padding: 0 6px; }
/* Vue conversation dans le widget */
.cw-conv-view { display: none; flex-direction: column; flex: 1; min-height: 0; }
.chat-widget.in-conv .cw-list-view { display: none; }
.chat-widget.in-conv .cw-conv-view { display: flex; }
.cw-cvhead { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--imv-navy); color: #fff; }
.cw-cvhead .bk { background: none; border: none; color: #fff; font-size: 18px; cursor: pointer; }
.cw-cvhead .avatar { background: linear-gradient(135deg, #FF7A45, #F0531E); color: #fff; }
/* Bouton retour (visible seulement en vue conversation sur mobile) */
.imv-back { display: none; width: 38px; height: 38px; flex: 0 0 auto; border-radius: 10px;
    align-items: center; justify-content: center; background: rgba(255,255,255,.16); color: #fff; font-size: 20px; text-decoration: none; }

/* ---- Messagerie mobile : une seule vue à la fois (façon WhatsApp) ---- */
@media (max-width: 900px) {
    body.msg-page .content { padding: 0; }
    .imv { grid-template-columns: 1fr; height: auto; min-height: 0; border: 0; border-radius: 0; box-shadow: none; }
    .imv-list, .imv-main { height: calc(100dvh - var(--topbar-h)); }
    /* Vue liste : la liste occupe l'écran, au-dessus de la barre du bas */
    .imv:not(.imv--conv) .imv-main { display: none; }
    .imv:not(.imv--conv) .imv-list { height: calc(100dvh - var(--topbar-h) - var(--tabbar-h) - env(safe-area-inset-bottom)); }
    /* Vue conversation : plein écran, liste et barre du bas masquées */
    .imv.imv--conv .imv-list { display: none; }
    .imv.imv--conv .imv-main { display: flex; }
    .imv-back { display: inline-flex; }
    body.msg-conv .tabbar { display: none; }
    .imv-head-search { display: none; }
    .imv-b .msg-img, .imv-b .msg-vid { max-width: 72vw; }
}

@media (max-width: 640px) {
    /* Chat flottant : plein écran + barre du bas masquée quand il est ouvert */
    .chat-widget { inset: 0; right: 0; left: 0; top: 0; bottom: 0; width: auto; max-width: none; height: 100dvh; max-height: 100dvh; border-radius: 0; }
    body.chat-open .tabbar { display: none; }
    .chat-fab { right: 16px; bottom: calc(var(--tabbar-h) + 16px); }
    .imv-b .msg-img, .imv-b .msg-vid { max-width: 76vw; }
}

/* Responsive */
@media (max-width: 900px) {
    .sidebar { transform: translateX(-100%); box-shadow: var(--sh-3); }
    body.drawer-open .sidebar { transform: translateX(0); }
    body.drawer-open .scrim { opacity: 1; visibility: visible; }
    .shell > .main { margin-left: 0; }
    .menu-btn, .brand-crest--sm, .topbar-logout { display: grid; }
    .brand-crest--sm { width: 38px; height: 38px; font-size: 18px; background: linear-gradient(135deg, #795548, var(--bordeaux)); color: #fff; }
    .app--admin .brand-crest--sm { background: linear-gradient(135deg, #1BC79A, var(--emeraude)); }
    .content { padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 22px); }
    .chat { height: auto; }
    .chat-list { max-height: 34dvh; }
    .chat-msgs { height: 46dvh; }
}
@media (max-width: 520px) {
    .topbar-title { font-size: 17px; }
    .card { padding: 18px 16px; }
    .stat { padding: 16px; }
    .stat .val, .stat-val { font-size: 24px; }
}

/* ============ Bannière d'installation PWA ============ */
.pwa-install {
    position: fixed;
    left: 50%;
    bottom: 24px;
    transform: translate(-50%, 130%);
    width: min(520px, calc(100vw - 28px));
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r);
    box-shadow: var(--sh-3);
    z-index: 210;
    opacity: 0;
    transition: transform .4s var(--ease), opacity .4s var(--ease);
}
.pwa-install.show { transform: translate(-50%, 0); opacity: 1; }
.pwa-install .pwa-ic {
    flex: 0 0 auto;
    width: 42px; height: 42px;
    display: grid; place-items: center;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--bordeaux), var(--bordeaux-2));
    color: var(--or); font-size: 22px;
}
.pwa-install .pwa-tx { flex: 1 1 auto; font-size: 13.5px; line-height: 1.35; color: var(--ink); }
.pwa-install .pwa-tx b { color: var(--bordeaux); }
.pwa-install .pwa-btn {
    flex: 0 0 auto;
    border: none; cursor: pointer;
    padding: 10px 16px;
    border-radius: var(--r-pill);
    background: linear-gradient(135deg, var(--or), var(--or-2));
    color: #3E2723; font-weight: 700; font-size: 13.5px;
    box-shadow: var(--sh-1);
}
.pwa-install .pwa-btn:active { transform: scale(.96); }
.pwa-install .pwa-x {
    flex: 0 0 auto;
    border: none; background: var(--surface-2); cursor: pointer;
    width: 30px; height: 30px; border-radius: 50%;
    color: var(--ink-2); font-size: 14px; line-height: 1;
}
.pwa-install .pwa-x:hover { background: var(--line); }
@media (max-width: 900px) {
    .pwa-install { bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 14px); }
}

/* Lignes d'options à cocher (confidentialité, préférences) */
.switch-row { display: flex; align-items: center; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--line-2); cursor: pointer; font-size: 14.5px; color: var(--ink); }
.switch-row:last-of-type { border-bottom: none; }
.switch-row input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--bordeaux); flex: 0 0 auto; cursor: pointer; }

/* ============================================================
   RESPONSIVE & STABILITÉ DES BARRES (#5)
   ============================================================ */

/* Empêche tout débordement horizontal, principale cause du décalage qui
   donne l'impression que les barres « bougent ». 'clip' n'interrompt pas
   position:sticky, contrairement à overflow:hidden. */
html, body { max-width: 100%; overflow-x: clip; }

/* Les textes très longs (noms, liens, messages) ne débordent plus la largeur */
.mc-nom, .card, .msg, .page-intro, .tu-hname, .user-name, .cw-conv .cp { overflow-wrap: anywhere; }

/* Barre du haut : toujours pleine largeur, bien ancrée en haut */
.topbar { width: 100%; }

/* Barre du bas (mobile) : calque dédié pour éviter les micro-sauts au défilement */
@media (max-width: 900px) {
    .tabbar { backface-visibility: hidden; }
    .topbar { position: sticky; top: 0; }
}

/* Petits écrans : on allège la barre du haut pour qu'elle ne déborde jamais */
@media (max-width: 560px) {
    .topbar { padding: 12px 14px; gap: 8px; }
    .tu-name, .tu-caret { display: none; }
    .topbar-search { min-width: 0; }
    .member-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
}

/* Très petits téléphones : grilles de statistiques sur 2 colonnes plutôt que tassées */
@media (max-width: 420px) {
    .grid-4, .grid-3 { grid-template-columns: 1fr 1fr; }
}

/* Grands écrans / téléviseurs : on centre et on borne la largeur du contenu
   pour garder des lignes lisibles au lieu de s'étirer sur toute la dalle. */
@media (min-width: 1700px) {
    .content { max-width: 1560px; margin-inline: auto; }
}

/* Barre de progression (recouvrement par branche, #4) */
.prog { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; margin-bottom: 4px; }
.prog > span { display: block; height: 100%; border-radius: 999px; background: var(--emeraude); transition: width .4s var(--ease); }

/* ============================================================
   MESSAGERIE « WhatsApp » : composeur, contact, nouveautés (#chat)
   ============================================================ */

/* En-tête liste : titre + bouton Nouveau */
.imv-list-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.imv-new { border: none; cursor: pointer; padding: 8px 14px; border-radius: var(--r-pill);
    background: linear-gradient(135deg, var(--bordeaux), var(--bordeaux-2)); color: #fff; font-weight: 700; font-size: 13px; box-shadow: var(--sh-1); }
.imv-new:hover { filter: brightness(1.08); }
.app--admin .imv-new { background: linear-gradient(135deg, var(--emeraude), var(--emeraude-2)); }

/* Carte de contact partagé (dans une bulle de message) */
.msg-ct { display: flex; align-items: center; gap: 10px; padding: 9px 12px; margin: 2px 0 4px;
    background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; min-width: 190px; }
.msg-ct-ic { flex: 0 0 auto; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center;
    background: linear-gradient(135deg, var(--bordeaux), var(--bordeaux-2)); color: #fff; font-weight: 800; font-size: 13px; }
.msg-ct-i { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.msg-ct-n { font-weight: 700; font-size: 13.5px; color: var(--ink); }
.msg-ct-tel { font-size: 13px; color: var(--bordeaux); font-weight: 600; }
.msg-ct-tel.none { color: var(--ink-3); font-weight: 500; }

/* Overlay composeur (nouvelle discussion / groupe / contact) */
.compose-ov { position: fixed; inset: 0; z-index: 400; display: flex; align-items: center; justify-content: center;
    padding: 20px; background: rgba(28,20,16,.5); backdrop-filter: blur(3px); animation: fade .2s var(--ease) both; }
.compose-ov[hidden] { display: none; }
.compose-card { width: 100%; max-width: 460px; max-height: min(640px, 86dvh); display: flex; flex-direction: column;
    background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--sh-3); overflow: hidden; animation: rise .22s var(--ease) both; }
.compose-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px;
    background: linear-gradient(135deg, var(--bordeaux), var(--bordeaux-2)); color: #fff; }
.compose-head strong { font-size: 16px; }
.cc-x { width: 32px; height: 32px; border-radius: 9px; border: none; background: rgba(255,255,255,.18); color: #fff; cursor: pointer; font-size: 15px; }
.cc-x:hover { background: rgba(255,255,255,.3); }
.compose-tabs { display: flex; padding: 10px 12px 0; gap: 6px; }
.cc-tab { flex: 1; border: 1px solid var(--line); background: var(--surface); cursor: pointer; padding: 10px; border-radius: 11px;
    font-weight: 700; font-size: 13.5px; color: var(--ink-2); }
.cc-tab.is-active { background: var(--info-bg); border-color: transparent; color: var(--bordeaux); }
.cc-group-name { padding: 12px 14px 0; }
.cc-group-name input, .cc-search input { width: 100%; padding: 11px 14px; border: 1px solid var(--line); border-radius: 11px; font-size: 14px; background: var(--surface); }
.cc-group-name input:focus, .cc-search input:focus { outline: none; border-color: var(--bordeaux); }
.cc-selected { display: flex; flex-wrap: wrap; gap: 6px; padding: 12px 14px 0; }
.cc-chip { background: var(--info-bg); color: var(--bordeaux); border-radius: var(--r-pill); padding: 5px 11px; font-size: 12.5px; font-weight: 700; cursor: pointer; }
.cc-chip:hover { background: var(--line); }
.cc-hint { color: var(--ink-3); font-size: 12.5px; padding: 2px; }
.cc-search { position: relative; padding: 12px 14px; }
.cc-search span { position: absolute; left: 26px; top: 50%; transform: translateY(-50%); opacity: .5; font-size: 13px; }
.cc-search input { padding-left: 36px; }
.cc-list { flex: 1; overflow-y: auto; padding: 4px 8px 8px; }
.cc-item { display: flex; align-items: center; gap: 11px; width: 100%; text-align: left; border: none; background: none; cursor: pointer;
    padding: 9px 10px; border-radius: 12px; }
.cc-item:hover { background: var(--surface-2); }
.cc-item.sel { background: var(--info-bg); }
.cc-tx { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.25; }
.cc-tx b { font-size: 14px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cc-tx small { font-size: 11.5px; color: var(--ink-3); }
.cc-go { color: var(--ink-3); font-size: 13px; font-weight: 700; flex: 0 0 auto; }
.cc-check { width: 24px; height: 24px; flex: 0 0 auto; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; color: #fff; font-size: 13px; font-weight: 800; }
.cc-check.on { background: var(--emeraude); border-color: var(--emeraude); }
.cc-empty, .cc-loading { padding: 26px; text-align: center; color: var(--ink-3); font-size: 13.5px; }
.cc-foot { padding: 12px 14px; border-top: 1px solid var(--line); }
.cc-foot .btn[disabled] { opacity: .5; cursor: not-allowed; }

/* Bottom-sheet sur mobile */
@media (max-width: 560px) {
    .compose-ov { padding: 0; align-items: flex-end; }
    .compose-card { max-width: none; max-height: 92dvh; border-radius: var(--r-lg) var(--r-lg) 0 0; }
}

/* ============================================================
   FIL D'ACTUALITÉ (Annonces) — mise en page 2 colonnes + finitions
   ============================================================ */
.feed-layout { display: grid; grid-template-columns: minmax(0, 640px) 340px; gap: 28px; align-items: start; justify-content: center; }
.feed-main { min-width: 0; }
.feed-side { position: sticky; top: 88px; display: flex; flex-direction: column; gap: 16px; }

/* Colonne latérale */
.side-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; box-shadow: var(--sh-1); }
.side-title { font-weight: 800; font-size: 14px; color: var(--ink); margin-bottom: 12px; }
.une-item { display: flex; gap: 10px; align-items: flex-start; padding: 9px 0; border-top: 1px solid var(--line-2); text-decoration: none; }
.une-item:first-of-type { border-top: none; padding-top: 0; }
.une-dot { font-size: 15px; flex: 0 0 auto; }
.une-tx { display: flex; flex-direction: column; min-width: 0; }
.une-t { font-weight: 700; font-size: 13.5px; color: var(--ink); line-height: 1.3; }
.une-item:hover .une-t { color: var(--bordeaux); }
.une-s { font-size: 11.5px; color: var(--ink-3); margin-top: 2px; }
.side-empty { color: var(--ink-3); font-size: 13px; margin: 0; }
.side-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ss { background: var(--surface-2); border-radius: 12px; padding: 12px; text-align: center; }
.ss-n { display: block; font-size: 22px; font-weight: 800; color: var(--bordeaux); font-family: var(--serif); }
.ss-l { font-size: 11.5px; color: var(--ink-2); }
.side-tip { font-size: 13px; color: var(--ink-2); line-height: 1.5; background: var(--info-bg); border-color: transparent; }
.side-tip strong { color: var(--bordeaux); }

/* En-tête de publication */
.ph-txt { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.ph-titre { font-family: var(--serif); font-size: 16px; color: var(--ink); }
.ph-nom { font-weight: 700; font-size: 14px; color: var(--ink); }
.ph-date { font-size: 12px; color: var(--ink-3); }

/* Annonce officielle : bandeau (pas de bordure latérale) */
.post-ribbon { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 12px; padding: 4px 12px; border-radius: var(--r-pill);
    background: linear-gradient(135deg, var(--or), var(--or-2)); color: #3E2723; font-weight: 800; font-size: 11.5px; letter-spacing: .02em; }
.post.annonce { border-color: var(--or); background: linear-gradient(180deg, #FFFDF7, var(--surface)); }

/* Média */
.post-media-w { display: block; margin-top: 12px; }

/* Barre d'actions */
.post-actions { display: flex; align-items: center; gap: 10px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.post-actions form { display: inline-flex; margin: 0; }
.post-actions-end { margin-left: auto; display: flex; gap: 10px; }
.react-btn, .act-btn { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); background: var(--surface); cursor: pointer;
    padding: 7px 14px; border-radius: var(--r-pill); font-weight: 700; font-size: 14px; color: var(--ink-2); font-family: inherit; transition: background .15s, color .15s, border-color .15s; }
.act-btn:hover { background: var(--surface-2); color: var(--bordeaux); }
.act-btn.danger { padding: 7px 11px; }
.act-btn.danger:hover { color: var(--danger); border-color: var(--danger); }
.react-btn:hover { border-color: #E0245E; color: #E0245E; }
.react-btn .heart { font-size: 16px; line-height: 1; filter: grayscale(1); opacity: .55; transition: filter .15s, opacity .15s; }
.react-btn.on { border-color: #E0245E; background: #FDEEF3; color: #E0245E; }
.react-btn.on .heart { filter: none; opacity: 1; }
.react-btn.pop .heart { animation: heartpop .34s var(--ease); }
@keyframes heartpop { 0% { transform: scale(1); } 35% { transform: scale(1.5); } 60% { transform: scale(.9); } 100% { transform: scale(1); } }

/* Commentaires */
.post-comments { display: none; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.post-comments.open { display: block; animation: fade .2s var(--ease) both; }
.comment { display: flex; gap: 10px; padding: 7px 0; }
.comment-b { background: var(--surface-2); border-radius: 14px; padding: 9px 13px; min-width: 0; }
.comment-txt { font-size: 14px; color: var(--ink); word-wrap: break-word; }
.comment-txt strong { color: var(--bordeaux); margin-right: 5px; }
.comment-date { font-size: 11px; color: var(--ink-3); margin-top: 3px; }
.comment-form { display: flex; align-items: center; gap: 9px; margin-top: 10px; }
.comment-form input[type=text] { flex: 1; min-width: 0; border: 1px solid var(--line); border-radius: var(--r-pill); padding: 10px 15px; font-size: 14px; background: var(--surface-2); }
.comment-form input[type=text]:focus { outline: none; border-color: var(--bordeaux); background: var(--surface); }

@media (max-width: 1000px) {
    .feed-layout { grid-template-columns: 1fr; max-width: 640px; }
    .feed-side { display: none; }
}
@media (prefers-reduced-motion: reduce) {
    .react-btn.pop .heart { animation: none; }
}

/* Aperçu média du composer (photo ou vidéo) + vidéo dans le fil */
.composer-preview-w { margin-top: 10px; }
.composer-preview-w img, .composer-preview-w video { max-width: 280px; max-height: 240px; border-radius: 12px; display: block; background: #000; }
video.post-media { width: 100%; max-height: 520px; border-radius: 14px; margin-top: 12px; display: block; background: #000; border: 1px solid var(--line); }

/* Colonne latérale : prochains événements */
.ev-item { display: flex; gap: 10px; align-items: flex-start; padding: 9px 0; border-top: 1px solid var(--line-2); text-decoration: none; }
.ev-item:first-of-type { border-top: none; padding-top: 0; }
.ev-ico { font-size: 17px; flex: 0 0 auto; }
.ev-tx { display: flex; flex-direction: column; min-width: 0; }
.ev-t { font-weight: 700; font-size: 13.5px; color: var(--ink); line-height: 1.3; }
.ev-item:hover .ev-t { color: var(--bordeaux); }
.ev-s { font-size: 11.5px; color: var(--ink-3); margin-top: 2px; }

/* ============================================================
   ANNONCES — onglets, réactions multi-emoji, badges, lightbox
   ============================================================ */
.feed-tabs { display: flex; gap: 6px; margin-bottom: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-pill); padding: 5px; box-shadow: var(--sh-1); overflow-x: auto; }
.ft { flex: 1; white-space: nowrap; border: none; background: none; cursor: pointer; padding: 9px 14px; border-radius: var(--r-pill); font-weight: 700; font-size: 13.5px; color: var(--ink-2); transition: background .15s, color .15s; }
.ft:hover { color: var(--bordeaux); }
.ft.is-active { background: var(--bordeaux); color: #fff; }
.app--admin .ft.is-active { background: var(--emeraude); }

.role-badge { display: inline-block; margin-left: 7px; padding: 1px 8px; border-radius: var(--r-pill); background: var(--info-bg); color: var(--bordeaux); font-size: 10.5px; font-weight: 800; vertical-align: 1px; }

.react-bar { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.rb-pill { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-pill); padding: 3px 10px; font-size: 13px; font-weight: 700; color: var(--ink-2); }

.react-wrap { position: relative; }
.react-face { font-size: 16px; line-height: 1; display: inline-block; }
.react-btn.pop .react-face { animation: heartpop .34s var(--ease); }
.react-picker { position: absolute; bottom: calc(100% + 8px); left: 0; display: flex; gap: 4px; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-pill); box-shadow: var(--sh-2); z-index: 30; animation: rise .16s var(--ease) both; }
.react-picker[hidden] { display: none; }
.react-picker button { border: none; background: none; cursor: pointer; font-size: 22px; line-height: 1; padding: 4px; border-radius: 50%; transition: transform .12s; }
.react-picker button:hover { transform: scale(1.4); }

img.post-media.clickable { cursor: zoom-in; }
.lightbox { position: fixed; inset: 0; z-index: 500; background: rgba(15,10,8,.92); display: flex; align-items: center; justify-content: center; padding: 24px; animation: fade .2s var(--ease) both; }
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 96vw; max-height: 92vh; border-radius: 10px; box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.lb-x { position: absolute; top: 18px; right: 22px; color: #fff; font-size: 26px; cursor: pointer; opacity: .85; }
.lb-x:hover { opacity: 1; }
.feed-empty { text-align: center; color: var(--ink-3); padding: 30px; font-size: 14px; }

/* Fenêtre d'aide à l'installation PWA (instructions pas-à-pas) */
.pwa-help { position: fixed; inset: 0; z-index: 500; background: rgba(28,20,16,.55); backdrop-filter: blur(3px);
    display: flex; align-items: center; justify-content: center; padding: 20px; animation: fade .2s var(--ease) both; }
.pwa-help-card { position: relative; width: 100%; max-width: 380px; background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--sh-3); padding: 26px 22px; animation: rise .22s var(--ease) both; }
.pwa-help-x { position: absolute; top: 12px; right: 12px; width: 32px; height: 32px; border-radius: 9px; border: none; background: var(--surface-2); cursor: pointer; font-size: 14px; color: var(--ink-2); }
.pwa-help-x:hover { background: var(--line); }
.pwa-help-ic { font-size: 36px; text-align: center; }
.pwa-help-card h3 { text-align: center; margin: 6px 0 16px; color: var(--bordeaux); font-size: 18px; }
.pwa-help-card ol { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 11px; color: var(--ink); font-size: 14px; line-height: 1.45; }
.pwa-help-card ol b { color: var(--bordeaux); }

/* Mois avant le début officiel des cotisations */
.mois-cell.avant { background: var(--surface-2); border-style: dashed; color: var(--ink-3); opacity: .6; }
.grille-legende i.lg.avant { background: transparent; border: 1px dashed var(--ink-3); }

/* Bannière permanente : contact officiel des dépôts de cotisation.
   Visible en haut de chaque page de l'espace membre — ne doit jamais être masquée. */
.depot-banner {
    display: flex; align-items: center; gap: 14px;
    margin: 0 0 18px; padding: 14px 18px;
    border-radius: var(--r-card, 16px);
    background: linear-gradient(135deg, var(--or), var(--or-2));
    color: #fff; box-shadow: 0 10px 24px rgba(176,135,47,.32);
    border: 1px solid rgba(255,255,255,.25);
}
.depot-banner:hover { color: #fff; filter: brightness(1.03); }
.depot-banner .db-ico {
    flex: 0 0 auto; width: 44px; height: 44px; border-radius: 50%;
    display: grid; place-items: center; font-size: 22px;
    background: rgba(255,255,255,.22);
}
.depot-banner .db-txt { display: flex; flex-direction: column; line-height: 1.25; flex: 1 1 auto; min-width: 0; }
.depot-banner .db-lbl { font-size: 12.5px; font-weight: 700; letter-spacing: .02em; opacity: .95; text-transform: uppercase; }
.depot-banner .db-name { font-size: 17px; font-weight: 800; }
.depot-banner .db-tel { font-size: 20px; font-weight: 800; letter-spacing: .06em; }
.depot-banner .db-cta {
    flex: 0 0 auto; padding: 9px 18px; border-radius: var(--r-pill, 999px);
    background: #fff; color: var(--or-2); font-weight: 800; font-size: 14px;
    box-shadow: 0 4px 12px rgba(0,0,0,.15);
}
@media (max-width: 560px) {
    .depot-banner { gap: 11px; padding: 12px 14px; }
    .depot-banner .db-ico { width: 38px; height: 38px; font-size: 19px; }
    .depot-banner .db-tel { font-size: 18px; }
    .depot-banner .db-cta { padding: 8px 13px; font-size: 13px; }
}
