/* PMC 管理工作台 · 样式
 * 双栏：左侧深色固定侧边栏 + 右侧浅色工作区
 */
[hidden] { display: none !important; }
:root {
  --side-bg: #0d1a2b;
  --side-bg2: #13273e;
  --side-line: rgba(255, 255, 255, .07);
  --side-text: #c9d5e5;
  --side-mute: #7b8ca4;
  --active: #1b4fd8;
  --active-2: #2a63ff;

  --bg: #f2f5fa;
  --panel: #fff;
  --ink: #14202f;
  --ink2: #46566b;
  --muted: #7d8b9e;
  --line: #e4eaf3;
  --line-soft: #eff3f9;
  --brand: #1e5eff;
  --red: #e02b1d;
  --amber: #d98600;
  --green: #12a150;
  --teal: #0f9b8e;
  --purple: #7b5cf0;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(20, 32, 47, .04), 0 8px 24px -14px rgba(20, 32, 47, .28);
  --side-w: 234px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 13px;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
button { font-family: inherit; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: #cfd8e6; border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: #b6c3d6; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------------- 布局 ---------------- */
.app { min-height: 100vh; }

.sidebar {
  position: fixed;
  left: 0; top: 0; bottom: 0;
  width: var(--side-w);
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #0d1a2b 0%, #102032 55%, #0c1828 100%);
  color: var(--side-text);
  z-index: 60;
  box-shadow: 1px 0 0 rgba(255, 255, 255, .05), 6px 0 28px -18px #000;
}
.sidebar::after {
  content: '';
  position: absolute; top: 0; right: 0; bottom: 0; width: 1px;
  background: rgba(255, 255, 255, .06);
}

.brand {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 16px 14px;
  border-bottom: 1px solid var(--side-line);
}
.brand-mark {
  width: 36px; height: 36px; flex: 0 0 auto;
  display: grid; place-items: center;
  border-radius: 10px;
  color: #fff;
  background: linear-gradient(140deg, #2a63ff, #123ba8);
  box-shadow: 0 6px 16px -8px rgba(42, 99, 255, .9);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.brand-text b { color: #fff; font-size: 13.5px; letter-spacing: .3px; }
.brand-text span { color: var(--side-mute); font-size: 11.5px; white-space: nowrap; }

/* 竖向排列的菜单 */
.nav {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 8px 8px 14px;
  display: flex; flex-direction: column; gap: 2px;
}
.nav::-webkit-scrollbar { width: 6px; }
.nav::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .16); }

.nav-item {
  display: flex; align-items: center; gap: 9px;
  width: 100%;
  padding: 9.5px 10px;
  border: 0; border-radius: 9px;
  background: transparent;
  color: var(--side-text);
  font-size: 13.5px; font-weight: 500;
  text-align: left; cursor: pointer;
  transition: background .15s, color .15s;
  position: relative;
}
.nav-item:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.nav-item .ic { width: 17px; height: 17px; flex: 0 0 auto; opacity: .85; }
.nav-item .lbl { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-item .caret {
  width: 12px; height: 12px; flex: 0 0 auto;
  transition: transform .18s; opacity: .55;
}
.nav-group.open > .nav-item .caret { transform: rotate(90deg); }
.nav-item .cnt {
  font-size: 10px; font-variant-numeric: tabular-nums;
  background: rgba(255, 255, 255, .1); color: #b9c7da;
  padding: 1px 5px; border-radius: 5px;
}

/* 一级选中：深蓝高亮 */
.nav-item.active {
  background: linear-gradient(95deg, var(--active), var(--active-2) 92%);
  color: #fff;
  box-shadow: 0 6px 16px -10px rgba(42, 99, 255, .95);
}
.nav-item.active .cnt { background: rgba(255, 255, 255, .22); color: #fff; }
.nav-item.active .ic { opacity: 1; }

/* 二级菜单 */
.nav-sub {
  display: flex; flex-direction: column; gap: 1px;
  margin: 2px 0 4px 0;
  padding-left: 8px;
  overflow: hidden;
}
.nav-group:not(.open) > .nav-sub { display: none; }
.nav-sub .nav-item {
  padding: 7px 10px 7px 22px;
  font-size: 12.8px;
  color: #a9b8cc;
  position: relative;
}
.nav-sub .nav-item::before {
  content: '';
  position: absolute; left: 11px; top: 50%;
  width: 4px; height: 4px; margin-top: -2px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .22);
}
.nav-sub .nav-item:hover { color: #fff; }
.nav-sub .nav-item.active {
  color: #fff;
  background: rgba(42, 99, 255, .22);
  box-shadow: inset 2px 0 0 var(--active-2);
}
.nav-sub .nav-item.active::before { background: #7ea5ff; }

.side-foot {
  padding: 10px 14px 12px;
  border-top: 1px solid var(--side-line);
  display: flex; flex-direction: column; gap: 4px;
}
.save-state {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; color: #8fd8b0;
}
.save-state i {
  width: 6px; height: 6px; border-radius: 50%;
  background: #35d07f; box-shadow: 0 0 0 3px rgba(53, 208, 127, .16);
}
.save-state.saving { color: #f0c36a; }
.save-state.saving i { background: #f0b64a; box-shadow: 0 0 0 3px rgba(240, 182, 74, .18); }
.side-ver { font-size: 10.5px; color: #5f7089; }

/* ---------------- 主区 ---------------- */
.main { margin-left: var(--side-w); min-height: 100vh; display: flex; flex-direction: column; }

.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 0 22px;
  height: 58px;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.tb-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.topbar h1 {
  margin: 0; font-size: 15px; font-weight: 700; letter-spacing: .3px;
  white-space: nowrap; color: #10233d;
}
.crumb {
  font-size: 11.5px; color: var(--muted);
  padding: 3px 9px; border-radius: 999px;
  background: #f1f5fb; border: 1px solid var(--line);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 280px;
}
.tb-right { display: flex; align-items: center; gap: 8px; }
.clock {
  font-size: 12px; color: var(--ink2);
  font-variant-numeric: tabular-nums;
  padding: 4px 10px; border-radius: 8px; background: #f5f8fd;
  border: 1px solid var(--line); white-space: nowrap;
}
.nav-toggle { display: none; }

/* 报表同步状态 */
.live-pill {
  display: inline-flex; align-items: center; gap: 6px;
  font: inherit; font-size: 11.5px; padding: 4px 10px; border-radius: 8px;
  border: 1px solid var(--line); background: #f5f8fd; color: var(--ink2);
  white-space: nowrap; cursor: pointer; transition: .15s;
}
.live-pill:hover { border-color: #b8cfee; background: #f0f6ff; color: var(--brand); }
.live-pill i {
  width: 6px; height: 6px; border-radius: 50%; background: #b6c2d4; flex: 0 0 6px;
}
.live-pill.on { background: #eefaf3; border-color: #cdecd9; color: #15803d; }
.live-pill.on:hover { background: #e4f7ed; border-color: #b9e3ca; }
.live-pill.on i { background: #22b573; box-shadow: 0 0 0 3px rgba(34,181,115,.16); }
.live-pill.off { color: #6b7d95; }
.live-pill.busy { background: #fff8ec; border-color: #f2dfb8; color: #8a6410; cursor: progress; }
.live-pill.busy i { background: #eda63a; animation: livePulse 1s infinite; }
@keyframes livePulse { 0%,100% { opacity: 1; } 50% { opacity: .3; } }

/* 实时行：只读，来自报表 */
table.data tbody tr.live-row td { background: #fcfdff; }
table.data tbody tr.live-row:hover td { background: #f5f9ff; }
table.data tbody tr.live-row td:first-child { box-shadow: inset 3px 0 0 #cfe0f7; }
.live-tag {
  display: inline-block; font-size: 10.5px; line-height: 18px;
  padding: 0 7px; border-radius: 5px;
  color: #2f6fd0; background: #eef4ff; border: 1px solid #dbe8fb;
  white-space: nowrap;
}

.content { flex: 1 1 auto; padding: 18px 22px 44px; max-width: 1600px; width: 100%; }

/* ---------------- 通用控件 ---------------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 32px; padding: 0 13px;
  border-radius: 8px; border: 1px solid transparent;
  background: var(--brand); color: #fff;
  font-size: 12.5px; font-weight: 600; cursor: pointer;
  transition: .15s; white-space: nowrap;
}
.btn:hover { filter: brightness(1.05); }
.btn:active { transform: translateY(1px); }
.btn.ghost { background: #fff; color: var(--ink2); border-color: var(--line); }
.btn.ghost:hover { border-color: #c6d4e8; color: var(--brand); background: #fbfdff; }
.btn.danger { background: #fff; color: var(--red); border-color: #f3c9c5; }
.btn.danger:hover { background: #fff6f5; }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.icon-btn {
  width: 30px; height: 30px; border-radius: 8px;
  border: 1px solid var(--line); background: #fff; color: var(--ink2);
  cursor: pointer; font-size: 15px; line-height: 1;
}

.field-input, .field-select, .field-textarea {
  width: 100%;
  border: 1px solid var(--line); border-radius: 8px;
  background: #fff; color: var(--ink);
  font-size: 12.8px; font-family: inherit;
  padding: 7px 10px;
  transition: .15s;
}
.field-input:focus, .field-select:focus, .field-textarea:focus {
  outline: none; border-color: #a9c2ff; box-shadow: 0 0 0 3px rgba(30, 94, 255, .12);
}
.field-textarea { min-height: 62px; resize: vertical; line-height: 1.6; }
.field-select { appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%237d8b9e' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; padding-right: 26px;
}

/* ---------------- 页面头 ---------------- */
.page-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 14px; flex-wrap: wrap; margin-bottom: 14px;
}
.page-head h2 { margin: 0 0 3px; font-size: 17px; font-weight: 700; letter-spacing: .2px; }
.page-head p { margin: 0; font-size: 12px; color: var(--muted); max-width: 760px; line-height: 1.6; }
.page-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ---------------- 卡片 / KPI ---------------- */
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 13px 16px 10px;
}
.card-head h3 { margin: 0; font-size: 13.5px; font-weight: 700; }
.card-head .hint { font-size: 11px; color: var(--muted); }

.kpi-row {
  display: grid; gap: 12px;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  margin-bottom: 14px;
}
.kpi {
  background: #fff; border: 1px solid var(--line); border-radius: 13px;
  padding: 13px 15px; box-shadow: var(--shadow);
  position: relative; overflow: hidden;
  min-width: 0;
}
.kpi::after {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--brand); opacity: .85;
}
.kpi.k-red::after { background: var(--red); }
.kpi.k-amber::after { background: var(--amber); }
.kpi.k-green::after { background: var(--green); }
.kpi.k-teal::after { background: var(--teal); }
.kpi.k-purple::after { background: var(--purple); }
.kpi .k-label { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .k-val {
  font-size: 24px; font-weight: 700; letter-spacing: -.4px;
  margin: 4px 0 2px; font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.kpi .k-val small { font-size: 11.5px; font-weight: 600; color: var(--muted); margin-left: 3px; }
.kpi .k-sub { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .k-sub b { color: var(--ink2); }

.grid { display: grid; gap: 14px; }
.grid.g2 { grid-template-columns: 1fr 1fr; }
.grid.g3 { grid-template-columns: repeat(3, 1fr); }
.grid.g-main { grid-template-columns: 1.45fr 1fr; }
.chart { width: 100%; height: 262px; }
.chart.tall { height: 300px; }

/* ---------------- 工具条 ---------------- */
.toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; flex-wrap: wrap;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line-soft);
}
.tb-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.search {
  position: relative; display: flex; align-items: center;
}
.search svg { position: absolute; left: 9px; color: var(--muted); pointer-events: none; }
.search input {
  height: 32px; width: 240px; padding: 0 10px 0 29px;
  border: 1px solid var(--line); border-radius: 8px;
  font-size: 12.5px; font-family: inherit; color: var(--ink); background: #fff;
}
.search input:focus { outline: none; border-color: #a9c2ff; box-shadow: 0 0 0 3px rgba(30, 94, 255, .12); }

.seg { display: inline-flex; background: #f3f6fc; border-radius: 9px; padding: 3px; gap: 2px; }
.seg button {
  height: 26px; padding: 0 10px; border: 0; border-radius: 7px;
  background: transparent; color: var(--ink2);
  font-size: 12px; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.seg button.on { background: #fff; color: var(--brand); box-shadow: 0 1px 3px rgba(20, 32, 47, .12); }

/* ---------------- 表格 ---------------- */
.table-wrap { overflow: auto; max-height: calc(100vh - 330px); min-height: 220px; }
table.data { width: 100%; border-collapse: separate; border-spacing: 0; }
table.data thead th {
  position: sticky; top: 0; z-index: 2;
  background: #f8fafd; padding: 9px 9px;
  font-size: 11.5px; font-weight: 700; color: var(--ink2);
  text-align: left; white-space: nowrap;
  border-bottom: 1px solid var(--line);
  cursor: pointer; user-select: none;
}
table.data thead th:hover { color: var(--brand); }
table.data thead th .sort { color: #bcc8d8; margin-left: 3px; font-size: 9px; }
table.data thead th.sorted { color: var(--brand); }
table.data thead th.sorted .sort { color: var(--brand); }
table.data th.num, table.data td.num { text-align: right; font-variant-numeric: tabular-nums; }
table.data tbody td {
  padding: 8px 9px;
  border-bottom: 1px solid #f3f6fb;
  font-size: 12.4px; color: var(--ink);
  white-space: nowrap; max-width: 260px;
  overflow: hidden; text-overflow: ellipsis;
}
/* 列多的台账（14 列以上）再压一档，避免右侧操作列被裁掉 */
table.data.dense thead th { padding: 9px 6px; }
table.data.dense tbody td { padding: 8px 6px; max-width: 172px; }
/* 窄屏放不下时横向滚动，首列钉住，单号始终可见 */
table.data.dense thead th:first-child,
table.data.dense tbody td:first-child {
  position: sticky; left: 0; z-index: 3;
  background: #fff;
  box-shadow: 1px 0 0 #eef2f8;
}
table.data.dense thead th:first-child { background: #f8fafd; z-index: 4; }
table.data.dense tbody tr:hover td:first-child { background: #f7faff; }
table.data.dense tbody tr.archived td:first-child { background: #fbfcfe; }
table.data.dense tbody tr.row-warn td:first-child { background: #fffbfb; }
/* 操作列钉在右侧，横向滚动时随时可点 */
table.data.dense thead th:last-child,
table.data.dense tbody td.ops {
  position: sticky; right: 0; z-index: 3;
  background: #fff;
  box-shadow: -1px 0 0 #eef2f8;
}
table.data.dense thead th:last-child { background: #f8fafd; z-index: 4; }
table.data.dense tbody tr:hover td.ops { background: #f7faff; }
table.data.dense tbody tr.archived td.ops { background: #fbfcfe; }
table.data tbody tr:hover td { background: #f7faff; }
table.data tbody tr.archived td { color: #96a3b5; background: #fbfcfe; }
table.data tbody tr.row-warn td { background: #fffbfb; }
/* 纯说明用表格：去掉悬停与分隔线 */
table.data.plain tbody td { border-bottom: 0; padding: 5px 0; white-space: normal; }
table.data.plain tbody tr:hover td { background: transparent; }
table.data td.code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 11.8px; color: var(--ink2); }
table.data td.muted { color: var(--muted); }
table.data td.num.zero { color: #b6c1d0; }
table.data td.neg { color: var(--red); font-weight: 700; }
table.data td.pos { color: var(--green); font-weight: 600; }
table.data td.ops { text-align: right; white-space: nowrap; }
.row-ops { display: inline-flex; gap: 4px; }
.row-ops .mini { flex: 0 0 auto; white-space: nowrap; }
table.data td.ops { min-width: 128px; }
/* 多页签台账（库存台账） */
.etabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.etab {
  display: inline-flex; align-items: center; gap: 6px;
  height: 30px; padding: 0 12px; border-radius: 8px;
  border: 1px solid var(--line); background: #fff; color: var(--ink2);
  font: inherit; font-size: 12.5px; cursor: pointer; transition: .15s;
}
.etab:hover { border-color: #c3d4f0; background: #f5f9ff; color: var(--brand); }
.etab.on { background: #eef4ff; border-color: #c9dbf7; color: var(--brand); font-weight: 600; }
.etab i {
  font-style: normal; font-size: 10.5px; color: #8b98ab;
  background: #f1f5fb; border-radius: 4px; padding: 0 5px; line-height: 16px;
}
.etab.on i { background: #dbe8fb; color: var(--brand); }

/* 列宽拖拽：表头右边缘手柄 */
table.data thead th .col-tt {
  display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
table.data thead th .col-rs {
  position: absolute; top: 0; right: 0; bottom: 0; width: 11px;
  cursor: col-resize; z-index: 6; touch-action: none;
}
table.data thead th .col-rs::after {
  content: ""; position: absolute; top: 5px; bottom: 5px; right: 3px; width: 2px;
  border-radius: 2px; background: transparent; transition: background .12s;
}
table.data thead th:hover .col-rs::after { background: #d6e2f1; }
table.data thead th .col-rs:hover::after,
body.col-resizing table.data thead th .col-rs::after { background: var(--brand2); }
body.col-resizing { cursor: col-resize; }
body.col-resizing * { user-select: none !important; }
/* 库存类台账的连续序号列 */
table.data th.idx-col,
table.data td.idx-col {
  width: 56px; min-width: 56px; text-align: right;
  font-variant-numeric: tabular-nums; white-space: nowrap;
  color: #8b98ab; font-size: 12px; padding-right: 12px;
}
table.data th.idx-col { font-weight: 600; color: var(--muted); }
table.data tbody tr:hover td.idx-col { color: var(--ink2); }
.mini {
  height: 24px; padding: 0 8px; border-radius: 6px;
  border: 1px solid var(--line); background: #fff; color: var(--ink2);
  font-size: 11.5px; cursor: pointer; transition: .14s;
}
.mini:hover { border-color: #b9cdf5; color: var(--brand); background: #f8fbff; }
.mini.del:hover { border-color: #f0c3bf; color: var(--red); background: #fff7f6; }
.mini.restore:hover { border-color: #b7e4c9; color: var(--green); background: #f6fdf9; }

.pager {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
  padding: 10px 14px; border-top: 1px solid var(--line-soft);
}
.pg-info { font-size: 11.5px; color: var(--muted); }
.pg-ctrl { display: flex; align-items: center; gap: 6px; }
.pg-ctrl select {
  height: 28px; border: 1px solid var(--line); border-radius: 7px; background: #fff;
  color: var(--ink2); font-size: 11.5px; padding: 0 6px; cursor: pointer;
}
.pg-btn {
  min-width: 28px; height: 28px; padding: 0 8px; border-radius: 7px;
  border: 1px solid var(--line); background: #fff; color: var(--ink2);
  font-size: 12px; cursor: pointer;
}
.pg-btn:hover:not([disabled]) { border-color: #c6d4e8; color: var(--brand); }
.pg-btn[disabled] { opacity: .4; cursor: not-allowed; }

.empty { padding: 54px 0; text-align: center; color: var(--muted); font-size: 12.5px; }
.empty b { display: block; font-size: 14px; color: var(--ink2); margin-bottom: 6px; }

/* 状态标签 */
.badge {
  display: inline-block; padding: 1.5px 8px; border-radius: 999px;
  font-size: 11px; font-weight: 600; line-height: 17px;
  background: #eef2f8; color: var(--ink2); white-space: nowrap;
}
.badge.b-blue { background: #eaf0ff; color: #1445c9; }
.badge.b-green { background: #e8f7ef; color: #0b7a3d; }
.badge.b-red { background: #fdeceb; color: #b32014; }
.badge.b-amber { background: #fdf4e3; color: #9a6200; }
.badge.b-teal { background: #e6f6f4; color: #0b7469; }
.badge.b-gray { background: #f0f2f6; color: #6b7a90; }
.badge.b-purple { background: #f1ecff; color: #5b3fd0; }

/* ---------------- 仪表盘 ---------------- */
.todo-list { display: flex; flex-direction: column; gap: 8px; padding: 4px 16px 16px; }
.todo {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 12px; border-radius: 10px;
  background: #f8fafd; border: 1px solid var(--line-soft);
}
.todo.done { opacity: .55; }
.todo .cb {
  width: 16px; height: 16px; margin-top: 1px; flex: 0 0 auto;
  border-radius: 5px; border: 1.5px solid #c3cfe0; background: #fff;
  cursor: pointer; display: grid; place-items: center;
}
.todo.done .cb { background: var(--green); border-color: var(--green); color: #fff; }
.todo .t-main { flex: 1 1 auto; min-width: 0; }
.todo .t-title { font-size: 12.8px; font-weight: 600; }
.todo.done .t-title { text-decoration: line-through; }
.todo .t-meta { font-size: 11px; color: var(--muted); margin-top: 3px; display: flex; gap: 8px; flex-wrap: wrap; }

.alert-board { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px; padding: 4px 16px 16px; }
.alert-cell {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 12px; border-radius: 11px;
  border: 1px solid var(--line-soft); background: #fff;
  cursor: pointer; transition: .15s; text-align: left;
}
.alert-cell:hover { border-color: #cfdcf0; box-shadow: 0 6px 18px -14px rgba(20,32,47,.5); transform: translateY(-1px); }
.alert-cell .a-ic {
  width: 30px; height: 30px; border-radius: 9px; flex: 0 0 auto;
  display: grid; place-items: center; font-size: 13px; font-weight: 700;
}
.alert-cell .a-main { min-width: 0; }
.alert-cell .a-name { font-size: 12px; color: var(--ink2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.alert-cell .a-val { font-size: 17px; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; }
.a-red { background: #fdeceb; color: #c22b1d; }
.a-amber { background: #fdf4e3; color: #a56a00; }
.a-blue { background: #eaf0ff; color: #1849c9; }
.a-green { background: #e8f7ef; color: #0b7a3d; }
.a-gray { background: #f0f2f6; color: #5f6f85; }

.countdown-list { display: flex; flex-direction: column; padding: 2px 8px 12px; }
.cd-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 8px; border-bottom: 1px dashed var(--line-soft);
}
.cd-item:last-child { border-bottom: 0; }
.cd-days {
  width: 46px; flex: 0 0 auto; text-align: center;
  font-size: 15px; font-weight: 700; line-height: 1.1;
}
.cd-days small { display: block; font-size: 9.5px; font-weight: 600; color: var(--muted); }
.cd-main { min-width: 0; flex: 1 1 auto; }
.cd-title { font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cd-meta { font-size: 11px; color: var(--muted); margin-top: 2px; }
.cd-over { color: var(--red); }
.cd-soon { color: var(--amber); }
.cd-ok { color: var(--green); }

/* ---------------- 弹窗 ---------------- */
.modal-root { position: fixed; inset: 0; z-index: 100; pointer-events: none; }
.modal-mask {
  position: absolute; inset: 0;
  background: rgba(11, 22, 38, .45);
  backdrop-filter: blur(2px);
  display: grid; place-items: center;
  padding: 24px;
  pointer-events: auto;
  animation: fade .16s ease;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal {
  width: min(880px, 100%);
  max-height: min(88vh, 900px);
  background: #fff; border-radius: 16px;
  box-shadow: 0 30px 70px -30px rgba(0, 0, 0, .6);
  display: flex; flex-direction: column;
  animation: pop .18s cubic-bezier(.2, .9, .3, 1.1);
  overflow: hidden;
}
@keyframes pop { from { transform: translateY(10px) scale(.985); opacity: .6; } to { transform: none; opacity: 1; } }

/* 访问地址行 */
.addr-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 9px 12px; margin-bottom: 8px;
  background: #f8fbff; border: 1px solid #e4eefa; border-radius: 9px;
}
.addr-k { flex: 0 0 100px; font-size: 12px; color: var(--muted); }
.addr-v {
  font: 600 12.5px/1.6 ui-monospace, Consolas, monospace; color: var(--brand);
  background: #fff; border: 1px solid #dbe8fb; border-radius: 6px;
  padding: 3px 8px; user-select: all;
}
.addr-tip { font-size: 11px; color: #98a6b8; }

/* 数据管理页：没有菜单入口的表 */
.no-entry-tag {
  margin-left: 8px; font-size: 10px; color: #98a6b8;
  background: #f4f7fb; border: 1px solid #e7eef7; border-radius: 4px; padding: 0 5px;
  line-height: 16px; display: inline-block;
}

/* 数据导入（验证期） */
.import-card { margin-bottom: 14px; }
.import-in { padding: 4px 18px 18px; display: flex; flex-direction: column; gap: 14px; }
.imp-step { display: flex; gap: 12px; align-items: flex-start; }
.imp-step .imp-n {
  flex: 0 0 24px; height: 24px; border-radius: 50%; text-align: center;
  font: 700 12px/24px ui-monospace, Consolas, monospace;
  color: #fff; background: linear-gradient(135deg, #1b4b8f, #2f6fd0);
  box-shadow: 0 3px 8px rgba(27,75,143,.2);
}
.imp-step b { font-size: 13px; color: var(--deep); }
.imp-step p { margin: 3px 0 8px; font-size: 12px; color: var(--ink2); line-height: 1.7; }
.imp-step p code { background: #f1f5fb; border: 1px solid #e3ebf6; border-radius: 4px; padding: 0 4px; font-size: 11.5px; }
.imp-pick { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.imp-state { font-size: 11.5px; color: var(--muted); }
.imp-res {
  margin: 0 18px 18px; padding: 12px 14px; border-radius: 10px;
  background: #f4fbf7; border: 1px solid #d5eee0;
}
.imp-res-hd { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.imp-res-hd b { font-size: 13px; color: #15803d; }
.imp-res-hd span { font-size: 11.5px; color: var(--muted); }
.imp-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.imp-chip {
  font-size: 11.5px; color: var(--ink2); background: #fff;
  border: 1px solid #dceee4; border-radius: 6px; padding: 3px 8px;
}
.imp-chip b { margin-left: 5px; color: var(--brand); font-variant-numeric: tabular-nums; }
.imp-chip.more { color: var(--muted); }
.imp-warn {
  margin-top: 10px; padding: 8px 10px; border-radius: 8px;
  font-size: 11.5px; line-height: 1.7; color: #8a6410;
  background: #fffbf0; border: 1px solid #f2e3c2;
}

/* 单价维护小弹窗 */
.modal.modal-sm { width: min(420px, 100%); }
.modal.modal-md { width: min(660px, 100%); }
.wh-note { margin: 0 0 12px; font-size: 12.5px; color: var(--ink2); line-height: 1.75; }
.wh-note b { color: var(--brand); }
.wh-tip { margin: 12px 0 0; padding: 10px 12px; font-size: 11.5px; line-height: 1.7;
  color: #8a6410; background: #fffbf0; border: 1px solid #f2e3c2; border-radius: 8px; }
.wh-kind { display: inline-block; margin-left: 8px; font-size: 10.5px; color: #93a1b5; }
.kpi.kpi-click { cursor: pointer; transition: box-shadow .16s, transform .16s; }
.kpi.kpi-click:hover { box-shadow: 0 8px 22px -12px rgba(21,52,96,.35); transform: translateY(-1px); }
.kpi.kpi-click::after {
  content: "按存储地点"; position: absolute; right: 12px; top: 10px;
  font-size: 10px; color: #a8b6c9; opacity: 0; transition: opacity .16s;
}
.kpi.kpi-click:hover::after { opacity: 1; }
.price-who { display: flex; flex-direction: column; gap: 3px; margin-bottom: 14px;
  padding: 10px 12px; background: #f6f9fd; border: 1px solid var(--line); border-radius: 10px; }
.price-who b { font: 600 12.5px/1.5 ui-monospace, Consolas, monospace; color: var(--brand); }
.price-who span { font-size: 12px; color: var(--ink2); }
.price-note { margin: 12px 0 0; font-size: 11.5px; line-height: 1.7; color: var(--muted); }
.mini.price { color: #8a6410; border-color: #f0e0bb; }
.mini.price:hover { background: #fffbf0; border-color: #e6cf9a; }
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px 12px; border-bottom: 1px solid var(--line-soft);
}
.modal-head h3 { margin: 0; font-size: 15px; font-weight: 700; }
.modal-head .sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.modal-body { padding: 16px 20px; overflow-y: auto; }
.modal-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 20px 16px; border-top: 1px solid var(--line-soft);
  background: #fbfcff;
}
.modal-foot .tip { font-size: 11px; color: var(--muted); }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.form-grid .full { grid-column: 1 / -1; }
.form-field label { display: block; font-size: 11.5px; color: var(--ink2); font-weight: 600; margin-bottom: 5px; }
.form-field label .req { color: var(--red); margin-left: 2px; }
.form-field label .auto-tag {
  margin-left: 6px; padding: 0 5px; border-radius: 4px;
  font-size: 9.5px; font-weight: 600; letter-spacing: .2px;
  color: #1b4fd8; background: #e8effe; vertical-align: 1px;
}
.field-input.ro { background: #f5f8fd; color: #44586f; cursor: default; }
.field-input.ro:focus { border-color: var(--line); box-shadow: none; }
.form-field .hint { font-size: 10.5px; color: var(--muted); margin-top: 4px; }

.confirm-box { max-width: 420px; }
.confirm-box p { margin: 0 0 6px; font-size: 13px; line-height: 1.7; color: var(--ink2); }

/* ---------------- 提示 ---------------- */
.toast {
  position: fixed; left: 50%; bottom: 30px; transform: translate(-50%, 16px);
  padding: 9px 18px; border-radius: 10px;
  background: #14202f; color: #fff; font-size: 12.5px;
  box-shadow: 0 14px 34px -14px rgba(0, 0, 0, .6);
  opacity: 0; pointer-events: none; transition: .22s; z-index: 200;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------------- 统计页 ---------------- */
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.mini-stat {
  border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: #fff;
}
.mini-stat .ms-label { font-size: 11.5px; color: var(--muted); }
.mini-stat .ms-val { font-size: 19px; font-weight: 700; margin-top: 3px; font-variant-numeric: tabular-nums; }

.bar-line { height: 6px; border-radius: 3px; background: #eef2f8; overflow: hidden; min-width: 60px; }
.bar-line i { display: block; height: 100%; background: linear-gradient(90deg, #5b8cff, #1e5eff); }
.bar-line.warn i { background: linear-gradient(90deg, #ffb44d, #e88a00); }
.bar-line.bad i { background: linear-gradient(90deg, #ff8a7a, #e02b1d); }

/* 台账里的百分比进度单元格：固定宽度，条形与数字同排，避免被挤成两行 */
/* 台账/报表里「条 + 百分比」的单元格：条固定宽度并排显示，避免宽屏下拉满整格 */
.data td > .bar-line { display: inline-block; vertical-align: middle; width: 68px; min-width: 68px; margin-right: 6px; }
.data td > .bar-line + span { display: inline-block; vertical-align: middle; }
.data td.pct-cell { min-width: 114px; white-space: nowrap; }
.data td.pct-cell .bar-line { display: inline-block; vertical-align: middle; width: 64px; min-width: 0; }
.data td.pct-cell span { display: inline-block; vertical-align: middle; margin-left: 6px; min-width: 30px; }


/* ---------------- 首页：项目联动 + 预警看板 ---------------- */
/* 空白工作台引导 */
.empty-guide {
  display: flex; align-items: center; gap: 14px;
  margin: 0 0 14px; padding: 14px 18px;
  background: linear-gradient(90deg, #f4f9ff, #fbfdff);
  border: 1px dashed #c7dbf5; border-radius: 12px;
}
.empty-guide .eg-ic {
  flex: 0 0 34px; height: 34px; border-radius: 10px; text-align: center;
  font-size: 18px; line-height: 34px; color: #2f6fd0;
  background: #e6f0ff; border: 1px solid #d3e3fb;
}
.empty-guide .eg-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.empty-guide .eg-txt b { font-size: 13px; color: var(--deep); font-weight: 650; }
.empty-guide .eg-txt span { font-size: 12px; color: var(--ink2); line-height: 1.7; }
.empty-guide .eg-txt span b { font-size: 12px; color: var(--brand); }
.proj-bar {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  padding: 10px 14px; margin-bottom: 14px;
}
.core-tag {
  margin-left: 6px; padding: 0 6px; border-radius: 4px;
  font-size: 10px; font-weight: 700; line-height: 15px;
  background: rgba(255, 255, 255, .16); color: #fff;
}
.nav-item:not(.active) .core-tag { background: rgba(30, 94, 255, .12); color: #1e5eff; }
.proj-label { font-size: 12.5px; font-weight: 700; color: var(--ink2); margin-right: 2px; }
.pchip {
  border: 1px solid var(--line); background: #f7f9fd; color: var(--ink2);
  border-radius: 999px; padding: 5px 14px; font-size: 12.5px; font-weight: 600;
  cursor: pointer; transition: all .15s; font-family: inherit;
}
.pchip:hover { border-color: #c3d4f0; background: #eef3fd; }
.pchip.on {
  background: var(--active); border-color: var(--active); color: #fff;
  box-shadow: 0 2px 8px rgba(27, 79, 216, .28);
}
.pchip.on::before { content: '✓ '; font-size: 11px; }
.proj-tip { margin-left: auto; font-size: 11.5px; color: var(--muted); }

.alert-card .card-head, .alert-mini .card-head { padding-bottom: 6px; }
.grid.dash-alerts { align-items: stretch; grid-template-columns: repeat(5, minmax(0, 1fr)); }
.grid.dash-alerts > .alert-mini { grid-column: span 1; }
.grid.dash-alerts > .alert-mini.expanded { grid-column: 1 / -1; order: 99; }
/* 展开时：其余四张均分一行，展开面板单独占满下一行 */
.grid.dash-alerts:has(> .alert-mini.expanded) { grid-template-columns: repeat(4, minmax(0, 1fr)); }
/* 五张并排后单卡只有 ~250px，分档摘要折两行显示，卡片等高 */
.alert-mini .am-sub {
  white-space: normal;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; line-height: 1.6;
}
.alert-mini .am-seg { display: inline-block; white-space: nowrap; }
.alert-mini .am-dot { font-style: normal; color: #c2cddd; margin: 0 5px; }
@media (max-width: 1340px) {
  .grid.dash-alerts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.alert-card .cnt, .alert-mini .cnt {
  display: inline-block; min-width: 22px; text-align: center;
  margin-left: 7px; padding: 1px 7px; border-radius: 999px;
  font-size: 11.5px; font-weight: 700;
}
.alert-card .cnt.danger, .alert-mini .cnt.danger { background: #fdeceb; color: #b32014; }
.alert-card .cnt.ok, .alert-mini .cnt.ok { background: #e8f7ef; color: #0b7a3d; }

/* 预警面板：默认只给汇总数字，点击才展开明细 */
.alert-mini { cursor: pointer; transition: border-color .15s, box-shadow .15s; min-height: 104px; }
.alert-mini:hover { border-color: #cfdcf2; box-shadow: 0 3px 12px rgba(20, 32, 47, .07); }
.alert-mini .am-val {
  padding: 4px 16px 0;
  font-size: 38px; font-weight: 700; line-height: 1.12;
  color: #10233d; font-variant-numeric: tabular-nums; letter-spacing: -.5px;
}
.alert-mini .am-val small { font-size: 12px; font-weight: 600; color: var(--muted); margin-left: 6px; letter-spacing: 0; }
.alert-mini .am-sub {
  padding: 7px 16px 15px;
  font-size: 11.8px; color: var(--muted);
}
.alert-mini.clear { cursor: default; }
.alert-mini.clear:hover { border-color: var(--line); box-shadow: none; }
.alert-mini.clear .am-val { color: #0b7a3d; font-size: 26px; padding-top: 12px; }
.alert-mini.clear .am-sub { color: #6f9a84; }
.alert-mini .am-chev { font-size: 11.5px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.alert-mini:hover .am-chev { color: var(--brand); }
.alert-mini.expanded { grid-column: 1 / -1; cursor: default; box-shadow: none; }
.alert-mini.expanded .am-chev { cursor: pointer; }
.alert-mini.expanded .mini-list { max-height: 268px; overflow: auto; }
.alert-mini .am-more { padding: 0 16px 13px; text-align: right; }
.card-head .link {
  border: 0; background: transparent; color: var(--brand);
  font-size: 11.5px; font-weight: 600; cursor: pointer; font-family: inherit;
  padding: 2px 0;
}
.card-head .link:hover { text-decoration: underline; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 16px 10px; }
.chip {
  border: 1px solid var(--line); background: #f7f9fd; color: var(--ink2);
  border-radius: 999px; padding: 2.5px 10px; font-size: 11.5px;
  cursor: pointer; font-family: inherit; line-height: 18px;
}
.chip b { font-weight: 700; color: var(--ink); }
.chip:hover { border-color: #c3d4f0; }
.chip.on { background: #eaf0ff; border-color: #b9cdf7; color: #1445c9; }
.chip.on b { color: #1445c9; }

.mini-list { padding: 0 12px 10px; display: flex; flex-direction: column; gap: 2px; }
.mini-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 6px; border-radius: 8px; cursor: pointer;
  border-bottom: 1px dashed var(--line-soft);
}
.mini-row:last-child { border-bottom: 0; }
.mini-row:hover { background: #f6f9ff; }
.mini-row .m-main { min-width: 0; flex: 1; }
.mini-row .m-title {
  font-size: 12.5px; font-weight: 600; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mini-row .m-meta {
  font-size: 11px; color: var(--muted); margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mini-row .m-meta b { color: var(--ink2); font-weight: 700; }
.mini-row .badge { flex: 0 0 auto; }
.empty.sm { padding: 22px 0; font-size: 12px; }

/* ---------------- 响应式 ---------------- */
@media (max-width: 1400px) {
  .kpi-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1180px) {
  .grid.g-main, .grid.g2, .grid.g3 { grid-template-columns: 1fr; }
  .grid.dash-alerts, .grid.dash-alerts:has(> .alert-mini.expanded) { grid-template-columns: 1fr; }
  .alert-board { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .stat-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
/* 窄屏抽屉遮罩 */
.nav-scrim {
  position: fixed; inset: 0; z-index: 55;
  background: rgba(11, 22, 36, .46);
  opacity: 0; pointer-events: none;
  transition: opacity .2s ease;
  backdrop-filter: blur(1px);
}
.nav-scrim.show { opacity: 1; pointer-events: auto; }
body.no-scroll { overflow: hidden; }
@media (min-width: 901px) { .nav-scrim { display: none; } }

@media (max-width: 900px) {
  :root { --side-w: 0px; }
  .sidebar {
    width: 234px;
    transform: translateX(-100%);
    transition: transform .22s ease;
  }
  .sidebar.open { transform: none; }
  .main { margin-left: 0; }
  .nav-toggle { display: inline-grid; place-items: center; }
  .content { padding: 14px 12px 40px; }
  .topbar { padding: 0 12px; }
  .topbar h1 { font-size: 13px; }
  .crumb { display: none; }
  .form-grid { grid-template-columns: 1fr; }
  .kpi-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .alert-board { grid-template-columns: 1fr; }
  .search input { width: 150px; }
  .table-wrap { max-height: none; }
}

/* 4 列 KPI（台账页 / 统计页）：auto-fit 让 2~4 张卡片都铺满整行，不留半截空白 */
.kpi-row.four { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
@media (max-width: 1180px) {
  .kpi-row.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .kpi-row.four { grid-template-columns: 1fr; }
}

/* ============================================================
   视觉升级 v2 —— 只调观感，不改布局与交互
   ============================================================ */

/* 画布：极淡的方向光 + 细网格，让大面积留白不显空 */
body {
  background:
    radial-gradient(900px 420px at 12% -8%, #e9f1fd 0%, rgba(233,241,253,0) 62%),
    radial-gradient(760px 380px at 88% -6%, #eef4ff 0%, rgba(238,244,255,0) 58%),
    linear-gradient(180deg, #f6f9fd 0%, #f1f5fa 46%, #eff3f9 100%);
  background-attachment: fixed;
}

/* 卡片：更柔的边、分级阴影、悬停微浮 */
.card {
  border-radius: 16px;
  border-color: #e9eff8;
  box-shadow: 0 1px 2px rgba(20, 32, 47, .035), 0 12px 32px -20px rgba(20, 32, 47, .34);
  transition: box-shadow .22s ease, border-color .22s ease, transform .22s ease;
}
.card:hover {
  border-color: #dde7f5;
  box-shadow: 0 2px 4px rgba(20, 32, 47, .04), 0 18px 44px -24px rgba(20, 32, 47, .42);
}

/* KPI 卡：顶部彩色细条 + 数字更有分量 */
.kpi {
  border-radius: 16px;
  border-color: #e9eff8;
  padding: 15px 16px 14px;
  box-shadow: 0 1px 2px rgba(20, 32, 47, .035), 0 12px 30px -20px rgba(20, 32, 47, .32);
  transition: box-shadow .22s ease, transform .22s ease;
}
.kpi::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px;
  background: linear-gradient(90deg, #c8d8ef, #e8eff9);
}
.kpi.k-teal::before   { background: linear-gradient(90deg, #16b3a4, #7fe0d4); }
.kpi.k-green::before  { background: linear-gradient(90deg, #18ab57, #7fd9a4); }
.kpi.k-amber::before  { background: linear-gradient(90deg, #e09a1a, #f7cf7e); }
.kpi.k-red::before    { background: linear-gradient(90deg, #e2493c, #f6a79f); }
.kpi.k-purple::before { background: linear-gradient(90deg, #7b5cf0, #b9a6ff); }
.kpi .k-label { font-size: 11.5px; letter-spacing: .2px; color: #8494a8; }
.kpi .k-val {
  font-size: 26px; font-weight: 800; letter-spacing: -.8px;
  color: #10223a; line-height: 1.16;
}
.kpi .k-val small { font-size: 12px; font-weight: 600; color: #97a5b8; letter-spacing: 0; }

/* 侧边栏：竖向渐变 + 顶部微光，选中项加左侧亮条 */
.side {
  background:
    radial-gradient(420px 220px at 0% 0%, rgba(43, 106, 214, .22), rgba(43, 106, 214, 0) 70%),
    linear-gradient(180deg, #0e1e33 0%, #0b1929 52%, #0a1626 100%);
  border-right: 1px solid rgba(255, 255, 255, .05);
}
.nav-item { transition: background .18s ease, color .18s ease, transform .18s ease; }
.nav-item:hover { background: rgba(255, 255, 255, .055); color: #e3ebf7; }
.nav-item.active {
  background: linear-gradient(90deg, rgba(46, 111, 224, .30), rgba(46, 111, 224, .12));
  box-shadow: inset 0 0 0 1px rgba(120, 170, 255, .18);
  color: #fff;
}
.nav-item.active::before {
  content: ""; position: absolute; left: 0; top: 7px; bottom: 7px; width: 3px;
  border-radius: 0 3px 3px 0;
  background: linear-gradient(180deg, #7fb0ff, #3a7bf0);
  box-shadow: 0 0 12px rgba(90, 150, 255, .55);
}

/* 顶栏：更轻的毛玻璃，底部细线弱化 */
.topbar {
  background: rgba(255, 255, 255, .86);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid rgba(228, 234, 243, .9);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .8);
}
.topbar h1 { font-size: 15.5px; font-weight: 750; letter-spacing: .2px; }

/* 页面标题区 */
.page-head h2 { font-size: 19px; font-weight: 800; letter-spacing: -.3px; color: #0f2135; }
.page-head p { font-size: 12.5px; color: #7d8b9e; line-height: 1.7; }

/* 按钮：统一圆角，悬停轻抬，按压缩回 */
.btn {
  border-radius: 10px;
  box-shadow: 0 1px 2px rgba(30, 94, 255, .18);
  transition: background .18s ease, box-shadow .18s ease, transform .12s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 4px 12px -4px rgba(30, 94, 255, .45); }
.btn:active { transform: translateY(0); box-shadow: 0 1px 2px rgba(30, 94, 255, .2); }
.btn.ghost { box-shadow: none; border-color: #dfe7f3; background: #fff; color: #46566b; }
.btn.ghost:hover { border-color: #c6d6ee; background: #f7faff; color: var(--brand); }
.btn.danger { box-shadow: 0 1px 2px rgba(224, 43, 29, .2); }

/* 表头：更轻的分隔，字重收敛 */
table.data thead th {
  background: linear-gradient(180deg, #f8fbfe, #f2f7fc);
  color: #5f7186; font-weight: 650; letter-spacing: .2px;
  border-bottom: 1px solid #e3ebf5;
}
table.data tbody tr { transition: background .14s ease; }
table.data tbody tr:hover td { background: #f5f9ff; }
table.data tbody td { border-bottom: 1px solid #f1f5fa; }

/* 徽章与标签 */
.badge { border-radius: 7px; font-weight: 650; letter-spacing: .2px; }

/* 输入与下拉 */
input[type="text"], input[type="number"], input[type="date"], select, .field-input, .field-select {
  border-radius: 9px; border-color: #dfe7f3;
  transition: border-color .16s ease, box-shadow .16s ease;
}
input:focus, select:focus, .field-input:focus, .field-select:focus {
  outline: none; border-color: #9fc0f5;
  box-shadow: 0 0 0 3px rgba(30, 94, 255, .10);
}

/* 滚动条 */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: #d3dded; border: 3px solid transparent;
  background-clip: content-box; border-radius: 8px;
}
::-webkit-scrollbar-thumb:hover { background: #b9c8dd; background-clip: content-box; }

/* 弹层：更深的遮罩与更柔的浮起 */
.modal-mask { background: rgba(12, 24, 40, .42); backdrop-filter: blur(3px); }
.modal { border-radius: 18px; box-shadow: 0 40px 90px -40px rgba(8, 20, 36, .55); }

/* 项目勾选条：选中态用深蓝实心 */
.pchip { transition: all .16s ease; background: #f8fafd; border-color: #e6ecf6; color: #5b6b80; }
.pchip:hover { border-color: #c3d4f0; background: #f2f7ff; color: var(--brand); }
.pchip.on {
  background: linear-gradient(180deg, #2c66ff, #1b4fd8);
  border-color: #1b4fd8; color: #fff;
  box-shadow: 0 2px 10px -2px rgba(27, 79, 216, .45), inset 0 1px 0 rgba(255, 255, 255, .18);
}
.pchip.on:hover {
  background: linear-gradient(180deg, #3a74ff, #2159e6);
  border-color: #2159e6; color: #fff;
  box-shadow: 0 4px 14px -3px rgba(27, 79, 216, .55), inset 0 1px 0 rgba(255, 255, 255, .22);
}
.kpi .k-val small { margin-left: 5px; }

/* ============ AI 搜索（侧边栏底部 + 弹层） ============ */
.ai-entry {
  margin: 10px 12px 6px;
  display: flex; align-items: center; gap: 8px;
  padding: 9px 12px; width: calc(100% - 24px);
  border-radius: 10px; border: 1px solid rgba(255, 255, 255, .12);
  background: linear-gradient(135deg, rgba(46, 111, 224, .22), rgba(46, 111, 224, .08));
  color: #d6e4fb; font: inherit; font-size: 12.5px; font-weight: 600;
  cursor: pointer; transition: .18s;
}
.ai-entry:hover {
  background: linear-gradient(135deg, rgba(60, 128, 245, .34), rgba(46, 111, 224, .14));
  border-color: rgba(140, 185, 255, .38); color: #fff;
}
.ai-entry svg { color: #8fc0ff; flex: 0 0 auto; }
.ai-entry kbd {
  margin-left: auto; font: 600 10px/1.7 ui-monospace, Consolas, monospace;
  padding: 0 6px; border-radius: 5px; background: rgba(255, 255, 255, .1); color: #a9c6ef;
}

.modal.modal-ai { width: min(780px, 100%); height: min(76vh, 720px); }
.ai-body {
  flex: 1; min-height: 0; overflow-y: auto; padding: 18px 20px;
  display: flex; flex-direction: column; gap: 12px; background: #fbfcfe;
}
.ai-msg {
  max-width: 86%; padding: 10px 14px; border-radius: 12px;
  font-size: 13px; line-height: 1.78; white-space: pre-wrap; word-break: break-word;
}
.ai-msg.me {
  align-self: flex-end; border-bottom-right-radius: 4px;
  background: linear-gradient(180deg, #2c66ff, #1b4fd8); color: #fff;
  box-shadow: 0 4px 12px -6px rgba(27, 79, 216, .6);
}
.ai-msg.bot {
  align-self: flex-start; border-bottom-left-radius: 4px;
  background: #fff; border: 1px solid #e6edf7; color: #22303f;
  box-shadow: 0 2px 8px -4px rgba(20, 32, 47, .18);
}
.ai-msg.pending { color: #8a97a8; font-style: italic; }
.ai-msg.err { background: #fff5f4; border-color: #f6d5d1; color: #b3352a; }
.ai-hint { font-size: 12px; color: #8a97a8; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; line-height: 2; }
.ai-chip {
  border: 1px solid #e2ebf7; background: #fff; border-radius: 999px;
  padding: 5px 12px; font: inherit; font-size: 12px; color: #4a6a92; cursor: pointer;
  transition: .15s;
}
.ai-chip:hover { border-color: #b9d0f0; color: #1b4fd8; background: #f6faff; }
.ai-input {
  display: flex; gap: 10px; padding: 14px 18px;
  border-top: 1px solid #eef3f9; background: #fff;
}
.ai-input input {
  flex: 1; height: 38px; padding: 0 14px;
  border: 1px solid #dfe7f3; border-radius: 10px; font: inherit; font-size: 13px;
}
.ai-input input:focus { outline: none; border-color: #9fc0f5; box-shadow: 0 0 0 3px rgba(30, 94, 255, .1); }

/* 数字单位后缀（如达成率 %） */
.num-suffix { margin-left: 2px; font-size: 11px; color: #8b98ab; font-weight: 600; }

/* ============ 齐套查询 ============ */
.kit-form { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; padding: 16px 18px; }
.kit-form label { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: #5b6b80; font-weight: 600; }
.kit-form input {
  width: 240px; height: 36px; padding: 0 12px;
  border: 1px solid #dfe7f3; border-radius: 9px; font: inherit; font-size: 13px;
}
.kit-form input:focus { outline: none; border-color: #9fc0f5; box-shadow: 0 0 0 3px rgba(30, 94, 255, .1); }
.kit-form .hint { margin-left: auto; align-self: center; }
tr.kit-miss td { background: #fff8f7; }
tr.kit-miss:hover td { background: #fff2f0; }
td.num.neg { color: #d9412f; font-weight: 700; }
.kit-note { padding: 11px 16px; font-size: 11.5px; color: #8a97a8; border-top: 1px solid #f1f5fa; line-height: 1.8; }
.modal.modal-wide { width: min(1000px, 96%); }

/* 齐套查询：多母件输入 */
.kit-form { flex-direction: column; align-items: stretch; gap: 12px; }
.kit-lines { display: flex; flex-direction: column; gap: 8px; max-width: 680px; }
.kit-line-head {
  display: grid; grid-template-columns: 1fr 150px 34px; gap: 10px;
  font-size: 11.5px; color: #8a97a8; padding: 0 2px 2px;
}
.kit-line { display: grid; grid-template-columns: 1fr 150px 34px; gap: 10px; align-items: center; }
.kit-line input {
  width: 100%; height: 36px; padding: 0 12px;
  border: 1px solid #dfe7f3; border-radius: 9px; font: inherit; font-size: 13px;
}
.kit-line input:focus { outline: none; border-color: #9fc0f5; box-shadow: 0 0 0 3px rgba(30, 94, 255, .1); }
.kit-line .kit-del { color: #b0bccb; font-size: 13px; height: 34px; }
.kit-line .kit-del:hover { color: #d9412f; background: #fff2f0; }
.kit-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.kit-actions .hint { margin-left: 4px; }

/* 齐套状态 */
.kit-state { font-weight: 700; font-size: 12px; }
.kit-state.ok { color: #12a150; }
.kit-state.bad { color: #d9412f; }

th.num.ref { color: #a7b3c4; font-weight: 600; }
