/* ============================================================
   Leaflow 叶流 CRM - 设计系统
   风格溯源：Ecofamile Logo 设计语言
   - Eco 绿 #20B040 + 工业灰 #5F6068 的双色策略
   - 几何圆角（10px）与单线宽图标，消费电子产品气质
   - 叶子作为唯一有机点缀符号，克制使用
   ============================================================ */

:root {
  --eco: #20B040;
  --eco-deep: #157A2E;
  --eco-050: #F0F9F1;
  --eco-soft: #E6F5E9;
  --gray-brand: #5F6068;
  --ink: #1B1E1A;
  --ink-2: #474B44;
  --ink-3: #878C82;
  --line: #E0E4DA;
  --bg: #F6F8F4;
  --surface: #FFFFFF;
  --amber: #C77E1F;
  --amber-soft: #F9F0E0;
  --red: #C94F3D;
  --red-soft: #FAECE9;
  --radius: 10px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(27,30,26,.04), 0 4px 16px rgba(27,30,26,.05);
  --font: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

/* ---------- 布局骨架 ---------- */
.app { display: grid; grid-template-columns: 236px 1fr; height: 100vh; }
.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
  overflow-y: auto;
}
.main { display: flex; flex-direction: column; overflow: hidden; }
.topbar {
  height: 62px; flex: none;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 18px;
  padding: 0 26px;
}
.view { flex: 1; overflow-y: auto; padding: 26px 30px 60px; }

/* ---------- Logo ---------- */
.brand { padding: 20px 22px 16px; border-bottom: 1px solid var(--line); }
.brand svg { display: block; }
.brand .slogan {
  margin-top: 7px; font-size: 11px; color: var(--ink-3); letter-spacing: .06em;
}

/* ---------- 侧边导航 ---------- */
.nav { padding: 14px 12px; flex: 1; }
.nav .group {
  font-size: 11px; color: var(--ink-3); letter-spacing: .12em;
  padding: 14px 12px 6px; font-weight: 700;
}
.nav a {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 12px; margin-bottom: 2px;
  color: var(--ink-2); text-decoration: none;
  border-radius: var(--radius-sm); font-weight: 500;
  transition: background .15s, color .15s;
}
.nav a svg { flex: none; }
.nav a:hover { background: var(--eco-050); color: var(--eco-deep); }
.nav a.active { background: var(--eco-soft); color: var(--eco-deep); font-weight: 700; }
.nav a .badge {
  margin-left: auto; font-size: 11px; font-weight: 700;
  background: var(--eco); color: #fff;
  border-radius: 999px; padding: 1px 8px;
}
.side-foot {
  padding: 14px 22px; border-top: 1px solid var(--line);
  font-size: 11.5px; color: var(--ink-3);
}

/* ---------- 顶栏 ---------- */
.page-title { font-size: 17px; font-weight: 700; font-family: inherit; }
.world-clock { display: flex; gap: 14px; margin-left: auto; }
.wc {
  text-align: right; line-height: 1.3;
}
.wc .city { font-size: 10.5px; color: var(--ink-3); letter-spacing: .04em; }
.wc .time { font-size: 13px; font-weight: 700; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.rate-chip {
  font-size: 12px; color: var(--ink-2); font-weight: 600;
  background: var(--eco-050); border: 1px solid var(--line);
  padding: 5px 12px; border-radius: 999px; white-space: nowrap;
}
.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--gray-brand); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700;
}
/* ---------- 用户身份区（v2 账号体系） ---------- */
.user-chip { display: flex; align-items: center; gap: 10px; }
.user-chip .uinfo { line-height: 1.3; text-align: right; }
.user-chip .uname { font-size: 13px; font-weight: 700; }
.user-chip .urole { font-size: 11px; color: var(--ink-3); }
.logout-btn {
  font-family: var(--font); font-size: 12px; font-weight: 600;
  padding: 5px 12px; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-3);
  transition: all .15s;
}
.logout-btn:hover { border-color: var(--red); color: var(--red); background: var(--red-soft); }
/* 账号管理页 */
.user-status { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; }
.user-status::before { content: ''; width: 8px; height: 8px; border-radius: 50%; }
.user-status.active { color: var(--eco-deep); }
.user-status.active::before { background: var(--eco); }
.user-status.disabled { color: var(--red); }
.user-status.disabled::before { background: var(--red); }

