:root {
  --bg: #0f1419;
  --card: #1a2332;
  --text: #e7ecf3;
  --muted: #8b9cb3;
  --accent: #5b9fd4;
  --error: #e57373;
  --link: #ffffff;
  --link-visited: #d4dae3;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
}
a {
  color: var(--link);
  text-decoration: underline;
  text-underline-offset: 2px;
}
a:visited { color: var(--link-visited); }
a:hover { color: var(--link); }
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1.5rem;
  background: var(--card);
  border-bottom: 1px solid #2a3544;
}
.topbar a {
  color: var(--link);
  margin-right: 1rem;
  text-decoration: none;
}
.topbar a:visited { color: var(--link-visited); }
.topbar a:hover { color: var(--link); }
.container { max-width: 1100px; margin: 0 auto; padding: 1.5rem; }
.card {
  background: var(--card);
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
}
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 1rem; }
.cards .card { text-align: center; }
.cards .label { display: block; color: var(--muted); font-size: 0.85rem; }
.cards .value { font-size: 1.75rem; font-weight: 700; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 0.5rem; border-bottom: 1px solid #2a3544; text-align: left; }
label { display: block; margin: 0.5rem 0; }
input, select, textarea, button {
  font: inherit;
  padding: 0.4rem 0.6rem;
  border-radius: 4px;
  border: 1px solid #3a4a5c;
  background: #0f1419;
  color: var(--text);
}
button { cursor: pointer; background: var(--accent); color: #0f1419; border: none; }
.btn { font-size: 0.8rem; padding: 0.25rem 0.5rem; }
.btn-success { background: #2e7d32; color: #fff; }
.btn-warn { background: #6a1b9a; color: #fff; }
.btn-danger { background: #c62828; color: #fff; }
.status-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.35rem;
}
.inline-form { display: inline-flex; flex-wrap: wrap; gap: 0.25rem; align-items: center; }
.actions-cell { min-width: 12rem; }
.resolution-panel h2 { margin-top: 0; font-size: 1rem; }
.resolution-panel .status-actions { margin-top: 0.5rem; }
.resolution-panel input { max-width: 14rem; }
.error, .warn { color: var(--error); }
.flash { padding: 0.75rem 1rem; border-radius: 6px; margin-bottom: 1rem; }
.flash-ok { background: #1b3d2a; color: #a5d6a7; }
.flash-error { background: #3d1b1b; color: #ef9a9a; }
.ops-card h2 { margin-top: 0; font-size: 1.1rem; }
.ops-form { margin-top: 0.75rem; padding-top: 0.75rem; border-top: 1px solid #2a3544; }
.ops-form:first-of-type { border-top: none; padding-top: 0; }
.ops-form-inline { display: inline-block; margin-right: 0.75rem; border-top: none; }
.ops-checkbox { display: flex; align-items: center; gap: 0.5rem; }
.ops-checkbox input { width: auto; }
.post-text { white-space: pre-wrap; background: #0a0e14; padding: 1rem; border-radius: 6px; max-height: 300px; overflow: auto; }
.login-card { max-width: 360px; margin: 4rem auto; }
.filters { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1rem; }

/* Status badges */
.status-badge {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1.3;
  white-space: nowrap;
  border: 1px solid transparent;
}
.status-new { background: #37474f; color: #eceff1; border-color: #546e7a; }
.status-queued { background: #e65100; color: #fff; border-color: #ff6d00; }
.status-claimed { background: #f9a825; color: #1a1a1a; border-color: #fbc02d; }
.status-in_progress { background: #7b1fa2; color: #fff; border-color: #9c27b0; }
.status-submitted { background: #00838f; color: #fff; border-color: #00acc1; }
.status-pending_review { background: #1565c0; color: #fff; border-color: #42a5f5; }
.status-posted { background: #2e7d32; color: #fff; border-color: #43a047; }
.status-done { background: #1b5e20; color: #c8e6c9; border-color: #388e3c; }
.status-duplicate { background: #c62828; color: #fff; border-color: #e53935; }
.status-rejected { background: #4a148c; color: #e1bee7; border-color: #6a1b9a; }
.status-failed { background: #b71c1c; color: #ffcdd2; border-color: #d32f2f; }
.status-needs_review { background: #ad1457; color: #fff; border-color: #ec407a; }

/* Public queue */
.topbar-public .nav-login {
  padding: 0.35rem 0.75rem;
  background: var(--accent);
  color: #0f1419 !important;
  border-radius: 6px;
  font-weight: 600;
}
.page-header { margin-bottom: 1.5rem; }
.page-header .lede { color: var(--muted); margin: 0.35rem 0 0; }
.queue-section { margin-bottom: 1.25rem; }
.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}
.section-heading h2 { margin: 0; font-size: 1.15rem; }
.section-count {
  color: var(--muted);
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
}
.table-wrap { overflow-x: auto; }
.queue-table td, .queue-table th { vertical-align: middle; }
.queue-table a { color: var(--link); text-decoration: underline; }
.queue-table a:visited { color: var(--link-visited); }
.tabulator a { color: var(--link); }
.tabulator a:visited { color: var(--link-visited); }
.muted { color: var(--muted); font-size: 0.9rem; }
.empty-section { color: var(--muted); margin: 0; }
.site-footer {
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
  padding: 2rem 1rem;
  border-top: 1px solid #2a3544;
}
.site-footer p { margin: 0; }

/* Tabulator */
.tabulator-theme {
  border: 1px solid #2a3544;
  border-radius: 8px;
  overflow: hidden;
  margin-top: 0.5rem;
}
.tabulator { background: var(--card); color: var(--text); font-size: 0.9rem; }
.tabulator .tabulator-header { background: #141b24; border-bottom: 1px solid #2a3544; }
.tabulator .tabulator-row { background: var(--card); border-bottom: 1px solid #2a3544; }
.tabulator .tabulator-row.tabulator-row-even { background: #151d28; }
.tabulator .tabulator-footer { background: #141b24; border-top: 1px solid #2a3544; }

/* Help */
.help-doc h1 { margin-top: 0; }
.help-doc section { margin: 1.75rem 0; }
.help-doc h2 { font-size: 1.2rem; margin-bottom: 0.5rem; }
.help-doc h3 { font-size: 1rem; color: var(--muted); }
.help-doc ul, .help-doc ol { padding-left: 1.25rem; }
.help-doc li { margin: 0.35rem 0; }
.help-doc code { background: #0a0e14; padding: 0.1rem 0.35rem; border-radius: 4px; font-size: 0.88em; }
