/* ============================================================
   新版首页 dash2 · 沉稳海军蓝 + 图表按内容适配
   与 app.css 并存，只作用于 #view-dash2 内部；顶栏工具栏沿用 app.css
   ============================================================ */

#view-dash2 {
  --ink: #1c2534;
  --ink2: #586374;
  --mut: #8f99a9;
  --line: #e7eaf0;
  --line2: #f3f5f9;
  --navy: #27406b;
  --navy2: #3d5c8c;
  --brand: #3f6598;
  --teal: #1a7f70;
  --amber: #c08a25;
  --brick: #b8544a;
  --slate: #7c8798;
  --soft: #f5f6f9;
  color: var(--ink);
  font-size: 13.5px;
  -webkit-font-smoothing: antialiased;
}

#view-dash2 .d2-num { font-variant-numeric: tabular-nums; letter-spacing: -.012em; }

/* ── 工具条（沿用 v-head，但重排） ── */
#view-dash2 .v-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
#view-dash2 .v-head h2 { font-size: 17px; font-weight: 700; letter-spacing: .2px; }
#view-dash2 .v-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-left: auto; }
#view-dash2 .dsel {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line); border-radius: 7px; padding: 4px 9px;
  font-size: 11.5px; color: var(--ink2); background: #fff; white-space: nowrap;
}
#view-dash2 .dsel label { font-size: 10.5px; color: var(--mut); }
#view-dash2 .dsel .inp { border: 0; padding: 0; height: 22px; font-size: 11.5px; background: transparent; color: var(--ink); font-weight: 600; }
#view-dash2 .dsel .inp:focus { outline: none; box-shadow: none; }
#view-dash2 .dsel:hover { border-color: #b6c6dd; background: #f7f9fc; }
#view-dash2 .seg { display: inline-flex; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; background: #fff; }
#view-dash2 .seg button { border: 0; background: transparent; padding: 5px 11px; font-size: 11.5px; color: var(--ink2); cursor: pointer; }
#view-dash2 .seg button.on { background: var(--navy); color: #fff; font-weight: 600; }

/* ── 问候条（窄、克制） ── */
#view-dash2 .hello { display: flex; align-items: center; gap: 16px; padding: 0 2px 14px; flex-wrap: wrap; }
#view-dash2 .hello h1 { font-size: 17px; font-weight: 700; letter-spacing: .2px; }
#view-dash2 .hello .sub { font-size: 12px; color: var(--ink2); margin-top: 4px; }
#view-dash2 .hello .sub b { color: var(--brick); font-weight: 600; }
#view-dash2 .hello .sub .ok { color: var(--teal); }
#view-dash2 .quote {
  margin-left: auto; font-size: 11.5px; color: #6d6350;
  background: #faf7f0; border: 1px solid #eee5d3;
  padding: 7px 14px; border-radius: 8px; max-width: 560px; line-height: 1.55;
  display: flex; gap: 7px; align-items: flex-start;
}
#view-dash2 .quote i { color: var(--amber); font-style: normal; font-size: 13px; line-height: 1.3; }

/* ── 通用卡 ── */
#view-dash2 .d2card { background: #fff; border: 1px solid var(--line); border-radius: 12px; }
#view-dash2 .ch { display: flex; align-items: center; gap: 8px; padding: 12px 16px 10px; }
#view-dash2 .ch h3 { font-size: 12.5px; font-weight: 600; letter-spacing: .2px; }
#view-dash2 .ch .sub { font-size: 10.5px; color: var(--mut); }
#view-dash2 .ch .sp { flex: 1; }
#view-dash2 .ch .lnk { font-size: 11px; color: var(--brand); cursor: pointer; font-weight: 500; }
#view-dash2 .ch .lnk:hover { text-decoration: underline; }
#view-dash2 .ch .units {
  font-size: 10px; color: #8b96a6; background: var(--line2);
  padding: 1px 7px; border-radius: 4px; border: 1px solid var(--line);
}

/* ═══ 第 1 层：趋势 / 环节 / 关键数 ═══ */
#view-dash2 .l1 { display: grid; grid-template-columns: 1.28fr 1fr 262px; gap: 12px; margin-bottom: 12px; }
#view-dash2 .chartbox { padding: 0 6px 6px; }
#view-dash2 #cTrend { height: 186px; }
#view-dash2 #cStage { height: 186px; }

