/* Page /admin : mise en page sobre ; les tableaux eux-mêmes sont stylés par /lib/tableau.css. */
:root {
  --fond: #f4f6f9;
  --surface: #ffffff;
  --texte: #1c2733;
  --texte-discret: #4a5866;
  --accent: #1f6feb;
  --bordure: #d5dce4;
  /* Variables attendues par /lib/tableau.css (absentes de ce thème sans style.css) */
  --surface-survol: #e8edf3;
  --accent-perfweb: #0b5cad;
  --accent-asser: #8a4b00;
  /* Alertes : texte sombre sur fond clair teinté (contraste ≥ 4,5:1, vérifié par test/admin-contraste.test.js) */
  --erreur-texte: #8f1d1d;
  --erreur-fond: rgba(180, 68, 60, 0.12);
  --erreur-bord: #b4443c;
  --succes-texte: #14532d;
  --succes-fond: rgba(63, 143, 91, 0.14);
  --succes-bord: #2f7a4a;
  --archive-opacite: 0.55;
  /* Texte des lignes archivées : seul le noir garde ≥ 4,5:1 sous l'opacité de grisage (test/admin-contraste.test.js) */
  --archive-texte: #000000;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--fond);
  color: var(--texte);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.5;
}

.entete-admin {
  display: flex;
  align-items: baseline;
  gap: 1.5rem;
  padding: 1rem 2rem;
  background: var(--surface);
  border-bottom: 1px solid var(--bordure);
}

.entete-admin h1 { margin: 0; font-size: 1.25rem; }
.retour { color: var(--accent); text-decoration: none; font-size: 0.9rem; }
.retour:hover { text-decoration: underline; }

.onglets {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  padding: 0.75rem 2rem 0;
  border-bottom: 1px solid var(--bordure);
  background: var(--surface);
}

.onglet {
  padding: 0.5rem 1rem;
  color: var(--texte-discret);
  text-decoration: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
}

.onglet:hover { color: var(--texte); }
.onglet.actif {
  color: var(--accent);
  font-weight: 600;
  border-bottom-color: var(--accent);
}

.panneau {
  max-width: 72rem;
  margin: 1.5rem auto;
  padding: 0 2rem;
}

/* Bandeau de page (échec de GET /api/admin) : hors du composant tableau, donc stylé ici. */
#bandeau-page {
  margin: 1rem 2rem 0;
  padding: 0.6rem 0.9rem;
  border: 1px solid var(--erreur-bord);
  border-radius: 6px;
  background: var(--erreur-fond);
  color: var(--erreur-texte);
}

#bandeau-page[hidden] {
  display: none;
}

@media (max-width: 599px) {
  .entete-admin {
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    padding: 0.75rem 1rem;
  }

  .onglets {
    padding: 0.5rem 1rem 0;
    overflow-x: auto;
  }

  .onglet {
    padding: 0.5rem 0.75rem;
    white-space: nowrap;
  }

  .panneau {
    margin: 1rem auto;
    padding: 0 1rem;
  }

  #bandeau-page {
    margin: 1rem 1rem 0;
  }
}

@media (min-width: 900px) {
  .panneau {
    max-width: 90rem;
  }
}
