/* ============================================
   DEMON SLAYER STAFF — Design System
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;700&family=Inter:wght@300;400;500;600&display=swap');

/* --- Variables --- */
:root {
  /* Backgrounds */
  --bg-primary:   #0a0a0f;
  --bg-secondary: #111118;
  --bg-card:      #16161f;
  --bg-hover:     #1e1e2a;
  --bg-input:     #12121a;

  /* Accents */
  --red:          #c0392b;
  --red-dark:     #8b0000;
  --red-glow:     rgba(192, 57, 43, 0.25);
  --red-border:   rgba(192, 57, 43, 0.5);

  /* Texte */
  --text-primary:   #e8e8f0;
  --text-secondary: #9090a8;
  --text-muted:     #5a5a6e;

  /* Bordures */
  --border:        #2a2a38;
  --border-light:  #1e1e2a;

  /* Grades */
  --grade-owner:       #f0c040;
  --grade-responsable: #a855f7;
  --grade-gerant-staff:#f97316;
  --grade-gerant-rp:   #3b82f6;
  --grade-moderateur:  #22c55e;
  --grade-helper:      #f472b6;
  --grade-animateur:   #a3e635;
  --grade-developpeur: #22d3ee;

  /* Misc */
  --radius:    8px;
  --radius-lg: 14px;
  --sidebar-w: 240px;
  --transition: 0.2s ease;
}

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, textarea { font-family: inherit; }

/* --- Scrollbar --- */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(192,57,43,0.25); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: rgba(192,57,43,0.5); }

/* --- Fond subtil avec radial gradients --- */
body {
  background-image:
    radial-gradient(ellipse at 15% 60%, rgba(192,57,43,0.04) 0%, transparent 50%),
    radial-gradient(ellipse at 85% 20%, rgba(168,85,247,0.025) 0%, transparent 50%);
}

/* ============================================
   ANIMATIONS
   ============================================ */

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInLeft {
  from { opacity: 0; transform: translateX(-16px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.94); }
  to   { opacity: 1; transform: scale(1); }
}

@keyframes slideInUp {
  from { opacity: 0; transform: translateY(20px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 0 0 rgba(34,197,94,0.5); }
  50%       { box-shadow: 0 0 0 6px rgba(34,197,94,0); }
}

@keyframes shimmer {
  0%   { background-position: -200% center; }
  100% { background-position:  200% center; }
}

@keyframes shimmerGold {
  0%   { background-position: -200% center; }
  100% { background-position:  200% center; }
}

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50%       { transform: translateY(-5px); }
}

@keyframes glowPulse {
  0%, 100% { box-shadow: 0 0 12px var(--red-glow); }
  50%       { box-shadow: 0 0 28px rgba(192,57,43,0.4), 0 0 60px rgba(192,57,43,0.1); }
}

@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50%       { background-position: 100% 50%; }
}

/* Entrée page */
.main-content        { animation: fadeIn 0.3s ease; }
.chat-main           { animation: fadeIn 0.3s ease; }
.chat-channels       { animation: fadeInLeft 0.3s ease; }

/* Login card */
.login-card          { animation: scaleIn 0.35s cubic-bezier(0.34,1.56,0.64,1); }

/* Cards dashboard */
.stat-card           { animation: fadeIn 0.4s ease both; }
.stat-card:nth-child(1) { animation-delay: 0.05s; }
.stat-card:nth-child(2) { animation-delay: 0.10s; }
.stat-card:nth-child(3) { animation-delay: 0.15s; }
.stat-card:nth-child(4) { animation-delay: 0.20s; }

.dashboard-grid > .card { animation: fadeIn 0.4s ease 0.2s both; }
.dashboard-grid > .card:last-child { animation-delay: 0.28s; }

/* Sidebar nav items */
.nav-item {
  animation: fadeInLeft 0.3s ease both;
}
.nav-item:nth-child(1) { animation-delay: 0.05s; }
.nav-item:nth-child(2) { animation-delay: 0.10s; }
.nav-item:nth-child(3) { animation-delay: 0.15s; }
.nav-item:nth-child(4) { animation-delay: 0.18s; }

/* Pulse sur le point vert "en ligne" */
.online-avatar::after {
  animation: pulse-dot 2.5s infinite;
}

/* Stat cards — hover lift + glow coloré */
.stat-card {
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
.stat-card:hover { transform: translateY(-4px); box-shadow: 0 12px 36px rgba(0,0,0,0.35); }
.stat-card:has(.stat-icon.red):hover    { box-shadow: 0 12px 36px rgba(192,57,43,0.2); border-color: rgba(192,57,43,0.25); }
.stat-card:has(.stat-icon.green):hover  { box-shadow: 0 12px 36px rgba(34,197,94,0.18); border-color: rgba(34,197,94,0.2); }
.stat-card:has(.stat-icon.blue):hover   { box-shadow: 0 12px 36px rgba(59,130,246,0.18); border-color: rgba(59,130,246,0.2); }
.stat-card:has(.stat-icon.purple):hover { box-shadow: 0 12px 36px rgba(168,85,247,0.18); border-color: rgba(168,85,247,0.2); }

/* Cards — lift au survol */
.card {
  transition: box-shadow 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}
.card:hover {
  box-shadow: 0 8px 28px rgba(0,0,0,0.25);
  border-color: #35354a;
}

/* Hover messages chat */
.msg { transition: background 0.15s ease; }
.msg:hover { background: rgba(255,255,255,0.02); border-radius: 6px; }

/* Logo sidebar — lueur animée au hover */
.sidebar-logo .logo-icon { transition: box-shadow 0.4s ease; }
.sidebar-logo:hover .logo-icon { animation: glowPulse 2s ease infinite; }

/* Bouton primary — gradient + glow + lift */
.btn-primary {
  background: linear-gradient(135deg, #c0392b 0%, #96281b 100%);
  transition: box-shadow 0.25s ease, transform 0.15s ease, filter 0.25s ease;
  position: relative;
  overflow: hidden;
}
.btn-primary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.25s ease;
}
.btn-primary:hover { box-shadow: 0 0 24px rgba(192,57,43,0.5), 0 4px 12px rgba(0,0,0,0.3); transform: translateY(-1px); }
.btn-primary:hover::before { opacity: 1; }
.btn-primary:active { transform: scale(0.97); }

/* Bouton ghost — border glow au hover */
.btn-ghost { transition: all 0.2s ease; }
.btn-ghost:hover { border-color: rgba(192,57,43,0.3); box-shadow: 0 0 0 1px rgba(192,57,43,0.1) inset; }

/* Items de salon chat */
.channel-item {
  transition: background 0.2s ease, color 0.2s ease, padding-left 0.2s ease, box-shadow 0.2s ease;
}
.channel-item.active { padding-left: 14px; }

/* Grade badge — pop + glow au survol */
.grade-badge { transition: filter 0.2s ease, box-shadow 0.2s ease; }
.grade-badge:hover { filter: brightness(1.25); }
.grade-badge.owner {
  background: linear-gradient(90deg, rgba(240,192,64,0.08) 0%, rgba(240,192,64,0.2) 50%, rgba(240,192,64,0.08) 100%);
  background-size: 200% auto;
  animation: shimmerGold 3s linear infinite;
  box-shadow: 0 0 8px rgba(240,192,64,0.15);
}

/* ============================================
   COMPOSANTS COMMUNS
   ============================================ */

/* Badge de grade */
.grade-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.grade-badge.owner        { color: var(--grade-owner);       background: rgba(240,192,64,0.12);  border: 1px solid rgba(240,192,64,0.3); }
.grade-badge.responsable  { color: var(--grade-responsable); background: rgba(168,85,247,0.12); border: 1px solid rgba(168,85,247,0.3); }
.grade-badge.gerant-staff { color: var(--grade-gerant-staff);background: rgba(249,115,22,0.12); border: 1px solid rgba(249,115,22,0.3); }
.grade-badge.gerant-rp    { color: var(--grade-gerant-rp);   background: rgba(59,130,246,0.12); border: 1px solid rgba(59,130,246,0.3); }
.grade-badge.moderateur   { color: var(--grade-moderateur);  background: rgba(34,197,94,0.12);  border: 1px solid rgba(34,197,94,0.3); }
.grade-badge.helper       { color: var(--grade-helper);      background: rgba(244,114,182,0.12); border: 1px solid rgba(244,114,182,0.3); }
.grade-badge.animateur    { color: var(--grade-animateur);   background: rgba(163,230,53,0.12);  border: 1px solid rgba(163,230,53,0.3); }
.grade-badge.developpeur  { color: var(--grade-developpeur); background: rgba(34,211,238,0.12);  border: 1px solid rgba(34,211,238,0.3); }

/* ---- Notification popover (mentions + DMs hors-ligne) ---- */
.mention-notif-popover {
  position: fixed;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px;
  width: 240px;
  z-index: 600;
  box-shadow: 0 8px 32px rgba(0,0,0,0.55);
  display: flex;
  flex-direction: column;
  gap: 4px;
  animation: fadeIn 0.15s ease;
}
.notif-title {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 2px;
}
.notif-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 5px 2px;
  border-radius: 6px;
}
.notif-row:hover { background: var(--bg-hover); }
.notif-row-icon  { font-size: 14px; flex-shrink: 0; margin-top: 1px; }
.notif-row-label { font-size: 12px; font-weight: 500; color: var(--text-primary); }
.notif-row-sub   { font-size: 11px; color: var(--text-muted); margin-top: 1px; }
.notif-goto {
  display: block;
  text-align: center;
  margin-top: 6px;
  padding: 7px;
  background: var(--red);
  color: #fff;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  transition: opacity var(--transition);
}
.notif-goto:hover { opacity: 0.85; }

