/*
 * Administration (ECL-15) : les onglets, les tableaux, l'editeur.
 *
 * Rien d'inline, aucun `!important` (check-css), aucune couleur en dur : tout
 * vient des jetons de dashboard.css. Le jaune de la marque reste au [AI] du logo.
 * Les couleurs semantiques ne servent qu'a des ETATS (badge d'une version, d'un
 * verdict de brique), jamais a decorer.
 */

.admin-tabs {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  margin-bottom: var(--space-4);
  border-bottom: 1px solid var(--border);
  padding-bottom: var(--space-2);
}

.admin-tab {
  appearance: none;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--text-muted);
  font: inherit;
  padding: var(--space-2) var(--space-3);
  cursor: pointer;
}

.admin-tab:hover { background: var(--surface-2); color: var(--text); }

.admin-tab[aria-current='true'] {
  background: var(--primary-soft);
  border-color: var(--primary);
  color: var(--primary);
  font-weight: 600;
}

.admin-panel { display: flex; flex-direction: column; gap: var(--space-4); }

/* --- Tableaux ---------------------------------------------------------- */

.admin-table-wrap { overflow-x: auto; }

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.admin-table th,
.admin-table td {
  text-align: left;
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.admin-table th {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.8rem;
  white-space: nowrap;
}

.admin-table tbody tr:hover { background: var(--surface-2); }

/* --- Champs ------------------------------------------------------------ */

.admin-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  margin-bottom: var(--space-3);
}

.admin-field-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* --- L'editeur --------------------------------------------------------- */

.admin-editor-body { display: flex; flex-direction: column; gap: var(--space-3); }

.admin-module {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-3);
  background: var(--surface);
}

.admin-module > summary {
  cursor: pointer;
  font-weight: 600;
  list-style: revert;
}

.admin-quiz {
  border-left: 2px solid var(--border);
  padding-left: var(--space-3);
  margin-bottom: var(--space-3);
}

.admin-option {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.admin-option > input[type='checkbox'] { flex: none; }
.admin-option > .input { flex: 1; }

/* --- Les reproches ----------------------------------------------------- */

.admin-problems {
  margin: 0 0 var(--space-3);
  padding-left: var(--space-5);
  color: var(--danger);
  font-size: 0.85rem;
}

.admin-problems li { margin-bottom: var(--space-1); }

/* ECL-35 — le filtre « hors module seulement » de l'onglet Questions : une
 * case et son libellé sur la meme ligne, pas un champ empile. */
.admin-questions-filter {
  flex-direction: row;
  align-items: center;
  gap: var(--space-2);
}

.admin-questions-filter .input { width: auto; }

/* ECL-75 — la jauge d'un plafond d'organisation, dans le Monitoring.
 * Un rail, une part : le ratio vient du serveur, jamais d'un calcul inventé
 * ici. La couleur dit un ÉTAT et rien d'autre — sous le plafond, proche,
 * atteint. Un plafond NON MESURÉ n'a pas de jauge du tout : il n'a pas de
 * valeur à montrer, et une barre vide se lirait « zéro ». */
.admin-gauge {
  display: block;
  width: 100%;
  max-width: 160px;
  height: 6px;
  border-radius: 999px;
  background: var(--border-soft);
  overflow: hidden;
}

.admin-gauge-fill { display: block; height: 100%; border-radius: 999px; background: var(--success); }
.admin-gauge-fill.is-warning { background: var(--warning); }
.admin-gauge-fill.is-danger { background: var(--danger); }

.admin-cap { margin: 0 0 var(--space-2); font-size: 0.78rem; }
.admin-cap:last-child { margin-bottom: 0; }
.admin-cap-label { display: block; color: var(--text-muted); }

/* Un coût que personne n'a chiffré : il se LIT comme un aveu, jamais comme un
 * zéro discret. */
.admin-cost-unknown { color: var(--warning); font-size: 0.78rem; margin: 0; }
