/* ═══════════════════════════════════════════════════════════
   🎨 DESIGN SYSTEM — Maison de Solutions pour les Nations
   ═══════════════════════════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

:root {
  --brand:        #0B1465;
  --brand-dark:   #080E4A;
  --brand-light:  #F1F5FF;
  --brand-soft:   rgba(11, 20, 101, 0.08);

  --green:        #2E7D32;
  --green-light:  #DFF5E3;
  --orange:       #E65100;
  --orange-light: #FFF1E1;
  --purple:       #7B1FA2;
  --purple-light: #F3E5F5;
  --red:          #D32F2F;
  --red-light:    #FFEBEE;
  --gold:         #B8860B;
  --gold-light:   #FFF4E6;

  --ink:          #111827;
  --slate:        #374151;
  --stone:        #6B7280;
  --mist:         #9CA3AF;
  --fog:          #D1D5DB;
  --line:         #E8ECF3;
  --bg:           #F5F7FB;
  --paper:        #F8FAFC;
  --white:        #FFFFFF;

  --shadow-card:  0 8px 20px rgba(0, 0, 0, 0.06);
  --shadow-soft:  0 4px 16px rgba(0, 0, 0, 0.05);
  --shadow-hover: 0 12px 28px rgba(0, 0, 0, 0.08);
  --shadow-brand: 0 12px 25px rgba(11, 20, 101, 0.20);

  --radius-sm:    10px;
  --radius:       14px;
  --radius-lg:    18px;
  --radius-2xl:   24px;
  --radius-3xl:   28px;
  --radius-pill:  999px;

  --transition:   all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  height: 100%;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-feature-settings: 'cv11', 'ss01';
  color: var(--ink);
  background: var(--bg);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.hidden { display: none !important; }
.text-right { text-align: right; }
.text-center { text-align: center; }

/* ICÔNES SVG */
.icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  flex-shrink: 0;
}
.icon-sm { width: 16px; height: 16px; }
.icon-lg { width: 22px; height: 22px; }
.icon-xl { width: 26px; height: 26px; }

/* BOUTONS */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: -0.1px;
  border: 1.5px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  user-select: none;
  text-decoration: none;
}
.btn-primary {
  background: var(--brand);
  color: var(--white);
  box-shadow: 0 4px 12px rgba(11, 20, 101, 0.20);
}
.btn-primary:hover {
  background: var(--brand-dark);
  box-shadow: 0 8px 20px rgba(11, 20, 101, 0.28);
  transform: translateY(-1px);
}
.btn-secondary {
  background: var(--white);
  color: var(--ink);
  border-color: var(--line);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
.btn-secondary:hover { background: var(--paper); border-color: var(--fog); }
.btn-ghost {
  background: transparent;
  color: var(--stone);
  border-color: transparent;
}
.btn-ghost:hover { background: var(--brand-light); color: var(--brand); }
.btn-danger { background: var(--red); color: var(--white); }
.btn-danger:hover { background: #B71C1C; }
.btn-icon { width: 38px; height: 38px; padding: 0; }
.btn-sm { padding: 7px 12px; font-size: 12.5px; }
.btn-sm.btn-icon { width: 32px; height: 32px; }
.btn-lg { padding: 13px 22px; font-size: 14px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }

/* FORMULAIRES */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}
.form-group label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--slate);
  letter-spacing: -0.1px;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 600px) { .form-row { grid-template-columns: 1fr; } }

input[type="text"], input[type="tel"], input[type="email"],
input[type="number"], input[type="password"], input[type="search"],
input[type="date"], select, textarea {
  width: 100%;
  padding: 11px 14px;
  font-family: inherit;
  font-size: 13.5px;
  color: var(--ink);
  background: var(--white);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  transition: var(--transition);
  outline: none;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}
input::placeholder, textarea::placeholder { color: var(--mist); }

