* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: #f6f7fa;
  color: #1f2330;
}

header {
  background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
  color: white;
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

header h1 {
  font-size: 1.25rem;
  margin: 0;
  font-weight: 600;
}

header .muted {
  opacity: 0.7;
  font-weight: normal;
  font-size: 0.9rem;
}

.header-right {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.pill {
  display: inline-block;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 500;
  background: #e5e7eb;
  color: #1f2330;
}

.pill-ok    { background: #16a34a; color: white; }
.pill-error { background: #dc2626; color: white; }
.pill-idle  { background: #fef3c7; color: #92400e; }

button {
  background: white;
  color: #1f2330;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  padding: 0.35rem 0.85rem;
  cursor: pointer;
  font: inherit;
}

button:hover  { background: #f3f4f6; }
button:disabled { opacity: 0.5; cursor: not-allowed; }

.banner {
  padding: 0.75rem 1.5rem;
  font-size: 0.9rem;
}

.banner-error {
  background: #fef2f2;
  color: #991b1b;
  border-bottom: 1px solid #fecaca;
}

.summary {
  display: flex;
  gap: 2rem;
  align-items: center;
  padding: 1.5rem;
  flex-wrap: wrap;
}

.kpi-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #6b7280;
  margin-bottom: 0.3rem;
}

.kpi-value {
  font-size: 2.5rem;
  font-weight: 600;
  line-height: 1;
}

.kpi-meta {
  font-size: 0.85rem;
  color: #6b7280;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.table-wrap {
  margin: 0 1.5rem 1.5rem;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

th, td {
  text-align: left;
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid #f1f3f6;
}

th {
  background: #f9fafb;
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6b7280;
}

td.empty {
  text-align: center;
  color: #6b7280;
  font-style: italic;
  padding: 2rem;
}

tbody tr:hover { background: #f9fafb; }
tbody tr:last-child td { border-bottom: none; }

footer {
  padding: 1rem 1.5rem;
  color: #6b7280;
  font-size: 0.85rem;
}

footer code {
  background: #e5e7eb;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  font-size: 0.85rem;
}