/* 右侧关键数字 */
#view-dash2 .kpis { padding: 10px 16px 12px; }
#view-dash2 .kpis .row { display: flex; align-items: center; gap: 11px; padding: 8.5px 0; cursor: pointer; border-radius: 7px; transition: background .15s; }
#view-dash2 .kpis .row:hover { background: #f7f9fc; }
#view-dash2 .kpis .row + .row { border-top: 1px solid var(--line2); }
#view-dash2 .kpis .ic {
  width: 30px; height: 30px; border-radius: 8px; flex: none;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; font-style: normal;
}
#view-dash2 .kpis .tx { flex: 1; min-width: 0; }
#view-dash2 .kpis .k { font-size: 10.5px; color: var(--mut); letter-spacing: .2px; }
#view-dash2 .kpis .v { font-size: 19px; font-weight: 700; letter-spacing: -.6px; margin-top: 2px; line-height: 1.15; }
#view-dash2 .kpis .v small { font-size: 10px; font-weight: 400; color: var(--mut); margin-left: 2px; }
#view-dash2 .kpis .s { font-size: 9.5px; color: var(--mut); margin-top: 1px; }
#view-dash2 .kpis .s b { font-weight: 600; }

/* ═══ 第 2 层：商机 / 合同 ═══ */
#view-dash2 .two { display: grid; grid-template-columns: 1.06fr 1fr; gap: 12px; margin-bottom: 12px; }
#view-dash2 .mb { padding: 0 16px 14px; }
#view-dash2 .mhead { display: flex; align-items: center; gap: 9px; padding: 12px 16px 10px; }
#view-dash2 .mhead .ic {
  width: 24px; height: 24px; border-radius: 7px; flex: none;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; font-style: normal;
}
#view-dash2 .mhead .t { font-size: 12.5px; font-weight: 600; }
#view-dash2 .mhead .s { font-size: 10px; color: var(--mut); margin-top: 1px; }
#view-dash2 .mhead .sp { flex: 1; }
#view-dash2 .mhead .lnk { font-size: 11px; color: var(--brand); cursor: pointer; }
#view-dash2 .mhead .lnk:hover { text-decoration: underline; }

/* 商机：左阶段条 + 右环形 */
#view-dash2 .opgrid { display: grid; grid-template-columns: 1fr 152px; gap: 10px; }
#view-dash2 .stg .r {
  display: grid; grid-template-columns: 58px 1fr 64px; gap: 8px;
  align-items: center; margin: 6.5px 0; font-size: 11.5px; cursor: pointer;
  border-radius: 5px; padding: 1px 2px; transition: background .15s;
}
#view-dash2 .stg .r:hover { background: #f7f9fc; }
#view-dash2 .stg .r .n { color: var(--ink2); white-space: nowrap; }
#view-dash2 .stg .r .b { height: 20px; background: var(--line2); border-radius: 4px; position: relative; overflow: hidden; }
#view-dash2 .stg .r .b i { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, #8aa6cc, #3f6598); min-width: 2px; }
#view-dash2 .stg .r .b em {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  font-style: normal; font-size: 10px; font-weight: 600; color: #fff;
  text-shadow: 0 1px 2px rgba(20, 32, 52, .35);
}
#view-dash2 .stg .r .b.light i { background: linear-gradient(90deg, #d8e3f0, #b9cde5); }
#view-dash2 .stg .r .b.light em { color: #5b6f89; text-shadow: none; }
#view-dash2 .stg .r .v { text-align: right; font-size: 10.5px; font-weight: 600; color: var(--ink2); }
#view-dash2 #cPieWin { height: 120px; }
#view-dash2 .pietx { text-align: center; font-size: 10px; color: var(--mut); margin-top: -2px; }

/* 合同 */
#view-dash2 .ctsum { display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; margin-bottom: 2px; }
#view-dash2 .ctsum .it { cursor: pointer; }
#view-dash2 .ctsum .it .k { font-size: 10px; color: var(--mut); }
#view-dash2 .ctsum .it .v { font-size: 17px; font-weight: 700; margin-top: 2px; letter-spacing: -.5px; }
#view-dash2 .ctsum .it .v small { font-size: 9.5px; font-weight: 400; color: var(--mut); margin-left: 2px; }
#view-dash2 #cCtBar { height: 86px; }
#view-dash2 .m4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; margin-top: 6px; }
#view-dash2 .m4 .x {
  border: 1px solid var(--line); border-radius: 8px; padding: 8px 9px;
  text-align: center; cursor: pointer; transition: .15s;
}
#view-dash2 .m4 .x:hover { transform: translateY(-1px); box-shadow: 0 3px 10px rgba(24, 48, 110, .08); }
#view-dash2 .m4 .x .k { font-size: 9.5px; color: var(--mut); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#view-dash2 .m4 .x .v { font-size: 15px; font-weight: 700; margin-top: 3px; }
#view-dash2 .m4 .x .v small { font-size: 9px; font-weight: 400; color: var(--mut); margin-left: 1px; }
#view-dash2 .m4 .x.t { background: #f2f8f7; border-color: #d5ebe7; }
#view-dash2 .m4 .x.v { background: #f4f6fa; border-color: #e2e7ef; }
#view-dash2 .m4 .x.r { background: #fbf3f2; border-color: #f2dcd9; }

