/* Structure du kit (/kit-rivia/), habillée aux couleurs de Rivia Production (/rp-da/base.css) : un seul thème, clair. */
:root,:root[data-theme="light"]{
 --font-sans:Poppins,system-ui,-apple-system,"Segoe UI",sans-serif;
 --bg:#FCFBFA;--surface:#FFFFFF;--surface-2:#F7F4EF;--raised:#FFFFFF;--text:#2A221D;--text-2:#655850;--text-3:#6F625A;
 --border:#EAE4DD;--border-strong:#8C7B6F;
 --brand:#3A2F29;--brand-hover:#2A221D;--brand-active:#1F1915;--on-brand:#FFFFFF;--brand-text:#45607C;
 --brand-soft:#F3EBDF;--brand-soft-text:#3A2F29;--brand-border:#D6BF9F;--active-bg:#F3EBDF;--active-text:#2A221D;
 --focus:#56728F;--overlay:rgba(42,34,29,.4);
 --viz-1:#56728F;--viz-2:#A8895C;--viz-3:#4D4038;--viz-4:#A0B6CB;--viz-5:#D6BF9F;--viz-6:#8C7B6F;
 --shadow-1:0 18px 40px -32px rgba(42,34,29,.45),0 1px 2px rgba(42,34,29,.04);
 --r-s:.625rem;--r-m:1rem;--r-l:1.375rem;
}
:root{--sable:var(--surface-2);--ligne:var(--border);--champ:var(--border-strong);--lien:var(--brand-text);--ombre:var(--shadow-1)}
*{box-sizing:border-box;margin:0}
[hidden]{display:none!important}
body{overflow-wrap:anywhere}
.meta{color:var(--text-2);font-size:13px;line-height:18px}
span.meta{display:block}
h1{font-size:1.25rem;line-height:1.3;font-weight:600;letter-spacing:-.015em}
h2{font-size:.9375rem;line-height:1.35}
ul,ol{list-style:none;padding:0}
.carte{background:var(--surface);border:1px solid var(--ligne);border-radius:var(--r-m);box-shadow:var(--shadow-1);padding:14px;display:grid;gap:10px;grid-template-columns:minmax(0,1fr)}
.rang{display:flex;flex-wrap:wrap;justify-content:space-between;align-items:center;gap:8px 16px;padding:10px 0;border-top:1px solid var(--ligne)}
.rang>div:first-child{flex:1 1 220px;min-width:0}
.saisi{white-space:pre-line}
.actions{display:flex;flex-wrap:wrap;align-items:center;gap:8px}
.pastille{display:inline-block;background:var(--sable);border-radius:999px;padding:2px 10px;font-size:13px;font-weight:600}
.pastille.ok{background:var(--brand-soft);color:var(--lien)}
.bouton{display:inline-flex;align-items:center;justify-content:center;min-height:44px;min-width:44px;padding:6px 18px;border:1.5px solid var(--brand);border-radius:999px;background:var(--brand);color:var(--on-brand);font:inherit;font-size:14px;font-weight:600;line-height:20px;text-decoration:none;cursor:pointer}
.bouton.discret{background:rgb(255 255 255/.55);border-color:rgb(77 64 56/.35);color:var(--brand)}
.bouton:disabled{background:var(--sable);border-color:transparent;color:var(--text-2);cursor:default}
:focus-visible{outline:3px solid var(--lien);outline-offset:2px}
form,.corps{display:grid;gap:12px;grid-template-columns:minmax(0,1fr)}
label{display:grid;grid-template-columns:minmax(0,1fr);gap:4px;font-size:13px;font-weight:600;min-width:0}
input,select,textarea{width:100%;min-width:0;min-height:44px;padding:8px 12px;border:1px solid var(--champ);border-radius:10px;background:var(--surface);color:var(--text);font:inherit;font-size:16px;font-weight:400;line-height:22px}
::placeholder{color:var(--text-2);opacity:1}

/* Page client (et message « lien absent »). */
.tete{display:flex;justify-content:space-between;align-items:center;gap:12px;max-width:752px;margin:0 auto;padding:10px 16px}
#page{max-width:752px;margin:0 auto;padding:8px 16px 32px;display:grid;gap:12px;grid-template-columns:minmax(0,1fr)}
#page>section{display:grid;gap:8px;align-content:start;grid-template-columns:minmax(0,1fr)}
.duo{display:grid;gap:12px;grid-template-columns:repeat(auto-fit,minmax(200px,1fr))}
.note{background:var(--sable);border-radius:10px;padding:10px 12px}
.etapes{display:grid;gap:4px;counter-reset:e}
.etapes li{counter-increment:e;display:flex;align-items:center;gap:8px;min-height:36px;padding:4px 10px;border-radius:10px;color:var(--text-2);font-size:14px}
.etapes li::before{content:counter(e);flex:none;display:grid;place-items:center;width:24px;height:24px;border-radius:50%;background:var(--sable);font-size:13px;font-weight:700}
.etapes li.faite::before{content:"✓";background:var(--brand-soft);color:var(--lien)}
.etapes li.en-cours{background:var(--brand-soft);color:var(--text);font-weight:700}
.etapes li.en-cours::before{background:var(--brand);color:var(--on-brand)}
@media (min-width:700px){.etapes{grid-template-columns:repeat(5,minmax(0,1fr))}.etapes li{flex-direction:column;text-align:center;font-size:13px;line-height:17px;padding-block:8px}}

