/* Administration : journal, plantages, utilisation, actualités, Migration Pennylane.
   Téléphone d'abord ; filtres et tableaux s'élargissent à partir de 40 em et 64 em. Cibles de 44 px au moins. */

/* ---------- textes et blocs communs ---------- */
.resume-page {
  margin-bottom: 0.75rem;
  color: var(--encre-2);
}

.liste-simple {
  margin: 0;
  padding-left: 1.2rem;
  display: grid;
  gap: 0.25rem;
}

.code-court {
  font-size: 0.875rem;
  overflow-wrap: break-word;
}

.cellule-coupee {
  overflow-wrap: break-word;
}

.bloc-code {
  margin: 0;
  max-height: 22rem;
  overflow: auto;
  padding: 0.75rem 0.9rem;
  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.85rem;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

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

.bloc-code--pile {
  max-height: 18rem;
}

.bloc-code--entier {
  max-height: none;
  overflow: visible;
}

.pile-cartes {
  display: grid;
  gap: 1.25rem;
}

.boutons-ligne {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.lien-bouton--danger {
  color: var(--mauvais);
}

.lien-bouton--danger:hover {
  color: #8f1515;
}

/* ---------- boutons segmentés (filtre d'état, période) ---------- */
.barre-filtres {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

/* ---------- onglets du journal ---------- */
.sous-onglets {
  display: flex;
  gap: 0.25rem;
  margin: 1rem 0;
  border-bottom: 1px solid var(--bord);
  overflow-x: auto;
}

.sous-onglets__onglet {
  min-height: 2.75rem;
  padding: 0 0.9rem;
  border: 0;
  border-bottom: 3px solid transparent;
  background: none;
  color: var(--encre-2);
  font-weight: 600;
  white-space: nowrap;
}

.sous-onglets__onglet:hover {
  color: var(--bleu-fonce);
  background: var(--survol);
}

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

/* ---------- filtres ---------- */
.filtres {
  margin-bottom: 1rem;
  padding: 0.25rem 1rem;
  border: 1px solid var(--bord);
  border-radius: var(--rayon);
  background: var(--fond-doux);
}

.filtres__repli {
  display: grid;
}

.filtres__titre {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  min-height: 2.75rem;
  cursor: pointer;
  font-weight: 700;
  color: var(--encre);
  list-style: none;
}

.filtres__titre::-webkit-details-marker {
  display: none;
}

/* chevron : pointe à droite replié, en bas déplié */
.filtres__titre::before {
  content: "";
  width: 0.5rem;
  height: 0.5rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  transition: transform 0.15s;
}

.filtres__repli[open] > .filtres__titre::before {
  transform: rotate(45deg);
}

.filtres__titre:focus-visible {
  outline: var(--anneau);
  outline-offset: 2px;
  border-radius: 4px;
}

.filtres__compte {
  padding: 0.1rem 0.55rem;
  border-radius: 999px;
  background: var(--bleu-pale);
  color: var(--bleu-fonce);
  font-size: 0.8rem;
  font-weight: 650;
}

.filtres__corps {
  display: grid;
  gap: 0.75rem;
  margin: 0.25rem 0 0.75rem;
}

.filtres__champs {
  display: grid;
  gap: 0.75rem;
  align-items: start;
}

@media (min-width: 40em) {
  .filtres__champs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 64em) {
  .filtres__champs {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

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

/* ---------- tableaux : cellule cliquable, pied de liste ---------- */
.lien-cellule {
  min-height: 2.75rem;
  padding: 0;
  border: 0;
  background: none;
  color: var(--bleu);
  font-weight: 600;
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 2px;
  white-space: nowrap;
}

.lien-cellule:hover {
  color: var(--bleu-fonce);
}

.lien-cellule--texte {
  white-space: normal;
  overflow-wrap: anywhere;
}

.barre-pied {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
  margin-top: 1rem;
}

.barre-pied__compte {
  color: var(--discret);
  font-size: 0.9rem;
}

.cellule-version {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

/* ---------- fiche de détail (fenêtres) ---------- */
.fiche {
  margin: 0;
  display: grid;
  gap: 0;
}

.fiche__ligne {
  display: grid;
  gap: 0.1rem;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--trait);
}

@media (min-width: 40em) {
  .fiche__ligne {
    grid-template-columns: minmax(0, 12rem) minmax(0, 1fr);
    gap: 0.75rem;
  }
}

.fiche__titre {
  color: var(--discret);
  font-size: 0.875rem;
  font-weight: 600;
}

.fiche__valeur {
  margin: 0;
  overflow-wrap: anywhere;
}

.detail-journal {
  display: grid;
  gap: 0.9rem;
}

.detail-journal__titre {
  font-size: 1rem;
  font-weight: 700;
  color: var(--encre);
}

.detail-journal__hash .fiche__valeur {
  font-family: var(--police-mono);
  font-size: 0.85rem;
}

.ancre {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.5rem;
  align-items: center;
  margin-top: 0.4rem;
}

.ancre__valeur {
  font-size: 0.85rem;
  overflow-wrap: anywhere;
}

/* ---------- plantages ---------- */
.detail-plantage {
  display: grid;
  gap: 0.9rem;
}

.detail-plantage__titre {
  font-weight: 700;
  overflow-wrap: anywhere;
}

.detail-plantage__infos {
  color: var(--encre-2);
  font-size: 0.95rem;
  overflow-wrap: anywhere;
}

/* ---------- zone de texte ---------- */
.champ__saisie--zone {
  min-height: 6rem;
  line-height: 1.45;
  resize: vertical;
}

.zone__compteur {
  text-align: right;
}

.zone__compteur--plein {
  color: var(--mauvais);
  font-weight: 600;
}

/* ---------- utilisation : chiffres de synthèse ---------- */
.tuiles-chiffres {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

@media (min-width: 40em) {
  .tuiles-chiffres {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 64em) {
  .tuiles-chiffres {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.tuile-chiffre {
  display: grid;
  align-content: start;
  gap: 0.3rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--bord);
  border-radius: var(--rayon-petit);
  background: var(--fond);
}

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

.tuile-chiffre__valeur {
  color: var(--encre);
  font-size: 1.5rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.tuile-chiffre__valeur--texte {
  font-size: 1.05rem;
  line-height: 1.4;
}

.tuile-chiffre__etat {
  display: inline-flex;
  gap: 0.3rem;
  align-items: center;
  justify-self: start;
}

.section-suivi {
  margin-top: 1.25rem;
}

.section-suivi__titre {
  margin-bottom: 0.6rem;
  font-size: 1.1rem;
  font-weight: 700;
}

/* ---------- actualités : liste et formulaire ---------- */
.editeur-actualites {
  display: grid;
  gap: 1rem;
}

@media (min-width: 64em) {
  .editeur-actualites {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
    align-items: start;
  }
}

.editeur-actualites__liste {
  display: grid;
  gap: 0.75rem;
}

/* état « Modifications non publiées. » parmi les boutons de l'en-tête de page */
.editeur-actualites__etat {
  align-self: center;
  color: var(--encre-2);
}

.liste-actualites {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.4rem;
}

.liste-actualites__element {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  width: 100%;
  min-height: 2.75rem;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--bord);
  border-radius: var(--rayon-petit);
  background: var(--fond);
  color: var(--encre);
  text-align: left;
}

.liste-actualites__element:hover {
  background: var(--survol);
}

.liste-actualites__element[aria-current="true"] {
  border-color: var(--bleu);
  background: var(--bleu-pale);
  box-shadow: inset 3px 0 0 var(--bleu);
}

.liste-actualites__element--invalide {
  border-color: var(--mauvais);
}

.liste-actualites__rang {
  flex: none;
  min-width: 1.5rem;
  color: var(--discret);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.liste-actualites__textes {
  display: grid;
  min-width: 0;
}

.liste-actualites__titre {
  font-weight: 600;
  overflow-wrap: anywhere;
}

.liste-actualites__date {
  color: var(--discret);
  font-size: 0.875rem;
}

/* ---------- Migration Pennylane : gel ---------- */
.barre-gel {
  display: grid;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

@media (min-width: 40em) {
  .barre-gel {
    grid-template-columns: minmax(0, 24rem) auto;
    justify-content: start;
    align-items: end;
  }
}

@media (prefers-reduced-motion: reduce) {
  .filtres__titre::before {
    transition: none;
  }
}

/* cartes du téléphone : un chemin ou une cible très longs se coupent n'importe où plutôt que de déborder */
@media (max-width: 47.99em) {
  .code-court,
  .cellule-coupee {
    overflow-wrap: anywhere;
  }
}
