/* RTS "New" recruiter UI component layer.
 *
 * Implements the shared design language from the Old/New review artifact
 * (qa-output/ui-design/recruiter-ui-old-new-review-20260625.html) using the existing RTS
 * palette: compact sticky record headers, internal tabs with counts, a green readiness strip,
 * a narrow right-side next-action/readiness rail, dense compact tables, and status chips.
 * Layout/hierarchy match the New mockups; colors stay on the RTS sand/navy/rust system.
 */

:root {
  --rts-ok: #2f7d52;
  --rts-ok-soft: #e9f4ec;
  --rts-warn: #9b6200;
  --rts-warn-soft: #fbf3e2;
  --rts-blocked: #a23b2a;
  --rts-blocked-soft: #f7e9e6;
  --rts-rail: #eef4ff;
  --rts-rail-line: #cdddf6;
  --rts-rail-ink: #2a4a78;
}

/* ── Compact sticky record header (Company / Job / Person) ───────────────── */
.rts-rec-header {
  position: sticky;
  top: 0;
  z-index: 8;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.7rem 0.9rem;
  margin-bottom: 0.85rem;
}
.rts-rec-id { min-width: 0; }
.rts-rec-id .rts-rec-name {
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.2;
  margin: 0;
}
.rts-rec-id .rts-rec-sub {
  color: var(--muted);
  font-size: 0.82rem;
  margin-top: 0.15rem;
}
.rts-rec-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  justify-content: flex-end;
}

/* ── Internal tab count badge (append to existing tab labels) ────────────── */
.rts-tabcount {
  display: inline-block;
  margin-left: 0.3rem;
  padding: 0 0.35rem;
  min-width: 1.1rem;
  border-radius: 999px;
  background: rgba(36, 50, 74, 0.08);
  color: var(--navy);
  font-size: 0.72rem;
  font-weight: 700;
  text-align: center;
}

/* ── Readiness strip (green) ─────────────────────────────────────────────── */
/* The status/policy bar. It was a full-width block whatever it held: the "Ready for recruiting"
   line ran 1,130px for text that ended at 603, and the off-limits box was a small control marooned
   in a page-wide frame with empty space all around it. The box now ends where its content ends. */
.rts-readiness {
  border: 1px solid #b9d6c2;
  border-left: 4px solid var(--rts-ok);
  background: var(--rts-ok-soft);
  border-radius: 8px;
  padding: 0.6rem 0.75rem;
  font-size: 0.86rem;
  color: var(--ink);
  width: fit-content;
  max-width: 100%;
}
.rts-readiness strong { color: var(--rts-ok); }
/* Provenance line inside the bar: who wrote the Deep Research and when. Its own line under the
   status text, quieter than it, because it qualifies the claim rather than making one. */
.rts-readiness-provenance {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.92em;
  color: var(--muted, #6b7280);
}
.rts-readiness.is-warn {
  border-color: #e6cf9a;
  border-left-color: var(--rts-warn);
  background: var(--rts-warn-soft);
}
.rts-readiness.is-warn strong { color: var(--rts-warn); }

/* ── Two-column cockpit: main content + narrow next-action rail ──────────── */
.rts-cockpit {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 0.85rem;
  align-items: start;
}
.rts-cockpit > .rts-main { min-width: 0; display: grid; gap: 0.7rem; }

/* Names the cockpit's to-do queue (Greta 2026-07-14: "Thing to work" -> to-do list).
   The list previously had no title and the column header did the naming. Matches the
   rail's h4 so the two halves of the cockpit read as one component; the margin reset
   matters because .rts-main is a grid and already supplies the gap. */
.rts-todo-title {
  margin: 0;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted, #6b7280);
}

.rts-rail {
  border: 1px solid var(--rts-rail-line);
  background: var(--rts-rail);
  border-radius: 8px;
  padding: 0.7rem 0.8rem;
  font-size: 0.84rem;
  color: var(--rts-rail-ink);
  position: sticky;
  top: 4.5rem;
}
.rts-rail h4 {
  margin: 0 0 0.35rem;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--rts-rail-ink);
}
.rts-rail .rts-rail-step { margin: 0.35rem 0; }
.rts-rail .rts-rail-cta {
  display: inline-block;
  margin-top: 0.5rem;
  font-weight: 700;
  color: var(--rust-dark);
}

/* ── Dense compact table for related records ─────────────────────────────── */
/* SIZE TO THE CONTENT, NOT TO THE SCREEN (2026-08-05).
   This is the table Ilya actually measured on the ADIA company page: "Choose the job this search
   is for" ended at x≈332 and its Review jobs link sat at x≈1220 — ~890px of nothing between a row
   and the button that acts on it. The first layout pass fixed `table.data-grid`, which is NOT this
   component: the cockpit to-do list is a bare <table> inside .rts-dense, so it kept its full-width
   stretch and the complaint that started the whole pass went unfixed.

   The BOX shrinks to its content (the border has to hug the table, not float around it) with a
   floor so a two-row list is not a stamp, and a ceiling so a genuinely wide one still fits. */
.rts-dense {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  font-size: 0.83rem;
  width: fit-content;
  min-width: min(100%, 34rem);
  max-width: 100%;
}
.rts-dense table { width: 100%; border-collapse: collapse; }
.rts-dense th,
.rts-dense td {
  text-align: left;
  padding: 0.4rem 0.55rem;
  border-top: 1px solid var(--line);
  vertical-align: middle;
}
.rts-dense thead th {
  border-top: 0;
  background: #f4efe6;
  color: var(--navy);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.rts-dense tbody tr:hover { background: #fbf8f2; }
/* One long row was setting the width of the whole first column, so every SHORT row's action was
   pushed out to meet it — the "Contacts nobody has confirmed are still here — confirmed on a
   person's own page..." row was doing this to the two rows above it. Let the long one wrap. */
.rts-dense td:first-child { max-width: 46ch; }
.rts-dense td.rts-num { font-variant-numeric: tabular-nums; }
.rts-dense .rts-cell-strong { font-weight: 700; color: var(--navy); }

/* ── Status chips ────────────────────────────────────────────────────────── */
.rts-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 0.12rem 0.5rem;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
}
.rts-chip.is-ok { color: var(--rts-ok); border-color: #b9d6c2; background: var(--rts-ok-soft); }
.rts-chip.is-warn { color: var(--rts-warn); border-color: #e6cf9a; background: var(--rts-warn-soft); }
.rts-chip.is-blocked { color: var(--rts-blocked); border-color: #e2bdb4; background: var(--rts-blocked-soft); }
.rts-chip.is-neutral { color: var(--navy); border-color: var(--line); background: #f4efe6; }

/* ── Inline action link/button used inside dense rows and the header ─────── */
.rts-actionlink {
  display: inline-block;
  border: 1px solid #cdb9a3;
  border-radius: 6px;
  padding: 0.18rem 0.5rem;
  color: var(--rust-dark);
  background: #fff;
  font-weight: 700;
  font-size: 0.76rem;
  text-decoration: none;
  white-space: nowrap;
}
.rts-actionlink:hover { background: #fbf8f2; }
.rts-actionlink.is-primary { background: var(--rust); border-color: var(--rust-dark); color: #fff; }
.rts-actionlink.is-primary:hover { background: var(--rust-dark); }

@media (max-width: 900px) {
  .rts-cockpit { grid-template-columns: 1fr; }
  .rts-rail { position: static; }
  .rts-rec-header { position: static; }
}
