:root {
  color-scheme: light;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #162033;
  background: #f5f7fb;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

a {
  color: inherit;
}

[hidden],
.view {
  display: none !important;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(420px, 100%);
  display: grid;
  gap: 16px;
  padding: 28px;
  border: 1px solid #dce3ed;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 20px 60px rgba(22, 32, 51, 0.08);
}

.login-card h1,
.topbar h1 {
  margin: 0;
  font-size: 28px;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px 16px;
  border-right: 1px solid #dce3ed;
  background: #ffffff;
}

.brand {
  display: inline-block;
  margin-bottom: 28px;
  font-size: 22px;
  font-weight: 800;
  text-decoration: none;
}

nav {
  display: grid;
  gap: 8px;
}

.nav-button,
.link-button {
  width: 100%;
  border: 0;
  color: #4d5b70;
  background: transparent;
  text-align: left;
}

.nav-button {
  padding: 10px 12px;
  border-radius: 6px;
  font-weight: 700;
}

.nav-button.is-active,
.nav-button:hover {
  color: #162033;
  background: #edf2f8;
}

.workspace {
  min-width: 0;
  padding: 24px;
}

.topbar {
  display: flex;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.topbar-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.eyebrow,
.meta {
  margin: 0 0 6px;
  color: #667286;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.muted,
.status {
  color: #667286;
}

.status {
  min-height: 22px;
  margin: 0 0 14px;
}

.view.is-visible {
  display: block !important;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.stat-card,
.panel {
  border: 1px solid #dce3ed;
  border-radius: 8px;
  background: #ffffff;
}

.stat-card {
  padding: 16px;
}

.stat-card span {
  color: #667286;
  font-size: 13px;
  font-weight: 700;
}

.stat-card strong {
  display: block;
  margin-top: 8px;
  font-size: 30px;
}

.panel {
  padding: 16px;
}

.panel h2 {
  margin: 0 0 14px;
  font-size: 18px;
}

.section-heading {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.section-heading h2 {
  margin: 0;
}

label {
  display: grid;
  gap: 6px;
  color: #667286;
  font-size: 13px;
  font-weight: 700;
}

input,
textarea,
select,
button {
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 10px 12px;
  color: #162033;
  background: #ffffff;
  font: inherit;
}

textarea {
  resize: vertical;
}

button {
  cursor: pointer;
  border-color: #162033;
  color: #ffffff;
  background: #162033;
  font-weight: 800;
}

.secondary {
  color: #162033;
  border-color: #cbd5e1;
  background: #ffffff;
}

.danger {
  border-color: #9f1d1d;
  background: #9f1d1d;
}

.link-button {
  width: auto;
  padding: 0;
  color: #34527b;
  font-weight: 800;
}

.source-form {
  display: grid;
  gap: 14px;
  max-width: 780px;
}

.split-panel {
  display: grid;
  grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
  gap: 14px;
}

.card-list,
.failure-list {
  display: grid;
  gap: 10px;
}

.queue-card,
.failure-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid #dce3ed;
  border-radius: 8px;
  background: #ffffff;
}

.queue-card h3,
.failure-card h3 {
  margin: 0;
  font-size: 17px;
}

.summary,
.error {
  margin: 0;
  color: #667286;
  line-height: 1.45;
}

.error {
  color: #9f1d1d;
}

.detail-empty {
  color: #667286;
}

.review-editor {
  display: grid;
  gap: 12px;
}

.review-editor textarea {
  min-height: 360px;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 13px;
}

.review-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.table-shell {
  overflow: auto;
}

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

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

th {
  color: #667286;
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.badge,
.pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 8px;
  color: #344256;
  background: #edf2f8;
  font-size: 12px;
  font-weight: 800;
}

.inline-filter {
  width: 180px;
}

@media (max-width: 940px) {
  .app-shell,
  .split-panel,
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid #dce3ed;
  }

  nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .topbar {
    align-items: stretch;
    flex-direction: column;
  }
}
