/**
 * Dashboard-specific styles
 */

/* Dashboard Grid Layout */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 20px;
  padding: 20px;
}

/* Metric cards: 3 across (span 2 of 6) */
.metric-card {
  grid-column: span 2;
}

/* Metric Cards */
.metric-card {
  background: var(--bg-primary);
  border-radius: 8px;
  padding: 24px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
}

.metric-card h3 {
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 12px;
  font-weight: 600;
}

.metric-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}

/* Chart Cards */
/* Chart cards: full width by default (span 6 of 6) */
.chart-card {
  grid-column: span 6;
  background: var(--bg-primary);
  border-radius: 8px;
  padding: 20px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
}

/* Half-width charts: 2 across (span 3 of 6) */
.chart-card-half {
  grid-column: span 3;
}

.chart-container {
  position: relative;
  height: 300px;
}

/* Export Button */
.export-btn {
  padding: 6px 14px;
  font-size: 0.875rem;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.2s;
}

.export-btn:hover {
  background: var(--bg-secondary);
  border-color: var(--link-color);
}

/* Chart Card Title */
.chart-card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 12px 0;
}

/* Top Organizations Table */
.top-orgs-table {
  width: 100%;
  border-collapse: collapse;
}

.top-orgs-table th {
  text-align: left;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  padding: 6px 8px;
  border-bottom: 1px solid var(--border-color);
}

.top-orgs-table th:last-child {
  text-align: right;
  width: 80px;
}

.top-orgs-table td {
  padding: 8px;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--border-color);
}

.top-orgs-table td:last-child {
  text-align: right;
  font-weight: 600;
}

.top-orgs-table tr:last-child td {
  border-bottom: none;
}

.org-rank {
  display: inline-block;
  width: 22px;
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* Responsive Layout */
@media (max-width: 900px) {
  .chart-card-half {
    grid-column: span 6;
  }
}

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

  .metric-card,
  .chart-card,
  .chart-card-half {
    grid-column: span 1;
  }

  .metric-card {
    padding: 16px;
  }

  .metric-value {
    font-size: 1.75rem;
  }

  .chart-card {
    padding: 16px;
  }

  .chart-container {
    height: 250px;
  }
}
