/* Final screen-only layer. Printed documents retain their dedicated layout. */
@media screen {
 :root{font-size:14px}
 body{color:#253b35;background:#f3f6f5}
 main{padding:18px 22px}
 h2{font-size:24px;line-height:1.35}h3{font-size:17px}h4{font-size:15px}
 .card{border-radius:12px;padding:16px;margin-bottom:14px;box-shadow:none}
 button,input,select{font-size:14px;min-height:36px;border-radius:7px}
 button{padding:6px 12px;cursor:pointer}button:disabled{cursor:not-allowed;opacity:.5}
 input,select{padding:7px 10px}label{line-height:1.6}
 button:focus-visible,summary:focus-visible{outline:3px solid #70bba1;outline-offset:2px}
 .maint-tools{gap:10px;margin:12px 0 16px}.maint-tools input{min-width:120px}
 .maint-nav,.work-actions{gap:8px;margin:10px 0}.maint-nav button,.work-actions button{min-height:36px}
 .compact-table{font-size:14px;border-collapse:collapse}
 .compact-table th{padding:10px 12px;background:#eff4f2;font-weight:600;white-space:nowrap}
 .compact-table td{padding:12px;vertical-align:middle;line-height:1.45}
 .compact-table tbody tr:hover{background:#f6faf8}
 .compact-table .maint-sort{min-height:24px;padding:0;border-radius:0}
 .compact-table .compact-number{text-align:right;font-variant-numeric:tabular-nums}
 .compact-table .compact-pending{color:#8c530d;background:#fff6e7;font-weight:600}
 #catalog-products .maint-scroll{container-type:inline-size}
 #catalog-products tr.catalog-bom-selected>td{background:#e8f4ee;border-bottom-color:#98c6b1}
 #catalog-products tr.catalog-bom-detail>td{padding:12px;white-space:normal;background:#f3f8f5;position:static;text-align:left}
 #catalog-bom{position:sticky;left:12px;width:calc(100cqw - 24px);box-sizing:border-box}
 #catalog-bom>.card{margin:0;border-left:3px solid #147650;min-width:0}
 #catalog-bom .catalog-bom-heading{display:flex;align-items:center;justify-content:space-between;gap:16px}
 #catalog-bom .catalog-bom-heading h3{margin:0;overflow-wrap:anywhere}
 #catalog-bom .catalog-bom-heading button{flex-shrink:0}
 #catalog-bom .table-wrap{overflow:auto}
 .compact-pay-status{padding:10px 12px;border-left:3px solid #11764f;background:#eff7f3;color:#285a47}
 .compact-table .compact-action-head,.compact-table .compact-action-cell,
 .fg-purchase-panel .maint-scroll table th.compact-action-head,.fg-purchase-panel .maint-scroll table td.compact-action-cell,
 #plan-batches .compact-action-cell{
  position:static;min-width:0;max-width:none;width:1%;white-space:nowrap;box-shadow:none;background:inherit
 }
 .compact-row-actions{display:flex;align-items:center;gap:6px;flex-wrap:nowrap}
 .compact-row-actions button,.fg-purchase-panel .maint-scroll td:last-child .compact-row-actions button,
 #doc-table .compact-row-actions button{display:inline-flex;flex-shrink:0;align-items:center;justify-content:center;min-height:32px;margin:0;padding:5px 9px;border-width:1px;white-space:nowrap;box-shadow:none;font-size:13px;font-weight:500}
 .compact-row-actions button.compact-direct:not(.compact-next){background:white;color:#253b35;border-color:#d7e2dc;font-weight:500}
 button.compact-next,.compact-row-actions button.compact-next{background:#11764f;color:white;border-color:#11764f;font-weight:600}
 .compact-action-menu{position:fixed;inset:auto;margin:0;padding:6px;border:1px solid #cadbd3;border-radius:10px;background:white;box-shadow:0 8px 32px #183b3029;z-index:10000;max-height:70vh;overflow:auto}
 .compact-action-menu[hidden]{display:none!important}
 .compact-action-menu button,.fg-purchase-panel .maint-scroll .compact-action-menu button{display:block;width:100%;text-align:left;min-height:38px;padding:8px 12px;margin:0;border:0;background:white;white-space:normal;box-shadow:none;color:#253b35}
 .compact-action-menu button:hover{background:#eef5f1}.compact-action-menu button.compact-danger{color:#a64032}
 .compact-identity{width:260px;white-space:normal;margin:0}
 .compact-identity summary{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;cursor:pointer;line-height:1.5;padding:0;font-weight:500;color:#245f4c;text-decoration:underline dotted #a6beb4;text-underline-offset:3px}
 .compact-identity[open] summary{-webkit-line-clamp:unset}.compact-identity p{margin:8px 0 0;color:#253b35}
 .compact-filter>.grid{grid-template-columns:minmax(220px,2fr) minmax(160px,1fr);gap:12px}
 .compact-filter-more{margin:8px 0}.compact-filter-more summary{cursor:pointer;color:#526f63;min-height:30px;line-height:30px}.compact-filter-more summary.has-filters{color:#08764e;font-weight:600}
 .compact-filter-more>.grid{padding:10px 0}.compact-filter .toolbar{margin:8px 0}
 .planning-dialog{width:min(1100px,94vw);max-width:1600px;border-radius:14px;padding:20px;max-height:90vh}
 .planning-dialog:has(.v3-print-content),.planning-dialog:has(table input){width:94vw}
 .planning-dialog .grid{gap:12px 18px}.planning-dialog .plan-heading{margin-bottom:18px}
 .planning-dialog .actions{display:flex;justify-content:flex-end;gap:8px;border-top:1px solid #e1eae5;padding:14px 0 0;margin-top:18px;z-index:4}
 .planning-dialog .plan-error{border-left:3px solid #b64436;padding:12px;background:#fff0ed}
 .planning-dialog [aria-invalid=true]{border-color:#b64436;outline-color:#b64436}
 .finance-metrics{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin:16px 0}
 .finance-metric{padding:16px;border:1px solid #dbe7e1;border-radius:10px;background:#f8fbf9}
 .finance-metric dt{color:#526b60;font-size:13px}.finance-metric dd{margin:8px 0 0;font-size:22px;font-weight:650;font-variant-numeric:tabular-nums;overflow-wrap:anywhere}
 .finance-details{margin:16px 0;border:1px solid #dbe7e1;border-radius:10px;padding:12px}.finance-details summary{cursor:pointer;font-weight:600;line-height:28px}
 .compact-history{margin-top:12px}.compact-history>summary{padding:12px;cursor:pointer;background:#eff4f2;border-radius:8px}
 .compact-history .card{margin-top:10px}
 .supply-document{border:1px solid #dbe7e1;border-radius:10px;margin:10px 0;padding:0 14px;background:white}
 .supply-document>summary{padding:12px 0;line-height:1.5}.supply-document article.card{border:0;padding:0;margin:0 0 12px}
 .supply-document.is-pending>summary{color:#11764f}.supply-document.has-issues>summary{color:#955d13}
 .wh-transfer-list .compact-table td:first-child{white-space:pre-line;max-width:220px;overflow-wrap:anywhere;font-size:13px}
 .wh-transfer-list .compact-table td:nth-child(2){white-space:pre-line;min-width:95px}
 .wh-transfer-list .compact-table td:nth-child(3){min-width:230px}
 .wh-transfer-list .compact-table td:nth-child(4){min-width:135px;white-space:pre-line;font-variant-numeric:tabular-nums}
 @media(max-width:1000px){.finance-metrics{grid-template-columns:repeat(2,minmax(0,1fr))}.planning-dialog .grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
 @media(max-width:700px){main{padding:12px}.card{padding:12px}.maint-tools{flex-wrap:wrap}.maint-tools input{flex-basis:65%}.compact-filter>.grid,.planning-dialog .grid{grid-template-columns:1fr}.planning-dialog{padding:14px}.finance-metric dd{font-size:19px}}
 @media(pointer:coarse){button,.work-actions button,.maint-nav button,.compact-row-actions button,.fg-purchase-panel .maint-scroll td:last-child .compact-row-actions button,#doc-table .compact-row-actions button,.compact-action-menu button,.fg-purchase-panel .maint-scroll .compact-action-menu button{min-height:44px}input,select{min-height:44px}}
}
/* Always-visible horizontal controls, independent of auto-hidden OS scrollbars. */
@media screen {
 .table-quantity-totals{position:sticky;top:0;z-index:5;display:flex;align-items:center;flex-wrap:wrap;gap:6px 20px;margin:10px 0;padding:9px 12px;min-height:38px;border:1px solid #c7ded2;border-radius:7px;background:#edf7f1;box-shadow:0 2px 4px #183b300a;font-size:13px;line-height:1.5}
 .table-quantity-scope,.table-quantity-note{color:#526f63;font-size:12px}.table-quantity-metric{display:inline-flex;gap:4px;align-items:baseline;white-space:nowrap}.table-quantity-metric strong{color:#125b3c;font-size:15px;font-variant-numeric:tabular-nums}.table-quantity-note{flex-basis:100%}
 @media(pointer:coarse){.table-quantity-totals{font-size:14px}.table-quantity-scope,.table-quantity-note{font-size:13px}}
}
@media print{.table-quantity-totals{display:none!important}}
@media screen {
 .table-scroll-assisted{padding-bottom:calc(var(--table-scroll-original-padding,0px) + 36px)}
 .table-scroll-control{--table-scroll-height:36px;position:fixed;z-index:8000;display:flex;align-items:center;gap:8px;height:var(--table-scroll-height);padding:2px 6px;border:1px solid #bccfc4;border-radius:6px;background:#f5faf7;box-shadow:0 -2px 6px #183b3012;box-sizing:border-box}
 .table-scroll-control[hidden]{display:none!important}
 .table-scroll-control button{flex:none;display:grid;place-items:center;width:30px;min-width:30px;min-height:30px;height:30px;padding:0;margin:0;border:0;background:transparent;font-size:23px;line-height:1;color:#17633f}
 .table-scroll-control button:disabled{opacity:.3;cursor:default}
 .table-scroll-track{position:relative;flex:1;min-width:0;height:28px;touch-action:none;user-select:none;cursor:pointer}
 .table-scroll-track:before{content:'';position:absolute;left:0;right:0;top:8px;height:12px;border-radius:8px;background:#dce7e1}
 .table-scroll-thumb{position:absolute;left:0;top:6px;height:16px;min-width:0;border-radius:8px;background:#628b77;cursor:grab;touch-action:none}
 .table-scroll-thumb:hover,.table-scroll-thumb:focus-visible{background:#176f4b;outline:2px solid #176f4b;outline-offset:2px}
 .table-scroll-thumb:active{cursor:grabbing}
 @media(pointer:coarse){
  .table-scroll-assisted{padding-bottom:calc(var(--table-scroll-original-padding,0px) + 44px)}
  .table-scroll-control{--table-scroll-height:44px}
  .table-scroll-control button{width:40px;min-width:40px;min-height:40px;height:40px}
  .table-scroll-track{height:36px}.table-scroll-track:before{top:12px}.table-scroll-thumb{top:10px}
 }
}
@media print{.table-scroll-control{display:none!important}}

/* H54: purchasing forms and advisory material shortage only. */

 .material-shortage-panel .toolbar{align-items:end;gap:12px;flex-wrap:wrap}.material-shortage-panel label{margin:0;min-width:160px}.material-shortage-panel input[type=search]{min-width:240px}.material-shortage-panel table,.free-purchase-dialog table,.material-order-purchase table{font-size:13px}.material-shortage-panel th,.material-shortage-panel td,.free-purchase-dialog th,.free-purchase-dialog td,.material-order-purchase th,.material-order-purchase td{white-space:nowrap;padding:9px 10px}.material-shortage-panel .material-name,.free-purchase-dialog [data-free-attributes]{white-space:normal;min-width:230px;max-width:420px}.material-shortage-panel .material-link{border:0;background:transparent;color:#0877bd;padding:0;text-align:left;font-size:inherit;white-space:normal}.material-shortage-panel .shortage-detail{background:#f2f8f5}.material-shortage-panel .shortage-detail>td{white-space:normal}.material-shortage-panel .quantity-summary{margin:8px 0}.free-purchase-dialog [name=material_id]{min-width:320px}.free-purchase-dialog [data-free-rows] .combo-wrap{min-width:320px}.free-purchase-dialog [name=quantity],.material-order-purchase [name=quantity]{width:120px;min-width:100px}.free-purchase-dialog [name=reason]{min-width:150px}.material-order-purchase [name=supplier_id]{min-width:170px}.material-order-purchase .combo-wrap{min-width:170px}.material-shortage-panel .shortage-number{font-weight:600}.material-shortage-panel .shortage-alert{color:#ab4509}@media(pointer:coarse){.material-shortage-panel table,.free-purchase-dialog table,.material-order-purchase table{font-size:14px}}
.free-purchase-dialog [data-free-rows] td:last-child button{white-space:nowrap;min-width:58px}
