/* ═══════════════════════════════════════════════════════════════
   NdoubockConnecting v5.0 — Design System
   Cabinet International Ndoubock Digital Expert · JCSN
   Thème : Bamiléké Contemporain · Vert profond & Or
   ═══════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@600;700;800&family=Lato:wght@300;400;700&family=Source+Code+Pro:wght@400;500&display=swap');

:root {
  /* Palette principale */
  --green-900: #052e16;
  --green-800: #0d6b39;
  --green-700: #15803d;
  --green-600: #16a34a;
  --green-400: #4ade80;
  --green-100: #dcfce7;
  --gold-700:  #92660a;
  --gold-600:  #b45309;
  --gold-500:  #c8963e;
  --gold-400:  #d4a843;
  --gold-100:  #fef9c3;
  --ivory:     #f5f0e8;
  --ivory-dark:#e8e0d0;
  --dark-950:  #050a05;
  --dark-900:  #0a0f0a;
  --dark-800:  #111811;
  --dark-700:  #1a261a;
  --dark-600:  #243024;
  --dark-500:  #2d3e2d;
  --slate-400: #94a3b8;
  --slate-300: #cbd5e1;
  --slate-200: #e2e8f0;
  --red-600:   #dc2626;
  --red-100:   #fee2e2;
  --blue-600:  #2563eb;
  --blue-100:  #dbeafe;
  --orange-600:#ea580c;
  --white:     #ffffff;

  /* Sémantique */
  --bg:        var(--dark-900);
  --bg-card:   var(--dark-800);
  --bg-raised: var(--dark-700);
  --border:    rgba(21,128,61,0.18);
  --border-gold: rgba(200,150,62,0.25);
  --text-primary: var(--ivory);
  --text-secondary: #a3b89a;
  --text-muted:   var(--slate-400);
  --accent:    var(--green-600);
  --accent-gold: var(--gold-500);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.4);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.5);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.6);
  --shadow-green: 0 0 24px rgba(22,163,74,0.2);
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body:    'Lato', system-ui, sans-serif;
  --font-mono:    'Source Code Pro', monospace;
  --nav-h:  64px;
  --sidebar-w: 240px;
  --transition: 0.22s cubic-bezier(0.4,0,0.2,1);
}

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: var(--green-400); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--gold-400); }
button { cursor: pointer; border: none; background: none; font-family: var(--font-body); }
input, textarea, select {
  font-family: var(--font-body);
  background: var(--dark-700);
  border: 1px solid var(--border);
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 14px;
  width: 100%;
  transition: border-color var(--transition), box-shadow var(--transition);
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--green-600);
  box-shadow: 0 0 0 3px rgba(22,163,74,0.15);
}
select option { background: var(--dark-700); }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--dark-800); }
::-webkit-scrollbar-thumb { background: var(--dark-500); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--green-700); }
::selection { background: var(--green-700); color: white; }

