/* ==========================================================================
   Dashboard Pro · 总览模块专属视觉层
   只在 #dashboardView 内生效，不改变客户中心、CPF、邮件、海牙等其他模块。
   ========================================================================== */

#appView #dashboardView {
  --dash-ink: #10263f;
  --dash-ink-soft: #465b72;
  --dash-muted: #7a8999;
  --dash-navy: #0d2744;
  --dash-blue: #1e5b86;
  --dash-gold: #b88a38;
  --dash-gold-soft: #f3ead8;
  --dash-green: #25866f;
  --dash-line: rgba(19, 45, 70, .1);
  --dash-line-soft: rgba(19, 45, 70, .065);
  --dash-surface: #ffffff;
  --dash-canvas: #f7f8fa;
  --dash-shadow: 0 16px 45px rgba(17, 38, 62, .065);
  font-family: "Avenir Next", "SF Pro Text", "PingFang SC", "Hiragino Sans GB",
    "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--dash-ink);
  letter-spacing: .01em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

#appView #dashboardView *,
#appView #dashboardView *::before,
#appView #dashboardView *::after {
  box-sizing: border-box;
}

#amberDashboard,
#nemeDashboard {
  display: grid;
  gap: 22px;
}

body.neme-mode #amberDashboard {
  display: none !important;
}

/* ---------- 顶部运营信息带 ---------- */
#appView #dashboardView .dashboard-masthead {
  position: relative;
  isolation: isolate;
  min-height: 138px;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  padding: 26px 30px;
  border: 1px solid rgba(225, 191, 120, .24);
  border-radius: 22px;
  background:
    radial-gradient(circle at 84% 16%, rgba(91, 148, 184, .28), transparent 31%),
    radial-gradient(circle at 12% 112%, rgba(190, 147, 66, .14), transparent 36%),
    linear-gradient(118deg, #0b2038 0%, #102c4a 52%, #163b5b 100%);
  box-shadow: 0 22px 55px rgba(10, 31, 52, .18);
}

#appView #dashboardView .dashboard-masthead::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  opacity: .32;
  pointer-events: none;
  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: 42px 42px;
  mask-image: linear-gradient(90deg, transparent 0%, #000 52%, #000 100%);
}

#appView #dashboardView .dashboard-masthead::after {
  content: "";
  position: absolute;
  right: -92px;
  top: -125px;
  width: 310px;
  height: 310px;
  border: 1px solid rgba(231, 202, 142, .2);
  border-radius: 50%;
  box-shadow:
    0 0 0 44px rgba(255, 255, 255, .022),
    0 0 0 92px rgba(255, 255, 255, .015);
  pointer-events: none;
}

#appView #dashboardView .dashboard-masthead-copy {
  max-width: 720px;
}

#appView #dashboardView .dashboard-masthead .eyebrow {
  display: block;
  margin: 0 0 13px;
  color: #d9b76d;
  font-family: "Avenir Next", "SF Pro Text", "PingFang SC", sans-serif;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 2.5px;
  line-height: 1.45;
  writing-mode: horizontal-tb;
}

#appView #dashboardView .dashboard-masthead h2 {
  margin: 0;
  color: #fff;
  font-family: "Songti SC", "STSong", "Iowan Old Style", Georgia, serif;
  font-size: clamp(30px, 3.1vw, 42px);
  font-weight: 600;
  line-height: 1.18;
  letter-spacing: -.035em;
  text-shadow: 0 3px 20px rgba(0, 0, 0, .18);
}

#appView #dashboardView .dashboard-masthead-aside {
  flex: 0 0 auto;
  display: grid;
  justify-items: end;
  gap: 13px;
}

#appView #dashboardView .dashboard-live-state {
  min-width: 206px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px 15px;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 13px;
  background: rgba(255, 255, 255, .085);
  box-shadow: inset 0 1px rgba(255, 255, 255, .08);
  backdrop-filter: blur(12px);
}

#appView #dashboardView .dashboard-live-state > i {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #58d0aa;
  box-shadow: 0 0 0 5px rgba(88, 208, 170, .13);
}

#appView #dashboardView .dashboard-live-state > b {
  color: #f8fbff;
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.35;
}

#appView #dashboardView .neme-dashboard-masthead {
  min-height: 130px;
}

/* ---------- 指标卡 ---------- */
#appView #dashboardView .dashboard-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin: 0;
}