/* Boutons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  transition: all var(--transition);
}
.btn-primary {
  background: var(--red);
  color: #fff;
}
.btn-primary:hover {
  background: #a93226;
  box-shadow: 0 0 16px var(--red-glow);
}
.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-ghost:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--border-light);
}
.btn-danger {
  background: rgba(192,57,43,0.15);
  color: var(--red);
  border: 1px solid var(--red-border);
}
.btn-danger:hover {
  background: var(--red);
  color: #fff;
}

/* Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}

/* Inputs */
.input-group { display: flex; flex-direction: column; gap: 6px; }
.input-group label { font-size: 12px; font-weight: 500; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.5px; }
.input-field {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  color: var(--text-primary);
  font-size: 14px;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
.input-field:focus {
  border-color: rgba(192,57,43,0.6);
  box-shadow: 0 0 0 3px var(--red-glow), inset 0 1px 4px rgba(0,0,0,0.2);
  background: #141420;
}
.input-field::placeholder { color: var(--text-muted); }

/* Divider — gradient fade */
.divider {
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, var(--border) 30%, var(--border) 70%, transparent 100%);
  margin: 16px 0;
  border: none;
}

/* ============================================
   LAYOUT — SIDEBAR + MAIN
   ============================================ */

.app-layout {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* --- Sidebar --- */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: linear-gradient(180deg, #0f0f18 0%, #0c0c14 100%);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar-logo {
  padding: 20px 16px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar-logo .logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--red-dark), var(--red));
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
  box-shadow: 0 0 12px var(--red-glow);
}
.sidebar-logo .logo-text {
  font-family: 'Cinzel', serif;
  font-weight: 700;
  font-size: 13px;
  color: var(--text-primary);
  line-height: 1.3;
}
.sidebar-logo .logo-sub {
  font-size: 10px;
  color: var(--text-muted);
  font-family: 'Inter', sans-serif;
  font-weight: 400;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 8px;
}

.nav-section-title {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 8px 10px 4px;
  margin-top: 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 400;
  transition: all var(--transition);
  cursor: pointer;
  margin-bottom: 2px;
}
.nav-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}
.nav-item.active {
  background: linear-gradient(90deg, rgba(192,57,43,0.18) 0%, rgba(192,57,43,0.05) 100%);
  color: var(--text-primary);
  border-left: 3px solid var(--red);
  box-shadow: inset 0 0 24px rgba(192,57,43,0.04);
}
.nav-item .nav-icon {
  width: 18px;
  text-align: center;
  opacity: 0.8;
  flex-shrink: 0;
}
.nav-item .nav-badge {
  margin-left: auto;
  background: var(--red);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}

.nav-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--red);
  margin-left: auto;
  flex-shrink: 0;
  animation: pulse-nav-dot 2s infinite;
}
@keyframes pulse-nav-dot {
  0%, 100% { box-shadow: 0 0 0 0 rgba(192,57,43,0.5); }
  50%       { box-shadow: 0 0 0 5px rgba(192,57,43,0); }
}

/* --- Horloge sidebar --- */
.sidebar-clock {
  padding: 10px 16px 12px;
  text-align: center;
  border-top: 1px solid var(--border-light);
}
.clock-time {
  font-family: 'Inter', sans-serif;
  font-size: 20px;
  font-weight: 300;
  letter-spacing: 4px;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}
.clock-date {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 4px;
  letter-spacing: 0.4px;
  text-transform: capitalize;
}

.sidebar-user {
  padding: 12px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(0deg, rgba(192,57,43,0.04) 0%, transparent 100%);
}
.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--red-dark), #2a2a3a);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  flex-shrink: 0;
  border: 2px solid var(--border);
}
.user-info { flex: 1; min-width: 0; }
.user-name {
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-grade { margin-top: 2px; }
.sidebar-logout {
  color: var(--text-muted);
  padding: 4px;
  border-radius: var(--radius);
  transition: color var(--transition);
  font-size: 16px;
}
.sidebar-logout:hover { color: var(--red); }

/* --- Main content --- */
.main-content {
  flex: 1;
  overflow-y: auto;
  background: var(--bg-primary);
}

.page-header {
  padding: 24px 28px 0;
}
.page-header h1 {
  font-family: 'Cinzel', serif;
  font-size: 22px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--text-primary) 40%, rgba(240,192,64,0.75) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.page-header p {
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 5px;
}

.page-body {
  padding: 20px 28px 28px;
}

/* ============================================
   PAGE — LOGIN
   ============================================ */

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-primary);
  position: relative;
  overflow: hidden;
}

