:root {
  --ink: #17211f;
  --ink-2: #24322e;
  --ink-3: #52625c;
  --muted: #7d8a84;
  --line: rgba(23, 33, 31, 0.1);
  --line-strong: rgba(23, 33, 31, 0.18);
  --paper: #f3f0e8;
  --paper-2: #ebe7dc;
  --card: #fcfbf7;
  --card-2: #f7f4ec;
  --emerald: #1f6b58;
  --emerald-soft: #e3f0eb;
  --gold: #c58b29;
  --gold-soft: #f6ead1;
  --coral: #b95547;
  --coral-soft: #f7e4df;
  --blue: #3d6f8e;
  --blue-soft: #e4edf3;
  --violet: #6c5b86;
  --violet-soft: #eee8f5;
  --shadow-sm: 0 1px 2px rgba(23, 33, 31, 0.05), 0 5px 16px rgba(23, 33, 31, 0.04);
  --shadow-md: 0 2px 4px rgba(23, 33, 31, 0.05), 0 18px 45px rgba(23, 33, 31, 0.08);
  --radius: 18px;
  --radius-sm: 12px;
  --sidebar: 248px;
  --font-ui: "SF Pro Text", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --font-display: "Songti SC", "Noto Serif SC", "STSong", serif;
  --font-num: "DIN Alternate", "Bahnschrift", "SF Pro Display", "Arial Narrow", sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; overflow-x: hidden; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 14% 8%, rgba(197, 139, 41, 0.08), transparent 28rem),
    radial-gradient(circle at 84% 20%, rgba(31, 107, 88, 0.07), transparent 30rem),
    var(--paper);
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }
svg { display: block; }

.app-shell { min-height: 100vh; }

/* Sidebar */
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar);
  display: flex;
  flex-direction: column;
  padding: 22px 14px 16px;
  color: #eef0e8;
  background:
    linear-gradient(165deg, rgba(255,255,255,0.04), transparent 34%),
    linear-gradient(180deg, #1a2724 0%, #131d1a 100%);
  border-right: 1px solid rgba(255,255,255,0.06);
  z-index: 30;
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 2px 8px 20px;
}
.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: #f4d58b;
  background: rgba(244, 213, 139, 0.08);
  border: 1px solid rgba(244, 213, 139, 0.24);
  box-shadow: inset 0 0 18px rgba(244, 213, 139, 0.06);
}
.brand-mark svg { width: 21px; height: 21px; }
.brand-name {
  font-family: var(--font-display);
  font-size: 20px;
  letter-spacing: 0.06em;
  line-height: 1.1;
}
.brand-sub {
  margin-top: 3px;
  font-size: 10px;
  letter-spacing: 0.16em;
  color: rgba(238, 240, 232, 0.46);
  text-transform: uppercase;
}
.nav-label {
  padding: 16px 12px 8px;
  font-size: 10px;
  letter-spacing: 0.16em;
  color: rgba(238, 240, 232, 0.36);
}
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 12px;
  color: rgba(238, 240, 232, 0.65);
  background: transparent;
  border: 0;
  border-radius: 11px;
  text-align: left;
  transition: background .18s ease, color .18s ease, transform .18s ease;
}
.nav-item:hover { background: rgba(255,255,255,0.055); color: #fff; }
.nav-item.active {
  color: #fff;
  background: linear-gradient(90deg, rgba(47, 119, 98, 0.36), rgba(47, 119, 98, 0.12));
  box-shadow: inset 2px 0 0 #e2b757;
}
.nav-icon { width: 19px; height: 19px; flex: 0 0 19px; opacity: .9; }
.nav-icon svg { width: 19px; height: 19px; }
.nav-item > svg { width: 19px; height: 19px; flex: 0 0 19px; opacity: .9; }
.nav-text { flex: 1; font-size: 13px; }
.nav-badge {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 99px;
  display: grid;
  place-items: center;
  color: #1a2724;
  background: #e9c46a;
  font-family: var(--font-num);
  font-size: 11px;
  font-weight: 700;
}
.sidebar-foot { margin-top: auto; padding-top: 18px; }
.demo-card {
  padding: 12px;
  border-radius: 13px;
  background: rgba(255,255,255,0.045);
  border: 1px solid rgba(255,255,255,0.07);
}
.demo-card-title { display: flex; align-items: center; gap: 7px; font-size: 11px; color: rgba(238,240,232,.6); }
.demo-dot { width: 6px; height: 6px; border-radius: 50%; background: #7fc7a9; box-shadow: 0 0 0 3px rgba(127,199,169,.12); }
.demo-card p { margin: 6px 0 10px; font-size: 11px; line-height: 1.55; color: rgba(238,240,232,.43); }
.demo-card button { width: 100%; }
.demo-card .btn { color: rgba(238,240,232,.7); border-color: rgba(255,255,255,.12); background: rgba(255,255,255,.045); }
.demo-card .btn:hover { color: #fff; background: rgba(255,255,255,.09); border-color: rgba(255,255,255,.18); }

/* Main shell */
.main-shell { margin-left: var(--sidebar); min-height: 100vh; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 88px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 32px 16px;
  background: rgba(243, 240, 232, 0.82);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(23,33,31,0.07);
}
.topbar-left { min-width: 0; }
.page-eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
}
.page-eyebrow .sep { width: 18px; height: 1px; background: var(--line-strong); }
.page-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(23px, 2.2vw, 31px);
  font-weight: 600;
  letter-spacing: 0.015em;
  line-height: 1.2;
}
.topbar-actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; justify-content: flex-end; }
.role-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 11px 0 7px;
  border-radius: 99px;
  background: rgba(255,255,255,0.55);
  border: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 12px;
}
.avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--emerald);
  font-size: 11px;
  font-weight: 700;
}
.role-chip select {
  max-width: 155px;
  border: 0;
  outline: 0;
  background: transparent;
  color: inherit;
  font-size: 12px;
  cursor: pointer;
}

/* Controls */
.content { padding: 26px 32px 48px; }
.page { animation: page-in .32s ease both; }
@keyframes page-in { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
/* 切换范围/页签时不重播入场动画，避免整页跳动 */
.app-shell.is-silent .page,
.content.is-silent .page,
.is-silent .page { animation: none !important; opacity: 1 !important; transform: none !important; }
.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}
.page-head h2 { margin: 0; font-family: var(--font-display); font-size: 21px; font-weight: 600; }
.page-head p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.page-head-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
/* 页头日期快捷按钮：紧凑，不抢空间 */
.page-head-actions .date-scope-seg { flex: 0 0 auto; }
.page-head-actions .date-scope-seg button { height: 30px; padding: 0 10px; font-size: 11px; }
.page-head-actions .date-scope-seg { margin-right: 2px; }
/* 页面底部口径说明：小字，不抢视线 */
.page-footnote { margin: 18px 2px 6px; font-size: 11px; line-height: 1.7; color: var(--muted); padding-top: 12px; border-top: 1px dashed rgba(23,33,31,.09); }
/* 页头里的下拉框/输入框限制宽度，避免被拉满 */
.page-head-actions > select,
.page-head-actions > .select { width: auto; min-width: 104px; max-width: 132px; height: 32px; font-size: 12px; padding-left: 10px; padding-right: 26px; background-position: calc(100% - 13px) 13px, calc(100% - 8px) 13px; }
.page-head-actions > .input[type="month"],
.page-head-actions > .input[type="date"] { width: 128px; height: 32px; font-size: 12px; }
.page-head-actions > .tag { height: 32px; display: inline-flex; align-items: center; }

