/* AutoFact : onglets, exports, options, résultat, journal, paramètres partagés (src/pages/autofact). */

.af {
  display: grid;
  gap: 1rem;
}

.af-discret {
  color: var(--discret);
  font-size: 0.92rem;
}

/* ---------- onglets ---------- */
.af-onglets,
.af-sous-onglets {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  border-bottom: 1px solid var(--bord);
}

.af-onglet,
.af-sous-onglet {
  min-height: 2.75rem;
  padding: 0.5rem 0.9rem;
  border: 0;
  border-bottom: 3px solid transparent;
  background: none;
  color: var(--encre-2);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.af-onglet:hover,
.af-sous-onglet:hover {
  background: var(--survol);
}

.af-onglet:focus-visible,
.af-sous-onglet:focus-visible {
  outline: var(--anneau);
  outline-offset: -3px;
}

.af-onglet[aria-selected="true"],
.af-sous-onglet[aria-selected="true"] {
  border-bottom-color: var(--bleu);
  color: var(--bleu-fonce);
}

.af-sous-onglet {
  font-size: 0.92rem;
}

/* ---------- contrôle ---------- */
.af-page > .carte {
  display: grid;
  gap: 0.9rem;
}

.af-exports {
  display: grid;
  gap: 0.6rem;
}

.af-export {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  padding: 0.65rem 0.8rem;
  border: 1px solid var(--trait);
  border-radius: var(--rayon-petit);
  background: var(--fond-doux);
}

.af-export__textes {
  flex: 1 1 18rem;
  min-width: 0;
  overflow-wrap: anywhere;
}

.af-export__libelle {
  font-weight: 600;
}

.af-export__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.af-fichier {
  cursor: pointer;
}

input.visuellement-cache:focus-visible + .af-fichier,
.af-fichier:focus-within {
  outline: var(--anneau);
  outline-offset: 2px;
}

.af-fichier--inactif {
  opacity: 0.55;
  pointer-events: none;
}

.af-numeros {
  font-family: var(--police-mono);
  resize: vertical;
}

.af-options {
  display: grid;
  gap: 0.25rem;
}

.af-lancer {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* ---------- résultat et journal ---------- */
.af-resultat {
  display: grid;
  gap: 0.75rem;
}

.af-resume,
.af-pre {
  white-space: pre-line;
}

.af-fichiers {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
}

.af-fichiers li {
  max-width: 100%;
}

.af-fichiers a {
  max-width: 100%;
  height: auto;
  white-space: normal;
  text-align: left;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.af-journal {
  display: grid;
  gap: 0.35rem;
}

.af-journal__titre {
  color: var(--encre-2);
  font-size: 0.9rem;
}

.af-journal__texte {
  max-height: 16rem;
  min-height: 6rem;
  margin: 0;
  padding: 0.6rem 0.8rem;
  overflow: auto;
  border: 1px solid var(--bord);
  border-radius: var(--rayon-petit);
  background: var(--fond-doux);
  color: var(--encre);
  font-family: var(--police-mono);
  font-size: 0.82rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.af-journal__texte:focus-visible {
  outline: var(--anneau);
  outline-offset: 2px;
}

/* ---------- paramètres ---------- */
.af-params {
  display: grid;
  gap: 0.75rem;
}

.af-params__entete {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
}

.af-params__entete > p {
  flex: 1 1 22rem;
}

.af-aide {
  font-size: 0.88rem;
}

.af-outils {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* l'en-tête masqué du tableau (écran étroit, position absolue) reste dans le cadre qui défile : jamais de page
   plus large que l'écran */
.af-params .tableau-adaptatif {
  position: relative;
}

.af-table td {
  overflow-wrap: anywhere;
}

.af-ligne--defaut td {
  color: var(--discret);
}

.af-actions {
  white-space: nowrap;
}

.af-actions .bouton {
  min-height: 2.75rem;
}

.af-vide {
  padding: 0.75rem 0;
}

.af-membres {
  padding-left: 1.2rem;
}

.af-saisie-titre {
  font-weight: 650;
}

.af-formulaire {
  display: grid;
  gap: 0.6rem;
}

.af-lignes {
  min-height: 9rem;
  resize: vertical;
}

@media (max-width: 47.99em) {
  .af-actions {
    white-space: normal;
  }

  .af-actions::before {
    content: none;
  }
}