/* Fond animé login */
.login-page::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 50% at 15% 85%, rgba(139,0,0,0.18) 0%, transparent 55%),
    radial-gradient(ellipse 60% 60% at 85% 15%, rgba(139,0,0,0.1) 0%, transparent 55%),
    radial-gradient(ellipse 40% 40% at 50% 50%, rgba(168,85,247,0.04) 0%, transparent 60%);
  animation: gradientShift 10s ease infinite;
  background-size: 200% 200%;
  pointer-events: none;
}

.login-card {
  width: 100%;
  max-width: 400px;
  padding: 40px;
  background: linear-gradient(160deg, #18181f 0%, #13131a 100%);
  border: 1px solid rgba(42,42,56,0.8);
  border-radius: 20px;
  position: relative;
  z-index: 1;
  box-shadow: 0 30px 80px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.03) inset;
}

.login-card::before {
  content: '';
  position: absolute;
  top: 0; left: 10%; right: 10%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(192,57,43,0.8), rgba(240,192,64,0.4), rgba(192,57,43,0.8), transparent);
  border-radius: 99px;
}

.login-logo {
  text-align: center;
  margin-bottom: 32px;
}
.login-logo-icon {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, var(--red-dark), var(--red));
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  margin-bottom: 16px;
  box-shadow: 0 8px 32px rgba(192,57,43,0.4), 0 0 0 1px rgba(255,255,255,0.05) inset;
  animation: float 4s ease-in-out infinite;
}
.login-logo h1 {
  font-family: 'Cinzel', serif;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 1px;
  background: linear-gradient(135deg, var(--text-primary) 50%, rgba(240,192,64,0.7) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.login-logo p {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 6px;
  text-transform: uppercase;
  letter-spacing: 3px;
}

.login-form { display: flex; flex-direction: column; gap: 18px; }

.login-form .btn-primary {
  width: 100%;
  justify-content: center;
  padding: 11px;
  font-size: 14px;
  font-weight: 600;
  margin-top: 4px;
  letter-spacing: 0.5px;
}

.login-footer {
  margin-top: 20px;
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
}

/* ============================================
   PAGE — DASHBOARD
   ============================================ */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.stat-card {
  background: linear-gradient(135deg, var(--bg-card) 0%, #14141e 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  position: relative;
  overflow: hidden;
}
.stat-card::after {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 60px; height: 60px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,0.02) 0%, transparent 70%);
  transform: translate(20px, -20px);
}

.stat-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.stat-icon.red    { background: rgba(192,57,43,0.15);  box-shadow: 0 0 16px rgba(192,57,43,0.12); }
.stat-icon.purple { background: rgba(168,85,247,0.15); box-shadow: 0 0 16px rgba(168,85,247,0.12); }
.stat-icon.blue   { background: rgba(59,130,246,0.15); box-shadow: 0 0 16px rgba(59,130,246,0.12); }
.stat-icon.green  { background: rgba(34,197,94,0.15);  box-shadow: 0 0 16px rgba(34,197,94,0.12); }

.stat-info .stat-value {
  font-size: 24px;
  font-weight: 600;
  font-family: 'Cinzel', serif;
  line-height: 1;
}
.stat-info .stat-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 3px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 20px;
}

.activity-list { display: flex; flex-direction: column; gap: 2px; }
.activity-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius);
  transition: background var(--transition);
}
.activity-item:hover { background: var(--bg-hover); transform: translateX(2px); }
.activity-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.activity-text { flex: 1; font-size: 13px; color: var(--text-secondary); }
.activity-text span { color: var(--text-primary); font-weight: 500; }
.activity-time { font-size: 11px; color: var(--text-muted); }

.online-list { display: flex; flex-direction: column; gap: 4px; }
.online-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius);
  transition: background var(--transition);
}
.online-item:hover { background: var(--bg-hover); transform: translateX(2px); }
.online-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--bg-hover);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
  position: relative;
}
.online-avatar::after {
  content: '';
  position: absolute;
  bottom: 0; right: 0;
  width: 9px; height: 9px;
  background: #22c55e;
  border-radius: 50%;
  border: 2px solid var(--bg-card);
}
.online-name { font-size: 13px; font-weight: 500; }

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.card-header h3 {
  font-family: 'Cinzel', serif;
  font-size: 14px;
  font-weight: 600;
  background: linear-gradient(135deg, var(--text-primary) 60%, rgba(240,192,64,0.6) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.card-header a {
  font-size: 12px;
  color: var(--red);
  transition: opacity var(--transition);
}
.card-header a:hover { opacity: 0.7; }

/* ============================================
   PAGE — CHAT
   ============================================ */

.chat-layout {
  display: flex;
  height: 100%;
}

.chat-channels {
  width: 200px;
  min-width: 200px;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.channels-header {
  padding: 16px 14px 10px;
  border-bottom: 1px solid var(--border);
}
.channels-header h3 {
  font-family: 'Cinzel', serif;
  font-size: 13px;
  font-weight: 600;
}

.channels-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px 6px;
}

.channel-section-title {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 8px 8px 4px;
}

.channel-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: var(--radius);
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  transition: all var(--transition);
  margin-bottom: 1px;
}
.channel-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.channel-item.active { background: rgba(192,57,43,0.12); color: var(--text-primary); }
.channel-item.has-unread { color: var(--text-primary); font-weight: 700; }
.channel-item .ch-icon { opacity: 0.6; font-size: 12px; }
.dm-avatar-mini {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--bg-hover);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 600;
  flex-shrink: 0;
}

/* ============================================
   SURVEILLANCE DM — Owner
   ============================================ */

.surveillance-title {
  color: rgba(192,57,43,0.7) !important;
  font-size: 10px !important;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: color var(--transition);
}
.surveillance-title:hover { color: var(--red) !important; }

.surveillance-conv-item {
  padding: 6px 10px !important;
  border-left: 2px solid transparent;
  transition: border-color var(--transition), background var(--transition);
}
.surveillance-conv-item:hover { border-left-color: rgba(192,57,43,0.4); }

.surveillance-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: rgba(192,57,43,0.10);
  border-top: 1px solid rgba(192,57,43,0.25);
  font-size: 12px;
  color: var(--red);
  font-weight: 500;
}

/* Dot de présence dans les messages */
.msg-online-dot {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 9px;
  height: 9px;
  background: #22c55e;
  border-radius: 50%;
  border: 2px solid var(--bg-primary);
  box-shadow: 0 0 4px rgba(34,197,94,0.5);
}

/* Dot de présence dans la liste DM sidebar */
.dm-online-dot {
  position: absolute;
  bottom: -1px;
  right: -1px;
  width: 8px;
  height: 8px;
  background: #22c55e;
  border-radius: 50%;
  border: 2px solid var(--bg-secondary);
  box-shadow: 0 0 4px rgba(34,197,94,0.4);
}

/* Pseudo cliquable dans le chat → DM */
.msg-author[onclick] {
  transition: color var(--transition);
}
.msg-author[onclick]:hover {
  color: var(--red);
  text-decoration: underline;
}

