/* ==========================================================================
   Dashboard Page
   ========================================================================== */

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-xl);
}

@media (max-width: 1200px) {
  .dashboard-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

/* ---- Page subtitle ---- */
.page-subtitle {
  font-size: 15px;
  color: var(--text-secondary);
  margin: 0;
}

/* ---- Top Section: Health + Stats ---- */
.dashboard-top-section {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--spacing-md);
  align-items: start;
  margin-bottom: var(--spacing-xl);
}

@media (max-width: 900px) {
  .dashboard-top-section {
    grid-template-columns: 1fr;
  }
}

/* ---- Stats Grid (2x2 in top section) ---- */
.dashboard-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--spacing-md);
}

@media (max-width: 640px) {
  .dashboard-stats-grid {
    grid-template-columns: 1fr;
  }
}

/* ---- Health Score Circle ---- */
.health-score {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-xl);
}

.health-score-circle {
  position: relative;
  width: 160px;
  height: 160px;
  margin-bottom: var(--spacing-md);
}

.health-score-circle svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.health-score-circle .track {
  fill: none;
  stroke: var(--bg-tertiary);
  stroke-width: 8;
}

.health-score-circle .fill {
  fill: none;
  stroke-width: 8;
  stroke-linecap: round;
  transition: stroke-dashoffset 1s ease, stroke 0.4s ease;
}

.health-score-circle .fill.green { stroke: var(--status-green); }
.health-score-circle .fill.yellow { stroke: var(--status-yellow); }
.health-score-circle .fill.red { stroke: var(--status-red); }

.health-score-value {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.health-score-number {
  font-size: 40px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--text-primary);
}

.health-score-unit {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-top: 4px;
}

.health-score-label {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.health-score-sublabel {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* ---- Dashboard Charts ---- */
.dashboard-charts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-xl);
}

@media (max-width: 900px) {
  .dashboard-charts {
    grid-template-columns: 1fr;
  }
}

.chart-container {
  position: relative;
  height: 240px;
  padding: var(--spacing-md);
}

/* ---- Activity / Recent Items ---- */
.dashboard-recent {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--spacing-md);
}

@media (max-width: 900px) {
  .dashboard-recent {
    grid-template-columns: 1fr;
  }
}

.recent-item {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  padding: var(--spacing-md);
  border-bottom: 1px solid var(--border-color);
  transition: background-color var(--transition);
}

.recent-item:last-child {
  border-bottom: none;
}

.recent-item:hover {
  background: var(--bg-secondary);
}

.recent-item-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  font-size: 16px;
  flex-shrink: 0;
}

.recent-item-content {
  flex: 1;
  min-width: 0;
}

.recent-item-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.recent-item-meta {
  font-size: 12px;
  color: var(--text-tertiary);
}

/* ---- Quick Actions ---- */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--spacing-sm);
}

.quick-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-lg) var(--spacing-md);
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}

.quick-action-btn:hover {
  border-color: var(--accent-blue);
  color: var(--accent-blue);
  box-shadow: var(--card-shadow-hover);
}

.quick-action-btn .icon {
  font-size: 24px;
}
