* {
  box-sizing: border-box;
}

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

.container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 24px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 20px;
}

.eyebrow {
  margin: 0 0 6px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #6b7280;
}

h1 {
  margin: 0 0 6px;
  font-size: 30px;
}

.subtext {
  margin: 0;
  color: #4b5563;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  background: #e5e7eb;
  color: #111827;
}

.button-link:hover {
  background: #d1d5db;
}

button {
  border: 0;
  border-radius: 8px;
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  background: #e5e7eb;
  color: #111827;
}

button:hover {
  background: #d1d5db;
}

button.primary {
  color: #fff;
  background: #7c3f20;
}

button.primary:hover {
  background: #6a3419;
}

button.ghost {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
}

.panel {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
}

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

h2 {
  margin: 0;
  font-size: 17px;
}

.status {
  margin: 0;
  font-size: 13px;
  color: #4b5563;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.stat-card {
  border: 1px solid #eef2f7;
  border-radius: 10px;
  padding: 12px;
  background: #fcfdff;
}

.stat-card h3 {
  margin: 0 0 8px;
  font-size: 12px;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.metric {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 900px;
}

th,
td {
  padding: 10px;
  text-align: left;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: top;
  font-size: 14px;
}

th {
  font-size: 13px;
  font-weight: 700;
  color: #374151;
  background: #f8fafc;
}

.placeholders {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.placeholders article {
  background: #fafafa;
  border: 1px dashed #d1d5db;
  border-radius: 8px;
  padding: 14px;
}

.placeholders p {
  margin: 8px 0 0;
  color: #4b5563;
  font-size: 14px;
}

@media (max-width: 900px) {
  .stats-grid,
  .placeholders {
    grid-template-columns: 1fr;
  }
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.controls label {
  font-size: 13px;
  font-weight: 600;
  color: #374151;
}

.controls select {
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 8px 10px;
  min-width: 240px;
  background: #fff;
}

.json-cell {
  max-width: 420px;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New",
    monospace;
  font-size: 12px;
}

.pager {
  margin-top: 12px;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}
