:root{--bg:#eef2f6;--card:#fff;--soft:#f7f9fc;--text:#17202b;--muted:#667085;--line:#d8e0e9;--brand:#0f4c81;--brand2:#1769aa;--brandsoft:#eaf3fb;--ok:#16794a;--danger:#b42318;--shadow:0 12px 30px rgba(16,24,40,.08)}
*{box-sizing:border-box}body{margin:0;font-family:Inter,system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;background:linear-gradient(180deg,#f8fafc,var(--bg));color:var(--text)}button,input,select,textarea{font:inherit}.topbar{height:66px;background:rgba(255,255,255,.96);border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;padding:0 22px;position:sticky;top:0;z-index:20}.brand{display:flex;align-items:center;gap:11px}.logo{width:40px;height:40px;border-radius:11px;display:grid;place-items:center;background:linear-gradient(135deg,var(--brand),var(--brand2));color:#fff;font-weight:900}.brand b,.brand span{display:block}.brand span{font-size:12px;color:var(--muted);margin-top:2px}.app{max-width:1480px;margin:auto;padding:20px}.tabs{display:flex;gap:8px;margin-bottom:16px}.tab{border:1px solid var(--line);background:#fff;border-radius:10px;padding:9px 13px;font-weight:800;color:#344054;cursor:pointer}.tab.active{background:var(--brand);color:#fff;border-color:var(--brand)}.layout{display:grid;grid-template-columns:minmax(0,1.15fr) minmax(390px,.85fr);gap:18px;align-items:start}.card{background:var(--card);border:1px solid var(--line);border-radius:16px;box-shadow:var(--shadow);overflow:hidden}.card-head{min-height:58px;padding:14px 18px;border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;gap:12px}.card-head h2{font-size:16px;margin:0}.card-body{padding:18px}.section{border:1px solid var(--line);border-radius:13px;padding:14px;margin-bottom:12px}.section-title{display:flex;align-items:center;gap:8px;font-weight:850;color:#344054;font-size:13px;margin-bottom:12px}.section-title span{width:25px;height:25px;border-radius:7px;background:var(--brandsoft);color:var(--brand);display:grid;place-items:center}.grid3,.grid4{display:grid;gap:10px}.grid3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid4{grid-template-columns:repeat(4,minmax(0,1fr))}label{font-size:12px;color:#475467;font-weight:700}input,select,textarea{width:100%;margin-top:5px;border:1px solid #c9d3df;border-radius:9px;padding:9px 10px;background:#fff;color:#111827}input:focus,select:focus,textarea:focus{outline:none;border-color:var(--brand2);box-shadow:0 0 0 3px rgba(23,105,170,.12)}textarea{min-height:565px;resize:vertical;font-size:12.5px;line-height:1.48;background:#fbfcfe}.gap-top{margin-top:10px}.metrics{display:grid;grid-template-columns:repeat(3,1fr);gap:9px}.metrics>div{border:1px solid var(--line);background:var(--soft);border-radius:10px;padding:11px}.metrics span{display:block;font-size:11px;color:var(--muted)}.metrics b{display:block;font-size:19px;margin-top:4px}.planbox{border:1.5px dashed #b7c6d5;background:#f8fbfe;border-radius:11px;padding:13px;display:flex;align-items:center;justify-content:space-between;gap:12px}.planbox b,.planbox span{display:block}.planbox span{font-size:11px;color:var(--muted);margin-top:3px;max-width:700px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.btn{border:0;border-radius:9px;padding:9px 12px;font-weight:800;cursor:pointer}.primary{background:linear-gradient(135deg,var(--brand),var(--brand2));color:#fff}.secondary,.ghost{background:#eef2f7;color:#273444;border:1px solid var(--line)}.danger{background:#fff0ef;color:var(--danger);border:1px solid #f2c7c3}.footer-actions{display:flex;gap:8px;flex-wrap:wrap}.badge{padding:5px 8px;border-radius:999px;background:var(--brandsoft);color:var(--brand);font-size:11px;font-weight:800}.sticky{position:sticky;top:84px}.hint{padding:10px 12px;background:#eef7ff;border:1px solid #cce1f1;border-radius:10px;color:#3c6079;font-size:11.5px;line-height:1.45}.hidden{display:none!important}.tablewrap{overflow:auto}table{width:100%;border-collapse:collapse;min-width:950px}th,td{text-align:left;padding:10px 9px;border-bottom:1px solid var(--line);font-size:12px}th{font-size:11px;color:#475467;background:#f8fafc}.actions{display:flex;gap:5px;flex-wrap:wrap}.search{max-width:360px;margin:0}.client-form{display:grid;grid-template-columns:1fr 1fr auto;gap:10px;align-items:end}.status{min-height:22px;margin-top:8px;color:var(--ok);font-size:12px}.top-actions{display:flex;gap:8px}@media(max-width:1120px){.layout{grid-template-columns:1fr}.sticky{position:static}.grid4{grid-template-columns:repeat(2,1fr)}}@media(max-width:700px){.app{padding:12px}.grid3,.grid4,.client-form{grid-template-columns:1fr}.topbar{padding:0 12px}.brand span{display:none}.metrics{grid-template-columns:1fr}}

/* Correctifs clients */
.client-form{display:grid;grid-template-columns:minmax(220px,1fr) minmax(280px,1fr) auto;gap:10px;align-items:end}
.client-form .btn{white-space:nowrap;min-width:190px}
.status{min-height:20px;margin-top:8px;font-size:12px;color:#667085}
.status.ok{color:#16794a;font-weight:700}
.status.error{color:#b42318;font-weight:700}
.btn:disabled{opacity:.55;cursor:not-allowed}
@media(max-width:900px){.client-form{grid-template-columns:1fr}.client-form .btn{width:100%}}
.count{display:inline-grid;place-items:center;min-width:22px;height:20px;padding:0 6px;margin-left:4px;border-radius:999px;background:#eaf3fb;color:#0f4c81;font-size:11px}.tab.active .count{background:#fff;color:#0f4c81}.toolbar{display:flex;gap:8px;align-items:center}.toolbar select{min-width:220px;margin:0}.workflow{display:grid;gap:12px}.workflow>div{border-left:3px solid var(--brand2);padding:3px 0 3px 12px}.workflow p{margin:4px 0 0;color:var(--muted);font-size:12px;line-height:1.5}.todo-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}.todo-card{border:1px solid var(--line);border-radius:13px;padding:14px;background:#fff;box-shadow:0 4px 14px rgba(16,24,40,.04)}.todo-card h3{font-size:14px;margin:12px 0 6px;word-break:break-word}.todo-card p{font-size:12px;color:var(--muted);min-height:36px}.todo-top{display:flex;justify-content:space-between;gap:8px;align-items:center}.date{font-size:11px;color:var(--muted)}.todo-actions{display:flex;gap:7px;margin-top:12px}.empty{padding:28px;text-align:center;color:var(--muted);border:1px dashed var(--line);border-radius:12px}.source-banner{margin-bottom:12px;padding:11px 13px;border-radius:10px;background:#eef7ff;border:1px solid #cce1f1;color:#315b78;font-size:12px}.status.ok{color:var(--ok);font-weight:700}.status.error{color:var(--danger);font-weight:700}@media(max-width:1100px){.todo-grid{grid-template-columns:repeat(2,1fr)}}@media(max-width:700px){.todo-grid{grid-template-columns:1fr}.toolbar{flex-direction:column;align-items:stretch}.toolbar select{min-width:0}}

/* v0.5 - Editeur avec aperçu plan + réponse ChatGPT */
.editor-layout{display:grid;grid-template-columns:minmax(540px,1.12fr) minmax(430px,.95fr) minmax(360px,.78fr);gap:16px;align-items:start}
.sticky-editor{position:sticky;top:84px}
.editor-form-card{min-width:0}.preview-card,.ai-card{min-width:0}
.preview-tools{display:flex;gap:6px}.btn.small{padding:7px 9px;font-size:11px}
.preview-body{height:calc(100vh - 170px);min-height:620px;background:#dfe5eb;position:relative;overflow:hidden}
.preview-empty{height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:7px;padding:24px;text-align:center;color:var(--muted);background:linear-gradient(180deg,#f7f9fb,#edf1f5)}
.preview-empty b{color:#344054;font-size:14px}.preview-empty span{font-size:12px;max-width:290px;line-height:1.5}
.plan-preview{width:100%;height:100%;border:0;background:#fff;object-fit:contain;display:block}
img.plan-preview{padding:12px;background:#e6ebf0}
.ai-body textarea#prompt{min-height:315px;max-height:360px}
.response-box{min-height:280px!important;background:#fff!important}
.response-state{display:flex;justify-content:flex-end;margin-top:7px}.muted-badge{background:#eef2f6!important;color:#667085!important}.response-ok{background:#e8f6ee!important;color:#16794a!important}
@media(max-width:1380px){.editor-layout{grid-template-columns:minmax(520px,1.15fr) minmax(420px,.9fr)}.ai-card{grid-column:1/-1;position:static}.ai-body{display:grid;grid-template-columns:1fr 1fr;gap:14px}.ai-body>.footer-actions,.ai-body>.hint,.ai-body>.response-state{grid-column:1/-1}.ai-body textarea#prompt,.response-box{min-height:260px!important;max-height:none}}
@media(max-width:980px){.editor-layout{grid-template-columns:1fr}.sticky-editor{position:static}.preview-body{height:680px;min-height:500px}.ai-body{display:block}.ai-body textarea#prompt,.response-box{min-height:300px!important}}


/* v0.6 — organisation par Client > Demande > Plans */
.subline{display:block;margin-top:3px;color:var(--muted);font-size:11px;font-weight:500}
.request-tree,.history-tree{display:grid;gap:12px}
.client-group,.request-group{border:1px solid var(--line);border-radius:13px;background:#fff;overflow:hidden}
.client-group>summary,.request-group>summary{list-style:none;cursor:pointer;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:13px 15px}
.client-group>summary::-webkit-details-marker,.request-group>summary::-webkit-details-marker{display:none}
.client-group>summary{background:#f6f9fc;border-bottom:1px solid transparent}
.client-group[open]>summary{border-bottom-color:var(--line)}
.client-group>summary>div{display:flex;align-items:center;gap:10px}.client-group>summary span{font-size:11px;color:var(--muted)}
.count-pill{padding:5px 8px;border-radius:999px;background:var(--brandsoft);color:var(--brand)!important;font-weight:800}
.client-group-body{padding:11px;display:grid;gap:9px;background:#fbfcfe}
.request-group{border-radius:11px}
.request-group>summary{padding:11px 13px;background:#fff}
.request-group[open]>summary{border-bottom:1px solid var(--line)}
.request-title{display:flex;align-items:center;gap:9px;min-width:0}.request-title span{font-size:11px;color:var(--muted)}.request-subject{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:420px}
.request-summary{display:flex;gap:7px;align-items:center}.request-summary span{font-size:11px;padding:4px 7px;border-radius:999px;background:#eef2f6;color:#475467}.request-summary .request-total{background:#e9f7f0;color:#16794a;font-weight:800}
.request-plans,.history-pieces{padding:10px;display:grid;gap:7px;background:#fbfcfe}
.plan-row,.history-piece{display:grid;grid-template-columns:auto minmax(0,1fr) auto;gap:10px;align-items:center;padding:10px;border:1px solid var(--line);border-radius:10px;background:#fff}
.plan-icon{width:38px;height:38px;border-radius:8px;background:#fff1f0;color:#b42318;display:grid;place-items:center;font-size:10px;font-weight:900;border:1px solid #f0d0cd}.done-icon{background:#e9f7f0;color:#16794a;border-color:#cbe7d8}
.plan-info b{display:block;font-size:12px}.plan-info span{display:block;font-size:11px;color:var(--muted);margin-top:2px}
.plan-actions{display:flex;gap:6px;flex-wrap:wrap;justify-content:flex-end}
.done-plans{border-top:1px dashed var(--line);margin-top:4px}.done-plans>summary{cursor:pointer;padding:9px 4px;color:var(--muted);font-size:11px}.done-list{display:grid;gap:7px}
.history-piece{grid-template-columns:minmax(0,1fr) 180px auto}
.piece-ref{font-weight:850;font-size:13px}.piece-desc{font-size:11px;color:var(--muted);margin-top:3px}
.piece-numbers{display:grid;text-align:right;gap:2px}.piece-numbers span{font-size:11px;color:var(--muted)}.piece-numbers b{font-size:13px}
.direct-group{margin-top:12px}
@media(max-width:900px){.plan-row,.history-piece{grid-template-columns:1fr}.plan-icon{display:none}.piece-numbers{text-align:left}.plan-actions{justify-content:flex-start}.request-title{flex-wrap:wrap}.request-subject{max-width:100%}}


/* v0.7 — actions demande / sauvegarde */
.request-actionbar{display:flex;gap:7px;flex-wrap:wrap;align-items:center;padding:3px 0 8px;border-bottom:1px dashed var(--line);margin-bottom:3px}
.top-actions{display:flex;gap:7px;align-items:center;flex-wrap:wrap}
@media(max-width:760px){.top-actions .btn{padding:7px 9px;font-size:11px}.request-actionbar{align-items:stretch}.request-actionbar .btn{flex:1 1 auto}}


/* v0.8 — confirmations internes ATCN, sans boite Windows ni son système */
.app-modal{position:fixed;inset:0;z-index:1000;display:grid;place-items:center;padding:24px}
.app-modal.hidden{display:none!important}
.app-modal-backdrop{position:absolute;inset:0;background:rgba(15,23,42,.42);backdrop-filter:blur(3px)}
.app-modal-dialog{position:relative;width:min(520px,calc(100vw - 32px));display:grid;grid-template-columns:58px minmax(0,1fr);gap:16px;padding:22px;border:1px solid rgba(255,255,255,.8);border-radius:18px;background:#fff;box-shadow:0 24px 70px rgba(15,23,42,.25);animation:modalIn .14s ease-out}
@keyframes modalIn{from{opacity:0;transform:translateY(6px) scale(.985)}to{opacity:1;transform:none}}
.app-modal-icon{width:52px;height:52px;border-radius:14px;display:grid;place-items:center;background:#fff0ef;color:#b42318;border:1px solid #f4ccc8}
.app-modal-icon svg{width:26px;height:26px}
.app-modal-kicker{font-size:10px;letter-spacing:.08em;text-transform:uppercase;font-weight:850;color:#b42318;margin-bottom:4px}
.app-modal-content h3{font-size:18px;margin:0;color:#1d2939}
.app-modal-item{margin-top:11px;padding:10px 12px;border-radius:10px;background:#f8fafc;border:1px solid var(--line);font-size:13px;font-weight:800;color:#344054;word-break:break-word}
.app-modal-text{margin:10px 0 0;color:#667085;font-size:12.5px;line-height:1.5}
.app-modal-extra{margin-top:10px;padding:9px 11px;border-radius:10px;background:#fff7ed;border:1px solid #fed7aa;color:#9a3412;font-size:11.5px;line-height:1.45}
.app-modal-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:18px}
.modal-danger{background:#b42318;color:#fff;border:1px solid #b42318;box-shadow:0 5px 12px rgba(180,35,24,.15)}
.modal-danger:hover{background:#912018}
body.modal-open{overflow:hidden}
@media(max-width:560px){.app-modal-dialog{grid-template-columns:1fr}.app-modal-icon{width:44px;height:44px}.app-modal-actions{flex-direction:column-reverse}.app-modal-actions .btn{width:100%}}


/* v0.9 — notifications internes et copie directe du plan */
.preview-card .card-head{align-items:flex-start}
.preview-card .preview-tools{flex-wrap:wrap;justify-content:flex-end}
.toast-stack{position:fixed;top:78px;right:18px;z-index:1400;width:min(410px,calc(100vw - 28px));display:grid;gap:10px;pointer-events:none}
.app-toast{pointer-events:auto;display:grid;grid-template-columns:38px minmax(0,1fr) 28px;gap:10px;align-items:start;padding:12px 12px;border:1px solid #cfe2d8;border-radius:13px;background:#fff;box-shadow:0 16px 36px rgba(15,23,42,.16);animation:toastIn .18s ease-out}
.app-toast.closing{animation:toastOut .18s ease-in forwards}
@keyframes toastIn{from{opacity:0;transform:translateY(-8px) translateX(10px)}to{opacity:1;transform:none}}
@keyframes toastOut{to{opacity:0;transform:translateX(18px)}}
.toast-icon{width:34px;height:34px;border-radius:10px;display:grid;place-items:center;font-size:16px;font-weight:900;background:#e9f7f0;color:#16794a;border:1px solid #cbe7d8}
.toast-copy{min-width:0}.toast-copy b{display:block;font-size:12.5px;color:#1d2939;margin:1px 0 3px}.toast-copy span{display:block;font-size:11.5px;line-height:1.45;color:#667085;overflow-wrap:anywhere}
.toast-close{border:0;background:transparent;color:#98a2b3;font-size:20px;line-height:22px;padding:0;cursor:pointer}.toast-close:hover{color:#344054}
.app-toast.warning{border-color:#f2db9f}.app-toast.warning .toast-icon{background:#fff8e8;color:#9a5b00;border-color:#f2db9f}
.app-toast.error{border-color:#f0c6c2}.app-toast.error .toast-icon{background:#fff0ef;color:#b42318;border-color:#f0c6c2}
#copyPlanFile{box-shadow:0 4px 10px rgba(15,76,129,.16)}
@media(max-width:700px){.toast-stack{top:66px;right:10px}.preview-card .card-head{flex-direction:column}.preview-card .preview-tools{width:100%;justify-content:flex-start}}


/* v1.0 Configuration */
.config-layout{display:grid;grid-template-columns:minmax(0,1fr) 330px;gap:16px;align-items:start}
.config-toolbar{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:10px}.config-toolbar .search{max-width:420px}
.material-table-wrap{overflow:auto;border:1px solid var(--line);border-radius:11px}.material-table{width:100%;border-collapse:collapse;min-width:760px}.material-table th,.material-table td{padding:10px 11px;border-bottom:1px solid var(--line);text-align:left;font-size:12px}.material-table th{background:#f7f9fc;color:#475467;font-size:11px;text-transform:uppercase}.material-table tr:last-child td{border-bottom:0}.material-table tr:hover td{background:#fbfcfe}.table-actions{display:flex;gap:6px;flex-wrap:wrap}.empty-cell{text-align:center!important;color:var(--muted);padding:22px!important}
@media(max-width:1000px){.config-layout{grid-template-columns:1fr}.config-layout>.sticky{position:static}}

/* v1.1 - brouillons persistants et champs à compléter */
.completion-state{display:flex;align-items:flex-start;gap:10px;padding:10px 12px;margin-bottom:12px;border:1px solid #efdca8;border-radius:10px;background:#fff8e8;color:#6b5315}
.completion-state b{white-space:nowrap}.completion-state span{font-size:11px;line-height:1.45}
.completion-state.complete{border-color:#c8e5d5;background:#edf8f2;color:#16633f}
.plan-row.has-draft{border-color:#b8d7ef;background:#f4faff}
.plan-row.has-draft .plan-info span{color:var(--brand);font-weight:700}


/* v1.2 - éditeur de confidentialité PDF */
.redact-modal{position:fixed;inset:0;z-index:1200;display:grid;place-items:center;padding:20px}.redact-modal.hidden{display:none}.redact-backdrop{position:absolute;inset:0;background:rgba(15,23,42,.62);backdrop-filter:blur(3px)}
.redact-dialog{position:relative;width:min(1320px,96vw);height:min(900px,94vh);display:grid;grid-template-rows:auto auto 1fr auto;background:#f8fafc;border:1px solid var(--line);border-radius:18px;overflow:hidden;box-shadow:0 28px 80px rgba(15,23,42,.28)}
.redact-header{display:flex;justify-content:space-between;gap:20px;padding:18px 20px;background:#fff;border-bottom:1px solid var(--line)}.redact-header h3{margin:3px 0 5px;font-size:18px}.redact-header p{margin:0;color:var(--muted);font-size:12px;max-width:840px;line-height:1.45}
.redact-toolbar{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:10px 14px;background:#f7f9fc;border-bottom:1px solid var(--line)}.redact-pages,.redact-actions{display:flex;gap:8px;align-items:center}.redact-pages span{font-size:12px;font-weight:800;color:#344054;min-width:92px;text-align:center}
.redact-workspace{min-height:0;display:grid;grid-template-rows:auto 1fr;gap:10px;padding:12px 14px}.redact-help{display:flex;gap:10px;align-items:center;padding:9px 11px;border:1px solid #f2d6a2;background:#fff8e8;border-radius:10px;color:#6b5315;font-size:12px}.redact-help span{color:#765f27}
.redact-canvas-wrap{min-height:0;overflow:auto;background:#dfe5eb;border:1px solid #c9d2dc;border-radius:12px;padding:18px;text-align:center}.redact-canvas-wrap canvas{display:inline-block;max-width:100%;height:auto;background:#fff;box-shadow:0 8px 28px rgba(15,23,42,.18);cursor:crosshair;touch-action:none}
.redact-footer{display:flex;justify-content:space-between;align-items:center;gap:16px;padding:12px 16px;background:#fff;border-top:1px solid var(--line)}.redact-security b,.redact-security span{display:block}.redact-security b{font-size:12px;color:#16794a}.redact-security span{font-size:11px;color:var(--muted);margin-top:2px}
.btn.success{background:#e9f7f0;color:#16794a;border:1px solid #c5e6d6}.btn.success:hover{background:#ddf2e8}
@media(max-width:850px){.redact-modal{padding:6px}.redact-dialog{width:99vw;height:98vh;border-radius:12px}.redact-toolbar,.redact-footer,.redact-header{align-items:flex-start;flex-direction:column}.redact-actions{flex-wrap:wrap}}

/* v1.3 Production */
.production-board{display:grid;grid-template-columns:repeat(auto-fit,minmax(285px,1fr));gap:14px;align-items:start}.machine-column{border:1px solid var(--line);border-radius:14px;background:#f8fafc;overflow:hidden}.machine-head{padding:12px 13px;background:#eef4f9;border-bottom:1px solid var(--line);display:flex;justify-content:space-between;align-items:center;gap:8px}.machine-head b{font-size:13px}.machine-head span{font-size:11px;color:var(--muted)}.machine-jobs{padding:9px;display:grid;gap:8px}.prod-job{background:#fff;border:1px solid var(--line);border-radius:11px;padding:11px;display:grid;gap:8px}.prod-job-top{display:flex;justify-content:space-between;gap:8px}.priority-badge{width:28px;height:28px;border-radius:8px;background:var(--brand);color:#fff;display:grid;place-items:center;font-weight:900;font-size:12px}.prod-title b{display:block;font-size:13px}.prod-title span{font-size:11px;color:var(--muted)}.prod-meta{display:flex;gap:6px;flex-wrap:wrap}.prod-meta span{font-size:11px;padding:4px 7px;border-radius:999px;background:#eef2f6}.prod-comment{font-size:11px;padding:8px;border-left:3px solid var(--brand);background:#f5f9fd;border-radius:6px}.prod-controls{display:grid;grid-template-columns:1fr auto;gap:7px}.prod-controls select,.prod-controls input{font-size:12px;padding:7px}.priority-actions{display:flex;gap:5px}.finished-section{margin-top:16px;border-top:1px solid var(--line);padding-top:12px}.finished-section>summary{cursor:pointer;font-weight:800}.production-done{display:grid;gap:7px;margin-top:10px}.done-job{display:flex;justify-content:space-between;gap:10px;padding:9px 10px;border:1px solid var(--line);border-radius:9px;background:#f7fbf8;font-size:12px}.worker-login{min-height:62vh;display:grid;place-items:center}.worker-login-card{width:min(430px,95%);background:#fff;border:1px solid var(--line);border-radius:18px;padding:28px;box-shadow:0 16px 40px rgba(16,24,40,.10);display:grid;gap:12px}.worker-logo{width:52px;height:52px;border-radius:14px;background:var(--brand);color:#fff;display:grid;place-items:center;font-weight:900;font-size:20px}.worker-login-card h2{margin:0}.worker-login-card p{margin:0 0 6px;color:var(--muted);font-size:13px}.worker-top{display:flex;justify-content:space-between;align-items:center;margin-bottom:14px;padding:13px 15px;border:1px solid var(--line);background:#fff;border-radius:13px}.worker-top b,.worker-top span{display:block}.worker-top span{font-size:11px;color:var(--muted)}.worker-board{display:grid;gap:16px}.worker-machine{background:#fff;border:1px solid var(--line);border-radius:15px;overflow:hidden}.worker-machine>header{padding:13px 15px;background:#eef4f9;border-bottom:1px solid var(--line);font-weight:900}.worker-job{padding:14px;border-bottom:1px solid var(--line);display:grid;grid-template-columns:minmax(0,1fr) 300px;gap:14px}.worker-job:last-child{border-bottom:0}.worker-job h3{margin:0 0 4px;font-size:16px}.worker-job .big-qty{font-size:24px;font-weight:900;color:var(--brand)}.worker-job textarea{min-height:74px}.worker-comments{display:grid;gap:5px;margin-top:8px}.worker-comment{font-size:11px;background:#f7f9fc;border:1px solid var(--line);border-radius:7px;padding:7px}.finish-row{display:grid;grid-template-columns:120px 1fr;gap:7px;margin-top:8px}.cfg-worker-list,.cfg-machine-list{display:grid;gap:7px;margin-top:10px}.cfg-row{display:grid;grid-template-columns:1fr auto;gap:8px;align-items:center;padding:8px 9px;border:1px solid var(--line);border-radius:8px;background:#fafbfd}.cfg-machine-row{display:grid;grid-template-columns:1fr auto;gap:7px}.order-dialog{max-width:560px}.short-textarea{min-height:88px}.prod-plan-modal{position:fixed;inset:0;z-index:90;display:grid;place-items:center}.prod-plan-backdrop{position:absolute;inset:0;background:rgba(9,18,28,.7)}.prod-plan-dialog{position:relative;width:min(1280px,96vw);height:min(900px,94vh);background:#fff;border-radius:15px;overflow:hidden;display:grid;grid-template-rows:auto 1fr}.prod-plan-dialog header{padding:12px 14px;border-bottom:1px solid var(--line);display:flex;justify-content:space-between;align-items:center}.prod-plan-dialog h3{margin:2px 0 0}.prod-plan-dialog iframe{width:100%;height:100%;border:0;background:#333}.production-lock .top-actions,.production-lock .tabs{display:none!important}.production-lock .app{padding-top:18px}.production-lock #productionManager{display:none!important}@media(max-width:900px){.worker-job{grid-template-columns:1fr}.production-board{grid-template-columns:1fr}}

/* v1.4 connexion générale + fiche commande ouvrier */
.global-login{min-height:100vh;display:grid;place-items:center;padding:24px;background:radial-gradient(circle at 20% 10%,rgba(25,97,150,.13),transparent 32%),linear-gradient(180deg,#f7fafc,#eaf0f5)}
.global-login-card{width:min(470px,96vw);background:#fff;border:1px solid var(--line);border-radius:22px;padding:32px;box-shadow:0 24px 60px rgba(16,24,40,.12);display:grid;gap:14px}.global-login-card h1{margin:0;font-size:24px}.global-login-card p{margin:4px 0 0;color:var(--muted)}.big-login-btn{padding:13px;font-size:14px}.login-help{font-size:11px;color:var(--muted);background:#f7f9fc;border:1px solid var(--line);padding:10px;border-radius:10px}
.worker-only .top-actions #backupAll,.worker-only .top-actions #restoreAll,.worker-only .top-actions #openRoot,.worker-only .tabs{display:none!important}.worker-only .app{padding-top:18px}.worker-only #productionManager{display:none!important}.worker-only #workerPanel{display:block!important}
.worker-card{padding:14px 16px;border-bottom:1px solid var(--line);display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:12px;cursor:pointer;transition:.15s;background:#fff}.worker-card:hover{background:#f7fbff}.worker-card:last-child{border-bottom:0}.worker-card .priority-badge{width:36px;height:36px}.worker-card-main h3{margin:0 0 4px}.worker-card-main p{margin:0;color:var(--muted);font-size:12px}.worker-card-side{text-align:right}.worker-card-side b{display:block;font-size:20px;color:var(--brand)}.worker-card-side span{font-size:11px;color:var(--muted)}
.job-detail-modal,.camera-modal{position:fixed;inset:0;z-index:140;display:grid;place-items:center;padding:10px}.job-detail-backdrop,.camera-backdrop{position:absolute;inset:0;background:rgba(8,18,28,.72)}.job-detail-dialog{position:relative;width:min(1480px,98vw);height:min(930px,97vh);background:#f5f7fa;border-radius:18px;overflow:hidden;display:grid;grid-template-rows:auto 1fr;box-shadow:0 26px 80px rgba(0,0,0,.25)}.job-detail-header{padding:14px 18px;background:#fff;border-bottom:1px solid var(--line);display:flex;justify-content:space-between;gap:16px;align-items:center}.job-detail-header h2{margin:5px 0 2px;font-size:20px}.job-detail-header p{margin:0;color:var(--muted);font-size:12px}.job-detail-grid{min-height:0;display:grid;grid-template-columns:minmax(0,1.25fr) minmax(370px,.75fr);gap:12px;padding:12px}.job-plan-pane,.job-notes-pane{min-height:0;background:#fff;border:1px solid var(--line);border-radius:13px;overflow:hidden}.job-plan-pane{display:grid;grid-template-rows:auto 1fr}.pane-title{padding:10px 12px;border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between}.job-plan-pane iframe{width:100%;height:100%;border:0;background:#333}.job-notes-pane{padding:14px;overflow:auto}.job-kpis{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-bottom:10px}.job-kpis>div{background:#f7f9fc;border:1px solid var(--line);border-radius:10px;padding:10px}.job-kpis span{display:block;font-size:11px;color:var(--muted)}.job-kpis b{font-size:20px}.job-section-title{font-weight:850;font-size:13px;margin:16px 0 8px}.job-comment-list{display:grid;gap:7px}.job-comment-item{padding:9px 10px;border:1px solid var(--line);border-radius:9px;background:#f8fafc;font-size:12px}.job-comment-item b{display:block;margin-bottom:3px}.job-big-comment{min-height:150px!important;font-size:14px!important}.photo-actions{display:flex;gap:8px;flex-wrap:wrap}.job-photo-gallery{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin-top:9px}.job-photo{border:1px solid var(--line);border-radius:10px;overflow:hidden;background:#f7f9fc}.job-photo img{width:100%;aspect-ratio:4/3;object-fit:cover;display:block}.job-photo div{padding:6px 7px;font-size:10px;color:var(--muted)}.finish-panel{margin-top:18px;padding-top:12px;border-top:1px solid var(--line)}
.camera-dialog{position:relative;width:min(780px,96vw);background:#111;border-radius:16px;overflow:hidden;color:#fff}.camera-dialog header{padding:12px 14px;background:#fff;color:#17202b;display:flex;justify-content:space-between;align-items:center}.camera-dialog header b,.camera-dialog header span{display:block}.camera-dialog header span{font-size:11px;color:var(--muted)}.camera-stage{background:#000;display:grid;place-items:center;min-height:420px}.camera-stage video,.camera-stage canvas{max-width:100%;max-height:68vh}.camera-actions{padding:12px;background:#fff;display:flex;justify-content:center;gap:8px}
@media(max-width:950px){.job-detail-grid{grid-template-columns:1fr}.job-detail-dialog{height:98vh}.job-plan-pane{min-height:48vh}.job-photo-gallery{grid-template-columns:repeat(2,1fr)}}

.job-comment-item.historic{border-left:3px solid #7b8da1;background:#f2f5f8}.historic-photo{outline:2px solid #d9e1e8}.historic-photo div b{color:#475467}


/* v1.5 - session claire + historique production administrateur */
.session-logout{white-space:nowrap}
.production-subtabs{display:flex;gap:8px;margin-bottom:16px;padding-bottom:12px;border-bottom:1px solid var(--line)}
.mini-count{display:inline-grid;place-items:center;min-width:20px;height:20px;padding:0 6px;margin-left:5px;border-radius:999px;background:rgba(255,255,255,.22);font-size:10px}
.secondary .mini-count{background:#dde6ef;color:#344054}
.production-history-head{display:flex;align-items:end;justify-content:space-between;gap:12px;margin-bottom:12px}
.production-history-head b,.production-history-head span{display:block}.production-history-head span{font-size:11px;color:var(--muted);margin-top:3px}
.production-history-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(330px,1fr));gap:10px}
.production-history-card{border:1px solid var(--line);border-radius:11px;padding:12px;background:#f8fbf9;display:grid;gap:9px}
.production-history-card .history-top{display:flex;justify-content:space-between;gap:12px;align-items:start}.production-history-card .history-top b{font-size:13px}.production-history-card .history-top span,.history-meta span{font-size:11px;color:var(--muted)}
.history-meta{display:flex;gap:6px;flex-wrap:wrap}.history-meta span{padding:4px 7px;border-radius:999px;background:#eef2f6;color:#475467}
.history-result{display:grid;grid-template-columns:repeat(3,1fr);gap:7px}.history-result>div{border:1px solid var(--line);background:#fff;border-radius:8px;padding:8px}.history-result span,.history-result b{display:block}.history-result span{font-size:10px;color:var(--muted)}.history-result b{font-size:13px;margin-top:2px}
.finished-info{border:1px solid #bfe2cf;background:#eef9f3;color:#245d40;border-radius:9px;padding:9px 10px;font-size:12px;line-height:1.45}
.worker-admin-preview #workerLogout{background:#eef2f7;color:#273444;border:1px solid var(--line)}
@media(max-width:760px){.production-history-head{align-items:stretch;flex-direction:column}.production-history-head .search{max-width:none}.history-result{grid-template-columns:1fr}.top-actions{gap:5px;flex-wrap:wrap}.topbar{height:auto;min-height:66px;padding-top:8px;padding-bottom:8px}}


/* v1.6 - ajout machine directement dans Production */
.prod-quick-machine{
  margin-bottom:12px;
  padding:12px 14px;
  border:1px solid var(--line);
  border-radius:12px;
  background:#f8fbfe;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
}
.prod-quick-machine>div:first-child b{display:block;font-size:13px}
.prod-quick-machine>div:first-child span{display:block;margin-top:3px;font-size:11px;color:var(--muted)}
.prod-quick-machine-form{display:flex;gap:7px;align-items:center;min-width:min(520px,50%)}
.prod-quick-machine-form input{min-width:250px}
@media(max-width:900px){
  .prod-quick-machine{align-items:stretch;flex-direction:column}
  .prod-quick-machine-form{min-width:0;width:100%;flex-wrap:wrap}
  .prod-quick-machine-form input{min-width:0;flex:1 1 220px}
}


/* v1.7 - calibration de chiffrage */
.calibration-intro{margin-top:14px;padding:11px 12px;border:1px solid var(--line);border-radius:10px;background:#f8fbfe}.calibration-intro b{display:block;font-size:12px}.calibration-intro span{display:block;margin-top:3px;font-size:11px;color:var(--muted);line-height:1.4}
.calibration-grid{display:grid;gap:8px;margin-top:10px}.cal-row{display:grid;grid-template-columns:minmax(190px,1fr) minmax(150px,.75fr) 42px;gap:10px;align-items:center;padding:10px;border:1px solid var(--line);border-radius:10px;background:#fff}.cal-row.all{background:#f3f8fd;border-color:#cbddeb}.cal-row b{display:block;font-size:12px}.cal-row span{display:block;font-size:10px;color:var(--muted);margin-top:2px}.cal-row input[type=range]{width:100%;accent-color:var(--brand)}.cal-row output{display:grid;place-items:center;height:31px;border-radius:8px;background:#eef2f6;font-weight:900;font-size:13px;color:#344054}.cal-row output[data-level="-2"],.cal-row output[data-level="-1"]{background:#eaf6ef;color:#16794a}.cal-row output[data-level="1"],.cal-row output[data-level="2"]{background:#fff1e8;color:#9a5b00}.calibration-scale{display:flex;justify-content:space-between;gap:6px;flex-wrap:wrap;margin-top:8px;font-size:9px;color:var(--muted)}
@media(max-width:900px){.cal-row{grid-template-columns:1fr 1fr 42px}.cal-row>div{grid-column:1/-1}}


/* =========================================================
   v1.8 - Corrections d'affichage uniquement
   - Calibration responsive, aucun débordement horizontal
   - Fenêtre "Ajouter le poste en production" pleine largeur
   ========================================================= */

/* La colonne Configuration ne doit jamais laisser ses enfants élargir la page */
#view-config .card,
#view-config .card-body,
#view-config .config-grid,
#view-config .cfg-panel,
.calibration-grid,
.cal-row {
  min-width: 0;
  max-width: 100%;
}

/* Calibration : le libellé garde de la place et la jauge se réduit proprement */
.cal-row{
  grid-template-columns:minmax(150px,1.15fr) minmax(110px,1fr) 38px;
  gap:8px;
  overflow:hidden;
}
.cal-row > div,
.cal-row input[type="range"],
.cal-row output{
  min-width:0;
  max-width:100%;
}
.cal-row input[type="range"]{
  display:block;
  width:100%;
  margin:0;
  padding:0;
}
.cal-row output{
  width:38px;
}

/* Sur une zone étroite, jauge sur une deuxième ligne */
@media(max-width:1180px){
  .cal-row{
    grid-template-columns:minmax(0,1fr) 38px;
  }
  .cal-row > div:first-child{
    grid-column:1 / -1;
  }
  .cal-row input[type="range"]{
    grid-column:1;
  }
  .cal-row output{
    grid-column:2;
  }
}

/* Sur tablette/petite fenêtre : disposition verticale très lisible */
@media(max-width:760px){
  .cal-row{
    grid-template-columns:minmax(0,1fr) 42px;
    padding:10px 11px;
  }
  .calibration-scale{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:4px 10px;
  }
  .calibration-scale span:nth-child(3){
    grid-column:1 / -1;
    text-align:center;
  }
}

/* La fenêtre commande héritait de la grille de la fenêtre de suppression :
   comme elle n'a pas d'icône, tout son contenu tombait dans la colonne 58 px. */
.app-modal-dialog.order-dialog{
  display:block;
  width:min(640px,calc(100vw - 36px));
  max-width:640px;
  padding:24px;
}
.order-dialog .app-modal-content{
  width:100%;
  min-width:0;
}
.order-dialog .app-modal-item{
  width:100%;
  word-break:normal;
  overflow-wrap:anywhere;
}
.order-dialog .grid2{
  width:100%;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:12px;
  margin-top:14px;
}
.order-dialog label{
  min-width:0;
}
.order-dialog input,
.order-dialog select,
.order-dialog textarea{
  width:100%;
  min-width:0;
}
.order-dialog .short-textarea{
  min-height:120px;
  resize:vertical;
}
.order-dialog .app-modal-actions{
  width:100%;
  margin-top:18px;
}

/* Confort sur petit écran */
@media(max-width:620px){
  .app-modal{
    padding:10px;
  }
  .app-modal-dialog.order-dialog{
    width:calc(100vw - 20px);
    padding:18px;
    border-radius:14px;
  }
  .order-dialog .grid2{
    grid-template-columns:1fr;
  }
  .order-dialog .app-modal-actions{
    flex-direction:column-reverse;
  }
  .order-dialog .app-modal-actions .btn{
    width:100%;
  }
}


/* v1.9 - reprise d'anciennes offres dans une nouvelle demande */
.optional-tag{font-size:9px!important;font-weight:800!important;color:var(--muted)!important;background:#eef2f6!important;border-radius:999px!important;padding:3px 6px!important;margin-left:5px}
.reuse-help{font-size:11px;line-height:1.45;color:#475467;background:#f8fbfe;border:1px solid var(--line);border-radius:10px;padding:10px 11px;margin-bottom:10px}
.reuse-search-row{display:flex;align-items:center;gap:10px}.reuse-search-row input{flex:1;min-width:0}.reuse-results{display:grid;gap:6px;margin-top:9px;max-height:280px;overflow:auto}.reuse-result{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:9px 10px;border:1px solid var(--line);border-radius:9px;background:#fff}.reuse-result.selected{background:#f2faf6;border-color:#bcdcca}.reuse-result>div{min-width:0}.reuse-result b{display:block;font-size:12px}.reuse-result span{display:block;font-size:10px;color:var(--muted);margin-top:2px}.reuse-selected{margin-top:10px;padding:10px;border-radius:10px;background:#f3f8fd;border:1px solid #cbddeb}.reuse-selected>b{display:block;font-size:11px;margin-bottom:7px}.reuse-selected>div{display:flex;flex-wrap:wrap;gap:6px}.reuse-chip{display:inline-flex;align-items:center;gap:6px;padding:5px 8px;border-radius:999px;background:#fff;border:1px solid var(--line);font-size:10px;font-weight:800}.reuse-chip button{border:0;background:transparent;color:var(--danger);cursor:pointer;font-weight:900;padding:0}.empty.compact{padding:10px;font-size:11px}
@media(max-width:700px){.reuse-search-row{align-items:stretch;flex-direction:column}.reuse-result{align-items:flex-start;flex-direction:column}}

/* v1.9 - jauges : disposition stable dans la colonne Configuration.
   Le libellé occupe toute la première ligne ; curseur + valeur restent dessous. */
#view-config .cal-row{
  display:grid!important;
  grid-template-columns:minmax(0,1fr) 40px!important;
  gap:7px 8px!important;
  width:100%!important;
  max-width:100%!important;
  overflow:hidden!important;
  box-sizing:border-box!important;
}
#view-config .cal-row>div:first-child{grid-column:1 / -1!important;min-width:0!important}
#view-config .cal-row input[type="range"]{
  grid-column:1!important;
  width:calc(100% - 20px)!important;
  max-width:calc(100% - 20px)!important;
  min-width:0!important;
  margin:0 10px!important;
  padding:0!important;
  box-sizing:border-box!important;
}
#view-config .cal-row output{grid-column:2!important;width:40px!important;max-width:40px!important}
#view-config .calibration-grid{overflow:hidden!important;width:100%!important;max-width:100%!important}


/* v1.10 - versions de plans par pièce */
.history-piece .piece-desc b{color:#344054;font-weight:800}
.history-piece .plan-actions .primary{white-space:nowrap}
.prod-meta{flex-wrap:wrap}
.prod-meta span:last-child{
  background:#eef7ff;
  border:1px solid #d5e6f3;
  border-radius:999px;
  padding:3px 7px;
}


/* v1.11 - Production directe sans devis */
.direct-production-dialog{
  width:min(720px,calc(100vw - 36px));
  max-width:720px;
}
.direct-plan-picker{
  min-height:42px;
  display:flex;
  align-items:center;
  gap:10px;
  padding:5px 0;
}
.direct-plan-picker .muted{
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
@media(max-width:650px){
  .direct-production-dialog{width:calc(100vw - 20px)}
  .direct-plan-picker{align-items:flex-start;flex-direction:column}
  .direct-plan-picker .muted{white-space:normal}
}


/* =========================================================
   v1.12 - Refonte ergonomique légère
   Objectif : logique de travail visible en permanence
   ========================================================= */

#mainShell .app{
  max-width:1600px;
  display:grid;
  grid-template-columns:205px minmax(0,1fr);
  column-gap:18px;
  align-items:start;
  padding-top:18px;
}

.workflow-nav{
  grid-column:1;
  position:sticky;
  top:82px;
  display:flex;
  flex-direction:column;
  align-items:stretch;
  gap:5px;
  padding:10px;
  background:#fff;
  border:1px solid var(--line);
  border-radius:15px;
  box-shadow:0 8px 24px rgba(16,24,40,.06);
}

.workflow-nav .nav-label{
  padding:10px 9px 4px;
  color:var(--muted);
  font-size:10px;
  font-weight:850;
  letter-spacing:.08em;
  text-transform:uppercase;
}
.workflow-nav .nav-label:not(:first-child){
  margin-top:7px;
  border-top:1px solid var(--line);
  padding-top:13px;
}

.workflow-nav .tab{
  width:100%;
  min-height:42px;
  display:grid;
  grid-template-columns:28px minmax(0,1fr) auto;
  align-items:center;
  gap:8px;
  text-align:left;
  border-radius:10px;
  padding:7px 9px;
  border:1px solid transparent;
  background:transparent;
  color:#344054;
}
.workflow-nav .tab:hover{
  background:#f6f9fc;
  border-color:#e5ebf1;
}
.workflow-nav .tab.active{
  background:var(--brandsoft);
  color:var(--brand);
  border-color:#cfe0ef;
  box-shadow:none;
}
.workflow-nav .nav-icon{
  width:27px;
  height:27px;
  display:grid;
  place-items:center;
  border-radius:8px;
  background:#eef2f6;
  color:#667085;
  font-size:10px;
  font-weight:900;
}
.workflow-nav .tab.active .nav-icon{
  background:var(--brand);
  color:#fff;
}
.workflow-nav .count{
  justify-self:end;
}

#mainShell .view{
  grid-column:2;
  min-width:0;
  margin:0;
}

#mainShell .topbar{
  padding-left:max(18px,calc((100vw - 1600px)/2 + 18px));
  padding-right:max(18px,calc((100vw - 1600px)/2 + 18px));
}

#view-inbox .layout{
  grid-template-columns:minmax(0,1fr) 280px;
}
#view-inbox .section{
  margin-bottom:14px;
}
#view-inbox .request-primary-actions{
  position:sticky;
  bottom:10px;
  z-index:5;
  padding:10px;
  margin:14px -4px -4px;
  border:1px solid var(--line);
  border-radius:12px;
  background:rgba(255,255,255,.96);
  backdrop-filter:blur(8px);
}
.direct-reuse-section{
  border-color:#d5e6f3;
  background:#fbfdff;
}

/* Les écrans larges utilisent mieux l'espace disponible */
#view-quotes .card-body,
#view-todo .card-body,
#view-production .card-body{
  padding:14px;
}
.history-piece{
  grid-template-columns:minmax(260px,1fr) 175px minmax(320px,auto);
}

/* Entête un peu plus calme */
.topbar{
  min-height:64px;
}
.topbar .brand span{
  opacity:.82;
}
.top-actions{
  gap:6px;
}
.top-actions .btn{
  padding:8px 10px;
}

/* Responsive : retour à une navigation horizontale sur tablette */
@media(max-width:1080px){
  #mainShell .app{
    display:block;
    padding-top:12px;
  }
  .workflow-nav{
    position:static;
    display:flex;
    flex-direction:row;
    flex-wrap:wrap;
    margin-bottom:12px;
    padding:8px;
  }
  .workflow-nav .nav-label{display:none}
  .workflow-nav .tab{
    width:auto;
    min-height:38px;
    grid-template-columns:24px auto auto;
    flex:1 1 130px;
  }
  .workflow-nav .nav-icon{
    width:23px;height:23px;
  }
  #view-inbox .layout{grid-template-columns:1fr}
  #view-inbox aside.sticky{position:static}
}
@media(max-width:700px){
  .workflow-nav .nav-icon{display:none}
  .workflow-nav .tab{grid-template-columns:minmax(0,1fr) auto}
  .history-piece{grid-template-columns:1fr}
}

/* Recherche des pièces atelier */
.direct-reuse-section .reuse-result span{
  line-height:1.45;
}


/* v1.13 - flux Reception > A traiter > Devis/Commandes > Production */
#view-inbox .card-head .toolbar{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
}
#view-inbox .card-head .success{
  white-space:nowrap;
}
#view-quotes .direct-group>summary{
  background:#f3faf6;
}
#view-quotes .direct-group .count-pill{
  background:#e6f5ed;
  color:#16794a!important;
}


/* v1.14 - Catalogue produits */
.product-catalog-section{border-color:#cfe0ef;background:#fbfdff}
.product-list{display:grid;gap:8px;margin-top:10px}
.product-card{
  display:grid;
  grid-template-columns:minmax(220px,1fr) 130px minmax(310px,auto);
  gap:12px;
  align-items:center;
  padding:11px 12px;
  border:1px solid var(--line);
  border-radius:11px;
  background:#fff;
}
.product-main b{display:block;font-size:13px}
.product-main span,.product-main small{display:block;margin-top:2px}
.product-main span{font-size:12px}.product-main small{font-size:10px;color:var(--muted)}
.product-price{text-align:right}.product-price span{display:block;font-size:10px;color:var(--muted)}.product-price b{font-size:14px;color:#16794a}
.product-actions{display:flex;gap:5px;justify-content:flex-end;flex-wrap:wrap}
.danger-zone{border-color:#efc5c2;background:#fffafa}
.erase-dialog{width:min(620px,calc(100vw - 36px));max-width:620px}
@media(max-width:1000px){
  .product-card{grid-template-columns:minmax(0,1fr) 120px}
  .product-actions{grid-column:1/-1;justify-content:flex-start}
}
@media(max-width:650px){
  .product-card{grid-template-columns:1fr}.product-price{text-align:left}.product-actions{grid-column:auto}
}


/* v1.15 - Réception intelligente unifiée */
.smart-reception-section{
  border-color:#cfe0ef;
  background:linear-gradient(180deg,#fbfdff,#f8fbfe);
}
.smart-help{
  padding:10px 12px;
  border-radius:10px;
  background:#eef7ff;
  border:1px solid #d3e6f5;
  font-size:12px;
  line-height:1.5;
  color:#36556e;
}
.smart-search-bar{
  display:flex;
  gap:10px;
  align-items:center;
  margin-top:12px;
}
.smart-search-bar input{flex:1}
.smart-filter-row{
  display:flex;
  gap:6px;
  flex-wrap:wrap;
  margin-top:9px;
}
.smart-filter{
  border:1px solid var(--line);
  border-radius:999px;
  background:#fff;
  color:#475467;
  padding:6px 10px;
  font-size:11px;
  font-weight:800;
  cursor:pointer;
}
.smart-filter.active{
  background:var(--brand);
  color:#fff;
  border-color:var(--brand);
}
.smart-results{
  display:grid;
  gap:7px;
  margin-top:10px;
  max-height:410px;
  overflow:auto;
  padding-right:3px;
}
.smart-result{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:12px;
  align-items:center;
  padding:10px 11px;
  border:1px solid var(--line);
  border-radius:10px;
  background:#fff;
}
.smart-result.selected{
  border-color:#99c6e8;
  background:#f4faff;
}
.smart-result-main b{font-size:13px}
.smart-result-main>span{display:block;font-size:12px;margin-top:2px}
.smart-result-main small{display:block;color:var(--muted);font-size:10.5px;margin-top:3px}
.smart-result-top{
  display:flex;
  gap:7px;
  align-items:center;
}
.smart-type{
  padding:3px 6px;
  border-radius:999px;
  font-size:9px;
  font-weight:900;
  text-transform:uppercase;
  letter-spacing:.03em;
}
.smart-type.product{background:#e7f6ee;color:#16794a}
.smart-type.quote{background:#eaf3fb;color:#0f4c81}
.smart-type.production{background:#fff4df;color:#9a5b00}
.smart-result-actions{
  display:flex;
  gap:5px;
  flex-wrap:wrap;
  justify-content:flex-end;
}
@media(max-width:760px){
  .smart-search-bar{align-items:stretch;flex-direction:column}
  .smart-result{grid-template-columns:1fr}
  .smart-result-actions{justify-content:flex-start}
}


/* v1.16 - création de listes de produits */
.bulk-products-dialog{
  display:block;
  width:min(900px,calc(100vw - 36px));
  max-width:900px;
  padding:24px;
}
.bulk-products-dialog .app-modal-content{width:100%;min-width:0}
.bulk-format-card{
  border:1px solid var(--line);
  border-radius:10px;
  padding:9px 11px;
  background:#f8fbfe;
}
.bulk-format-card b,.bulk-format-card code,.bulk-format-card span{display:block}
.bulk-format-card b{font-size:11px}
.bulk-format-card code{margin-top:4px;font-size:12px;font-weight:800;color:var(--brand)}
.bulk-format-card span{margin-top:3px;font-size:10px;color:var(--muted)}
.bulk-products-text{
  min-height:230px;
  font-family:ui-monospace,SFMono-Regular,Consolas,monospace;
  line-height:1.5;
}
.bulk-tools{
  margin-top:9px;
  display:flex;
  align-items:center;
  gap:7px;
  flex-wrap:wrap;
}
.bulk-products-preview{
  margin-top:10px;
  max-height:300px;
  overflow:auto;
  border:1px solid var(--line);
  border-radius:10px;
}
.bulk-preview-head,.bulk-preview-row{
  display:grid;
  grid-template-columns:180px minmax(220px,1fr) 120px;
  gap:7px;
  align-items:center;
  padding:7px 9px;
}
.bulk-preview-head{
  position:sticky;
  top:0;
  z-index:2;
  background:#f6f9fc;
  font-size:10px;
  font-weight:850;
  color:#667085;
  border-bottom:1px solid var(--line);
}
.bulk-preview-row{border-bottom:1px solid #edf1f5}
.bulk-preview-row:last-child{border-bottom:0}
.bulk-preview-row input{padding:7px 8px}
.warning-action{
  background:#fff6e8;
  color:#8a5600;
  border:1px solid #ecd7ae;
}
.smart-missing-plan{
  display:inline-flex;
  align-items:center;
  padding:5px 8px;
  border-radius:999px;
  background:#fff4df;
  color:#9a5b00;
  font-size:10px;
  font-weight:800;
}
@media(max-width:700px){
  .bulk-products-dialog{width:calc(100vw - 20px);padding:16px}
  .bulk-preview-head{display:none}
  .bulk-preview-row{grid-template-columns:1fr}
}

/* v1.17 - commande client + nom réel des pièces */
.incoming-piece-list{display:grid;gap:7px;margin-top:8px;width:100%}
.incoming-piece-row{display:grid;grid-template-columns:minmax(180px,1fr) minmax(220px,1.25fr) auto;gap:9px;align-items:end;padding:9px;border:1px solid var(--line);border-radius:9px;background:#fff}
.incoming-file b,.incoming-file span{display:block}.incoming-file b{font-size:11px}.incoming-file span{font-size:10px;color:var(--muted);margin-top:2px}
.incoming-piece-row label{margin:0}
.customer-order-tag{display:inline-flex;align-items:center;padding:3px 7px;border-radius:999px;background:#f0ecff;color:#5b3eb5!important;font-size:10px!important;font-weight:850}
@media(max-width:760px){.incoming-piece-row{grid-template-columns:1fr}}

/* v1.18 - renommage rapide des produits */
.smart-result-actions .btn.ghost{white-space:nowrap}

/* v1.18.1 - fenêtre intégrée pour le nom des produits */
.product-name-dialog{
  width:min(560px,calc(100vw - 36px));
  max-width:560px;
}
.product-name-dialog input{
  font-size:14px;
  font-weight:700;
}

/* v1.19 - insertion directe dans la priorité */
.priority-control{
  display:flex;
  align-items:center;
  gap:6px;
  flex-wrap:wrap;
}
.priority-select{
  width:auto;
  min-width:92px;
  padding:5px 7px;
  font-size:10px;
  font-weight:800;
  border-radius:8px;
}

/* v1.20 - recherche rapide Production */
.production-find-bar{
  margin-bottom:12px;
  padding:10px 12px;
  border:1px solid var(--line);
  border-radius:12px;
  background:#f8fbfe;
  display:grid;
  grid-template-columns:minmax(180px,.8fr) minmax(340px,1.4fr);
  gap:8px 14px;
  align-items:center;
}
.production-find-copy b,.production-find-copy span{display:block}
.production-find-copy b{font-size:12px}
.production-find-copy span{font-size:10px;color:var(--muted);margin-top:2px}
.production-find-controls{display:flex;gap:6px;align-items:center}
.production-find-controls .search{flex:1;min-width:0}
.production-find-status{
  grid-column:1/-1;
  min-height:0;
  color:#475467;
  font-size:10.5px;
  line-height:1.45;
}
.production-search-hidden{display:none!important}
.production-machine-no-match{opacity:.28}
.production-search-hit{
  border-color:#7bb4de!important;
  box-shadow:0 0 0 2px rgba(29,111,170,.08);
}
.production-search-focus{
  animation:productionFocusPulse .7s ease-in-out 2;
  box-shadow:0 0 0 4px rgba(29,111,170,.18)!important;
}
@keyframes productionFocusPulse{
  0%,100%{transform:translateY(0)}
  50%{transform:translateY(-2px)}
}
@media(max-width:850px){
  .production-find-bar{grid-template-columns:1fr}
  .production-find-status{grid-column:auto}
}

/* v1.21 - commande intelligente + anonymisation prompt */
.smart-title-row{
  display:flex!important;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}
.smart-title-row>div{display:flex;align-items:center;gap:7px}
.bulk-order-preview{
  margin-top:10px;
  max-height:330px;
  overflow:auto;
  border:1px solid var(--line);
  border-radius:10px;
}
.bulk-order-head,.bulk-order-row{
  display:grid;
  grid-template-columns:155px 150px minmax(180px,1fr) 70px 100px minmax(160px,1fr);
  gap:6px;
  align-items:center;
  padding:7px 8px;
}
.bulk-order-head{
  position:sticky;
  top:0;
  z-index:2;
  background:#f6f9fc;
  border-bottom:1px solid var(--line);
  font-size:9px;
  font-weight:900;
  color:#667085;
}
.bulk-order-row{border-bottom:1px solid #edf1f5}
.bulk-order-state{
  display:inline-flex;
  width:max-content;
  max-width:100%;
  padding:4px 7px;
  border-radius:999px;
  font-size:9px;
  font-weight:900;
}
.bulk-order-state.ready{background:#e7f6ee;color:#16794a}
.bulk-order-state.warning{background:#fff4df;color:#9a5b00}
.bulk-order-state.new{background:#eaf3fb;color:#0f4c81}
.bulk-order-row input,.bulk-order-row select{min-width:0;padding:7px}
@media(max-width:950px){
  .bulk-order-head{display:none}
  .bulk-order-row{grid-template-columns:1fr 1fr}
  .bulk-order-state{grid-column:1/-1}
}
@media(max-width:600px){
  .smart-title-row{align-items:stretch;flex-direction:column}
  .bulk-order-row{grid-template-columns:1fr}
  .bulk-order-state{grid-column:auto}
}


/* v1.22 - analyse autonome locale expérimentale */
.local-analyze-switch{border:1px solid #d4e4f1;border-radius:11px;background:#f7fbff;padding:10px 12px}
.switch-line{display:flex!important;align-items:flex-start;gap:10px;margin:0!important;cursor:pointer}
.switch-line input{width:18px;height:18px;margin-top:2px;flex:0 0 auto}
.switch-line span{display:block}.switch-line b,.switch-line small{display:block}.switch-line b{font-size:12px;color:#174e78}.switch-line small{font-size:10.5px;color:var(--muted);line-height:1.45;margin-top:3px}
.local-analyze-panel{margin-top:9px;border:1px dashed #9ec5df;border-radius:10px;padding:10px 12px;display:flex;align-items:center;justify-content:space-between;gap:12px;background:#fff}
.local-analyze-panel>div b,.local-analyze-panel>div span{display:block}.local-analyze-panel>div b{font-size:11px}.local-analyze-panel>div span{font-size:10.5px;color:var(--muted);margin-top:3px;word-break:break-all}
@media(max-width:650px){.local-analyze-panel{align-items:stretch;flex-direction:column}}


/* v1.22.1 - dépôt direct du PDF */
.local-drop-panel{padding:0!important;border:0!important;background:transparent!important}
.local-drop-zone{
  width:100%;min-height:118px;padding:16px;border:2px dashed #aac4d9;border-radius:13px;
  background:#f8fbfe;display:grid;grid-template-columns:54px minmax(0,1fr) auto;gap:13px;align-items:center;
  transition:.15s ease;cursor:default;
}
.local-drop-zone.dragover{border-color:var(--brand);background:#edf7ff;box-shadow:0 0 0 4px rgba(29,111,170,.08)}
.local-drop-icon{width:52px;height:52px;border-radius:11px;background:#e9f3fb;color:var(--brand);display:grid;place-items:center;font-weight:950;font-size:12px}
.local-drop-copy b,.local-drop-copy span{display:block}.local-drop-copy b{font-size:13px}.local-drop-copy span{font-size:11px;color:var(--muted);margin-top:4px}
@media(max-width:700px){.local-drop-zone{grid-template-columns:44px 1fr}.local-drop-zone .btn{grid-column:1/-1;width:100%}.local-drop-icon{width:42px;height:42px}}

/* v1.23 - micro-cerveau ATCN */
.micro-brain-status{
  display:block;
  width:max-content;
  margin-top:4px;
  padding:3px 7px;
  border-radius:999px;
  background:#e9f6ef;
  color:#16794a;
  font-size:9px;
  font-weight:850;
}

/* v1.25 - PDF direct dans Commande intelligente */
.bulk-order-head,.bulk-order-row{grid-template-columns:145px 140px minmax(180px,1fr) 65px 95px 115px minmax(155px,1fr)}
.bulk-order-command-ref{padding:7px 8px;border:1px solid #d7e0e8;border-radius:8px;background:#f4f8fb;font-size:10px;font-weight:850;color:#164f7a;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.production-order-ref{background:#edf5ff!important;border-color:#bdd8f1!important;color:#0f5287!important;font-weight:850!important}
@media(max-width:1100px){.bulk-order-head{display:none}.bulk-order-row{grid-template-columns:1fr 1fr}.bulk-order-state{grid-column:1/-1}}
@media(max-width:650px){.bulk-order-row{grid-template-columns:1fr}}


/* v1.25.1 - import commande : fenêtre adaptée aux grands écrans et petites hauteurs */
#bulkOrderModal.app-modal,
#bulkProductsModal.app-modal{
  padding:18px;
  align-items:center;
  overflow:hidden;
}
#bulkOrderModal .bulk-products-dialog,
#bulkProductsModal .bulk-products-dialog{
  width:min(1180px,calc(100vw - 36px));
  max-width:1180px;
  max-height:calc(100vh - 36px);
  height:auto;
  padding:0;
  display:block;
  overflow:hidden;
}
#bulkOrderModal .app-modal-content,
#bulkProductsModal .app-modal-content{
  max-height:calc(100vh - 36px);
  overflow:auto;
  padding:22px 24px 0;
  scrollbar-gutter:stable;
}
#bulkOrderModal .bulk-products-text{
  min-height:120px;
  height:150px;
  max-height:190px;
  resize:vertical;
}
#bulkOrderModal .bulk-order-preview{
  max-height:min(310px,32vh);
  overflow:auto;
}
#bulkOrderModal .app-modal-actions,
#bulkProductsModal .app-modal-actions{
  position:sticky;
  bottom:0;
  z-index:12;
  margin:14px -24px 0;
  padding:12px 24px 16px;
  background:linear-gradient(to bottom,rgba(255,255,255,.92),#fff 28%);
  border-top:1px solid #e7edf3;
}
#bulkOrderModal .bulk-order-head,
#bulkOrderModal .bulk-order-row{
  grid-template-columns:125px 150px minmax(220px,1.4fr) 68px 95px 110px minmax(155px,1fr);
}
#bulkOrderModal .bulk-order-row input,
#bulkOrderModal .bulk-order-row select{
  width:100%;
  box-sizing:border-box;
}
@media(max-height:850px){
  #bulkOrderModal .app-modal-content{padding-top:16px}
  #bulkOrderModal .app-modal-text{margin-top:5px}
  #bulkOrderModal .local-analyze-switch{padding:7px 10px}
  #bulkOrderModal .local-analyze-panel{padding:7px 9px}
  #bulkOrderModal .bulk-products-text{height:105px;min-height:90px}
  #bulkOrderModal .bulk-order-preview{max-height:250px}
}
@media(max-width:1050px){
  #bulkOrderModal .bulk-order-head{display:none}
  #bulkOrderModal .bulk-order-row{grid-template-columns:130px 1fr 1.3fr 80px 100px 115px 1fr}
}

/* v1.25.2 - détection des produits existants dans l'import */
.bulk-existing-tools{
  margin-top:9px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  flex-wrap:wrap;
  padding:8px 10px;
  border:1px solid var(--line);
  border-radius:9px;
  background:#f8fafc;
}
.bulk-new-only{
  display:flex!important;
  align-items:center;
  gap:7px;
  margin:0!important;
  font-size:11px;
  font-weight:800;
  cursor:pointer;
}
.bulk-new-only input{width:16px;height:16px;margin:0}
.bulk-preview-head-status,.bulk-preview-row-status{
  grid-template-columns:105px 180px minmax(220px,1fr) 120px!important;
}
.bulk-product-state{
  display:inline-flex;
  width:max-content;
  padding:4px 7px;
  border-radius:999px;
  font-size:9px;
  font-weight:900;
}
.bulk-product-state.new{background:#e7f6ee;color:#16794a}
.bulk-product-state.existing{background:#eef2f6;color:#475467}
.bulk-product-state.duplicate{background:#fff4df;color:#9a5b00}
.bulk-preview-row-status.existing{background:#f8fafc;opacity:.82}
.bulk-preview-row-status.existing input{background:#f2f4f7;color:#667085}
.success-empty{color:#16794a;background:#f3faf6}
@media(max-width:700px){
  .bulk-preview-head-status{display:none!important}
  .bulk-preview-row-status{grid-template-columns:1fr!important}
}

/* v1.25.3 - produits déjà importés visibles */
.bulk-product-state.existing{
  background:#eef2f6;
  color:#344054;
  border:1px solid #d0d5dd;
}
.bulk-preview-row-status.existing{
  background:#f8fafc;
  opacity:1;
}
.bulk-preview-row-status.existing input{
  background:#f2f4f7;
  color:#667085;
  border-color:#d0d5dd;
}

/* v1.26 - suivi complet des commandes client dans Production > Terminées */
.production-order-history{display:grid;gap:10px}
.production-order-filters{display:flex;gap:6px;flex-wrap:wrap;margin:10px 0 12px}
.prod-order-filter{border:1px solid var(--line);background:#fff;color:#475467;border-radius:999px;padding:6px 10px;font-size:10px;font-weight:850;cursor:pointer}
.prod-order-filter.active{background:var(--brand);border-color:var(--brand);color:#fff}
.customer-order-card{border:1px solid var(--line);border-radius:12px;background:#fff;padding:12px}
.customer-order-card.complete{border-color:#b8dfc9;background:#fbfefc}
.customer-order-card.incomplete{border-color:#f0d7a6;background:#fffdf8}
.customer-order-head{display:flex;justify-content:space-between;align-items:flex-start;gap:12px}
.customer-order-title{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.customer-order-title b{font-size:13px}
.customer-order-title span{font-size:12px;font-weight:900;color:#0f4c81;background:#eaf3fb;border-radius:999px;padding:4px 8px}
.customer-order-status{margin-top:5px;font-size:11px;font-weight:900}
.customer-order-status.complete{color:#16794a}
.customer-order-status.incomplete{color:#9a5b00}
.customer-order-progress{height:6px;background:#edf1f5;border-radius:999px;overflow:hidden;margin-top:10px}
.customer-order-progress span{display:block;height:100%;background:#1f8a58;border-radius:999px}
.customer-order-summary{display:flex;gap:7px;flex-wrap:wrap;margin-top:8px}
.customer-order-summary span{font-size:9.5px;font-weight:800;background:#f2f4f7;border-radius:999px;padding:4px 7px}
.customer-order-summary .done{background:#e7f6ee;color:#16794a}
.customer-order-summary .active{background:#eaf3fb;color:#0f4c81}
.customer-order-summary .pending{background:#fff4df;color:#9a5b00}
.customer-order-lines{margin-top:10px;border-top:1px solid var(--line)}
.customer-order-line{display:grid;grid-template-columns:minmax(220px,1.4fr) 80px minmax(190px,.8fr) auto;gap:8px;align-items:center;padding:9px 4px;border-bottom:1px solid #edf1f5}
.order-line-ref b,.order-line-ref span{display:block}.order-line-ref b{font-size:11px}.order-line-ref span{font-size:10px;color:var(--muted);margin-top:2px}
.order-line-status{font-size:10px;font-weight:850}
.order-line-status.done{color:#16794a}.order-line-status.active{color:#0f4c81}.order-line-status.pending{color:#9a5b00}
.order-line-actions{display:flex;gap:5px;justify-content:flex-end}
.legacy-production-title{margin:16px 0 8px;padding-top:12px;border-top:1px solid var(--line)}
.legacy-production-title b,.legacy-production-title span{display:block}.legacy-production-title span{font-size:10px;color:var(--muted);margin-top:2px}
@media(max-width:850px){.customer-order-line{grid-template-columns:1fr 80px}.order-line-status,.order-line-actions{grid-column:1/-1}.order-line-actions{justify-content:flex-start}}


/* v1.26.1 - Configuration : plus de colonne étroite à droite */
#view-config .config-layout{
  grid-template-columns:minmax(0,1fr)!important;
  gap:14px;
}
#view-config .config-layout>.sticky{
  position:static!important;
  top:auto!important;
  width:100%;
}
#view-config .config-layout>.sticky .card-body{
  padding-top:12px;
}

/* Les réglages atelier passent sous les matières et utilisent toute la largeur */
#view-config .calibration-grid{
  grid-template-columns:repeat(4,minmax(220px,1fr));
  gap:10px;
}
#view-config .cal-row{
  display:grid;
  grid-template-columns:minmax(0,1fr) 42px!important;
  grid-template-rows:auto auto;
  gap:8px 10px;
  align-items:center;
  overflow:visible;
  min-height:106px;
}
#view-config .cal-row>div:first-child{
  grid-column:1 / -1!important;
}
#view-config .cal-row input[type="range"]{
  grid-column:1!important;
  width:100%;
}
#view-config .cal-row output{
  grid-column:2!important;
  width:42px;
}
#view-config .cal-row.all{
  grid-column:span 2;
}
#view-config .calibration-intro{
  max-width:none;
}
#view-config .calibration-scale{
  justify-content:center;
  gap:18px;
  font-size:10px;
  margin:10px 0 2px;
}

/* Les autres sections des réglages gardent une lecture large */
#view-config .config-layout>.sticky .section{
  width:100%;
}
#view-config .config-layout>.sticky .notice{
  max-width:none;
}

@media(max-width:1400px){
  #view-config .calibration-grid{
    grid-template-columns:repeat(3,minmax(220px,1fr));
  }
  #view-config .cal-row.all{grid-column:span 1}
}
@media(max-width:1050px){
  #view-config .calibration-grid{
    grid-template-columns:repeat(2,minmax(220px,1fr));
  }
}
@media(max-width:680px){
  #view-config .calibration-grid{
    grid-template-columns:1fr;
  }
  #view-config .calibration-scale{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:5px 12px;
  }
}

/* ==========================================================
   VISIONNEUSE PLAN OUVRIER - PC + TABLETTE
   ========================================================== */

.worker-plan-preview-wrap{
  position:relative;
  min-height:360px;
  overflow:hidden;
  border-radius:10px;
}

.worker-plan-preview-wrap iframe{
  width:100%;
  height:100%;
  min-height:360px;
  border:0;
  display:block;
  background:#111;
}

.worker-plan-enlarge{
  position:absolute;
  right:12px;
  bottom:12px;
  z-index:5;

  border:1px solid rgba(255,255,255,.20);
  border-radius:9px;

  background:rgba(15,18,22,.88);
  color:#fff;

  padding:9px 14px;

  font-size:12px;
  font-weight:700;

  cursor:pointer;

  backdrop-filter:blur(8px);
  -webkit-backdrop-filter:blur(8px);

  box-shadow:0 4px 18px rgba(0,0,0,.35);
}

.worker-plan-enlarge:hover{
  background:#252a30;
}

.plan-viewer-modal{
  position:fixed;
  inset:0;
  z-index:100000;
  display:flex;
  align-items:center;
  justify-content:center;
}

.plan-viewer-modal.hidden{
  display:none !important;
}

.plan-viewer-backdrop{
  position:absolute;
  inset:0;
  background:rgba(0,0,0,.86);
  backdrop-filter:blur(5px);
  -webkit-backdrop-filter:blur(5px);
}

.plan-viewer-dialog{
  position:relative;
  z-index:2;

  width:96vw;
  height:96vh;

  display:flex;
  flex-direction:column;

  background:#11161b;
  border:1px solid #353b42;
  border-radius:14px;

  overflow:hidden;

  box-shadow:0 30px 100px rgba(0,0,0,.65);
}

.plan-viewer-header{
  flex:0 0 auto;

  min-height:64px;

  display:flex;
  align-items:center;
  justify-content:space-between;

  padding:10px 16px;

  background:#171c22;
  border-bottom:1px solid #30363d;
}

.plan-viewer-header h3{
  margin:2px 0 0;
  color:#f3f3f3;
  font-size:17px;
}

.plan-viewer-kicker{
  color:#999;
  font-size:10px;
  text-transform:uppercase;
  letter-spacing:.08em;
}

.plan-viewer-close{
  width:42px;
  height:42px;

  border:1px solid #3d444c;
  border-radius:9px;

  background:#20252b;
  color:#fff;

  font-size:28px;
  line-height:1;

  cursor:pointer;
}

.plan-viewer-toolbar{
  flex:0 0 auto;

  min-height:52px;

  display:flex;
  align-items:center;
  justify-content:center;

  gap:8px;

  padding:7px 12px;

  background:#14191e;
  border-bottom:1px solid #2d3339;
}

.plan-viewer-toolbar button{
  min-width:46px;
  height:36px;

  border:1px solid #3c4249;
  border-radius:8px;

  background:#242a30;
  color:#eee;

  padding:0 12px;

  font-size:14px;
  font-weight:700;

  cursor:pointer;
}

.plan-viewer-toolbar button:hover{
  background:#30363c;
}

#planViewerZoom{
  min-width:72px;
  text-align:center;
  color:#ddd;
  font-weight:700;
  font-size:12px;
}

.plan-viewer-canvas{
  flex:1 1 auto;

  position:relative;

  overflow:auto;

  background:#0b0e11;

  padding:18px;

  text-align:center;

  overscroll-behavior:contain;
  -webkit-overflow-scrolling:touch;

  touch-action:pan-x pan-y;
}

.plan-viewer-image{
  display:block;
}

#planViewerImage{
  display:block;

  width:100%;
  max-width:none;

  margin:0 auto;

  background:#fff;

  box-shadow:0 4px 35px rgba(0,0,0,.55);

  user-select:none;
  -webkit-user-select:none;
}

@media (max-width:900px){

  .plan-viewer-dialog{
    width:100vw;
    height:100dvh;
    border:0;
    border-radius:0;
  }

  .plan-viewer-header{
    min-height:54px;
    padding:7px 10px;
  }

  .plan-viewer-toolbar{
    position:relative;
    min-height:54px;
    padding:7px;
  }

  .plan-viewer-toolbar button{
    min-width:44px;
    height:40px;
    padding:0 10px;
  }

  .plan-viewer-canvas{
    padding:8px;
  }

  .worker-plan-enlarge{
    right:8px;
    bottom:8px;
    padding:10px 14px;
    font-size:13px;
  }
}

/* ===== ATCN TABLETTE ===== */

.worker-fullscreen-btn{
  margin-left:auto;
}

@media(max-width:900px){

  #workerPanel .worker-top{
    position:sticky;
    top:0;
    z-index:50;

    display:flex;
    align-items:center;
    gap:8px;
  }

  .worker-fullscreen-btn{
    min-height:44px;
    padding:0 13px;
    white-space:nowrap;
  }

  #jobTakePhoto,
  #jobImportPhoto{
    min-height:48px;
    font-size:14px;
  }

}


/* ==========================================================
   ATCN PHOTOS - VERSION PROPRE UNIQUE
   ========================================================== */

#jobPhotoGallery{
  display:grid !important;
  grid-template-columns:repeat(2,minmax(0,1fr)) !important;
  gap:12px !important;
  margin-top:10px !important;
  overflow:visible !important;
}

#jobPhotoGallery .job-photo{
  display:block !important;
  position:relative !important;

  width:100% !important;
  height:auto !important;

  padding:8px !important;

  overflow:visible !important;

  background:#f7f9fc !important;

  border:1px solid #d8e0e8 !important;
  border-radius:10px !important;

  box-sizing:border-box !important;
}

#jobPhotoGallery .atcn-photo-thumb{
  display:block !important;

  position:static !important;

  width:100% !important;
  height:auto !important;

  min-height:0 !important;
  max-height:none !important;

  aspect-ratio:auto !important;

  object-fit:contain !important;

  opacity:1 !important;
  visibility:visible !important;

  margin:0 !important;
  padding:0 !important;

  border-radius:7px !important;

  background:#ddd !important;

  cursor:pointer !important;

  pointer-events:auto !important;
}

#jobPhotoGallery .atcn-photo-info{
  display:flex !important;
  flex-direction:column !important;

  gap:7px !important;

  margin-top:7px !important;
  padding:0 !important;

  overflow:visible !important;

  color:#4b5967 !important;
  font-size:11px !important;
}

#jobPhotoGallery .atcn-photo-delete{
  display:block !important;

  position:static !important;

  width:100% !important;
  height:auto !important;
  min-height:42px !important;

  margin:0 !important;

  opacity:1 !important;
  visibility:visible !important;

  pointer-events:auto !important;
}


/* ===== PHOTO AGRANDIE ===== */

.atcn-photo-fullscreen{
  display:none !important;

  position:fixed !important;
  inset:0 !important;

  z-index:9999999 !important;

  align-items:center !important;
  justify-content:center !important;
}

.atcn-photo-fullscreen.visible{
  display:flex !important;
}

.atcn-photo-fullscreen-bg{
  position:absolute !important;
  inset:0 !important;

  background:rgba(0,0,0,.94) !important;
}

#atcnPhotoFullscreenImage{
  display:block !important;

  position:relative !important;

  z-index:2 !important;

  width:auto !important;
  height:auto !important;

  max-width:96vw !important;
  max-height:94vh !important;

  object-fit:contain !important;

  opacity:1 !important;
  visibility:visible !important;
}

#atcnPhotoFullscreenClose{
  display:flex !important;

  position:fixed !important;

  top:12px !important;
  right:12px !important;

  z-index:3 !important;

  width:50px !important;
  height:50px !important;

  align-items:center !important;
  justify-content:center !important;

  border:1px solid rgba(255,255,255,.30) !important;
  border-radius:50% !important;

  background:rgba(0,0,0,.70) !important;

  color:white !important;
  font-size:30px !important;
}


/* TABLETTE */

@media(max-width:900px){

  #jobPhotoGallery{
    grid-template-columns:1fr 1fr !important;
  }

  #jobPhotoGallery .job-photo{
    padding:6px !important;
  }

  #jobPhotoGallery .atcn-photo-delete{
    min-height:46px !important;
    font-size:13px !important;
  }
}

/* ==========================================================
   ATCN ADMIN RESPONSIVE
   PC = interface large
   TABLETTE = interface tactile adaptee
   ========================================================== */

/* ===== PC ===== */

@media (min-width: 1101px){

  body:not(.worker-only) .main-shell{
    width:100%;
  }

}


/* ===== TABLETTE ===== */

@media (max-width: 1100px){

  body:not(.worker-only){
    overflow-x:hidden;
  }

  body:not(.worker-only) .main-shell{
    width:100%;
    max-width:100%;
    overflow-x:hidden;
  }

  /* barre du haut */
  body:not(.worker-only) .topbar{
    display:flex;
    flex-wrap:wrap;
    gap:8px;
    padding:10px;
  }

  body:not(.worker-only) .top-actions{
    width:100%;
    display:flex;
    flex-wrap:wrap;
    gap:8px;
  }

  body:not(.worker-only) .top-actions .btn{
    min-height:44px;
    flex:1 1 auto;
  }


  /* navigation */
  body:not(.worker-only) .nav,
  body:not(.worker-only) .tabs,
  body:not(.worker-only) .sidebar{
    overflow-x:auto;
    -webkit-overflow-scrolling:touch;
  }


  /* grilles admin */
  body:not(.worker-only) .grid-2,
  body:not(.worker-only) .grid-3,
  body:not(.worker-only) .split,
  body:not(.worker-only) .editor-grid,
  body:not(.worker-only) .config-grid,
  body:not(.worker-only) .production-grid{
    grid-template-columns:1fr !important;
  }


  /* cartes */
  body:not(.worker-only) .card,
  body:not(.worker-only) .panel,
  body:not(.worker-only) section{
    max-width:100%;
  }


  /* champs tactiles */
  body:not(.worker-only) input,
  body:not(.worker-only) select,
  body:not(.worker-only) textarea,
  body:not(.worker-only) button{
    min-height:44px;
    font-size:14px;
  }


  /* tableaux */
  body:not(.worker-only) .table-wrap,
  body:not(.worker-only) table{
    max-width:100%;
  }

  body:not(.worker-only) .table-wrap{
    overflow-x:auto;
    -webkit-overflow-scrolling:touch;
  }

  body:not(.worker-only) table{
    min-width:760px;
  }


  /* modales admin */
  body:not(.worker-only) .modal-dialog,
  body:not(.worker-only) .app-modal-dialog,
  body:not(.worker-only) .prod-plan-dialog{
    width:96vw !important;
    max-width:96vw !important;
    max-height:94vh !important;
    overflow:auto !important;
  }


  /* boutons importants */
  body:not(.worker-only) .btn{
    padding:10px 14px;
  }

}


/* ===== PETITE TABLETTE / PORTRAIT ===== */

@media (max-width: 800px){

  body:not(.worker-only) .brand span{
    display:none;
  }

  body:not(.worker-only) .top-actions{
    display:grid;
    grid-template-columns:1fr 1fr;
  }

  body:not(.worker-only) .top-actions .btn{
    width:100%;
  }

  body:not(.worker-only) h1{
    font-size:22px;
  }

  body:not(.worker-only) h2{
    font-size:18px;
  }

  body:not(.worker-only) .card,
  body:not(.worker-only) .panel{
    padding:10px;
  }

}

/* ==========================================================
   ATCN ADMIN TABLET V2000
   Tablette uniquement : 701px -> 1100px
   PC > 1100px conserve son interface
   ========================================================== */

@media (min-width:701px) and (max-width:1100px){

  /* ===== BASE TABLETTE ===== */

  body:not(.worker-only){
    overflow-x:hidden !important;
  }

  body:not(.worker-only) .app{
    width:100% !important;
    max-width:none !important;
    padding:12px !important;
    margin:0 !important;
  }

  body:not(.worker-only) .view{
    width:100% !important;
    max-width:100% !important;
    min-width:0 !important;
  }

  body:not(.worker-only) .card{
    min-width:0 !important;
    max-width:100% !important;
  }

  body:not(.worker-only) .card-body{
    padding:14px !important;
  }


  /* ===== BARRE DU HAUT ===== */

  body:not(.worker-only) .topbar{
    height:auto !important;
    min-height:64px !important;
    padding:9px 12px !important;
    gap:10px !important;
    flex-wrap:wrap !important;
  }

  body:not(.worker-only) .top-actions{
    display:flex !important;
    flex-wrap:wrap !important;
    gap:7px !important;
  }

  body:not(.worker-only) .top-actions .btn{
    min-height:42px !important;
  }


  /* ===== NAVIGATION TABLETTE ===== */

  body:not(.worker-only) .workflow-nav{
    display:flex !important;
    flex-wrap:nowrap !important;
    overflow-x:auto !important;
    overflow-y:hidden !important;
    gap:6px !important;
    padding:4px 2px 10px !important;
    -webkit-overflow-scrolling:touch !important;
    scrollbar-width:thin;
  }

  body:not(.worker-only) .workflow-nav .nav-label{
    display:none !important;
  }

  body:not(.worker-only) .workflow-nav .tab{
    flex:0 0 auto !important;
    min-width:118px !important;
    min-height:46px !important;
    padding:9px 11px !important;
    white-space:nowrap !important;
  }


  /* ========================================================
     RECEPTION
     ======================================================== */

  body:not(.worker-only) #view-inbox .layout{
    grid-template-columns:1fr !important;
  }

  body:not(.worker-only) #view-inbox .sticky{
    position:static !important;
  }

  body:not(.worker-only) #view-inbox .grid4{
    grid-template-columns:repeat(2,minmax(0,1fr)) !important;
  }


  /* ========================================================
     A TRAITER
     ======================================================== */

  body:not(.worker-only) #view-todo .todo-grid{
    grid-template-columns:repeat(2,minmax(0,1fr)) !important;
  }

  body:not(.worker-only) #view-todo .plan-row,
  body:not(.worker-only) #view-todo .history-piece{
    grid-template-columns:auto minmax(0,1fr) !important;
  }

  body:not(.worker-only) #view-todo .plan-row > :last-child,
  body:not(.worker-only) #view-todo .history-piece > :last-child{
    grid-column:1/-1 !important;
  }


  /* ========================================================
     DEVIS
     ======================================================== */

  body:not(.worker-only) #view-editor .editor-layout{
    display:grid !important;
    grid-template-columns:minmax(0,1fr) minmax(300px,.72fr) !important;
    gap:12px !important;
    align-items:start !important;
  }

  body:not(.worker-only) #view-editor .editor-form-card{
    grid-column:1 !important;
    min-width:0 !important;
  }

  body:not(.worker-only) #view-editor .preview-card{
    grid-column:2 !important;
    position:static !important;
    min-width:0 !important;
  }

  body:not(.worker-only) #view-editor .ai-card{
    grid-column:1/-1 !important;
    position:static !important;
  }

  body:not(.worker-only) #view-editor .grid4{
    grid-template-columns:repeat(2,minmax(0,1fr)) !important;
  }

  body:not(.worker-only) #view-editor .preview-body{
    height:520px !important;
    min-height:420px !important;
  }

  body:not(.worker-only) #view-editor .preview-tools{
    display:grid !important;
    grid-template-columns:1fr 1fr !important;
    width:100% !important;
    gap:6px !important;
  }

  body:not(.worker-only) #view-editor .preview-tools .btn{
    width:100% !important;
    min-width:0 !important;
  }

  body:not(.worker-only) #view-editor .ai-body{
    display:grid !important;
    grid-template-columns:1fr 1fr !important;
    gap:12px !important;
  }

  body:not(.worker-only) #view-editor .ai-body > .footer-actions,
  body:not(.worker-only) #view-editor .ai-body > .hint,
  body:not(.worker-only) #view-editor .ai-body > .response-state{
    grid-column:1/-1 !important;
  }


  /* ========================================================
     COMMANDES
     ======================================================== */

  body:not(.worker-only) #view-quotes .history-tree{
    width:100% !important;
    min-width:0 !important;
  }

  body:not(.worker-only) #view-quotes .client-group,
  body:not(.worker-only) #view-quotes .request-group{
    width:100% !important;
    min-width:0 !important;
  }

  body:not(.worker-only) #view-quotes .plan-row,
  body:not(.worker-only) #view-quotes .history-piece{
    grid-template-columns:auto minmax(0,1fr) !important;
  }

  body:not(.worker-only) #view-quotes .plan-row > :last-child,
  body:not(.worker-only) #view-quotes .history-piece > :last-child{
    grid-column:1/-1 !important;
  }

  body:not(.worker-only) #view-quotes .request-actionbar{
    width:100% !important;
    flex-wrap:wrap !important;
  }

  body:not(.worker-only) #view-quotes .request-actionbar .btn{
    min-height:42px !important;
  }


  /* ========================================================
     PRODUCTION
     IMPORTANT : machines horizontalement, comme un planning
     ======================================================== */

  body:not(.worker-only) #view-production .card-body{
    overflow:hidden !important;
  }

  body:not(.worker-only) #view-production .production-board{
    display:flex !important;
    flex-wrap:nowrap !important;
    gap:12px !important;
    width:100% !important;
    max-width:100% !important;
    overflow-x:auto !important;
    overflow-y:visible !important;
    padding:2px 2px 12px !important;
    scroll-snap-type:x proximity;
    -webkit-overflow-scrolling:touch !important;
  }

  body:not(.worker-only) #view-production .machine-column{
    flex:0 0 310px !important;
    width:310px !important;
    min-width:310px !important;
    max-width:310px !important;
    scroll-snap-align:start;
  }

  body:not(.worker-only) #view-production .production-find-bar{
    grid-template-columns:1fr !important;
  }

  body:not(.worker-only) #view-production .production-find-controls{
    width:100% !important;
  }

  body:not(.worker-only) #view-production .production-find-controls .search{
    width:100% !important;
    max-width:none !important;
  }

  body:not(.worker-only) #view-production .toolbar{
    flex-wrap:wrap !important;
  }

  body:not(.worker-only) #view-production .production-subtabs{
    overflow-x:auto !important;
    flex-wrap:nowrap !important;
  }


  /* ========================================================
     CLIENTS
     ======================================================== */

  body:not(.worker-only) #view-clients .client-form{
    grid-template-columns:1fr 1fr !important;
  }

  body:not(.worker-only) #view-clients .client-form .btn{
    grid-column:1/-1 !important;
    width:100% !important;
  }

  body:not(.worker-only) #view-clients .tablewrap{
    width:100% !important;
    overflow-x:auto !important;
    -webkit-overflow-scrolling:touch !important;
  }

  body:not(.worker-only) #view-clients table{
    min-width:700px !important;
  }


  /* ========================================================
     CONFIGURATION
     ======================================================== */

  body:not(.worker-only) #view-config .config-layout{
    grid-template-columns:minmax(0,1fr) minmax(280px,340px) !important;
    gap:12px !important;
  }

  body:not(.worker-only) #view-config .config-layout > .sticky{
    position:static !important;
    min-width:0 !important;
  }

  body:not(.worker-only) #view-config .grid4{
    grid-template-columns:repeat(2,minmax(0,1fr)) !important;
  }

  body:not(.worker-only) #view-config .grid2{
    grid-template-columns:1fr !important;
  }

  body:not(.worker-only) #view-config .material-table-wrap{
    width:100% !important;
    overflow-x:auto !important;
    -webkit-overflow-scrolling:touch !important;
  }

  body:not(.worker-only) #view-config .material-table{
    min-width:680px !important;
  }

  body:not(.worker-only) #view-config .cal-row{
    grid-template-columns:minmax(120px,1fr) minmax(100px,.8fr) 42px !important;
    gap:7px !important;
  }

  body:not(.worker-only) #view-config .cfg-machine-row,
  body:not(.worker-only) #view-config .cfg-row{
    min-width:0 !important;
  }


  /* ===== ELEMENTS TACTILES COMMUNS ===== */

  body:not(.worker-only) input,
  body:not(.worker-only) select,
  body:not(.worker-only) button{
    min-height:42px;
  }

  body:not(.worker-only) textarea{
    font-size:14px;
  }

  body:not(.worker-only) .app-modal-dialog,
  body:not(.worker-only) .prod-plan-dialog{
    max-width:96vw !important;
  }

}


/* ==========================================================
   TABLETTE PORTRAIT ET PETITE LARGEUR
   ========================================================== */

@media (min-width:701px) and (max-width:820px){

  body:not(.worker-only) #view-editor .editor-layout{
    grid-template-columns:1fr !important;
  }

  body:not(.worker-only) #view-editor .editor-form-card,
  body:not(.worker-only) #view-editor .preview-card,
  body:not(.worker-only) #view-editor .ai-card{
    grid-column:1 !important;
  }

  body:not(.worker-only) #view-editor .preview-body{
    height:500px !important;
  }

  body:not(.worker-only) #view-config .config-layout{
    grid-template-columns:1fr !important;
  }

  body:not(.worker-only) #view-production .machine-column{
    flex-basis:290px !important;
    width:290px !important;
    min-width:290px !important;
    max-width:290px !important;
  }

}


/* =========================================================
   V2904 - SUIVI COMMANDES CLIENT
   Colonnes séparées : pièce / quantités / statut / actions
   ========================================================= */

.customer-order-line{
  display:grid !important;
  grid-template-columns:
    minmax(260px, 1.35fr)
    minmax(190px, .70fr)
    minmax(280px, 1.05fr)
    minmax(130px, auto) !important;
  column-gap:24px !important;
  row-gap:8px !important;
  align-items:center !important;
  padding:14px 4px !important;
  border-bottom:1px solid #edf1f5 !important;
}

.customer-order-line > *{
  min-width:0 !important;
}

.order-line-ref{
  grid-column:1 !important;
}

.order-line-ref b{
  display:block !important;
  font-size:11px !important;
}

.order-line-ref span{
  display:block !important;
  margin-top:3px !important;
  font-size:10px !important;
  color:var(--muted) !important;
}

/* Bloc Commandé / Réel / Écart */
.customer-order-line > div:nth-child(2){
  grid-column:2 !important;
  display:flex !important;
  flex-direction:column !important;
  gap:4px !important;
  line-height:1.30 !important;
  white-space:normal !important;
}

.customer-order-line > div:nth-child(2) span{
  display:block !important;
  position:static !important;
  white-space:nowrap !important;
}

/* Statut : Terminé ou En production / machine */
.order-line-status{
  grid-column:3 !important;
  display:block !important;
  position:static !important;
  width:auto !important;
  max-width:100% !important;
  margin:0 !important;
  padding:0 !important;
  line-height:1.35 !important;
  white-space:normal !important;
  overflow-wrap:anywhere !important;
  font-size:10px !important;
  font-weight:850 !important;
}

.order-line-status.done{
  color:#16794a !important;
}

.order-line-status.active{
  color:#0f4c81 !important;
}

.order-line-status.pending{
  color:#9a5b00 !important;
}

/* Boutons */
.order-line-actions{
  grid-column:4 !important;
  display:flex !important;
  justify-content:flex-end !important;
  align-items:center !important;
  gap:6px !important;
  flex-wrap:nowrap !important;
  position:static !important;
}

/* Tablette */
@media(max-width:1100px){
  .customer-order-line{
    grid-template-columns:
      minmax(210px,1.1fr)
      minmax(175px,.8fr)
      minmax(210px,1fr) !important;
  }

  .order-line-actions{
    grid-column:1 / -1 !important;
    justify-content:flex-start !important;
  }
}

/* Téléphone */
@media(max-width:760px){
  .customer-order-line{
    grid-template-columns:1fr !important;
    gap:7px !important;
    padding:14px 2px !important;
  }

  .order-line-ref,
  .customer-order-line > div:nth-child(2),
  .order-line-status,
  .order-line-actions{
    grid-column:1 !important;
  }

  .customer-order-line > div:nth-child(2) span{
    white-space:normal !important;
  }

  .order-line-actions{
    justify-content:flex-start !important;
    flex-wrap:wrap !important;
  }
}


/* =========================================================
   V2905 - FICHE ATELIER
   - bloque le planning en arrière-plan
   - scroll uniquement dans la fiche
   - photos nombreuses accessibles
   ========================================================= */

body.worker-job-open{
  overflow:hidden !important;
  overscroll-behavior:none !important;
}

/* La modale ne doit jamais transmettre le scroll au fond */
#workerJobModal{
  overflow:hidden !important;
  overscroll-behavior:contain !important;
}

#workerJobModal .job-detail-backdrop{
  overscroll-behavior:none !important;
  touch-action:none !important;
}

#workerJobModal .job-detail-dialog{
  height:min(930px,97dvh) !important;
  max-height:97dvh !important;
  overflow:hidden !important;
}

/* La grille reste enfermée dans la hauteur de la fenêtre */
#workerJobModal .job-detail-grid{
  min-height:0 !important;
  height:100% !important;
  overflow:hidden !important;
}

/* Le plan ne doit jamais prendre le scroll de la page */
#workerJobModal .job-plan-pane{
  min-height:0 !important;
  overflow:hidden !important;
}

/* C'EST CETTE COLONNE QUI DOIT DEFILER */
#workerJobModal .job-notes-pane{
  min-height:0 !important;
  height:100% !important;

  overflow-x:hidden !important;
  overflow-y:auto !important;

  overscroll-behavior-y:contain !important;
  overscroll-behavior-x:none !important;

  -webkit-overflow-scrolling:touch !important;

  touch-action:pan-y !important;

  padding-bottom:24px !important;
}

/* Les photos restent dans le scroll de droite */
#workerJobModal #jobPhotoGallery{
  overflow:visible !important;
  max-width:100% !important;
}

/* Zone fin de poste bien séparée */
#workerJobModal .finish-panel{
  position:relative !important;
  z-index:5 !important;

  margin-top:20px !important;
  padding:14px 0 18px !important;

  background:#fff !important;
  border-top:2px solid #dce5ed !important;
}

/* Bouton plus confortable à atteindre/toucher */
#workerJobModal #jobDetailFinish{
  min-height:48px !important;
  padding:11px 16px !important;
  font-size:14px !important;
}

/* Tablette / téléphone */
@media(max-width:950px){

  #workerJobModal{
    padding:4px !important;
  }

  #workerJobModal .job-detail-dialog{
    width:99vw !important;
    height:99dvh !important;
    max-height:99dvh !important;
  }

  #workerJobModal .job-detail-grid{
    overflow-y:auto !important;
    overscroll-behavior:contain !important;
  }

  #workerJobModal .job-notes-pane{
    height:auto !important;
    min-height:500px !important;
    overflow:visible !important;
  }

  #workerJobModal #jobDetailFinish{
    width:100% !important;
    min-height:52px !important;
    font-size:15px !important;
  }
}