/* ── Utility Classes ── */
.hidden { display: none !important; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.text-sm { font-size: 13px; }
.text-xs { font-size: 11px; }
.text-muted { color: var(--text-muted); }
.text-green { color: var(--green-400); }
.text-gold { color: var(--gold-400); }
.text-red { color: var(--red-600); }
.font-mono { font-family: var(--font-mono); }
.w-full { width: 100%; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Animations ── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-20px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes pulse-green {
  0%, 100% { box-shadow: 0 0 0 0 rgba(22,163,74,0.4); }
  50%       { box-shadow: 0 0 0 8px rgba(22,163,74,0); }
}
@keyframes shimmer {
  from { background-position: -200% 0; }
  to   { background-position: 200% 0; }
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes countUp { from { opacity:0; transform:scale(0.8); } to { opacity:1; transform:scale(1); } }

.anim-fade-up { animation: fadeInUp 0.5s ease both; }
.anim-delay-1 { animation-delay: 0.1s; }
.anim-delay-2 { animation-delay: 0.2s; }
.anim-delay-3 { animation-delay: 0.3s; }
.anim-delay-4 { animation-delay: 0.4s; }
.anim-delay-5 { animation-delay: 0.5s; }

/* ── Skeleton Loader ── */
.skeleton {
  background: linear-gradient(90deg, var(--dark-700) 25%, var(--dark-600) 50%, var(--dark-700) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

/* ════════════════════════════════════
   OFFLINE BANNER
   ════════════════════════════════════ */
#offline-banner {
  display: none;
  background: linear-gradient(135deg, #92400e, #78350f);
  color: #fef3c7;
  text-align: center;
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 9999;
  border-bottom: 1px solid #d97706;
}
#offline-banner.show { display: block; }
body.offline-active { padding-top: 36px; }

/* ════════════════════════════════════
   TOPBAR NAVIGATION
   ════════════════════════════════════ */
#topbar {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: rgba(10,15,10,0.92);
  backdrop-filter: blur(16px) saturate(180%);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
  display: flex; align-items: center;
  padding: 0 20px;
  gap: 16px;
}
#topbar .logo {
  display: flex; align-items: center; gap: 10px;
  cursor: pointer;
  flex-shrink: 0;
}
#topbar .logo-icon {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--green-700), var(--green-900));
  border: 1.5px solid var(--green-600);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  box-shadow: var(--shadow-green);
}
#topbar .logo-text {
  font-family: var(--font-display);
  font-size: 16px; font-weight: 700;
  color: var(--ivory);
  line-height: 1.1;
}
#topbar .logo-sub {
  font-size: 9px; color: var(--text-secondary);
  letter-spacing: 1px; text-transform: uppercase;
}
.topbar-search {
  flex: 1; max-width: 340px;
  position: relative;
}
.topbar-search input {
  padding-left: 36px; font-size: 13px;
  height: 36px; border-radius: 18px;
  background: var(--dark-700);
}
.topbar-search .search-icon {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  color: var(--text-muted); font-size: 14px; pointer-events: none;
}
.topbar-spacer { flex: 1; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.notif-btn {
  position: relative;
  width: 36px; height: 36px;
  background: var(--dark-700);
  border: 1px solid var(--border);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; color: var(--text-secondary);
  transition: all var(--transition);
}
.notif-btn:hover { border-color: var(--green-600); color: var(--green-400); }
.notif-badge {
  position: absolute; top: -4px; right: -4px;
  background: var(--red-600);
  color: white; font-size: 9px; font-weight: 700;
  width: 16px; height: 16px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--dark-900);
}
.avatar-btn {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--green-700), var(--green-900));
  border: 2px solid var(--green-600);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: white;
  cursor: pointer; transition: all var(--transition);
}
.avatar-btn:hover { box-shadow: 0 0 0 4px rgba(22,163,74,0.2); transform: scale(1.05); }
#btn-login-top, #btn-register-top {
  padding: 8px 16px; border-radius: 8px;
  font-size: 13px; font-weight: 700; letter-spacing: 0.3px;
  transition: all var(--transition);
}
#btn-login-top {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
}
#btn-login-top:hover { border-color: var(--green-600); color: var(--green-400); }
#btn-register-top {
  background: linear-gradient(135deg, var(--green-700), var(--green-600));
  color: white;
  border: 1px solid var(--green-600);
  box-shadow: 0 2px 8px rgba(22,163,74,0.3);
}
#btn-register-top:hover { transform: translateY(-1px); box-shadow: 0 4px 16px rgba(22,163,74,0.4); }
.hamburger {
  width: 36px; height: 36px;
  background: var(--dark-700); border: 1px solid var(--border);
  border-radius: 8px; display: none;
  align-items: center; justify-content: center;
  font-size: 18px; color: var(--text-secondary);
}

/* ════════════════════════════════════
   SIDEBAR
   ════════════════════════════════════ */
#sidebar {
  position: fixed;
  top: var(--nav-h); bottom: 0; left: 0;
  width: var(--sidebar-w);
  background: var(--dark-800);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 900;
  display: flex; flex-direction: column;
  padding: 12px 0 20px;
  transition: transform var(--transition);
}
.sidebar-section { padding: 8px 12px 4px; }
.sidebar-label {
  font-size: 9px; font-weight: 700; letter-spacing: 1.5px;
  color: var(--text-muted); text-transform: uppercase;
  padding: 0 8px; margin-bottom: 4px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; margin: 1px 8px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 13.5px; font-weight: 400;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  user-select: none;
}
.nav-item .nav-icon { font-size: 16px; width: 20px; text-align: center; flex-shrink: 0; }
.nav-item .nav-label { flex: 1; }
.nav-item .nav-badge {
  background: var(--green-700); color: white;
  font-size: 9px; font-weight: 700;
  padding: 1px 6px; border-radius: 10px;
}
.nav-item:hover { background: var(--dark-700); color: var(--text-primary); }
.nav-item.active {
  background: linear-gradient(135deg, rgba(22,163,74,0.15), rgba(22,163,74,0.08));
  color: var(--green-400);
  border-left: 2px solid var(--green-600);
  margin-left: 6px;
}
.nav-item.active .nav-icon { filter: none; }
.nav-item.admin-only { color: var(--gold-500); }
.nav-item.admin-only:hover { background: rgba(200,150,62,0.1); }
.sidebar-divider {
  height: 1px; background: var(--border);
  margin: 8px 16px;
}
.sidebar-user {
  margin: auto 12px 0;
  background: var(--dark-700);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  display: flex; align-items: center; gap: 10px;
  cursor: pointer; transition: border-color var(--transition);
}
.sidebar-user:hover { border-color: var(--green-600); }
.sidebar-user .s-avatar {
  width: 32px; height: 32px;
  background: linear-gradient(135deg, var(--green-700), var(--green-900));
  border-radius: 50%; display: flex; align-items: center;
  justify-content: center; font-size: 12px; font-weight: 700; color: white;
  flex-shrink: 0;
}
.sidebar-user .s-name { font-size: 12px; font-weight: 700; color: var(--text-primary); }
.sidebar-user .s-role { font-size: 10px; color: var(--text-muted); }