#appView #dashboardView .dashboard-metric {
  --metric-accent: var(--dash-blue);
  position: relative;
  overflow: hidden;
  min-height: 124px;
  padding: 20px 22px;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 12px;
  border: 1px solid var(--dash-line);
  border-radius: 17px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .98), rgba(252, 253, 254, .98));
  box-shadow: 0 10px 30px rgba(18, 41, 66, .05);
}

#appView #dashboardView .dashboard-metric::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, var(--metric-accent), color-mix(in srgb, var(--metric-accent) 12%, transparent));
}

#appView #dashboardView .dashboard-metric::after {
  content: "";
  position: absolute;
  right: -21px;
  bottom: -34px;
  width: 98px;
  height: 98px;
  border: 1px solid color-mix(in srgb, var(--metric-accent) 14%, transparent);
  border-radius: 50%;
  box-shadow: 0 0 0 20px color-mix(in srgb, var(--metric-accent) 3%, transparent);
  pointer-events: none;
}

#appView #dashboardView .metric-review,
#appView #dashboardView .dashboard-metric.is-warn {
  --metric-accent: var(--dash-gold);
}

#appView #dashboardView .metric-jobs {
  --metric-accent: #3f739a;
}

#appView #dashboardView .metric-mails,
#appView #dashboardView .dashboard-metric.is-done {
  --metric-accent: var(--dash-green);
}

#appView #dashboardView .metric-heading {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

#appView #dashboardView .metric-index {
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  min-width: 27px;
  height: 22px;
  padding: 0 6px;
  border: 1px solid color-mix(in srgb, var(--metric-accent) 26%, transparent);
  border-radius: 6px;
  color: color-mix(in srgb, var(--metric-accent) 88%, #18334e);
  background: color-mix(in srgb, var(--metric-accent) 7%, #fff);
  font-family: "SF Mono", "Roboto Mono", ui-monospace, monospace;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: .08em;
}

#appView #dashboardView .metric-label {
  min-width: 0;
  color: #516376;
  font-size: 13px;
  font-weight: 680;
  line-height: 1.45;
  letter-spacing: .015em;
  writing-mode: horizontal-tb;
}

#appView #dashboardView .dashboard-metric > strong {
  position: relative;
  z-index: 1;
  align-self: center;
  color: #132d49;
  font-family: "Iowan Old Style", "Baskerville", Georgia, "Songti SC", serif;
  font-size: clamp(38px, 4vw, 48px);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -.045em;
  font-variant-numeric: tabular-nums lining-nums;
}

/* ---------- 主工作区 ---------- */
#appView #dashboardView .dashboard-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  align-items: stretch;
}

#appView #dashboardView .dashboard-actions-panel {
  grid-column: 1 / -1;
}

#appView #dashboardView .dash-panel {
  padding: 23px 24px;
  border: 1px solid var(--dash-line);
  border-radius: 17px;
  background: var(--dash-surface);
  box-shadow: 0 11px 34px rgba(18, 41, 66, .048);
}

#appView #dashboardView .dash-panel .panel-head {
  align-items: flex-start;
  gap: 16px;
  margin: 0 0 18px;
  padding: 0 0 15px;
  border-bottom: 1px solid var(--dash-line-soft);
}

#appView #dashboardView .dash-panel .panel-head > div:first-child {
  min-width: 0;
}

#appView #dashboardView .dash-panel .panel-head h3 {
  margin: 5px 0 0;
  color: var(--dash-ink);
  font-family: "Avenir Next", "SF Pro Text", "PingFang SC", sans-serif;
  font-size: 17px;
  font-weight: 720;
  line-height: 1.4;
  letter-spacing: -.015em;
}

#appView #dashboardView .dash-panel .eyebrow.dark {
  color: #9c752f;
  font-family: "Avenir Next", "SF Pro Text", sans-serif;
  font-size: 9.5px;
  font-weight: 850;
  letter-spacing: 2px;
  line-height: 1.4;
}

#appView #dashboardView .dash-panel-meta {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

#appView #dashboardView .dash-count-pill {
  display: inline-flex;
  align-items: center;
  min-height: 27px;
  padding: 4px 10px;
  border: 1px solid var(--dash-line);
  border-radius: 999px;
  color: #657588;
  background: #f7f9fb;
  font-size: 10.5px;
  font-weight: 650;
  white-space: nowrap;
}

#appView #dashboardView .dash-panel .text-btn {
  padding: 5px 0;
  color: #2b6389;
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
}

#appView #dashboardView .dash-panel .text-btn:hover {
  color: #a67727;
}

/* ---------- 快捷入口 ---------- */
#appView #dashboardView .quick-grid.dashboard-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 11px;
}

