/* ==========================================================================
   LJ Autotech Manager — nouveau design (ébauche 1 validée par Loïc, 10.11.2026)
   Couche visuelle chargée APRÈS style.css : couleurs inchangées (--red #c8102e,
   --red-dark #9e0c24, --black #111, --grey #f4f4f4). Aucun effet sur les PDF.
   Desktop ≥ 769 px : barre latérale + barre du haut. Mobile ≤ 768 px : barre
   d'onglets du bas et menu « ☰ » existants (mêmes points de rupture).
   ========================================================================== */
@font-face{font-family:"Inter";src:url(fonts/Inter-Variable.woff) format("woff");font-weight:100 900;font-display:swap}
@font-face{font-family:"Plex Mono";src:url(fonts/IBMPlexMono-Medium.woff) format("woff");font-weight:400 500;font-display:swap}
@font-face{font-family:"Plex Mono";src:url(fonts/IBMPlexMono-SemiBold.woff) format("woff");font-weight:600 700;font-display:swap}
:root{
  --red:#c8102e;--red-dark:#9e0c24;--black:#111;--grey:#f4f4f4;
  --text:#1a1a1a;--text-2:#555;--line:#e2e2e2;--line-2:#d6d6d6;
  --sans:"Inter","Segoe UI",Arial,sans-serif;--mono:"Plex Mono",ui-monospace,"SF Mono",Menlo,Consolas,monospace;
  --r:12px;--r-sm:8px;--shadow:0 1px 2px #0000000d,0 1px 3px #0000000a;--side-w:104px;--top-h:72px;
  --ctl-h:40px;--topnav-h:0px;
}
@media(max-width:768px){:root{--ctl-h:48px;--topnav-h:62px}}
html{-webkit-font-smoothing:antialiased}
body{font-family:var(--sans);font-size:14.5px;line-height:1.5;background:var(--grey);color:var(--text)}
input,select,textarea,button{font-family:var(--sans)}
a{color:var(--red)}
td,.r,.st-card b,.kpi b{font-variant-numeric:tabular-nums}

/* ---------- titres ---------- */
h1{border-left:0;padding-left:0;font-size:30px;line-height:1.2;font-weight:800;letter-spacing:-.03em;margin:4px 0 20px;color:var(--text)}
h1 .tag{vertical-align:middle;margin-left:8px;letter-spacing:0}
h2{font-size:17px;font-weight:700;letter-spacing:-.015em;margin:2px 0 12px;color:var(--text)}
h3{font-size:15px;font-weight:700;letter-spacing:-.01em}