.channel-item .ch-unread {
  margin-left: auto;
  background: var(--red);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 8px;
}
.ch-ping-dot {
  display: inline-block;
  margin-left: auto;
  width: 8px;
  height: 8px;
  background: var(--red);
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 4px rgba(192,57,43,0.7);
}

.chat-members {
  width: 200px;
  min-width: 200px;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  order: 3;
}
.members-header {
  padding: 16px 12px 10px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: 'Cinzel', serif;
  font-size: 13px;
  font-weight: 600;
  flex-shrink: 0;
}
.members-list {
  flex: 1;
  overflow-y: auto;
  padding: 4px 0 8px;
}
.members-section-label {
  padding: 10px 10px 3px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
}
.members-section-label.is-online { color: #22c55e; }
.members-grade-label {
  padding: 6px 10px 2px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  opacity: 0.6;
}
.member-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
  border-radius: 6px;
  cursor: pointer;
  margin: 1px 4px;
  transition: background 0.15s;
}
.member-item:hover { background: var(--bg-hover); }
.member-item .member-name {
  font-size: 12px;
  color: var(--text-primary);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}
.member-item.is-offline .member-name {
  color: var(--text-muted);
  font-weight: 400;
  opacity: 0.6;
}
.member-item.is-offline img,
.member-item.is-offline .dm-avatar-mini { opacity: 0.35; }

.members-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 299;
}
.members-overlay.active { display: block; }

.chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(90deg, #0f0f18 0%, #111119 100%);
  flex-shrink: 0;
}
.chat-header h4 { font-size: 14px; font-weight: 600; }
.chat-header p { font-size: 12px; color: var(--text-muted); }
.clear-chat-btn {
  background: rgba(192,57,43,0.12);
  border: 1px solid rgba(192,57,43,0.35);
  color: var(--red);
  font-size: 12px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: var(--radius);
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--transition), border-color var(--transition);
  flex-shrink: 0;
}
.clear-chat-btn:hover { background: rgba(192,57,43,0.25); border-color: var(--red); }

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.msg-date-sep {
  text-align: center;
  font-size: 11px;
  color: var(--text-muted);
  margin: 12px 0;
  display: flex;
  align-items: center;
  gap: 10px;
}
.msg-date-sep::before,
.msg-date-sep::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
}

.msg {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 4px 8px;
  border-radius: var(--radius);
  transition: background var(--transition);
}
.msg:hover { background: var(--bg-hover); }
.msg-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.msg-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--bg-hover);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  flex-shrink: 0;
  margin-top: 2px;
}
.msg-content { flex: 1; min-width: 0; }
.msg-meta {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 3px;
}
.msg-author { font-size: 14px; font-weight: 600; }
.msg-time { font-size: 11px; color: var(--text-muted); }
.msg-text { font-size: 14px; color: var(--text-secondary); line-height: 1.5; word-break: break-word; }

/* Mentions */
.mention {
  background: rgba(59,130,246,0.15);
  color: #93c5fd;
  border-radius: 3px;
  padding: 1px 4px;
  font-weight: 500;
}
.mention-me {
  background: rgba(192,57,43,0.2);
  color: #fca5a5;
  border: 1px solid rgba(192,57,43,0.3);
}

/* Dropdown autocomplétion */
.mention-dropdown {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 0; right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  z-index: 200;
  box-shadow: 0 -8px 24px rgba(0,0,0,0.4);
  animation: fadeIn 0.15s ease;
}
.mention-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  cursor: pointer;
  transition: background var(--transition);
  font-size: 13px;
}
.mention-item:hover,
.mention-item.active { background: var(--bg-hover); }
.mention-item-type {
  font-size: 11px;
  color: var(--text-muted);
  margin-left: auto;
}

/* ---- GIF Picker ---- */
.gif-picker-panel {
  padding: 0 10px 8px;
}
.gif-picker-inner {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: visible;
}
.gif-search-bar {
  padding: 8px;
  border-bottom: 1px solid var(--border-light);
}
.gif-search-bar input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px 10px;
  color: var(--text-primary);
  font-size: 13px;
  outline: none;
  font-family: inherit;
  transition: border-color 0.2s;
}
.gif-search-bar input:focus { border-color: rgba(192,57,43,0.5); }
.gif-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 3px;
  padding: 6px;
  max-height: 210px;
  overflow-y: auto;
}
.gif-item {
  height: 72px;
  overflow: hidden;
  border-radius: 5px;
  cursor: pointer;
  background: var(--bg-hover);
  transition: transform 0.15s;
  display: block;
}
.gif-item:hover { transform: scale(1.05); }
.gif-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gif-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 16px 10px;
  color: var(--text-muted);
  font-size: 12px;
}

/* Bouton image dans l'input */
.chat-img-btn {
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 6px;
  border-radius: var(--radius);
  font-size: 17px;
  display: flex;
  align-items: center;
  transition: color var(--transition);
  flex-shrink: 0;
}
.chat-img-btn:hover { color: var(--text-primary); }

/* Image dans les messages */
.msg-image-wrap { margin-top: 6px; }
.msg-image {
  max-width: 320px;
  max-height: 280px;
  border-radius: var(--radius);
  display: block;
  cursor: zoom-in;
  border: 1px solid var(--border);
  transition: opacity 0.2s, transform 0.2s;
  object-fit: cover;
}
.msg-image:hover { opacity: 0.92; transform: scale(1.01); }

/* Actions au survol d'un message */
.msg { position: relative; }
.msg-actions {
  display: none;
  position: absolute;
  top: -14px;
  right: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 2px 4px;
  gap: 2px;
  align-items: center;
  z-index: 10;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.msg:hover .msg-actions { display: flex; }
.msg-action-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 13px;
  padding: 3px 6px;
  border-radius: 5px;
  transition: color 0.15s, background 0.15s;
  line-height: 1;
}
.msg-action-btn:hover { color: var(--text-primary); background: var(--bg-hover); }

/* Référence de réponse (style Discord) */
.msg-reply-ref {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: 17px;
  margin-bottom: 2px;
  font-size: 12px;
  color: var(--text-muted);
  overflow: hidden;
  position: relative;
  cursor: default;
}
.msg-reply-ref::before {
  content: '';
  display: inline-block;
  width: 22px;
  height: 11px;
  border-top: 2px solid var(--border);
  border-left: 2px solid var(--border);
  border-top-left-radius: 6px;
  flex-shrink: 0;
  align-self: flex-end;
  margin-bottom: -1px;
}
.msg-reply-ref-author {
  font-weight: 600;
  color: var(--text-secondary);
  flex-shrink: 0;
  white-space: nowrap;
}
.msg-reply-ref-preview {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}