/* ---------- 通用组件 ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card .card-head {
  padding: 15px 20px 12px;
  display: flex; align-items: center; gap: 10px;
  border-bottom: 1px solid var(--line);
}
.card .card-head h3 { font-size: 14.5px; font-weight: 700; }
.card .card-head .hint { font-size: 12px; color: var(--ink-3); margin-left: auto; }
.card .card-body { padding: 16px 20px; }

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font); font-size: 13px; font-weight: 600;
  padding: 7px 15px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--surface);
  color: var(--ink-2); cursor: pointer;
  transition: all .15s;
}
.btn:hover { border-color: var(--eco); color: var(--eco-deep); background: var(--eco-050); }
.btn.primary { background: var(--eco); border-color: var(--eco); color: #fff; }
.btn.primary:hover { background: var(--eco-deep); border-color: var(--eco-deep); color: #fff; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.sm { padding: 4px 10px; font-size: 12px; }
.btn.danger:hover { border-color: var(--red); color: var(--red); background: var(--red-soft); }

input, select, textarea {
  font-family: var(--font); font-size: 13px; color: var(--ink);
  padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); outline: none; width: 100%;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--eco); box-shadow: 0 0 0 3px var(--eco-soft);
}
textarea { resize: vertical; min-height: 74px; }
label.f { display: block; margin-bottom: 12px; }
label.f > span { display: block; font-size: 12px; font-weight: 600; color: var(--ink-2); margin-bottom: 5px; }

.badge {
  display: inline-block; font-size: 11.5px; font-weight: 600;
  padding: 2px 10px; border-radius: 999px; white-space: nowrap;
}
.badge.eco { background: var(--eco-soft); color: var(--eco-deep); }
.badge.gray { background: #EFEFF1; color: var(--gray-brand); }
.badge.amber { background: var(--amber-soft); color: var(--amber); }
.badge.red { background: var(--red-soft); color: var(--red); }

.tag {
  display: inline-block; font-size: 11px; padding: 2px 9px;
  border-radius: 999px; background: var(--eco-050); color: var(--eco-deep);
  border: 1px solid var(--eco-soft); margin: 1px 2px;
}

/* ---------- 表格 ---------- */
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th {
  text-align: left; font-size: 12px; font-weight: 700; color: var(--ink-3);
  padding: 10px 14px; border-bottom: 1px solid var(--line);
  background: #FAFBF8; white-space: nowrap; letter-spacing: .03em;
}
.tbl td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tbody tr { transition: background .12s; }
.tbl tbody tr:hover { background: var(--eco-050); }
.tbl tbody tr:last-child td { border-bottom: none; }
.tbl .rowlink { cursor: pointer; }
.tbl .strong { font-weight: 700; color: var(--ink); }
.tbl .sub { font-size: 12px; color: var(--ink-3); }
.tbl .num { font-variant-numeric: tabular-nums; font-weight: 600; }