/* Barre de l'espace client : liens en haut sur téléphone, à gauche dès 768 px. */
.cote{display:flex;gap:var(--sp-1);overflow-x:auto;padding:4px var(--sp-3);background:var(--surface);border-bottom:var(--bw) solid var(--border)}
.cote a{flex:none;white-space:nowrap;min-height:44px}
.cote p{display:none}
#page section,#page h1{scroll-margin-top:var(--sp-4)}
@media (max-width:767px){.client .cote{padding-inline:var(--sp-1);gap:0}.client .cote a{padding-inline:var(--sp-2)}}
@media (min-width:768px){
 body:has(>.cote){padding-left:13rem}
 .corps>.bouton{justify-self:start}
 .cote{position:fixed;inset:0 auto 0 0;width:13rem;display:grid;align-content:start;overflow-y:auto;padding:var(--sp-4) var(--sp-3);border-bottom:0;border-right:var(--bw) solid var(--border)}
 .cote p{display:block}
 .cote .marque{padding:0 var(--sp-3) var(--sp-3)}
 body:has(>.cote) .tete .marque{display:none}
 body:has(>.cote) .tete{justify-content:flex-start}
}

/* Application de la boîte : menu à gauche, barre du haut, tableaux, fiche en panneau. */
.lateral{position:fixed;inset:0 auto 0 0;width:min(18rem,85vw);height:100%;height:100dvh;max-height:none;margin:0;padding:var(--sp-4) var(--sp-3);border:0;border-right:var(--bw) solid var(--border);background:var(--surface);color:var(--text);overflow-y:auto;flex-direction:column;gap:var(--sp-4)}
.lateral:popover-open{display:flex}
.lateral::backdrop{background:rgb(0 0 0/.35)}
.lateral>*{flex:none}
.lateral .logo{padding:0 var(--sp-2);font-size:.9375rem}
.lateral .nav-group+.nav-group{margin-top:var(--sp-4)}
.lateral .nav-label{margin-bottom:var(--sp-1)}
.colonne{display:flex;flex-direction:column;min-height:100vh;min-height:100dvh}
.topbar{position:sticky;top:0;z-index:2;min-height:3.25rem;justify-content:flex-start;background:var(--bg)}
#fil{flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.topbar .btn{flex:none}
.entete{width:100%;max-width:var(--content-max);padding:var(--sp-4) var(--gutter) 0}
.entete h1{font-size:1.375rem}
.vue{display:grid;gap:var(--sp-4);align-content:start;grid-template-columns:minmax(0,1fr);width:100%;max-width:var(--content-max);padding:var(--sp-4) var(--gutter) 5rem}
.vue section{display:grid;gap:var(--sp-2);align-content:start;grid-template-columns:minmax(0,1fr);min-width:0}
#cadre{width:100%;height:calc(100vh - 3.25rem);height:calc(100dvh - 3.25rem);border:0;background:transparent}
body.boite:has(#barre:not([hidden])) #cadre{height:calc(100dvh - 7.5rem)}
.kpis{display:grid;gap:var(--sp-2);grid-template-columns:repeat(2,minmax(0,1fr))}
.kpis .card{padding:var(--sp-2) var(--sp-3);border-radius:var(--r-m)}
.kpis .card:last-child{grid-column:1/-1}
.kpis dt{display:grid;justify-items:start;gap:var(--sp-2);color:var(--text-2);font-size:var(--fs-meta);font-weight:700;text-transform:uppercase;letter-spacing:.06em}
.kpis dt .icon{display:none;width:2rem;height:2rem;padding:.5rem;border-radius:50%;background:var(--brand-soft);color:var(--lien)}
.kpis dd{white-space:nowrap;font-size:1.25rem;font-weight:700;font-variant-numeric:tabular-nums}
@media (min-width:600px){.kpis{grid-template-columns:repeat(3,minmax(0,1fr))}.kpis .card:last-child{grid-column:span 2}}
@media (min-width:900px){.kpis .card{padding:var(--sp-3) var(--sp-4)}}
@media (min-width:1200px){.kpis{gap:var(--sp-3);grid-template-columns:repeat(5,minmax(0,1fr))}.kpis .card:last-child{grid-column:auto}}
.afaire{display:flex;flex-wrap:wrap;align-items:center;gap:var(--sp-2)}
.afaire strong{font-weight:700}
.deux{display:grid;gap:var(--sp-4);grid-template-columns:minmax(0,1fr)}
.deux>:not(.plein) .sec{display:none}
@media (min-width:1280px){.deux{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}.deux>.plein{grid-column:1/-1}}
.outils{display:flex;flex-wrap:wrap;align-items:center;gap:var(--sp-2)}
.outils .input,.outils .select{width:100%;max-width:18rem}
.outils .segmented{max-width:100%;overflow-x:auto}
.outils .segmented button{flex:none;white-space:nowrap}
.vue .card.vide{padding:var(--sp-3) var(--sp-4);border-radius:var(--r-m);color:var(--text-2);font-size:var(--fs-ui)}
.vue .card-flush{border-radius:var(--r-m)}
.vue .table th{padding:var(--sp-2) var(--sp-3);white-space:normal;overflow-wrap:normal;vertical-align:bottom}
.vue .table td{height:2.75rem;padding:var(--sp-1) var(--sp-3);overflow-wrap:normal}
.vue .table td.large{width:100%;white-space:normal;overflow-wrap:anywhere}
.table td.large>*{min-width:8rem}
.vue .table td.large>.pill{min-width:0}
.table td.num>.pill:not(:last-child){margin-right:12px}
.vue .table td.num>.pill:last-child{margin-right:-4px}
.defaut{color:var(--text-2)}
.table .cell-sub{color:var(--text-2)}
.table .clic{cursor:pointer}
.ouvrir{display:block;min-height:1.5rem;padding:0;border:0;background:none;color:var(--text);font:inherit;font-weight:600;text-align:left;cursor:pointer}
.lien{display:inline-flex;align-items:center;min-height:2.75rem;min-width:2.75rem;color:var(--lien);font-weight:600}
.apercu{width:100%;max-width:47rem;height:calc(100dvh - 11rem);min-height:30rem;border:var(--bw) solid var(--border);border-radius:var(--r-m);background:var(--bg)}
.barre{position:fixed;right:var(--sp-3);bottom:calc(var(--sp-3) + env(safe-area-inset-bottom));z-index:3;display:flex;align-items:center;gap:var(--sp-3);max-width:calc(100% - 1.5rem);padding:var(--sp-2) var(--sp-2) var(--sp-2) var(--sp-4);background:var(--surface);border:var(--bw) solid var(--border-strong);border-radius:var(--r-m);box-shadow:var(--shadow-1)}
.barre p{min-width:0;font-size:var(--fs-ui)}
.barre .btn{flex:none}
#panneau{position:fixed;inset:0 0 0 auto;width:min(30rem,100%);max-width:100%;height:100%;height:100dvh;max-height:none;margin:0 0 0 auto;padding:0;border:0;border-left:var(--bw) solid var(--border);background:var(--surface);color:var(--text)}
#panneau[open]{display:flex;flex-direction:column}
#panneau::backdrop{background:rgb(0 0 0/.35)}
#panneau header,#panneau footer{display:flex;align-items:center;justify-content:space-between;gap:var(--sp-3);padding:var(--sp-3) var(--sp-4)}
#panneau header{border-bottom:var(--bw) solid var(--border)}
#panneau footer{border-top:var(--bw) solid var(--border);padding-bottom:calc(var(--sp-3) + env(safe-area-inset-bottom))}
#panneau h2,#panneau footer p{min-width:0}
#panneau footer p{font-size:var(--fs-ui)}
#panneau .btn{flex:none}
#panneau .corps{flex:1;align-content:start;overflow-y:auto;padding:var(--sp-4)}
#panneau .corps>.btn{justify-self:start}
fieldset{display:flex;flex-wrap:wrap;gap:10px;align-items:end;min-width:0;border:0;border-top:1px solid var(--ligne);padding:12px 0 0}
legend{float:left;width:100%;font-size:.875rem;font-weight:700}
fieldset>label{flex:1 1 140px}fieldset>label:has([type=url]){flex-basis:100%}
fieldset.archive{background:var(--sable);border-radius:10px;padding:12px}
.retrait{min-height:var(--hit);padding:0 8px;border:0;background:none;color:var(--text-2);font:inherit;font-size:13px;text-decoration:underline;cursor:pointer}
.corps>.retrait{justify-self:start}
.case{display:flex;align-items:center;gap:10px;min-height:var(--hit)}
.liste>label,.verdict{flex-basis:100%}
.liste{gap:0}
.demo{display:flex;flex-wrap:wrap;align-items:center;column-gap:var(--sp-3);margin:var(--sp-3) var(--gutter) 0;max-width:calc(var(--content-max) - 2*var(--gutter));padding:var(--sp-2) var(--sp-3);background:var(--sable);border-radius:var(--r-m);font-size:var(--fs-ui)}
.demo[hidden]{display:none}
.etapes.pilote small{display:block;font-size:13px;font-weight:400}
.case input{width:22px;min-height:22px;height:22px;flex:none;color-scheme:light;accent-color:var(--brand)}
body.boite .carte{max-width:100%}

/* Menu : intertitres, compteurs pleins. */
.lateral .nav .count:not([aria-hidden]){background:var(--brand);color:var(--on-brand);border-radius:999px;padding:0 7px}
.lateral .nav-label{text-transform:uppercase;letter-spacing:.06em}
/* Espace d'un client : ses noms sous « Clients », son en-tête, les étapes du montage à toucher. */
.lateral .nav a.sous-rub{padding-left:2.25rem;padding-block:2px}
.sous{display:flex;flex-wrap:wrap;align-items:center;gap:var(--sp-2)}
.sous:empty{display:none}
.vue section.card,.vue a.objectif{padding:var(--sp-3) var(--sp-4);border-radius:var(--r-m)}
.vue section>.btn{justify-self:start}
.etapes.pilote li{position:relative}
.etapes.pilote button{min-height:var(--hit);min-width:var(--hit);padding:0;border:0;background:none;color:inherit;font:inherit;text-align:inherit;cursor:pointer}
.etapes.pilote button::after{content:"";position:absolute;inset:0;border-radius:10px}
.kpis.quatre{grid-template-columns:repeat(2,minmax(0,1fr))}
.kpis.quatre .card:last-child{grid-column:auto}
@media (min-width:900px){.kpis.quatre{grid-template-columns:repeat(4,minmax(0,1fr))}}
@media (min-width:900px){.etapes.pilote li{padding-block:6px;gap:4px}.etapes.pilote button{min-height:1.5rem}}
/* Tableau et ses filtres dans une même carte, pastilles à point. */
.bloc>.outils{padding:12px}
.vue .bloc .card{border:0;border-radius:0;box-shadow:none}
.outils .segmented{flex-wrap:wrap;background:none;border:0;padding:0;gap:6px}
.outils .segmented button{border:1px solid var(--border);border-radius:999px;background:var(--surface)}
.outils .segmented button[aria-pressed=true]{background:var(--brand);border-color:var(--brand);color:var(--on-brand);outline:0}
.compte{margin-left:6px;font-weight:400}
:is(.vue,.entete) .pill{border:0;min-height:1.375rem;padding:0 8px;font-weight:700}
:is(.vue,.entete) .pill::before{content:"";flex:none;width:6px;height:6px;border-radius:50%;background:currentColor}
.vue .table .cell-sub{line-height:16px}
.vue .table td{padding-block:0}
/* Ordinateur étroit : sept colonnes tiennent en serrant les marges. */
@media (min-width:900px) and (max-width:1279px){.vue .table th,.vue .table td{padding-inline:var(--sp-2)}}
.vue .table td.large{padding-block:6px}
/* Page client affichée dans La boîte : seul son contenu et ses rubriques. */
.integre .tete,.integre .cote p{display:none}
.integre body:has(>.cote){padding-left:0}
.integre .cote{position:static;width:auto;display:flex;border-right:0;border-bottom:var(--bw) solid var(--border)}
.vue .apercu{max-width:none;height:100%}
.entete .sous{margin-top:var(--sp-1)}
.vue:has(>.apercu){grid-template-rows:auto auto minmax(30rem,1fr);align-content:stretch;height:calc(100dvh - 7rem);padding-bottom:var(--sp-3)}
body.boite:has(#barre:not([hidden])) .vue:has(>.apercu){padding-bottom:5rem}
.integre .cote{flex-wrap:wrap}
/* Habillage Rivia Production : boutons en pilule, cartes de verre sur le ciel doux. */
body{background:transparent}
.btn{border-radius:999px}
.btn-secondary{background:rgb(255 255 255/.55);border:1.5px solid rgb(77 64 56/.35);color:var(--brand)}
.card,.carte{background:rgb(255 255 255/.8);border:1px solid rgb(77 64 56/.1);box-shadow:var(--shadow-1)}
.lateral,.topbar,.cote{background:rgb(255 255 255/.72);-webkit-backdrop-filter:blur(18px) saturate(1.3);backdrop-filter:blur(18px) saturate(1.3)}
.lateral:popover-open{background:#fff}
.vue .card-flush{overflow:hidden}
.vue .bloc .card{background:none}
.vue section>h2,.vue a.objectif>h2,.entete h1{font-weight:600;letter-spacing:-.015em}
.kpis dd{font-weight:600;letter-spacing:-.02em;color:var(--text)}
.qui{color:var(--text-2);font-size:13px}

/* Pilotage : chiffres, barres du chiffre d'affaires, solde client. */
.kpis.six .card.alerte{background:var(--brand-soft)}
.kpis.six .card:last-child{grid-column:auto}
@media (min-width:1200px){.kpis.six{grid-template-columns:repeat(6,minmax(0,1fr))}.kpis.six dd{font-size:1.125rem}}
.vue>.segmented{justify-self:start}
.vue .table th.barre-ca,.vue .table td.barre-ca{width:45%}
.vue .table:has(.barre-ca) td.large{width:auto;white-space:nowrap}
.mesure{display:block;width:100%;height:8px;fill:var(--viz-1)}
.mob{display:none}
.petit-ecran{display:none}
/* Quatre montants par période : sur écran moyen, la barre laisse la place aux chiffres. */
@media (min-width:600px) and (max-width:1099px){.vue .table .barre-ca,.vue .legende-ca{display:none}}
.solde{display:flex;flex-wrap:wrap;gap:4px 20px;font-size:14px}
.pastille.tard{background:var(--danger-soft);color:var(--danger)}
.integre .valider{display:none}
.vue .table td.large>.pill{margin-bottom:4px}

/* Pas de mot ou de signe seul en fin de ligne. */
body{text-wrap:pretty}
@media (min-width:900px){.table td.large>*{min-width:12rem}}
@media (max-width:599px){
 .afaire{display:grid;grid-template-columns:minmax(0,1fr);align-items:stretch}
 .afaire .btn{white-space:normal;height:auto;justify-content:flex-start;text-align:left;padding-block:var(--sp-2)}
}
/* Au doigt et sur écran étroit : cibles de 44 px. */
@media (max-width:899px){
 body.boite{--hit:2.75rem}
 .boite .btn-sm,.boite .segmented button,.boite .nav a,.ouvrir{min-height:2.75rem}
 /* Sur téléphone le titre est juste dessous : le logo prend la place du fil. */
 #fil{display:none}
 .haut-marque{margin-right:auto}
 .ouvrir{display:flex;flex-direction:column;align-items:flex-start;justify-content:center}
}
/* Écran tactile large (tablette en paysage) : mêmes cibles. */
@media (pointer:coarse){.boite .btn-sm,.boite .segmented button,.boite .nav a,.ouvrir{min-height:2.75rem}}
.etroit{display:none}
@media (max-width:759px){.etroit{display:block}}
/* Entre téléphone et tablette, les colonnes secondaires ne tiennent pas. */
@media (max-width:759px){.vue .sec{display:none}}
/* Factures : sur tablette et ordinateur étroit, l'échéance reste, les deux autres dates sont dans la fiche. */
@media (max-width:1179px){.vue .table .loin{display:none}}
/* Le tableau des montages (7 colonnes) garde le monteur et laisse les chiffres. */
@media (max-width:1279px){.vue .table:has(th:nth-child(7)) .num.sec{display:none}}
/* Téléphone : chaque ligne de tableau devient nom à gauche, montant et état à droite. */
@media (max-width:599px){
 .vue .table,.vue .table tbody{display:block}
 .vue .table thead{display:none}
 .vue .table tr{display:grid;grid-template-columns:minmax(0,1fr) auto;align-content:center;align-items:center;gap:2px var(--sp-2);padding:6px var(--sp-3);border-bottom:var(--bw) solid var(--border)}
 .vue .table tr:last-child{border-bottom:0}
 .vue .table td:not(.sec){display:block;grid-column:2;justify-self:end;width:auto;height:auto;padding:0;border:0}
 .vue .table td.large:not(.sec){grid-column:1;grid-row:1/span 3;justify-self:stretch;align-self:center}
 .vue .table td:empty:not(.sec){display:none}
 .mob{display:inline;color:var(--text-2)}
 .vue .table .defaut{display:none}
 .vue .table td:has(>.defaut:only-child){display:none}
 .vue .table tr td.barre-ca:has(rect[width="0"]){display:none}
 .vue .table tbody tr:hover{background:var(--surface-2)}
 .vue .table tbody tr:hover td{background:none}
 /* Libellés et montants alignés d'une ligne à l'autre. */
 .vue .table td.num:has(>.mob){display:grid;grid-template-columns:auto 7.5rem;justify-items:end;column-gap:6px}
 .vue .table tr:has(.barre-ca){padding-block:var(--sp-3)}
 .vue .table tr:has(.barre-ca) td.large{grid-row:1/span 4}
 .vue .table tr td.barre-ca{grid-column:1/-1;grid-row:5;justify-self:stretch;width:auto}
 .vue .comptes .table tr td.large{grid-row:1/span 5}
 .vue .table tr.nul{display:none}
 .petit-ecran{display:block}
 .vue .table tr td.piece:has(>.defaut:only-child){display:none}
 .vue .table td.piece .lien{display:inline-flex;align-items:center;min-height:2.75rem}
 .vue .table tr.retour{grid-template-columns:minmax(0,1fr)}
 .vue .table tr.retour td:not(.sec){grid-column:1;grid-row:auto;justify-self:stretch;text-align:left}
 #fil .parent{display:none}
 .outils .input{max-width:none}
 .vue .apercu{width:calc(100% + 2 * var(--gutter));margin-inline:calc(-1 * var(--gutter));border-inline:0;border-radius:0}
}
/* Au clavier, un champ visé ne reste pas caché sous la barre du haut ou celle d'enregistrement. */
html{scroll-padding-block:4rem 5.5rem}
@media (min-width:900px){.topbar{padding-inline-end:max(var(--gutter),calc(100% - var(--content-max) + var(--gutter)))}}
@media (min-width:1500px){.demo{width:100%;margin-inline:auto}.vue,.entete{margin-inline:auto}#cadre{max-width:var(--content-max);margin-inline:auto}.topbar{padding-inline:calc((100% - var(--content-max)) / 2 + var(--gutter))}}
@media (min-width:900px){
 .lateral{display:flex}
 .topbar .menu,.topbar .haut-marque{display:none}
 .boite #panneau .corps input,.boite #panneau .corps select{min-height:var(--hit)}
 .lateral{width:16rem}.colonne{margin-left:16rem}.lateral .nav a{min-height:2.75rem}
 .outils .input{max-width:14rem;min-height:2.75rem;border-radius:999px}
}
/* Safari : le texte d' une liste choisie trop longue élargissait la fiche. */
#fiche select { overflow: hidden; text-overflow: ellipsis; }
/* Safari seulement : un champ de date vide ne montre plus la date du jour en gris. */
@supports (font:-apple-system-body){input[type=date].vide:not(:focus)::-webkit-datetime-edit{opacity:0}}
/* Petits téléphones : le logo se réduit pour que « Nouveau tournage » garde sa marge. */
@media (max-width:399px){.topbar{gap:var(--sp-2)}.topbar .haut-marque{width:64px;height:24px}}
/* Textes très longs : le montant et le nom du monteur passent à la ligne au lieu de déborder. */
.kpis .card{min-width:0;display:flex;flex-direction:column;gap:4px}
.kpis dd{margin-top:auto}
.kpis dd{white-space:normal}
.vue .table .monteur{display:block;min-width:6rem;white-space:normal;overflow-wrap:anywhere}

/* Montages par étape : une colonne par étape sur grand écran, l'une sous l'autre sur téléphone. */
.planche{display:grid;gap:var(--sp-4);padding:var(--sp-3);grid-template-columns:minmax(0,1fr);align-items:start}
.planche section{display:grid;gap:var(--sp-2);align-content:start;min-width:0}
.planche h2{display:flex;flex-wrap:wrap;gap:6px;align-items:baseline;font-size:var(--fs-ui)}
.planche .compte{color:var(--text-2);font-weight:400}
.etage-fiche{display:grid;gap:6px;justify-items:start;padding:var(--sp-3);border:var(--bw) solid var(--border);border-radius:var(--r-m);background:var(--surface);min-width:0;overflow-wrap:anywhere;grid-template-columns:minmax(0,1fr)}
.etage-fiche .pill{white-space:normal;height:auto;max-width:100%;overflow-wrap:break-word;line-height:16px;padding-block:4px}
.etage-fiche .btn-sm{justify-self:stretch;justify-content:center;white-space:normal;text-align:center;height:auto;line-height:18px;padding-block:6px}
.insec{white-space:nowrap}
@media (min-width:700px) and (max-width:1279px){.planche{grid-template-columns:repeat(auto-fill,minmax(14rem,1fr))}}
@media (min-width:1280px){.planche{grid-template-columns:repeat(5,minmax(0,1fr))}}
/* Tablette étroite : la colonne est masquée, la date passe sous le numéro. */
@media (min-width:600px) and (max-width:759px){.vue .mob.moyen{display:inline;color:var(--text-2)}}
#page>.carte:has(>.rp-marque){margin-top:24px}
.alerte-equipe{color:var(--danger)}
.alerte-equipe:empty{display:none}
.alerte-equipe{scroll-margin-block:var(--sp-3)}
.afaire .btn.urgent{color:var(--danger);border-color:var(--danger)}
/* Tablette : le menu latéral prend la place, les colonnes secondaires passent sous le nom. */
@media (min-width:900px) and (max-width:1099px){.vue .table .serre{display:none}.vue .table .etroit{display:block}.vue .table .mob.moyen{display:inline;color:var(--text-2)}}
@media (min-width:600px) and (max-width:699px){.vue .comptes .table :is(th,td){padding-inline:var(--sp-1)}}
@media (min-width:900px) and (max-width:999px){.vue .comptes .table td.large>*{min-width:8rem}}
@media (min-width:1280px){.vue .deux>:not(.plein) .table td.large>*{min-width:8rem}}
@media (max-width:359px){.topbar{flex-wrap:wrap}}
/* La date de paiement passe sous le nom quand sa colonne est masquée. */
@media (min-width:760px) and (max-width:899px),(min-width:1100px) and (max-width:1179px){.vue .table .mob.paye{display:inline;color:var(--text-2)}}
@media (max-width:599px){.vue .table tr:has(>.piece .lien) td.large:not(.sec){align-self:start}}
@media (min-width:600px){.vue .table td:has(>.cell-sub>.pill){padding-block:6px}}
/* Téléphone : la pastille d'une version passe au-dessus de son lien, le nom d'une dépense à justificatif reste en haut. */
@media (max-width:599px){.vue .table td.num:has(>.pill):has(>.lien):not(.sec){display:flex;flex-direction:column;align-items:flex-end;gap:2px}
 .vue .table tr:has(>.piece .lien) .ouvrir{justify-content:flex-start}}
@media (max-width:599px){.vue .table td.num:has(>.lien)>.pill{margin-inline-end:0}}
/* Téléphone : le nom garde au moins 104 px ; la longue pastille passe sur deux lignes seulement si la place manque. */
@media (max-width:599px){.vue .table tr:has(>td:not(.large):not(.num) .pill){grid-template-columns:minmax(6.5rem,1fr) auto}
 .vue .table tr:has(>td:not(.large):not(.num) .pill) td.large>*{min-width:0}
 .vue .table tr>td:not(.large):not(.num) .pill{white-space:normal;text-wrap:balance;height:auto;max-width:100%;line-height:16px;padding-block:3px}
 .vue .table tr:has(>td:not(.large):not(.num) .pill)>td.num{white-space:normal;min-width:0;text-align:end}
 .vue .table tr:has(>td:not(.large):not(.num) .pill)>td.num .pill{white-space:normal;text-wrap:balance;height:auto;max-width:100%;line-height:16px;padding-block:3px}}
/* Petit téléphone, chiffre d'affaires : le nom sur sa ligne, libellés et montants dessous, la barre en dernier. */
@media (max-width:429px){.vue .table tr:has(.barre-ca) td.large:not(.sec),.vue .comptes .table tr td.large:not(.sec){grid-column:1/-1;grid-row:auto}
 .vue .table tr:has(.barre-ca) td.num:has(>.mob):not(.sec),.vue .comptes .table tr td.num:has(>.mob):not(.sec){grid-column:1/-1;justify-self:stretch;grid-template-columns:1fr auto}
 .vue .table tr:has(.barre-ca) td.num>.mob,.vue .comptes .table tr td.num>.mob{justify-self:start}
 .vue .table tr:has(.barre-ca) td.barre-ca:not(.sec){grid-row:6}}
/* Montants jusqu'à 9 999 999,99 entiers dans les cartes de chiffres étroites. */
@media (max-width:379px){.kpis dd{font-size:1rem}}
@media (min-width:1200px) and (max-width:1359px){.kpis.six dd{font-size:.9375rem}}
/* « Ce que le client voit » : l'aperçu remonte sous les boutons. */
.vue:has(>.apercu){grid-template-rows:auto auto auto minmax(30rem,1fr)}
/* Jusqu'à 363 px : les quatre rubriques du client tiennent sans défiler. */
@media (max-width:363px){.client .cote{padding-inline:0}.client .cote a{padding-inline:5px;font-size:13px}}
/* Objectif du mois : la barre garde un fond visible même à zéro. */
.objectif{display:grid;gap:var(--sp-2);color:inherit;text-decoration:none}
.objectif .suivi{display:grid;gap:var(--sp-2)}
.objectif .mesure{background:var(--brand-soft);border-radius:4px}
.objectif label{max-width:18rem}
@media (max-width:599px){.objectif label{max-width:none}}
/* « Réessayer » garde sa taille au lieu de prendre toute la largeur. */
.vue>.card.vide+.btn{justify-self:start}
/* Téléphone : l'étape et son retard ne se touchent plus, et restent calés à droite comme la livraison. */
@media (max-width:599px){.vue .table tr>td:has(>.cell-sub>.pill){display:grid;gap:4px;justify-items:end;justify-self:end}}

/* Page de connexion de la boîte */
.cx{position:fixed;inset:0;z-index:5;display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.15fr);background:var(--bg);overflow:auto}
.cx-gauche{display:grid;grid-template-rows:auto 1fr auto;padding:28px 32px;background-image:radial-gradient(rgb(77 64 56/.16) 1px,transparent 1px);background-size:18px 18px}
.cx-logo{justify-self:start}
.cx-cadre{align-self:center;justify-self:center;width:min(440px,100%);padding:10px;border:1px solid var(--ligne);border-radius:28px;background:rgb(243 235 223/.55)}
.cx-carte{background:var(--surface);border:1px solid var(--ligne);border-radius:20px;padding:28px;box-shadow:var(--shadow-1)}
.cx-form{display:grid;gap:16px}
.cx-form h1{font-size:1.75rem;line-height:1.15;letter-spacing:-.02em}
.cx-sous{color:var(--text-2);font-size:14px;line-height:20px;margin-top:-8px}
.cx-bloc{display:grid;gap:6px}
.cx-ligne{display:flex;justify-content:space-between;align-items:baseline;gap:8px}
.cx-ligne label{font-size:14px;font-weight:600}
.cx-champ{width:100%;min-height:48px;padding:10px 14px 10px 44px;border:1.5px solid var(--border);border-radius:12px;background:var(--surface) no-repeat 14px 50%/18px;font:inherit;font-size:15px;color:var(--text)}
.cx-champ:focus-visible{outline:3px solid rgb(86 114 143/.3);border-color:var(--focus)}
.ic-mail{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='%236F625A' stroke-width='1.8' viewBox='0 0 24 24'%3E%3Crect x='3' y='5' width='18' height='14' rx='2'/%3E%3Cpath d='m3 7 9 6 9-6'/%3E%3C/svg%3E")}
.ic-cle{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='%236F625A' stroke-width='1.8' viewBox='0 0 24 24'%3E%3Crect x='5' y='11' width='14' height='9' rx='2'/%3E%3Cpath d='M8 11V8a4 4 0 0 1 8 0v3'/%3E%3C/svg%3E")}
.ic-lien{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='%236F625A' stroke-width='1.8' viewBox='0 0 24 24'%3E%3Cpath d='M10 14a4 4 0 0 0 5.7 0l3-3a4 4 0 0 0-5.7-5.7l-1 1M14 10a4 4 0 0 0-5.7 0l-3 3A4 4 0 0 0 11 18.7l1-1'/%3E%3C/svg%3E")}
.cx-bouton{width:100%;min-height:48px;font-size:15px}
.cx-msg{min-height:20px;color:#9B2C2C;font-size:13px;line-height:18px}
.cx-lien{background:none;border:0;padding:0 2px;min-height:44px;font:inherit;font-size:13px;font-weight:600;color:var(--lien);cursor:pointer;text-decoration:underline}
.cx-lien.petit{min-height:44px;font-weight:500;text-decoration:none}
.cx-pied{font-size:13px;line-height:20px;color:var(--text-2)}
.cx-droite{display:flex;flex-direction:column;justify-content:center;gap:32px;margin:12px 12px 12px 0;padding:56px;border-radius:28px;background:#2A221D;color:#fff}
.cx-slogan{display:grid;gap:4px;font-size:clamp(2rem,3.4vw,3.25rem);line-height:1.08;font-weight:600;letter-spacing:-.03em}
.cx-slogan span{color:rgb(255 255 255/.45)}
.cx-puces{display:flex;flex-wrap:wrap;gap:10px}
.cx-puces span{padding:8px 16px;border:1px solid rgb(255 255 255/.22);border-radius:999px;font-size:14px;color:rgb(255 255 255/.85)}
@media (max-width:860px){.cx{grid-template-columns:1fr}.cx-droite{display:none}.cx-gauche{padding:20px 16px}.cx-carte{padding:22px}}

/* Développer la boîte */
.espace-r{display:grid;gap:var(--sp-3)}
.espace-r h2{font-size:1.1rem}
.grille-r{display:grid;gap:var(--sp-3);grid-template-columns:repeat(auto-fill,minmax(250px,1fr))}
.champ-r{display:grid;gap:4px;margin-block:8px}
.espace-r .input,.espace-r .select,.espace-r .textarea{width:100%;max-width:100%;min-height:44px;font-size:15px}
.espace-r .btn{min-height:44px}
.texte-r{white-space:pre-wrap;overflow-wrap:anywhere}
.espace-r summary{cursor:pointer;min-height:44px;display:flex;align-items:center;gap:8px;flex-wrap:wrap}

/* Menu : groupes repliables, onglets Factures / Dépenses */
.lateral .nav-repli>summary{cursor:pointer;list-style:none;display:flex;align-items:center;justify-content:space-between;min-height:44px;padding-inline:var(--sp-2)}
.lateral .nav-repli>summary::-webkit-details-marker{display:none}
.lateral .nav-repli>summary::after{content:"";width:8px;height:8px;border-right:2px solid currentColor;border-bottom:2px solid currentColor;transform:rotate(45deg);transition:transform .15s;margin-right:4px}
.lateral .nav-repli[open]>summary::after{transform:rotate(-135deg)}
.onglets-fin{display:flex;gap:var(--sp-2);margin-bottom:var(--sp-4);border-bottom:1px solid var(--bord,#e7e2d9)}
.onglets-fin a{padding:12px 16px;min-height:44px;color:inherit;text-decoration:none;border-bottom:2px solid transparent;font-size:15px}
.onglets-fin a[aria-current=page]{font-weight:600;border-bottom-color:currentColor}

.lateral #menu{flex:1;display:flex;flex-direction:column;min-height:0}
.lateral #menu>.nav-repli+.nav-repli{margin-top:var(--sp-1)}
.lateral #menu>.nav-repli:last-child:not(:first-child){margin-top:auto;padding-top:var(--sp-2);border-top:1px solid var(--border)}
.lateral .nav-repli:not([open])>.nav-label,.lateral .nav-repli>summary{margin-bottom:0}
.lateral .nav-repli[open]>summary{margin-bottom:var(--sp-1)}