/* ════════════════════════════════════
   MAIN CONTENT
   ════════════════════════════════════ */
#main {
  margin-left: var(--sidebar-w);
  margin-top: var(--nav-h);
  min-height: calc(100vh - var(--nav-h));
  transition: margin-left var(--transition);
}
.page { display: none; padding: 28px; animation: fadeInUp 0.4s ease; }
.page.active { display: block; }

/* ════════════════════════════════════
   PAGE HEADER
   ════════════════════════════════════ */
.page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 28px; flex-wrap: wrap; gap: 12px;
}
.page-title {
  font-family: var(--font-display);
  font-size: 26px; font-weight: 700;
  color: var(--text-primary); line-height: 1.2;
}
.page-subtitle { color: var(--text-muted); font-size: 13px; margin-top: 4px; }
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ════════════════════════════════════
   BUTTONS
   ════════════════════════════════════ */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 18px; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 700; letter-spacing: 0.3px;
  transition: all var(--transition); cursor: pointer;
  border: 1px solid transparent; white-space: nowrap;
}
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-lg { padding: 12px 24px; font-size: 15px; border-radius: var(--radius-md); }
.btn-primary {
  background: linear-gradient(135deg, var(--green-700), var(--green-600));
  color: white; border-color: var(--green-600);
  box-shadow: 0 2px 8px rgba(22,163,74,0.3);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 4px 16px rgba(22,163,74,0.45); }
.btn-primary:active { transform: translateY(0); }
.btn-gold {
  background: linear-gradient(135deg, var(--gold-700), var(--gold-500));
  color: white; border-color: var(--gold-500);
  box-shadow: 0 2px 8px rgba(200,150,62,0.3);
}
.btn-gold:hover { transform: translateY(-1px); box-shadow: 0 4px 16px rgba(200,150,62,0.4); }
.btn-outline {
  background: transparent; color: var(--text-secondary);
  border-color: var(--border);
}
.btn-outline:hover { border-color: var(--green-600); color: var(--green-400); background: rgba(22,163,74,0.05); }
.btn-danger {
  background: rgba(220,38,38,0.1); color: var(--red-600);
  border-color: rgba(220,38,38,0.3);
}
.btn-danger:hover { background: var(--red-600); color: white; }
.btn-ghost { background: transparent; color: var(--text-muted); border-color: transparent; }
.btn-ghost:hover { color: var(--text-primary); background: var(--dark-700); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }
.btn .spinner {
  width: 14px; height: 14px; border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white; border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* ════════════════════════════════════
   CARDS
   ════════════════════════════════════ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.card:hover { border-color: rgba(22,163,74,0.3); }
.card-elevated {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
}
.card-gold {
  background: linear-gradient(135deg, rgba(200,150,62,0.08), rgba(200,150,62,0.03));
  border-color: var(--border-gold);
}
.card-green {
  background: linear-gradient(135deg, rgba(22,163,74,0.08), rgba(22,163,74,0.03));
  border-color: rgba(22,163,74,0.25);
}

/* ════════════════════════════════════
   STAT CARDS (KPI)
   ════════════════════════════════════ */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px,1fr)); gap: 16px; }
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  position: relative; overflow: hidden;
  transition: all var(--transition);
}
.stat-card::before {
  content: ''; position: absolute;
  top: 0; left: 0; right: 0; height: 2px;
  background: var(--stat-color, var(--green-600));
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: rgba(22,163,74,0.3); }
.stat-icon { font-size: 24px; margin-bottom: 10px; }
.stat-value {
  font-family: var(--font-mono);
  font-size: 26px; font-weight: 700;
  color: var(--stat-color, var(--green-400));
  animation: countUp 0.5s ease;
  line-height: 1;
}
.stat-label { font-size: 11px; color: var(--text-muted); margin-top: 6px; text-transform: uppercase; letter-spacing: 0.8px; }
.stat-trend { font-size: 11px; margin-top: 4px; color: var(--green-400); }

