body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  margin: 0;
  padding: 0;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  color: #111827;
}
header {
  background: rgba(0, 0, 0, 0.5);
  color: white;
  padding: 1rem;
}
nav a {
  color: white;
  margin-right: 1.5rem;
  text-decoration: none;
  font-weight: 500;
}
nav a:hover {
  opacity: 0.8;
}
main {
  max-width: 1100px;
  margin: 2rem auto;
  padding: 2rem;
  background: white;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

h1 {
  color: #111827;
  margin-top: 0;
  margin-bottom: 0.5rem;
}

.muted {
  color: #6b7280;
}

.card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  padding: 1rem;
  border-radius: 8px;
}

.form-card {
  max-width: 480px;
  margin: 0 auto;
  padding: 1.5rem;
}

label {
  display: block;
  margin-bottom: 0.35rem;
  color: #1f2937;
}
input {
  width: 100%;
  padding: 0.7rem 0.75rem;
  border-radius: 10px;
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #111827;
  font-size: 1rem;
  margin-bottom: 0.9rem;
}
button {
  width: 100%;
  padding: 0.9rem;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: white;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
}
button:hover {
  background: linear-gradient(135deg, #1d4ed8, #1e40af);
}

.status {
  margin-top: 0.75rem;
  font-size: 0.95rem;
}
.status.error {
  color: #b91c1c;
}
.status.success {
  color: #15803d;
}
.hint {
  color: #4b5563;
  margin-top: 0.75rem;
  font-size: 0.95rem;
}
a {
  color: #2563eb;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.hero-card {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  background: linear-gradient(135deg, #eef2ff, #f8fafc);
}

.hero-card h2 {
  margin: 0 0 0.5rem;
  color: #1e3a8a;
}

.pill {
  background: #2563eb;
  color: #fff;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
}

.action-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}

.action-list li {
  display: grid;
  gap: 0.35rem;
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  background: #2563eb;
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, outline-color 0.15s ease;
}

.button-link:hover {
  background: #1d4ed8;
}

.button-link:focus-visible {
  outline: 2px solid #fbbf24;
  outline-offset: 2px;
  box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.5);
}

.button-link.secondary {
  background: #1e40af;
}

.button-link.secondary:hover {
  background: #1e3a8a;
}

.button-link.secondary:focus-visible {
  outline: 2px solid #fbbf24;
  outline-offset: 2px;
  box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.5);
}

.button-link.tertiary {
  background: #fff;
  color: #1e3a8a;
  border-color: #cbd5f5;
}

.button-link.tertiary:hover {
  background: #e5ecff;
  border-color: #93c5fd;
}

.button-link.tertiary:focus-visible {
  outline: 2px solid #1d4ed8;
  outline-offset: 2px;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.4);
}
.button-link.tertiary:hover {
  background: #eff6ff;
  border-color: #93c5fd;
}
.step-list {
  padding-left: 1.25rem;
  margin: 0.5rem 0 0;
  color: #334155;
  display: grid;
  gap: 0.5rem;
}
.stat {
  background: #eef2ff;
  padding: 0.75rem;
  border-radius: 8px;
  border: 1px solid #e0e7ff;
}
.stat h4 {
  margin: 0 0 0.35rem 0;
  font-size: 0.95rem;
  color: #334155;
}
.stat p {
  margin: 0;
  font-weight: 700;
  color: #111827;
}
.stat p.delta {
  font-variant-numeric: tabular-nums;
  position: relative;
}
.stat p.delta.positive {
  color: #15803d;
}
.stat p.delta.positive::after {
  content: " (positive performance)";
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.stat p.delta.negative {
  color: #b91c1c;
}
.stat p.delta.negative::after {
  content: " (negative performance)";
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.chart-container {
  position: relative;
  height: 400px;
  margin: 2rem 0;
}

.range-tabs {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin: 1rem 0 0.5rem;
}
.range-tabs button {
  width: auto;
  padding: 0.55rem 1rem;
  font-weight: 600;
  border-radius: 999px;
  border: 1px solid #e0e7ff;
  background: #eef2ff;
  color: #1e3a8a;
}
.range-tabs button.active {
  background: #2563eb;
  color: #fff;
  border-color: #2563eb;
}

.table-wrapper {
  overflow-x: auto;
}

.table-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  text-align: left;
  padding: 0.75rem;
  border-bottom: 1px solid #e2e8f0;
}

.data-table th {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
}

.data-table tbody tr:hover {
  background: #f1f5f9;
}

.pagination {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1rem;
}

.pagination button {
  width: auto;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  background: #2563eb;
}

.pagination button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