/* BADGES */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  font-size: 11.5px;
  font-weight: 700;
  border-radius: var(--radius-pill);
  letter-spacing: -0.1px;
  white-space: nowrap;
}
.badge-blue   { background: var(--brand-light);  color: var(--brand); }
.badge-green  { background: var(--green-light);  color: var(--green); }
.badge-gold   { background: var(--gold-light);   color: var(--gold); }
.badge-red    { background: var(--red-light);    color: var(--red); }
.badge-purple { background: var(--purple-light); color: var(--purple); }
.badge-orange { background: var(--orange-light); color: var(--orange); }
.badge-gray   { background: var(--paper);        color: var(--stone); }
.badge-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* CARTES */
.card {
  background: var(--white);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  transition: var(--transition);
}
.card:hover { box-shadow: var(--shadow-hover); }
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 22px 14px;
  gap: 12px;
}
.card-header h3 {
  font-size: 16px;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.2px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.card-header h3 .icon { color: var(--brand); }
.card-body { padding: 0 22px 22px; }
.card-body.no-padding { padding: 0; }

/* TABLEAUX */
.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}
.data-table thead th {
  text-align: left;
  padding: 12px 22px;
  font-size: 11px;
  font-weight: 700;
  color: var(--stone);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.data-table tbody td {
  padding: 14px 22px;
  font-size: 13.5px;
  color: var(--ink);
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr { transition: var(--transition); }
.data-table tbody tr:hover { background: var(--brand-light); }
.table-actions { display: flex; gap: 4px; justify-content: flex-end; }

/* LOADING / EMPTY */
.loading-state, .empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  gap: 12px;
  text-align: center;
  color: var(--stone);
}
.empty-state h3 { font-size: 15px; color: var(--ink); font-weight: 800; }
.empty-state p { font-size: 13px; color: var(--mist); max-width: 320px; }
.empty-state-icon {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--brand-light);
  color: var(--brand);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 4px;
}
.empty-state-icon .icon { width: 26px; height: 26px; }