/* ════════════════════════════════════
   PROGRESS BAR
   ════════════════════════════════════ */
.progress-wrap {
  background: var(--dark-700);
  border-radius: 100px; overflow: hidden;
  height: 8px; position: relative;
}
.progress-bar {
  height: 100%; border-radius: 100px;
  background: linear-gradient(90deg, var(--green-700), var(--green-400));
  transition: width 1s cubic-bezier(0.4,0,0.2,1);
  position: relative;
}
.progress-bar::after {
  content: ''; position: absolute; right: 0; top: 0; bottom: 0;
  width: 20px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3));
  border-radius: 0 100px 100px 0;
}
.progress-bar-gold {
  background: linear-gradient(90deg, var(--gold-700), var(--gold-400));
}
.progress-bar-red {
  background: linear-gradient(90deg, #7f1d1d, var(--red-600));
}
.progress-label {
  display: flex; justify-content: space-between;
  font-size: 12px; margin-top: 6px;
}

/* ════════════════════════════════════
   BADGES & CHIPS
   ════════════════════════════════════ */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 100px;
  font-size: 10px; font-weight: 700; letter-spacing: 0.5px;
  text-transform: uppercase;
}
.badge-green  { background: rgba(22,163,74,0.15);  color: var(--green-400);  border: 1px solid rgba(22,163,74,0.3); }
.badge-gold   { background: rgba(200,150,62,0.15); color: var(--gold-400);  border: 1px solid rgba(200,150,62,0.3); }
.badge-red    { background: rgba(220,38,38,0.12);  color: #f87171;          border: 1px solid rgba(220,38,38,0.3); }
.badge-blue   { background: rgba(37,99,235,0.12);  color: #60a5fa;          border: 1px solid rgba(37,99,235,0.3); }
.badge-gray   { background: rgba(100,116,139,0.15);color: var(--slate-400); border: 1px solid rgba(100,116,139,0.3); }
.chip {
  display: inline-flex; align-items: center;
  padding: 4px 12px; border-radius: 100px;
  background: var(--dark-700); border: 1px solid var(--border);
  font-size: 12px; color: var(--text-secondary);
  cursor: pointer; transition: all var(--transition);
}
.chip:hover, .chip.active {
  background: rgba(22,163,74,0.1); border-color: var(--green-600); color: var(--green-400);
}

/* ════════════════════════════════════
   TABS
   ════════════════════════════════════ */
.tabs {
  display: flex; gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px; overflow-x: auto;
}
.tab-btn {
  padding: 10px 18px; font-size: 13px; font-weight: 600;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  transition: all var(--transition); white-space: nowrap;
  cursor: pointer;
}
.tab-btn:hover { color: var(--text-primary); }
.tab-btn.active { color: var(--green-400); border-bottom-color: var(--green-600); }
.tab-panel { display: none; animation: fadeIn 0.3s ease; }
.tab-panel.active { display: block; }

/* ════════════════════════════════════
   TABLES
   ════════════════════════════════════ */
.table-wrap { overflow-x: auto; border-radius: var(--radius-md); border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead { background: var(--dark-700); }
th {
  padding: 12px 16px; text-align: left;
  font-size: 10px; font-weight: 700; letter-spacing: 1px;
  color: var(--text-muted); text-transform: uppercase;
  border-bottom: 1px solid var(--border);
}
td { padding: 12px 16px; border-bottom: 1px solid rgba(255,255,255,0.04); }
tr:last-child td { border-bottom: none; }
tbody tr:hover { background: rgba(22,163,74,0.03); }

/* ════════════════════════════════════
   GRID LAYOUTS
   ════════════════════════════════════ */
.grid-2 { display: grid; grid-template-columns: repeat(2,1fr); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fill,minmax(280px,1fr)); gap: 16px; }

/* ════════════════════════════════════
   FORMS
   ════════════════════════════════════ */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block; font-size: 12px; font-weight: 700;
  color: var(--text-secondary); margin-bottom: 6px;
  text-transform: uppercase; letter-spacing: 0.5px;
}
.form-label .required { color: var(--red-600); }
.form-error { color: #f87171; font-size: 11px; margin-top: 4px; }
.form-hint { color: var(--text-muted); font-size: 11px; margin-top: 4px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-section-title {
  font-size: 12px; font-weight: 700; letter-spacing: 1px;
  color: var(--text-muted); text-transform: uppercase;
  border-bottom: 1px solid var(--border); padding-bottom: 8px;
  margin: 20px 0 14px;
}
textarea { resize: vertical; min-height: 80px; }

/* ════════════════════════════════════
   MODALS
   ════════════════════════════════════ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(4px);
  z-index: 10000;
  display: none; align-items: center; justify-content: center;
  padding: 16px;
  animation: fadeIn 0.2s ease;
}
.modal-overlay.show { display: flex; }
.modal {
  background: var(--dark-800);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%; max-width: 520px;
  max-height: 90vh; overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: fadeInUp 0.3s ease;
}
.modal-header {
  padding: 20px 24px 0;
  display: flex; align-items: center; justify-content: space-between;
}
.modal-title {
  font-family: var(--font-display);
  font-size: 20px; font-weight: 700;
}
.modal-close {
  width: 32px; height: 32px;
  background: var(--dark-700); border: 1px solid var(--border);
  border-radius: 8px; color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; transition: all var(--transition);
}
.modal-close:hover { color: var(--red-600); border-color: var(--red-600); }
.modal-body { padding: 20px 24px; }
.modal-footer { padding: 0 24px 20px; display: flex; gap: 10px; justify-content: flex-end; }
.modal-tabs {
  display: flex; border-bottom: 1px solid var(--border);
  margin: 0 24px 20px;
}

/* ════════════════════════════════════
   TOASTS / ALERTS
   ════════════════════════════════════ */
#toast-container {
  position: fixed; bottom: 24px; right: 24px;
  z-index: 11000; display: flex; flex-direction: column; gap: 8px;
}
.toast {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; border-radius: var(--radius-md);
  min-width: 280px; max-width: 400px;
  box-shadow: var(--shadow-lg);
  animation: fadeInUp 0.3s ease;
  font-size: 13px; font-weight: 500;
}
.toast-success { background: var(--green-900); border: 1px solid var(--green-700); color: var(--green-100); }
.toast-error   { background: #450a0a; border: 1px solid #991b1b; color: #fca5a5; }
.toast-warning { background: #431407; border: 1px solid #9a3412; color: #fed7aa; }
.toast-info    { background: #0c1a3b; border: 1px solid #1d4ed8; color: #bfdbfe; }
.toast-icon { font-size: 18px; }
.toast-close { margin-left: auto; cursor: pointer; opacity: 0.7; }
.toast-close:hover { opacity: 1; }

/* ════════════════════════════════════
   SEARCH & FILTER BAR
   ════════════════════════════════════ */
.filter-bar {
  display: flex; gap: 10px; align-items: center;
  flex-wrap: wrap; margin-bottom: 20px;
}
.filter-bar input { max-width: 260px; height: 36px; }
.filter-bar select { max-width: 180px; height: 36px; padding: 0 12px; }
.chips-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }

/* ════════════════════════════════════
   MEMBER CARDS
   ════════════════════════════════════ */
.member-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px;
  transition: all var(--transition);
  cursor: pointer;
}
.member-card:hover { border-color: rgba(22,163,74,0.35); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.member-avatar {
  width: 48px; height: 48px; border-radius: 50%;
  background: linear-gradient(135deg, var(--green-700), var(--green-900));
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 700; color: white; flex-shrink: 0;
}
.member-name { font-size: 14px; font-weight: 700; color: var(--text-primary); }
.member-role { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* ════════════════════════════════════
   PRODUCT CARDS (Marketplace)
   ════════════════════════════════════ */
.product-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: all var(--transition);
}
.product-card:hover { border-color: rgba(200,150,62,0.4); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.product-img {
  height: 150px;
  background: linear-gradient(135deg, var(--dark-700), var(--dark-600));
  display: flex; align-items: center; justify-content: center;
  font-size: 40px;
}
.product-body { padding: 14px; }
.product-name { font-size: 14px; font-weight: 700; color: var(--text-primary); }
.product-price { font-family: var(--font-mono); font-size: 15px; color: var(--gold-400); margin-top: 6px; }
.product-seller { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

/* ════════════════════════════════════
   NEWS / FEED
   ════════════════════════════════════ */
.post-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px; margin-bottom: 14px;
  transition: border-color var(--transition);
}
.post-card:hover { border-color: rgba(22,163,74,0.25); }
.post-header { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.post-author { font-size: 13px; font-weight: 700; }
.post-meta { font-size: 11px; color: var(--text-muted); }
.post-content { font-size: 14px; line-height: 1.65; color: var(--text-secondary); }
.post-tag {
  display: inline-block; padding: 2px 8px;
  background: rgba(22,163,74,0.1); color: var(--green-400);
  border-radius: 4px; font-size: 11px; font-weight: 700;
  margin-right: 6px; margin-top: 8px;
}
.post-actions { display: flex; gap: 16px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.post-action-btn {
  display: flex; align-items: center; gap: 5px;
  font-size: 12px; color: var(--text-muted);
  transition: color var(--transition); cursor: pointer;
}
.post-action-btn:hover { color: var(--green-400); }

/* ════════════════════════════════════
   GPS / CADASTRE CARDS
   ════════════════════════════════════ */
.parcelle-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px; margin-bottom: 10px;
  display: grid; grid-template-columns: 1fr auto;
  gap: 12px; align-items: center;
  transition: all var(--transition);
}
.parcelle-card:hover { border-color: rgba(22,163,74,0.3); }
.parcelle-id { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); }
.parcelle-name { font-size: 14px; font-weight: 700; }
.parcelle-meta { font-size: 12px; color: var(--text-muted); margin-top: 3px; }

/* ════════════════════════════════════
   CONTRIBUTION / MEWAHOU
   ════════════════════════════════════ */
.project-fund-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px; margin-bottom: 16px;
}
.project-fund-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 14px; }
.project-fund-name { font-family: var(--font-display); font-size: 18px; font-weight: 700; }
.project-fund-urgency { font-size: 10px; font-weight: 700; padding: 3px 8px; border-radius: 4px; }
.fund-amounts { display: flex; justify-content: space-between; margin-bottom: 8px; }
.fund-amount-main { font-family: var(--font-mono); font-size: 22px; font-weight: 700; color: var(--green-400); }
.fund-amount-target { font-family: var(--font-mono); font-size: 14px; color: var(--text-muted); }
.contributors-list { display: flex; margin-top: 14px; gap: -8px; }
.contrib-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--dark-600); border: 2px solid var(--dark-800);
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; color: white;
  margin-left: -8px;
}
.contrib-avatar:first-child { margin-left: 0; }

/* ════════════════════════════════════
   CODISBA / GOVERNANCE
   ════════════════════════════════════ */
.mission-card {
  background: var(--bg-card);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-md);
  padding: 20px;
  border-left: 3px solid var(--gold-500);
}
.mission-title { font-family: var(--font-display); font-size: 16px; font-weight: 700; color: var(--gold-400); margin-bottom: 8px; }
.hierarchy-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid var(--border);
}
.hierarchy-num {
  width: 24px; height: 24px;
  background: var(--dark-700); border: 1px solid var(--gold-500);
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: var(--gold-400); flex-shrink: 0;
}
.governance-step {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px; text-align: center;
  position: relative;
}
.governance-step::after {
  content: '→'; position: absolute; right: -12px; top: 50%;
  transform: translateY(-50%); color: var(--text-muted); font-size: 16px;
}
.governance-step:last-child::after { display: none; }

