/* Extranet MaxoPièces (espace client). Version 0.4 : police Rubik, angles légèrement arrondis.
   Direction « liasse de comptoir » : on reprend les codes des documents que les garages manipulent déjà.
   - Chaque type de document a la couleur de son feuillet, comme les doubles autocopiants :
     facture bleue, BL jaune, avoir vert, retour rose. Cette bande de couleur est le seul élément marquant.
   - Rubik pour tout le texte (lettres aux angles adoucis, chiffres bien lisibles).
   - Listes en lignes réglées, alignées comme un registre ; angles légèrement arrondis, pas d'ombres ni de dégradés. */
/* Police Rubik hébergée sur l'extranet (licence libre SIL OFL, voir polices/) : aucun appel à Google. */
@font-face { font-family: "Rubik"; font-style: normal; font-weight: 400; font-display: swap; src: url("polices/rubik-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Rubik"; font-style: normal; font-weight: 500; font-display: swap; src: url("polices/rubik-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Rubik"; font-style: normal; font-weight: 600; font-display: swap; src: url("polices/rubik-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Rubik"; font-style: normal; font-weight: 700; font-display: swap; src: url("polices/rubik-latin-700-normal.woff2") format("woff2"); }
:root {
  --marine: #1A2E73; --marine-fonce: #12205A; --marine-pale: #E9EDF7;
  --jaune: #F5C94C; --jaune-fonce: #DDAE24; --jaune-pale: #FDF3D3;
  --encre: #1E2330; --gris: #5D6475; --ligne: #D3D7DF; --ligne-claire: #E7E9EE; --fond: #F3F4F6; --papier: #FFFFFF;
  --c-FAC: #1A2E73; --c-BLC: #E3AD14; --c-AVC: #2E8457; --c-BRC: #CF4472;
  --ok: #1F7A4D; --ok-pale: #E3F3EA; --du: #9A5800; --du-pale: #FCEFD8; --critique: #B3261E; --critique-pale: #FBE9E7;
  --texte: "Rubik", "Segoe UI", Arial, sans-serif; --etroit: "Rubik", "Segoe UI", Arial, sans-serif;
  --largeur: 1000px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
[hidden] { display: none !important; }
body { background: var(--fond); color: var(--encre); font-family: var(--texte); font-size: 16px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
h1, h2, h3 { margin: 0; font-family: var(--etroit); font-weight: 700; line-height: 1.1; color: var(--encre); }
h1 { font-size: 30px; }
h2 { font-size: 20px; font-weight: 600; }
p, dl, dd { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--marine); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--jaune); outline-offset: 2px; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- boutons et champs ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 9px 18px; border-radius: 6px; border: 1px solid var(--ligne); background: var(--papier); color: var(--marine); font-weight: 600; font-size: 16px; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { border-color: var(--marine); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.bleu { background: var(--marine); border-color: var(--marine); color: #fff; }
.btn.bleu:hover:not(:disabled) { background: var(--marine-fonce); }
.btn.jaune { background: var(--jaune); border-color: var(--jaune-fonce); color: var(--encre); }
.btn.jaune:hover:not(:disabled) { background: var(--jaune-fonce); }
.btn.petit { min-height: 34px; padding: 4px 12px; font-size: 15px; }
.btn.large { width: 100%; }
.btn.danger { color: var(--critique); }
.lien { background: none; border: 0; padding: 0; color: var(--marine); font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.boutons { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.champ { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.champ > label, .champ > .etiquette { font-size: 15px; font-weight: 600; }
input:not([type=checkbox]):not([type=radio]):not([type=file]), select, textarea { width: 100%; min-height: 44px; background: var(--papier); border: 1px solid #B9BFCB; border-radius: 6px; padding: 8px 11px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--marine); outline-offset: -1px; border-color: var(--marine); }
textarea { min-height: 100px; resize: vertical; }
.champ.plein { grid-column: 1 / -1; }
.case { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.case input { width: 18px; height: 18px; accent-color: var(--marine); }
.grille-champs { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.erreur { background: var(--critique-pale); color: var(--critique); border-left: 4px solid var(--critique); padding: 10px 14px; }
.succes { background: var(--ok-pale); color: var(--ok); border-left: 4px solid var(--ok); padding: 10px 14px; }
.aide { color: var(--gris); font-size: 15px; }
.piege { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- connexion ---------- */
.auth { min-height: 100vh; display: flex; background: var(--fond); border-top: 6px solid var(--jaune); }
.auth-zone { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 32px 16px; }
.auth-carte { width: 100%; max-width: 420px; background: var(--papier); border: 1px solid var(--ligne); border-top: 6px solid var(--marine); padding: 28px; display: flex; flex-direction: column; gap: 22px; }
.auth-tete { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.auth-logo { width: 140px; height: auto; }
.auth-sous { font-family: var(--etroit); font-size: 17px; font-weight: 600; color: var(--marine); }
.auth-carte form, #f-inscrit { display: flex; flex-direction: column; gap: 14px; }
.auth-carte h1 { font-size: 28px; }
.auth-bas { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.auth-pied { color: var(--gris); font-size: 15px; text-align: center; max-width: 420px; }

/* ---------- en-tête ---------- */
.entete { position: sticky; top: 0; z-index: 40; background: var(--papier); border-bottom: 4px solid var(--jaune); }
.entete-int { max-width: calc(var(--largeur) + 48px); margin: 0 auto; padding: 0 24px; display: flex; align-items: stretch; gap: 20px; min-height: 68px; }
.marque { display: flex; align-items: center; gap: 12px; text-decoration: none; flex: none; }
.marque img { width: 96px; height: auto; display: block; }
.marque span { font-family: var(--etroit); font-size: 16px; font-weight: 600; color: var(--marine); }
.menu-haut { display: flex; flex: 1; overflow-x: auto; scrollbar-width: none; }
.menu-haut a { position: relative; display: inline-flex; align-items: center; gap: 6px; padding: 0 12px; color: var(--gris); font-family: var(--etroit); font-size: 16px; font-weight: 500; text-decoration: none; white-space: nowrap; }
.menu-haut a:hover { color: var(--marine); }
.menu-haut a[aria-current="page"] { color: var(--marine); background: var(--marine-pale); }
.menu-haut a[aria-current="page"]::after { content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 4px; background: var(--marine); }
.nb:empty { display: none; }
.nb { background: var(--jaune); color: var(--encre); border-radius: 6px; font-family: var(--texte); font-size: 13px; font-weight: 700; padding: 0 6px; line-height: 20px; font-variant-numeric: tabular-nums; }
.moi { position: relative; flex: none; display: flex; align-items: center; }
.moi-btn { display: flex; align-items: center; gap: 10px; border: 0; background: none; cursor: pointer; padding: 6px 8px; text-align: right; }
.moi-btn:hover .moi-nom { color: var(--marine); text-decoration: underline; }
.avatar { width: 36px; height: 36px; background: var(--marine); color: #fff; display: grid; place-items: center; font-size: 14px; font-weight: 700; border-radius: 50%; }
.moi-nom { font-weight: 600; max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.moi-menu { position: absolute; right: 0; top: calc(100% + 4px); width: 270px; background: var(--papier); border: 1px solid var(--ligne); border-top: 4px solid var(--marine); padding: 6px 0; display: flex; flex-direction: column; z-index: 5; }
.moi-qui { padding: 10px 16px 12px; border-bottom: 1px solid var(--ligne-claire); margin-bottom: 4px; display: flex; flex-direction: column; font-size: 15px; }
.moi-qui span { color: var(--gris); }
.moi-menu a, .moi-menu button { text-align: left; padding: 10px 16px; border: 0; background: none; color: var(--encre); text-decoration: none; cursor: pointer; }
.moi-menu a:hover, .moi-menu button:hover { background: var(--fond); color: var(--marine); }
.bandeau-voir { background: var(--jaune-pale); border-bottom: 1px solid #EBD58F; padding: 8px 24px; display: flex; gap: 12px; align-items: center; justify-content: center; flex-wrap: wrap; font-weight: 600; }
main { max-width: calc(var(--largeur) + 48px); margin: 0 auto; padding: 32px 24px 80px; }
.barre-bas { display: none; }

@media (max-width: 820px) {
  .entete-int { padding: 0 14px; gap: 10px; min-height: 58px; }
  .menu-haut, .moi-nom { display: none; }
  .marque { margin-right: auto; }
  .marque img { width: 82px; }
  main { padding: 22px 14px 100px; }
  h1 { font-size: 26px; }
  .barre-bas { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; background: var(--papier); border-top: 1px solid var(--ligne); padding-bottom: env(safe-area-inset-bottom, 0px); }
  .barre-bas a { position: relative; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 8px 0 7px; color: var(--gris); font-family: var(--etroit); font-size: 13px; font-weight: 500; text-decoration: none; }
  .barre-bas .ico { width: 24px; height: 24px; }
  .barre-bas a[aria-current="page"] { color: var(--marine); }
  .barre-bas a[aria-current="page"]::before { content: ""; position: absolute; top: -1px; left: 18%; right: 18%; height: 4px; background: var(--jaune); }
}

/* ---------- structure des vues ---------- */
.vue { display: flex; flex-direction: column; gap: 24px; }
.vue-tete { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.vue-tete p { color: var(--gris); max-width: 66ch; margin-top: 6px; }
.retour { align-self: flex-start; font-weight: 600; }
.bloc { display: flex; flex-direction: column; gap: 12px; }
.bloc-tete { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.bloc-tete a { font-weight: 600; }
.bloc-tete select { width: auto; }

/* tête de l'accueil : le nom du garage, comme l'en-tête d'un compte client */
.compte-tete { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-bottom: 18px; border-bottom: 2px solid var(--encre); }
.compte-tete h1 { font-size: 34px; }
@media (max-width: 820px) { .compte-tete h1 { font-size: 28px; } .compte-tete .boutons, .compte-tete .btn { width: 100%; } }

/* encours */
.encours { display: flex; flex-direction: column; gap: 10px; background: var(--papier); border: 1px solid var(--ligne); padding: 16px 20px; }
.encours-chiffres { display: flex; flex-wrap: wrap; gap: 8px 40px; }
.encours-chiffres dt { font-size: 15px; color: var(--gris); }
.encours-chiffres dd { font-family: var(--etroit); font-size: 23px; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.15; }
.encours-chiffres .fort dd { color: var(--marine); font-weight: 700; }
.encours-chiffres .fort { margin-left: auto; text-align: right; }
@media (max-width: 600px) { .encours-chiffres .fort { margin-left: 0; text-align: left; } }
.jauge { height: 8px; background: var(--ligne-claire); }
.jauge > div { height: 100%; background: var(--marine); }
.jauge.haute > div { background: var(--jaune-fonce); } .jauge.pleine > div { background: var(--critique); }

.alerte { display: block; background: var(--jaune-pale); border-left: 6px solid var(--jaune-fonce); padding: 12px 16px; font-weight: 600; color: var(--encre); }

/* ---------- registre des documents : une ligne par document, bande de couleur du feuillet ---------- */
.registre { background: var(--papier); border: 1px solid var(--ligne); }
.rang { display: grid; grid-template-columns: 150px minmax(0, 1fr) 150px 110px 130px 64px; align-items: center; gap: 0 14px; padding: 11px 14px 11px 16px; border-bottom: 1px solid var(--ligne-claire); border-left: 6px solid transparent; }
.rang:last-child { border-bottom: 0; }
.rang:not(.rang-tete):hover { background: #FAFAFB; }
.rang-tete { padding-top: 8px; padding-bottom: 8px; font-size: 14px; color: var(--gris); border-bottom: 1px solid var(--ligne); background: var(--fond); }
.rang-tete .d, .rang-montant { text-align: right; }
.doc-FAC { border-left-color: var(--c-FAC); } .doc-BLC { border-left-color: var(--c-BLC); } .doc-AVC { border-left-color: var(--c-AVC); } .doc-BRC { border-left-color: var(--c-BRC); }
.rang-type { font-size: 15px; color: var(--gris); }
.rang-num { font-family: var(--etroit); font-size: 17px; font-weight: 600; color: var(--encre); text-decoration: none; letter-spacing: .01em; }
.rang-num:hover { color: var(--marine); text-decoration: underline; }
.rang-num::after { content: ""; position: absolute; inset: 0; }   /* toute la ligne mène au document */
.rang { position: relative; }
.rang-date { font-variant-numeric: tabular-nums; display: flex; flex-direction: column; line-height: 1.25; }
.rang-date small { color: var(--gris); font-size: 14px; }
.rang-montant { font-family: var(--etroit); font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rang-pdf { position: relative; z-index: 1; justify-self: end; font-size: 14px; font-weight: 700; color: var(--marine); border: 1px solid var(--ligne); padding: 4px 9px; text-decoration: none; border-radius: 6px; }
.rang-pdf:hover { background: var(--marine); border-color: var(--marine); color: #fff; }
.etat { font-size: 14px; font-weight: 600; }
.etat.ok { color: var(--ok); } .etat.du { color: var(--du); } .etat.refus { color: var(--critique); }
@media (max-width: 700px) {
  .rang-tete { display: none; }
  .rang { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "num montant" "type pdf" "date etat"; gap: 2px 12px; padding: 12px 12px 12px 14px; }
  .rang-num { grid-area: num; } .rang-montant { grid-area: montant; } .rang-type { grid-area: type; } .rang-pdf { grid-area: pdf; } .rang-date { grid-area: date; font-size: 15px; color: var(--gris); } .etat { grid-area: etat; justify-self: end; }
}
.mois { font-family: var(--etroit); font-size: 18px; font-weight: 600; text-transform: capitalize; margin: 26px 0 8px; }
.mois:first-child { margin-top: 0; }
.plus { width: 100%; margin-top: 14px; }

/* onglets de type de document (avec la couleur du feuillet) */
.onglets { display: flex; border-bottom: 1px solid var(--ligne); overflow-x: auto; scrollbar-width: none; }
.onglets button { flex: none; border: 0; background: none; padding: 10px 14px; font-family: var(--etroit); font-size: 16px; font-weight: 600; color: var(--gris); cursor: pointer; border-bottom: 4px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.onglets button:hover { color: var(--encre); }
.onglets button[aria-pressed="true"] { color: var(--encre); border-bottom-color: var(--encre); }
.onglets button.doc-FAC[aria-pressed="true"] { border-bottom-color: var(--c-FAC); } .onglets button.doc-BLC[aria-pressed="true"] { border-bottom-color: var(--c-BLC); }
.onglets button.doc-AVC[aria-pressed="true"] { border-bottom-color: var(--c-AVC); } .onglets button.doc-BRC[aria-pressed="true"] { border-bottom-color: var(--c-BRC); }
.onglets button[class^="doc-"] { border-left: 0; }
.recherche { display: grid; grid-template-columns: minmax(0, 360px) 220px; gap: 10px; }
@media (max-width: 600px) { .recherche { grid-template-columns: 1fr; } }

/* promotion sur l'accueil */
.promo-ligne { display: flex; align-items: center; gap: 18px; width: 100%; text-align: left; background: var(--papier); border: 1px solid var(--ligne); border-left: 6px solid var(--jaune); padding: 12px 16px 12px 12px; cursor: pointer; }
.promo-ligne:hover { border-color: var(--marine); border-left-color: var(--jaune); }
.promo-ligne img { width: 110px; height: 74px; object-fit: cover; flex: none; }
.promo-ligne > span:nth-of-type(1) { flex: 1; display: flex; flex-direction: column; }
.promo-ligne b { font-family: var(--etroit); font-size: 19px; font-weight: 600; line-height: 1.15; }
.promo-ligne small { color: var(--gris); font-size: 14px; }
.promo-voir { font-weight: 600; color: var(--marine); text-decoration: underline; white-space: nowrap; }
@media (max-width: 600px) { .promo-ligne { flex-wrap: wrap; } .promo-ligne img { width: 100%; height: 140px; } .promo-voir { display: none; } }

/* ---------- un document : présenté comme un feuillet ---------- */
.feuillet { background: var(--papier); border: 1px solid var(--ligne); border-left: 8px solid var(--ligne); padding: 24px 28px; display: flex; flex-direction: column; gap: 20px; }
.feuillet.doc-FAC { border-left-color: var(--c-FAC); } .feuillet.doc-BLC { border-left-color: var(--c-BLC); } .feuillet.doc-AVC { border-left-color: var(--c-AVC); } .feuillet.doc-BRC { border-left-color: var(--c-BRC); }
.feuillet-tete { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; flex-wrap: wrap; padding-bottom: 18px; border-bottom: 2px solid var(--encre); }
.feuillet-type { font-family: var(--etroit); font-size: 17px; font-weight: 600; color: var(--gris); }
.feuillet-num { font-size: 36px; letter-spacing: .01em; }
.feuillet-infos { display: grid; grid-template-columns: auto auto; gap: 2px 18px; font-size: 15px; }
.feuillet-infos div { display: contents; }
.feuillet-infos dt { color: var(--gris); }
.feuillet-infos dd { font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
table.lignes { width: 100%; border-collapse: collapse; }
table.lignes th { text-align: left; font-size: 14px; font-weight: 600; color: var(--gris); padding: 6px 10px 8px 0; border-bottom: 1px solid var(--encre); }
table.lignes td { padding: 10px 10px 10px 0; border-bottom: 1px solid var(--ligne-claire); vertical-align: top; }
table.lignes td.ref { font-family: var(--etroit); font-size: 15px; font-weight: 600; white-space: nowrap; }
table.lignes td small { display: block; color: var(--gris); font-size: 14px; }
table.lignes td small.tel-seul { display: none; }   /* 0.8.1 : prix public et remise ont leurs colonnes ; ce rappel ne sert que sur téléphone */
table.lignes .d { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; padding-right: 0; padding-left: 10px; }
table.lignes .fort { font-weight: 700; }
.totaux { margin-left: auto; width: min(320px, 100%); display: grid; gap: 4px; }
.totaux div { display: flex; justify-content: space-between; gap: 18px; font-variant-numeric: tabular-nums; }
.totaux dt { color: var(--gris); }
.totaux .ttc { border-top: 2px solid var(--encre); padding-top: 8px; margin-top: 4px; }
.totaux .ttc dt { color: var(--encre); font-weight: 700; }
.totaux .ttc dd { font-family: var(--etroit); font-size: 24px; font-weight: 700; line-height: 1; }
@media (max-width: 700px) {
  .feuillet-infos { grid-template-columns: auto 1fr; } .feuillet-infos dd { text-align: left; }
  .feuillet { padding: 18px 14px 18px 16px; border-left-width: 6px; }
  .feuillet-num { font-size: 30px; }
  table.lignes thead { display: none; }
  table.lignes, table.lignes tbody, table.lignes tr, table.lignes td { display: block; }
  table.lignes tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; padding: 10px 0; border-bottom: 1px solid var(--ligne-claire); }
  table.lignes td { border: 0; padding: 0; }
  table.lignes td.ref { grid-column: 1; }
  table.lignes td:nth-child(2) { grid-column: 1 / -1; grid-row: 2; }
  table.lignes td:nth-child(3)::before { content: "Qté "; color: var(--gris); }
  table.lignes td:nth-child(2) small.tel-seul { display: block; }
  table.lignes td:nth-child(3) { grid-row: 3; grid-column: 1; text-align: left; padding: 0; }
  table.lignes td:nth-child(4), table.lignes td:nth-child(5), table.lignes td:nth-child(6) { display: none; }
  table.lignes td.fort { grid-row: 1; grid-column: 2; }
}
.coordonnees address { font-style: normal; }

/* demandes SAV (client) */
.rang-sav { display: flex; align-items: center; gap: 16px; padding: 13px 16px; border-bottom: 1px solid var(--ligne-claire); text-decoration: none; color: var(--encre); }
.rang-sav:last-child { border-bottom: 0; }
.rang-sav:hover { background: #FAFAFB; }
.rang-sav-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.rang-sav-txt b { font-weight: 600; }
.rang-sav-txt small { color: var(--gris); font-size: 14px; }
.nouveau { background: var(--jaune); font-size: 13px; font-weight: 700; padding: 1px 8px; border-radius: 6px; white-space: nowrap; }

/* ---------- éléments communs (SAV, promotions, écrans de l'équipe) ---------- */
.carte { background: var(--papier); border: 1px solid var(--ligne); padding: 20px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.carte > h2 { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.grille { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; align-items: start; }
.chiffres { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.chiffre { background: var(--papier); border: 1px solid var(--ligne); border-top: 4px solid var(--marine); padding: 12px 16px; display: flex; flex-direction: column; text-decoration: none; color: inherit; }
a.chiffre:hover { border-color: var(--marine); }
.chiffre b { font-family: var(--etroit); font-size: 28px; font-weight: 700; color: var(--marine); font-variant-numeric: tabular-nums; line-height: 1.1; }
.chiffre span { font-size: 15px; color: var(--gris); }
.bienvenue { padding-bottom: 14px; border-bottom: 2px solid var(--encre); }
.bienvenue p { color: var(--gris); margin-top: 4px; }
.pastille { display: inline-flex; align-items: center; padding: 1px 8px; font-size: 14px; font-weight: 600; white-space: nowrap; background: var(--fond); color: var(--gris); border-radius: 6px; flex: none; }
.pastille.ok { background: var(--ok-pale); color: var(--ok); } .pastille.attention { background: var(--du-pale); color: var(--du); }
.pastille.critique { background: var(--critique-pale); color: var(--critique); } .pastille.info { background: var(--marine-pale); color: var(--marine); } .pastille.jaune { background: var(--jaune-pale); color: #6E5000; }
.vide { color: var(--gris); padding: 28px 16px; background: var(--papier); border: 1px dashed var(--ligne); text-align: center; }
.filtres { display: flex; flex-wrap: wrap; gap: 6px; }
.filtre { border: 1px solid var(--ligne); background: var(--papier); padding: 6px 14px; font-weight: 600; cursor: pointer; border-radius: 6px; }
.filtre[aria-pressed="true"] { background: var(--marine); border-color: var(--marine); color: #fff; }
.outils { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.outils .champ { min-width: 180px; }
.tableau-zone { overflow-x: auto; background: var(--papier); border: 1px solid var(--ligne); }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 14px; color: var(--gris); font-weight: 600; padding: 9px 14px; background: var(--fond); border-bottom: 1px solid var(--ligne); white-space: nowrap; }
td { padding: 11px 14px; border-bottom: 1px solid var(--ligne-claire); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
td.d, th.d { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tr.cliquable { cursor: pointer; } tr.cliquable:hover td { background: #FAFAFB; }
@media (max-width: 700px) { .masque-tel { display: none; } }
.liste-docs { display: flex; flex-direction: column; }
.doc { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 4px 14px; align-items: center; padding: 12px 6px; border: 0; border-bottom: 1px solid var(--ligne-claire); background: none; text-align: left; cursor: pointer; font: inherit; width: 100%; color: inherit; text-decoration: none; }
.doc:last-child { border-bottom: 0; }
.doc:hover { background: var(--fond); }
.doc .type { min-width: 42px; height: 34px; display: grid; place-items: center; font-family: var(--etroit); font-size: 16px; font-weight: 700; background: var(--marine-pale); color: var(--marine); padding: 0 6px; border-radius: 6px; }
.doc .type.FAC { background: var(--marine); color: #fff; } .doc .type.BLC { background: var(--jaune); color: var(--encre); }
.doc b { display: block; } .doc span { color: var(--gris); font-size: 15px; }
.doc .montant { font-family: var(--etroit); font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; }
.doc-tete { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.doc-infos { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px 18px; }
.doc-infos div span { display: block; font-size: 14px; color: var(--gris); }
.promos { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 16px; }
.promo { background: var(--papier); border: 1px solid var(--ligne); border-bottom: 6px solid var(--jaune); display: flex; flex-direction: column; text-align: left; padding: 0; cursor: pointer; }
.promo:hover { border-color: var(--marine); border-bottom-color: var(--jaune); }
.promo img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; background: var(--fond); }
.promo .sans-image { aspect-ratio: 4 / 3; background: var(--marine); display: grid; place-items: center; color: #fff; font-family: var(--etroit); font-weight: 700; font-size: 28px; padding: 16px; text-align: center; }
.promo-corps { padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.promo-corps h3 { font-size: 19px; font-weight: 600; }
.promo-detail img { max-width: 100%; }
.texte-long { white-space: pre-wrap; }
.fil { display: flex; flex-direction: column; gap: 10px; }
.message { padding: 10px 14px; max-width: 82%; border-left: 4px solid var(--ligne); background: var(--fond); }
.message.equipe { border-left-color: var(--marine); background: var(--marine-pale); align-self: flex-start; }
.message.client { border-left-color: var(--jaune-fonce); align-self: flex-end; }
.message.interne { background: var(--du-pale); border-left-color: var(--du); }
.message .qui { font-size: 14px; color: var(--gris); font-weight: 600; }
.photos { display: flex; flex-wrap: wrap; gap: 8px; }
.photos a, .photos .vignette { width: 84px; height: 84px; overflow: hidden; border: 1px solid var(--ligne); display: grid; place-items: center; font-size: 13px; font-weight: 700; color: var(--marine); text-decoration: none; position: relative; background: var(--papier); }
.photos img { width: 100%; height: 100%; object-fit: cover; }
.photos .vignette button { position: absolute; top: 2px; right: 2px; border: 0; width: 22px; height: 22px; background: rgba(30,35,48,.75); color: #fff; cursor: pointer; line-height: 1; }
.articles-choix { display: flex; flex-direction: column; max-height: 340px; overflow-y: auto; border: 1px solid var(--ligne); background: var(--papier); }
.articles-choix label { display: grid; grid-template-columns: auto minmax(0, 1fr) 80px; gap: 10px; align-items: center; padding: 8px 10px; border-bottom: 1px solid var(--ligne-claire); }
.articles-choix label:hover { background: var(--fond); }
.articles-choix input[type=number] { min-height: 36px; }
.encadre { background: var(--jaune-pale); border-left: 4px solid var(--jaune-fonce); padding: 10px 14px; }
.encadre.info { background: var(--marine-pale); border-left-color: var(--marine); }
.verif { display: flex; gap: 10px; align-items: baseline; }
pre.brut { background: var(--fond); padding: 10px; overflow: auto; max-height: 260px; font-size: 12px; }
.pagination { display: flex; justify-content: center; gap: 8px; align-items: center; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--encre); color: #fff; padding: 12px 18px; border-left: 6px solid var(--jaune); z-index: 100; max-width: min(560px, 92vw); }
@media (max-width: 820px) { .toast { bottom: 84px; } }
dialog { border: 1px solid var(--ligne); border-top: 6px solid var(--marine); padding: 0; max-width: min(620px, 94vw); width: 100%; }
dialog::backdrop { background: rgba(30, 35, 48, .5); }
dialog form, dialog > div { padding: 24px; display: flex; flex-direction: column; gap: 14px; }
.chargement { color: var(--gris); padding: 24px 0; }
details summary { cursor: pointer; font-weight: 600; }
.ico { width: 22px; height: 22px; }

/* Arrondis (version 0.4) : cadres à 8 px, boutons et champs à 6 px ; la bande de couleur suit l'arrondi */
.registre, .encours, .feuillet, .promo-ligne, .carte, .tableau-zone, .vide, .chiffre, .promo, .alerte, .encadre, .erreur, .succes, .articles-choix, .moi-menu { border-radius: 8px; }
.registre, .tableau-zone, .promo, .articles-choix { overflow: hidden; }
.auth-carte { border-radius: 10px; } dialog { border-radius: 10px; } .toast { border-radius: 10px; }
.message { border-radius: 8px; } .photos a, .photos .vignette { border-radius: 6px; }
.promo-ligne img { border-radius: 6px; }
.jauge, .jauge > div { border-radius: 999px; }
.menu-haut a[aria-current="page"] { border-radius: 6px 8px 0 0; }
.compte-tete { border-bottom-width: 1px; border-bottom-color: var(--ligne); }
.feuillet-tete { border-bottom-width: 1px; border-bottom-color: var(--ligne); }

/* 0.5 : factures à régler, immatriculation */
.rang .d { text-align: right; }
.rang-montant.du { color: var(--du); }
.rang-total { background: var(--fond); font-weight: 600; }
.rang-total .rang-montant { font-weight: 700; }
.immat { display: inline-block; align-self: flex-start; margin-top: 2px; font-size: 13px; font-weight: 600; letter-spacing: .04em; color: var(--encre); border: 1px solid var(--ligne); border-left: 4px solid #003399; border-radius: 3px; padding: 0 5px; }
@media (max-width: 700px) { .rang-total { display: flex; justify-content: space-between; } .rang-total span:empty { display: none; } }

/* 0.5.1 : numéro de version visible */
.version-entete { align-self: center; flex: none; font-size: 13px; font-weight: 600; color: var(--gris); background: var(--fond); border: 1px solid var(--ligne); border-radius: 6px; padding: 1px 7px; margin-left: -12px; }
.version-entete:empty { display: none; }
.moi-version { padding: 8px 16px 4px; margin-top: 4px; border-top: 1px solid var(--ligne-claire); font-size: 13px; color: var(--gris); }
.auth-version { font-size: 13px; color: var(--gris); }
@media (max-width: 820px) { .version-entete { margin-left: 0; } }
@media (max-width: 1279px) { .moi-nom { display: none; } .menu-haut a { padding: 0 10px; } }

/* 0.5.3 : lignes de commentaire des pièces */
table.lignes tr.commentaire td { color: var(--gris); font-style: italic; padding-top: 6px; padding-bottom: 6px; }
@media (max-width: 700px) { table.lignes tr.commentaire { display: block; } table.lignes tr.commentaire td { display: block; } }

/* 0.6 : factures et avoirs périodiques (même feuillet que les factures et avoirs) */
.doc-FACP, .feuillet.doc-FACP { border-left-color: var(--c-FAC); } .doc-AVCP, .feuillet.doc-AVCP { border-left-color: var(--c-AVC); }
.doc .type.FACP { background: var(--marine); color: #fff; }

/* 0.7 : « Mes achats » */
.achats-chiffres { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 0; }
.achat-chiffre { background: var(--papier); border: 1px solid var(--ligne); border-radius: 8px; padding: 14px 18px; }
.achat-chiffre dt { color: var(--gris); font-size: 15px; }
.achat-chiffre dd { margin: 2px 0 0; display: flex; flex-direction: column; gap: 2px; }
.achat-chiffre dd b { font-size: 26px; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.2; }
.achat-chiffre small { color: var(--gris); font-size: 14px; }
.ecart { font-weight: 600; font-size: 15px; font-variant-numeric: tabular-nums; }
.ecart.hausse { color: var(--ok); } .ecart.baisse { color: var(--critique); }
@media (max-width: 820px) { .achats-chiffres { grid-template-columns: 1fr; } }
.graphe-carte { gap: 10px; }
.graphe { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 6px; height: 220px; align-items: end; }
.graphe-mois { display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; }
.graphe-barres { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 3px; border-bottom: 1px solid var(--ligne); }
.graphe-barres i { display: block; width: 38%; max-width: 22px; background: var(--marine); border-radius: 3px 3px 0 0; min-height: 1px; }
.graphe-barres i.n1 { background: #B9C3E0; }
.graphe-mois span { font-size: 13px; color: var(--gris); }
.graphe-mois.cours span { color: var(--encre); font-weight: 600; }
.graphe-mois.cours .graphe-barres i:not(.n1) { background: repeating-linear-gradient(135deg, var(--marine) 0 4px, #3A55A8 4px 8px); }
.graphe-legende { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 14px; align-items: center; }
.graphe-legende i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; background: var(--marine); vertical-align: -1px; }
.graphe-legende i.n1 { background: #B9C3E0; }
tr.cours td { font-weight: 600; }
@media (max-width: 600px) { .graphe { height: 160px; gap: 3px; } .graphe-mois span { font-size: 11px; } }

span.etiquette, legend.etiquette { display: block; font-size: 15px; font-weight: 600; }

/* ---------- 0.8 : retours de consignes, de pièces neuves et SAV ----------
   Chaque sorte de demande garde une bande de couleur, comme les feuillets : consignes en rose (comme les reprises),
   pièces neuves en vert (elles donnent un avoir), SAV en ocre, autres demandes en gris. */
:root { --c-consigne: #CF4472; --c-neuf: #2E8457; --c-sav: #B4700C; --c-autre: #8A90A0; }
.rang-choix { text-decoration: none; display: flex; align-items: center; gap: 16px; width: 100%; padding: 16px 18px 16px 16px; border: 0; border-bottom: 1px solid var(--ligne-claire); border-left: 5px solid var(--ligne); background: var(--papier); text-align: left; cursor: pointer; color: var(--encre); }
.rang-choix:last-child { border-bottom: 0; }
.rang-choix:hover { background: #FAFAFB; }
.rang-choix > span:first-child { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.rang-choix b { font-size: 18px; font-weight: 600; }
.rang-choix small { color: var(--gris); font-size: 15px; }
.rang-choix .fleche { font-size: 28px; line-height: 1; color: var(--gris); }
.sav-consigne { border-left-color: var(--c-consigne) !important; } .sav-neuf { border-left-color: var(--c-neuf) !important; }
.sav-sav { border-left-color: var(--c-sav) !important; } .sav-autre { border-left-color: var(--c-autre) !important; }
.rang-sav { border-left: 5px solid var(--ligne); }
.carte.sav-consigne, .carte.sav-neuf, .carte.sav-sav, .carte.sav-autre { border-left-width: 5px; border-left-style: solid; }
.form-sav { display: flex; flex-direction: column; gap: 18px; }
.form-sav fieldset { border: 0; padding: 0; margin: 0; }
.form-sav legend { padding: 0; margin-bottom: 6px; font-size: 15px; font-weight: 600; }
.form-sav textarea { min-height: 96px; }
table.articles-sav td { vertical-align: top; }
table.articles-sav input.qte[type=number], .vue table input.qte[type=number] { width: 86px; min-height: 36px; text-align: right; padding: 4px 8px; }
.total-sav { font-size: 16px; }
.total-sav .aide { display: inline; }
.bon-retour { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.bon-retour p { color: var(--gris); font-size: 15px; }
.dialogue-sav { display: flex; flex-direction: column; gap: 12px; }
.dialogue-sav .liste-docs { max-height: 52vh; overflow-y: auto; }
.articles-choix label small { display: block; color: var(--gris); font-size: 14px; }
.articles-choix label.indispo { opacity: .55; }
table.articles-sav th.d, table.articles-sav td.d { white-space: nowrap; }
.tel-seul { display: none; }
@media (max-width: 700px) { .tel-seul { display: block; } }
@media (max-width: 640px) {
  .rang-choix b { font-size: 17px; }
  table.articles-sav input.qte[type=number] { width: 70px; }
  .bon-retour .btn { width: 100%; }
}
