/* =============================================================================
   Paramètres (société, utilisateurs, compteurs, journal, base) et Mon compte.
   Complète app.css ; aucune règle globale redéfinie.
   ============================================================================= */

/* Fiche en lecture : libellé / valeur sur deux colonnes */
.fiche-dl { display: grid; grid-template-columns: minmax(120px, max-content) 1fr; gap: 8px 18px; margin: 0 0 14px; }
.fiche-dl dt { color: var(--muted); font-size: 13px; }
.fiche-dl dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.texte-long { white-space: pre-wrap; overflow-wrap: anywhere; }

/* Cellules de tableau qui peuvent passer à la ligne */
.tbl td.wrap { white-space: normal; overflow-wrap: anywhere; }

/* Journal d'audit : avant / après */
.journal-champs summary { cursor: pointer; color: var(--primary); }
.journal-champs[open] summary { margin-bottom: 8px; }
.diff { width: 100%; border-collapse: collapse; font-size: 13px; }
.diff th { text-align: left; font-weight: 500; color: var(--muted); padding: 4px 8px; border-bottom: 1px solid var(--line-2); }
.diff td { padding: 4px 8px; border-bottom: 1px solid var(--line-2); vertical-align: top; white-space: pre-wrap; overflow-wrap: anywhere; }
.diff td.champ { font-family: var(--mono); color: var(--ink-2); white-space: nowrap; }
.diff .avant { color: var(--red-ink); background: var(--red-bg); }
.diff .apres { color: var(--green-ink); background: var(--green-bg); }
.diff .vide { color: var(--muted); font-style: italic; background: transparent; }

/* Compteurs : formulaire dans la ligne du tableau */
.compteur-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; }
.compteur-form input { width: 110px; height: 36px; padding: 0 8px; border: 1px solid var(--field); border-radius: 7px; font: 400 14px var(--mono); text-align: right; }
.compteur-form input[aria-invalid="true"] { border-color: var(--red-ink); }
.compteur-err { margin: 4px 0 0; color: var(--red-ink); font-size: 12.5px; white-space: normal; }

/* Zone sensible (base de données) */
.zone-sensible { border-color: #F2B8B5; }
.zone-sensible .card-h { color: var(--red-ink); }

/* Déverrouillage (zone sensible) : bouton rouge, motif lisible dans l'historique */
.btn.primary.danger-fond { background: var(--red-ink); border-color: var(--red-ink); color: #FFFFFF; }
.btn.primary.danger-fond:hover { background: #8F1C13; }
.tbl td.cell-wrap { white-space: normal; min-width: 160px; max-width: 420px; overflow-wrap: anywhere; }

/* Références (ancienne « Gestion des références », capture 181) : cadre du haut, onglet « Principal »,
   compteurs à gauche, déblocage au centre, taux de TVA à droite, puis deux colonnes et pleine largeur.
   Libellés à gauche des champs et densité « bureau » au-dessus de 900 px ; empilé en dessous. */
.ref-fenetre { gap: 12px; }
/* Fenêtre « Gestion des références - Mode » : cadre du haut centré (Titre, Euro), pastilles des autres paramètres sous la fenêtre */
.ref-entete-g { grid-template-columns: minmax(0, 1fr); }
.ref-entete-g .ref-entete { width: min(560px, 100%); justify-self: center; padding: 0; }
.ref-autres { margin-top: 18px; display: flex; flex-direction: column; gap: 6px; }
.ref-autres-l { margin: 0; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.ref-autres .segments { padding: 0; }
.ref-autres p.small { margin: 0; }
.ref-entete-in { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px 28px; padding: 12px 18px; }
.ref-titre { flex-direction: row; align-items: center; gap: 10px; }
.ref-titre input { width: 150px; }
.ref-grille { display: grid; gap: 14px 24px; }
.ref-gauche, .ref-droite, .ref-large { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.ref-deux { display: grid; gap: 8px 24px; min-width: 0; }
.ref-centre { display: flex; align-items: center; justify-content: center; }
.btn.ref-deblocage { flex-direction: column; justify-content: center; gap: 2px; min-height: 76px; padding: 10px 22px; text-align: center; white-space: normal;
  color: var(--red-ink); border: 2px solid #E8B4AE; background: var(--red-bg); font-weight: 600; }
.btn.ref-deblocage:hover { background: #F9DCD8; color: var(--red-ink); }
.ref-note { margin: 0; }
.ref-vide { min-height: 1px; }

@media (min-width: 900px) {
  .ref-grille { grid-template-columns: minmax(0, 1.25fr) minmax(0, .8fr) minmax(0, 1fr);
    grid-template-areas: "gauche centre droite" "deux deux deux" "large large large"; }
  .ref-gauche { grid-area: gauche; }
  .ref-centre { grid-area: centre; }
  .ref-droite { grid-area: droite; align-items: flex-end; }
  .ref-deux { grid-area: deux; grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr); }
  .ref-large { grid-area: large; }
  /* Libellé à gauche, aligné à droite contre le champ, comme l'ancien écran */
  .ref-principal .fld { display: grid; grid-template-columns: 11.5rem minmax(0, 1fr); align-items: center; column-gap: 10px; row-gap: 4px; }
  .ref-principal .fld > label { text-align: right; }
  .ref-principal .fld > .fld-err { grid-column: 2; margin: 0; }
  .ref-principal .fld input, .ref-principal .fld select { min-height: 34px; }
  .ref-principal .fld textarea { min-height: 52px; }
  .ref-gauche .fld { grid-template-columns: 11.5rem 9rem; }
  .ref-droite .fld { grid-template-columns: 8.5rem 7rem; }
  .ref-deux .fld:nth-child(odd) { grid-template-columns: 11.5rem 9rem; }
  .ref-deux .fld:nth-child(even) { grid-template-columns: 8.5rem minmax(0, 1fr); }
  .ref-note { margin-left: calc(11.5rem + 10px); }
}
