/* 151 Weekly Order shared decision controls only; no global styles. */
#w151App #w151Save[data-state=error]{color:#9c3d21;font-weight:700}
#w151App #w151Save[data-state=ready]{color:#287448;font-weight:700}
#w151CloudCount,#w151HistorySync{font-size:11px;color:#58677a;margin-top:5px}
#w151HistorySync[data-state=error]{color:#a12d27}
#w151ReviewWarning{border-radius:5px}
#w151App .w151-small{min-height:29px;padding:5px 8px;font-size:10px;margin:2px 0 3px}
#w151App .w151-tag.oos{background:#f6e9fc;color:#7e35a0}
#w151App .w151-tag.ordered{background:#e2eaf4;color:#235a87}
#w151App .w151-editor{margin:15px 0;padding:17px;border:1px solid #d3b77b;background:#fffaf0;border-radius:10px}
#w151App .w151-editor[hidden],#w151App #w151EditAvailableWrap[hidden]{display:none!important}
#w151App .w151-editor-head{display:flex;justify-content:space-between;gap:10px;align-items:flex-start}
#w151App .w151-editor h4{font-size:17px;margin:0;color:#182230}
#w151App .w151-editor-head p{max-width:850px;color:#5b6572}
#w151App .w151-editor-intro{color:#705d36;font-weight:600}
#w151App .w151-edit-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px 14px;margin-top:14px}
#w151App .w151-edit-grid label{display:grid;align-content:start;gap:5px;color:#344154;font-size:12px;font-weight:700;min-width:0}
#w151App .w151-edit-grid input,#w151App .w151-edit-grid select,#w151App .w151-edit-grid textarea{width:100%;border:1px solid #bcc5d0;min-height:40px;border-radius:6px;padding:9px 10px;background:white;font:12px Arial,sans-serif;color:#1d2937}
#w151App .w151-edit-grid textarea{resize:vertical;min-height:56px}
#w151App .w151-edit-wide{grid-column:1/-1}
#w151App .w151-edit-note{font-size:12px;color:#7b5c25;margin:12px 0}
#w151App .w151-editor-actions{display:flex;gap:9px;flex-wrap:wrap}
#w151App .w151-history-help{padding:0 14px 12px;font-size:11px;color:#64748b}
#w151App #w151HistoryTable{min-width:1000px}
#w151App #w151HistoryTable td{max-width:480px;overflow-wrap:anywhere}
@media(max-width:920px){#w151App .w151-edit-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:560px){#w151App .w151-edit-grid{grid-template-columns:1fr}#w151App .w151-editor-head{flex-direction:column}#w151App .w151-editor-actions button{flex:1 1 100%}#w151App .w151-editor{padding:13px}}

#w151App .w151-prior-title{font-size:12px;font-weight:800;color:#4a566a;margin:15px 13px 8px}
#w151App #w151PreviousTable{min-width:900px}

/* Supplier availability unit - one shared preference for the 151 module. */
#w151App .w151-unit-row{display:flex;align-items:center;gap:10px;flex-wrap:wrap;padding:10px 13px;margin-top:7px;background:#f4f7fc;border:1px solid #cdd6e3;border-radius:6px;font-size:11px;color:#45546b}
#w151App .w151-unit-row label{font-weight:750;flex:0 0 auto}
#w151App .w151-unit-row select{min-height:34px;padding:6px 10px;border:1px solid #b9c5d2;border-radius:5px;background:white;color:#172536;font-weight:700;font-size:11px}
#w151App .w151-unit-row button{min-height:34px;padding:6px 12px;margin:0;flex:0 0 auto}
#w151App .w151-unit-row span{color:#637186}
@media(max-width:540px){#w151App .w151-unit-row{flex-direction:column;align-items:stretch}#w151App .w151-unit-row select,#w151App .w151-unit-row button{width:100%}}

/* v7: show saved-price/demand draft when supplier stock was not captured by older uploads. */
#w151App #w151DraftSection[hidden]{display:none!important}
#w151App .w151-draft{margin:15px 0;padding:13px 14px;background:#fff9ea;border:2px solid #d6a741;border-radius:10px}
#w151App .w151-draft-head{display:flex;align-items:center;justify-content:space-between;gap:15px;margin-bottom:10px}
#w151App .w151-draft h4{font-size:16px;line-height:1.4;margin:0;color:#805315}
#w151App .w151-draft p{color:#805315;font-size:12px;line-height:1.5;margin:5px 0}
#w151App #w151DraftSummary{display:block;font-size:13px;color:#543808;padding-top:3px}
#w151App #w151DraftTable th{background:#865d1a;color:#fff}
#w151App #w151DraftSection td{background:#fffdf7}
#w151App .w151-draft-note{margin:9px 0 0!important}
#w151App .w151-draft-head button{flex-shrink:0}
@media(max-width:700px){#w151App .w151-draft-head{flex-direction:column;align-items:stretch}#w151App .w151-draft-head button{width:100%}}

/* 151 v8: show computed weekly value even when supplier availability is unverified. */
#w151App #w151StockUnitRow[hidden]{display:none!important}
#w151App .w151-value-breakdown{font-size:12px;color:#5e4a20;padding:10px 12px;margin:9px 0;background:#fff9e7;border:1px solid #ead6a4;border-radius:7px;font-weight:650;line-height:1.45}
#w151App .w151-recommend-head{display:flex;justify-content:space-between;align-items:center;gap:9px;margin:15px 0 9px;font-size:14px;color:#1f2937}
#w151App .w151-recommend-head span{font-size:11px;font-weight:450;color:#715222}
#w151App #w151ReadyTable tbody tr.w151-preview-unverified td{background:#fff8e9}
#w151App #w151ReadyTable tbody tr.w151-preview-confirmed td{background:#f7fffb}
#w151App .w151-pending-tag,#w151App .w151-verified-tag{display:block;margin-top:4px;font-size:10px;font-weight:800;letter-spacing:.03em}
#w151App .w151-pending-tag{color:#93530e}
#w151App .w151-verified-tag{color:#256c40}
@media(max-width:700px){#w151App .w151-recommend-head{align-items:flex-start;flex-direction:column}}
/* 151-only live source stamp: compact on desktop and mobile. */
#w151App .w151-sync-line{display:block;margin-top:5px;font:600 10px/1.35 system-ui,Arial,sans-serif;color:#27694b;white-space:normal;max-width:250px}
#w151App .w151-sync-line[data-status="stale"]{color:#985315}
#w151App .w151-sync-line[data-status="error"]{color:#a52b26}

#w151App .w151-week{white-space:normal;min-width:190px;max-width:290px;border-radius:13px;line-height:1.3}
#w151App .w151-export-notice{font-size:11px;font-weight:700;line-height:1.45;color:#27694b;background:#eaf8ed;border:1px solid #c5e3d0;border-radius:7px;padding:8px 11px;flex:1 1 100%}
#w151App .w151-export-notice[hidden]{display:none!important}
#w151App .w151-export-notice[data-state="error"]{color:#9b2525;background:#fff0ee;border-color:#e8baba}
@media(max-width:700px){#w151App .w151-week{min-width:0;max-width:100%;width:100%}}

/* 151: traceable exceptions, visible only under Item Settings */
#w151App #w151LookupPanel { margin: 0 12px 14px; padding: 12px; border:1px solid #d6dce3; border-radius:8px; background:#f8fafc; }
#w151App #w151LookupPanel label {display:block; font-size:12px; color:#263950; font-weight:700; margin-bottom:7px;}
#w151App .w151-lookup-actions {display:flex;flex-wrap:wrap;gap:8px;align-items:center;}
#w151App #w151LookupCode {flex:1 1 230px;min-width:180px;}
#w151App #w151LookupPanel button {flex:0 1 auto;max-width:100%;}
#w151App #w151LookupResult {margin-top:11px;white-space:pre-wrap;line-height:1.5;overflow-wrap:anywhere;font-size:12px;color:#263950;}
#w151App #w151AuditHealth {margin-top:8px;font-size:11px;color:#46624d;}
#w151App #w151AuditHealth[data-state=error] {color:#ab3434;font-weight:700;}
@media(max-width:600px){#w151App .w151-lookup-actions{flex-direction:column;align-items:stretch;}#w151App .w151-lookup-actions>*{width:100%!important;flex:0 0 auto!important;}#w151App #w151LookupCode{min-width:0;}}

/* 151 OW-to-supplier-form exceptions review (scoped to Weekly Order only). */
#w151App #w151ExceptionPanel[hidden]{display:none!important}
#w151App .w151-exceptions{margin:12px 0 18px;border:1px solid #dac189;border-radius:10px;background:#fffdf8;padding:14px}
#w151App .w151-exceptions-title{display:flex;gap:12px;justify-content:space-between;align-items:flex-start}
#w151App .w151-exceptions-title h4{margin:0;font-size:16px;color:#202e42}
#w151App .w151-exceptions-title p{margin:5px 0 0;color:#576276;max-width:850px;line-height:1.5}
#w151App .w151-exceptions-summary{padding:10px 12px;margin:12px 0;background:#fff4dc;border-radius:6px;color:#71501e;font-size:12px;font-weight:700}
#w151App .w151-exceptions-filters{display:flex;flex-wrap:wrap;gap:9px;align-items:center;margin:12px 0}
#w151App .w151-exceptions-filters label{display:flex;align-items:center;gap:8px;font-size:12px;font-weight:700}
#w151App #w151ExceptionSearch{flex:1 1 240px;min-width:140px}
#w151App .w151-exceptions-scroll{max-width:100%;overflow-x:auto;overflow-y:visible;border:1px solid #e0e3e7;border-radius:7px}
#w151App #w151ExceptionTable{min-width:1010px;width:100%;font-size:11px}
#w151App #w151ExceptionTable th{position:static;background:#24272b}
#w151App #w151ExceptionTable td{vertical-align:top}
#w151App #w151ExceptionTable td:nth-child(2){min-width:190px}
#w151App #w151ExceptionTable td:nth-child(6){min-width:280px}
#w151App .w151-exception-type{font-size:10px;display:inline-block;padding:4px 6px;border-radius:5px;color:#6f4211;background:#ffecd0}
#w151App .w151-exception-type.excluded{background:#ecedf6;color:#434c73}
#w151App .w151-exception-reason{margin-top:6px;line-height:1.45;overflow-wrap:anywhere;color:#44556b}
#w151App .w151-no-exceptions{padding:20px 10px!important;text-align:center;color:#587065}
#w151App .w151-exceptions-foot{margin:10px 0 0!important;color:#6b7687!important}
#w151App #w151ExceptionButtonCount{font-size:10px}
#w151App #w151ExceptionOpen[aria-expanded=true]{background:#fff0cf;border-color:#b48d44;color:#72501e}
@media(max-width:700px){
 #w151App .w151-exceptions-title{flex-direction:column}
 #w151App .w151-exceptions-filters{flex-direction:column;align-items:stretch}
 #w151App .w151-exceptions-filters label,#w151App .w151-exceptions-filters select,#w151App #w151ExceptionSearch,#w151App #w151ExceptionCsv{width:100%}
 #w151App #w151ExceptionSearch{flex:0 0 auto!important;min-height:38px;height:38px;}
 #w151App .w151-exceptions{padding:11px}
}
