/* 管理端 / 渠道端 · 首页仪表盘（无地图 · Chart.js） */

.vf-panel--dash:has(.vf-dash--home) {
  overflow-y: auto;
  overflow-x: hidden;
}

.vf-admin-content:has(> .vf-panel--dash.is-visible) {
  overflow-y: auto;
}

.vf-dash--home {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-bottom: 20px;
  position: relative;
  z-index: 1;
}

/* —— 顶栏 —— */
.vf-dash--home .vf-dash-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-radius: var(--vf-radius-lg);
  border: 1px solid rgba(56, 189, 248, 0.2);
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.12), rgba(15, 22, 40, 0.92));
}

.vf-dash--home .vf-dash-toolbar__title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
}

.vf-dash--home .vf-dash-toolbar__sub {
  margin: 4px 0 0;
  font-size: 0.78rem;
  color: var(--vf-text-muted);
}

.vf-dash--home .vf-dash-toolbar__meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.vf-dash-live {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #34d399;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(52, 211, 153, 0.12);
  border: 1px solid rgba(52, 211, 153, 0.25);
}

.vf-dash--home .vf-dash-toolbar__time {
  font-size: 0.72rem;
  color: var(--vf-text-muted);
  font-family: var(--vf-mono);
}

/* —— KPI —— */
.vf-dash--home .vf-kpi-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

@media (max-width: 1400px) {
  .vf-dash--home .vf-kpi-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .vf-dash--home .vf-kpi-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.vf-dash--home .vf-kpi {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--vf-radius);
  border: 1px solid var(--vf-border);
  background: rgba(21, 29, 46, 0.85);
  min-height: 72px;
}

.vf-dash--home .vf-kpi__icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: rgba(56, 189, 248, 0.1);
  color: var(--vf-accent);
}

.vf-dash--home .vf-kpi__icon svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

.vf-dash--home .vf-kpi__label {
  display: block;
  font-size: 0.68rem;
  color: var(--vf-text-muted);
  margin-bottom: 2px;
}

.vf-dash--home .vf-kpi__value {
  display: block;
  font-family: var(--vf-mono);
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.2;
}

.vf-dash--home .vf-kpi--accent .vf-kpi__value {
  color: var(--vf-accent);
}

.vf-dash--home .vf-kpi--ok .vf-kpi__value {
  color: #34d399;
}

.vf-dash--home .vf-kpi--warn .vf-kpi__value {
  color: #fbbf24;
}

/* —— 面板 —— */
.vf-dash--home .vf-dash-panel {
  padding: 12px 14px;
  border-radius: var(--vf-radius);
  border: 1px solid var(--vf-border);
  background: rgba(21, 29, 46, 0.88);
  min-height: 0;
}

.vf-dash--home .vf-dash-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.vf-dash--home .vf-dash-panel__title {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 700;
}

.vf-dash--home .vf-dash-panel__hint {
  font-size: 0.65rem;
  color: var(--vf-text-muted);
}

/* —— 栅格 —— */
.vf-dash-home-charts {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 12px;
}

.vf-dash-home-mid {
  display: grid;
  grid-template-columns: 1fr 1fr 300px;
  gap: 12px;
  align-items: stretch;
}

.vf-dash-home-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.vf-dash-home-bottom {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 12px;
  align-items: start;
}

@media (max-width: 1200px) {
  .vf-dash-home-charts,
  .vf-dash-home-mid,
  .vf-dash-home-split,
  .vf-dash-home-bottom {
    grid-template-columns: 1fr;
  }
}

/* —— 图表容器（固定高度，避免空白圆） —— */
.vf-dash-chart-box {
  position: relative;
  width: 100%;
  height: 220px;
  min-height: 200px;
}

.vf-dash-chart-box--sm {
  height: 180px;
  min-height: 160px;
}

.vf-dash-chart-box canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
  max-height: none !important;
}

/* —— 健康度双环 —— */
.vf-dash-health {
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: 100%;
  justify-content: center;
}

.vf-dash-health__card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--vf-radius-sm);
  border: 1px solid rgba(148, 163, 184, 0.12);
  background: rgba(15, 22, 40, 0.6);
}

.vf-dash--home .vf-dash-ring {
  --vf-ring-pct: 0;
  width: 64px;
  height: 64px;
  flex-shrink: 0;
  border-radius: 50%;
  background: conic-gradient(
    var(--vf-accent) calc(var(--vf-ring-pct) * 1%),
    rgba(148, 163, 184, 0.18) 0
  );
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.vf-dash--home .vf-dash-ring::before {
  content: "";
  position: absolute;
  inset: 7px;
  border-radius: 50%;
  background: var(--vf-surface-inset);
}

.vf-dash--home .vf-dash-ring__inner {
  position: relative;
  z-index: 1;
  text-align: center;
}

.vf-dash--home .vf-dash-ring__value {
  display: block;
  font-family: var(--vf-mono);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--vf-accent);
}

.vf-dash-health__meta strong {
  display: block;
  font-size: 0.78rem;
  margin-bottom: 2px;
}

.vf-dash-health__meta span {
  font-size: 0.65rem;
  color: var(--vf-text-muted);
}

/* —— 表格 —— */
.vf-dash--home .vf-dash-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.74rem;
}

.vf-dash--home .vf-dash-table th,
.vf-dash--home .vf-dash-table td {
  padding: 7px 8px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
  text-align: left;
  vertical-align: top;
}

.vf-dash--home .vf-dash-table th {
  font-size: 0.65rem;
  color: var(--vf-text-muted);
  font-weight: 600;
}

.vf-dash--home .vf-dash-table tbody tr:hover td {
  background: rgba(56, 189, 248, 0.05);
}

.vf-dash--home .vf-dash-table .vf-amt {
  font-family: var(--vf-mono);
  font-weight: 600;
  color: var(--vf-accent);
  white-space: nowrap;
}

.vf-dash-table-wrap {
  max-height: 220px;
  overflow: auto;
}

/* —— 营销 + 快捷 —— */
.vf-dash-mkt-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.vf-dash-mkt-card {
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid var(--vf-border);
  background: var(--vf-surface-inset);
  font-size: 0.72rem;
}

.vf-dash-mkt-card strong {
  display: block;
  font-size: 0.75rem;
  margin-bottom: 4px;
  color: var(--vf-accent);
}

.vf-dash-side-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.vf-quick-grid--home {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.vf-quick-btn--home {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 68px;
  padding: 10px 8px;
  font-size: 0.78rem;
  text-align: center;
  border-radius: var(--vf-radius-sm);
  border: 1px solid var(--vf-border);
  background: rgba(15, 22, 40, 0.75);
  color: var(--vf-text);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.vf-quick-btn--home:hover {
  border-color: rgba(56, 189, 248, 0.4);
  background: rgba(56, 189, 248, 0.08);
}

.vf-quick-btn--home.vf-quick-btn--primary {
  border-color: rgba(56, 189, 248, 0.45);
  background: rgba(2, 132, 199, 0.2);
}

.vf-quick-btn--home .vf-quick-btn__icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: rgba(56, 189, 248, 0.12);
  color: var(--vf-accent);
}

.vf-quick-btn--home .vf-quick-btn__icon svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

.vf-channel-kpi-note {
  font-size: 0.65rem;
  color: var(--vf-text-muted);
  display: block;
  margin-top: 2px;
}
