@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;700&family=DM+Mono:wght@400;500&family=Fraunces:opsz,wght@9..144,600;9..144,700&display=swap');

:root {
  --bg: #fafaf8;
  --panel: #ffffff;
  --panel-alt: #f6f8f4;
  --sidebar-top: #204033;
  --sidebar-bottom: #173126;
  --accent: #2d6a4f;
  --accent-strong: #1f523c;
  --text: #18201b;
  --muted: #657067;
  --line: #dde4dc;
  --line-soft: #edf1eb;
  --shadow: 0 18px 40px rgba(27, 54, 40, 0.08);
  --radius: 8px;
  --blue-bg: #dbeafe;
  --blue-fg: #1d4ed8;
  --teal-bg: #ccfbf1;
  --teal-fg: #0f766e;
  --amber-bg: #fef3c7;
  --amber-fg: #92400e;
  --orange-bg: #ffedd5;
  --orange-fg: #c2410c;
  --purple-bg: #ede9fe;
  --purple-fg: #6d28d9;
  --green-bg: #dcfce7;
  --green-fg: #15803d;
  --emerald-bg: #d1fae5;
  --emerald-fg: #065f46;
  --red-bg: #fee2e2;
  --red-fg: #991b1b;
  --gray-bg: #f3f4f6;
  --gray-fg: #6b7280;
  --gold-bg: #fef3c7;
  --gold-fg: #a16207;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  min-height: 100%;
  background: radial-gradient(circle at top left, #edf5ef 0%, #fafaf8 45%, #f7f5ef 100%);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  line-height: 1.7;
}

body {
  overflow-x: hidden;
}

body.sidebar-open {
  overflow: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea,
select {
  font: inherit;
}

.app-shell {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 248px;
  padding: 28px 18px;
  background: linear-gradient(180deg, var(--sidebar-top) 0%, var(--sidebar-bottom) 100%);
  color: rgba(255, 255, 255, 0.76);
  display: flex;
  flex-direction: column;
  gap: 18px;
  z-index: 40;
}

.brand {
  padding: 10px 14px 24px;
}

.brand-title {
  color: #ffffff;
  font-family: 'Fraunces', serif;
  font-size: 1.7rem;
  line-height: 1;
  letter-spacing: -0.04em;
}

.brand-sub {
  margin-top: 8px;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: rgba(255, 255, 255, 0.5);
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius);
  color: rgba(255, 255, 255, 0.7);
  transition: background 0.18s ease, color 0.18s ease;
}

.nav-link:hover,
.nav-link.active {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.nav-dot {
  margin-left: auto;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #9be5bb;
  opacity: 0;
}

.nav-link.active .nav-dot {
  opacity: 1;
}

.sidebar-footer {
  padding: 18px 14px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
}

.sidebar-status::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #9be5bb;
}

.main {
  margin-left: 248px;
  width: calc(100% - 248px);
}

.container {
  max-width: 1500px;
  margin: 0 auto;
  padding: 40px 40px 56px;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid rgba(24, 32, 27, 0.08);
}

.page-title,
.section-title {
  font-family: 'Fraunces', serif;
}

.page-title {
  font-size: 3rem;
  line-height: 0.95;
  letter-spacing: -0.05em;
}

.page-subtitle,
.label-caps,
.panel-label,
th {
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.mobile-menu {
  display: none;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid rgba(24, 32, 27, 0.12);
  border-radius: var(--radius);
  background: var(--panel);
  cursor: pointer;
}

.mobile-nav-backdrop {
  display: none;
}

.section {
  margin-top: 32px;
}

.view-section {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.surface,
.metric-card,
.job-card,
.approval-card,
.thread-card,
.health-card,
.config-card {
  background: var(--panel);
  border: 1px solid rgba(24, 32, 27, 0.08);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.surface,
.metric-card,
.approval-card,
.thread-card,
.health-card,
.config-card,
.train-agent-section,
.train-agent-hero {
  padding: 24px;
}

.section-head,
.job-card-head,
.approval-card-head,
.health-head,
.config-head,
.drawer-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.section-title {
  margin-top: 4px;
  font-size: 1.9rem;
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.section-title.small {
  font-size: 1.2rem;
}

.button-row,
.tab-row,
.tag-row,
.panel-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.btn {
  min-width: 80px;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.16s ease, background 0.16s ease, border-color 0.16s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--accent);
  color: #ffffff;
}

.btn-primary:hover {
  background: var(--accent-strong);
}

.btn-secondary {
  background: var(--panel);
  color: var(--text);
  border-color: rgba(24, 32, 27, 0.14);
}

.btn-success {
  background: var(--green-fg);
  color: #ffffff;
}

.btn-danger {
  background: transparent;
  border-color: rgba(153, 27, 27, 0.28);
  color: var(--red-fg);
}

.btn-danger-outline {
  background: transparent;
  border-color: rgba(153, 27, 27, 0.28);
  color: var(--red-fg);
}

.btn-danger-solid {
  background: #ef4444;
  border-color: #ef4444;
  color: #ffffff;
}

.btn-danger-solid:hover {
  background: #dc2626;
  border-color: #dc2626;
}

.btn-danger-outline:hover,
.btn-danger:hover {
  background: #fef2f2;
}

.btn-sm {
  min-width: 80px;
}

.text-link {
  background: none;
  border: 0;
  color: var(--accent-strong);
  cursor: pointer;
  padding: 0;
  text-align: left;
}

.metric-strip {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 24px;
}

.metric-strip-job {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.strip-card {
  min-height: 144px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
}

.metric-number {
  font-size: 3rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.06em;
}

.metric-small {
  font-size: 1.25rem;
}

.metric-caption {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--muted);
}

.table-shell {
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--line-soft);
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--panel);
}

th,
td {
  padding: 18px 20px;
  min-height: 56px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: top;
  text-align: left;
}

th {
  position: sticky;
  top: 0;
  background: #fcfdfb;
  z-index: 1;
}

tbody tr:nth-child(even) {
  background: rgba(246, 248, 244, 0.8);
}

tbody tr:hover {
  background: rgba(219, 234, 254, 0.18);
}

tbody tr:last-child td {
  border-bottom: 0;
}

.danger-zone {
  border: 1px solid #ef4444;
}

.danger-action {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding: 18px 0;
  border-top: 1px solid #f3f4f6;
}

.danger-action strong {
  display: block;
  margin-bottom: 4px;
}

.danger-action p {
  color: var(--muted);
}

.mini-progress {
  display: flex;
  width: 100%;
  min-width: 140px;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8ece6;
}

.mini-progress-segment {
  height: 100%;
}

.jobs-grid,
.health-grid,
.config-grid,
.train-agent-grid {
  display: grid;
  gap: 32px;
}

.jobs-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.health-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

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

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

.train-agent-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(280px, 0.9fr);
  gap: 28px;
  background:
    radial-gradient(circle at top right, rgba(45, 106, 79, 0.18), transparent 40%),
    linear-gradient(135deg, #f7fbf7 0%, #f0f6f2 100%);
}

.train-agent-copy {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.train-agent-lead {
  max-width: 62ch;
  color: var(--text);
  font-size: 1rem;
}

.train-agent-badges {
  display: grid;
  gap: 14px;
}

.train-agent-stat {
  padding: 16px 18px;
  border: 1px solid rgba(24, 32, 27, 0.08);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.75);
}

.train-agent-stat strong {
  display: block;
  font-size: 1.4rem;
  line-height: 1.1;
  letter-spacing: -0.04em;
}

.train-agent-stat span {
  color: var(--muted);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.train-agent-section {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.train-agent-summary {
  justify-content: space-between;
}

.onboarding-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  background:
    linear-gradient(135deg, rgba(219, 234, 254, 0.5), rgba(209, 250, 229, 0.55)),
    var(--panel);
}

.config-group {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.job-card {
  padding: 24px;
  border-left: 4px solid var(--line);
}

.job-card.is-selected {
  border-color: rgba(45, 106, 79, 0.22);
  box-shadow: 0 0 0 2px rgba(45, 106, 79, 0.12), var(--shadow);
}

.job-border-active {
  border-left-color: var(--green-fg);
}

.job-border-paused {
  border-left-color: var(--amber-fg);
}

.job-border-closed {
  border-left-color: var(--gray-fg);
}

.job-card-title {
  font-size: 1.3rem;
  line-height: 1.15;
  letter-spacing: -0.03em;
}

.job-card-sub,
.job-detail-sub,
.candidate-sub,
.thread-meta,
.approval-meta,
.muted-inline {
  color: var(--muted);
}

.job-bars {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 20px 0 24px;
}

.job-bar-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.job-detail-header {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
}

.create-job-form {
  scroll-margin-top: 24px;
}

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

.snapshot-card {
  padding: 18px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: #fcfdfb;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.tab-row {
  gap: 12px;
}

.tab-button {
  min-height: 40px;
  padding: 8px 14px;
  border: 1px solid rgba(24, 32, 27, 0.12);
  border-radius: 999px;
  background: var(--panel);
  color: var(--muted);
  cursor: pointer;
}

.tab-button.active {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
}

.candidate-primary {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.candidate-name {
  font-size: 1rem;
  font-weight: 700;
}

.score-pill,
.stage-chip,
.approval-type,
.tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  border-radius: 999px;
}

.score-pill {
  min-width: 52px;
  padding: 4px 10px;
  font-family: 'DM Mono', monospace;
  font-size: 0.88rem;
  color: #ffffff;
}

.score-high {
  background: var(--green-fg);
}

.score-mid {
  background: var(--amber-fg);
}

.score-low {
  background: var(--gray-fg);
}

.stage-chip,
.approval-type {
  padding: 4px 10px;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.stage-default {
  background: var(--gray-bg);
  color: var(--gray-fg);
}

.stage-sourced {
  background: var(--gray-bg);
  color: #4b5563;
}

.stage-shortlisted {
  background: var(--blue-bg);
  color: var(--blue-fg);
}

.stage-enriched,
.stage-invite {
  background: var(--teal-bg);
  color: var(--teal-fg);
}

.stage-accepted {
  background: #dcfce7;
  color: #15803d;
}

.stage-dm {
  background: var(--orange-bg);
  color: var(--orange-fg);
}

.stage-email {
  background: var(--purple-bg);
  color: var(--purple-fg);
}

.stage-replied {
  background: var(--green-bg);
  color: var(--green-fg);
}

.stage-qualified {
  background: var(--emerald-bg);
  color: var(--emerald-fg);
}

.stage-rejected,
.stage-archived {
  background: #f3f4f6;
  color: #6b7280;
}

.stage-withdrawn {
  background: #f3f4f6;
  color: #6b7280;
  font-style: italic;
}

.stage-placed {
  background: var(--gold-bg);
  color: var(--gold-fg);
}

.job-active {
  background: var(--green-bg);
  color: var(--green-fg);
}

.job-paused {
  background: var(--amber-bg);
  color: var(--amber-fg);
}

.job-closed {
  background: var(--gray-bg);
  color: var(--gray-fg);
}

.enrichment-mark {
  width: 12px;
  height: 12px;
  display: inline-block;
  border-radius: 999px;
}

.enrichment-mark.good {
  background: var(--emerald-fg);
}

.enrichment-mark.bad {
  background: var(--red-fg);
}

.enrichment-mark.empty {
  background: var(--amber-fg);
}

.enrichment-mark.pending {
  background: #94a3b8;
}

.thread-list,
.approvals-stack {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.thread-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.thread-preview {
  color: var(--text);
}

.activity-feed {
  width: 100%;
  max-height: 480px;
  overflow-y: auto;
  overflow-x: hidden;
}

.activity-event-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid #f0f0f0;
  min-height: 44px;
  flex-wrap: nowrap;
  overflow: hidden;
}

.activity-event-row:last-child {
  border-bottom: 0;
}

.activity-muted {
  opacity: 0.6;
}

.activity-timestamp {
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  color: #999;
  white-space: nowrap;
  flex-shrink: 0;
  min-width: 110px;
}

.activity-chip {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 4px;
  white-space: nowrap;
  flex-shrink: 0;
}

.activity-description {
  font-size: 13px;
  color: #444;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.chip-default {
  background: var(--gray-bg);
  color: var(--gray-fg);
}

.chip-message {
  background: #dbeafe;
  color: #1d4ed8;
}

.chip-enrichment {
  background: #fef3c7;
  color: #92400e;
}

.chip-invite {
  background: #ccfbf1;
  color: #0f766e;
}

.chip-accepted {
  background: #dcfce7;
  color: #15803d;
}

.chip-reply {
  background: #d1fae5;
  color: #065f46;
}

.chip-error {
  background: #fee2e2;
  color: #991b1b;
}

.chip-window {
  background: #f3f4f6;
  color: #9ca3af;
  opacity: 0.7;
}

.approval-card {
  max-width: 800px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: opacity 0.25s ease;
}

.approval-faded {
  opacity: 0.7;
}

.approval-person {
  font-size: 1.2rem;
  font-weight: 700;
}

.approval-message {
  padding: 16px 18px;
  border-left: 4px solid var(--line);
  background: var(--panel-alt);
  border-radius: 6px;
  color: var(--text);
}

.approval-dm {
  background: var(--blue-bg);
  color: var(--blue-fg);
}

.approval-email {
  background: var(--purple-bg);
  color: var(--purple-fg);
}

.approval-followup {
  background: var(--amber-bg);
  color: var(--amber-fg);
}

.toggle-surface {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.toggle-switch {
  width: 58px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid rgba(24, 32, 27, 0.12);
  background: #d9dfd7;
  position: relative;
  cursor: pointer;
}

.toggle-switch span {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 5px 14px rgba(0, 0, 0, 0.14);
  transition: left 0.18s ease;
}

.toggle-switch.is-on {
  background: var(--accent);
}

.toggle-switch.is-on span {
  left: 28px;
}

.health-card,
.config-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.health-dot {
  width: 10px;
  height: 10px;
  display: inline-block;
  border-radius: 999px;
  margin-right: 8px;
}

.health-dot.ok {
  background: var(--emerald-fg);
}

.health-dot.warn {
  background: var(--amber-fg);
}

.health-dot.error {
  background: var(--red-fg);
}

.input,
.textarea,
.select {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius);
  border: 1px solid rgba(24, 32, 27, 0.14);
  background: #ffffff;
  color: var(--text);
}

.config-input {
  min-height: 44px;
}

.textarea {
  min-height: 128px;
  resize: vertical;
}

.mono-text {
  font-family: 'DM Mono', monospace;
  font-size: 0.82rem;
}

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

.form-span-2 {
  grid-column: 1 / -1;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  color: var(--text);
}

.checkbox-row input {
  width: 16px;
  height: 16px;
}

.applicant-team-row {
  margin-top: 12px;
  padding: 18px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--panel-alt);
}

.form-help {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.5;
}

.tag {
  padding: 6px 10px;
  background: var(--panel-alt);
  border: 1px solid var(--line-soft);
  color: var(--text);
  font-size: 0.8rem;
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(24, 32, 27, 0.35);
  z-index: 60;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(400px, 100vw);
  height: 100vh;
  background: var(--panel);
  box-shadow: -20px 0 40px rgba(0, 0, 0, 0.12);
  z-index: 70;
  display: flex;
  flex-direction: column;
}

.drawer-head {
  padding: 24px;
  border-bottom: 1px solid var(--line-soft);
}

.drawer-body {
  padding: 24px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.panel-block {
  padding: 18px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: #fcfdfb;
}

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

.conversation-card {
  padding: 14px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--line-soft);
}

.conversation-card.inbound {
  background: #f8fbff;
}

.conversation-card.outbound {
  background: #f4faf6;
}

.conversation-meta {
  margin-bottom: 6px;
  color: var(--muted);
  font-family: 'DM Mono', monospace;
  font-size: 0.76rem;
}

.avatar-hot {
  background: #fecaca;
  color: #991b1b;
}

.avatar-warm {
  background: #fde68a;
  color: #92400e;
}

.avatar-possible {
  background: var(--blue-bg);
  color: var(--blue-fg);
}

.empty-state {
  padding: 18px 0;
  color: var(--muted);
}

.toast-wrap {
  position: fixed;
  right: 24px;
  bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 90;
}

.toast {
  max-width: 320px;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: var(--text);
  color: #ffffff;
  box-shadow: 0 18px 30px rgba(0, 0, 0, 0.16);
}

.toast.error {
  background: var(--red-fg);
}

.toast.success {
  background: var(--accent);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(24, 32, 27, 0.38);
  z-index: 110;
}

.modal-shell {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 111;
}

.modal-card {
  width: min(840px, 100%);
}

.welcome-backdrop {
  backdrop-filter: blur(3px);
}

.welcome-shell {
  z-index: 120;
}

.welcome-card {
  position: relative;
  width: min(560px, 100%);
  padding: 34px 32px 30px;
  background:
    radial-gradient(circle at top right, rgba(45, 106, 79, 0.16), transparent 34%),
    linear-gradient(135deg, #f7fbf7 0%, #f0f6f2 100%);
}

.welcome-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(24, 32, 27, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--text);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

.welcome-copy {
  margin: 14px 0 22px;
  color: var(--text);
  font-size: 0.98rem;
}

.approval-editor-textarea {
  min-height: 320px;
}

@media (max-width: 1280px) {
  .metric-strip,
  .metric-strip-job,
  .jobs-grid,
  .health-grid,
  .config-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 960px) {
  .mobile-menu {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 700;
    position: relative;
    z-index: 46;
  }

  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    box-shadow: none;
    max-width: min(84vw, 320px);
  }

  body.sidebar-open .sidebar {
    transform: translateX(0);
  }

  .mobile-nav-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(24, 32, 27, 0.34);
    z-index: 35;
  }

  body.sidebar-open .mobile-nav-backdrop {
    display: block;
  }

  .main {
    margin-left: 0;
    width: 100%;
  }

  .container {
    padding: 24px 18px 40px;
  }

  .page-header,
  .job-detail-header,
  .section-head,
  .job-card-head,
  .approval-card-head,
  .config-head,
  .health-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .metric-strip,
  .metric-strip-job,
  .jobs-grid,
  .health-grid,
  .config-grid,
  .form-grid,
  .panel-grid,
  .job-snapshot-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .page-title {
    font-size: 2.3rem;
  }

  .activity-event-row {
    gap: 10px;
  }

  .page-header-right,
  .demo-company {
    width: 100%;
  }

  .page-header-right {
    align-items: flex-start;
  }

  .page-header-right .button-row {
    width: 100%;
  }

  .page-header-right .button-row .btn {
    flex: 1 1 0;
  }

  .sourcing-card {
    right: 18px;
    left: 18px;
    bottom: 18px;
    width: auto;
  }
}

@media (max-width: 767px) {
  .metric-number {
    font-size: 2.3rem;
  }

  .table-shell {
    overflow-x: auto;
  }

  .activity-timestamp {
    min-width: 92px;
  }

  .approval-card,
  .surface,
  .metric-card,
  .thread-card,
  .health-card,
  .config-card,
  .job-card {
    padding: 20px;
  }

  .metric-strip,
  .metric-strip-job,
  .jobs-grid,
  .health-grid,
  .config-grid,
  .form-grid,
  .panel-grid,
  .job-snapshot-grid {
    grid-template-columns: 1fr;
  }

  .page-header {
    gap: 16px;
  }

  .page-title {
    font-size: 1.95rem;
  }

  .demo-banner-top {
    font-size: 0.92rem;
  }

  .button-row .btn,
  .button-row .book-call-link.btn {
    width: 100%;
  }

  .sidebar {
    width: min(84vw, 320px);
    padding-top: 22px;
  }
}

.page-header-right,
.demo-company,
.approval-person-wrap,
.sourcing-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.page-header-right {
  flex-direction: column;
  align-items: flex-end;
}

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

.demo-company-name {
  font-weight: 700;
  color: var(--text);
}

.demo-banner {
  background:
    linear-gradient(135deg, rgba(219, 234, 254, 0.48), rgba(209, 250, 229, 0.52)),
    var(--panel);
}

.demo-banner-top {
  font-size: 0.98rem;
}

.demo-banner-top a {
  color: var(--accent-strong);
  font-weight: 700;
}

.book-call-link {
  color: var(--accent-strong);
  font-weight: 700;
}

.demo-banner-sub,
.metric-foot,
.cta-sub {
  margin-top: 8px;
  color: var(--muted);
}

.metric-foot {
  font-size: 0.92rem;
}

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

.controls-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.control-card p,
.controls-cta p {
  color: var(--text);
}

.controls-cta {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, 0.9fr);
  gap: 28px;
  align-items: center;
}

.controls-cta .book-call-link.btn {
  color: #111111;
}

.empty-hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

.pipeline-tabs {
  margin: 20px 0;
}

.fit-score-text {
  font-family: 'DM Mono', monospace;
  font-weight: 700;
}

.fit-score-text.score-high {
  color: var(--teal-fg);
}

.fit-score-text.score-mid {
  color: var(--text);
}

.fit-score-text.score-low {
  color: var(--muted);
}

.candidate-avatar {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.approval-channel-row {
  display: flex;
  justify-content: flex-start;
}

.approval-success {
  border-color: rgba(6, 95, 70, 0.25);
}

.approval-confirmation {
  color: var(--emerald-fg);
  font-weight: 700;
}

.reply-draft-block {
  margin-top: 10px;
}

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

.sourcing-card {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 100;
  width: min(320px, calc(100vw - 40px));
  padding: 18px;
  border: 1px solid rgba(24, 32, 27, 0.08);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.sourcing-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(45, 106, 79, 0.18);
  border-top-color: var(--accent);
  border-radius: 999px;
  animation: spin 0.9s linear infinite;
  flex: 0 0 auto;
}

.sourcing-count {
  font-family: 'DM Mono', monospace;
  font-size: 0.82rem;
}

.input-error {
  border-color: var(--red-fg);
  animation: shake 0.32s linear;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes shake {
  0%, 100% {
    transform: translateX(0);
  }

  25% {
    transform: translateX(-4px);
  }

  75% {
    transform: translateX(4px);
  }
}

@media (max-width: 1280px) {
  .overview-grid,
  .controls-grid,
  .train-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 960px) {
  .page-header-right,
  .empty-hero,
  .controls-cta {
    align-items: flex-start;
  }

  .overview-grid,
  .controls-grid,
  .controls-cta,
  .train-summary-grid {
    grid-template-columns: 1fr;
  }
}
