/* The hiring console. Plain, dense, readable: a work surface, not a brochure. */

:root {
  --bg: #f6f7f9;
  --panel: #ffffff;
  --ink: #1d2230;
  --muted: #5d6576;
  --faint: #8a91a0;
  --line: #e2e5ea;
  --accent: #2856d6;
  --accent-ink: #ffffff;
  --good: #1f7a4d;
  --warn: #9a5b00;
  --bad: #b3261e;
  --chip: #eef1f6;
  --focus: #2856d6;
  --row-hover: #f1f4fa;
  --selected: #e8efff;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.06), 0 1px 3px rgba(16, 24, 40, 0.08);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111419;
    --panel: #181c23;
    --ink: #e6e8ee;
    --muted: #a3aab8;
    --faint: #7b8394;
    --line: #2a303b;
    --accent: #6d93ff;
    --accent-ink: #0b1020;
    --good: #57c28b;
    --warn: #e0a84a;
    --bad: #ff7b72;
    --chip: #232935;
    --row-hover: #1d222b;
    --selected: #1c2640;
    --shadow: none;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body { font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
h1 { font-size: 20px; margin: 0; line-height: 1.25; }
h2 { font-size: 15px; margin: 0 0 8px; }
h3 { font-size: 13px; margin: 12px 0 6px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.loading, .empty { color: var(--muted); padding: 24px; }
.muted { color: var(--muted); }
.warn { color: var(--warn); }
.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 12px; word-break: break-all; }
.faint { color: var(--faint); }
.small { font-size: 12px; }
.nowrap { white-space: nowrap; }
.pre { white-space: pre-wrap; word-break: break-word; }

/* --- the bar across the top ------------------------------------------------ */
.top {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 10px 16px; background: var(--panel); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 5;
}
.top .brand { font-weight: 650; }
.top nav { display: flex; gap: 4px; }
.top nav a { padding: 5px 10px; border-radius: 6px; color: var(--muted); }
.top nav a.on { background: var(--chip); color: var(--ink); }
.top .spacer { flex: 1; }
.top .who { color: var(--muted); }

.page { padding: 16px; max-width: 1500px; margin: 0 auto; }

/* --- buttons, fields -------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  border: 1px solid var(--line); background: var(--panel); border-radius: 6px;
  padding: 5px 11px; line-height: 1.3;
}
.btn:hover { border-color: var(--faint); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, var(--line)); }
.btn.danger-solid { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn[disabled] { opacity: .5; cursor: default; }
.btn.link { border: 0; background: none; padding: 2px 4px; color: var(--accent); }
input[type=text], input[type=search], input[type=email], input[type=password], select, textarea {
  border: 1px solid var(--line); background: var(--panel); border-radius: 6px; padding: 5px 8px;
}
textarea { width: 100%; min-height: 70px; resize: vertical; }
label.field { display: grid; gap: 4px; margin: 10px 0; }
label.check { display: inline-flex; gap: 6px; align-items: center; cursor: pointer; }

/* --- chips, badges ---------------------------------------------------------- */
.chip {
  display: inline-block; padding: 1px 8px; border-radius: 999px; background: var(--chip);
  font-size: 12px; margin: 1px 3px 1px 0; white-space: nowrap;
}
.chip.flag { background: color-mix(in srgb, var(--warn) 16%, var(--panel)); color: var(--warn); }
.chip.stage { background: var(--chip); }
.chip.band-STRONG { background: color-mix(in srgb, var(--good) 18%, var(--panel)); color: var(--good); }
.chip.band-CALL { background: color-mix(in srgb, var(--accent) 14%, var(--panel)); color: var(--accent); }
.chip.band-WEAK { color: var(--muted); }
.chip.pending { background: color-mix(in srgb, var(--accent) 14%, var(--panel)); color: var(--accent); }
.chip.refused { background: color-mix(in srgb, var(--bad) 14%, var(--panel)); color: var(--bad); }
.chip.dup { background: color-mix(in srgb, var(--faint) 20%, var(--panel)); color: var(--muted); }
.chip.no { background: color-mix(in srgb, var(--bad) 14%, var(--panel)); color: var(--bad); }

/* --- the queue ---------------------------------------------------------------- */
.stages { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.stages button {
  border: 1px solid var(--line); background: var(--panel); border-radius: 8px; padding: 6px 10px;
  cursor: pointer; text-align: left; min-width: 118px;
}
.stages button .n { display: block; font-size: 18px; font-weight: 650; }
.stages button .l { font-size: 12px; color: var(--muted); }
.stages button.on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.stages button.waiting .l::after { content: " · yours"; color: var(--warn); }

.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }
.filters input[type=search] { min-width: 240px; }

.bulk {
  display: flex; gap: 8px; align-items: center; padding: 8px 12px; margin-bottom: 10px;
  background: var(--selected); border: 1px solid var(--accent); border-radius: 8px;
}

.table-wrap { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; overflow: auto; box-shadow: var(--shadow); }
table.queue { border-collapse: collapse; width: 100%; }
table.queue th, table.queue td { padding: 7px 10px; border-bottom: 1px solid var(--line); vertical-align: top; text-align: left; }
table.queue th { position: sticky; top: 0; background: var(--panel); font-size: 12px; color: var(--muted); font-weight: 600; z-index: 1; }
table.queue tr:hover td { background: var(--row-hover); }
table.queue tr.selected td { background: var(--selected); }
table.queue td.why { max-width: 360px; color: var(--muted); }
table.queue td.num { text-align: right; white-space: nowrap; }
.more { padding: 12px; text-align: center; }

/* --- one application ---------------------------------------------------------- */
.app-grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 16px; align-items: start; }
@media (max-width: 1050px) { .app-grid { grid-template-columns: 1fr; } }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; margin-bottom: 16px; box-shadow: var(--shadow); }
.card.head .line { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; }
.back { display: inline-block; margin-bottom: 10px; }
dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin: 0; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; white-space: pre-wrap; word-break: break-word; }
.machine { font-size: 12px; color: var(--faint); font-style: italic; }
.trait { border-top: 1px solid var(--line); padding: 8px 0; }
.trait:first-child { border-top: 0; }
.trait .score { font-weight: 650; }
blockquote { margin: 4px 0 4px 0; padding: 2px 10px; border-left: 3px solid var(--line); color: var(--muted); }

