/* ============================================================
   LEADER Network — Styles globaux
   ============================================================ */

* { box-sizing: border-box; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #12121A; }
::-webkit-scrollbar-thumb { background: #22223A; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #F59E0B; }

/* Nav active */
.nav-btn.active, .admin-nav-btn.active {
  background: linear-gradient(135deg, rgba(245,158,11,0.15), rgba(245,158,11,0.05));
  color: #F59E0B !important;
  border-right: 2px solid #F59E0B;
}
.admin-nav-btn.active {
  background: linear-gradient(135deg, rgba(239,68,68,0.15), rgba(239,68,68,0.05));
  color: #EF4444 !important;
  border-right: 2px solid #EF4444;
}

/* Cards */
.stat-card {
  background: linear-gradient(135deg, #12121A, #1A1A26);
  border: 1px solid #22223A;
  border-radius: 16px;
  padding: 20px;
  transition: transform 0.2s, box-shadow 0.2s;
  min-width: 0;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 8px 32px rgba(0,0,0,0.3); }

/* Rank badges */
.rank-none       { color: #6B7280; background: rgba(107,114,128,0.15); }
.rank-administrator { color: #60A5FA; background: rgba(96,165,250,0.15); }
.rank-manager    { color: #34D399; background: rgba(52,211,153,0.15); }
.rank-captain    { color: #FBBF24; background: rgba(251,191,36,0.15); }
.rank-leader     { color: #F97316; background: rgba(249,115,22,0.15); }
.rank-mentor     { color: #A78BFA; background: rgba(167,139,250,0.15); }
.rank-superviseur{ color: #EC4899; background: rgba(236,72,153,0.15); }
.rank-executive  { color: #06B6D4; background: rgba(6,182,212,0.15); }
.rank-president  { color: #EF4444; background: rgba(239,68,68,0.15); }
.rank-director   { color: #8B5CF6; background: rgba(139,92,246,0.15); }
.rank-boss       { color: #F59E0B; background: rgba(245,158,11,0.2); }
.rank-visionary  { 
  background: linear-gradient(135deg, rgba(245,158,11,0.3), rgba(239,68,68,0.2));
  color: #FCD34D;
}

/* Status badges */
.status-ami     { color: #FBBF24; background: rgba(251,191,36,0.15); }
.status-partner { color: #34D399; background: rgba(52,211,153,0.15); }
.status-client  { color: #60A5FA; background: rgba(96,165,250,0.15); }
.status-member  { color: #9CA3AF; background: rgba(156,163,175,0.15); }

/* Table */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  background: #1A1A26;
  color: #9CA3AF;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 12px 16px;
  text-align: left;
  font-weight: 500;
  border-bottom: 1px solid #22223A;
}
.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid #1A1A26;
  font-size: 13px;
  color: #D1D5DB;
}
.data-table tr:hover td { background: rgba(245,158,11,0.04); }
.data-table tr:last-child td { border-bottom: none; }

/* Binary tree */
.tree-node {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  min-width: 120px;
}
.tree-node-card {
  border: 1px solid #22223A;
  border-radius: 12px;
  padding: 10px 14px;
  background: #1A1A26;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  min-width: 110px;
}
.tree-node-card:hover { border-color: #F59E0B; background: #22223A; }
.tree-node-card.empty {
  border-style: dashed;
  border-color: #374151;
  background: #12121A;
  opacity: 0.6;
}
.tree-connector {
  width: 2px;
  height: 24px;
  background: #22223A;
  margin: 0 auto;
}
.tree-children {
  display: flex;
  gap: 16px;
  position: relative;
}
.tree-children::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 60px);
  height: 2px;
  background: #22223A;
}

/* Progress bar */
.progress-bar {
  background: #22223A;
  border-radius: 999px;
  height: 8px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #F59E0B, #EF4444);
  transition: width 0.6s ease;
}

/* Commission type badges */
.comm-prime_leadership        { color: #FBBF24; }
.comm-bonus_influence         { color: #60A5FA; }
.comm-bonus_rayonnement       { color: #34D399; }
.comm-valorisation_recommandation { color: #A78BFA; }
.comm-fast_start              { color: #F97316; }
.comm-credit_croissance       { color: #EC4899; }
.comm-reserve_strategique     { color: #06B6D4; }

/* Animations */
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.fade-in { animation: fadeIn 0.3s ease forwards; }

@keyframes pulse-gold { 0%, 100% { box-shadow: 0 0 0 0 rgba(245,158,11,0.4); } 50% { box-shadow: 0 0 0 8px rgba(245,158,11,0); } }
.pulse-gold { animation: pulse-gold 2s infinite; }

/* Input */
.form-input {
  width: 100%;
  background: #1A1A26;
  border: 1px solid #22223A;
  border-radius: 10px;
  padding: 10px 14px;
  color: #fff;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}
.form-input:focus { border-color: #F59E0B; }
.form-label { display: block; font-size: 12px; color: #9CA3AF; margin-bottom: 6px; font-weight: 500; }

/* Modal */
#modal-overlay { backdrop-filter: blur(4px); }

/* Loader */
.loader {
  width: 36px; height: 36px;
  border: 3px solid #22223A;
  border-top-color: #F59E0B;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Toast */
#toast.show { animation: slideUp 0.3s ease; }
@keyframes slideUp { from { opacity:0; transform: translateY(20px); } to { opacity:1; transform: translateY(0); } }

/* ── Recherche arbre binaire ── */
#tree-search-dropdown {
  animation: fadeIn 0.15s ease forwards;
}
#tree-search-dropdown::-webkit-scrollbar { width: 4px; }
#tree-search-dropdown::-webkit-scrollbar-track { background: #1A1A26; }
#tree-search-dropdown::-webkit-scrollbar-thumb { background: #22223A; border-radius: 2px; }

.tree-search-result {
  transition: background 0.12s ease;
}
.tree-search-result:hover {
  background: rgba(245,158,11,0.06) !important;
}

#tree-search-input:focus + kbd,
#tree-search-input:not(:placeholder-shown) + kbd {
  opacity: 0;
}