/* =========================================================
   V2906 - PLEIN ECRAN ATELIER PERSISTANT
   Ne dépend plus du Fullscreen API Android
   ========================================================= */

body.worker-atcn-fullscreen{
  overflow:hidden !important;
}

/* l'espace ouvrier devient une vraie couche plein écran ATCN */
body.worker-atcn-fullscreen #workerPanel{
  display:block !important;
  position:fixed !important;
  inset:0 !important;

  z-index:120 !important;

  width:100vw !important;
  height:100dvh !important;
  max-width:none !important;

  margin:0 !important;
  padding:10px !important;

  overflow-y:auto !important;
  overflow-x:hidden !important;

  overscroll-behavior:contain !important;
  -webkit-overflow-scrolling:touch !important;

  background:#eef3f7 !important;
}

/* la barre ouvrier reste visible en haut */
body.worker-atcn-fullscreen #workerPanel .worker-top{
  position:sticky !important;
  top:0 !important;
  z-index:20 !important;

  margin-top:0 !important;

  background:#fff !important;
}

/* la fiche pièce reste au-dessus du plein écran atelier */
body.worker-atcn-fullscreen #workerJobModal{
  z-index:1000 !important;
}

/* visionneuses/caméra encore au-dessus */
body.worker-atcn-fullscreen .camera-modal,
body.worker-atcn-fullscreen .plan-viewer-modal,
body.worker-atcn-fullscreen .atcn-photo-fullscreen{
  z-index:2000 !important;
}


