:root {
  --rouge: #E31E24;
  --rouge-fonce: #B0141A;
  --noir: #16181B;
  --bleu-bat: #274677;
  --bleu-clair: #EAF2FB;
  --gris: #F4F5F7;
  --gris-texte: #5A6069;
  --blanc: #FFFFFF;
  --rayon: 8px;
}
* { box-sizing: border-box; }
body {
  margin: 0; font-family: 'Work Sans', sans-serif; background: var(--gris); color: var(--noir);
}
a { text-decoration: none; color: inherit; }

/* --- Layout --- */
.admin-layout { display: flex; min-height: 100vh; }

.admin-sidebar {
  width: 250px; background: var(--noir); color: #C7CBD2; flex-shrink: 0;
  display: flex; flex-direction: column; padding: 26px 0;
}
.admin-sidebar .logo { padding: 0 24px 26px; border-bottom: 1px solid #2B2E33; margin-bottom: 20px; }
.admin-sidebar .logo img { height: 42px; }
.admin-sidebar nav a {
  display: flex; align-items: center; gap: 12px; padding: 13px 24px; font-weight: 500; font-size: 0.95rem;
  border-left: 3px solid transparent;
}
.admin-sidebar nav a:hover { background: rgba(255,255,255,0.05); }
.admin-sidebar nav a.actif { background: rgba(227,30,36,0.12); border-left-color: var(--rouge); color: #fff; }
.admin-sidebar .deconnexion { margin-top: auto; padding: 13px 24px; color: #E38E90; font-weight: 600; }

.admin-main { flex: 1; padding: 34px 40px; max-width: 100%; overflow-x: auto; }
.admin-topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px; }
.admin-topbar h1 { font-size: 1.6rem; margin: 0; }
.admin-topbar .utilisateur { font-size: 0.9rem; color: var(--gris-texte); }

/* --- Cartes / stats --- */
.grille-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px,1fr)); gap: 20px; margin-bottom: 30px; }
.carte-stat {
  background: var(--blanc); border-radius: var(--rayon); padding: 22px 24px; box-shadow: 0 4px 16px rgba(0,0,0,0.05);
  border-left: 4px solid var(--rouge);
}
.carte-stat:nth-child(2) { border-left-color: var(--bleu-bat); }
.carte-stat:nth-child(3) { border-left-color: #2E9E5B; }
.carte-stat:nth-child(4) { border-left-color: var(--noir); }
.carte-stat .valeur { font-size: 2.1rem; font-weight: 700; }
.carte-stat .label { color: var(--gris-texte); font-size: 0.88rem; }

.bloc {
  background: var(--blanc); border-radius: var(--rayon); padding: 26px; box-shadow: 0 4px 16px rgba(0,0,0,0.05); margin-bottom: 26px;
}
.bloc h2 { font-size: 1.15rem; margin: 0 0 18px; }

/* --- Table --- */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid #EEEFF1; font-size: 0.92rem; }
th { color: var(--gris-texte); font-weight: 600; text-transform: uppercase; font-size: 0.75rem; letter-spacing: 0.5px; }
tr:hover td { background: #FAFAFB; }
.miniature { width: 56px; height: 56px; object-fit: cover; border-radius: 6px; }

.tag { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 0.75rem; font-weight: 600; }
.tag-vert { background: #E6F6EA; color: #1E7E34; }
.tag-jaune { background: #FFF3D6; color: #93670A; }
.tag-gris { background: #EEF0F2; color: #555; }

/* --- Boutons / formulaires --- */
.btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 10px 18px; border-radius: 6px; border: none;
  font-weight: 600; font-size: 0.88rem; cursor: pointer; transition: .2s;
}
.btn-primary { background: var(--rouge); color: #fff; }
.btn-primary:hover { background: var(--rouge-fonce); }
.btn-secondaire { background: var(--blanc); border: 1.5px solid #E3E5E8; color: var(--noir); }
.btn-secondaire:hover { border-color: var(--noir); }
.btn-danger { background: #FBE7E8; color: var(--rouge-fonce); }
.btn-danger:hover { background: #F6C9CB; }
.btn-sm { padding: 6px 12px; font-size: 0.8rem; }

.champ { margin-bottom: 18px; }
.champ label { display: block; font-weight: 600; font-size: 0.88rem; margin-bottom: 6px; }
.champ input, .champ select, .champ textarea {
  width: 100%; padding: 11px 13px; border: 1.5px solid #E3E5E8; border-radius: 6px; font-family: inherit; font-size: 0.95rem;
}
.champ input:focus, .champ select:focus, .champ textarea:focus { outline: none; border-color: var(--rouge); }
.ligne-champs { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }

.alerte { padding: 13px 16px; border-radius: 6px; margin-bottom: 20px; font-size: 0.9rem; }
.alerte-ok { background: #E6F6EA; color: #1E7E34; border: 1px solid #B7E4C2; }
.alerte-err { background: #FBE7E8; color: var(--rouge-fonce); border: 1px solid #F3B8BA; }

.login-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--noir);
}
.login-box { background: var(--blanc); padding: 44px; border-radius: 10px; width: 380px; max-width: 90vw; }
.login-box img { height: 50px; margin-bottom: 20px; }

@media (max-width: 900px) {
  .admin-layout { flex-direction: column; }
  .admin-sidebar { width: 100%; flex-direction: row; overflow-x: auto; padding: 14px; }
  .admin-sidebar nav { display: flex; }
  .admin-sidebar .deconnexion { margin-top: 0; }
  .ligne-champs { grid-template-columns: 1fr; }
}
