/* ── VARIABLES ─────────────────────────────────────── */

:root {
  --navy:    #4B3F8F;
  --blue:    #7B6FBF;
  --green:   #2E7D32;
  --mint:    #E8F5E9;
  --amber:   #E8A838;
  --cream:   #FFF8E1;
  --red:     #C62828;
  --rose:    #FFEBEE;
  --gray:    #F7F5FF;
  --silver:  #DDD8F5;
  --slate:   #6B5FAF;
  --dark:    #1A1433;
  --white:   #FFFFFF;
  --sidebar-w: 240px;
  --radius:    8px;
  --shadow:    0 2px 8px rgba(75,63,143,0.08);
}




/* ── RESET ─────────────────────────────────────────── */
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: Arial, sans-serif; font-size: 14px; 
       color: var(--dark); background: var(--gray); }

/* ── LOGIN ─────────────────────────────────────────── */
#page-login {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--navy) 0%, var(--blue) 100%);
}
.login-card {
  background: var(--white);
  border-radius: 16px;
  padding: 40px;
  width: 380px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  text-align: center;
}
.login-logo { font-size: 48px; margin-bottom: 12px; }
.login-card h1 { 
  color: var(--navy); 
  font-size: 28px; 
  margin-bottom: 4px; 
}
.login-subtitle { 
  color: var(--slate); 
  margin-bottom: 28px; 
  font-size: 13px; 
}

/* ── LAYOUT APP ─────────────────────────────────────── */
#app { display: flex; min-height: 100vh; }

/* ── SIDEBAR ────────────────────────────────────────── */
#sidebar {
  width: var(--sidebar-w);
  background: var(--navy);
  color: var(--white);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
}
.sidebar-logo {
  padding: 24px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.logo-icon { font-size: 24px; }
.logo-text { font-size: 20px; font-weight: bold; }

.sidebar-menu {
  list-style: none;
  flex: 1;
  padding: 12px 0;
  overflow-y: auto;
}
.sidebar-menu li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  cursor: pointer;
  transition: background 0.2s;
  font-size: 14px;
  color: rgba(255,255,255,0.8);
}
.sidebar-menu li:hover { background: rgba(255,255,255,0.1); }
.sidebar-menu li.active { 
  background: rgba(255,255,255,0.15); 
  color: var(--white);
  font-weight: bold;
  border-right: 3px solid var(--white);
}
.nav-icon { font-size: 18px; width: 24px; text-align: center; }

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,0.1);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.user-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: rgba(255,255,255,0.8);
}
.lang-switch { display: flex; gap: 6px; }
.lang-switch button {
  background: rgba(255,255,255,0.1);
  border: none;
  color: var(--white);
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
}
.lang-switch button.active { background: rgba(255,255,255,0.3); }
.btn-logout {
  background: rgba(255,255,255,0.1);
  border: none;
  color: var(--white);
  padding: 8px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 13px;
  text-align: center;
}
.btn-logout:hover { background: rgba(255,255,255,0.2); }

/* ── CONTENU PRINCIPAL ──────────────────────────────── */
#content {
  margin-left: var(--sidebar-w);
  flex: 1;
  padding: 28px;
  min-height: 100vh;
}

/* ── FORMULAIRES ────────────────────────────────────── */
.form-group { 
  margin-bottom: 16px; 
  text-align: left;
}
.form-group label { 
  display: block; 
  font-size: 13px; 
  font-weight: bold;
  color: var(--slate);
  margin-bottom: 6px; 
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--silver);
  border-radius: var(--radius);
  font-size: 14px;
  transition: border-color 0.2s;
  background: var(--white);
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--blue);
}

/* ── BOUTONS ────────────────────────────────────────── */
.btn-primary {
  background: var(--navy);
  color: var(--white);
  border: none;
  padding: 10px 20px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 14px;
  font-weight: bold;
  transition: background 0.2s;
}
.btn-primary:hover { background: var(--blue); }
.btn-full { width: 100%; padding: 12px; }

.btn-secondary {
  background: var(--white);
  color: var(--navy);
  border: 1.5px solid var(--navy);
  padding: 10px 20px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s;
}
.btn-secondary:hover { background: var(--gray); }

.btn-danger {
  background: var(--red);
  color: var(--white);
  border: none;
  padding: 8px 16px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 13px;
}

.btn-success {
  background: var(--green);
  color: var(--white);
  border: none;
  padding: 10px 20px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 14px;
  font-weight: bold;
}

/* ── CARTES ─────────────────────────────────────────── */
.card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}
.card-title {
  font-size: 16px;
  font-weight: bold;
  color: var(--navy);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--silver);
}

/* ── KPI CARDS ──────────────────────────────────────── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.kpi-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  text-align: center;
}
.kpi-icon { font-size: 28px; margin-bottom: 8px; }
.kpi-value { 
  font-size: 28px; 
  font-weight: bold; 
  color: var(--navy);
  line-height: 1;
}
.kpi-label { 
  font-size: 12px; 
  color: var(--slate); 
  margin-top: 4px;
}

/* ── TABLEAUX ───────────────────────────────────────── */
.table-wrapper { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
th {
  background: var(--gray);
  padding: 10px 14px;
  text-align: left;
  font-weight: bold;
  color: var(--slate);
  border-bottom: 2px solid var(--silver);
}
td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--silver);
  color: var(--dark);
}
tr:hover td { background: var(--gray); }

/* ── BADGES STATUT ──────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: bold;
}
.badge-success { background: var(--mint);  color: var(--green); }
.badge-warning { background: var(--cream); color: var(--amber); }
.badge-danger  { background: var(--rose);  color: var(--red);   }
.badge-info    { background: #D6E4F0;      color: var(--blue);  }

/* ── MESSAGES ERREUR ────────────────────────────────── */
.erreur { color: var(--red); font-size: 13px; margin-top: 8px; }

/* ── BARRE DE PROGRESSION ───────────────────────────── */
.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--silver);
  border-radius: 4px;
  overflow: hidden;
  margin: 12px 0;
}
.progress-fill {
  height: 100%;
  background: var(--green);
  border-radius: 4px;
  transition: width 0.3s;
}

/* ── ZONE UPLOAD ────────────────────────────────────── */
.upload-zone {
  border: 2px dashed var(--silver);
  border-radius: var(--radius);
  padding: 32px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s;
  background: var(--gray);
}
.upload-zone:hover { border-color: var(--blue); }
.upload-zone.active { border-color: var(--green); background: var(--mint); }
.upload-icon { font-size: 36px; margin-bottom: 8px; }
.upload-text { color: var(--slate); font-size: 13px; }

/* ── TOAST ──────────────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  padding: 12px 20px;
  border-radius: var(--radius);
  color: var(--white);
  font-size: 13px;
  box-shadow: var(--shadow);
  animation: slideIn 0.3s ease;
  min-width: 220px;
}
.toast-success { background: var(--green); }
.toast-error   { background: var(--red); }
.toast-info    { background: var(--blue); }

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

/* ── PAGE HEADER ────────────────────────────────────── */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}
.page-title {
  font-size: 22px;
  font-weight: bold;
  color: var(--navy);
}

/* ── GRID ───────────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; }

/* ── UTILITAIRES ────────────────────────────────────── */
.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-muted  { color: var(--slate); font-size: 12px; }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-16 { margin-bottom: 16px; }
.gap-8 { gap: 8px; }
.flex  { display: flex; align-items: center; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.hidden { display: none; }