.commands { display: grid; gap: 6px; }
.commands .group { font-size: 12px; color: var(--muted); margin-top: 6px; }
.commands .btn { justify-content: space-between; width: 100%; }
.commands .btn .what { color: var(--faint); font-size: 12px; }
.open-command { padding: 10px; border-radius: 6px; background: var(--chip); margin-bottom: 10px; }
.open-command.refused { background: color-mix(in srgb, var(--bad) 10%, var(--panel)); }

ol.journey { list-style: none; margin: 0; padding: 0; }
ol.journey li { position: relative; padding: 0 0 12px 16px; border-left: 2px solid var(--line); margin-left: 4px; }
ol.journey li::before { content: ""; position: absolute; left: -6px; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
ol.journey li.command::before { background: var(--accent); }
ol.journey li.message::before, ol.journey li.reply::before { background: var(--good); }
ol.journey li.stage::before { background: var(--warn); }
ol.journey .when { font-size: 12px; color: var(--faint); }
ol.journey .who { font-size: 12px; color: var(--muted); }
ol.journey .detail { font-size: 12px; color: var(--muted); white-space: pre-wrap; word-break: break-word; }

.thread { display: grid; gap: 8px; }
.bubble { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
.bubble.in { background: color-mix(in srgb, var(--good) 8%, var(--panel)); }
.bubble .meta { font-size: 12px; color: var(--faint); margin-bottom: 4px; }

details > summary { cursor: pointer; color: var(--accent); }

/* --- dialog, toasts, sign in -------------------------------------------------- */
dialog { border: 1px solid var(--line); border-radius: 10px; padding: 18px; width: min(560px, 94vw); background: var(--panel); color: var(--ink); }
dialog::backdrop { background: rgba(10, 14, 24, 0.45); }
dialog .actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 14px; }
dialog .preview { border: 1px dashed var(--line); border-radius: 6px; padding: 8px 10px; white-space: pre-wrap; font-size: 13px; max-height: 260px; overflow: auto; }

#toasts { position: fixed; right: 16px; bottom: 16px; display: grid; gap: 8px; z-index: 50; max-width: min(460px, 90vw); }
.toast { background: var(--ink); color: var(--bg); padding: 10px 14px; border-radius: 8px; box-shadow: var(--shadow); white-space: pre-wrap; }
.toast.bad { background: var(--bad); color: #fff; }

.signin { max-width: 380px; margin: 12vh auto; }
.signin .card { padding: 22px; }
.signin p { color: var(--muted); }
.error { color: var(--bad); }

/* --- the next step: the one highlighted place on an application -------------- */
.card.next {
  border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--line));
  background: color-mix(in srgb, var(--accent) 5%, var(--panel));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 10%, transparent), var(--shadow);
}
.next-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 8px; }
.next-head h2 { margin: 0; }
.next-head .spacer { flex: 1; }
.steps { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 4px; }
.btn.step { flex-direction: column; align-items: flex-start; gap: 2px; padding: 8px 12px; min-width: 190px; max-width: 300px; text-align: left; }
.btn.step .what { font-weight: 600; }
.btn.step .note { font-size: 12px; color: var(--muted); }
.btn.step.main { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.step.main .note { color: color-mix(in srgb, var(--accent-ink) 80%, transparent); }
.btn.step.danger .what { color: var(--bad); }
.small-steps .btn.step { min-width: 170px; padding: 6px 10px; }
.more-steps { margin-top: 8px; }
.more-steps > summary { font-size: 13px; }

/* --- a confirmation: what will happen ----------------------------------------- */
ul.effects { margin: 4px 0 8px; padding-left: 18px; display: grid; gap: 6px; }
ul.effects li.warn { color: var(--warn); }
ul.effects li.error { color: var(--bad); }
ul.effects .preview { margin-top: 6px; }
ul.names { margin: 0 0 8px; padding-left: 18px; font-size: 13px; }
.pick { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
@media (max-width: 560px) { .pick { grid-template-columns: 1fr; } }
dialog { width: min(640px, 94vw); max-height: 90vh; overflow: auto; }

/* --- interviews and what the interviewers said -------------------------------- */
.interview { border-top: 1px solid var(--line); padding: 10px 0; }
.interview:first-of-type { border-top: 0; }
.interview .line { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.interview .feedback { margin-top: 6px; padding: 8px 10px; border-left: 3px solid var(--accent); background: var(--chip); border-radius: 0 6px 6px 0; }
.chip.iv-feedback_in { background: color-mix(in srgb, var(--good) 18%, var(--panel)); color: var(--good); }
.chip.iv-booked { background: color-mix(in srgb, var(--accent) 14%, var(--panel)); color: var(--accent); }
.chip.iv-called_off, .chip.iv-no_show, .chip.iv-booking_cancelled { color: var(--muted); }
.chip.verdict-STRONG_YES, .chip.verdict-YES { background: color-mix(in srgb, var(--good) 18%, var(--panel)); color: var(--good); }
.chip.verdict-NO, .chip.verdict-STRONG_NO { background: color-mix(in srgb, var(--bad) 14%, var(--panel)); color: var(--bad); }
.chip.verdict-NO_READ { color: var(--muted); }
table.queue tr.inactive td { color: var(--faint); }

/* --- an interviewer's own pages ------------------------------------------------ */
.interview-list { display: grid; gap: 8px; }
.interview-row { display: grid; gap: 4px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); }
.interview-row:hover { border-color: var(--accent); text-decoration: none; background: var(--row-hover); }
.feedback-form { position: sticky; top: 64px; }
.feedback-form .actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 8px; }
.verdicts { display: grid; gap: 4px; }
.verdict { display: flex; gap: 8px; align-items: flex-start; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; cursor: pointer; }
.verdict:has(input:checked) { border-color: var(--accent); background: var(--selected); }
.verdict input { margin-top: 3px; }
textarea.tall { min-height: 180px; }
