:root{font-family:"Segoe UI","Microsoft YaHei UI","Microsoft YaHei",Arial,sans-serif;color:var(--text);background:#f5f5f5;font-size:16px;--brand:#ed2224;--text:#171717;--muted:#414141;--line:#dedee3}small{font-size:13px}*{box-sizing:border-box}body{margin:0}button,input,select,textarea{font:inherit}button,a,label{touch-action:manipulation}button{cursor:pointer}button:disabled{opacity:.45;cursor:not-allowed}[hidden]{display:none!important}.sidebar{position:fixed;width:232px;inset:0 auto 0 0;background:#231f20;color:#f4f4f5;padding:32px 20px;display:flex;flex-direction:column}.brand{display:flex;align-items:center;gap:12px;font-weight:600;font-size:19px;line-height:1.5}.brandmark{display:grid;place-items:center;background:#ed2224;width:42px;height:42px;border-radius:10px;color:white;font-size:23px}.brand small{display:block;font-weight:400;font-size:13px;color:#b4b4bd;margin-top:2px}nav{margin-top:48px;display:grid;gap:8px}.nav{border:0;background:transparent;color:#dedee3;text-align:left;padding:14px 16px;font-size:15px;border-radius:7px}.nav.active{background:#442123;color:#fff;box-shadow:inset 3px 0 #ed2224}.nav span{float:right;background:#704044;border-radius:4px;padding:1px 5px;font-size:13px}.sidebar-bottom{margin-top:auto;font-size:13px;color:#b4b4bd;line-height:1.8}.sidebar-bottom span{color:#f4f4f5;font-size:15px}.sidebar-bottom a{color:#dedee3;text-decoration:none}main{margin-left:232px;padding:38px 44px;max-width:1600px}header{display:flex;justify-content:space-between;align-items:center;margin-bottom:32px}.eyebrow{font-size:13px;color:var(--muted);margin:0 0 8px}h1{font-size:29px;letter-spacing:-.5px;margin:0;font-weight:600}.trial-tag{font-size:13px;border:1px solid #d1d1d8;padding:7px 12px;border-radius:5px;color:var(--muted)}.metrics{display:grid;grid-template-columns:repeat(4,1fr);background:white;border:1px solid var(--line);margin-bottom:32px;border-radius:8px}.metrics>div{padding:23px 26px;border-right:1px solid var(--line)}.metrics>div:last-child{border:0}.metrics span{display:block;font-size:15px;color:var(--muted)}.metrics strong{display:block;font-size:30px;font-weight:600;font-variant-numeric:tabular-nums;margin-top:10px}.metrics small{font-size:16px;color:var(--muted);font-weight:400}.section-head{display:flex;justify-content:space-between;align-items:center;gap:20px;margin:24px 0 18px}h2{font-size:20px;margin:0 0 8px;font-weight:600}h3{font-size:16px;margin:0 0 8px;font-weight:600}p{line-height:1.6}.section-head p{margin:0;color:var(--muted);font-size:15px}.upload-area{border:1.5px dashed #bcbcc6;background:#fff;text-align:center;border-radius:8px;padding:30px 20px}.upload-area.drag{background:#f4f4f5;border-color:var(--brand)}.file-icon{display:grid;place-items:center;width:44px;height:44px;margin:0 auto 14px;background:#f4f4f5;color:var(--brand);border-radius:8px;font-size:26px}.upload-area h3{font-size:18px}.upload-area p{font-size:15px;color:var(--muted);margin:8px 0 18px}.upload-area #selectedFiles{margin-bottom:0;overflow-wrap:anywhere}.button{border:1px solid #cfcfd7;background:#fff;color:#27272a;padding:10px 16px;border-radius:5px;font-size:15px;display:inline-block;text-decoration:none;line-height:1.4;text-align:center}.button:hover{background:#f4f4f5}.button.primary,#exportIssues{background:var(--brand);border-color:var(--brand);color:white}.button.primary:hover,#exportIssues:hover{background:#cf1b1d}.text-button{border-color:transparent;background:transparent;color:var(--brand)}#fileInput{position:absolute;opacity:0;width:1px;height:1px}.import-actions{display:flex;gap:12px;align-items:center;margin-top:16px}.notes{display:grid;grid-template-columns:1fr 1fr;gap:36px;border-top:1px solid var(--line);margin-top:30px;padding-top:22px}.notes p{font-size:15px;color:var(--muted);margin:0}.table-wrap{background:#fff;border:1px solid var(--line);border-radius:7px;overflow:auto}table{border-collapse:collapse;width:100%;font-size:15px}th{text-align:left;background:#f0f0f2;color:#202020;font-weight:600;white-space:nowrap;padding:13px 16px;font-size:14px}td{padding:15px 16px;border-top:1px solid #e7e7eb;vertical-align:top;line-height:1.5}td small{display:block;color:var(--muted);font-size:13px;max-width:500px;overflow-wrap:anywhere}.num{font-variant-numeric:tabular-nums;white-space:nowrap}.negative{color:#b33b36;font-weight:600}.pill{display:inline-block;border-radius:4px;padding:2px 7px;background:#f4f4f5;color:#52525b;font-size:13px;margin-top:4px}.pill.warn{background:#fff2dd;color:#976420}.secondary{font-size:14px;color:var(--muted);line-height:1.5}.notice{background:#fff5e6;border-left:3px solid #dca94c;padding:12px 16px;font-size:15px;line-height:1.8;margin-top:16px}.toolbar{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:18px;margin-bottom:18px;font-size:15px}.toolbar label{display:flex;align-items:center;gap:10px}.toolbar input,.toolbar select{border:1px solid #cfcfd7;border-radius:5px;padding:10px 12px;background:white;min-width:200px;color:#27272a}.search{flex:1}.search input{width:100%;max-width:420px}.pager{display:flex;justify-content:space-between;align-items:center;margin:18px 0;color:var(--muted);font-size:13px}.pager>div{display:flex;align-items:center;gap:12px}.pager .button{padding:7px 12px}.empty{text-align:center;color:var(--muted);padding:40px}.location-list{display:grid;grid-template-columns:repeat(3,1fr);gap:12px;margin-top:24px}.location-list>div{border-top:2px solid #dedee3;padding:12px 0;font-size:15px}.location-list small{display:block;color:var(--muted);font-size:13px;margin-top:6px}footer{margin-top:38px;padding-top:16px;border-top:1px solid var(--line);font-size:13px;color:var(--muted);display:flex;justify-content:space-between;gap:14px}#toast:not(:empty){padding:12px 16px;background:#f4f4f5;color:#3f3f46;border-radius:5px;margin-bottom:18px;font-size:15px}#toast.error{background:#fff0ed;color:#ad3d2c}#busy{display:flex;align-items:center;gap:12px;font-size:15px;color:#52525b;margin:18px 0}.spinner{width:19px;height:19px;border:2px solid #f4b3b4;border-top-color:var(--brand);border-radius:50%;animation:spin .8s linear infinite}@keyframes spin{to{transform:rotate(360deg)}}:focus-visible{outline:3px solid #ed2224;outline-offset:3px}@media(max-width:1000px){.sidebar{width:196px}main{margin-left:196px;padding:28px 24px}.metrics>div{padding:18px}.metrics strong{font-size:26px}.toolbar{flex-wrap:wrap}.location-list{grid-template-columns:repeat(2,1fr)}}@media(max-width:700px){.sidebar{position:static;width:auto;padding:18px}.brand{font-size:17px}.brand small{font-size:13px}nav{display:flex;margin-top:18px;gap:3px;overflow-x:auto}.nav{font-size:15px;white-space:nowrap;padding:10px}.nav span{display:none}.sidebar-bottom{display:none}main{margin:0;padding:24px 16px}header{margin-bottom:22px}h1{font-size:24px}.metrics{grid-template-columns:1fr 1fr;margin-bottom:24px}.metrics>div:nth-child(2){border-right:0}.metrics>div:nth-child(-n+2){border-bottom:1px solid var(--line)}.notes{grid-template-columns:1fr;gap:22px}.import-actions{align-items:stretch;flex-direction:column}.section-head{align-items:flex-start;flex-wrap:wrap}.toolbar label{width:100%}.toolbar select{flex:1;min-width:0}.toolbar input{min-width:0}.pager{flex-wrap:wrap;gap:14px}.location-list{grid-template-columns:1fr 1fr}footer{display:block}footer span{display:block;margin-top:6px}table{min-width:650px}.upload-area{padding:24px 14px}}@media(prefers-reduced-motion:reduce){.spinner{animation:none}}

.sidebar{overflow-y:auto}nav{margin-top:26px;gap:3px}.nav{padding:10px 14px}.sidebar-bottom{padding-top:20px}main{max-width:1800px}.supplier-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:14px;margin:18px 0}.supplier-card{background:white;border:1px solid var(--line);border-radius:7px;padding:18px}.supplier-card>div{display:flex;align-items:center;justify-content:space-between;gap:8px}.supplier-card strong{font-size:15px}.supplier-card p{font-size:15px;margin:12px 0 8px}.supplier-card small{display:block;color:var(--muted);font-size:13px;line-height:1.5}.supplier-card .button{margin-top:14px}.panel{background:white;border:1px solid var(--line);border-radius:7px;padding:24px;margin:20px 0}.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:20px}.form-grid .wide{grid-column:1/-1}.form-grid label{display:grid;gap:8px;font-size:15px}.form-grid input,.form-grid select,textarea{width:100%;border:1px solid #cfcfd7;border-radius:5px;padding:11px;background:#fff;color:var(--text)}.form-grid small{color:var(--muted)}.config-table input[type=number]{width:90px;border:1px solid #cfcfd7;padding:8px;border-radius:4px}.config-table input[type=checkbox]{width:18px;height:18px}.config-table{min-width:950px}.config-table td:first-child{min-width:290px}details{border-top:1px solid var(--line);padding-top:16px;margin-top:20px}summary{cursor:pointer;font-size:15px;color:#52525b}.notice p{margin:4px 0}dialog{width:min(1300px,95vw);max-height:92vh;border:1px solid var(--line);border-radius:10px;padding:24px;color:var(--text);box-shadow:0 20px 80px #231f2033}dialog::backdrop{background:#231f2080}.dialog-head{display:flex;justify-content:space-between;gap:20px}.dialog-head p{color:var(--muted);margin:0}.order-scroll{max-height:44vh}.order-scroll thead{position:sticky;top:0}.order-scroll input{width:100px;padding:8px;border:1px solid #cfcfd7;border-radius:4px}.dialog-actions{display:flex;gap:10px;flex-wrap:wrap;margin-top:16px}dialog h3{margin-top:20px}.ack{display:flex;gap:10px;font-size:15px;margin-top:16px;line-height:1.6}.danger,#orderError{color:#ad3d2c}#orderError{font-size:15px}#forecastRows td:first-child{min-width:235px}#forecastRows td:last-child{min-width:170px}.toolbar select{max-width:330px}#forecastOnly{min-width:140px}@media(max-width:1100px){.supplier-grid{grid-template-columns:1fr 1fr}}@media(max-width:700px){.supplier-grid,.form-grid{grid-template-columns:1fr}.form-grid .wide{grid-column:auto}.sidebar{overflow-y:visible}nav{margin-top:18px}.nav{padding:10px}.panel{padding:18px}.toolbar select{max-width:100%}dialog{padding:16px}.dialog-actions .button{flex:1}.dialog-head h2{font-size:17px}#salesFile{max-width:100%}}

.toolbar label{white-space:nowrap}.order-scroll td:nth-child(2){min-width:100px}.order-scroll td:first-child{min-width:220px}

.supplier-picker{padding:20px}.supplier-picker-head{display:flex;align-items:center;justify-content:space-between;gap:12px}.supplier-picker label{display:flex;align-items:center;gap:8px;font-size:15px;cursor:pointer}.supplier-picker input[type=checkbox]{width:18px;height:18px;flex-shrink:0;accent-color:var(--brand)}.supplier-select-groups{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}.supplier-select-group{border:1px solid var(--line);border-radius:6px;padding:14px;min-width:0}.supplier-group-label{flex-wrap:wrap}.supplier-group-label small{color:var(--muted);margin-left:auto}.supplier-select-group details{margin-top:12px;padding-top:12px}.supplier-options{display:grid;gap:10px;max-height:260px;overflow-y:auto;padding:14px 0 2px}.supplier-options label{align-items:flex-start}.supplier-options span{overflow-wrap:anywhere}.supplier-card{overflow-wrap:anywhere}@media(max-width:900px){.supplier-select-groups{grid-template-columns:1fr}}@media(max-width:700px){.supplier-picker{padding:16px}.supplier-picker-head{align-items:flex-start;flex-direction:column}}

body:not(.signed-in)>.sidebar,body:not(.signed-in)>main{display:none}body:not(.signed-in){display:block;background:#f5f5f5}.signed-in #authShell{display:none}.auth-shell{min-height:100vh;display:grid;place-items:center;padding:24px}.auth-card{width:min(480px,100%);background:white;border:1px solid #dedee3;border-radius:14px;padding:32px;box-shadow:0 8px 32px #231f200d}.auth-card .brand{color:var(--text);margin-bottom:24px}.auth-card label{display:block;margin:16px 0}.auth-card input,.auth-card select{width:100%;margin-top:6px}.auth-card h1{font-size:22px}.account-bar{display:flex;justify-content:flex-end;align-items:center;gap:16px;margin-bottom:16px;color:var(--muted)}.permission-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:12px;padding:16px 0}#view-settings>.panel{margin-bottom:20px}#view-settings .form-grid{margin:16px 0}#view-settings label{display:block}#view-settings form .button{margin-top:16px}.auth-card p{line-height:1.6}#authError{min-height:24px}@media(max-width:600px){.account-bar{flex-wrap:wrap;justify-content:space-between}.auth-card{padding:24px}.permission-grid{grid-template-columns:1fr}}
#view-settings label>input:not([type="checkbox"]),#view-settings label>select{display:block;padding:10px 12px;min-height:40px;border:1px solid #cfcfd7;border-radius:6px;margin-top:6px;max-width:100%;font:inherit}#auditPanel .toolbar{flex-wrap:wrap;align-items:end}#auditPanel .toolbar label{min-width:140px;flex:1}#auditPanel .toolbar input,#auditPanel .toolbar select{width:100%}.panel{min-width:0}#view-settings table td{overflow-wrap:anywhere}

/* Red and black brand theme: restrained surfaces, clear action and focus states. */
:root{--brand-hover:#cf1b1d;--brand-soft:#fff1f2;--sidebar:#231f20;--surface:#fff;--canvas:#f5f5f5}
.sidebar{background:var(--sidebar)}.nav:hover{background:#27272a;color:#fff}.nav.active:hover{background:#442123}.brandmark{flex-shrink:0;border-radius:7px}.button.primary:hover,#exportIssues:hover{background:var(--brand-hover);border-color:var(--brand-hover)}.upload-area.drag{background:var(--brand-soft)}input[type=checkbox],input[type=radio]{accent-color:var(--brand)}.form-grid input:focus,.form-grid select:focus,.toolbar input:focus,.toolbar select:focus,textarea:focus{border-color:var(--brand)}.auth-card input,.auth-card select{border:1px solid var(--line);border-radius:6px;padding:10px 12px;background:var(--surface);color:var(--text)}.auth-card .brandmark{color:#fff}.table-wrap,.panel,.supplier-card,.metrics{border-radius:6px}tbody tr:hover{background:#fafafa}

.update-notice{display:flex;justify-content:space-between;align-items:center;gap:16px;padding:12px 16px;margin-bottom:20px;background:#fff;border:1px solid var(--line);border-left:3px solid var(--brand);border-radius:6px;font-size:15px}.update-notice.offline{border-left-color:#dca94c}#refreshDialog{max-width:560px}#refreshDialog h3{line-height:1.7}@media(max-width:700px){.update-notice{align-items:flex-start;flex-direction:column}}

.import-tabs{display:flex;gap:8px;flex-wrap:wrap;margin:0 0 20px;padding-bottom:12px;border-bottom:1px solid var(--border,#ddd)}
.import-tabs[hidden]{display:none}
.import-tabs .import-tab.active{background:var(--red,#ED2224);border-color:var(--red,#ED2224);color:#fff}

#toast:not(:empty){position:sticky;top:8px;z-index:30;box-shadow:0 2px 10px #0002}.save-notice{padding:10px 12px;background:#ecfdf5;color:#166534;border-radius:5px}.save-notice.error{background:#fff0ed;color:#ad3d2c}
#stockHistoryPanel .toolbar{flex-wrap:wrap;align-items:flex-end}
#stockHistoryPanel .toolbar label{display:flex;flex-direction:column;align-items:stretch;min-width:140px;flex:1 1 160px}
#stockHistoryPanel .toolbar label.search{min-width:180px;flex:2 1 220px}
#stockHistoryPanel .toolbar input,#stockHistoryPanel .toolbar select{width:100%;min-width:0;max-width:100%}
#stockHistoryPanel .toolbar .button{flex:0 0 auto;white-space:nowrap}

#stockHistoryError:empty{display:none}

/* Keep supplier routes separate and V1 branch actions compact. */
#supplierSummary{align-items:start}
.supplier-route-heading{grid-column:1/-1;margin:8px 0 0;padding:10px 12px;background:#e4e4e4;border-left:3px solid var(--brand);font-size:16px}
.supplier-branch-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin:14px 0}
.supplier-branch{display:flex;flex-direction:column;gap:6px;min-width:0;padding:10px;border:1px solid var(--line);background:#fafafa}
.supplier-card .supplier-branch .button{margin-top:auto;width:100%}
@media(max-width:900px){.supplier-branch-grid{grid-template-columns:1fr}}
.supplier-route-heading small{display:block;margin-top:4px;font-size:13px;font-weight:400;color:var(--muted)}
#supplierSummary .supplier-card-compact{padding:12px;min-width:0}
#supplierSummary .supplier-card-compact>div{flex-wrap:wrap;align-items:baseline}
#supplierSummary .supplier-card-compact>div strong{overflow-wrap:anywhere;min-width:0}
#supplierSummary .supplier-card-compact>div b{white-space:nowrap}
#supplierSummary .supplier-card-compact>p{margin:6px 0 10px;font-size:13px;color:var(--muted)}
#supplierSummary .supplier-review-needed{color:#944010;font-weight:600}
#supplierSummary .supplier-summary-details{border:0;padding:0;margin:0}
#supplierSummary .supplier-summary-details>summary{display:flex;gap:8px;align-items:center;justify-content:space-between;list-style:none;font-size:13px}
#supplierSummary .supplier-summary-details>summary::-webkit-details-marker{display:none}
#supplierSummary .supplier-detail-open,#supplierSummary .supplier-detail-close{border:1px solid var(--line);padding:4px 8px;white-space:nowrap}
#supplierSummary .supplier-detail-close{display:none}
#supplierSummary details[open] .supplier-detail-open{display:none}
#supplierSummary details[open] .supplier-detail-close{display:inline}
#supplierSummary .supplier-summary-body{display:block;border-top:1px solid var(--line);margin-top:10px;padding-top:10px}
#view-quotes #quoteSupplierPicker{padding:12px;margin:12px 0}
#view-quotes .toolbar .quote-missing-check{display:flex;align-items:center;gap:8px}
#view-quotes #quoteMissingOnly{width:auto;margin:0}
#view-quotes th small{display:block;font-weight:400}
#quoteSupplierPicker{box-sizing:border-box;min-width:0;max-width:100%;margin:0 0 16px}
#quoteSupplierPicker>summary{cursor:pointer;overflow-wrap:anywhere}
#quoteSupplierPicker>summary>span+span{margin-left:12px}
#quoteSupplierPicker .quote-supplier-actions{display:flex;flex-wrap:wrap;align-items:center;gap:12px;margin:12px 0}
#quoteSupplierPicker .quote-supplier-actions>label{display:flex;align-items:center;gap:8px;margin:0}
#quoteSupplierPicker #quoteSupplierOptions{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,220px),1fr));gap:8px 20px;min-width:0}
#quoteSupplierPicker #quoteSupplierOptions>label{display:flex;align-items:flex-start;gap:8px;min-width:0;margin:0;font-size:13px;line-height:1.5}
#quoteSupplierPicker input[type=checkbox]{flex:0 0 auto;width:16px;height:16px;margin:2px 0 0}
#quoteSupplierPicker #quoteSupplierOptions>label>span{min-width:0;overflow-wrap:anywhere}
#quoteSupplierPicker #quoteSupplierOptions>label>small{flex:0 0 auto;margin:0 0 0 auto;color:var(--muted)}
@media(max-width:600px){#quoteSupplierPicker #quoteSupplierOptions{grid-template-columns:minmax(0,1fr)}}

/* Compact route groups share presentation, not supplier identity or permissions. */
:is(#quoteSupplierOptions,#configSupplierOptions,#inventorySupplierOptions){display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;min-width:0}
:is(#quoteSupplierOptions,#configSupplierOptions,#inventorySupplierOptions) .supplier-filter-group{min-width:0;border:1px solid var(--line);padding:10px;border-radius:3px}
:is(#quoteSupplierOptions,#configSupplierOptions,#inventorySupplierOptions) .supplier-filter-group-heading{display:flex;align-items:flex-start;gap:8px;margin:0;font-size:13px;line-height:1.5;min-width:0;flex-wrap:wrap}
:is(#quoteSupplierOptions,#configSupplierOptions,#inventorySupplierOptions) .supplier-filter-group-heading strong{min-width:0;overflow-wrap:anywhere}
:is(#quoteSupplierOptions,#configSupplierOptions,#inventorySupplierOptions) .supplier-filter-group-count{margin-left:auto;white-space:nowrap;font-size:13px;color:var(--muted)}
:is(#quoteSupplierOptions,#configSupplierOptions,#inventorySupplierOptions) details>summary{cursor:pointer;margin-top:8px;font-size:13px}
:is(#quoteSupplierOptions,#configSupplierOptions,#inventorySupplierOptions) .supplier-filter-names{display:grid;gap:6px;padding:10px 0 0;max-height:320px;overflow-y:auto}
:is(#quoteSupplierOptions,#configSupplierOptions,#inventorySupplierOptions) .supplier-filter-names label{display:flex;align-items:flex-start;gap:8px;margin:0;min-width:0;font-size:13px;line-height:1.5}
:is(#quoteSupplierOptions,#configSupplierOptions,#inventorySupplierOptions) .supplier-filter-names span{min-width:0;overflow-wrap:anywhere}
@media(max-width:900px){#quoteSupplierPicker #quoteSupplierOptions,#configSupplierPicker #configSupplierOptions{grid-template-columns:minmax(0,1fr)}}

#quoteSupplierPicker #quoteSupplierOptions{grid-template-columns:repeat(3,minmax(0,1fr))}
@media(max-width:900px){#quoteSupplierPicker #quoteSupplierOptions{grid-template-columns:minmax(0,1fr)}}

@media(max-width:1200px){:is(#quoteSupplierOptions,#configSupplierOptions,#inventorySupplierOptions) .supplier-filter-group-heading{display:grid;grid-template-columns:16px minmax(0,1fr)}:is(#quoteSupplierOptions,#configSupplierOptions,#inventorySupplierOptions) .supplier-filter-group-count{grid-column:2;justify-self:end}}

#view-pack .table-wrap{max-width:100%;min-width:0;overflow-x:auto}
#view-pack .config-table{min-width:1380px}
#view-pack .config-table .carton-dimensions{display:grid;grid-template-columns:repeat(3,100px);gap:8px}
#view-pack .carton-dimension-headings{margin-top:8px;font-size:13px;font-weight:500;color:var(--muted)}
#configRows .carton-dimensions input{width:100px}
#configRows input[data-field="carton_cbm"]{width:135px}
#configRows input[readonly]{background:#f4f4f5;color:var(--muted)}
#configRows [data-carton-source]{max-width:180px}

.product-photo-cell{width:88px;min-width:88px;text-align:center}.product-thumbnail,.product-photo-preview-image{display:block;width:64px;height:64px;object-fit:contain;background:#fff}.product-thumbnail{margin:auto}.product-photo-placeholder{display:block;max-width:90px;color:var(--muted);font-size:13px}.photo-candidate{display:inline-flex;vertical-align:top;align-items:center;gap:6px;max-width:180px;margin:4px 12px 4px 0}.photo-candidate input{width:auto;flex:0 0 auto}.photo-candidate span{font-size:13px}#photoPreviewRows td{vertical-align:top}#photoImportPanel input[type=file]{max-width:100%}

#photoImportPanel>.toolbar{flex-wrap:wrap;align-items:flex-end}#photoImportPanel>.toolbar>label{display:flex;flex-direction:column;gap:4px;min-width:0;max-width:100%}#photoImportPanel>.toolbar>a{max-width:100%;white-space:normal}#photoImportPanel input[type=file],#photoImportPanel select{max-width:100%}

.photo-file-control{display:flex;flex-wrap:wrap;align-items:center;gap:8px;min-width:0;max-width:100%}.photo-file-control>span{overflow-wrap:anywhere}.photo-file-control>.button{max-width:100%;white-space:normal}

input::placeholder,textarea::placeholder{color:#595959;opacity:1}
/* Inventory retains one internal horizontal scroller; numeric columns never squeeze the product anchor. */
.inventory-table-wrap{width:100%;max-width:1200px;min-width:0;overflow-x:auto}
.inventory-table{table-layout:fixed;width:100%;min-width:820px}
.inventory-table .inventory-product{width:36%}
.inventory-table .inventory-number{width:10%}
.inventory-table .inventory-action{width:14%}
.inventory-table th,.inventory-table td{padding:8px 7px;overflow-wrap:anywhere}
.inventory-table th:nth-child(n+3):nth-child(-n+7),.inventory-table td.num{text-align:right}
.inventory-table th{white-space:normal}
.inventory-table .stock-target-value{white-space:normal}
.inventory-table .stock-target-actions{text-align:left;white-space:nowrap}
.inventory-table .stock-target-button{padding:4px 7px;min-height:30px;font-size:13px;margin:0;white-space:nowrap}
#stockTargetDialog{width:min(960px,calc(100vw - 32px));max-height:90vh;overflow:auto}
#stockTargetDialog .table-wrap{max-width:100%;overflow-x:auto}
#stockTargetDialog table{min-width:650px}
#stockTargetRows input{width:145px;max-width:100%;padding:8px;border:1px solid var(--line);border-radius:5px}
#stockTargetRows .button{padding:7px 9px;margin-bottom:6px}
#stockTargetNotice.error{color:#ad3d2c}
#stockTargetSelectedFile{overflow-wrap:anywhere;min-width:0}
#stockTargetImportPanel{margin-bottom:24px}
#stockTargetConfirm{margin-top:16px}
@media(max-width:700px){
 .inventory-table{min-width:820px}
 .inventory-table .inventory-product{width:180px}
 .inventory-table .inventory-number{width:100px}
 .inventory-table .inventory-action{width:140px}
 .inventory-table th:first-child,.inventory-table td:first-child{position:sticky;left:0;z-index:1;background:var(--surface,#fff);box-shadow:1px 0 0 var(--line)}
 .inventory-table th:first-child{background:#e4e4e4;z-index:2}
 #stockTargetImportPanel .toolbar{justify-content:flex-start}
 #stockTargetImportPanel .toolbar .button{max-width:100%}
}
#stockTargetDialog .stock-target-head{position:sticky;top:0;z-index:3;display:flex;justify-content:space-between;align-items:center;gap:12px;background:var(--surface,#fff);padding-bottom:10px}
#stockTargetDialog .stock-target-head h2{margin:0}
#stockTargetClose{flex-shrink:0}

/* Maintenance text uses the exact logo/favicon red, independent of the gold SAP theme. */
#toast.error.maintenance{color:#ed2224}

#inventorySupplierPicker{margin:0 0 12px;padding:10px 12px;max-width:1200px}
#inventorySupplierPicker summary{cursor:pointer;font-size:13px}
.inventory-supplier-controls{display:flex;align-items:center;gap:12px;margin:10px 0}
.inventory-supplier-controls label{display:flex;gap:8px;margin:0;font-size:13px}
#inventorySupplierPicker input[type=checkbox]{width:16px;height:16px;flex:0 0 auto;margin:2px 0 0}
.inventory-supplier-controls .button{padding:4px 8px;min-height:28px;font-size:13px}
.inventory-table th:first-child,.inventory-table td:first-child{position:sticky;left:0;z-index:1;background:var(--surface,#fff);box-shadow:1px 0 0 var(--line)}
.inventory-table th:first-child{background:#e4e4e4;z-index:2}
@media(max-width:900px){#inventorySupplierOptions{grid-template-columns:minmax(0,1fr)}}
/* Read-only inventory detail: scroll belongs to each table, including narrow screens. */
#view-inventory{min-width:0;max-width:100%}.inventory-table-wrap{max-width:100%}.inventory-table{min-width:1230px}.inventory-table .inventory-product{width:25%}.inventory-table .inventory-number{width:8%}.inventory-table .inventory-action{width:11%}.inventory-table th:nth-child(n+3):nth-child(-n+10){text-align:right}.inventory-product-link{border:0;background:none;color:inherit;text-align:left;padding:0;max-width:100%;font-size:15px;line-height:1.5;overflow-wrap:anywhere}.inventory-product-link strong{color:#a81b20;text-decoration:underline;text-underline-offset:3px}.inventory-product-link span{display:block;font-size:13px;color:var(--muted)}.inventory-source-state{font-size:13px;color:var(--muted);white-space:normal}.inventory-transit-state small{white-space:nowrap}.inventory-detail-head{display:flex;justify-content:space-between;gap:16px;align-items:flex-start}.inventory-detail-tabs{display:flex;gap:8px;overflow-x:auto;padding:4px 2px 12px}.inventory-detail-tabs .button{white-space:nowrap}.inventory-detail-tabs [aria-selected=true]{background:#442123;color:#fff;border-color:#442123}#inventoryDetailDialog{width:min(1280px,95vw);max-width:95vw;overflow:auto}#inventoryDetailTitle,#inventoryDetailMeta{overflow-wrap:anywhere}.inventory-detail-table{max-width:100%;max-height:52vh}.inventory-detail-table table{min-width:1100px}.inventory-detail-table th{font-size:14px}.inventory-detail-table td{font-size:15px}.inventory-detail-table td small{font-size:13px}.inventory-detail-table thead{position:sticky;top:0}
@media(max-width:700px){.inventory-table .inventory-product{width:180px}.inventory-table .inventory-number{width:115px}.inventory-table .inventory-action{width:130px}#inventoryDetailDialog{padding:16px}.inventory-detail-tabs .button{padding:8px 12px}.inventory-detail-head h2{font-size:20px}.inventory-detail-table{max-height:48vh}}
/* Match inventory headings and values; keep product/site names easy to scan. */
#currentInventoryPanel .inventory-table th:not(:first-child),
#currentInventoryPanel .inventory-table td:not(:first-child),
#inventoryDetailDialog .inventory-detail-table th:not(:first-child),
#inventoryDetailDialog .inventory-detail-table td:not(:first-child){text-align:center;vertical-align:middle}

/* Two-line product summary; full text remains available in product details. */
#currentInventoryPanel .inventory-table{min-width:1320px}
#currentInventoryPanel .inventory-product{width:380px}
#currentInventoryPanel .inventory-number{width:100px}
#currentInventoryPanel .inventory-action{width:140px}
.inventory-product-link{display:block;width:100%;min-width:0;overflow:hidden}
.inventory-product-link .inventory-product-primary{display:block;font-size:15px;color:inherit;line-height:1.5;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.inventory-product-secondary{display:block;max-width:100%;font-size:13px;line-height:1.5;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
@media(max-width:700px){#currentInventoryPanel .inventory-table{min-width:1220px}#currentInventoryPanel .inventory-product{width:240px}#currentInventoryPanel .inventory-number{width:105px}}

/* Balance product whitespace against longer allocation/transit statuses. */
#currentInventoryPanel .inventory-table{min-width:1330px}
#currentInventoryPanel .inventory-product{width:320px}
#currentInventoryPanel .inventory-allocated{width:110px}
#currentInventoryPanel .inventory-transit{width:160px}
.inventory-transit-state small{white-space:normal;overflow-wrap:normal}
@media(max-width:700px){#currentInventoryPanel .inventory-table{min-width:1280px}#currentInventoryPanel .inventory-product{width:240px}#currentInventoryPanel .inventory-allocated{width:110px}}

/* Category sits between product identity and its thumbnail. */
#view-quotes .price-category-cell{min-width:120px;max-width:200px;overflow-wrap:anywhere}

/* Stop-purchasing controls are separate from forecast enablement. */
.purchasing-discontinued[hidden]{display:none}.purchasing-discontinued{display:block;color:#9b3e18;font-weight:600;white-space:normal}.purchasing-stop-control input[type="checkbox"]{width:auto;flex:none}

.purchasing-status-cell{min-width:120px;white-space:nowrap}.purchasing-status{display:inline-flex;align-items:center;gap:6px;white-space:nowrap}.purchasing-status input[type="checkbox"]{width:auto;flex:none;margin:0}.inventory-table .inventory-status{width:120px}.inventory-table{min-width:1350px}

#stockTargetPreviewPanel>.table-wrap{max-height:480px;margin-top:12px}
/* Inventory bins belong to the selected site, or explicitly labelled sites. */
#currentInventoryPanel .inventory-table col.inventory-bin{width:150px}
#currentInventoryPanel .inventory-bin-cell{overflow-wrap:anywhere;white-space:normal}
#currentInventoryPanel .inventory-bin-cell small{display:block}
#view-transfers table{min-width:1450px}

/* On phones, Product moves with the inventory table so it cannot cover other columns. */
@media(max-width:700px){
 #currentInventoryPanel .inventory-table th:first-child,
 #currentInventoryPanel .inventory-table td:first-child{
  position:static;left:auto;z-index:auto;box-shadow:none
 }
}

/* Keep phone price rows readable: scroll the table instead of squeezing Product. */
@media(max-width:700px){
 #view-quotes{min-width:0;max-width:100%}
 #view-quotes>.table-wrap{max-width:100%;min-width:0;overflow-x:auto}
 #view-quotes>.table-wrap>table{min-width:1180px}
 #view-quotes>.table-wrap>table th:first-child,
 #view-quotes>.table-wrap>table td:first-child{width:300px;min-width:300px}
}

/* Inventory-only compact presentation, based on Product & Sourcing Status.
   Keep data, control IDs, table geometry owners and business handlers intact. */
#view-inventory {
 --inv-surface: light-dark(#fff, #282a30);
 --inv-inset: light-dark(#efefef, #303239);
 --inv-ink: light-dark(#17212b, #edf0f4);
 --inv-muted: light-dark(#52606b, #bac4d0);
 --inv-line: light-dark(#cdd0d4, #4a4e58);
 --inv-yellow: light-dark(#956d00, #e9c854);
 --inv-selected: light-dark(#fff2b0, #51431b);
 color: var(--inv-ink);
 font-size: 14px;
 line-height: 1.45;
 min-width: 0;
}
#view-inventory .inventory-view-tabs {
 justify-content: flex-start;
 gap: 6px;
 margin: 0 0 10px;
 padding: 0;
}
#view-inventory .button,
#view-inventory input:not([type="checkbox"]),
#view-inventory select {
 min-height: 34px;
 border: 1px solid var(--inv-line);
 border-radius: 3px;
 padding: 6px 10px;
 background: var(--inv-surface);
 color: var(--inv-ink);
 font: inherit;
}
#view-inventory .button { box-shadow: none; }
#view-inventory .button:not(:disabled):hover { border-color: var(--inv-yellow); }
#view-inventory .button[aria-selected="true"] {
 background: var(--inv-selected);
 border-color: var(--inv-yellow);
 color: var(--inv-ink);
}
#view-inventory :is(button, input, select, summary):focus-visible {
 outline: 2px solid var(--inv-yellow);
 outline-offset: 2px;
}
#view-inventory .inventory-query-panel {
 margin: 0 0 10px;
 border: 1px solid var(--inv-line);
 border-radius: 3px;
 background: var(--inv-surface);
}
#view-inventory .inventory-query-panel .section-head {
 margin: 0;
 padding: 10px 12px 8px;
 border-bottom: 1px solid var(--inv-line);
 gap: 8px;
}
#view-inventory .section-head h2 { font-size: 15px; line-height: 1.45; margin: 0; }
#view-inventory #stockContext { margin: 3px 0 0; color: var(--inv-muted); font-size: 12px; }
#view-inventory .inventory-query-panel > .toolbar {
 display: grid;
 grid-template-columns: minmax(220px, 1.6fr) minmax(180px, 1fr);
 align-items: end;
 gap: 10px;
 margin: 0;
 padding: 10px 12px;
}
#view-inventory .toolbar label { display: grid; gap: 4px; min-width: 0; font-size: 12px; color: var(--inv-muted); }
#view-inventory .toolbar input,
#view-inventory .toolbar select { width: 100%; min-width: 0; max-width: none; color: var(--inv-ink); font-size: 14px; }
#view-inventory #inventorySupplierPicker {
 margin: 0;
 padding: 0 12px 10px;
 border: 0;
 border-radius: 0;
 max-width: none;
 background: transparent;
}
#view-inventory #inventorySupplierPicker > summary {
 padding: 8px 0 0;
 border-top: 1px solid var(--inv-line);
 font-size: 13px;
 color: var(--inv-ink);
 min-height: 30px;
}
#view-inventory .inventory-supplier-controls { gap: 8px; margin-top: 8px; }
#view-inventory #inventorySupplierPicker label { font-size: 13px; line-height: 1.45; gap: 7px; }
#view-inventory #inventorySupplierPicker input[type="checkbox"] { width: 17px; height: 17px; margin: 0; accent-color: var(--inv-yellow); }
#view-inventory #inventorySupplierOptions { gap: 8px; padding: 8px 0 0; }
#view-inventory #inventorySupplierOptions .supplier-filter-group { padding: 9px 10px; border-color: var(--inv-line); border-radius: 3px; background: var(--inv-surface); }
#view-inventory #inventorySupplierOptions details { margin: 7px 0 0; padding-top: 7px; border-color: var(--inv-line); }
#view-inventory #inventorySupplierOptions summary { font-size: 13px; color: var(--inv-muted); }
#view-inventory #inventorySupplierOptions .supplier-filter-names { gap: 6px; padding-top: 8px; }
#view-inventory .table-wrap { border-color: var(--inv-line); border-radius: 3px; background: var(--inv-surface); margin: 0; }
#view-inventory table { font-size: 13px; color: var(--inv-ink); }
#view-inventory th,
#view-inventory td { padding: 9px 10px; line-height: 1.45; border-bottom-color: var(--inv-line); }
#view-inventory td { padding-top: 7px; padding-bottom: 7px; }
#view-inventory th { background: var(--inv-inset); color: var(--inv-ink); font-size: 13px; }
#view-inventory .inventory-table td:first-child { background: var(--inv-surface); }
#view-inventory tbody tr:hover,
#view-inventory .inventory-table tr:hover td:first-child { background: color-mix(in srgb, var(--inv-selected) 28%, var(--inv-surface)); }
#view-inventory .inventory-product-link { min-height: 0; border: 0; border-radius: 0; padding: 0; background: none; color: var(--inv-ink); }
#view-inventory .inventory-product-link .inventory-product-primary { font-size: 14px; line-height: 1.45; }
#view-inventory .inventory-product-link strong { color: var(--inv-ink); text-underline-offset: 3px; }
#view-inventory .inventory-product-secondary { color: var(--inv-muted); font-size: 12px; line-height: 1.45; margin-top: 3px; }
#view-inventory .inventory-bin-cell,
#view-inventory .inventory-source-state,
#view-inventory .inventory-transit-state,
#view-inventory .purchasing-status { font-size: 13px; }
#view-inventory td small { font-size: 12px; }
#view-inventory td.num { font-variant-numeric: tabular-nums; }
#view-inventory .inventory-purchase-status { display: inline-block; padding: 2px 6px; border-radius: 4px; font-size: 12px; font-weight: 600; line-height: 1.45; white-space: normal; background: var(--inv-inset); color: var(--inv-ink); }
#view-inventory [data-purchase-status="allowed"] { color: light-dark(#205b41, #a6dec0); background: light-dark(#eaf4ed, #253b31); }
#view-inventory [data-purchase-status="blocked"] { color: light-dark(#91372d, #ffb1a6); background: light-dark(#fbeeea, #482e2b); }
#view-inventory [data-purchase-status="mixed"] { color: var(--inv-ink); background: var(--inv-selected); }
#view-inventory .stock-target-button { padding: 5px 9px; font-size: 13px; white-space: nowrap; }
#view-inventory .pager { gap: 8px; margin: 0 0 10px; padding: 9px 0; font-size: 12px; color: var(--inv-muted); }
#view-inventory .pager > div { gap: 6px; }
#view-inventory #currentInventoryPanel > p.secondary,
#view-inventory #stockHistoryNote { font-size: 12px; color: var(--inv-muted); margin: 8px 0; line-height: 1.5; }
#view-inventory #locationStatus { gap: 6px; margin-top: 8px; font-size: 12px; }
#view-inventory #stockHistoryPanel > .toolbar { gap: 8px; margin: 10px 0; padding: 10px 12px; border: 1px solid var(--inv-line); border-radius: 3px; background: var(--inv-surface); }
#view-inventory #stockHistoryPanel h3 { margin: 12px 0 8px; font-size: 15px; }
@media (max-width: 700px) {
 #view-inventory .inventory-query-panel > .toolbar { grid-template-columns: minmax(0, 1fr); gap: 8px; }
 #view-inventory .inventory-view-tabs { flex-wrap: wrap; }
 #view-inventory #stockHistoryPanel > .toolbar label { flex: 1 1 140px; }
 #view-inventory .pager { align-items: flex-start; flex-wrap: wrap; }
 #view-inventory .pager > div { flex-wrap: wrap; }
}
@media (pointer: coarse) {
 #view-inventory .button,
 #view-inventory input:not([type="checkbox"]),
 #view-inventory select { min-height: 44px; }
 #view-inventory input:not([type="checkbox"]),
 #view-inventory select { font-size: 16px; }
 #view-inventory #inventorySupplierPicker summary,
 #view-inventory #inventorySupplierPicker label { min-height: 44px; }
 #view-inventory .inventory-product-link { min-height: 44px; }
}

/* One combined product table; photos precede product identity. */
#view-forecast table:has(#forecastRows) { min-width: 1250px; }
#view-forecast .forecast-photo-heading, #forecastRows td:first-child { min-width: 84px; width: 84px; text-align: center; }
#forecastRows td:nth-child(2) { min-width: 235px; max-width: 320px; }
#forecastRows .product-thumbnail { width: 64px; height: 64px; }
#view-inventory #currentInventoryPanel .inventory-table { min-width: 1460px; }
#view-inventory #currentInventoryPanel .inventory-product { width: 220px; }
#view-inventory #currentInventoryPanel .inventory-status { width: 100px; }
#view-inventory #currentInventoryPanel col.inventory-status:nth-child(3) { width: 126px; }
#view-inventory #currentInventoryPanel .purchasing-status-cell { min-width: 100px; white-space: normal; }
#view-inventory .inventory-product-link :is(.inventory-product-code,.inventory-product-description) { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 1.4; }
#view-inventory .inventory-product-code { font-size: 14px; }
#view-inventory .inventory-product-description { font-size: 13px; color: var(--inv-ink); }
#view-quotes > .section-head h2 { margin-bottom: 3px; }
#view-quotes .overview-help { margin: 0 0 10px; font-size: 12px; color: var(--muted); }
#view-quotes .overview-help summary { cursor: pointer; width: fit-content; }
#view-quotes .overview-help p { margin: 6px 0; }
#view-quotes > .section-head p, #view-quotes > p.secondary { font-size: 12px; margin: 4px 0; }
#view-quotes .toolbar { margin: 10px 0; }
#view-quotes .toolbar input[type=search] { width: min(360px, 60vw); }
#view-quotes .toolbar input[type=checkbox] { min-width: 0; width: 16px; min-height: 0; padding: 0; flex: 0 0 16px; }
#view-quotes #quoteSupplierPicker { margin: 8px 0; padding: 8px 12px; }
#view-quotes .table-wrap { border: 1px solid #c8cdd2; background: #fff; }
#view-quotes .table-wrap table:has(#quoteRows) { min-width: 1360px; table-layout: fixed; }
#view-quotes table:has(#quoteRows) th { padding: 9px 8px; font-size: 12px; }
#quoteRows td { padding: 8px; vertical-align: middle; font-size: 13px; }
#view-quotes table:has(#quoteRows) :is(th,td):nth-child(1) { width: 84px; min-width: 84px; }
#view-quotes table:has(#quoteRows) :is(th,td):nth-child(2) { width: 265px; min-width: 265px; }
#view-quotes table:has(#quoteRows) :is(th,td):nth-child(3) { width: 140px; }
#view-quotes table:has(#quoteRows) :is(th,td):nth-child(4) { width: 104px; }
#view-quotes table:has(#quoteRows) :is(th,td):nth-child(5) { width: 104px; }
#view-quotes table:has(#quoteRows) :is(th,td):nth-child(6) { width: 100px; }
#view-quotes table:has(#quoteRows) :is(th,td):nth-child(7) { width: 82px; }
#view-quotes table:has(#quoteRows) :is(th,td):nth-child(8), #view-quotes table:has(#quoteRows) :is(th,td):nth-child(9) { width: 84px; }
#view-quotes table:has(#quoteRows) :is(th,td):nth-child(10) { width: 188px; }
#view-quotes table:has(#quoteRows) :is(th,td):nth-child(11) { width: 100px; }
.product-overview-table :is(.overview-cbm-heading,.overview-split-heading) { display: inline-grid; white-space: normal; line-height: 1.35; }
.product-overview-table .overview-split-heading > span:empty { display: none; }
#view-quotes table:has(#quoteRows) :is(th,td):nth-child(12) { width: 128px; }
#quoteRows .product-row-actions { display: flex; flex-direction: column; gap: 6px; }
#quoteRows .product-row-actions .button { width: 100%; min-height: 32px; padding: 6px; white-space: nowrap; font-size: 12px; }
#quoteRows td:nth-child(n+4):nth-child(-n+7) { font-variant-numeric: tabular-nums; }
#quoteRows input[data-field] { width: 85px; min-height: 34px; padding: 5px 7px; }
#quoteRows :is(input[data-field=case_size],input[data-field=pack]) { width: 64px; }
.product-overview-table .carton-dimensions { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 5px; }
.product-overview-table .carton-dimension-headings { margin-top: 5px; font-size: 11px; font-weight: 400; color: var(--muted); }
#quoteRows .carton-dimensions input { width: 100%; }
#quoteRows input[data-field=carton_cbm] { width: 76px; }
#quoteRows input[readonly] { background: #f4f4f5; color: var(--muted); }
#quoteRows [data-carton-source] { max-width: 84px; font-size: 11px; line-height: 1.25; }
#view-quotes .table-wrap table:has(#quoteRows) :is(th,td):first-child { position: static; left: auto; }
@media(min-width:701px) {
 #view-quotes .table-wrap table:has(#quoteRows) :is(th,td):first-child { position: sticky; left: 0; z-index: 2; background: #fff; }
 #view-quotes .table-wrap table:has(#quoteRows) :is(th,td):nth-child(2) { position: sticky; left: 84px; z-index: 2; background: #fff; box-shadow: 1px 0 #c8cdd2; }
 #view-quotes .table-wrap table:has(#quoteRows) th:nth-child(-n+2) { background: #e4e4e4; }
}
@media(max-width:700px) {
 #quoteRows input[data-field], #quoteRows button { min-height: 44px; }
 #quoteRows input[data-field] { font-size: 16px; }
}