#appView #dashboardView .quick-grid.dashboard-actions.neme-actions {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

#appView #dashboardView .dash-action-card {
  min-width: 0;
  min-height: 60px;
  padding: 11px 14px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 16px;
  align-items: center;
  justify-items: stretch;
  gap: 11px;
  text-align: left;
  border: 1px solid var(--dash-line);
  border-radius: 13px;
  background: linear-gradient(135deg, #fbfcfd, #f7f9fb);
  color: var(--dash-ink);
  box-shadow: none;
  transform: none;
}

#appView #dashboardView .dash-action-card:hover {
  transform: translateY(-2px);
  border-color: rgba(184, 138, 56, .35);
  background: #fff;
  box-shadow: 0 11px 24px rgba(19, 44, 68, .075);
}

#appView #dashboardView .dash-action-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(25, 61, 91, .08);
  border-radius: 11px;
  color: #275879;
  background: linear-gradient(145deg, #eef4f8, #e4edf4);
}

#appView #dashboardView .dash-action-icon .nav-svg {
  width: 19px;
  height: 19px;
  stroke-width: 1.7;
}

#appView #dashboardView .dash-action-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
  writing-mode: horizontal-tb;
}

#appView #dashboardView .dash-action-copy b {
  overflow: hidden;
  color: #173551;
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: .005em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#appView #dashboardView .dash-action-arrow {
  align-self: start;
  color: #a5b0bc;
  font-size: 13px;
  font-style: normal;
  line-height: 1;
  transition: color .16s ease, transform .16s ease;
}

#appView #dashboardView .dash-action-card:hover .dash-action-arrow {
  color: #a47627;
  transform: translate(1px, -1px);
}

/* ---------- 运行任务 ---------- */
#appView #dashboardView .dash-jobs {
  display: grid;
  gap: 9px;
}

#appView #dashboardView .dash-job {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  min-height: 59px;
  padding: 11px 13px 11px 15px;
  border: 1px solid var(--dash-line-soft);
  border-radius: 11px;
  background: #fafbfc;
  cursor: pointer;
}

#appView #dashboardView .dash-job::before {
  content: "";
  position: absolute;
  left: 0;
  top: 12px;
  bottom: 12px;
  width: 2px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--dash-gold), #e1c88e);
}

#appView #dashboardView .dash-job:hover {
  border-color: rgba(184, 138, 56, .34);
  background: #fffdf8;
}

#appView #dashboardView .dash-job-main {
  min-width: 0;
  display: grid;
  gap: 4px;
}

#appView #dashboardView .dash-job-main b {
  overflow: hidden;
  color: #203b56;
  font-size: 12.5px;
  font-weight: 680;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#appView #dashboardView .dash-job-main span {
  overflow: hidden;
  margin: 0;
  color: #83909e;
  font-size: 10.5px;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#appView #dashboardView .dash-job-right {
  display: grid;
  justify-items: end;
  gap: 4px;
}

#appView #dashboardView .dash-job-right .badge {
  padding: 4px 9px;
  font-size: 10px;
}

#appView #dashboardView .dash-job-right > span {
  color: #8b97a5;
  font-size: 10px;
  white-space: nowrap;
}

/* ---------- 最近客户 ---------- */
#appView #dashboardView .dashboard-recent-panel .list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 20px;
}

#appView #dashboardView .dashboard-recent-panel .list-row {
  min-width: 0;
  padding: 13px 11px;
  border-top: 0;
  border-bottom: 1px solid var(--dash-line-soft);
  border-radius: 9px;
  cursor: pointer;
  transition: background .16s ease, border-color .16s ease;
}

#appView #dashboardView .dashboard-recent-panel .list-row:nth-child(-n+2) {
  border-bottom-color: var(--dash-line-soft);
}

#appView #dashboardView .dashboard-recent-panel .list-row:hover {
  border-bottom-color: transparent;
  background: #f7fafc;
}

#appView #dashboardView .dashboard-recent-panel .avatar {
  width: 38px;
  height: 38px;
  border: 1px solid rgba(28, 69, 104, .07);
  border-radius: 11px;
  color: #24506f;
  background: linear-gradient(145deg, #eff4f7, #e4ebf0);
}

#appView #dashboardView .dashboard-recent-panel .list-main b {
  color: #1a344d;
  font-size: 12.5px;
  font-weight: 680;
}

#appView #dashboardView .dashboard-recent-panel .list-main span {
  margin-top: 3px;
  color: #84919f;
  font-size: 10.5px;
}

