:root {
  --color-success: #28a745;
  --color-warning: #ffc107;
  --color-error: #dc3545;
  --color-primary: #007bff;
  --bg-card: #f8f9fa;
  --text-primary: #212529;
  --text-secondary: #6c757d;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
  color: var(--text-primary);
  background: #ffffff;
}

.nav {
  background: var(--color-primary);
  padding: 1rem 2rem;
  display: flex;
  gap: 2rem;
}

.nav a {
  color: white;
  text-decoration: none;
  font-weight: 500;
}

.nav a:hover {
  text-decoration: underline;
}

main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem;
}

.dashboard-header {
  text-align: center;
  margin-bottom: 3rem;
}

.dashboard-header h1 {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.branch-selector {
  margin: 1rem 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.branch-selector label {
  font-weight: 500;
  color: var(--text-secondary);
}

.branch-selector select {
  padding: 0.5rem 1rem;
  font-size: 1rem;
  border: 2px solid var(--color-primary);
  border-radius: 4px;
  background: white;
  color: var(--text-primary);
  cursor: pointer;
  min-width: 120px;
}

.branch-selector select:hover {
  border-color: #0056b3;
}

.branch-selector select:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
}

.last-update, .commit-info {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
}

/* Clickable metric card links */
.metric-card-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.metric-card-link:hover .metric-card {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.metric-card {
  background: var(--bg-card);
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  border-left: 4px solid var(--color-primary);
  transition: transform 0.2s, box-shadow 0.2s;
}

.card-action {
  font-size: 0.8rem;
  color: var(--color-primary);
  margin-top: 0.5rem;
}

.metric-card.success {
  border-left-color: var(--color-success);
}

.metric-card.warning {
  border-left-color: var(--color-warning);
}

.metric-card.error {
  border-left-color: var(--color-error);
}

.metric-card h3 {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.metric-value {
  font-size: 3rem;
  font-weight: bold;
  margin: 0.5rem 0;
}

.metric-subtitle {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.trend {
  display: block;
  font-size: 0.85rem;
  margin-top: 0.25rem;
}

.charts-section {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
  gap: 2rem;
  margin-bottom: 3rem;
}

.chart-container {
  background: var(--bg-card);
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.chart-container h2 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
}

footer {
  text-align: center;
  padding: 2rem;
  color: var(--text-secondary);
  border-top: 1px solid #dee2e6;
  margin-top: 3rem;
}

.no-data {
  text-align: center;
  padding: 3rem;
  color: var(--text-secondary);
  font-size: 1.2rem;
}

/* Reports Section */
.reports-section {
  margin-top: 3rem;
}

.reports-section h2 {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  text-align: center;
}

.reports-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.report-card {
  display: block;
  background: var(--bg-card);
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  border-left: 4px solid var(--color-primary);
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s, box-shadow 0.2s;
}

.report-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.report-card h3 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  color: var(--color-primary);
}

.report-card p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin: 0;
}

/* Commit History Section */
.history-section {
  margin-top: 3rem;
}

.history-section h2 {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
}

.history-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-card);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.history-table th,
.history-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid #dee2e6;
}

.history-table th {
  background: #e9ecef;
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
}

.history-table tr:hover {
  background: rgba(0,0,0,0.02);
}

.history-table a {
  color: var(--color-primary);
  text-decoration: none;
}

.history-table a:hover {
  text-decoration: underline;
}

.history-table td.good {
  color: var(--color-success);
  font-weight: 600;
}

.history-table td.bad {
  color: var(--color-error);
  font-weight: 600;
}

.history-table td.neutral {
  color: var(--text-secondary);
}

.commit-info a {
  color: var(--color-primary);
  text-decoration: none;
}

.commit-info a:hover {
  text-decoration: underline;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  .metrics-grid {
    grid-template-columns: 1fr;
  }

  .charts-section {
    grid-template-columns: 1fr;
  }

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

  main {
    padding: 1rem;
  }

  .nav {
    padding: 1rem;
  }
}
