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

/* ============================ 1. TOKENS ============================ */
:root {
  --brand: #0F766E;
  --brand-dark: #0B5C56;
  --brand-soft: #E7F5F3;
  --brand-ink: #06403C;
  --accent: #F59E0B;
  --accent-soft: #FEF3C7;

  --ink: #0B1220;
  --ink-soft: #475569;
  --ink-mute: #7C8A9A;
  --line: #E5E9EF;
  --line-soft: #F0F3F7;
  --bg: #F5F7FA;
  --surface: #FFFFFF;
  --surface-2: #FAFBFC;

  --danger: #DC2626;
  --danger-soft: #FEF2F2;
  --success: #15803D;
  --success-soft: #ECFDF5;
  --warn: #B45309;
  --warn-soft: #FFFBEB;

  --r-xs: 8px;
  --r-sm: 10px;
  --r: 14px;
  --r-lg: 20px;
  --r-xl: 26px;
  --r-pill: 999px;

  --sh-1: 0 1px 2px rgba(11, 18, 32, .05), 0 1px 3px rgba(11, 18, 32, .04);
  --sh-2: 0 4px 14px rgba(11, 18, 32, .07);
  --sh-3: 0 20px 44px rgba(11, 18, 32, .14);

  --font-display: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

  --sidebar-w: 258px;
  --topbar-h: 66px;
}

/* ============================ 2. BASE ============================ */
*, *::before, *::after { box-sizing: border-box; }

[hidden] { display: none !important; }
.is-hidden { display: none !important; }