.spinner {
  width: 34px; height: 34px;
  border: 3px solid var(--line);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes slideUp {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ALERTS */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 16px;
  border: 1.5px solid transparent;
}
.alert-error   { background: var(--red-light);   color: #991B1B; border-color: #FECACA; }
.alert-success { background: var(--green-light); color: #065F46; border-color: #A7F3D0; }
.alert-info    { background: var(--brand-light); color: var(--brand); border-color: #C7D2FE; }

/* LOGIN */
.auth-body { background: var(--bg); }
.auth-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
}
.auth-left {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
  color: var(--white);
  padding: 60px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.auth-left::before {
  content: '';
  position: absolute;
  top: -30%; right: -20%;
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(255,255,255,0.06) 0%, transparent 70%);
  border-radius: 50%;
}
.auth-left::after {
  content: '';
  position: absolute;
  bottom: -30%; left: -20%;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(255,255,255,0.04) 0%, transparent 70%);
  border-radius: 50%;
}
.auth-brand { position: relative; z-index: 1; }
.brand-logo {
  width: 64px; height: 64px;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(10px);
  border: 1.5px solid rgba(255, 255, 255, 0.2);
  color: var(--white);
  font-size: 20px;
  font-weight: 900;
  border-radius: 18px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 26px;
  letter-spacing: -0.5px;
}
.auth-brand h1 {
  font-size: 34px;
  font-weight: 900;
  letter-spacing: -1.2px;
  margin-bottom: 10px;
  line-height: 1.15;
}
.auth-brand p {
  font-size: 15px;
  opacity: 0.7;
  margin-bottom: 48px;
  font-weight: 500;
  line-height: 1.55;
}
.auth-features {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
  z-index: 1;
}
.feature {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 14px;
  font-weight: 500;
  opacity: 0.92;
}
.feature-icon {
  width: 38px; height: 38px;
  background: rgba(255, 255, 255, 0.10);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.feature-icon .icon { color: var(--white); width: 18px; height: 18px; }
.auth-right {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  background: var(--white);
}
.auth-form { width: 100%; max-width: 380px; }
.auth-form h2 {
  font-size: 28px;
  font-weight: 900;
  margin-bottom: 8px;
  letter-spacing: -0.9px;
  color: var(--ink);
}
.auth-subtitle {
  color: var(--stone);
  font-size: 14px;
  margin-bottom: 32px;
  font-weight: 500;
}
.password-wrapper { position: relative; }
.password-wrapper input { padding-right: 46px; }
.toggle-password {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--mist);
  padding: 6px;
  display: flex;
  border-radius: 8px;
}
.toggle-password:hover { color: var(--brand); background: var(--brand-light); }
.auth-footer {
  margin-top: 30px;
  text-align: center;
  font-size: 12px;
  color: var(--mist);
  font-weight: 500;
}
@media (max-width: 900px) {
  .auth-container { grid-template-columns: 1fr; }
  .auth-left { display: none; }
}

/* INFO LIST & TIMELINE */
.info-list { display: flex; flex-direction: column; }
.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13.5px;
  gap: 12px;
}
.info-row:last-child { border-bottom: none; }
.info-label { color: var(--stone); font-weight: 500; flex-shrink: 0; }
.info-value { color: var(--ink); font-weight: 700; text-align: right; }
.timeline { padding: 12px 22px; display: flex; flex-direction: column; }
.timeline-item {
  display: flex;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.timeline-item:last-child { border-bottom: none; }
.timeline-icon {
  width: 40px; height: 40px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  background: var(--brand-light);
  color: var(--brand);
}
.timeline-content { flex: 1; min-width: 0; }
.timeline-header {
  display: flex; justify-content: space-between;
  margin-bottom: 4px;
  gap: 10px;
}
.timeline-title { font-size: 13.5px; font-weight: 800; }
.timeline-date { font-size: 11.5px; color: var(--mist); font-weight: 500; flex-shrink: 0; }
.timeline-note { font-size: 13px; color: var(--stone); line-height: 1.55; }

/* NOTIFICATIONS */
.notif-list { display: flex; flex-direction: column; gap: 10px; }
.notif-item {
  display: flex;
  gap: 14px;
  padding: 16px 20px;
  background: var(--white);
  border-radius: var(--radius-2xl);
  cursor: pointer;
  transition: var(--transition);
  border-left: 4px solid var(--brand);
  box-shadow: var(--shadow-soft);
}
.notif-item:hover { box-shadow: var(--shadow-card); transform: translateX(2px); }
.notif-item.notif-read { border-left-color: var(--line); opacity: 0.65; }
.notif-icon {
  width: 40px; height: 40px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  background: var(--brand-light);
  color: var(--brand);
}
.notif-body { flex: 1; min-width: 0; }
.notif-title { font-size: 14px; font-weight: 800; margin-bottom: 3px; }
.notif-message { font-size: 13px; color: var(--stone); line-height: 1.5; }
.notif-meta {
  font-size: 11.5px;
  color: var(--mist);
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* CAMPAGNES GRID */
.campagnes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 18px;
}
.campagne-card { display: flex; flex-direction: column; }
.campagne-card:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.campagne-info { font-size: 13px; color: var(--stone); line-height: 1.7; }
.campagne-stat { display: flex; align-items: baseline; gap: 5px; margin-top: 14px; }
.campagne-stat strong {
  font-size: 26px;
  font-weight: 900;
  color: var(--brand);
  letter-spacing: -0.8px;
}
.campagne-stat span { font-size: 12px; color: var(--mist); font-weight: 600; }

/* EXPORT MENU */
.export-menu-wrapper { position: relative; }
.export-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-hover);
  padding: 6px;
  min-width: 210px;
  z-index: 100;
  animation: slideUp 0.15s ease;
}
.export-menu button {
  width: 100%;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: none;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  color: var(--slate);
  font-weight: 600;
  text-align: left;
}
.export-menu button:hover { background: var(--brand-light); color: var(--brand); }

