:root {
  --c1: #6366f1;
  --c2: #06b6d4;
  --c3: #8b5cf6;
  --c4: #ec4899;
  --c5: #10b981;
  --bg-soft: #f4f6fb;
  --card-bg: #ffffffcc;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: 'Inter', system-ui, sans-serif;
  color: var(--text-main);
  min-height: 100vh;
  background: var(--bg-soft);
}

h1, h2, h3, h4, .font-display {
  font-family: 'Poppins', 'Inter', sans-serif;
}

/* ===== Fond animé doux (dégradé multicolore lent) ===== */
.app-bg-anim {
  position: fixed;
  inset: 0;
  z-index: -1;
  background: linear-gradient(120deg, #eef2ff, #e0f2fe, #f5f3ff, #fdf2f8, #ecfdf5, #eef2ff);
  background-size: 400% 400%;
  animation: gradientShift 22s ease infinite;
}

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

/* ===== Logo animé ===== */
.brand-logo {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background: linear-gradient(135deg, var(--c1), var(--c2), var(--c3), var(--c4));
  background-size: 300% 300%;
  animation: logoColorShift 6s ease infinite, logoPulse 3s ease-in-out infinite;
  box-shadow: 0 6px 18px rgba(99, 102, 241, 0.35);
}
.brand-logo i {
  color: white;
  font-size: 20px;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.2));
}
.brand-logo.lg { width: 84px; height: 84px; border-radius: 22px; }
.brand-logo.lg i { font-size: 38px; }

@keyframes logoColorShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
@keyframes logoPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

.brand-title {
  font-weight: 800;
  background: linear-gradient(90deg, var(--c1), var(--c3), var(--c4), var(--c2));
  background-size: 300% 300%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: gradientShift 8s ease infinite;
}

/* ===== Cartes / surfaces ===== */
.glass-card {
  background: var(--card-bg);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.6);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 30px rgba(30, 41, 59, 0.07);
  transition: transform .25s ease, box-shadow .25s ease;
}
.glass-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 36px rgba(30, 41, 59, 0.12);
}

