/* =============================================================================
   Nova — styles propres à l'application. Mobile-first (CLAUDE.md §7).
   Aucun style en ligne : la CSP ('self') l'interdit.

   Couleurs de la marque :
   - vert pétrole #1F4E4A : couleur principale (boutons, liens, barre latérale) ;
   - orange #E0793A       : accent (repères visuels, bordures, menu actif).
     Contraste de l'orange sur blanc ≈ 2,9:1 : il n'est JAMAIS utilisé comme fond derrière
     du texte blanc ni comme couleur de texte courant (accessibilité).
   ============================================================================= */


:root {
  /* Identité visuelle Nova - Bleu ciel professionnel */
  --nova-petrole: #2563EB;
  --nova-petrole-fonce: #1D4ED8;
  --nova-petrole-clair: #EAF2FF;

  --nova-orange: #38BDF8;
  --nova-orange-fonce: #0369A1;

  --nova-fond: #F5F8FC;

  /* Bootstrap */
  --bs-primary: var(--nova-petrole);
  --bs-primary-rgb: 37, 99, 235;
  --bs-primary-text-emphasis: #172554;
  --bs-primary-bg-subtle: #DBEAFE;
  --bs-primary-border-subtle: #93C5FD;

  --bs-link-color: var(--nova-petrole);
  --bs-link-color-rgb: 37, 99, 235;
  --bs-link-hover-color: var(--nova-petrole-fonce);
  --bs-link-hover-color-rgb: 29, 78, 216;

  --bs-border-radius: .5rem;
  --bs-focus-ring-color: rgba(37, 99, 235, .25);
}
/* Fond de page gris très clair ; cartes et champs restent blancs (--bs-body-bg inchangé). */
body { background-color: var(--nova-fond); }

