:root {
  --bg: #f5f7fa; --panel: #ffffff; --ink: #1f2933; --muted: #6b7785;
  --line: #e3e8ef; --brand: #2563eb; --brand-soft: #e8f0fe;
  --green: #15803d; --green-bg: #e7f6ec; --red: #b42318; --red-bg: #fdecea;
  --amber: #b45309; --amber-bg: #fef3e2; --gray-bg: #eef1f5; --purple: #6d28d9; --purple-bg: #f1ebfd;

  /* §20 全系统 Overlay 层级规范（唯一权威定义，业务页面禁止硬编码 z-index）
     普通内容 < 冻结列 < sticky表头 < 页面下拉 < 遮罩 < Drawer < Modal < 悬浮卡 */
  --z-resize: 2;
  --z-frozen-td: 3;
  --z-sum: 3;
  --z-sticky-th: 5;
  --z-sticky-th-frozen: 6;
  --z-dropdown: 40;      /* 筛选下拉 / 列菜单 / 视图 / 快捷筛选 / 列头弹层 */
  --z-navfly: 200;       /* 一级导航功能中心浮层 */
  --z-mask: 900;         /* Drawer 遮罩 */
  --z-drawer: 1000;      /* Drawer（body 顶层 Overlay Root） */
  --z-modal: 1100;       /* Modal */
  --z-modal-drop: 1150;  /* Modal 内部 Dropdown */
  --z-tip: 9999;         /* 长文本悬浮卡（永远最高） */
}
* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg); color: var(--ink); font-size: 13px; }
a { color: inherit; }
.app { display: grid; grid-template-columns: 220px 1fr; height: 100vh; }

