/* ─────────────────────────────────────────────────────────────────────── */
/* Dashboard Page — Overview, Widgets, Charts                                */
/* ─────────────────────────────────────────────────────────────────────── */

/* ─────────────────────────────────────────────────────────────────────── */
/* Dashboard Grid                                                            */
/* ─────────────────────────────────────────────────────────────────────── */

.page-dashboard {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* ─────────────────────────────────────────────────────────────────────── */
/* Dashboard Section                                                         */
/* ─────────────────────────────────────────────────────────────────────── */

.dashboard-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dashboard-section-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 500;
  color: var(--text);
  margin: 0;
}

/* ─────────────────────────────────────────────────────────────────────── */
/* Stats Grid (4 columns: Tickets, Votes, Apps, Moderation)                 */
/* ─────────────────────────────────────────────────────────────────────── */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.stat-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
  background-color: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: var(--transition-colors);
}

.stat-card:hover {
  background-color: var(--bg-3);
  border-color: var(--hover-bd);
}

.stat-label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-mute);
}

.stat-value {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.stat-number {
  font-size: 28px;
  font-weight: 500;
  color: var(--text);
  font-family: var(--font-display);
}

.stat-unit {
  font-size: 12px;
  color: var(--text-dim);
}

.stat-sparkline {
  width: 100%;
  height: 40px;
  margin-top: 4px;
}

.stat-change {
  font-size: 11px;
  margin-top: 4px;
}

.stat-change.up {
  color: var(--st-accepted);
}

.stat-change.down {
  color: var(--t-bug);
}

/* ─────────────────────────────────────────────────────────────────────── */
/* Activity Feed                                                             */
/* ─────────────────────────────────────────────────────────────────────── */

.activity-feed {
  display: flex;
  flex-direction: column;
  gap: 0;
  background-color: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.activity-item {
  display: flex;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  transition: background-color var(--transition-colors);
  cursor: pointer;
}

.activity-item:hover {
  background-color: var(--bg-3);
}

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

.activity-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: var(--bg-3);
  color: var(--text);
  flex-shrink: 0;
  font-size: 14px;
}

.activity-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.activity-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.activity-description {
  font-size: 12px;
  color: var(--text-mute);
  line-height: 1.4;
}

.activity-time {
  font-size: 11px;
  color: var(--text-mute);
  margin-top: 2px;
}

/* ─────────────────────────────────────────────────────────────────────── */
/* Two-Column Layout (Feed + Chart)                                         */
/* ─────────────────────────────────────────────────────────────────────── */

.dashboard-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
}

/* ─────────────────────────────────────────────────────────────────────── */
/* Chart Container                                                           */
/* ─────────────────────────────────────────────────────────────────────── */

.chart-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  background-color: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.chart-title {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  margin: 0;
}

.chart {
  width: 100%;
  height: 240px;
}

/* ─────────────────────────────────────────────────────────────────────── */
/* List Card (Top Votes, Top Apps)                                          */
/* ─────────────────────────────────────────────────────────────────────── */

.list-card {
  display: flex;
  flex-direction: column;
  gap: 0;
  background-color: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.list-card-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}

.list-card-items {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  transition: background-color var(--transition-colors);
  cursor: pointer;
}

.list-item:hover {
  background-color: var(--bg-3);
}

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

.list-item-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

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

.list-item-meta {
  font-size: 11px;
  color: var(--text-mute);
}

.list-item-value {
  font-size: 13px;
  font-weight: 500;
  color: var(--accent);
}

/* ─────────────────────────────────────────────────────────────────────── */
/* Empty State                                                               */
/* ─────────────────────────────────────────────────────────────────────── */

.dashboard-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 48px 24px;
  text-align: center;
}

.dashboard-empty-icon {
  font-size: 48px;
  opacity: 0.5;
}

.dashboard-empty-title {
  font-size: 16px;
  font-weight: 500;
  color: var(--text);
}

.dashboard-empty-text {
  font-size: 13px;
  color: var(--text-mute);
  max-width: 320px;
}

/* ─────────────────────────────────────────────────────────────────────── */
/* Responsive                                                                */
/* ─────────────────────────────────────────────────────────────────────── */

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

  .dashboard-row {
    grid-template-columns: 1fr;
  }
}

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

  .chart {
    height: 200px;
  }
}

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

  .stat-card {
    padding: 12px;
    gap: 4px;
  }

  .stat-number {
    font-size: 24px;
  }

  .activity-item {
    padding: 10px 12px;
  }

  .chart-card,
  .list-card {
    padding: 12px;
  }
}