/* ════════════════════════════════════
   NJANGI / TONTINES
   ════════════════════════════════════ */
.njangi-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 18px;
  border-top: 3px solid var(--green-600);
}
.njangi-members { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 10px; }
.njangi-member-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--green-600);
}
.njangi-member-dot.paid { background: var(--green-400); }
.njangi-member-dot.pending { background: var(--gold-500); }

/* ════════════════════════════════════
   RIPREM SOLAR
   ════════════════════════════════════ */
.solar-gauge {
  width: 120px; height: 120px; margin: 0 auto;
  position: relative;
}
.solar-gauge svg { transform: rotate(-90deg); }
.solar-gauge .gauge-track { stroke: var(--dark-600); }
.solar-gauge .gauge-fill { stroke: var(--gold-400); stroke-linecap: round; transition: stroke-dashoffset 1.5s ease; }
.solar-gauge-label {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 22px; font-weight: 700; color: var(--gold-400);
}
.solar-gauge-sub { font-size: 10px; color: var(--text-muted); margin-top: -2px; }

/* ════════════════════════════════════
   ADMIN PANEL
   ════════════════════════════════════ */
.admin-metric {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 14px;
  display: flex; align-items: center; gap: 12px;
}
.admin-metric-icon { font-size: 22px; width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; background: var(--dark-700); border-radius: 10px; }
.admin-metric-value { font-family: var(--font-mono); font-size: 18px; font-weight: 700; color: var(--green-400); }
.admin-metric-label { font-size: 11px; color: var(--text-muted); }
.toggle-switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.toggle-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.toggle-track {
  width: 44px; height: 24px;
  background: var(--dark-600);
  border-radius: 100px; transition: background var(--transition);
  border: 1px solid var(--border);
}
.toggle-thumb {
  position: absolute; left: 3px; top: 3px;
  width: 18px; height: 18px; background: white;
  border-radius: 50%; transition: transform var(--transition);
}
.toggle-switch input:checked ~ .toggle-track { background: var(--green-600); border-color: var(--green-700); }
.toggle-switch input:checked ~ .toggle-thumb { transform: translateX(20px); }

