:root {
  --bg: #f7f8fa;
  --surface: #ffffff;
  --border: #e2e5e9;
  --text: #1a1d23;
  --text-muted: #667085;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --danger: #dc2626;
  --radius: 8px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 12px 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar .brand { font-weight: 700; font-size: 16px; color: var(--text); text-decoration: none; }
.topbar nav { display: flex; gap: 18px; }
.topbar nav a { color: var(--text-muted); text-decoration: none; font-weight: 500; padding: 6px 2px; }
.topbar nav a:hover { color: var(--primary); }

main { padding: 24px; max-width: 1100px; margin: 0 auto; }

h1 { font-size: 20px; margin: 0 0 16px; }
h2 { font-size: 13px; margin: 24px 0 8px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }
h3 { font-size: 13px; margin: 0 0 8px; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
}
.card > div { padding: 3px 0; }

table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
th, td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--border); font-size: 13px; }
th { background: #fafbfc; color: var(--text-muted); font-weight: 600; text-transform: uppercase; font-size: 11px; letter-spacing: .03em; }
tr:last-child td { border-bottom: none; }

.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; text-transform: uppercase; white-space: nowrap; }
.badge-staging, .badge-pending, .badge-processing, .badge-claimed, .badge-running, .badge-needs_metadata { background: #fef3c7; color: #92400e; }
.badge-completed, .badge-processed, .badge-confirmed, .badge-accepted { background: #dcfce7; color: #166534; }
.badge-failed, .badge-rejected { background: #fee2e2; color: #991b1b; }
.badge-model_detected { background: #dbeafe; color: #1e40af; }

button, .btn {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 13px;
  cursor: pointer;
  color: var(--text);
}
button:hover { background: #f2f4f7; }
button.primary { background: var(--primary); color: white; border-color: var(--primary); }
button.primary:hover { background: var(--primary-hover); }

input, select {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 13px;
}

a { color: var(--primary); }
.muted { color: var(--text-muted); }

.dropzone {
  border: 2px dashed #c8ccd2;
  border-radius: var(--radius);
  padding: 48px;
  text-align: center;
  background: var(--surface);
  color: var(--text-muted);
}

.callout {
  border: 1px solid #fbbf24;
  background: #fffbeb;
  color: #92400e;
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 16px;
  font-size: 13px;
}

fieldset {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px 16px;
  margin: 0 0 16px;
}
fieldset legend { font-weight: 600; padding: 0 6px; }
.field-row { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 8px; }
.field-row label { display: block; font-size: 12px; color: var(--text-muted); }
.field-row input, .field-row select { display: block; margin-top: 2px; }
