/* =============================================================
   ASCO — Espace club (tableau de bord)
   ============================================================= */

.corps-admin { background: var(--gris-000); }

/* ---------- Connexion ---------- */
.connexion {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem 1rem;
  background:
    radial-gradient(900px 420px at 80% -10%, rgba(255, 255, 255, 0.14), transparent 60%),
    linear-gradient(150deg, var(--rouge) 0%, var(--rouge-fonce) 55%, var(--rouge-nuit) 100%);
}

.connexion__carte {
  background: var(--blanc);
  border-radius: var(--r-xl);
  box-shadow: var(--ombre-3);
  padding: 2.4rem 2.2rem;
  width: min(100%, 420px);
  text-align: center;
}

.connexion__logo { width: 76px; margin: 0 auto 1rem; }
.connexion__carte h1 { font-size: 1.45rem; margin-bottom: 0.15rem; }
.connexion__carte > p { color: var(--gris-600); font-size: 0.92rem; margin-bottom: 1.6rem; }
.connexion__carte form { text-align: start; display: grid; gap: 1rem; }
.connexion__retour {
  display: inline-block;
  margin-top: 1.2rem;
  font-size: 0.87rem;
  color: var(--gris-600);
  text-decoration: none;
}
.connexion__retour:hover { color: var(--rouge); text-decoration: underline; }

/* ---------- En-tête admin ---------- */
.admin-utilisateur {
  font-size: 0.85rem;
  color: var(--gris-600);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
}

.btn--petit { padding: 0.5rem 1rem; font-size: 0.88rem; }

.admin-corps { padding-block: 1.8rem 3rem; }

/* ---------- Statistiques ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1.2rem;
}

.stat-carte {
  background: var(--blanc);
  border: 1px solid var(--gris-100);
  border-inline-start: 4px solid var(--gris-200);
  border-radius: var(--r-md);
  padding: 1.05rem 1.25rem;
  box-shadow: var(--ombre-1);
}
.stat-carte__lib {
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gris-400);
}
:root[data-langue="ar"] .stat-carte__lib { letter-spacing: 0; text-transform: none; font-size: 0.85rem; }
.stat-carte__val { font-size: 1.9rem; font-weight: 800; line-height: 1.2; }
.stat-carte--vert { border-inline-start-color: var(--vert); }
.stat-carte--vert .stat-carte__val { color: var(--vert); }
.stat-carte--ambre { border-inline-start-color: #d9910b; }
.stat-carte--ambre .stat-carte__val { color: var(--ambre); }
.stat-carte--rouge { border-inline-start-color: var(--rouge); }
.stat-carte--rouge .stat-carte__val { color: var(--rouge); }

/* ---------- Répartition ---------- */
.repartition {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.4rem;
}
.repartition__item {
  background: var(--blanc);
  border: 1px solid var(--gris-100);
  border-radius: 999px;
  padding: 0.35rem 0.9rem;
  font-size: 0.85rem;
  font-weight: 700;
  display: inline-flex;
  gap: 0.45rem;
  align-items: center;
}
.repartition__item b {
  background: var(--rouge);
  color: var(--blanc);
  border-radius: 999px;
  min-width: 22px;
  text-align: center;
  padding: 0 0.35rem;
  font-size: 0.78rem;
}

/* ---------- Barre d'outils ---------- */
.barre-outils {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
  margin-bottom: 1rem;
}
.champ--recherche { flex: 1 1 260px; }
.champ--recherche input {
  width: 100%;
  border: 1.5px solid var(--gris-200);
  border-radius: var(--r-md);
  padding: 0.62rem 0.95rem;
  background: var(--blanc);
  min-height: 44px;
}
.champ--recherche input:focus {
  outline: none;
  border-color: var(--rouge);
  box-shadow: 0 0 0 4px rgba(200, 16, 46, 0.12);
}
.select-compact {
  border: 1.5px solid var(--gris-200);
  border-radius: var(--r-md);
  padding: 0.6rem 0.9rem;
  background: var(--blanc);
  min-height: 44px;
  font-weight: 600;
  font-size: 0.9rem;
}

/* ---------- Tableau ---------- */
.tableau-boite {
  background: var(--blanc);
  border: 1px solid var(--gris-100);
  border-radius: var(--r-lg);
  box-shadow: var(--ombre-1);
  overflow-x: auto;
}