/* ---------- boutons ---------- */
button,.btn{background:var(--red);color:#fff;border:2px solid transparent;border-radius:var(--r-sm);padding:8px 16px;font-weight:600;font-size:14px;line-height:20px;text-decoration:none;cursor:pointer;vertical-align:middle}
button:hover,.btn:hover{background:var(--red-dark)}
.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;white-space:nowrap}
.btn svg,button svg{width:18px;height:18px;flex:none;display:block}
.btn-dark{background:var(--black);color:#fff}.btn-dark:hover{background:#2a2a2a}
.btn-outline{background:#fff;color:var(--black);border-color:var(--black)}.btn-outline:hover{background:var(--black);color:#fff}
.btn-ghost{background:#fff;color:var(--black);border-color:var(--line-2)}.btn-ghost:hover{background:var(--grey);color:var(--black)}
.danger{background:#fff;color:var(--red);border:2px solid var(--red)}.danger:hover{background:var(--red);color:#fff}
.small,button.small{padding:3px 9px;font-size:12.5px;border-width:1px;border-radius:6px;line-height:18px}
button.link{border:0}
.actions{gap:10px;margin-bottom:20px}
.actions>.btn:not(.btn-dark):not(.btn-ghost):not(.btn-outline):not(.danger){box-shadow:none}

/* ---------- champs ---------- */
label{font-size:12px;color:var(--text-2);font-weight:500;gap:5px}
input,select,textarea{border:1px solid var(--line-2);border-radius:var(--r-sm);padding:9px 11px;font-size:14.5px;background:#fff;color:var(--text)}
input:focus,select:focus,textarea:focus{border-color:var(--red);box-shadow:0 0 0 3px #c8102e22}
input[type=checkbox],input[type=radio]{accent-color:var(--red)}

/* ---------- cartes ---------- */
.card{border:1px solid var(--line);border-radius:var(--r);box-shadow:var(--shadow);padding:20px 24px;margin-bottom:20px}
.card>h2:first-child{margin-top:0}
.sub{background:#fafafa;border:1px solid var(--line);border-top:3px solid var(--black);border-radius:var(--r-sm)}
.flash{border-radius:var(--r-sm);padding:12px 16px;border:1px solid transparent;font-weight:500}
.flash.ok{background:#e8f7ec;border-color:#8dcf9b;color:#1e6b34}
.flash.err{background:#fde2e2;border-color:#f3b4b4;color:#a01818}
.flash.warn{background:#fff4d6;border-color:#f0d58a;color:#5c4300}
.flash.warn a{color:#5c4300;font-weight:600}
.muted{color:#6b6b6b}

/* ---------- tableaux ---------- */
table{border-collapse:separate;border-spacing:0}
th{background:#fff;color:var(--text-2);font:500 11.5px/16px var(--mono);letter-spacing:.06em;text-transform:uppercase;padding:12px 12px;border-bottom:1px solid var(--line);white-space:nowrap;vertical-align:bottom}
td{padding:10px 12px;border-bottom:1px solid #ececec;vertical-align:middle}
table.list{background:#fff;border:1px solid var(--line);border-radius:var(--r);box-shadow:var(--shadow);margin-bottom:20px}
table.list tr:last-child>td{border-bottom:0}
table.list tr:hover>td{background:#fafafa}
table.list tr.lowrow>td,tr.lowrow>td{background:#fdeef0}
.card table.list{border:0;box-shadow:none;border-radius:0;margin-bottom:0}
.card>table:not(.list) td,.card .dash-scroll table:not(.list) td{padding:9px 10px}
th.sortable a{color:inherit}th.sorted a{color:var(--red)}
th.todayc{background:var(--red);color:#fff}
table.cal th{text-transform:none;letter-spacing:0;font:600 12.5px/16px var(--sans);color:var(--text)}
table.cal th.todayc{color:#fff}
.tech-b th{font-family:var(--sans)}

/* ---------- statuts (couleurs inchangées, forme pastille) ---------- */
.tag{display:inline-flex;align-items:center;gap:6px;padding:3px 10px 3px 9px;border-radius:999px;font-size:12.5px;font-weight:600;line-height:18px;white-space:nowrap;border:1px solid transparent;vertical-align:middle}
.tag::before{content:"";width:7px;height:7px;border-radius:50%;background:currentColor;flex:none}
/* décision de Loïc (10.11.2026) : « partiellement payée » en jaune */
.tag[data-st="partiellement payée"]{background:#FFF4C2;color:#7A5A00;border:1px solid #E6C200}
.badge{background:#e07b00;color:#fff;border-radius:10px;min-width:20px;height:20px;padding:0 6px;font:700 11px/20px var(--sans);display:inline-block;text-align:center}

/* ---------- KPI / statistiques ---------- */
.kpi{border:1px solid var(--line);border-top:3px solid var(--red);border-radius:var(--r);box-shadow:var(--shadow);padding:14px 18px}
.kpi small{font:500 11.5px/16px var(--mono);letter-spacing:.06em;text-transform:uppercase;color:var(--text-2)}
.kpi b{font-size:22px;font-weight:800;letter-spacing:-.02em}
.chart small{font:500 11px/14px var(--mono);color:var(--text-2)}

/* ---------- barre du haut (desktop) ---------- */
.topbar{display:none}
.avatar{width:36px;height:36px;border-radius:50%;background:var(--black);color:#fff;display:inline-grid;place-items:center;font:700 13px/1 var(--sans);flex:none}

/* ==================== DESKTOP ≥ 769 px ==================== */
@media(min-width:769px){
  body.has-side{padding-left:var(--side-w);
    /* M9 (07:17) : le fond noir de la barre latérale descend sur toute la hauteur de la page, même longue (le menu reste fixe par-dessus) */
    background:linear-gradient(to right,var(--black) 0 calc(var(--side-w) - 3px),var(--red) calc(var(--side-w) - 3px) var(--side-w),var(--grey) var(--side-w)) var(--grey)}
  /* barre latérale = même <nav id="top-nav"> (ordre et masquage personnels conservés) */
  body #top-nav,body #top-nav.js-nav{position:fixed!important;left:0;top:0;bottom:0;width:var(--side-w);z-index:60;display:flex!important;flex-direction:column;flex-wrap:nowrap;align-items:stretch;gap:2px;
    padding:12px 10px 16px;background:var(--black);border-bottom:0;border-right:3px solid var(--red);overflow-y:auto;overflow-x:hidden;grid-template-columns:none!important;scrollbar-width:thin;scrollbar-color:#444 transparent}
  body #top-nav>.brand,body #top-nav>.nav-scan,body #top-nav>.nav-acc,body #top-nav>.sp,body #top-nav>.nav-toggle{display:none!important}
  body #top-nav>a.nav-tab{display:flex!important;flex-direction:column;align-items:center;justify-content:center;gap:4px;min-height:58px;padding:7px 4px;border-radius:10px;color:#cfcfcf;
    text-decoration:none;font-size:11.5px;line-height:14px;font-weight:500;text-align:center;position:relative;white-space:normal;flex:none;overflow:visible}
  body #top-nav>a.nav-tab svg{width:24px;height:24px;display:block;flex:none}
  body #top-nav>a.nav-tab:hover{background:#ffffff14;color:#fff}
  body #top-nav>a.nav-tab.is-active{background:#ffffff1a;color:#fff}
  body #top-nav>a.nav-tab.is-active::before{content:"";position:absolute;left:-10px;top:12px;bottom:12px;width:4px;border-radius:0 4px 4px 0;background:var(--red)}
  #top-nav .badges{display:flex;gap:3px;justify-content:center}
  #top-nav .badge{min-width:18px;height:18px;line-height:18px;font-size:10.5px;padding:0 5px;margin:0}
  /* barre du haut */
  .topbar{display:flex;align-items:center;gap:12px;height:var(--top-h);padding:0 40px;background:#fff;border-bottom:1px solid var(--line);position:sticky;top:0;z-index:50}
  .topbar .sp{flex:1}
  .tb-brand{display:flex;align-items:center;height:100%;text-decoration:none;color:var(--black);font-weight:800;font-size:18px;min-width:0}
  .tb-brand img{height:44px;max-width:240px;object-fit:contain;display:block}
  .tb-user{display:flex;align-items:center;gap:10px;text-decoration:none;color:var(--text);margin-left:4px;min-width:0}
  .tb-uname{display:flex;flex-direction:column;line-height:18px;min-width:0}
  .tb-uname b{font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:180px}
  .tb-uname small{font:500 11.5px/16px var(--mono);color:var(--text-2)}
  .topbar .btn{height:44px;padding:0 16px}
  main{padding:32px 40px 48px;max-width:none;width:auto;box-sizing:border-box;margin:0}
}
@media(min-width:769px) and (max-width:1100px){
  .topbar{padding:0 20px}.tb-uname{display:none}main{padding:24px 20px 40px}
  .tb-scan{font-size:0;gap:0;width:44px;padding:0!important}.tb-scan svg{width:20px;height:20px}
}

/* ==================== MOBILE ≤ 768 px ==================== */
@media(max-width:768px){
  body{font-size:15px}
  h1{font-size:24px;margin:2px 0 14px}
  #top-nav{border-bottom:3px solid var(--red)}
  #top-nav a.nav-tab svg{width:20px;height:20px;flex:none;margin-right:12px;display:inline-block}
  #top-nav a.nav-tab .badges{margin-left:8px;display:inline-flex;gap:4px}
  #top-nav.js-nav.open a.nav-tab{gap:0}
  .tabbar .tab-ico svg{width:24px;height:24px;display:block}
  .tab-a .tab-ico{line-height:0}
  .tab-a{font-size:10.5px;font-weight:500}
  .tab-a.is-active{color:#fff}.tab-a.is-active .tab-lbl{color:#ff6b6b}
  .card{padding:14px 14px;border-radius:12px}
  table.list th:first-child,.card>table th:first-child,.dash-scroll th:first-child{background:#fff}
  th{padding:10px 10px}td{padding:9px 10px}
  .btn,button{border-radius:10px}
}

/* ---------- en-tête de page, résumé ---------- */
.page-head{display:flex;flex-wrap:wrap;align-items:flex-end;justify-content:space-between;gap:12px 24px;margin-bottom:20px}
.page-head>div:first-child{min-width:0}
.page-head h1{margin:0}
.summary{font:400 13px/20px var(--mono);color:var(--text-2);margin:6px 0 0}
.summary b{color:var(--text);font-weight:600}
.eyebrow{display:block;font:500 11.5px/16px var(--mono);letter-spacing:.08em;text-transform:uppercase;color:var(--text-2)}
.eyebrow-inline{font:500 11px/16px var(--mono);letter-spacing:.08em;text-transform:uppercase;color:var(--text-2);margin-left:8px;vertical-align:middle}
.scan-big{display:none}
table td a{text-decoration:none;font-weight:600}
table td a:hover{text-decoration:underline}
a.pdf-ico{font-weight:400}
/* Lot F : l'icône 🖨 ne doit pas être coupée dans les cases étroites */
.dash-scroll th.col-num,.dash-scroll td.col-num{
  overflow:visible;white-space:nowrap;vertical-align:middle
}
.dash-scroll a.pdf-ico,.dash-mlist a.pdf-ico{
  overflow:visible;flex-shrink:0;vertical-align:middle
}


/* ---------- statistiques du tableau de bord (admin : grand chiffre + 12 mois + petites cartes) ---------- */
.st-title{margin:28px 0 14px;font-size:20px}
.st-hero{display:grid;grid-template-columns:minmax(0,1.45fr) minmax(0,1fr);gap:16px;margin-bottom:16px}
.st-big{margin:0;display:flex;flex-direction:column;min-width:0}
.st-num{font-size:56px;line-height:1.05;font-weight:800;letter-spacing:-.04em;margin-top:10px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.st-num small{font-size:22px;font-weight:700;letter-spacing:-.01em;color:var(--text-2)}
.st-sub{font:400 12.5px/18px var(--mono);color:var(--text-2);margin:6px 0 16px}
.st-bars{display:flex;align-items:flex-end;gap:8px;height:150px;margin-top:auto}
.st-bar{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:flex-end;height:100%;min-width:0}
.st-bar i{display:block;width:100%;max-width:44px;background:#d6d6d6;border-radius:4px 4px 0 0}
.st-bar.cur i{background:var(--red)}
.st-bar em{font:500 10.5px/14px var(--mono);font-style:normal;color:var(--text-2);white-space:nowrap}
.st-bar span{font:500 10.5px/14px var(--mono);color:var(--text-2);margin-top:4px;white-space:nowrap}
.st-side{display:grid;grid-template-columns:1fr 1fr;gap:16px;min-width:0}
.st-side .st-card{margin:0}
.st-grid{grid-template-columns:repeat(auto-fill,minmax(200px,1fr));gap:16px;margin-bottom:16px}
.st-card{background:#fff;border:1px solid var(--line);border-radius:var(--r);box-shadow:var(--shadow);padding:16px 18px;gap:4px;justify-content:flex-start}
.st-card span{font:500 11.5px/16px var(--mono);letter-spacing:.06em;text-transform:uppercase;color:var(--text-2)}
.st-card b{font-size:26px;line-height:1.2;font-weight:800;letter-spacing:-.025em;margin-top:6px}
.st-card small{color:#6b6b6b;font-size:12.5px}
.st-card.st-warn{border-left:1px solid var(--line)}
.st-card.st-warn small{color:var(--red);font-weight:600}
.st-top{margin-top:0}
/* page Statistiques : barres empilées dans les couleurs actuelles */
.chart{gap:12px}.bar small{margin-top:4px}
.kpis{gap:16px}

@media(max-width:1100px){.st-hero{grid-template-columns:1fr}}
@media(max-width:768px){
  .page-head{margin-bottom:14px}
  .summary{font-size:12px}
  .scan-big{display:block}
  .st-num{font-size:40px}
  .st-side{grid-template-columns:1fr 1fr;gap:10px}
  .st-grid{grid-template-columns:1fr 1fr!important;gap:10px}
  .st-card{padding:12px}
  .st-card b{font-size:20px}
  .st-card span{font-size:10.5px;letter-spacing:.04em}
  .st-bars{gap:3px;height:120px}
  .st-bar em{display:none}
  .st-bar span{writing-mode:vertical-rl;transform:rotate(180deg);height:3.4em}
}

/* ---------- ordres : pastilles, recherche, tri, pagination, vue Atelier ---------- */
.page-actions{display:flex;gap:10px;flex-wrap:wrap}
.page-actions .btn{height:48px;padding:0 20px;font-size:15px}
.ot-toolbar{display:flex;flex-wrap:wrap;align-items:center;gap:12px;margin-bottom:12px}
.seg{display:inline-flex;background:#fff;border:1px solid var(--line-2);border-radius:10px;padding:3px;gap:2px;flex:none}
.seg a{display:inline-flex;align-items:center;gap:6px;height:38px;padding:0 14px;border-radius:7px;color:var(--text);text-decoration:none;font-weight:600;font-size:14px}
.seg a svg{width:18px;height:18px}
.seg a.on{background:var(--black);color:#fff}
.ot-search{display:flex;align-items:center;gap:8px;flex:0 1 460px;min-width:0;height:46px;padding:0 6px 0 14px;background:#fff;border:1px solid var(--line-2);border-radius:10px;margin:0}
.ot-search:focus-within{border-color:var(--red);box-shadow:0 0 0 3px #c8102e22}
.ot-search svg{width:20px;height:20px;color:var(--text-2);flex:none}
.ot-search input{border:0;box-shadow:none!important;padding:0;height:40px;flex:1;min-width:0;background:transparent;font-size:15px}
.ot-search .ot-search-btn{height:36px;padding:0 12px;font-size:13px;border:1px solid var(--line-2);border-radius:7px;background:#fff;color:var(--black);flex:none}
.ot-search .ot-search-btn:hover{background:var(--grey)}
.ot-clear{color:var(--text-2);text-decoration:none;font-size:16px;padding:0 6px}
.chips{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin:0 0 18px}
.chip{display:inline-flex;align-items:center;gap:8px;height:36px;padding:0 8px 0 14px;border-radius:999px;background:#fff;border:1px solid var(--line-2);color:var(--text);text-decoration:none;font-weight:600;font-size:13.5px;white-space:nowrap}
.chip em{font:600 12px/1 var(--mono);font-style:normal;color:var(--text-2);background:var(--grey);border-radius:999px;padding:4px 7px;min-width:24px;text-align:center}
.chip:hover{border-color:var(--black)}
.chip.on{background:var(--black);border-color:var(--black);color:#fff}
.chip.on em{background:#ffffff26;color:#fff}
.chips-sep{width:1px;height:24px;background:var(--line-2);margin:0 4px}
.chips-l{font:500 11px/16px var(--mono);letter-spacing:.08em;text-transform:uppercase;color:var(--text-2)}
.ot-table td:first-child{white-space:nowrap}
.empty-row{text-align:center;padding:28px 12px}
.ot-cards{display:none}
.pager{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:12px;margin:-4px 0 20px}
.pager-info{font:400 13px/20px var(--mono);color:var(--text-2)}
.pager-nav{display:flex;gap:6px;flex-wrap:wrap}
.pg{display:inline-grid;place-items:center;min-width:38px;height:38px;padding:0 8px;border-radius:8px;border:1px solid var(--line-2);background:#fff;color:var(--text);text-decoration:none;font:600 14px/1 var(--mono)}
a.pg:hover{border-color:var(--black)}
.pg.on{background:var(--black);border-color:var(--black);color:#fff}
.pg.off{color:#bbb}.pg.gap{border:0;background:transparent;min-width:20px}
.board{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px;align-items:start;margin-bottom:16px}
.board .col{background:#eaeaea;border-radius:var(--r);padding:12px;display:flex;flex-direction:column;gap:8px;min-width:0}
.col-h{display:flex;align-items:center;justify-content:space-between;padding:2px 4px 4px}
.col-h .count{font:600 13px/1 var(--mono);color:var(--text-2)}
.oc{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:4px 8px;align-items:center;background:#fff;border:1px solid var(--line);border-radius:10px;padding:10px 12px;text-decoration:none;color:var(--text);min-width:0}
.oc:hover{border-color:var(--black)}
.oc .n{font:600 13px/18px var(--mono);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.oc .c{font-size:13.5px;color:var(--text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0}
.oc .pl{font:600 12px/1 var(--mono);border:1.5px solid var(--black);border-radius:5px;padding:4px 6px;white-space:nowrap;justify-self:end}
.mini{width:28px;height:28px;border-radius:50%;background:var(--grey);border:1px solid var(--line-2);display:inline-grid;place-items:center;font:700 11px/1 var(--sans);justify-self:end;color:var(--text)}
.col-more{height:40px;margin-top:2px}
.col-more svg{width:16px;height:16px}
.col-empty{margin:4px;}
.hist-band{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:12px;padding:14px 20px}
.hist-band span{display:inline-flex;align-items:center;gap:8px}
.hist-band svg{width:18px;height:18px}
.hist-band .btn svg{width:16px;height:16px}
@media(max-width:1100px) and (min-width:769px){.board{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:768px){
  .page-actions{width:100%}.page-actions .btn{width:100%;height:52px}
  .ot-toolbar{flex-direction:column;align-items:stretch}
  .seg{align-self:flex-start}
  .ot-search{flex:1 1 auto;width:100%}
  .ot-search .ot-search-btn{width:auto!important;min-height:36px!important;min-width:0}
  .chips{gap:6px}.chips-sep{display:none}.chips-l{width:100%;margin-top:2px}
  .chip{height:34px;font-size:13px}
  table.ot-table{display:none!important}
  .ot-cards{display:flex;flex-direction:column;gap:8px;margin-bottom:14px}
  .ot-cards .oc{grid-template-columns:minmax(0,1fr) auto;padding:12px 14px}
  .ot-cards .oc .m{grid-column:1/-1;font:400 12px/16px var(--mono);color:var(--text-2)}
  .ot-cards .oc .c{grid-column:1/-1}
  .board{grid-template-columns:1fr}
  .board .col .oc:nth-of-type(n+4){display:none}
  .board .col .col-more{display:inline-flex!important}
  .hist-band{flex-direction:column;align-items:stretch}.hist-band .btn{width:100%}
  .pager{justify-content:center}.pager-info{width:100%;text-align:center}
}
.col-more.only-m{display:none}
.board .oc{grid-template-areas:"n m" "c p"}
.board .oc .n{grid-area:n}.board .oc .mini{grid-area:m}.board .oc .c{grid-area:c}.board .oc .pl{grid-area:p}
.ot-cards .oc{grid-template-areas:"n t" "c c" "m m"}
.ot-cards .oc .n{grid-area:n}.ot-cards .oc .tag{grid-area:t;justify-self:end}.ot-cards .oc .c{grid-area:c}.ot-cards .oc .m{grid-area:m}
/* 0833 : 🖨 PDF par ordre sur les cartes mobiles (comme le tableau) — lien frère de la carte, en bas à droite */
.ot-cards .oc-row{position:relative}
.ot-cards .oc-row .oc .m{padding-right:40px}
.ot-cards .oc-pdf{position:absolute;right:6px;bottom:4px;display:inline-flex;align-items:center;justify-content:center;width:40px;height:32px;margin:0;font-size:16px;line-height:1;border-radius:8px}
.ot-cards .oc-pdf:focus-visible{outline:2px solid var(--black);outline-offset:-2px}

/* ---------- statut en boutons (ordres, devis) ---------- */
.status-seg{border:0;margin:0 0 4px;padding:0;min-width:0}
.status-seg legend{font-size:12px;color:var(--text-2);font-weight:500;padding:0;margin-bottom:6px}
.seg-opts{display:grid;grid-template-columns:repeat(auto-fit,minmax(130px,1fr));gap:8px}
.st-opt{position:relative;display:flex;flex-direction:row!important;align-items:center;justify-content:center;min-height:46px;padding:6px 10px;border:1.5px solid var(--line-2);border-radius:10px;background:#fff;color:var(--text);font-size:14px;font-weight:600;cursor:pointer;text-align:center;gap:0!important}
.st-opt input{position:absolute;opacity:0;width:1px;height:1px;pointer-events:none}
.st-opt:hover{border-color:var(--black)}
.st-opt:focus-within{outline:3px solid #c8102e55;outline-offset:1px}
.st-opt.on,.st-opt:has(input:checked){background:#fff0d6;border-color:#8a5300;color:#8a5300}
.seg-help{display:block;margin-top:6px}
@media(max-width:768px){.seg-opts{grid-template-columns:1fr 1fr}.st-opt{min-height:48px}}
input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=submit]):not([type=hidden]),select{min-height:40px}

/* formulaires : colonnes un peu plus larges pour la police Inter (aucun libellé de liste coupé) */
.grid{grid-template-columns:repeat(auto-fill,minmax(250px,1fr));gap:12px 18px}
.st-big .chart{height:auto;min-height:230px;margin-top:auto}
.legend-row{margin:10px 0 0;font-size:13px}
.page-actions select{min-width:110px}

/* passe 1 : largeur utile à 1280 px, cartes du tableau de bord sans débordement */
@media(min-width:769px) and (max-width:1500px){main{padding:28px 28px 44px}.topbar{padding:0 28px}}
td{padding:10px 10px}th{padding:12px 10px}
.dash-cols .card td{padding:8px 8px;font-size:13.5px}
.dash-cols .card td:first-child{white-space:nowrap}
@media(max-width:1400px){.dash-cols{grid-template-columns:1fr}}
@media(max-width:768px){table.navprefs button.mv{width:44px!important;min-width:44px;padding:4px!important}table.navprefs td,table.navprefs th{padding:8px 4px}}

/* passe 2 : montants longs jamais tronqués dans les petites cartes */
.st-card b{white-space:normal;overflow:visible;text-overflow:clip;overflow-wrap:anywhere}
@media(min-width:769px){.st-grid{grid-template-columns:repeat(auto-fill,minmax(230px,1fr))}}
@media(max-width:768px){.chart{gap:3px}.chart .bar{flex:1 1 0;min-width:0;overflow:hidden;text-align:center}.chart small{font-size:9px;letter-spacing:-.03em}.chart small+small{display:none}.card table.list.top-cli{display:table;width:100%}.card table.list.top-cli td,.card table.list.top-cli td:first-child{white-space:normal;position:static;box-shadow:none}.card table.list.top-cli td.r{white-space:nowrap}}

/* ===== Relecture Design (10.11.2026) ===== */
/* B1 agenda : 6 jours sans défilement sur ordinateur */
@media(min-width:769px){.agenda-duration-grid{min-width:0!important;width:100%;grid-template-columns:60px repeat(6,minmax(0,1fr))!important}}
/* B2 RDV courts : une ligne « HH:MM · objet » */
a.agenda-duration-card.agenda-short{white-space:nowrap;text-overflow:ellipsis;line-height:20px;padding-top:0;padding-bottom:0}
a.agenda-duration-card.agenda-short br,a.agenda-duration-card.agenda-short small{display:none}
/* B3 champs : 40 px bureau, 48 px mobile (#11, --ctl-h) */
input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=submit]):not([type=hidden]):not([type=range]):not([type=color]),select:not([multiple]){height:var(--ctl-h);min-height:var(--ctl-h);padding-top:0;padding-bottom:0;line-height:calc(var(--ctl-h) - 2px);box-sizing:border-box}
input[type=date],input[type=datetime-local],input[type=time],input[type=month]{line-height:normal}
.grid{align-items:end}
/* B4 graphique de l'accueil : mois courts, année sous janvier */
.st-bar span{font:500 11px/16px var(--mono);white-space:nowrap;display:flex;flex-direction:column;align-items:center}
.st-bar span{position:relative}.st-bar span small{position:absolute;top:100%;left:50%;transform:translateX(-50%);font:500 10px/12px var(--mono);color:#8a8a8a}@media(min-width:769px){.st-bars{padding-bottom:12px}}
/* C1 barre du haut 80 px, boutons 48 px, avatar 40 px */
@media(min-width:769px){:root{--top-h:80px}.topbar{height:80px}.topbar .btn{height:48px}.avatar{width:40px;height:40px}}
@media(min-width:769px) and (max-width:1100px){.tb-scan{width:48px}}
/* C2 petits boutons : 40 px minimum */
.small,button.small,.btn.small{height:40px;min-height:40px;min-width:40px;padding:0 14px;font-size:14px;line-height:20px;display:inline-flex;align-items:center;justify-content:center;vertical-align:middle}
td .small{padding:0 12px}
.doc-lines .small{width:40px;padding:0}
/* C3 icônes dans le texte */
.flash-act svg,.h-ico svg,.cat-chip svg,.nav-acc svg{width:18px;height:18px;flex:none;vertical-align:-3px}
.h-ico{display:flex;align-items:center;gap:8px}
/* C4 hiérarchie : action principale à droite */
@media(min-width:769px){.actions>.act-primary{order:10}}
@media(max-width:768px){.actions.client-acts{display:grid;grid-template-columns:1fr 1fr;gap:8px}.actions.client-acts>.btn{width:100%;margin:0;white-space:normal;text-align:center}.actions.client-acts>.btn:not(.btn-ghost){grid-column:1/-1}.actions.client-acts>.btn:not(.btn-ghost):not(.btn-outline){order:-1}}
/* C5 plaques en badge (purement visuel) */
.plate{display:inline-flex;align-items:center;height:28px;padding:0 7px;border:2px solid var(--black);border-radius:5px;background:#fff;color:var(--black);font:600 13px/1 var(--mono);white-space:nowrap;vertical-align:middle;box-sizing:border-box}
a .plate{color:var(--black)}
.ot-card .plate,.oc .plate{height:24px;font-size:12px;padding:0 5px;border-width:1.5px}
/* C6 « en attente pièces » distinct de « en cours » */
.tag[data-st="en attente pièces"]{background:#fff;color:#8a5300;border:1px dashed #8a5300}
/* C7 vue Atelier : cartes de même hauteur */
.oc{min-height:72px;box-sizing:border-box}
.mini.mini-empty{background:transparent;border-color:transparent}
/* C8 pastilles sur une ligne dès 1280 px */
@media(min-width:769px){.chips{gap:6px}.chip{padding:0 6px 0 12px;font-size:13.5px;gap:6px}.chips-sep{margin:0 2px}.chips-l{margin-right:2px}}
/* C9 accueil : paires en 2 colonnes dès 1100 px */
@media(min-width:1100px){.dash-cols{grid-template-columns:minmax(0,3fr) minmax(0,2fr)!important;gap:24px}}
@media(max-width:1099px){.dash-cols{grid-template-columns:1fr!important}}
.dash-cols .card{min-width:0}
.dash-cols .card table{width:100%}
.dash-cols .card td{white-space:normal}
.dash-cols .card td:first-child,.dash-cols .card td .tag{white-space:nowrap}
/* C10 valeur estimée */
@media(min-width:769px){.val-form .grid{grid-template-columns:repeat(4,minmax(0,1fr))}}
.val-chf{min-width:0}.val-chf input{min-width:0;width:100%}
/* C11 statistiques : libellés sur 2 lignes réservées, en-tête centré */
@media(min-width:769px){.st-card>span:first-child{min-height:32px}}
.page-head:has(select){align-items:center}
/* C13 barres d'outils alignées */
@media(min-width:769px){.actions>form{display:flex;align-items:center;gap:8px;flex-wrap:wrap}}
@media(min-width:769px){.users form.inline.uform{display:flex;align-items:center;gap:8px;flex-wrap:nowrap}
.users form.inline.uform input[name=full_name]{width:150px;flex:none}
.users form.inline.uform select,.users form.inline.uform>span{width:125px;flex:none}
.users form.inline.uform input[type=password]{width:115px;flex:none}
.users form.inline.uform button{flex:none}}
/* C14 totaux en mobile hors du tableau */
.totals-m{display:none}
@media(max-width:768px){.doc-lines tr.tot{display:none}.totals-m{display:grid;grid-template-columns:1fr auto;gap:6px 16px;margin-top:12px;padding-top:10px;border-top:1px solid var(--line);font-size:14px}.totals-m b{text-align:right;font-weight:500;font-variant-numeric:tabular-nums}.totals-m .g{font-weight:800}}
/* C15 paiements en mobile : lignes-cartes */
td.actions-td{width:1%;white-space:nowrap}
td.actions-td .small{width:40px;padding:0;flex:none}
@media(max-width:768px){.card table.list.pay-list{display:block;overflow:visible}.pay-list tbody{display:block}.pay-list tr:has(th){display:none}.pay-list tr{display:grid;grid-template-columns:1fr auto;gap:2px 12px;padding:10px 0;border-bottom:1px solid var(--line)}.pay-list td{display:block;border:0!important;padding:0!important;white-space:normal!important;position:static!important;background:none!important;box-shadow:none!important;width:auto}.pay-list td:nth-child(1){font-weight:600}.pay-list td:nth-child(2){text-align:right;font-weight:700}.pay-list td:nth-child(n+3){grid-column:1;color:var(--text-2);font-size:13px}.pay-list td.actions-td{grid-column:2;grid-row:2/span 3;display:flex;align-items:center;gap:10px;justify-content:flex-end;color:inherit;font-size:14px}}
/* C16 légende de l'agenda sur sa ligne */
.agenda-legend{display:flex;flex-wrap:wrap;gap:8px 20px;margin:16px 0 4px;font-size:13px}
.agenda-legend .legend{display:inline-flex!important;align-items:center;gap:8px;background:none!important;border:0!important;padding:0!important;margin:0!important;font-weight:500;color:var(--text)}
.agenda-legend .legend::before{content:"";width:12px;height:12px;border-radius:3px;flex:none}
.agenda-legend .appt.pending::before{background:#fff1dc;border:1px dashed #e07b00}
.agenda-legend .closedc::before{background:repeating-linear-gradient(135deg,#eee 0 3px,#cfcfcf 3px 6px);border:1px solid #bbb}
/* D1 titres */
@media(min-width:769px){h1{font-size:40px;line-height:48px;font-weight:800;letter-spacing:-.035em}}
@media(max-width:768px){h1{font-size:24px;line-height:32px}}
/* D2 statut choisi : état neutre */
.st-opt.on,.st-opt:has(input:checked){background:#fff;border:2px solid #111;color:#111}
/* D4 */
.cancel-link{margin-left:12px}
/* D5 */
td.veh-acts{font-size:0;white-space:normal}td.veh-acts a{display:block;font-size:14px;line-height:22px;white-space:nowrap}
/* D7 pastilles mobile sur une ligne qui défile */
@media(max-width:768px){.chips{flex-wrap:nowrap;overflow-x:auto;padding-bottom:4px;-webkit-overflow-scrolling:touch}.chip{flex:none}.chips-l{width:auto;flex:none;margin:0 2px 0 6px}}
/* D8 bandeaux avec bouton à droite */
.flash-act{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}
.flash-act>span{flex:1;min-width:0;display:flex;align-items:center;gap:8px}
.flash-act>svg{flex:none}
.flash-act .btn{height:40px;background:#fff}
/* D9 */
.status-seg{margin-top:16px}
/* §4.7 numéro du document insécable */
.doc-no{white-space:nowrap}
@media(max-width:768px){.st-bar span small{display:none}}
/* m4 (QC) : barre « Classer » du stock alignée en mobile (bouton = hauteur du sélecteur) */
@media(max-width:768px){.bulk-bar button{height:40px;min-height:40px}}

/* m2 : message clavier du groupe Statut */
.seg-live{display:block;margin-top:6px;font-size:13px;font-weight:600;color:#5c4300}
.seg-live:empty{display:none}
/* m1 : confirmation avant « annulé » */
dialog.confirm-dlg{border:0;border-radius:var(--r);padding:24px;max-width:520px;width:calc(100% - 32px);box-shadow:0 20px 60px #0004;color:var(--text)}
dialog.confirm-dlg::backdrop{background:#1118}
dialog.confirm-dlg h2{margin:0 0 12px;font-size:22px;line-height:28px}
dialog.confirm-dlg p{margin:0 0 10px;font-size:15px;line-height:22px}
dialog.confirm-dlg .dlg-stock{background:#fff4d6;border:1px solid #f0d58a;border-radius:var(--r-sm);padding:10px 12px;color:#5c4300}
.dlg-actions{display:flex;justify-content:flex-end;gap:10px;margin-top:18px;flex-wrap:wrap}
.dlg-actions button{height:44px;padding:0 18px}
@media(max-width:768px){.dlg-actions{flex-direction:column-reverse}.dlg-actions button{width:100%}}
dialog.confirm-dlg button.danger{background:var(--red);color:#fff;border-color:var(--red)}

/* M10 + 14:05 : blocs listés du tableau de bord — 12 lignes de données visibles, défilement interne au-delà (rien n'est tronqué côté serveur) */
.dash-scroll{max-height:var(--dash-rows-h,600px);overflow:hidden;overscroll-behavior:auto;border-top:1px solid var(--line);border-bottom:1px solid var(--line);scrollbar-width:none;-webkit-overflow-scrolling:auto}
.dash-scroll:focus-visible{outline:2px solid var(--black);outline-offset:2px}
.dash-scroll table{margin:0}
.dash-scroll thead th,.dash-scroll tr:first-child th{position:sticky;top:0;z-index:2;background:#fff}
.dash-more{margin:10px 0 0;font-size:13.5px}.dash-more a{font-weight:600;color:var(--text)}
@media(max-width:768px){.dash-scroll{--dash-rows-h:500px}}   /* lignes plus hautes au téléphone (≈ 78 px) : ≈ 6 lignes */
/* défilement vertical et horizontal sur .dash-scroll (pas sur le tableau) : en-tête sticky et 1re colonne sticky restent possibles au téléphone */
.dash-scroll table.list,.dash-scroll table{display:table;width:max-content;min-width:100%;max-width:none;overflow:visible}

/* Correction 08:05 (1) : logo d'écran recadré côté serveur (/logo-ecran.png) ; le dessin remplit la hauteur de la barre */
.tb-brand img{width:auto;max-width:240px;object-fit:contain}
#top-nav .brand img{width:auto;max-width:140px;object-fit:contain}

/* Correction 08:05 (2) : « Stock bas » — noms longs en ellipse (nom complet en infobulle), quantité toujours visible, pas de débordement */
.card.dash-low{min-width:0;overflow:hidden}
.card.dash-low table{display:table!important;table-layout:fixed;width:100%;max-width:100%;overflow:visible}
.card.dash-low td{white-space:nowrap!important;overflow:hidden;text-overflow:ellipsis;vertical-align:middle}
.card.dash-low td:first-child a{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.card.dash-low td.late{width:9.5em;text-align:right;font-variant-numeric:tabular-nums}

/* Correction 08:05 (4) : lignes d'ordre/facture — champ quantité et bouton ✓ de même hauteur (32 px), champ compact */
.doc-lines .qty-cell input[name=qty]{height:32px!important;min-height:32px!important;max-height:32px;line-height:30px!important;padding:0 6px!important;box-sizing:border-box}
.doc-lines .qty-form .qty-ok-btn{width:32px!important;height:32px!important;min-width:32px!important;min-height:32px!important;max-height:32px}

/* Correction 08:05 (bonus) : Paramètres, sélecteur du logo aligné sur « Envoyer le logo » (ordinateur) */
@media(min-width:769px){form.actions>input[type=file]{height:40px;padding:6px 8px;line-height:26px;box-sizing:border-box;align-self:center}form.actions>input[type=file]~button{align-self:center;margin-top:0;margin-bottom:0}}

/* 15:15 : toutes les pages authentifiées — toute la largeur disponible dès 769 px ; mobile inchangé.
   Listes et tableaux utilisent la largeur. Pages à plusieurs cartes (paramètres, compte, utilisateurs) : 2 colonnes dès 1920 px.
   Le tableau de bord : grille 3 colonnes identique dès 1280 px (1650). Champs de formulaire : colonnes auto, lisibles. */
@media(min-width:769px){main{max-width:none;width:auto;box-sizing:border-box}}
@media(min-width:1920px){
  main{padding-left:48px;padding-right:48px}
  body.page-dash .dash-lists{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:24px;align-items:stretch}
  body.page-dash .dash-lists>.dash-cols{display:contents}
  body.page-dash .dash-lists>.card{margin-bottom:0;min-width:0}
  body.page-cards main{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 24px;align-items:start}
  body.page-cards main>.card{min-width:0;overflow-x:auto}
  body.page-cards main>:not(.card){grid-column:1/-1}
  body.page-cards main>.card.wide{grid-column:1/-1}
  main .grid{grid-template-columns:repeat(auto-fill,minmax(260px,1fr))}
}
@media(min-width:2560px){
  main{padding-left:56px;padding-right:56px}
  body.page-cards main{column-gap:28px}
}


/* 15:35 : pas de barre de défilement horizontale dans les blocs listés du tableau de bord
   (Ordres en cours, Rendez-vous, Services à venir, Stock bas, Échéances en retard, Services à prévoir)
   aux largeurs 1280, 1440, 1600, 1920×1080, 2560 et 3840.
   Tableaux calés à 100 % (table-layout:fixed), dates et n°+icône jamais tronqués (largeur fixe, nowrap),
   ellipse sur client / véhicule / mécanicien, pastilles compactes, colonne rappel qui s'ajuste sans chevauchement,
   colonnes secondaires masquées dans une carte étroite (container queries),
   « Services à prévoir » et « Ordres en cours » plus larges dès 1920 px.
   Défilement vertical 12/6, en-tête sticky, couleurs et mobile inchangés. */
.page-dash .dash-lists .card{container-type:inline-size;container-name:dashcard}
@media(min-width:769px){
  .dash-scroll{overflow-x:hidden;overflow-y:hidden}
  .dash-scroll table.list,.dash-scroll table{display:table;width:100%;max-width:100%;min-width:0;table-layout:fixed}
  .dash-scroll th,.dash-scroll td{overflow:hidden;text-overflow:ellipsis;vertical-align:middle;box-sizing:border-box}
  .dash-scroll td{white-space:nowrap}
  .dash-cols .card td:first-child{overflow:hidden;text-overflow:ellipsis}
  .dash-scroll .tag{padding:1px 6px 1px 5px;font-size:12px;max-width:100%;overflow:hidden;text-overflow:ellipsis;box-sizing:border-box;display:inline-block;vertical-align:middle}
  .dash-scroll .plate{max-width:100%;overflow:hidden;text-overflow:ellipsis}
  .dash-scroll .col-client,.dash-scroll .col-title,.dash-scroll .col-veh,.dash-scroll .col-mech{overflow:hidden;text-overflow:ellipsis;min-width:0}
  /* dates, n° + icône PDF, montants : largeur fixe, nowrap, jamais d'ellipse (les colonnes client/véhicule cèdent) */
  .dash-scroll th.col-due,.dash-scroll td.col-due,
  .dash-scroll th.col-last,.dash-scroll td.col-last,
  .dash-scroll th.col-when,.dash-scroll td.col-when,
  .dash-scroll th.col-amt,.dash-scroll td.col-amt,
  .dash-scroll th.col-num,.dash-scroll td.col-num,
  .dash-scroll th.col-status,.dash-scroll td.col-status{overflow:hidden;text-overflow:clip;white-space:nowrap}
  .dash-orders table td.col-num{width:14rem}
  .dash-orders table td.col-plate{width:7.2rem}
  .dash-orders table td.col-status{width:10.5rem}
  .dash-orders table td.col-mech,.dash-cols .card td.col-mech{width:10rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0}
  .late-card table .col-num{width:10.5rem}
  .late-card table .col-due{width:8.5rem}
  .late-card table .col-amt{width:8.5rem}
  .late-card table .col-client{min-width:0}
  .svc-card table .col-due{width:13rem}          /* JJ.MM.AAAA (dépassée) ; rem = pas la police des th */
  .svc-card table .col-last{width:11rem}         /* en-tête « Dernier service » (th uppercase mono) + date */
  .svc-card table .col-num{width:12rem}          /* JS-AAAA-NNNN + icône PDF, sans déborder sur la colonne rappel */
  .svc-card table .col-action{width:14rem;white-space:normal;overflow:hidden;text-overflow:clip;vertical-align:middle}
  .svc-card table .col-client{min-width:10.5rem;width:auto} /* ≥ ~10 caractères avant ellipse */
  .svc-card table .col-veh{min-width:9rem;width:auto}       /* badge « GE 123456 » jamais rogné */
  .svc-card td.col-veh{white-space:normal}
  .svc-card td.col-veh .veh-cell{display:flex;flex-direction:column;align-items:flex-start;gap:2px;min-width:0;max-width:100%}
  .svc-card .dash-scroll .plate{max-width:none;overflow:visible;text-overflow:clip;flex-shrink:0}
  .dash-appts table td.col-when{width:11.5rem;white-space:nowrap;overflow:hidden;text-overflow:clip}
  .dash-appts table td.col-plate{width:7.2rem}
  .dash-reminders table td.col-plate{width:7.2rem}
  .dash-reminders table td.col-due{width:11.5rem;white-space:nowrap;overflow:hidden;text-overflow:clip}
  .svc-card .dash-scroll .small,.svc-card .dash-scroll .btn.small,.svc-card .dash-scroll .svc-sent{max-width:100%;box-sizing:border-box;height:auto;min-height:32px;padding:2px 8px;font-size:12px;white-space:normal;overflow-wrap:anywhere}
}
@container dashcard (max-width: 960px){
  /* À 1024 (carte pleine) et 1400 (carte 2/3), on masque « Dernier service »
     et on raccourcit le bouton pour laisser la place au badge et au client. */
  .svc-card table .col-last{display:none}
  .svc-card .col-client .muted{display:none}
  .svc-card table .col-client{min-width:10.5rem;width:auto}
  .svc-card table .col-veh{min-width:9rem;width:auto}
  .svc-card table .col-due{width:8.2rem}
  .svc-card table .col-num{width:11.2rem;min-width:11.2rem}
  .svc-card table .col-action{width:7.2rem}
  .svc-card .svc-send-full{display:none}
  .svc-card .svc-send-short{display:inline}
}
@container dashcard (max-width: 800px){
  .dash-scroll .col-mech{display:none}
  .dash-orders table td.col-num{width:12.8rem}
  .dash-orders table td.col-plate{width:6.8rem}
  .dash-orders table td.col-status{width:9.8rem}
}
@container dashcard (max-width: 740px){
  .dash-scroll .col-last{display:none}
  .svc-card .col-client .muted{display:none}
  .svc-card table .col-due{width:8.2rem}
  .svc-card table .col-num{width:11.2rem;min-width:11.2rem}
  .svc-card table .col-action{width:7.2rem}
}
@container dashcard (max-width: 540px){
  .dash-orders table td.col-num{width:12.8rem}
  .dash-orders table td.col-plate{width:6.8rem}
  .dash-orders table td.col-status{width:9.8rem}
}



/* 16:50 : grille du tableau de bord — 3 colonnes identiques à toutes les largeurs
   desktop (≥1280). Les blocs s'élargissent en pleine largeur (pas de 4e colonne à
   2560/3840, pas de max-width, pas de vide à droite). Ligne A toujours affichée.
   Ligne A : Échéances (1) + Services à prévoir (2)
   Ligne B : Ordres en cours (2) + Stock bas (1)
   Ligne C : Rendez-vous + Services à venir + Top 5 clients
   Hauteurs égales dans chaque rangée. Mobile ≤768 : une colonne. */
@media(min-width:1280px){
  body.page-dash .dash-lists{
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    grid-template-areas:
      "late svc svc"
      "orders orders low"
      "appts reminders top";
    gap:24px;
    align-items:stretch;
    width:100%;
    max-width:none;
    box-sizing:border-box;
  }
  body.page-dash .dash-lists>.dash-cols{display:contents}
  body.page-dash .dash-lists .card{margin-bottom:0;min-width:0;height:100%;display:flex;flex-direction:column}
  body.page-dash .dash-lists .card .dash-scroll{flex:1 1 auto;min-height:0}
  body.page-dash .dash-lists .late-card{grid-area:late}
  body.page-dash .dash-lists .svc-card{grid-area:svc}
  body.page-dash .dash-lists .dash-orders{grid-area:orders}
  body.page-dash .dash-lists .dash-low{grid-area:low}
  body.page-dash .dash-lists .dash-appts{grid-area:appts}
  body.page-dash .dash-lists .dash-reminders{grid-area:reminders}
  body.page-dash .dash-lists .st-top{grid-area:top}
}
/* Cartes étroites à 1280 (1/3 de colonne ≈ 350 px) : masquer les colonnes secondaires,
   dates / n° / montants restent visibles, pas de barre horizontale. */
@container dashcard (max-width: 420px){
  .dash-appts table td.col-plate{display:none}
  .dash-reminders table td.col-plate{display:none}
}
/* Case étroite : masquer le client à 1280/1400 (case mesurée ≈ 357 / 397 px),
   le garder à 1920 (case mesurée ≈ 557 px). Seuil : 500 px. */
@container dashcard (max-width: 500px){
  .late-card table th.col-client,
  .late-card table td.col-client{display:none!important}
  .late-card table.list,
  .late-card table{table-layout:fixed;width:100%}
  .late-card table .col-num{width:auto;overflow:hidden;white-space:nowrap}
  .late-card table .col-pdf{width:40px!important;min-width:40px!important;max-width:40px!important;padding-left:0!important;padding-right:0!important}
  .late-card table .col-due{width:6.2rem!important}
  .late-card table .col-amt{width:5rem!important}
}
/* Case ≈ 557 px (1/3 de colonne à 1920) : le client redevient visible.
   On serre n° / échéance / montant pour lui laisser au moins ~10 caractères. */
@container dashcard (min-width: 501px) and (max-width: 700px){
  .late-card table.list,
  .late-card table{table-layout:fixed;width:100%}
  .late-card table .col-num{width:9rem;min-width:8.8rem;overflow:hidden;white-space:nowrap}
  .late-card table .col-pdf{width:44px!important;min-width:44px!important;max-width:44px!important;padding-left:0!important;padding-right:0!important}
  .late-card table .col-client{min-width:7.5rem;width:auto}
  .late-card table .col-due{width:6.2rem!important;min-width:6rem}
  .late-card table .col-amt{width:5.2rem!important;min-width:5rem}
}
/* ~350 px (1/3 de colonne à 1280) : dates et montants un peu plus compacts,
   pour que le n° tienne en entier à côté de l'icône. */
@container dashcard (max-width: 380px){
  .late-card table th,
  .late-card table td{padding-left:4px;padding-right:4px}
  .late-card table .col-num{font-size:12.5px;letter-spacing:-.02em}
  .late-card table .col-due,
  .late-card table .col-amt{font-size:12.5px;font-variant-numeric:tabular-nums}
  .late-card table .col-due{width:5.4rem!important}
  .late-card table .col-amt{width:4.2rem!important}
  .late-card table thead th.col-due,
  .late-card table thead th.col-amt{font-size:11px;letter-spacing:0}
}

/* 16:15 : mêmes blocs statistiques pour tous les rôles ; les montants admin
   sont remplacés par « réservé à l'admin » (le cadrage ne bouge pas). */
.st-num.st-reserved{font-size:28px;line-height:1.2;letter-spacing:-.02em;white-space:normal;color:var(--text-2);font-weight:700;margin-top:14px}
.st-card b.st-reserved,.st-card .st-reserved{color:var(--text-2);font-weight:600;font-size:18px;letter-spacing:0}
.st-bars-reserved{position:relative}
.st-bars-reserved .st-bar i{height:12%;background:var(--line);min-height:4px}
.st-bars-reserved .st-bar em{visibility:hidden}
.st-reserved-label{position:absolute;inset:0 0 22px;display:flex;align-items:center;justify-content:center;color:var(--text-2);font-weight:600;font-size:16px;pointer-events:none;text-align:center;padding:8px}
.card.st-top .st-reserved{min-height:11em;display:flex;align-items:center;justify-content:center;color:var(--text-2);font-weight:600;margin:12px 0;text-align:center}

/* 16:15 : indice de zoom des visionneuses — doigts au tactile, Ctrl + molette sur ordinateur */
.pv-zoom-touch{display:none}
.pv-zoom-pc{display:inline}
@media (hover: none) and (pointer: coarse){
  .pv-zoom-touch{display:inline}
  .pv-zoom-pc{display:none}
}

/* 1645 — listes à actions : colonnes alignées d'une ligne à l'autre
   flèches | nom (flex) | Renommer | nombre d'articles (largeur fixe, à droite) | Supprimer */
ul.cat-list > li,
ul.cat-list > li.cat-row{
  display:grid;
  grid-template-columns:auto minmax(0,1fr) auto 8.5rem auto;
  align-items:center;
  column-gap:8px;
  row-gap:6px;
}
ul.cat-list .cat-ren{
  display:block;
  min-width:0;
  width:auto;
  margin:0!important;
}
ul.cat-list .cat-renbtn{white-space:nowrap;justify-self:start}
ul.cat-list .cat-n{
  display:block;
  box-sizing:border-box;
  width:8.5rem;
  min-width:8.5rem;
  max-width:8.5rem;
  text-align:right;
  white-space:nowrap;
  font-variant-numeric:tabular-nums;
  margin-left:0;
}
ul.cat-list .cat-delbtn{white-space:nowrap;justify-self:start}
.late-card .st-reserved{min-height:4em;display:flex;align-items:center;justify-content:center;margin:12px 0;text-align:center}
@media(max-width:700px){
  /* 1720 : « Renommer » ne partage plus une piste 1fr trop étroite avec le compteur (chevauchement à 360–390 px). */
  ul.cat-list > li,
  ul.cat-list > li.cat-row{
    grid-template-columns:auto minmax(0,1fr) auto;
    grid-template-areas:
      "pos name name"
      "pos rename rename"
      "pos count del";
  }
  ul.cat-list .cat-pos{grid-area:pos;align-self:center}
  ul.cat-list .cat-ren{grid-area:name}
  ul.cat-list .cat-renbtn{grid-area:rename;justify-self:start;min-width:max-content}
  ul.cat-list .cat-n{grid-area:count;width:auto;min-width:7rem;max-width:none;justify-self:end}
  ul.cat-list .cat-delbtn{grid-area:del;justify-self:start}
}

/* 2040 : au téléphone, chaque bloc listé du tableau de bord défile horizontalement au doigt
   si le tableau est plus large que l'écran (overflow-x:auto, -webkit-overflow-scrolling:touch).
   La page ne défile pas latéralement (overscroll-behavior:contain) ; le défilement vertical 6 lignes est conservé.
   Couleurs et disposition des cartes inchangées. Ordinateur (≥769 px) : inchangé (1535/1650, overflow-x:hidden). */
@media(max-width:768px){
  body.page-dash .dash-lists .dash-scroll{
    overflow-x:hidden;overflow-y:hidden;-webkit-overflow-scrolling:auto;
    overscroll-behavior:auto;touch-action:auto;
  }
  body.page-dash .dash-lists .dash-scroll table.list,
  body.page-dash .dash-lists .dash-scroll table{
    display:table!important;width:max-content!important;min-width:100%!important;max-width:none!important;table-layout:auto!important;
  }
  body.page-dash .dash-lists .dash-scroll th,
  body.page-dash .dash-lists .dash-scroll td{overflow:visible;box-sizing:border-box;max-width:none;white-space:nowrap}
  body.page-dash .dash-lists .dash-scroll th:first-child,
  body.page-dash .dash-lists .dash-scroll td:first-child{position:sticky;left:0;z-index:1;background:#fff}
  body.page-dash .dash-lists .dash-scroll thead th:first-child,
  body.page-dash .dash-lists .dash-scroll tr:first-child th:first-child{z-index:3}
  body.page-dash .card.dash-low{overflow:visible}
  body.page-dash .card.dash-low table{table-layout:auto!important;width:max-content!important;max-width:none!important}
  body.page-dash .card.dash-low td,
  body.page-dash .card.dash-low td:first-child a{overflow:visible;text-overflow:clip}
}

/* 1640 : même mise en page verrouillée / édition, champs désactivés légèrement grisés */
.svc-form.is-locked input:disabled,
.svc-form.is-locked select:disabled,
.svc-form.is-locked textarea:disabled,
form.grid.is-locked input:disabled,
form.grid.is-locked select:disabled,
form.grid.is-locked textarea:disabled,
.qty-form.is-locked input:disabled,
.qty-form.is-locked button:disabled,
.line-del.is-locked button:disabled,
.line-adds.is-locked input:disabled,
.line-adds.is-locked select:disabled,
.line-adds.is-locked button:disabled{
  background:#f3f3f3;
  color:#444;
  opacity:.9;
  cursor:default;
}
.ph-1640{visibility:hidden;pointer-events:none}

/* Correctif visuel 15.11.2026 : un champ e-mail doit afficher les caractères, jamais des points. */
input[type="email"],
input[name="email"],
input[name="garage_email"],
input[name$="_email"]{
  -webkit-text-security:none!important;
  text-security:none!important;
  font-family:inherit!important;
}
/* /utilisateurs : nom et rôle alignés ; Modifier dans une colonne dédiée, sans débordement */
.users-wrap{overflow-x:auto;max-width:100%}
.users-row{display:flex;align-items:center;gap:8px;flex-wrap:wrap;min-height:40px}
.users-row .users-name,.users-row .users-role{min-width:0}
.users th:last-child,.users td:last-child{width:1%;vertical-align:middle;text-align:left}
.users td:last-child .users-edit-btn{white-space:nowrap}
.users td:last-child form.inline{
  display:flex;flex-direction:column;align-items:flex-start;gap:6px;white-space:normal;
}
.users td:last-child form.inline button,
.users td:last-child form.inline .btn{width:auto;max-width:max-content;align-self:flex-start}

.users .users-edit-btn{min-width:7.5em;width:auto;white-space:nowrap;flex:none}
@media(min-width:769px){
  table.list.users{display:table;width:100%;max-width:100%}
  .users-row{flex-wrap:nowrap}
  .users-row .users-name{width:150px;flex:none;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .users-row .users-role{width:125px;flex:none;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  /* Annule le nowrap C13 : une ligne « Modifier » ouverte ne doit pas élargir le tableau */
  .users form.inline.uform{flex-wrap:wrap}
  .users td:nth-child(5) .uform,.users td:last-child form{flex-wrap:wrap}
}
/* Alias : class "ghost" sans préfixe btn (pages e-mail 2FA) */
button.ghost,.ghost{background:#fff;color:var(--black);border:2px solid var(--line-2)}
button.ghost:hover,.ghost:hover{background:var(--grey);color:var(--black)}
/* Lien « Gérer mon adresse » : une seule ligne */
.users td:nth-child(3) a{white-space:nowrap}
/* Mobile : lignes en cartes, actions visibles sans défilement horizontal */
@media(max-width:768px){
  .users-wrap{overflow:visible}
  .card table.list.users,
  table.list.users{
    display:block!important;
    overflow:visible!important;
    width:100%!important;
    max-width:100%!important;
  }
  .users tr:has(th){display:none}
  .users tr{
    display:grid;
    grid-template-columns:minmax(0,1fr) auto;
    gap:4px 10px;
    padding:12px 0;
    border-bottom:1px solid var(--line);
    width:100%;
    box-sizing:border-box;
  }
  .users td,.users th{
    display:block!important;
    border:0!important;
    padding:0!important;
    white-space:normal!important;
    width:auto!important;
    max-width:none!important;
    position:static!important;
    background:none!important;
    box-shadow:none!important;
  }
  .users td:nth-child(1){grid-column:1;font-weight:600}
  .users td:nth-child(2),
  .users td:nth-child(3),
  .users td:nth-child(4),
  .users td:nth-child(5){grid-column:1}
  .users td:nth-child(3),
  .users td:nth-child(4){color:var(--text-2);font-size:13px}
  .users td:last-child{
    grid-column:2;
    grid-row:1 / span 8;
    display:flex!important;
    flex-direction:column;
    align-items:flex-end;
    justify-content:flex-start;
    gap:8px;
    white-space:nowrap!important;
  }
  .users form.inline.uform,
  .users form.inline{
    display:flex;
    flex-wrap:wrap;
    gap:6px;
    align-items:center;
  }
  .users form.inline.uform input[name=full_name],
  .users form.inline.uform select,
  .users form.inline.uform>span,
  .users form.inline.uform input[type=password]{
    width:auto;
    max-width:100%;
    flex:1 1 8em;
  }
  .users-row .users-name,.users-row .users-role{width:auto;overflow:visible;white-space:normal}
  .users-row .users-edit-btn,
  .users .users-edit-btn,
  .users button.small,
  .users a.btn.small{width:auto!important;max-width:max-content;align-self:flex-start;white-space:nowrap}
}


/* audit 16.11 lot A : n°1 pastille facture, n°2 lignes, n°3 listes devis/factures, n°4 stock */
h1.doc-h{display:flex;flex-wrap:wrap;align-items:center;column-gap:8px;row-gap:8px}
h1.doc-h .doc-h-title{min-width:0}
h1.doc-h .tag{margin-left:0;vertical-align:middle;letter-spacing:0}
.status-sel{max-width:100%;text-overflow:ellipsis}
@media(max-width:768px){
  table.list.doc-lines,table.list.doc-lines tbody{display:block;width:100%}
  table.list.doc-lines tr:has(th){display:none}
  table.list.doc-lines tr.line-row{
    display:flex;flex-wrap:wrap;align-items:flex-end;gap:8px;position:relative;
    padding:12px 48px 12px 0;border-bottom:1px solid var(--line);box-sizing:border-box;
    width:100%;max-width:100%;overflow:hidden
  }
  table.list.doc-lines tr.line-row>td{
    border:0!important;padding:0!important;white-space:normal!important;
    background:none!important;box-shadow:none!important;position:static;width:auto;min-width:0
  }
  /* Désignation seule sur toute la largeur, puis qté / prix / rabais / montant. */
  table.list.doc-lines tr.line-row>td.line-desc{flex:1 1 100%;width:100%;max-width:100%;min-width:0;font-weight:600;order:1}
  table.list.doc-lines tr.line-row>td.line-desc input.line-desc-in{display:block;width:100%!important;max-width:100%!important;min-width:0!important;box-sizing:border-box}
  table.list.doc-lines tr.line-row>td.line-kind{flex:1 1 100%;width:100%;color:var(--text-2);font-size:12.5px;order:2}
  table.list.doc-lines tr.line-row>td.line-qty,
  table.list.doc-lines tr.line-row>td.line-price,
  table.list.doc-lines tr.line-row>td.line-disc{
    flex:1 1 0;min-width:0;order:3;display:flex;flex-direction:column;align-items:stretch;gap:2px;
    font-variant-numeric:tabular-nums
  }
  table.list.doc-lines tr.line-row>td.line-amt{flex:1 1 100%;width:100%;max-width:100%;order:4;font-variant-numeric:tabular-nums;white-space:nowrap!important;text-align:right;padding-top:0!important}
  table.list.doc-lines tr.line-row>td.line-qty::before{content:"Qté";color:var(--text-2);font-size:11px;font-weight:600;line-height:1.2}
  table.list.doc-lines tr.line-row>td.line-price::before{content:"Prix";color:var(--text-2);font-size:11px;font-weight:600;line-height:1.2}
  table.list.doc-lines tr.line-row>td.line-disc::before{content:"Rabais %";color:var(--text-2);font-size:11px;font-weight:600;line-height:1.2}
  table.list.doc-lines tr.line-row>td.line-amt::before{content:"= ";color:var(--text-2)}
  table.list.doc-lines tr.line-row>td.line-qty .qty-form,
  table.list.doc-lines tr.line-row>td.line-qty input,
  table.list.doc-lines tr.line-row>td.line-price input,
  table.list.doc-lines tr.line-row>td.line-disc input{
    width:100%!important;max-width:100%!important;min-width:0!important;box-sizing:border-box
  }
  table.list.doc-lines tr.line-row>td.line-del-cell{
    position:absolute!important;right:0;top:8px;transform:none;
    width:40px;height:40px;display:flex;align-items:center;justify-content:center;padding:0!important
  }
  table.list.doc-lines tr.line-row>td.line-del-cell button,
  table.list.doc-lines tr.line-row>td.line-del-cell button.small{
    min-width:40px!important;min-height:40px!important;width:40px!important;height:40px!important;margin:0;padding:0!important;
    display:inline-grid;place-items:center
  }
  table.stock-table{width:100%;max-width:100%;table-layout:fixed}
  table.stock-table th:nth-child(4),table.stock-table td:nth-child(4),
  table.stock-table th:nth-child(7),table.stock-table td:nth-child(7),
  table.stock-table th:nth-child(8),table.stock-table td:nth-child(8){display:none}
  table.stock-table th,table.stock-table td{white-space:normal}
  table.stock-table th:nth-child(1),table.stock-table td:nth-child(1),
  table.stock-table th.ck,table.stock-table td.ck{width:36px;padding-left:6px;padding-right:4px}
  table.stock-table th:nth-child(2),table.stock-table td:nth-child(2){width:96px;overflow-wrap:anywhere;word-break:break-word}
  table.stock-table th:nth-child(5),table.stock-table td:nth-child(5),
  table.stock-table td.qty-cell{width:72px}
  table.stock-table th:nth-child(6),table.stock-table td:nth-child(6){width:44px}
  table.stock-table .name-cell{padding-right:6px;overflow:visible}
  table.stock-table .name-cell .lowmark{position:static;top:auto;right:auto;margin-right:6px;display:inline}
  table.stock-table .name-cell .lowmark[hidden]{display:none}
}


/* ========== lots B+C (audit Design 16.11, au-dessus du lot A) ========== */
/* #11 #33 : hauteur commune des champs et boutons (48 px mobile / 40 px desktop) */
input:not([type=checkbox]):not([type=radio]):not([type=hidden]):not([type=file]):not([type=image]),
select,
button:not(.small):not(.link):not(.nav-toggle):not(.tab-a):not(.mv):not(.sw-retry),
.btn, a.btn{
  min-height:var(--ctl-h);
  box-sizing:border-box;
}
/* #24 #33 : cibles tactiles 40×40 (🗑, 🖨, Annuler, ✕) */
a.pdf-ico, a.del-link, .line-del button, .line-del button.small, a.oc-pdf,
#unsaved-banner .unsaved-actions a[data-unsaved-cancel],
#unsaved-banner .unsaved-actions .btn{
  min-width:40px!important;min-height:40px!important;
  display:inline-flex;align-items:center;justify-content:center;
  box-sizing:border-box;
}
@media(max-width:768px){
  .line-del button, .line-del button.small{
    width:40px!important;height:40px!important;padding:0!important;
  }
}

/* #8 : Déconnexion lisible, 48 px, en dernier dans le tiroir ouvert */
@media(max-width:768px){
  #top-nav.js-nav.open a.nav-acc{order:98}
  #top-nav.js-nav.open form.logout-form,
  #top-nav.js-nav.open form.logout-form.nav-acc{
    display:block!important;
    order:99;
    width:100%;
    margin:8px 0 4px;
    grid-column:1/-1;
  }
  #top-nav.js-nav.open form.logout-form button,
  #top-nav.js-nav.open form.logout-form.nav-acc button{
    display:flex!important;
    align-items:center;
    justify-content:center;
    width:100%;
    min-height:48px;
    height:48px;
    color:#f4f4f4!important;
    background:transparent!important;
    border:1px solid #f4f4f4!important;
    border-radius:8px;
    font-size:16px;
    font-weight:600;
    padding:12px 14px;
    cursor:pointer;
  }
}

/* #9 : bandeau sous l'en-tête, une ligne 48 px au téléphone */
@media(max-width:768px){
  #unsaved-banner{
    position:sticky;
    top:var(--topnav-h,62px);
    z-index:55;
    min-height:48px;
    height:48px;
    flex-wrap:nowrap!important;
    align-items:center;
    gap:8px;
    padding:4px 8px;
    margin:0 0 12px;
    overflow:hidden;
  }
  #unsaved-banner>span:first-child{
    flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:13px;line-height:16px;
  }
  #unsaved-banner .unsaved-actions{flex:none;flex-wrap:nowrap;gap:6px}
  #unsaved-banner .unsaved-actions button,
  #unsaved-banner .unsaved-actions .btn,
  #unsaved-banner .unsaved-actions a{
    width:auto!important;min-width:40px;height:40px;min-height:40px;padding:0 10px;font-size:13px;flex:none;
  }
}

/* #12 : tableau véhicules de la fiche client */
.veh-table-wrap{overflow-x:auto;-webkit-overflow-scrolling:touch;max-width:100%}
.veh-table{min-width:100%}
td.veh-acts,th.veh-acts{font-size:14px;white-space:nowrap}
td.veh-acts{display:flex;flex-wrap:nowrap;gap:8px;align-items:center}
td.veh-acts a{display:inline;font-size:14px;line-height:22px;white-space:nowrap}
@media(max-width:1365px){
  .veh-table .col-recep{display:none}
}

/* #13 : 16 px entre Total TTC et les formulaires d'ajout */
.totals-m + .line-adds, table.lines + .line-adds, .line-adds{margin-top:16px}

/* #16 : listes du tableau de bord en cartes 2 lignes au téléphone (bureau inchangé) */
.dash-mlist{display:none;list-style:none;margin:0;padding:0}
.dash-mlist li{padding:10px 0;border-bottom:1px solid var(--line)}
.dash-mlist li:last-child{border-bottom:0}
.dash-mlist .dm-l1,.dash-mlist .dm-l2{display:block;min-width:0}
.dash-mlist .dm-l1{font-weight:600}
.dash-mlist .dm-l2{font-size:13px;color:var(--text-2);margin-top:2px}
.dash-mlist .dm-client,.dash-mlist .dm-l1,.dash-mlist .dm-l2{
  overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;white-space:normal;
}
@media(max-width:768px){
  body.page-dash .dash-lists .dash-scroll table.dash-dtable,
  body.page-dash .dash-lists .dash-scroll table.list.dash-dtable,
  body.page-dash .dash-lists .dash-scroll table,
  .dash-scroll table.dash-dtable,
  .card.dash-low table.dash-dtable,
  .card.dash-low table{
    display:none!important;
  }
  .dash-mlist{display:block!important}
}

/* #17 : agenda, 3 boutons semaine sur une rangée + snap */
.agenda-week-nav{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
.agenda-week-nav .aw-row{display:flex;gap:8px;flex:1 1 100%}
@media(max-width:768px){
  .agenda-week-nav{flex-wrap:wrap;overflow:visible}
  .agenda-week-nav .aw-row{flex:1 1 100%;flex-wrap:nowrap}
  .agenda-week-nav .aw-row a.btn,
  .agenda-week-nav .aw-row a.btn-ghost{
    width:auto!important;flex:0 0 auto;min-width:auto;min-height:48px;height:48px;padding:0 12px;font-size:14px;
    overflow:visible;white-space:nowrap
  }
  .agenda-week-nav .aw-row a.btn[href="?"]{flex:1 1 auto;min-width:max-content;padding:0 14px}
  .agenda-week-nav > a.btn{width:100%;min-height:48px;height:48px}
  .agenda-week-nav .aw-full{display:none}
}
.agenda-scroll{scroll-snap-type:x mandatory;-webkit-overflow-scrolling:touch}
.agenda-day-header,.agenda-day-column{scroll-snap-align:start}
.agenda-help{margin:0 0 12px}
.agenda-help summary{cursor:pointer;font-weight:600}

/* #18 : cartes utilisateurs au téléphone */
.users-cards{display:none}
@media(max-width:768px){
  /* Lot E : masquer la carte vide du tableau (le contenu passe dans .users-cards) */
  .users-wrap{display:none!important;margin:0;padding:0;border:0;height:0;overflow:hidden}
  body.page-cards .users-wrap table.list.users,
  .users-wrap table.list.users,
  .users-wrap>table.users{
    display:none!important;
  }
  .users-cards{display:block!important}
  .ucard{background:#fff;border:1px solid var(--line);border-radius:var(--r);padding:12px 14px;margin:0 0 10px}
  .ucard .uc-name{font-weight:700;font-size:16px;display:block;width:100%;margin:0 0 6px}
  .ucard .uc-line{display:flex;gap:8px;font-size:14px;margin:4px 0}
  .ucard .uc-line .uc-k{color:var(--text-2);flex:none;min-width:6.5em}
  .ucard details.uc-droits{margin-top:8px}
  .ucard details.uc-droits summary{cursor:pointer;font-weight:600}
}

/* #20 : quantité invalide */
input.qty-err, .qty-in.qty-err, .qty-cell input.qty-err{
  outline:2px solid var(--red);border-color:var(--red);background:#fff5f5;
}

/* #25 : fiche pneus, écart 8 px, Sortie en contour */
.tyre-actions{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin-top:8px}
.tyre-actions .unsaved-submit[disabled],.tyre-actions .unsaved-submit[aria-disabled=true]{opacity:.5}

/* Libellé court du bouton rappel : masqué hors de la case services à largeur moyenne. */
.svc-send-short{display:none}

/* #28 : troncature à 2 lignes sur un élément intérieur.
   Les td restent en table-cell : display:-webkit-box sur la cellule
   cassait l'alignement des colonnes (Services à prévoir, etc.). */
.dash-scroll td.col-client,
.dash-scroll td.col-title,
.dash-scroll td.col-veh{
  display:table-cell;
  overflow:hidden;
  max-width:100%;
  vertical-align:middle;
}
.dash-clamp{
  overflow:hidden;
  display:-webkit-box;
  -webkit-box-orient:vertical;
  -webkit-line-clamp:2;
  white-space:normal;
  max-width:100%;
}

/* #30 : libellés du graphique sous 400 px (initiales, 11 px) */
.st-bar .st-init{display:none}
@media(max-width:400px){
  .st-bars{gap:2px}
  .st-bar span{font-size:11px;line-height:14px;writing-mode:horizontal-tb;transform:none;height:auto;margin-top:4px}
  .st-bar .st-full{display:none}
  .st-bar .st-init{display:inline}
  .st-bar span small{display:none}
}

/* #31 : CHF et montant insécables */
.amt-chf, .oc .m{white-space:nowrap}

/* #38 : listes clients / véhicules en cartes, recherche dans le champ */
.list-search{display:flex;align-items:center;gap:8px;flex:1 1 280px;min-width:0;min-height:var(--ctl-h);height:var(--ctl-h);padding:0 6px 0 12px;background:#fff;border:1px solid var(--line-2);border-radius:10px;margin:0}
.list-search:focus-within{border-color:var(--red);box-shadow:0 0 0 3px #c8102e22}
.list-search svg{width:18px;height:18px;color:var(--text-2);flex:none}
.list-search input{border:0;box-shadow:none!important;padding:0;height:calc(var(--ctl-h) - 8px);min-height:0;flex:1;min-width:0;background:transparent;font-size:15px}
.list-search button, .list-search .btn{
  min-height:40px;height:40px;width:40px;min-width:40px;padding:0;border-radius:8px;flex:none;
}
@media(max-width:768px){
  .list-search{width:100%;flex:1 1 auto;min-height:48px;height:48px}
  .list-search button, .list-search .btn{min-height:48px;height:48px;width:48px;min-width:48px}
  table.list-cards{display:none!important}
  .entity-cards{display:block!important}
  .list-search button,.list-search .btn{width:48px!important;min-width:48px;max-width:48px;height:48px}
}
.entity-cards{display:none}
.ecard{background:#fff;border:1px solid var(--line);border-radius:var(--r);padding:12px 14px;margin:0 0 10px;display:block;text-decoration:none;color:inherit}
.ecard .ec-name{font-weight:700;font-size:16px;display:block;margin:0 0 6px}
.ecard .ec-line{display:flex;gap:8px;font-size:14px;margin:3px 0}
.ecard .ec-k{color:var(--text-2);flex:none;min-width:6em}
.ecard .ec-acts{margin-top:8px}

/* ===== lot D (audit #10 #15 #19 #26 #27) ===== */
button.unsaved-submit, input.unsaved-submit[type=submit]{
  display:inline-flex!important;align-items:center;justify-content:center;
}
button.unsaved-submit[disabled], input.unsaved-submit[disabled],
button.unsaved-submit[aria-disabled=true], input.unsaved-submit[aria-disabled=true]{
  opacity:.5;cursor:not-allowed;
}
/* Lot F : « Lire une carte grise » en bouton plein ; grille 2×2 des 4 actions */
@media(max-width:768px){
  .dash-actions{display:flex;flex-direction:column;align-items:stretch;gap:8px}
  .dash-actions .dash-act-scan{width:100%;min-height:48px;margin:0}
  .dash-actions .dash-act-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px;width:100%}
  .dash-actions .dash-act-primary,
  .dash-actions .dash-act-sec{
    width:100%;min-height:48px;margin:0;
    background:var(--red);color:#fff;border-color:var(--red);
  }
  /* #19 : plus de ☰ Menu dans l'en-tête ; Fermer seulement tiroir ouvert */
  #top-nav.js-nav:not(.open)>.nav-toggle{display:none!important}
  #top-nav.js-nav.open a.nav-tab[data-tab="dashboard"],
  #top-nav.js-nav.open a.nav-tab[data-tab="agenda"],
  #top-nav.js-nav.open a.nav-tab[data-tab="clients"],
  #top-nav.js-nav.open a.nav-tab[data-tab="vehicles"]{display:none!important}
}
@media(min-width:769px){
  .dash-actions .dash-act-scan{display:none}
  .dash-actions .dash-act-grid{display:contents}
  .dash-actions .dash-act-sec{background:var(--red);color:#fff;border-color:var(--red)}
}

/* Lot E : pagination des cases du tableau de bord
   Aucun nouveau style de bouton : on réutilise button.btn.small.danger
   et ico('arrow'). Ajouts : placement, inversion de la flèche précédente,
   verrouillage du survol désactivé, :focus-visible (valeurs déjà dans le
   thème), indicateur « 1/3 ». */
.card-h{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  margin:0 0 12px;
  min-width:0;
}
.card-h > h2{
  margin:0;
  min-width:0;
  flex:1 1 auto;
}
.card-h > h2.h-ico{flex-wrap:nowrap}
.card-h > h2.h-ico > span{min-width:0}
.dash-pager{
  display:flex;
  align-items:center;
  flex-wrap:nowrap;
  gap:8px;
  flex:none;
  margin:0;
  padding:0;
  background:transparent;
  border:0;
  color:inherit;
  position:static;
  width:auto;
  height:auto;
  min-width:0;
  box-shadow:none;
  white-space:nowrap;
}
.dash-pager[hidden]{display:none}
.dash-pager .btn[data-dir="prev"] svg{transform:rotate(180deg)}
.dash-pager .btn:disabled:hover,
.dash-pager .btn[disabled]:hover{
  background:#fff;
  color:var(--red);
  border-color:var(--red);
}
.dash-pager .btn:focus-visible{
  outline:2px solid var(--black);
  outline-offset:2px;
}
.dash-pager-status{
  font:400 13px/20px var(--mono);
  font-variant-numeric:tabular-nums;
  color:var(--text-2);
  min-width:4ch;
  text-align:center;
  white-space:nowrap;
}
/* Plus de barre de défilement interne : une page = 12 lignes (ordinateur)
   ou 6 (smartphone). Conserver .dash-scroll pour les règles de tableau. */
.page-dash .dash-lists .dash-scroll{
  overflow:visible;
  max-height:none;
}

/* Lot F : l'icône 🖨 ne doit pas être coupée. Les règles .dash-scroll overflow:hidden
   plus haut (y compris th/td.col-num) l'emportent sur la règle antérieure ; celle-ci
   vient après, avec une spécificité suffisante. Colonne assez large pour le n° + 40 px. */
@media(min-width:769px){
  .dash-scroll th.col-num,
  .dash-scroll td.col-num{
    overflow:visible!important;
    text-overflow:clip;
    white-space:nowrap;
  }
  .dash-scroll td.col-num a.pdf-ico,
  .dash-scroll a.pdf-ico{
    overflow:visible;
    flex-shrink:0;
    position:relative;
    z-index:1;
  }
  .dash-orders table td.col-num{min-width:12.8rem}
  /* Échéances en retard : icône dans sa propre colonne 44 px, sans déborder sur l'échéance. */
  .late-card .dash-scroll th.col-num,
  .late-card .dash-scroll td.col-num{
    overflow:hidden!important;
    white-space:nowrap;
    text-overflow:ellipsis;
  }
  .late-card .dash-scroll th.col-pdf,
  .late-card .dash-scroll td.col-pdf{
    width:44px!important;
    min-width:44px!important;
    max-width:44px!important;
    padding-left:0;
    padding-right:0;
    overflow:hidden!important;
    text-align:center;
    vertical-align:middle;
    box-sizing:border-box;
  }
  .late-card td.col-pdf a.pdf-ico{
    margin:0 auto;
  }
}

/* Lot F : quantité (et bouton ✓) à 48 px sur mobile, comme les autres champs.
   Les règles 32 px / 28 px !important de theme.css et style.css l'emportent sinon. */
@media(max-width:768px){
  html body .doc-lines .qty-cell input[name=qty],
  html body .doc-lines .qty-cell input.qty-in,
  html body .qty-cell input[name=qty],
  html body .doc-lines input.line-desc-in,
  html body .doc-lines input.line-price-in,
  html body .doc-lines input.line-disc-in{
    height:var(--ctl-h)!important;
    min-height:var(--ctl-h)!important;
    max-height:none;
    line-height:calc(var(--ctl-h) - 2px)!important;
    font-size:16px!important;
    padding:0 8px!important;
    box-sizing:border-box;
  }
  html body .doc-lines .qty-form .qty-ok-btn{
    width:var(--ctl-h)!important;
    height:var(--ctl-h)!important;
    min-width:var(--ctl-h)!important;
    min-height:var(--ctl-h)!important;
    max-height:none;
  }
}