/* ════════════════════════════════════
   PROFILE PAGE
   ════════════════════════════════════ */
.profile-banner {
  height: 140px;
  background: linear-gradient(135deg, var(--green-900), var(--dark-700), var(--green-800));
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  position: relative;
}
.profile-avatar-wrap {
  position: absolute; bottom: -30px; left: 24px;
}
.profile-avatar {
  width: 72px; height: 72px; border-radius: 50%;
  background: linear-gradient(135deg, var(--green-700), var(--green-900));
  border: 3px solid var(--dark-800);
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; font-weight: 700; color: white;
  box-shadow: var(--shadow-green);
}
.profile-body { padding: 44px 24px 24px; background: var(--bg-card); border-radius: 0 0 var(--radius-lg) var(--radius-lg); border: 1px solid var(--border); border-top: none; }
.profile-name { font-family: var(--font-display); font-size: 22px; font-weight: 700; }
.profile-title { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.profile-stats { display: grid; grid-template-columns: repeat(4,1fr); gap: 1px; background: var(--border); border-radius: var(--radius-sm); overflow: hidden; margin-top: 16px; }
.profile-stat { background: var(--bg-card); padding: 12px; text-align: center; }
.profile-stat-val { font-family: var(--font-mono); font-size: 18px; font-weight: 700; color: var(--green-400); }
.profile-stat-label { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-top: 2px; }

/* ════════════════════════════════════
   LANDING PAGE (HOME — non connecté)
   ════════════════════════════════════ */
#page-home {
  padding: 0;
  background: var(--dark-900);
}
.hero {
  min-height: 100vh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 80px 24px;
  position: relative; overflow: hidden;
}
.hero-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(21,128,61,0.18) 0%, transparent 70%),
    radial-gradient(ellipse 60% 40% at 80% 100%, rgba(200,150,62,0.08) 0%, transparent 60%),
    var(--dark-900);
}
.hero-pattern {
  position: absolute; inset: 0; opacity: 0.03;
  background-image:
    repeating-linear-gradient(45deg, var(--green-600) 0, var(--green-600) 1px, transparent 0, transparent 50%),
    repeating-linear-gradient(135deg, var(--green-600) 0, var(--green-600) 1px, transparent 0, transparent 50%);
  background-size: 30px 30px;
}
.hero-content { position: relative; max-width: 780px; }
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(22,163,74,0.1); border: 1px solid rgba(22,163,74,0.3);
  border-radius: 100px; padding: 5px 14px;
  font-size: 12px; font-weight: 700; letter-spacing: 1px;
  color: var(--green-400); text-transform: uppercase;
  margin-bottom: 24px; animation: fadeInUp 0.6s ease;
}
.hero-title {
  font-family: var(--font-display);
  font-size: clamp(36px, 7vw, 68px);
  font-weight: 800; line-height: 1.08;
  color: var(--ivory); margin-bottom: 16px;
  animation: fadeInUp 0.7s ease 0.1s both;
}
.hero-title .accent { color: var(--green-400); }
.hero-title .accent-gold { color: var(--gold-400); }
.hero-subtitle {
  font-size: clamp(15px, 2.5vw, 18px);
  color: var(--text-secondary); max-width: 560px; margin: 0 auto 36px;
  line-height: 1.7; animation: fadeInUp 0.7s ease 0.2s both;
}
.hero-cta {
  display: flex; gap: 14px; justify-content: center; flex-wrap: wrap;
  animation: fadeInUp 0.7s ease 0.3s both;
}
.hero-stats {
  display: flex; gap: 40px; justify-content: center; flex-wrap: wrap;
  margin-top: 56px; padding-top: 40px;
  border-top: 1px solid rgba(255,255,255,0.08);
  animation: fadeInUp 0.7s ease 0.4s both;
}
.hero-stat { text-align: center; }
.hero-stat-val {
  font-family: var(--font-display);
  font-size: 32px; font-weight: 800; color: var(--ivory);
}
.hero-stat-val span { color: var(--green-400); }
.hero-stat-label { font-size: 12px; color: var(--text-muted); margin-top: 4px; text-transform: uppercase; letter-spacing: 0.8px; }
.features-section { padding: 80px 32px; background: var(--dark-800); }
.section-label {
  font-size: 11px; font-weight: 700; letter-spacing: 2px;
  color: var(--green-400); text-transform: uppercase;
  margin-bottom: 12px;
}
.section-title {
  font-family: var(--font-display);
  font-size: clamp(26px, 4vw, 40px); font-weight: 700;
  color: var(--ivory); margin-bottom: 16px;
}
.section-subtitle { font-size: 16px; color: var(--text-secondary); max-width: 520px; }
.feature-card {
  background: var(--dark-700);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px; transition: all var(--transition);
}
.feature-card:hover { border-color: rgba(22,163,74,0.4); transform: translateY(-4px); box-shadow: var(--shadow-green); }
.feature-icon {
  font-size: 28px; margin-bottom: 14px;
  width: 52px; height: 52px;
  background: rgba(22,163,74,0.1);
  border: 1px solid rgba(22,163,74,0.2);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
}
.feature-title { font-size: 15px; font-weight: 700; margin-bottom: 8px; }
.feature-desc { font-size: 13px; color: var(--text-secondary); line-height: 1.6; }