/* ---------- NEME 总览 ---------- */
body.neme-mode #nemeDashboard .neme-dash-kpis {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

body.neme-mode #nemeDashboard .neme-dash-grid {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
  margin-top: 0;
}

body.neme-mode #nemeDashboard .neme-dash-wide {
  grid-column: 1 / -1;
}

body.neme-mode #nemeDashboard .neme-dash-card,
body.neme-mode #nemeDashboard .neme-dash-row {
  padding: 13px 14px;
  border-color: var(--dash-line-soft);
  border-radius: 12px;
  background: #fafbfc;
}

body.neme-mode #nemeDashboard .neme-dash-row:hover {
  border-color: rgba(184, 138, 56, .3);
  background: #fffdf8;
}

body.neme-mode #nemeDashboard .neme-dash-card-main b,
body.neme-mode #nemeDashboard .neme-dash-row-main b {
  color: #1d3952;
  font-size: 12.5px;
  font-weight: 690;
}

body.neme-mode #nemeDashboard .neme-dash-card-main span,
body.neme-mode #nemeDashboard .neme-dash-row-main span {
  color: #83919f;
  font-size: 11px;
}

/* ---------- 空状态 ---------- */
#appView #dashboardView .dash-jobs.empty,
#appView #dashboardView .dashboard-recent-panel .list.empty {
  min-height: 88px;
  display: grid;
  place-items: center;
  color: #929eaa;
  font-size: 12px;
}

#appView #dashboardView .dashboard-recent-panel .list.empty {
  grid-template-columns: 1fr;
}

/* ---------- 响应式 ---------- */
@media (max-width: 1240px) {
  #appView #dashboardView .dashboard-metrics,
  body.neme-mode #nemeDashboard .neme-dash-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #appView #dashboardView .quick-grid.dashboard-actions,
  #appView #dashboardView .quick-grid.dashboard-actions.neme-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1080px) {
  #appView #dashboardView .dashboard-workspace,
  body.neme-mode #nemeDashboard .neme-dash-grid {
    grid-template-columns: 1fr;
  }

  #appView #dashboardView .dashboard-actions-panel,
  body.neme-mode #nemeDashboard .neme-dash-wide {
    grid-column: auto;
  }

  #appView #dashboardView .dashboard-recent-panel .list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  #appView #dashboardView {
    --dash-shadow: 0 10px 28px rgba(17, 38, 62, .06);
  }

  #appView #dashboardView .dashboard-masthead {
    min-height: 0;
    padding: 25px 22px;
    align-items: flex-start;
    flex-direction: column;
    gap: 20px;
    border-radius: 17px;
  }

  #appView #dashboardView .dashboard-masthead h2 {
    font-size: 30px;
  }

  #appView #dashboardView .dashboard-masthead-aside {
    width: 100%;
    justify-items: stretch;
  }

  #appView #dashboardView .dashboard-live-state {
    min-width: 0;
    width: 100%;
  }

  #appView #dashboardView .dashboard-metrics,
  body.neme-mode #nemeDashboard .neme-dash-kpis {
    gap: 12px;
  }

  #appView #dashboardView .dashboard-metric {
    min-height: 118px;
    padding: 18px;
  }

  #appView #dashboardView .dashboard-metric > strong {
    font-size: 38px;
  }

  #appView #dashboardView .dash-panel {
    padding: 19px 17px;
    border-radius: 15px;
  }

  #appView #dashboardView .dash-panel .panel-head {
    flex-wrap: wrap;
  }

  #appView #dashboardView .dash-panel-meta {
    justify-content: flex-start;
  }

  #appView #dashboardView .quick-grid.dashboard-actions,
  #appView #dashboardView .quick-grid.dashboard-actions.neme-actions {
    grid-template-columns: 1fr;
  }

  #appView #dashboardView .dash-action-card {
    min-height: 58px;
  }

  #appView #dashboardView .dash-job {
    grid-template-columns: 1fr;
    align-items: flex-start;
  }

  #appView #dashboardView .dash-job-right {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
}

@media (max-width: 520px) {
  #appView #dashboardView .dashboard-metrics,
  body.neme-mode #nemeDashboard .neme-dash-kpis {
    grid-template-columns: 1fr;
  }

  #appView #dashboardView .dashboard-metric {
    min-height: 112px;
  }

}

@media (prefers-reduced-motion: reduce) {
  #appView #dashboardView .dash-action-card,
  #appView #dashboardView .dash-action-arrow,
  #appView #dashboardView .dashboard-recent-panel .list-row {
    transition: none !important;
  }
}
