/* e-Consulaire RDC — Design System Tokens */
:root {
  /* Palette RDC */
  --rdc-blue: #0066CC; --rdc-yellow: #FFD700; --rdc-red: #CE1126;

  /* Fond & surfaces */
  --bg-app: #F8FAFC;
  --surface-white: #ffffff;
  --surface-glass: rgba(255,255,255,0.65);
  --border-glass: rgba(255,255,255,0.35);
  --border-soft: rgba(0,0,0,0.06);

  /* Theme par défaut (citoyen) */
  --primary: #1A3A6B;
  --primary-to: #0D6EFD;
  --primary-light: rgba(26,58,107,0.08);
  --primary-border: rgba(26,58,107,0.20);
  --primary-glow: rgba(26,58,107,0.25);

  /* Shadows */
  --shadow-soft: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
  --shadow-glass: 0 8px 32px rgba(0,0,0,0.08), inset 0 1px 0 rgba(255,255,255,0.6);

  /* Typography */
  --font-ui: 'Inter', sans-serif;
  --font-display: 'Outfit', sans-serif;

  /* Sidebar */
  --sidebar-width: 280px;
  --sidebar-collapsed: 72px;

  /* Z-index */
  --z-dropdown: 10; --z-sticky: 20; --z-modal: 30; --z-toast: 40; --z-tooltip: 50;
}

/* Themes par rôle */
.theme-superadmin {
  --primary: #C0392B; --primary-to: #8B0000;
  --primary-light: rgba(192,57,43,0.08);
  --primary-border: rgba(192,57,43,0.20);
  --primary-glow: rgba(192,57,43,0.25);
}
.theme-consulaire {
  --primary: #F0A500; --primary-to: #C77D00;
  --primary-light: rgba(240,165,0,0.08);
  --primary-border: rgba(240,165,0,0.20);
  --primary-glow: rgba(240,165,0,0.25);
}
.theme-citoyen {
  --primary: #1A3A6B; --primary-to: #0D6EFD;
  --primary-light: rgba(26,58,107,0.08);
  --primary-border: rgba(26,58,107,0.20);
  --primary-glow: rgba(26,58,107,0.25);
}

/* Glassmorphisme */
.glass-card {
  background: var(--surface-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-glass);
  box-shadow: var(--shadow-glass);
}
/* Variante solide — fond blanc opaque */
.glass-card-solid {
  background: #ffffff;
  border: 1px solid var(--border-soft);
  box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 4px 16px rgba(0,0,0,0.04);
}
/* Card white — simple white card */
.card-white {
  background: #ffffff;
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-soft);
}
/* badge-status — wrapper neutre */
.badge-status { display: inline-flex; align-items: center; padding: 2px 10px; border-radius: 9999px; font-size: 0.75rem; font-weight: 500; }

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background: linear-gradient(180deg, #ffffff 0%, #f9fafb 100%);
  border-right: 1px solid var(--border-soft);
  box-shadow: 2px 0 10px rgba(0,0,0,0.04);
  transition: width 0.3s ease;
}
.sidebar.collapsed { width: var(--sidebar-collapsed); }
.sidebar-link {
  border-left: 3px solid transparent;
  transition: all 0.2s ease;
  color: #6b7280;
}
.sidebar-link:hover, .sidebar-link.active {
  background: var(--primary-light);
  border-left-color: var(--primary);
  color: var(--primary);
}

/* Btn primary */
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-to));
  color: white; border-radius: 10px; font-weight: 500;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px var(--primary-glow);
  display: inline-flex; align-items: center; justify-content: center;
  gap: 0.375rem; padding: 0.5rem 1.125rem; font-size: 0.875rem;
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px var(--primary-glow);
}