/* ════════════════════════════════════
   EMPTY STATES
   ════════════════════════════════════ */
.empty-state {
  text-align: center; padding: 48px 24px;
  color: var(--text-muted);
}
.empty-state-icon { font-size: 48px; margin-bottom: 12px; opacity: 0.5; }
.empty-state-title { font-size: 15px; font-weight: 700; margin-bottom: 6px; color: var(--text-secondary); }
.empty-state-text { font-size: 13px; line-height: 1.6; }

/* ════════════════════════════════════
   NOTIFICATIONS
   ════════════════════════════════════ */
.notif-item {
  display: flex; gap: 12px; padding: 14px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer; transition: all var(--transition);
}
.notif-item:hover { padding-left: 6px; }
.notif-item.unread .notif-text { color: var(--text-primary); }
.notif-item.read .notif-text { color: var(--text-muted); }
/* States standalone (utilisés dynamiquement) */
.read   { opacity: 0.65; }
.unread { font-weight: 600; }
/* Body ready — fade-in initial */
body.ready { opacity: 1; }
.notif-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--green-600); flex-shrink: 0; margin-top: 6px;
}
.notif-item.read .notif-dot { background: transparent; border: 1px solid var(--dark-500); }
.notif-icon { font-size: 20px; flex-shrink: 0; }
.notif-text { font-size: 13px; line-height: 1.5; }
.notif-time { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

/* ════════════════════════════════════
   FOOTER
   ════════════════════════════════════ */
.app-footer {
  background: var(--dark-800);
  border-top: 1px solid var(--border);
  padding: 28px; margin-top: 40px;
  text-align: center;
}
.footer-links { display: flex; gap: 20px; justify-content: center; flex-wrap: wrap; margin-bottom: 14px; }
.footer-link { font-size: 12px; color: var(--text-muted); transition: color var(--transition); }
.footer-link:hover { color: var(--green-400); }
.footer-copy { font-size: 11px; color: var(--dark-500); }

/* ════════════════════════════════════
   SIDEBAR OVERLAY (mobile)
   ════════════════════════════════════ */
#sidebar-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.6); z-index: 899;
}

