*, *::before, *::after { box-sizing: border-box; }
:root {
  --bg: #f4f6fa;
  --panel: #ffffff;
  --line: #e5e9f0;
  --line-strong: #d3dae6;
  --text: #0f172a;
  --text-2: #475569;
  --muted: #7c8798;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-soft: #eef4ff;
  --green: #0f9d58;
  --green-soft: #e8f6ee;
  --red: #dc2626;
  --red-soft: #feeceb;
  --amber: #d97706;
  --amber-soft: #fef5e7;
  --purple: #7c3aed;
  --purple-soft: #f3eeff;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 4px 14px rgba(15, 23, 42, .05);
}
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  font-size: 14px; line-height: 1.55; -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
a { color: var(--primary); text-decoration: none; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------------- 登录 ---------------- */
.login-wrap {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(1200px 600px at 15% 0%, #e3ecff 0%, transparent 55%),
              radial-gradient(900px 500px at 100% 100%, #e8f7f0 0%, transparent 50%), #f4f6fa;
}
/* 品牌化左右分栏登录卡：左深色品牌区，右表单区 */
.login-hero {
  width: 100%; max-width: 900px; background: #fff; border-radius: 20px; overflow: hidden;
  border: 1px solid var(--line); box-shadow: 0 24px 70px rgba(15, 23, 42, .12);
  display: grid; grid-template-columns: 1.08fr 1fr; min-height: 540px;
}
.lh-left {
  position: relative; overflow: hidden; color: #fff; padding: 40px 36px 28px;
  background: linear-gradient(150deg, #16246b 0%, #1e40af 42%, #4f46e5 78%, #7c3aed 110%);
  display: flex; flex-direction: column;
}
.lh-glow { position: absolute; border-radius: 50%; filter: blur(60px); opacity: .5; pointer-events: none; }
.lh-glow.g1 { width: 340px; height: 340px; background: #60a5fa; top: -120px; right: -100px; }
.lh-glow.g2 { width: 280px; height: 280px; background: #c084fc; bottom: -110px; left: -80px; opacity: .38; }
.lh-grid {
  position: absolute; inset: 0; pointer-events: none; opacity: .10;
  background-image: linear-gradient(rgba(255,255,255,.8) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.8) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: radial-gradient(420px 300px at 30% 20%, #000 0%, transparent 75%);
  -webkit-mask-image: radial-gradient(420px 300px at 30% 20%, #000 0%, transparent 75%);
}
.lh-left > :not(.lh-glow):not(.lh-grid) { position: relative; z-index: 1; }
.lh-brand { display: flex; align-items: center; gap: 11px; }
.lh-brand .logo-mark { background: rgba(255, 255, 255, .16); backdrop-filter: blur(4px); border: 1px solid rgba(255,255,255,.28); }
.lh-title { font-size: 27px; line-height: 1.3; letter-spacing: -.5px; margin: 44px 0 10px; font-weight: 700; }
.lh-sub { margin: 0; font-size: 13.5px; color: rgba(255,255,255,.82); }
.lh-feats { list-style: none; margin: 34px 0 0; padding: 0; display: flex; flex-direction: column; gap: 13px; }
.lh-feats li {
  font-size: 13px; color: rgba(255,255,255,.92); line-height: 1.55; padding-left: 24px; position: relative;
}
.lh-feats li::before {
  content: ""; position: absolute; left: 0; top: 3px; width: 15px; height: 15px; border-radius: 50%;
  background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.45);
}
.lh-feats li::after {
  content: ""; position: absolute; left: 4px; top: 7px; width: 6px; height: 3.5px;
  border-left: 1.6px solid #fff; border-bottom: 1.6px solid #fff; transform: rotate(-45deg);
}
.lh-feats b { display: block; font-size: 13.5px; margin-bottom: 1px; }
.lh-foot { margin-top: auto; padding-top: 30px; font-size: 11.5px; color: rgba(255,255,255,.55); }
.lh-right { padding: 44px 40px 32px; display: flex; flex-direction: column; }
.lh-right h1 { font-size: 23px; margin: 0 0 4px; letter-spacing: -.4px; }
.lh-right .sub { margin: 0 0 26px; color: var(--muted); font-size: 13px; }
.lh-right .note-box { margin-top: auto; }
.login-hero .field { margin-bottom: 15px; }
.login-hero .field label { display: block; font-size: 12.5px; color: var(--text-2); margin-bottom: 6px; font-weight: 500; }
.login-hero .input { height: 40px; }
/* 品牌 Logo（登录页与侧栏共用） */
.logo-mark {
  width: 38px; height: 38px; border-radius: 11px; background: linear-gradient(135deg, #2563eb, #7c3aed);
  display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 17px; letter-spacing: -.5px;
}
@media (max-width: 860px) {
  .login-hero { grid-template-columns: 1fr; min-height: 0; max-width: 440px; }
  .lh-left { padding: 28px 26px 22px; }
  .lh-title { margin-top: 24px; font-size: 21px; }
  .lh-title br { display: none; }
  .lh-sub { margin-top: 4px; }
  .lh-feats { display: none; }
  .lh-foot { padding-top: 18px; }
  .lh-right { padding: 30px 26px 24px; }
}

/* ---------------- 通用控件 ---------------- */
.input, .select, .textarea {
  width: 100%; padding: 9px 12px; border: 1px solid var(--line-strong); border-radius: 8px;
  background: #fff; outline: none; transition: border-color .15s, box-shadow .15s;
}
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}
.textarea { resize: vertical; min-height: 90px; line-height: 1.6; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' stroke='%237c8798' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center; padding-right: 30px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 15px; border-radius: 8px; border: 1px solid var(--line-strong);
  background: #fff; cursor: pointer; font-weight: 500; transition: all .15s; white-space: nowrap;
}
.btn:hover { background: #f8fafc; border-color: #b9c4d4; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-ghost { border-color: transparent; background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: #eef2f7; }
.btn-sm { padding: 5px 10px; font-size: 12.5px; border-radius: 7px; }
.btn-danger { color: var(--red); border-color: #f3c4c0; background: #fff; }
.btn-danger:hover { background: var(--red-soft); }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* ---------------- 骨架 ---------------- */
.shell { display: grid; grid-template-columns: 216px 1fr; height: 100vh; overflow: hidden; }
.sidebar {
  background: #fff; border-right: 1px solid var(--line);
  display: flex; flex-direction: column; overflow: hidden;
}
.side-head { padding: 18px 18px 14px; display: flex; align-items: center; gap: 9px; }
.side-head .logo-mark { width: 32px; height: 32px; border-radius: 9px; font-size: 14px; }
.side-title { font-weight: 600; font-size: 14.5px; letter-spacing: -.2px; }
.side-sub { font-size: 11px; color: var(--muted); margin-top: -2px; }
.nav { padding: 6px 10px; flex: 1; overflow-y: auto; }
.nav-label { font-size: 11px; color: #9aa4b2; padding: 12px 8px 6px; font-weight: 600; letter-spacing: .4px; }
/* 可折叠分组标签 */
.nav-gtoggle { display: flex; align-items: center; cursor: pointer; user-select: none; border-radius: 6px; }
.nav-gtoggle:hover { color: var(--text-2); }
.nav-gtoggle .g-arrow {
  margin-left: auto; width: 10px; height: 10px; opacity: .55;
  border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg); transition: transform .15s; margin-right: 3px;
}
.nav-gtoggle.fold .g-arrow { transform: rotate(-45deg); }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px;
  color: var(--text-2); cursor: pointer; font-size: 13.5px; margin-bottom: 2px; transition: all .13s;
  border: none; background: none; width: 100%; text-align: left;
}
.nav-item:hover { background: #f2f5fa; color: var(--text); }
.nav-item.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.nav-item svg { width: 17px; height: 17px; flex-shrink: 0; }
.nav-badge {
  margin-left: auto; background: var(--red); color: #fff; font-size: 10.5px;
  padding: 1px 6px; border-radius: 20px; font-weight: 600;
}
.side-foot { padding: 10px; border-top: 1px solid var(--line); }
.user-chip { display: flex; align-items: center; gap: 9px; padding: 8px; border-radius: 8px; cursor: pointer; }
.user-chip:hover { background: #f2f5fa; }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; background: var(--primary-soft); color: var(--primary);
  display: grid; place-items: center; font-weight: 600; font-size: 13px; flex-shrink: 0;
}
.user-chip .u-name { font-size: 13px; font-weight: 500; line-height: 1.2; }
.user-chip .u-role { font-size: 11px; color: var(--muted); }

.main { display: flex; flex-direction: column; overflow: hidden; background: var(--bg); }
.topbar {
  height: 58px; background: #fff; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 14px; padding: 0 22px; flex-shrink: 0;
}
.page-title { font-size: 16px; font-weight: 600; letter-spacing: -.2px; }
.search-box { position: relative; margin-left: auto; width: 260px; }
.search-box input { padding-left: 32px; height: 34px; font-size: 13px; }
.search-box svg { position: absolute; left: 10px; top: 9px; width: 15px; height: 15px; color: var(--muted); }
.search-drop {
  position: absolute; top: 40px; left: 0; right: 0; background: #fff; border: 1px solid var(--line);
  border-radius: 9px; box-shadow: 0 12px 30px rgba(15,23,42,.12); overflow: hidden; z-index: 60;
}
.search-drop div { padding: 9px 12px; cursor: pointer; font-size: 13px; border-bottom: 1px solid #f1f4f9; }
.search-drop div:last-child { border-bottom: none; }
.search-drop div:hover { background: var(--primary-soft); }
.content { flex: 1; overflow-y: auto; padding: 20px 22px 40px; }

/* ---------------- 卡片 / 栅格 ---------------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.card-head {
  padding: 14px 16px; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 10px;
}
.card-head h3 { margin: 0; font-size: 14px; font-weight: 600; }
.card-head .more { margin-left: auto; font-size: 12.5px; color: var(--muted); cursor: pointer; }
.card-body { padding: 16px; }
.grid { display: grid; gap: 14px; }
.g4 { grid-template-columns: repeat(4, 1fr); }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g2 { grid-template-columns: repeat(2, 1fr); }
.g21 { grid-template-columns: 2fr 1fr; }
.g12 { grid-template-columns: 1fr 2fr; }
@media (max-width: 1280px) { .g4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 1080px) { .g3, .g2, .g21, .g12 { grid-template-columns: 1fr; } }

/* ---------------- 指标卡 ---------------- */
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 15px 16px; }
.stat .lbl { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.stat .val { font-size: 25px; font-weight: 650; letter-spacing: -.8px; margin-top: 6px; line-height: 1.15; }
.stat .val small { font-size: 13px; font-weight: 500; color: var(--muted); margin-left: 3px; letter-spacing: 0; }
.stat .foot { font-size: 12px; color: var(--muted); margin-top: 5px; }
.stat.accent { background: linear-gradient(135deg, #1e40af, #4f46e5); border-color: transparent; color: #fff; }
.stat.accent .lbl, .stat.accent .foot { color: rgba(255,255,255,.78); }
.stat.accent .val small { color: rgba(255,255,255,.75); }
.up { color: var(--red); }
.down { color: var(--green); }

/* ---------------- 表格 ---------------- */
.table-wrap { overflow-x: auto; }
table.tb { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tb th {
  text-align: left; font-weight: 500; color: var(--muted); font-size: 12px;
  padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; background: #fbfcfe;
  position: sticky; top: 0; z-index: 2;
}
table.tb td { padding: 10px 12px; border-bottom: 1px solid #f1f4f9; vertical-align: middle; }
table.tb tbody tr { cursor: pointer; transition: background .1s; }
table.tb tbody tr:hover { background: #f8fafd; }
table.tb tbody tr:last-child td { border-bottom: none; }
.co-name { font-weight: 500; color: var(--text); }
.co-sub { font-size: 11.5px; color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }

/* ---------------- 徽标 ---------------- */
.badge {
  display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 500;
  padding: 2px 8px; border-radius: 6px; background: #f1f5f9; color: var(--text-2); white-space: nowrap;
}
.badge.blue { background: var(--primary-soft); color: var(--primary-dark); }
.badge.green { background: var(--green-soft); color: #0b7a44; }
.badge.red { background: var(--red-soft); color: #b91c1c; }
.badge.amber { background: var(--amber-soft); color: #b45309; }
.badge.purple { background: var(--purple-soft); color: #6d28d9; }
.badge.gray { background: #f1f5f9; color: #64748b; }
.dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.lvl { font-weight: 700; font-size: 11.5px; width: 20px; height: 20px; border-radius: 5px;
  display: inline-grid; place-items: center; }
.lvl-A { background: #fee2e2; color: #b91c1c; }
.lvl-B { background: #fef3c7; color: #b45309; }
.lvl-C { background: #e0e7ff; color: #3730a3; }
.lvl-D { background: #f1f5f9; color: #64748b; }

/* ---------------- 工具条 ---------------- */
.toolbar { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .input, .toolbar .select { width: auto; min-width: 130px; height: 34px; padding-top: 0; padding-bottom: 0; }
.toolbar .spacer { flex: 1; }
.chip {
  padding: 5px 11px; border-radius: 20px; border: 1px solid var(--line-strong); background: #fff;
  font-size: 12.5px; cursor: pointer; color: var(--text-2); transition: all .13s;
}
.chip:hover { border-color: #a9b8cc; }
.chip.on { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 500; }

/* 行内操作降噪：默认半隐，hover 行时浮现；soft 按钮替代满屏实心主按钮 */
table.tb .row-act { opacity: .5; transition: opacity .12s; }
table.tb tr:hover .row-act,
table.tb .row-act:focus-visible { opacity: 1; }
.btn-soft {
  border-color: transparent; background: var(--primary-soft); color: var(--primary-dark);
}
.btn-soft:hover { background: #dfeaff; border-color: transparent; }
.btn-soft.green { background: var(--green-soft); color: #0b7a44; }
.btn-soft.green:hover { background: #d8f0e2; }
.btn-soft.red { background: var(--red-soft); color: #b91c1c; }
.btn-soft.red:hover { background: #fddcd9; }

/* ---------------- 分页 ---------------- */
.pager { display: flex; align-items: center; gap: 8px; justify-content: flex-end; padding: 12px 4px; font-size: 13px; color: var(--muted); }

/* ---------------- 抽屉 ---------------- */
.drawer-mask {
  position: fixed; inset: 0; background: rgba(15, 23, 42, .38); z-index: 200;
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
.drawer-mask.on { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: 720px; max-width: 94vw; background: #fff;
  z-index: 201; display: flex; flex-direction: column; transform: translateX(100%);
  transition: transform .26s cubic-bezier(.32,.72,0,1); box-shadow: -18px 0 50px rgba(15,23,42,.16);
}
.drawer.on { transform: translateX(0); }
.drawer-head { padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: flex-start; gap: 12px; }
.drawer-head h2 { margin: 0; font-size: 17px; letter-spacing: -.3px; }
.drawer-head .x { margin-left: auto; cursor: pointer; color: var(--muted); padding: 4px; border-radius: 6px; }
.drawer-head .x:hover { background: #f1f5f9; color: var(--text); }
.drawer-body { flex: 1; overflow-y: auto; padding: 18px 20px 40px; }
.drawer-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); padding: 0 20px; }
.drawer-tab {
  padding: 10px 12px; font-size: 13px; cursor: pointer; color: var(--text-2);
  border-bottom: 2px solid transparent; margin-bottom: -1px; background: none; border-top: none;
  border-left: none; border-right: none;
}
.drawer-tab.on { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

/* ---------------- 信息网格 ---------------- */
.kv { display: grid; grid-template-columns: 92px 1fr; gap: 9px 12px; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; color: var(--text); }
.section-title {
  font-size: 12.5px; font-weight: 600; color: var(--text-2); margin: 20px 0 10px;
  display: flex; align-items: center; gap: 7px;
}
.section-title::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ---------------- AI 面板 ---------------- */
.ai-panel {
  background: linear-gradient(135deg, #f5f0ff 0%, #eef4ff 100%);
  border: 1px solid #ddd6fe; border-radius: var(--radius); padding: 14px 16px;
}
.ai-panel .ai-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.ai-tag {
  font-size: 10.5px; font-weight: 700; letter-spacing: .5px; padding: 2px 7px; border-radius: 5px;
  background: linear-gradient(135deg, #7c3aed, #2563eb); color: #fff;
}
.ai-rec {
  background: #fff; border: 1px solid #e6e5f5; border-radius: 9px; padding: 11px 13px; margin-bottom: 8px;
}
.ai-rec .t { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.ai-rec .t b { font-size: 13.5px; }
.ai-rec .r { font-size: 12.5px; color: var(--text-2); line-height: 1.6; }
.ai-rec .talk {
  margin-top: 7px; font-size: 12.5px; color: #4c1d95; background: #faf7ff;
  border-left: 2px solid #a78bfa; padding: 6px 10px; border-radius: 0 6px 6px 0; line-height: 1.6;
}
.ai-loading { display: flex; align-items: center; gap: 8px; color: var(--purple); font-size: 13px; padding: 8px 0; }
.spinner {
  width: 14px; height: 14px; border: 2px solid #ddd6fe; border-top-color: #7c3aed;
  border-radius: 50%; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------- 看板 ---------------- */
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(240px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 10px; }
.kcol { background: #eef1f6; border-radius: var(--radius); padding: 10px; min-height: 200px; }
.kcol-head { display: flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 600; color: var(--text-2); margin-bottom: 9px; padding: 0 3px; }
.kcol-head .cnt { margin-left: auto; font-weight: 500; color: var(--muted); font-size: 11.5px; }
.kcard {
  background: #fff; border: 1px solid var(--line); border-radius: 9px; padding: 10px 11px; margin-bottom: 8px;
  cursor: pointer; transition: all .13s;
}
.kcard:hover { border-color: #a9b8cc; box-shadow: var(--shadow); transform: translateY(-1px); }
.kcard .kc-t { font-size: 13px; font-weight: 500; margin-bottom: 4px; }
.kcard .kc-m { font-size: 11.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; }

/* ---------------- 漏斗 ---------------- */
.funnel-row { display: flex; align-items: center; gap: 10px; margin-bottom: 9px; font-size: 12.5px; }
.funnel-row .fl { width: 52px; color: var(--text-2); }
.funnel-row .fbar-wrap { flex: 1; height: 26px; background: #f1f5f9; border-radius: 6px; overflow: hidden; }
.funnel-row .fbar {
  height: 100%; background: linear-gradient(90deg, #3b82f6, #6366f1); border-radius: 6px;
  display: flex; align-items: center; padding-left: 9px; color: #fff; font-size: 11.5px; font-weight: 600;
  transition: width .5s ease;
}
.funnel-row .fv { width: 92px; text-align: right; color: var(--text-2); font-variant-numeric: tabular-nums; }

/* ---------------- 时间线 ---------------- */
.timeline { position: relative; padding-left: 20px; }
.timeline::before { content: ""; position: absolute; left: 5px; top: 6px; bottom: 6px; width: 1px; background: var(--line); }
.tl-item { position: relative; padding-bottom: 16px; }
.tl-item::before {
  content: ""; position: absolute; left: -18px; top: 5px; width: 9px; height: 9px; border-radius: 50%;
  background: #fff; border: 2px solid #cbd5e1;
}
.tl-item.ai::before { border-color: var(--purple); background: var(--purple-soft); }
.tl-head { display: flex; align-items: center; gap: 8px; font-size: 12.5px; margin-bottom: 3px; }
.tl-head b { font-size: 13px; }
.tl-head .time { margin-left: auto; color: var(--muted); font-size: 11.5px; }
.tl-body { font-size: 12.5px; color: var(--text-2); line-height: 1.65; }

/* ---------------- 弹窗 ---------------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(15,23,42,.4); z-index: 300; display: none;
  place-items: center; padding: 24px;
}
.modal-mask.on { display: grid; }
.modal {
  background: #fff; border-radius: 14px; width: 560px; max-width: 96vw; max-height: 88vh;
  display: flex; flex-direction: column; box-shadow: 0 24px 70px rgba(15,23,42,.24);
}
.modal-head { padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; }
.modal-head h3 { margin: 0; font-size: 15.5px; }
.modal-body { padding: 18px 20px; overflow-y: auto; }
.modal-foot { padding: 13px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 9px; }

/* ---------------- Toast ---------------- */
.toast-wrap { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 400; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  background: #0f172a; color: #fff; padding: 9px 16px; border-radius: 9px; font-size: 13px;
  box-shadow: 0 8px 28px rgba(15,23,42,.24); animation: tIn .22s ease; max-width: 80vw;
}
.toast.err { background: #b91c1c; }
.toast.ok { background: #15803d; }
@keyframes tIn { from { opacity: 0; transform: translateY(-8px); } }

/* ---------------- 其它 ---------------- */
.empty { text-align: center; padding: 40px 20px; color: var(--muted); font-size: 13px; }
.empty svg { width: 38px; height: 38px; opacity: .35; margin-bottom: 8px; }
.hint { font-size: 12px; color: var(--muted); }
.flex { display: flex; align-items: center; }
.gap6 { gap: 6px; } .gap8 { gap: 8px; } .gap12 { gap: 12px; }
.mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 16px; }
.mb8 { margin-bottom: 8px; } .mb12 { margin-bottom: 12px; }
.right { margin-left: auto; }
.w100 { width: 100%; }
.progress { height: 5px; background: #eef1f6; border-radius: 4px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--primary); border-radius: 4px; }
.stage-flow { display: flex; align-items: center; gap: 0; margin: 6px 0 14px; }
.stage-node {
  flex: 1; text-align: center; font-size: 11.5px; color: var(--muted); position: relative; padding-top: 16px;
}
.stage-node::before {
  content: ""; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 10px; height: 10px; border-radius: 50%; background: #e2e8f0;
}
.stage-node::after {
  content: ""; position: absolute; top: 4px; left: 50%; width: 100%; height: 2px; background: #e2e8f0;
}
.stage-node:last-child::after { display: none; }
.stage-node.done { color: var(--primary); font-weight: 600; }
.stage-node.done::before { background: var(--primary); }
.stage-node.done::after { background: var(--primary); }
.note-box {
  background: #fbfcfe; border: 1px dashed var(--line-strong); border-radius: 9px; padding: 11px 13px;
  font-size: 12.5px; color: var(--text-2); line-height: 1.7;
}

/* ---------- 组织与权限 ---------- */
.u-scope {
  margin-top: 6px; font-size: 10.5px; color: var(--muted); text-align: center;
  background: #f1f5f9; border-radius: 5px; padding: 2px 0;
}
.role-item {
  padding: 9px 10px; border-radius: 8px; cursor: pointer; margin-bottom: 4px;
  border: 1px solid transparent;
}
.role-item:hover { background: #f8fafc; }
.role-item.on { background: var(--primary-soft); border-color: #c7dbff; }
.perm-tb th { font-size: 11.5px; }
.perm-tb td { vertical-align: middle; }
.perm-tb .co-sub { font-size: 11px; margin-top: 1px; }
.perm-tb input[type="checkbox"] { width: 15px; height: 15px; accent-color: var(--primary); cursor: pointer; }
.perm-tb input[type="checkbox"]:disabled { cursor: not-allowed; opacity: .55; }
.select-sm { height: 28px; padding: 0 22px 0 8px; font-size: 12px; }

/* ---------- 页签 ---------- */
.tabbar { display: inline-flex; gap: 4px; background: #e9edf4; padding: 3px; border-radius: 9px; }
.tabbtn {
  border: none; background: transparent; padding: 6px 15px; border-radius: 7px;
  font-size: 12.5px; color: var(--text-2); cursor: pointer; transition: all .13s; font-weight: 500;
}
.tabbtn:hover { color: var(--text); }
.tabbtn.on { background: #fff; color: var(--primary-dark); box-shadow: 0 1px 3px rgba(15,23,42,.09); }

/* ---------- 业务线面板 ---------- */
.line-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(272px, 1fr)); gap: 12px; }
.line-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 15px;
  cursor: pointer; transition: all .14s;
}
.line-card:hover { border-color: #b6c4d8; box-shadow: var(--shadow); transform: translateY(-1px); }
.lc-head { display: flex; align-items: center; gap: 7px; font-size: 13.5px; margin-bottom: 12px; }
.lc-head i { width: 9px; height: 9px; border-radius: 3px; flex: none; }
.lc-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 11px; }
.lc-kpis div { display: flex; flex-direction: column; }
.lc-kpis b { font-size: 18px; font-weight: 650; letter-spacing: -.5px; line-height: 1.2; font-variant-numeric: tabular-nums; }
.lc-kpis span { font-size: 11px; color: var(--muted); }
.lc-foot { display: flex; align-items: center; gap: 6px; margin-top: 9px; font-size: 11px; }
.stack-bar { display: flex; height: 6px; border-radius: 4px; overflow: hidden; background: #eef1f6; }
.stack-bar i { display: block; height: 100%; }
.tag-mini {
  font-size: 10.5px; background: #f1f5f9; color: var(--text-2); border-radius: 5px; padding: 1px 6px;
}
.line-dot { display: inline-block; width: 7px; height: 7px; border-radius: 2px; margin-right: 6px; vertical-align: 1px; }

/* ---------- 迷你条形 ---------- */
.mini-bar { height: 6px; border-radius: 4px; background: #eef1f6; overflow: hidden; }
.mini-bar i { display: block; height: 100%; background: linear-gradient(90deg, #3b82f6, #6366f1); border-radius: 4px; }
.mini-bar i.warn { background: linear-gradient(90deg, #f59e0b, #ef4444); }
.load-row { display: flex; align-items: center; gap: 8px; padding: 5px 0; font-size: 12.5px; }
.load-row .ln { width: 56px; flex: none; }
.load-row .mini-bar { flex: 1; }
.load-row .lv2 { width: 26px; text-align: right; font-variant-numeric: tabular-nums; color: var(--text-2); }

/* ---------- 趋势双条 ---------- */
.trend-row { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; font-size: 11.5px; }
.trend-row .tl { width: 38px; color: var(--muted); flex: none; }
.trend-bars { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.trend-bars i { display: block; height: 7px; border-radius: 3px; min-width: 2px; }
.trend-bars i.new { background: #93b4f7; }
.trend-bars i.done { background: #34d399; }
.trend-row .tv { width: 72px; text-align: right; color: var(--text-2); font-variant-numeric: tabular-nums; }

/* ---------- 财务发票 ---------- */
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.pick-list { max-height: 168px; overflow-y: auto; margin-top: 6px; }
.pick-item {
  display: flex; align-items: center; gap: 8px; padding: 7px 9px; border-radius: 7px;
  cursor: pointer; font-size: 12.5px;
}
.pick-item:hover { background: var(--primary-soft); }
.pick-item .co-sub { margin-left: auto; }

/* ============ 蓝图 v2.0 交付中心 ============ */
:root {
  --ok: var(--green);
  --danger: var(--red);
  --warn: var(--amber);
  --brand: var(--primary);
}

/* 交付日历 */
.cal-head { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-bottom: 4px; }
.cal-h { text-align: center; font-size: 11.5px; color: var(--muted); padding: 3px 0; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-cell {
  min-height: 78px; border: 1px solid var(--line); border-radius: 7px;
  padding: 4px 5px; background: #fff; overflow: hidden;
}
.cal-cell.cal-today { border-color: var(--primary); background: var(--primary-soft); }
.cal-day { font-size: 11.5px; color: var(--text-2); font-weight: 600; margin-bottom: 2px; }
.cal-item {
  font-size: 10.5px; line-height: 1.5; padding: 1px 4px; border-radius: 4px;
  margin-bottom: 2px; cursor: pointer; color: #fff; overflow: hidden;
}
/* 批次状态色（语义化）：灰=未计划 · 深灰=待启动 · 蓝=交付中 · 紫=待客户确认
   天蓝/青=已提交/受理中 · 浅绿/深绿=已到账/已结算 · 红=异常 */
.cal-item.st-BATCH_S1 { background: #94a3b8; }
.cal-item.st-BATCH_S2 { background: #64748b; }
.cal-item.st-BATCH_S3 { background: #2563eb; }
.cal-item.st-BATCH_S4 { background: #7c3aed; }
.cal-item.st-BATCH_S5 { background: #0ea5e9; }
.cal-item.st-BATCH_S6 { background: #0891b2; }
.cal-item.st-BATCH_S7 { background: #10b981; }
.cal-item.st-BATCH_S8 { background: #059669; }
.cal-item.st-BATCH_S9 { background: #dc2626; }

/* 里程碑时间轴 */
.ms-line { display: flex; flex-direction: column; gap: 0; }
.ms-node { display: flex; gap: 9px; position: relative; padding-bottom: 9px; }
.ms-node:not(:last-child)::before {
  content: ''; position: absolute; left: 9px; top: 20px; bottom: 0;
  width: 1.5px; background: var(--line-strong);
}
.ms-dot {
  width: 19px; height: 19px; border-radius: 50%; flex: 0 0 19px;
  display: flex; align-items: center; justify-content: center;
  font-size: 10.5px; font-weight: 600; color: #fff; background: #cbd5e1; z-index: 1;
}
.ms-MST_DONE .ms-dot { background: var(--green); }
.ms-MST_DOING .ms-dot { background: var(--amber); }
.ms-MST_BLOCK .ms-dot { background: var(--red); }
.ms-MST_SKIP .ms-dot { background: #94a3b8; }
.ms-body { flex: 1; min-width: 0; padding-bottom: 2px; }
.ms-MST_DONE .ms-body b { color: var(--muted); text-decoration: line-through; }

/* ---------------- 岗位工作台（v2.1 C8） ---------------- */
.stat.danger { background: linear-gradient(135deg, #b91c1c, #dc2626); border-color: transparent; color: #fff; }
.stat.danger .lbl, .stat.danger .foot { color: rgba(255,255,255,.8); }
.stat.warn { background: linear-gradient(135deg, #92400e, #d97706); border-color: transparent; color: #fff; }
.stat.warn .lbl, .stat.warn .foot { color: rgba(255,255,255,.8); }
.wb-todos { display: flex; flex-direction: column; max-height: 340px; overflow-y: auto; }
.wb-todo {
  display: flex; align-items: center; gap: 8px; padding: 8px 6px;
  border-bottom: 1px solid var(--line); cursor: pointer; transition: background .12s;
}
.wb-todo:last-child { border-bottom: none; }
.wb-todo:hover { background: #f5f7fb; }
.wb-todo .wt-main { flex: 1; min-width: 0; }
.wb-todo .wt-main b { display: block; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wb-todo .wt-main .hint { font-size: 11.5px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wb-todo .wt-arrow { color: var(--muted); font-size: 15px; }
@media (max-width: 720px) { .wb-todos { max-height: none; } }

/* ---------------- 员工账号批量管理 ---------------- */
.bulk-bar {
  display: none; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 9px 14px; background: #eef4ff; border-top: 1px solid #dbe6fb; border-bottom: 1px solid #dbe6fb;
}
.bulk-bar.on { display: flex; }
.bulk-bar .bulk-n { font-size: 12.5px; color: var(--text-2); }
.bulk-bar .bulk-n b { color: var(--primary); font-size: 14px; }
.bulk-bar .spacer { flex: 1; }
.ck-cell { width: 34px; text-align: center; }
.ck-cell input, .tb th input[type="checkbox"] {
  width: 15px; height: 15px; cursor: pointer; accent-color: var(--primary); vertical-align: middle;
}
tr.row-off td { background: #fafbfd; }
tr.row-off .co-name { color: var(--muted); }
tr.row-off:hover td { background: #f5f7fb; }
