:root{--ink:#111;--panel:#171717;--yellow:#ffb000;--bright:#feb805;--cream:#fbf9f2;--deep:#f5f2ea;--white:#fff;--copy:#5f5f61;--line:#d8d5cc;--green:#1f7a53;--red:#ba3d32;--sidebar:248px;--radius:14px;--shadow:0 18px 55px rgba(17,17,17,.12)}
*{box-sizing:border-box}html{scroll-behavior:smooth}body{margin:0;background:var(--cream);color:var(--ink);font-family:Manrope,Arial,sans-serif;font-size:14px}.app-shell{display:grid;grid-template-columns:var(--sidebar) 1fr;min-height:100vh}.sidebar{position:fixed;inset:0 auto 0 0;width:var(--sidebar);background:var(--ink);color:#fff;padding:26px 18px 18px;display:flex;flex-direction:column;z-index:20}.brand{display:flex;align-items:center;gap:12px;color:#fff;text-decoration:none;padding:0 8px 25px}.brand-mark,.mobile-brand{width:38px;height:38px;border:0;border-radius:4px;background:var(--yellow);color:var(--ink);font-weight:900;font-size:22px;display:grid;place-items:center}.brand strong,.brand small{display:block}.brand strong{font-size:15px;letter-spacing:.04em}.brand small{margin-top:2px;color:#aaa;font-size:9px;letter-spacing:.18em}.side-nav{display:flex;flex-direction:column;gap:4px}.side-nav p{margin:22px 10px 7px;color:#767676;font-size:9px;font-weight:800;letter-spacing:.18em}.side-nav a,.side-nav button{width:100%;height:44px;border:0;border-radius:8px;padding:0 12px;display:flex;align-items:center;gap:12px;background:transparent;color:#bdbdbd;text-decoration:none;font:600 12px Manrope;cursor:pointer;text-align:left}.side-nav a:hover,.side-nav button:hover,.side-nav a.active{background:#252525;color:#fff}.side-nav a.active{box-shadow:inset 3px 0 var(--yellow)}.side-nav button small{margin-left:auto;border:1px solid #444;border-radius:99px;padding:2px 6px;font-size:8px}.nav-icon{width:20px;text-align:center;font-size:17px}.sidebar-foot{margin-top:auto;border-top:1px solid #292929;padding:18px 8px 0;display:flex;align-items:center;gap:10px}.sidebar-foot strong,.sidebar-foot small{display:block}.sidebar-foot strong{font-size:11px}.sidebar-foot small{color:#888;font-size:9px;margin-top:2px}.operator-avatar{width:34px;height:34px;border-radius:50%;background:var(--yellow);color:#111;display:grid;place-items:center;font-weight:900;font-size:10px}main{grid-column:2;min-width:0}.topbar{height:76px;background:#fff;border-bottom:1px solid #e8e5dd;display:flex;align-items:center;padding:0 30px;gap:14px;position:sticky;top:0;z-index:10}.top-title{display:flex;flex-direction:column;min-width:190px}.top-title strong{font-size:9px;color:#999;text-transform:uppercase;letter-spacing:.13em}.top-title span{font-size:18px;font-weight:800}.global-search{margin-left:auto;width:min(350px,34vw);height:40px;border:1px solid var(--line);border-radius:9px;background:var(--cream);display:flex;align-items:center;padding:0 12px;gap:8px}.global-search input{border:0;outline:0;background:transparent;width:100%;font:500 12px Manrope}.icon-button{width:40px;height:40px;border:1px solid var(--line);background:#fff;border-radius:9px;cursor:pointer;font-size:18px}.notification{font-size:8px;color:var(--yellow)}.mobile-brand{display:none}.content{padding:30px;max-width:1530px;margin:auto}.page-head{display:flex;align-items:flex-end;justify-content:space-between;gap:20px;margin-bottom:24px}.page-head h1{margin:0;font-size:28px;line-height:1.1}.page-head p{color:var(--copy);margin:7px 0 0;max-width:680px}.actions{display:flex;gap:9px;flex-wrap:wrap}.button{border:1px solid var(--ink);background:var(--ink);color:#fff;min-height:40px;padding:0 15px;border-radius:8px;font:700 11px Manrope;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;gap:8px}.button:hover{transform:translateY(-1px)}.button.yellow{background:var(--yellow);border-color:var(--yellow);color:#111}.button.ghost{background:#fff;border-color:var(--line);color:#111}.button.danger{color:var(--red);border-color:#eacbc7;background:#fff}.button.small{min-height:34px;padding:0 11px}.eyebrow{font-size:9px;font-weight:800;letter-spacing:.16em;text-transform:uppercase;color:#8b8b8b}.metric-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(175px,1fr));gap:14px;margin-bottom:22px}.metric-card{background:#fff;border:1px solid #e6e2d9;border-radius:var(--radius);padding:19px;position:relative;overflow:hidden}.metric-card .metric-icon{position:absolute;right:15px;top:15px;width:34px;height:34px;background:var(--deep);border-radius:9px;display:grid;place-items:center;font-size:16px}.metric-card small{color:#888;font-size:10px;font-weight:700}.metric-card strong{display:block;font-size:26px;margin-top:14px}.metric-card em{display:block;font-style:normal;color:var(--green);font-size:9px;margin-top:4px}.dashboard-grid{display:grid;grid-template-columns:1.3fr .7fr;gap:18px}.panel{background:#fff;border:1px solid #e6e2d9;border-radius:var(--radius);padding:21px}.panel-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:18px}.panel-head h2{font-size:15px;margin:0}.panel-head a{font-size:10px;color:var(--ink);font-weight:800}.hero-panel{background:var(--ink);color:#fff;min-height:280px;display:grid;grid-template-columns:1.1fr .9fr;overflow:hidden;padding:0}.hero-copy{padding:34px;display:flex;flex-direction:column;justify-content:center}.hero-copy h2{font-size:29px;line-height:1.05;margin:8px 0 12px}.hero-copy p{color:#aaa;line-height:1.65;max-width:500px}.hero-visual{background:var(--yellow);display:grid;place-items:center;min-height:280px}.hero-visual svg{width:90%;max-height:245px}.activity-list{display:flex;flex-direction:column}.activity{display:grid;grid-template-columns:34px 1fr auto;gap:11px;align-items:center;padding:13px 0;border-top:1px solid #eee}.activity:first-child{border-top:0;padding-top:0}.activity-icon{width:34px;height:34px;border-radius:9px;background:var(--deep);display:grid;place-items:center}.activity strong,.activity small{display:block}.activity strong{font-size:11px}.activity small{font-size:9px;color:#888;margin-top:3px}.activity time{font-size:9px;color:#aaa}.quick-actions{display:grid;grid-template-columns:repeat(2,1fr);gap:10px}.quick-action{border:1px solid var(--line);background:var(--cream);border-radius:10px;padding:15px;text-align:left;font:700 11px Manrope;cursor:pointer}.quick-action span{display:block;font-size:18px;margin-bottom:12px}.toolbar{display:flex;align-items:center;gap:9px;margin-bottom:18px;flex-wrap:wrap}.field-control{border:1px solid var(--line);background:#fff;border-radius:8px;height:40px;padding:0 11px;font:600 11px Manrope;outline:0}.field-control:focus{border-color:#777}.toolbar .search-control{flex:1;min-width:210px}.view-switch{display:flex;border:1px solid var(--line);border-radius:8px;overflow:hidden;margin-left:auto}.view-switch button{height:38px;width:40px;border:0;background:#fff;cursor:pointer}.view-switch button.active{background:#111;color:#fff}.product-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:15px}.product-card{background:#fff;border:1px solid #e6e2d9;border-radius:12px;overflow:hidden;cursor:pointer;transition:.18s}.product-card:hover{transform:translateY(-3px);box-shadow:var(--shadow)}.product-art{height:185px;background:var(--deep);display:grid;place-items:center;position:relative;overflow:hidden;isolation:isolate}.product-art svg{width:76%;height:76%}.status-pill,.category-pill{display:inline-flex;align-items:center;height:23px;border-radius:99px;padding:0 8px;font-size:8px;font-weight:800;text-transform:uppercase;letter-spacing:.05em}.status-pill{position:absolute;top:12px;right:12px;background:#fff;color:var(--green);z-index:3}.category-pill{background:#f0ede4;color:#555}.product-info{padding:15px;position:relative;z-index:1;background:#fff}.product-info h3{font-size:14px;margin:9px 0 3px}.product-info .sku{font-size:9px;color:#999}.product-meta{display:flex;justify-content:space-between;border-top:1px solid #eee;margin-top:13px;padding-top:11px;color:#777;font-size:9px}.data-table-wrap{background:#fff;border:1px solid #e6e2d9;border-radius:12px;overflow:auto}.data-table{border-collapse:collapse;width:100%;min-width:780px}.data-table th{text-align:left;background:var(--deep);font-size:8px;letter-spacing:.1em;text-transform:uppercase;padding:12px;color:#777}.data-table td{border-top:1px solid #eee;padding:13px 12px;font-size:10px}.data-table tbody tr{cursor:pointer}.data-table tbody tr:hover{background:#fffcf4}.product-cell{display:flex;align-items:center;gap:10px}.mini-art{width:42px;height:42px;border-radius:7px;background:var(--deep);display:grid;place-items:center;position:relative;overflow:hidden;flex:0 0 42px}.mini-art svg{width:35px;height:35px}.empty{grid-column:1/-1;padding:60px 20px;text-align:center;background:#fff;border:1px dashed var(--line);border-radius:12px}.empty strong{display:block;font-size:18px;margin-bottom:7px}.empty p{color:#888}.record-drawer{position:fixed;z-index:42;right:0;top:0;width:min(470px,92vw);height:100vh;background:#fff;box-shadow:-25px 0 70px rgba(0,0,0,.18);transform:translateX(105%);transition:.25s;overflow:auto}.record-drawer.open{transform:none}.drawer-backdrop{position:fixed;inset:0;background:rgba(17,17,17,.48);z-index:41}.drawer-head{background:var(--ink);color:#fff;padding:24px;display:flex;justify-content:space-between;align-items:flex-start}.drawer-head h2{margin:6px 0 0;font-size:20px}.close-button{border:0;background:#2a2a2a;color:#fff;border-radius:50%;width:34px;height:34px;cursor:pointer}.drawer-art{height:210px;background:var(--yellow);display:grid;place-items:center;position:relative;overflow:hidden}.drawer-art svg{height:85%;width:75%}.drawer-body{padding:24px;position:relative;background:#fff}.detail-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:16px;margin:20px 0}.detail-item small,.detail-item strong{display:block}.detail-item small{font-size:8px;color:#999;text-transform:uppercase;letter-spacing:.1em}.detail-item strong{font-size:11px;margin-top:5px}.note-list{padding:0;list-style:none}.note-list li{font-size:10px;border-left:3px solid var(--yellow);padding:9px 12px;background:var(--deep);margin:7px 0}.note-entry{display:flex;gap:7px}.note-entry input{flex:1}.drawer-actions{display:flex;gap:8px;margin-top:20px}.bom-layout{display:grid;grid-template-columns:minmax(0,1fr) 310px;gap:18px;align-items:start}.bom-main{min-width:0}.bom-summary{display:grid;grid-template-columns:1.3fr repeat(3,1fr);gap:12px;margin-bottom:17px}.product-summary{background:var(--ink);color:#fff;border-radius:12px;padding:17px}.product-summary small,.product-summary strong{display:block}.product-summary small{color:#999;font-size:8px}.product-summary strong{font-size:14px;margin:5px 0}.product-summary span{color:var(--yellow);font-size:9px}.mini-metric{background:#fff;border:1px solid #e6e2d9;border-radius:12px;padding:15px}.mini-metric small{font-size:8px;color:#888}.mini-metric strong{display:block;font-size:17px;margin-top:8px}.bom-section{background:#fff;border:1px solid #e6e2d9;border-radius:12px;margin-bottom:14px;overflow:hidden}.bom-section-head{padding:15px 17px;border-bottom:1px solid #eee;display:flex;align-items:center;justify-content:space-between}.bom-section-head h2{margin:0;font-size:13px}.bom-table{width:100%;border-collapse:collapse;min-width:900px}.bom-table th{font-size:7px;letter-spacing:.08em;text-transform:uppercase;text-align:left;padding:9px;background:var(--deep);color:#777}.bom-table td{border-top:1px solid #eee;padding:7px}.bom-table input,.bom-table select{width:100%;min-width:68px;height:32px;border:1px solid #ddd;border-radius:6px;padding:0 7px;font:600 9px Manrope;background:#fff}.bom-table td.calc{font-size:9px;font-weight:700;white-space:nowrap}.bom-table td.amount{font-weight:800}.remove-line{border:0;background:transparent;color:#b55;font-size:17px;cursor:pointer}.cost-card{background:var(--ink);color:#fff;border-radius:12px;padding:20px;position:sticky;top:94px}.cost-card h2{font-size:15px;margin:0 0 17px}.cost-line{display:flex;justify-content:space-between;padding:10px 0;border-bottom:1px solid #303030;font-size:10px}.cost-line small{color:#aaa}.cost-total{display:flex;justify-content:space-between;align-items:flex-end;padding:19px 0}.cost-total span{font-size:10px;color:#aaa}.cost-total strong{display:block;font-size:27px;color:var(--yellow);margin-top:3px}.cost-card .button{width:100%;margin-top:8px}.cost-breakdown{margin-top:16px}.bar-row{display:grid;grid-template-columns:70px 1fr 38px;gap:7px;align-items:center;margin-top:8px;font-size:8px;color:#aaa}.bar{height:5px;background:#333;border-radius:10px;overflow:hidden}.bar i{display:block;height:100%;background:var(--yellow)}dialog{border:0;border-radius:15px;padding:0;width:min(650px,92vw);max-height:90vh;box-shadow:var(--shadow);overflow:auto}dialog::backdrop{background:rgba(17,17,17,.62)}.dialog-head{padding:21px 23px;background:var(--ink);color:#fff;display:flex;justify-content:space-between;align-items:center}.dialog-head h2{font-size:16px;margin:0}.dialog-body{padding:23px}.form-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:14px}.field{display:flex;flex-direction:column;gap:6px}.field.full{grid-column:1/-1}.field label{font-size:8px;font-weight:800;letter-spacing:.09em;text-transform:uppercase;color:#777}.field input,.field select,.field textarea{border:1px solid var(--line);border-radius:8px;min-height:40px;padding:9px 11px;font:500 11px Manrope}.field textarea{min-height:76px;resize:vertical}.form-hint{font-size:9px;color:#888;background:var(--deep);border-radius:8px;padding:10px}.dialog-actions{display:flex;justify-content:flex-end;gap:8px;padding:0 23px 23px}.master-list{display:flex;flex-direction:column;gap:8px}.master-row{display:grid;grid-template-columns:1fr 100px 80px;gap:8px;align-items:center}.master-row input{height:35px;border:1px solid #ddd;border-radius:7px;padding:0 8px;font:600 10px Manrope}.master-row small{font-size:8px;color:#777}.toast{position:fixed;z-index:80;right:25px;bottom:25px;background:#111;color:#fff;border-left:4px solid var(--yellow);border-radius:8px;padding:13px 18px;font-size:10px;font-weight:700;box-shadow:var(--shadow);opacity:0;transform:translateY(20px);pointer-events:none;transition:.2s}.toast.show{opacity:1;transform:none}.mobile-nav{display:none}
.product-art>img,.drawer-art>img{position:absolute;inset:0;width:100%;height:100%;max-width:100%;max-height:100%;object-fit:cover;object-position:center;display:block}.mini-art>img{position:absolute;inset:0;width:100%;height:100%;max-width:100%;max-height:100%;object-fit:cover;object-position:center;display:block}.product-fallback{width:100%;height:100%;display:grid;place-items:center}.product-art>.product-fallback svg{width:76%;height:76%}.drawer-art>.product-fallback svg{height:85%;width:75%}.mini-art>.product-fallback svg{width:35px;height:35px}.product-art>img[hidden],.drawer-art>img[hidden],.mini-art>img[hidden],.product-fallback[hidden]{display:none}.form-error{border:1px solid #e6a7a0;background:#fff1ef;color:#8f2018;border-radius:8px;padding:11px 12px;font-size:11px;font-weight:700}.field input.invalid{border-color:var(--red);box-shadow:0 0 0 2px rgba(186,61,50,.1)}.button:disabled{opacity:.6;cursor:wait;transform:none}
@media(max-width:1100px){.metric-grid{grid-template-columns:repeat(2,1fr)}.product-grid{grid-template-columns:repeat(2,1fr)}.dashboard-grid{grid-template-columns:1fr}.bom-layout{grid-template-columns:1fr}.cost-card{position:static}.bom-summary{grid-template-columns:repeat(3,1fr)}.product-summary{grid-column:1/-1}}
@media(max-width:760px){body{padding-bottom:67px}.app-shell{display:block}.sidebar{display:none}main{display:block}.topbar{height:64px;padding:0 15px}.mobile-brand{display:grid;width:34px;height:34px}.top-title{min-width:0}.top-title strong{display:none}.top-title span{font-size:14px}.global-search{display:none}.content{padding:18px 14px}.page-head{align-items:flex-start;flex-direction:column;margin-bottom:18px}.page-head h1{font-size:23px}.actions{width:100%}.actions .button{flex:1}.metric-grid{grid-template-columns:repeat(2,1fr);gap:9px}.metric-card{padding:14px}.metric-card strong{font-size:20px}.metric-card .metric-icon{display:none}.hero-panel{grid-template-columns:1fr}.hero-copy{padding:26px}.hero-copy h2{font-size:24px}.hero-visual{min-height:180px}.product-grid{grid-template-columns:1fr}.toolbar .view-switch{display:none}.field-control{max-width:100%}.bom-summary{grid-template-columns:1fr 1fr}.product-summary{grid-column:1/-1}.bom-layout{display:block}.form-grid{grid-template-columns:1fr}.field.full{grid-column:auto}.mobile-nav{position:fixed;display:grid;grid-template-columns:repeat(3,1fr);inset:auto 0 0;background:#111;height:66px;z-index:30;border-top:1px solid #333}.mobile-nav a{color:#888;text-decoration:none;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;font-size:9px;font-weight:700}.mobile-nav a span{font-size:18px}.mobile-nav a.active{color:var(--yellow)}.toast{bottom:80px;left:14px;right:14px}.master-row{grid-template-columns:1fr 76px 65px}}
@media print{.sidebar,.topbar,.mobile-nav,.page-head,.toolbar,.bom-section-head .button,.cost-card .button{display:none!important}.app-shell{display:block}.content{padding:0}.page[hidden]{display:none}.bom-layout{grid-template-columns:1fr}.cost-card{position:static;background:#fff;color:#111;border:2px solid #111}.cost-total strong{color:#111}.bom-section{break-inside:avoid}}
.skip-link{position:fixed;left:12px;top:10px;z-index:1000;padding:10px 14px;border-radius:8px;background:var(--yellow);color:var(--ink);font-weight:800;text-decoration:none;transform:translateY(-150%)}.skip-link:focus{transform:none}:where(a,button,input,select,textarea,summary):focus-visible{outline:3px solid var(--yellow);outline-offset:2px}.record-drawer[aria-hidden="true"]{visibility:hidden}.record-drawer[aria-hidden="false"]{visibility:visible}
@media(prefers-reduced-motion:reduce){html{scroll-behavior:auto}*,*::before,*::after{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important;scroll-behavior:auto!important}}
@media(max-width:760px){dialog{width:calc(100vw - 20px);max-height:calc(100vh - 24px)}.drawer-actions{flex-wrap:wrap}.drawer-actions .button{flex:1}.dialog-actions{position:sticky;bottom:0;background:#fff;padding-top:12px}.icon-button,.close-button,.mobile-nav a{min-width:44px;min-height:44px}}

/* Phase 1 interface refresh */
:root{--ink:#101827;--panel:#14213d;--blue:#255ec7;--blue-dark:#163b65;--blue-soft:#eaf1ff;--teal:#0f766e;--cream:#fbf8f0;--deep:#f1eee6;--copy:#50596a;--line:#d6d8df;--green:#08745b;--sidebar:248px;--sidebar-collapsed:76px}
body{font-size:15px;background:linear-gradient(135deg,#fbf8f0 0%,#f7f9ff 100%);line-height:1.45}
.app-shell{grid-template-columns:var(--sidebar) minmax(0,1fr);transition:grid-template-columns .24s ease}
.sidebar{background:linear-gradient(180deg,var(--blue-dark),#101827 72%);transition:width .24s ease;overflow:visible}
main{transition:margin .24s ease;width:100%}
.sidebar-toggle{position:absolute;z-index:2;top:86px;right:-15px;width:30px;height:30px;border:2px solid #fff;border-radius:50%;background:var(--blue);color:#fff;display:grid;place-items:center;font:800 22px/1 Manrope;box-shadow:0 7px 18px rgba(16,24,39,.22);cursor:pointer}
.sidebar-toggle:hover{background:var(--yellow);color:#111}
.brand-mark,.mobile-brand,.operator-avatar{box-shadow:0 0 0 3px rgba(255,176,0,.14)}
.side-nav a,.side-nav button{font-size:13px;color:#d8e2f3}.side-nav a:hover,.side-nav button:hover{background:rgba(255,255,255,.09)}
.side-nav a.active{background:var(--blue);box-shadow:inset 3px 0 var(--yellow),0 8px 22px rgba(0,0,0,.18)}
.side-nav p{font-size:10px;color:#94a8c4}.sidebar-foot small,.brand small{color:#b6c3d6}
.topbar{box-shadow:0 1px 0 rgba(16,24,39,.04)}.content{max-width:none;width:100%;padding:30px clamp(22px,2.2vw,38px)}
.eyebrow,.top-title strong{font-size:10px;color:var(--blue);font-weight:800}.page-head p{font-size:14px;line-height:1.6}
.button,.field-control,.global-search input{font-size:12px}.button:not(.yellow):not(.danger).ghost:hover{border-color:var(--blue);color:var(--blue)}.button.yellow{box-shadow:0 7px 16px rgba(255,176,0,.16)}
.metric-card,.panel,.cma-toolbar-card,.ems-pipeline-toolbar{box-shadow:0 8px 26px rgba(20,33,61,.045)}
.metric-card .metric-icon,.activity-icon{background:var(--blue-soft);color:var(--blue)}
.hero-panel,.product-summary,.cost-card,.dialog-head,.ems-customer-toolbar{background:linear-gradient(145deg,var(--blue-dark),#101827)}.hero-visual{background:linear-gradient(145deg,var(--yellow),#ffd367)}
.quick-action:hover{border-color:var(--blue);background:var(--blue-soft);color:var(--blue)}
.status-pill,.category-pill,.cma-chip{font-size:10px}.product-info .sku,.product-meta,.activity small,.activity time,.metric-card small,.metric-card em{font-size:10px}
.data-table-wrap{width:100%;max-width:100%;overflow:auto;overscroll-behavior-inline:contain;scrollbar-gutter:stable;border-color:#dfe2e8}
.data-table-wrap::-webkit-scrollbar,.cma-table-wrap::-webkit-scrollbar,.ems-kanban::-webkit-scrollbar,.oms-kanban::-webkit-scrollbar{height:12px;width:12px}
.data-table-wrap::-webkit-scrollbar-track,.cma-table-wrap::-webkit-scrollbar-track,.ems-kanban::-webkit-scrollbar-track,.oms-kanban::-webkit-scrollbar-track{background:#e7eaf0;border-radius:99px}
.data-table-wrap::-webkit-scrollbar-thumb,.cma-table-wrap::-webkit-scrollbar-thumb,.ems-kanban::-webkit-scrollbar-thumb,.oms-kanban::-webkit-scrollbar-thumb{background:var(--blue);border:3px solid #e7eaf0;border-radius:99px}
.data-table th,.bom-table th{font-size:10px;line-height:1.35;padding:12px 10px;color:#586174;background:#f0f3f9}.data-table td{font-size:12px;line-height:1.4;padding:13px 11px}
.bom-table td{font-size:11px}.bom-table input,.bom-table select{font-size:11px;min-width:84px}.field label,.detail-item small{font-size:10px}.field input,.field select,.field textarea{font-size:12px}.note-list li,.detail-item strong,.panel-head a{font-size:11px}
.cma-tab.active,.ems-tab.active,.oms-tab.active,.view-switch button.active,.ems-view-switch button.active,.oms-view-switch button.active{background:var(--blue-dark);border-color:var(--blue-dark)}
.cma-tab.active span,.ems-tab.active>span{background:var(--yellow)}.cma-counter,.cma-table-note,.ems-result-count{font-size:10px}
body.sidebar-collapsed{--sidebar:var(--sidebar-collapsed)}
body.sidebar-collapsed .sidebar{padding-left:10px;padding-right:10px}
body.sidebar-collapsed .brand{padding-left:9px;padding-right:9px;justify-content:center}
body.sidebar-collapsed .brand>span:last-child,body.sidebar-collapsed .side-nav a>span:last-child,body.sidebar-collapsed .side-nav p,body.sidebar-collapsed .sidebar-foot>div:last-child{display:none}
body.sidebar-collapsed .side-nav a{justify-content:center;padding:0}body.sidebar-collapsed .nav-icon{width:auto}body.sidebar-collapsed .sidebar-foot{justify-content:center;padding-left:0;padding-right:0}
@media(max-width:760px){body{font-size:14px}.sidebar-toggle{display:none}.content{padding:18px 14px}.page-head p{font-size:13px}.data-table td{font-size:11px}.data-table th{font-size:9px}}
#cmaPage small,#emsPage small,#omsPage small{font-size:10px}
#cmaPage button,#cmaPage input,#cmaPage select,#emsPage button,#emsPage input,#emsPage select,#omsPage button,#omsPage input,#omsPage select{font-size:11px}
#emsPage p,#omsPage p{font-size:11px;line-height:1.55}

/* Phase 2 dashboard and universal record-dialog refinements */
.metric-card>small{font-size:13px;color:#4b5565;font-weight:800}.metric-card strong{margin-top:18px}
.dashboard-grid{grid-template-columns:minmax(0,.95fr) minmax(420px,1.05fr)}
.hero-panel{grid-template-columns:minmax(0,1.08fr) minmax(245px,.92fr);min-height:305px}.hero-copy{padding:28px}.hero-copy h2{font-size:27px}
.hero-visual{min-height:305px;padding:24px 20px;align-items:center;justify-items:stretch}
.workflow-steps{width:100%;display:grid;gap:12px}.workflow-step{display:grid;grid-template-columns:42px 1fr;gap:11px;align-items:center;color:#111}.workflow-step>span{width:42px;height:42px;border:2px solid #101827;background:#fff;border-radius:50%;display:grid;place-items:center;font-size:11px;font-weight:900}.workflow-step strong,.workflow-step small{display:block}.workflow-step strong{font-size:12px;text-transform:uppercase}.workflow-step small{font-size:9px;line-height:1.35;margin-top:2px}
.panel-head h2{font-size:17px}.quick-action{padding:13px}.activity{padding:11px 0}

.record-drawer{left:50%;right:auto;top:50%;width:min(780px,calc(100vw - 40px));height:auto;max-height:88vh;border-radius:16px;box-shadow:0 30px 90px rgba(8,18,38,.28);transform:translate(-50%,-46%) scale(.97);opacity:0;overflow:auto;transition:transform .2s ease,opacity .2s ease}
.record-drawer.open{transform:translate(-50%,-50%) scale(1);opacity:1}.drawer-head{position:sticky;top:0;z-index:4}.drawer-art{height:240px}.drawer-body{padding:26px 30px}.record-drawer .detail-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
.drawer-backdrop{backdrop-filter:blur(3px)}

dialog:has(#rateForm){width:min(920px,95vw)}.rate-master-body{position:relative}.rate-wood-grid{margin-bottom:18px}.rate-type-filter{max-width:320px;margin-bottom:18px}.master-list{gap:0;border:1px solid #e1e4eb;border-radius:10px;overflow:hidden}.master-row{grid-template-columns:130px minmax(220px,1fr) 130px 90px;gap:12px;min-height:56px;padding:8px 12px;border-top:1px solid #e8eaf0}.master-row:first-child{border-top:0}.master-row-head{min-height:42px;background:#f0f3f9;color:#586174}.master-row-head strong{font-size:10px;text-transform:uppercase;letter-spacing:.08em}.master-row input{height:38px;font-size:13px;text-align:center}.master-type{font-size:12px;font-weight:800;color:var(--blue-dark)}.master-name strong,.master-name small{display:block}.master-name strong{font-size:13px}.master-name small{font-size:10px;color:#747d8b;margin-top:2px}.rate-history-button{border:0;background:var(--blue-soft);color:var(--blue-dark);border-radius:7px;height:34px;font:800 10px Manrope;cursor:pointer}.rate-history-panel{position:absolute;z-index:8;inset:0 0 0 auto;width:min(390px,92%);background:#fff;box-shadow:-22px 0 50px rgba(16,24,39,.18);overflow:auto}.rate-history-panel[hidden]{display:none}.rate-history-head{position:sticky;top:0;background:var(--blue-dark);color:#fff;padding:20px;display:flex;justify-content:space-between;align-items:flex-start}.rate-history-head h3{margin:5px 0 2px}.rate-history-head small{color:#c8d3e4}.rate-history-list{padding:16px}.rate-history-list article{display:grid;grid-template-columns:1fr auto;gap:3px 12px;border-bottom:1px solid #e6e8ed;padding:12px 2px}.rate-history-list time,.rate-history-list small{font-size:10px;color:#747d8b}.rate-history-list strong{font-size:14px}.rate-history-list small{grid-column:1/-1}

.bom-table th:not(:first-child),.bom-table td:not(:first-child){text-align:center}.bom-table input[type="number"]{text-align:center}.bom-table select{text-align-last:center}

@media(max-width:1100px){.dashboard-grid{grid-template-columns:1fr}.record-drawer .detail-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:760px){.hero-panel{grid-template-columns:1fr}.workflow-steps{padding:2px 4px}.workflow-step{grid-template-columns:38px 1fr}.workflow-step>span{width:38px;height:38px}.record-drawer{width:calc(100vw - 20px);max-height:calc(100vh - 28px)}.record-drawer .detail-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.drawer-body{padding:20px}.master-row{grid-template-columns:92px 1fr 82px}.master-row-head strong:last-child,.master-row .rate-history-button{grid-column:3}.master-row-head{display:none}.master-row .master-type{grid-row:1 / span 2}.master-row .master-name{min-width:0}.rate-history-button{height:32px}}

/* Compact website preview mode */
html.embed-mode body{padding-bottom:64px;background:var(--cream)}
html.embed-mode .app-shell{display:block}
html.embed-mode .sidebar{display:none}
html.embed-mode main{display:block;width:100%}
html.embed-mode .topbar{height:64px;padding:0 15px}
html.embed-mode .mobile-brand{display:grid;width:36px;height:36px;cursor:default}
html.embed-mode .top-title{min-width:0}
html.embed-mode .top-title strong{display:none}
html.embed-mode .top-title span{font-size:15px;font-weight:800}
html.embed-mode .global-search{display:none}
html.embed-mode .content{width:100%;max-width:none;padding:20px clamp(14px,2.8vw,28px)}
html.embed-mode .mobile-nav{position:fixed;display:grid;grid-template-columns:repeat(6,minmax(0,1fr));inset:auto 0 0;background:#111;height:64px;z-index:30;border-top:1px solid #333}
html.embed-mode .mobile-nav a{min-width:0;color:#888;text-decoration:none;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;font-size:9px;font-weight:700}
html.embed-mode .mobile-nav a span{font-size:17px}
html.embed-mode .mobile-nav a.active{color:var(--yellow)}
html.embed-mode .page-head{margin-bottom:18px}
html.embed-mode .toast{bottom:76px}
@media(max-width:520px){html.embed-mode .content{padding:16px 12px}html.embed-mode .mobile-nav a{font-size:8px}html.embed-mode .mobile-nav a span{font-size:15px}}