/* =========================================================
   V2907 - VRAI PLEIN ECRAN ATELIER
   ========================================================= */

/* Annule le faux plein écran V2906 */
body.worker-atcn-fullscreen #workerPanel{
  position:static !important;
  inset:auto !important;
  z-index:auto !important;
  width:auto !important;
  height:auto !important;
  max-width:none !important;
  margin:0 !important;
  padding:0 !important;
  overflow:visible !important;
  background:transparent !important;
}

body.worker-atcn-fullscreen{
  overflow:auto !important;
}

/* bouton de restauration après retour caméra */
#workerFullscreenRestore{
  position:fixed;
  inset:0;
  z-index:999999999;

  display:flex;
  align-items:center;
  justify-content:center;

  background:rgba(7,18,29,.70);
  backdrop-filter:blur(4px);
}

#workerFullscreenRestore.hidden{
  display:none !important;
}

#workerFullscreenRestore button{
  min-width:260px;
  min-height:62px;

  padding:15px 24px;

  border:0;
  border-radius:14px;

  background:#0f5f9a;
  color:#fff;

  font-size:17px;
  font-weight:900;

  box-shadow:0 18px 50px rgba(0,0,0,.30);
}



/* =========================================================
   INVENTAIRE MATIERE
   ========================================================= */

