:root {
  --bg: #f3f0e8;
  --bg-2: #ece7dc;
  --surface: #fffdf8;
  --surface-2: #f8f5ed;
  --surface-3: #f0ebe0;
  --ink: #18251f;
  --ink-2: #36463d;
  --muted: #737d75;
  --muted-2: #9aa29b;
  --line: #e3ddd1;
  --line-2: #d5cdbe;
  --green: #1e4c3d;
  --green-2: #2e6a55;
  --green-3: #dcebe4;
  --clay: #b96245;
  --clay-2: #d98564;
  --clay-soft: #f3e1d8;
  --gold: #ad832f;
  --gold-soft: #f2e8cf;
  --red: #ad3d31;
  --red-soft: #f6deda;
  --blue: #3d6479;
  --blue-soft: #e0ebf0;
  --shadow: 0 16px 40px rgba(35, 44, 37, .055);
  --shadow-lg: 0 28px 70px rgba(25, 38, 31, .13);
  --radius: 18px;
  --radius-sm: 12px;
  --radius-xs: 9px;
  --sidebar: 244px;
  /* 统一字号与间距 token（精修用，现有硬编码逐步收敛） */
  --fs-xxs: 10px;
  --fs-xs: 11px;
  --fs-sm: 12px;
  --fs-base: 13px;
  --fs-md: 15px;
  --fs-lg: 18px;
  --fs-xl: 24px;
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --serif: "Songti SC", "Noto Serif SC", "Source Han Serif SC", Georgia, serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(1200px 700px at 82% -10%, rgba(197, 165, 105, .14), transparent 60%),
    radial-gradient(900px 600px at -10% 30%, rgba(46, 106, 85, .07), transparent 60%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--green); color: #fff; }

/* ---------------- login ---------------- */
.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.08fr .92fr;
  background: var(--bg);
}
.login-visual {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(800px 500px at 20% 15%, rgba(213, 186, 132, .18), transparent 60%),
    linear-gradient(145deg, #163b30 0%, #1d4b3d 48%, #17382f 100%);
  color: #f4efe2;
  padding: 58px 64px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.login-visual::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,.7), transparent 85%);
}
.login-visual::after {
  content: "";
  position: absolute;
  width: 520px; height: 520px;
  right: -170px; bottom: -220px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, rgba(217,133,100,.55), rgba(185,98,69,.16) 55%, transparent 70%);
  filter: blur(2px);
}
.login-brand { position: relative; z-index: 2; display: flex; gap: 14px; align-items: center; }
.brand-mark {
  width: 42px; height: 42px; border-radius: 13px;
  display: grid; place-items: center;
  background: linear-gradient(145deg, #d8c08c, #b9894a);
  color: #193b30; font-weight: 900; font-size: 15px; letter-spacing: -.5px;
  box-shadow: 0 8px 22px rgba(0,0,0,.18);
}
.brand-logo { width: 44px; height: 44px; object-fit: cover; border-radius: 12px; background: #fff; box-shadow: 0 6px 18px rgba(0,0,0,.16); }
.brand-name { font-family: var(--serif); font-size: 21px; letter-spacing: 3px; }
.brand-sub { font-size: 10px; letter-spacing: 2.4px; opacity: .62; margin-top: 2px; }
.login-copy { position: relative; z-index: 2; max-width: 600px; margin: 40px 0; }
.login-kicker {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid rgba(255,255,255,.2); border-radius: 100px;
  padding: 7px 14px; font-size: 11px; letter-spacing: 1.7px; color: #e8d9b9;
  background: rgba(255,255,255,.04);
}
.login-copy h1 {
  font-family: var(--serif);
  font-size: clamp(38px, 4.2vw, 64px);
  line-height: 1.16; letter-spacing: 2px; font-weight: 700;
  margin: 26px 0 20px;
}
.login-copy h1 em { font-style: normal; color: #d9b97b; }
.login-copy p { font-size: 15px; line-height: 1.9; color: rgba(245,240,228,.72); max-width: 500px; }
.login-stats { position: relative; z-index: 2; display: flex; gap: 42px; }
.login-stat strong { display: block; font-family: var(--serif); font-size: 27px; color: #e9d7ae; }
.login-stat span { display: block; font-size: 11px; letter-spacing: 1px; color: rgba(255,255,255,.52); margin-top: 5px; }
.login-panel {
  display: flex; align-items: center; justify-content: center;
  padding: 42px;
  background:
    radial-gradient(700px 500px at 100% 100%, rgba(185,98,69,.07), transparent 60%),
    var(--surface);
}
.login-box { width: 100%; max-width: 390px; animation: fadeUp .55s ease both; }
.login-box h2 { font-family: var(--serif); font-size: 31px; margin: 0 0 8px; letter-spacing: 1px; }
.login-box > p { color: var(--muted); font-size: 13px; margin: 0 0 30px; }
.field { margin-bottom: 17px; }
.field label { display: block; font-size: 12px; font-weight: 600; color: var(--ink-2); margin-bottom: 8px; }
.field .hint { font-weight: 400; color: var(--muted-2); margin-left: 6px; }
.input, .select, .textarea {
  width: 100%; border: 1px solid var(--line); background: var(--surface);
  border-radius: 11px; padding: 12px 13px; color: var(--ink); outline: none;
  transition: border .2s, box-shadow .2s, background .2s;
}
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--green-2); box-shadow: 0 0 0 4px rgba(46,106,85,.10); background: #fff;
}
.textarea { min-height: 96px; resize: vertical; line-height: 1.6; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent; border-radius: 11px; padding: 11px 16px;
  font-size: 13px; font-weight: 600; transition: transform .15s, box-shadow .2s, background .2s, border .2s;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn > svg { width: 15px; height: 15px; flex: 0 0 15px; }
.more-link > svg { width: 12px; height: 12px; flex: 0 0 12px; }
.hero-action > svg { width: 12px; height: 12px; }
.alert-icon > svg { width: 14px; height: 14px; }
.nav-item > svg { width: 17px; height: 17px; flex: 0 0 17px; }
.mobile-nav svg { width: 17px; height: 17px; }
.ai-btn svg { width: 15px; height: 15px; }
.qc-pass .ring svg { width: 100%; height: 100%; }
.btn-primary { background: var(--green); color: #fff; box-shadow: 0 8px 20px rgba(30,76,61,.18); }
.btn-primary:hover { background: #255a48; }
.btn-clay { background: var(--clay); color: #fff; box-shadow: 0 8px 20px rgba(185,98,69,.18); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--ink-2); }
.btn-ghost:hover { background: var(--surface-2); border-color: var(--line-2); }
.btn-soft { background: var(--surface-2); color: var(--ink-2); border-color: transparent; }
.btn-danger { background: var(--red-soft); color: var(--red); }
.btn-sm { padding: 7px 11px; font-size: 12px; border-radius: 9px; }
.btn-lg { padding: 14px 22px; font-size: 14px; border-radius: 13px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; transform: none; }
.login-submit { width: 100%; margin-top: 6px; padding: 14px; font-size: 14px; }
.login-foot { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.login-foot-title { font-size: 11px; letter-spacing: 1.2px; color: var(--muted-2); margin-bottom: 11px; }
.demo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.demo-user {
  text-align: left; border: 1px solid var(--line); background: var(--surface-2);
  padding: 9px 10px; border-radius: 10px; transition: .2s;
}
.demo-user:hover { border-color: var(--green-2); background: var(--green-3); }
.demo-user strong { display: block; font-size: 12px; }
.demo-user span { font-size: 10px; color: var(--muted); }
.login-error { color: var(--red); font-size: 12px; min-height: 18px; margin: 2px 0 10px; }

/* ---------------- shell ---------------- */
.app-shell { min-height: 100vh; display: flex; }
.sidebar {
  position: fixed; z-index: 30; inset: 0 auto 0 0; width: var(--sidebar);
  background:
    radial-gradient(600px 400px at 0% 0%, rgba(217,185,123,.10), transparent 60%),
    linear-gradient(180deg, #173d32 0%, #14352c 70%, #112d26 100%);
  color: #ece7d9; padding: 24px 16px 18px; display: flex; flex-direction: column;
  border-right: 1px solid rgba(255,255,255,.05);
}
.side-brand { display: flex; align-items: center; gap: 11px; padding: 0 8px 24px; }
.side-brand .brand-mark { width: 38px; height: 38px; border-radius: 11px; font-size: 13px; }
.side-brand .brand-logo { width: 38px; height: 38px; border-radius: 10px; }
.side-brand .brand-name { font-size: 18px; letter-spacing: 2.5px; }
.side-brand .brand-sub { font-size: 9px; letter-spacing: 1.7px; }
.side-section { padding: 16px 10px 7px; font-size: 9px; letter-spacing: 1.8px; color: rgba(236,231,217,.34); }
.nav-list { display: flex; flex-direction: column; gap: 3px; overflow-y: auto; scrollbar-width: none; }
.nav-list::-webkit-scrollbar { display: none; }
.nav-item {
  display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 10px;
  color: rgba(236,231,217,.7); font-size: 13px; transition: .18s; position: relative;
}
.nav-item:hover { color: #fff; background: rgba(255,255,255,.055); }
.nav-item.active { color: #173d32; background: linear-gradient(135deg, #e8dcc0, #d6c49e); font-weight: 700; box-shadow: 0 8px 18px rgba(0,0,0,.18); }
.nav-item svg { width: 17px; height: 17px; stroke-width: 1.7; flex: 0 0 17px; }
.nav-badge { margin-left: auto; background: var(--clay); color: #fff; font-size: 9px; padding: 2px 6px; border-radius: 100px; }
.nav-item.active .nav-badge { background: var(--green); }
.side-foot { margin-top: auto; padding-top: 16px; }
.side-user {
  display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 12px;
  background: rgba(255,255,255,.055); border: 1px solid rgba(255,255,255,.06);
}
.avatar {
  width: 34px; height: 34px; border-radius: 50%; flex: 0 0 34px;
  background: linear-gradient(145deg, #d7bd86, #ac7d3e); color: #173d32;
  display: grid; place-items: center; font-weight: 800; font-size: 12px;
}
.avatar.green { background: linear-gradient(145deg, #8fc7ad, #3f7c64); color: #fff; }
.avatar.clay { background: linear-gradient(145deg, #e3a58b, #b96245); color: #fff; }
.side-user strong { display: block; font-size: 12px; }
.side-user span { display: block; font-size: 10px; color: rgba(236,231,217,.5); }
.icon-btn {
  width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px;
  border: 1px solid transparent; background: transparent; color: var(--muted);
  transition: .18s;
}
.icon-btn:hover { background: var(--surface-2); color: var(--ink); border-color: var(--line); }
.icon-btn svg { width: 17px; height: 17px; }
.main { margin-left: var(--sidebar); width: calc(100% - var(--sidebar)); min-width: 0; }
.topbar {
  height: 72px; position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 16px; padding: 0 32px;
  background: rgba(243,240,232,.82); backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(213,205,190,.55);
}
.topbar-title { min-width: 0; }
.topbar-title .crumb { font-size: 10px; letter-spacing: 1.5px; color: var(--muted-2); text-transform: uppercase; }
.topbar-title h1 { font-size: 18px; margin: 2px 0 0; letter-spacing: .5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-spacer { flex: 1; }
.topbar-actions { display: flex; align-items: center; gap: 7px; }
.ai-btn {
  border: 1px solid rgba(30,76,61,.18); background: linear-gradient(135deg, rgba(30,76,61,.06), rgba(185,98,69,.06));
  color: var(--green); padding: 8px 13px; border-radius: 10px; font-size: 12px; font-weight: 700;
  display: inline-flex; align-items: center; gap: 7px;
}
.ai-btn:hover { background: var(--green); color: #fff; }
.ai-btn .spark { color: var(--clay); }
.ai-btn:hover .spark { color: #f0c9a8; }
.bell { position: relative; }
.bell-dot {
  position: absolute; top: 5px; right: 5px; width: 7px; height: 7px; border-radius: 50%;
  background: var(--clay); box-shadow: 0 0 0 2px var(--bg);
}
.page { padding: 28px 32px 56px; max-width: 1560px; margin: 0 auto; animation: fadeUp .35s ease both; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 22px; }
.eyebrow { font-size: 10px; letter-spacing: 2px; color: var(--clay); font-weight: 800; text-transform: uppercase; margin: 0 0 7px; }
.page-head h1 { font-family: var(--serif); font-size: 30px; letter-spacing: 1px; margin: 0; font-weight: 700; }
.page-head p { color: var(--muted); font-size: 12.5px; margin: 7px 0 0; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------------- common ---------------- */
.panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
}
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 19px 21px 13px; }
.panel-head h3 { margin: 0; font-size: 14px; letter-spacing: .3px; }
.panel-head p { margin: 4px 0 0; font-size: 11px; color: var(--muted); }
.panel-body { padding: 0 21px 20px; }
.panel-body.pad { padding: 20px 21px; }
.more-link { font-size: 11px; color: var(--green-2); font-weight: 700; display: inline-flex; align-items: center; gap: 4px; }
.more-link:hover { color: var(--clay); }
.grid-2 { display: grid; grid-template-columns: 1.45fr 1fr; gap: 16px; margin-top: 16px; }
.grid-2.equal { grid-template-columns: 1fr 1fr; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 16px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.mt-16 { margin-top: 16px; }
.mt-22 { margin-top: 22px; }
.muted { color: var(--muted); }
.tiny { font-size: 10.5px; }
.mono { font-variant-numeric: tabular-nums; }
.divider { height: 1px; background: var(--line); margin: 14px 0; }
.pill {
  display: inline-flex; align-items: center; gap: 5px; padding: 4px 8px; border-radius: 100px;
  font-size: 10px; font-weight: 700; line-height: 1; letter-spacing: .2px;
}
.pill.green { background: var(--green-3); color: var(--green); }
.pill.clay { background: var(--clay-soft); color: var(--clay); }
.pill.gold { background: var(--gold-soft); color: var(--gold); }
.pill.red { background: var(--red-soft); color: var(--red); }
.pill.blue { background: var(--blue-soft); color: var(--blue); }
.pill.gray { background: var(--surface-3); color: var(--muted); }
.sales-dense .pill { white-space: nowrap; padding: 3px 5px; font-size: 9px; }
.dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; }
.dot.green { background: var(--green-2); }
.dot.clay { background: var(--clay); }
.dot.red { background: var(--red); }
.dot.gold { background: var(--gold); }

/* ---------------- dashboard ---------------- */
.hero-grid { display: grid; grid-template-columns: 1.55fr .8fr; gap: 16px; }
.ai-hero {
  position: relative; overflow: hidden; border-radius: var(--radius);
  background:
    radial-gradient(600px 300px at 100% 0%, rgba(217,185,123,.18), transparent 60%),
    linear-gradient(135deg, #1b4639 0%, #173a30 55%, #1b4035 100%);
  color: #f4efe4; padding: 24px 27px; min-height: 218px; box-shadow: var(--shadow-lg);
}
.ai-hero::after {
  content: ""; position: absolute; width: 300px; height: 300px; right: -90px; bottom: -150px;
  border-radius: 50%; background: radial-gradient(circle, rgba(217,133,100,.35), transparent 70%);
}
.ai-hero-top { position: relative; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ai-chip { display: inline-flex; align-items: center; gap: 7px; font-size: 10px; letter-spacing: 1.5px; color: #e5cfa5; border: 1px solid rgba(229,207,165,.25); padding: 5px 10px; border-radius: 100px; background: rgba(255,255,255,.04); }
.ai-chip .pulse { width: 6px; height: 6px; border-radius: 50%; background: #8fd3b1; box-shadow: 0 0 0 0 rgba(143,211,177,.6); animation: pulse 2s infinite; }
.health-mini { font-size: 10px; color: rgba(244,239,228,.55); }
.ai-hero h2 { position: relative; z-index: 2; font-family: var(--serif); font-size: clamp(20px, 2.2vw, 28px); line-height: 1.45; font-weight: 600; letter-spacing: .3px; margin: 18px 0 8px; max-width: 780px; }
.ai-hero p { position: relative; z-index: 2; color: rgba(244,239,228,.64); font-size: 12px; line-height: 1.85; margin: 0; max-width: 800px; }
.hero-actions { position: relative; z-index: 2; display: flex; gap: 8px; flex-wrap: wrap; margin-top: 18px; }
.hero-action { background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.12); color: #efe8d9; padding: 6px 10px; border-radius: 8px; font-size: 10.5px; }
.hero-action:hover { background: rgba(255,255,255,.14); }
.health-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 19px; display: flex; flex-direction: column; justify-content: space-between; }
.health-top { display: flex; align-items: center; justify-content: space-between; }
.health-top h3 { font-size: 13px; margin: 0; }
.health-ring-wrap { display: flex; align-items: center; gap: 14px; margin: 8px 0; }
.health-ring { width: 108px; height: 108px; position: relative; flex: 0 0 108px; }
.health-ring svg { transform: rotate(-90deg); width: 108px; height: 108px; }
.health-ring .val { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.health-ring .val strong { font-family: var(--serif); font-size: 27px; line-height: 1; display: block; }
.health-ring .val span { font-size: 9px; color: var(--muted); }
.health-copy { font-size: 11px; line-height: 1.7; color: var(--muted); }
.health-copy strong { color: var(--ink); }
.health-bars { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.health-bar-row { display: flex; align-items: center; gap: 8px; font-size: 9.5px; color: var(--muted); }
.health-bar-row span:first-child { width: 48px; flex: 0 0 48px; }
.bar-track { height: 5px; border-radius: 100px; background: var(--surface-3); flex: 1; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 100px; background: var(--green-2); }
.bar-fill.clay { background: var(--clay); }
.bar-fill.gold { background: var(--gold); }

.kpi-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; margin-top: 16px; }
.kpi {
  background: var(--surface); border: 1px solid var(--line); border-radius: 15px; padding: 15px 15px 13px;
  box-shadow: var(--shadow); position: relative; overflow: hidden; min-height: 112px;
}
.kpi::after { content: ""; position: absolute; right: -18px; top: -22px; width: 76px; height: 76px; border-radius: 50%; background: var(--green-3); opacity: .55; }
.kpi.clay::after { background: var(--clay-soft); }
.kpi.gold::after { background: var(--gold-soft); }
.kpi.red::after { background: var(--red-soft); }
.kpi-label { font-size: 10.5px; color: var(--muted); display: flex; align-items: center; gap: 5px; }
.kpi-value { font-family: var(--serif); font-size: 24px; letter-spacing: -.4px; margin-top: 11px; line-height: 1.1; position: relative; z-index: 2; }
.kpi-value small { font-family: var(--font); font-size: 10px; color: var(--muted); margin-left: 3px; letter-spacing: 0; }
.kpi-sub { font-size: 10px; color: var(--muted); margin-top: 8px; display: flex; align-items: center; gap: 5px; position: relative; z-index: 2; }
.kpi-sub .up { color: var(--red); }
.kpi-sub .down { color: var(--green-2); }

.trend-legend { display: flex; gap: 13px; font-size: 10px; color: var(--muted); }
.trend-legend i { width: 7px; height: 7px; border-radius: 2px; display: inline-block; margin-right: 4px; }
.chart-wrap { width: 100%; overflow: hidden; }
.chart-wrap svg { width: 100%; height: auto; display: block; }
.chart-empty { padding: 36px 10px; text-align: center; color: var(--muted-2); font-size: 12px; }

.alert-list { display: flex; flex-direction: column; gap: 8px; }
.alert-item {
  display: flex; gap: 10px; padding: 10px 11px; border-radius: 10px; background: var(--surface-2);
  border: 1px solid transparent; transition: .18s; cursor: pointer;
}
.alert-item:hover { border-color: var(--line-2); background: #fff; transform: translateX(2px); }
.alert-item > svg { width: 14px; height: 14px; flex: 0 0 14px; color: var(--muted-2); }
.alert-icon { width: 27px; height: 27px; border-radius: 8px; display: grid; place-items: center; flex: 0 0 27px; font-size: 12px; }
.alert-icon.danger { background: var(--red-soft); color: var(--red); }
.alert-icon.warning { background: var(--gold-soft); color: var(--gold); }
.alert-icon.info { background: var(--green-3); color: var(--green); }
.alert-main { min-width: 0; flex: 1; }
.alert-title { font-size: 11.5px; font-weight: 600; line-height: 1.45; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.alert-desc { font-size: 10px; color: var(--muted); margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.alert-time { font-size: 9px; color: var(--muted-2); margin-left: auto; flex: 0 0 auto; }

.mini-table { width: 100%; border-collapse: collapse; }
.mini-table th { font-size: 9.5px; letter-spacing: .4px; color: var(--muted-2); font-weight: 600; text-align: left; padding: 0 0 9px; border-bottom: 1px solid var(--line); }
.mini-table td { padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 11.5px; vertical-align: middle; }
.mini-table tr:last-child td { border-bottom: 0; }
.mini-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.mini-table .bar-cell { width: 86px; }
.revbar { height: 5px; background: var(--surface-3); border-radius: 100px; overflow: hidden; }
.revbar i { display: block; height: 100%; background: linear-gradient(90deg, var(--green-2), #6d9a81); border-radius: 100px; }
.cust-name { display: flex; align-items: center; gap: 8px; }
.cust-avatar { width: 24px; height: 24px; border-radius: 7px; background: var(--surface-3); display: grid; place-items: center; font-size: 9px; font-weight: 700; color: var(--green); flex: 0 0 24px; }

.task-mini { display: flex; flex-direction: column; gap: 9px; }
.task-mini-item { display: flex; align-items: flex-start; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.task-mini-item:last-child { border-bottom: 0; }
.task-check { width: 16px; height: 16px; border-radius: 5px; border: 1.5px solid var(--line-2); margin-top: 1px; flex: 0 0 16px; display: grid; place-items: center; color: transparent; font-size: 9px; }
.task-mini-item:hover .task-check { border-color: var(--green-2); color: var(--green-2); }
.task-mini-main { min-width: 0; flex: 1; }
.task-mini-title { font-size: 11.5px; font-weight: 600; line-height: 1.4; }
.task-mini-meta { font-size: 9.5px; color: var(--muted); margin-top: 3px; display: flex; gap: 8px; }
.data-note { margin-top: 18px; padding: 12px 15px; border-radius: 10px; background: rgba(255,253,248,.55); border: 1px dashed var(--line-2); font-size: 10px; color: var(--muted); line-height: 1.7; }
.data-note strong { color: var(--ink-2); }

/* ---------------- toolbar / table ---------------- */
.toolbar { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-bottom: 14px; }
.search-box { position: relative; min-width: 230px; flex: 1; max-width: 340px; }
.search-box svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--muted-2); }
.search-box .input { padding-left: 34px; background: var(--surface); }
.select-sm { width: auto; min-width: 100px; padding: 9px 30px 9px 11px; font-size: 12px; background: var(--surface); }
.toolbar-spacer { flex: 1; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tab { padding: 10px 15px; border: 0; background: transparent; color: var(--muted); font-size: 12px; font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tab:hover { color: var(--ink); }
.tab.active { color: var(--green); border-bottom-color: var(--green); }
.table-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: auto; }
.data-table { width: 100%; border-collapse: collapse; min-width: 760px; }
.data-table th {
  text-align: left; font-size: 9.5px; letter-spacing: .5px; color: var(--muted-2); font-weight: 700;
  padding: 12px 13px; background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap;
}
.data-table td { padding: 12px 13px; border-bottom: 1px solid var(--line); font-size: 11.5px; vertical-align: middle; }
.data-table tbody tr { transition: background .15s; cursor: pointer; }
.data-table tbody tr:hover { background: #fbf8f1; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.data-table .strong { font-weight: 700; }
.data-table .sub { font-size: 9.5px; color: var(--muted); margin-top: 3px; }
.qc-table-wrap { max-height: calc(100vh - 150px); overflow: auto; }
.qc-full-table { width: 100%; font-size: 12.5px; border-collapse: separate; border-spacing: 0; }
.qc-full-table th, .qc-full-table td { padding: 9px 10px !important; }
body:has(.qc-full-table) .page { max-width: none; padding-left: 16px; padding-right: 16px; }
/* 表头：吸顶 + 分组配色 */
.qc-full-table thead th {
  position: sticky; top: 0; z-index: 5; background: #efeae0;
  color: var(--ink); font-size: 10.5px; letter-spacing: .4px; font-weight: 700;
  box-shadow: inset 0 -1px 0 var(--line-2), 0 3px 6px rgba(0,0,0,.05);
}
/* 固定列基础：吸边 + 不透明背景（否则滚动时文字会透叠） */
.qc-full-table .qc-pin { position: sticky; background: var(--surface); z-index: 3; }
.qc-full-table thead th.qc-pin { z-index: 8; background: #efeae0; }
/* 左侧固定列之间的细分隔线 */
.qc-full-table .qc-pin-l { box-shadow: inset -1px 0 0 var(--line); }
/* 分界列（结论 / 操作）：加阴影强调「固定区 | 滚动区」边界 */
.qc-full-table .qc-pin-edge { box-shadow: inset -1px 0 0 var(--line-2), 4px 0 10px -4px rgba(24,37,31,.18); }
.qc-full-table .qc-pin-r.qc-pin-edge { box-shadow: inset 1px 0 0 var(--line-2), -4px 0 10px -4px rgba(24,37,31,.18); }
/* hover 时固定列同步高亮，避免滚动区变色而固定区不变 */
.qc-full-table tbody tr:hover td.qc-pin { background: #fbf8f1; }
/* 斑马纹，弱化大量空"—"的视觉噪音 */
.qc-full-table tbody tr:nth-child(even) td { background: #fcfaf5; }
.qc-full-table tbody tr:nth-child(even) td.qc-pin { background: #fcfaf5; }
.qc-full-table tbody tr:nth-child(even):hover td.qc-pin { background: #fbf8f1; }
.qc-full-table td.muted { max-width: 220px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qc-full-table td { white-space: nowrap; }
.qc-full-table td.mono { color: var(--muted); font-size: 11.5px; }
.qc-full-table td.strong { font-size: 12.5px; }
/*表格脚注*/
.qc-table-wrap .table-foot { position: sticky; left: 0; }
.sales-dense-wrap { max-height: 72vh; overflow: auto; }
.ledger-page .sales-dense-wrap { max-height: calc(100vh - 250px); }
.sales-dense { min-width: 1672px; table-layout: fixed; font-size: 10px; }
.sales-dense th, .sales-dense td { padding: 5px 4px !important; vertical-align: middle; }
.sales-dense thead th { white-space: normal !important; line-height: 1.25; font-size: 12.5px; font-weight: 700; }
body.ledger-mode .sidebar { display: none; }
body.ledger-mode .main { margin-left: 0; width: 100%; }
body.ledger-mode .topbar { display: none; }
body.ledger-mode .page { padding: 0; max-width: none; margin: 0; width: 100%; }
body.ledger-mode .ledger-page { width: 100%; padding: 6px 0 0; }
body.ledger-mode .ledger-page .sales-dense-wrap { max-height: calc(100vh - 62px); }
body.ledger-mode .sales-dense { min-width: 1672px; width: 100%; font-size: 11.5px; }

/* 财务会计嵌入：占满内容区，隐藏外壳 page 内边距，iframe 自适应高度 */
body.embed-mode .page { padding: 0; max-width: none; margin: 0; width: 100%; }
.fin-embed-wrap { width: 100%; height: calc(100vh - 72px); overflow: hidden; }
.fin-embed-frame { width: 100%; height: 100%; border: 0; display: block; background: #f4f1ea; }
body.embed-mode .demo-banner + .page .fin-embed-wrap { height: calc(100vh - 72px - 36px); }
.sales-dense thead th { position: sticky; top: 0; z-index: 5; background: #f1eee6; box-shadow: inset 0 -1px 0 var(--line), 0 2px 5px rgba(0,0,0,.06); }
.sales-dense th:first-child, .sales-dense td:first-child { position: sticky; left: 0; z-index: 4; background: #fff; box-shadow: 1px 0 0 var(--line); }
.sales-dense thead th:first-child { z-index: 6; background: #f1eee6; }
.sales-dense td { white-space: nowrap; }
.sales-dense td:nth-child(23), .sales-dense td:nth-child(24) { overflow: hidden; text-overflow: ellipsis; color: var(--muted); }
.sales-dense tr.month-divider td { background: #e9e2d1; color: #3c3a33; font-size: 10px; padding: 6px 8px !important; border-top: 2px solid #c9bda3; border-bottom: 1px solid #c9bda3; }
.sales-dense tr.month-divider { cursor: default; }
.customer-link { border: 0; background: transparent; color: var(--green); font: inherit; font-weight: 700; padding: 0; cursor: pointer; text-align: left; }
.customer-link:hover { text-decoration: underline; }
.stat-card.clickable { cursor: pointer; text-align: left; font: inherit; width: 100%; color: inherit; }
.stat-card.clickable:hover { border-color: var(--green-2); transform: translateY(-1px); }
.fin-card.clickable { cursor: pointer; text-align: left; font: inherit; width: 100%; color: inherit; }
.fin-card.clickable:hover { border-color: var(--green-2); }
.finance-formula { display: flex; flex-direction: column; gap: 6px; }
.finance-formula > div { display: grid; grid-template-columns: 1.2fr auto; gap: 3px 12px; padding: 7px 9px; border-bottom: 1px solid var(--line); }
.finance-formula > div span { font-size: 12px; color: var(--muted); }
.finance-formula > div b { font-size: 14px; text-align: right; }
.finance-formula > div small { grid-column: 1 / -1; font-size: 10px; color: var(--muted); }
.finance-formula > div.total { background: #f6f1e5; border-radius: 6px; border-bottom: 0; }
.sales-dense tr.month-divider strong { font-size: 11px; letter-spacing: .3px; }
body.ledger-mode .sales-dense-wrap { border: 0; box-shadow: none; background: transparent; }
body.ledger-mode .sales-dense th, body.ledger-mode .sales-dense td { border: 0; border-bottom: 1px solid rgba(30,76,61,.08); padding: 7px 5px !important; }
body.ledger-mode .sales-dense thead th { background: #f3efe5; font-size: 12.5px; font-weight: 700; border-bottom: 1px solid #d8cfbb; box-shadow: none; }
body.ledger-mode .sales-dense tr.month-divider td { font-size: 11.5px; }
body.ledger-mode .sales-dense tbody tr:nth-child(even) td { background: rgba(255,255,255,.38); }
body.ledger-mode .sales-dense tbody tr:hover td { background: #f6f1e4; }
body.ledger-mode .table-foot { border: 0; box-shadow: none; background: transparent; }
@media (min-width: 1700px) {
  body.ledger-mode .sales-dense-wrap { scrollbar-width: none; -ms-overflow-style: none; }
  body.ledger-mode .sales-dense-wrap::-webkit-scrollbar { width: 0; height: 0; display: none; }
}
.hr-salary-table th:first-child, .hr-salary-table td:first-child { position: sticky; left: 0; z-index: 3; background: #fff; }
.hr-salary-table thead th:first-child { z-index: 5; background: #f1eee6; }
.hr-salary-table th:last-child, .hr-salary-table td:last-child { position: sticky; right: 0; z-index: 4; background: #fff; box-shadow: -1px 0 0 var(--line); }
.hr-salary-table thead th:last-child { z-index: 6; background: #f1eee6; }
.table-foot { display: flex; align-items: center; justify-content: space-between; padding: 11px 14px; border-top: 1px solid var(--line); font-size: 10.5px; color: var(--muted); background: var(--surface); }
.pager { display: flex; gap: 5px; }
.pager button { border: 1px solid var(--line); background: var(--surface); width: 26px; height: 26px; border-radius: 7px; font-size: 10px; }
.pager button:hover { border-color: var(--green-2); }
.pager button.active { background: var(--green); color: #fff; border-color: var(--green); }
.status-dot { display: inline-flex; align-items: center; gap: 5px; font-size: 10.5px; }
.status-dot i { width: 6px; height: 6px; border-radius: 50%; display: inline-block; background: var(--muted-2); }
.status-dot.green i { background: var(--green-2); }
.status-dot.red i { background: var(--red); }
.status-dot.gold i { background: var(--gold); }
.status-dot.clay i { background: var(--clay); }
.inline-actions { display: flex; gap: 5px; }
.empty { padding: 52px 20px; text-align: center; color: var(--muted-2); }
.empty strong { display: block; color: var(--ink-2); font-size: 14px; margin-bottom: 6px; }
.empty p { margin: 0; font-size: 11px; }

/* ---------------- inventory / qc ---------------- */
.inv-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.shipment-hero { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 16px; padding: 18px 20px; border-radius: 16px; background: linear-gradient(135deg, #1e4c3d, #2c6b55); color: #f5f1e8; }
.shipment-hero span { display: block; font-size: 11px; opacity: .72; letter-spacing: .5px; }
.shipment-hero strong { display: block; font-family: var(--serif); font-size: 30px; line-height: 1.15; margin-top: 7px; }
.shipment-hero small { font-size: 13px; font-family: var(--sans); opacity: .75; }
.type-check-grid { display: flex; flex-wrap: wrap; gap: 7px; }
.type-check { display: inline-flex; align-items: center; gap: 5px; padding: 6px 9px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); font-size: 11px; cursor: pointer; }
.type-check input { accent-color: var(--green); }
.check-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.check-item { display: inline-flex; align-items: center; gap: 5px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface-2); font-size: 11px; cursor: pointer; }
.check-item input { accent-color: var(--green); }
.qc-meta-strip { display:flex; flex-wrap:wrap; gap:8px 18px; padding:10px 14px; margin-bottom:12px; background:var(--surface-2); border:1px solid var(--line); border-radius:8px; font-size:12px; }
.qc-meta-strip span { color:var(--muted); }
.qc-meta-strip b { color:var(--ink); font-weight:600; margin-right:6px; }
.qc-board { display:grid; grid-template-columns:1fr 1fr; gap:0; padding:0; overflow:hidden; }
.qc-board-section { padding:14px 16px; }
.qc-board-section + .qc-board-section { border-left:1px solid var(--line); }
.qc-board-title { font-size:15px; font-weight:700; margin-bottom:8px; color:var(--green-2); }
.qc-board-horizontal { padding:12px 14px; }
.qc-horizontal-group + .qc-horizontal-group { margin-top:12px; padding-top:12px; border-top:1px solid var(--line); }
.qc-horizontal-scroll { overflow-x:auto; }
.qc-horizontal-grid { display:grid; gap:0; min-width:max-content; border:1px solid var(--line); border-radius:8px; overflow:hidden; }
.qc-h-label { padding:8px 10px; background:var(--surface-2); color:var(--muted); font-size:11px; text-align:center; border-bottom:1px solid var(--line); white-space:nowrap; }
.qc-h-value { padding:10px 10px 12px; font-size:19px; font-weight:600; text-align:center; color:var(--ink); white-space:nowrap; }
.qc-metric-table { display:flex; flex-direction:column; }
.qc-metric-row { display:flex; justify-content:space-between; align-items:baseline; gap:12px; padding:8px 4px; border-bottom:1px solid #eee; }
.qc-metric-row span { font-size:12px; color:var(--muted); }
.qc-metric-row strong { font-size:18px; font-weight:600; color:var(--ink); }
.qc-compare-picker { display:flex; flex-wrap:wrap; gap:5px; max-height:92px; overflow:auto; }
.qc-trend-svg { width:100%; height:220px; background:#fbf8f1; border:1px solid var(--line); border-radius:10px; }
.qc-legend { display:flex; flex-wrap:wrap; gap:12px; margin-top:8px; font-size:11px; color:var(--muted); }
.qc-legend i { display:inline-block; width:10px; height:3px; border-radius:2px; margin-right:5px; vertical-align:middle; }

/* ===== 检测详情 · 指标看板（卡片式，2026-11-19 美化） ===== */
.qc-metric-board { display:grid; grid-template-columns:1fr 1fr; gap:16px; margin-bottom:16px; }
.qc-metric-panel { background:var(--surface-1, #fff); border:1px solid var(--line); border-radius:14px; padding:18px 20px 20px; box-shadow:0 2px 10px rgba(30,76,61,.05); }
.qc-metric-panel-head { display:flex; align-items:center; gap:9px; margin-bottom:16px; padding-bottom:12px; border-bottom:2px solid var(--green-3); }
.qc-metric-panel-head h3 { margin:0; font-size:16px; font-weight:700; color:var(--green); letter-spacing:.5px; }
.qc-metric-panel-icon { display:inline-flex; align-items:center; justify-content:center; width:26px; height:26px; border-radius:8px; font-size:15px; background:var(--green-3); color:var(--green); }
.qc-metric-panel.chem .qc-metric-panel-icon { background:var(--clay-soft); color:var(--clay); }
.qc-metric-panel.chem .qc-metric-panel-head { border-bottom-color:var(--clay-soft); }
.qc-metric-panel.chem .qc-metric-panel-head h3 { color:var(--clay); }
.qc-metric-panel-count { margin-left:auto; font-size:11px; color:var(--muted); background:var(--surface-2); padding:3px 9px; border-radius:12px; }
.qc-metric-cards { display:grid; grid-template-columns:repeat(auto-fill, minmax(104px, 1fr)); gap:10px; }
.qc-metric-card { background:var(--surface-2); border:1px solid var(--line); border-radius:10px; padding:12px 8px 14px; text-align:center; transition:transform .12s ease, box-shadow .12s ease, border-color .12s ease; }
.qc-metric-card:hover { transform:translateY(-2px); box-shadow:0 4px 12px rgba(30,76,61,.09); }
.qc-metric-card.has-value { background:linear-gradient(180deg, var(--green-3), var(--surface-1, #fff)); border-color:var(--green-3); }
.qc-metric-panel.chem .qc-metric-card.has-value { background:linear-gradient(180deg, var(--clay-soft), var(--surface-1, #fff)); border-color:var(--clay-soft); }
.qc-metric-card-label { font-size:12px; color:var(--muted); margin-bottom:8px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.qc-metric-card-value { font-size:23px; font-weight:700; color:var(--muted-2); line-height:1.1; font-variant-numeric:tabular-nums; }
.qc-metric-card.has-value .qc-metric-card-value { color:var(--green); }
.qc-metric-panel.chem .qc-metric-card.has-value .qc-metric-card-value { color:var(--clay); }
@media (max-width: 900px) {
  .qc-metric-board { grid-template-columns:1fr; }
  .qc-metric-cards { grid-template-columns:repeat(auto-fill, minmax(92px, 1fr)); gap:8px; }
  .qc-metric-card-value { font-size:20px; }
}
.warehouse-map-shell { background:#fbf8f1; border:1px solid var(--line); border-radius:12px; padding:12px; }
.warehouse-map-grid { display:grid; grid-template-columns:repeat(12,1fr); grid-template-rows:repeat(8,54px); gap:3px; background:#f0ece2; padding:3px; border-radius:8px; }
.map-cell { border:1px dashed #d9d0bd; background:rgba(255,255,255,.35); border-radius:4px; cursor:pointer; }
.map-cell:hover { background:#eef7f1; border-color:var(--green-2); }
.map-zone { z-index:2; border:1px solid var(--green-2); background:linear-gradient(145deg,#e8f3ec,#d7eadf); border-radius:6px; padding:6px 7px; text-align:left; cursor:pointer; overflow:hidden; display:flex; flex-direction:column; gap:3px; }
.map-zone b { font-size:11px; color:var(--green-2); }
.map-zone span { font-size:10px; color:var(--ink); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.map-zone em { font-style:normal; font-size:12px; font-weight:700; color:var(--clay); }
.map-legend { margin-top:8px; font-size:11px; color:var(--muted); }
.combo-box { position:relative; }
.combo-box .combo-input { width:100%; padding-right:24px; }
.combo-toggle { position:absolute; right:4px; top:50%; transform:translateY(-50%); border:0; background:transparent; color:var(--muted); cursor:pointer; font-size:12px; }
.combo-menu { display:none; position:absolute; left:0; right:0; top:calc(100% + 2px); z-index:120; max-height:220px; overflow:auto; background:#fff; border:1px solid var(--line); border-radius:8px; box-shadow:var(--shadow); padding:4px; }
.combo-box.open .combo-menu { display:block; }
.combo-option { display:block; width:100%; border:0; background:transparent; text-align:left; padding:7px 8px; border-radius:5px; font:inherit; font-size:12px; cursor:pointer; }
.combo-option:hover, .combo-option.active { background:#eef3ec; color:var(--green); }
.combo-manual { color:var(--green); font-weight:700; border-top:1px solid var(--line); margin-top:3px; }
.demo-banner { margin:8px 18px 0; padding:7px 12px; border-radius:8px; background:#f6efdc; border:1px solid #dfcf9f; color:#7b5c21; font-size:12px; }
.stat-card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; box-shadow: var(--shadow); }
.stat-card span { display: block; font-size: 10px; color: var(--muted); }
.stat-card strong { display: block; font-family: var(--serif); font-size: 23px; margin-top: 6px; }
.stat-card small { font-size: 9.5px; color: var(--muted-2); }
.qc-pass { display: flex; align-items: center; gap: 12px; }
.qc-pass .ring { width: 52px; height: 52px; }
.qc-table-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; margin-right: 5px; }
.standards { display: flex; flex-wrap: wrap; gap: 7px; }
.standard-chip { font-size: 9.5px; color: var(--ink-2); background: var(--surface-2); border: 1px solid var(--line); padding: 5px 8px; border-radius: 7px; }
.standard-chip b { color: var(--green); }

/* ---------------- customers ---------------- */
.customer-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.customer-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 17px 17px 14px; box-shadow: var(--shadow); transition: .2s; cursor: pointer; position: relative;
}
.customer-card:hover { transform: translateY(-2px); box-shadow: 0 22px 45px rgba(35,44,37,.09); border-color: var(--line-2); }
.customer-top { display: flex; align-items: flex-start; gap: 10px; }
.customer-logo { width: 40px; height: 40px; border-radius: 11px; background: linear-gradient(145deg, var(--green-3), #c7ddd2); color: var(--green); display: grid; place-items: center; font-family: var(--serif); font-size: 15px; font-weight: 700; flex: 0 0 40px; }
.customer-logo.clay { background: linear-gradient(145deg, var(--clay-soft), #ecc7b7); color: var(--clay); }
.customer-logo.gold { background: linear-gradient(145deg, var(--gold-soft), #e7d4a8); color: var(--gold); }
.customer-name { font-size: 14px; font-weight: 700; line-height: 1.35; }
.customer-meta { font-size: 10px; color: var(--muted); margin-top: 4px; display: flex; gap: 7px; align-items: center; }
.customer-tags { display: flex; flex-wrap: wrap; gap: 5px; margin: 11px 0 12px; min-height: 20px; }
.customer-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding-top: 11px; border-top: 1px solid var(--line); }
.customer-stat span { display: block; font-size: 9px; color: var(--muted-2); }
.customer-stat strong { display: block; font-size: 12px; margin-top: 3px; font-variant-numeric: tabular-nums; }
.customer-ai {
  margin-top: 10px; font-size: 9.5px; color: var(--muted); background: var(--surface-2);
  border-radius: 8px; padding: 8px 9px; line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.customer-owner { position: absolute; right: 15px; top: 15px; font-size: 9px; color: var(--muted-2); }

/* ---------------- tasks ---------------- */
.kanban { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; align-items: start; }
.kanban-col { background: rgba(255,253,248,.55); border: 1px solid var(--line); border-radius: 14px; padding: 10px; min-height: 180px; }
.kanban-head { display: flex; align-items: center; gap: 7px; padding: 3px 2px 10px; }
.kanban-head strong { font-size: 11px; }
.kanban-count { font-size: 9px; color: var(--muted); background: var(--surface-3); border-radius: 100px; padding: 2px 6px; }
.kanban-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 11px; padding: 11px;
  margin-bottom: 8px; box-shadow: 0 5px 14px rgba(35,44,37,.035); cursor: pointer; transition: .18s;
}
.kanban-card:hover { transform: translateY(-1px); border-color: var(--line-2); box-shadow: 0 10px 20px rgba(35,44,37,.07); }
.kanban-type { font-size: 8.5px; letter-spacing: .5px; color: var(--clay); font-weight: 700; margin-bottom: 5px; }
.kanban-title { font-size: 11.5px; font-weight: 600; line-height: 1.45; }
.kanban-meta { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; font-size: 9px; color: var(--muted); gap: 6px; }
.priority { display: inline-flex; align-items: center; gap: 4px; font-size: 8.5px; }
.priority i { width: 5px; height: 5px; border-radius: 50%; }
.priority.high i { background: var(--red); }
.priority.mid i { background: var(--gold); }
.priority.low i { background: var(--muted-2); }

/* ---------------- finance ---------------- */
.fin-kpi { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.fin-card { background: var(--surface); border: 1px solid var(--line); border-radius: 15px; padding: 15px 17px; box-shadow: var(--shadow); }
.fin-card span { font-size: 10px; color: var(--muted); }
.fin-card strong { display: block; font-family: var(--serif); font-size: 24px; margin-top: 7px; letter-spacing: -.3px; }
.fin-card small { font-size: 9.5px; color: var(--muted); display: block; margin-top: 5px; }
.waterfall { display: flex; flex-direction: column; gap: 10px; padding: 3px 0; }
.wf-row { display: flex; align-items: center; gap: 10px; }
.wf-label { width: 104px; flex: 0 0 104px; font-size: 10px; color: var(--muted); text-align: right; }
.wf-track { flex: 1; height: 22px; background: var(--surface-2); border-radius: 6px; overflow: hidden; position: relative; }
.wf-bar { height: 100%; border-radius: 6px; background: var(--green-2); transition: width .5s; }
.wf-bar.neg { background: var(--clay); }
.wf-bar.soft { background: #b7c8bd; }
.wf-val { width: 92px; flex: 0 0 92px; font-size: 10px; text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.aging-list { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.aging-row { display: flex; align-items: center; gap: 8px; font-size: 10px; }
.aging-row .name { width: 54px; color: var(--muted); }
.aging-row .track { flex: 1; height: 6px; background: var(--surface-3); border-radius: 100px; overflow: hidden; }
.aging-row .track i { display: block; height: 100%; border-radius: 100px; }
.aging-row .val { width: 60px; text-align: right; font-variant-numeric: tabular-nums; }
.slider-row { margin: 12px 0; }
.slider-row label { display: flex; justify-content: space-between; font-size: 10px; color: var(--muted); margin-bottom: 6px; }
.slider-row label b { color: var(--ink); }
input[type=range] { width: 100%; accent-color: var(--green); }
.dist-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.dist-box { background: var(--surface-2); border-radius: 10px; padding: 10px; }
.dist-box span { font-size: 9px; color: var(--muted); display: block; }
.dist-box strong { font-size: 13px; display: block; margin-top: 4px; }
.risk-flag { font-size: 8.5px; color: var(--red); background: var(--red-soft); padding: 2px 6px; border-radius: 100px; font-weight: 700; white-space: nowrap; }

/* ---------------- alerts ---------------- */
.alert-page-list { display: flex; flex-direction: column; gap: 9px; }
.alert-card {
  display: flex; gap: 13px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 14px; padding: 14px 16px; box-shadow: var(--shadow); transition: .18s;
}
.alert-card:hover { border-color: var(--line-2); transform: translateX(2px); }
.alert-card.unread { border-left: 3px solid var(--clay); }
.alert-card .alert-icon { width: 34px; height: 34px; flex: 0 0 34px; border-radius: 10px; font-size: 14px; }
.alert-card-main { flex: 1; min-width: 0; }
.alert-card-title { font-size: 12.5px; font-weight: 700; line-height: 1.4; }
.alert-card-desc { font-size: 10.5px; color: var(--muted); line-height: 1.6; margin-top: 4px; }
.alert-card-meta { display: flex; gap: 10px; font-size: 9px; color: var(--muted-2); margin-top: 7px; }
.alert-card-actions { display: flex; flex-direction: column; gap: 5px; align-items: flex-end; }

/* ---------------- import / settings ---------------- */
.dropzone {
  border: 1.5px dashed var(--line-2); border-radius: 14px; background: var(--surface-2);
  padding: 32px 20px; text-align: center; transition: .2s; cursor: pointer;
}
.dropzone:hover, .dropzone.drag { border-color: var(--green-2); background: var(--green-3); }
.dropzone .dz-icon { width: 48px; height: 48px; margin: 0 auto 12px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); display: grid; place-items: center; color: var(--green); }
.dropzone strong { display: block; font-size: 13px; }
.dropzone span { display: block; font-size: 10px; color: var(--muted); margin-top: 5px; }
.upload-result { margin-top: 12px; padding: 11px 13px; border-radius: 10px; font-size: 10.5px; line-height: 1.7; }
.upload-result.ok { background: var(--green-3); color: var(--green); }
.upload-result.err { background: var(--red-soft); color: var(--red); }

/* ---------------- 录单弹窗布局优化 ---------------- */
.entry-section-title { display: flex; align-items: center; gap: 10px; margin: 20px 0 12px; font-size: 12px; font-weight: 700; color: var(--ink-2); grid-column: 1 / -1; }
.entry-section-title::after { content: ''; flex: 1; height: 1px; background: var(--line); }
/* 可折叠分组 */
.entry-section { grid-column: 1 / -1; }
.entry-section .entry-section-title { cursor: pointer; user-select: none; margin: 14px -10px 10px; padding: 6px 10px; border-radius: 8px; transition: background .15s, color .15s; }
.entry-section .entry-section-title:hover { color: var(--green-2); background: rgba(46,125,50,.08); }
.entry-section .entry-section-title .sec-arrow {
  flex: none; width: 26px; height: 26px; margin-left: auto;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 15px; line-height: 1; color: var(--primary);
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 7px;
  transition: transform .18s, background .15s, color .15s;
}
.entry-section .entry-section-title:hover .sec-arrow { background: var(--primary); color: #fff; border-color: var(--primary); }
.entry-section:not(.open) .entry-section-title .sec-arrow { transform: rotate(-90deg); }
.entry-section .entry-section-body { display: none; }
.entry-section.open .entry-section-body { display: block; }
/* 自定义居中确认弹窗 */
.confirm-backdrop { position: fixed; inset: 0; z-index: 200; background: rgba(20,34,28,.45); backdrop-filter: blur(3px); display: flex; align-items: center; justify-content: center; animation: fadeIn .15s; }
.confirm-card { background: var(--surface); border-radius: 14px; box-shadow: var(--shadow-lg); width: min(430px, 90vw); padding: 22px 26px 18px; animation: modalIn .2s cubic-bezier(.22,.8,.3,1); }
.confirm-msg { font-size: 13.5px; line-height: 1.75; white-space: pre-wrap; color: var(--ink); }
.confirm-btns { display: flex; justify-content: center; gap: 10px; margin-top: 18px; }
.material-table { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--surface); }
.material-head { display: grid; grid-template-columns: minmax(0,1fr) 110px 110px 120px 36px; gap: 8px; padding: 9px 12px; background: var(--surface-2); font-size: 10px; color: var(--muted); font-weight: 600; }
.material-head.cols-3 { grid-template-columns: minmax(0,1fr) 110px 110px; }
.material-row { display: grid; grid-template-columns: minmax(0,1fr) 110px 110px 120px 36px; gap: 8px; padding: 7px 12px; align-items: center; border-top: 1px solid var(--line); }
.material-row.cols-3 { grid-template-columns: minmax(0,1fr) 110px 110px; }
.material-row .field { margin: 0; }
.material-row .field label { display: none; }
.material-remove { width: 30px; height: 30px; min-height: 30px; border-radius: 8px; padding: 0; }
.material-total-row { display: flex; justify-content: flex-end; align-items: center; gap: 10px; padding: 9px 12px; border-top: 1px solid var(--line); background: var(--surface-2); }
.entry-file { border: 1.5px dashed var(--line-2); background: var(--surface-2); border-radius: 12px; padding: 10px 12px; cursor: pointer; color: var(--ink); }
.entry-file:hover, .entry-file:focus { border-color: var(--green-2); background: var(--green-3); }
.entry-file::file-selector-button { border: 0; border-radius: 9px; padding: 8px 14px; margin: 0 12px 0 0; background: var(--green); color: #fff; font-size: 11px; font-weight: 600; cursor: pointer; }
.entry-file::file-selector-button:hover { background: var(--green-2); }
.file-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.file-chips:empty { margin-top: 0; }
.file-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 4px 10px; font-size: 10.5px; color: var(--ink-2); max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.truck-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 8px; }
.truck-grid .input { width: 100%; }
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid .full { grid-column: 1 / -1; }
.setting-note { font-size: 10px; color: var(--muted); line-height: 1.7; background: var(--surface-2); border-radius: 9px; padding: 10px 12px; margin-top: 10px; }
.user-table { width: 100%; border-collapse: collapse; font-size: 11px; }
.user-table th { text-align: left; font-size: 9px; color: var(--muted-2); padding: 7px 8px; border-bottom: 1px solid var(--line); }
.user-table td { padding: 9px 8px; border-bottom: 1px solid var(--line); }
.kpi-list { display: flex; flex-direction: column; gap: 10px; }
.kpi-person { display: flex; align-items: center; gap: 10px; }
.kpi-person .avatar { width: 30px; height: 30px; flex: 0 0 30px; font-size: 10px; }
.kpi-person-main { flex: 1; min-width: 0; }
.kpi-person-main strong { display: block; font-size: 11px; }
.kpi-person-main span { font-size: 9px; color: var(--muted); }
.kpi-person-val { font-size: 11px; font-weight: 700; }

/* ---------------- drawer / modal ---------------- */
.drawer-backdrop { position: fixed; inset: 0; z-index: 90; background: rgba(20,34,28,.4); backdrop-filter: blur(3px); opacity: 0; transition: opacity .22s; }
.drawer-backdrop.show { opacity: 1; }
.drawer {
  position: fixed; z-index: 91; top: 0; right: 0; bottom: 0; width: min(660px, 94vw);
  background: var(--surface); box-shadow: -30px 0 70px rgba(20,34,28,.2);
  transform: translateX(100%); transition: transform .28s cubic-bezier(.22,.8,.3,1);
  display: flex; flex-direction: column;
}
.drawer.show { transform: translateX(0); }
.drawer.wide { width: min(1180px, 97vw); }
.drawer-head { padding: 20px 24px 16px; border-bottom: 1px solid var(--line); display: flex; align-items: flex-start; gap: 12px; }
.drawer-head h2 { margin: 0; font-family: var(--serif); font-size: 22px; }
.drawer-head p { margin: 4px 0 0; font-size: 10px; color: var(--muted); }
.drawer-body { padding: 20px 24px 40px; overflow-y: auto; flex: 1; }
.drawer-close { margin-left: auto; }
.drawer-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.drawer-hero { background: linear-gradient(135deg, var(--green), #2f5a49); color: #fff; border-radius: 14px; padding: 17px; margin-bottom: 15px; }
.drawer-hero h3 { margin: 0; font-family: var(--serif); font-size: 20px; }
.drawer-hero p { color: rgba(255,255,255,.65); font-size: 10px; line-height: 1.6; margin: 6px 0 0; }
.drawer-stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 13px; }
.drawer-stat { background: rgba(255,255,255,.08); border-radius: 8px; padding: 8px; }
.drawer-stat span { display: block; font-size: 8px; color: rgba(255,255,255,.55); }
.drawer-stat strong { display: block; font-size: 12px; margin-top: 3px; }
.timeline { position: relative; padding-left: 17px; }
.timeline::before { content: ""; position: absolute; left: 4px; top: 4px; bottom: 4px; width: 1px; background: var(--line); }
.timeline-item { position: relative; padding: 0 0 16px; }
.timeline-item::before { content: ""; position: absolute; left: -17px; top: 4px; width: 9px; height: 9px; border-radius: 50%; background: var(--surface); border: 2px solid var(--green-2); }
.timeline-date { font-size: 9px; color: var(--muted-2); }
.timeline-title { font-size: 11.5px; font-weight: 700; margin-top: 3px; }
.timeline-text { font-size: 10.5px; color: var(--muted); line-height: 1.65; margin-top: 3px; }
.timeline-photos { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.activity-photo { width: 78px; height: 58px; object-fit: cover; border-radius: 7px; border: 1px solid var(--line); display: block; transition: transform .18s; }
.activity-photo:hover { transform: scale(1.04); }
.modal-backdrop { position: fixed; inset: 0; z-index: 100; background: rgba(20,34,28,.45); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; padding: 20px; animation: fadeIn .18s; }
.modal {
  background: var(--surface); border-radius: 18px; width: min(560px, 100%); max-height: 90vh;
  box-shadow: var(--shadow-lg); display: flex; flex-direction: column; animation: modalIn .24s cubic-bezier(.22,.8,.3,1);
}
.modal.wide { width: min(760px, 100%); }
.modal.xwide { width: min(1320px, 97vw); max-height: 96vh; }
.modal.xwide .modal-body { padding: 10px 18px 8px; }
.combined-form .form-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px 8px; }
.combined-form .field label { font-size: 9.5px; }
.combined-form .field .input, .combined-form .field .select { height: 31px; font-size: 11.5px; }
.combined-form .field .input.entry-file { height: auto; font-size: 12px; }
.combined-form .form-section-title { margin: 6px 0 4px; font-size: 10.5px; }
.combined-form .combined-ai-box textarea { min-height: 48px; }
.combined-form .field.full { grid-column: 1 / -1; }
.combined-ai-box { border: 1px dashed #c9bda3; background: #fbf8f0; border-radius: 10px; padding: 10px; }
.combined-ai-box textarea { min-height: 64px; }
.combined-preview { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-top: 10px; background: #fbf8f0; }
.combined-preview table { width: 100%; border-collapse: collapse; font-size: 11px; }
.combined-preview td { padding: 3px 5px; border-bottom: 1px solid #eee; }
.combined-preview td:nth-child(odd) { color: var(--muted); width: 110px; }
.qc-ai-box { border: 1px dashed #c9bda3; background: #fbf8f0; border-radius: 10px; padding: 10px; margin-bottom: 8px; }
.ai-form-box { border: 1px dashed #c9bda3; background: #fbf8f0; border-radius: 10px; padding: 9px 10px; margin-bottom: 9px; }
.ai-form-box textarea { min-height: 48px; }
.qc-ai-box textarea { min-height: 52px; }
.qc-ai-box.dragging, .ai-form-box.dragging, .combined-ai-box.dragging { border-color: var(--green-2); background: #eef7f1; box-shadow: 0 0 0 2px rgba(46,106,85,.15); }
.ai-attach-preview { display:flex; flex-wrap:wrap; gap:6px; margin-top:6px; }
.ai-file-chip { position:relative; display:flex; align-items:center; gap:6px; max-width:210px; padding:4px 6px 4px 4px; border:1px solid var(--line); border-radius:8px; background:#fff; font-size:10px; }
.ai-file-chip img { width:54px; height:54px; object-fit:cover; border-radius:5px; }
.ai-file-chip span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.ai-file-chip.file { padding-left:7px; }
.ai-file-chip button { border:0; background:transparent; cursor:pointer; color:var(--muted); font-size:14px; line-height:1; padding:0 2px; }
.qc-entry-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 5px 8px; }
.qc-entry-grid .field label { font-size: 9.5px; }
.qc-entry-grid .field .input, .qc-entry-grid .field .select { height: 30px; font-size: 11px; }
.qc-entry-grid .field.full { grid-column: 1 / -1; }
@media (max-width: 900px) { .qc-entry-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.trade-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; margin-top: 8px; }
.trade-split .purchase-side { order: -1; }
.trade-side { border-radius: 12px; padding: 10px 12px 12px; border: 1px solid transparent; }
.sales-side { background: #e9f4ec; border-color: #b9d8c2; }
.purchase-side { background: #fbf4d9; border-color: #e5d292; }
.trade-side-head { display: flex; align-items: baseline; gap: 10px; padding-bottom: 6px; margin-bottom: 7px; border-bottom: 1px solid rgba(30,76,61,.14); }
.trade-side-head strong { font-family: var(--serif); font-size: 16px; }
.trade-side-head span { font-size: 10px; color: var(--muted); }
.trade-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px 7px; }
.trade-grid .field label { font-size: 9.5px; }
.trade-grid .field .input, .trade-grid .field .select { height: 31px; font-size: 11.5px; }
.trade-grid .field .select, .combined-form .field .select { padding: 3px 26px 3px 8px; line-height: 1.25; }
@media (max-width: 900px) { .trade-split { grid-template-columns: 1fr; } .trade-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.modal-head { padding: 20px 22px 3px; }
.modal-head h2 { margin: 0; font-family: var(--serif); font-size: 21px; }
.modal-head p { margin: 5px 0 0; font-size: 10.5px; color: var(--muted); }
.modal-body { padding: 17px 22px 4px; overflow-y: auto; scrollbar-width: none; }
.modal-body::-webkit-scrollbar { display: none; }
.modal-foot { padding: 14px 22px 20px; display: flex; justify-content: flex-end; gap: 8px; }
.modal-close { position: absolute; right: 18px; top: 16px; }
.modal-wrap { position: relative; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.form-row.three { grid-template-columns: repeat(3, 1fr); }
.form-row .full { grid-column: 1 / -1; }

/* ---------------- AI drawer ---------------- */
.ai-backdrop { position: fixed; inset: 0; z-index: 80; background: rgba(20,34,28,.32); backdrop-filter: blur(3px); }
.ai-drawer {
  position: fixed; z-index: 81; top: 0; right: 0; bottom: 0; width: min(440px, 94vw);
  background: var(--surface); box-shadow: -30px 0 70px rgba(20,34,28,.2);
  display: flex; flex-direction: column; transform: translateX(100%); transition: transform .28s cubic-bezier(.22,.8,.3,1);
}
.ai-drawer.show { transform: translateX(0); }
.ai-drawer-head { padding: 20px 20px 14px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.ai-orb { width: 34px; height: 34px; border-radius: 10px; background: linear-gradient(145deg, var(--green), #3e7a61); color: #e9d7ae; display: grid; place-items: center; font-size: 15px; box-shadow: 0 6px 16px rgba(30,76,61,.25); }
.ai-drawer-head h2 { font-size: 14px; margin: 0; }
.ai-drawer-head p { font-size: 9.5px; color: var(--muted); margin: 3px 0 0; }
.ai-chat { flex: 1; overflow-y: auto; padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; background: var(--surface-2); }
.ai-msg { max-width: 88%; padding: 10px 12px; border-radius: 12px; font-size: 11.5px; line-height: 1.75; white-space: pre-wrap; }
.ai-msg.bot { background: var(--surface); border: 1px solid var(--line); border-bottom-left-radius: 3px; align-self: flex-start; }
.ai-msg.user { background: var(--green); color: #fff; border-bottom-right-radius: 3px; align-self: flex-end; }
.ai-msg.typing { color: var(--muted); font-style: italic; }
.ai-suggest { display: flex; gap: 6px; flex-wrap: wrap; padding: 10px 18px 0; }
.ai-suggest button { border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); font-size: 9.5px; padding: 6px 9px; border-radius: 100px; }
.ai-suggest button:hover { border-color: var(--green-2); color: var(--green); }
.ai-input { padding: 12px 16px 18px; border-top: 1px solid var(--line); display: flex; gap: 8px; align-items: flex-end; }
.ai-input textarea { flex: 1; min-height: 42px; max-height: 100px; resize: none; border: 1px solid var(--line); border-radius: 10px; padding: 10px 11px; font-size: 11.5px; outline: none; background: var(--surface-2); }
.ai-input textarea:focus { border-color: var(--green-2); background: #fff; }
.ai-send { width: 38px; height: 38px; border-radius: 10px; border: 0; background: var(--green); color: #fff; display: grid; place-items: center; }

/* ---------------- footer / mobile nav ---------------- */
.mobile-nav { display: none; }
.toast-root { position: fixed; z-index: 200; bottom: 22px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: #1b3b30; color: #f4efe4; padding: 10px 16px; border-radius: 10px; font-size: 11px; box-shadow: 0 12px 30px rgba(0,0,0,.2); animation: toastIn .2s ease both; max-width: 90vw; }
.toast.err { background: #8e3027; }
.skeleton { background: linear-gradient(90deg, var(--surface-2) 25%, #fff 50%, var(--surface-2) 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 8px; }
.loading-page { padding: 40px; display: grid; gap: 14px; }
.loading-page .skeleton:nth-child(1) { height: 120px; }
.loading-page .skeleton:nth-child(2) { height: 90px; }
.loading-page .skeleton:nth-child(3) { height: 300px; }

/* ---------------- animations ---------------- */
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalIn { from { opacity: 0; transform: translateY(10px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(143,211,177,.55); } 70% { box-shadow: 0 0 0 7px rgba(143,211,177,0); } 100% { box-shadow: 0 0 0 0 rgba(143,211,177,0); } }

/* ---------------- responsive ---------------- */
@media (max-width: 1300px) {
  .kpi-grid { grid-template-columns: repeat(3, 1fr); }
  .customer-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 1100px) {
  :root { --sidebar: 214px; }
  .page { padding: 24px 22px 50px; }
  .topbar { padding: 0 22px; }
  .hero-grid { grid-template-columns: 1fr; }
  .health-card { flex-direction: row; flex-wrap: wrap; gap: 18px; align-items: center; }
  .health-ring-wrap { margin: 0; }
  .health-bars { flex: 1; min-width: 180px; }
  .grid-2, .grid-2.equal { grid-template-columns: 1fr; }
  .fin-kpi { grid-template-columns: repeat(2, 1fr); }
  .kanban { grid-template-columns: repeat(2, 1fr); }
  .settings-grid { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  :root { --sidebar: 0px; }
  .sidebar { transform: translateX(-100%); width: 244px; transition: transform .25s; }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; width: 100%; }
  .topbar { height: 62px; padding: 0 16px; }
  .topbar-title h1 { font-size: 16px; }
  .page { padding: 19px 16px 88px; }
  .page-head { align-items: flex-start; flex-direction: column; gap: 12px; }
  .page-head h1 { font-size: 25px; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .inv-stats { grid-template-columns: repeat(2, 1fr); }
  .shipment-hero { grid-template-columns: 1fr; }
  .customer-grid { grid-template-columns: 1fr; }
  .kanban { grid-template-columns: 1fr 1fr; }
  .mobile-nav {
    display: flex; position: fixed; z-index: 40; left: 10px; right: 10px; bottom: 10px;
    background: rgba(20,53,44,.96); backdrop-filter: blur(12px); border-radius: 16px;
    padding: 7px 6px; box-shadow: 0 16px 40px rgba(0,0,0,.22); justify-content: space-around;
  }
  .mobile-nav button { border: 0; background: transparent; color: rgba(236,231,217,.55); display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 8px; padding: 5px 9px; border-radius: 9px; }
  .mobile-nav button.active { color: #e9d7ae; background: rgba(255,255,255,.08); }
  .mobile-nav svg { width: 17px; height: 17px; }
  .form-row, .form-row.three { grid-template-columns: 1fr; }
  .modal { max-height: 94vh; }
  .drawer { width: 100vw; }
  .search-box { max-width: none; flex: 1 0 100%; }
  .toolbar .select-sm { flex: 1; }
  .toolbar .btn { flex: 0 0 auto; }
}
@media (max-width: 560px) {
  .login-shell { grid-template-columns: 1fr; }
  .login-visual { display: none; }
  .login-panel { min-height: 100vh; padding: 28px 22px; }
  .login-box { max-width: 420px; }
  .kpi-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
  .kpi { min-height: 102px; padding: 13px; }
  .kpi-value { font-size: 21px; }
  .fin-kpi { grid-template-columns: 1fr 1fr; gap: 9px; }
  .kanban { grid-template-columns: 1fr; }
  .ai-hero { padding: 19px 18px; }
  .ai-hero h2 { font-size: 19px; }
  .health-card { display: block; }
  .health-ring-wrap { justify-content: center; }
  .health-bars { margin-top: 12px; }
  .demo-grid { grid-template-columns: 1fr 1fr; }
  .alert-card-actions { flex-direction: row; }
  .table-foot { flex-direction: column; gap: 8px; align-items: flex-start; }
  .topbar-actions .ai-btn span.ai-label { display: none; }
  .dist-grid { grid-template-columns: 1fr; }
  .drawer-stat-grid { grid-template-columns: 1fr 1fr; }
}
@media print {
  .sidebar, .topbar, .mobile-nav, .page-actions, .btn { display: none !important; }
  .main { margin: 0; width: 100%; }
  body { background: #fff; }
  .panel { box-shadow: none; border-color: #ddd; }
}

/* ============================================================
   UI 精修 2026-11-19 · 纯视觉增强（只追加，不改原规则/布局/内容）
   模块1：头部 / 侧栏
   ============================================================ */
/* 激活项左侧深绿强调条，强化当前位置辨识度 */
.nav-item.active::before {
  content: ""; position: absolute; left: 3px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 18px; border-radius: 3px; background: var(--green-2);
}
/* 导航项 hover 过渡更柔顺 */
.nav-item:hover { background: rgba(255,255,255,.09); }
/* 分组标题加一道淡淡的细分隔线，层次更清晰 */
.side-section::after {
  content: ""; display: block; height: 1px; margin: 6px 10px 0;
  background: linear-gradient(90deg, rgba(236,231,217,.16), transparent);
}
/* 顶栏面包屑用金色点缀，与中式雅致主题呼应 */
.topbar-title .crumb { color: var(--gold); opacity: .9; font-weight: 600; }
/* AI 助手按钮增加柔和的悬停阴影 */
.ai-btn { transition: background .2s, color .2s, box-shadow .2s, transform .18s; }
.ai-btn:hover { box-shadow: 0 6px 16px rgba(30,76,61,.20); transform: translateY(-1px); }

/* 模块2：卡片 / 面板 —— 柔和悬停反馈与顶部高光 */
.panel, .kpi, .health-card {
  transition: box-shadow .25s ease, transform .25s ease, border-color .25s ease;
}
.panel:hover { box-shadow: 0 20px 46px rgba(35,44,37,.085); }
.kpi:hover { transform: translateY(-3px); box-shadow: 0 20px 40px rgba(35,44,37,.11); border-color: var(--line-2); }
.health-card:hover { box-shadow: 0 20px 46px rgba(35,44,37,.085); }
/* 卡片顶部极细的高光，增强材质层次（不占据布局空间） */
.panel::before, .health-card::before {
  content: ""; position: absolute; left: 18px; right: 18px; top: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.9), transparent);
  pointer-events: none;
}
.panel, .health-card { position: relative; }
/* KPI 数值字重更沉稳， decimals 更清晰 */
.kpi-value { font-weight: 600; }

/* 模块3：表格 —— 表头可读性 + 行悬浮指示，纯视觉 */
.data-table th { letter-spacing: .7px; color: var(--muted); }
/* 数据行悬浮时左侧出现细绿条，强化「当前行」反馈 */
.data-table tbody tr, .qc-full-table tbody tr { position: relative; }
.data-table tbody tr:hover td:first-child { box-shadow: inset 3px 0 0 var(--green-2); }
.qc-full-table tbody tr:hover td.qc-pin-l:first-child { box-shadow: inset 3px 0 0 var(--green-2), inset -1px 0 0 var(--line); }
/* 表头底部加一道细高光，分区更清晰 */
.data-table thead th { box-shadow: inset 0 -2px 0 rgba(30,76,61,.05); }
/* 表头字母与数字列更利落 */
.qc-full-table thead th { letter-spacing: .6px; }

/* 模块4：弹窗 / 抽屉 —— 质感与层次精修，纯视觉 */
/* 遮罩更柔和细腻 */
.modal-backdrop, .drawer-backdrop { backdrop-filter: blur(6px); }
/* 弹窗顶部装饰线已按用户要求移除（2026-11-19） */
/* 标题与副标题层次 */
.modal-head h2 { letter-spacing: .5px; }
.modal-head p { line-height: 1.6; }
/* 关闭按钮 hover 回反馈 */
.modal-close:hover, .drawer-close:hover { color: var(--clay); transform: rotate(90deg); }
.modal-close, .drawer-close { transition: color .2s, transform .25s ease, background .2s; }
/* 抽屉顶部同样加细线 */
.drawer::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: linear-gradient(180deg, var(--green), var(--gold), var(--clay));
  pointer-events: none; z-index: 3;
}

/* 模块5：表单控件 —— 聚焦光晕 / 占位符 / 按钮层次，纯视觉 */
/* 占位符颜色更柔和统一 */
.input::placeholder, .textarea::placeholder { color: var(--muted-2); opacity: .85; }
/* 聚焦时更明显但不刺眼的绿色光晕 */
.input:focus, .select:focus, .textarea:focus {
  box-shadow: 0 0 0 4px rgba(46,106,85,.13);
}
/* 标签字重与颜色微调，可读性更好 */
.field label { color: var(--ink-2); letter-spacing: .2px; }
/* 主按钮悬停抬升更明显，层次更分明 */
.btn-primary { transition: background .2s, box-shadow .2s, transform .18s; }
.btn-primary:hover { box-shadow: 0 12px 26px rgba(30,76,61,.28); transform: translateY(-2px); }
/* 幽灵按钮 hover 加淡绿底 */
.btn-ghost:hover { background: var(--green-3); color: var(--green); border-color: var(--green-3); }
/* 复选框/单选 accent 统一强调色 */
input[type=checkbox], input[type=radio] { accent-color: var(--green); }

/* 模块6：移动端适配 —— 仅视觉微调，不改布局尺寸/内容 */
/* 窄屏面包屑单行省略，避免换行挤占顶栏高度（文案不变，仅截断显示） */
@media (max-width: 860px) {
  .topbar-title .crumb {
    display: block; max-width: 62vw; white-space: nowrap;
    overflow: hidden; text-overflow: ellipsis;
  }
  .topbar-title h1 { line-height: 1.25; }
}
/* 底部导航适配全面屏安全区 */
.mobile-nav { padding-bottom: max(7px, env(safe-area-inset-bottom)); }
/* 移动端 KPI 卡片圆角与阴影更柔和 */
@media (max-width: 560px) {
  .kpi { border-radius: 14px; }
}

/* ============================================================
   雅致·新境 UI 重塑 2026-11-19 · 模块0：全局设计体系
   覆盖 :root token —— 改一处、全站生效（纯视觉，不动结构/内容）
   ============================================================ */
:root {
  /* 画布：更温暖的宣纸质感 */
  --bg: #f6f2e9;
  --bg-2: #efe9dc;
  --surface: #fffefb;
  --surface-2: #f9f6ee;
  --surface-3: #f1ece1;
  /* 墨色：更深邃、对比更清晰 */
  --ink: #14211a;
  --ink-2: #304036;
  --muted: #6c776e;
  --muted-2: #9ca59c;
  /* 线条：更柔和 */
  --line: #e7e0d3;
  --line-2: #d8cfbd;
  /* 主绿：更沉稳饱满 */
  --green: #1b4a39;
  --green-2: #2e7058;
  --green-3: #e1eee6;
  /* 陶土 / 金：更鲜明有力 */
  --clay: #b95c3c;
  --clay-2: #dd8b69;
  --clay-soft: #f6e3d8;
  --gold: #a97c24;
  --gold-soft: #f5ead0;
  /* 多层柔和阴影：卡片浮起来（一眼可见的立体感） */
  --shadow: 0 1px 2px rgba(35,44,37,.045), 0 12px 30px rgba(35,44,37,.08);
  --shadow-lg: 0 3px 6px rgba(25,38,31,.06), 0 30px 70px rgba(25,38,31,.17);
  /* 圆角更现代 */
  --radius: 20px;
  --radius-sm: 14px;
  --radius-xs: 10px;
}
/* 背景暖光更饱满、有层次 */
body {
  background:
    radial-gradient(1100px 680px at 85% -8%, rgba(205,170,104,.20), transparent 58%),
    radial-gradient(900px 620px at -8% 24%, rgba(47,112,89,.11), transparent 58%),
    var(--bg);
}

/* ---------------- 重塑模块1：侧栏 / 顶栏 ---------------- */
/* 侧栏：更深的墨绿渐变 + 顶部暖金光，质感更沉稳 */
.sidebar {
  background:
    radial-gradient(420px 300px at 0% 0%, rgba(205,170,104,.14), transparent 62%),
    linear-gradient(178deg, #1a4538 0%, #14362c 48%, #0f2c24 100%) !important;
}
/* 品牌区加一道底部柔金分隔线 */
.side-brand { position: relative; }
.side-brand::after {
  content: ""; position: absolute; left: 8px; right: 8px; bottom: 6px; height: 1px;
  background: linear-gradient(90deg, rgba(205,170,104,.38), rgba(205,170,104,.04));
}
/* 分组标题：金色调 + 行首小竖条，层次更清晰 */
.side-section {
  color: rgba(214,190,140,.62) !important;
  letter-spacing: 2px !important; font-weight: 700;
  display: flex; align-items: center; gap: 8px;
}
.side-section::before {
  content: ""; width: 3px; height: 11px; border-radius: 2px;
  background: linear-gradient(180deg, #d9b779, #a97c24);
}
/* 分组标题下的分隔线增强（覆盖上一轮） */
.side-section::after {
  background: linear-gradient(90deg, rgba(214,190,140,.28), transparent) !important;
}
/* 导航项：默认文字更清晰、圆角更柔 */
.nav-item { border-radius: 11px !important; }
/* 激活项：更饱满的金色渐变 + 投影，左侧金条（覆盖上一轮的绿条） */
.nav-item.active {
  background: linear-gradient(105deg, #efd9a8 0%, #dcc081 55%, #cda966 100%) !important;
  box-shadow: 0 10px 22px rgba(0,0,0,.22), inset 0 1px 0 rgba(255,255,255,.55) !important;
  color: #173d32 !important; font-weight: 800 !important;
}
.nav-item.active::before {
  background: #8a5a12 !important;
  left: 2px !important; width: 4px !important; height: 20px !important;
}
.nav-item.active .nav-badge { background: #7a4a0e !important; }
/* 侧栏底部用户卡：更精致的玻璃质感 */
.side-user { background: rgba(255,255,255,.08) !important; border-color: rgba(205,170,104,.18) !important; }
/* 顶栏：底部一道金绿渐变细线，标题层次更分明 */
.topbar {
  border-bottom: 1px solid rgba(213,205,190,.55) !important;
  box-shadow: 0 1px 0 rgba(255,255,255,.6), 0 6px 20px rgba(35,44,37,.035);
}
.topbar::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px;
  background: linear-gradient(90deg, var(--green) 0%, var(--gold) 45%, var(--clay) 100%);
  opacity: .55; pointer-events: none;
}
.topbar-title .crumb { color: var(--gold) !important; font-weight: 700 !important; opacity: 1 !important; }
.topbar-title h1 { font-size: 20px !important; font-weight: 700 !important; letter-spacing: .8px !important; }
/* AI 按钮更精致的胶囊质感 */
.ai-btn {
  border-radius: 100px !important; padding: 8px 15px !important;
  box-shadow: 0 4px 12px rgba(30,76,61,.10);
}

/* ---------------- 重塑模块2：卡片 / KPI / 面板 ---------------- */
/* Hero 卡：更深的墨绿 + 暖金光晕，标题与正文对比更强 */
.ai-hero {
  background:
    radial-gradient(560px 300px at 100% -10%, rgba(217,185,123,.26), transparent 62%),
    radial-gradient(420px 260px at -10% 110%, rgba(185,98,69,.18), transparent 60%),
    linear-gradient(130deg, #1d4b3b 0%, #143a2e 52%, #16382e 100%) !important;
  border: 1px solid rgba(217,185,123,.20) !important;
  box-shadow: 0 3px 8px rgba(20,40,30,.12), 0 24px 56px rgba(20,40,30,.28) !important;
}
.ai-hero h2 { color: #fbf4e6 !important; text-shadow: 0 1px 2px rgba(0,0,0,.18); }
.ai-hero p { color: rgba(248,240,224,.78) !important; }
/* Hero 操作按钮：更清晰的描边胶囊 */
.hero-action { border-radius: 100px !important; padding: 7px 13px !important; border-color: rgba(255,255,255,.20) !important; }
/* 健康度卡：环形数字更醒目、标题更沉稳 */
.health-card { padding: 20px 21px !important; }
.health-ring .val strong { font-size: 30px !important; color: var(--green) !important; }
.health-top h3 { font-weight: 700 !important; letter-spacing: .4px !important; }
/* KPI 卡：更大圆角 + 更明显立体感 + 顶部彩色渐变条 */
.kpi {
  border-radius: 16px !important;
  border-color: var(--line) !important;
  box-shadow: 0 1px 2px rgba(35,44,37,.04), 0 14px 30px rgba(35,44,37,.09) !important;
}
.kpi::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px;
  background: linear-gradient(90deg, var(--green-2), #6ea088);
  border-radius: 16px 16px 0 0;
}
.kpi.clay::before { background: linear-gradient(90deg, var(--clay), var(--clay-2)); }
.kpi.gold::before { background: linear-gradient(90deg, var(--gold), #d4ab5c); }
.kpi.red::before { background: linear-gradient(90deg, var(--red), #d4736a); }
.kpi-value { font-size: 27px !important; font-weight: 700 !important; color: var(--ink) !important; letter-spacing: -.6px !important; }
.kpi-label { font-weight: 600 !important; color: var(--muted) !important; }
/* 普通面板：头部标题更沉稳、分割感更强 */
.panel-head { padding: 20px 22px 14px !important; border-bottom: 1px solid var(--line); }
.panel-head h3 { font-size: 15px !important; font-weight: 700 !important; }
.panel-body.pad { padding: 20px 22px !important; }

/* ---------------- 重塑模块3：表格 / 工具栏 / 标签页 ---------------- */
/* 工具栏：搜索框与控件更饱满统一 */
.search-box .input, .select-sm {
  border-radius: 10px !important; border-color: var(--line-2) !important;
  box-shadow: 0 1px 2px rgba(35,44,37,.03);
}
.search-box .input:focus { box-shadow: 0 0 0 3px rgba(46,112,88,.13) !important; }
/* 标签页：激活态更明确的下划线胶囊 */
.tab { font-size: 13px !important; padding: 11px 17px !important; }
.tab.active { font-weight: 800 !important; border-bottom-width: 3px !important; }
/* 数据表格：表头深色质感 + 行更舒展，读数更清晰 */
.table-wrap { border-radius: var(--radius) !important; }
.data-table th {
  background: linear-gradient(180deg, var(--surface-2), #f3eee3) !important;
  color: var(--ink-2) !important; font-size: 10.5px !important; font-weight: 800 !important;
  padding: 14px 14px !important; border-bottom: 2px solid var(--line-2) !important;
}
.data-table td { padding: 14px 14px !important; font-size: 12.5px !important; }
.data-table tbody tr:hover { background: #fbf6ea !important; }
/* 检测中心全列表：表头更沉稳（保持 sticky/固定列 z-index 不变） */
.qc-full-table thead th {
  background: linear-gradient(180deg, #f3eddd, #e9e1cd) !important;
  color: var(--ink) !important; font-weight: 800 !important; font-size: 11px !important;
}
.qc-full-table thead th.qc-pin { background: linear-gradient(180deg, #f3eddd, #e9e1cd) !important; }
.qc-full-table th, .qc-full-table td { padding: 11px 11px !important; }
/* 斑马纹更清晰、行悬浮高亮（固定列同步，保持不透明背景） */
.qc-full-table tbody tr:nth-child(even) td { background: #faf7f0 !important; }
.qc-full-table tbody tr:nth-child(even) td.qc-pin { background: #faf7f0 !important; }
.qc-full-table tbody tr:hover td, .qc-full-table tbody tr:hover td.qc-pin { background: #f6efe0 !important; }

/* ---------------- 重塑模块4：弹窗 / 抽屉 / 表单 / 按钮 ---------------- */
/* 弹窗：更大气的圆角与立体阴影，暖白底 */
.modal {
  border-radius: 22px !important;
  box-shadow: 0 4px 12px rgba(20,40,30,.12), 0 40px 90px rgba(20,40,30,.30) !important;
  border: 1px solid rgba(217,185,123,.22) !important;
}
/* 弹窗头部：加金色底部渐隐分隔、标题更大 */
.modal-head { border-bottom: 1px solid var(--line); padding-bottom: 14px !important; }
.modal-head h2 { font-size: 23px !important; letter-spacing: .5px !important; }
.modal-foot { border-top: 1px solid var(--line); padding-top: 16px !important; }
/* 遮罩更柔和深邃 */
.modal-backdrop { background: rgba(16,32,25,.54) !important; }
/* 抽屉：左侧金绿渐变粗条 + 更立体阴影（覆盖上一轮） */
.drawer {
  box-shadow: -8px 0 40px rgba(20,40,30,.22) !important;
  border-left: 1px solid rgba(217,185,123,.25) !important;
}
.drawer::before { width: 5px !important; background: linear-gradient(180deg, var(--gold), var(--green), var(--clay)) !important; }
.drawer-head { background: linear-gradient(180deg, var(--surface-2), transparent); }
.drawer-head h2 { font-weight: 700 !important; }
/* 通用表单控件：更饱满柔和（不改密集表单的固定高度/字号） */
.field .input, .field .select, .field .textarea {
  border-radius: 10px !important; border-color: var(--line-2) !important;
  box-shadow: 0 1px 2px rgba(35,44,37,.035);
}
.field label { font-weight: 700 !important; }
/* 按钮：主按钮更立体、层次更强 */
.btn-primary {
  border-radius: 11px !important;
  box-shadow: 0 4px 10px rgba(27,74,57,.26), 0 10px 22px rgba(27,74,57,.18) !important;
}
.btn-clay { border-radius: 11px !important; box-shadow: 0 4px 10px rgba(185,92,60,.24) !important; }
.btn-ghost, .btn-soft { border-radius: 11px !important; }
.btn-sm { border-radius: 9px !important; }

/* ---------------- 重塑模块5：登录页 / 移动端 ---------------- */
/* 登录视觉面：更深的墨绿 + 暖金光晕，质感更高级 */
.login-visual {
  background:
    radial-gradient(760px 520px at 18% 12%, rgba(217,185,123,.22), transparent 58%),
    radial-gradient(620px 500px at 100% 100%, rgba(185,98,69,.16), transparent 60%),
    linear-gradient(150deg, #164035 0%, #1b4b3d 50%, #123128 100%) !important;
}
.login-copy h1 { color: #fbf3e2 !important; text-shadow: 0 2px 4px rgba(0,0,0,.16); }
.login-copy h1 em { color: #e2be7d !important; }
/* 登录表单面：更温暖的象牙白 */
.login-panel {
  background:
    radial-gradient(680px 480px at 100% 100%, rgba(185,98,69,.06), transparent 60%),
    linear-gradient(180deg, #fffefa, #f9f5ec) !important;
}
.login-box h2 { font-size: 33px !important; color: var(--ink) !important; }
.login-submit { border-radius: 12px !important; }
/* 移动端：顶栏标题与卡片更紧凑精致 */
@media (max-width: 860px) {
  .topbar { padding: 0 16px !important; }
  .page { padding: 18px 14px 44px !important; }
  .page-head h1 { font-size: 25px !important; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .grid-2, .grid-2.equal, .grid-3 { grid-template-columns: 1fr !important; }
  .hero-grid { grid-template-columns: 1fr !important; }
}
@media (max-width: 560px) {
  .kpi { border-radius: 15px !important; }
  .kpi-value { font-size: 23px !important; }
}

/* ============================================================
   侧栏折叠 / 隐藏（桌面端）—— 三态：完整 → 图标条 → 隐藏
   仅作用于 >860px，移动端抽屉逻辑不受影响
   ============================================================ */
@media (min-width: 861px) {
  /* 折叠态：侧栏收成图标条 */
  body.sidebar-collapsed { --sidebar: 72px; }
  body.sidebar-collapsed .side-brand { justify-content: center; padding: 0 0 20px; }
  body.sidebar-collapsed .side-brand > div { display: none; }
  body.sidebar-collapsed .side-section { font-size: 0; height: 1px; padding: 10px 0 0; overflow: hidden; }
  body.sidebar-collapsed .side-section::before, body.sidebar-collapsed .side-section::after { display: none; }
  body.sidebar-collapsed .nav-item { justify-content: center; padding: 12px 0 !important; }
  body.sidebar-collapsed .nav-item > span { display: none; }
  body.sidebar-collapsed .nav-item > svg { width: 20px; height: 20px; flex-basis: 20px; }
  body.sidebar-collapsed .nav-badge {
    position: absolute; top: 4px; right: 12px; margin: 0;
    min-width: 15px; height: 15px; padding: 0 3px; line-height: 15px;
    text-align: center; font-size: 9px; border-radius: 100px;
  }
  body.sidebar-collapsed .nav-item.active::before { left: 0; }
  body.sidebar-collapsed .side-user { justify-content: center; padding: 8px 4px; }
  body.sidebar-collapsed .side-user > div:not(.avatar) { display: none; }
  body.sidebar-collapsed .side-user > button { display: none; }
  /* 隐藏态：主区占满，侧栏保持原宽整体移出屏幕（避免宽度归零后padding残留挡住折叠按钮） */
  body.sidebar-hidden { --sidebar: 0px; }
  body.sidebar-hidden .sidebar { width: 244px; transform: translateX(-102%); }
  /* 侧栏宽度变化更平滑 */
  .sidebar { transition: width .22s ease, transform .22s ease; }
  .main { transition: margin-left .22s ease, width .22s ease; }
  /* 折叠按钮：桌面端常显，随状态轻微高亮 */
  #menu-btn { color: var(--green); }
  body.sidebar-collapsed #menu-btn, body.sidebar-hidden #menu-btn { background: var(--green-3); }
}

/* ============================================================
   字体可读性提升（通用列表页）—— 纯字号/行高，不动布局尺寸
   ============================================================ */
/* 主数据表格：表头与数据行放大一档 */
.data-table th { font-size: 12px !important; padding: 14px 14px !important; }
.data-table td { font-size: 13px !important; line-height: 1.5 !important; }
.data-table .sub { font-size: 11px !important; }
.data-table .num { font-size: 13px !important; }
/* 表格内小按钮/标签 */
.data-table .btn-sm { font-size: 12px !important; }
.pager button { font-size: 11px !important; }
/* 迷你表格 */
.mini-table th { font-size: 11px !important; }
.mini-table td { font-size: 12.5px !important; }
/* 空状态 */
.empty p { font-size: 12.5px !important; }
/* 客户卡片 / 列表卡辅助小字 */
.customer-meta, .stat-card span, .customer-stat span, .customer-owner { font-size: 11px !important; }
.customer-stat strong { font-size: 13px !important; }
/* 提醒/待办列表小字 */
.alert-title, .task-mini-title { font-size: 12.5px !important; }
.alert-desc, .alert-time, .task-mini-meta, .kanban-meta { font-size: 10.5px !important; }
/* 面板副标题 */
.panel-head p { font-size: 12px !important; }
.page-head p { font-size: 13px !important; }
/* 检测中心表格底部说明行 */
.table-foot, .qc-table-wrap + div, .data-note { font-size: 11.5px !important; }
/* 客户卡片：AI画像行、统计卡小字 */
.customer-ai { font-size: 11px !important; line-height: 1.5 !important; }
.stat-card small { font-size: 11px !important; }
.stat-card span { font-size: 11.5px !important; }
/* 进销存密集账表：表头强制单行不换行，避免窄列文字竖排堆叠破版 */
.sales-dense thead th { white-space: nowrap !important; font-size: 12.5px !important; }
.sales-dense tbody td { white-space: nowrap; }
body.ledger-mode .sales-dense thead th { white-space: nowrap !important; }
/* 财务嵌入页内的小标签/副标题（父页面样式可穿透iframe同源） */
.tag { font-size: 12px !important; }
/* 辅助说明类小字兜底：统一提到11px，改善可读性 */
.tiny { font-size: 11px !important; }
.kpi-sub { font-size: 11px !important; }
.field .hint, .hint { font-size: 11px !important; }
.qc-metric-card-label { font-size: 12.5px !important; }

/* ============================================================
   侧栏分组折叠 —— 点击分组标题展开/收起该组菜单项
   ============================================================ */
.nav-group { position: relative; }
/* 分组标题按钮化：继承原有外观，补交互反馈 */
.side-section {
  width: 100%; background: none !important; border: 0 !important;
  text-align: left; cursor: pointer; user-select: none;
  transition: color .18s;
}
.side-section:hover { color: rgba(233,215,174,.92) !important; }
.side-section:focus-visible { outline: 1px solid rgba(217,185,123,.5); outline-offset: 2px; border-radius: 4px; }
.side-section-label { flex: 1; }
/* 折叠箭头：展开朝下，收起朝右 */
.side-section-caret { display: inline-flex; align-items: center; opacity: .55; transition: transform .2s ease; }
.side-section-caret svg { width: 13px; height: 13px; }
.nav-group.collapsed .side-section-caret { transform: rotate(-90deg); }
/* 核心：收起时隐藏该组菜单项 */
.nav-group.collapsed .nav-group-items { display: none; }
/* 分组菜单项保持原有间距节奏 */
.nav-group-items { display: flex; flex-direction: column; gap: 3px; }
/* 图标条态：分组标题整体隐藏，只留纯图标，避免小箭头/竖条残留显脏 */
body.sidebar-collapsed .nav-group > .side-section { display: none !important; }
body.sidebar-collapsed .nav-group-items { gap: 5px; }

/* 菜单显示/隐藏按钮：醒目胶囊按钮，左右双箭头指示「收起/展开」，常显不隐藏 */
#menu-btn {
  display: inline-flex !important; align-items: center; gap: 7px;
  height: 36px; padding: 0 13px 0 11px !important; margin-right: 2px;
  border: 1px solid var(--green) !important; border-radius: 10px !important;
  background: var(--green) !important; color: #fff !important;
  font-size: 12px; font-weight: 700; letter-spacing: .3px; white-space: nowrap;
  box-shadow: 0 3px 10px rgba(30,76,61,.22);
  transition: background .18s, box-shadow .18s, transform .18s, color .18s;
}
#menu-btn:hover { background: #255a48 !important; box-shadow: 0 5px 14px rgba(30,76,61,.3); transform: translateY(-1px); }
#menu-btn:active { transform: translateY(0); }
#menu-btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
body.sidebar-hidden #menu-btn { background: transparent !important; color: var(--green) !important; }
#menu-btn .toggle-ico { display: inline-flex; align-items: center; }
#menu-btn svg { width: 17px; height: 17px; }
@media (max-width: 860px) {
  #menu-btn { padding: 0 9px !important; }
  #menu-btn .sidebar-toggle-label { display: none; }
}

/* 侧栏一级分组标题：9px 太小，调到 12px 清晰可读（仍小于菜单项14px保持层级） */
.side-section { font-size: 12px !important; letter-spacing: 1.5px !important; padding: 18px 10px 8px !important; }
.side-section-label { font-size: 12px !important; font-weight: 700 !important; }
.side-section-caret svg { width: 14px; height: 14px; }