/* ═══ 第 3 层：账龄 / 回款构成 / 应收 TOP5 ═══ */
#view-dash2 .l3 { display: grid; grid-template-columns: 1.1fr 1fr 1.15fr; gap: 12px; margin-bottom: 12px; }
#view-dash2 #cAge { height: 172px; }
#view-dash2 #cWay { height: 154px; }
#view-dash2 .legend-under { display: flex; flex-wrap: wrap; gap: 8px 12px; padding: 0 14px 12px; font-size: 10px; color: var(--mut); }
#view-dash2 .legend-under span { display: flex; align-items: center; gap: 4px; }
#view-dash2 .legend-under em { width: 7px; height: 7px; border-radius: 2px; display: block; font-style: normal; }
#view-dash2 .legend-under b { color: var(--ink2); font-weight: 600; }

/* 应收 TOP5：账龄分段横条（D 方案） */
#view-dash2 .artop { padding: 2px 16px 12px; }
#view-dash2 .artop .r { padding: 7px 0; border-bottom: 1px solid var(--line2); cursor: pointer; }
#view-dash2 .artop .r:last-child { border-bottom: 0; }
#view-dash2 .artop .r:hover .nm { color: var(--brand); }
#view-dash2 .artop .h1 { display: flex; align-items: baseline; gap: 6px; font-size: 11.5px; }
#view-dash2 .artop .nm { color: var(--ink); font-weight: 600; max-width: 40%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#view-dash2 .artop .no { font-size: 9.5px; color: var(--mut); }
#view-dash2 .artop .amt { margin-left: auto; font-size: 11.5px; font-weight: 700; color: var(--ink); }
#view-dash2 .artop .bar { height: 9px; border-radius: 5px; background: #eef1f6; margin: 5px 0 4px; display: flex; overflow: hidden; }
#view-dash2 .artop .bar i { display: block; height: 100%; }
#view-dash2 .artop .bar .pd { background: linear-gradient(90deg, #a9c6e4, #7fa8c9); }
#view-dash2 .artop .bar .od { background: linear-gradient(90deg, #d98b82, #b8544a); }
#view-dash2 .artop .h2 { display: flex; align-items: center; gap: 8px; font-size: 9.5px; color: var(--mut); }
#view-dash2 .artop .tag { padding: 0 5px; border-radius: 3px; font-weight: 600; font-size: 9px; }
#view-dash2 .artop .tag.r { background: #fbeae8; color: var(--brick); }
#view-dash2 .artop .tag.a { background: #fbf1dd; color: #9a6d10; }
#view-dash2 .artop .tag.g { background: #e9f4f2; color: var(--teal); }
#view-dash2 .artop .lg { display: flex; gap: 10px; font-size: 9.5px; color: var(--mut); padding: 4px 16px 10px; }
#view-dash2 .artop .lg span { display: flex; align-items: center; gap: 4px; }
#view-dash2 .artop .lg em { width: 8px; height: 5px; border-radius: 2px; display: block; font-style: normal; }

/* ═══ 第 4 层：灯 / 待办 / 现金 ═══ */
#view-dash2 .l4 { display: grid; grid-template-columns: 1.15fr 1fr 1fr; gap: 12px; }
#view-dash2 .cb { padding: 0 16px 12px; }
#view-dash2 .lm {
  display: flex; align-items: center; gap: 9px; padding: 8px 0;
  border-bottom: 1px solid var(--line2); font-size: 12px; cursor: pointer;
}
#view-dash2 .lm:last-child { border-bottom: 0; }
#view-dash2 .lm:hover .t { color: var(--ink); }
#view-dash2 .lm .d { width: 5px; height: 5px; border-radius: 50%; flex: none; }
#view-dash2 .lm .d.r { background: var(--brick); box-shadow: 0 0 0 3px #f8e6e4; }
#view-dash2 .lm .d.a { background: var(--amber); box-shadow: 0 0 0 3px #fbf1dd; }
#view-dash2 .lm .d.g { background: var(--teal); box-shadow: 0 0 0 3px #e4f4f1; }
#view-dash2 .lm .t { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink2); }
#view-dash2 .lm .t b { color: var(--ink); font-weight: 600; }
#view-dash2 .lm .v { font-size: 11px; font-weight: 600; flex: none; }
#view-dash2 .lm .v.r { color: var(--brick); }
#view-dash2 .lm .v.a { color: #a5760f; }
#view-dash2 .lm .v.g { color: var(--teal); }