/* Barre de réponse au-dessus de l'input */
.reply-bar-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-secondary);
  border-left: 3px solid var(--red);
  border-radius: 0 6px 6px 0;
  padding: 6px 10px;
  margin: 8px 12px 0;
  font-size: 12px;
}
.reply-bar-author { color: var(--text-primary); font-weight: 600; flex-shrink: 0; }
.reply-bar-preview { color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.reply-bar-close {
  background: none; border: none; color: var(--text-muted);
  cursor: pointer; font-size: 15px; padding: 0 2px; flex-shrink: 0; line-height: 1;
}
.reply-bar-close:hover { color: var(--text-primary); }

.msg-delete-btn {
  margin-left: 6px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 12px;
  display: none;
  padding: 2px 4px;
  border-radius: 4px;
  color: var(--text-muted);
  transition: color var(--transition), background var(--transition);
}
.is-owner .msg:hover .msg-delete-btn { display: inline-block; }
.msg-delete-btn:hover { color: var(--red) !important; background: rgba(192,57,43,0.15); }

/* Message groupé (même auteur) */
.msg.grouped { padding-top: 1px; }
.msg.grouped .msg-avatar { visibility: hidden; }

.chat-input-area {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  background: var(--bg-secondary);
  flex-shrink: 0;
}
.chat-input-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #101018;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0 10px;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}
.chat-input-wrap:focus-within {
  border-color: rgba(192,57,43,0.45);
  box-shadow: 0 0 0 3px rgba(192,57,43,0.08), 0 2px 12px rgba(0,0,0,0.2);
}
.chat-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  padding: 11px 4px;
  color: var(--text-primary);
  font-size: 14px;
}
.chat-input::placeholder { color: var(--text-muted); }
.chat-send-btn {
  color: var(--text-muted);
  padding: 4px;
  border-radius: var(--radius);
  transition: color var(--transition);
  font-size: 16px;
}
.chat-send-btn:hover { color: var(--red); }

/* ============================================
   PAGE — ADMIN
   ============================================ */

.admin-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 20px;
}

.accounts-table {
  width: 100%;
  border-collapse: collapse;
}
.accounts-table th {
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
}
.accounts-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-light);
  font-size: 13px;
  color: var(--text-secondary);
  vertical-align: middle;
}
.accounts-table tr:last-child td { border-bottom: none; }
.accounts-table tr:hover td { background: var(--bg-hover); color: var(--text-primary); }
.accounts-table .td-name {
  font-weight: 500;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}
.accounts-table .td-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}
.icon-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  transition: all var(--transition);
  color: var(--text-muted);
}
.icon-btn:hover { background: var(--bg-hover); color: var(--text-primary); }
.icon-btn.danger:hover { background: rgba(192,57,43,0.15); color: var(--red); }

.create-form { display: flex; flex-direction: column; gap: 14px; }
.create-form .btn-primary {
  justify-content: center;
  width: 100%;
  margin-top: 4px;
}

/* Select */
select.input-field {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%235a5a6e' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}
select.input-field option { background: var(--bg-card); }

/* ============================================
   PAGE — RÉUNION
   ============================================ */

/* Carte prochaine réunion */
.next-reunion-display {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  margin-bottom: 0;
  position: relative;
  overflow: hidden;
}
.next-reunion-display::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--red), transparent);
}
.next-reunion-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}
.next-reunion-icon  { font-size: 40px; flex-shrink: 0; }
.next-reunion-info  { flex: 1; min-width: 200px; }
.next-reunion-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.next-reunion-date {
  font-family: 'Cinzel', serif;
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}
.next-reunion-time {
  font-size: 26px;
  font-weight: 700;
  color: var(--red);
  margin-top: 4px;
  letter-spacing: 1px;
}
.next-reunion-right { margin-left: auto; text-align: right; flex-shrink: 0; }
.next-reunion-empty {
  text-align: center;
  padding: 24px;
  color: var(--text-secondary);
}

/* Countdown badge */
.reunion-countdown {
  display: inline-block;
  background: rgba(192,57,43,0.12);
  color: var(--red);
  border: 1px solid var(--red-border);
  border-radius: var(--radius);
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
}
.reunion-countdown.urgent {
  background: rgba(192,57,43,0.2);
  animation: pulse-border 2s infinite;
}
@keyframes pulse-border {
  0%, 100% { box-shadow: 0 0 0 0 rgba(192,57,43,0.3); }
  50%       { box-shadow: 0 0 0 5px rgba(192,57,43,0); }
}

/* Liste des réunions */
.reunion-item {
  display: flex;
  flex-direction: column;
  padding: 11px 14px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background var(--transition);
  margin-bottom: 4px;
  border-left: 2px solid transparent;
}
.reunion-item:hover    { background: var(--bg-hover); }
.reunion-item.selected { background: rgba(192,57,43,0.08); border-left-color: var(--red); }
.reunion-item.upcoming { }

/* Badges statut */
.reunion-status {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.reunion-status.planifiee {
  background: rgba(34,197,94,0.12);
  color: var(--grade-moderateur);
  border: 1px solid rgba(34,197,94,0.25);
}
.reunion-status.terminee {
  background: rgba(90,90,110,0.2);
  color: var(--text-muted);
  border: 1px solid rgba(90,90,110,0.3);
}

/* ============================================
   PAGE — ABSENCES
   ============================================ */

.absence-item {
  padding: 12px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 10px;
  animation: fadeIn 0.2s ease;
}
.absence-header {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.absence-author {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}
.absence-dates {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-primary);
  background: rgba(192,57,43,0.1);
  border: 1px solid var(--red-border);
  border-radius: 4px;
  padding: 1px 7px;
}
.absence-created {
  font-size: 11px;
  color: var(--text-muted);
}
.absence-motif {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-top: 4px;
  padding-top: 6px;
  border-top: 1px solid var(--border-light);
  white-space: pre-wrap;
}

/* Comptes rendus (vue membre) */
.compte-rendu-item {
  padding: 14px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-left: 3px solid var(--red-border);
  border-radius: var(--radius);
  margin-bottom: 12px;
  animation: fadeIn 0.2s ease;
}
.compte-rendu-date {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
  text-transform: capitalize;
}
.compte-rendu-content {
  font-size: 13px;
  color: var(--text-primary);
  line-height: 1.6;
  white-space: pre-wrap;
}

/* Remontées */
.remontee-item {
  padding: 10px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-left: 2px solid var(--red-border);
  border-radius: var(--radius);
  margin-bottom: 8px;
  animation: fadeIn 0.2s ease;
}

/* ============================================
   PAGE — SUIVI STAFF
   ============================================ */

.suivi-section-title {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 6px 12px 4px;
}

.member-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background var(--transition), border-left var(--transition);
  margin-bottom: 2px;
  border-left: 2px solid transparent;
}
.member-row {
  transition: background 0.2s ease, transform 0.15s ease, border-color 0.2s ease;
}
.member-row:hover   { background: var(--bg-hover); transform: translateX(3px); }
.member-row.selected {
  background: linear-gradient(90deg, rgba(192,57,43,0.1) 0%, rgba(192,57,43,0.02) 100%);
  border-left: 3px solid var(--red);
  box-shadow: inset 0 0 20px rgba(192,57,43,0.03);
}

/* Tags blame / surveillance */
.tag-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.3px;
}
.tag-badge.blame {
  background: rgba(192,57,43,0.15);
  color: #fca5a5;
  border: 1px solid rgba(192,57,43,0.3);
}
.tag-badge.surveille {
  background: rgba(249,115,22,0.12);
  color: #fdba74;
  border: 1px solid rgba(249,115,22,0.3);
}

