.display-theme-control{display:inline-flex;flex:none;align-items:center}
.display-theme-control .display-theme-trigger{display:grid;place-items:center;width:36px;height:36px;min-width:36px;padding:8px;margin:0;border:1px solid transparent;border-radius:50%;background:transparent;color:#515b6c;box-shadow:none;cursor:pointer;transition:background .15s,color .15s}
.display-theme-control .display-theme-trigger:hover,.display-theme-control .display-theme-trigger[aria-expanded="true"]{background:rgba(30,55,85,.07);color:#1d2736;transform:none;filter:none}
.display-theme-trigger svg{width:20px;height:20px}
.display-theme-login{position:fixed;top:22px;right:26px;z-index:20}
.display-theme-menu{position:fixed;z-index:1000;width:176px;max-width:calc(100vw - 16px);max-height:calc(100vh - 16px);overflow-y:auto;box-sizing:border-box;padding:5px;border:1px solid rgba(40,55,75,.12);border-radius:14px;background:rgba(255,255,255,.97);box-shadow:0 12px 36px rgba(20,35,55,.16);backdrop-filter:blur(20px);color:#283344}
.display-theme-menu[hidden]{display:none!important}
.display-theme-menu .display-theme-option{display:flex;align-items:center;gap:10px;width:100%;min-height:38px;padding:9px 10px;margin:0;border:0;border-radius:9px;background:transparent;color:inherit;box-shadow:none;text-align:left;font:500 12px/1.4 -apple-system,BlinkMacSystemFont,"Microsoft YaHei UI",sans-serif;cursor:pointer;transition:background .12s}
.display-theme-option svg{width:17px;height:17px;flex:none}
.display-theme-option span{flex:1}
.display-theme-option .display-theme-check{width:14px;height:14px;visibility:hidden}
.display-theme-option[aria-checked="true"] .display-theme-check{visibility:visible}
.display-theme-menu .display-theme-option:hover,.display-theme-menu .display-theme-option:focus-visible{background:#eef3fa;outline:none;transform:none;filter:none}
.display-theme-menu .display-theme-option[aria-checked="true"]{color:#006bd6}
.display-theme-control .display-theme-trigger:focus-visible{outline:2px solid #007aff;outline-offset:2px}
@media(max-width:900px){.top-actions{flex-wrap:wrap;justify-content:flex-end;gap:5px}.display-theme-login{top:10px;right:10px}}
@media print{.display-theme-control,.display-theme-menu{display:none!important}:root{color-scheme:light}}
/* Shared palette. Screen-only variables keep printed output in its original light colors. */
@media screen {
  :root[data-theme="dark"] {
    color-scheme:dark;
    --primary:#2384e8;
    --primary2:#1875d5;
    --theme-blue-1000:rgba(134,190,255,1);
    --theme-blue-border-100:rgba(57,98,147,0.1);
    --theme-blue-border-1000:rgba(57,98,147,1);
    --theme-blue-border-120:rgba(57,98,147,0.12);
    --theme-blue-border-130:rgba(57,98,147,0.13);
    --theme-blue-border-140:rgba(57,98,147,0.14);
    --theme-blue-border-180:rgba(57,98,147,0.18);
    --theme-blue-border-200:rgba(57,98,147,0.2);
    --theme-blue-border-220:rgba(57,98,147,0.22);
    --theme-blue-border-240:rgba(57,98,147,0.24);
    --theme-blue-border-250:rgba(57,98,147,0.25);
    --theme-blue-border-280:rgba(57,98,147,0.28);
    --theme-blue-border-340:rgba(57,98,147,0.34);
    --theme-blue-border-420:rgba(57,98,147,0.42);
    --theme-blue-border-500:rgba(57,98,147,0.5);
    --theme-blue-border-660:rgba(57,98,147,0.66);
    --theme-blue-border-680:rgba(57,98,147,0.68);
    --theme-blue-border-80:rgba(57,98,147,0.08);
    --theme-blue-surface-1000:rgba(26,43,65,1);
    --theme-blue-surface-140:rgba(26,43,65,0.14);
    --theme-blue-surface-290:rgba(26,43,65,0.29);
    --theme-blue-surface-340:rgba(26,43,65,0.34);
    --theme-blue-surface-360:rgba(26,43,65,0.36);
    --theme-blue-surface-420:rgba(26,43,65,0.42);
    --theme-blue-surface-440:rgba(26,43,65,0.44);
    --theme-blue-surface-460:rgba(26,43,65,0.46);
    --theme-blue-surface-520:rgba(26,43,65,0.52);
    --theme-blue-surface-640:rgba(26,43,65,0.64);
    --theme-blue-surface-680:rgba(26,43,65,0.68);
    --theme-blue-surface-700:rgba(26,43,65,0.7);
    --theme-blue-surface-720:rgba(26,43,65,0.72);
    --theme-blue-surface-740:rgba(26,43,65,0.74);
    --theme-blue-surface-840:rgba(26,43,65,0.84);
    --theme-blue-surface-920:rgba(26,43,65,0.92);
    --theme-border-100:rgba(80,93,112,0.1);
    --theme-border-1000:rgba(80,93,112,1);
    --theme-border-110:rgba(80,93,112,0.11);
    --theme-border-120:rgba(80,93,112,0.12);
    --theme-border-130:rgba(80,93,112,0.13);
    --theme-border-140:rgba(80,93,112,0.14);
    --theme-border-160:rgba(80,93,112,0.16);
    --theme-border-180:rgba(80,93,112,0.18);
    --theme-border-200:rgba(80,93,112,0.2);
    --theme-border-220:rgba(80,93,112,0.22);
    --theme-border-240:rgba(80,93,112,0.24);
    --theme-border-280:rgba(80,93,112,0.28);
    --theme-border-360:rgba(80,93,112,0.36);
    --theme-border-380:rgba(80,93,112,0.38);
    --theme-border-480:rgba(80,93,112,0.48);
    --theme-border-520:rgba(80,93,112,0.52);
    --theme-border-550:rgba(80,93,112,0.55);
    --theme-border-580:rgba(80,93,112,0.58);
    --theme-border-660:rgba(80,93,112,0.66);
    --theme-border-680:rgba(80,93,112,0.68);
    --theme-border-70:rgba(80,93,112,0.07);
    --theme-border-700:rgba(80,93,112,0.7);
    --theme-border-720:rgba(80,93,112,0.72);
    --theme-border-740:rgba(80,93,112,0.74);
    --theme-border-75:rgba(80,93,112,0.075);
    --theme-border-760:rgba(80,93,112,0.76);
    --theme-border-780:rgba(80,93,112,0.78);
    --theme-border-80:rgba(80,93,112,0.08);
    --theme-border-800:rgba(80,93,112,0.8);
    --theme-border-820:rgba(80,93,112,0.82);
    --theme-border-840:rgba(80,93,112,0.84);
    --theme-border-860:rgba(80,93,112,0.86);
    --theme-border-880:rgba(80,93,112,0.88);
    --theme-border-90:rgba(80,93,112,0.09);
    --theme-border-900:rgba(80,93,112,0.9);
    --theme-border-950:rgba(80,93,112,0.95);
    --theme-elevated-1000:rgba(35,43,55,1);
    --theme-elevated-660:rgba(35,43,55,0.66);
    --theme-green-1000:rgba(105,220,157,1);
    --theme-green-border-1000:rgba(58,117,83,1);
    --theme-green-border-200:rgba(58,117,83,0.2);
    --theme-green-border-240:rgba(58,117,83,0.24);
    --theme-green-border-320:rgba(58,117,83,0.32);
    --theme-green-surface-280:rgba(25,48,39,0.28);
    --theme-green-surface-450:rgba(25,48,39,0.45);
    --theme-highlight-100:rgba(48,59,75,0.1);
    --theme-highlight-1000:rgba(48,59,75,1);
    --theme-highlight-120:rgba(48,59,75,0.12);
    --theme-highlight-160:rgba(48,59,75,0.16);
    --theme-highlight-240:rgba(48,59,75,0.24);
    --theme-highlight-250:rgba(48,59,75,0.25);
    --theme-highlight-480:rgba(48,59,75,0.48);
    --theme-highlight-650:rgba(48,59,75,0.65);
    --theme-highlight-720:rgba(48,59,75,0.72);
    --theme-highlight-780:rgba(48,59,75,0.78);
    --theme-highlight-800:rgba(48,59,75,0.8);
    --theme-highlight-820:rgba(48,59,75,0.82);
    --theme-highlight-850:rgba(48,59,75,0.85);
    --theme-highlight-860:rgba(48,59,75,0.86);
    --theme-highlight-880:rgba(48,59,75,0.88);
    --theme-highlight-900:rgba(48,59,75,0.9);
    --theme-highlight-940:rgba(48,59,75,0.94);
    --theme-highlight-950:rgba(48,59,75,0.95);
    --theme-highlight-960:rgba(48,59,75,0.96);
    --theme-ink-1000:rgba(235,239,246,1);
    --theme-muted-100:rgba(172,183,199,0.1);
    --theme-muted-1000:rgba(172,183,199,1);
    --theme-orange-1000:rgba(255,200,112,1);
    --theme-orange-border-1000:rgba(125,98,53,1);
    --theme-orange-border-120:rgba(125,98,53,0.12);
    --theme-orange-border-160:rgba(125,98,53,0.16);
    --theme-orange-border-200:rgba(125,98,53,0.2);
    --theme-orange-border-220:rgba(125,98,53,0.22);
    --theme-orange-border-280:rgba(125,98,53,0.28);
    --theme-orange-border-350:rgba(125,98,53,0.35);
    --theme-orange-border-620:rgba(125,98,53,0.62);
    --theme-orange-surface-660:rgba(56,44,27,0.66);
    --theme-purple-surface-280:rgba(44,35,61,0.28);
    --theme-purple-surface-300:rgba(44,35,61,0.3);
    --theme-purple-surface-80:rgba(44,35,61,0.08);
    --theme-red-1000:rgba(255,137,144,1);
    --theme-red-border-1000:rgba(131,68,79,1);
    --theme-red-border-140:rgba(131,68,79,0.14);
    --theme-red-border-180:rgba(131,68,79,0.18);
    --theme-red-border-200:rgba(131,68,79,0.2);
    --theme-red-surface-1000:rgba(62,32,39,1);
    --theme-surface-100:rgba(27,33,43,0.1);
    --theme-surface-1000:rgba(27,33,43,1);
    --theme-surface-120:rgba(27,33,43,0.12);
    --theme-surface-250:rgba(27,33,43,0.25);
    --theme-surface-270:rgba(27,33,43,0.27);
    --theme-surface-300:rgba(27,33,43,0.3);
    --theme-surface-340:rgba(27,33,43,0.34);
    --theme-surface-350:rgba(27,33,43,0.35);
    --theme-surface-370:rgba(27,33,43,0.37);
    --theme-surface-380:rgba(27,33,43,0.38);
    --theme-surface-400:rgba(27,33,43,0.4);
    --theme-surface-440:rgba(27,33,43,0.44);
    --theme-surface-450:rgba(27,33,43,0.45);
    --theme-surface-460:rgba(27,33,43,0.46);
    --theme-surface-480:rgba(27,33,43,0.48);
    --theme-surface-500:rgba(27,33,43,0.5);
    --theme-surface-520:rgba(27,33,43,0.52);
    --theme-surface-530:rgba(27,33,43,0.53);
    --theme-surface-540:rgba(27,33,43,0.54);
    --theme-surface-550:rgba(27,33,43,0.55);
    --theme-surface-560:rgba(27,33,43,0.56);
    --theme-surface-580:rgba(27,33,43,0.58);
    --theme-surface-600:rgba(27,33,43,0.6);
    --theme-surface-620:rgba(27,33,43,0.62);
    --theme-surface-640:rgba(27,33,43,0.64);
    --theme-surface-660:rgba(27,33,43,0.66);
    --theme-surface-680:rgba(27,33,43,0.68);
    --theme-surface-70:rgba(27,33,43,0.07);
    --theme-surface-700:rgba(27,33,43,0.7);
    --theme-surface-720:rgba(27,33,43,0.72);
    --theme-surface-740:rgba(27,33,43,0.74);
    --theme-surface-760:rgba(27,33,43,0.76);
    --theme-surface-780:rgba(27,33,43,0.78);
    --theme-surface-800:rgba(27,33,43,0.8);
    --theme-surface-820:rgba(27,33,43,0.82);
    --theme-surface-840:rgba(27,33,43,0.84);
    --theme-surface-860:rgba(27,33,43,0.86);
    --theme-surface-880:rgba(27,33,43,0.88);
    --theme-surface-900:rgba(27,33,43,0.9);
    --theme-surface-920:rgba(27,33,43,0.92);
    --theme-surface-940:rgba(27,33,43,0.94);
    --theme-surface-960:rgba(27,33,43,0.96);
    --theme-surface-980:rgba(27,33,43,0.98);
  }
  :root[data-theme="dark"] .display-theme-trigger{color:#bdc9da}
  :root[data-theme="dark"] .display-theme-trigger:hover,:root[data-theme="dark"] .display-theme-trigger[aria-expanded="true"]{background:rgba(180,205,240,.1);color:#eef3fb}
  :root[data-theme="dark"] .display-theme-menu{border-color:#3f4c60;background:rgba(30,39,52,.98);color:#dce6f5;box-shadow:0 12px 40px rgba(0,0,0,.3)}
  :root[data-theme="dark"] .display-theme-option:hover,:root[data-theme="dark"] .display-theme-option:focus-visible{background:#2d3b50}
  :root[data-theme="dark"] .display-theme-option[aria-checked="true"]{color:#86beff}
  :root[data-theme="dark"] :is(input,textarea)::placeholder{color:#9caabd;opacity:1}
  :root[data-theme="dark"] :is(input,select,textarea){border-color:#526075}
  :root[data-theme="dark"] :is(input,select,textarea):disabled{color:#97a4b6;opacity:.65}
  :root[data-theme="dark"] :is(button,input,select,textarea):focus-visible{outline:2px solid #86beff;outline-offset:2px}
  :root[data-theme="dark"] :is(.topbar-logo,.brand-logo){filter:brightness(0) invert(1);opacity:.9}
  :root[data-theme="dark"] .modal-backdrop{background:rgba(3,7,13,.65)}
  :root[data-theme="dark"] .modal-card{background:#1d2531}
  :root[data-theme="dark"] select option{background:#232c3a;color:#eef3fb}
  :root[data-theme="dark"] .toast{background:#29384d;color:#fff}
  :root[data-theme="dark"] .toast.error{background:#a92132;color:#fff}

  /* Opaque, ordered surfaces keep workspace depth independent of glass stacking. */
  :root[data-theme="dark"] body{background:#0d1117;color:#edf1f7}
  :root[data-theme="dark"] :is(.topbar,body.workspace-mode .topbar){background:#171e28;border-bottom:1px solid #394453;box-shadow:0 4px 18px rgba(0,0,0,.2);backdrop-filter:none}
  :root[data-theme="dark"] .panel{background:#161d27;border-color:#384352;box-shadow:0 6px 20px rgba(0,0,0,.16);backdrop-filter:none}
  :root[data-theme="dark"] body.workspace-mode .tabs{background:#171e28;border-color:#364151;backdrop-filter:none}
  :root[data-theme="dark"] body.workspace-mode .tab{color:#b9c4d3}
  :root[data-theme="dark"] body.workspace-mode .tab:hover{background:#242e3c;color:#f3f6fb}
  :root[data-theme="dark"] body.workspace-mode .tab.active{background:#253c57;border-color:#46688e;color:#a6d2ff;box-shadow:inset 3px 0 #72b7ff}
  :root[data-theme="dark"] body.workspace-mode .tab-page{background:#111720;border-color:#303b4b;box-shadow:none}
  :root[data-theme="dark"] #dashboardTab:before{background:none}
  :root[data-theme="dark"] #dashboardTab:after{display:none}
  :root[data-theme="dark"] :is(.ops-card,.picker,.inline-card,.detail,.result-table-wrap,.sales-focus-surface,.sales-share-surface,.sales-panel){background:#1c2531;border-color:#404d5f;box-shadow:0 5px 16px rgba(0,0,0,.16);backdrop-filter:none}
  :root[data-theme="dark"] :is(.ops-card-head,.picker-head,.sales-panel-head){background:#25303e;border-color:#414f61}
  :root[data-theme="dark"] :is(.summary,.dashboard-stat,.stat,.inventory-risk-stat,.decision-brief-stat,.data-readiness-stat,.inventory-health-stat,.risk-task-stat){background:#263241;border-color:#49596d;box-shadow:inset 0 1px rgba(255,255,255,.035);backdrop-filter:none}
  :root[data-theme="dark"] :is(.operations-view-switch,.integration-view-switch,.finance-view-switch,.sales-dashboard-toolbar){background:#1c2531;border-color:#3e4c5e;box-shadow:none;backdrop-filter:none}
  :root[data-theme="dark"] :is(.operations-view-switch,.integration-view-switch,.finance-view-switch) button{color:#b8c5d6}
  :root[data-theme="dark"] :is(.operations-view-switch,.integration-view-switch,.finance-view-switch) button.active{background:#314760;color:#c0dfff;border-color:#5c7d9f;box-shadow:0 2px 6px rgba(0,0,0,.2)}
  :root[data-theme="dark"] th{background:#2b3747;color:#d1dbea;border-color:#4a596d;backdrop-filter:none}
  :root[data-theme="dark"] td{border-color:#3a4657}
  :root[data-theme="dark"] tbody tr:hover{background:#283b52}
  :root[data-theme="dark"] tbody tr.active{background:#2b4563}
  :root[data-theme="dark"] :is(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]),select,textarea){background:#101721;color:#edf2fa;border:1px solid #586a81;box-shadow:inset 0 1px 3px rgba(0,0,0,.18)}
  :root[data-theme="dark"] :is(input,select,textarea):hover{border-color:#758aa5}
  :root[data-theme="dark"] :is(input,select,textarea):focus{border-color:#83bfff}
  :root[data-theme="dark"] :is(input,select,textarea):disabled{background:#202a38;color:#aebccd;border-color:#435167;opacity:1}
  :root[data-theme="dark"] :is(button.secondary,.btn-secondary,button.ghost){background:#2c394a;color:#e3ebf6;border-color:#53647a;box-shadow:none}
  :root[data-theme="dark"] :is(button.secondary,.btn-secondary,button.ghost):hover{background:#3a4b61;border-color:#7a91ae}
  :root[data-theme="dark"] .modal-backdrop{background:rgba(3,7,12,.78);backdrop-filter:blur(5px)}
  :root[data-theme="dark"] .modal-card{background:#202a37;border:1px solid #63758d;box-shadow:0 24px 80px rgba(0,0,0,.6);backdrop-filter:none}
  :root[data-theme="dark"] :is(.modal-head,.modal-actions){background:#283545;border-color:#4b5d73;backdrop-filter:none}
  :root[data-theme="dark"] .login-card{background:#202b39;border:1px solid #4d6078;box-shadow:0 24px 70px rgba(0,0,0,.35);backdrop-filter:none}
  :root[data-theme="dark"] .login-brand{background:linear-gradient(140deg,#24384e,#172330);border-color:#445971;backdrop-filter:none}
  :root[data-theme="dark"] .display-theme-menu{background:#263343;border-color:#5a6e87;box-shadow:0 14px 40px rgba(0,0,0,.5);backdrop-filter:none}
  :root[data-theme="dark"] .display-theme-option[aria-checked="true"]{background:#334e6c;color:#bddeff}
  :root[data-theme="dark"] .display-theme-option:hover,:root[data-theme="dark"] .display-theme-option:focus-visible{background:#3a4d65}
  :root[data-theme="dark"] .uv-work-stat{background:#263241;border-color:#49596d;box-shadow:none}
  :root[data-theme="dark"] :is(.dashboard-stat,.uv-work-stat):is(.warning,.warn){background:#382e20;border-color:#8d7045}
  :root[data-theme="dark"] :is(.dashboard-stat,.uv-work-stat):is(.critical,.bad){background:#3c252c;border-color:#975663}
  :root[data-theme="dark"] :is(.dashboard-stat,.uv-work-stat).active{background:#203b32;border-color:#4c826d}
  :root[data-theme="dark"] .uv-work-stat.selected{border-color:#89c4ff;box-shadow:0 0 0 2px rgba(110,179,255,.25)}
}

/* Shared screen typography and component geometry. Print uses original fallbacks. */
@media screen {
  :root{--ui-small:12px;--ui-weight-medium:500;--ui-weight-strong:600;--ui-tracking:0em;--ui-font:"Microsoft YaHei UI","PingFang SC",system-ui,sans-serif}
  :root body{font-family:var(--ui-font);font-size:13px;font-weight:400;line-height:1.55;letter-spacing:0}
  :root :is(button,input,select,textarea){font-family:var(--ui-font);letter-spacing:0}
  :root :is(b,strong){font-weight:500}
  :root :is(h1,h2,h3,h4){font-weight:600;letter-spacing:0;line-height:1.4}
  :root body.workspace-mode .topbar h1{font-size:18px;font-weight:600;letter-spacing:0}
  :root .brand-block{gap:16px}
  :root .topbar-logo{width:112px}
  :root .eyebrow{display:none}
  :root .workspace-context{font-size:12px;font-weight:400;box-shadow:none;border-radius:6px}
  :root .current-user{min-width:120px}
  :root .current-user b{font-size:13px;font-weight:500}
  :root .current-user span{font-size:12px}
  :root body.workspace-mode .nav-section{font-size:12px;font-weight:400;letter-spacing:0}
  :root body.workspace-mode .tab{font-size:13px;font-weight:400;line-height:1.5;border-radius:8px;padding-top:10px;padding-bottom:10px}
  :root body.workspace-mode .tab.active{font-weight:600;box-shadow:none}
  :root body.workspace-mode .tab.active:after{display:none}
  :root .panel{border-radius:14px;box-shadow:none;backdrop-filter:none}
  :root :is(.section-head,.result-head){margin-bottom:20px}
  :root :is(.section-head,.result-head) h2{font-size:23px;letter-spacing:0;line-height:1.4}
  :root :is(.section-head,.result-head) .hint{font-size:13px;line-height:1.6}
  :root :is(.ops-card,.picker,.inline-card,.detail,.result-table-wrap,.sales-focus-surface,.sales-share-surface,.sales-panel){border-radius:12px;box-shadow:none;backdrop-filter:none}
  :root .ops-card-head{padding:16px 18px;gap:12px;flex-wrap:wrap}
  :root .ops-card-head>div>span:first-child{display:none}
  :root .ops-card-head h3{font-size:17px;line-height:1.4;margin:0;font-weight:600;letter-spacing:0}
  :root .ops-card-head small{font-size:12px;line-height:1.6;font-weight:400}
  :root :is(.summary,.dashboard-stat,.stat,.inventory-risk-stat,.decision-brief-stat,.data-readiness-stat,.inventory-health-stat,.risk-task-stat,.uv-work-stat){border-radius:10px;box-shadow:none}
  :root :is(.dashboard-stat,.stat,.inventory-risk-stat,.inventory-health-stat,.uv-work-stat) b{font-size:26px;font-weight:600;line-height:1.2;font-variant-numeric:tabular-nums;letter-spacing:0}
  :root :is(.dashboard-stat,.stat,.uv-work-stat) span{font-size:12px;font-weight:400;margin-top:6px}
  :root :is(.operations-view-switch,.integration-view-switch,.finance-view-switch){border-radius:10px;padding:5px;box-shadow:none;backdrop-filter:none}
  :root :is(.operations-view-switch,.integration-view-switch,.finance-view-switch) button{border-radius:7px;box-shadow:none}
  :root :is(.operations-view-switch,.integration-view-switch,.finance-view-switch) button b{font-size:14px;font-weight:500}
  :root :is(.operations-view-switch,.integration-view-switch,.finance-view-switch) button span{font-size:12px;font-weight:400;line-height:1.5}
  :root :is(button.primary,button.secondary,button.ghost,.mini-action){font-size:13px;font-weight:500;line-height:1.4;min-height:34px;border-radius:8px;padding:7px 12px;box-shadow:none;backdrop-filter:none}
  :root :is(.primary,.mini-action:not(.secondary)){background:#0875e1;box-shadow:none}
  :root :is(.primary,.mini-action:not(.secondary)):hover{background:#0765c2;box-shadow:none;transform:none}
  :root :is(.mini-action.supply-plan-delete,.mini-action.danger){background:transparent;color:var(--bad)}
  :root :is(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="file"]),select,textarea){font-size:13px;font-weight:400;line-height:1.5;min-height:36px;border-radius:8px}
  :root input[type="number"]{text-align:right;font-variant-numeric:tabular-nums}
  :root textarea{line-height:1.65}
  :root :is(.form-grid,.login-card) label{font-size:13px;font-weight:400;line-height:1.5}
  :root :is(.form-grid,.login-card) label small{font-size:12px;font-weight:400}
  :root table{font-size:13px;line-height:1.6}
  :root th{font-size:12px;font-weight:500;letter-spacing:0;padding:11px 12px;backdrop-filter:none}
  :root td{padding:12px;vertical-align:top}
  :root td :is(b,strong){font-weight:500}
  :root td small{font-size:12px;font-weight:400;line-height:1.55}
  :root :is(.code,.detail-code,.product-identity-code,.uv-rtp-code){font-family:Consolas,"SFMono-Regular",monospace;font-size:12px;font-weight:400;letter-spacing:0}
  :root .product-identity-name{font-family:var(--ui-font);font-size:13px;font-weight:500;line-height:1.6}
  :root :is(.badge,.supply-plan-state,.ordering-decision,.purchase-reconciliation){font-size:12px;font-weight:500;border-radius:5px;padding:3px 7px}
  :root :is(.modal-head,.modal-actions){padding:18px 22px}
  :root .modal-card{border-radius:16px;backdrop-filter:none}
  :root .modal-head h3{font-size:20px;font-weight:600;line-height:1.4;letter-spacing:0}
  :root .modal-head>div>span:first-child{display:none}
  :root .modal-actions{gap:10px;flex-wrap:wrap}
  :root .modal-actions button{font-size:14px;font-weight:500;min-height:38px;border-radius:8px}
  :root .login-brand h1{font-size:38px;font-weight:600;line-height:1.5;letter-spacing:0}
  :root .login-card h2{font-size:26px;font-weight:600;line-height:1.5;letter-spacing:0}
  :root .login-card input{font-size:14px;min-height:42px}
  :root .login-card button{font-family:var(--ui-font);font-size:14px;font-weight:500;border-radius:8px;box-shadow:none}
  :root .brand-points b{font-weight:400;border-radius:6px;box-shadow:none}
  :root #dashboardTab .sales-dashboard-hero{min-height:0;padding:18px 20px!important;border-radius:12px;box-shadow:none!important;backdrop-filter:none}
  :root #dashboardTab .sales-dashboard-hero:before,:root #dashboardTab .sales-dashboard-hero:after{display:none}
  :root #dashboardTab .sales-dashboard-hero .dashboard-actions button{box-shadow:none!important;backdrop-filter:none}
  :root #dashboardTab .sales-dashboard-hero .dashboard-actions .primary{background:#0875e1!important;border-color:#0875e1!important}
  :root #dashboardTab .sales-dashboard-toolbar{border-radius:10px;box-shadow:none;backdrop-filter:none}
  :root #dashboardTab .sales-dashboard-toolbar select{box-shadow:none}
  :root #dashboardTab .sales-dashboard-hero h2{font-size:24px!important;letter-spacing:0}
  :root :is(.sales-focus-heading,.sales-panel-head) h3{font-size:17px;font-weight:600;letter-spacing:0}
  :root :is(.sales-focus-heading>span,.sales-panel-head>div>span){display:none}
  :root :is(.sales-headline-primary,.sales-headline-item,.sales-gmv-card) b{font-weight:600;letter-spacing:0;font-variant-numeric:tabular-nums}
  :root .sales-headline-primary b{font-size:36px}
  :root .sales-product-row{line-height:1.6}
  :root[data-theme="light"] body{background:#f2f4f7}
  :root[data-theme="light"] :is(.topbar,body.workspace-mode .topbar){background:#fff;border-color:#dfe4ec;box-shadow:none;backdrop-filter:none}
  :root[data-theme="light"] body.workspace-mode .tabs{background:#f8f9fb;border-color:#dfe4ec;backdrop-filter:none}
  :root[data-theme="light"] body.workspace-mode .tab-page{background:#f2f4f7}
  :root[data-theme="light"] body.workspace-mode .tab.active{background:#e5effc;color:#175daa;border-color:#c6daf5;box-shadow:inset 3px 0 #2781df}
  :root[data-theme="light"] :is(.ops-card,.picker,.detail,.result-table-wrap,.sales-focus-surface,.sales-share-surface,.sales-panel){background:#fff;border-color:#dce2ea}
  :root[data-theme="light"] :is(.ops-card-head,.picker-head){background:#fff;border-color:#e4e8ee}
  :root[data-theme="light"] th{background:#f0f3f7;color:#4d5c6f;border-color:#dce2ea}
  :root[data-theme="light"] td{border-color:#e6eaf0}
  :root[data-theme="light"] :is(.secondary,.ghost){background:#fff;border-color:#cfd7e3;color:#344256}
  :root[data-theme="light"] .modal-card{background:#fff}
  :root[data-theme="light"] .modal-actions{background:#f6f8fb}
  :root[data-theme="light"] .login-brand{background:#edf2f8}
  :root[data-theme="light"] .login-card{background:#fff}
  :root[data-theme="light"] #dashboardTab:before{background:none}
  :root[data-theme="light"] #dashboardTab:after{display:none}
  :root[data-theme="light"] #dashboardTab .sales-dashboard-hero{background:#fff!important;border-color:#dce2ea!important}
  :root[data-theme="light"] #dashboardTab .sales-dashboard-toolbar{background:#fff;border-color:#dce2ea}
  :root[data-theme="dark"] #dashboardTab .sales-dashboard-hero{background:#1c2531!important;border-color:#404d5f!important}
}
@media screen and (min-width:1101px){
  :root body.workspace-mode .topbar{height:78px;padding:12px 24px}
  :root body.workspace-mode main{height:calc(100vh - 78px)}
  :root body.workspace-mode .tab-page{padding:22px 24px}
}
@media screen and (max-width:1100px){
  :root .topbar-logo{width:90px}
  :root body.workspace-mode .topbar h1{font-size:16px}
  :root .brand-block{gap:10px}
  :root .login-brand h1{font-size:30px}
}

@media screen {
  :root body.workspace-mode .nav-primary{gap:4px;margin:2px 0 14px}
  :root body.workspace-mode .nav-primary .tab{display:flex;align-items:center;gap:11px;min-height:42px}
  :root .nav-icon{width:18px;height:18px;flex:none;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}
  :root body.workspace-mode .nav-group-toggle{display:grid;grid-template-columns:18px minmax(0,1fr) 16px;align-items:center;gap:11px;font-size:13px;font-weight:500;letter-spacing:0;min-height:42px;padding:10px 11px;border-radius:8px}
  :root body.workspace-mode .nav-group-toggle i{width:16px;height:16px;background:none}
  :root body.workspace-mode .nav-group-toggle i:before{left:3px;background:currentColor}
  :root body.workspace-mode .nav-group-toggle i:after{right:3px;background:currentColor}
  :root body.workspace-mode .nav-group-items{padding:3px 0 7px 28px;gap:3px}
  :root body.workspace-mode .nav-group-items .tab{font-size:13px;min-height:36px;padding:8px 10px;font-weight:400}
  :root body.workspace-mode .nav-group-items .tab.active{font-weight:600}
  :root[data-theme="light"] body.workspace-mode .tab.active{box-shadow:inset 3px 0 #2781df}
  :root[data-theme="dark"] body.workspace-mode .tab.active{box-shadow:inset 3px 0 #72b7ff}
}
@media screen and (max-width:900px){
  :root body.workspace-mode .nav-group-toggle{display:none}
  :root body.workspace-mode .nav-primary .tab{min-height:36px;gap:7px}
  :root body.workspace-mode .nav-group-items{padding:0}
}

/* Real-data review: preserve readable columns and keep row actions reachable. */
@media screen {
  :root{--ui-sticky-surface:#fff;--ui-sticky-head:#f0f3f7}
  :root[data-theme="dark"]{--ui-sticky-surface:#1c2531;--ui-sticky-head:#2b3747}
  :root #operationsTab .supply-plan-card table{min-width:900px}
  :root #operationsTab .supply-plan-card :is(th,td):first-child{min-width:150px}
  :root #operationsTab .supply-plan-card :is(th,td):nth-child(2){min-width:165px;overflow-wrap:anywhere}
  :root #operationsTab .supply-plan-card :is(th,td):nth-child(3){min-width:85px;white-space:nowrap}
  :root #operationsTab .supply-plan-card :is(th,td):nth-child(4),:root #operationsTab .supply-plan-card :is(th,td):nth-child(5){min-width:115px}
  :root #operationsTab .supply-plan-card :is(th,td):last-child{min-width:230px}
  :root .uv-work-table :is(th,td):last-child{position:sticky;right:0;z-index:2;background:var(--ui-sticky-surface);box-shadow:-1px 0 var(--line);min-width:112px}
  :root .uv-work-table th:last-child{z-index:4;background:var(--ui-sticky-head)}
  :root .uv-work-table td:last-child .mini-action{display:block;width:100%;margin:0 0 7px;white-space:normal}
  :root :is(.uv-stock-identity,.uv-custom-text,.uv-order-note){overflow-wrap:anywhere;white-space:normal}
  :root .uv-stock-identity{padding:10px 12px;margin-top:12px;border-left:3px solid #578fc5;border-radius:6px;background:var(--ui-sticky-surface);color:var(--ink);font-size:13px;line-height:1.65}
  :root #uvStockSummary b{overflow-wrap:anywhere;font-variant-numeric:tabular-nums}
  :root #supplyPlanModal .modal-actions #supplyPreviewBtn.supply-step-pending{background:#0875e1;border-color:#0875e1;color:#fff;box-shadow:none}
  :root #supplyPlanModal .modal-actions #supplyPreviewBtn.supply-step-pending:hover{background:#0765c2}
  :root .sales-share-copy>span{display:none}
  :root .sales-share-copy{min-width:0;overflow-wrap:anywhere}
}
@media screen and (max-width:1700px){
  :root #operationsTab[data-view="workflow"] .supply-plan-card,:root #operationsTab[data-view="workflow"] .transfer-batch-card{grid-column:1/-1}
}
@media screen and (min-width:1001px) and (max-width:1500px){
  :root .sales-share-surface{grid-template-columns:100px minmax(0,1fr);gap:14px;padding:16px}
  :root .sales-share-orb{width:100px;height:100px}
  :root .sales-share-orb:before{width:74px;height:74px}
  :root .sales-share-orb b{font-size:22px}
}

/* Module alignment: readable directories and restrained finance surfaces. */
@media screen {
  :root #masterTab .master-layout{grid-template-columns:minmax(0,1.25fr) minmax(340px,.75fr)}
  :root #masterTab .master-directory{min-width:0}
  :root #masterTab .master-table-wrap table{min-width:880px}
  :root #masterTab .master-table-wrap :is(th,td):nth-child(2){min-width:230px;white-space:normal;overflow-wrap:anywhere}
  :root #masterTab .master-table-wrap :is(th,td):nth-child(3){min-width:235px;overflow-wrap:anywhere}
  :root #masterTab .master-table-wrap :is(th,td):last-child{min-width:135px;font-variant-numeric:tabular-nums}
  :root :is(.finance-daily-toolbar,.finance-filter,.inventory-health-toolbar,.inventory-risk-toolbar,.risk-task-toolbar,.cutover-toolbar){flex-wrap:wrap;gap:10px}
  :root .finance-daily-toolbar>label{min-width:140px}
  :root .finance-daily-toolbar .finance-bom-search{min-width:240px}
  :root :is(.finance-daily-toolbar,.finance-filter) :is(input,select){min-height:36px;max-width:100%}
  :root :is(.inventory-health-toolbar,.inventory-risk-toolbar,.risk-task-toolbar)>input{flex:1 1 250px;min-width:180px}
  :root #financeTab.finance-page:before{display:none}
  :root #financeTab.finance-page :is(.finance-data-hero,.finance-daily-control,.finance-area-switch){border:1px solid var(--line);border-radius:12px;background:var(--ui-sticky-surface);box-shadow:none;backdrop-filter:none}
  :root #financeTab.finance-page .finance-data-hero{min-height:0;padding:18px 20px}
  :root #financeTab.finance-page .finance-data-hero h2{font-size:24px;line-height:1.5;letter-spacing:0}
  :root #financeTab.finance-page .finance-data-hero>div>span,:root #financeTab .finance-daily-toolbar>div>span{display:none}
  :root #financeTab.finance-page nav.finance-area-switch>button{min-height:52px;border-radius:8px;box-shadow:none;backdrop-filter:none}
  :root #financeTab.finance-page nav.finance-area-switch>button.active{box-shadow:inset 3px 0 #2781df!important}
  :root[data-theme="dark"] #financeTab.finance-page nav.finance-area-switch>button.active{background:#30475f!important;border-color:#58718d!important;box-shadow:inset 3px 0 #72b7ff!important}
  :root[data-theme="dark"] #financeTab.finance-page nav.finance-area-switch>button.active b{color:#b9dcff!important}
  :root[data-theme="dark"] #financeTab.finance-page nav.finance-area-switch>button.active span{color:#cedbea!important}
}
@media screen and (max-width:1600px){
  :root #masterTab .master-layout{grid-template-columns:minmax(0,1fr)}
  :root #masterTab .master-directory-toolbar{display:grid;grid-template-columns:repeat(3,minmax(126px,auto)) minmax(220px,1fr) auto}
  :root #masterTab .master-directory-toolbar>*{width:auto;min-width:0}
  :root #masterTab .master-directory-toolbar #masterSearch{width:100%;min-width:0}
  :root #masterTab .master-directory-toolbar>:nth-child(n+6){grid-row:2}
  :root #financeTab .finance-daily-toolbar>div{flex-basis:100%;margin:0 0 4px}
}
@media screen and (max-width:1000px){
  :root #masterTab .master-directory-toolbar{display:flex;flex-wrap:wrap}
  :root #masterTab .master-directory-toolbar select{flex:1 1 145px}
  :root #masterTab .master-directory-toolbar #masterSearch{flex:1 1 100%}
  :root #financeTab.finance-page .finance-area-switch{grid-template-columns:repeat(2,minmax(0,1fr))}
}

@media screen {
  :root .ai-result-list article small{font-size:12px;line-height:1.6;overflow-wrap:anywhere}
  :root .ai-result-list article b.code{font-size:13px;line-height:1.6;overflow-wrap:anywhere}
}

/* Keyboard navigation must remain visible in both display modes. */
@media screen {
  :root{--ui-focus-ring:#155eef}
  :root[data-theme="dark"]{--ui-focus-ring:#86beff}
  :root :is(button,a[href],input,select,textarea,summary,[tabindex]):focus-visible{
    outline:2px solid var(--ui-focus-ring);outline-offset:3px;
  }
}

/* Desktop appearance: semantic surfaces shared by light and dark modes.
   Keep these screen-only; business state classes and print output are unchanged. */
@media screen {
  :root[data-theme] {
    --ui-font:-apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Microsoft YaHei UI",system-ui,sans-serif;
    --ui-canvas:#f2f2ef;--ui-sidebar:#eceeea;--ui-surface:#fdfdfb;
    --ui-raised:#fff;--ui-toolbar:#f5f6f2;--ui-field:#fff;
    --ui-text:#262b31;--ui-muted:#626b72;--ui-border:#dadfdc;--ui-divider:#e5e9e5;
    --ui-accent:#306dc6;--ui-accent-hover:#235bb0;--ui-accent-text:#fff;
    --ui-tint:#e7eef9;--ui-tint-ink:#2a5eac;--ui-button:#ebefee;--ui-button-hover:#e0e6e3;
    --ui-selected:#e0eafb;--ui-selected-ink:#245aab;--ui-row-hover:#eff4fa;
    --ui-focus-ring:#306dc6;--ui-focus-halo:rgba(48,109,198,.15);
    --theme-blue-1000:var(--ui-tint-ink);--theme-blue-border-1000:var(--ui-focus-ring);
    --ui-card-shadow:0 2px 8px rgba(32,42,38,.035);
    --ui-float-shadow:0 18px 54px rgba(24,32,29,.18),0 2px 8px rgba(24,32,29,.08);
    --ui-glass:#f6f7f3;--ui-scrim:rgba(35,42,42,.32);
    --ok:#227048;--warn:#8c5916;--bad:#b23e38;
    --theme-green-1000:var(--ok);--theme-orange-1000:var(--warn);--theme-red-1000:var(--bad);
    --ink:var(--ui-text);--muted:var(--ui-muted);--line:var(--ui-divider);
    --primary:var(--ui-accent);--primary2:var(--ui-accent-hover);
    --ui-sticky-surface:var(--ui-surface);--ui-sticky-head:var(--ui-toolbar);
  }
  :root[data-theme="dark"] {
    --ui-canvas:#202224;--ui-sidebar:#282d2f;--ui-surface:#32383b;
    --ui-raised:#40484c;--ui-toolbar:#373e41;--ui-field:#2b3235;
    --ui-text:#f3f6f7;--ui-muted:#bdc9cd;--ui-border:#4b575d;--ui-divider:#444e53;
    --ui-accent:#306dc6;--ui-accent-hover:#255db0;--ui-accent-text:#fff;
    --ui-tint:#304966;--ui-tint-ink:#b2d5ff;--ui-button:#414e54;--ui-button-hover:#4e5c63;
    --ui-selected:#314e70;--ui-selected-ink:#c4e0ff;--ui-row-hover:#3b4a54;
    --ui-focus-ring:#7ab6ff;--ui-focus-halo:rgba(122,182,255,.2);
    --ui-card-shadow:0 3px 12px rgba(0,0,0,.12);
    --ui-float-shadow:0 22px 60px rgba(0,0,0,.4),0 2px 8px rgba(0,0,0,.24);
    --ui-glass:#2b3134;--ui-scrim:rgba(9,9,12,.55);
    --ok:#84d3a6;--warn:#e6bc79;--bad:#f39797;
    --theme-ink-1000:var(--ui-text);--theme-muted-1000:var(--ui-muted);
    --theme-surface-1000:var(--ui-surface);--theme-elevated-1000:var(--ui-raised);
  }
  :root[data-theme] body{background:var(--ui-canvas);color:var(--ui-text)}
  :root[data-theme] :is(.topbar,body.workspace-mode .topbar){background:var(--ui-glass);border-color:var(--ui-border);box-shadow:0 1px 0 rgba(0,0,0,.02);backdrop-filter:blur(18px) saturate(115%)}
  :root[data-theme] :is(.topbar h1,body.workspace-mode .topbar h1){color:var(--ui-text)}
  :root[data-theme] .workspace-context{background:var(--ui-button);border-color:transparent;color:var(--ui-muted);padding:3px 9px;border-radius:7px}
  :root[data-theme] .panel{background:var(--ui-canvas);border-color:transparent;box-shadow:none}
  :root[data-theme="light"] .panel{border-color:var(--ui-border)}
  :root[data-theme] body.workspace-mode .tabs{background:var(--ui-sidebar);border-color:var(--ui-border);padding:16px 10px;backdrop-filter:none}
  :root[data-theme] body.workspace-mode .tab-page{background:var(--ui-canvas);border-color:transparent}
  :root[data-theme] body.workspace-mode .tab{color:var(--ui-muted);border:1px solid transparent;border-radius:9px;transition:background .15s,color .15s}
  :root[data-theme] body.workspace-mode .tab:hover{background:var(--ui-button-hover);color:var(--ui-text)}
  :root[data-theme] body.workspace-mode .tab.active{background:var(--ui-selected);color:var(--ui-selected-ink);border-color:transparent;box-shadow:none;font-weight:500}
  :root[data-theme] body.workspace-mode .tab.active:after{display:none}
  :root[data-theme] body.workspace-mode .nav-group-toggle{color:var(--ui-muted)}
  :root[data-theme] body.workspace-mode .nav-safety{background:transparent;border:0;border-top:1px solid var(--ui-border);border-radius:0;color:var(--ui-muted)}
  :root[data-theme] :is(.ops-card,.picker,.inline-card,.detail,.result-table-wrap,.sales-focus-surface,.sales-share-surface,.sales-panel){background:var(--ui-surface);border-color:var(--ui-border);border-radius:14px;box-shadow:var(--ui-card-shadow);backdrop-filter:none}
  :root[data-theme] :is(.ops-card-head,.picker-head,.sales-panel-head){background:var(--ui-surface);border-color:var(--ui-divider)}
  :root[data-theme] .operations-sections{gap:18px;margin-bottom:18px}
  :root[data-theme] :is(.ops-card-head h3,.section-head h2,.result-head h2){color:var(--ui-text)}
  :root[data-theme] :is(.summary,.dashboard-stat,.stat,.inventory-risk-stat,.decision-brief-stat,.data-readiness-stat,.inventory-health-stat,.risk-task-stat,.uv-work-stat){background:var(--ui-surface);border:1px solid var(--ui-border);border-radius:12px;box-shadow:var(--ui-card-shadow)}
  :root[data-theme] :is(.dashboard-stat,.stat,.uv-work-stat) b{color:var(--ui-text)}
  :root[data-theme] :is(.dashboard-stat,.stat,.uv-work-stat) span{color:var(--ui-muted)}
  :root[data-theme] :is(.operations-view-switch,.integration-view-switch,.finance-view-switch,.sales-dashboard-toolbar){background:var(--ui-sidebar);border:1px solid var(--ui-border);padding:5px;border-radius:12px;box-shadow:none}
  :root[data-theme] :is(.operations-view-switch,.integration-view-switch,.finance-view-switch) button{background:transparent;color:var(--ui-muted);border-color:transparent;border-radius:8px}
  :root[data-theme] :is(.operations-view-switch,.integration-view-switch,.finance-view-switch) button.active{background:var(--ui-raised);color:var(--ui-tint-ink);border-color:var(--ui-border);box-shadow:0 1px 4px rgba(20,30,40,.08)}
  :root[data-theme] :is(.operations-view-switch,.integration-view-switch,.finance-view-switch) button span{color:var(--ui-muted)}
  :root[data-theme] :is(button.primary,.mini-action:not(.secondary):not(.danger):not(.supply-plan-delete)){background:var(--ui-accent);color:var(--ui-accent-text);border:1px solid transparent;box-shadow:0 1px 2px rgba(20,70,135,.12);border-radius:8px}
  :root[data-theme] :is(button.primary,.mini-action:not(.secondary):not(.danger):not(.supply-plan-delete)):hover{background:var(--ui-accent-hover);filter:none}
  :root[data-theme] :is(button.secondary,.btn-secondary,button.ghost,.ghost-dark){background:var(--ui-button);color:var(--ui-text);border:1px solid var(--ui-border);box-shadow:inset 0 1px 0 rgba(255,255,255,.06);backdrop-filter:none}
  :root[data-theme] :is(button.secondary,.btn-secondary,button.ghost,.ghost-dark):hover{background:var(--ui-button-hover);border-color:var(--ui-muted);filter:none}
  :root[data-theme] :is(.mini-action.danger,.mini-action.supply-plan-delete){background:transparent;color:var(--bad);box-shadow:none}
  :root[data-theme] button:disabled{box-shadow:none;cursor:not-allowed}
  :root[data-theme] :is(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="file"]),select,textarea){background:var(--ui-field);color:var(--ui-text);border:1px solid var(--ui-border);box-shadow:inset 0 1px 2px rgba(0,0,0,.025)}
  :root[data-theme] :is(input,textarea)::placeholder{color:var(--ui-muted);opacity:1}
  :root[data-theme] :is(input,select,textarea):hover{border-color:var(--ui-muted)}
  :root[data-theme] :is(input,select,textarea){accent-color:var(--ui-accent)}
  :root[data-theme] :is(input,select,textarea):focus{border-color:var(--ui-focus-ring)!important;box-shadow:0 0 0 3px var(--ui-focus-halo)}
  :root[data-theme] :is(button,a[href],input,select,textarea,summary,[tabindex]):focus-visible{outline-color:var(--ui-focus-ring)}
  :root[data-theme] select option{background:var(--ui-raised);color:var(--ui-text)}
  :root[data-theme] th{background:var(--ui-toolbar);color:var(--ui-muted);border-color:var(--ui-divider)}
  :root[data-theme] td{border-color:var(--ui-divider)}
  :root[data-theme] tbody tr:hover{background:var(--ui-row-hover)}
  :root[data-theme] tbody tr.active{background:var(--ui-tint)}
  :root[data-theme] .modal-backdrop{background:var(--ui-scrim);backdrop-filter:blur(6px)}
  :root[data-theme] .modal-card{background:var(--ui-surface);border:1px solid var(--ui-border);border-radius:18px;box-shadow:var(--ui-float-shadow)}
  :root[data-theme] :is(.modal-head,.modal-actions){background:var(--ui-toolbar);border-color:var(--ui-divider)}
  :root[data-theme] .display-theme-trigger{color:var(--ui-muted)}
  :root[data-theme] .display-theme-trigger:hover{color:var(--ui-text);background:var(--ui-button-hover)}
  :root[data-theme] .display-theme-menu{background:var(--ui-raised);color:var(--ui-text);border-color:var(--ui-border);box-shadow:var(--ui-float-shadow)}
  :root[data-theme] .display-theme-option[aria-checked="true"]{background:var(--ui-tint);color:var(--ui-tint-ink)}
  :root[data-theme] .display-theme-option:hover,:root[data-theme] .display-theme-option:focus-visible{background:var(--ui-button-hover)}
  :root[data-theme] .login-card{background:var(--ui-surface);border-color:var(--ui-border);box-shadow:var(--ui-float-shadow)}
  :root[data-theme] .login-brand{background:linear-gradient(145deg,var(--ui-sidebar),var(--ui-tint));border-color:var(--ui-border)}
  :root[data-theme] #dashboardTab .sales-dashboard-hero{background:var(--ui-surface)!important;border-color:var(--ui-border)!important}
  :root[data-theme] #dashboardTab .sales-dashboard-toolbar{background:var(--ui-toolbar);border-color:var(--ui-border)}
  :root[data-theme] #dashboardTab .sales-dashboard-hero .dashboard-actions .primary{background:var(--ui-accent)!important;border-color:var(--ui-accent)!important;color:var(--ui-accent-text)}
  :root[data-theme] #dashboardTab .sales-dashboard-hero .dashboard-actions .primary:hover{background:var(--ui-accent-hover)!important}
  :root[data-theme] #supplyPlanModal .modal-actions #supplyPreviewBtn.supply-step-pending{background:var(--ui-accent);border-color:var(--ui-accent);color:var(--ui-accent-text)}
  :root[data-theme] #supplyPlanModal .modal-actions #supplyPreviewBtn.supply-step-pending:hover{background:var(--ui-accent-hover)}
  :root[data-theme] .uv-stock-identity{border-left-color:var(--ui-focus-ring)}
  :root[data-theme] :is(.powerdisc-scrap-form,.uv-custom-text,.uv-order-notes){background:var(--ui-toolbar);border-color:var(--ui-divider);color:var(--ui-text)}
  :root[data-theme] #financeTab.finance-page .finance-area-switch{background:var(--ui-sidebar)}
  :root[data-theme] #financeTab.finance-page nav.finance-area-switch>button.active{background:var(--ui-raised)!important;border-color:var(--ui-border)!important;box-shadow:0 1px 4px rgba(20,30,40,.08)!important}
  :root[data-theme] #financeTab.finance-page nav.finance-area-switch>button.active b{color:var(--ui-tint-ink)!important}
  :root[data-theme] #financeTab.finance-page nav.finance-area-switch>button.active span{color:var(--ui-muted)!important}
  /* Retain explicit risk semantics instead of recoloring every tile blue. */
  :root[data-theme="light"] :is(.dashboard-stat,.uv-work-stat):is(.warning,.warn){background:#f5eddd;border-color:#dcc9a8}
  :root[data-theme="light"] :is(.dashboard-stat,.uv-work-stat):is(.critical,.bad){background:#f6e8e5;border-color:#dcbeb7}
  :root[data-theme="light"] :is(.dashboard-stat,.uv-work-stat).active{background:#e5eee7;border-color:#bdd2c3}
  :root[data-theme="dark"] :is(.dashboard-stat,.uv-work-stat):is(.warning,.warn){background:#3b3427;border-color:#75603b}
  :root[data-theme="dark"] :is(.dashboard-stat,.uv-work-stat):is(.critical,.bad){background:#402e30;border-color:#785052}
  :root[data-theme="dark"] :is(.dashboard-stat,.uv-work-stat).active{background:#2b3b34;border-color:#4d715f}
  :root[data-theme] .uv-work-stat.selected{outline:2px solid var(--ui-tint-ink);outline-offset:-2px;box-shadow:none}
}

/* Stage tiles stay inside their card; four operations metrics fill their row. */
@media screen {
  :root[data-theme] #uvWorkStats{margin:12px 16px 16px;min-width:0;grid-template-columns:repeat(6,minmax(0,1fr))}
  :root[data-theme] #uvWorkStats>.uv-work-stat{min-width:0;box-sizing:border-box;overflow-wrap:anywhere}
  :root[data-theme] #uvWorkStats>.uv-work-stat:focus-visible{outline:2px solid var(--ui-focus-ring);outline-offset:-2px}
  :root[data-theme] #operationsStats{grid-template-columns:repeat(4,minmax(0,1fr))}
}
@media screen and (max-width:1440px){
  :root[data-theme] #uvWorkStats{grid-template-columns:repeat(3,minmax(0,1fr))}
}
@media screen and (max-width:1100px){
  :root[data-theme] #operationsStats{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media screen and (max-width:760px){
  :root[data-theme] #uvWorkStats{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media screen and (max-width:560px){
  :root[data-theme] #operationsStats{grid-template-columns:minmax(0,1fr)}
}

/* Dashboard data series are independent of navigation/action theme tokens. */
@media screen {
  :root[data-theme] #dashboardTab{
    --sales-series-overseas:#3978d0;--sales-series-china:#25866d;
    --sales-blue:var(--sales-series-overseas);--sales-lilac:var(--sales-series-china);
    --sales-grid:#e5eae6;--sales-track:#e7ede9;
  }
  :root[data-theme="dark"] #dashboardTab{
    --sales-series-overseas:#80b5ff;--sales-series-china:#65d1af;
    --sales-grid:#48545a;--sales-track:#48545a;
  }
  :root[data-theme] #dashboardTab .sales-share-orb{background:conic-gradient(var(--sales-series-overseas) 0 var(--sales-share-angle),var(--sales-series-china) var(--sales-share-angle) 360deg);box-shadow:none}
  :root[data-theme] #dashboardTab .sales-share-orb:before{background:var(--ui-surface);box-shadow:none}
  :root[data-theme] #dashboardTab .sales-share-row i{background:var(--sales-series-overseas);box-shadow:none}
  :root[data-theme] #dashboardTab .sales-share-row.china i{background:var(--sales-series-china)}
  :root[data-theme] #dashboardTab .sales-curve-line{stroke-width:2.6;filter:none}
  :root[data-theme] #dashboardTab .sales-curve-line.china{stroke-dasharray:6 4}
  :root[data-theme] #dashboardTab .sales-curve-svg circle{stroke:var(--ui-surface);stroke-width:1.8;filter:none}
  :root[data-theme] #dashboardTab .sales-curve-svg circle[fill="#5b7cfa"]{fill:var(--sales-series-overseas)}
  :root[data-theme] #dashboardTab .sales-curve-svg circle[fill="#b7a9ec"]{fill:var(--sales-series-china)}
  :root[data-theme] #dashboardTab #salesOverseasArea stop{stop-color:var(--sales-series-overseas)}
  :root[data-theme] #dashboardTab #salesChinaArea stop{stop-color:var(--sales-series-china)}
  :root[data-theme] #dashboardTab :is(#salesOverseasArea,#salesChinaArea) stop:first-child{stop-opacity:.09}
  :root[data-theme] #dashboardTab .sales-curve-grid line{stroke:var(--sales-grid)}
  :root[data-theme] #dashboardTab .sales-curve-labels text{fill:var(--ui-muted);font-size:12px}
  :root[data-theme] #dashboardTab .sales-trend-legend{font-size:12px;color:var(--ui-muted)}
  :root[data-theme] #dashboardTab .sales-trend-legend i{width:18px;height:3px;border-radius:0;vertical-align:middle}
  :root[data-theme] #dashboardTab .sales-trend-legend span:nth-child(2) i{background:repeating-linear-gradient(90deg,var(--sales-series-china) 0 6px,transparent 6px 9px)}
  :root[data-theme] #dashboardTab .sales-channel-track{height:5px;background:var(--sales-track)}
  :root[data-theme] #dashboardTab .sales-channel-track i{background:var(--sales-series-overseas)}
  :root[data-theme] #dashboardTab .sales-channel-card.china .sales-channel-track i{background:var(--sales-series-china)}
  :root[data-theme] #dashboardTab :is(.sales-gmv-card,.sales-product-feature,.sales-latest-glance){background:var(--ui-toolbar);border-color:var(--ui-divider);box-shadow:none;backdrop-filter:none}
  :root[data-theme] #dashboardTab :is(.sales-product-feature-top i,.sales-market-pill.overseas){background:var(--ui-tint);color:var(--ui-tint-ink)}
  :root[data-theme] #dashboardTab .sales-dashboard-hero .dashboard-actions .primary{color:var(--ui-accent-text)!important}
}

/* Lightweight glass-inspired materials: static gradients only, no live blur.
   Content stays opaque; subdued navigation avoids a raised glass-tile effect. */
@media screen {
  :root[data-theme="light"]{
    --glass-back:rgba(249,253,252,.82);--glass-side:rgba(237,246,244,.76);
    --glass-edge:rgba(255,255,255,.8);--glass-stroke:rgba(157,181,180,.3);
    --glass-shadow:0 5px 18px rgba(45,80,89,.05),inset 0 1px 0 rgba(255,255,255,.8);
    --glass-control:linear-gradient(155deg,rgba(255,255,255,.96),rgba(228,239,243,.94));
    --glass-control-hover:linear-gradient(155deg,#fff,#dbeaf3);
    --glass-selected:rgba(193,219,240,.48);
    --glass-background:radial-gradient(ellipse at 0% 5%,rgba(113,178,248,.22),transparent 47%),radial-gradient(ellipse at 90% 12%,rgba(109,219,183,.18),transparent 44%),radial-gradient(ellipse at 40% 100%,rgba(250,196,157,.12),transparent 58%),#eef3f2;
  }
  :root[data-theme="dark"]{
    --glass-back:rgba(43,60,69,.88);--glass-side:rgba(33,51,57,.82);
    --glass-edge:rgba(208,240,250,.2);--glass-stroke:rgba(172,214,224,.17);
    --glass-shadow:0 5px 18px rgba(0,0,0,.15),inset 0 1px 0 rgba(221,245,255,.1);
    --glass-control:linear-gradient(155deg,rgba(80,103,118,.94),rgba(46,64,76,.98));
    --glass-control-hover:linear-gradient(155deg,#596f80,#384e60);
    --glass-selected:rgba(75,119,151,.28);
    --glass-background:radial-gradient(ellipse at 2% 0%,rgba(52,119,202,.26),transparent 48%),radial-gradient(ellipse at 95% 15%,rgba(46,157,129,.2),transparent 48%),radial-gradient(ellipse at 40% 100%,rgba(112,98,160,.09),transparent 60%),#1e272c;
  }
  :root[data-theme]{--glass-primary:linear-gradient(165deg,#3071c8 0%,#245daf 100%)}
  :root[data-theme] body{background:var(--glass-background);background-attachment:fixed}
  :root[data-theme] .panel,:root[data-theme] body.workspace-mode .tab-page{background:transparent;border-color:var(--glass-stroke)}
  :root[data-theme] :is(.topbar,body.workspace-mode .topbar){background:var(--glass-back);border-color:var(--glass-stroke);box-shadow:var(--glass-shadow);backdrop-filter:none;-webkit-backdrop-filter:none}
  :root[data-theme] body.workspace-mode .tabs{background:var(--glass-side);border-color:var(--glass-stroke);backdrop-filter:none;-webkit-backdrop-filter:none}
  :root[data-theme] body.workspace-mode .tab.active{background:var(--glass-selected);border-color:transparent;box-shadow:none;border-radius:9px}
  :root[data-theme] :is(.operations-view-switch,.sales-dashboard-toolbar){background:var(--glass-back);border-color:var(--glass-stroke);box-shadow:var(--glass-shadow);backdrop-filter:none;-webkit-backdrop-filter:none}
  :root[data-theme] .display-theme-menu{background:var(--ui-raised);backdrop-filter:none;-webkit-backdrop-filter:none}
  :root[data-theme] #dashboardTab .sales-dashboard-toolbar{background:var(--glass-back);border-color:var(--glass-stroke)}
  :root[data-theme] #dashboardTab .sales-dashboard-hero{background:var(--glass-back)!important;border-color:var(--glass-edge)!important;box-shadow:var(--glass-shadow);backdrop-filter:none;-webkit-backdrop-filter:none}
  :root[data-theme] :is(.ops-card,.sales-focus-surface,.sales-share-surface,.sales-panel){box-shadow:0 3px 10px rgba(22,46,58,.045),inset 0 1px 0 var(--glass-edge);border-color:var(--glass-stroke);backdrop-filter:none;-webkit-backdrop-filter:none}
  :root[data-theme] :is(button.secondary,.btn-secondary,button.ghost,.ghost-dark){background:var(--glass-control);border-color:var(--glass-edge);box-shadow:inset 0 1px 0 var(--glass-edge)}
  :root[data-theme] :is(button.secondary,.btn-secondary,button.ghost,.ghost-dark):hover{background:var(--glass-control-hover);border-color:var(--glass-edge)}
  :root[data-theme] :is(button.primary,.mini-action:not(.secondary):not(.danger):not(.supply-plan-delete)){background:var(--glass-primary);border-color:rgba(139,196,255,.34);box-shadow:inset 0 1px 0 rgba(255,255,255,.2)}
  :root[data-theme] .uv-type-tabs [aria-selected="true"]{box-shadow:inset 0 0 0 2px var(--ui-focus-ring)}
  :root[data-theme] .uv-type-tabs button:focus-visible{outline-offset:-3px}
  :root[data-theme] #dashboardTab .sales-dashboard-hero .dashboard-actions .primary{background:var(--glass-primary)!important;border-color:rgba(139,196,255,.34)!important}
  :root[data-theme] .top-actions button,:root[data-theme] .dashboard-actions button{border-radius:999px}
  :root[data-theme] .uv-work-table{background:var(--ui-surface)}
  :root[data-theme] :is(.uv-work-stat,.uv-work-table){backdrop-filter:none;-webkit-backdrop-filter:none}
  /* Repeated row actions stay flat even in very long production lists. */
  :root[data-theme] .uv-work-table .mini-action{box-shadow:none}
  :root[data-theme] .uv-work-table .mini-action:not(.secondary):not(.danger):not(.supply-plan-delete){background:var(--ui-accent);border-color:var(--ui-accent)}
  :root[data-theme] .uv-work-table .mini-action.secondary{background:var(--ui-button);border-color:var(--ui-border)}
}
@media screen and (prefers-reduced-transparency:reduce){
  :root[data-theme] body{background:var(--ui-canvas)}
  :root[data-theme] :is(.topbar,body.workspace-mode .topbar,body.workspace-mode .tabs,.operations-view-switch,.sales-dashboard-toolbar){background:var(--ui-raised)}
  :root[data-theme] #dashboardTab .sales-dashboard-hero{background:var(--ui-surface)!important}
}

/* Respect the operating system preference without changing workflow state. */
@media screen and (prefers-reduced-motion:reduce){
  :root *, :root *::before, :root *::after{
    animation-duration:.01ms!important;animation-iteration-count:1!important;
    transition-duration:.01ms!important;scroll-behavior:auto!important;
  }
}
:root #operationsTab[data-view="workflow"] .supply-plan-card,:root #operationsTab[data-view="workflow"] .transfer-batch-card{grid-column:1/-1;width:100%;min-width:0}
:root #operationsTab .supply-plan-card .ops-table{max-height:none;height:auto;overflow:visible}
:root #operationsTab .supply-plan-card table{table-layout:fixed;width:100%;min-width:0}
:root #operationsTab .supply-plan-card :is(th,td){min-width:0!important;white-space:normal;overflow-wrap:anywhere;padding:14px 12px;vertical-align:top}
:root #operationsTab .supply-plan-card th:nth-child(1){width:20%}:root #operationsTab .supply-plan-card th:nth-child(2){width:23%}:root #operationsTab .supply-plan-card th:nth-child(3){width:10%}:root #operationsTab .supply-plan-card th:nth-child(4){width:12%}:root #operationsTab .supply-plan-card th:nth-child(5){width:16%}:root #operationsTab .supply-plan-card th:nth-child(6){width:19%}
.supply-plan-card td>b,.supply-plan-card td>small{display:block;margin-top:5px}.supply-plan-link{padding:0;background:transparent;color:var(--theme-blue-1000,#0071e3);text-align:left;font-size:inherit;overflow-wrap:anywhere}.supply-product-summary{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;font-weight:600}
.supply-workspace-tools{display:flex;flex-wrap:wrap;gap:10px;padding:16px 20px}.supply-workspace-tools input{flex:1;min-width:200px}.supply-workspace-tools :is(input,select),.supply-workspace-pages select{border:1px solid var(--line,#ddd);border-radius:12px;padding:10px 12px;background:var(--theme-surface-1000,#fff);color:var(--theme-ink-1000,#222)}
.supply-workspace-views{display:grid;grid-template-columns:1fr 1fr;gap:10px;padding:16px 20px 4px}.supply-workspace-views button{display:flex;align-items:center;justify-content:center;gap:8px;min-height:48px;border:1px solid var(--line,#ddd);border-radius:14px;background:var(--theme-surface-1000,#fff);color:var(--theme-ink-700,#5f6b7a);font-weight:700}.supply-workspace-views button.active{background:var(--theme-blue-1000,#0877e1);border-color:var(--theme-blue-1000,#0877e1);color:#fff;box-shadow:0 8px 20px #0877e126}.supply-workspace-views button span{min-width:24px;padding:2px 7px;border-radius:999px;background:#00000012}.supply-contract-no{color:var(--theme-blue-1000,#0877e1);font-weight:700}.office-china-inbox[hidden]{display:none!important}
#operationsTab .office-china-inbox{margin:12px 20px 16px;min-width:0}
#operationsTab .office-china-inbox>summary .china-summary-count{margin-left:8px}
#operationsTab .office-china-inbox>.line-builder-head{margin:12px 16px 8px}
#operationsTab .office-china-inbox>.china-tasks{padding:0 16px 16px}
#operationsTab .office-china-inbox>.china-tasks>p{margin:0;padding:8px 0}
#operationsTab .office-china-inbox>.china-tasks>.ops-table{max-width:100%;overflow:auto}
@media(max-width:800px){#operationsTab .office-china-inbox{margin-right:12px;margin-left:12px}}
.supply-workspace-actions{display:flex;gap:6px;flex-wrap:wrap;align-items:center}.supply-workspace-actions button{white-space:normal;max-width:100%;margin:0}.supply-workspace-more{width:100%}.supply-workspace-more summary{cursor:pointer;color:var(--theme-blue-1000,#0071e3);padding:5px 0}.supply-workspace-more>div{display:flex;flex-direction:column;gap:6px;padding-top:5px}.supply-workspace-pages{display:flex;align-items:center;justify-content:flex-end;gap:10px;padding:16px 20px;flex-wrap:wrap}.supply-workspace-pages>span:first-child{margin-right:auto}
.supply-workspace-detail{width:min(1000px,92vw);max-height:88vh;padding:0;border:1px solid var(--line,#ddd);border-radius:24px;background:var(--theme-surface-1000,#fff);color:var(--theme-ink-1000,#222);box-shadow:0 24px 80px #0003}.supply-workspace-detail::backdrop{background:#27334466;backdrop-filter:blur(6px)}.supply-workspace-detail header{display:flex;justify-content:space-between;padding:22px;border-bottom:1px solid var(--line,#ddd)}.supply-detail-content{padding:20px}.supply-detail-lines>div{display:flex;justify-content:space-between;gap:15px;padding:12px 0;border-bottom:1px solid var(--line,#ddd)}.supply-detail-lines small{display:block;opacity:.65;margin-top:5px}.supply-detail-content details{padding:15px 0}.supply-detail-content summary{cursor:pointer;font-weight:600}
#supplyPlanModal .supply-plan-draggable{transform:translate3d(var(--supply-drag-x,0),var(--supply-drag-y,0),0)}#supplyPlanModal .supply-plan-drag-handle{cursor:grab;user-select:none;touch-action:none}#supplyPlanModal .supply-plan-dragging{will-change:transform}#supplyPlanModal .supply-plan-dragging .supply-plan-drag-handle{cursor:grabbing}.supply-plan-drag-active,.supply-plan-drag-active *{cursor:grabbing!important;user-select:none!important}
@media(max-width:900px){#supplyPlanModal .supply-plan-draggable{transform:none!important}#supplyPlanModal .supply-plan-drag-handle{cursor:default;touch-action:auto;user-select:auto}}
@media(max-width:800px){:root #operationsTab .supply-plan-card thead{display:none}:root #operationsTab .supply-plan-card tr{display:grid;grid-template-columns:1fr 1fr;border-bottom:1px solid var(--line,#ddd)}:root #operationsTab .supply-plan-card td{display:block;width:auto!important;border:0}:root #operationsTab .supply-plan-card td:last-child{grid-column:1/-1}.supply-workspace-tools input{flex-basis:100%}.supply-workspace-views{grid-template-columns:1fr}.supply-workspace-views button{justify-content:flex-start;text-align:left}}

/* Restrained cyber-neon status tiles. Semantic colours stay secondary; the
   selected UV filter uses a separate electric-blue treatment below. */
:root[data-theme="dark"] :is(.dashboard-stat,.uv-work-stat){position:relative;background:#27323e!important;border-color:#47586c!important;box-shadow:inset 0 1px 0 rgba(255,255,255,.035),0 0 7px rgba(105,174,241,.055)!important;transition:border-color .16s ease,box-shadow .16s ease,transform .16s ease,background .16s ease}
:root[data-theme="dark"] :is(.dashboard-stat,.uv-work-stat):is(.warning,.warn){background:linear-gradient(105deg,rgba(224,168,70,.10),rgba(39,50,62,0) 58%),#27323e!important;border-color:#9a793c!important;box-shadow:inset 0 0 0 1px rgba(255,202,100,.045),0 0 7px rgba(224,168,70,.14)!important}
:root[data-theme="dark"] :is(.dashboard-stat,.uv-work-stat).active{background:linear-gradient(105deg,rgba(63,185,139,.09),rgba(39,50,62,0) 58%),#27323e!important;border-color:#4c987b!important;box-shadow:inset 0 0 0 1px rgba(106,224,180,.04),0 0 7px rgba(63,185,139,.13)!important}
:root[data-theme="dark"] :is(.dashboard-stat,.uv-work-stat):is(.critical,.bad){background:linear-gradient(105deg,rgba(232,92,110,.09),rgba(39,50,62,0) 58%),#27323e!important;border-color:#a55261!important;box-shadow:inset 0 0 0 1px rgba(255,132,151,.04),0 0 7px rgba(232,92,110,.14)!important}
:root[data-theme="dark"] :is(.dashboard-stat,.uv-work-stat):is(.warning,.warn) b{color:#f1d28d!important}
:root[data-theme="dark"] :is(.dashboard-stat,.uv-work-stat).active b{color:#9ce0c4!important}
:root[data-theme="dark"] :is(.dashboard-stat,.uv-work-stat):is(.critical,.bad) b{color:#ffabb7!important}
:root[data-theme="dark"] .uv-work-stat.selected{z-index:1;transform:translateY(-2px);background:linear-gradient(110deg,rgba(24,143,255,.34),rgba(18,67,111,.42) 55%,rgba(19,43,66,.78)),#183e61!important;border-color:#47c7ff!important;outline:1px solid rgba(232,249,255,.82)!important;outline-offset:-4px;box-shadow:0 0 0 1px rgba(71,199,255,.42),0 0 13px rgba(0,176,255,.58),0 7px 15px rgba(0,0,0,.26),inset 0 0 19px rgba(36,167,255,.27)!important}
:root[data-theme="dark"] .uv-work-stat.selected::before{content:"";position:absolute;z-index:2;top:-1px;left:12px;right:12px;height:2px;border-radius:999px;background:#d9f7ff;box-shadow:0 0 7px #61d8ff,0 0 14px rgba(42,188,255,.72);pointer-events:none}
:root[data-theme="dark"] .uv-work-stat.selected b{color:#f4fcff!important;text-shadow:0 0 9px rgba(111,218,255,.72)}
:root[data-theme="dark"] .uv-work-stat.selected span{color:#d8f1ff!important}
@media screen and (prefers-reduced-motion:reduce){:root[data-theme="dark"] :is(.dashboard-stat,.uv-work-stat){transition:none}}