.inventory-sync-note{
  background:#eef7fd;
  border:1px solid #cbe1ef;
  color:#315c78;
  padding:11px 13px;
  border-radius:10px;
  margin-bottom:14px;
  font-size:11px;
}

.inventory-builder{
  display:grid;
  grid-template-columns:minmax(0,1fr) 310px;
  gap:14px;
  align-items:start;
}

.inventory-builder-main{
  min-width:0;
}

.inventory-dimensions{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:10px;
  margin-top:10px;
  padding:11px;
  border:1px solid var(--line);
  border-radius:10px;
  background:#f8fafc;
}

.inventory-length-entry{
  display:grid;
  grid-template-columns:220px auto;
  gap:10px;
  align-items:end;
}

.inventory-length-quick{
  display:flex;
  gap:6px;
  flex-wrap:wrap;
  margin-top:9px;
}

.inventory-pieces{
  display:flex;
  gap:6px;
  flex-wrap:wrap;
  min-height:34px;
  margin-top:10px;
}

.inventory-piece{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:6px 9px;
  border-radius:999px;
  background:#edf3f7;
  font-size:10.5px;
  font-weight:800;
}

.inventory-piece button{
  border:0;
  background:transparent;
  color:#a63d3d;
  padding:0;
  font-weight:900;
  cursor:pointer;
}