.tableau {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  min-width: 1040px;
}
.tableau th {
  text-align: start;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gris-400);
  padding: 0.85rem 0.9rem;
  border-bottom: 1px solid var(--gris-100);
  white-space: nowrap;
  background: var(--gris-000);
}
:root[data-langue="ar"] .tableau th { letter-spacing: 0; text-transform: none; font-size: 0.82rem; }
.tableau td {
  padding: 0.75rem 0.9rem;
  border-bottom: 1px solid var(--gris-100);
  vertical-align: middle;
  white-space: nowrap;
}
.tableau tbody tr { cursor: pointer; transition: background 140ms; }
.tableau tbody tr:hover { background: #fff5f6; }
.tableau tbody tr:last-child td { border-bottom: none; }

.cel-ref {
  font-family: Consolas, "Courier New", monospace;
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--rouge-fonce);
  white-space: nowrap;
}
.cel-nom { font-weight: 700; }
.cel-sous {
  font-size: 0.78rem;
  color: var(--gris-400);
  max-width: 190px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.etiq {
  display: inline-block;
  border-radius: 999px;
  padding: 0.18rem 0.65rem;
  font-size: 0.76rem;
  font-weight: 800;
  white-space: nowrap;
}
.etiq--nouveau { background: #eaf1fb; color: #1f5091; }
.etiq--incomplet { background: var(--ambre-fond); color: var(--ambre); }
.etiq--valide { background: var(--vert-fond); color: var(--vert); }
.etiq--refuse { background: #fdecee; color: var(--rouge); }
.etiq--paye { background: var(--vert-fond); color: var(--vert); }
.etiq--nonpaye { background: var(--gris-000); color: var(--gris-600); }
.etiq--cat { background: rgba(200, 16, 46, 0.1); color: var(--rouge-fonce); }

.btn-ligne {
  border: 1.5px solid var(--gris-200);
  background: var(--blanc);
  border-radius: var(--r-sm);
  padding: 0.32rem 0.7rem;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.btn-ligne:hover { border-color: var(--rouge); color: var(--rouge); }

.vide {
  text-align: center;
  color: var(--gris-400);
  padding: 3rem 1rem;
  margin: 0;
}

/* ---------- Modale ---------- */
.modale {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  place-items: center;
  padding: 1rem;
}
.modale__fond {
  position: absolute;
  inset: 0;
  background: rgba(12, 14, 18, 0.55);
  backdrop-filter: blur(3px);
}
.modale__boite {
  position: relative;
  background: var(--blanc);
  border-radius: var(--r-xl);
  box-shadow: var(--ombre-3);
  width: min(100%, 780px);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: monte 220ms cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes monte { from { transform: translateY(16px); opacity: 0; } to { transform: none; opacity: 1; } }

.modale__tete {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.3rem 1.6rem;
  background: linear-gradient(135deg, var(--rouge), var(--rouge-fonce));
  color: var(--blanc);
}
.modale__tete h2 { margin: 0; font-size: 1.2rem; }
.modale__ref {
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.82rem;
  opacity: 0.9;
}
.modale__fermer {
  background: rgba(255, 255, 255, 0.16);
  border: none;
  color: var(--blanc);
  width: 32px; height: 32px;
  border-radius: 50%;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  flex: none;
}
.modale__fermer:hover { background: rgba(255, 255, 255, 0.3); }

.modale__corps { padding: 1.5rem 1.6rem; overflow-y: auto; }
.modale__pied {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  flex-wrap: wrap;
  padding: 1rem 1.6rem;
  border-top: 1px solid var(--gris-100);
  background: var(--gris-000);
}

.fiche-groupe + .fiche-groupe { margin-top: 1.5rem; }
.fiche-groupe h3 {
  font-size: 0.76rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--rouge);
  border-bottom: 2px solid var(--gris-100);
  padding-bottom: 0.4rem;
  margin-bottom: 0.7rem;
}
:root[data-langue="ar"] .fiche-groupe h3 { letter-spacing: 0; text-transform: none; font-size: 0.92rem; }

.fiche-grille {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.6rem 1.2rem;
}
.fiche-grille dt {
  font-size: 0.72rem;
  color: var(--gris-400);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
}
:root[data-langue="ar"] .fiche-grille dt { letter-spacing: 0; text-transform: none; font-size: 0.82rem; }
.fiche-grille dd { margin: 0 0 0.3rem; font-weight: 600; word-break: break-word; }

.fiche-photo {
  width: 84px; height: 112px;
  border-radius: var(--r-sm);
  object-fit: cover;
  border: 1px solid var(--gris-200);
  float: inline-end;
  margin-inline-start: 1rem;
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  inset-inline: 0;
  bottom: 1.5rem;
  margin-inline: auto;
  width: max-content;
  max-width: 90vw;
  background: var(--encre);
  color: var(--blanc);
  padding: 0.75rem 1.4rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.9rem;
  box-shadow: var(--ombre-2);
  z-index: 400;
  animation: monte 200ms ease;
}
.toast--erreur { background: var(--rouge); }

@media (max-width: 700px) {
  .admin-utilisateur { display: none; }
  .modale__boite { max-height: 96vh; }
}