/* DASHBOARD SPÉCIFIQUE */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}
.kpi-card {
  background: var(--white);
  border-radius: var(--radius-2xl);
  padding: 16px;
  box-shadow: var(--shadow-card);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.kpi-card:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.kpi-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.kpi-card-icon {
  width: 32px; height: 32px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.kpi-card-trend { display: flex; align-items: center; justify-content: center; }
.kpi-card-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--stone);
  letter-spacing: 0.1px;
  text-transform: uppercase;
  margin-bottom: 2px;
}
.kpi-card-value {
  font-size: 26px;
  font-weight: 900;
  letter-spacing: -0.8px;
  line-height: 1.1;
  margin-bottom: 2px;
}
.kpi-card-subtitle {
  font-size: 11px;
  color: var(--mist);
  font-weight: 500;
  margin-bottom: 10px;
}
.kpi-card-sparkline { height: 34px; width: 100%; margin-top: auto; }

.evolution-card {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
  border-radius: var(--radius-3xl);
  padding: 22px;
  box-shadow: var(--shadow-brand);
  color: var(--white);
  margin-bottom: 22px;
  position: relative;
  overflow: hidden;
}
.evolution-card::before {
  content: '';
  position: absolute;
  top: -50%; right: -20%;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}
.evolution-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
  position: relative;
  z-index: 1;
}
.evolution-title {
  font-size: 18px;
  font-weight: 900;
  letter-spacing: -0.4px;
  margin-bottom: 4px;
}
.evolution-subtitle {
  font-size: 11.5px;
  opacity: 0.75;
  font-weight: 500;
}
.evolution-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  background: rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}
.evolution-chart {
  height: 230px;
  margin-bottom: 18px;
  position: relative;
  z-index: 1;
}
.evolution-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid rgba(255,255,255,0.12);
  position: relative;
  z-index: 1;
  font-size: 12.5px;
  font-weight: 700;
}
.evolution-footer .icon { color: var(--white); }

.chart-compare { height: 280px; margin: 4px 0 12px; }

.pie-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 22px;
}
.pie-tile {
  height: 180px;
  background: var(--white);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-card);
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}
.pie-tile:hover { box-shadow: var(--shadow-hover); }
.pie-tile-chart {
  width: 96px; height: 96px;
  position: relative;
  margin-bottom: 12px;
}
.pie-tile-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.pie-tile-percent { font-size: 19px; font-weight: 900; line-height: 1; }
.pie-tile-value {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
  margin-top: 2px;
}
.pie-tile-label { font-size: 14px; font-weight: 800; color: var(--ink); }

.recent-list { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.recent-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: var(--transition);
}
.recent-item:hover { border-color: var(--fog); background: var(--brand-light); }
.recent-avatar {
  width: 42px; height: 42px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--white);
  font-size: 13px;
  font-weight: 900;
  flex-shrink: 0;
}
.recent-info { flex: 1; min-width: 0; }
.recent-name {
  font-size: 13px;
  font-weight: 800;
  color: var(--ink);
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.recent-sub {
  font-size: 11px;
  color: var(--stone);
  display: flex;
  align-items: center;
  gap: 5px;
}
.recent-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}
.recent-tag {
  width: 30px; height: 30px;
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
}
.recent-date { font-size: 10px; color: var(--mist); font-weight: 600; }

.campagne-item {
  padding: 14px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 10px;
}
.campagne-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
}
.campagne-item-name {
  font-size: 14.5px;
  font-weight: 800;
  color: var(--brand);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.campagne-item-badge {
  padding: 4px 10px;
  background: var(--green-light);
  color: var(--green);
  border-radius: 10px;
  font-size: 11px;
  font-weight: 800;
  flex-shrink: 0;
}
.campagne-item-dates {
  font-size: 12px;
  color: var(--stone);
  font-weight: 500;
  margin-bottom: 10px;
}
.campagne-progress {
  height: 6px;
  background: var(--line);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 6px;
}
.campagne-progress-fill {
  height: 100%;
  border-radius: 6px;
  transition: var(--transition);
}
.campagne-item-footer {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--mist);
  font-weight: 600;
}

.dashboard-grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-bottom: 22px;
}
@media (max-width: 900px) { .dashboard-grid-2col { grid-template-columns: 1fr; } }