/* --- Composants Bootstrap aux couleurs de la marque ------------------------------------ */
.btn-primary {
  --bs-btn-bg: var(--nova-petrole);
  --bs-btn-border-color: var(--nova-petrole);
  --bs-btn-hover-bg: var(--nova-petrole-fonce);
  --bs-btn-hover-border-color: var(--nova-petrole-fonce);
  --bs-btn-active-bg: #11302d;
  --bs-btn-active-border-color: #11302d;
  --bs-btn-disabled-bg: var(--nova-petrole);
  --bs-btn-disabled-border-color: var(--nova-petrole);
}
.btn-outline-primary {
  --bs-btn-color: var(--nova-petrole);
  --bs-btn-border-color: var(--nova-petrole);
  --bs-btn-hover-bg: var(--nova-petrole);
  --bs-btn-hover-border-color: var(--nova-petrole);
  --bs-btn-active-bg: var(--nova-petrole-fonce);
  --bs-btn-active-border-color: var(--nova-petrole-fonce);
}
.btn-outline-secondary {
  --bs-btn-color: #3d4a48;
  --bs-btn-border-color: #8a9896;
  --bs-btn-hover-bg: #3d4a48;
  --bs-btn-hover-border-color: #3d4a48;
}
.pagination {
  --bs-pagination-color: var(--nova-petrole);
  --bs-pagination-hover-color: var(--nova-petrole-fonce);
  --bs-pagination-active-bg: var(--nova-petrole);
  --bs-pagination-active-border-color: var(--nova-petrole);
  --bs-pagination-focus-box-shadow: none;
}
.nav-tabs { --bs-nav-link-color: var(--nova-petrole); --bs-nav-link-hover-color: var(--nova-petrole-fonce); }
.text-bg-primary { background-color: var(--nova-petrole) !important; }
.form-check-input:checked { background-color: var(--nova-petrole); border-color: var(--nova-petrole); }
.form-control:focus, .form-select:focus, .form-check-input:focus {
  border-color: #5d8a86;
  box-shadow: 0 0 0 .25rem rgba(31, 78, 74, .2);
}
.card { --bs-card-border-color: #dfe5e4; }

/* --- Accessibilité --------------------------------------------------------------------- */

/* Zones cliquables d'au moins 44 px */
.nova-tap {
  min-height: 44px;
  min-width: 44px;
  display: inline-flex;
  align-items: center;
  gap: .4rem;
}
.btn.nova-tap { justify-content: center; }

/* Focus toujours visible : contour à double couleur (sombre + blanc), lisible sur fond clair
   comme sur la barre latérale vert pétrole. */
:focus-visible,
.btn:focus-visible,
.btn-close:focus-visible,
.nav-link:focus-visible,
.page-link:focus-visible,
.list-group-item:focus-visible,
.navbar-brand:focus-visible,
.form-control:focus-visible,
.form-select:focus-visible,
.form-check-input:focus-visible {
  outline: 3px solid #212529;
  outline-offset: 2px;
  box-shadow: 0 0 0 5px #fff;
}

/* Bouton de fermeture (menu, boîte de dialogue, messages) : zone cliquable de 44 px. */
.offcanvas-header .btn-close,
.modal-header .btn-close {
  width: 44px;
  height: 44px;
  padding: 0;
  margin: -.5rem -.5rem -.5rem auto;
  background-size: 1em;
}

.nova-skip:focus {
  position: absolute;
  top: .5rem;
  left: .5rem;
  z-index: 2000;
  padding: .5rem 1rem;
  background: #fff;
}

.min-w-0 { min-width: 0; }
.nova-nombre { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* --- Mise en page ---------------------------------------------------------------------- */
.nova-barre-haut {
  background: var(--nova-petrole);
  border-bottom: 3px solid var(--nova-orange);
}
.nova-btn-menu { color: #fff; padding: 0 .5rem; }
.nova-btn-menu:hover { color: #fff; background: rgba(255, 255, 255, .1); }
.nova-marque {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-weight: 700;
  letter-spacing: .02em;
  color: #fff;
  text-decoration: none;
  font-size: 1.25rem;
}
.nova-marque:hover { color: #fff; }
.nova-logo {
  display: inline-grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: .45rem;
  background: var(--nova-orange);
  color: #1b1b1b;
  font-weight: 800;
}

.nova-contenu { padding: 1rem .75rem 2rem; }
.nova-contenu:focus { outline: none; }

/* Barre latérale (offcanvas sur mobile, fixe ≥ lg) */
.nova-sidebar {
  --bs-offcanvas-width: 280px;
  --bs-offcanvas-bg: var(--nova-petrole);
  --bs-offcanvas-color: #fff;
  background: var(--nova-petrole);
  color: #fff;
}
.nova-sidebar .offcanvas-header { border-bottom: 1px solid rgba(255, 255, 255, .12); }
.nova-marque-sidebar { padding: 1.25rem 1.25rem 1rem; }
.nova-nav .nav-link {
  color: rgba(255, 255, 255, .88);
  border-radius: .4rem;
  border-left: 3px solid transparent;
  gap: .65rem;
  padding: .5rem .75rem;
  width: 100%;
}
.nova-nav .nav-link:hover { color: #fff; background: rgba(255, 255, 255, .08); }
.nova-nav .nav-link.active {
  color: #fff;
  background: rgba(255, 255, 255, .14);
  border-left-color: var(--nova-orange);
  font-weight: 600;
}
.nova-nav-section {
  margin: 1.25rem .75rem .35rem;
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .72);
  display: flex;
  gap: .4rem;
}
.nova-utilisateur {
  border-top: 1px solid rgba(255, 255, 255, .14);
  padding: .75rem .75rem 1rem;
}
.nova-utilisateur-nom {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: 0 .75rem;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.nova-lien-utilisateur {
  color: rgba(255, 255, 255, .88);
  text-decoration: none;
  background: none;
  border: 0;
  border-radius: .4rem;
  padding: .25rem .75rem;
  font-size: .925rem;
  text-align: left;
}
.nova-lien-utilisateur:hover { color: #fff; background: rgba(255, 255, 255, .08); }

@media (min-width: 576px) {
  .nova-contenu { padding: 1.25rem 1.25rem 2.5rem; }
}
@media (min-width: 992px) {
  .nova-layout {
    display: flex;
    min-height: 100vh;
    /* Le fond vert pétrole couvre toute la hauteur, même sur une page plus longue que l'écran. */
    background: linear-gradient(90deg, var(--nova-petrole) 260px, transparent 260px);
  }
  /* .offcanvas-lg force un fond transparent (!important) à partir de lg : on le rétablit. */
  .offcanvas-lg.nova-sidebar {
    background-color: var(--nova-petrole) !important;
    color: #fff;
  }
  .nova-sidebar {
    width: 260px;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
  }
  .nova-sidebar .offcanvas-body { min-height: 100%; }
  .nova-contenu { flex: 1; min-width: 0; padding: 1.75rem 2rem 3rem; max-width: 1400px; }
}

/* --- En-tête de page ------------------------------------------------------------------- */
.nova-entete { margin-bottom: 1.25rem; }
.nova-fil-ariane { margin-bottom: .35rem; font-size: .875rem; }
.nova-fil-ariane a { text-decoration: none; }
.nova-entete-ligne { display: flex; flex-direction: column; gap: .75rem; }
.nova-titre { font-size: 1.5rem; font-weight: 700; margin: 0; color: #172b29; overflow-wrap: anywhere; }
.nova-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.nova-actions .btn { flex: 1 1 auto; }
@media (min-width: 576px) {
  /* Fiches à nombreuses actions : la barre passe sous le titre puis revient à la ligne. */
  .nova-entete-ligne { flex-direction: row; flex-wrap: wrap; align-items: center; }
  .nova-actions { flex-wrap: wrap; justify-content: flex-end; margin-left: auto; max-width: 100%; }
  .nova-actions .btn { flex: 0 0 auto; }
  .nova-titre { font-size: 1.75rem; }
}

/* Sous 768 px (R2, lot 3) : action principale + menu « Actions », sur une seule ligne,
   jamais plus larges que la zone de contenu. */
.nova-actions-mobile { flex-wrap: nowrap; width: 100%; max-width: 100%; }
.nova-actions-mobile > .btn, .nova-actions-mobile > .dropdown { flex: 1 1 0; min-width: 0; }
.nova-actions-mobile > .dropdown > .btn { width: 100%; }
.nova-actions-mobile .btn { white-space: normal; }
.nova-actions-mobile .dropdown-menu { max-width: calc(100vw - 2rem); }
.dropdown-item.nova-tap { display: flex; width: 100%; gap: .5rem; white-space: normal; }

/* Listes (R4, R5, lot 3) : cartes jusqu'à 991 px (le tableau ne tient pas à 768 px), sur deux
   colonnes à partir de 576 px ; le champ de recherche garde une largeur utile. */
@media (min-width: 576px) and (max-width: 991.98px) {
  .nova-cartes-liste { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.nova-col-recherche { min-width: min(100%, 16rem); }

/* --- Zones cliquables d'au moins 44 × 44 px (CLAUDE.md §7 ; R7 à R10, lot 3) -------------
   Liens du contenu (fil d'Ariane, n° de document, tiers, « Voir… » des widgets, cellules des
   tableaux) : boîte en ligne d'au moins 44 px de haut et de large, sans changer le texte. */
.nova-marque { min-height: 44px; }
.nova-fil-ariane .breadcrumb-item { display: inline-flex; align-items: center; }
#contenu a:not(.btn):not(.nav-link):not(.page-link):not(.dropdown-item):not(.list-group-item):not(.stretched-link):not(.nova-tri):not(.nova-tap) {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  min-width: 44px;
  vertical-align: middle;
}
/* Case à cocher, bouton radio : toute la ligne (case + libellé) est cliquable, 44 px de haut. */
.form-check { display: flex; align-items: center; gap: .5rem; min-height: 44px; }
.form-check .form-check-input { margin-top: 0; flex-shrink: 0; }
.form-check .form-check-label { flex: 1 1 auto; align-self: stretch; display: flex; align-items: center; }

/* --- Messages -------------------------------------------------------------------------- */
.nova-messages:empty { display: none; }
.nova-messages .alert { margin-bottom: .75rem; }
.nova-messages .alert > .bi { margin-top: .15rem; }

/* --- Listes ---------------------------------------------------------------------------- */
.nova-barre {
  background: #fff;
  border: 1px solid #dfe5e4;
  border-radius: var(--bs-border-radius);
  padding: .75rem;
  margin-bottom: 1rem;
}
.nova-resultats-entete { display: flex; align-items: center; gap: .5rem; margin-bottom: .5rem; min-height: 44px; }
.nova-tableau { overflow: hidden; }
.nova-tableau thead th {
  background: var(--nova-petrole-clair);
  color: #22403d;
  font-size: .8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .03em;
  white-space: nowrap;
  vertical-align: middle;
  border-bottom: 2px solid var(--nova-orange);
}
.nova-tri { color: inherit; text-decoration: none; display: inline-flex; align-items: center; gap: .3rem; min-height: 44px; }
.nova-tri:hover { color: var(--nova-petrole); }
.nova-tri-inactif { opacity: .35; }
.nova-tableau td { padding-top: .7rem; padding-bottom: .7rem; }

.nova-cartes { list-style: none; padding: 0; margin: 0; display: grid; gap: .6rem; }
.nova-carte-ligne { border-left: 4px solid var(--nova-orange); }
.nova-carte-ligne .card-body { padding: .85rem 1rem; }
.nova-carte-titre { font-weight: 600; margin-bottom: .4rem; min-height: 1.5rem; }
.nova-carte-titre a { text-decoration: none; }
.nova-carte-details { margin: 0; display: grid; gap: .25rem; font-size: .9rem; }
.nova-carte-details > div { display: flex; justify-content: space-between; gap: 1rem; }
.nova-carte-details dt { font-weight: 400; color: var(--bs-secondary-color); }
.nova-carte-details dd { margin: 0; text-align: right; overflow-wrap: anywhere; }

.nova-pagination {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .5rem;
  margin-top: 1rem;
}
@media (min-width: 576px) {
  .nova-pagination { flex-direction: row; justify-content: space-between; }
}

.nova-vide {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--bs-secondary-color);
  background: #fff;
  border: 1px dashed #c9d3d2;
  border-radius: var(--bs-border-radius);
}
.nova-vide > .bi { font-size: 2rem; display: block; margin-bottom: .5rem; color: var(--nova-petrole); }
.nova-vide-accueil { padding: 3.5rem 1.5rem; max-width: 44rem; }

/* --- Badges ---------------------------------------------------------------------------- */
.nova-badge { font-weight: 600; font-size: .78rem; padding: .35em .7em; }

/* --- Formulaires ----------------------------------------------------------------------- */
.nova-form { max-width: 46rem; }
.nova-form-large { max-width: none; }
.nova-champ { margin-bottom: 1.1rem; }
.nova-champ.form-check { padding-left: 1.75em; min-height: 44px; display: block; }
.nova-champ .form-check-input { width: 1.25em; height: 1.25em; margin-left: -1.75em; margin-top: .15em; }
.nova-choix { display: grid; gap: .1rem; }
.nova-choix .form-check { min-height: 44px; display: flex; align-items: center; gap: .5rem; padding-left: 0; }
.nova-choix .form-check-input { float: none; margin: 0; width: 1.2em; height: 1.2em; flex-shrink: 0; }
@media (min-width: 768px) {
  .nova-choix { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 1.5rem; }
}
.nova-form .form-text ul { padding-left: 1.1rem; margin-bottom: 0; }
.nova-form-boutons {
  display: flex;
  flex-direction: column-reverse;
  gap: .5rem;
  margin-top: 1.5rem;
}
@media (min-width: 576px) {
  .nova-form-boutons { flex-direction: row; justify-content: flex-end; }
}
.nova-carte-formulaire .card-body { padding: 1rem; }
.nova-contenu > .nova-carte-formulaire { max-width: 50rem; }
@media (min-width: 768px) {
  .nova-carte-formulaire .card-body { padding: 1.5rem; }
  .nova-grille-champs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 1.5rem; }
}
.modal-footer.nova-form-boutons { align-items: stretch; }
.modal-footer.nova-form-boutons > * { margin: 0; }

.form-control-color { width: 4.5rem; min-height: 44px; }

/* Champs de saisie et listes déroulantes : zone tactile d'au moins 44 px (CLAUDE.md §7),
   formulaires comme filtres des listes. */
.form-control,
.form-select { min-height: 44px; }

/* --- Onglets --------------------------------------------------------------------------- */
.nova-onglets {
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  border-bottom: 0;
}
.nova-onglets .nav-link { white-space: nowrap; gap: .4rem; font-weight: 500; }
.nova-onglets .nav-link.active { border-top: 3px solid var(--nova-orange); font-weight: 600; color: #172b29; }
.nova-onglets-contenu { border-top-left-radius: 0; }
@media (max-width: 575.98px) {
  .nova-onglets {
    flex-wrap: wrap;
    overflow: visible;
    gap: .35rem;
    margin-bottom: .5rem;
  }
  .nova-onglets .nav-item { flex: 1 1 auto; }
  .nova-onglets .nav-link {
    width: 100%;
    justify-content: center;
    border: 1px solid #dfe5e4;
    border-radius: .4rem;
    background: #fff;
  }
  .nova-onglets .nav-link.active { border-color: var(--nova-petrole); border-top: 3px solid var(--nova-orange); }
  .nova-onglets-contenu { border-top-left-radius: var(--bs-border-radius); }
}

/* --- Cartes de synthèse ---------------------------------------------------------------- */
.nova-carte-synthese { border-top: 4px solid var(--nova-petrole); position: relative; container-type: inline-size; }
/* Carte étroite (4 par ligne, colonne latérale) : l'icône passe au-dessus pour laisser au
   montant toute la largeur. */
@container (max-width: 260px) {
  .nova-carte-synthese .card-body { flex-direction: column; gap: .6rem; }
}
.nova-carte-synthese .card-body { display: flex; gap: .9rem; align-items: flex-start; }
.nova-carte-warning { border-top-color: var(--nova-orange); }
.nova-carte-danger { border-top-color: var(--bs-danger); }
.nova-carte-success { border-top-color: var(--bs-success); }
.nova-carte-icone {
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: .6rem;
  background: var(--nova-petrole-clair);
  color: var(--nova-petrole);
  font-size: 1.3rem;
}
.nova-carte-warning .nova-carte-icone { background: #fbeadf; color: var(--nova-orange-fonce); }
.nova-carte-danger .nova-carte-icone { background: var(--bs-danger-bg-subtle); color: var(--bs-danger-text-emphasis); }
.nova-carte-success .nova-carte-icone { background: var(--bs-success-bg-subtle); color: var(--bs-success-text-emphasis); }
.nova-carte-libelle { font-size: .85rem; color: var(--bs-secondary-color); margin-bottom: .2rem; }
/* Le nombre ne se coupe jamais ; l'unité passe à la ligne si la carte est étroite. */
.nova-carte-valeur { font-size: 1.5rem; font-weight: 700; margin: 0; color: #172b29; line-height: 1.25; }
.nova-carte-synthese .min-w-0 { flex: 1; }
.nova-carte-unite { font-size: .85rem; font-weight: 500; color: var(--bs-secondary-color); }
.nova-carte-sous-texte { font-size: .825rem; margin: .2rem 0 0; color: var(--bs-secondary-color); }

/* --- Fiches ---------------------------------------------------------------------------- */
.nova-fiche-champs { margin: 0; display: grid; gap: .9rem; }
.nova-fiche-champs dt { font-size: .8rem; font-weight: 500; color: var(--bs-secondary-color); }
.nova-fiche-champs dd { margin: 0; }
@media (min-width: 768px) {
  .nova-fiche-champs { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 2rem; }
}
.nova-membres li { border-bottom: 1px solid #edf1f0; }
.nova-membres li:last-child { border-bottom: 0; }

/* --- Auto-complétion ------------------------------------------------------------------- */
.nova-ac { position: relative; }
.nova-ac-liste { position: relative; z-index: 1010; }  /* sous .sticky-top (1020) */
.nova-ac-liste:empty { display: none; }
.nova-ac-menu { margin-top: .25rem; box-shadow: 0 .5rem 1.25rem rgba(23, 43, 41, .12); }
.nova-ac-option { min-height: 44px; text-align: left; }
.nova-ac-option.nova-ac-actif, .nova-ac-option:focus { background: var(--nova-petrole-clair); }
.nova-ac-creer { color: var(--nova-petrole); font-weight: 600; display: flex; align-items: center; gap: .5rem; }

/* --- Pages minimales (connexion, erreurs hors session) --------------------------------- */
.nova-page-minimale {
  min-height: 100vh;
  background:
    linear-gradient(180deg, var(--nova-petrole) 0, var(--nova-petrole) 14rem, var(--nova-fond) 14rem);
}
.nova-minimale-conteneur {
  max-width: 26rem;
  margin: 0 auto;
  padding: 2.5rem 1rem;
}
.nova-marque-minimale { margin-bottom: 1.5rem; justify-content: center; display: flex; font-size: 1.6rem; }
.nova-carte-minimale { box-shadow: 0 1rem 2.5rem rgba(23, 43, 41, .15); border: 0; }
.nova-carte-minimale .card-body { padding: 1.5rem; }
.nova-pied-minimal { text-align: center; font-size: .85rem; color: var(--bs-secondary-color); margin-top: 1rem; }

/* --- Pages d'erreur -------------------------------------------------------------------- */
.nova-erreur { max-width: 38rem; padding: 1.5rem 0; }
.nova-erreur-icone { font-size: 2.5rem; color: var(--nova-orange-fonce); display: block; margin-bottom: .5rem; }
.nova-erreur-code {
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--bs-secondary-color);
  margin-bottom: .25rem;
}

/* --- Catalogue des composants (développement) ------------------------------------------ */
.nova-demo { margin-bottom: 2.25rem; }
.nova-demo-titre { font-size: 1.05rem; font-weight: 600; margin-bottom: .15rem; }
.nova-demo-gabarit { font-size: .8rem; color: var(--bs-secondary-color); margin-bottom: .75rem; }
.nova-demo-gabarit code { color: inherit; background: #e9eeed; padding: .1rem .35rem; border-radius: .25rem; }

/* Indicateurs HTMX (remplacent les styles que HTMX injecterait en ligne, désactivés pour la CSP) */
.htmx-indicator { opacity: 0; }
.htmx-request .htmx-indicator,
.htmx-request.htmx-indicator {
  opacity: 1;
  transition: opacity 200ms ease-in;
}

/* --- Référentiel (étape 3) : fiches, sous-fiches, historique ------------------------------ */
.nova-fiche-media { display: flex; flex-direction: column; gap: 1rem; }
.nova-fiche-photo { width: 100%; max-width: 220px; height: auto; border-radius: var(--bs-border-radius); border: 1px solid #dfe5e4; object-fit: contain; }
@media (min-width: 768px) {
  .nova-fiche-media { flex-direction: row; align-items: flex-start; }
  .nova-cartes-grille { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1200px) {
  .nova-cartes-grille { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.nova-sous-fiche-form { margin-bottom: 1rem; border-left: 4px solid var(--nova-petrole); }
.nova-historique { display: grid; gap: .9rem; }
.nova-historique-version { padding-left: .9rem; border-left: 3px solid #dfe5e4; }

/* Barre d'avancement (comptage d'inventaire) : élément <progress>, sans style en ligne (CSP). */
.nova-progression {
  display: block;
  width: 100%;
  height: .5rem;
  appearance: none;
  border: 0;
  border-radius: 1rem;
  overflow: hidden;
  background-color: var(--bs-secondary-bg);
}
.nova-progression::-webkit-progress-bar { background-color: var(--bs-secondary-bg); }
.nova-progression::-webkit-progress-value { background-color: var(--bs-success); }
.nova-progression::-moz-progress-bar { background-color: var(--bs-success); }

/* Totaux d'un document valorisé (bon de commande, bon de réception) : alignés à droite. */
.nova-totaux { display: grid; gap: .2rem; margin-left: auto; max-width: 26rem; font-size: .95rem; }
.nova-totaux > div { display: flex; justify-content: space-between; gap: 1rem; }
.nova-totaux dt { font-weight: 400; color: var(--bs-secondary-color); }
.nova-totaux dd { margin: 0; }
.nova-totaux-ttc { border-top: 1px solid var(--bs-border-color); padding-top: .3rem; font-weight: 600; }
.nova-totaux-ttc dt { color: inherit; font-weight: 600; }

/* Historique d'audit (onglet des fiches de documents) */
.nova-historique-entree { border-left: 3px solid var(--bs-border-color); padding: .1rem 0 .6rem .8rem; }
.nova-historique-entree + .nova-historique-entree { margin-top: .2rem; }

/* Aperçu des montants d'une ligne pendant la saisie */
.nova-apercu { border: 1px dashed var(--bs-border-color); border-radius: var(--bs-border-radius); padding: .5rem .75rem; }
.nova-apercu-ligne { display: flex; flex-wrap: wrap; gap: .25rem 1.5rem; }
.nova-apercu-ligne > div { display: flex; gap: .5rem; }
.nova-apercu-ligne dt { font-weight: 400; color: var(--bs-secondary-color); }
.nova-apercu-ligne dd { margin: 0; }

/* Réception rapide (mobile) : boutons − / + de 44 px, barre d'actions collée en bas */
.nova-stepper { display: grid; grid-template-columns: 44px minmax(4rem, 1fr) 44px auto; gap: .5rem; align-items: stretch; }
.nova-stepper .form-control { min-height: 44px; font-size: 1.15rem; }
.nova-reception-rapide summary { min-height: 44px; cursor: pointer; }
.nova-barre-actions-bas { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: flex-end; }
@media (max-width: 767.98px) {
  .nova-barre-actions-bas { position: sticky; bottom: 0; z-index: 10; background: var(--bs-body-bg); padding: .75rem 0; border-top: 1px solid var(--bs-border-color); }
  .nova-barre-actions-bas .btn { flex: 1 1 100%; }
}

/* Contrôle de facture : lignes colorées selon le rapprochement (le badge porte aussi le texte) */
.nova-controle-success > td { background: var(--bs-success-bg-subtle); }
.nova-controle-warning > td { background: var(--bs-warning-bg-subtle); }
.nova-controle-danger > td { background: var(--bs-danger-bg-subtle); }
.nova-controle-carte { border-left-width: 4px; }

/* Arbre de traçabilité */
.nova-arbre, .nova-arbre ul { list-style: none; margin: 0; padding-left: 0; }
.nova-arbre ul { padding-left: 1.1rem; border-left: 2px solid var(--bs-border-color); margin-left: .4rem; }
.nova-arbre li { padding: .25rem 0; }
.nova-arbre-noeud { padding: .35rem .6rem; border-radius: var(--bs-border-radius); }
.nova-arbre-courant { background: var(--bs-primary-bg-subtle); outline: 2px solid var(--nova-orange); }

/* Widgets du tableau de bord */
.nova-widget-total { margin-bottom: .5rem; }

/* Graphiques des rapports (SVG, longueurs en attributs : la CSP interdit les styles en ligne) */
.nova-graphique-colonnes { display: block; width: 100%; height: 12rem; }
.nova-graphique-colonnes rect, .nova-graphique-barres rect { fill: var(--bs-primary); }
.nova-graphique-colonnes rect:hover { fill: var(--nova-orange); }
.nova-graphique-axe { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); text-align: center;
  font-size: .7rem; color: var(--bs-secondary-color); margin-top: .25rem; }
.nova-graphique-axe span { overflow: hidden; white-space: nowrap; }
.nova-graphique-barres li + li { margin-top: .5rem; }
.nova-graphique-barres svg { display: block; width: 100%; height: .6rem; border-radius: 2px; }
.nova-graphique-barres rect.nova-graphique-fond { fill: var(--bs-secondary-bg); }
.nova-matrice { font-size: .8rem; }
.nova-matrice th, .nova-matrice td { white-space: nowrap; padding-left: .35rem; padding-right: .35rem; }

/* Lettrage d'un règlement : récapitulatif compact (barre collée en bas sur mobile) */
.nova-recap-lettrage { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .15rem 1rem; }
.nova-recap-lettrage dt { font-weight: 400; font-size: .8rem; color: var(--bs-secondary-color); }
.nova-recap-lettrage dd { margin: 0; }
@media (min-width: 768px) {
  .nova-recap-lettrage { grid-template-columns: repeat(5, minmax(0, auto)); justify-content: space-between; }
}