/* ---------- 工作台 ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.stat {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.stat::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--eco); border-radius: 3px 0 0 3px;
}
.stat.gray::before { background: var(--gray-brand); }
.stat.amber::before { background: var(--amber); }
.stat .label { font-size: 12px; color: var(--ink-3); font-weight: 600; }
.stat .value { font-size: 26px; font-weight: 800; margin-top: 4px; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.stat .value small { font-size: 13px; font-weight: 600; color: var(--ink-3); }
.stat .foot { font-size: 11.5px; color: var(--ink-3); margin-top: 3px; }

.dash-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 14px; align-items: start; }
.dash-col { display: flex; flex-direction: column; gap: 14px; }

/* 四象限任务 */
.quad-tabs { display: flex; gap: 6px; }
.quad-tabs button {
  font-size: 12px; font-weight: 600; padding: 4px 12px;
  border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink-3); cursor: pointer;
}
.quad-tabs button.on { background: var(--eco); border-color: var(--eco); color: #fff; }
.task-item {
  display: flex; align-items: flex-start; gap: 11px;
  padding: 10px 0; border-bottom: 1px dashed var(--line);
}
.task-item:last-child { border-bottom: none; }
.task-check {
  width: 18px; height: 18px; flex: none; margin-top: 3px;
  border: 2px solid var(--line); border-radius: 6px; cursor: pointer;
  transition: all .15s;
}
.task-check:hover { border-color: var(--eco); background: var(--eco-soft); }
.task-check.done { background: var(--eco); border-color: var(--eco); position: relative; }
.task-check.done::after {
  content: ''; position: absolute; left: 4px; top: 1px;
  width: 5px; height: 9px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.task-item .tt { font-weight: 600; font-size: 13px; }
.task-item .tt.done { text-decoration: line-through; color: var(--ink-3); font-weight: 400; }
.task-item .tm { font-size: 11.5px; color: var(--ink-3); margin-top: 2px; }
.task-item .tm .due { color: var(--amber); font-weight: 600; }

/* 漏斗 */
.funnel { display: flex; flex-direction: column; gap: 7px; }
.funnel-row { display: grid; grid-template-columns: 74px 1fr 92px; align-items: center; gap: 12px; font-size: 12.5px; }
.funnel-row .fname { color: var(--ink-2); font-weight: 600; text-align: right; }
.funnel-bar { height: 24px; background: var(--eco-050); border-radius: 6px; overflow: hidden; position: relative; }
.funnel-fill {
  height: 100%; border-radius: 6px;
  background: var(--eco); opacity: .85;
  transition: width .5s ease;
  min-width: 2px;
}
.funnel-row .fval { font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.funnel-row .fval b { color: var(--ink); }

/* 邮件小组件 */
.mail-item { padding: 10px 0; border-bottom: 1px dashed var(--line); }
.mail-item:last-child { border-bottom: none; }
.mail-item .ms { font-weight: 600; font-size: 13px; display: flex; gap: 8px; align-items: center; }
.mail-item .mm { font-size: 12px; color: var(--ink-3); margin-top: 3px; }
.read-track {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 700; color: var(--eco-deep);
  background: var(--eco-soft); padding: 1px 8px; border-radius: 999px;
}

/* ---------- 客户列表 ---------- */
.toolbar { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; align-items: center; }
.toolbar input[type=search] { width: 240px; }
.toolbar select { width: auto; }
.toolbar .spacer { flex: 1; }
.level-dot {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 7px;
  font-size: 11px; font-weight: 800;
}
.level-A { background: var(--eco); color: #fff; }
.level-B { background: var(--eco-soft); color: var(--eco-deep); }
.level-C { background: #EFEFF1; color: var(--gray-brand); }

/* ---------- 客户 360 ---------- */
.profile-head { display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap; }
.profile-head .pinfo { flex: 1; min-width: 280px; }
.profile-head h2 { font-size: 21px; font-weight: 800; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pmeta { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 10px; font-size: 12.5px; color: var(--ink-2); }
.pmeta .k { color: var(--ink-3); margin-right: 4px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 20px 0 16px; overflow-x: auto; }
.tabs button {
  font-family: var(--font); font-size: 13.5px; font-weight: 600;
  padding: 9px 16px; border: none; background: none; cursor: pointer;
  color: var(--ink-3); border-bottom: 2px solid transparent; margin-bottom: -1px;
  white-space: nowrap;
}
.tabs button.on { color: var(--eco-deep); border-bottom-color: var(--eco); }

/* 行动流时间线 */
.timeline { position: relative; padding-left: 26px; }
.timeline::before {
  content: ''; position: absolute; left: 8px; top: 6px; bottom: 6px;
  width: 2px; background: var(--line); border-radius: 2px;
}
.tl-item { position: relative; padding: 0 0 18px; }
.tl-item::before {
  content: ''; position: absolute; left: -24px; top: 5px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--surface); border: 3px solid var(--eco);
}
.tl-item.t-email::before { border-color: var(--amber); }
.tl-item.t-call::before { border-color: var(--gray-brand); }
.tl-item.t-quote::before { border-color: #2E7DC2; }
.tl-item.t-sample::before { border-color: #8B5CF6; }
.tl-item.t-note::before { border-color: var(--ink-3); }
.tl-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.tl-time { font-size: 11.5px; color: var(--ink-3); margin-left: auto; font-variant-numeric: tabular-nums; }
.tl-content { font-size: 13px; color: var(--ink-2); margin-top: 4px; }
.tl-next {
  margin-top: 6px; font-size: 12px; color: var(--eco-deep);
  background: var(--eco-050); border: 1px dashed var(--eco);
  border-radius: var(--radius-sm); padding: 6px 12px; display: inline-block;
}
.tl-next b { font-weight: 700; }
.tl-next .at { color: var(--amber); font-weight: 600; margin-left: 6px; }

.act-form { background: var(--eco-050); border: 1px solid var(--eco-soft); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 20px; }
.act-types { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
.act-types button {
  font-size: 12.5px; font-weight: 600; padding: 5px 14px;
  border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink-2); cursor: pointer;
}
.act-types button.on { background: var(--eco); color: #fff; border-color: var(--eco); }
.act-form .row { display: grid; grid-template-columns: 1fr 180px; gap: 10px; margin-top: 10px; }

/* ---------- 商机看板 ---------- */
.board-wrap { position: relative; }
.board {
  display: flex; gap: 13px; overflow-x: auto; padding-bottom: 18px; align-items: flex-start;
  cursor: grab;
  scrollbar-width: auto;               /* Firefox：恢复常规粗滚动条 */
  scrollbar-color: #B9C9B4 var(--eco-050);
}
.board.panning { cursor: grabbing; user-select: none; }
.board.panning * { pointer-events: none; }
/* 看板专属加粗横向滚动条（Webkit） */
.board::-webkit-scrollbar { height: 14px; }
.board::-webkit-scrollbar-track { background: var(--eco-050); border-radius: 14px; }
.board::-webkit-scrollbar-thumb {
  background: #B9C9B4; border: 3px solid transparent;
  background-clip: content-box; border-radius: 14px;
}
.board::-webkit-scrollbar-thumb:hover {
  background: var(--eco); border: 3px solid transparent; background-clip: content-box;
}
.board-nav { display: flex; gap: 6px; }
.board-nav button {
  width: 30px; height: 30px; border-radius: 9px;
  border: 1px solid var(--line); background: var(--surface);
  color: var(--ink-2); font-size: 16px; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all .15s;
}
.board-nav button:hover { border-color: var(--eco); color: var(--eco-deep); background: var(--eco-050); }
.bcol {
  flex: 0 0 252px; background: #F1F3EE; border-radius: var(--radius);
  display: flex; flex-direction: column; max-height: calc(100vh - 190px);
}
.bcol .bhead { padding: 12px 14px 10px; display: flex; align-items: baseline; gap: 8px; }
.bcol .bhead .bn { font-weight: 700; font-size: 13.5px; }
.bcol .bhead .bc { font-size: 11.5px; color: var(--ink-3); }
.bcol .bhead .ba { margin-left: auto; font-size: 12px; font-weight: 700; color: var(--eco-deep); font-variant-numeric: tabular-nums; }
.bcol.won .bhead .bn { color: var(--eco-deep); }
.bcol.lost .bhead .bn { color: var(--ink-3); }
.bcards { padding: 0 10px 10px; overflow-y: auto; display: flex; flex-direction: column; gap: 9px; min-height: 60px; }
.bcard {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 11px 13px; cursor: grab; box-shadow: var(--shadow);
  transition: transform .12s, box-shadow .12s;
}
.bcard:hover { transform: translateY(-1px); }
.bcard.dragging { opacity: .45; }
.bcol.dragover { outline: 2px dashed var(--eco); outline-offset: -2px; }
.bcard .bt { font-weight: 700; font-size: 13px; line-height: 1.45; }
.bcard .bc2 { font-size: 12px; color: var(--ink-3); margin-top: 3px; }
.bcard .bm { display: flex; align-items: center; margin-top: 8px; }
.bcard .amount { font-weight: 800; color: var(--eco-deep); font-variant-numeric: tabular-nums; }
.bcard .exp { margin-left: auto; font-size: 11px; color: var(--ink-3); }

/* ---------- 邮件中心 ---------- */
.mail-layout { display: grid; grid-template-columns: 190px 1fr 1.2fr; gap: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; height: calc(100vh - 170px); }
.mail-folders { border-right: 1px solid var(--line); padding: 12px 8px; background: #FAFBF8; overflow-y: auto; }
.mail-folders button {
  display: flex; align-items: center; gap: 9px; width: 100%;
  font-family: var(--font); font-size: 13px; font-weight: 500;
  padding: 8px 12px; margin-bottom: 2px; border: none; border-radius: var(--radius-sm);
  background: none; color: var(--ink-2); cursor: pointer; text-align: left;
}
.mail-folders button:hover { background: var(--eco-050); }
.mail-folders button.on { background: var(--eco-soft); color: var(--eco-deep); font-weight: 700; }
.mail-folders .cnt { margin-left: auto; font-size: 11px; color: var(--ink-3); }
.mail-list { border-right: 1px solid var(--line); overflow-y: auto; }
.ml-item { padding: 13px 16px; border-bottom: 1px solid var(--line); cursor: pointer; }
.ml-item:hover { background: var(--eco-050); }
.ml-item.on { background: var(--eco-soft); }
.ml-item .from { font-weight: 700; font-size: 12.5px; display: flex; align-items: center; gap: 6px; }
.ml-item .subj { font-weight: 600; font-size: 13px; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ml-item .snip { font-size: 12px; color: var(--ink-3); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ml-item .when { margin-left: auto; font-size: 11px; color: var(--ink-3); flex: none; }
.mail-reader { overflow-y: auto; padding: 22px 26px; }
.mail-reader h3 { font-size: 16px; font-weight: 800; }
.mail-reader .mh { font-size: 12.5px; color: var(--ink-3); margin: 8px 0 4px; }
.mail-reader .body-text { margin-top: 16px; font-size: 13.5px; color: var(--ink-2); white-space: pre-wrap; line-height: 1.8; }
.mail-empty { display: flex; align-items: center; justify-content: center; height: 100%; color: var(--ink-3); font-size: 13px; }
.star { cursor: pointer; color: var(--ink-3); flex: none; }
.star.on { color: var(--amber); }

/* 跟进策略 */
.tpl-steps { display: flex; flex-direction: column; gap: 12px; }
.tpl-item { border: 1px solid var(--line); border-radius: var(--radius); padding: 15px 18px; }
.tpl-item .th { display: flex; align-items: center; gap: 10px; }
.tpl-item .step-no {
  width: 24px; height: 24px; border-radius: 8px; flex: none;
  background: var(--eco); color: #fff; font-size: 12px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}
.tpl-item .tn { font-weight: 700; font-size: 13.5px; }
.tpl-item .ts { margin-left: auto; font-size: 12px; color: var(--ink-3); }
.tpl-item .tb { margin-top: 9px; font-size: 12.5px; color: var(--ink-2); white-space: pre-wrap; background: #FAFBF8; border-radius: var(--radius-sm); padding: 10px 14px; }

/* ---------- 订单 ---------- */
.subtabs { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.subtabs button {
  font-family: var(--font); font-size: 13px; font-weight: 600;
  padding: 7px 16px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-2);
}
.subtabs button.on { background: var(--ink); border-color: var(--ink); color: #fff; }

/* ---------- 产品/供应商 ---------- */
.prod-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 13px; }
.prod-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.prod-card .sku { font-size: 11px; color: var(--ink-3); font-weight: 700; letter-spacing: .06em; }
.prod-card .pn { font-weight: 700; font-size: 14px; margin-top: 4px; }
.prod-card .pm { font-size: 12px; color: var(--ink-3); margin-top: 3px; }
.prod-card .pp { margin-top: 10px; display: flex; align-items: baseline; gap: 8px; }
.prod-card .price { font-size: 19px; font-weight: 800; color: var(--eco-deep); font-variant-numeric: tabular-nums; }
.prod-card .moq { font-size: 11.5px; color: var(--ink-3); margin-left: auto; }
.stars { color: var(--amber); letter-spacing: 2px; font-size: 13px; }
.stars .off { color: var(--line); }

/* ---------- 决策报表 ---------- */
.report-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
.bar-row { display: grid; grid-template-columns: 92px 1fr 56px; gap: 10px; align-items: center; padding: 5px 0; font-size: 12.5px; }
.bar-row .bl { text-align: right; color: var(--ink-2); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { height: 18px; background: var(--eco-050); border-radius: 5px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--eco); border-radius: 5px; opacity: .8; min-width: 2px; }
.bar-fill.g { background: var(--gray-brand); }
.bar-row .bv { font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---------- 弹窗 ---------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(27,30,26,.36);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 8vh 20px 20px; z-index: 100; overflow-y: auto;
}
.modal {
  background: var(--surface); border-radius: 14px; width: 520px; max-width: 100%;
  box-shadow: 0 20px 60px rgba(27,30,26,.22); overflow: hidden;
}
.modal .mhead {
  padding: 16px 22px; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; font-weight: 800; font-size: 15px;
}
.modal .mhead .x { margin-left: auto; cursor: pointer; color: var(--ink-3); border: none; background: none; font-size: 18px; }
.modal .mbody { padding: 20px 22px; max-height: 62vh; overflow-y: auto; }
.modal .mfoot { padding: 14px 22px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; }
.form-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: #fff; font-size: 13px; font-weight: 600;
  padding: 10px 22px; border-radius: 999px; z-index: 200;
  box-shadow: 0 8px 30px rgba(0,0,0,.25);
  animation: toast-in .25s ease;
}
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }

.empty {
  text-align: center; color: var(--ink-3); font-size: 13px; padding: 34px 0;
}
.leaf-deco { color: var(--eco); opacity: .9; }

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: #D5DAD0; border-radius: 9px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #B9C1B2; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

@media (max-width: 1100px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .dash-grid, .report-grid { grid-template-columns: 1fr; }
  .mail-layout { grid-template-columns: 160px 1fr; }
  .mail-reader { display: none; }
}
