:root {
  --bg: #f4f7fb;
  --surface: #ffffff;
  --surface-muted: #f8fafc;
  --surface-strong: #edf3fb;
  --border: #d9e2ef;
  --text: #132238;
  --muted: #64748b;
  --brand: #21496f;
  --brand-soft: #5c7ea5;
  --accent-soft: #eaf5de;
  --warn: #b9851f;
  --warn-soft: #fff4d9;
  --danger: #b44f4f;
  --danger-soft: #fde8e8;
  --shadow: 0 12px 40px rgba(26, 47, 79, 0.08);
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 14px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top left, rgba(33, 73, 111, 0.08), transparent 28%),
    linear-gradient(180deg, #f9fbfe 0%, var(--bg) 100%);
  color: var(--text);
  font-family:
    Manrope,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

button,
textarea,
select {
  font: inherit;
}

.hidden,
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.app-shell {
  padding: 28px;
}

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

.eyebrow,
.section-kicker {
  margin: 0 0 8px;
  color: var(--brand-soft);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.72rem;
  font-weight: 800;
}

.topbar h1 {
  margin: 0;
  font-size: clamp(1.8rem, 2.4vw, 2.5rem);
  line-height: 1.05;
}

.topbar-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.meta-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--brand);
  color: white;
  font-size: 0.88rem;
  font-weight: 700;
}

.meta-chip-soft {
  background: var(--surface);
  color: var(--muted);
  border: 1px solid var(--border);
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
}

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

.summary-card {
  padding: 18px 20px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.summary-label {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 800;
}

.summary-value {
  display: block;
  margin-top: 10px;
  font-size: 1.8rem;
}

.workspace {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr) 360px;
  gap: 18px;
}

.queue-panel,
.detail-panel,
.approval-panel {
  padding: 20px;
}

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

.panel-header h2 {
  margin: 0;
  font-size: 1.1rem;
}

.select-wrap select {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 10px 14px;
  background: var(--surface);
  color: var(--text);
}

.job-list {
  display: grid;
  gap: 12px;
}

.job-card {
  display: grid;
  gap: 10px;
  width: 100%;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface-muted);
  text-align: left;
  cursor: pointer;
  transition: border-color 160ms ease, transform 160ms ease, background 160ms ease;
}

.job-card:hover,
.job-card.active {
  transform: translateY(-1px);
  border-color: var(--brand-soft);
  background: white;
}

.job-card h3 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.35;
}

.job-card-meta,
.job-card-site {
  color: var(--muted);
  font-size: 0.82rem;
}

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

.detail-head h2 {
  margin: 0;
  font-size: 1.4rem;
}

.empty-state {
  padding: 24px;
  border-radius: var(--radius-lg);
  background: var(--surface-muted);
  color: var(--muted);
  line-height: 1.7;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 8px 14px;
  background: var(--accent-soft);
  color: #4f7a25;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.status-pill.status-final_pending,
.status-pill.status-brief_pending {
  background: var(--warn-soft);
  color: var(--warn);
}

.status-pill.status-needs_revision {
  background: var(--danger-soft);
  color: var(--danger);
}

.status-pill.status-published {
  background: var(--accent-soft);
  color: #4f7a25;
}

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

.meta-card {
  padding: 14px 16px;
  border-radius: var(--radius-lg);
  background: var(--surface-muted);
}

.meta-card span {
  display: block;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.72rem;
  font-weight: 700;
}

.meta-card strong {
  display: block;
  margin: 8px 0 0;
  line-height: 1.6;
}

.tabs {
  display: flex;
  gap: 10px;
  margin-top: 20px;
  padding-bottom: 8px;
}

.tab {
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 11px 16px;
  background: var(--surface-strong);
  color: var(--brand-soft);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
}

.tab.active {
  background: var(--brand);
  border-color: var(--brand);
  color: white;
}

.tab-panel {
  display: none;
  margin-top: 18px;
}

.tab-panel.active {
  display: block;
}

.stack {
  display: grid;
  gap: 14px;
}

.card {
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface-muted);
}

.card h3 {
  margin: 0 0 12px;
  font-size: 1rem;
}

.card p {
  margin: 0;
  line-height: 1.7;
}

.clean-list {
  margin: 0;
  padding-left: 18px;
  line-height: 1.7;
}

.clean-list li + li {
  margin-top: 8px;
}

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

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: white;
  border: 1px solid var(--border);
  font-size: 0.9rem;
}

.approval-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.checkpoint-box,
.review-preview {
  padding: 16px 18px;
  border-radius: var(--radius-lg);
  background: var(--surface-muted);
  border: 1px solid var(--border);
}

.checkpoint-label {
  display: block;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.checkpoint-box strong {
  display: block;
  margin-top: 8px;
  font-size: 1rem;
}

.approval-box {
  display: grid;
  gap: 8px;
}

.approval-box label {
  font-size: 0.88rem;
  font-weight: 700;
}

.approval-box textarea {
  width: 100%;
  min-height: 150px;
  resize: vertical;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  padding: 14px 16px;
  color: var(--text);
}

.action-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.action {
  min-height: 48px;
  border: 1px solid var(--border);
  border-radius: 14px;
  cursor: pointer;
  font-weight: 800;
}

.action.primary {
  background: var(--brand);
  color: white;
  border-color: var(--brand);
}

.action.secondary {
  background: white;
  color: var(--text);
}

.metric-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  line-height: 1.6;
}

.metric-row + .metric-row {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.muted {
  color: var(--muted);
}

@media (max-width: 1180px) {
  .workspace {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 720px) {
  .app-shell {
    padding: 16px;
  }

  .topbar {
    flex-direction: column;
  }

  .summary-strip,
  .meta-grid,
  .action-buttons {
    grid-template-columns: 1fr;
  }
}