/* 待办 Tab */
#view-dash2 .tabs2 { display: flex; gap: 6px; padding: 0 16px 8px; }
#view-dash2 .tabs2 button {
  border: 1px solid var(--line); background: #fff; border-radius: 6px;
  padding: 3px 10px; font-size: 11px; color: var(--ink2); cursor: pointer;
}
#view-dash2 .tabs2 button.on { background: var(--navy); border-color: var(--navy); color: #fff; font-weight: 600; }
#view-dash2 .tabs2 button i { font-style: normal; font-size: 9.5px; opacity: .8; margin-left: 3px; }
#view-dash2 .tk {
  display: flex; gap: 9px; padding: 7.5px 0; border-bottom: 1px solid var(--line2);
  font-size: 12px; align-items: center; cursor: pointer;
}
#view-dash2 .tk:last-child { border-bottom: 0; }
#view-dash2 .tk:hover .tt { color: var(--brand); }
#view-dash2 .tk .dd { font-size: 10px; color: var(--mut); width: 36px; flex: none; }
#view-dash2 .tk .tt { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink2); }
#view-dash2 .tk .w { font-size: 10px; font-weight: 600; color: var(--brand); flex: none; }
#view-dash2 .tk .w.h { color: var(--brick); }
#view-dash2 .cb .empty2 { padding: 18px 0; text-align: center; font-size: 11.5px; color: var(--mut); }

/* 现金走势 */
#view-dash2 #cCash { height: 136px; margin-top: 2px; }
#view-dash2 .cashfoot { display: flex; justify-content: space-between; align-items: baseline; padding: 6px 16px 12px; font-size: 10.5px; color: var(--mut); }
#view-dash2 .cashfoot b { color: var(--ink); font-size: 13px; font-weight: 700; }

/* 「我的业务」条（总经理/业务员都有） */
#view-dash2 .mine {
  display: flex; align-items: center; gap: 0; flex-wrap: wrap;
  background: linear-gradient(96deg, #f7f9fc, #fbfcfe);
  border: 1px solid var(--line); border-radius: 12px;
  padding: 11px 18px; margin-bottom: 12px;
}
#view-dash2 .mine .lab {
  font-size: 11px; font-weight: 700; color: var(--navy);
  letter-spacing: .5px; padding-right: 16px; margin-right: 4px;
  border-right: 1px solid var(--line); white-space: nowrap;
}
#view-dash2 .mine .it { padding: 0 18px; border-right: 1px solid var(--line2); }
#view-dash2 .mine .it:last-child { border-right: 0; }
#view-dash2 .mine .it .k { font-size: 10px; color: var(--mut); }
#view-dash2 .mine .it .v { font-size: 15px; font-weight: 700; margin-top: 2px; letter-spacing: -.4px; }
#view-dash2 .mine .it .v small { font-size: 9.5px; font-weight: 400; color: var(--mut); margin-left: 2px; }
#view-dash2 .mine .rk { margin-left: auto; font-size: 11px; color: var(--ink2); }
#view-dash2 .mine .rk b { color: var(--amber); font-size: 15px; font-weight: 700; }

/* 骨架 / 空态 */
#view-dash2 .d2sk { color: var(--mut); font-size: 11.5px; padding: 18px 0; text-align: center; }
#view-dash2 .d2-err {
  background: #fbf3f2; border: 1px solid #f2dcd9; color: var(--brick);
  border-radius: 9px; padding: 10px 14px; font-size: 12px; margin-bottom: 12px;
}
#view-dash2 .kpis .s.up { color: var(--teal); }
#view-dash2 .kpis .s.down { color: var(--brick); }

