/* ============================================================
   dashboard.css — 统计卡、图表、图例
   ============================================================ */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
@media (max-width: 1100px) { .stats-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .stats-grid { grid-template-columns: 1fr; } }

.charts-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 16px;
}
@media (max-width: 1000px) { .charts-grid { grid-template-columns: 1fr; } }

/* 柱状图 */
.bar-chart { width: 100%; height: 190px; display: block; overflow: visible; }
.bar-chart .bar {
  fill: var(--accent);
  opacity: .85;
  transition: var(--transition);
  cursor: pointer;
}
.bar-chart .bar:hover { opacity: 1; }
.bar-chart .bar.zero { fill: var(--surface-3); opacity: 1; }
.bar-chart .axis-label {
  fill: var(--text-faint);
  font-size: 9.5px;
  font-family: var(--mono);
}
.bar-chart .grid-line {
  stroke: var(--border-soft);
  stroke-width: 1;
  stroke-dasharray: 3 4;
}
.bar-chart .bar-value {
  fill: var(--text-dim);
  font-size: 9.5px;
  font-family: var(--mono);
  text-anchor: middle;
}

/* 环形图 */
.donut-wrap {
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
  justify-content: center;
}
.donut { width: 148px; height: 148px; flex-shrink: 0; }
.donut circle { transition: var(--transition); }
.donut .seg { cursor: pointer; }
.donut .seg:hover { opacity: .82; }
.donut .center-num {
  fill: var(--text);
  font-size: 21px;
  font-weight: 600;
  font-family: var(--mono);
  text-anchor: middle;
}
.donut .center-label {
  fill: var(--text-faint);
  font-size: 10px;
  text-anchor: middle;
}

.legend { display: flex; flex-direction: column; gap: 9px; min-width: 130px; }
.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--text-dim);
}
.legend-swatch {
  width: 9px; height: 9px;
  border-radius: 2.5px;
  flex-shrink: 0;
}
.legend-item .val {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--text);
}

/* 最近入库的小表 */
.recent-list { display: flex; flex-direction: column; }
.recent-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--border-soft);
  font-size: 13px;
  transition: background .1s;
}
.recent-item:hover { background: var(--surface-2); }
.recent-item:last-child { border-bottom: 0; }
.recent-item .q {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.recent-item .a {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--ok);
  max-width: 190px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.recent-item .t {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-faint);
  white-space: nowrap;
}

/* 迷你进度条 */
.mini-bar {
  height: 4px;
  background: var(--surface-3);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 8px;
}
.mini-bar > i {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width .4s ease;
}