.inventory-calc{
  position:sticky;
  top:82px;
  display:grid;
  gap:9px;
}

.inventory-metric{
  border:1px solid var(--line);
  border-radius:11px;
  padding:13px;
  background:#fafcfd;
}

.inventory-metric span{
  display:block;
  font-size:9.5px;
  color:var(--muted);
  text-transform:uppercase;
  font-weight:850;
}

.inventory-metric b{
  display:block;
  font-size:22px;
  margin-top:4px;
}

.inventory-calc-detail{
  padding:12px;
  border:1px dashed #ccd8e0;
  border-radius:10px;
  background:#fff;
  font-size:10.5px;
  line-height:1.55;
}

.inventory-add-line{
  width:100%;
}

.inventory-list-head{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
  margin-top:18px;
  margin-bottom:8px;
}

.inventory-list-head b,
.inventory-list-head span{
  display:block;
}

.inventory-list-head span{
  font-size:10px;
  color:var(--muted);
  margin-top:2px;
}

.inventory-group{
  border:1px solid var(--line);
  border-radius:11px;
  overflow:hidden;
  margin-bottom:10px;
}

.inventory-group-head{
  display:flex;
  justify-content:space-between;
  gap:10px;
  padding:10px 12px;
  background:#f5f8fa;
  border-bottom:1px solid var(--line);
}

