/* ============ 基础 ============ */
:root {
  --bg: #f4f6fb;
  --surface: #ffffff;
  --surface-2: #f8fafd;
  --surface-3: #eef3fa;
  --ink: #15233b;
  --ink-2: #55657f;
  --ink-3: #8794a9;
  --line: #e4e9f2;
  --line-strong: #d2dae8;
  --brand: #2f5fe0;
  --brand-dark: #1d45b5;
  --brand-soft: #eaf0ff;
  --teal: #0b9c9a;
  --ok: #0d9868;
  --ok-soft: #e6f7ef;
  --warn: #c2760a;
  --warn-soft: #fdf2df;
  --bad: #d1294a;
  --bad-soft: #fdebed;
  --violet: #6f4de0;
  --violet-soft: #f0ecff;
  --orange: #d9660b;
  --orange-soft: #fdf0e4;
  --info: #2265d8;
  --info-soft: #eaf1ff;
  --shadow-sm: 0 1px 2px rgba(20, 35, 60, .05);
  --shadow: 0 10px 32px rgba(20, 35, 60, .08);
  --shadow-lg: 0 24px 64px rgba(13, 27, 47, .18);
  --r-sm: 9px;
  --r: 14px;
  --r-lg: 20px;
  --sidebar-w: 242px;
  --font: "Segoe UI", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, -apple-system, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
h1, h2, h3, h4, p { margin: 0; }
ul, ol { margin: 0; padding: 0; }
::selection { background: #c9d8ff; }

/* ============ 应用框架 ============ */
.app-shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; }
.main { min-width: 0; display: flex; flex-direction: column; }
.page { width: 100%; max-width: 1500px; margin: 0 auto; padding: 26px 30px 56px; flex: 1; }

.sidebar {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
  background:
    radial-gradient(1000px 500px at -10% -10%, rgba(66, 116, 255, .26), transparent 60%),
    linear-gradient(170deg, #0e1d33 0%, #0b1729 60%, #091322 100%);
  color: #c5d1e4; padding: 22px 16px 16px; z-index: 40; overflow-y: auto;
}
.sidebar::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .22;
  background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 34px 34px; mask-image: linear-gradient(180deg, #000, transparent 70%);
}
.brand { display: flex; align-items: center; gap: 11px; padding: 2px 6px 20px; position: relative; z-index: 1; }
.brand-mark {
  width: 46px; height: 46px; border-radius: 0; flex: 0 0 auto;
  display: grid; place-items: center; color: #fff; background: #fff; padding: 0;
  box-shadow: 0 6px 18px rgba(160, 20, 35, .28), inset 0 0 0 1px rgba(255, 255, 255, .7);
}
.brand-mark img { width: 100%; height: 100%; object-fit: contain; border-radius: 0; display: block; }
.brand-text { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.brand-text strong { font-size: 17px; letter-spacing: .12em; color: #fff; font-weight: 700; }
.brand-text span { font-size: 10.5px; color: #8497b5; letter-spacing: .02em; white-space: nowrap; }

.nav { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 3px; }
.nav-group { font-size: 10.5px; letter-spacing: .12em; color: #627594; padding: 16px 12px 7px; text-transform: uppercase; }
.nav-group:first-child { padding-top: 4px; }
.nav-item {
  display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 10px;
  color: #a9b8ce; font-size: 13.5px; position: relative; transition: background .15s, color .15s;
}
.nav-item svg { width: 18px; height: 18px; opacity: .9; flex: 0 0 auto; }
.nav-item:hover { background: rgba(255,255,255,.06); color: #e7eefb; }
.nav-item.active { background: linear-gradient(90deg, rgba(66, 112, 245, .3), rgba(66, 112, 245, .12)); color: #fff; font-weight: 600; }
.nav-item.active::before { content: ""; position: absolute; left: -16px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: #5d8bff; }
.nav-count {
  margin-left: auto; font-style: normal; font-size: 11px; min-width: 20px; height: 19px; padding: 0 6px;
  border-radius: 20px; display: grid; place-items: center; background: rgba(255,255,255,.1); color: #d5e0f0;
}
.nav-count.accent { background: #e04a5f; color: #fff; }
.nav-count:empty { display: none; }

.sidebar-rule {
  position: relative; z-index: 1; margin-top: auto; padding: 13px 13px 12px;
  border: 1px solid rgba(120, 155, 210, .18); border-radius: 12px;
  background: rgba(68, 102, 155, .13); backdrop-filter: blur(4px);
}
.sidebar-rule-title { display: flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 600; color: #dce6f5; margin-bottom: 7px; }
.sidebar-rule-title svg { width: 15px; height: 15px; color: #7fa2ff; }
.sidebar-rule p { font-size: 11px; line-height: 1.65; color: #8b9db8; }
.sidebar-foot { position: relative; z-index: 1; font-size: 10px; color: #566882; padding: 14px 6px 0; letter-spacing: .03em; }
.sidebar-scrim { display: none; position: fixed; inset: 0; background: rgba(9, 18, 32, .46); z-index: 35; backdrop-filter: blur(1px); }
.sidebar-scrim.show { display: block; }

/* ============ 顶栏 ============ */
.topbar {
  height: 64px; flex: 0 0 64px; display: flex; align-items: center; gap: 12px;
  padding: 0 28px; background: rgba(255,255,255,.86); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30;
}
.crumb { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--ink-2); }
.crumb strong { color: var(--ink); font-weight: 600; }
.crumb .sep { color: var(--ink-3); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 7px; }
.icon-btn {
  width: 36px; height: 36px; border-radius: 10px; border: 1px solid transparent; background: transparent;
  display: grid; place-items: center; color: var(--ink-2); position: relative; transition: .15s;
}
.icon-btn svg { width: 19px; height: 19px; }
.icon-btn:hover { background: var(--surface-3); color: var(--ink); }
.notif-btn i {
  position: absolute; top: 7px; right: 8px; width: 7px; height: 7px; border-radius: 50%;
  background: #e04a5f; border: 1.5px solid #fff; display: none;
}
.notif-btn i.on { display: block; }
.menu-btn { display: none; }
.role-switch { display: flex; align-items: center; gap: 9px; margin-left: 8px; padding-left: 14px; border-left: 1px solid var(--line); }
.avatar {
  width: 35px; height: 35px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(145deg, #e8efff, #cfdcff); color: #2447a8; font-size: 13px; font-weight: 700;
  border: 1px solid #c8d6f8;
}
.role-select-wrap { display: flex; flex-direction: column; line-height: 1.15; }
.role-select-wrap label { font-size: 9.5px; color: var(--ink-3); letter-spacing: .06em; padding-left: 2px; }
.role-select-wrap select {
  appearance: none; border: none; background: transparent; font-size: 12.5px; font-weight: 600;
  padding: 1px 20px 1px 0; cursor: pointer; color: var(--ink);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238794a9' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 2px center;
}
.role-select-wrap select:focus { outline: none; }

/* ============ 页头 / 通用 ============ */
.page-head { display: flex; align-items: flex-start; gap: 18px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head .head-main { min-width: 0; flex: 1; }
.page-title { font-size: 23px; font-weight: 700; letter-spacing: -.015em; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.page-sub { color: var(--ink-2); font-size: 12.5px; margin-top: 5px; }
.page-actions { display: flex; gap: 9px; align-items: center; flex-wrap: wrap; }
.back-link { display: inline-flex; align-items: center; gap: 5px; color: var(--ink-2); font-size: 12px; margin-bottom: 9px; }
.back-link svg { width: 15px; height: 15px; }
.back-link:hover { color: var(--brand); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-sm); }
.card-head { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.card-head h3 { font-size: 14px; font-weight: 650; }
.card-head .sub { font-size: 11.5px; color: var(--ink-3); }
.card-head .head-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.card-body { padding: 20px; }
.card-body.tight { padding: 14px 20px; }
.muted { color: var(--ink-3); }
.small { font-size: 12px; }
.tiny { font-size: 11px; }
.mono { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }
.flex { display: flex; align-items: center; gap: 8px; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.divider { height: 1px; background: var(--line); border: 0; margin: 0; }

/* ============ 按钮 ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 36px; padding: 0 15px; border-radius: 9px; border: 1px solid var(--line-strong);
  background: #fff; color: var(--ink); font-size: 12.5px; font-weight: 550; white-space: nowrap;
  transition: transform .06s, background .15s, border-color .15s, box-shadow .15s;
}
.btn svg { width: 15px; height: 15px; }
.btn:hover { background: var(--surface-2); border-color: #c2ccdd; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn-primary { background: linear-gradient(160deg, #3a6bf0, #2b55cf); border-color: #2b55cf; color: #fff; box-shadow: 0 5px 14px rgba(47,95,224,.22); }
.btn-primary:hover { background: linear-gradient(160deg, #4776f5, #244cc2); border-color: #244cc2; }
.btn-ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn-ok:hover { background: #0b865b; border-color: #0b865b; }
.btn-danger { background: #fff; border-color: #f0c3cc; color: var(--bad); }
.btn-danger:hover { background: #fff5f6; border-color: #e7a7b4; }
.btn-ghost { border-color: transparent; background: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--surface-3); color: var(--ink); }
.btn-soft { background: var(--brand-soft); border-color: #d5e1ff; color: var(--brand-dark); }
.btn-soft:hover { background: #dfe9ff; border-color: #bed0ff; }
.btn-sm { height: 30px; padding: 0 10px; font-size: 11.5px; border-radius: 7px; gap: 5px; }
.btn-sm svg { width: 13px; height: 13px; }
.btn-lg { height: 42px; padding: 0 20px; font-size: 13.5px; border-radius: 10px; }
.btn-block { width: 100%; }
.btn-link { background: none; border: 0; padding: 0; color: var(--brand); font-size: 12px; font-weight: 550; }
.btn-link:hover { text-decoration: underline; }

/* ============ 徽标 / 状态 ============ */
.pill {
  display: inline-flex; align-items: center; gap: 5px; height: 23px; padding: 0 9px;
  border-radius: 20px; font-size: 11px; font-weight: 600; white-space: nowrap;
  border: 1px solid transparent;
}
.pill::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .85; }
.pill.no-dot::before { display: none; }
.tone-muted { background: #f0f2f6; color: #6d7a90; }
.tone-warn { background: var(--warn-soft); color: var(--warn); }
.tone-violet { background: var(--violet-soft); color: var(--violet); }
.tone-orange { background: var(--orange-soft); color: var(--orange); }
.tone-ok { background: var(--ok-soft); color: var(--ok); }
.tone-bad { background: var(--bad-soft); color: var(--bad); }
.tone-info { background: var(--info-soft); color: var(--info); }
.tag { display: inline-flex; align-items: center; height: 21px; padding: 0 8px; border-radius: 6px; background: var(--surface-3); color: var(--ink-2); font-size: 10.5px; font-weight: 550; white-space: nowrap; flex-shrink: 0; }
.tag.blue { background: var(--brand-soft); color: var(--brand-dark); }

/* ============ KPI ============ */
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px 15px;
  position: relative; overflow: hidden; box-shadow: var(--shadow-sm);
}
.kpi-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--ink-2); font-size: 12px; }
.kpi-icon { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); }
.kpi-icon svg { width: 16px; height: 16px; }
.kpi-value { font-size: 26px; font-weight: 700; letter-spacing: -.02em; margin-top: 9px; line-height: 1.15; font-variant-numeric: tabular-nums; }
.kpi-value .unit { font-size: 13px; font-weight: 500; color: var(--ink-3); margin-left: 3px; letter-spacing: 0; }
.kpi-foot { margin-top: 7px; font-size: 11px; color: var(--ink-3); display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.kpi-foot .up { color: var(--ok); font-weight: 600; }
.kpi-foot .down { color: var(--bad); font-weight: 600; }

/* ============ 表格 ============ */
.table-wrap { width: 100%; overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 12.5px; }
table.data th {
  text-align: left; font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--ink-3); font-weight: 600; padding: 10px 14px; background: var(--surface-2);
  border-bottom: 1px solid var(--line); white-space: nowrap;
}
table.data th:first-child { padding-left: 20px; }
table.data th:last-child { padding-right: 20px; }
table.data td { padding: 12px 14px; border-bottom: 1px solid #eef1f7; vertical-align: middle; }
table.data td:first-child { padding-left: 20px; }
table.data td:last-child { padding-right: 20px; }
table.data tbody tr { transition: background .12s; }
table.data tbody tr:hover { background: #fafbfe; }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data .primary-cell { font-weight: 600; color: var(--ink); }
table.data .sub-cell { font-size: 10.5px; color: var(--ink-3); margin-top: 2px; }
table.data .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.data .actions { text-align: right; white-space: nowrap; }
table.data .actions .btn + .btn { margin-left: 5px; }
.table-link { color: var(--ink); font-weight: 600; }
.table-link:hover { color: var(--brand); }
.margin-pos { color: var(--ok); font-weight: 650; }
.margin-neg { color: var(--bad); font-weight: 650; }

/* ============ 表单 ============ */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label { font-size: 11.5px; font-weight: 600; color: var(--ink-2); display: flex; align-items: center; gap: 5px; }
.field > label .req { color: var(--bad); }
.field .hint { font-size: 10.5px; color: var(--ink-3); }
.input, .select, .textarea {
  width: 100%; height: 38px; border: 1px solid var(--line-strong); border-radius: 9px;
  background: #fff; padding: 0 11px; font-size: 13px; color: var(--ink); transition: .15s;
}
.textarea { height: auto; min-height: 70px; padding: 9px 11px; resize: vertical; line-height: 1.6; }
.input:hover, .select:hover, .textarea:hover { border-color: #bcc8db; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(47,95,224,.11); }
.input::placeholder, .textarea::placeholder { color: #a8b3c4; }
.input.error, .select.error { border-color: #e7a7b4; background: #fffafb; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238794a9' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 11px center; padding-right: 30px; cursor: pointer; }
.input-group { display: flex; align-items: stretch; }
.input-group .input { border-radius: 9px 0 0 9px; }
.input-group .unit { display: grid; place-items: center; padding: 0 11px; border: 1px solid var(--line-strong); border-left: 0; border-radius: 0 9px 9px 0; background: var(--surface-2); color: var(--ink-3); font-size: 11.5px; white-space: nowrap; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.form-grid .span-2 { grid-column: span 2; }
.form-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; }

/* 产品经理：只保留基础设置入口 */
body.role-pm .nav-item:not([data-nav="settings"]),
body.role-pm .nav-group { display: none; }
body.role-production .nav-item:not([data-nav="orders"]),
body.role-production .nav-group { display: none; }
body.role-assistant .nav-item:not([data-nav="dashboard"]):not([data-nav="applications"]):not([data-nav="orders"]),
body.role-assistant .nav-group { display: none; }
body.role-tech .nav-item:not([data-nav="dashboard"]):not([data-nav="applications"]):not([data-nav="orders"]),
body.role-tech .nav-group { display: none; }

/* 产品明细 */
.product-list { display: flex; flex-direction: column; gap: 10px; }
.product-line {
  border: 1px solid var(--line); border-radius: 11px; padding: 12px 14px;
  background: #fff; transition: border-color .15s, background .15s;
}
.product-line:hover { border-color: #c8d6ef; background: #fcfdff; }
.line-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.line-title { font-size: 13px; font-weight: 650; }
.line-actions { margin-left: auto; display: flex; gap: 2px; }
.line-spec { font-size: 11px; color: var(--ink-2); margin-top: 5px; line-height: 1.55; }
.line-bottom { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 9px; padding-top: 8px; border-top: 1px dashed var(--line); }
.line-qty { font-size: 11px; color: var(--ink-2); }
.line-qty b { color: var(--ink); font-size: 13px; }
.line-quote { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--ink-2); }
.line-quote .input { width: 140px; height: 32px; text-align: right; font-size: 12px; padding: 0 9px; }
.line-quote .unit { font-size: 11px; color: var(--ink-3); }
.item-form-hint { font-size: 10.5px; color: var(--ink-3); margin-top: 8px; line-height: 1.6; }

/* 分类成本与利润率 */
.category-section { margin-top: 18px; }
.category-block { margin: 2px 0 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: #fbfcfe; }
.category-block h4 { margin: 0 0 9px; font-size: 11.5px; }
.category-table tr.total td { background: #f5f8fd; border-top: 1.5px solid #d6e0ef; }
.category-table td:first-child { min-width: 130px; }
.category-table .sub-cell { margin-top: 2px; }
.software-price-section td { vertical-align: middle; }
.software-price-section input { width: 140px; height: 32px; text-align: right; }
.software-price-section .sub-cell { margin-top: 2px; }

/* 含税价格汇总 */
.tax-summary { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: #fbfcfe; }
.tax-summary .row { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; font-size: 11px; color: var(--ink-2); }
.tax-summary .row b { color: var(--ink); font-size: 12px; font-weight: 600; }
.tax-summary .row.total { border-top: 1px solid var(--line); margin-top: 5px; padding-top: 8px; font-size: 12px; }
.tax-summary .row.total b { color: var(--brand); font-size: 15px; font-weight: 700; }

/* 销售易项目编号 */
.project-link { border: 0; background: none; color: var(--brand); font: inherit; font-weight: 600; padding: 0; cursor: pointer; text-decoration: underline; text-decoration-style: dotted; text-underline-offset: 3px; white-space: nowrap; }
.project-link:hover { color: var(--brand-2, #2456b8); }
.project-id-block { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 1px; line-height: 1.4; vertical-align: top; max-width: 100%; }
.project-id-block .id-row { display: block; max-width: 100%; white-space: nowrap; }
.project-id-block .config-id { color: var(--ink-3); font-size: 10.5px; }
.input.invalid { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(201, 21, 43, .10); }
.installation-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 9px; background: #fff; font-size: 11px; color: var(--ink-2); }
.installation-line b { color: var(--ink); font-size: 12px; }
.installation-line small { color: var(--ink-3); font-size: 10.5px; }
.opportunity-code { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 14px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; background: #fbfcfe; }
.opportunity-code span { font-size: 11px; color: var(--ink-3); }
.opportunity-code b { font-family: var(--mono); font-size: 16px; letter-spacing: .04em; color: var(--brand); }

/* 多配件编辑 */
.part-editor { border: 1px dashed var(--line); border-radius: 9px; padding: 9px 10px; background: #fbfcfe; }
.part-row { display: grid; grid-template-columns: minmax(0, 1fr) 70px 26px 30px; align-items: center; gap: 6px; margin-bottom: 6px; }
.part-row .select, .part-row .input { height: 32px; font-size: 11.5px; }
.part-row .unit { font-size: 10px; color: var(--ink-3); }
.part-row .icon-btn { width: 28px; height: 28px; }
.part-editor > .hint { display: inline-block; margin-top: 4px; }

/* 硬件行 */
.hw-row { display: grid; grid-template-columns: minmax(0, 1fr) 96px; gap: 10px; align-items: start; }
.hw-row .field { gap: 5px; }
.qty-input { text-align: center; padding: 0 6px; }

/* 机型选择 */
.model-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.model-card {
  border: 1px solid var(--line-strong); border-radius: 11px; padding: 12px 13px; cursor: pointer;
  background: #fff; transition: .15s; position: relative;
}
.model-card:hover { border-color: #b9c8e6; background: #fbfcff; }
.model-card.selected { border-color: var(--brand); background: linear-gradient(160deg, #f7faff, #eef4ff); box-shadow: 0 0 0 3px rgba(47,95,224,.08); }
.model-card.selected::after {
  content: "✓"; position: absolute; top: 9px; right: 10px; width: 17px; height: 17px; border-radius: 50%;
  display: grid; place-items: center; background: var(--brand); color: #fff; font-size: 10px; font-weight: 700;
}
.model-card .m-name { font-weight: 650; font-size: 12.5px; padding-right: 20px; }
.model-card .m-vendor { font-size: 10px; color: var(--ink-3); margin-top: 1px; }
.model-card .m-specs { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 8px; font-size: 10px; color: var(--ink-2); }
.model-card .m-specs b { font-weight: 600; color: var(--ink); }
.model-card .m-note { font-size: 10px; color: var(--ink-3); margin-top: 7px; line-height: 1.4; }

/* 配置页 */
.config-grid { display: grid; grid-template-columns: minmax(0, 1fr) 375px; gap: 18px; align-items: start; }
.config-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.config-side { position: sticky; top: 84px; display: flex; flex-direction: column; gap: 14px; }
.section-title { display: flex; align-items: center; gap: 8px; }
.section-num { width: 22px; height: 22px; border-radius: 7px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; font-size: 10.5px; font-weight: 700; }
.section-title h3 { font-size: 14px; }
.section-title .sub { margin-left: auto; font-size: 10.5px; color: var(--ink-3); }

/* 价格摘要 */
.summary { position: relative; }
.summary-head { padding: 16px 18px 13px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.summary-head h3 { font-size: 13.5px; }
.bom { padding: 12px 18px; display: flex; flex-direction: column; gap: 7px; max-height: 250px; overflow-y: auto; }
.bom-line { display: flex; gap: 8px; font-size: 11px; align-items: baseline; }
.bom-line .bl-name { color: var(--ink-2); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bom-line .bl-qty { color: var(--ink-3); font-size: 10px; white-space: nowrap; }
.bom-line .bl-amount { width: 70px; text-align: right; font-variant-numeric: tabular-nums; color: var(--ink); white-space: nowrap; }
.summary-totals { padding: 12px 18px 0; border-top: 1px dashed var(--line); display: flex; flex-direction: column; gap: 6px; font-size: 11.5px; }
.summary-totals .row { display: flex; justify-content: space-between; color: var(--ink-2); }
.summary-totals .row b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.summary-totals .row.big { font-size: 12.5px; padding-top: 7px; margin-top: 2px; border-top: 1px solid var(--line); }
.summary-totals .row.big b { font-size: 17px; color: var(--ink); }
.margin-box { margin: 14px 18px 0; padding: 12px; border-radius: 11px; background: var(--surface-2); border: 1px solid var(--line); }
.margin-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.margin-label { font-size: 11px; color: var(--ink-2); }
.margin-value { font-size: 21px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.margin-bar { height: 6px; border-radius: 8px; background: #e7ebf3; margin-top: 9px; overflow: hidden; position: relative; }
.margin-bar i { display: block; height: 100%; border-radius: 8px; background: linear-gradient(90deg, #41b98a, #0d9868); transition: width .25s; }
.margin-bar.below i { background: linear-gradient(90deg, #f0a03c, #d9660b); }
.margin-bar.negative i { background: linear-gradient(90deg, #ee8298, #d1294a); }
.margin-meta { display: flex; justify-content: space-between; font-size: 10px; color: var(--ink-3); margin-top: 5px; }
.summary-route { padding: 14px 18px 0; }
.summary-route-title { font-size: 10.5px; color: var(--ink-3); letter-spacing: .05em; margin-bottom: 8px; text-transform: uppercase; }
.route-line { display: flex; align-items: flex-start; gap: 8px; font-size: 11px; padding: 4px 0; position: relative; }
.route-dot { width: 15px; height: 15px; border-radius: 50%; border: 1.5px solid var(--line-strong); background: #fff; flex: 0 0 auto; display: grid; place-items: center; margin-top: 1px; color: transparent; font-size: 8px; }
.route-line.done .route-dot { background: var(--ok); border-color: var(--ok); color: #fff; }
.route-line.rejected .route-dot { background: var(--bad); border-color: var(--bad); color: #fff; }
.route-line.rejected .r-label { color: var(--bad); text-decoration: line-through; }
.route-line.current .route-dot { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 3px rgba(47,95,224,.1); }
.route-line .r-label { color: var(--ink-2); }
.route-line.done .r-label { color: var(--ink); font-weight: 600; }
.route-line .r-desc { display: block; font-size: 9.5px; color: var(--ink-3); margin-top: 1px; line-height: 1.4; }
.summary-actions { padding: 15px 18px 18px; display: flex; flex-direction: column; gap: 8px; }
.summary-actions .row { display: flex; gap: 8px; }

/* 校验 */
.check-list { display: flex; flex-direction: column; gap: 7px; }
.check-item { display: flex; align-items: flex-start; gap: 8px; font-size: 11.5px; padding: 8px 10px; border-radius: 8px; line-height: 1.5; }
.check-item svg { width: 14px; height: 14px; flex: 0 0 auto; margin-top: 1px; }
.check-item.err { background: #fff6f7; color: #a92a43; border: 1px solid #f8dbe1; }
.check-item.warn { background: #fffaf0; color: #98600a; border: 1px solid #f7e6c5; }
.check-ok { display: flex; align-items: center; gap: 8px; padding: 11px 12px; background: var(--ok-soft); border: 1px solid #c9eddd; color: #08744f; border-radius: 9px; font-size: 12px; font-weight: 550; }
.check-ok svg { width: 17px; height: 17px; }
.check-summary { display: flex; gap: 14px; font-size: 10.5px; color: var(--ink-3); margin-top: 10px; }
.score-ring { --score: 100; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; position: relative; flex: 0 0 auto; background: conic-gradient(var(--ok) calc(var(--score) * 1%), #e9edf5 0); }
.score-ring::before { content: ""; position: absolute; inset: 4px; background: #fff; border-radius: 50%; }
.score-ring span { position: relative; font-size: 10px; font-weight: 700; color: var(--ink); }

/* 提示条 */
.banner { display: flex; align-items: flex-start; gap: 9px; padding: 11px 13px; border-radius: 9px; font-size: 11.5px; line-height: 1.55; border: 1px solid transparent; }
.banner svg { width: 16px; height: 16px; flex: 0 0 auto; margin-top: 1px; }
.banner.info { background: var(--brand-soft); border-color: #d5e1ff; color: #284a9e; }
.banner.ok { background: var(--ok-soft); border-color: #c9eddd; color: #08744f; }
.banner.warn { background: var(--warn-soft); border-color: #f3e0bb; color: #915c08; }
.banner.bad { background: var(--bad-soft); border-color: #f6d5dc; color: #a92a43; }

/* 审批时间线 */
.timeline { display: flex; flex-direction: column; }
.tl-item { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 10px; position: relative; padding-bottom: 18px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-rail { display: flex; flex-direction: column; align-items: center; }
.tl-dot { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3); color: var(--ink-3); border: 1.5px solid var(--line-strong); flex: 0 0 auto; }
.tl-dot svg { width: 12px; height: 12px; }
.tl-dot.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.tl-dot.bad { background: var(--bad); border-color: var(--bad); color: #fff; }
.tl-dot.current { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); }
.tl-dot.auto { background: var(--violet-soft); border-color: #d9ceff; color: var(--violet); }
.tl-line { width: 1.5px; flex: 1; background: var(--line); margin: 3px 0; min-height: 8px; }
.tl-item:last-child .tl-line { display: none; }
.tl-body { padding-top: 2px; }
.tl-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tl-head b { font-size: 12px; font-weight: 650; }
.tl-head .when { font-size: 10px; color: var(--ink-3); margin-left: auto; white-space: nowrap; }
.tl-comment { font-size: 11.5px; color: var(--ink-2); margin-top: 4px; line-height: 1.55; background: var(--surface-2); border-radius: 7px; padding: 7px 9px; }
.tl-meta { font-size: 10px; color: var(--ink-3); margin-top: 4px; }

/* 详情 */
.detail-hero { display: flex; align-items: flex-start; gap: 14px; padding: 20px 22px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.detail-hero .dh-main { flex: 1; min-width: 220px; }
.detail-hero h2 { font-size: 19px; letter-spacing: -.01em; }
.detail-hero .dh-sub { color: var(--ink-2); font-size: 11.5px; margin-top: 4px; display: flex; gap: 10px; flex-wrap: wrap; }
.detail-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; border-bottom: 1px solid var(--line); }
.detail-metric { padding: 14px 18px; border-right: 1px solid var(--line); }
.detail-metric:last-child { border-right: 0; }
.detail-metric label { display: block; font-size: 10px; color: var(--ink-3); letter-spacing: .04em; }
.detail-metric b { display: block; font-size: 18px; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; }
.detail-metric small { font-size: 10px; color: var(--ink-3); display: block; margin-top: 2px; }
.detail-section { padding: 18px 22px; border-bottom: 1px solid var(--line); }
.detail-section:last-child { border-bottom: 0; }
.detail-section h4 { font-size: 12px; font-weight: 650; margin-bottom: 11px; display: flex; align-items: center; gap: 7px; }
.detail-section h4 .sub { font-weight: 400; color: var(--ink-3); font-size: 10.5px; margin-left: auto; }
.detail-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; }
.spec-table { width: 100%; border-collapse: collapse; font-size: 11.5px; }
.spec-table td { padding: 7px 0; border-bottom: 1px dashed #eef1f7; vertical-align: top; }
.spec-table tr:last-child td { border-bottom: 0; }
.spec-table td:first-child { color: var(--ink-3); width: 88px; }
.spec-table td:last-child { color: var(--ink); }
.spec-table.price-table td:first-child { width: auto; color: var(--ink); padding-right: 14px; line-height: 1.45; }
.spec-table.price-table td.num { text-align: right; white-space: nowrap; width: 92px; font-variant-numeric: tabular-nums; color: var(--ink); }
.spec-table.price-table tr.total td { border-top: 1px solid var(--line); border-bottom: 0; padding-top: 9px; font-weight: 650; }
.modal-actions { display: flex; align-items: center; gap: 8px; padding: 14px 22px; background: var(--surface-2); border-top: 1px solid var(--line); flex-wrap: wrap; }
.modal-actions .spacer { flex: 1; }

/* 审批卡片 */
.approve-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.approve-card { padding: 17px 18px; border-radius: var(--r); background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: 12px; transition: .15s; }
.approve-card:hover { border-color: #c8d6ef; box-shadow: var(--shadow); }
.approve-card .ac-head { display: flex; align-items: flex-start; gap: 10px; }
.approve-card .ac-title { font-weight: 650; font-size: 13.5px; }
.approve-card .ac-sub { font-size: 11px; color: var(--ink-3); margin-top: 2px; }
.approve-card .ac-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 10px 0; border-top: 1px dashed var(--line); border-bottom: 1px dashed var(--line); }
.approve-card .ac-metrics label { font-size: 9.5px; color: var(--ink-3); display: block; }
.approve-card .ac-metrics b { font-size: 13px; font-variant-numeric: tabular-nums; }
.approve-card .ac-foot { display: flex; align-items: center; gap: 8px; }
.approve-card .ac-foot .meta { font-size: 10px; color: var(--ink-3); margin-right: auto; }

/* 空状态 */
.empty { padding: 48px 20px; text-align: center; color: var(--ink-3); }
.empty-icon { width: 54px; height: 54px; border-radius: 16px; background: var(--surface-3); display: grid; place-items: center; margin: 0 auto 12px; color: var(--ink-3); }
.empty-icon svg { width: 25px; height: 25px; }
.empty h4 { color: var(--ink); font-size: 14px; margin-bottom: 4px; }
.empty p { font-size: 12px; }
.empty .btn { margin-top: 14px; }

/* 筛选栏 */
.filters { display: flex; align-items: center; gap: 9px; padding: 13px 18px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.filters .search { position: relative; flex: 1; min-width: 190px; max-width: 320px; }
.filters .search svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--ink-3); }
.filters .search input { padding-left: 32px; height: 34px; font-size: 12px; }
.filters select { height: 34px; font-size: 12px; width: auto; min-width: 120px; }
.filters .spacer { flex: 1; }
.segmented { display: inline-flex; background: var(--surface-3); border-radius: 9px; padding: 3px; gap: 2px; }
.segmented button { border: 0; background: transparent; height: 28px; padding: 0 11px; border-radius: 7px; font-size: 11.5px; color: var(--ink-2); font-weight: 550; }
.segmented button.active { background: #fff; color: var(--ink); box-shadow: var(--shadow-sm); }
.count-chip { font-size: 10.5px; background: var(--surface-3); color: var(--ink-2); border-radius: 20px; padding: 3px 9px; font-weight: 600; }

/* 图表 */
.chart-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 16px; margin-bottom: 16px; }
.bars { display: flex; align-items: flex-end; gap: 10px; height: 180px; padding: 8px 2px 0; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.bar-stack { width: 100%; max-width: 36px; display: flex; flex-direction: column; justify-content: flex-end; gap: 3px; flex: 1; }
.bar-create { background: linear-gradient(180deg, #b9cbfb, #dbe6ff); border-radius: 5px 5px 0 0; min-height: 2px; transition: height .4s; }
.bar-approve { background: linear-gradient(180deg, #2f5fe0, #6f93f7); border-radius: 5px 5px 0 0; min-height: 2px; transition: height .4s; }
.bar-label { font-size: 10px; color: var(--ink-3); }
.bar-value { font-size: 10px; font-weight: 650; color: var(--ink-2); }
.legend { display: flex; gap: 14px; font-size: 10.5px; color: var(--ink-2); flex-wrap: wrap; }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }

.donut-wrap { display: flex; align-items: center; gap: 22px; justify-content: center; padding: 8px 0; }
.donut { width: 142px; height: 142px; border-radius: 50%; position: relative; flex: 0 0 auto; }
.donut::before { content: ""; position: absolute; inset: 20px; background: #fff; border-radius: 50%; }
.donut-center { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; z-index: 1; }
.donut-center b { font-size: 25px; display: block; line-height: 1.1; }
.donut-center span { font-size: 10px; color: var(--ink-3); }
.donut-legend { display: flex; flex-direction: column; gap: 7px; font-size: 11px; min-width: 120px; }
.donut-legend .row { display: flex; align-items: center; gap: 7px; }
.donut-legend .row i { width: 8px; height: 8px; border-radius: 2px; }
.donut-legend .row b { margin-left: auto; font-variant-numeric: tabular-nums; }

.ind-bar { display: flex; flex-direction: column; gap: 13px; }
.ind-row .ind-top { display: flex; align-items: baseline; justify-content: space-between; font-size: 11.5px; margin-bottom: 5px; gap: 8px; }
.ind-row .ind-top b { font-weight: 600; }
.ind-row .ind-top .vals { font-size: 10px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.ind-track { height: 7px; background: #edf0f6; border-radius: 8px; position: relative; overflow: hidden; }
.ind-fill { height: 100%; border-radius: 8px; background: linear-gradient(90deg, #4b78ee, #2f5fe0); }
.ind-threshold { position: absolute; top: -2px; bottom: -2px; width: 2px; background: #d9660b; border-radius: 2px; }

/* 设置 */
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.threshold-row { display: grid; grid-template-columns: 1fr 110px 32px; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.threshold-row .icon-btn { width: 30px; height: 30px; }
.threshold-row:last-child { border-bottom: 0; }
.threshold-name { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 550; }
.threshold-dot { width: 8px; height: 8px; border-radius: 50%; }
.threshold-input { display: flex; align-items: center; gap: 5px; }
.threshold-input .input { height: 32px; text-align: right; padding: 0 8px; }
.threshold-input span { color: var(--ink-3); font-size: 11px; }
.catalog-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); padding: 0 18px; overflow-x: auto; }
.catalog-tabs button { border: 0; background: none; padding: 12px 11px 10px; color: var(--ink-3); font-size: 11.5px; font-weight: 550; border-bottom: 2px solid transparent; white-space: nowrap; }
.catalog-tabs button.active { color: var(--brand); border-bottom-color: var(--brand); }
.catalog-table { width: 100%; border-collapse: collapse; font-size: 11.5px; }
.catalog-table th { text-align: left; font-size: 10px; color: var(--ink-3); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.catalog-table td { padding: 9px 10px; border-bottom: 1px solid #f0f2f7; }
.catalog-table tr:last-child td { border-bottom: 0; }

/* 弹窗 */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(11, 23, 41, .5); backdrop-filter: blur(3px);
  z-index: 100; display: flex; align-items: flex-start; justify-content: center; padding: 5vh 20px;
  animation: fadeIn .16s ease;
}
.modal {
  width: 100%; max-width: 560px; background: #fff; border-radius: var(--r-lg); box-shadow: var(--shadow-lg);
  max-height: 90vh; display: flex; flex-direction: column; overflow: hidden; animation: modalIn .2s cubic-bezier(.2,.9,.3,1);
}
.modal.wide { max-width: 1000px; }
.modal.medium { max-width: 720px; }
.modal-head { display: flex; align-items: flex-start; gap: 12px; padding: 19px 22px 16px; border-bottom: 1px solid var(--line); }
.modal-head h3 { font-size: 16px; flex: 1; }
.modal-head .modal-sub { font-size: 11.5px; color: var(--ink-3); margin-top: 3px; }
.modal-close { width: 30px; height: 30px; border-radius: 8px; border: 0; background: var(--surface-3); color: var(--ink-2); display: grid; place-items: center; flex: 0 0 auto; }
.modal-close:hover { background: #e5eaf3; }
.modal-close svg { width: 15px; height: 15px; }
.modal-body { padding: 20px 22px; overflow-y: auto; }
.modal-body.flush { padding: 0; }
.modal-body .field + .field { margin-top: 14px; }
.modal-foot { padding: 14px 22px; border-top: 1px solid var(--line); background: var(--surface-2); display: flex; justify-content: flex-end; gap: 9px; }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes modalIn { from { opacity: 0; transform: translateY(10px) scale(.985); } }

/* Toast */
.toast-root { position: fixed; right: 22px; bottom: 22px; z-index: 200; display: flex; flex-direction: column; gap: 9px; align-items: flex-end; }
.toast {
  min-width: 240px; max-width: 400px; background: #132138; color: #fff; border-radius: 11px;
  padding: 11px 14px; font-size: 12.5px; box-shadow: var(--shadow-lg); display: flex; align-items: flex-start; gap: 9px;
  animation: toastIn .22s ease;
}
.toast svg { width: 16px; height: 16px; flex: 0 0 auto; margin-top: 1px; }
.toast.ok svg { color: #4ade9e; }
.toast.bad svg { color: #ff8fa3; }
.toast.info svg { color: #8fb0ff; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } }

/* 仪表盘布局 */
.dash-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, .75fr); gap: 16px; align-items: start; }
.dash-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.quick-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.quick-action { display: flex; flex-direction: column; gap: 5px; padding: 13px; border: 1px solid var(--line); border-radius: 10px; background: #fff; transition: .15s; }
.quick-action:hover { border-color: #c8d6ef; background: #fbfcff; transform: translateY(-1px); }
.quick-action svg { width: 18px; height: 18px; color: var(--brand); }
.quick-action b { font-size: 12px; }
.quick-action span { font-size: 10px; color: var(--ink-3); }
.rule-steps { display: flex; flex-direction: column; gap: 0; }
.rule-step { display: flex; gap: 10px; position: relative; padding-bottom: 15px; }
.rule-step:last-child { padding-bottom: 0; }
.rule-num { width: 21px; height: 21px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); font-size: 10px; font-weight: 700; display: grid; place-items: center; flex: 0 0 auto; z-index: 1; }
.rule-step:not(:last-child)::before { content: ""; position: absolute; left: 10px; top: 21px; bottom: 0; width: 1px; background: var(--line); }
.rule-step b { font-size: 11.5px; display: block; }
.rule-step p { font-size: 10.5px; color: var(--ink-3); margin-top: 1px; line-height: 1.5; }

/* 小工具 */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
.hr-space { height: 14px; }
.inline-note { font-size: 10.5px; color: var(--ink-3); }
.breakdown { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.breakdown.four { grid-template-columns: repeat(4, 1fr); }
.breakdown .b-item { background: var(--surface-2); border: 1px solid var(--line); border-radius: 9px; padding: 9px 11px; }
.breakdown label { font-size: 9.5px; color: var(--ink-3); display: block; }
.breakdown b { font-size: 13px; font-variant-numeric: tabular-nums; }
.role-badge { display: inline-flex; align-items: center; gap: 5px; font-size: 10px; color: var(--ink-3); }
.role-badge img { width: 16px; height: 16px; border-radius: 50%; }

/* ============ 响应式 ============ */
@media (max-width: 1240px) {
  .config-grid { grid-template-columns: minmax(0, 1fr) 340px; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1120px) {
  .config-grid { grid-template-columns: 1fr; }
  .config-side { position: static; display: grid; grid-template-columns: 1fr 1fr; align-items: start; }
  .config-side .summary { grid-row: span 2; }
  .dash-grid { grid-template-columns: 1fr; }
  .chart-grid { grid-template-columns: 1fr; }
  .approve-grid { grid-template-columns: 1fr; }
  .settings-grid { grid-template-columns: 1fr; }
  .detail-cols { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; width: 250px; transform: translateX(-102%); transition: transform .22s ease; box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: translateX(0); }
  .menu-btn { display: grid; }
  .page { padding: 20px 18px 44px; }
  .topbar { padding: 0 16px; }
  .model-grid { grid-template-columns: 1fr; }
  .detail-metrics { grid-template-columns: repeat(2, 1fr); }
  .detail-metric:nth-child(2) { border-right: 0; }
  .detail-metric:nth-child(1), .detail-metric:nth-child(2) { border-bottom: 1px solid var(--line); }
  .config-side { grid-template-columns: 1fr; }
  .config-side .summary { grid-row: auto; }
}
@media (max-width: 640px) {
  .page-title { font-size: 19px; }
  .role-switch { border-left: 0; padding-left: 0; margin-left: 0; min-width: 0; }
  .role-select-wrap label { display: none; }
  .role-select-wrap select { max-width: 120px; }
  .crumb { display: none; }
  .topbar-right { gap: 2px; min-width: 0; }
  .page-head { flex-direction: column; gap: 12px; margin-bottom: 18px; }
  .page-head .head-main { width: 100%; }
  .page-head .page-actions { width: 100%; justify-content: flex-start; }
  .page-head .page-actions .btn { flex: 1 1 auto; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { padding: 13px 14px; min-width: 0; }
  .kpi-value { font-size: 21px; }
  .form-grid, .form-grid-3 { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: auto; }
  .filters { padding: 11px 14px; }
  .filters .search { max-width: none; flex-basis: 100%; }
  .detail-hero { padding: 16px; }
  .detail-metrics { grid-template-columns: 1fr 1fr; }
  .detail-section { padding: 15px 16px; }
  .modal-backdrop { padding: 2vh 8px; }
  .modal { max-height: 96vh; border-radius: 14px; }
  .modal-body { padding: 16px; }
  .modal-actions { padding: 12px 16px; }
  .donut-wrap { gap: 14px; }
  .donut { width: 116px; height: 116px; }
  .donut::before { inset: 16px; }
  .quick-actions { grid-template-columns: 1fr; }
  .breakdown { grid-template-columns: 1fr 1fr; }
  .breakdown.four { grid-template-columns: 1fr 1fr; }
  .approve-card .ac-metrics { grid-template-columns: repeat(2, 1fr); }
}

/* 系统管理：可视化角色映射 */
.admin-users-table th:nth-child(1){width:180px}.admin-users-table th:nth-child(2){width:150px}.admin-users-table th:nth-child(4){width:230px}
.admin-user-cell b{display:block}.role-checks{display:flex;flex-wrap:wrap;gap:6px 12px;min-width:420px}.role-check{display:inline-flex;align-items:center;gap:5px;font-size:11.5px;white-space:nowrap;color:#34445c}.role-check input{accent-color:#2f5fe0}.role-check.is-locked{opacity:.72}
.admin-users-table td{vertical-align:top}.admin-users-table .field label{font-size:10.5px;margin-bottom:3px}

/* 生产订单组装配置明细 */
.assembly-block{margin:0 0 16px;padding:12px;border:1px solid #e3e9f2;border-radius:10px;background:#fbfcfe}
.assembly-title{display:flex;flex-wrap:wrap;align-items:baseline;gap:8px;margin-bottom:8px;color:#15233b}
.assembly-title span{color:#5b6b85;font-size:12px}.assembly-title em{margin-left:auto;font-style:normal;color:#2f5fe0;font-size:12px;font-weight:600}
.assembly-table{font-size:11px}.assembly-table th{white-space:nowrap}

.error-list{margin:12px 0 0;padding-left:20px;max-height:320px;overflow:auto;color:#9e1b2a;font-size:12px;line-height:1.7}.error-list li{margin:4px 0}