.btn {
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.66);
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  transition: transform .16s ease, background .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.btn:hover { background: #fff; border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
.btn:active { transform: translateY(1px); }
.btn svg { width: 16px; height: 16px; }
.btn-primary { color: #fff; background: var(--ink); border-color: var(--ink); }
.btn-primary:hover { background: #24322e; border-color: #24322e; }
.btn-emerald { color: #fff; background: var(--emerald); border-color: var(--emerald); }
.btn-emerald:hover { background: #185847; border-color: #185847; }
.btn-danger { color: var(--coral); background: var(--coral-soft); border-color: rgba(185,85,71,.16); }
.btn-ghost { background: transparent; }
.btn-small { height: 31px; padding: 0 10px; font-size: 11px; border-radius: 8px; }
.btn-small svg { width: 14px; height: 14px; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }
.icon-btn {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.5);
  color: var(--ink-2);
}
.icon-btn:hover { background: #fff; }
.icon-btn svg { width: 17px; height: 17px; }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label { font-size: 11px; font-weight: 600; color: var(--ink-3); }
.input, .select, .textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255,255,255,0.72);
  color: var(--ink);
  outline: none;
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
.input, .select { height: 38px; padding: 0 11px; }
.textarea { min-height: 78px; padding: 10px 11px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { border-color: rgba(31,107,88,.5); box-shadow: 0 0 0 3px rgba(31,107,88,.09); background: #fff; }
.input::placeholder, .textarea::placeholder { color: #a6aea9; }
.select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%), linear-gradient(135deg, var(--ink-3) 50%, transparent 50%); background-position: calc(100% - 15px) 16px, calc(100% - 10px) 16px; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 30px; }
.filter-bar { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-bottom: 16px; }
/* 台账日期筛选：紧凑一排 */
.filter-bar .ledger-date-seg { flex: 0 0 auto; }
.filter-bar .ledger-date-seg button { height: 30px; padding: 0 10px; font-size: 11px; }
.filter-bar .input[type="date"] { width: 132px; height: 32px; font-size: 12px; }
.filter-bar .input { width: 240px; }
.filter-bar .select { width: 138px; }
.search-wrap { position: relative; }
.search-wrap svg { position: absolute; left: 11px; top: 11px; width: 16px; height: 16px; color: var(--muted); }
.search-wrap .input { padding-left: 34px; }

.segmented {
  display: inline-flex;
  gap: 6px;
  padding: 0;
  border-radius: 10px;
  background: transparent;
  border: 0;
}
.segmented button {
  height: 32px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  transition: background .16s ease, color .16s ease, box-shadow .16s ease;
}
.segmented button:hover { background: rgba(23,33,31,.05); color: var(--ink); }
.segmented button.active { color: var(--indigo, #534AB7); background: var(--card); border-color: rgba(23,33,31,.06); box-shadow: var(--shadow-sm); }

/* 经营总览 KPI 分组页签 */
.kpi-tabs { margin-bottom: 14px; margin-top: 16px; }
.kpi-pane { display: none; }
/* 只负责显隐，栅格布局交给内部的 .kpi-grid，避免双层栅格把卡片压成竖条 */
.kpi-pane.active { display: block; }

/* 成交类型饼图 + 图例 */
.type-pie-body { display: flex; gap: 18px; align-items: center; padding: 6px 2px 2px; }
.type-pie { flex: 0 0 170px; display: grid; place-items: center; }
.type-pie .pie, .type-pie .pie-svg { width: 170px; height: 170px; }
.pie { position: relative; }
.pie-svg { display: block; }
.pie-slice { cursor: pointer; transition: opacity .15s ease; }
.pie-slice:hover { opacity: .85; }
.type-legend { flex: 1; min-width: 0; display: grid; gap: 6px; }
.type-legend-row { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: var(--radius-sm); font-size: 11px; cursor: pointer; }
.type-legend-row:hover { background: rgba(23,33,31,.04); }
.type-legend-dot { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 9px; }
.type-legend-name { flex: 0 0 auto; color: var(--ink); font-weight: 500; }
.type-legend-val { margin-left: auto; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (max-width: 900px) {
  .type-pie-body { flex-direction: column; align-items: stretch; }
  .type-pie { flex: 0 0 auto; }
  .type-pie .pie, .type-pie .pie-svg { width: 140px; height: 140px; margin: 0 auto; }
}

/* 业务完成情况：环形图 + 指标条 */
.dash-body { display: flex; gap: 26px; align-items: center; padding: 6px 0 2px; }
.dash-ring { flex: 0 0 190px; display: grid; place-items: center; }
.dash-ring .donut { width: 190px; }
.dash-ring .donut-svg { width: 190px; height: 190px; }
.dash-side { flex: 1; min-width: 0; display: grid; gap: 10px; }
.dash-stat { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: var(--radius-sm); background: rgba(23,33,31,.028); border: 1px solid rgba(23,33,31,.045); }
.dash-dot { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 9px; }
.dash-stat-main { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 8px; }
.dash-stat-label { font-size: 12px; color: var(--muted); min-width: 46px; }
.dash-stat-num { font-family: var(--font-num); font-size: 22px; font-weight: 600; line-height: 1; color: var(--ink); }
.dash-stat-num small { font-size: 11px; font-weight: 400; color: var(--muted); margin-left: 3px; }
.dash-pct { font-family: var(--font-num); font-size: 13px; font-weight: 600; flex: 0 0 auto; }
.dash-rows { display: grid; gap: 7px; margin-top: 4px; padding-top: 10px; border-top: 1px dashed rgba(23,33,31,.09); }
.dash-row { display: flex; align-items: center; gap: 10px; font-size: 11px; color: var(--muted); }
.dash-row > span { flex: 0 0 42px; }
.dash-mini-bar { flex: 1; height: 6px; border-radius: 99px; background: rgba(23,33,31,.06); overflow: hidden; }
.dash-mini-bar > i { display: block; height: 100%; border-radius: 99px; transition: width .3s ease; }
.dash-stat-btn, .dash-row-btn { width: 100%; text-align: left; font: inherit; color: inherit; cursor: pointer; transition: background .15s ease, border-color .15s ease, transform .12s ease; }
.dash-stat-btn { border-style: solid; }
.dash-stat-btn:hover, .dash-row-btn:hover { background: rgba(79,70,229,.07); border-color: rgba(79,70,229,.25); }
.dash-stat-btn:active, .dash-row-btn:active { transform: scale(.995); }
.dash-stat-btn:focus-visible, .dash-row-btn:focus-visible { outline: 2px solid rgba(79,70,229,.45); outline-offset: 2px; }
.dash-row-btn { padding: 3px 4px; border: 1px solid transparent; border-radius: 6px; background: transparent; }
.dash-row-btn:hover { background: rgba(79,70,229,.07); }
.dash-row > b { flex: 0 0 auto; font-family: var(--font-num); font-size: 11px; font-weight: 600; color: var(--ink-3, var(--ink)); min-width: 42px; text-align: right; }
@media (max-width: 900px) {
  .dash-body { flex-direction: column; align-items: stretch; gap: 16px; }
  .dash-ring { flex: 0 0 auto; }
  .dash-ring .donut, .dash-ring .donut-svg { width: 160px; height: 160px; margin: 0 auto; }
}

/* 数据看板 · 老板视角：核心区 + 折叠分组 */
.boss-hero { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 14px; margin-bottom: 16px; }
.boss-hero-main { padding: 22px 24px; border-radius: var(--radius-lg); background: var(--card); border: 1px solid rgba(23,33,31,.08); box-shadow: var(--shadow-sm); display: flex; flex-direction: column; justify-content: center; }
.boss-hero-label { font-size: 12px; color: var(--muted); letter-spacing: .02em; }
.boss-hero-num { font-family: var(--font-num); font-size: 40px; font-weight: 700; line-height: 1.1; margin: 8px 0 6px; color: var(--ink); }
.boss-hero-num.pos { color: #0F6E56; }
.boss-hero-num.neg { color: #A32D2D; }
.boss-hero-delta { font-size: 12px; font-weight: 600; }
.boss-hero-delta.pos { color: #0F6E56; }
.boss-hero-delta.neg { color: #A32D2D; }
.boss-hero-link { align-self: flex-start; margin-top: 12px; border: 0; background: none; padding: 0; font-size: 11px; color: var(--accent, #534AB7); cursor: pointer; }
.boss-hero-link:hover { text-decoration: underline; }
.boss-hero-side { display: grid; gap: 10px; }
.boss-mini { padding: 13px 16px; border-radius: var(--radius-md, 10px); background: var(--card); border: 1px solid rgba(23,33,31,.07); }
.boss-mini span { display: block; font-size: 11px; color: var(--muted); }
.boss-mini strong { display: block; font-family: var(--font-num); font-size: 20px; font-weight: 600; color: var(--ink); margin: 4px 0 2px; line-height: 1.2; }
.boss-mini small { display: block; font-size: 10px; color: var(--muted); }
.boss-mini.warn strong, .boss-mini.warn small { color: #A32D2D; }
.boss-gauges { margin-bottom: 16px; }

.acc-card { border-radius: var(--radius-lg); background: var(--card); border: 1px solid rgba(23,33,31,.08); overflow: hidden; margin-bottom: 12px; }
.acc-card.is-open { box-shadow: var(--shadow-sm); }
.acc-head { width: 100%; display: flex; align-items: center; gap: 10px; padding: 14px 18px; border: 0; background: none; text-align: left; cursor: pointer; font: inherit; color: inherit; }
.acc-head:hover { background: rgba(23,33,31,.025); }
.acc-caret { flex: 0 0 12px; font-size: 11px; color: var(--muted); }
.acc-title-wrap { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.acc-title { font-size: 14px; font-weight: 600; color: var(--ink); }
.acc-sub { font-size: 11px; color: var(--muted); }
.acc-summary { display: flex; align-items: center; gap: 14px; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; flex-wrap: wrap; justify-content: flex-end; }
.acc-summary span { white-space: nowrap; }
.acc-body { padding: 0 18px 18px; }
.acc-body > .two-col:first-child, .acc-body > .analytics-grid-3:first-child, .acc-body > .kpi-grid:first-child, .acc-body > section:first-child, .acc-body > div:first-child { margin-top: 0; }
.acc-body .kpi-grid { margin-bottom: 16px; }
@media (max-width: 900px) {
  .boss-hero { grid-template-columns: minmax(0, 1fr); }
  .boss-hero-num { font-size: 32px; }
  .acc-summary { display: none; }
}

/* 数据看板 · 顶部核心数字卡 */
.headline-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.headline-card { display: flex; flex-direction: column; gap: 4px; padding: 15px 18px; border-radius: var(--radius-lg); background: var(--card); border: 1px solid rgba(23,33,31,.08); box-shadow: var(--shadow-sm); cursor: pointer; text-align: left; font: inherit; color: inherit; transition: border-color .15s ease, transform .15s ease; }
.headline-card:hover { border-color: rgba(23,33,31,.18); transform: translateY(-1px); }
.headline-label { font-size: 11px; color: var(--muted); }
.headline-value { font-family: var(--font-num); font-size: 24px; font-weight: 700; line-height: 1.15; color: var(--ink); }
.headline-value.pos { color: #0F6E56; }
.headline-value.neg { color: #A32D2D; }
.headline-sub { font-size: 10px; color: var(--muted); }
@media (max-width: 1100px) { .headline-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* 三栏：走势 + 返佣 + 工资，走势占宽 */
.two-col-wide { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) minmax(0, 1fr); gap: 14px; align-items: start; }
@media (max-width: 1280px) { .two-col-wide { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
@media (max-width: 860px) { .two-col-wide { grid-template-columns: minmax(0, 1fr); } }

/* 数据看板 · 仪表盘版：区块编号 + 子弹图 + 瀑布图 + 门店横条 */
.dash-block { min-width: 0; }
.dash-block-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.dash-block-num { flex: 0 0 auto; font-family: var(--font-num); font-size: 11px; font-weight: 700; color: var(--muted); background: rgba(23,33,31,.05); border-radius: 6px; padding: 3px 7px; letter-spacing: .04em; }
.dash-block-title { font-size: 14px; font-weight: 600; color: var(--ink); margin: 0; }
.dash-block-sub { font-size: 11px; color: var(--muted); margin: 2px 0 0; }
.dash-block-head > div:not(.dash-block-num) { flex: 1; min-width: 0; }
.dash-block .panel { margin: 0; }
.dash-block .gauge-grid { margin-bottom: 0; }

/* 子弹图 */
.bullet-list { display: grid; gap: 14px; padding: 4px 2px 2px; }
.bullet-row { min-width: 0; }
.bullet-head { display: flex; align-items: baseline; gap: 8px; font-size: 11px; margin-bottom: 5px; }
.bullet-label { flex: 1; min-width: 0; color: var(--ink); font-weight: 500; }
.bullet-value { font-family: var(--font-num); font-size: 13px; font-weight: 600; color: var(--ink); }
.bullet-status { font-size: 10px; flex: 0 0 auto; }
.bullet-track { position: relative; height: 14px; border-radius: 4px; background: rgba(23,33,31,.06); overflow: hidden; }
.bullet-fill { position: absolute; left: 0; top: 4px; height: 6px; border-radius: 3px; transition: width .3s ease; }
.bullet-target { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--ink); transform: translateX(-1px); }
.bullet-foot { font-size: 9px; color: var(--muted); margin-top: 3px; }

/* 数据看板统一栅格：所有行等高、等间距 */
.dash-grid { display: grid; gap: 16px; align-items: stretch; }
.dash-grid > .dash-block { min-width: 0; display: flex; flex-direction: column; }
.dash-grid > .dash-block > .panel { flex: 1; display: flex; flex-direction: column; justify-content: flex-start; }
/* 同一行区块：环形图与条形列表统一最小高度，避免底部参差 */
.dash-grid > .dash-block > .panel .donut-wrap { min-height: 200px; }
.dash-grid > .dash-block > .panel .bar-list { min-height: 200px; display: flex; flex-direction: column; justify-content: center; }
.dash-grid > .dash-block > .panel .store-bars { min-height: 200px; align-content: center; }
.dash-grid > .dash-block > .panel .donut-legend { max-height: 200px; overflow-y: auto; }
.dash-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.dash-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.dash-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.dash-grid-633 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr); }
@media (max-width: 1400px) {
  .dash-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-grid-633 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}
@media (max-width: 1000px) {
  .dash-grid-4, .dash-grid-3, .dash-grid-2, .dash-grid-633 { grid-template-columns: minmax(0, 1fr); }
}

/* 横向柱状图（人员排行 / 可堆叠） */
.hb-chart { display: grid; gap: 9px; padding: 2px 0; }
.hb-row { display: grid; grid-template-columns: 150px minmax(0, 1fr) 78px; align-items: center; gap: 12px; padding: 3px 4px; border-radius: 6px; }
.hb-row[role="button"] { cursor: pointer; }
.hb-row[role="button"]:hover { background: rgba(23,33,31,.035); }
.hb-name { display: flex; align-items: center; gap: 8px; min-width: 0; }
.hb-rank { flex: 0 0 18px; font-family: var(--font-num); font-size: 10px; color: var(--muted); }
.hb-name-main { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.hb-name-text { font-size: 12px; font-weight: 500; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hb-name-sub { font-size: 9.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hb-track { height: 18px; border-radius: 4px; background: rgba(23,33,31,.05); overflow: hidden; }
.hb-bar { display: flex; height: 100%; border-radius: 4px; overflow: hidden; min-width: 3px; transition: width .35s ease; }
.hb-seg { height: 100%; display: block; transition: opacity .15s ease; }
.hb-seg:hover { opacity: .8; }
.hb-value { text-align: right; font-family: var(--font-num); font-size: 12px; font-weight: 600; color: var(--ink); }

/* 柱状图（横向分组）：一个周期一组，组内并排细柱 */
.col-chart { --col-h: 210px; display: flex; align-items: stretch; gap: 8px; padding: 6px 2px 0; }
.col-plot { flex: 1; min-width: 0; display: flex; align-items: flex-end; gap: 6px; height: var(--col-h); border-bottom: 1px solid rgba(23,33,31,.12); }
.col-group { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: flex-end; height: 100%; }
.col-bars { flex: 1; display: flex; align-items: flex-end; justify-content: center; gap: 2px; padding: 0 3px; }
.col-bar-slot { flex: 1; min-width: 0; height: 100%; display: flex; align-items: flex-end; }
.col-bar { display: block; width: 100%; border-radius: 2px 2px 0 0; transition: height .35s ease, opacity .15s ease; cursor: pointer; }
.col-bar:hover { opacity: .82; }
.col-label { padding: 6px 2px 0; text-align: center; line-height: 1.25; }
.col-label strong { display: block; font-size: 11px; font-weight: 500; color: var(--ink); }
.col-label small { display: block; font-size: 9px; color: var(--muted); }
.col-axis { width: 46px; height: var(--col-h); display: flex; flex-direction: column; justify-content: space-between; padding-bottom: 0; }
.col-axis-item { text-align: right; }
.col-axis-item i { font-style: normal; font-size: 9.5px; color: var(--muted); font-family: var(--font-num); }
@media (max-width: 760px) {
  .col-chart { --col-h: 160px; }
  .col-label small { display: none; }
  .col-axis { width: 34px; }
}

/* 审批流编辑器 */
.flow-editor { padding: 2px 16px 14px; }
.flow-editor-track { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 10px 0 14px; }
.flow-node-chip { display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 999px; font-size: 11px; background: #f1f5f9; color: var(--ink); border: 1px solid rgba(23,33,31,.1); }
.flow-node-chip.is-step { background: #16211f; color: #fff; border-color: #16211f; }
.flow-arrow { color: var(--muted); font-size: 11px; }
.flow-step-list { display: grid; gap: 8px; }
.flow-step-row { display: grid; grid-template-columns: 22px minmax(0,1fr) minmax(0,1.1fr) 34px; gap: 8px; align-items: center; }
.flow-step-index { width: 22px; height: 22px; border-radius: 50%; background: #eef2f8; color: #475569; font-size: 10px; display: inline-flex; align-items: center; justify-content: center; font-family: var(--font-num); }
.flow-step-row .input, .flow-step-row .select { height: 30px; font-size: 12px; }
@media (max-width: 760px) {
  .flow-step-row { grid-template-columns: 22px minmax(0,1fr) 34px; }
  .flow-step-row .select { grid-column: 2 / 3; }
}

/* ===== 新增/编辑业务表单：2×2 卡片版式 ===== */
.deal-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  align-items: start;
}
.deal-card {
  background: #fff;
  border: 1px solid #e6ebf2;
  border-radius: 9px;
  padding: 8px 10px 9px;
  min-width: 0;
}
.deal-card-head,
.deal-card-sub {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 6px;
}
.deal-card-sub {
  margin-top: 9px;
  padding-top: 7px;
  border-top: 1px solid #f1f4f8;
  margin-bottom: 5px;
}
.deal-card-bar {
  width: 3px; height: 11px; border-radius: 2px; background: #1f6b58; flex: 0 0 3px;
}
.deal-card-bar.is-mint { background: #5DCAA5; }
.deal-card-bar.is-coral { background: #D85A30; }
.deal-card-bar.is-violet { background: #534AB7; }
.deal-card-bar.is-amber { background: #BA7517; }
.deal-card-head h4,
.deal-card-sub h5 {
  margin: 0; font-size: 11px; font-weight: 600; color: #243440; letter-spacing: .01em;
}
.deal-card-sub h5 { font-size: 10.5px; }
.deal-card-hint {
  margin-left: auto; font-size: 9px; color: #94a3b8; white-space: nowrap;
}

/* 卡片内栅格：12 格基准 */
.deal-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 5px 8px;
  align-content: start;
}
.deal-grid > .field { grid-column: span 3; min-width: 0; }
.deal-grid > .field.col-4 { grid-column: span 4; }
.deal-grid > .field.col-6 { grid-column: span 6; }
.deal-grid > .field.col-8 { grid-column: span 8; }
.deal-grid > .field.col-12 { grid-column: span 12; }
.deal-grid .field { gap: 2px; }
.deal-grid .field > label {
  font-size: 9.5px; line-height: 1.2; color: #7c8a9a; margin: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.deal-grid .input, .deal-grid .select { height: 28px; padding: 0 7px; font-size: 11.5px; }
.deal-grid .select { background-position: calc(100% - 12px) 12px, calc(100% - 7px) 12px; padding-right: 22px; }
.deal-grid .input-suffix > span { right: 7px; font-size: 8.5px; }
.deal-grid .field-help { display: none; }
.deal-grid .textarea.compact { min-height: 28px; height: 28px; padding: 5px 7px; font-size: 11.5px; resize: none; }

/* 台账标签整体框 */
.tag-box {
  border: 1px solid #dfe7f0;
  border-radius: 7px;
  background: #fcfdfe;
  padding: 6px 7px;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.tag-box .tag-picker-list { display: flex; flex-wrap: wrap; gap: 5px; }
.tag-box .tag-chip { padding: 3px 9px; font-size: 10.5px; }
.tag-add {
  display: flex; gap: 5px; margin-top: 6px; padding-top: 6px; border-top: 1px dashed #e8eef5;
}
.tag-add .input { flex: 1; min-width: 0; height: 24px; font-size: 10.5px; }
.tag-add .btn { height: 24px; padding: 0 9px; font-size: 10px; }

/* 费池卡片纵向堆叠（卡片内的次级容器） */
.listing-stack { display: grid; gap: 6px; }
.listing-stack .listing-role-card { padding: 6px 8px; border-radius: 7px; }
.listing-stack .listing-role-head {
  flex-direction: row; justify-content: space-between; align-items: baseline;
  margin-bottom: 4px; gap: 6px;
}
.listing-stack .listing-role-head strong { font-size: 10.5px; }
.listing-stack .listing-role-head span { font-size: 8.5px; }
.listing-stack .person-row { gap: 5px; }
.listing-stack .person-row.primary { grid-template-columns: minmax(0,1fr) 56px 62px; }
.listing-stack .person-row .select,
.listing-stack .person-row .input { height: 25px; font-size: 10.5px; padding: 0 6px; }
.listing-stack .person-add { height: 21px; font-size: 9.5px; padding: 0 6px; margin-top: 3px; }
.listing-stack .person-group { gap: 4px; }

/* 提示与合计 */
.notice.compact { padding: 5px 8px !important; font-size: 10px !important; line-height: 1.45 !important; gap: 6px !important; }
.notice.compact > svg { width: 12px; height: 12px; flex: 0 0 12px; }
.calc-inline {
  display: flex; align-items: center; height: 28px; padding: 0 8px;
  border: 1px dashed rgba(23,33,31,.18); border-radius: 6px;
  background: rgba(93,202,165,.07);
}
.calc-inline span { font-family: var(--font-num); font-size: 12px; font-weight: 700; color: #0F6E56; }
.calc-inline.is-net { background: rgba(55,138,221,.08); border-color: rgba(55,138,221,.22); }
.calc-inline.is-net span { color: #185FA5; }

/* 弹窗更宽、更紧凑 */
.modal.wide { width: min(1180px, 100%); }
.modal.wide .modal-head { padding: 10px 16px 8px; }
.modal.wide .modal-title { font-size: 16px; }
.modal.wide .modal-sub { margin-top: 2px; font-size: 10px; }
.modal.wide .modal-body { padding: 10px 12px 12px; background: #f6f8fb; }
.modal.wide .modal-foot { padding: 9px 16px; }

@media (max-width: 900px) {
  .deal-cards { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  .deal-grid > .field,
  .deal-grid > .field.col-4,
  .deal-grid > .field.col-6,
  .deal-grid > .field.col-8 { grid-column: span 12; }
}

/* 台账标签多选 */
.tag-picker { display: flex; flex-direction: column; gap: 8px; }
.tag-picker-list { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-chip { display: inline-flex; align-items: center; padding: 5px 12px; border: 1px solid rgba(23,33,31,.16); border-radius: 999px; font-size: 12px; color: var(--ink); background: #fff; cursor: pointer; transition: all .15s ease; user-select: none; }
.tag-chip:hover { border-color: rgba(23,33,31,.34); }
.tag-chip.is-on { background: #16211f; border-color: #16211f; color: #fff; }
.tag-picker-add { display: flex; gap: 8px; align-items: center; }
.tag-picker-add .input { flex: 1; min-width: 0; height: 32px; }
.stage-quick-select { height: 30px; min-width: 132px; font-size: 12px; }
.tag-cell { display: flex; flex-wrap: wrap; gap: 4px; }

/* 工资项录入：端口报销明细内联表 */
.port-ledger-inline { margin-top: 8px; border: 1px solid rgba(23,33,31,.08); border-radius: 8px; background: rgba(23,33,31,.015); overflow: hidden; }
.port-ledger-inline-row { display: grid; grid-template-columns: 76px 62px minmax(0,1fr) 88px; gap: 8px; align-items: center; padding: 6px 9px; font-size: 10.5px; border-bottom: 1px solid rgba(23,33,31,.05); }
.port-ledger-inline-row:last-child { border-bottom: 0; }
.port-ledger-inline-row .pld-date { color: var(--muted); font-family: var(--font-num); }
.port-ledger-inline-row .pld-platform { font-weight: 600; }
.port-ledger-inline-row .pld-note { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.port-ledger-inline-row .pld-amount { text-align: right; font-family: var(--font-num); font-weight: 600; }
.port-ledger-inline-row.is-total { background: rgba(93,202,165,.12); font-weight: 600; }

/* 返佣提交：可选业务列表（整行可点） */.rebate-pick-list { max-height: 46vh; overflow-y: auto; padding-right: 2px; }
.rebate-pick-row { width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid rgba(23,33,31,.065); cursor: pointer; font: inherit; color: inherit; padding: 10px 6px; border-radius: 6px; }
.rebate-pick-row:hover { background: rgba(23,33,31,.04); }
.rebate-pick-row .list-value { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
@media (max-width: 760px) {
  .hb-row { grid-template-columns: 104px minmax(0, 1fr) 64px; gap: 8px; }
  .hb-name-sub { display: none; }
}

/* 趋势明细折线图图例：7 项，允许换行 */
.detail-legend { flex-wrap: wrap; gap: 8px 18px; }
.detail-legend > span { display: inline-flex; align-items: center; gap: 5px; }

/* 佣金分配流程图 */
.flow { width: 100%; }
.flow-svg { width: 100%; height: auto; display: block; }
.flow-node, .flow-link { cursor: pointer; }
.flow-node:hover rect:first-child { stroke-width: 2; }
.flow-link:hover { stroke-opacity: .55; }

/* 瀑布图 */
.wf { width: 100%; }
.wf-svg { width: 100%; height: auto; display: block; }
.wf-bar rect { transition: opacity .15s ease; }
.wf-bar:hover rect { opacity: .85; }
.chart-empty { padding: 28px; text-align: center; font-size: 12px; color: var(--muted); }

/* 门店对比横条 */
.store-bars { display: grid; gap: 14px; padding: 2px; }
.store-bar-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 4px; font-size: 12px; }
.store-bar-head b { font-family: var(--font-num); font-size: 14px; font-weight: 600; }
.store-bar-track { height: 9px; border-radius: 5px; background: rgba(23,33,31,.06); overflow: hidden; }
.store-bar-track > i { display: block; height: 100%; border-radius: 5px; background: #1D9E75; transition: width .3s ease; }
.store-bar-track > i.neg { background: #E24B4A; }
.store-bar-foot { font-size: 10px; color: var(--muted); margin-top: 3px; }

/* Layout */
.grid { display: grid; gap: 15px; }
/* 同一行卡片等高：内容靠上，底部说明贴底，避免某张卡多一行字就撑高整排 */
.kpi-grid > .kpi-card { display: flex; flex-direction: column; }
.kpi-grid > .kpi-card .kpi-meta { margin-top: auto; padding-top: 8px; }
/* 说明文字统一最多两行，超出省略，保证五张卡高度一致 */
.kpi-grid > .kpi-card .kpi-meta > span {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; line-height: 1.4;
}
/* 五列时字会窄，价值数字缩一点避免溢出 */
.kpi-grid.kpi-count-5 .kpi-value { font-size: clamp(20px, 1.7vw, 26px); }

.kpi-grid { display: grid; gap: 15px; grid-template-columns: repeat(6, minmax(0, 1fr)); align-items: stretch; margin-bottom: 18px; }
/* 工资结算 KPI：上排 3 张数字卡；下排 4 张整行或 2×2，同一行强制等高对齐 */
.pay-kpi { display: grid; gap: 12px; margin-bottom: 18px; }

/* —— 上排：3 张数字卡，始终一行，等高 —— */
.pay-kpi-row-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  align-items: stretch;   /* 同一行拉平，避免第一张矮一截 */
}
.pay-kpi-row-3 > .kpi-card {
  height: auto; min-height: 0; margin: 0;
  padding: 12px 14px;
  display: flex; flex-direction: column;
}

/* —— 下排：4 张卡 —— */
/* 默认（≥1101px）：一行四列，等高 */
/* 前 3 张数字卡等宽，锁账卡内容多给一点宽度（1:1:1:1.25） */
.pay-kpi-row-4 {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.22fr);
  gap: 12px;
  align-items: stretch;
}
.pay-kpi-row-4 > .kpi-card {
  height: auto; min-height: 0; margin: 0;
  padding: 12px 14px;
  display: flex; flex-direction: column;
}
/* 数字卡内容靠上，底部说明贴底，视觉上与锁账卡对齐 */
.pay-kpi-row-3 > .kpi-card .kpi-meta,
.pay-kpi-row-4 > .kpi-card:not(.lock-inline-card) .kpi-meta { margin-top: auto; padding-top: 8px; }
.pay-kpi-row-3 > .kpi-card .kpi-value,
.pay-kpi-row-4 > .kpi-card:not(.lock-inline-card) .kpi-value { margin-top: 10px; }

/* ≤1100px：切成 2×2（绝不留 3+1） */
@media (max-width: 1100px) {
  .pay-kpi-row-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* ≤680px：单列，四张卡依次竖排 */
@media (max-width: 680px) {
  .pay-kpi-row-3 { grid-template-columns: minmax(0, 1fr); }
  .pay-kpi-row-4 { grid-template-columns: minmax(0, 1fr); }
}

/* 工资页数字统一字号，避免 vw 放大把卡片撑得忽高忽低 */
.pay-kpi-row-3 > .kpi-card .kpi-value,
.pay-kpi-row-4 > .kpi-card .kpi-value { font-size: 26px; line-height: 1.1; }
.pay-kpi-row-3 > .kpi-card .kpi-label,
.pay-kpi-row-4 > .kpi-card .kpi-label { font-size: 10.5px; }

/* 第 4 张卡：门店锁账与发放（与其它卡同款白底、同高） */
.lock-inline-card { display: flex; flex-direction: column; }
.lock-inline-card .kpi-icon { color: var(--gold); background: var(--gold-soft); }
/* 门店条目：左名称+日期 / 右状态+按钮，两行压成一条半，减少高度 */
.lock-inline-body { flex: 1; margin-top: 8px; display: grid; gap: 0; align-content: start; }
.lock-inline-row {
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  padding: 6px 0; border-bottom: 1px dashed rgba(23,33,31,.07);
  flex-wrap: wrap;
}
.lock-inline-row:last-of-type { border-bottom: 0; }
.lock-inline-main { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.lock-inline-side { display: flex; align-items: center; gap: 5px; flex: 0 1 auto; flex-wrap: wrap; justify-content: flex-end; margin-left: auto; }
.lock-inline-name { font-size: 11.5px; font-weight: 700; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lock-inline-sub { font-size: 9.5px; color: var(--muted); line-height: 1.3; white-space: nowrap; }
.lock-inline-btns { display: inline-flex; gap: 4px; flex-wrap: nowrap; margin: 0; }
.lock-inline-btns .btn { height: 20px; padding: 0 6px; font-size: 9.5px; border-radius: 5px; white-space: nowrap; }
.lock-inline-card { overflow: hidden; }
.lock-inline-card .kpi-meta { margin-top: auto; padding-top: 7px; font-size: 9.5px; }
.kpi-card {
  position: relative;
  min-height: 126px;
  padding: 16px 17px;
  overflow: hidden;
  border-radius: var(--radius-sm);
  background: var(--card);
  border: 1px solid rgba(23,33,31,.075);
  box-shadow: var(--shadow-sm);
}
.kpi-card::after {
  content: "";
  position: absolute;
  width: 80px;
  height: 80px;
  right: -28px;
  bottom: -38px;
  border-radius: 50%;
  background: var(--kpi-tint, rgba(31,107,88,.06));
}
.kpi-card.gold { --kpi-tint: rgba(197,139,41,.09); }
.kpi-card.coral { --kpi-tint: rgba(185,85,71,.08); }
.kpi-card.blue { --kpi-tint: rgba(61,111,142,.08); }
.kpi-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.kpi-label { font-size: 11px; color: var(--muted); font-weight: 600; letter-spacing: .02em; }
.kpi-icon { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 7px; color: var(--emerald); background: var(--emerald-soft); }
.kpi-icon.gold { color: var(--gold); background: var(--gold-soft); }
.kpi-icon.coral { color: var(--coral); background: var(--coral-soft); }
.kpi-icon.blue { color: var(--blue); background: var(--blue-soft); }
.kpi-icon svg { width: 14px; height: 14px; }
.kpi-value { margin-top: 13px; font-family: var(--font-num); font-size: clamp(23px, 2.1vw, 31px); font-weight: 700; letter-spacing: .015em; line-height: 1; font-variant-numeric: tabular-nums; }
.kpi-value small { font-family: var(--font-ui); font-size: 11px; font-weight: 600; color: var(--muted); margin-left: 3px; }
.kpi-meta { display: flex; align-items: center; gap: 6px; margin-top: 10px; font-size: 10px; color: var(--muted); }
/* 近 6 个月迷你趋势线 */
.kpi-trend { margin-top: 10px; line-height: 0; opacity: .9; }
.kpi-trend svg { width: 100%; height: 26px; display: block; }
.kpi-meta .up { color: var(--emerald); font-weight: 700; }
.kpi-meta .down { color: var(--coral); font-weight: 700; }

.two-col { display: grid; grid-template-columns: minmax(0, 1.38fr) minmax(320px, .82fr); gap: 15px; }
.two-col.equal { grid-template-columns: repeat(2, minmax(0, 1fr)); }
/* 经营总览：图表 + 列表组合统一 6:4（左图右表），与等分栅格同属 12 栏体系 */
.two-col.ratio-64 { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
@media (max-width: 1180px) { .two-col.ratio-64 { grid-template-columns: minmax(0, 1fr); } }
.three-col { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; }
.stack { display: flex; flex-direction: column; gap: 15px; }
.panel {
  padding: 18px;
  border-radius: var(--radius);
  background: var(--card);
  border: 1px solid rgba(23,33,31,.075);
  box-shadow: var(--shadow-sm);
  min-width: 0;
}
/* 表头排序 */
.th-sort {
  display: inline-flex; align-items: center; gap: 3px;
  background: none; border: 0; padding: 0; cursor: pointer;
  font: inherit; color: inherit; letter-spacing: inherit;
}
.th-sort:hover { color: var(--emerald); }
.th-sort-icon { font-size: 9px; opacity: .35; line-height: 1; }
th.is-sorted .th-sort { color: var(--emerald); font-weight: 700; }
th.is-sorted .th-sort-icon { opacity: 1; }

/* 全局加载遮罩 */
.app-loading {
  position: fixed; inset: 0; z-index: 9999;
  display: grid; place-items: center;
  background: rgba(246, 248, 252, .82);
  backdrop-filter: blur(2px);
  opacity: 0; pointer-events: none;
  transition: opacity .18s ease;
}
.app-loading.is-on { opacity: 1; pointer-events: auto; }
.app-loading-card {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  padding: 22px 30px; border-radius: 12px;
  background: #fff; box-shadow: 0 10px 40px rgba(23,33,31,.14);
}
.app-loading-spinner {
  width: 26px; height: 26px; border-radius: 50%;
  border: 2.5px solid rgba(31,107,88,.18);
  border-top-color: var(--emerald);
  animation: appSpin .7s linear infinite;
}
@keyframes appSpin { to { transform: rotate(360deg); } }
.app-loading-text { font-size: 12px; color: var(--muted); }

/* 骨架屏：表格加载占位 */
.skeleton-row { height: 38px; border-radius: 6px; background: linear-gradient(90deg, #eef2f7 25%, #f8fafc 37%, #eef2f7 63%); background-size: 400% 100%; animation: skShimmer 1.2s ease-in-out infinite; margin: 6px 12px; }
@keyframes skShimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* 分页条 */
.pager {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  padding: 10px 14px; border-top: 1px solid rgba(23,33,31,.07);
  background: #fbfcfe;
}
.pager-info { font-size: 11px; color: var(--muted); margin-right: auto; }
.pager-info strong { color: var(--ink); font-variant-numeric: tabular-nums; }
.pager-size .select { height: 26px; font-size: 11px; padding: 0 22px 0 8px; }
.pager-btn {
  min-width: 26px; height: 26px; padding: 0 7px;
  border: 1px solid rgba(23,33,31,.12); border-radius: 6px;
  background: #fff; color: var(--ink); font-size: 11.5px; font-variant-numeric: tabular-nums;
  cursor: pointer; transition: background .12s ease, border-color .12s ease;
}
.pager-btn:hover:not(:disabled) { background: var(--emerald-soft); border-color: var(--emerald); }
.pager-btn.is-active { background: var(--emerald); border-color: var(--emerald); color: #fff; font-weight: 700; }
.pager-btn:disabled { opacity: .4; cursor: not-allowed; }
@media (max-width: 640px) {
  .pager { padding: 8px 10px; gap: 4px; }
  .pager-info { width: 100%; margin-bottom: 4px; }
}

.panel.flush { padding: 0; overflow: hidden; }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 15px; }
.panel.flush .panel-head { padding: 18px 18px 0; margin-bottom: 12px; }
.panel-title { margin: 0; font-size: 14px; font-weight: 700; letter-spacing: .01em; }
.panel-sub { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.panel-actions { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.panel-link { border: 0; background: transparent; color: var(--emerald); font-size: 11px; font-weight: 700; padding: 4px 0; }
.panel-link:hover { color: var(--ink); }
.panel-foot { margin-top: 10px; padding-top: 10px; border-top: 1px dashed rgba(23,33,31,.09); text-align: right; }
.bar-hint { font-size: 10px; color: var(--muted); margin: -3px 0 7px 97px; line-height: 1.4; }
/* 待回款明细：逾期档位图例 + 展开收起（仅作用于带图例的面板，避免影响其它 panel-foot） */
.panel-foot.has-bar-legend { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.bar-legend { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 10px; color: var(--muted); }
.bar-legend > span { font-weight: 600; }
.bar-legend i { display: inline-flex; align-items: center; gap: 4px; font-style: normal; }
.bar-legend b { width: 9px; height: 9px; border-radius: 2px; display: inline-block; }

/* Tables */
.table-wrap { width: 100%; overflow: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.data-table th {
  padding: 10px 12px;
  text-align: left;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .06em;
  color: var(--muted);
  background: rgba(23,33,31,.028);
  border-top: 1px solid rgba(23,33,31,.05);
  border-bottom: 1px solid rgba(23,33,31,.07);
  white-space: nowrap;
}
.data-table td { padding: 12px; border-bottom: 1px solid rgba(23,33,31,.06); vertical-align: middle; }
.data-table tbody tr { transition: background .14s ease; }
.data-table tbody tr:hover { background: rgba(31,107,88,.03); }
.data-table tbody tr.clickable { cursor: pointer; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table .num { font-family: var(--font-num); font-variant-numeric: tabular-nums; font-weight: 600; }
.data-table .strong { font-weight: 700; }
.data-table .muted { color: var(--muted); font-size: 11px; }
.data-table .right { text-align: right; }
.data-table .nowrap { white-space: nowrap; }
.data-table .row-title { font-weight: 700; color: var(--ink); }
.data-table .row-sub { margin-top: 2px; color: var(--muted); font-size: 10px; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 22px;
  padding: 0 8px;
  border-radius: 99px;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}
.badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .85; }
.badge.green { color: var(--emerald); background: var(--emerald-soft); }
.badge.gold { color: #9b6c16; background: var(--gold-soft); }
.badge.red { color: var(--coral); background: var(--coral-soft); }
.badge.blue { color: var(--blue); background: var(--blue-soft); }
.badge.violet { color: var(--violet); background: var(--violet-soft); }
.badge.gray { color: var(--ink-3); background: rgba(23,33,31,.06); }
.badge.plain::before { display: none; }
.tag { display: inline-flex; align-items: center; height: 21px; padding: 0 7px; border-radius: 5px; background: rgba(23,33,31,.05); color: var(--ink-3); font-size: 10px; font-weight: 600; }

/* Progress + bars */
.progress { height: 7px; border-radius: 99px; background: rgba(23,33,31,.07); overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: inherit; background: var(--emerald); }
.bar-list { display: flex; flex-direction: column; gap: 11px; }
.bar-row { display: grid; grid-template-columns: 88px minmax(0,1fr) 48px; align-items: center; gap: 9px; font-size: 11px; }
.bar-name { color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-track { height: 7px; background: rgba(23,33,31,.065); border-radius: 99px; overflow: hidden; }
.bar-fill { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--emerald), #4d9b82); }
.bar-fill.gold { background: linear-gradient(90deg, var(--gold), #e1b765); }
.bar-fill.coral { background: linear-gradient(90deg, var(--coral), #d48377); }
.bar-fill.blue { background: linear-gradient(90deg, var(--blue), #78a3bd); }
.bar-value { text-align: right; font-family: var(--font-num); font-weight: 700; color: var(--ink-3); }

/* Charts */
.chart { width: 100%; min-height: 210px; }
.chart svg { width: 100%; height: auto; overflow: visible; }
.chart-legend { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 8px; font-size: 10px; color: var(--muted); }
.legend-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; margin-right: 5px; }
.chart-grid line { stroke: rgba(23,33,31,.07); stroke-width: 1; }
/* 折线图：viewBox 1200，字号与线宽已按比例换算为接近真实像素 */
.chart-axis { fill: var(--muted); font-size: 17px; font-family: var(--font-ui); }
.chart-line { fill: none; stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; }
.chart-area { opacity: .07; }
.chart-point { stroke: var(--card); stroke-width: 1.6; }
.donut-wrap { display: flex; align-items: center; gap: 18px; min-height: 190px; }
.donut { flex: 0 0 158px; width: 158px; height: 158px; }
.donut-center { font-family: var(--font-num); font-size: 20px; font-weight: 700; fill: var(--ink); }
.donut-center-sub { font-family: var(--font-ui); font-size: 9px; fill: var(--muted); }
.donut-legend { display: flex; flex-direction: column; gap: 9px; min-width: 0; }
.donut-legend-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; font-size: 11px; }
.donut-legend-name { color: var(--ink-3); display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.donut-legend-value { font-family: var(--font-num); font-weight: 700; white-space: nowrap; }

/* Timeline */
.timeline { position: relative; display: flex; flex-direction: column; gap: 0; }
.timeline-stage { display: grid; grid-template-columns: 25px minmax(0,1fr); gap: 11px; min-height: 55px; }
.timeline-rail { position: relative; display: flex; justify-content: center; }
.timeline-rail::after { content: ""; position: absolute; top: 18px; bottom: -6px; width: 1px; background: rgba(23,33,31,.11); }
.timeline-stage:last-child .timeline-rail::after { display: none; }
.timeline-dot { position: relative; z-index: 1; width: 11px; height: 11px; margin-top: 3px; border-radius: 50%; border: 2px solid var(--card); background: #c8cec9; box-shadow: 0 0 0 1px rgba(23,33,31,.12); }
.timeline-stage.done .timeline-dot { background: var(--emerald); box-shadow: 0 0 0 1px rgba(31,107,88,.2); }
.timeline-stage.current .timeline-dot { background: var(--gold); box-shadow: 0 0 0 4px rgba(197,139,41,.13); }
.timeline-stage.overdue .timeline-dot { background: var(--coral); box-shadow: 0 0 0 4px rgba(185,85,71,.12); }
.timeline-stage.na .timeline-dot { background: #dfe2dd; }
.timeline-stage.na .timeline-main { opacity: .48; }
.timeline-main { padding: 0 0 16px; min-width: 0; }
.timeline-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.timeline-name { font-size: 12px; font-weight: 700; }
.timeline-date { font-family: var(--font-num); font-size: 10px; color: var(--muted); }
.timeline-note { margin-top: 3px; font-size: 10px; color: var(--muted); }
.timeline-actions { display: flex; align-items: center; gap: 7px; margin-top: 6px; }
.timeline-file { font-size: 10px; color: var(--blue); background: var(--blue-soft); border-radius: 5px; padding: 2px 6px; }

/* Kanban */
.kanban { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.kanban-col { flex: 0 0 238px; min-width: 238px; padding: 10px; border-radius: 14px; background: rgba(23,33,31,.03); border: 1px solid rgba(23,33,31,.045); }
.kanban-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 2px 3px 9px; }
.kanban-title { font-size: 11px; font-weight: 700; }
.kanban-count { min-width: 19px; height: 19px; display: grid; place-items: center; border-radius: 99px; background: rgba(23,33,31,.07); color: var(--ink-3); font-family: var(--font-num); font-size: 10px; }
.kanban-card { margin-bottom: 8px; padding: 11px; border-radius: 11px; background: var(--card); border: 1px solid rgba(23,33,31,.07); box-shadow: 0 1px 2px rgba(23,33,31,.03); cursor: pointer; transition: transform .16s ease, box-shadow .16s ease; }
.kanban-card:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.kanban-card:last-child { margin-bottom: 0; }
.kanban-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.kanban-card-title { font-size: 11px; font-weight: 700; line-height: 1.4; }
.kanban-card-sub { margin-top: 3px; font-size: 9px; color: var(--muted); }
.kanban-card-bottom { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 9px; padding-top: 8px; border-top: 1px dashed rgba(23,33,31,.08); font-size: 9px; color: var(--muted); }
.kanban-card-bottom strong { font-family: var(--font-num); color: var(--ink-3); }
.kanban-empty { padding: 16px 4px; text-align: center; font-size: 10px; color: var(--muted); }

/* Lists */
.list { display: flex; flex-direction: column; }
.list-row { display: flex; align-items: center; justify-content: space-between; gap: 13px; padding: 11px 0; border-bottom: 1px solid rgba(23,33,31,.065); }
.list-row:last-child { border-bottom: 0; padding-bottom: 0; }
.list-row:first-child { padding-top: 0; }
.list-main { min-width: 0; }
.list-title { font-size: 11px; font-weight: 700; }
.list-sub { margin-top: 2px; font-size: 10px; color: var(--muted); }
.list-side { text-align: right; flex: 0 0 auto; }
.list-value { font-family: var(--font-num); font-size: 13px; font-weight: 700; }
.list-row.is-void { opacity: .72; }
.list-row.is-void .list-value { display: flex; align-items: center; gap: 8px; }
.list-row .list-value .btn { margin-left: 8px; }
.list-side small { display: block; margin-top: 2px; font-size: 9px; color: var(--muted); }
.list-row > svg, .data-table td > svg { width: 16px; height: 16px; flex: 0 0 16px; color: var(--muted); }

.notice {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 13px;
  border-radius: 11px;
  background: var(--gold-soft);
  border: 1px solid rgba(197,139,41,.16);
  color: #805a18;
  font-size: 11px;
  line-height: 1.55;
}
.notice.red { background: var(--coral-soft); border-color: rgba(185,85,71,.16); color: #8f3c31; }
.notice.green { background: var(--emerald-soft); border-color: rgba(31,107,88,.14); color: #1c5d4c; }
.notice svg { width: 16px; height: 16px; flex: 0 0 16px; margin-top: 1px; }
.notice strong { font-weight: 700; }

/* Lock cards */
.lock-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 13px; }
.lock-card { padding: 14px; border-radius: 13px; background: var(--card-2); border: 1px solid var(--line); }
.lock-card.locked { background: var(--emerald-soft); border-color: rgba(31,107,88,.14); }
.lock-card.blocked { background: var(--coral-soft); border-color: rgba(185,85,71,.14); }
.lock-top { display: flex; align-items: center; justify-content: space-between; gap: 9px; }
.lock-store { font-size: 12px; font-weight: 700; }
.lock-meta { margin-top: 6px; font-size: 10px; color: var(--muted); line-height: 1.55; }
.lock-actions { margin-top: 11px; display: flex; gap: 7px; flex-wrap: wrap; }

/* Approval */
.approval-steps { display: flex; flex-direction: column; gap: 0; }
.approval-step { display: flex; gap: 10px; min-height: 44px; }
.approval-rail { display: flex; flex-direction: column; align-items: center; width: 17px; }
.approval-dot { width: 9px; height: 9px; margin-top: 3px; border-radius: 50%; background: #cfd5d0; border: 2px solid var(--card); box-shadow: 0 0 0 1px rgba(23,33,31,.11); }
.approval-step.done .approval-dot { background: var(--emerald); }
.approval-step.current .approval-dot { background: var(--gold); box-shadow: 0 0 0 3px rgba(197,139,41,.12); }
.approval-step.rejected .approval-dot { background: var(--coral); }
.approval-rail::after { content: ""; width: 1px; flex: 1; background: rgba(23,33,31,.1); margin: 3px 0; }
.approval-step:last-child .approval-rail::after { display: none; }
.approval-content { padding-bottom: 10px; min-width: 0; }
.approval-title { font-size: 11px; font-weight: 700; }
.approval-text { margin-top: 2px; font-size: 10px; color: var(--muted); }
.approval-comment { margin-top: 4px; font-size: 10px; color: var(--ink-3); background: rgba(23,33,31,.045); padding: 5px 7px; border-radius: 6px; }

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 5vh 18px;
  background: rgba(18, 26, 24, 0.46);
  backdrop-filter: blur(5px);
  animation: fade-in .18s ease both;
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.modal {
  width: min(860px, 100%);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 20px;
  background: var(--card);
  border: 1px solid rgba(255,255,255,.4);
  box-shadow: 0 30px 90px rgba(10,17,15,.3);
  animation: modal-in .22s ease both;
}
.modal.wide { width: min(1120px, 100%); }
.modal.small { width: min(520px, 100%); }
@keyframes modal-in { from { opacity: 0; transform: translateY(10px) scale(.99); } to { opacity: 1; transform: none; } }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 19px 22px 15px; border-bottom: 1px solid var(--line); }
.modal-title { margin: 0; font-family: var(--font-display); font-size: 21px; font-weight: 600; line-height: 1.25; }
.modal-sub { margin-top: 4px; font-size: 11px; color: var(--muted); }
.modal-body { padding: 19px 22px 24px; overflow: auto; }
.modal-foot { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 14px 22px; border-top: 1px solid var(--line); background: rgba(23,33,31,.018); }
.modal-close { width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 9px; background: transparent; color: var(--muted); }
.modal-close:hover { background: rgba(23,33,31,.05); color: var(--ink); }
.modal-close svg { width: 17px; height: 17px; }

/* Forms in modal */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 13px; }
.form-grid .span-2 { grid-column: span 2; }
.form-section { margin: 18px 0 11px; padding-top: 16px; border-top: 1px dashed rgba(23,33,31,.12); }
.form-section:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.form-section-title { margin-bottom: 11px; font-size: 11px; font-weight: 800; letter-spacing: .06em; color: var(--muted); text-transform: uppercase; }
.file-drop {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 46px;
  padding: 9px 11px;
  border: 1px dashed rgba(23,33,31,.18);
  border-radius: 10px;
  background: rgba(23,33,31,.018);
  color: var(--muted);
  font-size: 11px;
}
.file-drop input { max-width: 210px; font-size: 10px; color: var(--ink-3); }
.attachment-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }

/* Detail */
.detail-hero { display: flex; align-items: flex-start; justify-content: space-between; gap: 13px; margin-bottom: 16px; }
.detail-hero h3 { margin: 0; font-size: 18px; }
.detail-hero p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.detail-badges { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.detail-kpis { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 9px; margin-bottom: 16px; }
.mini-kpi { padding: 11px 12px; border-radius: 11px; background: var(--card-2); border: 1px solid var(--line); }
.mini-kpi-label { font-size: 9px; color: var(--muted); font-weight: 600; }
.mini-kpi-value { margin-top: 4px; font-family: var(--font-num); font-size: 17px; font-weight: 700; }
.detail-tabs { display: flex; gap: 3px; padding: 3px; margin-bottom: 16px; border-radius: 10px; background: rgba(23,33,31,.05); overflow-x: auto; }
.detail-tabs button { flex: 0 0 auto; height: 30px; padding: 0 12px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); font-size: 11px; font-weight: 600; }
.detail-tabs button.active { background: var(--card); color: var(--ink); box-shadow: var(--shadow-sm); }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 13px; }
.info-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px 16px; }
.info-item { min-width: 0; }
.info-label { font-size: 9px; color: var(--muted); }
.info-value { margin-top: 2px; font-size: 11px; font-weight: 600; overflow-wrap: anywhere; }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 18px 0 9px; }
.section-title h4 { margin: 0; font-size: 12px; }
.section-title span { font-size: 10px; color: var(--muted); }

/* Toasts */
#toast-root { position: fixed; right: 18px; bottom: 18px; z-index: 200; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast {
  min-width: 240px;
  max-width: 360px;
  padding: 11px 14px;
  border-radius: 11px;
  color: #fff;
  background: #1e2d29;
  box-shadow: 0 12px 35px rgba(15,23,21,.25);
  font-size: 11px;
  line-height: 1.5;
  animation: toast-in .22s ease both;
}
.toast.error { background: #8e3f34; }
.toast.success { background: #1f6b58; }
@keyframes toast-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* 云端保存失败横幅（常驻，不随 toast 消失） */.sync-status {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  z-index: 190;
  width: min(720px, calc(100vw - 32px));
  animation: toast-in .22s ease both;
}
.sync-status[hidden] { display: none; }
.sync-status-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-radius: 12px;
  background: #fff1ee;
  border: 1px solid #f3b7ac;
  box-shadow: 0 12px 32px rgba(142, 63, 52, .18);
}
.sync-status-inner > svg { flex: none; width: 18px; height: 18px; color: #b4392a; }
.sync-status-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1 1 auto; }
.sync-status-text strong { font-size: 12px; font-weight: 700; color: #8e3f34; }
.sync-status-text span { font-size: 11px; color: #9a5a4e; line-height: 1.45; }
.sync-status .sync-status-btn { flex: none; white-space: nowrap; }
/* 横幅出现时给正文留出底部空间，避免遮住分页和表格最后一行 */
body.has-sync-banner { padding-bottom: 76px; }
@media (max-width: 720px) {
  .sync-status { bottom: 10px; width: calc(100vw - 20px); }
  .sync-status-inner { flex-wrap: wrap; padding: 10px 12px; }
  .sync-status-text { flex-basis: calc(100% - 34px); }
  .sync-status .sync-status-btn { width: 100%; }
  body.has-sync-banner { padding-bottom: 118px; }
}

/* Empty */
.empty { padding: 34px 18px; text-align: center; color: var(--muted); }
.empty svg { width: 30px; height: 30px; margin: 0 auto 8px; opacity: .45; }
.empty h4 { margin: 0 0 4px; color: var(--ink-3); font-size: 12px; }
.empty p { margin: 0; font-size: 10px; }

/* Mobile nav */
.mobile-nav { display: none; }

/* Utilities */
.text-muted { color: var(--muted); }
.text-emerald { color: var(--emerald); }
.text-coral { color: var(--coral); }
.text-gold { color: var(--gold); }
.mono { font-family: var(--font-num); font-variant-numeric: tabular-nums; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-4 { gap: 4px; } .gap-6 { gap: 6px; } .gap-8 { gap: 8px; } .gap-10 { gap: 10px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; }
.mt-4 { margin-top: 4px; } .mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; } .mt-20 { margin-top: 20px; }
.mb-0 { margin-bottom: 0; }
.w-full { width: 100%; }
.hidden { display: none !important; }

@media (max-width: 1450px) {
  .kpi-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
}
@media (max-width: 1180px) {
  :root { --sidebar: 216px; }
  .topbar { padding-left: 24px; padding-right: 24px; }
  .content { padding-left: 24px; padding-right: 24px; }
  .two-col { grid-template-columns: minmax(0, 1fr); }
  .three-col { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .detail-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  :root { --sidebar: 0px; }
  .sidebar { display: none; }
  .main-shell { margin-left: 0; padding-bottom: 72px; width: 100%; min-width: 0; max-width: 100%; }
  .content, .page { width: 100%; min-width: 0; max-width: 100%; }
  .topbar { min-height: 74px; padding: 13px 16px 11px; }
  .page-title { font-size: 23px; }
  .page-eyebrow { font-size: 9px; }
  .topbar-actions .role-chip { max-width: 190px; min-width: 0; }
  .topbar-actions .role-chip select { min-width: 0; }
  .content { padding: 18px 16px 30px; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }
  .kpi-card { min-height: 112px; padding: 13px 14px; }
  .kpi-value { font-size: 24px; }
  .three-col { grid-template-columns: minmax(0, 1fr); }
  .two-col.equal { grid-template-columns: minmax(0, 1fr); }
  .lock-grid { grid-template-columns: minmax(0, 1fr); }
  .detail-kpis { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .form-grid .span-2 { grid-column: span 1; }

  .form-grid.deal-form-grid .field-help { display: block; }
  .info-grid { grid-template-columns: minmax(0, 1fr); }
  .mobile-nav {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 40;
    display: flex;
    align-items: stretch;
    justify-content: space-around;
    gap: 2px;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    background: rgba(250,249,245,.94);
    backdrop-filter: blur(18px);
    border-top: 1px solid rgba(23,33,31,.09);
  }
  .mobile-nav button {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-height: 48px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--muted);
    font-size: 9px;
  }
  .mobile-nav button.active { color: var(--emerald); background: var(--emerald-soft); }
  .mobile-nav svg { width: 18px; height: 18px; }
  .modal-backdrop { padding: 0; align-items: stretch; }
  .modal { max-height: 100vh; border-radius: 0; width: 100%; }
  .modal-head { padding: 15px 16px 12px; }
  .modal-body { padding: 15px 16px 22px; }
  .modal-foot { padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); }
  .detail-tabs { position: sticky; top: 0; z-index: 2; background: var(--card); }
  .filter-bar .input { width: 100%; }
  .filter-bar .select { flex: 1; min-width: 116px; }
  .search-wrap { width: 100%; }
  .page-head { flex-direction: column; }
  .page-head-actions { width: 100%; min-width: 0; }
  .page-head-actions .btn { flex: 1; }
  .data-table { min-width: 720px; }
  .table-wrap { margin: 0 -16px; width: calc(100% + 32px); }
  .table-wrap .data-table th:first-child, .table-wrap .data-table td:first-child { padding-left: 16px; }
  .table-wrap .data-table th:last-child, .table-wrap .data-table td:last-child { padding-right: 16px; }
  .chart { min-height: 175px; }
  .donut-wrap { flex-direction: column; align-items: flex-start; }
  .donut { flex: 0 0 auto; }
}
@media (max-width: 560px) {
  .topbar { flex-wrap: wrap; }
  .topbar-actions { width: 100%; justify-content: flex-start; }
  .topbar-actions .role-chip { flex: 1; max-width: none; }
  .topbar-actions .role-chip select { max-width: none; flex: 1; }
  .topbar-actions .btn { flex: 1; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi-card { min-height: 104px; }
  .kpi-value { font-size: 22px; }
  .detail-kpis { grid-template-columns: 1fr 1fr; }
  .bar-row { grid-template-columns: 74px minmax(0,1fr) 40px; }
  .segmented { width: 100%; }
  .segmented button { flex: 1; }
}

.tag-editor { display: grid; gap: 10px; }
.tag-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--card-2);
}
.identity-tag { display: inline-flex; align-items: center; gap: 6px; padding: 5px 7px 5px 10px; }
.tag-remove {
  width: 18px;
  height: 18px;
  display: inline-grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  padding: 0;
  color: inherit;
  background: rgba(23, 33, 31, 0.09);
  font-size: 13px;
  line-height: 1;
}
.tag-remove:hover { color: #fff; background: var(--coral); }
.identity-tag-empty { font-size: 11px; }
.tag-editor-add { display: flex; align-items: center; gap: 8px; }
.tag-editor-add .input { flex: 1; min-width: 0; }
.deduction-editor { display: grid; gap: 10px; }
.deduction-rows { display: grid; gap: 8px; }
.deduction-row {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(140px, 0.8fr) auto;
  align-items: center;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--card-2);
}

@media (max-width: 560px) {
  .tag-editor-add { align-items: stretch; }
  .tag-editor-add .btn { flex: 0 0 auto; }
  .deduction-row { grid-template-columns: minmax(0, 1fr) minmax(110px, 0.7fr); }
  .deduction-row .btn { grid-column: 1 / -1; justify-self: end; }
}

/* 新增业务表单专项断点：900px 以下按 3 列 → 2 列递进，避免过早压成单列 */
@media (max-width: 900px) {
  .form-grid.deal-form-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .form-grid.deal-form-grid .span-4 { grid-column: span 3; }
  .form-grid.deal-form-grid .col-3 { grid-column: span 3; }
}
@media (max-width: 720px) {
  .form-grid.deal-form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid.deal-form-grid .span-3,
  .form-grid.deal-form-grid .span-4,
  .form-grid.deal-form-grid .col-3 { grid-column: span 2; }
}

/* 首屏启动占位：JS 未就绪前遮罩默认显示，渲染完成后隐藏 */
.app-loading.is-on .app-loading-card { animation: none; }

/* 多端编辑冲突提示列表 */
.conflict-list { margin: 0; padding: 0 0 0 18px; display: flex; flex-direction: column; gap: 10px; }
.conflict-list li { font-size: 11px; line-height: 1.55; color: #334155; }
.conflict-list li strong { color: #8e3f34; font-weight: 700; }
.conflict-list .muted { color: #94a3b8; font-size: 10px; }