.inventory-group-head b{
  font-size:12px;
}

.inventory-group-head span{
  font-size:10px;
  color:var(--muted);
}

.inventory-grand-total{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:9px;
  margin-top:12px;
}

.inventory-grand-total>div{
  padding:11px 13px;
  border:1px solid var(--line);
  border-radius:10px;
  background:#fafcfd;
}

.inventory-grand-total span{
  display:block;
  font-size:9px;
  text-transform:uppercase;
  color:var(--muted);
  font-weight:850;
}

.inventory-grand-total b{
  display:block;
  font-size:17px;
  margin-top:3px;
}

.inventory-archives{
  margin-top:20px;
  padding-top:4px;
  border-top:1px solid var(--line);
}

.inventory-archive-list{
  min-height:55px;
}

/* tablette */
@media(max-width:1100px){

  .inventory-builder{
    grid-template-columns:1fr;
  }

  .inventory-calc{
    position:static;
    grid-template-columns:1fr 1fr;
  }

  .inventory-calc-detail,
  .inventory-add-line{
    grid-column:1/-1;
  }

  .inventory-dimensions{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
}

/* petite tablette */
@media(max-width:760px){

  .inventory-dimensions{
    grid-template-columns:1fr;
  }

  .inventory-length-entry{
    grid-template-columns:1fr;
  }

  .inventory-calc{
    grid-template-columns:1fr;
  }

  .inventory-calc-detail,
  .inventory-add-line{
    grid-column:auto;
  }

  .inventory-grand-total{
    grid-template-columns:1fr;
  }

  .inventory-group-head{
    flex-direction:column;
  }
}



/* =========================================================
   ARCHIVES INVENTAIRE MATIERE
   ========================================================= */

.inventory-archive-row{
  display:grid;
  grid-template-columns:48px minmax(230px,1fr) 190px auto;
  gap:12px;
  align-items:center;
  padding:11px 12px;
  border:1px solid var(--line);
  border-radius:10px;
  margin-bottom:8px;
  background:#fff;
}

.inventory-archive-icon{
  width:42px;
  height:42px;
  display:grid;
  place-items:center;
  border-radius:9px;
  background:#fdecec;
  color:#a72d2d;
  font-size:10px;
  font-weight:950;
}

.inventory-archive-info b,
.inventory-archive-info span,
.inventory-archive-data b,
.inventory-archive-data span{
  display:block;
}

.inventory-archive-info b{
  font-size:11px;
}

.inventory-archive-info span,
.inventory-archive-data span{
  margin-top:2px;
  font-size:9.5px;
  color:var(--muted);
}

.inventory-archive-data{
  text-align:right;
}

.inventory-archive-data b{
  font-size:12px;
}

@media(max-width:900px){

  .inventory-archive-row{
    grid-template-columns:
      48px minmax(0,1fr) auto;
  }

  .inventory-archive-data{
    grid-column:2;
    text-align:left;
  }

  .inventory-archive-row>.btn{
    grid-column:3;
    grid-row:1 / span 2;
  }
}

@media(max-width:620px){

  .inventory-archive-row{
    grid-template-columns:42px 1fr;
  }

  .inventory-archive-data{
    grid-column:2;
  }

  .inventory-archive-row>.btn{
    grid-column:1/-1;
    grid-row:auto;
    width:100%;
  }
}



.inventory-archive-actions{
  display:flex;
  gap:7px;
  justify-content:flex-end;
  align-items:center;
  flex-wrap:wrap;
}

@media(max-width:900px){
  .inventory-archive-actions{
    grid-column:3;
    grid-row:1 / span 2;
    flex-direction:column;
    align-items:stretch;
  }
}

@media(max-width:620px){
  .inventory-archive-actions{
    grid-column:1/-1;
    grid-row:auto;
    flex-direction:row;
  }

  .inventory-archive-actions .btn{
    flex:1;
  }
}


/* =========================================================
   V2943I - PRODUCTION > TERMINEES
   Skin vert uniforme, sans modification fonctionnelle
   ========================================================= */

#productionDonePane .customer-order-card,
#productionDonePane .customer-order-card.incomplete,
#productionDonePane .customer-order-card.complete {
  border-color:#b8dfc9;
  background:#fbfefc;
}

