/* ── dashboard.css ── */

/* Search area */
.dash-search-area {
  padding: 14px 16px 12px;
  background: var(--card);
  border-bottom: 1px solid var(--border-light);
}

/* Stats */
.dash-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 16px 16px 0;
}

@media (min-width: 480px) {
  .dash-stats { grid-template-columns: repeat(4, 1fr); }
}
@media (min-width: 768px) {
  .dash-stats { grid-template-columns: repeat(4, 1fr); }
}

.stat-card {
  background: var(--card);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  border: 1.5px solid var(--border-light);
  transition: var(--transition);
  cursor: pointer;
}
.stat-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.stat-icon { font-size: 22px; margin-bottom: 8px; line-height: 1; }
.stat-val {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 400;
  color: var(--text);
  line-height: 1;
  margin-bottom: 4px;
}
.stat-label { font-size: 11px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }

.stat-card.s-total  { background: var(--primary-bg); border-color: var(--primary-xlight); }
.stat-card.s-total .stat-val { color: var(--primary-mid); }

.stat-card.s-low    { background: var(--warning-light); border-color: rgba(224,123,57,0.25); }
.stat-card.s-low .stat-val { color: var(--warning); }

.stat-card.s-cat    { background: #eef0ff; border-color: rgba(99,102,241,0.2); }
.stat-card.s-cat .stat-val { color: #4f52c5; }

.stat-card.s-out    { background: var(--danger-light); border-color: rgba(214,40,57,0.2); }
.stat-card.s-out .stat-val { color: var(--danger); }

/* Dashboard sections */
.dash-section {
  padding: 20px 16px 0;
}
.dash-section:last-child { padding-bottom: 100px; }

.sec-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.sec-title {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 400;
  color: var(--text);
}
.sec-link {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary-mid);
  cursor: pointer;
  background: none;
  border: none;
  font-family: var(--font-body);
  padding: 4px 0;
  transition: var(--transition);
}
.sec-link:hover { color: var(--accent); }

/* Chart card */
.chart-card {
  background: var(--card);
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border-light);
  padding: 16px;
  min-height: 80px;
}

.chart-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.chart-empty {
  width: 100%;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  padding: 14px 0;
}

/* Pie chart */
.pie-container {
  position: relative;
  width: 110px;
  height: 110px;
  flex-shrink: 0;
}
.pie-container canvas {
  width: 110px !important;
  height: 110px !important;
}
.pie-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.pie-center-val {
  font-family: var(--font-display);
  font-size: 20px;
  color: var(--text);
  line-height: 1;
}
.pie-center-lbl {
  font-size: 9px;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.chart-legend {
  flex: 1;
  min-width: 120px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
}
.legend-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}
.legend-name { font-size: 13px; color: var(--text-secondary); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.legend-val  { font-size: 13px; font-weight: 700; color: var(--text); }

/* Recent list */
#recent-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Search results area */
#dash-search-results {
  padding: 12px 16px;
}