/* Mise en page écran indépendante des styles A4 d'impression. */
[hidden]{display:none!important}
html{scrollbar-gutter:stable}
body{min-width:0}
main,.shell,.panel,.panelbody,.grid>*,.metrics>*,.cards>*,.formrow>*,label,fieldset{min-width:0}
fieldset{margin:0;max-width:100%}
h1,h2,h3,p,td,.notice,.profile span,.brand span{overflow-wrap:anywhere}
button,input,select,textarea{max-width:100%}
button:disabled{cursor:not-allowed;opacity:.55}
button:focus-visible,a:focus-visible{outline:3px solid #ed1430;outline-offset:3px}
input:not([type=checkbox]):not([type=radio]),select,textarea{width:100%;min-width:0}
input[type=checkbox],input[type=radio]{flex-shrink:0}
input[type=file]{white-space:normal;padding:9px;font-size:12px}
.pagehead>div:first-child{min-width:0}
.pagehead>.formrow{grid-template-columns:repeat(2,minmax(0,1fr));flex-shrink:0;max-width:50%}
.grid{grid-template-columns:minmax(0,1fr) minmax(260px,310px)}
.metrics{grid-template-columns:repeat(4,minmax(0,1fr))}
.cards{grid-template-columns:repeat(3,minmax(0,1fr))}
.tablewrap{max-width:100%;overscroll-behavior-inline:contain}
.responsive-table td{overflow-wrap:anywhere}
.formactions{gap:10px;flex-wrap:wrap}
.formactions button{white-space:normal}
.modalhead{position:sticky;top:0;background:white;z-index:2;gap:15px}
.modalhead h2{min-width:0}
.modalhead button{min-width:44px;min-height:44px;flex-shrink:0}
dialog{box-sizing:border-box;max-height:90dvh;overscroll-behavior:contain;overflow-y:auto}
.photos>div,.photos>a{max-width:100%}
.photos img,.signatureimage{max-width:100%}
.signature{display:block;width:100%;height:180px}
#toast{max-width:min(420px,calc(100vw - 32px));overflow-wrap:anywhere;bottom:max(20px,env(safe-area-inset-bottom))}
.menu-toggle,.menu-close,#menuOverlay{display:none}
.sidebar-top{display:flex;align-items:center;justify-content:space-between;gap:8px}
@media screen and (min-width:1025px) and (max-width:1350px){
 .grid{grid-template-columns:minmax(0,1fr)}
 .rightcol{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:20px}
 .metrics{grid-template-columns:repeat(2,minmax(0,1fr))}
 .pagehead{flex-wrap:wrap}
 .pagehead>.formrow{max-width:100%}
}
@media screen and (max-width:1024px){
 body.menu-open{overflow:hidden}
 aside{position:fixed;inset:0 auto 0 0;width:min(300px,88vw);height:100vh;height:100dvh;padding:20px 16px;z-index:50;transform:translateX(-105%);transition:transform .2s ease;box-shadow:8px 0 35px #24223e30;display:flex;flex-direction:column}
 body.menu-open aside{transform:translateX(0)}
 .menu-toggle,.menu-close{display:inline-flex;align-items:center;justify-content:center;min-width:44px;min-height:44px;padding:9px;flex-shrink:0}
 .menu-close{border:0;font-size:25px}
 #menuOverlay:not([hidden]){display:block;position:fixed;inset:0;border:0;border-radius:0;background:#24223e70;z-index:45;width:100%;height:100%;padding:0}
 .brand img{width:40px}.brand b{font-size:17px}.brand small{font-size:7px}
 aside nav{display:block;overflow-y:auto;overflow-x:hidden;min-height:0;flex:1;margin-top:20px;padding:0 0 15px}
 .navitems{display:block;overflow:visible}
 .navsection{margin-bottom:17px}.navsection+.navsection{padding-top:16px}
 .navsection-title{margin:0 10px 9px}
 nav button{width:100%;white-space:normal;margin:4px 0;padding:11px 12px;font-size:13px;min-height:44px}
 nav svg{display:block}nav button small{font-size:10px}
 .sidebarrole{margin:17px 0 0 8px}
 .asidebottom{display:block;padding-top:17px}
 .shell{margin-left:0}
 .shell>header{height:auto;min-height:72px;gap:14px;padding:12px 24px;display:flex;align-items:center;flex-wrap:wrap}
 .shell>header>.breadcrumb{flex:1;min-width:0;font-size:12px}
 .profile{font-size:12px;margin-left:auto;min-width:0;gap:9px}
 .profile span{max-width:240px}
 .profile button{min-height:44px}
 main{padding:28px 24px;min-height:calc(100dvh - 130px)}
 .grid{grid-template-columns:minmax(0,1fr)}
 .metrics{grid-template-columns:repeat(2,minmax(0,1fr))}
 .rightcol{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px}
 .cards{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}
 .pagehead{flex-wrap:wrap;align-items:flex-start;gap:16px}
 .pagehead>.formrow{max-width:100%}
 button,input:not([type=checkbox]):not([type=radio]),select{min-height:44px}
 input,select,textarea{font-size:16px}
 .orderfacts{grid-template-columns:repeat(2,minmax(0,1fr))}
 footer{padding-left:24px;padding-right:24px;gap:15px;flex-wrap:wrap}
}
@media screen and (max-width:767px){
 .shell>header{padding:10px 16px;gap:10px}
 .profile{flex-basis:100%;justify-content:space-between;margin-left:0;border-top:1px solid var(--line);padding-top:8px;font-size:12px}
 .profile span{max-width:calc(100% - 125px)}
 main{padding:22px 14px}
 h1,.pagehead h1{font-size:25px;line-height:1.3}
 .pagehead>div:first-child{width:100%}
 .pagehead>.formrow{width:100%;max-width:none;grid-template-columns:1fr}
 .pagehead>button{width:100%}
 .pagehead button{font-size:13px}
 .formrow{grid-template-columns:minmax(0,1fr)}
 .metrics{gap:10px}.metric{padding:16px 13px}.metric strong{font-size:28px}
 .metriclabel{gap:8px;line-height:1.5}
 .rightcol,.cards{display:block}
 .panelhead{padding:17px 15px;flex-wrap:wrap}
 .panelbody{padding:16px}
 .toolbar{padding:15px;gap:10px}
 .toolbar>*{width:100%;min-width:0}
 .detailstat{gap:16px;flex-wrap:wrap}
 .timeline{padding-left:12px;margin-left:2px}
 .workflowsteps{display:grid;grid-template-columns:1fr;gap:7px}
 .workflowsteps span{padding:11px;font-size:13px}
 .preparationchecks{padding:15px 12px;gap:16px}
 .preparationchecks label{line-height:1.5}
 .preparationchecks input[type=checkbox]{width:22px;height:22px}
 .photos{gap:10px}
 .photos>div{flex:0 1 calc(50% - 5px);min-width:0}
 .photos img{height:110px;width:100%;max-width:100%;object-fit:cover}
 .photos>a{flex:0 1 calc(50% - 5px)}
 .photos button{width:100%;margin-top:5px}
 .signature{height:175px}
 dialog{width:calc(100vw - 16px);max-width:calc(100vw - 16px);max-height:calc(100vh - 20px);max-height:calc(100dvh - 20px);border-radius:10px;margin:auto}
 .modalhead{padding:12px 14px}.modalhead h2{font-size:16px;line-height:1.4}
 #dialogbody{padding:16px 14px}
 .formactions{flex-direction:column}.formactions button{width:100%}
 .orderrow{grid-template-columns:minmax(0,1fr) 76px 44px;gap:7px}
 .orderrow input,.orderrow select{padding:9px 7px}
 .orderbrand{gap:10px}.orderbrand img{width:42px}
 .orderbrand h2{font-size:14px}
 .orderfacts{grid-template-columns:1fr;gap:10px}
 .loginpanel{width:100%;margin:6px auto}.loginpanel .panelbody{padding:24px 18px}
 /* Les tableaux deviennent des fiches lisibles avec libellés sur téléphone. */
 .responsive-table,.responsive-table tbody{display:block;width:100%}
 .responsive-table thead{position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
 .responsive-table tbody>tr{display:block;padding:8px 14px;border-top:1px solid var(--line);background:white}
 .responsive-table td{display:flex;justify-content:space-between;align-items:flex-start;gap:16px;border:0;padding:9px 0;font-size:13px;min-width:0;flex-wrap:wrap}
 .responsive-table td::before{content:attr(data-label);font-size:11px;color:#777787;font-weight:600;flex:0 0 38%;padding-top:2px;overflow-wrap:anywhere}
 .responsive-table td[data-label=""]::before{display:none}
 .responsive-table td[data-label=""]{justify-content:flex-end}
 .responsive-table td[colspan]{display:block;text-align:center;padding:22px 0}
 .responsive-table td small{max-width:100%;font-size:11px}
 .responsive-table td button{font-size:12px;white-space:normal}
 .responsive-table td .badge{white-space:normal}
 footer{padding:12px 16px 24px;line-height:1.5}
}
@media screen and (max-width:359px){
 .metrics{grid-template-columns:1fr}
 .orderrow{grid-template-columns:minmax(0,1fr) 70px}.orderrow>button{grid-column:1 / -1}
 .responsive-table td{display:block}.responsive-table td::before{display:block;margin-bottom:6px}
}
@media(prefers-reduced-motion:reduce){aside{transition:none}}
@media print{.menu-toggle,.menu-close,#menuOverlay{display:none!important}}

@media screen and (max-width:767px){.responsive-table .cellvalue{flex:1;min-width:0;text-align:right}.responsive-table td[colspan] .cellvalue{text-align:center}.responsive-table .cellvalue button{margin:3px 0 3px 5px}.responsive-table .cellvalue small{font-size:11px;line-height:1.5}.responsive-table td:has(.cellvalue:empty){display:none}}@media screen and (max-width:359px){.responsive-table .cellvalue{text-align:left}}