#productionDonePane .customer-order-status,
#productionDonePane .customer-order-status.incomplete,
#productionDonePane .customer-order-status.complete {
  color:#16794a;
}

#productionDonePane .customer-order-progress span {
  background:#1f8a58;
}


/* =========================================================
   V2943J - POSTES TERMINES HORS CFR
   Même skin vert que Production > Terminées
   ========================================================= */

#productionDonePane .legacy-production-title + .production-history-grid .production-history-card {
  border-color:#b8dfc9;
  background:#fbfefc;
}

#productionDonePane .legacy-production-title + .production-history-grid .history-result > div {
  background:#fff;
  border-color:#d7eadf;
}

#productionDonePane .legacy-production-title + .production-history-grid .history-result > div:nth-child(2) b {
  color:#16794a;
}



/* =========================================================
   V2944 - COMMANDE INTERNE DEPUIS PRODUITS
   ========================================================= */

.internal-order-dialog{
  width:min(1180px,96vw);
}

.internal-order-layout{
  display:grid;
  grid-template-columns:1fr 1.15fr;
  gap:18px;
}

.internal-order-column-title{
  font-weight:800;
  margin-bottom:10px;
}

.internal-order-products,
.internal-order-selected{
  display:flex;
  flex-direction:column;
  gap:10px;
  max-height:52vh;
  overflow:auto;
  padding-right:4px;
}