/* Panneau membre */
.member-panel-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

/* Notes */
.note-textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  color: var(--text-primary);
  font-size: 13px;
  resize: vertical;
  min-height: 72px;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  font-family: inherit;
}
.note-textarea:focus {
  border-color: rgba(192,57,43,0.5);
  box-shadow: 0 0 0 3px var(--red-glow), inset 0 1px 3px rgba(0,0,0,0.15);
  background: #141420;
}
.note-textarea::placeholder { color: var(--text-muted); }

.note-item {
  padding: 10px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 8px;
  animation: fadeIn 0.2s ease;
}
.note-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
}
.note-author { font-size: 12px; font-weight: 600; color: var(--text-primary); }
.note-date   { font-size: 11px; color: var(--text-muted); }
.note-delete {
  margin-left: auto;
  font-size: 11px;
  color: var(--text-muted);
  padding: 2px 5px;
  border-radius: 3px;
  transition: color var(--transition), background var(--transition);
}
.note-delete:hover { color: var(--red); background: rgba(192,57,43,0.1); }
.note-content { font-size: 13px; color: var(--text-secondary); line-height: 1.5; }

/* ============================================
   ANNONCES STAFF
   ============================================ */

.annonces-section {
  background: linear-gradient(135deg, rgba(240,192,64,0.06) 0%, rgba(192,57,43,0.04) 100%);
  border: 1px solid rgba(240,192,64,0.25);
  border-left: 4px solid #f0c040;
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  margin-bottom: 22px;
}

.annonces-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.annonces-title {
  font-size: 15px;
  font-weight: 700;
  color: #f0c040;
  letter-spacing: 0.2px;
}

.annonces-subtitle {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 1px;
}

/* Conteneur scrollable — hauteur fixe */
.annonces-scroll {
  margin-top: 14px;
  max-height: 260px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(240,192,64,0.2) transparent;
}
.annonces-scroll::-webkit-scrollbar { width: 4px; }
.annonces-scroll::-webkit-scrollbar-track { background: transparent; }
.annonces-scroll::-webkit-scrollbar-thumb { background: rgba(240,192,64,0.25); border-radius: 4px; }

.annonce-card {
  background: rgba(240,192,64,0.03);
  border: 1px solid rgba(240,192,64,0.10);
  border-radius: var(--radius);
  padding: 12px 14px;
  flex-shrink: 0;
  transition: border-color var(--transition);
}
.annonce-card:hover { border-color: rgba(240,192,64,0.22); }

/* Dernière annonce mise en avant */
.annonce-latest {
  background: rgba(240,192,64,0.07);
  border-color: rgba(240,192,64,0.28);
}

.annonce-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.annonce-num {
  font-size: 11px;
  font-weight: 700;
  color: rgba(240,192,64,0.55);
  min-width: 24px;
  flex-shrink: 0;
}
.annonce-latest .annonce-num { color: #f0c040; }

.annonce-new-badge {
  font-size: 10px;
  font-weight: 700;
  background: rgba(240,192,64,0.18);
  color: #f0c040;
  border: 1px solid rgba(240,192,64,0.35);
  border-radius: 99px;
  padding: 1px 7px;
  letter-spacing: 0.3px;
}

.annonce-author {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.annonce-date {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 1px;
}

.annonce-content {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.65;
  white-space: pre-wrap;
  padding-left: 32px;
}

/* ============================================
   FLATPICKR — Overrides thème sombre
   ============================================ */

.flatpickr-calendar {
  background: var(--bg-card) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5) !important;
  font-family: 'Inter', sans-serif !important;
}

.flatpickr-calendar.arrowTop::before,
.flatpickr-calendar.arrowTop::after { border-bottom-color: var(--border) !important; }
.flatpickr-calendar.arrowBottom::before,
.flatpickr-calendar.arrowBottom::after { border-top-color: var(--border) !important; }

.flatpickr-months { background: var(--bg-secondary) !important; border-radius: var(--radius-lg) var(--radius-lg) 0 0 !important; padding: 6px 0 !important; }
.flatpickr-month  { color: var(--text-primary) !important; fill: var(--text-primary) !important; }
.flatpickr-current-month span.cur-month,
.flatpickr-current-month input.cur-year { color: var(--text-primary) !important; font-weight: 600 !important; font-size: 14px !important; }
.flatpickr-prev-month svg,
.flatpickr-next-month svg { fill: var(--text-secondary) !important; }
.flatpickr-prev-month:hover svg,
.flatpickr-next-month:hover svg { fill: var(--text-primary) !important; }

.flatpickr-weekdays { background: var(--bg-secondary) !important; }
span.flatpickr-weekday { color: var(--text-muted) !important; font-size: 11px !important; font-weight: 600 !important; }

.flatpickr-day {
  color: var(--text-primary) !important;
  border-radius: 6px !important;
  font-size: 13px !important;
}
.flatpickr-day:hover { background: var(--bg-hover) !important; border-color: transparent !important; }
.flatpickr-day.selected,
.flatpickr-day.selected:hover {
  background: var(--red) !important;
  border-color: var(--red) !important;
  color: #fff !important;
}
.flatpickr-day.today { border-color: var(--red) !important; }
.flatpickr-day.today:hover { background: rgba(192,57,43,0.2) !important; }
.flatpickr-day.flatpickr-disabled,
.flatpickr-day.flatpickr-disabled:hover { color: var(--text-muted) !important; }
.flatpickr-day.prevMonthDay,
.flatpickr-day.nextMonthDay { color: var(--text-muted) !important; }

/* Time picker */
.flatpickr-time { border-top: 1px solid var(--border) !important; background: var(--bg-secondary) !important; border-radius: 0 0 var(--radius-lg) var(--radius-lg) !important; }
.flatpickr-time input,
.flatpickr-time .flatpickr-time-separator,
.flatpickr-time .flatpickr-am-pm {
  color: var(--text-primary) !important;
  background: transparent !important;
  font-size: 16px !important;
  font-weight: 500 !important;
}
.flatpickr-time input:hover,
.flatpickr-time input:focus { background: var(--bg-hover) !important; }

/* Alt input (champ affiché à l'utilisateur) */
.flatpickr-input.form-control.input,
input.flatpickr-input.flatpickr-mobile { cursor: pointer !important; }

/* ============================================
   SUIVI — TABS
   ============================================ */

.suivi-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 4px;
  width: fit-content;
}

.suivi-tab {
  background: none;
  border: none;
  border-radius: 6px;
  padding: 7px 18px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}

.suivi-tab:hover { background: var(--bg-hover); color: var(--text-primary); }
.suivi-tab.active { background: var(--bg-card); color: var(--text-primary); box-shadow: 0 1px 4px rgba(0,0,0,0.3); }

/* ============================================
   ENTRETIENS — BADGES STATUT
   ============================================ */

.entretien-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
  flex-shrink: 0;
}

.entretien-attente {
  background: rgba(234,179,8,0.12);
  color: #eab308;
  border: 1px solid rgba(234,179,8,0.3);
}