html, body { margin: 0; padding: 0; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5 {
  font-family: var(--font-display);
  color: var(--ink);
  margin: 0 0 .4em;
  line-height: 1.22;
  letter-spacing: -.015em;
}
h1 { font-size: 1.75rem; font-weight: 800; }
h2 { font-size: 1.3rem; font-weight: 700; }
h3 { font-size: 1.08rem; font-weight: 700; }
h4 { font-size: .98rem; font-weight: 700; }
p { margin: 0 0 .9em; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
strong { font-weight: 700; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #D3DAE3; border-radius: 999px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #BCC6D2; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ======================= 3. UTILITAIRES ======================= */
.muted { color: var(--ink-mute); }
.soft { color: var(--ink-soft); }
.small { font-size: .82rem; }
.tiny { font-size: .74rem; }
.bold { font-weight: 700; }
.center { text-align: center; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.6rem; }
.mb-1 { margin-bottom: .5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.6rem; }
.row { display: flex; align-items: center; gap: .6rem; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: .8rem; flex-wrap: wrap; }
.row-wrap { flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: .85rem; }
.stack-sm { display: flex; flex-direction: column; gap: .5rem; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: .9rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: .9rem; }
.spacer { flex: 1; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* .mobile-only : masque uniquement sur grand ecran (voir media queries en fin de fichier) */
@media (max-width: 900px) {
  .desktop-only { display: none !important; }
}

/* ======================= 4. BOUTONS ======================= */
.btn {
  --btn-bg: var(--surface);
  --btn-fg: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .68rem 1.05rem;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-weight: 600;
  font-size: .9rem;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .18s ease, background .18s ease, border-color .18s ease;
  white-space: nowrap;
  line-height: 1.2;
}
.btn:hover { box-shadow: var(--sh-1); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .6; cursor: not-allowed; transform: none; }
.btn svg { flex: 0 0 auto; }

.btn-primary { --btn-bg: var(--brand); --btn-fg: #fff; border-color: var(--brand); box-shadow: 0 2px 10px rgba(15, 118, 110, .24); }
.btn-primary:hover { --btn-bg: var(--brand-dark); border-color: var(--brand-dark); }
.btn-ghost { --btn-bg: transparent; border-color: transparent; color: var(--ink-soft); }
.btn-ghost:hover { --btn-bg: var(--line-soft); color: var(--ink); }
.btn-outline { --btn-bg: #fff; border-color: var(--line); }
.btn-outline:hover { border-color: #C9D3DE; background: var(--surface-2); }
.btn-soft { --btn-bg: var(--brand-soft); --btn-fg: var(--brand-ink); border-color: transparent; }
.btn-soft:hover { --btn-bg: #D6EDEA; }
.btn-danger { --btn-bg: var(--danger-soft); --btn-fg: var(--danger); border-color: #FBD5D5; }
.btn-danger:hover { --btn-bg: #FDE8E8; }
.btn-success { --btn-bg: var(--success-soft); --btn-fg: var(--success); border-color: #CCEBD9; }
.btn-accent { --btn-bg: var(--accent-soft); --btn-fg: #92400E; border-color: #FDE68A; }
.btn-block { width: 100%; }
.btn-sm { padding: .42rem .72rem; font-size: .8rem; border-radius: var(--r-xs); }
.btn-lg { padding: .85rem 1.5rem; font-size: .98rem; border-radius: var(--r); }
.btn-icon { padding: .5rem; width: 38px; height: 38px; }
.btn-icon.btn-sm { width: 32px; height: 32px; padding: .3rem; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-soft);
  cursor: pointer;
  transition: background .16s ease, color .16s ease;
}
.icon-btn:hover { background: var(--line-soft); color: var(--ink); }

/* ======================= 5. FORMULAIRES ======================= */
.field { display: flex; flex-direction: column; gap: .34rem; margin-bottom: .85rem; }
.field label { font-size: .84rem; font-weight: 600; color: var(--ink-soft); }
.field .opt { color: var(--ink-mute); font-weight: 400; }
.field input, .field select, .field textarea, .input {
  width: 100%;
  padding: .7rem .85rem;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  transition: border-color .16s ease, box-shadow .16s ease;
  font-size: .92rem;
}
.field textarea, .input-area { min-height: 110px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus, .input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, .12);
}
.field input::placeholder, .field textarea::placeholder { color: #A9B4C0; }
.hint { font-size: .78rem; color: var(--ink-mute); margin: .1rem 0 0; line-height: 1.45; }
.field-error { color: var(--danger); font-size: .78rem; }
.checkbox { display: flex; align-items: flex-start; gap: .55rem; font-size: .88rem; color: var(--ink-soft); }
.checkbox input { width: 18px; height: 18px; accent-color: var(--brand); margin-top: .1rem; flex: 0 0 auto; }

.search {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .5rem .8rem;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--ink-mute);
}
.search input { border: 0; outline: none; background: transparent; flex: 1; padding: .18rem 0; min-width: 0; }

/* ======================= 6. BADGES / CHIPS / ALERTES ======================= */
.badge {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .2rem .6rem;
  border-radius: var(--r-pill);
  font-size: .73rem;
  font-weight: 600;
  background: var(--line-soft);
  color: var(--ink-soft);
  white-space: nowrap;
}
.badge-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-brand { background: var(--brand-soft); color: var(--brand-ink); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-soft { background: #EEF2F7; color: var(--ink-soft); }

.chips { display: flex; gap: .45rem; flex-wrap: wrap; }
.chip {
  padding: .4rem .8rem;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: .82rem;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
  transition: all .16s ease;
  white-space: nowrap;
}
.chip:hover { border-color: #C9D3DE; }
.chip.is-active { background: var(--brand); border-color: var(--brand); color: #fff; }
.chip .chip-n { opacity: .65; margin-left: .3rem; font-weight: 500; }

.alert {
  padding: .8rem 1rem;
  border-radius: var(--r-sm);
  font-size: .87rem;
  border: 1px solid transparent;
  margin-bottom: 1rem;
  line-height: 1.45;
}
.alert-error { background: var(--danger-soft); color: #991B1B; border-color: #FAD4D4; }
.alert-success { background: var(--success-soft); color: #14532D; border-color: #CBEBD9; }
.alert-info { background: var(--brand-soft); color: var(--brand-ink); border-color: #CDE9E6; }
.alert-warn { background: var(--warn-soft); color: #92400E; border-color: #FDE68A; }

/* ======================= 7. AVATARS ======================= */
.avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: .88rem;
  color: #fff;
  flex: 0 0 auto;
  background: var(--brand);
  letter-spacing: .5px;
  user-select: none;
}
.avatar-sm { width: 32px; height: 32px; font-size: .74rem; }
.avatar-lg { width: 56px; height: 56px; font-size: 1.12rem; }
.avatar-xl { width: 76px; height: 76px; font-size: 1.5rem; }
.avatar-me { box-shadow: 0 0 0 3px var(--brand-soft); }
.avatar-wrap { position: relative; display: inline-flex; }
.presence { position: absolute; right: -1px; bottom: -1px; width: 12px; height: 12px; border-radius: 50%; border: 2px solid #fff; background: #22C55E; }

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(140deg, var(--brand) 0%, #14A097 100%);
  color: #fff;
  flex: 0 0 auto;
  box-shadow: 0 6px 16px rgba(15, 118, 110, .26);
}
.brand-mark-lg { width: 52px; height: 52px; border-radius: 16px; }
.brand-name { font-family: var(--font-display); font-weight: 800; font-size: 1.06rem; letter-spacing: -.02em; }

/* ======================= 8. PAGE AUTHENTIFICATION ======================= */
.auth-body { background: var(--bg); min-height: 100vh; }
.auth-wrap { display: grid; grid-template-columns: minmax(320px, 44%) 1fr; min-height: 100vh; }

.auth-aside {
  background: linear-gradient(155deg, #0F766E 0%, #0B5C56 55%, #083F3B 100%);
  color: #fff;
  padding: 3rem 3rem 2.4rem;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  position: relative;
  overflow: hidden;
}
.auth-aside::after {
  content: "";
  position: absolute;
  right: -120px;
  bottom: -140px;
  width: 380px;
  height: 380px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, .14) 0%, rgba(255, 255, 255, 0) 70%);
}
.auth-aside .brand-mark { background: rgba(255, 255, 255, .16); box-shadow: none; backdrop-filter: blur(4px); }
.auth-aside-title { color: #fff; font-size: 1.75rem; margin: .6rem 0 0; }
.auth-aside-text { color: rgba(255, 255, 255, .82); font-size: .95rem; max-width: 40ch; }
.auth-aside-list { list-style: none; margin: 1rem 0 0; padding: 0; display: flex; flex-direction: column; gap: .8rem; }
.auth-aside-list li { display: flex; align-items: flex-start; gap: .7rem; font-size: .92rem; color: rgba(255, 255, 255, .93); }
.aside-ico {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: rgba(255, 255, 255, .13);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  color: #fff;
}
.auth-aside-foot {
  margin-top: auto;
  padding-top: 1.4rem;
  border-top: 1px solid rgba(255, 255, 255, .18);
  font-size: .9rem;
  color: rgba(255, 255, 255, .8);
}
.auth-aside-foot strong { color: #fff; font-family: var(--font-display); font-size: 1.1rem; }

.auth-main { display: flex; align-items: center; justify-content: center; padding: 2.4rem 1.4rem; }
.auth-card { width: 100%; max-width: 440px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 2rem; box-shadow: var(--sh-2); }
.auth-head { display: flex; align-items: center; gap: .65rem; margin-bottom: 1.4rem; }
.auth-tabs { display: flex; gap: .3rem; padding: .3rem; background: var(--line-soft); border-radius: var(--r-pill); margin-bottom: 1.4rem; }
.auth-tab {
  flex: 1;
  padding: .55rem;
  border: 0;
  border-radius: var(--r-pill);
  background: transparent;
  font-weight: 600;
  font-size: .88rem;
  color: var(--ink-soft);
  cursor: pointer;
  transition: all .16s ease;
}
.auth-tab.is-active { background: var(--surface); color: var(--brand-ink); box-shadow: var(--sh-1); }
.auth-form .btn { margin-top: .4rem; }

/* ======================= 9. COQUILLE APPLICATION ======================= */
.app { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  background: #0B3B38;
  color: #fff;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 1.1rem .9rem;
  background-image: linear-gradient(180deg, #0D4440 0%, #0A3634 100%);
}
.sidebar-brand { display: flex; align-items: center; gap: .65rem; padding: .3rem .45rem 1.2rem; }
.sidebar-brand .brand-name { color: #fff; }
.sidebar-brand small { display: block; font-size: .72rem; color: rgba(255, 255, 255, .6); font-weight: 500; letter-spacing: 0; }
.sidebar .brand-mark { background: rgba(255, 255, 255, .14); box-shadow: none; }

.nav { display: flex; flex-direction: column; gap: .18rem; }
.nav-label { font-size: .68rem; text-transform: uppercase; letter-spacing: .12em; color: rgba(255, 255, 255, .45); padding: .9rem .6rem .35rem; font-weight: 600; }
.nav-item {
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .62rem .7rem;
  border-radius: var(--r-sm);
  color: rgba(255, 255, 255, .8);
  font-weight: 500;
  font-size: .9rem;
  cursor: pointer;
  transition: background .16s ease, color .16s ease;
  border: 0;
  background: transparent;
  width: 100%;
  text-align: left;
  text-decoration: none;
}
.nav-item:hover { background: rgba(255, 255, 255, .09); color: #fff; text-decoration: none; }
.nav-item.is-active { background: rgba(255, 255, 255, .15); color: #fff; font-weight: 600; }
.nav-item svg { flex: 0 0 auto; opacity: .9; }
.nav-count {
  margin-left: auto;
  background: var(--accent);
  color: #3F2A02;
  border-radius: var(--r-pill);
  font-size: .7rem;
  font-weight: 700;
  padding: .05rem .42rem;
  min-width: 20px;
  text-align: center;
}
.sidebar-foot { margin-top: auto; padding-top: .8rem; border-top: 1px solid rgba(255, 255, 255, .12); }
.sidebar-user { display: flex; align-items: center; gap: .6rem; padding: .5rem; border-radius: var(--r-sm); }
.sidebar-user .u-name { font-size: .87rem; font-weight: 600; color: #fff; line-height: 1.25; }
.sidebar-user .u-sub { font-size: .74rem; color: rgba(255, 255, 255, .6); }
.sidebar-user .btn-ghost { color: rgba(255, 255, 255, .7); }
.sidebar-user .btn-ghost:hover { background: rgba(255, 255, 255, .12); color: #fff; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: 0 1.4rem;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 40;
}
.topbar-title { font-size: 1.06rem; margin: 0; font-weight: 700; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: .5rem; }

.user-chip {
  display: flex;
  align-items: center;
  gap: .55rem;
  padding: .3rem .7rem .3rem .35rem;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--surface);
}
.user-chip .u-name { font-size: .84rem; font-weight: 600; line-height: 1.2; }
.user-chip .u-sub { font-size: .72rem; color: var(--ink-mute); }

.content { padding: 1.5rem 1.4rem 3rem; max-width: 1180px; width: 100%; margin: 0 auto; }
.view { animation: fade .28s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.2rem; }
.page-head h1 { margin: 0; }
.page-head p { margin: .2rem 0 0; color: var(--ink-mute); font-size: .9rem; }

.tabbar { display: none; }

/* ======================= 10. CARTES & STATS ======================= */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 1.15rem 1.2rem;
  box-shadow: var(--sh-1);
}
.card-flush { padding: 0; overflow: hidden; }
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .8rem;
  flex-wrap: wrap;
  margin-bottom: .95rem;
}
.card-head h2, .card-head h3 { margin: 0; }
.card-head p { margin: .15rem 0 0; font-size: .84rem; color: var(--ink-mute); }
.card-divider { height: 1px; background: var(--line-soft); margin: .95rem 0; }

.kpi { display: flex; flex-direction: column; gap: .3rem; }
.kpi-label { font-size: .76rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-mute); font-weight: 600; }
.kpi-value { font-family: var(--font-display); font-size: 1.75rem; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; }
.kpi-foot { font-size: .78rem; color: var(--ink-mute); }
.kpi-icon {
  width: 40px; height: 40px; border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--brand-soft); color: var(--brand-ink);
}
.stat-card { display: flex; align-items: flex-start; gap: .85rem; }
.stat-card .kpi { flex: 1; }
.stat-accent { background: var(--accent-soft); color: #92400E; }
.stat-danger { background: var(--danger-soft); color: var(--danger); }
.stat-soft { background: #EEF2F7; color: var(--ink-soft); }

/* ======================= 11. FIL D'ANNONCES ======================= */
.composer {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 1rem;
  box-shadow: var(--sh-1);
  margin-bottom: 1.1rem;
}
.composer-top { display: flex; gap: .75rem; align-items: center; }
.composer-fake {
  flex: 1;
  text-align: left;
  padding: .7rem .95rem;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink-mute);
  cursor: pointer;
  font-size: .9rem;
}
.composer-fake:hover { background: #F1F4F8; }

.post {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 1.05rem 1.15rem;
  box-shadow: var(--sh-1);
  transition: box-shadow .18s ease, border-color .18s ease;
}
.post:hover { box-shadow: var(--sh-2); border-color: #DDE4EC; }
.post.is-pinned { border-left: 3px solid var(--brand); }
.post-head { display: flex; align-items: flex-start; gap: .7rem; margin-bottom: .6rem; }
.post-author { font-weight: 600; font-size: .9rem; line-height: 1.3; }
.post-meta { font-size: .76rem; color: var(--ink-mute); display: flex; align-items: center; gap: .35rem; flex-wrap: wrap; }
.post-title { font-size: 1.05rem; margin: .1rem 0 .35rem; cursor: pointer; }
.post-title:hover { color: var(--brand); }
.post-body {
  color: var(--ink-soft);
  font-size: .92rem;
  white-space: pre-wrap;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
}
.post-actions {
  display: flex;
  align-items: center;
  gap: .3rem;
  margin-top: .85rem;
  padding-top: .7rem;
  border-top: 1px solid var(--line-soft);
  flex-wrap: wrap;
}
.act {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .35rem .6rem;
  border-radius: var(--r-pill);
  border: 0;
  background: transparent;
  color: var(--ink-mute);
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .16s ease, color .16s ease;
}
.act:hover { background: var(--line-soft); color: var(--ink); }
.act.is-on { color: var(--brand); background: var(--brand-soft); }
.act.is-on svg { color: var(--brand); }
.act.danger:hover { color: var(--danger); background: var(--danger-soft); }

.comments { margin-top: .9rem; padding-top: .85rem; border-top: 1px solid var(--line-soft); display: flex; flex-direction: column; gap: .8rem; }
.comment { display: flex; gap: .6rem; }
.comment-body { flex: 1; min-width: 0; }
.comment-bubble {
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-sm);
  padding: .55rem .75rem;
  font-size: .88rem;
  color: var(--ink-soft);
  white-space: pre-wrap;
  word-break: break-word;
}
.comment-name { font-size: .84rem; font-weight: 600; color: var(--ink); }
.comment-form { display: flex; gap: .55rem; align-items: flex-start; }
.comment-form input { flex: 1; }

.empty {
  text-align: center;
  padding: 2.6rem 1.2rem;
  color: var(--ink-mute);
}
.empty-ico {
  width: 52px; height: 52px; border-radius: 16px;
  background: var(--line-soft); color: var(--ink-mute);
  display: inline-flex; align-items: center; justify-content: center;
  margin-bottom: .7rem;
}
.empty h3 { margin: 0 0 .25rem; color: var(--ink); }
.empty p { margin: 0; font-size: .88rem; }

/* ======================= 12. CHAT ======================= */
.chat-layout { display: grid; grid-template-columns: 310px 1fr; gap: 1rem; align-items: start; }
.chat-list { max-height: calc(100vh - 190px); overflow-y: auto; padding: .4rem; }
.chat-item {
  display: flex;
  gap: .7rem;
  align-items: center;
  padding: .65rem .7rem;
  border-radius: var(--r-sm);
  cursor: pointer;
  border: 1px solid transparent;
  transition: background .16s ease;
  text-align: left;
  width: 100%;
  background: transparent;
}
.chat-item:hover { background: var(--surface-2); }
.chat-item.is-active { background: var(--brand-soft); border-color: #CFE9E6; }
.chat-item-main { flex: 1; min-width: 0; }
.chat-item-name { font-size: .88rem; font-weight: 600; display: flex; align-items: center; gap: .4rem; }
.chat-item-prev { font-size: .79rem; color: var(--ink-mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-item-time { font-size: .7rem; color: var(--ink-mute); flex: 0 0 auto; }
.unread-pill { background: var(--brand); color: #fff; font-size: .68rem; font-weight: 700; border-radius: var(--r-pill); padding: .05rem .4rem; }

.thread { display: flex; flex-direction: column; height: calc(100vh - 190px); min-height: 420px; }
.thread-head { display: flex; align-items: center; gap: .7rem; padding: .8rem 1rem; border-bottom: 1px solid var(--line-soft); }
.thread-body { flex: 1; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: .7rem; background: var(--surface-2); }
.thread-foot { padding: .75rem; border-top: 1px solid var(--line-soft); background: var(--surface); }
.thread-foot form { display: flex; gap: .55rem; align-items: flex-end; }
.thread-foot textarea { flex: 1; min-height: 44px; max-height: 120px; resize: none; padding: .65rem .8rem; border-radius: var(--r-sm); border: 1px solid var(--line); }

.msg { display: flex; gap: .55rem; max-width: 78%; }
.msg.is-mine { margin-left: auto; flex-direction: row-reverse; }
.msg-bubble {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px 14px 14px 4px;
  padding: .55rem .8rem;
  font-size: .89rem;
  color: var(--ink);
  white-space: pre-wrap;
  word-break: break-word;
}
.msg.is-mine .msg-bubble { background: var(--brand); border-color: var(--brand); color: #fff; border-radius: 14px 14px 4px 14px; }
.msg-foot { font-size: .68rem; color: var(--ink-mute); margin-top: .25rem; }
.msg.is-mine .msg-foot { text-align: right; }
.msg-name { font-size: .74rem; font-weight: 600; color: var(--ink-soft); margin-bottom: .18rem; }
.day-sep { text-align: center; font-size: .72rem; color: var(--ink-mute); margin: .4rem 0; }
.day-sep span { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-pill); padding: .15rem .7rem; }

/* ======================= 13. VOISINS ======================= */
.people-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .9rem; }
.person {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 1.1rem;
  text-align: center;
  box-shadow: var(--sh-1);
  transition: transform .16s ease, box-shadow .18s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .3rem;
}
.person:hover { transform: translateY(-2px); box-shadow: var(--sh-2); }
.person h4 { margin: .45rem 0 0; font-size: .98rem; }
.person .bio { font-size: .82rem; color: var(--ink-mute); line-height: 1.45; min-height: 2.4em; }
.person .row { width: 100%; justify-content: center; margin-top: .5rem; }
.person.is-suspended { opacity: .72; }
.person.is-pending { border-style: dashed; }

/* ======================= 14. MODALES / TOASTS ======================= */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(11, 18, 32, .5);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.1rem;
  z-index: 200;
  animation: fade .18s ease;
}
.modal {
  background: var(--surface);
  border-radius: var(--r-lg);
  width: 100%;
  max-width: 620px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--sh-3);
  animation: pop .22s ease;
}
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
.modal-head { display: flex; align-items: flex-start; gap: .8rem; padding: 1.15rem 1.3rem .85rem; border-bottom: 1px solid var(--line-soft); position: sticky; top: 0; background: var(--surface); z-index: 2; }
.modal-head h2, .modal-head h3 { margin: 0; }
.modal-body { padding: 1.15rem 1.3rem; }
.modal-foot { padding: .95rem 1.3rem 1.15rem; border-top: 1px solid var(--line-soft); display: flex; gap: .6rem; justify-content: flex-end; flex-wrap: wrap; }
.modal-close { margin-left: auto; }

.toasts { position: fixed; right: 1rem; bottom: 1rem; display: flex; flex-direction: column; gap: .5rem; z-index: 300; max-width: min(360px, calc(100vw - 2rem)); }
.toast {
  background: #111C2E;
  color: #fff;
  padding: .75rem .95rem;
  border-radius: var(--r-sm);
  font-size: .87rem;
  box-shadow: var(--sh-3);
  display: flex;
  gap: .6rem;
  align-items: flex-start;
  animation: slideIn .22s ease;
}
.toast-success { background: #0F5132; }
.toast-error { background: #7F1D1D; }
@keyframes slideIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }

/* ======================= 15. TABLEAUX (ADMIN) ======================= */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: .88rem; min-width: 620px; }
table.data th {
  text-align: left;
  font-size: .74rem;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--ink-mute);
  font-weight: 600;
  padding: .7rem .8rem;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
  white-space: nowrap;
}
table.data td { padding: .75rem .8rem; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
table.data tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover { background: var(--surface-2); }
table.data .cell-main { font-weight: 600; }
table.data .cell-sub { font-size: .78rem; color: var(--ink-mute); }
.table-actions { display: flex; gap: .3rem; flex-wrap: wrap; }

/* ======================= 16. GRAPHIQUES ======================= */
.chart-box { position: relative; height: 260px; }
.bars { display: flex; align-items: flex-end; gap: clamp(6px, 1.6vw, 18px); height: 200px; padding: 0 .2rem; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: .3rem; height: 100%; }
.bar-stack { width: 100%; max-width: 46px; display: flex; flex-direction: column; justify-content: flex-end; gap: 2px; height: 100%; }
.bar-seg { border-radius: 4px; min-height: 3px; transition: height .4s ease; }
.bar-posts { background: var(--brand); }
.bar-comments { background: #5EEAD4; }
.bar-messages { background: var(--accent); }
.bar-label { font-size: .72rem; color: var(--ink-mute); }
.legend { display: flex; gap: .9rem; flex-wrap: wrap; font-size: .78rem; color: var(--ink-soft); }
.legend span { display: inline-flex; align-items: center; gap: .35rem; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

.donut-wrap { display: flex; align-items: center; gap: 1.4rem; flex-wrap: wrap; }
.donut { width: 150px; height: 150px; flex: 0 0 auto; }
.donut-legend { display: flex; flex-direction: column; gap: .4rem; font-size: .84rem; }
.donut-legend div { display: flex; align-items: center; gap: .5rem; }
.donut-legend i { width: 10px; height: 10px; border-radius: 50%; }

.progress { height: 7px; background: var(--line-soft); border-radius: 999px; overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--brand); border-radius: 999px; }

.rank-row { display: flex; align-items: center; gap: .7rem; padding: .55rem 0; border-bottom: 1px solid var(--line-soft); }
.rank-row:last-child { border-bottom: 0; }
.rank-num {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--line-soft); color: var(--ink-soft);
  font-size: .74rem; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
  flex: 0 0 auto;
}
.rank-row:first-child .rank-num { background: var(--accent-soft); color: #92400E; }

.timeline { display: flex; flex-direction: column; gap: .75rem; }
.timeline-item { display: flex; gap: .7rem; align-items: flex-start; }
.timeline-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--brand); margin-top: .45rem; flex: 0 0 auto; }
.timeline-body { flex: 1; min-width: 0; }

.admin-tabs { display: flex; gap: .4rem; overflow-x: auto; padding-bottom: .35rem; margin-bottom: 1.2rem; border-bottom: 1px solid var(--line); }
.admin-tab {
  padding: .55rem .9rem;
  border: 0;
  background: transparent;
  font-weight: 600;
  font-size: .88rem;
  color: var(--ink-mute);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.admin-tab:hover { color: var(--ink); }
.admin-tab.is-active { color: var(--brand-ink); border-bottom-color: var(--brand); }

/* ======================= 17. PAGE PUBLIQUE (INDEX) ======================= */
.site-head {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-head-inner { max-width: 1120px; margin: 0 auto; padding: .85rem 1.3rem; display: flex; align-items: center; gap: 1.1rem; }
.site-nav { display: flex; gap: 1.2rem; margin-left: auto; font-size: .9rem; font-weight: 500; }
.site-nav a { color: var(--ink-soft); }
.site-nav a:hover { color: var(--brand); text-decoration: none; }

.hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(160deg, #0F766E 0%, #0B5C56 60%, #07332F 100%);
  color: #fff;
  padding: 4.2rem 1.3rem 4.6rem;
}
.hero::after {
  content: "";
  position: absolute;
  top: -180px;
  right: -160px;
  width: 560px;
  height: 560px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, .13) 0%, rgba(255, 255, 255, 0) 70%);
}
.hero-inner { max-width: 1120px; margin: 0 auto; display: grid; grid-template-columns: 1.05fr .95fr; gap: 3rem; align-items: center; position: relative; z-index: 1; }
.hero h1 { color: #fff; font-size: clamp(1.9rem, 4vw, 2.9rem); margin-bottom: .7rem; }
.hero p.lead { color: rgba(255, 255, 255, .88); font-size: 1.06rem; max-width: 52ch; }
.hero-actions { display: flex; gap: .7rem; flex-wrap: wrap; margin-top: 1.3rem; }
.hero .btn-primary { --btn-bg: #fff; --btn-fg: var(--brand-ink); border-color: #fff; box-shadow: 0 10px 26px rgba(0, 0, 0, .18); }
.hero .btn-outline { --btn-bg: rgba(255, 255, 255, .1); --btn-fg: #fff; border-color: rgba(255, 255, 255, .35); }
.hero-visual { background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .18); border-radius: var(--r-lg); padding: 1.1rem; backdrop-filter: blur(6px); }
.mock-post { background: rgba(255, 255, 255, .96); border-radius: var(--r-sm); padding: .85rem .95rem; margin-bottom: .6rem; color: var(--ink); }
.mock-post:last-child { margin-bottom: 0; }
.mock-line { height: 8px; border-radius: 999px; background: #E3E9F0; margin-top: .4rem; }
.hero-stats { display: flex; gap: 2rem; margin-top: 2rem; flex-wrap: wrap; }
.hero-stats strong { display: block; font-family: var(--font-display); font-size: 1.6rem; color: #fff; }
.hero-stats span { font-size: .84rem; color: rgba(255, 255, 255, .75); }

.section { padding: 3.6rem 1.3rem; }
.section-alt { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-inner { max-width: 1120px; margin: 0 auto; }
.section-head { text-align: center; max-width: 660px; margin: 0 auto 2.2rem; }
.section-head p { color: var(--ink-mute); }
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.1rem; }
.feature {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 1.4rem;
  box-shadow: var(--sh-1);
}
.feature-ico {
  width: 44px; height: 44px; border-radius: 13px;
  background: var(--brand-soft); color: var(--brand-ink);
  display: inline-flex; align-items: center; justify-content: center;
  margin-bottom: .8rem;
}
.feature h3 { margin-bottom: .35rem; }
.feature p { font-size: .9rem; color: var(--ink-mute); margin: 0; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.1rem; counter-reset: step; }
.step { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r); padding: 1.4rem; }
.step-num {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--brand); color: #fff;
  font-family: var(--font-display); font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
  margin-bottom: .7rem;
}

.install-card {
  background: linear-gradient(150deg, #0F766E 0%, #0B5C56 100%);
  color: #fff;
  border-radius: var(--r-lg);
  padding: 2.2rem;
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 2rem;
  align-items: center;
}
.install-card h2 { color: #fff; }
.install-card p { color: rgba(255, 255, 255, .85); }
.platforms { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: .8rem; }
.platform {
  display: inline-flex; align-items: center; gap: .5rem;
  background: rgba(255, 255, 255, .12);
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: var(--r-pill);
  padding: .42rem .85rem;
  font-size: .82rem;
  color: #fff;
}
.iphone-hint { background: rgba(0, 0, 0, .18); border-radius: var(--r-sm); padding: .8rem .95rem; font-size: .85rem; color: #fff; margin-top: .9rem; }

.site-foot { background: #0B1220; color: rgba(255, 255, 255, .72); padding: 2.6rem 1.3rem 1.6rem; }
.site-foot-inner { max-width: 1120px; margin: 0 auto; }
.site-foot h4 { color: #fff; font-size: .95rem; }
.site-foot a { color: rgba(255, 255, 255, .72); }
.site-foot a:hover { color: #fff; }
.site-foot-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 2rem; }
.foot-bottom { margin-top: 2rem; padding-top: 1.2rem; border-top: 1px solid rgba(255, 255, 255, .12); font-size: .82rem; display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }

/* ======================= 18. RESPONSIVE ======================= */
@media (max-width: 1080px) {
  .people-grid { grid-template-columns: repeat(2, 1fr); }
  .feature-grid, .steps { grid-template-columns: repeat(2, 1fr); }
  .hero-inner { grid-template-columns: 1fr; gap: 2rem; }
}

@media (max-width: 900px) {
  .content { padding: 1.1rem 1rem 5.6rem; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: 1fr; }

  .sidebar {
    position: fixed;
    z-index: 120;
    left: 0;
    top: 0;
    bottom: 0;
    height: 100dvh;
    transform: translateX(-102%);
    transition: transform .26s ease;
    box-shadow: var(--sh-3);
  }
  .sidebar.is-open { transform: none; }
  .drawer-backdrop {
    position: fixed; inset: 0; background: rgba(11, 18, 32, .45);
    z-index: 110; animation: fade .18s ease;
  }

  .tabbar {
    display: flex;
    position: fixed;
    left: 0; right: 0; bottom: 0;
    background: rgba(255, 255, 255, .96);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--line);
    padding: .35rem .3rem calc(.35rem + env(safe-area-inset-bottom));
    z-index: 100;
  }
  .tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .18rem;
    padding: .35rem .2rem;
    border: 0;
    background: transparent;
    color: var(--ink-mute);
    font-size: .68rem;
    font-weight: 600;
    cursor: pointer;
    position: relative;
    text-decoration: none;
  }
  .tab.is-active { color: var(--brand); }
  .tab .tab-badge {
    position: absolute;
    top: .1rem;
    right: 50%;
    margin-right: -18px;
    background: var(--accent);
    color: #3F2A02;
    border-radius: 999px;
    font-size: .62rem;
    font-weight: 700;
    padding: 0 .3rem;
    min-width: 16px;
  }

  .topbar { padding: 0 1rem; }
  .topbar-title { font-size: .98rem; }

  .chat-layout { grid-template-columns: 1fr; }
  .chat-list { max-height: none; }
  .thread { height: calc(100dvh - 250px); }
  .chat-list.is-hidden + .card { display: block; }
  .thread-wrap.is-hidden { display: none; }

  .msg { max-width: 88%; }
  .modal { max-height: 94vh; }
  .modal-foot { flex-direction: column-reverse; }
  .modal-foot .btn { width: 100%; }
}

@media (max-width: 700px) {
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-aside { display: none; }
  .auth-main { padding: 1.8rem 1.1rem; }
  .auth-card { padding: 1.5rem 1.25rem; }
  .people-grid { grid-template-columns: 1fr; }
  .feature-grid, .steps { grid-template-columns: 1fr; }
  .install-card { grid-template-columns: 1fr; padding: 1.6rem 1.3rem; }
  .site-foot-grid { grid-template-columns: 1fr; gap: 1.4rem; }
  .hero { padding: 3rem 1.1rem 3.4rem; }
  .section { padding: 2.6rem 1.1rem; }
  .site-nav { display: none; }
  .toasts { left: 1rem; right: 1rem; bottom: 5.2rem; max-width: none; }
}

@media (max-width: 560px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .hero-stats { gap: 1.2rem; }
  .hero-stats strong { font-size: 1.35rem; }
  .kpi-value { font-size: 1.5rem; }
  .post { padding: .95rem 1rem; }
  .card { padding: 1rem; }
  .brand-name { font-size: .98rem; }
  .modal-body, .modal-head, .modal-foot { padding-left: 1rem; padding-right: 1rem; }
}

/* ======================= 19. CORRECTIFS RESPONSIVE ======================= */
/* Les utilitaires mobile/desktop sont declares en fin de fichier pour primer
   sur les display des composants (.btn, .icon-btn, .tab...). */
@media (max-width: 900px) {
  .desktop-only { display: none !important; }
}
@media (min-width: 901px) {
  .mobile-only { display: none !important; }
}

/* Grilles a colonne principale + colonne laterale.
   Jamais cote a cote sous 1000px : sinon les blocs sont ecrases sur telephone. */
.grid-side {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 1.2rem;
  align-items: start;
}
.grid-side-wide {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 1.2rem;
  align-items: start;
}
.grid-profile {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.2rem;
  align-items: start;
}
@media (max-width: 1000px) {
  .grid-side,
  .grid-side-wide,
  .grid-profile {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

@media (max-width: 768px) {
  .grid-2 { grid-template-columns: 1fr; }
}