.btn-secondary {
  background: #F3F4F6;
  color: #374151; border-radius: 10px; font-weight: 500;
  border: 1px solid var(--border-soft);
  transition: all 0.2s ease;
  display: inline-flex; align-items: center; justify-content: center;
  gap: 0.375rem; padding: 0.5rem 1.125rem; font-size: 0.875rem;
}
.btn-secondary:hover {
  background: #E5E7EB;
  transform: translateY(-1px);
}

.btn-danger {
  background: linear-gradient(135deg, #DC2626, #991B1B);
  color: white; border-radius: 10px; font-weight: 500;
  transition: all 0.2s ease;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.2);
}
.btn-danger:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(220, 38, 38, 0.3);
}

.btn-outline {
  background: transparent;
  color: var(--primary); border-radius: 10px; font-weight: 500;
  border: 1px solid var(--primary-border);
  transition: all 0.2s ease;
  display: inline-flex; align-items: center; justify-content: center;
}
.btn-outline:hover {
  background: var(--primary-light);
  transform: translateY(-1px);
}

/* Cercles décoratifs */
.deco-circle {
  position: fixed; border-radius: 50%; pointer-events: none; z-index: 0;
  background: radial-gradient(circle, var(--primary-light), transparent);
}

/* Main content offset */
.main-content {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  transition: margin-left 0.3s ease;
}

/* Stat card */
.stat-card {
  background: var(--surface-white);
  border: 1px solid var(--border-soft);
  border-radius: 16px;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-soft);
}
.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* Badge statuts */
.badge { display: inline-flex; align-items: center; padding: 2px 10px; border-radius: 9999px; font-size: 0.75rem; font-weight: 500; }
.badge-pending { background: #FEF3C7; color: #92400E; }
.badge-success { background: #D1FAE5; color: #065F46; }
.badge-error   { background: #FEE2E2; color: #991B1B; }
.badge-info    { background: #DBEAFE; color: #1E40AF; }
.badge-gray    { background: #F3F4F6; color: #374151; }

/* Input styles */
.input-base {
  width: 100%; border: 1px solid #e2e8f0; border-radius: 12px; background-color: rgba(248, 250, 252, 0.5);
  padding: 10px 16px; font-size: 0.875rem;
  transition: all 0.2s ease; outline: none;
  font-family: var(--font-ui);
}
.input-base:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}
.input-light {
  width: 100%; border: 1px solid #e2e8f0; border-radius: 8px; background-color: #f8fafc;
  padding: 8px 12px; font-size: 0.875rem;
  transition: all 0.2s ease; outline: none;
  font-family: var(--font-ui);
}
.input-light:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-light);
}
.input-error { border-color: #F87171; }
.input-error:focus { box-shadow: 0 0 0 3px rgba(248,113,113,0.15); }
.input-success { border-color: #34D399; }

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.02);
  border-radius: 8px;
}
::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.15);
  border-radius: 8px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.25);
}

/* Custom Select globally */
select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-color: white;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 1em;
  padding-right: 2.5rem !important;
}

/* Toast */
.toast {
  display: flex; align-items: center; gap: 12px;
  background: white; border-radius: 12px; padding: 12px 16px;
  box-shadow: var(--shadow-lg); min-width: 280px;
  animation: slideIn 0.3s ease;
}
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* Table */
.table-row { transition: background 0.15s ease; }
.table-row:hover { background: #F9FAFB; }

.table-light {
  width: 100%; border-collapse: collapse;
}
.table-light thead {
  background-color: rgba(248, 250, 252, 0.5);
  border-bottom: 1px solid #e2e8f0;
}
.table-light th {
  padding: 12px 16px; text-align: left; font-weight: 600; color: #6b7280; font-size: 0.75rem;
}
.table-light td {
  padding: 12px 16px; border-bottom: 1px solid #f3f4f6; color: #374151;
}
.table-light tbody tr {
  transition: background-color 0.15s ease;
}
.table-light tbody tr:hover {
  background-color: #f9fafb;
}

/* Responsive sidebar mobile */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); transition: transform 0.3s ease; }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
}
