/* Shared MAX visual contract: home cards, equal control geometry and distinct palettes. */
html#max-dashboard[data-appearance=default]{--ui-accent:#246b68;--ui-accent-ink:#153e3c;--ui-bg:#faf3e8;--ui-panel:#fffcf6;--ui-raised:#fffdfa;--ui-soft:#f4e8d9;--ui-tint:#dfefea;--ui-line:#e6d6c3}
html#max-dashboard[data-appearance=light]{--ui-bg:#f1f5ff;--ui-panel:#ffffff;--ui-raised:#ffffff;--ui-soft:#e8eeff;--ui-ink:#1a2440;--ui-muted:#63718f;--ui-line:#cdd9f4;--ui-accent:#355dd2;--ui-accent-ink:#fff;--ui-tint:#dce6ff;--plum:#355dd2;--plum-dark:#274bb0;--hub-surface:#f3f6ff;--hub-color-strength:20%;--hub-edge-strength:48%;--hub-shadow-strength:12%;--ui-icon-filter:brightness(0) saturate(100%) invert(35%) sepia(90%) saturate(1800%) hue-rotate(215deg)}
html#max-dashboard[data-appearance=light] body{background:radial-gradient(ellipse at 100% 0%,#a4bfff38,transparent 55%),var(--ui-bg)!important}
html#max-dashboard[data-appearance=light] body :is(.commerce-button.primary,.core-primary,.appearance-save,.inventory-primary,.p-primary,button[type=submit],.inventory-action.primary,.sc-toolbar button.primary,.sc-footer button.primary,.sc-primary,.ix-button.primary,.ix-button.ix-primary,.br-dialog button.primary,.bd-dialog button.primary,.date-apply){background:#355dd2!important;color:#fff!important;border-color:#355dd2!important;box-shadow:0 4px 14px #355dd225!important}
html#max-dashboard[data-appearance=light] body :is([aria-selected=true],.max-view-switch button[aria-pressed=true],.mw-tab.active,.commerce-tab.active){background:#dce6ff!important;color:#274bb0!important;border-color:#7295ed!important}
html#max-dashboard[data-appearance=light] body .maxdash-header .toolbar #maxWeather{background:linear-gradient(130deg,#ffffffd9,#c4d5ff99 65%,#d4e7ff99)!important;color:#274bb0!important;border-color:#ffffffdf!important}
html#max-dashboard body .reference-home .ref-card-rows .ref-tile::before{display:none!important;content:none!important}
html#max-dashboard body .max-reference-card{display:flex!important;flex-direction:column!important;align-items:center!important;text-align:center!important;position:relative!important;min-height:264px!important;height:auto!important;padding:24px 20px 16px!important;gap:14px!important;border-radius:22px!important;background:var(--hub-background,var(--ui-panel))!important;border:1px solid var(--hub-border,var(--ui-line))!important;box-shadow:var(--hub-shadow,var(--ui-shadow))!important;color:var(--ui-ink)!important;box-sizing:border-box!important;overflow:hidden;transition:transform .18s,border-color .18s,box-shadow .18s!important}
html#max-dashboard body .max-reference-card:hover{transform:translateY(-3px)!important;border-color:var(--card-accent,var(--ui-accent))!important;box-shadow:0 12px 28px color-mix(in srgb,var(--card-glow,var(--ui-accent)) 20%,transparent)!important}
html#max-dashboard body .max-reference-card :is(.ref-tile-copy,.mw-card-copy){display:flex!important;flex-direction:column!important;align-items:center!important;gap:8px!important;flex:1!important;width:100%!important}
html#max-dashboard body .max-reference-card :is(h2,h3,.inventory-card-title,.mw-card-title,.ref-tile-copy b){font-size:18px!important;font-weight:700!important;line-height:1.55!important;color:var(--ui-ink)!important;margin:0!important}
html#max-dashboard body .max-reference-card :is(p,.inventory-card-description,.ref-tile-copy small){font-size:13px!important;line-height:1.8!important;color:var(--ui-muted)!important;max-width:32ch!important;margin:0!important}
html#max-dashboard body .max-reference-card :is(.ref-tile-footer,.inventory-card-footer,.mw-card-open,.op-card-bottom,.mg-card-bottom){position:static!important;display:flex!important;align-items:center!important;justify-content:space-between!important;align-self:stretch!important;gap:8px!important;width:100%!important;min-height:38px!important;border:1px solid color-mix(in srgb,var(--card-accent,var(--ui-accent)) 43%,transparent)!important;border-radius:99px!important;background:color-mix(in srgb,var(--card-accent,var(--ui-accent)) 11%,transparent)!important;color:var(--card-accent,var(--ui-accent))!important;padding:8px 12px!important;font-size:12px!important;font-weight:600!important;margin-top:auto!important;box-sizing:border-box!important}
html#max-dashboard body .max-reference-card .inventory-card-top{display:flex!important;flex-direction:column-reverse!important;align-items:center!important;gap:14px!important;width:100%!important}
html#max-dashboard body .max-reference-card .inventory-card-icon{align-self:center!important}
html#max-dashboard body .material-unit-fields{align-items:start!important}
html#max-dashboard body .material-unit-fields label{align-content:start!important;grid-template-rows:auto 44px!important}
html#max-dashboard body .material-editor :is(input,select){height:44px!important;min-height:44px!important;max-height:44px!important;box-sizing:border-box!important;padding:8px 12px!important;line-height:normal!important}
html#max-dashboard body .mwi-quantity-field{display:grid!important;grid-template-columns:minmax(0,1fr)!important;gap:6px!important;min-width:0!important;align-items:start!important}
html#max-dashboard body .mwi-quantity-field .mwi-unit{grid-row:1!important;position:static!important;display:block!important;text-align:start!important;width:auto!important;background:transparent!important;border:0!important;padding:0!important;font-size:12px!important;color:var(--ui-muted)!important}
html#max-dashboard body .mwi-quantity-field input{grid-row:2!important;width:100%!important;height:44px!important;min-height:44px!important;padding:8px 12px!important;box-sizing:border-box!important}
html#max-dashboard body :is(.mw-dialog-actions,.mcr-dialog footer,.material-category-actions,.bd-dialog footer,.tr-document-actions,.tr-save-footer,.tr-receive-footer){display:flex!important;gap:10px!important;align-items:stretch!important}
html#max-dashboard body :is(.mw-dialog-actions,.mcr-dialog footer,.material-category-actions,.bd-dialog footer,.tr-document-actions)>button{flex:1 1 0!important;min-width:0!important;height:44px!important;min-height:44px!important;padding:8px 16px!important;font-size:14px!important;box-sizing:border-box!important;line-height:1.4!important}
html#max-dashboard body :is(.sc-page-actions,.mwr-actions,.mw-heading>div:last-child,.tr-list-filters)>.commerce-button{height:40px!important;min-height:40px!important;padding:8px 14px!important;box-sizing:border-box!important}
html#max-dashboard body .max-account-menu{background:linear-gradient(135deg,#ffffff91,#ffffff18 48%,#ffffff50),color-mix(in srgb,var(--ui-panel) 65%,transparent)!important;border:1px solid color-mix(in srgb,var(--ui-accent) 22%,#ffffffb0)!important;box-shadow:inset 1px 1px 0 #ffffffd0,0 18px 55px color-mix(in srgb,var(--ui-accent) 20%,transparent)!important;backdrop-filter:blur(30px) saturate(170%)!important;-webkit-backdrop-filter:blur(30px) saturate(170%)!important}
html#max-dashboard body .max-account-branches button{border:1px solid color-mix(in srgb,var(--ui-accent) 13%,transparent)!important;background:color-mix(in srgb,var(--ui-raised) 45%,transparent)!important;margin:2px 0!important;box-shadow:inset 0 1px 0 #ffffff60!important}
html#max-dashboard body .max-account-branches button[aria-current=true]{background:color-mix(in srgb,var(--ui-tint) 80%,transparent)!important;border-color:var(--ui-accent)!important}
html#max-dashboard[data-appearance=dark] body .max-account-menu{background:linear-gradient(135deg,#ffffff14,transparent),color-mix(in srgb,var(--ui-panel) 85%,transparent)!important;border-color:#ffffff26!important;box-shadow:inset 0 1px 0 #ffffff18,0 18px 55px #0005!important}
@media(min-width:761px){html#max-dashboard body .maxdash-header>.topbar-first{display:grid!important;grid-template-columns:auto minmax(160px,1fr) auto 44px!important;align-items:center!important;gap:18px!important;direction:ltr!important}html#max-dashboard body .maxdash-header .maxdash-brand{grid-column:1!important;grid-row:1!important}html#max-dashboard body .maxdash-header .ref-global-search{grid-column:2!important;grid-row:1!important;width:100%!important;min-width:0!important}html#max-dashboard body .maxdash-header .toolbar{grid-column:3!important;grid-row:1!important;margin:0!important;direction:rtl!important}html#max-dashboard body .maxdash-header .profile-control{grid-column:4!important;grid-row:1!important;justify-self:end!important}html#max-dashboard[lang=en] body .maxdash-header>.topbar-first{grid-template-columns:44px auto minmax(160px,1fr) auto!important}html#max-dashboard[lang=en] body .maxdash-header .profile-control{grid-column:1!important;justify-self:start!important}html#max-dashboard[lang=en] body .maxdash-header .toolbar{grid-column:2!important;direction:ltr!important}html#max-dashboard[lang=en] body .maxdash-header .ref-global-search{grid-column:3!important}html#max-dashboard[lang=en] body .maxdash-header .maxdash-brand{grid-column:4!important}}
@media(max-width:760px){html#max-dashboard body .maxdash-header .profile-control{grid-column:6!important;grid-row:1!important;justify-self:end!important}html#max-dashboard[lang=en] body .maxdash-header>.topbar-first{grid-template-columns:repeat(5,30px) minmax(0,1fr)!important}html#max-dashboard[lang=en] body .maxdash-header .profile-control{grid-column:1!important;justify-self:start!important}html#max-dashboard[lang=en] body .maxdash-header .maxdash-brand{grid-column:5/7!important;justify-self:end!important}html#max-dashboard[lang=en] body .maxdash-header #languageToggle{grid-column:2!important}html#max-dashboard[lang=en] body .maxdash-header #dateSelect{grid-column:3!important}html#max-dashboard[lang=en] body .maxdash-header #notifications{grid-column:4!important}html#max-dashboard[lang=en] body .maxdash-header .ref-global-search{grid-column:4/7!important}html#max-dashboard[lang=en] body .maxdash-header #maxWeather{grid-column:1/4!important}}
@media(prefers-reduced-motion:reduce){html#max-dashboard body .max-reference-card{transition:none!important;transform:none!important}}
html#max-dashboard body .maxdash-header .profile-control #profile{background:linear-gradient(135deg,#ffffffd9,#ffffff30 48%,#ffffff75),color-mix(in srgb,var(--ui-accent) 20%,var(--ui-tint))!important;color:var(--ui-accent)!important;border:1px solid #ffffffcf!important;box-shadow:inset 1px 1px 0 #fff,0 4px 12px color-mix(in srgb,var(--ui-accent) 17%,transparent)!important;backdrop-filter:blur(18px) saturate(160%)}
@media(max-width:760px){html#max-dashboard body .maxdash-header .profile-control #profile{width:30px!important;height:30px!important;min-height:30px!important;min-width:30px!important;font-size:12px!important}}
html#max-dashboard[data-appearance=light] body :is(.commerce-button,.inventory-action,.mw-tab,.mwr-actions button,.inventory-action-footer-cancel){background:#edf2ff!important;color:#2c4da8!important;border-color:#c2d1f6!important}
html#max-dashboard[data-appearance=light] body :is(.commerce-button.primary,.inventory-action.primary,button[type=submit]){background:#355dd2!important;color:#fff!important;border-color:#355dd2!important}
html#max-dashboard body .max-reference-card .inventory-card-content{display:flex!important;flex-direction:column!important;align-items:center!important;gap:14px!important;flex:1!important;width:100%!important}
html#max-dashboard body .max-reference-card .inventory-card-copy{display:flex!important;flex-direction:column!important;align-items:center!important;gap:8px!important;width:100%!important}
html#max-dashboard body .max-reference-card .inventory-card-copy b{font-size:18px!important;line-height:1.55!important;color:var(--ui-ink)!important}
html#max-dashboard body .max-reference-card .inventory-card-copy small{font-size:13px!important;line-height:1.8!important;color:var(--ui-muted)!important;max-width:32ch!important}
html#max-dashboard body .max-reference-card .inventory-card-symbol{position:relative!important;display:grid!important;place-items:center!important;width:64px!important;height:64px!important;padding:12px!important;border-radius:20px!important;border:1px solid color-mix(in srgb,var(--card-accent) 48%,transparent)!important;background:linear-gradient(145deg,color-mix(in srgb,var(--card-accent) 10%,transparent),color-mix(in srgb,var(--card-accent) 26%,transparent))!important;box-shadow:inset 0 1px 0 #ffffff59,0 4px 16px color-mix(in srgb,var(--card-accent) 10%,transparent)!important;box-sizing:border-box!important}
html#max-dashboard body .max-reference-card .inventory-card-symbol img{width:40px!important;height:40px!important}
html#max-dashboard body .max-reference-card .inventory-card-open{font-size:0!important;background:transparent!important;border:0!important;padding:0!important;width:16px!important;height:16px!important}
html#max-dashboard body .max-reference-card .inventory-card-open img{width:14px!important;height:14px!important}

/* Light uses the original six card hues, with a softer wash only. */
html#max-dashboard[data-appearance=light]{--ui-bg:#f9fbff;--ui-panel:#fff;--ui-raised:#fff;--ui-soft:#f2f6ff;--ui-tint:#edf3ff;--ui-line:#dce5f4;--hub-surface:#fff;--hub-color-strength:12%;--hub-edge-strength:32%;--hub-shadow-strength:6%}
html#max-dashboard[data-appearance=light] body :is(.commerce-button.primary,.inventory-action.primary,button[type=submit],.core-primary,.appearance-save,.inventory-primary,.p-primary,.sc-primary,.date-apply){background:#e5edff!important;color:#315ab6!important;border-color:#c8d8f7!important;box-shadow:0 3px 10px #6489ce12!important}
html#max-dashboard[data-appearance=light] body .maxdash-header{background:radial-gradient(ellipse at 18% 0%,#d5e2ff70,transparent 60%),#ffffffd9!important}
html#max-dashboard body .max-reference-card:is(.ref-tile,.mw-nav-card,.op-card,.mg-card,.commerce-card,.workspace-info-card,.inventory-section-card,.ix-family-card,.p-card)::before{content:none!important;display:none!important}
html#max-dashboard body .max-reference-card :is(.ref-tile-icon,.mw-card-icon,.op-symbol,.mg-symbol,.ix-family-symbol,.inventory-card-icon,.inventory-card-symbol,.commerce-card-icon,.workspace-card-icon,.p-card-icon){width:64px!important;height:64px!important;min-width:64px!important;flex:0 0 64px!important;padding:12px!important;border-radius:20px!important;box-sizing:border-box!important;display:grid!important;place-items:center!important;align-self:center!important}
html#max-dashboard body .max-reference-card :is(.ref-tile-icon,.mw-card-icon,.op-symbol,.mg-symbol,.ix-family-symbol,.inventory-card-icon,.inventory-card-symbol,.commerce-card-icon,.workspace-card-icon,.p-card-icon)>:is(img,svg){width:40px!important;height:40px!important;max-width:40px!important;max-height:40px!important}
/* Menu directories and product tiles follow the same home card geometry. */
html#max-dashboard body .max-reference-card .mw-card-top{display:flex!important;justify-content:center!important;align-items:center!important;width:100%!important;margin:0!important;padding:0!important}
html#max-dashboard body .max-reference-card .mw-card-description{font-size:13px!important;line-height:1.8!important;color:var(--ui-muted)!important;max-width:32ch!important;margin:0!important;flex:1!important}
html#max-dashboard body .max-reference-card .mw-card-open img{width:14px!important;height:14px!important}
html#max-dashboard body .max-reference-card .mw-card-stat{display:flex!important;justify-content:space-between!important;align-items:center!important;width:100%!important;padding-top:10px!important;border-top:1px solid color-mix(in srgb,var(--card-accent) 23%,transparent)!important;color:var(--card-accent)!important}
html#max-dashboard body .max-reference-card .mw-card-stat small{font-size:11px!important;color:var(--ui-muted)!important}
html#max-dashboard body .max-reference-card .mw-card-stat b{font-size:19px!important;font-weight:400!important}
html#max-dashboard body .mw-product-card.max-reference-card>div{align-items:center!important;width:100%!important;flex:1!important}
html#max-dashboard body .mw-product-card.max-reference-card .mw-product-icon{border:1px solid color-mix(in srgb,var(--card-accent) 48%,transparent)!important;background:color-mix(in srgb,var(--card-accent) 13%,transparent)!important;border-radius:20px!important;padding:12px!important}
html#max-dashboard body .mw-product-card.max-reference-card .mw-product-icon img{width:40px!important;height:40px!important;object-fit:contain!important}
html#max-dashboard body .mw-product-card.max-reference-card footer{border:1px solid color-mix(in srgb,var(--card-accent) 43%,transparent)!important;border-radius:99px!important;background:color-mix(in srgb,var(--card-accent) 11%,transparent)!important;padding:8px 12px!important;box-sizing:border-box!important;min-height:38px!important}
html#max-dashboard body .mw-product-card.max-reference-card footer b{font-size:15px!important;font-weight:500!important;color:var(--card-accent)!important}
.mw-import-category-cell{min-width:230px;max-width:340px;white-space:normal}
.mw-import-category-cell select,.mw-import-category-cell input{width:100%;min-height:44px;box-sizing:border-box;border:1px solid var(--ui-line);border-radius:9px;background:var(--ui-panel);color:var(--ui-ink);padding:8px 12px;font:inherit}
.mw-import-category-cell [data-inline-category]{display:grid;gap:10px;margin-top:12px;padding:12px;border:1px solid var(--ui-line);border-radius:12px;background:var(--ui-soft)}
.mw-import-category-cell [data-inline-category][hidden]{display:none}
.mw-import-category-cell label{display:grid;gap:6px;font-size:12px}
.mw-import-category-cell [data-inline-category]>div{display:flex;gap:8px}
.mw-import-category-cell [data-inline-category] button{flex:1;min-height:40px;font-size:12px;justify-content:center}
[data-import-preview] .mw-table td:first-child{min-width:40px}
[data-import-preview] .mw-error{white-space:normal;display:block;min-width:150px}
html#max-dashboard body .max-reference-card .mw-card-icon.max-hub-icon{border:1px solid color-mix(in srgb,var(--card-accent) 48%,transparent)!important;background:linear-gradient(145deg,color-mix(in srgb,var(--card-accent) 10%,transparent),color-mix(in srgb,var(--card-accent) 26%,transparent))!important;box-shadow:inset 0 1px 0 #ffffff59,0 4px 16px color-mix(in srgb,var(--card-accent) 10%,transparent)!important}
