/* ============================================================
   仓库业务工作台 · 设计系统（层次 / 科技感）
   变量化主题：8 套配色 × 侧边/顶部两种布局，切换后同步至全部子程序
   ============================================================ */
* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  /* 表面与文本（浅色专业体系） */
  --bg: #eef1f6; --panel: #ffffff; --line: #e3e8f0; --text: #1b2434; --sub: #66718a;
  --brand: #2b5cd9; --brand-d: #1e46ab; --brand-s: #eaf0fd;
  --red: #d8434e; --amber: #e8820c; --ok: #17a566;
  /* 侧栏：由主色深阶推导的层次渐变（顶部品牌辉光由 ::after 叠加） */
  --side-a: color-mix(in srgb, var(--brand-d) 80%, #060a14);
  --side-b: color-mix(in srgb, var(--brand-d) 58%, #0a1020);
  --side-line: rgba(255,255,255,.09);
  --side-hover: rgba(255,255,255,.07);
  --side-text: #a8b2c6;
  /* 阴影：双层叠加营造层次 */
  --shadow: 0 1px 2px rgba(16,24,40,.05), 0 4px 14px rgba(16,24,40,.06);
  --shadow-lg: 0 4px 10px rgba(16,24,40,.07), 0 14px 36px rgba(16,24,40,.11);
  /* 登录页渐变 */
  --login-a: color-mix(in srgb, var(--brand-d) 88%, #05080f);
  --login-b: var(--brand);
  --radius: 13px;
}
/* ---- 八套配色方案（工作台「主题外观」切换，选择后同步到全部子程序） ---- */
html[data-theme='classic'] { --brand: #2b5cd9; --brand-d: #1e46ab; --brand-s: #eaf0fd; }
html[data-theme='xinhai']  { --brand: #3f6cb4; --brand-d: #2f5490; --brand-s: #ecf2fa; }
html[data-theme='ocean']   { --brand: #0e9488; --brand-d: #0a7368; --brand-s: #e6f6f4; }
html[data-theme='purple']  { --brand: #7c5cff; --brand-d: #6043d6; --brand-s: #f1edff; }
html[data-theme='forest']  { --brand: #128a5e; --brand-d: #0c6a47; --brand-s: #e7f5ef; }
html[data-theme='sunset']  { --brand: #e8720c; --brand-d: #bf5b07; --brand-s: #fdf0e4; }
html[data-theme='tech']    { --brand: #0a9fb8; --brand-d: #07798e; --brand-s: #e3f6fa; }
html[data-theme='ruby']    { --brand: #c0284a; --brand-d: #961d39; --brand-s: #fcecef; }

body { font-family: -apple-system, "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif; background: var(--bg); color: var(--text); font-size: 14px; -webkit-font-smoothing: antialiased; }
.hidden { display: none !important; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 14px; padding: 8px 11px; border: 1px solid var(--line); border-radius: 9px; outline: none; background: #fff; transition: border-color .15s, box-shadow .15s; }
input::placeholder, textarea::placeholder { color: #9aa3b5; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 16%, transparent); }
button.primary, .login-card button, .btn-primary { background: linear-gradient(135deg, var(--brand), var(--brand-d)); color: #fff; border: none; padding: 9px 18px; border-radius: 9px; font-weight: 500; box-shadow: 0 2px 8px color-mix(in srgb, var(--brand) 32%, transparent); transition: filter .15s, transform .15s, box-shadow .15s; }
button.primary:hover { filter: brightness(1.07); transform: translateY(-1px); box-shadow: 0 4px 14px color-mix(in srgb, var(--brand) 38%, transparent); }
button.ghost { background: #fff; border: 1px solid var(--line); padding: 8px 15px; border-radius: 9px; color: var(--text); font-weight: 500; transition: all .15s; }
button.ghost:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-s); }
button.danger { background: #fff; border: 1px solid #f3c2c6; color: var(--red); padding: 8px 15px; border-radius: 9px; font-weight: 500; transition: all .15s; }
button.danger:hover { background: var(--red); color: #fff; border-color: var(--red); }
button.link { background: none; border: none; color: var(--sub); text-decoration: underline; font-size: 12px; }
button.link:hover { color: #fff; }
.msg { color: var(--red); min-height: 18px; font-size: 13px; }

/* ============ 登录（品牌面板 + 表单） ============ */
.login-layer { position: fixed; inset: 0; background:
  radial-gradient(900px 520px at 18% 18%, color-mix(in srgb, var(--login-b) 45%, transparent), transparent 62%),
  radial-gradient(760px 460px at 88% 92%, color-mix(in srgb, var(--login-b) 30%, transparent), transparent 60%),
  linear-gradient(135deg, var(--login-a) 0%, var(--login-b) 135%);
  display: flex; align-items: center; justify-content: center; z-index: 50; padding: 20px; }
.login-shell { display: flex; width: 800px; max-width: 96vw; border-radius: 20px; overflow: hidden; box-shadow: 0 32px 90px rgba(4,10,26,.5), 0 0 0 1px rgba(255,255,255,.08); }
.login-aside { flex: 1.15; position: relative; padding: 46px 38px 34px; color: #fff; display: flex; flex-direction: column; gap: 26px;
  background: linear-gradient(165deg, rgba(255,255,255,.14) 0%, rgba(255,255,255,.03) 55%, transparent 100%), rgba(8,14,30,.22); }
.login-aside::after { content: ''; position: absolute; right: -60px; bottom: -80px; width: 240px; height: 240px; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--login-b) 55%, transparent), transparent 68%); pointer-events: none; }
.login-aside-logo { width: 158px; height: auto; filter: drop-shadow(0 6px 18px rgba(0,0,0,.4)); position: relative; z-index: 1; }
.login-aside-txt { position: relative; z-index: 1; }
.login-aside-txt b { display: block; font-size: 22px; font-weight: 700; letter-spacing: 1.5px; }
.login-aside-txt i { display: block; font-style: normal; font-size: 12.5px; letter-spacing: .5px; color: rgba(255,255,255,.72); margin-top: 8px; }
.login-aside-points { list-style: none; margin-top: auto; display: flex; flex-direction: column; gap: 13px; position: relative; z-index: 1; }
.login-aside-points li { font-size: 12.5px; color: rgba(255,255,255,.82); padding-left: 20px; position: relative; letter-spacing: .3px; }
.login-aside-points li::before { content: ''; position: absolute; left: 0; top: 5px; width: 7px; height: 7px; border-radius: 2px; background: #fff; box-shadow: 0 0 10px rgba(255,255,255,.9); }
.login-card { width: 392px; flex: none; background: #fff; padding: 44px 38px 36px; display: flex; flex-direction: column; }
.login-logo { width: 128px; display: block; margin: 0 auto 12px; border-radius: 9px; }
.login-card h1 { font-size: 20px; text-align: center; letter-spacing: .5px; }
.login-sub { text-align: center; color: var(--sub); margin: 7px 0 22px; font-size: 12px; letter-spacing: .3px; }
.login-card input { width: 100%; margin-bottom: 13px; padding: 10px 12px; }
.login-card button { width: 100%; padding: 11px; font-size: 15px; margin-top: 4px; }
.login-tip { text-align: center; color: var(--sub); font-size: 12px; margin-top: 16px; }
@media (max-width: 880px) { .login-aside { display: none; } .login-shell { width: 420px; } }

/* ============ 布局：侧边栏（深色层次渐变 + 品牌辉光） ============ */
.app { display: flex; height: 100vh; }
.sidebar { width: 222px; position: relative; background: linear-gradient(168deg, var(--side-a) 0%, var(--side-b) 100%); color: var(--side-text); display: flex; flex-direction: column; flex: none; }
.sidebar::after { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 190px; pointer-events: none;
  background: radial-gradient(420px 130px at 26% 0%, color-mix(in srgb, var(--brand) 42%, transparent), transparent 72%); }
/* 品牌区：透明底白字 LOGO + 平台名 */
.brand { padding: 14px 16px 12px; border-bottom: 1px solid var(--side-line); display: flex; flex-direction: column; align-items: center; gap: 7px; text-align: center; position: relative; z-index: 1; }
.brand-logo { width: 100px; height: auto; flex: none; filter: drop-shadow(0 3px 10px rgba(0,0,0,.4)); }
.brand-txt b { display: block; color: #fff; font-size: 15px; font-weight: 700; letter-spacing: 1.5px; }
.sidebar nav { flex: 1; overflow-y: auto; padding: 10px 10px 14px; position: relative; z-index: 1; }
.sidebar nav::-webkit-scrollbar { width: 4px; }
.sidebar nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.16); border-radius: 2px; }
.nav-group { margin-bottom: 4px; }
.nav-label { font-size: 10.5px; color: rgba(255,255,255,.36); padding: 13px 10px 6px; letter-spacing: 2px; font-weight: 500; }
.sidebar nav a { display: flex; align-items: center; gap: 10px; padding: 9px 11px; color: var(--side-text); text-decoration: none; border-radius: 9px; cursor: pointer; font-size: 13.5px; margin-bottom: 2px; transition: background .13s, color .13s; position: relative; }
.sidebar nav a:hover { background: var(--side-hover); color: #eef1f8; }
.sidebar nav a.active { background: linear-gradient(90deg, var(--brand), color-mix(in srgb, var(--brand) 58%, #fff)); color: #fff; font-weight: 500; box-shadow: 0 4px 14px color-mix(in srgb, var(--brand) 42%, transparent); }
.sidebar nav a.active::before { content: ''; position: absolute; left: -10px; top: 22%; height: 56%; width: 3px; border-radius: 2px; background: #fff; box-shadow: 0 0 9px rgba(255,255,255,.95); }
.nav-ico { width: 17px; height: 17px; flex: none; opacity: .92; }
.nav-ico svg { width: 100%; height: 100%; display: block; }
.side-foot { padding: 12px 14px; border-top: 1px solid var(--side-line); font-size: 12px; position: relative; z-index: 1; }
.side-user-chip { color: #dfe4ee; margin-bottom: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-user-chip span { cursor: pointer; border-bottom: 1px dashed rgba(255,255,255,.28); }
.side-user-chip span:hover { color: #fff; }
.side-foot button.link { margin-right: 10px; color: rgba(255,255,255,.55); }
.side-foot button.link:hover { color: #fff; }

/* ============ 布局：主区（顶栏玻璃质感 + 内容区层次光晕） ============ */
.main { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-width: 0; }
.topbar { height: 56px; position: relative; background: rgba(255,255,255,.88); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); display: flex; align-items: center; padding: 0 22px; flex: none; }
.topbar::after { content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--brand) 50%, transparent) 25%, color-mix(in srgb, var(--brand) 50%, transparent) 75%, transparent); }
.top-left { display: flex; align-items: baseline; gap: 12px; min-width: 0; }
.topbar #page-title { font-size: 16.5px; font-weight: 700; letter-spacing: .3px; }
.top-hint { color: var(--sub); font-size: 12.5px; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 14px; }
/* 双语语言切换 */
.lang-switch { display: inline-flex; align-items: center; gap: 2px; font-size: 13px; user-select: none; }
.lang-switch .lang-opt { cursor: pointer; padding: 4px 7px; border-radius: 6px; color: var(--text-2); transition: all .15s; }
.lang-switch .lang-opt:hover { background: var(--bg-2); color: var(--text); }
.lang-switch .lang-opt.active { color: #fff; background: var(--primary); font-weight: 600; }
.lang-switch .lang-sep { color: var(--line); }
.top-date { color: var(--sub); font-size: 12.5px; }
.theme-btn { margin-left: 0; padding: 6px 13px; font-size: 13px; font-weight: 400; }
.content { flex: 1; overflow-y: auto; padding: 22px; background:
  radial-gradient(1100px 380px at 88% -12%, color-mix(in srgb, var(--brand) 7%, transparent), transparent 62%),
  radial-gradient(860px 300px at -12% 108%, color-mix(in srgb, var(--brand) 5%, transparent), transparent 58%); }
.content::-webkit-scrollbar { width: 8px; }
.content::-webkit-scrollbar-thumb { background: #ccd3de; border-radius: 4px; }
.content::-webkit-scrollbar-thumb:hover { background: #b6bfcd; }

/* ---- 顶部导航布局模式 ---- */
body[data-layout='top'] .app { flex-direction: column; }
body[data-layout='top'] .sidebar { width: 100%; flex-direction: row; align-items: center; }
body[data-layout='top'] .sidebar::after { height: 100%; width: 340px; background: radial-gradient(340px 90px at 20% 0%, color-mix(in srgb, var(--brand) 40%, transparent), transparent 72%); }
body[data-layout='top'] .brand { padding: 10px 14px; border-bottom: none; border-right: 1px solid var(--side-line); white-space: nowrap; }
body[data-layout='top'] .brand-logo { width: 96px; }
body[data-layout='top'] .brand-txt i { display: none; }
body[data-layout='top'] .sidebar nav { display: flex; overflow-x: auto; padding: 0 8px; }
body[data-layout='top'] .nav-group { display: flex; align-items: center; margin: 0; }
body[data-layout='top'] .nav-label { display: none; }
body[data-layout='top'] .sidebar nav a { padding: 17px 13px; border-radius: 0; white-space: nowrap; }
body[data-layout='top'] .sidebar nav a.active { background: transparent; box-shadow: inset 0 -3px 0 var(--brand); }
body[data-layout='top'] .sidebar nav a.active::before { display: none; }
body[data-layout='top'] .side-foot { border-top: none; border-left: 1px solid var(--side-line); margin-left: auto; padding: 6px 16px; white-space: nowrap; }

/* ---- 导航栏折叠（2026-11-18）：收起侧栏让内容区 / 子程序 iframe 全宽 ----
   属基础布局样式，必须留在 style.css；不得混进服务端注入的 #cwp-theme-vars
   （换主题整体替换）或 #cwp-theme-extra，否则折叠会被主题刷新抹掉。 */
.nav-toggle { align-self: center; flex: none; width: 30px; height: 30px; border: 1px solid var(--line);
  border-radius: 8px; background: rgba(255,255,255,.72); color: var(--text-2); cursor: pointer;
  font-size: 16px; line-height: 1; display: inline-flex; align-items: center; justify-content: center;
  transition: background .13s, border-color .13s, color .13s; }
.nav-toggle:hover { background: var(--brand-s); border-color: var(--brand); color: var(--brand); }
.brand .nav-collapse { position: absolute; top: 9px; right: 9px; z-index: 2; width: 24px; height: 24px;
  border: 1px solid rgba(255,255,255,.24); border-radius: 6px; background: rgba(255,255,255,.09);
  color: rgba(255,255,255,.75); cursor: pointer; font-size: 14px; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center; transition: all .13s; }
.brand .nav-collapse:hover { background: rgba(255,255,255,.2); color: #fff; border-color: rgba(255,255,255,.45); }
.sidebar { transition: width .18s ease, height .18s ease; }
body.nav-collapsed .sidebar { width: 0 !important; min-width: 0; overflow: hidden; }
body.nav-collapsed .sidebar nav,
body.nav-collapsed .sidebar .brand,
body.nav-collapsed .sidebar .side-foot { opacity: 0; pointer-events: none; }
body[data-layout='top'].nav-collapsed .sidebar { width: 100% !important; height: 0; min-height: 0; overflow: hidden; }

/* ---- 主题外观面板 ---- */
.theme-label { font-size: 12px; color: var(--sub); margin: 14px 0 8px; }
.theme-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.theme-item { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border: 1px solid var(--line); background: #fff; border-radius: 9px; font-size: 13px; transition: all .13s; }
.theme-item:hover { border-color: var(--brand); }
.theme-item .sw { width: 18px; height: 18px; border-radius: 5px; display: inline-block; flex: none; box-shadow: inset 0 0 0 1px rgba(0,0,0,.06); }
.theme-item.active { border-color: var(--brand); color: var(--brand); background: var(--brand-s); font-weight: 600; box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 12%, transparent); }

/* ---- 子应用嵌入页（原版程序，iframe 铺满内容区） ---- */
.content.embed { padding: 0; overflow: hidden; }
.embed-wrap { height: 100%; background: #fff; overflow: hidden; }
.embed-wrap iframe { width: 100%; height: 100%; border: 0; display: block; }
/* 平台仪表盘内嵌：进销存仪表盘（自动高度，由子页面 postMessage 驱动） */
.inv-dash-frame { width: 100%; height: 620px; border: 0; display: block; background: var(--bg); border-radius: 10px; transition: height .18s ease; }

/* KPI 指标卡 */
.cards.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(172px, 1fr)); gap: 13px; margin-bottom: 18px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 15px 16px; box-shadow: var(--shadow); transition: box-shadow .15s, transform .15s; }
.card:hover { box-shadow: var(--shadow-lg); }
.card .num { font-size: 25px; font-weight: 700; letter-spacing: .3px; font-variant-numeric: tabular-nums; }
.card .lbl { color: var(--sub); margin-top: 3px; font-size: 12.5px; }
.card.warn { border-color: #f5d8a8; background: #fffbf3; }
.card.warn .num { color: var(--amber); }
.kpi { display: flex; align-items: center; gap: 12px; }
.kpi-ico { width: 42px; height: 42px; border-radius: 11px; background: linear-gradient(135deg, var(--brand), color-mix(in srgb, var(--brand) 62%, #fff)); color: #fff; display: flex; align-items: center; justify-content: center; flex: none; box-shadow: 0 4px 12px color-mix(in srgb, var(--brand) 30%, transparent); }
.kpi-ico svg { width: 20px; height: 20px; }
.kpi .num { font-size: 21px; }
.kpi.warn .kpi-ico { background: linear-gradient(135deg, #f2a93b, var(--amber)); box-shadow: 0 4px 12px rgba(232,130,12,.28); }

/* 快捷入口 */
.quick-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(196px, 1fr)); gap: 13px; margin-bottom: 18px; }
.quick { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 13px 14px; display: flex; align-items: center; gap: 12px; cursor: pointer; box-shadow: var(--shadow); transition: transform .14s, border-color .14s, box-shadow .14s; position: relative; overflow: hidden; }
.quick::after { content: ''; position: absolute; inset: 0 0 auto 0; height: 2px; background: linear-gradient(90deg, var(--brand), transparent); opacity: 0; transition: opacity .14s; }
.quick:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--brand) 45%, #fff); box-shadow: var(--shadow-lg); }
.quick:hover::after { opacity: 1; }
.quick b { display: block; font-size: 13.5px; }
.quick i { display: block; font-style: normal; color: var(--sub); font-size: 11.5px; margin-top: 2px; }
.q-ico { width: 37px; height: 37px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex: none; color: #fff; box-shadow: 0 4px 10px rgba(16,24,40,.18); }
.q-ico svg { width: 18px; height: 18px; }
.q-ico.in { background: linear-gradient(135deg, #3b6ef5, #2451c8); } .q-ico.out { background: linear-gradient(135deg, #f2a93b, #e8820c); } .q-ico.ship { background: linear-gradient(135deg, #2fbf83, #17a566); }
.q-ico.cap { background: linear-gradient(135deg, #9d7cff, #7c5cff); } .q-ico.wf { background: linear-gradient(135deg, #14b3a6, #0e9488); }
.q-ico.inv { background: linear-gradient(135deg, var(--brand), var(--brand-d)); }
.q-ico.sys { background: linear-gradient(135deg, #64748b, #475569); }

/* 图表区 */
.grid2 { display: grid; grid-template-columns: 1.5fr 1fr; gap: 14px; margin-bottom: 14px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1.2fr; gap: 14px; margin-bottom: 14px; }
@media (max-width: 1100px) { .grid2, .grid3 { grid-template-columns: 1fr; } }
.chart { width: 100%; height: auto; display: block; }
.chart .grid { stroke: #e6eaf2; stroke-width: 1; }
.chart .ax { font-size: 10px; fill: #8a93a6; }
.chart .bar { fill: var(--brand); transition: fill .13s; }
.chart .bar:hover { fill: var(--brand-d); }
.donut-wrap { display: flex; align-items: center; gap: 18px; padding: 6px 2px; }
.donut { width: 150px; flex: none; }
.donut-num { font-size: 22px; font-weight: 700; fill: var(--text); }
.legend { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.lg-item { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.lg-item b { margin-left: 2px; }
.lg-item i { font-style: normal; color: var(--sub); font-size: 11.5px; margin-left: auto; }
.lg-sw { width: 11px; height: 11px; border-radius: 3px; flex: none; }
.hbars { display: flex; flex-direction: column; gap: 12px; padding: 4px 0; }
.hbar { display: flex; align-items: center; gap: 10px; }
.hbar-l { width: 92px; font-size: 12.5px; color: var(--sub); flex: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-t { flex: 1; height: 12px; background: #eef1f6; border-radius: 6px; overflow: hidden; box-shadow: inset 0 1px 2px rgba(16,24,40,.06); }
.hbar-t i { display: block; height: 100%; border-radius: 6px; }
.hbar-t i.brand { background: linear-gradient(90deg, var(--brand), color-mix(in srgb, var(--brand) 55%, #fff)); }
.hbar-t i.amber { background: linear-gradient(90deg, #f2a93b, #e8820c); }
.hbar-t i.ok { background: linear-gradient(90deg, #2fbf83, #17a566); }
.hbar-t i.gray { background: #c4cad4; }
.spark { display: flex; align-items: flex-end; gap: 8px; height: 96px; padding: 4px 2px 0; }
.spark-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 6px; }
.spark-bar { width: 70%; max-width: 26px; background: linear-gradient(180deg, var(--brand), color-mix(in srgb, var(--brand) 55%, #fff)); border-radius: 5px 5px 2px 2px; }
.spark-col span { font-size: 10.5px; color: var(--sub); }
table.tight td { padding: 6px 8px; border-bottom: 1px dashed var(--line); font-size: 12.5px; }
.num-cell { font-weight: 600; }
.num-cell.red { color: var(--red); }

/* 面板/表格 */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 16px; box-shadow: var(--shadow); }
.panel h3 { font-size: 14.5px; margin-bottom: 14px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.panel h3::before { content: ''; width: 3px; height: 15px; border-radius: 2px; background: linear-gradient(180deg, var(--brand), color-mix(in srgb, var(--brand) 50%, #fff)); display: inline-block; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.toolbar .spacer { flex: 1; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: left; }
th { background: linear-gradient(180deg, #fbfcfe, #f5f7fb); color: var(--sub); font-weight: 600; position: sticky; top: 0; font-size: 12.5px; white-space: nowrap; box-shadow: inset 0 -1px 0 var(--line); }
tr:hover td { background: color-mix(in srgb, var(--brand-s) 55%, #fff); }
.tag { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 12px; background: #eef2f7; color: #4a5568; }
.tag.low { background: #fdeceb; color: var(--red); }
.tag.ship-wait { background: #fff4e5; color: var(--amber); }
.tag.ship-done { background: #e7f7ee; color: var(--ok); }
.tag.ship-cancel { background: #eef2f7; color: var(--sub); }
.tag.ok-tag { background: #e7f7ee; color: var(--ok); }
.tag.warn-tag { background: #fff4e5; color: var(--amber); }
.row-actions button { margin-right: 6px; padding: 4px 10px; font-size: 12px; }

/* 表单/模态 */
.modal { position: fixed; inset: 0; background: rgba(10,16,32,.48); display: flex; align-items: center; justify-content: center; z-index: 40; backdrop-filter: blur(3px); }
.modal-box { background: #fff; border-radius: 16px; padding: 24px; width: 720px; max-width: 94vw; max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow-lg), 0 24px 60px rgba(6,12,30,.22); }
.modal-box h3 { margin-bottom: 14px; }
.form-row { display: flex; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.form-row label { display: block; font-size: 12px; color: var(--sub); margin-bottom: 4px; }
.form-row > div { flex: 1; min-width: 140px; }
.form-row input, .form-row select, .form-row textarea { width: 100%; }
.item-table input { width: 100%; padding: 5px 7px; }
.item-table td { padding: 4px 6px; }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; }

/* 细粒度权限授权矩阵（用户管理） */
.perm-matrix { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.perm-group + .perm-group { border-top: 1px solid var(--line); }
.perm-group-head { display: flex; align-items: center; padding: 8px 12px; background: var(--bg); }
.perm-group-head .perm-all { display: flex; align-items: center; gap: 6px; cursor: pointer; font-size: 13px; }
.perm-items { display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 10px 12px 12px 30px; }
.perm-item { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--sub); cursor: pointer; min-width: 240px; }
.perm-item input, .perm-group-head input { cursor: pointer; }

/* 多角色选择（用户编辑弹窗） */
.role-checks { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 2px; }
.role-check { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border: 1px solid var(--line); border-radius: 999px; cursor: pointer; font-size: 13px; color: var(--sub); background: #fff; transition: all .14s; user-select: none; }
.role-check:hover { border-color: var(--accent); }
.role-check input { cursor: pointer; }
.role-check:has(input:checked) { border-color: var(--accent); color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, #fff); font-weight: 600; }
.role-check.admin-role { background: #fff5f0; border-color: #ffd7c2; color: #c0392b; }
.role-check.admin-role:has(input:checked) { background: #ffe9dd; }

/* 角色权限管理弹窗 */
.role-edit-block { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px 6px; margin-bottom: 14px; background: #fff; }
.role-edit-block h4 { margin: 0 0 8px; display: flex; align-items: center; gap: 8px; }
/* 角色权限管理：选一种角色调一种（标签式，不堆叠全部） */
.role-mgr-wrap { display: flex; flex-direction: column; gap: 12px; }
.role-tabs { display: flex; flex-wrap: wrap; gap: 8px; padding-bottom: 4px; border-bottom: 1px solid var(--line); }
.role-tab { padding: 8px 16px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--sub); font-size: 13px; cursor: pointer; transition: all .14s; user-select: none; }
.role-tab:hover { border-color: var(--accent); color: var(--accent); }
.role-tab.active { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.role-mgr-body { min-height: 120px; }

.toast { position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%); background: #1c2333; color: #fff; padding: 10px 20px; border-radius: 10px; z-index: 60; box-shadow: 0 10px 30px rgba(0,0,0,.32); font-size: 13.5px; }
.toast.ok { background: var(--ok); }
.toast.err { background: var(--red); }

.muted { color: var(--sub); }
.hint-box { background: var(--brand-s); border: 1px solid color-mix(in srgb, var(--brand) 24%, #fff); color: var(--brand-d); padding: 12px 14px; border-radius: 10px; font-size: 13px; line-height: 1.7; }
.print-area { padding: 20px; }
.print-area h2 { text-align: center; margin-bottom: 14px; }
.print-area table { margin-top: 12px; }
@media print { .sidebar, .topbar, .toolbar, #modal .modal-foot { display: none !important; } .modal-box { width: 100%; box-shadow: none; } .print-area thead { display: table-header-group; } .print-area tr { break-inside: avoid; page-break-inside: avoid; } }
.print-rule { font-size: 12px; font-weight: 700; color: #1d4fb8; background: #eef4ff; border-left: 4px solid #2f6fed; padding: 4px 9px; margin: 0 0 10px; }

/* 木架测算 / 装柜预排 布局（平台内页面元素） */
.cols2 { display: flex; gap: 16px; flex-wrap: wrap; align-items: flex-start; }
.cols2 > .col { flex: 1; min-width: 340px; }
.viewport { width: 100%; height: 440px; border-radius: 12px; overflow: hidden; background: #05071f; position: relative; border: 1px solid #11163a; }
.viewport canvas { width: 100%; height: 100%; display: block; }
.mini { font-size: 12px; color: var(--sub); }
.tagrow { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.kv { display: flex; gap: 8px; flex-wrap: wrap; }
.kv span { background: #f3f5f8; border: 1px solid var(--line); border-radius: 6px; padding: 4px 10px; font-size: 13px; }
.seq-list { max-height: 320px; overflow-y: auto; }
.seq-list .seq { display: flex; gap: 10px; padding: 5px 8px; border-bottom: 1px solid var(--line); align-items: center; }
.seq-list .seq b { width: 34px; text-align: center; background: linear-gradient(135deg, var(--brand), var(--brand-d)); color: #fff; border-radius: 5px; padding: 1px 0; }
.big-util { font-size: 22px; font-weight: 700; }
.i-code { font-variant-numeric: tabular-nums; }
.i-price { text-align: right; font-variant-numeric: tabular-nums; }
.i-qty { text-align: right; }