.internal-order-product{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:12px 14px;
  border:1px solid #d9e3dd;
  border-radius:12px;
  background:#fff;
}

.internal-order-product.selected{
  border-color:#9bd0b3;
  background:#f4fbf7;
}

.internal-order-product > div{
  display:flex;
  flex-direction:column;
  gap:3px;
}

.internal-order-product span,
.internal-order-product small{
  color:#66736d;
}

.internal-order-selected-row{
  display:flex;
  flex-direction:column;
  gap:10px;
  padding:14px;
  border:1px solid #b8dfc9;
  border-radius:12px;
  background:#fbfefc;
}

.internal-order-selected-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
}

.internal-order-selected-head > div{
  display:flex;
  flex-direction:column;
  gap:3px;
}

.warning-text{
  color:#a66a00 !important;
}

@media(max-width:900px){
  .internal-order-layout{
    grid-template-columns:1fr;
  }
}


/* =========================================================
   V2944B - NOUVELLE COMMANDE
   Même présentation que l'import commande
   ========================================================= */

#internalOrderModal.app-modal{
  padding:18px;
  align-items:center;
  overflow:hidden;
}

#internalOrderModal .internal-order-dialog{
  width:min(1400px,calc(100vw - 36px));
  max-width:1400px;
  max-height:calc(100vh - 36px);
  padding:0;
  overflow:hidden;
}

#internalOrderModal .app-modal-content{
  max-height:calc(100vh - 36px);
  overflow:auto;
  padding:22px 24px 0;
  scrollbar-gutter:stable;
}

#internalOrderModal .app-modal-actions{
  position:sticky;
  bottom:0;
  z-index:20;
  margin:14px -24px 0;
  padding:12px 24px 16px;
  background:linear-gradient(to bottom,rgba(255,255,255,.92),#fff 28%);
  border-top:1px solid #e7edf3;
}


/* PRODUITS DISPONIBLES */

.internal-order-picker{
  border:1px solid var(--line);
  border-radius:10px;
  background:#f8fbfe;
  padding:10px;
}

.internal-order-picker-title,
.internal-order-table-title{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:8px;
}

.internal-order-picker-title b,
.internal-order-table-title b{
  font-size:12px;
}

.internal-order-picker-title span,
.internal-order-table-title span{
  color:var(--muted);
  font-size:10px;
}

.internal-order-products-compact{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:7px;
  max-height:185px;
  overflow:auto;
}

.internal-product-compact{
  display:grid;
  grid-template-columns:minmax(0,1fr) 110px auto;
  gap:9px;
  align-items:center;
  padding:8px 9px;
  border:1px solid var(--line);
  border-radius:9px;
  background:#fff;
}

.internal-product-compact.selected{
  border-color:#9fd5b8;
  background:#f4fbf7;
}

.internal-product-compact-main{
  min-width:0;
}

.internal-product-compact-main b,
.internal-product-compact-main span,
.internal-product-compact-main small{
  display:block;
}

.internal-product-compact-main b{
  font-size:11px;
}

.internal-product-compact-main span{
  margin-top:2px;
  font-size:10px;
  color:#475467;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.internal-product-compact-main small{
  margin-top:3px;
  font-size:9px;
}

.internal-product-compact-main small.ready{
  color:#16794a;
}

.internal-product-compact-price{
  text-align:right;
  font-size:10px;
  font-weight:800;
  color:#475467;
}


/* TABLEAU */

.internal-order-table{
  max-height:min(355px,38vh);
  overflow:auto;
}

#internalOrderModal .internal-order-head,
#internalOrderModal .internal-order-row{
  grid-template-columns:
    118px
    155px
    minmax(210px,1.5fr)
    70px
    95px
    175px
    minmax(180px,1fr)
    75px;
}

.internal-order-row{
  position:relative;
}

.internal-order-row input[readonly]{
  background:#f8fafc;
}

.internal-order-row-actions{
  display:flex;
  justify-content:flex-end;
}

.internal-order-comment{
  grid-column:2 / -1;
}

.internal-order-comment input{
  width:100%;
  background:#fbfcfd;
  font-size:10px;
}


/* On neutralise l'ancien layout deux colonnes */
.internal-order-layout,
.internal-order-selected-row{
  display:none!important;
}


@media(max-width:1100px){

  .internal-order-products-compact{
    grid-template-columns:1fr;
  }

  #internalOrderModal .internal-order-head{
    display:none;
  }

  #internalOrderModal .internal-order-row{
    grid-template-columns:1fr 1fr;
  }

  #internalOrderModal .internal-order-row > div:first-child,
  #internalOrderModal .internal-order-comment{
    grid-column:1/-1;
  }
}


/* =========================================================
   FIX MODALE CREER PRODUIT - PETITS ECRANS
   ========================================================= */

#directProdModal {
  overflow-y: auto;
  padding: 24px;
  box-sizing: border-box;
}

#directProdModal .direct-production-dialog {
  max-height: calc(100vh - 48px);
  margin: auto;
  overflow: hidden;
}

#directProdModal .app-modal-content {
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  box-sizing: border-box;
  padding-bottom: 0;
}

/* Les boutons restent toujours accessibles */
#directProdModal .app-modal-actions {
  position: sticky;
  bottom: 0;
  z-index: 20;
  background: #fff;
  padding-top: 14px;
  padding-bottom: 14px;
  margin-bottom: 0;
  border-top: 1px solid #dbe4ee;
}

@media (max-height: 800px) {
  #directProdModal {
    padding: 12px;
  }

  #directProdModal .direct-production-dialog,
  #directProdModal .app-modal-content {
    max-height: calc(100vh - 24px);
  }
}


/* =========================================================
   V2945 - CLIENTS : TELEPHONE + MODIFICATION
   ========================================================= */

.client-form-v2945{
  display:grid;
  grid-template-columns:
    minmax(220px,1fr)
    minmax(260px,1fr)
    minmax(180px,.65fr)
    auto;
  gap:10px;
  align-items:end;
}

.client-form-actions{
  display:flex;
  gap:7px;
  align-items:center;
  flex-wrap:wrap;
}

.client-row-actions{
  display:flex;
  gap:6px;
  align-items:center;
  flex-wrap:wrap;
}

@media(max-width:1000px){

  .client-form-v2945{
    grid-template-columns:1fr 1fr;
  }

  .client-form-actions{
    grid-column:1/-1;
  }
}

@media(max-width:650px){

  .client-form-v2945{
    grid-template-columns:1fr;
  }

  .client-form-actions{
    grid-column:auto;
  }
}



/* =========================================================
   ATCN MAIL
   ========================================================= */

.mail-page{
  width:100%;
}

.mail-main-card{
  min-height:calc(100vh - 130px);
}

.mail-head{
  align-items:flex-start;
}

.mail-search-hero{
  padding:28px;
  border:1px solid var(--line, #dce3ec);
  border-radius:16px;
  background:linear-gradient(135deg, rgba(37,99,235,.055), rgba(16,185,129,.035));
}

.mail-search-title{
  display:flex;
  flex-direction:column;
  gap:5px;
  margin-bottom:17px;
}

.mail-search-title b{
  font-size:19px;
}

.mail-search-title span,
.mail-panel-head span{
  color:var(--muted, #64748b);
  font-size:13px;
}

.mail-search-row{
  display:grid;
  grid-template-columns:220px minmax(300px,1fr) 145px;
  gap:10px;
}

.mail-search-row select,
.mail-search-row input{
  min-height:48px;
}

.mail-search-input{
  font-size:15px;
}

.mail-search-button{
  min-height:48px;
}

.mail-search-help{
  margin-top:10px;
  font-size:12px;
  color:var(--muted, #64748b);
}

.mail-stats{
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:12px;
  margin:16px 0;
}

.mail-stats > div{
  display:flex;
  flex-direction:column;
  gap:4px;
  padding:15px 17px;
  border:1px solid var(--line, #dce3ec);
  border-radius:13px;
  background:#fff;
}

.mail-stats span{
  font-size:12px;
  color:var(--muted, #64748b);
}

.mail-stats b{
  font-size:21px;
}

.mail-workspace{
  display:grid;
  grid-template-columns:minmax(420px,.9fr) minmax(500px,1.1fr);
  gap:14px;
  min-height:470px;
}

.mail-results-panel,
.mail-detail-panel{
  border:1px solid var(--line, #dce3ec);
  border-radius:14px;
  overflow:hidden;
  background:#fff;
}

.mail-panel-head{
  min-height:62px;
  padding:14px 17px;
  border-bottom:1px solid var(--line, #dce3ec);
  background:#f8fafc;
}

.mail-panel-head > div{
  display:flex;
  flex-direction:column;
  gap:3px;
}

.mail-results,
.mail-detail{
  min-height:405px;
}

.mail-empty{
  min-height:405px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  text-align:center;
  gap:8px;
  padding:30px;
  color:var(--muted, #64748b);
}

.mail-empty b{
  color:var(--text, #172033);
  font-size:15px;
}

.mail-empty span{
  max-width:440px;
  font-size:13px;
  line-height:1.5;
}

.mail-empty.compact{
  min-height:405px;
}

.mail-empty-icon{
  width:46px;
  height:46px;
  border-radius:50%;
  display:flex;
  align-items:center;
  justify-content:center;
  background:#eef4ff;
  color:#2563eb;
  font-size:21px;
  font-weight:700;
  margin-bottom:4px;
}

.mail-loader{
  width:30px;
  height:30px;
  border:3px solid #dbe4f0;
  border-top-color:#2563eb;
  border-radius:50%;
  animation:mailSpin .8s linear infinite;
}

@keyframes mailSpin{
  to{transform:rotate(360deg)}
}

@media(max-width:1100px){
  .mail-search-row{
    grid-template-columns:1fr;
  }

  .mail-stats{
    grid-template-columns:repeat(2,1fr);
  }

  .mail-workspace{
    grid-template-columns:1fr;
  }
}



/* =========================================================
   ATCN MAIL - COMPTES IMAP
   ========================================================= */

.mail-accounts-dialog{
  width:min(1100px,96vw);
  max-height:92vh;
  overflow:auto;
}

.mail-accounts-modal-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:20px;
}

.mail-accounts-modal-head h3{
  margin-top:0;
}

.mail-accounts-layout{
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(360px,.85fr);
  gap:18px;
  margin-top:18px;
}

.mail-account-form,
.mail-account-list-panel{
  border:1px solid var(--line,#dce3ec);
  border-radius:14px;
  padding:17px;
  background:#fff;
}

.mail-secure-line{
  display:flex;
  align-items:center;
  gap:8px;
  margin-top:14px;
  font-size:13px;
  font-weight:600;
}

.mail-account-list{
  display:flex;
  flex-direction:column;
  gap:9px;
  margin-top:12px;
}

.mail-account-card{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  border:1px solid var(--line,#dce3ec);
  border-radius:12px;
  padding:12px;
  background:#f8fafc;
}

.mail-account-card-main{
  display:flex;
  align-items:center;
  gap:11px;
  min-width:0;
}

.mail-account-avatar{
  flex:0 0 auto;
  width:38px;
  height:38px;
  border-radius:10px;
  display:flex;
  align-items:center;
  justify-content:center;
  background:#e8f1ff;
  color:#135ea8;
  font-size:18px;
}

.mail-account-card-main > div:last-child{
  display:flex;
  flex-direction:column;
  min-width:0;
}

.mail-account-card-main b{
  font-size:13px;
}

.mail-account-card-main span{
  font-size:12px;
  margin-top:2px;
}

.mail-account-card-main small{
  margin-top:4px;
  color:var(--muted,#64748b);
  font-size:11px;
}

.mail-account-card-actions{
  display:flex;
  align-items:center;
  gap:7px;
}

@media(max-width:900px){

  .mail-accounts-layout{
    grid-template-columns:1fr;
  }
}


/* =========================================================
   FIX ATCN MAIL - MODALE COMPTES
   ========================================================= */

.mail-accounts-dialog{
  display:block !important;
  width:min(1100px,96vw) !important;
  max-width:1100px !important;
  max-height:92vh !important;
  overflow:auto !important;
  padding:0 !important;
}

.mail-accounts-dialog .app-modal-content{
  display:block !important;
  width:100% !important;
  max-width:none !important;
  min-width:0 !important;
  padding:24px !important;
  grid-column:auto !important;
}

.mail-accounts-modal-head{
  width:100%;
}

.mail-accounts-layout{
  width:100%;
  grid-template-columns:minmax(0,1fr) minmax(340px,.85fr) !important;
}

.mail-account-form,
.mail-account-list-panel{
  min-width:0;
}


/* =========================================================
   ATCN MAIL - RESULTATS LIVE
   ========================================================= */

.mail-result-card{
  width:100%;
  border:0;
  border-bottom:1px solid var(--line,#dce3ec);
  background:#fff;
  text-align:left;
  padding:14px 16px;
  cursor:pointer;
}

.mail-result-card:hover{
  background:#f6f9fc;
}

.mail-result-top{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:12px;
}

.mail-result-top b{
  font-size:13px;
  color:#172033;
}

.mail-result-top span{
  white-space:nowrap;
  font-size:10px;
  color:#748092;
}

.mail-result-from{
  margin-top:5px;
  font-size:11px;
  color:#145d97;
  font-weight:700;
}

.mail-result-preview{
  margin-top:7px;
  font-size:11px;
  line-height:1.5;
  color:#566373;
}

.mail-result-attachments{
  margin-top:8px;
  padding:6px 8px;
  border-radius:7px;
  background:#f0f5fb;
  font-size:10px;
  color:#41546a;
}

.mail-result-account{
  margin-top:7px;
  font-size:9px;
  color:#7a8797;
  text-transform:uppercase;
  font-weight:800;
}

.mail-message{
  padding:18px;
}

.mail-message-head{
  padding-bottom:15px;
  border-bottom:1px solid var(--line,#dce3ec);
  font-size:11px;
  line-height:1.7;
}

.mail-message-head h3{
  margin:0 0 10px;
  font-size:17px;
}

.mail-message-files{
  padding:14px 0;
  border-bottom:1px solid var(--line,#dce3ec);
}

.mail-file-list{
  display:flex;
  flex-wrap:wrap;
  gap:7px;
  margin-top:8px;
}

.mail-message-body{
  padding-top:18px;
  font-size:12px;
  line-height:1.65;
  white-space:normal;
  overflow-wrap:anywhere;
}


/* =========================================================
   ATCN MAIL - CORRESPONDANCES PIECES JOINTES
   ========================================================= */

.mail-result-matches{
  display:flex;
  flex-direction:column;
  gap:6px;
  margin-top:8px;
}

.mail-match-file{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:8px 10px;
  border:1px solid #d8a900;
  border-radius:8px;
  background:#fff7cc;
}

.mail-match-file span{
  font-size:11px;
  font-weight:700;
  color:#3f3a19;
  overflow-wrap:anywhere;
}

.mail-match-file b{
  flex:0 0 auto;
  font-size:9px;
  letter-spacing:.04em;
  padding:3px 6px;
  border-radius:999px;
  background:#ffe074;
  color:#5e4700;
}

.mail-attachment-match{
  border:2px solid #d8a900 !important;
  background:#fff7cc !important;
  box-shadow:0 0 0 2px rgba(216,169,0,.08);
}

.mail-attachment-match-badge{
  display:inline-flex;
  align-items:center;
  padding:3px 7px;
  border-radius:999px;
  font-size:9px;
  font-weight:800;
  background:#ffe074;
  color:#5e4700;
  margin-left:6px;
}
