:root{font-family:system-ui,"Segoe UI",sans-serif;color:#18342f;background:#f4f7f6}*{box-sizing:border-box}body{margin:0}header{background:#145c53;color:white;padding:22px max(22px,calc((100% - 1150px)/2));display:flex;justify-content:space-between;align-items:center;gap:16px}h1{margin:0;font-size:27px}h1 small{font-size:13px;font-weight:500}header p{margin:4px 0 0;color:#d7e9e5;font-size:13px}main{max-width:1150px;margin:auto;padding:20px}.pill{border:1px solid #83b9ae;border-radius:30px;padding:8px 12px;font-size:13px;white-space:nowrap}.notice{background:#fff6df;border-left:5px solid #aa7510;padding:13px;margin-bottom:18px}.stats{display:grid;grid-template-columns:repeat(4,1fr);gap:12px}.stats article,.panel{background:white;border:1px solid #d6e3df;border-radius:12px;padding:18px}.stats article{display:flex;flex-direction:column}.stats strong{font-size:28px}.stats span,.muted,small{color:#637671}small{display:block;font-size:12px;margin:7px 0 12px}.layout{display:grid;grid-template-columns:1fr 1fr;gap:16px;margin:16px 0}.panel{margin-bottom:16px}h2{font-size:19px;margin:0 0 15px}label{font-weight:600;font-size:13px;display:block;margin-bottom:7px}input:not([type=file]){width:100%;border:1px solid #a7bdb6;border-radius:8px;padding:13px;font:inherit}input:focus,button:focus-visible{outline:3px solid #84bcb1;outline-offset:2px}.results{max-height:310px;overflow:auto}.result{width:100%;background:#f7faf9;border:1px solid #d1e0db;border-radius:9px;padding:11px;text-align:left;display:flex;justify-content:space-between;align-items:center;margin:7px 0;color:#193d34;cursor:pointer}.result[aria-pressed=true]{border:2px solid #145c53;background:#e7f3ef}.result small{margin:3px 0}.detail{background:#eef6f3;border-radius:8px;padding:13px;margin-bottom:14px}.detail strong{font-size:19px}.actions{display:flex;flex-wrap:wrap;gap:9px;margin:14px 0}button,.filebutton{border:0;border-radius:8px;background:#145c53;color:white;padding:10px 15px;cursor:pointer;font:600 14px system-ui;text-align:center;margin:0}button:disabled{opacity:.4;cursor:default}.secondary,.filebutton{background:#e3eee9;color:#145c53}.danger{background:#8f3530}#feedback{min-height:25px;font-weight:600}.error{color:#ae3a32}.success{color:#12644a}.sectionbar{display:flex;justify-content:space-between;align-items:center}.tablewrap{overflow-x:auto}table{width:100%;border-collapse:collapse;font-size:13px}td,th{text-align:left;padding:10px 8px;border-bottom:1px solid #e2ebe8}th{color:#566d65}footer{text-align:center;color:#65776d;font-size:12px;padding:18px}@media(max-width:720px){.stats{grid-template-columns:repeat(2,1fr)}.layout{grid-template-columns:1fr}header{padding:20px;align-items:flex-start;flex-direction:column}}
/* PWA-04 UX : vues distinctes sans suppression des formulaires historiques */
[hidden]{display:none!important}
.app-nav{display:flex;flex-wrap:wrap;gap:8px;margin:0 0 22px;padding:10px;background:#e7efec;border-radius:12px}
.app-nav .nav-item{flex:1 1 auto;min-width:120px;background:transparent;color:#20574d;border:1px solid transparent;padding:12px 11px}
.app-nav .nav-item[aria-current="page"]{background:#145c53;color:#fff;box-shadow:0 2px 4px #1a55472a}
.app-nav .nav-item:hover:not([aria-current="page"]){background:#d4e6df}
.app-view{animation:fade .12s ease-out}.view-title{font-size:23px;margin:2px 0 18px}
.hero{display:flex;justify-content:space-between;align-items:center;gap:24px;background:linear-gradient(110deg,#fff,#f0f8f5)}
.eyebrow{font-size:12px;letter-spacing:.08em;font-weight:700;color:#57766d;text-transform:uppercase;margin:0 0 6px}
#dashboardPlan{font-size:21px;font-weight:700;overflow-wrap:anywhere}
.hero-actions{display:flex;flex-direction:column;gap:8px;min-width:220px}
.hero-actions button{min-height:45px}
#view-home .stats{margin:0 0 16px}
#view-operations .layout{margin:0}
body[data-operation="distribution"] #return,body[data-operation="restitution"] #issue{display:none}
#view-operations #scan{font-size:17px}
@keyframes fade{from{opacity:.75}to{opacity:1}}
@media(max-width:720px){.hero{flex-direction:column;align-items:stretch}.hero-actions{min-width:0}.app-nav .nav-item{min-width:calc(50% - 8px)}.view-title{font-size:21px}}

/* PWA-04 R2 : header compact et navigation sticky */
.site-header{position:sticky;top:0;z-index:1000;background:#145c53;color:#fff;padding:10px 20px 0;display:block;box-shadow:0 2px 9px rgba(0,0,0,.12)}
.site-header .header-inner{width:100%;max-width:1150px;margin:0 auto}
.site-header h1{margin:0 0 9px;font-size:27px;line-height:1.15;color:#fff}
.site-header .app-nav{display:flex;flex-wrap:wrap;gap:4px;margin:0;padding:0;background:transparent;border-radius:0}
.site-header .app-nav .nav-item{flex:1 1 0;min-width:0;border:0;border-radius:7px 7px 0 0;padding:9px 8px;background:transparent;color:#e1f2ec;font-size:13px;line-height:1.2;min-height:37px}
.site-header .app-nav .nav-item[aria-current="page"]{background:#f4f7f6;color:#145c53;box-shadow:none}
.site-header .app-nav .nav-item:hover:not([aria-current="page"]){background:#277268;color:#fff}
main{padding-top:15px}
@media(max-width:720px){.site-header{padding:8px 10px 0}.site-header .header-inner{width:100%}.site-header h1{font-size:21px;margin-bottom:7px}.site-header .app-nav{gap:2px}.site-header .app-nav .nav-item{flex:1 1 calc(25% - 4px);font-size:11px;padding:7px 4px;min-height:30px}.view-title{margin-top:0}}

/* PWA-04 R3 : bilans compacts, formulaire et boutons equilibrés */
#reportsPanel .report-intro{margin:0 0 18px;font-size:14px;line-height:1.5}
#reportsPanel .report-filter-grid{display:grid;grid-template-columns:minmax(210px,1.35fr) minmax(200px,1.25fr) minmax(230px,1.45fr) auto;align-items:end;gap:12px;margin-bottom:12px}
#reportsPanel .report-field{display:flex;flex-direction:column;gap:6px;min-width:0;margin:0;font-size:13px}
#reportsPanel .report-field select,#reportsPanel .report-field input{display:block;width:100%;min-width:0;height:42px;box-sizing:border-box;border:1px solid #a7bdb6;border-radius:8px;padding:8px 10px;background:#fff;color:#183f38;font:400 14px system-ui}
#reportsPanel .report-filter-grid .report-calc{height:42px;min-height:42px;padding:8px 16px;white-space:nowrap}
#reportsPanel .report-export-actions{display:flex;flex-wrap:wrap;gap:9px;margin:0 0 16px}
#reportsPanel .report-export-actions button{min-height:38px;height:38px;width:auto;padding:7px 14px;font-size:13px;white-space:nowrap}
#reportsPanel .report-summary:not(:empty){margin:12px 0;font-weight:600;line-height:1.5}
#reportsPanel .report-summary:empty{display:none}
#reportsPanel .report-footnote{line-height:1.5;margin-top:10px}
@media(max-width:1050px){#reportsPanel .report-filter-grid{grid-template-columns:repeat(2,minmax(0,1fr))}#reportsPanel .report-filter-grid .report-calc{justify-self:start}}
@media(max-width:560px){#reportsPanel .report-filter-grid{grid-template-columns:minmax(0,1fr)}#reportsPanel .report-filter-grid .report-calc{width:100%}#reportsPanel .report-export-actions button{flex:1 1 100%}}

/* PWA-04 R4 : gestion des plans harmonisée avec Bilans */
#eventPanel .plan-current{margin:0 0 17px;line-height:1.5}
#eventPanel .plan-current p{margin:6px 0}
#eventPanel .plan-field-grid{display:grid;grid-template-columns:minmax(140px,.7fr) minmax(230px,1.6fr) minmax(205px,1.35fr) minmax(205px,1.35fr);align-items:end;gap:12px;margin:0 0 12px}
#eventPanel .plan-field{display:flex;flex-direction:column;gap:6px;min-width:0;margin:0;font-size:13px;font-weight:600}
#eventPanel .plan-field input,#eventPanel .plan-field select{display:block;width:100%;min-width:0;height:42px;box-sizing:border-box;border:1px solid #a7bdb6;border-radius:8px;padding:8px 10px;background:#fff;color:#183f38;font:400 14px system-ui}
#eventPanel .plan-action-row{display:flex;flex-wrap:wrap;align-items:center;gap:9px;margin:0 0 18px}
#eventPanel .plan-action-row button{width:auto;min-height:38px;height:38px;padding:7px 14px;font-size:13px;white-space:nowrap}
#eventPanel .plan-history-tools{border-top:1px solid #e2ebe8;padding-top:14px;display:flex;align-items:end;gap:12px}
#eventPanel .plan-history-tools .plan-field{width:min(100%,320px)}
#eventPanel #eventSummary{margin:12px 0 0;line-height:1.5}
@media(max-width:1050px){#eventPanel .plan-field-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:560px){#eventPanel .plan-field-grid{grid-template-columns:minmax(0,1fr)}#eventPanel .plan-action-row button{flex:1 1 auto}}

/* PWA-04 R5 : filtre du journal, au-dessus des mouvements */
#view-journal .journal-tools{display:flex;align-items:end;gap:12px;margin:2px 0 16px}
#view-journal .journal-tools label{width:min(100%,380px);margin:0}
#view-journal .journal-tools select{display:block;width:100%;height:42px;border:1px solid #a7bdb6;border-radius:8px;background:#fff;color:#18342f;padding:7px 12px;font:inherit;margin-top:7px}

/* PWA-05 : module étiquettes */
.label-config{display:grid;grid-template-columns:1fr 1fr;gap:12px}.label-config label{display:flex;flex-direction:column;gap:5px}.label-options{display:flex;flex-wrap:wrap;gap:14px;margin:14px 0}.label-options label{display:flex;gap:6px;align-items:center}.label-options input{width:auto}.label-items{max-height:260px;overflow:auto;border:1px solid #ddd;border-radius:7px;padding:8px;margin:10px 0;display:grid;grid-template-columns:repeat(auto-fit,minmax(270px,1fr));gap:5px}.label-item{display:block;padding:5px}.label-item input{width:auto}.label-preview{margin-top:14px}.label-sheet{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}.printed-label{min-height:175px;border:1px solid #ddd;border-radius:5px;padding:8px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;text-align:center;break-inside:avoid}.printed-label .code-drawing svg{width:105px;height:105px;display:block}.label-128 .code-drawing svg{width:180px;height:65px}.printed-label small{font-size:11px}.printed-label .label-phone{font-size:15px}@media(max-width:720px){.label-config,.label-sheet{grid-template-columns:1fr}}

/* PWA-05 R1 — selecteurs etiquettes compacts, sans impact sur les autres vues */
#labelPanel .label-config{grid-template-columns:minmax(0,220px) minmax(0,300px);justify-content:start;align-items:end;column-gap:16px;row-gap:12px}
#labelPanel .label-config label{min-width:0}
#labelPanel .label-config select{width:100%;max-width:100%;min-width:0}
@media(max-width:620px){#labelPanel .label-config{grid-template-columns:minmax(0,1fr)}}

/* PWA-05 R2 : alignement des selecteurs avec les champs Bilans */
#labelPanel .label-config select{display:block;width:100%;min-width:0;max-width:100%;height:42px;box-sizing:border-box;border:1px solid #a7bdb6;border-radius:8px;padding:8px 10px;background:#fff;color:#183f38;font:400 14px system-ui,sans-serif;line-height:normal}
#labelPanel .label-config select:focus-visible{outline:3px solid #84bcb1;outline-offset:2px}