.stat-card {
  border-radius: var(--radius-md);
  padding: 18px 20px;
  color: white;
  background-size: 220% 220%;
  animation: gradientShift 10s ease infinite;
  box-shadow: 0 10px 26px rgba(0,0,0,0.10);
}
.stat-card.c-blue { background-image: linear-gradient(135deg, #0ea5e9, #6366f1); }
.stat-card.c-violet { background-image: linear-gradient(135deg, #8b5cf6, #ec4899); }
.stat-card.c-green { background-image: linear-gradient(135deg, #10b981, #06b6d4); }
.stat-card.c-orange { background-image: linear-gradient(135deg, #f59e0b, #ef4444); }

/* ===== Sidebar ===== */
.sidebar {
  width: 272px;
  min-height: 100vh;
  background: rgba(255,255,255,0.75);
  backdrop-filter: blur(14px);
  border-right: 1px solid rgba(226,232,240,0.8);
  position: sticky;
  top: 0;
  align-self: flex-start;
}
.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 12px;
  color: var(--text-muted);
  font-weight: 500;
  font-size: 14px;
  transition: all .2s ease;
  cursor: pointer;
}
.nav-link:hover { background: rgba(99,102,241,0.08); color: var(--c1); }
.nav-link.active {
  background: linear-gradient(90deg, rgba(99,102,241,0.15), rgba(139,92,246,0.15));
  color: var(--c1);
  font-weight: 600;
}
.nav-section-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #94a3b8;
  font-weight: 700;
  margin: 18px 0 6px 10px;
}

/* ===== Boutons ===== */
.btn-gradient {
  background: linear-gradient(90deg, var(--c1), var(--c3));
  background-size: 200% 200%;
  animation: gradientShift 6s ease infinite;
  color: white;
  border: none;
  border-radius: 12px;
  padding: 10px 18px;
  font-weight: 600;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease;
  box-shadow: 0 6px 16px rgba(99,102,241,0.3);
}
.btn-gradient:hover { transform: translateY(-1px); box-shadow: 0 10px 22px rgba(99,102,241,0.4); }
.btn-gradient:active { transform: translateY(0); }
.btn-gradient:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-outline {
  border: 1.5px solid #e2e8f0;
  background: white;
  border-radius: 12px;
  padding: 9px 16px;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  transition: all .2s ease;
}
.btn-outline:hover { border-color: var(--c1); color: var(--c1); }

.btn-danger-outline {
  border: 1.5px solid #fecaca;
  background: #fff1f2;
  color: #dc2626;
  border-radius: 12px;
  padding: 8px 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s ease;
}
.btn-danger-outline:hover { background: #fee2e2; }

/* ===== Badges statut ===== */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge-Nouveau { background: #e0f2fe; color: #0369a1; }
.badge-Encours, .badge-En-cours { background: #fef3c7; color: #b45309; }
.badge-Enattente, .badge-En-attente { background: #ede9fe; color: #6d28d9; }
.badge-Traité { background: #dcfce7; color: #15803d; }
.badge-Rejeté { background: #fee2e2; color: #b91c1c; }
.badge-Clôturé { background: #e2e8f0; color: #475569; }

/* ===== Inputs ===== */
.input-field {
  width: 100%;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 14px;
  background: white;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.input-field:focus {
  outline: none;
  border-color: var(--c1);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}

/* ===== Login page ===== */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

/* ===== Table ===== */
table.data-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
table.data-table thead th {
  text-align: left;
  padding: 10px 14px;
  background: rgba(99,102,241,0.06);
  color: #475569;
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  position: sticky;
  top: 0;
}
table.data-table thead th:first-child { border-top-left-radius: 10px; }
table.data-table thead th:last-child { border-top-right-radius: 10px; }
table.data-table tbody td { padding: 10px 14px; border-bottom: 1px solid #f1f5f9; }
table.data-table tbody tr:hover { background: rgba(99,102,241,0.04); }

/* ===== Modal ===== */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(15,23,42,0.45);
  display: flex; align-items: center; justify-content: center; z-index: 60;
  backdrop-filter: blur(2px);
}
.modal-box {
  background: white; border-radius: 20px; width: 100%; max-width: 620px;
  max-height: 88vh; overflow-y: auto; padding: 28px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
}

/* ===== Toast ===== */
.toast {
  position: fixed; top: 20px; right: 20px; z-index: 80;
  padding: 14px 20px; border-radius: 14px; color: white; font-weight: 600;
  box-shadow: 0 10px 24px rgba(0,0,0,0.2);
  animation: slideIn .3s ease;
}
.toast.success { background: linear-gradient(90deg,#10b981,#06b6d4); }
.toast.error { background: linear-gradient(90deg,#ef4444,#f59e0b); }
@keyframes slideIn { from { transform: translateX(30px); opacity:0 } to { transform: translateX(0); opacity:1 } }

/* ===== Scrollbar ===== */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ===== Landing page ===== */
.hero-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.35;
  animation: floatBlob 12s ease-in-out infinite;
}
@keyframes floatBlob {
  0%, 100% { transform: translate(0,0) scale(1); }
  50% { transform: translate(20px,-30px) scale(1.1); }
}

.feature-icon {
  width: 52px; height: 52px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  background-size: 200% 200%;
  animation: gradientShift 8s ease infinite;
  color: white; font-size: 22px;
}

.spinner {
  width: 18px; height: 18px; border: 3px solid rgba(255,255,255,0.4);
  border-top-color: white; border-radius: 50%; animation: spin .7s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

.fade-in { animation: fadeIn .35s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px);} to { opacity:1; transform:translateY(0);} }

@media (max-width: 900px) {
  .sidebar { position: fixed; left: -280px; z-index: 50; transition: left .25s ease; height: 100vh; }
  .sidebar.open { left: 0; }
}