/* sidebar */
.sidebar { background: #0f172a; color: #cbd5e1; padding: 14px 0; overflow-y: auto; }
.sidebar h1 { font-size: 14px; color: #fff; padding: 0 18px 12px; margin: 0; line-height: 1.4; }
.sidebar .sub { font-size: 11px; color: #64748b; padding: 0 18px 14px; }
.nav-item { padding: 9px 18px; cursor: pointer; border-left: 3px solid transparent; display: flex; gap: 8px; align-items: center; }
.nav-item:hover { background: #1e293b; }
.nav-item.active { background: #1e293b; border-left-color: var(--brand); color: #fff; }
.nav-item .dot { width: 7px; height: 7px; border-radius: 50%; background: #475569; }
.nav-item.active .dot { background: var(--brand); }

/* main */
.main { display: flex; flex-direction: column; overflow: hidden; }
.topbar { background: var(--panel); border-bottom: 1px solid var(--line); padding: 10px 18px; display: flex; align-items: center; gap: 14px; }
.topbar .title { font-weight: 600; font-size: 15px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { background: var(--gray-bg); border-radius: 12px; padding: 3px 10px; font-size: 12px; color: var(--muted); }
.chip b { color: var(--ink); }
.spacer { flex: 1; }
.btn { background: var(--brand); color: #fff; border: none; border-radius: 6px; padding: 7px 14px; cursor: pointer; font-size: 13px; }
.btn:hover { filter: brightness(1.05); }
.btn.ghost { background: var(--brand-soft); color: var(--brand); }
.btn:disabled { opacity: .5; cursor: default; }

.content { padding: 16px 18px; overflow-y: auto; flex: 1; }
.view-title { font-size: 16px; font-weight: 600; margin: 0 0 4px; }
.view-desc { color: var(--muted); margin: 0 0 14px; font-size: 12px; }
.toolbar { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.input, .select { border: 1px solid var(--line); border-radius: 6px; padding: 6px 9px; font-size: 13px; background: #fff; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 600; }
.b-green { background: var(--green-bg); color: var(--green); }
.b-red { background: var(--red-bg); color: var(--red); }
.b-amber { background: var(--amber-bg); color: var(--amber); }
.b-gray { background: var(--gray-bg); color: var(--muted); }
.b-purple { background: var(--purple-bg); color: var(--purple); }
.b-blue { background: var(--brand-soft); color: var(--brand); }

/* table */
table.grid { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
table.grid th { text-align: left; background: #f8fafc; color: var(--muted); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); font-size: 12px; position: sticky; top: 0; }
table.grid td { padding: 7px 10px; border-bottom: 1px solid #f0f2f5; font-size: 12.5px; }
table.grid tr:hover td { background: #f8fafc; cursor: pointer; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.empty { color: var(--muted); padding: 30px; text-align: center; }

/* drawer（§20~§24：Overlay 层级规范 + 顶层挂载 + 内部独立滚动）
   遮罩/抽屉必须是 body 直接子节点且带明确 z-index：此前二者无 z-index，
   被 sticky 表头(z=5)、筛选下拉(z=40)、导航浮层(z=200) 穿透 —— 这是「表头盖住抽屉」的根因。 */
#overlay-root { position: relative; }
.drawer-mask { position: fixed; inset: 0; background: rgba(15,23,42,.35); display: none; z-index: var(--z-mask); }
.drawer-mask.open { display: block; }
.drawer { position: fixed; top: 0; right: 0; height: 100vh; width: 460px; max-width: 94vw; background: #fff; box-shadow: -4px 0 20px rgba(0,0,0,.12); transform: translateX(100%); transition: transform .2s; display: flex; flex-direction: column; z-index: var(--z-drawer); }
.drawer.wide { width: 1080px; }
.drawer.open { transform: translateX(0); }
.drawer header { padding: 14px 18px; border-bottom: 1px solid var(--line); display: flex; align-items: center; background: #fff; }
.drawer header .x { margin-left: auto; cursor: pointer; color: var(--muted); font-size: 18px; }
/* 详情抽屉返回按钮（指令#31：从供应商到料计划下钻进入时显示） */
.drawer header .sp-back { flex: 0 0 auto; margin-right: 8px; font-size: 12px; padding: 4px 10px; }
/* §24：标题与关闭按钮常驻，正文内部滚动 */
.drawer .body { padding: 16px 18px; overflow-y: auto; flex: 1 1 auto; min-height: 0; }
/* 待核实 / 数据关联异常：禁止用 0 掩盖（§三） */
.dt-verify { color: var(--amber); background: var(--amber-bg); border-radius: 4px; padding: 0 5px; font-size: 12px; white-space: nowrap; }
.dt-more-inline { margin-left: 6px; color: var(--brand); font-size: 11.5px; }
.dt-more { color: var(--brand); cursor: help; font-size: 11.5px; text-decoration: underline dotted; }
.tbl-sm th, .tbl-sm td { padding: 5px 7px; font-size: 12px; }
/* Modal 预留（当前无业务 Modal，先锁定层级） */
.modal-mask { position: fixed; inset: 0; background: rgba(15,23,42,.45); z-index: var(--z-modal); display: none; }
.modal-mask.open { display: flex; align-items: center; justify-content: center; }
.modal { background: #fff; border-radius: 12px; min-width: 420px; max-width: 92vw; max-height: 86vh; overflow: auto; box-shadow: 0 24px 64px rgba(15,23,42,.28); }
.modal .modal-drop { z-index: var(--z-modal-drop); }
.kv { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.kv .k { color: var(--muted); }
.kv .v { font-weight: 500; max-width: 60%; text-align: right; word-break: break-all; }
.section-h { font-weight: 600; margin: 16px 0 6px; font-size: 13px; }
.notice { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; padding: 8px 12px; border-radius: 6px; font-size: 12px; margin-bottom: 12px; }
.kpi-row { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 12px 16px; min-width: 130px; }
.kpi .label { color: var(--muted); font-size: 12px; }
.kpi .val { font-size: 22px; font-weight: 700; margin-top: 4px; }
.tag-real { background: var(--green-bg); color: var(--green); }
.tag-mock { background: var(--amber-bg); color: var(--amber); }
.pill { font-size: 11px; padding: 1px 7px; border-radius: 9px; }

/* exception board (Sprint 2 Phase 4) */
.ex-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 14px; margin-top: 4px; }
.ex-card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; display: flex; flex-direction: column; }
.ex-head { display: flex; align-items: center; gap: 8px; }
.ex-title { font-weight: 600; font-size: 14px; }
.ex-count { margin-left: auto; font-size: 18px; font-weight: 700; }
.ex-hint { color: var(--muted); font-size: 11.5px; margin: 6px 0 8px; }
.ex-sample { list-style: none; margin: 0 0 10px; padding: 0; max-height: 150px; overflow-y: auto; }
.ex-sample li { padding: 4px 0; border-bottom: 1px dashed var(--line); font-size: 12px; }
.ex-sample li b { color: var(--ink); }
.ex-go { align-self: flex-start; padding: 5px 12px; font-size: 12px; margin-top: auto; }

/* promise channel (Sprint 3 方向 #1) */
.ingest-box { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; margin-bottom: 12px; }
.ingest-area { width: 100%; min-height: 84px; box-sizing: border-box; border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; resize: vertical; color: var(--ink); background: #fff; }
.chk { font-size: 12px; color: var(--muted); display: inline-flex; align-items: center; gap: 4px; }
.result-box { margin-top: 10px; font-size: 12px; }
.result-box .muted { color: var(--muted); }
.muted { color: var(--muted); }


/* ══════════════════════════════════════════════════════════
   Sprint 3.1 — 首页（供应链管理驾驶舱）/ 验收证据 / 归因时间轴
   ══════════════════════════════════════════════════════════ */

/* 侧边导航分组标题 */
.nav-group { font-size: 10.5px; letter-spacing: .08em; color: #64748b;
  padding: 14px 18px 5px; text-transform: none; font-weight: 600; }
.nav-group:first-child { padding-top: 4px; }

/* ── 首页 ── */
.home { display: flex; flex-direction: column; gap: 4px; }
.home-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 14px 18px; margin-bottom: 16px; }
.home-title { font-size: 20px; font-weight: 700; letter-spacing: .01em; }
.home-sub { color: var(--muted); font-size: 12px; margin-top: 3px; }
.home-head-right { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 5px; }
.home-meta { color: var(--muted); font-size: 11.5px; }

.home-sec { margin-bottom: 20px; }
.home-sec-h { font-size: 14px; font-weight: 600; margin-bottom: 10px;
  display: flex; align-items: baseline; gap: 10px; border-left: 3px solid var(--brand); padding-left: 9px; }
.home-sec-note { font-size: 11.5px; font-weight: 400; color: var(--muted); }

/* 第一层：可下钻 KPI 卡 */
.hkpi-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 12px; }
.hkpi { background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--line);
  border-radius: 9px; padding: 13px 15px; transition: box-shadow .15s, transform .15s; }
.hkpi-click { cursor: pointer; }
.hkpi-click:hover { box-shadow: 0 3px 14px rgba(15,23,42,.10); transform: translateY(-1px); }
.hkpi-ok { border-left-color: var(--green); }
.hkpi-warn { border-left-color: var(--amber); }
.hkpi-bad { border-left-color: var(--red); }
.hkpi-label { color: var(--muted); font-size: 12px; }
.hkpi-val { font-size: 26px; font-weight: 700; margin-top: 5px; line-height: 1.15; }
.hkpi-unit { font-size: 12px; font-weight: 500; color: var(--muted); margin-left: 4px; }
.hkpi-slash { color: var(--muted); font-weight: 400; margin: 0 1px; }
.hkpi-sub { color: var(--muted); font-size: 11.5px; margin-top: 5px; line-height: 1.5; }
.hkpi-sub b { color: var(--ink); }
.hkpi-hint { color: var(--muted); font-size: 11px; margin-top: 4px; }
.hkpi-go { color: var(--brand); font-size: 11px; margin-top: 8px; font-weight: 600; }

/* 第二/三层：卡片列 */
.home-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); gap: 14px; align-items: start; }
.hcard { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; }
.hcard-grow { grid-column: span 2; }
.hcard-h { font-weight: 600; font-size: 13.5px; margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.hcard-total { margin-left: auto; font-size: 17px; font-weight: 700; color: var(--ink); }
.hcard-note { color: var(--muted); font-size: 11.5px; line-height: 1.6; margin-bottom: 10px; }
.hcard-note b { color: var(--ink); }

/* 风险→行动 1:N 分层图 */
.layering { padding: 4px 0 8px; }
.layer-row { display: flex; align-items: baseline; gap: 10px; padding: 7px 0; border-bottom: 1px dashed var(--line); }
.layer-k { font-size: 12.5px; min-width: 96px; }
.layer-v { font-size: 20px; font-weight: 700; min-width: 52px; }
.layer-n { color: var(--muted); font-size: 11.5px; }
.layer-arrow { color: var(--brand); font-size: 11.5px; padding: 5px 0 5px 6px; }

/* 横条分布 */
.bar-row { display: flex; align-items: center; gap: 9px; padding: 5px 0; }
.bar-k { font-size: 12px; min-width: 116px; color: var(--ink); }
.bar-track { flex: 1; height: 8px; background: var(--gray-bg); border-radius: 4px; overflow: hidden; min-width: 50px; }
.bar-fill { display: block; height: 100%; background: var(--brand); border-radius: 4px; }
.bar-fill-amber { background: var(--amber); }
.bar-v { font-size: 12.5px; font-weight: 600; min-width: 34px; text-align: right; font-variant-numeric: tabular-nums; }

/* 今日焦点行 */
.focus-row { display: flex; align-items: baseline; gap: 8px; padding: 7px 0; border-bottom: 1px dashed var(--line); flex-wrap: wrap; }
.focus-cat { font-size: 11.5px; color: var(--muted); min-width: 108px; }
.focus-title { font-size: 12.5px; font-weight: 600; }
.focus-detail { font-size: 11.5px; color: var(--muted); flex: 1; min-width: 200px; }

/* AI 供应链助手预留区（明确「即将启用」，不伪造回答） */
.ai-card { border-style: dashed; border-color: #c7d2e0; background: #fbfcfe; }
.ai-pending-badge { display: inline-block; background: var(--purple-bg); color: var(--purple);
  border-radius: 10px; padding: 2px 10px; font-size: 11px; font-weight: 600; margin-bottom: 8px; }
.ai-pending-text { color: var(--muted); font-size: 12px; line-height: 1.75; }
.ai-pending-text b { color: var(--ink); }
.ai-todo { margin: 10px 0 0; padding-left: 18px; color: var(--muted); font-size: 11.5px; line-height: 1.9; }

.home-foot { margin-top: 18px; }

/* ── 标签页 ── */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 14px; flex-wrap: wrap; }
.tab { padding: 8px 15px; cursor: pointer; font-size: 13px; color: var(--muted);
  border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab:hover { color: var(--ink); }
.tab.active { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }

/* ── 验收证据：UAT 用例卡 ── */
.uat-list { display: flex; flex-direction: column; gap: 10px; }
.uat-card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.uat-card-empty { border-style: dashed; }
.uat-head { display: flex; align-items: center; gap: 10px; padding: 11px 15px; cursor: pointer; flex-wrap: wrap; }
.uat-head:hover { background: #f8fafc; }
.uat-id { font-weight: 700; font-size: 12.5px; color: var(--brand); min-width: 58px; }
.uat-scenario { font-weight: 600; font-size: 13px; }
.uat-status { color: var(--muted); font-size: 11.5px; }
.uat-toggle { margin-left: auto; color: var(--brand); font-size: 11.5px; font-weight: 600; }
.uat-summary { padding: 0 15px 10px; display: flex; gap: 14px; flex-wrap: wrap; }
.uat-kv { font-size: 11.5px; color: var(--ink); }
.uat-kv i { color: var(--muted); font-style: normal; margin-right: 4px; }
.uat-body { padding: 4px 15px 15px; border-top: 1px dashed var(--line); }

/* ── 证据链块 ── */
.ev-block { margin-bottom: 14px; }
.ev-block-h { font-weight: 600; font-size: 12.5px; color: var(--ink); margin-bottom: 6px;
  padding-left: 8px; border-left: 3px solid var(--brand); }
.ev-kv { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0;
  border-bottom: 1px dashed var(--line); font-size: 12px; }
.ev-k { color: var(--muted); flex-shrink: 0; }
.ev-v { text-align: right; word-break: break-all; max-width: 68%; }
.ev-v code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11.5px;
  background: var(--gray-bg); padding: 1px 5px; border-radius: 3px; }
.ev-steps { margin: 0; padding-left: 20px; font-size: 12px; line-height: 1.9; color: var(--ink); }
.ev-nosample { text-align: center; padding: 26px; color: var(--muted); font-size: 12.5px; }
.ev-nosample .badge { margin-bottom: 8px; }

/* ── 延期归因：六时间节点时间轴 ── */
.timeline { background: #fbfcfe; border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; margin-bottom: 6px; }
.tl-row { position: relative; display: grid; grid-template-columns: 110px 120px 1fr; gap: 8px;
  align-items: baseline; padding: 6px 0 6px 16px; font-size: 12px; }
.tl-row::before { content: ''; position: absolute; left: 3px; top: 16px; bottom: -8px; width: 1px; background: var(--line); }
.tl-row:last-child::before { display: none; }
.tl-dot { position: absolute; left: 0; top: 11px; width: 7px; height: 7px; border-radius: 50%; background: var(--brand); }
.tl-missing .tl-dot { background: #cbd5e1; }
.tl-k { color: var(--muted); }
.tl-v b { font-size: 12.5px; }
.tl-hint { color: var(--muted); font-size: 11px; }

/* ── 系统信息（技术字段折叠）── */
.sysinfo { margin-top: 14px; border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; background: #fbfcfe; }
.sysinfo summary { cursor: pointer; font-size: 12px; color: var(--muted); font-weight: 600; }
.sysinfo .kv { font-size: 11.5px; }
.sysinfo .kv .v { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; }

/* ══════════════════════════════════════════════════════════
   正式数据导入模式（data-import 页面）
   ══════════════════════════════════════════════════════════ */
/* 全局数据源芯片（顶栏，区分 真实/演示） */
.src-chip { cursor: pointer; border-radius: 12px; padding: 4px 12px; font-size: 12px; font-weight: 600; user-select: none; }
.src-chip.real { background: var(--green-bg); color: var(--green); border: 1px solid #bfe3cb; }
.src-chip.demo { background: var(--amber-bg); color: var(--amber); border: 1px solid #f3d8af; }

/* 通用表格（与 .grid 保持一致观感） */
.tbl { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; margin-top: 4px; }
.tbl th { text-align: left; background: #f8fafc; color: var(--muted); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); font-size: 12px; position: sticky; top: 0; }
.tbl td { padding: 7px 10px; border-bottom: 1px solid #f0f2f5; font-size: 12.5px; }
.tbl tr:hover td { background: #f8fafc; }
.num-ok { color: var(--green); font-weight: 600; }
.num-bad { color: var(--red); font-weight: 600; }
.num-warn { color: var(--amber); font-weight: 600; }

/* 上传卡片 */
.up-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; margin: 12px 0; }
.up-card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; }
.up-label { font-weight: 600; font-size: 13.5px; }
.up-hint { color: var(--muted); font-size: 11.5px; margin: 4px 0 10px; line-height: 1.5; }
.up-file { width: 100%; margin-bottom: 8px; font-size: 12px; }
.up-type { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.up-sel { border: 1px solid var(--line); border-radius: 6px; padding: 4px 6px; font-size: 12px; background: #fff; }

/* 规则标签 */
.imp-rules { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0 4px; }
.tag { display: inline-block; padding: 3px 10px; border-radius: 10px; font-size: 11.5px; font-weight: 600; background: var(--gray-bg); color: var(--muted); }
.tag.real { background: var(--green-bg); color: var(--green); }
.tag.warn { background: var(--amber-bg); color: var(--amber); }
.tag.ok { background: var(--green-bg); color: var(--green); }
.imp-note { color: var(--muted); font-size: 11.5px; line-height: 1.6; }

/* ===== 计划周期控制（指令 0908）===== */
.cyc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 10px 0; }
.cyc-item { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
.cyc-k { font-size: 11.5px; color: var(--muted); margin-bottom: 4px; }
.cyc-v { font-size: 14px; font-weight: 600; color: var(--ink); }
.cyc-counts { font-size: 12.5px; color: var(--muted); margin: 8px 0; line-height: 1.8; }
.cyc-counts b { color: var(--ink); font-size: 13.5px; }
.cyc-acts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.cyc-empty { color: var(--muted); font-size: 12.5px; padding: 14px 0; }
.cyc-panel { margin: 8px 0; }
.cyc-title { font-size: 14px; font-weight: 600; color: var(--ink); margin: 4px 0 8px; }
.cyc-note {
  font-size: 12px; color: var(--muted); line-height: 1.75;
  background: var(--gray-bg); border-radius: 8px; padding: 10px 12px; margin: 10px 0;
}
.cyc-note.warn { background: var(--amber-bg); color: #7c4a03; }
.cyc-note b { color: var(--ink); }
.cyc-note.warn b { color: #7c4a03; }

/* 导入后处理方式：三选一 */
.mode-list { display: flex; flex-direction: column; gap: 8px; margin: 8px 0 4px; }
.mode-item {
  display: flex; gap: 10px; align-items: flex-start; cursor: pointer;
  border: 1px solid var(--line); border-radius: 10px; padding: 11px 14px; background: var(--panel);
  transition: border-color .15s, background .15s;
}
.mode-item:hover { border-color: #c7d2fe; }
.mode-item.on { border-color: var(--brand); background: var(--brand-soft); }
.mode-item input { margin-top: 2px; accent-color: var(--brand); }
.mode-body { display: flex; flex-direction: column; gap: 4px; }
.mode-h { font-size: 13px; font-weight: 600; color: var(--ink); }
.mode-d { font-size: 11.5px; color: var(--muted); line-height: 1.65; }

/* 抽屉底部操作区 */
.drawer-acts { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); }

/* 报告卡 */
.rep-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; margin-bottom: 14px; }
.mini { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; text-align: center; }
.mini-v { font-size: 22px; font-weight: 700; }
.mini-l { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.mini.ok .mini-v { color: var(--green); }
.mini.bad .mini-v { color: var(--red); }
.mini.warn .mini-v { color: var(--amber); }
.rep-alloc { background: var(--brand-soft); border: 1px solid #cfe0fd; border-radius: 8px; padding: 9px 12px; font-size: 12px; margin: 10px 0; color: var(--ink); }
.rep-exc { margin-top: 12px; }
.rep-exc-h { font-weight: 600; font-size: 12.5px; margin-bottom: 6px; }
.rep-exc-note { color: var(--muted); font-size: 11px; font-weight: 400; }

/* 小按钮 */
.btn.sm { padding: 4px 10px; font-size: 12px; }
.drawer-h { font-weight: 600; font-size: 13px; margin-bottom: 6px; }

/* ══════════════════════════════════════════════════════════
   统一企业数据表格组件 .dt（宽表：滚动 / 冻结 / 筛选 / 列设置）
   ══════════════════════════════════════════════════════════ */
.dt { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; margin-top: 4px; }
.dt-bar { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.dt-count { font-size: 12px; color: var(--muted); font-weight: 600; }
.dt-bar-spacer { flex: 1; }
.dt-bar-right { position: relative; }
.dt-cols-toggle { border: 1px solid var(--line); background: #fff; border-radius: 6px; padding: 5px 10px; font-size: 12px; cursor: pointer; }
.dt-cols-toggle:hover { background: var(--brand-soft); color: var(--brand); }
.dt-colpop { position: absolute; right: 0; top: 34px; z-index: var(--z-dropdown); background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; box-shadow: 0 6px 20px rgba(0,0,0,.12); display: none; min-width: 160px; max-height: 300px; overflow: auto; }
.dt-colpop.open { display: block; }
.dt-colpop-h { font-size: 12px; font-weight: 600; margin-bottom: 6px; color: var(--muted); }
.dt-col-opt { display: flex; align-items: center; gap: 6px; font-size: 12.5px; padding: 3px 0; cursor: pointer; }

/* 顶部同步滚动条（始终可访问，无需滚到表格底部） */
.dt-topsb { overflow-x: auto; overflow-y: hidden; height: 13px; border-bottom: 1px solid var(--line); scrollbar-width: thin; }
.dt-topsb-in { height: 1px; }
.dt-topsb::-webkit-scrollbar { height: 11px; }
.dt-topsb::-webkit-scrollbar-thumb { background: #c4cedb; border-radius: 6px; }
.dt-topsb::-webkit-scrollbar-track { background: #eef1f5; }

/* ===== EnterpriseGrid V1 §32~§44：底部常驻水平滚动条 + 三层底部结构 =====
   层级自下而上：分页栏(.dt-foot) → 常驻水平滚动条(.dt-botsb) → 吸底合计行(.dt-sum)
   → 数据区域。合计行不再被原生横向滚动条遮挡，数字不再被切掉一半。 */
.dt-botsb { overflow-x: auto; overflow-y: hidden; height: 13px; border-top: 1px solid var(--line); background: #f8fafc; scrollbar-width: thin; }
.dt-botsb-in { height: 1px; }
.dt-botsb::-webkit-scrollbar { height: 12px; }
.dt-botsb::-webkit-scrollbar-thumb { background: #94a3b8; border-radius: 6px; }
.dt-botsb::-webkit-scrollbar-thumb:hover { background: #64748b; }
.dt-botsb::-webkit-scrollbar-track { background: #f1f5f9; }
/* 隐藏主滚动容器的原生横向滚动条（改由 .dt-botsb 统一承担），避免压住底部合计行 */
.dt-scroll::-webkit-scrollbar:horizontal { height: 0; }
.dt-scroll::-webkit-scrollbar-thumb:horizontal { background: transparent; }

/* 主滚动容器：横向 + 纵向，底部常驻可见滚动条 */
.dt-scroll { overflow: auto; max-height: calc(100vh - 270px); position: relative; }
.dt-loading .dt-scroll { opacity: .6; transition: opacity .12s; pointer-events: none; }
.dt-tbl { border-collapse: collapse; background: var(--panel); table-layout: fixed; }
.dt-th { position: sticky; top: 0; z-index: var(--z-sticky-th); background: #f3f6fb; color: var(--muted); font-weight: 600; font-size: 12px; text-align: left; padding: 0; border-bottom: 1px solid var(--line); white-space: nowrap; }
.dt-th.dt-frozen { z-index: var(--z-sticky-th-frozen); }
.dt-th-in { display: flex; align-items: center; gap: 4px; padding: 9px 10px; border-right: 1px solid var(--line); position: relative; }
.dt-th-t { cursor: pointer; user-select: none; overflow: hidden; text-overflow: ellipsis; }
.dt-filter-btn { margin-left: auto; border: none; background: transparent; cursor: pointer; color: var(--muted); font-size: 12px; padding: 0 2px; border-radius: 4px; }
.dt-filter-btn:hover { background: var(--brand-soft); color: var(--brand); }
.dt-th.dt-filtered .dt-filter-btn { color: var(--brand); }
.dt-resize { position: absolute; right: -5px; top: 0; width: 10px; height: 100%; cursor: col-resize; z-index: var(--z-resize); touch-action: none; }
.dt-resize:hover { background: rgba(37,99,235,.18); }
.dt-td { padding: 7px 10px; border-bottom: 1px solid #f0f2f5; font-size: 12.5px; border-right: 1px solid #f3f5f8; min-width: 0; overflow: hidden; }
.dt-frozen { position: sticky; box-shadow: 2px 0 4px -2px rgba(15,23,42,.10); }
.dt-td.dt-frozen { z-index: var(--z-frozen-td); background: var(--panel); }
.dt-tbl tbody tr:hover td { background: #f6f9ff; }
.dt-clip { max-width: 520px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.dt-empty { color: var(--muted); }

/* 行虚拟化（§15/§29）：大表固定行高 31px，窗口外由等高占位行撑出滚动高度。
   ROW_H 常量与 grid.js 保持一致；行内容单行省略，不允许撑高。 */
.dt-tbl.dt-virt tbody tr:not(.dt-vsp) { height: 31px; }
.dt-tbl.dt-virt tbody tr:not(.dt-vsp) .dt-td { max-height: 31px; white-space: nowrap; }
.dt-vsp td { padding: 0 !important; border: 0 !important; background: transparent !important; font-size: 0 !important; line-height: 0 !important; }
.dt-vsp:hover td { background: transparent !important; }

/* §70 长文本自定义悬浮卡（替代浏览器原生 title） */
.sc-tip {
  position: fixed;
  z-index: var(--z-tip);
  max-width: 420px;
  padding: 8px 11px;
  background: #1f2937;
  color: #f9fafb;
  font-size: 12.5px;
  line-height: 1.5;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(15,23,42,.28);
  pointer-events: none;
  white-space: pre-wrap;
  word-break: break-word;
}
.sc-tip::after {
  content: '';
  position: absolute;
  top: -5px; left: 12px;
  border: 5px solid transparent;
  border-top: 0;
  border-bottom: 5px solid #1f2937;
}
.dt-norow { text-align: center; color: var(--muted); padding: 30px; }

/* 表头筛选弹层（可超出列宽，绝不撑坏列宽） */
.dt-filter-pop { display: none; position: absolute; top: 100%; left: 0; z-index: var(--z-dropdown); background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; box-shadow: 0 6px 20px rgba(0,0,0,.14); min-width: 180px; }
.dt-filter-pop.open { display: block; }
.dt-f-inp { width: 100%; box-sizing: border-box; border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; font-size: 12.5px; margin-bottom: 6px; }
.dt-f-list { max-height: 220px; overflow: auto; }
.dt-f-opt { display: flex; align-items: center; gap: 6px; font-size: 12.5px; padding: 3px 0; cursor: pointer; white-space: nowrap; }
.dt-f-acts { margin-top: 6px; text-align: right; }
.dt-f-clear { border: 1px solid var(--line); background: #fff; border-radius: 6px; padding: 3px 10px; font-size: 12px; cursor: pointer; }

/* 冻结右侧阴影 */
.dt-th.dt-frozen[style*="right:"] { box-shadow: -2px 0 4px -2px rgba(15,23,42,.10); }
.dt-td.dt-frozen[style*="right:"] { box-shadow: -2px 0 4px -2px rgba(15,23,42,.10); }

/* 全局搜索框 */
.dt-search { border: 1px solid var(--line); border-radius: 6px; padding: 6px 10px; font-size: 12.5px; min-width: 220px; }
.dt-search:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-soft); }

/* 激活筛选 chips */
.dt-chips { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; padding: 6px 12px 2px; }
.dt-chip { display: inline-flex; align-items: center; gap: 4px; background: var(--brand-soft); color: var(--brand); border: 1px solid var(--brand); border-radius: 999px; padding: 2px 8px; font-size: 11.5px; font-weight: 600; }
.dt-chip-x { cursor: pointer; opacity: .7; }
.dt-chip-x:hover { opacity: 1; }
.dt-chip-clear { border: 1px dashed var(--line); background: #fff; border-radius: 999px; padding: 2px 10px; font-size: 11.5px; cursor: pointer; color: var(--muted); }

/* 表头列菜单按钮 + 浮层 */
.dt-menu-btn { border: none; background: transparent; cursor: pointer; color: var(--muted); font-size: 11px; padding: 0 2px; border-radius: 4px; }
.dt-menu-btn:hover { background: var(--brand-soft); color: var(--brand); }
.dt-colmenu { position: absolute; top: 100%; left: 0; z-index: var(--z-dropdown); background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 4px; box-shadow: 0 8px 24px rgba(0,0,0,.16); min-width: 150px; display: flex; flex-direction: column; }
.dt-colmenu button { text-align: left; border: none; background: transparent; padding: 6px 8px; font-size: 12.5px; cursor: pointer; border-radius: 5px; }
.dt-colmenu button:hover { background: var(--brand-soft); color: var(--brand); }

/* 冻结标记 */
.dt-fz { font-size: 10px; color: var(--brand); }

/* 去重值自动汇总筛选列表 */
.dt-f-search { width: 100%; box-sizing: border-box; border: 1px solid var(--line); border-radius: 6px; padding: 5px 8px; font-size: 12px; margin-bottom: 6px; }
.dt-f-list { max-height: 230px; overflow: auto; }
.dt-f-val { color: var(--ink); }
.dt-f-cnt { margin-left: auto; color: var(--muted); font-size: 11px; background: #f0f3f7; border-radius: 999px; padding: 0 6px; }
.dt-f-opt { justify-content: flex-start; }
.dt-f-apply { border: 1px solid var(--brand); background: var(--brand); color: #fff; border-radius: 6px; padding: 4px 12px; font-size: 12px; cursor: pointer; }
.dt-f-op { padding: 4px 4px; }
.dt-f-row { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.dt-f-date { display: flex; flex-direction: column; gap: 4px; }

/* 列设置弹层内可拖拽列表 */
.dt-colpop-list { display: flex; flex-direction: column; gap: 2px; }
.dt-col-opt.dt-movable { cursor: grab; }
.dt-col-opt:not(.dt-movable) { cursor: default; opacity: .92; }
/* §18：表头主体 cursor: grab；拖拽进行中全局 grabbing */
.dt-th.dt-movable .dt-th-t { cursor: grab; }
body.dt-col-dragging, body.dt-col-dragging * { cursor: grabbing !important; user-select: none; }
.dt-col-opt-t { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dt-col-fz { margin-left: auto; border: 1px solid transparent; background: transparent; color: #cbd5e1; cursor: pointer; font-size: 11px; padding: 0 3px; border-radius: 4px; line-height: 1.2; }
.dt-col-fz:hover { background: var(--brand-soft); color: var(--brand); border-color: var(--line); }
.dt-col-fz.on { color: var(--brand); font-weight: 700; }
.dt-col-lock { font-size: 10px; opacity: .6; }

/* ===== §21 列换序视觉反馈：拖拽态 + 插入线 + 跟随标题 ===== */
.dt-th.dt-dragging { opacity: .45; background: #dbeafe !important; }
.dt-col-opt.dt-dragging { opacity: .45; }
.dt-th.dt-dl::before,
.dt-th.dt-dr::after,
.dt-col-opt.dt-dl::before,
.dt-col-opt.dt-dr::after {
  content: ''; position: absolute; top: 0; width: 3px; height: 100%;
  background: var(--brand); z-index: calc(var(--z-resize) + 5); pointer-events: none;
}
.dt-th.dt-dl::before, .dt-col-opt.dt-dl::before { left: -1px; }
.dt-th.dt-dr::after, .dt-col-opt.dt-dr::after { right: -1px; }
.dt-col-opt { position: relative; }
.dt-drag-title {
  position: fixed; z-index: var(--z-tip); display: none;
  padding: 4px 10px; background: #1f2937; color: #f9fafb;
  font-size: 12px; border-radius: 6px; pointer-events: none;
  box-shadow: 0 6px 18px rgba(15,23,42,.28); white-space: nowrap;
}

/* 保存视图 */
.dt-views-btn { border: 1px solid var(--line); background: #fff; border-radius: 6px; padding: 5px 10px; font-size: 12px; cursor: pointer; }
.dt-views-btn:hover { background: var(--brand-soft); color: var(--brand); }
.dt-views-pop { position: absolute; right: 0; top: 34px; z-index: var(--z-dropdown); background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 10px; box-shadow: 0 6px 20px rgba(0,0,0,.12); display: none; min-width: 200px; }
.dt-views-pop.open { display: block; }
.dt-views-save { display: flex; gap: 6px; margin-bottom: 8px; }
.dt-views-name { border: 1px solid var(--line); border-radius: 6px; padding: 5px 8px; font-size: 12px; flex: 1; }
.dt-views-save button { border: 1px solid var(--brand); background: var(--brand); color: #fff; border-radius: 6px; padding: 4px 10px; font-size: 12px; cursor: pointer; }
.dt-views-list { display: flex; flex-direction: column; gap: 4px; max-height: 200px; overflow: auto; }
.dt-view-item { display: flex; align-items: center; gap: 4px; }
.dt-view-item button { border: 1px solid var(--line); background: #fff; border-radius: 6px; padding: 4px 8px; font-size: 12px; cursor: pointer; flex: 1; text-align: left; }
.dt-view-item button:hover { background: var(--brand-soft); color: var(--brand); }
.dt-view-del { flex: 0 0 auto !important; color: var(--muted) !important; }
.dt-export-btn { border: 1px solid var(--line); background: #fff; border-radius: 6px; padding: 5px 10px; font-size: 12px; cursor: pointer; }
.dt-export-btn:hover { background: var(--brand-soft); color: var(--brand); }

/* 底栏分页 */
.dt-foot { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.dt-pager { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.dt-pager button { border: 1px solid var(--line); background: #fff; border-radius: 6px; padding: 4px 9px; font-size: 12px; cursor: pointer; }
.dt-pager button:hover:not([disabled]) { background: var(--brand-soft); color: var(--brand); }
.dt-pager button[disabled] { opacity: .4; cursor: not-allowed; }
.dt-pg-info { padding: 0 6px; font-variant-numeric: tabular-nums; }
.dt-pgsize { border: 1px solid var(--line); border-radius: 6px; padding: 3px 6px; font-size: 12px; }

/* 行选中 */
.dt-sel { text-align: center; }
.dt-th.dt-sel, .dt-td.dt-sel { background: #f7f9fc; }
.dt-sel-on > td { background: #eef4ff !important; }

/* 风险色（红/橙/黄/绿） */
.r-high { color: #d92d20; font-weight: 700; }
.r-mid  { color: #f08c00; font-weight: 700; }
.r-low  { color: #b58a00; }
.r-ok   { color: #1a7f37; font-weight: 600; }
td.r-high { background: #fdecea; }
td.r-mid  { background: #fff4e6; }
td.r-low  { background: #fffbe6; }
td.r-ok   { background: #eaf7ee; }

/* 状态徽标（页面级 render 使用） */
.badge { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; border: 1px solid transparent; white-space: nowrap; }
.badge-ready { background: #eaf7ee; color: #1a7f37; border-color: #b7e4c7; }
.badge-warn { background: #fff4e6; color: #b54708; border-color: #fcd9b6; }
.badge-danger { background: #fdecea; color: #b42318; border-color: #f9c8c2; }
.badge-info { background: #e7f0ff; color: #1d4ed8; border-color: #bcd2ff; }
.badge-muted { background: #eef1f5; color: #667; border-color: #dde3ea; }

/* 单元格下钻链接 */
.cell-link { color: var(--brand); cursor: pointer; }
.cell-link:hover { text-decoration: underline; }
.link-red { color: #b42318; }
.link-red:hover { color: #b42318; }
.num { text-align: right; font-variant-numeric: tabular-nums; }

/* 抽屉内 KPI 行 + 分区 */
.kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin: 10px 0; }
.kpi { background: #f7f9fc; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
.kpi-label { font-size: 11px; color: var(--muted); margin-bottom: 4px; }
.kpi-val { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.kpi-ok .kpi-val { color: #1a7f37; }
.kpi-high .kpi-val { color: #b42318; }
.kpi-low .kpi-val { color: #b58a00; }
.kpi-mid .kpi-val { color: #b54708; }
.drawer-sec { padding: 4px 2px; }
.drawer-sub { font-size: 12.5px; color: var(--muted); margin-bottom: 8px; }
.drawer-sec .sec-h { font-size: 13px; font-weight: 700; color: var(--ink); margin: 6px 0; }
.tbl-wrap { overflow-x: auto; margin-top: 4px; }
table.tbl { border-collapse: collapse; width: 100%; background: var(--panel); font-size: 12.5px; }
table.tbl th { background: #f3f6fb; color: var(--muted); font-weight: 600; text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.tbl td { padding: 6px 10px; border-bottom: 1px solid #f0f2f5; }
table.tbl tbody tr:hover td { background: #f6f9ff; }

/* 工具栏：左侧动作 / 右侧搜索筛选 */
.dt-toolbar { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.dt-toolbar-l { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.dt-toolbar-r { margin-left: auto; color: var(--muted); font-size: 12px; white-space: nowrap; position: relative; }

/* 详情表（订单/供应商全景）横向滚动 */
.tbl-wrap { overflow-x: auto; margin-top: 4px; }

/* ══════════════════════════════════════════════════════════
   供应链管理驾驶舱（可视化）
   ══════════════════════════════════════════════════════════ */
.cockpit-kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin: 12px 0; }
@media (max-width: 1200px) { .cockpit-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 900px) { .cockpit-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .cockpit-kpis { grid-template-columns: 1fr; } }
.ckpi { background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--line); border-radius: 10px; padding: 10px 12px; transition: box-shadow .15s, transform .15s; display: flex; align-items: center; gap: 10px; }
.ckpi-click { cursor: pointer; }
.ckpi-click:hover { box-shadow: 0 4px 16px rgba(15,23,42,.10); transform: translateY(-1px); }
.ckpi-ok { border-left-color: var(--green); }
.ckpi-warn { border-left-color: var(--amber); }
.ckpi-bad { border-left-color: var(--red); }
.ckpi-ico { flex: 0 0 auto; width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 700; color: #fff; background: var(--muted); }
.ckpi-ico-ok { background: var(--green); }
.ckpi-ico-warn { background: var(--amber); }
.ckpi-ico-bad { background: var(--red); }
.ckpi-body { min-width: 0; flex: 1; }
.ckpi-label { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ckpi-val { font-size: 26px; font-weight: 700; margin-top: 2px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.ckpi-sub { color: var(--muted); font-size: 11px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ckpi-go { color: var(--brand); font-size: 10.5px; margin-top: 4px; font-weight: 600; flex: 0 0 100%; }
.ckpi { flex-wrap: wrap; }

.cockpit-charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; margin-bottom: 14px; align-items: stretch; }
.cockpit-charts .hcard { min-height: 252px; display: flex; flex-direction: column; }
.cockpit-charts .hcard > :last-child { flex: 1; }
.chart-empty { padding: 30px; text-align: center; color: var(--muted); font-size: 12.5px; }

/* 环形图 */
.donut-wrap { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.donut-svg-box { position: relative; width: 160px; height: 160px; flex-shrink: 0; }
.donut-svg { display: block; flex-shrink: 0; }
.donut-seg { cursor: pointer; transition: opacity .15s; }
.donut-seg:hover { opacity: .8; }
.donut-center { position: absolute; inset: 0; width: 160px; height: 160px; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; }
.donut-cv { font-size: 22px; font-weight: 700; }
.donut-cs { font-size: 11px; color: var(--muted); }
.donut-legend { display: flex; flex-direction: column; gap: 4px; font-size: 12px; flex: 1; min-width: 120px; }
.lg { display: flex; align-items: center; gap: 6px; cursor: pointer; padding: 2px 4px; border-radius: 6px; }
.lg:hover { background: #f3f6fb; }
.lg-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.lg b { margin-left: auto; }

/* 横向条形 */
.hbar-box { display: flex; flex-direction: column; gap: 6px; }
.hbar-row { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.hbar-row:hover .hbar-k { color: var(--brand); }
.hbar-k { font-size: 12px; min-width: 120px; max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-track { flex: 1; height: 14px; background: var(--gray-bg); border-radius: 7px; overflow: hidden; min-width: 60px; }
.hbar-fill { display: block; height: 100%; border-radius: 7px; transition: width .3s; }
.hbar-v { font-size: 12px; font-weight: 600; min-width: 40px; text-align: right; white-space: nowrap; }
.hbar-sub { font-size: 10.5px; color: var(--muted); margin-left: 6px; font-weight: 400; }

/* 采购负责人交付情况（首页§25-§36） */
.bd-note { color: var(--muted); font-size: 11.5px; line-height: 1.6; margin-bottom: 10px; }
.bd-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.bd-table th, .bd-table td { padding: 7px 10px; text-align: right; border-bottom: 1px solid var(--line); }
.bd-table th:first-child, .bd-table td:first-child { text-align: left; }
.bd-table th { color: var(--muted); font-weight: 600; position: sticky; top: 0; background: var(--panel); }
.bd-table tbody tr { cursor: pointer; }
.bd-table tbody tr:hover { background: var(--hover); }
.bd-table .bd-bad { color: var(--red); font-weight: 600; }
.bd-table .bd-pending { color: #a16207; font-weight: 600; background: #fef9c3; }
.bd-rates { display: flex; flex-direction: column; gap: 14px; padding-top: 6px; }
.bd-rate { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.bd-rate:hover .bd-r-name { color: var(--brand); }
.bd-r-name { width: 80px; font-weight: 600; flex-shrink: 0; }
.bd-r-bars { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.bd-r-bar { display: flex; align-items: center; gap: 8px; }
.bd-r-lbl { width: 42px; color: var(--muted); font-size: 11px; }
.bd-r-track { flex: 1; height: 12px; background: var(--gray-bg); border-radius: 6px; overflow: hidden; min-width: 60px; }
.bd-r-fill { height: 100%; border-radius: 6px; }
.bd-r-fill.ok { background: var(--green); }
.bd-r-fill.bad { background: var(--red); }
.bd-r-val { width: 50px; text-align: right; font-size: 11.5px; font-variant-numeric: tabular-nums; font-weight: 600; }

/* 折线 */
.ln-wrap { width: 100%; }
.ln-svg { display: block; width: 100%; }
.ln-x { font-size: 9px; fill: var(--muted); }
.ln-y { font-size: 9px; fill: var(--muted); text-anchor: end; }
.ln-peak { font-size: 11.5px; color: var(--muted); margin-top: 4px; }
.ln-peak b { color: var(--ink); }

/* ===== 供应商到料计划工作台 ===== */
.sp-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 6px 0 8px; flex-wrap: wrap; }
.sp-title { font-size: 18px; font-weight: 700; }
.sp-sub { font-size: 12px; color: var(--muted); font-weight: 400; margin-left: 8px; }
.sp-actions { display: flex; gap: 8px; }
.sp-quick, .sp-views { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.chip { display: inline-block; padding: 4px 10px; border-radius: 14px; background: var(--panel-2); color: var(--ink); font-size: 12.5px; cursor: pointer; border: 1px solid transparent; user-select: none; }
.chip:hover { border-color: var(--line); }
.chip-on { background: var(--accent); color: #fff; }
.sp-search { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 10px; }
.sp-search .inp { min-width: 120px; }
.sp-body { min-height: 200px; }
.focus-chips { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.focus-chips .ckpi { min-width: 120px; flex: 1; padding: 8px 12px; }
.focus-chips .ckpi-label { font-size: 12px; }
.lk { color: var(--accent); cursor: pointer; text-decoration: none; }
.lk:hover { text-decoration: underline; }
.badge { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 12px; font-weight: 600; background: var(--panel-2); color: var(--ink); white-space: nowrap; }
.tone-ok { background: #dcfce7; color: #15803d; }
.tone-warn { background: #fef9c3; color: #a16207; }
.tone-danger { background: #ffedd5; color: #c2410c; }
.tone-bad { background: #fee2e2; color: #b42318; }
.tone-muted { background: #e5e7eb; color: #6b7280; }
.trace-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; margin-top: 8px; }
.trace-3 h4 { font-size: 13px; margin: 0 0 4px; }
.mini { width: 100%; border-collapse: collapse; font-size: 12px; }
.mini th, .mini td { border-bottom: 1px solid var(--line); padding: 3px 6px; text-align: left; }
.mini th { background: var(--panel-2); font-weight: 600; }
.mini td.r, .mini th.r { text-align: right; }
.form-row { display: flex; align-items: center; gap: 8px; margin: 6px 0; }
.form-row label { width: 96px; color: var(--muted); font-size: 13px; }
.form-row .inp { flex: 1; }
.sched { gap: 6px; }
.muted { color: var(--muted); font-size: 12.5px; }



/* ===== 企业表格统一增强：合计行 / 常用条件 / 筛选收起 / 恢复默认布局 ===== */
/* 合计行：吸底、与表头数据共用 colgroup 列宽模型、冻结列同步 */
.dt-sum { position: sticky; bottom: 0; z-index: var(--z-sum); }
.dt-sum-td { background: #f1f5f9; font-weight: 600; border-top: 2px solid var(--line); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; height: 35px; padding: 0 8px; font-size: 12.5px; }
.dt-sum-td.dt-frozen { z-index: var(--z-frozen-td); }
.dt-sum-label { color: var(--brand); }
/* 常用条件过滤 */
.dt-quick-btn, .dt-ftoggle { border: 1px solid var(--line); background: #fff; border-radius: 6px; padding: 5px 10px; font-size: 12.5px; cursor: pointer; }
.dt-quick-btn:hover, .dt-ftoggle:hover { background: var(--brand-soft); color: var(--brand); }
.dt-ftoggle.off { color: var(--muted); }
.dt-quick-pop { display: none; position: absolute; top: 36px; left: 0; z-index: var(--z-dropdown); background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 24px rgba(15,23,42,.12); min-width: 180px; padding: 4px; }
.dt-quick-pop.open { display: block; }
.dt-quick-item { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 7px 10px; font-size: 12.5px; border-radius: 6px; cursor: pointer; }
.dt-quick-item:hover { background: var(--brand-soft); color: var(--brand); }
.dt-toolbar-l { position: relative; display: flex; gap: 6px; align-items: center; }
/* 收起详细筛选：隐藏列头筛选/菜单入口，保留排序与拖宽 */
.dt-fcollapsed .dt-filter-btn, .dt-fcollapsed .dt-menu-btn { display: none; }
/* 列设置底部：恢复默认布局 */
.dt-colpop-f { border-top: 1px solid var(--line); padding: 6px 8px; }
.dt-resetlayout { width: 100%; border: 1px dashed var(--line); background: #fff; border-radius: 6px; padding: 6px; font-size: 12.5px; cursor: pointer; color: var(--muted); }
.dt-resetlayout:hover { color: var(--brand); border-color: var(--brand); }

/* ===== 一级导航：业务域 + 功能中心浮层 ===== */
.nav-item[data-haschildren] .nav-tx::after { content: ' ▸'; opacity: .5; font-size: 10px; }
.nav-fly { position: fixed; z-index: var(--z-navfly); background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 16px 48px rgba(15,23,42,.18); padding: 16px 18px; min-width: 560px; max-width: 760px; }
.nav-fly-h { font-size: 14px; font-weight: 700; margin-bottom: 10px; color: var(--text); }
.nav-fly-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px 20px; }
.nav-fly-g { min-width: 0; }
.nav-fly-gt { font-size: 12px; font-weight: 700; color: var(--muted); margin-bottom: 6px; border-bottom: 1px solid var(--line); padding-bottom: 4px; }
.nav-fly-it { display: block; padding: 5px 8px; border-radius: 6px; font-size: 13px; color: var(--text); cursor: pointer; white-space: nowrap; }
.nav-fly-it:hover { background: var(--brand-soft); color: var(--brand); }
.nav-fly-it.on { color: var(--brand); font-weight: 600; }

/* ==========================================================================
   生产订单详情 · 摘要卡片（§17~§22 手动换序 + 用户级记忆）
   ========================================================================== */
.card-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 2px 0 10px; font-size: 12.5px; }
.card-bar .muted { color: var(--muted); }
.kpi-card { cursor: grab; user-select: none; touch-action: none; transition: box-shadow .12s, transform .12s; }
.kpi-card.is-drill { cursor: pointer; }
.kpi-card:hover { box-shadow: 0 2px 10px rgba(15, 23, 42, .12); }
.kpi-card.dragging { opacity: .45; cursor: grabbing; }
.kpi-ghost { border: 2px dashed var(--brand); background: var(--brand-soft); border-radius: 8px; min-width: 130px; padding: 10px 12px; box-sizing: border-box; }
body.card-dragging { cursor: grabbing; }
body.card-dragging .kpi-card { cursor: grabbing; }

/* ============================================================
   供应商到料计划 —— 紧凑企业工作台（UI 重构）
   目标：顶部极小化、6 张横向椭圆立体卡、状态胶囊、单行工具栏、主表首屏
   ============================================================ */
.sp-page { display: flex; flex-direction: column; gap: 10px; height: 100%; min-height: 0; box-sizing: border-box; }

/* 标题行 */
.sp-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sp-titles { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.sp-title { font-size: 18px; font-weight: 700; margin: 0; color: var(--ink); line-height: 1.2; }
.sp-sub { font-size: 12px; color: var(--muted); }
.sp-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.sp-actions .btn { white-space: nowrap; height: 34px; display: inline-flex; align-items: center; }

/* 下拉菜单（导出 / 更多） */
.sp-drop { position: relative; }
.sp-menu { position: absolute; top: calc(100% + 5px); right: 0; min-width: 190px; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 24px rgba(15, 23, 42, .14); padding: 5px; z-index: var(--z-dropdown); }
.sp-menu[hidden] { display: none; }
.sp-mi { padding: 8px 11px; border-radius: 6px; font-size: 13px; cursor: pointer; color: var(--ink); }
.sp-mi:hover { background: var(--brand-soft); color: var(--brand); }

/* 六张椭圆立体摘要卡 */
.sp-summary { display: flex; gap: 10px; flex-wrap: wrap; }
.sp-kpi { flex: 1 1 0; min-width: 150px; display: flex; align-items: center; gap: 11px; padding: 12px 15px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line); box-shadow: 0 1px 4px rgba(15, 23, 42, .07); min-height: 78px; box-sizing: border-box; transition: box-shadow .15s, transform .15s; }
.sp-kpi:hover { box-shadow: 0 4px 14px rgba(15, 23, 42, .12); transform: translateY(-1px); }
.sp-kpi-ic { width: 38px; height: 38px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 18px; flex: 0 0 auto; }
.sp-kpi-tx { display: flex; flex-direction: column; min-width: 0; }
.sp-kpi-l { font-size: 12px; color: var(--muted); white-space: nowrap; }
.sp-kpi-v { font-size: 22px; font-weight: 700; line-height: 1.15; color: var(--ink); }
.kpi-blue .sp-kpi-ic { background: var(--brand-soft); } .kpi-blue .sp-kpi-v { color: var(--brand); }
.kpi-orange .sp-kpi-ic { background: #fff3e6; } .kpi-orange .sp-kpi-v { color: #c2410c; }
.kpi-green .sp-kpi-ic { background: var(--green-bg); } .kpi-green .sp-kpi-v { color: var(--green); }
.kpi-red .sp-kpi-ic { background: var(--red-bg); } .kpi-red .sp-kpi-v { color: var(--red); }
.kpi-purple .sp-kpi-ic { background: var(--purple-bg); } .kpi-purple .sp-kpi-v { color: var(--purple); }
.kpi-teal .sp-kpi-ic { background: #e0f7f4; } .kpi-teal .sp-kpi-v { color: #0f766e; }

/* 信息带：状态胶囊 + 工具栏 */
.sp-band { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.sp-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.sp-pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 13px; border-radius: 999px; background: var(--gray-bg); color: var(--muted); font-size: 12px; cursor: pointer; border: 1px solid transparent; user-select: none; transition: background .12s, border-color .12s; }
.sp-pill b { font-size: 13px; color: var(--ink); }
.sp-pill i { font-style: normal; }
.sp-pill:hover { border-color: var(--line); }
.sp-pill.on { background: var(--brand-soft); color: var(--brand); border-color: var(--brand); }
.sp-pill.on b, .sp-pill.on i { color: var(--brand); }
.pill-blue b, .pill-blue i { color: var(--brand); }
.pill-red b, .pill-red i { color: var(--red); }
.pill-amber b, .pill-amber i { color: var(--amber); }
.pill-amber2 b, .pill-amber2 i { color: #a16207; }
.pill-blue2 b, .pill-blue2 i { color: var(--brand); }

.sp-tools { display: flex; align-items: center; gap: 8px; flex: 1; justify-content: flex-end; min-width: 280px; }
.sp-search { flex: 1; min-width: 160px; max-width: 340px; height: 34px; box-sizing: border-box; }
.sp-view-label { font-size: 12px; color: var(--muted); flex: 0 0 auto; }
.sp-tools .sel { height: 34px; box-sizing: border-box; }
.sp-tools .btn { height: 34px; display: inline-flex; align-items: center; white-space: nowrap; }

/* 主表区域 */
.sp-body { flex: 1; min-height: 0; overflow: auto; }

/* 单个供应商导出列表（drawer） */
.sp-sup-list { max-height: 52vh; overflow: auto; margin-top: 6px; }
.sp-sup-row { display: flex; align-items: center; gap: 10px; padding: 6px 4px; border-bottom: 1px solid var(--line); }
.sp-sup-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.btn.sm { padding: 4px 11px; font-size: 12px; }

/* 导出按钮加载态 */
.btn.loading { opacity: .65; cursor: progress; }
.btn[disabled] { cursor: not-allowed; }

/* 行内操作链接 */
.op-link { color: var(--brand); }
.lk { color: var(--brand); cursor: pointer; }
.lk:hover { text-decoration: underline; }
.tone-bad { color: var(--red); }
.tone-ok { color: var(--green); }
.tone-warn { color: var(--amber); }
.tone-danger { color: #b91c1c; }
.tone-muted { color: var(--muted); }
.r-ok { color: var(--ink); font-variant-numeric: tabular-nums; }

/* ══════════════════════════════════════════════════════════
   PMC 计划分析 + 多因素证据化归因（P0 专项）—— 首页浅蓝区块
   ══════════════════════════════════════════════════════════ */
.pmc-block { background: #eef4ff; border: 1px solid #cfe0fd; border-radius: 12px; padding: 14px 16px 16px; margin-bottom: 18px; }
.pmc-block-h { font-size: 14px; font-weight: 700; margin-bottom: 12px; display: flex; align-items: baseline; gap: 10px; color: #1e3a8a; }
.pmc-block-h .home-sec-note { font-weight: 400; color: var(--muted); }
.pmc-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 1200px) { .pmc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 720px) { .pmc-grid { grid-template-columns: 1fr; } }
/* 四卡等高：卡片纵向弹性布局，底部说明统一贴底（指令#19） */
.pmc-card { background: #fff; border: 1px solid #dbe7fb; border-radius: 10px; padding: 12px 14px; display: flex; flex-direction: column; }
.pmc-card-wide { grid-column: auto; margin-top: 0; }
.pmc-sub-h { font-weight: 600; font-size: 11.5px; color: var(--ink); margin: 8px 0 4px; padding-left: 7px; border-left: 3px solid var(--brand); display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
/* 统计口径标签：明确每个百分比的分母，避免跨口径误读（指令#12/#13/#16） */
.pmc-scope { font-weight: 400; font-size: 10.5px; color: var(--muted); }
/* 可信度条（归因覆盖率 / Promise 覆盖率） */
.pmc-cov { display: flex; flex-wrap: wrap; gap: 4px 12px; background: var(--brand-soft); border: 1px solid #dbe7fb; border-radius: 8px; padding: 7px 10px; font-size: 11.5px; color: var(--ink); margin-bottom: 8px; }
.pmc-cov b { font-weight: 700; font-variant-numeric: tabular-nums; }
.pmc-cov-pct b { color: var(--brand); }
.pmc-cov-4 { gap: 4px 10px; }
.pmc-warn { background: #fff7ed; border: 1px solid #fed7aa; color: #9a3412; border-radius: 8px; padding: 6px 10px; font-size: 11px; margin-bottom: 8px; line-height: 1.5; }
/* 待完善证据：浅紫信息区，与业务根因明确分离（指令#7） */
.pmc-evidence { background: #f5f3ff; border: 1px solid #ddd6fe; border-radius: 8px; padding: 7px 10px; margin-top: 8px; }
.pmc-ev-h { font-size: 11.5px; font-weight: 700; color: #5b21b6; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.pmc-ev-h b { font-variant-numeric: tabular-nums; }
.pmc-ev-items { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 4px; font-size: 11px; color: #4c1d95; }
.pmc-ev-item { white-space: nowrap; cursor: help; }
.pmc-ev-item b { font-variant-numeric: tabular-nums; }
.pmc-card-h { font-weight: 700; font-size: 13px; margin-bottom: 4px; display: flex; align-items: center; gap: 8px; color: #1e3a8a; }
.pmc-card-sub { color: var(--muted); font-size: 11.5px; margin-bottom: 8px; }
.pmc-note { color: var(--muted); font-size: 11px; line-height: 1.6; margin-top: auto; padding-top: 8px; }
.pmc-toggle { margin-left: auto; display: inline-flex; gap: 4px; }
.pmc-tg { border: 1px solid #cfe0fd; background: #fff; color: var(--muted); border-radius: 6px; padding: 3px 10px; font-size: 11.5px; cursor: pointer; }
.pmc-tg.on { background: var(--brand); color: #fff; border-color: var(--brand); }
/* 可下钻的条（订单紧急性/采购/承诺/根因） */
.pmc-bar { cursor: pointer; border-radius: 6px; }
.pmc-bar:hover { background: #f3f8ff; }
.pmc-bar:hover .bar-k { color: var(--brand); }
.pmc-bar .bar-pct { color: var(--muted); font-size: 10.5px; font-weight: 400; margin-left: 2px; }
.pmc-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.pmc-chip { background: var(--brand-soft); color: var(--brand); border: 1px solid #cfe0fd; border-radius: 999px; padding: 3px 11px; font-size: 11.5px; cursor: pointer; font-weight: 600; }
.pmc-chip:hover { background: var(--brand); color: #fff; }
.pmc-chip b { font-weight: 700; }
/* 三层归因详情 */
.kv-box { background: #fbfcfe; border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; }
.pmc-biz-row { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px dashed var(--line); flex-wrap: wrap; }
.pmc-biz-label { font-weight: 600; font-size: 12.5px; }
.pmc-role { font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 8px; background: var(--gray-bg); color: var(--muted); }
.pmc-role-主因 { background: #fdecea; color: #b42318; }
.pmc-role-次因 { background: #fff4e6; color: #b54708; }
.pmc-role-影响因素 { background: #e7f0ff; color: #1d4ed8; }
.pmc-role-AI候选 { background: var(--purple-bg); color: var(--purple); }
.pmc-role-责任 { background: #e7f0ff; color: #1d4ed8; }
.pmc-rc-row { cursor: pointer; }
.pmc-rc-row:hover td { background: #eef4ff; }
.tl-bad .tl-dot { background: var(--red); }
.tl-bad .tl-v b { color: var(--red); }

/* ══════════════════════════════════════════════════════════
   原因字典 / AI 备注识别（P0 专项管理页）
   ══════════════════════════════════════════════════════════ */
.cd-form .form-row { display: flex; align-items: center; gap: 10px; margin: 8px 0; }
.cd-form .form-row label { width: 92px; color: var(--muted); font-size: 13px; flex-shrink: 0; }
.cd-form .inp { flex: 1; min-width: 0; }
.cd-form textarea.inp { font-family: inherit; }
.cd-remark { background: #fbfcfe; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin-bottom: 10px; }
.cd-remark-h { font-size: 12.5px; font-weight: 600; color: var(--ink); margin-bottom: 4px; }
.cd-remark-text { font-size: 12px; color: var(--muted); line-height: 1.6; margin-bottom: 8px; background: #f1f5f9; border-radius: 6px; padding: 6px 9px; }
.cd-cand-row { display: flex; align-items: center; gap: 7px; padding: 5px 0; border-top: 1px dashed var(--line); flex-wrap: wrap; }
.cd-cand-acts { margin-left: auto; display: flex; gap: 6px; }


/* ══════════════════════════════════════════════════════════════
   P0 最终视觉整改 —— 统一 Dashboard Card / Chart 设计系统
   白色卡片 · 12px 圆角 · 浅边框轻阴影 · 卡片间距 12~16px
   ══════════════════════════════════════════════════════════════ */

/* ---------- 通用卡片 ---------- */
.ck { background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  padding: 13px 15px; box-shadow: 0 1px 2px rgba(15,23,42,.04);
  display: flex; flex-direction: column; min-width: 0; }
.ck-h { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; min-height: 22px; }
.ck-t { font-size: 13.5px; font-weight: 700; color: var(--ink); letter-spacing: .01em; }
.ck-tag { font-size: 10.5px; font-weight: 600; color: var(--brand); background: var(--brand-soft);
  border-radius: 4px; padding: 2px 6px; white-space: nowrap; }
.ck-total { font-size: 12px; font-weight: 700; color: var(--muted); }
.ck-info { border: 1px solid var(--line); background: var(--panel); color: var(--muted); cursor: pointer;
  border-radius: 50%; width: 17px; height: 17px; line-height: 1; font-size: 11px; padding: 0; }
.ck-info:hover { color: var(--brand); border-color: var(--brand); }
.ck-n { color: var(--muted); font-size: 11.5px; line-height: 1.5; margin-bottom: 8px; }
.ck-n b { color: var(--ink); }
.ck-b { flex: 1; min-height: 0; display: flex; flex-direction: column; justify-content: center; }
.ck-h260 { min-height: 248px; }
.ck-h300 { min-height: 272px; max-height: 300px; }
.ck-row { display: grid; gap: 12px; margin-bottom: 14px; }
.ck-row-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ck-row-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1400px) { .ck-row-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 1100px) { .ck-row-3 { grid-template-columns: 1fr; } .ck-row-4 { grid-template-columns: 1fr; } }

/* ---------- 6 核心 KPI（90~115px）---------- */
.ck-kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
@media (max-width: 1500px) { .ck-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 820px) { .ck-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.ck-kpi { background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 13px; display: flex; align-items: center; gap: 11px; min-height: 96px; max-height: 112px;
  box-shadow: 0 1px 2px rgba(15,23,42,.04); transition: box-shadow .15s, transform .15s; }
.ck-kpi:hover { box-shadow: 0 4px 14px rgba(15,23,42,.10); transform: translateY(-1px); }
.ck-kpi-ico { flex: 0 0 auto; width: 34px; height: 34px; border-radius: 50%; display: flex;
  align-items: center; justify-content: center; font-size: 13.5px; font-weight: 700; color: #fff; }
.ck-kpi-b { min-width: 0; flex: 1; }
.ck-kpi-l { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ck-kpi-v { font-size: 25px; font-weight: 700; line-height: 1.15; margin-top: 1px; font-variant-numeric: tabular-nums; color: var(--ink); }
.ck-kpi-s { color: var(--muted); font-size: 11px; margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ck-blue .ck-kpi-ico { background: #2563eb; } .ck-green .ck-kpi-ico { background: #15803d; }
.ck-amber .ck-kpi-ico { background: #b45309; } .ck-red .ck-kpi-ico { background: #b42318; }
.ck-purple .ck-kpi-ico { background: #6d28d9; }

/* ---------- 图表容器 ---------- */
.ck .donut-wrap { gap: 10px; }
.ck .donut-svg { width: 130px; height: 130px; }
.ck .hbar-box { max-height: 232px; overflow-y: auto; }
.ck-h260 .hbar-box { max-height: 178px; }
.ck .ln-peak { font-size: 11px; color: var(--muted); margin-top: 4px; text-align: right; }

/* ---------- 小样本标注 n=X ---------- */
.nmark { display: inline-block; font-size: 10px; color: var(--muted); background: var(--gray-bg);
  border-radius: 3px; padding: 0 4px; margin-left: 3px; font-weight: 600; }

/* ---------- 近期待料提醒 6 紧凑卡（80~100px）---------- */
.mini-kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 1200px) { .mini-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.mini-kpi { background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--line);
  border-radius: 10px; padding: 9px 11px; min-height: 80px; max-height: 100px; cursor: pointer;
  display: flex; flex-direction: column; justify-content: center; }
.mini-kpi:hover { box-shadow: 0 3px 12px rgba(15,23,42,.09); }
.mk-l { color: var(--muted); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mk-v { font-size: 20px; font-weight: 700; margin-top: 2px; font-variant-numeric: tabular-nums; }
.mk-blue { border-left-color: #2563eb; } .mk-amber { border-left-color: #b45309; }
.mk-red { border-left-color: #b42318; } .mk-purple { border-left-color: #6d28d9; }
.mk-tip { margin-top: 8px; font-size: 11.5px; color: var(--muted); }
.mk-tip b { color: var(--ink); }

/* ---------- 今日重点行动（行高 36~44px）---------- */
.act-table th, .act-table td { padding: 6px 9px; font-size: 12.5px; }
.act-table tbody tr { height: 40px; }
.act-tr { cursor: pointer; }
.act-tr:hover { background: var(--hover); }
.act-obj { font-weight: 600; max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.act-issue { color: var(--muted); max-width: 380px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.act-date { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- PMC 浅蓝大区 ---------- */
.pmc-block { background: #eef4ff; border: 1px solid #cfe0fd; border-radius: 12px; padding: 14px 16px 16px; margin-bottom: 14px; }
.pmc-block-h { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin-bottom: 12px; }
.pmc-block-t { min-width: 0; }
.pmc-title { font-size: 14.5px; font-weight: 700; color: #1e3a8a; }
.pmc-subtitle { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.pmc-top-metrics { display: flex; gap: 16px; flex-wrap: wrap; }
.ptm { display: flex; flex-direction: column; background: #fff; border: 1px solid #dbe7fb;
  border-radius: 8px; padding: 5px 11px; min-width: 96px; }
.ptm i { font-style: normal; font-size: 10.5px; color: var(--muted); }
.ptm b { font-size: 16px; color: #1e3a8a; line-height: 1.25; font-variant-numeric: tabular-nums; }
.ptm em { font-style: normal; font-size: 10px; color: var(--muted); }

/* ---------- PMC 卡内元素 ---------- */
.pmc-donut { display: flex; justify-content: center; }
.pmc-donut .donut-svg { width: 116px; height: 116px; }
.pmc-donut .donut-cv { font-size: 18px; }
.pmc-donut .donut-legend { gap: 3px 10px; }
.pmc-minis { display: flex; flex-direction: column; gap: 3px; margin-top: 7px; }
.pmc-mini { display: flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--muted); }
.pmc-mini b { color: var(--ink); font-variant-numeric: tabular-nums; }
.pmc-mini i { font-style: normal; margin-left: auto; font-variant-numeric: tabular-nums; }
.pmc-mini-dot { width: 8px; height: 8px; border-radius: 2px; flex: 0 0 auto; }
.pmc-mini-l { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pmc-cov-pct.big { font-size: 13px; text-align: center; margin-top: 6px; color: var(--muted); }
.pmc-cov-pct.big b { font-size: 19px; color: #1e3a8a; }
.pmc-covline { text-align: center; font-size: 11px; color: var(--muted); margin-top: 2px; }
.pmc-covline b { color: var(--ink); font-variant-numeric: tabular-nums; }
.pmc-cred { display: flex; flex-wrap: wrap; gap: 4px 10px; background: #f6f9ff; border: 1px solid #dbe7fb;
  border-radius: 7px; padding: 5px 9px; font-size: 11px; color: var(--muted); margin-bottom: 6px; }
.pmc-cred b { color: #1e3a8a; font-variant-numeric: tabular-nums; }
.pmc-kv { display: flex; align-items: baseline; gap: 5px; font-size: 11.5px; color: var(--muted); margin-top: 6px; }
.pmc-kv b { color: var(--ink); font-variant-numeric: tabular-nums; }

/* ---------- 计划窗口紧凑柱状图 ---------- */
.mc-wrap { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px;
  align-items: end; height: 126px; padding-top: 4px; }
.mc { display: flex; flex-direction: column; align-items: center; height: 100%; cursor: pointer; min-width: 0; }
.mc:hover { opacity: .82; }
.mc-v { font-size: 11.5px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink); }
.mc-bar { width: 100%; max-width: 34px; border-radius: 3px 3px 0 0; margin-top: 2px; min-height: 3px;
  transition: height .25s; }
.mc-l { font-size: 10.5px; color: var(--muted); margin-top: 3px; text-align: center; line-height: 1.25; }
.mc-p { font-size: 10px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------- 顶部徽标行 ---------- */
.home-badges { display: flex; gap: 6px; }

/* ══════════ 原因字典 / AI候选工作台（P0 最终视觉整改）══════════ */
.cd-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 10px; }
.cd-h1 { font-size: 19px; font-weight: 700; }
.cd-sub { color: var(--muted); font-size: 12px; margin-top: 3px; }
.cd-head-acts { display: flex; gap: 8px; flex-shrink: 0; }
.cd-sec { background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  padding: 14px 16px 16px; margin-bottom: 14px; }
.cd-sec-h { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px;
  padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.cd-sec-t { font-size: 14px; font-weight: 700; }
.cd-sec-n { color: var(--muted); font-size: 11.5px; margin-left: auto; }
.cd-filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.cd-filters .inp { width: auto; min-width: 128px; flex: 0 0 auto; }
.cd-filters #cdDictQ, .cd-filters #cdFQ { flex: 1; min-width: 180px; max-width: 320px; }

.cd-tbl-wrap { max-height: 560px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; }
.cd-dict-table th, .cd-cand-table th { position: sticky; top: 0; background: #f8fafc; z-index: var(--z-sticky-th); }
.cd-dict-table td, .cd-cand-table td { padding: 6px 9px; vertical-align: middle; }
.cd-dict-table tbody tr, .cd-cand-table tbody tr { height: 38px; }
.cd-dict-tr:hover, .cd-cand-tr:hover { background: var(--hover); }
.cd-cat { display: inline-block; color: #fff; font-size: 11px; font-weight: 700;
  border-radius: 4px; padding: 1px 7px; }
.cd-dict-name b { font-weight: 600; }
.cd-dict-desc { display: block; color: var(--muted); font-size: 11px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 420px; }

/* AI 候选工作台 */
.cd-stats { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.cd-stat { background: var(--panel); border: 1px solid var(--line); border-radius: 8px;
  padding: 5px 12px; cursor: pointer; display: flex; flex-direction: column; align-items: flex-start; min-width: 84px; }
.cd-stat:hover { border-color: var(--brand); }
.cd-stat.on { border-color: var(--brand); background: var(--brand-soft); }
.cd-stat i { font-style: normal; font-size: 10.5px; color: var(--muted); }
.cd-stat b { font-size: 17px; font-variant-numeric: tabular-nums; }
.cd-stat.s-amber b { color: var(--amber); } .cd-stat.s-red b { color: var(--red); }
.cd-stat.s-blue b { color: var(--brand); } .cd-stat.s-gray b { color: var(--muted); }
.cd-stat-note { margin-left: auto; font-size: 11.5px; color: var(--muted); }

.cd-bulkbar { display: flex; align-items: center; gap: 10px; padding: 7px 10px;
  background: #f8fafc; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.cd-check { display: flex; align-items: center; gap: 5px; font-size: 12px; }
.cd-selinfo { font-size: 12px; font-weight: 600; }
.cd-sel-lbl { font-size: 11px; color: var(--muted); }
.cd-seltags { display: flex; gap: 4px; flex-wrap: wrap; flex: 1; }

.cd-tag { display: inline-flex; align-items: center; gap: 4px; font-size: 11px;
  border-radius: 4px; padding: 2px 6px; margin: 1px 2px 1px 0; border: 1px solid var(--line); background: #f8fafc; }
.cd-tag i { font-style: normal; font-size: 10px; font-weight: 700; }
.cd-tag em { font-style: normal; font-size: 10px; color: var(--muted); }
.cd-tag-pend { background: var(--amber-bg); border-color: #f3d9a4; color: #92400e; }
.cd-tag-ok { background: var(--green-bg); border-color: #b7e0c4; color: #14532d; }
.cd-tag-off { background: var(--gray-bg); color: var(--muted); }

.cd-c-po { font-weight: 600; font-variant-numeric: tabular-nums; }
.cd-c-sup, .cd-c-mat { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 150px; }
.cd-c-rem { max-width: 0; width: 34%; cursor: pointer; }
.cd-rem-clamp { display: block; color: var(--muted); font-size: 11.5px; line-height: 1.4;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cd-c-rem:hover .cd-rem-clamp { color: var(--ink); }
.cd-c-tags { white-space: normal; }
.cd-c-date { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.cd-c-act { white-space: nowrap; }
.cd-tr-done { opacity: .72; }
.cd-done { color: var(--muted); }
.cd-c-c { text-align: center; }
.cd-hint { margin-top: 7px; font-size: 11px; color: var(--muted); }
.cd-drawer-remark { background: #f1f5f9; border-radius: 6px; padding: 10px 12px;
  font-size: 12.5px; line-height: 1.7; white-space: pre-wrap; word-break: break-word; }

/* ════════ 齐套执行分析（P0 最终实施 §84）════════ */
.kit-exec { margin-top: 14px; }
.ck-block { background: var(--card, #fff); border: 1px solid var(--line, #e2e8f0); border-radius: 12px; padding: 14px 16px; margin-top: 14px; }
.ck-block-h { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.ck-block-t { display: flex; flex-direction: column; }
.ck-title { font-size: 15px; font-weight: 700; color: var(--ink, #0f172a); }
.ck-subtitle { font-size: 11.5px; color: var(--muted, #64748b); margin-top: 2px; }
.ck-row { display: grid; gap: 14px; }
.ck-row-2 { grid-template-columns: 1fr 1fr; }
@media (max-width: 1100px) { .ck-row-2 { grid-template-columns: 1fr; } }
.ck-h320 { min-height: 320px; }
.kit-trend { margin-top: 8px; max-height: 180px; overflow: auto; }

/* 齐套管理页顶部 KPI 条 */
.kit-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 12px; }
@media (max-width: 900px) { .kit-strip { grid-template-columns: repeat(2, 1fr); } }
.ks { background: var(--card, #fff); border: 1px solid var(--line, #e2e8f0); border-left: 4px solid var(--muted); border-radius: 10px; padding: 10px 14px; cursor: pointer; }
.ks:hover { box-shadow: 0 2px 10px rgba(15,23,42,.08); }
.ks-green { border-left-color: #15803d; } .ks-amber { border-left-color: #b45309; }
.ks-red { border-left-color: #b42318; } .ks-purple { border-left-color: #6d28d9; } .ks-gray { border-left-color: #94a3b8; }
.ks-l { font-size: 12px; color: var(--muted); }
.ks-v { font-size: 22px; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; line-height: 1.2; }
.ks-s { font-size: 11px; color: var(--muted); margin-top: 2px; }

.btn-danger { background: #b42318; border-color: #b42318; color: #fff; }
.btn-danger:hover { background: #8f1d14; }

/* ===== Phase 2：Supplier Promise 采购操作界面 ===== */
.promise-ro { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px 14px; background: var(--panel-2, #f7f9fc); border: 1px solid var(--line, #e3e8ef); border-radius: 8px; padding: 10px 12px; margin-bottom: 10px; }
.promise-ro .kv { display: flex; flex-direction: column; gap: 1px; }
.promise-ro .kv .k { font-size: 11px; color: var(--muted, #64748b); }
.promise-ro .kv .v { font-size: 13px; color: var(--ink, #0f172a); font-weight: 600; word-break: break-all; }
.form-row { display: flex; align-items: center; gap: 8px; margin: 8px 0; flex-wrap: wrap; }
.form-row > label { min-width: 92px; font-size: 13px; color: var(--muted, #475569); }
.form-row .inp, .form-row .sel { flex: 1; min-width: 160px; }
.form-row.sched .s-date { flex: 1.2; } .form-row.sched .s-qty { flex: 1; }
.req { color: #dc2626; margin-left: 2px; }
#promise-sched { margin: 6px 0; }
#promise-sched .sched { background: var(--panel-2, #f7f9fc); border: 1px solid var(--line, #e3e8ef); border-radius: 6px; padding: 6px 8px; }
.cur-promise { background: #eef6ff; border: 1px solid #c7ddf7; border-radius: 6px; padding: 8px 10px; font-size: 12.5px; color: #1e3a5f; margin: 6px 0; }
.change-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px 12px; background: #fbfdff; border: 1px dashed #bcd3ee; border-radius: 8px; padding: 10px; margin: 8px 0; }
.change-facts .cf { display: flex; flex-direction: column; gap: 2px; }
.change-facts .cf span { font-size: 11px; color: var(--muted, #64748b); }
.change-facts .cf b { font-size: 14px; color: var(--ink, #0f172a); font-variant-numeric: tabular-nums; }
.op-row { align-items: center; }
.op-by { font-size: 11.5px; color: var(--muted, #64748b); margin-left: 6px; }
.v-msg { color: #b45309; font-size: 12.5px; margin: 3px 0; }
#p-validate { margin: 4px 0; }
.tabs { display: flex; gap: 6px; margin: 8px 0; border-bottom: 1px solid var(--line, #e3e8ef); }
.tab { background: none; border: none; padding: 7px 14px; font-size: 13px; color: var(--muted, #64748b); cursor: pointer; border-bottom: 2px solid transparent; }
.tab.on { color: var(--accent, #2563eb); border-bottom-color: var(--accent, #2563eb); font-weight: 700; }
/* 批量录入工具条 */
.sp-batchbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: #fff7ed; border: 1px solid #fed7aa; border-radius: 8px; padding: 8px 12px; margin: 8px 0; }
.sp-batch-tip { font-size: 13px; color: #9a3412; }
.sp-batch-tip b { color: #c2410c; }
.sp-batchbar label { font-size: 12px; color: var(--muted, #475569); display: flex; align-items: center; gap: 4px; }
.sp-batchbar .inp, .sp-batchbar .sel { padding: 4px 6px; }
.sp-batch-msg { font-size: 12.5px; color: #15803d; }

/* ---- 登录层（第一阶段：测试网页环境）---- */
#loginLayer { position: fixed; inset: 0; z-index: 9998; background: linear-gradient(160deg, #0f172a 0%, #1e293b 60%, #0f172a 100%);
  display: flex; align-items: center; justify-content: center; }
.login-card { width: 340px; background: var(--panel); border-radius: 12px; padding: 28px 26px;
  box-shadow: 0 18px 50px rgba(2, 6, 23, .55); display: flex; flex-direction: column; gap: 12px; }
.login-title { font-size: 18px; font-weight: 700; text-align: center; color: var(--ink); }
.login-sub { font-size: 12px; color: var(--muted); text-align: center; margin-bottom: 4px; }
.login-card .inp { width: 100%; padding: 9px 10px; font-size: 13px; }
.login-err { font-size: 12px; color: var(--red); background: var(--red-bg); border-radius: 6px; padding: 6px 9px; }
/* §P0 正式员工登录页：品牌 / 标题 / 测试环境标识 / 字段标签 / 底部说明 */
.login-brand { font-size: 12px; font-weight: 600; color: var(--muted); text-align: center; letter-spacing: 3px; margin-bottom: 8px; }
.login-title { font-size: 20px; font-weight: 700; text-align: center; color: var(--ink); letter-spacing: 1px; }
.login-env { font-size: 11px; color: #b26a00; background: #fff5e6; border: 1px solid #ffd591; border-radius: 6px; padding: 5px 8px; text-align: center; margin: 10px 0 4px; }
.login-lb { display: block; font-size: 12px; color: var(--muted); margin: 12px 0 5px; }
.login-foot { font-size: 11px; color: var(--muted); text-align: center; margin-top: 14px; line-height: 1.6; }
#loginLayer { position: fixed; inset: 0; z-index: 10000; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #0f2f5c 0%, #1a4f8a 100%); }
.user-chip { font-weight: 600; color: var(--brand); background: var(--brand-soft); border-radius: 12px; padding: 4px 12px; font-size: 12px; user-select: none; }
.env-badge { background: var(--amber, #b45309); color: #fff; font-size: 11px; font-weight: 700;
  border-radius: 4px; padding: 3px 8px; letter-spacing: 1px; user-select: none; }
/* P0 收口：动态环境标识（REAL=绿 / TEST=黄 / TEMP·未知=红） */
.env-badge.env-real { background: #15803d; }
.env-badge.env-test { background: var(--amber, #b45309); }
.env-badge.env-temp, .env-badge.env-unknown { background: #b91c1c; animation: envPulse 1.6s ease-in-out infinite; }
@keyframes envPulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.72; } }

/* ===== P0 管理员后台：账号与权限管理（admin-users） ===== */
.au-tabs { display: flex; gap: 4px; margin-bottom: 10px; border-bottom: 2px solid var(--line); }
.au-tab { border: none; background: none; padding: 8px 16px; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -2px; }
.au-tab.on { color: var(--brand); border-bottom-color: var(--brand); }
.au-toolbar { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; flex-wrap: wrap; }
.au-toolbar .inp { width: auto; }
.au-ops a { margin-right: 8px; font-size: 12px; }
.au-ops .au-danger { color: var(--red); }
.au-form { display: flex; flex-direction: column; gap: 4px; padding: 4px 2px; }
.au-form label { font-size: 12px; color: var(--muted); margin-top: 8px; display: flex; justify-content: space-between; align-items: center; }
.au-form .inp { width: 100%; }
.au-check { font-size: 12px; min-height: 16px; margin-top: 2px; }
.au-check.good { color: var(--green, #1a7f37); }
.au-check.bad { color: var(--red); }
.au-eye { border: 1px solid var(--line); background: var(--panel-2); border-radius: 4px; font-size: 11px; padding: 1px 8px; cursor: pointer; }
.au-sub { font-weight: 700; font-size: 13px; margin: 14px 0 6px; color: var(--ink); }
.au-code { color: var(--muted); font-size: 10px; margin-left: 6px; font-family: Consolas, monospace; }
.au-good { color: var(--green, #1a7f37); font-size: 12px; }
.au-bad { color: var(--muted); font-size: 12px; }
.au-ovsel { width: auto !important; font-size: 12px; padding: 2px 6px !important; }
.au-role-wrap { display: flex; gap: 14px; align-items: flex-start; }
.au-role-list { width: 210px; flex: none; display: flex; flex-direction: column; gap: 6px; }
.au-role-it { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; cursor: pointer; background: var(--panel); display: flex; flex-direction: column; gap: 2px; }
.au-role-it.on { border-color: var(--brand); background: var(--brand-soft); }
.au-role-it .au-cnt { font-size: 11px; color: var(--muted); }
.au-role-tree { flex: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.au-pgroup { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; background: var(--panel); }
.au-pmod { font-weight: 700; font-size: 13px; margin-bottom: 6px; }
.au-pitem { display: flex; align-items: center; gap: 6px; padding: 4px 0; font-size: 13px; cursor: pointer; }
.au-pitem.au-locked { opacity: .6; cursor: not-allowed; }

/* ===== 首页「生产齐套执行」驾驶舱（kx-*，最终指令 §28~§57） ===== */
.kx-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 10px; }
.kx-kpi { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; min-height: 110px; max-height: 130px;
  box-shadow: 0 1px 2px rgba(15,23,42,.04); cursor: pointer; display: flex; flex-direction: column; justify-content: space-between;
  border-top: 3px solid var(--line); transition: box-shadow .15s; }
.kx-kpi:hover { box-shadow: 0 3px 10px rgba(15,23,42,.10); }
.kx-blue { border-top-color: #2563eb; } .kx-green { border-top-color: #15803d; }
.kx-amber { border-top-color: #b45309; } .kx-red { border-top-color: #ea580c; }
.kx-kpi-l { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; font-weight: 600; }
.kx-kpi-v { font-size: 28px; font-weight: 800; color: var(--ink); line-height: 1.15; letter-spacing: -.5px; }
.kx-blue .kx-kpi-v { color: #2563eb; } .kx-green .kx-kpi-v { color: #15803d; }
.kx-amber .kx-kpi-v { color: #b45309; } .kx-red .kx-kpi-v { color: #ea580c; }
.kx-kpi-s { font-size: 11px; color: var(--muted); }
.kx-info { border: none; background: none; color: #94a3b8; font-size: 11px; cursor: pointer; padding: 0 2px; }
.kx-info:hover { color: var(--brand); }
.kx-hint { display: flex; align-items: center; gap: 10px; background: #f8fafc; border: 1px solid var(--line);
  border-radius: 8px; padding: 8px 14px; min-height: 42px; font-size: 12px; color: var(--muted); margin-bottom: 12px; }
.kx-hint-act { margin-left: auto; display: flex; gap: 8px; }
.kx-hint-actions .kx-hint-label { font-weight: 700; color: var(--ink); }
.kx-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.kx-hint-chip { display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; padding: 3px 12px; font-size: 12px; cursor: pointer; border: 1px solid var(--line); background: var(--panel); }
.kx-hint-chip b { font-size: 13px; }
.kx-hint-chip.kx-red { color: #b42318; border-color: #f9c8c2; background: #fdecea; }
.kx-hint-chip.kx-amber { color: #b54708; border-color: #fcd9b6; background: #fff4e6; }
.kx-hint-chip.kx-purple { color: #6d28d9; border-color: #ddd6fe; background: #f5f3ff; }
.kx-hint-chip.kx-green { color: #1a7f37; border-color: #b7e4c7; background: #eaf7ee; }
.kx-row-main { display: grid; grid-template-columns: 62fr 38fr; gap: 12px; margin-bottom: 12px; align-items: stretch; }
.kx-trend-card, .kx-f7-card { display: flex; flex-direction: column; }
.kx-range { display: inline-flex; gap: 2px; margin-left: 10px; }
.kx-rbtn { border: 1px solid var(--line); background: var(--panel); border-radius: 6px; font-size: 11px; padding: 2px 10px; cursor: pointer; color: var(--muted); }
.kx-rbtn.on { background: var(--brand-soft); color: var(--brand); border-color: var(--brand); font-weight: 700; }
.kx-chart { width: 100%; height: auto; }
.kx-legend { display: flex; gap: 16px; font-size: 11px; color: var(--muted); padding: 4px 2px 0; }
.kx-legend .lg { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 4px; vertical-align: -1px; }
.lg-total { background: #bfdbfe; } .lg-kit { background: #15803d; } .lg-line { background: #b45309; height: 3px; border-radius: 2px; }
.kx-trend-mini { max-height: 150px; margin-top: 6px; }
.kx-f7 .tbl td, .kx-f7 .tbl th { padding: 5px 8px; font-size: 12px; }
.kx-note { font-size: 11px; color: var(--muted); padding: 5px 2px 0; }
.kx-click { cursor: pointer; }
.kx-click:hover td { background: #f1f5f9; }
.kx-risk-row td:first-child { border-left: 3px solid #b42318; }
.kx-empty { text-align: center; padding: 26px 12px; }
.kx-empty-t { font-weight: 700; color: var(--ink); margin-bottom: 6px; }
.kx-empty-s { font-size: 12px; color: var(--muted); margin-bottom: 12px; line-height: 1.6; }

/* ═══ 2026-09-09 首页控制塔层级与可视化恢复（仅结构/样式重排，不改任何业务口径） ═══ */
/* —— 「更多供应链总览」折叠区（旧驾驶舱区块：默认收起，可展开；折叠只影响展示不影响数据） —— */
.fold-overview { margin-top: 16px; background: var(--card, #fff); border: 1px solid var(--line, #e2e8f0); border-radius: 12px; overflow: hidden; }
.fold-overview > summary { list-style: none; display: flex; align-items: center; gap: 10px; padding: 12px 16px; cursor: pointer; user-select: none; }
.fold-overview > summary::-webkit-details-marker { display: none; }
.fold-overview > summary:hover { background: #f8fafc; }
.fold-caret { display: inline-block; transition: transform .15s ease; color: var(--muted); font-size: 11px; }
.fold-overview[open] .fold-caret { transform: rotate(90deg); }
.fold-t { font-size: 14px; font-weight: 700; color: var(--ink, #0f172a); }
.fold-s { font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fold-body { padding: 4px 16px 16px; border-top: 1px dashed var(--line, #e2e8f0); }
.fold-body > .ck-block:first-child { margin-top: 12px; }

/* —— 控制塔分节标题（今日需要处理） —— */
.kx-sect-h { display: flex; align-items: center; gap: 10px; margin: 14px 0 10px; }
.kx-sect-h span { font-size: 13px; font-weight: 700; color: var(--ink, #0f172a); }
.kx-sect-h i { flex: 1; height: 1px; background: var(--line, #e2e8f0); }

/* —— 图表空态保框架（无数据 ≠ 删图表） —— */
.kx-plot-empty { position: relative; }
.kx-plot-empty .kx-chart { display: block; }
.kx-plot-msg { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center; pointer-events: none; }
.kx-plot-msg .btn { pointer-events: auto; }
.kx-legend.dim { opacity: .45; }
.lg-risk { background: #dc2626; }

/* —— 未来7天：KPI 条 + 7日风险柱状图 —— */
.kx-f7-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 8px; }
.kx-f7-kpi { background: #f8fafc; border: 1px solid var(--line, #e2e8f0); border-radius: 8px; padding: 6px 10px; display: flex; flex-direction: column; gap: 2px; }
.kx-f7-kpi span { font-size: 11px; color: var(--muted); }
.kx-f7-kpi b { font-size: 16px; line-height: 1.2; }
.kx-f7-kpi.ok b { color: #15803d; }
.kx-f7-kpi.bad b { color: #b42318; }
.kx-f7-bar:hover .bar-seg { opacity: .8; }

/* —— Top10 横向条形图（缺料 / 供应商风险共用） —— */
.kx-hb-box { display: flex; flex-direction: column; gap: 7px; }
.kx-hb-row { display: flex; align-items: center; gap: 10px; cursor: pointer; padding: 3px 6px; border-radius: 6px; }
.kx-hb-row:hover { background: #f8fafc; }
.kx-hb-k { width: 138px; flex: none; display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.kx-hb-k b { font-size: 12px; color: var(--ink, #0f172a); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kx-hb-k span { font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kx-hb-track { flex: 1; height: 14px; background: #f1f5f9; border-radius: 7px; overflow: hidden; }
.kx-hb-fill { height: 100%; border-radius: 7px; min-width: 2px; }
.kx-hb-v { width: 168px; flex: none; display: flex; flex-direction: column; align-items: flex-end; line-height: 1.3; }
.kx-hb-v b { font-size: 12px; color: #b42318; display: flex; align-items: center; gap: 5px; }
.kx-hb-v span { font-size: 11px; color: var(--muted); }
.kx-mini-act { margin-top: 6px; }
