/* =========================================================
   江西藏山运营数据工作台 — 原生 CSS
   深色侧栏 + 浅色内容区的 B 端控制台视觉体系
   ========================================================= */

:root {
  --bg:            #f3f5f9;
  --surface:       #ffffff;
  --surface-alt:   #f8fafc;
  --ink:           #0f172a;
  --ink-2:         #334155;
  --muted:         #64748b;
  --muted-2:       #94a3b8;
  --line:          #e4e9f0;
  --line-strong:   #cbd5e1;

  --side-bg:       #0d1526;
  --side-bg-2:     #131f36;
  --side-ink:      #cbd5e1;
  --side-ink-dim:  #7c8aa5;

  --brand:         #2563eb;
  --brand-ink:     #1d4ed8;
  --brand-soft:    #eff4ff;
  --teal:          #0d9488;
  --amber:         #d97706;
  --amber-soft:    #fffbeb;
  --red:           #dc2626;
  --red-soft:      #fef2f2;
  --green:         #059669;
  --green-soft:    #ecfdf5;

  --radius:        10px;
  --radius-sm:     7px;
  --shadow-sm:     0 1px 2px rgba(15, 23, 42, .06);
  --shadow-md:     0 4px 14px rgba(15, 23, 42, .08);
  --shadow-lg:     0 18px 46px rgba(15, 23, 42, .18);

  --font: "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  --mono: "Cascadia Mono", "Consolas", ui-monospace, monospace;
}

* { box-sizing: border-box; }

/* 必须显式兜底：本文件的多处 display:grid/flex 会覆盖 UA 的 [hidden] 规则 */
[hidden] { display: none !important; }

html, body {
  margin: 0; padding: 0; height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -.01em; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
code { font-family: var(--mono); font-size: 12px; }

.num { font-variant-numeric: tabular-nums; }

/* ============================ 按钮 ============================ */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 34px; padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink-2);
  font-size: 13px; font-weight: 500;
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s;
  white-space: nowrap;
}
.btn:hover { background: var(--surface-alt); border-color: var(--muted-2); }
.btn:active { transform: translateY(.5px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.btn-primary {
  background: var(--brand); border-color: var(--brand); color: #fff;
  box-shadow: 0 1px 2px rgba(37, 99, 235, .3);
}
.btn-primary:hover { background: var(--brand-ink); border-color: var(--brand-ink); }

.btn-danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn-danger:hover { background: #b91c1c; border-color: #b91c1c; }

.btn-sm { height: 28px; padding: 0 10px; font-size: 12px; }
.btn-block { width: 100%; }

.btn-ghost {
  background: transparent; border-color: rgba(203, 213, 225, .28); color: var(--side-ink);
}
.btn-ghost:hover { background: rgba(255, 255, 255, .07); color: #fff; }

.icon-btn {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; padding: 0;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--muted);
  transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--surface-alt); color: var(--ink); }
.icon-btn svg { width: 18px; height: 18px; fill: currentColor; }
.icon-btn .dot {
  position: absolute; top: 6px; right: 6px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--red); border: 1.5px solid #fff;
}

/* ============================ 登录 ============================ */

.login-view {
  min-height: 100vh; display: grid; place-items: center;
  background:
    radial-gradient(900px 600px at 12% -10%, #1e3a8a 0%, transparent 55%),
    radial-gradient(800px 500px at 100% 110%, #0f766e 0%, transparent 50%),
    #0b1220;
  padding: 24px;
}
.login-panel {
  width: 100%; max-width: 420px;
  background: var(--surface);
  border-radius: 16px;
  padding: 32px;
  box-shadow: var(--shadow-lg);
}
.login-brand { display: flex; gap: 14px; align-items: center; margin-bottom: 26px; }
.login-brand h1 { font-size: 18px; letter-spacing: -.02em; }
.login-brand p { font-size: 12px; color: var(--muted); margin-top: 3px; }

.brand-mark {
  width: 42px; height: 42px; flex: none;
  display: grid; place-items: center;
  border-radius: 11px;
  background: linear-gradient(140deg, #2563eb, #0d9488);
  color: #fff; font-size: 19px; font-weight: 700;
  box-shadow: 0 4px 12px rgba(37, 99, 235, .3);
}

.login-form { display: grid; gap: 14px; }
.field { display: grid; gap: 6px; }
.field > span { font-size: 12px; font-weight: 500; color: var(--ink-2); }
.field input, .field select, .field textarea {
  width: 100%; height: 38px; padding: 0 12px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink); font-family: inherit; font-size: 13px;
  outline: none; transition: border-color .15s, box-shadow .15s;
}
.field textarea { height: auto; min-height: 88px; padding: 10px 12px; resize: vertical; line-height: 1.6; }
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--brand); box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}
.login-error {
  padding: 9px 12px; border-radius: var(--radius-sm);
  background: var(--red-soft); border: 1px solid #fecaca;
  color: #b91c1c; font-size: 12.5px;
}
.login-hint { margin-top: 22px; padding-top: 18px; border-top: 1px dashed var(--line); }
.hint-title { font-size: 11px; font-weight: 600; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; }
.hint-grid { display: grid; gap: 6px; margin-top: 9px; }
.hint-grid code {
  background: var(--surface-alt); border: 1px solid var(--line);
  padding: 6px 10px; border-radius: 5px; color: var(--ink-2);
}

/* ============================ 应用骨架 ============================ */

.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 232px; flex: none;
  display: flex; flex-direction: column;
  background: linear-gradient(180deg, var(--side-bg) 0%, var(--side-bg-2) 100%);
  color: var(--side-ink);
  position: sticky; top: 0; height: 100vh;
}
.sidebar-brand {
  display: flex; align-items: center; gap: 11px;
  padding: 20px 18px 18px;
  border-bottom: 1px solid rgba(148, 163, 184, .12);
}
.brand-text { display: grid; gap: 1px; }
.brand-text strong { color: #fff; font-size: 14.5px; letter-spacing: -.01em; }
.brand-text small { color: var(--side-ink-dim); font-size: 11px; }

.nav { flex: 1; padding: 14px 10px; display: grid; gap: 3px; align-content: start; overflow-y: auto; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  color: var(--side-ink); font-size: 13.5px; font-weight: 500;
  transition: background .15s, color .15s;
  position: relative;
}
.nav-item:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav-item.active {
  background: linear-gradient(90deg, rgba(37, 99, 235, .26), rgba(37, 99, 235, .1));
  color: #fff;
  box-shadow: inset 2px 0 0 var(--brand);
}
.nav-icon { width: 17px; height: 17px; fill: currentColor; opacity: .82; flex: none; }
.nav-item.active .nav-icon { opacity: 1; }
.nav-badge {
  margin-left: auto;
  min-width: 19px; height: 19px; padding: 0 5px;
  display: grid; place-items: center;
  border-radius: 10px; background: var(--red);
  color: #fff; font-size: 11px; font-style: normal; font-weight: 600;
}

.sidebar-foot {
  padding: 14px 12px 16px;
  border-top: 1px solid rgba(148, 163, 184, .12);
  display: grid; gap: 10px;
}
.user-mini { display: flex; align-items: center; gap: 10px; padding: 0 4px; }
.user-mini-info { display: grid; gap: 0; min-width: 0; }
.user-mini-info strong { color: #fff; font-size: 13px; font-weight: 500; }
.user-mini-info small { color: var(--side-ink-dim); font-size: 11px; }

.avatar {
  width: 32px; height: 32px; flex: none;
  display: grid; place-items: center;
  border-radius: 9px;
  background: linear-gradient(140deg, #2563eb, #0d9488);
  color: #fff; font-size: 12.5px; font-weight: 600;
}

.main-area { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 13px 24px;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar-left h2 { font-size: 16px; }
.topbar-left p { font-size: 11.5px; color: var(--muted); margin-top: 1px; }
.topbar-right { display: flex; align-items: center; gap: 12px; }

.sync-state {
  display: inline-flex; align-items: center; gap: 6px;
  height: 28px; padding: 0 10px;
  border: 1px solid var(--line); border-radius: 20px;
  background: var(--surface);
  font-size: 11.5px; color: var(--muted); white-space: nowrap;
}
.sync-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); flex: none; }
.sync-state.stale .sync-dot { background: var(--amber); }
.sync-state.offline .sync-dot { background: var(--red); }
.sync-state.flash { border-color: #a7f3d0; background: var(--green-soft); color: var(--green); }
.sync-state.flash .sync-dot { animation: syncPulse .9s ease; }
@keyframes syncPulse {
  0% { transform: scale(1); }
  50% { transform: scale(2.2); box-shadow: 0 0 0 4px rgba(5, 150, 105, .18); }
  100% { transform: scale(1); }
}

.user-chip { display: flex; align-items: center; gap: 9px; padding-left: 12px; border-left: 1px solid var(--line); }
.user-chip-info { display: grid; }
.user-chip-info strong { font-size: 12.5px; font-weight: 600; }
.user-chip-info small { font-size: 10.5px; color: var(--muted); }

.content { flex: 1; padding: 20px 24px 40px; min-width: 0; }

/* ============================ 通用卡片 ============================ */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}
.card-head h3 { font-size: 13.5px; }
.card-head .sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.card-body { padding: 16px; }
.card-body.tight { padding: 12px 16px; }

.section-title {
  display: flex; align-items: center; justify-content: space-between;
  margin: 22px 0 12px; gap: 12px;
}
.section-title:first-child { margin-top: 0; }
.section-title h3 { font-size: 13.5px; color: var(--ink); }
.section-title .hint { font-size: 11.5px; color: var(--muted); }

/* ============================ KPI 卡片 ============================ */

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(196px, 1fr));
  gap: 12px;
}
.kpi {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 13px 15px 14px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: box-shadow .18s, transform .18s;
}
.kpi:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.kpi::after {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--kpi-accent, var(--brand));
}
.kpi-label { font-size: 11.5px; color: var(--muted); font-weight: 500; display: flex; align-items: center; gap: 5px; }
.kpi-value {
  margin-top: 7px;
  font-size: 23px; font-weight: 650; letter-spacing: -.025em;
  color: var(--ink); font-variant-numeric: tabular-nums; line-height: 1.15;
}
.kpi-value .unit { font-size: 12px; font-weight: 500; color: var(--muted); margin-left: 3px; letter-spacing: 0; }
.kpi-foot { margin-top: 7px; font-size: 11px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.kpi-foot .tag {
  padding: 1px 6px; border-radius: 4px; font-size: 10.5px; font-weight: 500;
}
.tag-up { background: var(--green-soft); color: var(--green); }
.tag-down { background: var(--red-soft); color: var(--red); }
.tag-neutral { background: var(--surface-alt); color: var(--muted); }

/* ============================ 图表 ============================ */

.chart-grid {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 14px;
  align-items: start;
}
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
.grid-import { display: grid; grid-template-columns: 1.1fr 1fr; gap: 14px; align-items: start; }
@media (max-width: 1180px) {
  .chart-grid, .grid-2, .grid-import { grid-template-columns: 1fr; }
}

.chart-host { position: relative; width: 100%; overflow-x: auto; overflow-y: hidden; }
.chart-host svg { display: block; width: 100%; height: auto; overflow: visible; }
@media (max-width: 920px) {
  .chart-host svg { min-width: 480px; }
}

.chart-tip {
  position: absolute; z-index: 20; pointer-events: none;
  padding: 7px 10px; border-radius: 6px;
  background: #0f172a; color: #fff;
  font-size: 11.5px; line-height: 1.45; white-space: nowrap;
  box-shadow: var(--shadow-md);
  transform: translate(-50%, -120%);
  opacity: 0; transition: opacity .12s;
}
.chart-tip.on { opacity: 1; }
.chart-tip b { font-weight: 600; }

.seg {
  display: inline-flex; padding: 2px; gap: 2px;
  background: var(--surface-alt); border: 1px solid var(--line);
  border-radius: 7px;
}
.seg button {
  border: 0; background: transparent; color: var(--muted);
  font-size: 11.5px; font-weight: 500; padding: 4px 10px; border-radius: 5px;
  transition: background .15s, color .15s;
}
.seg button.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }

.legend { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-top: 12px; }
.legend-item { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--ink-2); }
.legend-dot { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.legend-item span.v { color: var(--muted); font-variant-numeric: tabular-nums; }

/* ============================ 表格 ============================ */

.table-wrap { overflow-x: auto; }
/* 固定高度内滚动：使横向滚动条始终可见，避免被长表格推到页面底部 */
.table-scroll { max-height: calc(100vh - 336px); min-height: 260px; overflow: auto; }
table.tbl {
  width: 100%; border-collapse: separate; border-spacing: 0;
  font-size: 12.5px;
}
table.tbl th {
  position: sticky; top: 0; z-index: 2;
  background: var(--surface-alt);
  padding: 9px 12px;
  text-align: left; font-weight: 600; font-size: 11.5px; color: var(--muted);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
table.tbl th.sortable { cursor: pointer; user-select: none; }
table.tbl th.sortable:hover { color: var(--ink); background: #eef2f8; }
table.tbl th .sort-ind { margin-left: 4px; font-size: 9px; color: var(--muted-2); }
table.tbl th.sorted .sort-ind { color: var(--brand); }
table.tbl td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-2);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
table.tbl tbody tr { transition: background .12s; }
table.tbl tbody tr:hover { background: #f7f9fd; }
table.tbl tbody tr.selected { background: var(--brand-soft); }
table.tbl tbody tr.clickable { cursor: pointer; }
table.tbl td.strong { color: var(--ink); font-weight: 550; }
table.tbl td.wrap { white-space: normal; min-width: 180px; }
table.tbl .col-check { width: 36px; text-align: center; }

input[type="checkbox"] {
  width: 14px; height: 14px; accent-color: var(--brand); cursor: pointer;
}

/* ============================ 徽标 ============================ */

.chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 7px; border-radius: 4px;
  font-size: 11px; font-weight: 500; line-height: 1.6;
  white-space: nowrap;
}
.chip-red     { background: var(--red-soft);   color: #b91c1c; border: 1px solid #fecaca; }
.chip-amber   { background: var(--amber-soft); color: #b45309; border: 1px solid #fde68a; }
.chip-green   { background: var(--green-soft); color: var(--green); border: 1px solid #a7f3d0; }
.chip-blue    { background: var(--brand-soft); color: var(--brand-ink); border: 1px solid #bfdbfe; }
.chip-gray    { background: var(--surface-alt); color: var(--muted); border: 1px solid var(--line); }

.tag-pill {
  display: inline-block; padding: 1px 7px; margin: 1px 3px 1px 0;
  border-radius: 10px; font-size: 10.5px;
  background: var(--brand-soft); color: var(--brand-ink);
  border: 1px solid #dbeafe;
}

/* ============================ 过滤器 / 工具条 ============================ */

.toolbar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}
.toolbar .grow { flex: 1; min-width: 160px; }
.search-box {
  position: relative; flex: 1; min-width: 180px; max-width: 320px;
}
.search-box input {
  width: 100%; height: 32px; padding: 0 10px 0 30px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--surface); font-family: inherit; font-size: 12.5px; color: var(--ink);
  outline: none; transition: border-color .15s, box-shadow .15s;
}
.search-box input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
.search-box svg {
  position: absolute; left: 9px; top: 50%; transform: translateY(-50%);
  width: 14px; height: 14px; fill: var(--muted-2);
}
select.ctl, input.ctl {
  height: 32px; padding: 0 9px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink-2);
  font-family: inherit; font-size: 12.5px; outline: none;
  transition: border-color .15s;
}
select.ctl:focus, input.ctl:focus { border-color: var(--brand); }
select.ctl { padding-right: 6px; }

.batch-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 16px;
  background: var(--brand-soft);
  border-bottom: 1px solid #dbeafe;
  font-size: 12.5px; color: var(--brand-ink);
}
.batch-bar strong { font-weight: 650; }

/* ============================ 分页 ============================ */

.pager {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  font-size: 12px; color: var(--muted);
  flex-wrap: wrap;
}
.pager-btns { display: flex; align-items: center; gap: 4px; }
.page-btn {
  min-width: 30px; height: 30px; padding: 0 8px;
  border: 1px solid var(--line); border-radius: 6px;
  background: var(--surface); color: var(--ink-2);
  font-size: 12px; font-variant-numeric: tabular-nums;
}
.page-btn:hover:not(:disabled) { background: var(--surface-alt); border-color: var(--muted-2); }
.page-btn.active { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.page-btn:disabled { opacity: .4; cursor: not-allowed; }

/* ============================ 空状态 / 骨架 ============================ */

.empty {
  display: grid; place-items: center; gap: 8px;
  padding: 52px 20px; text-align: center; color: var(--muted);
}
.empty svg { width: 40px; height: 40px; fill: var(--muted-2); opacity: .55; }
.empty h4 { font-size: 13px; color: var(--ink-2); font-weight: 600; }
.empty p { font-size: 12px; }

.skeleton {
  background: linear-gradient(90deg, #eef2f8 25%, #f6f8fc 50%, #eef2f8 75%);
  background-size: 200% 100%;
  animation: sk 1.2s infinite;
  border-radius: 6px;
}
@keyframes sk { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ============================ 抽屉 ============================ */

.drawer-mask {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(15, 23, 42, .36);
  animation: fadeIn .18s ease;
}
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 91;
  width: min(560px, 94vw);
  background: var(--surface);
  border-left: 1px solid var(--line);
  box-shadow: -18px 0 46px rgba(15, 23, 42, .16);
  display: flex; flex-direction: column;
  animation: slideIn .22s cubic-bezier(.22,.61,.36,1);
}
@keyframes slideIn { from { transform: translateX(30px); opacity: .6; } to { transform: none; opacity: 1; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.drawer-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 15px 18px; border-bottom: 1px solid var(--line); flex: none;
}
.drawer-head h3 { font-size: 14.5px; }
.drawer-body { flex: 1; overflow-y: auto; padding: 18px; }

.detail-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px; background: var(--line);
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
}
.detail-cell { background: var(--surface); padding: 10px 13px; }
.detail-cell dt { font-size: 10.5px; color: var(--muted); font-weight: 500; margin-bottom: 3px; }
.detail-cell dd { margin: 0; font-size: 12.5px; color: var(--ink); font-weight: 550; font-variant-numeric: tabular-nums; }
.detail-cell dd.big { font-size: 15px; }

.alert-box {
  padding: 11px 13px; border-radius: var(--radius-sm);
  font-size: 12px; line-height: 1.65;
}
.alert-box.critical { background: var(--red-soft); border: 1px solid #fecaca; color: #991b1b; }
.alert-box.attention { background: var(--amber-soft); border: 1px solid #fde68a; color: #92400e; }
.alert-box.normal { background: var(--green-soft); border: 1px solid #a7f3d0; color: #065f46; }
.alert-box ul { margin: 5px 0 0; padding-left: 17px; }
.alert-box li { margin: 2px 0; }

.timeline { position: relative; padding-left: 20px; }
.timeline::before {
  content: ''; position: absolute; left: 5px; top: 4px; bottom: 4px;
  width: 2px; background: var(--line);
}
.tl-item { position: relative; padding: 0 0 16px; }
.tl-item::before {
  content: ''; position: absolute; left: -18px; top: 4px;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--brand); border: 2px solid #fff;
  box-shadow: 0 0 0 1px var(--line);
}
.tl-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 11px; color: var(--muted); margin-bottom: 4px; }
.tl-content { font-size: 12.5px; color: var(--ink-2); line-height: 1.6; white-space: pre-wrap; word-break: break-word; }
.tl-feedback {
  margin-top: 5px; padding: 7px 10px; border-radius: 6px;
  background: var(--surface-alt); border-left: 2px solid var(--muted-2);
  font-size: 12px; color: var(--ink-2);
}
.tl-next { margin-top: 5px; font-size: 11.5px; color: var(--brand-ink); }

/* ============================ 模态 ============================ */

.modal-mask {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center; padding: 20px;
  background: rgba(15, 23, 42, .4);
  animation: fadeIn .15s ease;
}
.modal {
  width: min(520px, 100%); max-height: 88vh; display: flex; flex-direction: column;
  background: var(--surface); border-radius: 12px; box-shadow: var(--shadow-lg);
  animation: popIn .18s cubic-bezier(.22,.61,.36,1);
}
@keyframes popIn { from { transform: scale(.97); opacity: .7; } to { transform: none; opacity: 1; } }
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 15px 18px; border-bottom: 1px solid var(--line);
}
.modal-head h3 { font-size: 14.5px; }
.modal-body { padding: 18px; overflow-y: auto; display: grid; gap: 14px; }
.modal-foot {
  display: flex; justify-content: flex-end; gap: 8px;
  padding: 13px 18px; border-top: 1px solid var(--line);
}

/* ============================ Toast ============================ */

.toast-wrap {
  position: fixed; top: 18px; right: 18px; z-index: 200;
  display: grid; gap: 8px; pointer-events: none;
}
.toast {
  min-width: 220px; max-width: 380px;
  padding: 11px 14px; border-radius: 9px;
  background: var(--surface); border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  font-size: 12.5px; color: var(--ink-2);
  display: flex; align-items: flex-start; gap: 9px;
  animation: toastIn .2s cubic-bezier(.22,.61,.36,1);
}
@keyframes toastIn { from { transform: translateX(16px); opacity: 0; } to { transform: none; opacity: 1; } }
.toast .bar { width: 3px; align-self: stretch; border-radius: 2px; flex: none; }
.toast.ok .bar { background: var(--green); }
.toast.err .bar { background: var(--red); }
.toast.info .bar { background: var(--brand); }
.toast.warn .bar { background: var(--amber); }

/* ============================ 拖拽上传 ============================ */

.dropzone {
  border: 2px dashed var(--line-strong);
  border-radius: var(--radius);
  padding: 38px 20px;
  text-align: center;
  background: var(--surface-alt);
  transition: border-color .18s, background .18s;
  cursor: pointer;
}
.dropzone:hover, .dropzone.over {
  border-color: var(--brand); background: var(--brand-soft);
}
.dropzone svg { width: 34px; height: 34px; fill: var(--muted-2); margin-bottom: 8px; }
.dropzone.over svg { fill: var(--brand); }
.dropzone h4 { font-size: 13.5px; margin-bottom: 4px; }
.dropzone p { font-size: 11.5px; color: var(--muted); }
.dropzone .formats {
  margin-top: 10px; display: flex; gap: 6px; justify-content: center; flex-wrap: wrap;
}

.import-result {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 1px; background: var(--line);
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
}
.import-result > div { background: var(--surface); padding: 11px 13px; }
.import-result dt { font-size: 10.5px; color: var(--muted); margin-bottom: 3px; }
.import-result dd { margin: 0; font-size: 17px; font-weight: 650; font-variant-numeric: tabular-nums; }

/* ============================ 列表卡片 ============================ */

.queue-list { display: grid; gap: 9px; }
.queue-item {
  display: grid; grid-template-columns: 4px 1fr auto; gap: 0;
  align-items: stretch;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: box-shadow .16s, border-color .16s;
}
.queue-item:hover { box-shadow: var(--shadow-md); border-color: var(--line-strong); }
.queue-item .edge { background: var(--muted-2); }
.queue-item.crit .edge { background: var(--red); }
.queue-item.attn .edge { background: var(--amber); }
.queue-main { padding: 12px 15px; min-width: 0; }
.queue-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.queue-title strong { font-size: 13px; color: var(--ink); font-weight: 600; }
.queue-meta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 6px; font-size: 11.5px; color: var(--muted); }
.queue-reasons { margin-top: 7px; display: grid; gap: 3px; }
.queue-reasons span { font-size: 11.5px; color: #991b1b; display: flex; gap: 5px; align-items: flex-start; }
.queue-reasons span::before { content: '·'; color: var(--red); font-weight: 700; }
.queue-actions { display: flex; align-items: center; gap: 6px; padding: 0 14px; }

/* ============================ Tab ============================ */

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); padding: 0 16px; }
.tabs button {
  border: 0; background: transparent; padding: 11px 14px;
  font-size: 12.5px; font-weight: 500; color: var(--muted);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  transition: color .15s, border-color .15s;
}
.tabs button:hover { color: var(--ink-2); }
.tabs button.active { color: var(--brand); border-bottom-color: var(--brand); }
.tabs button .count {
  margin-left: 5px; padding: 0 5px; border-radius: 8px;
  background: var(--surface-alt); font-size: 10.5px; color: var(--muted);
}
.tabs button.active .count { background: var(--brand-soft); color: var(--brand-ink); }

/* ============================ 响应式 ============================ */

@media (max-width: 920px) {
  .app-shell { flex-direction: column; }

  /* 侧栏转为顶部横向导航，避免折叠成无文字的图标条导致无法识别 */
  .sidebar {
    width: 100%; height: auto;
    position: sticky; top: 0; z-index: 40;
    flex-direction: row; align-items: center;
    padding: 7px 10px; gap: 8px;
    overflow-x: auto; overflow-y: hidden;
  }
  .sidebar-brand { display: none; }
  .nav {
    display: flex; flex-direction: row; gap: 4px;
    padding: 0; flex: 1; overflow: visible;
  }
  .nav-item { padding: 8px 10px; white-space: nowrap; gap: 7px; }
  .nav-item span { display: inline; font-size: 12.5px; }
  .nav-item.active { box-shadow: inset 0 -2px 0 var(--brand); border-radius: 6px; }
  .nav-badge { margin-left: 4px; }
  .sidebar-foot {
    border: 0; padding: 0; display: flex; align-items: center; gap: 7px; flex: none;
  }
  .user-mini { display: none; }
  .sidebar-foot .btn { height: 30px; padding: 0 10px; font-size: 11.5px; white-space: nowrap; }

  .topbar { position: static; padding: 11px 16px; }
  .content { padding: 16px; }
  .kpi-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .detail-grid { grid-template-columns: 1fr; }

  .toolbar select.ctl, .toolbar input.ctl { max-width: 100%; flex: 1 1 132px; min-width: 0; }
  .search-box { max-width: none; }
  .section-title { flex-wrap: wrap; }
  .section-title h3 { font-size: 13px; }
}

@media (max-width: 620px) {
  .topbar-left p { display: none; }
  .user-chip-info { display: none; }
  .kpi-value { font-size: 19px; }
  .nav-item span { font-size: 12px; }
  .batch-bar { font-size: 12px; }
  .modal-body { padding: 14px; }
}

/* 滚动条 */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d3dbe7; border-radius: 5px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #b6c2d3; background-clip: content-box; }


/* =========================================================
   V2: 分组式二级导航 + 业务看板组件
   ========================================================= */

.nav { gap: 2px; }

.nav-group { display: block; }
.nav-group + .nav-group { margin-top: 4px; }

.nav-group-head {
  width: 100%;
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px;
  border: 0; border-radius: 7px;
  background: transparent; color: var(--side-ink-dim);
  font-size: 12px; font-weight: 600; letter-spacing: .02em;
  cursor: pointer; text-align: left;
  transition: color .15s, background .15s;
}
.nav-group-head:hover { color: var(--side-ink); background: rgba(255,255,255,.04); }
.nav-group-head .nav-icon { width: 16px; height: 16px; opacity: .7; }
.nav-group-head .caret {
  margin-left: auto; width: 0; height: 0;
  border-left: 4px solid transparent; border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  transition: transform .18s;
  opacity: .6;
}
.nav-group.collapsed .caret { transform: rotate(-90deg); }
.nav-group.collapsed .nav-sub { display: none; }

.nav-sub {
  display: grid; gap: 1px; padding: 2px 0 4px 10px; margin-left: 8px;
  border-left: 1px solid rgba(148,163,184,.18);
}

.nav-sub .nav-item {
  padding: 8px 12px 8px 14px;
  font-size: 13px; font-weight: 500;
  gap: 8px;
  position: relative;
}
.nav-sub .nav-item::before {
  content: ""; position: absolute; left: 2px; top: 50%;
  width: 4px; height: 4px; margin-top: -2px; border-radius: 50%;
  background: currentColor; opacity: .28;
}
.nav-sub .nav-item.active::before { opacity: 1; background: #60a5fa; }
.nav-sub .nav-item.active { background: rgba(37,99,235,.18); box-shadow: none; }

/* ---- 页内三级 Tabs ---- */
.sub-tabs {
  display: flex; gap: 4px; flex-wrap: wrap;
  padding: 6px; margin-bottom: 14px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 9px; box-shadow: var(--shadow-sm);
}
.sub-tabs button {
  border: 0; background: transparent; color: var(--muted);
  padding: 7px 14px; border-radius: 6px;
  font-size: 12.5px; font-weight: 500;
  transition: background .15s, color .15s;
}
.sub-tabs button:hover { background: var(--surface-alt); color: var(--ink-2); }
.sub-tabs button.active { background: var(--brand); color: #fff; box-shadow: 0 1px 3px rgba(37,99,235,.3); }

/* ---- 排行条 ---- */
.rank-row { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: center; padding: 7px 0; }
.rank-row + .rank-row { border-top: 1px solid var(--line); }
.rank-name { font-size: 12.5px; color: var(--ink-2); display: flex; align-items: center; gap: 7px; }
.rank-idx {
  width: 18px; height: 18px; flex: none; display: grid; place-items: center;
  border-radius: 4px; background: var(--surface-alt); color: var(--muted);
  font-size: 10.5px; font-weight: 600;
}
.rank-row:nth-child(1) .rank-idx { background: #fef3c7; color: #b45309; }
.rank-val { font-size: 12.5px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.rank-bar { grid-column: 1 / -1; height: 5px; border-radius: 3px; background: #eef2f8; overflow: hidden; }
.rank-bar > i { display: block; height: 100%; border-radius: 3px; background: var(--brand); }

/* ---- 目标进度 ---- */
.goal-box { display: grid; gap: 10px; }
.goal-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.goal-label { font-size: 11.5px; color: var(--muted); }
.goal-num { font-size: 20px; font-weight: 650; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.goal-track { height: 8px; border-radius: 4px; background: #eef2f8; overflow: hidden; }
.goal-fill { height: 100%; border-radius: 4px; background: linear-gradient(90deg, #2563eb, #0d9488); }
.goal-fill.warn { background: linear-gradient(90deg, #f59e0b, #dc2626); }

/* ---- 市场活动 ---- */
.event-list { display: grid; gap: 10px; }
.event-card {
  display: grid; grid-template-columns: 74px 1fr auto; gap: 0;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
  transition: box-shadow .16s, border-color .16s;
}
.event-card:hover { box-shadow: var(--shadow-md); border-color: var(--line-strong); }
.event-date {
  display: grid; place-items: center; align-content: center; gap: 1px;
  background: linear-gradient(160deg, #eff4ff, #e0eaff);
  border-right: 1px solid var(--line);
  padding: 10px 6px; text-align: center;
}
.event-date .d { font-size: 20px; font-weight: 700; color: var(--brand-ink); line-height: 1; font-variant-numeric: tabular-nums; }
.event-date .m { font-size: 10.5px; color: var(--muted); }
.event-main { padding: 11px 14px; min-width: 0; }
.event-title { font-size: 13px; font-weight: 600; color: var(--ink); line-height: 1.45; }
.event-meta { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 6px; font-size: 11.5px; color: var(--muted); }
.event-meta b { color: var(--ink-2); font-weight: 500; }
.event-side { display: flex; align-items: center; gap: 8px; padding: 0 14px; }

/* ---- 知识库 ---- */
.kb-layout { display: grid; grid-template-columns: 180px 1fr; gap: 14px; align-items: start; }
.kb-cats { display: grid; gap: 3px; }
.kb-cat {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 11px; border-radius: 7px; cursor: pointer;
  font-size: 12.5px; color: var(--ink-2);
  border: 1px solid transparent;
}
.kb-cat:hover { background: var(--surface-alt); }
.kb-cat.active { background: var(--brand-soft); border-color: #dbeafe; color: var(--brand-ink); font-weight: 600; }
.kb-cat .n { font-size: 11px; color: var(--muted); }
.kb-item { border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 9px; overflow: hidden; background: var(--surface); }
.kb-q {
  display: flex; align-items: center; gap: 9px;
  padding: 12px 14px; cursor: pointer;
  font-size: 13px; font-weight: 600; color: var(--ink);
  transition: background .15s;
}
.kb-q:hover { background: var(--surface-alt); }
.kb-q .tag {
  flex: none; font-size: 10.5px; font-weight: 500; padding: 1px 6px; border-radius: 4px;
  background: var(--brand-soft); color: var(--brand-ink); border: 1px solid #dbeafe;
}
.kb-q .arrow { margin-left: auto; color: var(--muted-2); font-size: 11px; transition: transform .18s; }
.kb-item.open .kb-q .arrow { transform: rotate(90deg); }
.kb-a {
  display: none; padding: 12px 14px 14px;
  font-size: 12.5px; color: var(--ink-2); line-height: 1.75;
  white-space: pre-wrap; word-break: break-word;
  border-top: 1px dashed var(--line);
}
.kb-item.open .kb-a { display: block; }

/* ---- 数据缺口提示 ---- */
.data-gap {
  display: flex; gap: 8px; align-items: flex-start;
  padding: 9px 12px; border-radius: 7px;
  background: var(--amber-soft); border: 1px solid #fde68a;
  color: #92400e; font-size: 11.5px; line-height: 1.6;
}

@media (max-width: 920px) {
  .nav-group-head { display: none; }
  .nav-group, .nav-sub { display: contents; }
  .nav-sub .nav-item { padding: 8px 10px; }
  .nav-sub .nav-item::before { display: none; }
  .kb-layout { grid-template-columns: 1fr; }
  .event-card { grid-template-columns: 62px 1fr; }
  .event-side { grid-column: 1 / -1; padding: 0 12px 10px; justify-content: flex-end; }
}

@media (max-width: 620px) {
  .event-card { grid-template-columns: 1fr; }
  .event-date {
    flex-direction: row; gap: 6px; justify-content: flex-start;
    padding: 8px 12px; border-right: 0; border-bottom: 1px solid var(--line);
  }
}


/* =========================================================
   V3: 待办面板 / 命令面板 / 续签 / 目标 / 数据质量
   ========================================================= */

.todo-wrap { position: relative; }
.todo-dot {
  position: absolute; top: 2px; right: 4px;
  min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 8px; background: #dc2626; color: #fff;
  font-size: 10px; font-weight: 600; line-height: 16px;
  text-align: center; pointer-events: none;
}
.todo-panel {
  position: absolute; top: 40px; right: 0; width: 330px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 10px; box-shadow: 0 12px 32px rgba(15,23,42,.14);
  z-index: 80; overflow: hidden;
}
.todo-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 11px 14px; border-bottom: 1px solid var(--line);
  font-size: 12.5px; font-weight: 600; color: var(--ink);
}
.todo-head em { font-style: normal; font-size: 11px; color: var(--muted); font-weight: 400; }
.todo-item {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 11px 14px; cursor: pointer;
  border-bottom: 1px solid var(--line);
  transition: background .15s;
}
.todo-item:last-child { border-bottom: 0; }
.todo-item:hover { background: var(--surface-alt); }
.todo-n {
  flex: none; min-width: 22px; height: 22px; padding: 0 5px;
  border-radius: 6px; background: #fef2f2; color: #b91c1c;
  font-size: 11.5px; font-weight: 700; line-height: 22px; text-align: center;
}
.todo-txt { min-width: 0; }
.todo-txt b { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink); }
.todo-txt span { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; line-height: 1.5; }

/* 命令面板 */
.cmdk {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(15,23,42,.42);
  display: flex; justify-content: center; align-items: flex-start;
  padding-top: 11vh;
}
.cmdk-box {
  width: min(640px, 92vw);
  background: var(--surface); border-radius: 12px;
  box-shadow: 0 24px 60px rgba(15,23,42,.3);
  overflow: hidden;
}
.cmdk-input-row {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px; border-bottom: 1px solid var(--line);
}
.cmdk-ico { width: 18px; height: 18px; fill: var(--muted-2); flex: none; }
.cmdk-input-row input {
  flex: 1; border: 0; outline: 0; font-size: 14px;
  background: transparent; color: var(--ink);
}
.cmdk-input-row kbd {
  font-size: 10px; color: var(--muted-2);
  border: 1px solid var(--line-strong); border-radius: 4px;
  padding: 1px 5px; font-family: inherit;
}
.cmdk-results { max-height: 52vh; overflow-y: auto; padding: 6px; }
.cmdk-group { font-size: 10.5px; color: var(--muted-2); padding: 8px 10px 4px; letter-spacing: .04em; }
.cmdk-row {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 10px; border-radius: 7px; cursor: pointer;
  font-size: 13px; color: var(--ink-2);
}
.cmdk-row:hover, .cmdk-row.sel { background: var(--brand-soft); color: var(--brand-ink); }
.cmdk-row .k { margin-left: auto; font-size: 10.5px; color: var(--muted-2); }
.cmdk-empty { padding: 26px; text-align: center; color: var(--muted); font-size: 12.5px; }

/* 续签档位 */
.bucket {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10.5px; font-weight: 600; padding: 2px 7px; border-radius: 4px;
}
.bucket-exp { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.bucket-t3  { background: #fff7ed; color: #c2410c; border: 1px solid #fed7aa; }
.bucket-t6  { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
.bucket-safe{ background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }
.bucket-na  { background: #f8fafc; color: #64748b; border: 1px solid #e2e8f0; }

.stage-select {
  font-size: 11.5px; padding: 3px 6px;
  border: 1px solid var(--line-strong); border-radius: 5px;
  background: var(--surface); color: var(--ink-2);
  cursor: pointer; outline: none;
}
.stage-select:focus { border-color: var(--brand); }

.days-left { font-variant-numeric: tabular-nums; font-weight: 600; }
.days-neg { color: #b91c1c; }

/* 目标矩阵 */
.tbl-target input[type="number"] {
  width: 108px; padding: 4px 6px; font-size: 12px;
  border: 1px solid var(--line-strong); border-radius: 5px;
  text-align: right; font-variant-numeric: tabular-nums;
}
.tbl-target input[type="number"]:disabled { background: var(--surface-alt); color: var(--muted); border-color: var(--line); }
.rate-pill { font-size: 11px; font-weight: 600; padding: 1px 6px; border-radius: 4px; }
.rate-good { background: #f0fdf4; color: #15803d; }
.rate-mid  { background: #fffbeb; color: #b45309; }
.rate-low  { background: #fef2f2; color: #b91c1c; }
.rate-none { background: #f8fafc; color: #94a3b8; }

/* 数据质量 */
.q-score {
  display: flex; align-items: center; gap: 20px;
  padding: 20px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius);
}
.q-score-num { font-size: 46px; font-weight: 700; line-height: 1; letter-spacing: -.03em; }
.q-score-num.ok { color: #15803d; }
.q-score-num.mid { color: #b45309; }
.q-score-num.bad { color: #b91c1c; }
.q-issues { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px,1fr)); gap: 10px; }
.q-issue {
  padding: 13px 15px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius);
}
.q-issue .n { font-size: 22px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.q-issue .l { font-size: 12px; color: var(--muted); margin-top: 2px; }
.q-issue .bar { height: 4px; border-radius: 2px; background: #eef2f8; margin-top: 8px; overflow: hidden; }
.q-issue .bar > i { display: block; height: 100%; border-radius: 2px; }

@media (max-width: 620px) {
  .todo-panel { width: calc(100vw - 24px); right: -8px; }
  .q-score { flex-direction: column; align-items: flex-start; gap: 10px; }
}


.modal.modal-wide { width: min(860px, 94vw); }
@media (max-width: 620px) { .modal.modal-wide { width: 96vw; } }


/* =========================================================
   V6: P4P 三层统计报表（公司 / 团队 / 客户经理）
   ========================================================= */

.p4p-report .table-wrap { border: 0; }
.hier-table {
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12px;
  min-width: 1180px;
}
.hier-table thead th {
  position: sticky; top: 0; z-index: 3;
  background: #16233b;
  color: #e8eefb;
  font-weight: 600;
  font-size: 11.5px;
  line-height: 1.35;
  padding: 9px 8px;
  border-right: 1px solid rgba(255,255,255,.09);
  border-bottom: 1px solid rgba(255,255,255,.12);
  text-align: center;
  white-space: nowrap;
}
.hier-table thead th:last-child { border-right: 0; }
.hier-table thead th.num { text-align: center; }
.hier-table thead th.th-partner,
.hier-table thead th.th-team,
.hier-table thead th.th-mgr { text-align: left; min-width: 96px; }

.hier-table tbody td {
  padding: 7px 8px;
  border-right: 1px solid #eef1f6;
  border-bottom: 1px solid #eef1f6;
  white-space: nowrap;
  color: #1e293b;
  vertical-align: middle;
}
.hier-table tbody td:last-child { border-right: 0; }
.hier-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.hier-table td.strong { font-weight: 600; }

/* 分组列 */
.hier-table td.grp-partner,
.hier-table td.grp-team {
  background: #f7f9fd;
  font-weight: 600;
  color: #0f172a;
  text-align: center;
  vertical-align: middle;
  border-right: 1px solid #e3e9f3;
  padding: 6px 10px;
  white-space: normal;
  word-break: break-all;
  line-height: 1.4;
}
.hier-table td.grp-partner { background: #f2f6fc; font-size: 12.5px; }
.hier-table td.mgr { font-weight: 500; color: #0f172a; }

.hier-table tbody tr.hier-row:hover td { background: #f6f9ff; }
.hier-table tbody tr.hier-row:hover td.grp-partner,
.hier-table tbody tr.hier-row:hover td.grp-team { background: #eaf1fd; }

/* 团队小计 */
.hier-table tr.row-subtotal td {
  background: #e8f4f7;
  font-weight: 600;
  color: #0b4f5e;
  border-top: 1px solid #cfe6ec;
  border-bottom: 1px solid #cfe6ec;
}
.hier-table tr.row-subtotal td.sub-label {
  text-align: left;
  letter-spacing: .02em;
  padding-left: 14px;
}

/* 公司合计 */
.hier-table tr.row-company td {
  background: #dfeaf6;
  font-weight: 700;
  color: #12395e;
  border-top: 1px solid #c3d6ea;
  border-bottom: 1px solid #c3d6ea;
}
.hier-table tr.row-company td.company-label {
  text-align: left;
  letter-spacing: .03em;
  padding-left: 14px;
}

/* 总计 */
.hier-table tr.row-grand td {
  background: #16233b;
  color: #ffffff;
  font-weight: 700;
  border-top: 2px solid #0b1220;
}
.hier-table tr.row-grand td.grand-label {
  text-align: center;
  letter-spacing: .16em;
}

@media (max-width: 900px) {
  .hier-table { min-width: 980px; font-size: 11.5px; }
  .hier-table td.grp-partner, .hier-table td.grp-team { font-size: 11px; }
}


/* ---- 报表工具条 / 排序控件 / 全屏 ---- */
.report-toolbar { align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 12px; }
.report-title { font-size: 13px; font-weight: 600; color: #0f172a; margin-right: 4px; }
.report-sub {
  font-size: 11.5px; color: #64748b;
  padding: 0 12px 10px; line-height: 1.6;
}
.sort-ctl {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 8px; background: #f4f7fc;
  border: 1px solid #e3e9f3; border-radius: 7px;
}
.sort-label { font-size: 11.5px; color: #64748b; white-space: nowrap; }
.sort-ctl .ctl { height: 26px; font-size: 12px; padding: 0 6px; }
.sort-dir { white-space: nowrap; }

.p4p-report:fullscreen,
.p4p-report.is-fullscreen {
  background: #fff; padding: 14px; overflow: auto;
  width: 100%; height: 100%;
}
.p4p-report:fullscreen .table-wrap,
.p4p-report.is-fullscreen .table-wrap {
  max-height: calc(100vh - 40px) !important;
}
.p4p-report:fullscreen .hier-table,
.p4p-report.is-fullscreen .hier-table { min-width: 100%; }

@media (max-width: 700px) {
  .report-toolbar { gap: 6px; }
  .report-title { width: 100%; }
  .sort-ctl { flex: 1 1 100%; }
}

/* 表头仅作列名展示，排序统一走工具条控件 */
.th-hint { cursor: default; }


/* =========================================================
   V7: 报表文字居中 + 页面概览条 + 行距优化
   ========================================================= */

/* 全表内容居中（含客户经理、公司、团队、小计与合计标签） */
.hier-table tbody td,
.hier-table tbody td.num,
.hier-table td.mgr,
.hier-table tr.row-subtotal td.sub-label,
.hier-table tr.row-company td.company-label {
  text-align: center;
}
.hier-table tr.row-subtotal td.sub-label,
.hier-table tr.row-company td.company-label {
  padding-left: 8px;
  padding-right: 8px;
}

/* 行距与分隔更舒展 */
.hier-table tbody td { padding: 9px 10px; }
.hier-table thead th { padding: 10px 8px; }
.hier-table tbody tr.hier-row td { border-bottom: 1px solid #eef1f6; }
.hier-table tbody tr.hier-row:last-of-type td { border-bottom: 1px solid #e3e9f3; }

/* 数字列统一等宽，便于纵向对齐 */
.hier-table td.num {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}

/* 页面顶部概览条 */
.p4p-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.p4p-strip-item {
  display: flex; flex-direction: column; gap: 3px;
  padding: 11px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow-sm);
}
.p4p-strip-item .k {
  font-size: 11.5px; color: var(--muted);
  white-space: nowrap;
}
.p4p-strip-item .v {
  font-size: 18px; font-weight: 650; letter-spacing: -.01em;
  color: var(--ink); font-variant-numeric: tabular-nums;
}
.p4p-strip-item .v.up-bad { color: #b91c1c; }
.p4p-strip-item .v.up-good { color: #15803d; }

@media (max-width: 700px) {
  .p4p-strip { grid-template-columns: repeat(2, 1fr); }
  .p4p-strip-item .v { font-size: 15px; }
}


/* 通用报表表样式（消耗明细等页面复用） */
.tbl-report thead th {
  background: #16233b;
  color: #e8eefb;
  font-weight: 600;
  font-size: 11.5px;
  text-align: center;
  border-right: 1px solid rgba(255,255,255,.09);
  white-space: nowrap;
}
.tbl-report thead th:last-child { border-right: 0; }
.tbl-center tbody td { text-align: center; font-variant-numeric: tabular-nums; }
.tbl-center tbody td.strong { font-weight: 600; }


/* =========================================================
   V8: 核心指标卡图标与拖拽自定义排序
   ========================================================= */

.kpi-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.kpi-icon {
  width: 16px;
  height: 16px;
  flex: none;
  opacity: 0.85;
}

.kpi-drag-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  max-height: 480px;
  overflow-y: auto;
  padding: 4px;
}

.kpi-drag-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 7px;
  cursor: grab;
  user-select: none;
  transition: all 0.15s ease;
}

.kpi-drag-item:active {
  cursor: grabbing;
}

.kpi-drag-item.dragging {
  opacity: 0.45;
  background: var(--surface-alt);
  border-color: var(--brand);
}

.kpi-drag-item.drag-over {
  border-top: 2px solid var(--brand);
  background: #f0f7ff;
}

.kpi-drag-handle {
  color: var(--muted-2);
  cursor: grab;
  display: flex;
  align-items: center;
}

.kpi-drag-handle svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

.kpi-drag-label {
  flex: 1;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
  display: flex;
  align-items: center;
  gap: 8px;
}

.kpi-drag-tip {
  font-size: 11.5px;
  color: var(--muted);
}


/* =========================================================
   V9: 分屏沉浸式登录页（对标 Mili Packaging 风格）
   ========================================================= */

.split-login-view {
  display: flex;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: #ffffff;
  position: fixed;
  inset: 0;
  z-index: 1000;
}

/* 左侧轮播海报展示区 (占比 60%) */
.login-carousel-pane {
  flex: 1.25;
  position: relative;
  height: 100%;
  overflow: hidden;
  background: #0b1120;
}

.carousel-slides {
  width: 100%;
  height: 100%;
  position: relative;
}

.carousel-slide {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  opacity: 0;
  visibility: hidden;
  transition: opacity 1s cubic-bezier(0.4, 0, 0.2, 1), transform 6s cubic-bezier(0.1, 1, 0.1, 1);
  transform: scale(1.05);
}

.carousel-slide.active {
  opacity: 1;
  visibility: visible;
  transform: scale(1);
}

.carousel-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(11, 17, 32, 0.2) 0%, rgba(11, 17, 32, 0.55) 50%, rgba(11, 17, 32, 0.92) 100%);
}

.carousel-caption {
  position: absolute;
  left: 64px;
  right: 64px;
  bottom: 64px;
  color: #ffffff;
  z-index: 2;
}

.carousel-badge {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #fbbf24;
  margin-bottom: 12px;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.carousel-caption h2 {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 14px 0;
  line-height: 1.3;
  color: #ffffff;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.carousel-caption p {
  font-size: 14.5px;
  color: #cbd5e1;
  line-height: 1.6;
  margin: 0 0 20px 0;
  max-width: 580px;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.carousel-tags {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.carousel-tags span {
  font-size: 12px;
  padding: 5px 12px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #f1f5f9;
  letter-spacing: 0.02em;
}

.carousel-indicators {
  position: absolute;
  left: 64px;
  bottom: 24px;
  display: flex;
  gap: 8px;
  z-index: 3;
}

.carousel-indicators .indicator {
  width: 28px;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.35);
  cursor: pointer;
  transition: all 0.3s ease;
}

.carousel-indicators .indicator.active {
  width: 44px;
  background: #fbbf24;
}

/* 右侧表单操作区 (占比 40%) */
.login-form-pane {
  flex: 0.85;
  min-width: 440px;
  max-width: 540px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  padding: 40px;
  box-shadow: -12px 0 32px rgba(0, 0, 0, 0.04);
  position: relative;
  z-index: 10;
}

.login-card-box {
  width: 100%;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.mili-logo-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: #0f172a;
  color: #fbbf24;
  font-size: 26px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  box-shadow: 0 8px 16px rgba(15, 23, 42, 0.12);
}

.mili-brand-title {
  font-size: 22px;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 6px 0;
  letter-spacing: -0.01em;
}

.mili-brand-sub {
  font-size: 12.5px;
  color: #64748b;
  margin: 0 0 28px 0;
}

.mili-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.mili-field-group {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 100%;
  gap: 6px;
}

.mili-field-group label {
  font-size: 12px;
  font-weight: 600;
  color: #334155;
}

.mili-field-group input {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  font-size: 13.5px;
  color: #0f172a;
  transition: all 0.2s ease;
  outline: none;
}

.mili-field-group input:focus {
  border-color: #d97706;
  box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.12);
}

.mili-pw-wrap {
  position: relative;
  width: 100%;
}

.mili-pw-wrap input {
  padding-right: 42px;
}

.pw-eye-btn {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
  outline: none;
}

.pw-eye-btn:hover {
  color: #475569;
}

.pw-eye-btn .eye-icon {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.mili-login-error {
  padding: 10px 14px;
  border-radius: 6px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
  font-size: 12px;
  text-align: left;
  line-height: 1.4;
}

.mili-submit-btn {
  width: 100%;
  height: 44px;
  margin-top: 8px;
  border-radius: 8px;
  border: none;
  background: #c59b27;
  color: #ffffff;
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(197, 155, 39, 0.25);
}

.mili-submit-btn:hover {
  background: #b48a1c;
  box-shadow: 0 6px 16px rgba(197, 155, 39, 0.35);
}

.mili-submit-btn:active {
  transform: translateY(1px);
}

.mili-auto-tip {
  margin-top: 14px;
  font-size: 11.5px;
  color: #94a3b8;
}

.mili-demo-accounts {
  margin-top: 24px;
  width: 100%;
  padding-top: 18px;
  border-top: 1px dashed #e2e8f0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.demo-title {
  font-size: 11px;
  color: #64748b;
  text-align: left;
}

.demo-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.demo-chip {
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 4px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #475569;
  cursor: pointer;
  transition: all 0.15s ease;
}

.demo-chip:hover {
  background: #fef3c7;
  border-color: #fde68a;
  color: #b45309;
}

.mili-card-footer {
  margin-top: 32px;
  font-size: 10px;
  letter-spacing: 0.16em;
  color: #cbd5e1;
  text-transform: uppercase;
}

@media (max-width: 960px) {
  .login-carousel-pane {
    display: none;
  }
  .login-form-pane {
    flex: 1;
    min-width: 100%;
    max-width: 100%;
    padding: 24px;
    box-shadow: none;
  }
}


/* =========================================================
   V10: 品广目标矩阵 & Q3 资产在线协同看板
   ========================================================= */

.brand-hub-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.fy-switcher {
  display: inline-flex;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 3px;
  box-shadow: var(--shadow-sm);
}

.fy-btn {
  border: none;
  background: transparent;
  padding: 6px 14px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.fy-btn.active {
  background: var(--brand);
  color: #ffffff;
  box-shadow: 0 1px 3px rgba(37,99,235,0.25);
}

.target-matrix-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.target-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.target-card-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.target-q-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}

.target-q-actual {
  font-size: 13px;
  font-weight: 600;
  color: var(--brand);
}

.month-target-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 8px;
  border-top: 1px dashed var(--line);
}

.month-target-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--ink-2);
}

.month-inp-wrap {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.month-target-inp {
  width: 90px;
  height: 24px;
  font-size: 11.5px;
  text-align: right;
  padding: 0 6px;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  font-variant-numeric: tabular-nums;
}

.month-target-inp:focus {
  border-color: var(--brand);
  outline: none;
}

.chance-tag {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  text-align: center;
}
.chance-sure   { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }
.chance-try    { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
.chance-eval   { background: #fefce8; color: #a16207; border: 1px solid #fef08a; }
.chance-doubt  { background: #fff7ed; color: #c2410c; border: 1px solid #fed7aa; }
.chance-none   { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }

.status-badge {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
}
.status-init     { background: #f8fafc; color: #64748b; border: 1px solid #e2e8f0; }
.status-plan     { background: #f5f3ff; color: #6d28d9; border: 1px solid #ddd6fe; }
.status-talk     { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
.status-lock     { background: #fef3c7; color: #b45309; border: 1px solid #fde68a; font-weight: 700; }
.status-done     { background: #dcfce7; color: #15803d; border: 1px solid #86efac; font-weight: 700; }
.status-drop     { background: #f1f5f9; color: #94a3b8; text-decoration: line-through; }

.asset-filter-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 12px;
}

.asset-table th {
  background: #16233b;
  color: #e8eefb;
  font-weight: 600;
  font-size: 11.5px;
  text-align: center;
  white-space: nowrap;
  padding: 9px 8px;
}

.asset-table td {
  font-size: 12px;
  padding: 8px;
  text-align: center;
  vertical-align: middle;
}

.asset-table td.left-txt {
  text-align: left;
}

.cell-edit-btn {
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #334155;
  cursor: pointer;
}
.cell-edit-btn:hover {
  background: var(--brand-soft);
  color: var(--brand);
  border-color: #bfdbfe;
}


/* =========================================================
   V11: 阿里先富 CRM 风格客户工作台卡片体系
   ========================================================= */

/* 视图模式切换与先富顶栏 */
.romeo-view-switch {
  display: inline-flex;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 6px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.romeo-v-btn {
  border: none;
  background: transparent;
  padding: 5px 11px;
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
}
.romeo-v-btn.active {
  background: #f1f5f9;
  color: var(--ink);
  font-weight: 600;
}

/* 先富三大作战模式 Tab */
.romeo-mode-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 2px;
}

.romeo-mode-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 6px 6px 0 0;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  transition: all 0.15s ease;
}
.romeo-mode-tab:hover {
  color: var(--ink);
  background: var(--surface-alt);
}
.romeo-mode-tab.active {
  color: var(--brand);
  border-bottom-color: var(--brand);
  font-weight: 700;
  background: #eff6ff;
}
.romeo-mode-tab .badge {
  font-size: 10.5px;
  padding: 1px 5px;
  border-radius: 10px;
  background: #fee2e2;
  color: #dc2626;
  font-weight: 700;
}

/* 先富式客户大卡片 (宽卡模式) */
.romeo-card-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 10px;
}

.romeo-cust-card {
  background: var(--surface);
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 16px 18px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: box-shadow 0.2s, border-color 0.2s;
  position: relative;
}
.romeo-cust-card:hover {
  box-shadow: 0 6px 16px rgba(15,23,42,0.06);
  border-color: #cbd5e1;
}

/* 卡片顶部：公司名称 + 账号 + 快捷动作 */
.r-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding-bottom: 10px;
  border-bottom: 1px solid #f1f5f9;
}
.r-head-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.r-comp-name {
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
  cursor: pointer;
}
.r-comp-name:hover {
  color: var(--brand);
  text-decoration: underline;
}
.r-ali-id {
  font-size: 12px;
  color: #64748b;
  font-family: monospace;
}
.r-quick-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}
.r-act-btn {
  font-size: 11.5px;
  padding: 3px 8px;
  border-radius: 4px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #334155;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.r-act-btn:hover {
  background: var(--brand-soft);
  color: var(--brand);
  border-color: #bfdbfe;
}
.r-act-btn.primary {
  background: #eff6ff;
  color: #1e40af;
  border-color: #bfdbfe;
  font-weight: 600;
}

/* 卡片中段：三栏网格 (左栏档案 ｜ 中栏平台效果 ｜ 右侧平台效果标签) */
.r-card-body {
  display: grid;
  grid-template-columns: 1.15fr 0.9fr 0.55fr;
  gap: 18px;
  align-items: start;
}

/* 左栏：基础与合同资质 */
.r-col-left {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 14px;
  font-size: 12px;
  color: #475569;
}
.r-col-left .item {
  display: flex;
  align-items: baseline;
  gap: 4px;
}
.r-col-left .k {
  color: #94a3b8;
  white-space: nowrap;
}
.r-col-left .v {
  color: #1e293b;
  font-weight: 500;
}
.r-col-left .cgs-tag {
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 3px;
  font-weight: 600;
}
.cgs-tag.gold {
  background: #fef9c3;
  color: #854d0e;
  border: 1px solid #fef08a;
}
.cgs-tag.cgs {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #dbeafe;
}

/* 中栏：平台效果与环比 (先富特色) */
.r-col-mid {
  background: #fafbfd;
  border: 1px solid #f1f5f9;
  border-radius: 8px;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.r-mid-title {
  font-size: 11.5px;
  font-weight: 600;
  color: #64748b;
  margin-bottom: 2px;
}
.r-effect-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}
.r-effect-box {
  display: flex;
  flex-direction: column;
}
.r-effect-box .lbl {
  font-size: 11px;
  color: #94a3b8;
}
.r-effect-box .num {
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
}
.r-effect-box .sub {
  font-size: 10.5px;
  color: #64748b;
}

/* 右栏：服务诊断/平台效果速览 */
.r-col-right {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-end;
}
.r-status-pill {
  font-size: 11.5px;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 600;
}
.r-detail-link {
  font-size: 12px;
  color: var(--brand);
  text-decoration: none;
  cursor: pointer;
  margin-top: 8px;
}
.r-detail-link:hover {
  text-decoration: underline;
}

/* 卡片底栏：先富特色「AI 客户诊断 4 步走」 */
.r-card-ai-footer {
  background: #f8fafc;
  border-top: 1px solid #f1f5f9;
  border-radius: 0 0 8px 8px;
  padding: 8px 12px;
  margin: 0 -18px -16px -18px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 11.5px;
}
.r-ai-badge {
  color: #4f46e5;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 4px;
}
.r-ai-item {
  color: #64748b;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.r-ai-item b {
  font-weight: 600;
  color: #334155;
}
.r-ai-item.alert b {
  color: #b91c1c;
}

/* 守卫：登录容器一旦标记 hidden 必须彻底隐藏（防止 display 规则覆盖） */
.split-login-view[hidden],
#loginView[hidden] {
  display: none !important;
}

/* ===================== V9 可维护数据层 ===================== */

.grow { flex: 1 1 auto; }

.btn-xs {
  height: 24px; padding: 0 8px; font-size: 11.5px; border-radius: 6px;
  line-height: 1; white-space: nowrap;
}
.btn-danger-ghost {
  color: #b91c1c; border-color: #fecaca; background: #fff;
}
.btn-danger-ghost:hover { background: #fef2f2; border-color: #fca5a5; color: #991b1b; }

.section-title .grow, .card-head .grow { flex: 1; }

.kb-acts { display: inline-flex; gap: 6px; margin-right: 8px; }
.kb-acts .btn { opacity: .55; }
.kb-item.open .kb-acts .btn, .kb-acts .btn:hover { opacity: 1; }

.link-cell { color: #1d4ed8; cursor: pointer; text-decoration: none; }
.link-cell:hover { text-decoration: underline; }

.chk-inline {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; color: #475569; white-space: nowrap;
}
.chk-inline input { width: 14px; height: 14px; margin: 0; }

.field-hint { display: block; font-size: 11px; color: #94a3b8; margin-top: 4px; }

/* 客户选择器 */
.cp-wrap { position: relative; }
.cp-list {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 40;
  max-height: 240px; overflow-y: auto;
  background: #fff; border: 1px solid var(--line-strong, #cbd5e1);
  border-radius: 8px; box-shadow: 0 12px 28px rgba(15, 23, 42, .14);
}
.cp-item {
  padding: 8px 10px; cursor: pointer; border-bottom: 1px solid #f1f5f9;
  display: flex; flex-direction: column; gap: 2px;
}
.cp-item:last-child { border-bottom: 0; }
.cp-item:hover { background: #f8fafc; }
.cp-item b { font-size: 12.5px; color: #0f172a; font-weight: 600; }
.cp-item span { font-size: 11px; color: #64748b; }
.cp-empty { padding: 12px 10px; font-size: 12px; color: #94a3b8; }

/* 跟进记录表 */
.rec-table td { vertical-align: top; }
.rec-table .chip { white-space: nowrap; }
.rec-toolbar { flex-wrap: wrap; row-gap: 8px; }
.rec-toolbar .ctl { max-width: 150px; }

/* P4P 月度维护 */
.pm-amount { text-align: right; }

/* ===================== V11 业务标准与健康度 ===================== */

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

@media (max-width: 1024px) {
  .grid-3 { grid-template-columns: 1fr; }
}

/* ===================== 经营总览 · 标准驾驶舱 ===================== */

.status-open {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

#dashTop .card-head h3 { font-size: 12.5px; }
#dashTop .tbl th { white-space: nowrap; }
#dashTop .tbl td { font-size: 12px; }

/* ===================== 经营总览 · DataMate 指标网格 ===================== */

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0;
  border: 1px solid #eef2f7;
  border-radius: 12px;
  overflow: hidden;
  background: #fbfdff;
}

.dm-card {
  padding: 12px 14px 10px;
  background: #fff;
  border-right: 1px solid #f1f5f9;
  border-bottom: 1px solid #f1f5f9;
  transition: background .15s ease;
  min-width: 0;
}
.dm-card:hover { background: #f8fafc; }

.dm-head { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.dm-icon { width: 13px; height: 13px; flex: 0 0 13px; opacity: .85; }
.dm-label {
  font-size: 11.5px; color: #64748b; line-height: 1.2;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.dm-value {
  font-size: 21px; font-weight: 650; color: #0f172a;
  letter-spacing: -.01em; line-height: 1.15;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dm-unit { font-size: 11px; font-weight: 400; color: #94a3b8; margin-left: 3px; }

.dm-spark { width: 100%; height: 34px; display: block; margin: 6px 0 2px; }
.dm-spark-empty {
  height: 34px; margin: 6px 0 2px;
  display: flex; align-items: center;
  font-size: 10.5px; color: #cbd5e1;
}

.dm-foot {
  font-size: 10.5px; color: #94a3b8; line-height: 1.35;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

@media (max-width: 1500px) { .kpi-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
@media (max-width: 1100px) { .kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 700px)  { .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ===================== 侧栏 v2 ===================== */

.sidebar { width: 244px; transition: width .18s ease; }
.sidebar-brand { position: relative; padding-right: 12px; }

.rail-toggle {
  margin-left: auto;
  width: 26px; height: 26px; flex: none;
  display: grid; place-items: center;
  border: 0; border-radius: 7px;
  background: transparent; color: #94a3b8; cursor: pointer;
}
.rail-toggle:hover { background: rgba(255,255,255,.08); color: #fff; }
.rail-toggle svg { width: 17px; height: 17px; fill: currentColor; transition: transform .18s ease; }
.sidebar.rail .rail-toggle svg { transform: rotate(180deg); }

.nav { padding: 12px 9px 18px; gap: 2px; }

.nav-group + .nav-group { margin-top: 2px; }

.nav-group-head {
  display: flex; align-items: center; gap: 9px; width: 100%;
  padding: 9px 11px; border: 0; border-radius: 8px;
  background: transparent; cursor: pointer;
  color: #94a3b8; font-size: 11.5px; font-weight: 600;
  letter-spacing: .04em; text-align: left;
  transition: background .15s, color .15s;
}
.nav-group-head:hover { background: rgba(255,255,255,.05); color: #cbd5e1; }
.nav-group-head .nav-icon { width: 15px; height: 15px; opacity: .6; }
.nav-group-head span { flex: none; }

.nav-group-count {
  font-style: normal; font-size: 10px; line-height: 1;
  padding: 2px 6px; border-radius: 9px;
  color: #7c8ba1; background: rgba(148,163,184,.12);
}
.nav-group-head .caret { margin-left: auto; }

.nav-sub { display: grid; gap: 1px; padding: 2px 0 8px; }
.nav-sub .nav-item {
  padding: 8px 11px 8px 12px;
  font-size: 13px; font-weight: 400;
  color: #b6c2d2;
  border-radius: 8px;
  gap: 9px;
}
.nav-sub .nav-item .nav-icon { width: 15px; height: 15px; opacity: .55; }
.nav-sub .nav-item:hover { color: #fff; background: rgba(255,255,255,.06); }
.nav-sub .nav-item:hover .nav-icon { opacity: .9; }
.nav-sub .nav-item::before { display: none; }

.nav-sub .nav-item.active {
  background: linear-gradient(90deg, rgba(37,99,235,.32), rgba(37,99,235,.12));
  color: #fff; font-weight: 500;
  box-shadow: inset 3px 0 0 #3b82f6;
}
.nav-sub .nav-item.active .nav-icon { opacity: 1; fill: #93c5fd; }

.nav-badge { background: #dc2626; }
.nav-badge-amber { background: #d97706; }

#logoutBtn { display: flex; align-items: center; justify-content: center; gap: 7px; }
#logoutBtn .nav-icon { width: 15px; height: 15px; opacity: .7; }

/* 收起为图标栏 */
.sidebar.rail { width: 66px; }
.sidebar.rail .brand-text,
.sidebar.rail .nav-group-head,
.sidebar.rail .nav-item span,
.sidebar.rail .nav-badge,
.sidebar.rail .user-mini-info,
.sidebar.rail #logoutBtn span { display: none; }
.sidebar.rail .sidebar-brand { justify-content: center; padding: 18px 0 16px; }
.sidebar.rail .rail-toggle { display: none; }
.sidebar.rail .nav { padding: 10px 8px; }
.sidebar.rail .nav-group { border-top: 1px solid rgba(148,163,184,.12); padding-top: 8px; }
.sidebar.rail .nav-group:first-child { border-top: 0; padding-top: 0; }
.sidebar.rail .nav-group + .nav-group { margin-top: 6px; }
.sidebar.rail .nav-sub { padding: 0; gap: 4px; }
.sidebar.rail .nav-item { justify-content: center; padding: 10px 0; }
.sidebar.rail .nav-item .nav-icon { width: 17px; height: 17px; opacity: .8; }
.sidebar.rail .nav-item.active { box-shadow: inset 0 0 0 1px rgba(59,130,246,.5); }
.sidebar.rail .sidebar-foot { padding: 10px 8px 14px; }
.sidebar.rail #logoutBtn { padding: 0; height: 34px; }
.sidebar.rail .user-mini { justify-content: center; padding: 0; }

/* 移动端恢复横向导航（覆盖上方的桌面规则） */
@media (max-width: 920px) {
  .sidebar, .sidebar.rail { width: 100%; height: auto; }
  .sidebar .rail-toggle { display: none; }
  .sidebar .nav-group-head { display: none; }
  .sidebar .nav-group, .sidebar .nav-sub { display: contents; }
  .sidebar .nav-sub .nav-item,
  .sidebar.rail .nav-item { padding: 8px 10px; justify-content: flex-start; }
  .sidebar .nav-item span,
  .sidebar.rail .nav-item span { display: inline; }
  .sidebar .nav-badge { display: grid; }
  .sidebar.rail .nav-group { border: 0; }
}

/* 图标栏模式下，折叠分组也要显示图标 */
.sidebar.rail .nav-group.collapsed .nav-sub { display: grid; }

/* 弹窗表单：两列栅格（可自动单列） */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 14px;
}
.form-grid label {
  display: flex; flex-direction: column; gap: 5px;
  font-size: 12px; color: #475569;
}
.form-grid label input,
.form-grid label select,
.form-grid label textarea {
  font-size: 13px;
}
@media (max-width: 700px) { .form-grid { grid-template-columns: 1fr; } }

/* ===================== P4P 明细表：自适应与冻结 ===================== */

.tbl-report thead th { position: sticky; top: 0; z-index: 3; }

.tbl-auto { table-layout: auto; width: 100%; }
.tbl-auto tbody td {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  padding: 10px 12px;
}
.tbl-auto tbody tr:nth-child(even) { background: #fafcff; }
.tbl-auto tbody tr:hover { background: #eff6ff; }
.tbl-auto tbody td:first-child { max-width: 260px; overflow: hidden; text-overflow: ellipsis; }

/* 冻结首列（仅用于无合并单元格的明细表） */
.tbl-freeze tbody td:first-child,
.tbl-freeze thead th:first-child {
  position: sticky; left: 0; z-index: 2;
  background: #fff;
  box-shadow: 1px 0 0 #eef2f7;
}
.tbl-freeze thead th:first-child { background: #16233b; z-index: 4; }
.tbl-freeze tbody tr:nth-child(even) td:first-child { background: #fafcff; }
.tbl-freeze tbody tr:hover td:first-child { background: #eff6ff; }

/* 行密度 */
.tbl-dense tbody td { padding: 5px 10px; font-size: 12px; }
.tbl-dense thead th { padding: 7px 10px; }

/* ===================== 导入预览弹窗 ===================== */

.imp-drop {
  border: 1.5px dashed #cbd5e1; border-radius: 10px;
  padding: 26px 18px; text-align: center; cursor: pointer;
  background: #fbfdff; transition: border-color .15s, background .15s;
}
.imp-drop:hover { border-color: #3b82f6; background: #f0f7ff; }

.imp-file {
  display: flex; align-items: baseline; gap: 10px;
  padding: 10px 12px; margin-bottom: 12px;
  background: #f8fafc; border: 1px solid #eef2f7; border-radius: 8px;
}
.imp-file strong { font-size: 13px; color: #0f172a; }
.imp-file span { font-size: 11.5px; color: #94a3b8; }

.imp-stats {
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px; margin-bottom: 12px;
}
.imp-stat {
  padding: 9px 10px; border: 1px solid #eef2f7; border-radius: 8px;
  background: #fff; text-align: center;
}
.imp-stat b { display: block; font-size: 17px; color: #0f172a; font-variant-numeric: tabular-nums; }
.imp-stat span { font-size: 10.5px; color: #94a3b8; }
.imp-stat-warn b { color: #b45309; }

.imp-warn {
  padding: 9px 12px; margin-bottom: 12px; border-radius: 8px;
  background: #fffbeb; border: 1px solid #fde68a;
  color: #92400e; font-size: 11.5px; line-height: 1.75;
}

.imp-sec-title {
  font-size: 11.5px; font-weight: 650; color: #475569;
  margin: 14px 0 6px;
}

.imp-arrow { color: #cbd5e1; width: 22px; text-align: center; }

.imp-tag {
  display: inline-block; padding: 1px 7px; border-radius: 9px;
  font-size: 10.5px; line-height: 1.6;
}
.imp-ok { background: #ecfdf5; color: #15803d; }
.imp-off { background: #f1f5f9; color: #94a3b8; }
.imp-bad { background: #fef2f2; color: #b91c1c; }
.imp-dated { background: #eff6ff; color: #1d4ed8; }

@media (max-width: 700px) {
  .imp-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ===================== 导入对账 ===================== */

.rec-head {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px; margin-bottom: 12px;
  background: linear-gradient(90deg, #f8fafc, #f1f7ff);
  border: 1px solid #e8eef7; border-radius: 10px;
}
.rec-pair { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.rec-pair span { font-size: 11px; color: #94a3b8; }
.rec-pair em {
  font-style: normal; font-size: 16px; font-weight: 650;
  color: #334155; font-variant-numeric: tabular-nums;
}
.rec-pair-new em { color: #1d4ed8; }
.rec-arrow { color: #cbd5e1; font-size: 15px; margin-top: 12px; }
.rec-total {
  margin-left: auto; font-size: 19px; font-weight: 700;
  font-variant-numeric: tabular-nums; color: #334155;
}
.rec-total.rec-up { color: #b45309; }
.rec-total.rec-down { color: #15803d; }

.rec-kpis {
  display: grid; grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px; margin-bottom: 12px;
}
.rec-kpi {
  padding: 8px 6px; text-align: center;
  background: #fff; border: 1px solid #eef2f7; border-radius: 8px;
}
.rec-kpi b { display: block; font-size: 16px; color: #0f172a; font-variant-numeric: tabular-nums; }
.rec-kpi span { font-size: 10.5px; color: #94a3b8; }

.rec-notes { margin-bottom: 10px; }
.rec-note {
  padding: 7px 11px; margin-bottom: 5px; border-radius: 7px;
  background: #f8fafc; border-left: 3px solid #cbd5e1;
  font-size: 11.5px; color: #475569; line-height: 1.7;
}
.rec-note-warn { background: #fff7ed; border-left-color: #f59e0b; color: #92400e; }

.rec-sec {
  font-size: 11.5px; font-weight: 650; color: #475569;
  margin: 14px 0 6px;
}

.rec-up { color: #b45309; font-variant-numeric: tabular-nums; }
.rec-down { color: #15803d; font-variant-numeric: tabular-nums; }
.rec-flat { color: #94a3b8; }
.rec-warn { color: #dc2626; font-weight: 600; }

@media (max-width: 760px) {
  .rec-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .rec-head { flex-wrap: wrap; }
  .rec-total { margin-left: 0; }
}

/* ===================== 历史快照提示条 ===================== */

.snap-banner {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 9px 14px; margin: 0 0 10px;
  background: #fff7ed; border: 1px solid #fed7aa;
  border-left: 3px solid #f59e0b; border-radius: 8px;
  font-size: 12px; color: #92400e;
}
.snap-banner b {
  padding: 1px 7px; border-radius: 4px;
  background: #f59e0b; color: #fff; font-size: 11px; font-weight: 600;
}
.snap-banner span { color: #78350f; }
.snap-banner em {
  font-style: normal; margin-left: auto;
  font-variant-numeric: tabular-nums; color: #92400e;
}

/* ===================== 达标客户明细：列宽与未达标项 ===================== */

.dash-cust-tbl { table-layout: fixed; }
.dash-cust-tbl td, .dash-cust-tbl th { overflow: hidden; }
.dash-cust-tbl td.left-txt { text-overflow: ellipsis; }
.dash-cust-tbl td:first-child { white-space: normal; word-break: break-all; line-height: 1.45; }
.dash-cust-tbl td.gap-cell { white-space: normal; overflow: visible; padding-top: 8px; padding-bottom: 8px; }

.gap-chip {
  display: inline-block; margin: 2px 4px 2px 0; padding: 2px 7px;
  border-radius: 5px; background: #fff7ed; border: 1px solid #fed7aa;
  color: #b45309; font-size: 11px; line-height: 1.5; white-space: nowrap;
}
.gap-chip.gap-miss {
  background: #f8fafc; border-color: #e2e8f0; color: #94a3b8;
}
.gap-none { color: #16a34a; font-size: 11px; }

/* ===================== 自定义筛选面板 ===================== */

.adv-panel {
  border-top: 1px solid #f1f5f9; background: #fbfdff;
  padding: 12px 16px 14px;
}
.adv-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.adv-title { font-size: 12.5px; font-weight: 600; color: #0f172a; }
.adv-sub { font-size: 11px; color: #94a3b8; }
.adv-logic { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: #64748b; }

.adv-rules { display: flex; flex-direction: column; gap: 8px; }
.adv-rule {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px; background: #fff;
  border: 1px solid #e8eef7; border-radius: 8px;
}
.adv-rule select.adv-field { width: 128px; }
.adv-rule select.adv-op { width: 88px; }
.adv-vals { display: flex; align-items: center; gap: 6px; flex: 1; min-width: 0; }
.adv-vals .ctl { width: 160px; }
.adv-tilde { color: #94a3b8; font-size: 12px; }
.adv-na { font-size: 11.5px; color: #b6c2d2; }
.adv-del {
  border: 0; background: transparent; color: #cbd5e1; cursor: pointer;
  font-size: 17px; line-height: 1; padding: 0 2px; border-radius: 4px;
}
.adv-del:hover { color: #dc2626; background: #fef2f2; }
.adv-empty { font-size: 11.5px; color: #94a3b8; padding: 6px 2px; }

.adv-foot { display: flex; align-items: center; gap: 8px; margin-top: 12px; flex-wrap: wrap; }

.adv-count {
  display: inline-block; min-width: 15px; margin-left: 5px; padding: 0 4px;
  border-radius: 8px; background: #2563eb; color: #fff;
  font-size: 10px; line-height: 15px; text-align: center; font-weight: 600;
}
#dashAdvToggle.active { border-color: #2563eb; color: #2563eb; background: #eff6ff; }

@media (max-width: 1180px) {
  .adv-rule { flex-wrap: wrap; }
  .adv-vals .ctl { width: 130px; }
}

/* ===================== 达标明细：筛选条 / 排序 / 分页 ===================== */

.dash-cust-scroll { max-height: calc(100vh - 400px); min-height: 300px; }

.dash-filter-bar {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  padding: 8px 14px; background: #f8fbff;
  border-top: 1px solid #f1f5f9; border-bottom: 1px solid #eef4fb;
  font-size: 11.5px;
}
.dash-filter-idle { color: #94a3b8; }
.dash-filter-tip { margin-left: 8px; color: #b6c2d2; }
.dash-filter-label { color: #64748b; margin-right: 2px; }

.dash-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 12px;
  background: #eff6ff; border: 1px solid #dbeafe; color: #1d4ed8;
  font-size: 11px; cursor: pointer; line-height: 1.6;
}
.dash-chip:hover { background: #dbeafe; }
.dash-chip i { font-style: normal; color: #93c5fd; font-size: 12px; }
.dash-chip:hover i { color: #2563eb; }
.dash-chip-reset {
  background: #fff; border-color: #e2e8f0; color: #64748b;
}
.dash-chip-reset:hover { background: #fef2f2; border-color: #fecaca; color: #dc2626; }

/* 排序表头 */
.dash-cust-tbl th.sortable { cursor: pointer; user-select: none; }
.dash-cust-tbl th.sortable:hover { background: #eef2f8; color: #0f172a; }
.dash-cust-tbl th.sorted { color: #2563eb; }
.dash-cust-tbl th .sort-ind { font-size: 10px; opacity: .9; }

.dash-cust-tbl td.dash-empty {
  text-align: center; color: #94a3b8; padding: 30px 0; font-size: 12px;
}

.pager-size {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; color: #64748b; margin-right: 4px;
}
.pager-size .ctl { width: 72px; height: 28px; padding: 0 6px; }

/* ===================== 育商活动日历 ===================== */

.view-switch {
  display: inline-flex; border: 1px solid #dbe3ef; border-radius: 8px;
  overflow: hidden; background: #fff;
}
.view-switch button {
  border: 0; background: transparent; cursor: pointer;
  padding: 5px 13px; font-size: 12px; color: #64748b;
}
.view-switch button + button { border-left: 1px solid #eef2f8; }
.view-switch button.active { background: #2563eb; color: #fff; font-weight: 600; }

.cal-head {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 16px; border-bottom: 1px solid #eef2f8; flex-wrap: wrap;
}
.cal-title { font-size: 15px; font-weight: 700; color: #0f172a; margin-left: 6px; }
.cal-stat { font-size: 11.5px; color: #64748b; }

.cal-week {
  display: grid; grid-template-columns: repeat(7, 1fr);
  background: #f8fafc; border-bottom: 1px solid #eef2f8;
}
.cal-wd {
  padding: 8px 6px; text-align: center;
  font-size: 11.5px; font-weight: 600; color: #64748b;
}

.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.cal-cell {
  min-height: 104px; padding: 6px 7px 8px;
  border-right: 1px solid #f1f5f9; border-bottom: 1px solid #f1f5f9;
  display: flex; flex-direction: column; gap: 4px;
}
.cal-cell:nth-child(7n) { border-right: 0; }
.cal-cell.cal-muted { background: #fbfcfe; }
.cal-cell.cal-has { background: #fdfefe; }
.cal-cell.cal-today { background: #eff6ff; box-shadow: inset 0 0 0 1.5px #bfdbfe; }

.cal-cell-top { display: flex; align-items: center; justify-content: space-between; }
.cal-day { font-size: 12px; font-weight: 600; color: #475569; }
.cal-cell.cal-today .cal-day {
  background: #2563eb; color: #fff; border-radius: 50%;
  width: 20px; height: 20px; line-height: 20px; text-align: center; font-size: 11px;
}
.cal-plus {
  border: 0; background: transparent; color: #cbd5e1; cursor: pointer;
  font-size: 15px; line-height: 1; padding: 0 3px; border-radius: 4px; opacity: 0;
  transition: opacity .12s;
}
.cal-cell:hover .cal-plus { opacity: 1; }
.cal-plus:hover { color: #2563eb; background: #dbeafe; }

.cal-items { display: flex; flex-direction: column; gap: 3px; overflow: hidden; }
.cal-mark {
  font-size: 10.5px; padding: 2px 6px; border-radius: 4px;
  cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  border-left: 3px solid transparent;
}
.cal-ev {
  font-size: 10.5px; color: #334155; background: #f1f5f9;
  padding: 2px 6px; border-radius: 4px; cursor: pointer;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cal-ev:hover { background: #e2e8f0; }
.cal-more { font-size: 10px; color: #94a3b8; padding-left: 4px; }

.mk-blue   { background: #eff6ff; color: #1d4ed8; border-left-color: #3b82f6; }
.mk-green  { background: #f0fdf4; color: #15803d; border-left-color: #22c55e; }
.mk-amber  { background: #fffbeb; color: #b45309; border-left-color: #f59e0b; }
.mk-rose   { background: #fff1f2; color: #be123c; border-left-color: #f43f5e; }
.mk-violet { background: #f5f3ff; color: #6d28d9; border-left-color: #8b5cf6; }

.cal-legend {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 10px 16px; font-size: 11px; color: #64748b;
  border-top: 1px solid #f1f5f9; background: #fbfdff;
}
.cal-legend span { display: inline-flex; align-items: center; gap: 5px; }
.mk-dot { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }
.cal-tip { margin-left: auto; color: #94a3b8; }

/* ===================== 首页活动提醒 ===================== */

.remind-card { border-left: 3px solid #2563eb; }
.remind-head {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px 10px; border-bottom: 1px solid #f1f5f9;
}
.remind-head h3 { margin: 0; font-size: 14px; font-weight: 700; display: flex; align-items: center; }
.remind-sub { font-size: 11.5px; color: #64748b; }
.remind-dot {
  display: inline-block; width: 7px; height: 7px; margin-left: 7px;
  border-radius: 50%; background: #ef4444;
  box-shadow: 0 0 0 3px rgba(239,68,68,.16);
}

.remind-list { display: flex; flex-direction: column; }
.remind-item {
  display: flex; gap: 12px; padding: 9px 16px;
  border-bottom: 1px solid #f8fafc; align-items: center;
}
.remind-item:last-child { border-bottom: 0; }
.remind-item.remind-urgent { background: #fffdf8; }
.remind-item.remind-mark { background: #fcfdff; }

.remind-when {
  width: 62px; flex-shrink: 0; text-align: center;
  display: flex; flex-direction: column; gap: 1px;
}
.remind-when b { font-size: 11.5px; color: #1d4ed8; font-weight: 700; }
.remind-item.remind-urgent .remind-when b { color: #dc2626; }
.remind-when span { font-size: 10px; color: #94a3b8; }

.remind-main { min-width: 0; flex: 1; }
.remind-title {
  font-size: 12.5px; font-weight: 600; color: #0f172a;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.remind-meta {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: 10.5px; color: #94a3b8; margin-top: 2px;
}
.remind-tag {
  padding: 1px 6px; border-radius: 4px;
  background: #eef2f8; color: #64748b; font-size: 10px;
}
.remind-tag-ev { background: #eff6ff; color: #1d4ed8; }
.remind-note { color: #b6c2d2; }

/* ===================== 活动导入预览 ===================== */

.imp-summary {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 10px 12px; background: #f8fafc;
  border: 1px solid #eef2f8; border-radius: 8px; margin-bottom: 10px;
  font-size: 12px; color: #334155;
}
.imp-stats { display: flex; gap: 10px; margin-left: auto; font-size: 11.5px; }
.imp-stats .ok { color: #15803d; font-weight: 600; }
.imp-stats .bad { color: #b45309; }

.imp-cols { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.imp-col {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 8px; border-radius: 6px; font-size: 11px;
  border: 1px solid #e2e8f0; background: #fff; color: #334155;
  max-width: 260px;
}
.imp-col i {
  font-style: normal; font-size: 10px; padding: 0 4px;
  border-radius: 3px; background: #f1f5f9; color: #64748b;
  white-space: nowrap;
}
.imp-col-ok { border-color: #bbf7d0; background: #f0fdf4; }
.imp-col-ok i { background: #dcfce7; color: #15803d; }
.imp-col-ign { opacity: .6; }
.imp-col-dup { border-color: #fecaca; background: #fef2f2; }
.imp-col-dup i { background: #fee2e2; color: #b91c1c; }

.imp-problems {
  padding: 9px 12px; margin-bottom: 12px;
  background: #fffbeb; border: 1px solid #fde68a; border-radius: 8px;
  font-size: 11.5px; color: #92400e;
}
.imp-problems-title { font-weight: 600; margin-bottom: 3px; }

.imp-sample-title {
  font-size: 11.5px; font-weight: 600; color: #64748b; margin-bottom: 6px;
}

.imp-drop.over { border-color: #2563eb; background: #eff6ff; }

/* ===================== 目标一致性校验提示 ===================== */

.target-audit {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 10px 14px; margin-bottom: 14px;
  background: #fff7ed; border: 1px solid #fed7aa;
  border-left: 3px solid #f59e0b; border-radius: 8px;
  font-size: 12px; color: #92400e;
}
.target-audit b {
  flex-shrink: 0; padding: 1px 8px; border-radius: 4px;
  background: #f59e0b; color: #fff; font-size: 11px; font-weight: 600;
}
.target-audit-body { flex: 1; line-height: 1.7; }
.target-audit .btn { flex-shrink: 0; }

/* P4P 异常预警卡片 */
.alert-tiles{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:10px}
.alert-tile{background:#fff;border:1px solid #e2e8f0;border-left:3px solid #94a3b8;border-radius:8px;padding:12px 14px}
.alert-tile .at-n{font-size:24px;font-weight:700;line-height:1.1}
.alert-tile .at-l{font-size:13px;font-weight:600;color:#334155;margin-top:4px}
.alert-tile .at-t{font-size:11px;color:#94a3b8;margin-top:2px}
.alert-pill{display:inline-block;padding:2px 8px;border-radius:10px;font-size:12px;font-weight:600;white-space:nowrap}
@media (max-width:640px){
  .alert-tiles{grid-template-columns:repeat(2,1fr)}
  .alert-tile{padding:10px}
  .alert-tile .at-n{font-size:20px}
}

/* 首年商五维门槛评分 */
.fy-dims{display:grid;grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:14px}
.fy-dim{border:1px solid #e2e8f0;border-radius:8px;padding:12px 14px;background:#fff}
.fy-dim-top{display:flex;justify-content:space-between;align-items:baseline}
.fy-dim-name{font-size:13px;font-weight:600;color:#334155}
.fy-dim-val{font-size:20px;font-weight:700;line-height:1}
.fy-dim-total{font-size:12px;font-weight:400;color:#94a3b8}
.fy-dim-bar{height:6px;background:#f1f5f9;border-radius:3px;margin:8px 0 6px;overflow:hidden}
.fy-dim-bar i{display:block;height:100%;border-radius:3px;transition:width .3s}
.fy-dim-foot{display:flex;justify-content:space-between;font-size:11.5px;color:#64748b}
.fy-dim-tip{font-size:11px;color:#94a3b8;margin-top:4px}
.fy-dist{display:flex;flex-direction:column;gap:9px}
.fy-dist-row{display:grid;grid-template-columns:88px 1fr 44px;align-items:center;gap:10px}
.fy-dist-l{font-size:12px;color:#475569}
.fy-dist-bar{height:14px;background:#f1f5f9;border-radius:7px;overflow:hidden}
.fy-dist-bar i{display:block;height:100%;border-radius:7px;min-width:2px}
.fy-dist-n{font-size:12.5px;font-weight:600;text-align:right}
@media (max-width:760px){
  .fy-dims{grid-template-columns:repeat(2,1fr);gap:10px}
  .fy-dim{padding:10px}
  .fy-dim-val{font-size:17px}
}

/* 通用下钻抽屉 */
.drill-overlay{position:fixed;inset:0;background:rgba(15,23,42,.55);z-index:9000;display:flex;align-items:center;justify-content:center;padding:24px}
.drill-panel{background:#fff;border-radius:12px;width:min(1180px,100%);max-height:88vh;display:flex;flex-direction:column;box-shadow:0 20px 60px rgba(2,6,23,.35)}
.drill-head{display:flex;justify-content:space-between;align-items:flex-start;gap:12px;padding:16px 20px;border-bottom:1px solid #e2e8f0}
.drill-head h3{font-size:16px;margin:0 0 4px}
.drill-head .sub{font-size:12px;color:#64748b}
.drill-body{padding:14px 20px 20px;overflow:auto}
.drill-loading{padding:36px;text-align:center;color:#94a3b8;font-size:13px}
.drill-summary{font-size:12.5px;color:#64748b;margin-bottom:8px}
.drill-body .tbl{width:100%}
.drill-body tr.clickable:hover{background:#f1f5f9}
@media (max-width:768px){
  .drill-overlay{padding:0}
  .drill-panel{width:100%;max-height:100vh;height:100vh;border-radius:0}
  .drill-body{padding:10px 12px 16px}
  .drill-head{padding:12px}
}