/* ═══════════ 响应式 ═══════════ */
@media (max-width: 1440px) {
  #view-dash2 .l1 { grid-template-columns: 1.2fr 1fr 240px; }
}
@media (max-width: 1240px) {
  #view-dash2 .l1 { grid-template-columns: 1fr 1fr; }
  #view-dash2 .l1 > .d2card:nth-child(3) { grid-column: 1 / -1; }
  #view-dash2 .kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0 18px; }
  #view-dash2 .kpis .row { padding: 8px 0; }
  #view-dash2 .kpis .row + .row { border-top: 1px solid var(--line2); }
  #view-dash2 .l3 { grid-template-columns: 1fr 1fr; }
  #view-dash2 .l3 > .d2card:nth-child(3) { grid-column: 1 / -1; }
  #view-dash2 .l4 { grid-template-columns: 1fr 1fr; }
  #view-dash2 .l4 > .d2card:nth-child(3) { grid-column: 1 / -1; }
}
@media (max-width: 980px) {
  #view-dash2 .two { grid-template-columns: 1fr; }
  #view-dash2 .opgrid { grid-template-columns: 1fr 160px; }
}
@media (max-width: 760px) {
  #view-dash2 { font-size: 13px; }
  #view-dash2 .v-head { gap: 8px; }
  #view-dash2 .v-head h2 { font-size: 16px; width: 100%; }
  #view-dash2 .v-tools { margin-left: 0; width: 100%; gap: 6px; }
  #view-dash2 .dsel { flex: 1 1 auto; min-width: 0; }
  #view-dash2 .dsel .inp { flex: 1; min-width: 0; width: 100%; }
  #view-dash2 .hello { gap: 8px; padding-bottom: 12px; }
  #view-dash2 .hello h1 { font-size: 16px; }
  #view-dash2 .hello .sub { font-size: 11.5px; line-height: 1.55; }
  #view-dash2 .quote { margin-left: 0; max-width: 100%; width: 100%; font-size: 11px; }
  #view-dash2 .l1,
  #view-dash2 .l3,
  #view-dash2 .l4 { grid-template-columns: 1fr; }
  #view-dash2 .l1 > .d2card:nth-child(3),
  #view-dash2 .l3 > .d2card:nth-child(3),
  #view-dash2 .l4 > .d2card:nth-child(3) { grid-column: auto; }
  #view-dash2 .kpis { grid-template-columns: 1fr 1fr; gap: 0 12px; padding: 8px 14px 12px; }
  #view-dash2 .kpis .v { font-size: 17px; }
  #view-dash2 #cTrend, #view-dash2 #cStage { height: 168px; }
  #view-dash2 #cAge { height: 160px; }
  #view-dash2 #cCash { height: 124px; }
  #view-dash2 .opgrid { grid-template-columns: 1fr 120px; gap: 6px; }
  #view-dash2 .stg .r { grid-template-columns: 50px 1fr 48px; font-size: 11px; }
  #view-dash2 .m4 { grid-template-columns: 1fr 1fr; }
  #view-dash2 .mine { padding: 10px 12px; gap: 8px 0; }
  #view-dash2 .mine .lab { width: 100%; border-right: 0; padding-right: 0; }
  #view-dash2 .mine .it { padding: 0 12px 0 0; margin-right: 12px; flex: 1 1 40%; }
  #view-dash2 .mine .rk { margin-left: 0; width: 100%; }
  #view-dash2 .lm, #view-dash2 .tk { padding: 9px 0; }
  #view-dash2 .artop { padding: 2px 12px 10px; }
}
@media (max-width: 420px) {
  #view-dash2 .kpis { grid-template-columns: 1fr; }
  #view-dash2 .kpis .row + .row { border-top: 1px solid var(--line2); }
  #view-dash2 .opgrid { grid-template-columns: 1fr; }
  #view-dash2 .opgrid > div:last-child { display: none; }
}

/* 常用页面快捷入口（v20261106D） */
#view-dash2 .quick { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 0 2px 4px; }
#view-dash2 .quick .q-lab { font-size: 12px; color: var(--ink2); }
#view-dash2 .quick .q-chip {
  border: 1px solid var(--line); background: var(--card, #fff); color: var(--ink);
  font-size: 12.5px; padding: 5px 12px; border-radius: 999px; cursor: pointer; transition: all .15s;
}
#view-dash2 .quick .q-chip:hover { border-color: var(--brand); color: var(--brand); }
#view-dash2 .quick .q-chip.on { background: var(--brand); border-color: var(--brand); color: #fff; }
#view-dash2 .quick .q-edit { padding: 5px 9px; color: var(--ink2); }
#view-dash2 .quick .q-done { border-style: dashed; color: var(--brand); }