.entretien-valide {
  background: rgba(34,197,94,0.12);
  color: #22c55e;
  border: 1px solid rgba(34,197,94,0.3);
}

.entretien-refuse {
  background: rgba(192,57,43,0.12);
  color: var(--red);
  border: 1px solid var(--red-border);
}

/* ============================================
   UTILITAIRES
   ============================================ */

.flex { display: flex; }
.items-center { align-items: center; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 12px; }
.font-cinzel { font-family: 'Cinzel', serif; }
.ml-auto { margin-left: auto; }

/* ============================================
   RESPONSIVE — MOBILE
   ============================================ */

/* Overlay sombre derrière la sidebar mobile */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  z-index: 299;
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  animation: fadeIn 0.2s ease;
}
.sidebar-overlay.active { display: block; }

/* Barre de navigation mobile (cachée sur desktop) */
.mobile-topbar {
  display: none;
}

@media (max-width: 768px) {

  /* --- Sidebar : overlay fixe glissant --- */
  .sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 300;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    width: 260px;
    min-width: 260px;
    box-shadow: none;
  }
  .sidebar.mobile-open {
    transform: translateX(0);
    box-shadow: 6px 0 40px rgba(0, 0, 0, 0.6);
  }

  /* --- Barre mobile en haut --- */
  .mobile-topbar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: linear-gradient(90deg, #0f0f18 0%, #111119 100%);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    flex-shrink: 0;
  }
  .mobile-topbar .hamburger-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 22px;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: var(--radius);
    transition: background 0.2s ease, color 0.2s ease;
    display: flex;
    align-items: center;
    line-height: 1;
    flex-shrink: 0;
  }
  .mobile-topbar .hamburger-btn:hover { background: var(--bg-hover); color: var(--text-primary); }
  .mobile-topbar .topbar-logo-img {
    width: 26px; height: 26px;
    border-radius: 6px;
    object-fit: contain;
    flex-shrink: 0;
  }
  .mobile-topbar .topbar-title {
    font-family: 'Cinzel', serif;
    font-size: 13px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--text-primary) 40%, rgba(240,192,64,0.7) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .mobile-topbar .topbar-sub {
    font-size: 9px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
  }
  .mobile-topbar .topbar-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
  }
  .mobile-topbar .topbar-avatar {
    width: 28px; height: 28px;
    border-radius: 50%;
    background: var(--bg-hover);
    border: 1px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    font-size: 11px; font-weight: 600;
    overflow: hidden;
    flex-shrink: 0;
  }
  .mobile-topbar .topbar-avatar img { width:100%; height:100%; object-fit:cover; border-radius:50%; }

  /* --- Layout principal : pleine largeur --- */
  .app-layout { flex-direction: column; }
  .main-content {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    width: 100%;
  }

  /* --- Padding réduit --- */
  .page-header { padding: 14px 14px 0; }
  .page-body   { padding: 12px 14px 20px; }
  .page-header h1 { font-size: 18px; }

  /* --- Cards --- */
  .card { padding: 14px; }

  /* --- Stats grid : 2 colonnes --- */
  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .stat-card { padding: 14px 12px; }
  .stat-icon { width: 36px; height: 36px; font-size: 16px; }
  .stat-info .stat-value { font-size: 20px; }

  /* --- Dashboard grid : 1 colonne --- */
  .dashboard-grid { grid-template-columns: 1fr; }

  /* --- Admin grid : 1 colonne --- */
  .admin-grid {
    grid-template-columns: 1fr !important;
    gap: 14px;
  }

  /* --- Tableau comptes : scroll horizontal --- */
  .accounts-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .accounts-table { min-width: 520px; }

  /* --- Chat layout : colonne + channels en bandeau horizontal --- */
  .chat-layout { flex-direction: column; height: 100%; }

  .chat-members {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 220px;
    z-index: 300;
    transform: translateX(100%);
    transition: transform 0.25s ease;
    border-left: 1px solid var(--border);
  }
  .chat-members.mobile-open {
    transform: translateX(0);
  }

  .chat-channels {
    width: 100%;
    min-width: unset;
    border-right: none;
    border-bottom: 1px solid var(--border);
    height: 0;
    overflow: hidden;
    flex-shrink: 0;
    transition: height 0.3s ease;
  }
  .chat-channels.mobile-open {
    height: auto;
    max-height: 220px;
    overflow-y: auto;
  }
  .chat-main {
    flex: 1;
    min-height: 0;
  }
  .chat-messages { padding: 10px 12px; }
  .chat-input-area { padding: 8px 12px; }

  /* --- DM liste : taille réduite --- */
  #dm-members-list .channel-item { font-size: 12px; padding: 6px 10px; }

  /* --- Reunion layout : 1 colonne --- */
  .reunion-layout {
    grid-template-columns: 1fr !important;
  }
  .reunion-panel {
    min-width: unset !important;
  }

  /* --- Suivi admin-grid --- */
  .suivi-tabs { width: 100%; justify-content: center; }
  .suivi-tab { flex: 1; text-align: center; }

  /* --- Entretiens grid --- */
  .entretiens-grid {
    grid-template-columns: 1fr !important;
  }

  /* --- Absences : colonne --- */
  .absences-grid {
    grid-template-columns: 1fr !important;
  }

  /* --- Annonces section --- */
  .annonces-section { padding: 14px; }
  .annonce-card { padding: 12px 14px; }

  /* --- Login page --- */
  .login-card {
    margin: 16px;
    padding: 28px 20px;
  }

  /* --- Btn taille mobile --- */
  .btn { padding: 8px 14px; font-size: 13px; }

  /* --- Member panel : prend toute la largeur --- */
  .member-panel { padding: 12px; }
  .member-panel-head { gap: 10px; }

  /* --- Reunion next card --- */
  .next-reunion-display { padding: 14px; }
  .reunion-countdown { font-size: 20px; }
}

@media (max-width: 480px) {
  /* Sur très petits écrans : stats en 1 colonne */
  .stats-grid { grid-template-columns: 1fr; }

  /* Chat input plus grand pour le touch */
  .chat-input { font-size: 16px; } /* évite le zoom iOS */
  .chat-input-wrap { border-radius: 12px; }

  /* Page header encore plus compact */
  .page-header { padding: 10px 12px 0; }
  .page-body   { padding: 10px 12px 16px; }
}

/* ---- Page chat : layout spécial mobile ---- */
@media (max-width: 768px) {
  /* Le wrapper flex du chat devient colonne sur mobile */
  .chat-page .main-content {
    flex-direction: column !important;
  }
  /* chat-main prend tout l'espace restant après topbar + channels */
  .chat-page .chat-main {
    flex: 1;
    min-height: 0;
    overflow: hidden;
  }
}

/* Cacher le topbar mobile sur desktop + agrandissement des polices */
@media (min-width: 769px) {
  .mobile-topbar  { display: none !important; }
  .sidebar-overlay { display: none !important; }

  /* Tailles de police agrandies sur desktop */
  html, body              { font-size: 15px; }
  .page-header h1         { font-size: 27px; }
  .page-header p          { font-size: 14px; }
  .stat-info .stat-value  { font-size: 28px; }
  .card-header h3         { font-size: 15px; }
  .activity-text          { font-size: 14px; }
  .online-name            { font-size: 14px; }
  .chat-header h4         { font-size: 15px; }
  .nav-item               { font-size: 14px; }
}

