* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #12161c;
  background: #eef2f5;
}

.page-header,
.section-controls,
.section-band,
.auth-shell {
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: 24px 0 12px;
}

.page-main {
  padding-bottom: 32px;
}

.section-controls,
.section-band,
.flash-banner {
  margin-top: 16px;
}

.section-controls {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
}

.section-controls label {
  min-width: 180px;
}

.section-band,
.flash-banner,
.auth-panel {
  background: #ffffff;
  border: 1px solid #d2dae1;
  border-radius: 8px;
  padding: 16px;
}

.summary-grid,
.chart-grid,
.two-column {
  display: grid;
  gap: 16px;
}

.summary-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.chart-grid,
.two-column {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.chart-grid > section,
.two-column > div,
.two-column > section {
  min-width: 0;
}

.metric-card {
  border: 1px solid #dce5eb;
  border-radius: 8px;
  padding: 14px;
  background: #fbfdff;
}

.metric-card h3,
.section-band h2,
.section-band h3,
.auth-panel h1 {
  margin: 0 0 10px;
}

.metric-card p {
  font-size: 2rem;
  margin: 0;
}

.metric-card dl,
.metric-card div {
  margin: 0;
}

.metric-card dl {
  display: grid;
  gap: 8px;
}

.metric-card dt {
  color: #5b6573;
  font-size: 0.85rem;
}

.metric-card dd {
  margin: 0;
  font-size: 1.2rem;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 12px;
}

.status-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.status-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid #edf1f4;
}

.status-row:last-child {
  border-bottom: 0;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 74px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.85rem;
  background: #dde5eb;
}

.freshness-summary {
  display: grid;
  justify-items: end;
  gap: 8px;
}

.badge-up {
  background: #d8f0df;
}

.badge-warn {
  background: #f6e8b8;
}

.badge-down {
  background: #f6d2d4;
}

.muted,
.eyebrow {
  color: #5f6f81;
}

.eyebrow {
  text-transform: uppercase;
  font-size: 0.78rem;
  margin: 0 0 6px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  text-align: left;
  padding: 8px;
  border-bottom: 1px solid #edf1f4;
}

button,
.button-link {
  appearance: none;
  border: 1px solid #30425a;
  background: #30425a;
  color: #ffffff;
  border-radius: 8px;
  padding: 10px 14px;
  font: inherit;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  justify-content: center;
  align-items: center;
}

label,
input,
select {
  font: inherit;
}

input,
select {
  width: 100%;
  margin-top: 6px;
  border: 1px solid #c9d4de;
  border-radius: 8px;
  padding: 10px 12px;
}

.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
}

.auth-shell {
  width: min(460px, calc(100vw - 32px));
}

.auth-form {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.auth-error {
  color: #97363f;
}

.enrollment-box {
  display: grid;
  gap: 6px;
  padding: 12px;
  background: #f4f8fb;
  border: 1px solid #d8e3ec;
  border-radius: 8px;
}

code {
  word-break: break-word;
}

.chart-panel {
  min-width: 0;
}

.chart-shell {
  position: relative;
  height: 320px;
  min-height: 320px;
}

.chart-shell canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
  min-height: 0;
}

@media (max-width: 700px) {
  .section-controls {
    align-items: stretch;
    flex-direction: column;
  }

  .freshness-summary {
    justify-items: start;
  }

  .chart-shell {
    height: 260px;
    min-height: 260px;
  }
}

@media (max-width: 720px) {
  .page-header {
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
  }
}