/* ════════════════════════════════════
   RESPONSIVE
   ════════════════════════════════════ */
@media (max-width: 900px) {
  :root { --sidebar-w: 0px; }
  #sidebar { transform: translateX(-240px); --sidebar-w: 240px; }
  #sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); }
  #sidebar-overlay.show { display: block; }
  #main { margin-left: 0; }
  .hamburger { display: flex; }
  .topbar-search { display: none; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .hero-stats { gap: 24px; }
  .profile-stats { grid-template-columns: repeat(2,1fr); }
  .page { padding: 16px; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .modal { border-radius: var(--radius-md); }
  .hero-cta { flex-direction: column; align-items: center; }
  .hero-stats { flex-direction: column; gap: 16px; }
}

/* ════════════════════════════════════
   CHART PLACEHOLDERS
   ════════════════════════════════════ */
.mini-chart {
  display: flex; align-items: flex-end; gap: 3px;
  height: 40px; padding: 0 4px;
}
.mini-bar {
  flex: 1; border-radius: 2px 2px 0 0;
  background: rgba(22,163,74,0.3);
  transition: height 0.8s ease, background var(--transition);
  min-height: 4px;
}
.mini-bar:hover { background: var(--green-600); }

/* Scrollbar in modals */
.modal::-webkit-scrollbar { width: 4px; }
.modal::-webkit-scrollbar-thumb { background: var(--dark-500); }