/* Grille dates absences */
.dates-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
@media (max-width: 480px) {
  .dates-grid { grid-template-columns: 1fr; }
}

/* ============================================
   TICKETS & SIGNALEMENTS
   ============================================ */

/* Grille catégories */
.ticket-category-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
@media (max-width: 600px) {
  .ticket-category-grid { grid-template-columns: repeat(2, 1fr); }
}

.ticket-category-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 10px;
  background: var(--bg-input);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.15s ease;
  text-align: center;
}
.ticket-category-card:hover {
  background: var(--bg-hover);
  border-color: rgba(192,57,43,0.3);
  transform: translateY(-2px);
}
.ticket-category-card.selected {
  border-color: var(--red);
  background: rgba(192,57,43,0.08);
  box-shadow: 0 0 0 3px rgba(192,57,43,0.12);
}
.tc-icon  { font-size: 22px; line-height: 1; }
.tc-label { font-size: 12px; font-weight: 500; color: var(--text-secondary); }
.ticket-category-card.selected .tc-label { color: var(--text-primary); }

/* Ligne ticket (mes tickets) */
.ticket-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius);
  border-left: 3px solid transparent;
  margin-bottom: 4px;
  transition: background 0.2s ease, border-color 0.2s ease;
}
.ticket-row:hover { background: var(--bg-hover); }
.ticket-row-left  { display: flex; align-items: center; gap: 10px; }
.ticket-cat-icon  { font-size: 20px; flex-shrink: 0; }

/* Badges de statut */
.ticket-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.ts-ouvert   { color: #93c5fd; background: rgba(59,130,246,0.12);  border: 1px solid rgba(59,130,246,0.25); }
.ts-en-cours { color: #fdba74; background: rgba(249,115,22,0.12);  border: 1px solid rgba(249,115,22,0.25); }
.ts-standby  { color: #d8b4fe; background: rgba(168,85,247,0.12); border: 1px solid rgba(168,85,247,0.25); }
.ts-attente  { color: #fde68a; background: rgba(234,179,8,0.12);  border: 1px solid rgba(234,179,8,0.25);  }
.ts-termine  { color: #86efac; background: rgba(34,197,94,0.12);  border: 1px solid rgba(34,197,94,0.25);  }
.ts-refuse   { color: #fca5a5; background: rgba(192,57,43,0.12);  border: 1px solid rgba(192,57,43,0.3);   }

/* Filtres de gestion */
.ticket-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}
.ticket-filter-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}
.ticket-filter-btn:hover { background: var(--bg-hover); color: var(--text-primary); }
.ticket-filter-btn.active {
  background: rgba(192,57,43,0.12);
  border-color: var(--red-border);
  color: var(--text-primary);
}

/* ---- Commentaires tickets ---- */
.ticket-comments-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 280px;
  overflow-y: auto;
  padding-right: 2px;
}
.ticket-comment {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 10px;
  animation: fadeIn 0.2s ease;
}
.ticket-comment.own {
  background: rgba(192,57,43,0.05);
  border-color: rgba(192,57,43,0.18);
}
.tc-comment-head {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 5px;
  flex-wrap: wrap;
}
.tc-comment-author { font-size: 12px; font-weight: 600; }
.tc-comment-date   { font-size: 11px; color: var(--text-muted); margin-left: auto; }
.tc-comment-body   { font-size: 13px; color: var(--text-secondary); line-height: 1.5; white-space: pre-wrap; word-break: break-word; }

/* ============================================
   ORGANIGRAMME
   ============================================ */

.org-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 32px 24px;
  overflow-x: auto;
  overflow-y: auto;
  flex: 1;
}

.org-page-title {
  font-family: 'Cinzel', serif;
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-primary);
}
.org-page-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 36px;
}

/* Layout principal : arbre + dev aside */
.org-chart-wrapper {
  display: flex;
  align-items: flex-start;
  gap: 48px;
}

/* Colonne principale de l'arbre */
.org-main {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Ligne de niveau (une ou plusieurs boxes côte à côte) */
.org-level {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

/* Connecteur vertical entre niveaux */
.org-vconn {
  width: 2px;
  height: 32px;
  background: var(--border);
  flex-shrink: 0;
}

/* Conteneur des deux branches (Gérant RP + Gérant Staff) */
.org-branches {
  display: flex;
  align-items: flex-start;
}

/* Branche individuelle */
.org-branch {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  padding-top: 32px; /* espace pour le T-bar */
  min-width: 200px;
}

/* Connecteur vertical depuis le T-bar vers la box */
.org-branch::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  height: 32px;
  background: var(--border);
}

/* Moitié droite du T-bar (branche gauche = first-child) */
.org-branch:first-child::after {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  right: 0;
  height: 2px;
  background: var(--border);
}

/* Moitié gauche du T-bar (branche droite = last-child) */
.org-branch:last-child::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 50%;
  height: 2px;
  background: var(--border);
}

/* Box d'un niveau de grade */
.org-node-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  min-width: 150px;
  max-width: 240px;
  text-align: center;
  border-top-width: 3px;
}

.org-node-grade-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 10px;
}

.org-members-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Carte membre */
.org-member-card {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 10px;
  border-radius: var(--radius);
  background: var(--bg-secondary);
  text-align: left;
  transition: background var(--transition);
}
.org-member-card:hover { background: var(--bg-hover); }

.org-member-avatar {
  position: relative;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}
.org-member-avatar img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
}
.org-member-avatar-letter {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-hover);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
}

.org-online-dot {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 9px;
  height: 9px;
  background: #22c55e;
  border-radius: 50%;
  border: 2px solid var(--bg-secondary);
}
.org-online-dot.hidden { display: none; }

.org-member-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.org-member-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 150px;
}

.org-empty-slot {
  color: var(--text-muted);
  font-size: 11px;
  font-style: italic;
  padding: 4px 0;
  text-align: center;
}

.spinner {
  width: 22px;
  height: 22px;
  border: 2px solid var(--border);
  border-top-color: var(--red);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Section développeur (à part) */
.org-dev-aside {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding-top: 16px;
  border-left: 2px dashed var(--border);
  padding-left: 40px;
  margin-left: 8px;
}

.org-aside-tag {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
  text-align: center;
}

@media (max-width: 900px) {
  .org-chart-wrapper { flex-direction: column; align-items: center; }
  .org-dev-aside { border-left: none; border-top: 2px dashed var(--border); padding-left: 0; padding-top: 24px; margin-left: 0; margin-top: 16px; flex-direction: row; gap: 24px; align-items: flex-start; }
  .org-branches { flex-direction: column; align-items: center; }
  .org-branch { min-width: 160px; }
  .org-branch:first-child::after, .org-branch:last-child::after { display: none; }
  .org-branch::before { display: none; }
  .org-branch { padding-top: 0; }
}
