/* HAZEMAG – Chargement camions. Couleurs reprises du logo : bleu marine #002540, gris #B2B4B3. */
:root {
  --marine: #002540;
  --marine-2: #0a3a5f;
  --marine-clair: #e6ecf1;
  --gris-logo: #b2b4b3;
  --fond: #f2f4f6;
  --carte: #ffffff;
  --texte: #16202a;
  --texte-2: #5b6772;
  --bord: #d8dde2;
  --vert: #1e7a46;
  --vert-fond: #e5f4ec;
  --rouge: #b42318;
  --rouge-fond: #fdecea;
  --orange-fond: #fff4e0;
  --rayon: 10px;
  --ombre: 0 1px 2px rgba(0, 20, 40, .06), 0 2px 8px rgba(0, 20, 40, .05);
  --nav-h: 64px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--fond);
  color: var(--texte);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-variant-numeric: tabular-nums;
}
a { color: var(--marine-2); }
h1 { font-size: 1.45rem; margin: 0 0 .15rem; color: var(--marine); letter-spacing: -.01em; }
h2 { font-size: 1.05rem; }
.discret { color: var(--texte-2); font-size: .9em; font-style: normal; }
.req { color: var(--rouge); }
kbd { border: 1px solid var(--bord); border-bottom-width: 2px; border-radius: 4px; padding: 0 .3em; font-size: .85em; background: #fff; }
svg { width: 1.2em; height: 1.2em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ------------------------------------------------------------------ en-tête */
.entete { background: var(--marine); color: #fff; position: sticky; top: 0; z-index: 20; }
.entete-inner { max-width: 1280px; margin: 0 auto; display: flex; align-items: center; gap: 1.25rem; padding: .55rem 16px; }
.entete-barre { height: 5px; background: var(--gris-logo); }
.marque { display: flex; align-items: center; gap: .8rem; text-decoration: none; color: #fff; }
.marque img { height: 34px; width: auto; display: block; }
.marque-app { font-size: .82rem; opacity: .85; border-left: 1px solid rgba(255,255,255,.3); padding-left: .8rem; line-height: 1.15; max-width: 7.5rem; }
.nav { display: flex; gap: .25rem; margin-left: auto; }
.nav a { display: flex; align-items: center; gap: .45rem; color: #fff; text-decoration: none; padding: .5rem .8rem; border-radius: 8px; opacity: .85; font-weight: 500; font-size: .95rem; }
.nav a:hover { background: rgba(255,255,255,.1); opacity: 1; }
.nav a.actif { background: rgba(255,255,255,.16); opacity: 1; box-shadow: inset 0 -3px 0 var(--gris-logo); }
.nav-compte { display: none !important; }
.utilisateur { display: flex; align-items: center; gap: .6rem; font-size: .85rem; }
.utilisateur form { margin: 0; }
.utilisateur .btn-lien { color: #fff; opacity: .8; }
.badge-role { background: rgba(255,255,255,.15); border-radius: 99px; padding: .1rem .55rem; font-size: .75rem; }

/* ------------------------------------------------------------------ mise en page */
.page { max-width: 1280px; margin: 0 auto; padding: 16px 16px 32px; }
.carte { background: var(--carte); border: 1px solid var(--bord); border-radius: var(--rayon); box-shadow: var(--ombre); padding: 18px; margin-bottom: 16px; min-width: 0; }
.carte-titre { font-size: 1.05rem; margin: 0 0 .9rem; color: var(--marine); }
.carte-entete { display: flex; justify-content: space-between; align-items: center; gap: .5rem; margin-bottom: .9rem; }
.carte-entete .carte-titre { margin: 0; }
.titre-page { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: .75rem 1rem; margin: 4px 0 14px; }
.titre-page p { margin: 0; }
.grille-2 { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 16px; }
.grille-admin { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 16px; align-items: start; }
.vide { color: var(--texte-2); text-align: center; padding: 1.5rem .5rem; margin: 0; }

/* ------------------------------------------------------------------ formulaires */
.champ { display: flex; flex-direction: column; gap: .3rem; margin-bottom: 14px; font-weight: 600; font-size: .9rem; color: var(--texte); }
.champ > span { display: block; }
input, select, textarea {
  font: inherit; font-weight: 400; color: var(--texte); background: #fff; width: 100%;
  border: 1.5px solid var(--bord); border-radius: 8px; padding: .6rem .75rem; min-height: 44px;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--marine-2); box-shadow: 0 0 0 3px rgba(10,58,95,.18); }
.input-grand { font-size: 1.5rem; font-weight: 700; padding: .55rem .8rem; min-height: 58px; letter-spacing: .02em; }
.input-matricule { text-transform: uppercase; }
.input-matricule::placeholder { text-transform: none; }
.input-unite { position: relative; }
.input-unite input { padding-right: 2.6rem; }
.input-unite .unite { position: absolute; right: .9rem; top: 50%; transform: translateY(-50%); font-weight: 700; color: var(--texte-2); font-size: 1.2rem; }
.champ-admin { margin: 0 0 14px; border: 1px dashed var(--bord); border-radius: 8px; padding: .5rem .75rem; font-size: .9rem; }
.champ-admin summary { cursor: pointer; color: var(--texte-2); }
.champ-admin .champ { margin: .6rem 0 .2rem; }
.aide-clavier { text-align: center; margin: .6rem 0 0; font-size: .8rem; }

/* ------------------------------------------------------------------ boutons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  font: inherit; font-weight: 600; border-radius: 8px; border: 1.5px solid transparent; cursor: pointer;
  padding: .6rem 1.1rem; min-height: 44px; text-decoration: none; white-space: nowrap; user-select: none;
  transition: background .15s, border-color .15s, transform .05s;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .6; cursor: progress; }
.btn-principal { background: var(--marine); color: #fff; }
.btn-principal:hover { background: var(--marine-2); }
.btn-secondaire { background: #fff; color: var(--marine); border-color: var(--bord); }
.btn-secondaire:hover { border-color: var(--marine-2); }
.btn-danger-plein { background: var(--rouge); color: #fff; }
.btn-petit { padding: .35rem .75rem; min-height: 36px; font-size: .9rem; }
.btn-bloc { width: 100%; }
.btn-enregistrer { min-height: 60px; font-size: 1.15rem; }
.btn-lien { background: none; border: 0; padding: .25rem; color: var(--marine-2); cursor: pointer; font: inherit; text-decoration: underline; text-underline-offset: 2px; }
.btn-photo { background: var(--marine-clair); color: var(--marine); border-color: #c9d6e0; flex: 1; min-height: 56px; }
.btn-photo svg { width: 1.5em; height: 1.5em; }
.btn-icone { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 8px; border: 1px solid var(--bord); background: #fff; color: var(--marine); cursor: pointer; }
.btn-icone:hover { border-color: var(--marine-2); }
.btn-danger { color: var(--rouge); }
.btn-danger:hover { border-color: var(--rouge); background: var(--rouge-fond); }
.desactive { opacity: .4; pointer-events: none; }

/* ------------------------------------------------------------------ alertes */
.alerte { border-radius: 8px; padding: .7rem .9rem; margin-bottom: 14px; font-size: .95rem; border-left: 4px solid; }
.alerte-erreur { background: var(--rouge-fond); color: var(--rouge); border-color: var(--rouge); }
.alerte-succes { background: var(--vert-fond); color: var(--vert); border-color: var(--vert); }
.toast {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 24px; z-index: 60;
  padding: .85rem 1.25rem; border-radius: 10px; font-weight: 600; box-shadow: 0 8px 24px rgba(0,0,0,.2);
  width: max-content; max-width: calc(100% - 32px); text-align: center; animation: monte .2s ease-out;
}
.toast-succes { background: var(--vert); color: #fff; }
.toast-erreur { background: var(--rouge); color: #fff; }
@keyframes monte { from { opacity: 0; transform: translate(-50%, 10px); } }

/* ------------------------------------------------------------------ bandeau temps réel */
.bandeau {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--bord);
  border: 1px solid var(--bord); border-radius: var(--rayon); overflow: hidden; margin-bottom: 16px; box-shadow: var(--ombre);
}
.bandeau-item { background: #fff; padding: .7rem .9rem; display: flex; flex-direction: column; min-width: 0; }
.bandeau-label { font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--texte-2); font-weight: 600; }
.bandeau-valeur { font-size: 1.6rem; font-weight: 800; color: var(--marine); line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bandeau-valeur.petit { font-size: 1rem; font-weight: 700; white-space: normal; }
.bandeau-fort { background: var(--marine); }
.bandeau-fort .bandeau-label { color: #c8d3dc; }
.bandeau-fort .bandeau-valeur { color: #fff; }

/* ------------------------------------------------------------------ saisie */
.saisie-grille { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 16px; align-items: start; }
.photo-zone { font-weight: 400; }
.photo-vide { display: flex; gap: .5rem; }
.photo-apercu { display: flex; gap: .8rem; align-items: center; background: var(--fond); border: 1px solid var(--bord); border-radius: 8px; padding: .5rem; }
.photo-apercu img { width: 132px; height: 99px; object-fit: cover; border-radius: 6px; display: block; background: #ddd; }
.photo-infos { display: flex; flex-direction: column; align-items: flex-start; gap: .35rem; }

.liste-chargements { display: flex; flex-direction: column; gap: 8px; max-height: none; }
.ligne { display: flex; align-items: center; gap: .75rem; padding: .55rem; border: 1px solid var(--bord); border-radius: 8px; background: #fff; }
.ligne:first-child { border-color: #b8c7d4; background: #f8fafc; }
.ligne-num { width: 2rem; text-align: center; color: var(--texte-2); font-size: .85rem; font-weight: 600; flex: none; }
.vignette { width: 72px; height: 54px; border-radius: 6px; overflow: hidden; border: 0; padding: 0; background: var(--fond); cursor: zoom-in; flex: none; display: grid; place-items: center; }
.vignette img { width: 100%; height: 100%; object-fit: cover; display: block; }
.vignette-vide { cursor: default; color: #aab3bb; border: 1px dashed var(--bord); }
.vignette-vide svg { width: 26px; height: 26px; }
.vignette-petite { width: 56px; height: 42px; }
.ligne-corps { flex: 1; min-width: 0; }
.ligne-haut { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; flex-wrap: wrap; }
.matricule { font-weight: 800; letter-spacing: .03em; color: var(--marine); }
.ligne .matricule { font-size: 1.1rem; }
.tonnage { font-weight: 800; font-size: 1.1rem; white-space: nowrap; }
.ligne-meta { color: var(--texte-2); font-size: .85rem; }
.ligne-remarque { font-size: .85rem; background: var(--orange-fond); border-radius: 4px; padding: .05rem .4rem; display: inline-block; margin-top: .2rem; }
.ligne-actions { display: flex; gap: .35rem; flex: none; }

/* ------------------------------------------------------------------ modales */
.modale { border: 0; border-radius: 12px; padding: 20px; width: min(480px, calc(100% - 32px)); box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.modale::backdrop { background: rgba(0, 20, 40, .55); }
.modale-petite { width: min(400px, calc(100% - 32px)); }
.modale-actions { display: flex; justify-content: flex-end; gap: .5rem; margin-top: 10px; }
.edition-photo { display: flex; align-items: center; gap: .75rem; font-weight: 400; }
.edition-photo img { width: 96px; height: 72px; object-fit: cover; border-radius: 6px; }

.lightbox { position: fixed; inset: 0; background: rgba(0, 10, 20, .92); z-index: 100; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 16px; }
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 100%; max-height: calc(100% - 60px); border-radius: 6px; }
.lightbox-legende { color: #fff; margin-top: 10px; font-weight: 600; text-align: center; }
.lightbox-fermer { position: absolute; top: 10px; right: 14px; font-size: 2.2rem; line-height: 1; color: #fff; background: none; border: 0; cursor: pointer; width: 48px; height: 48px; }

/* ------------------------------------------------------------------ rapport / historique */
.selecteur-date { display: flex; align-items: center; gap: .4rem; }
.selecteur-date input { width: auto; min-height: 36px; padding: .3rem .5rem; }
.actions-export { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 14px; }
.info-bulle { cursor: help; color: var(--texte-2); }
.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 16px; }
.kpi { background: #fff; border: 1px solid var(--bord); border-radius: var(--rayon); padding: .8rem 1rem; display: flex; flex-direction: column; box-shadow: var(--ombre); min-width: 0; }
.kpi-label { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--texte-2); font-weight: 600; }
.kpi-valeur { font-size: 1.55rem; font-weight: 800; color: var(--marine); line-height: 1.25; }
.kpi-sous { font-size: .8rem; color: var(--texte-2); }
.kpi-fort { background: var(--marine); border-color: var(--marine); }
.kpi-fort .kpi-label { color: #c8d3dc; }
.kpi-fort .kpi-valeur { color: #fff; }

.tableau-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -4px; padding: 0 4px; }
.tableau { width: 100%; border-collapse: collapse; font-size: .93rem; }
.tableau th { text-align: left; font-size: .76rem; text-transform: uppercase; letter-spacing: .04em; color: var(--texte-2); font-weight: 700; padding: .5rem .6rem; border-bottom: 2px solid var(--bord); white-space: nowrap; }
.tableau td { padding: .5rem .6rem; border-bottom: 1px solid #eceff2; vertical-align: middle; }
.tableau tfoot th { color: var(--texte); font-size: .93rem; text-transform: none; letter-spacing: 0; border-top: 2px solid var(--bord); border-bottom: 0; background: var(--marine-clair); }
.tableau .num { text-align: right; white-space: nowrap; }
.tableau tbody tr:hover { background: #f7f9fb; }
.tableau .remarque { max-width: 280px; color: var(--texte-2); font-size: .88rem; }
.ligne-vide td { color: #9aa4ad; }
.col-barre { width: 30%; }
.barre { display: block; height: 10px; background: var(--marine-2); border-radius: 0 4px 4px 0; min-width: 2px; }
.nowrap { white-space: nowrap; }

.filtres { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 12px; align-items: end; }
.filtres .champ:nth-of-type(3) { grid-column: 1 / -1; }
.filtres-actions { grid-column: 1 / -1; display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 12px; }
.raccourcis { grid-column: 1 / -1; display: flex; gap: .4rem; flex-wrap: wrap; }
.puce { border: 1px solid var(--bord); border-radius: 99px; padding: .25rem .75rem; font-size: .85rem; text-decoration: none; color: var(--marine); background: #fff; }
.puce.actif, .puce:hover { background: var(--marine); color: #fff; border-color: var(--marine); }

.graphique svg { width: 100%; height: auto; display: block; stroke: none; fill: none; stroke-width: 1; overflow: visible; }
.graphique text { stroke: none; font-family: inherit; }
.g-grille { stroke: #e3e7eb; stroke-width: 1; }
.g-base { stroke: #9aa4ad; stroke-width: 1; }
.g-axe { font-size: 12px; fill: var(--texte-2); }
.g-rect { fill: var(--marine-2); }
.g-zone { fill: transparent; }
.g-barre:hover .g-rect { fill: var(--marine); }
.g-barre:hover .g-zone { fill: rgba(10,58,95,.06); }
.legende-graph { margin: .5rem 0 0; font-size: .82rem; }

.galerie { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.galerie-item { border: 1px solid var(--bord); border-radius: 8px; overflow: hidden; background: #fff; }
.galerie-photo { display: block; width: 100%; aspect-ratio: 4 / 3; border: 0; padding: 0; cursor: zoom-in; background: var(--fond); }
.galerie-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.galerie-sans { display: grid; place-items: center; color: var(--texte-2); font-size: .85rem; cursor: default; }
.galerie-texte { padding: .5rem .65rem; display: flex; flex-direction: column; gap: .1rem; font-size: .9rem; }

/* ------------------------------------------------------------------ facturation (admin / directeur) */
.carte-facture { border-left: 4px solid var(--marine); }
.carte-facture .carte-titre { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.badge-confidentiel { background: var(--orange-fond); color: #8a5300; border-color: #f3d39b; font-size: .7rem; text-transform: uppercase; letter-spacing: .04em; }
.facture-grille { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--bord); border: 1px solid var(--bord); border-radius: 8px; overflow: hidden; }
.facture-grille > div { background: #fff; padding: .6rem .8rem; display: flex; flex-direction: column; min-width: 0; }
.facture-valeur { font-size: 1.2rem; font-weight: 800; color: var(--marine); white-space: nowrap; }
.facture-total { background: var(--marine) !important; grid-column: 1 / -1; }
.facture-total .kpi-label { color: #c8d3dc; }
.facture-total .facture-valeur { color: #fff; font-size: 1.45rem; }
.facture-note { margin: .6rem 0 0; font-size: .82rem; }
.alerte-avertissement { background: var(--orange-fond); color: #7a4a00; border-color: #e0a030; }
.kpis-2 { grid-template-columns: 1fr 1fr !important; }
.unite-texte { font-size: .95rem !important; }
.input-unite .unite-texte ~ input, .input-unite input:has(+ .unite-texte) { padding-right: 4.5rem; }
.badge-role-admin, .badge-role-directeur { background: var(--marine); color: #fff; border-color: var(--marine); }
.badge-role-directeur { background: #7a5a00; border-color: #7a5a00; }

/* ------------------------------------------------------------------ admin */
.onglets { display: flex; gap: .3rem; }
.onglets a { padding: .45rem .9rem; border-radius: 8px; text-decoration: none; font-weight: 600; color: var(--marine); border: 1px solid var(--bord); background: #fff; }
.onglets a.actif { background: var(--marine); color: #fff; border-color: var(--marine); }
.badge { display: inline-block; padding: .1rem .55rem; border-radius: 99px; font-size: .78rem; font-weight: 600; background: var(--fond); border: 1px solid var(--bord); white-space: nowrap; }
.badge-admin { background: var(--marine); color: #fff; border-color: var(--marine); }
.badge-création { background: var(--vert-fond); color: var(--vert); border-color: #b9e0c9; }
.badge-modification { background: var(--orange-fond); color: #8a5300; border-color: #f3d39b; }
.badge-suppression { background: var(--rouge-fond); color: var(--rouge); border-color: #f5c2bd; }
.menu-actions summary { list-style: none; }
.menu-actions summary::-webkit-details-marker { display: none; }
.menu-actions[open] .menu-contenu { margin-top: .5rem; display: flex; flex-direction: column; gap: .4rem; min-width: 300px; }
.form-ligne { display: flex; gap: .4rem; align-items: center; margin: 0; }
.form-ligne form { margin: 0; }
.form-ligne input { min-height: 36px; padding: .3rem .5rem; }
.tableau-journal .details { font-size: .85rem; }
.detail-kv { margin-right: .7rem; white-space: nowrap; }
del { color: var(--rouge); } ins { color: var(--vert); text-decoration: none; font-weight: 600; }
.pagination { display: flex; gap: .5rem; justify-content: center; margin-top: 12px; }
.infos { display: grid; grid-template-columns: auto 1fr; gap: .4rem 1rem; margin: 0 0 1rem; }
.infos dt { color: var(--texte-2); }
.infos dd { margin: 0; font-weight: 600; }

/* ------------------------------------------------------------------ connexion / erreurs */
.page-connexion { background: var(--marine); min-height: 100vh; }
.connexion { max-width: 400px; margin: 0 auto; padding: 8vh 0 32px; }
.connexion-logo { text-align: center; margin-bottom: 28px; }
.connexion-logo img { width: 220px; height: auto; }
.connexion-logo .entete-barre { width: 200px; margin: 6px auto 0; }
.connexion-carte { padding: 24px; }
.connexion-carte h1 { font-size: 1.3rem; }
.connexion-carte .discret { margin: 0 0 18px; }
.erreur-page { text-align: center; padding: 40px 20px; max-width: 520px; margin: 40px auto; }
.erreur-code { font-size: 3rem; font-weight: 800; color: var(--gris-logo); margin: 0; }

/* ------------------------------------------------------------------ mobile : barre d'onglets en bas */
@media (max-width: 899px) {
  body:not(.page-connexion) { padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom)); }
  .entete-inner { padding: .5rem 16px; }
  .marque img { height: 28px; }
  .utilisateur { margin-left: auto; }
  .utilisateur-nom, .utilisateur form { display: none; }
  .nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; margin: 0; gap: 0;
    background: var(--marine); border-top: 3px solid var(--gris-logo);
    padding: 0 0 env(safe-area-inset-bottom); height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  }
  .nav a { flex: 1; flex-direction: column; gap: 2px; justify-content: center; font-size: .72rem; border-radius: 0; padding: .3rem .2rem; }
  .nav a svg { width: 24px; height: 24px; }
  .nav a.actif { box-shadow: inset 0 3px 0 #fff; background: rgba(255,255,255,.1); }
  .nav-compte { display: flex !important; }
  .toast { bottom: calc(var(--nav-h) + 16px + env(safe-area-inset-bottom)); }
}
@media (max-width: 599px) {
  .page { padding: 12px 12px 24px; }
  .marque-app { display: none; }
  .bandeau { grid-template-columns: 1fr 1fr; }
  .bandeau-valeur { font-size: 1.35rem; }
  .bandeau-item { padding: .5rem .75rem; }
  .bandeau-valeur.petit { font-size: .9rem; }
  .carte { padding: 14px; }
  .kpi-valeur { font-size: 1.3rem; }
  .ligne-num { display: none; }
  .ligne { gap: .6rem; }
  .ligne-actions { flex-direction: column; }
  .btn-icone { width: 36px; height: 36px; }
  .titre-page { align-items: flex-start; }
  .cache-mobile, .col-barre { display: none; }
  .facture-valeur { font-size: 1.05rem; }
  .facture-total .facture-valeur { font-size: 1.3rem; }
  .menu-actions[open] .menu-contenu { min-width: 240px; }
  .form-ligne { flex-wrap: wrap; }
}
@media (min-width: 900px) {
  .saisie-grille { grid-template-columns: minmax(360px, 440px) minmax(0, 1fr); }
  .formulaire-saisie { position: sticky; top: 92px; }
  .grille-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .grille-admin { grid-template-columns: minmax(0, 1fr) 340px; }
  .kpis { grid-template-columns: repeat(4, 1fr); }
  .facture-grille { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 1fr; }
  .facture-total { grid-column: auto; }
  .filtres { grid-template-columns: 170px 170px 1fr auto; }
  .filtres .champ:nth-of-type(3) { grid-column: auto; }
  .filtres-actions { grid-column: auto; }
}

/* ------------------------------------------------------------------ impression */
@media print {
  .entete, .nav, .actions-export, .selecteur-date, .toast, .filtres, .btn { display: none !important; }
  body { background: #fff; padding: 0 !important; }
  .carte, .kpi { box-shadow: none; break-inside: avoid; }
  .kpi-fort { background: #fff; } .kpi-fort .kpi-valeur, .kpi-fort .kpi-label { color: var(--marine); }
}

.grille-admin > *, .grille-2 > * { min-width: 0; }
.filtres input[type=date] { min-width: 0; }
