/* HirePro Links: a list-and-detail layout in the style of Circle
   (https://github.com/ln-dev7/circle, MIT License, (c) ln-dev7), whose zinc
   palette the tokens below follow. No build step: plain CSS. */

:root {
  --bg: oklch(0.975 0.001 286.375);
  --surface: #fff;
  --sidebar: oklch(0.975 0.001 286.375);
  --fg: oklch(0.141 0.005 285.823);
  --muted: oklch(0.552 0.016 285.938);
  --hover: oklch(0.967 0.001 286.375);
  --selected: oklch(0.94 0.004 286.32);
  --border: oklch(0.92 0.004 286.32);
  --accent: oklch(0.488 0.243 264.376);
  --accent-soft: oklch(0.488 0.243 264.376 / 0.1);
  --team: oklch(0.6 0.118 184.704);
  --recruiter: oklch(0.646 0.222 41.116);
  --group: oklch(0.627 0.265 303.9);
  --warn: oklch(0.666 0.179 58.318);
  --warn-soft: oklch(0.666 0.179 58.318 / 0.12);
  --bubble: oklch(0.95 0.03 230);
  --danger: oklch(0.577 0.245 27.325);
  --danger-soft: oklch(0.577 0.245 27.325 / 0.1);
  --radius: 10px;
  --font: "Inter", "Geist", ui-sans-serif, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: oklch(0.141 0.005 285.823);
    --surface: #101011;
    --sidebar: oklch(0.21 0.006 285.885);
    --fg: oklch(0.985 0 0);
    --muted: oklch(0.705 0.015 286.067);
    --hover: oklch(0.274 0.006 286.033);
    --selected: oklch(0.3 0.008 286.033);
    --border: oklch(0.274 0.006 286.033);
    --accent: oklch(0.7 0.16 264);
    --accent-soft: oklch(0.7 0.16 264 / 0.16);
    --warn: oklch(0.8 0.15 75);
    --warn-soft: oklch(0.8 0.15 75 / 0.12);
    --bubble: oklch(0.3 0.04 240);
    --danger: oklch(0.637 0.237 25.331);
    --danger-soft: oklch(0.637 0.237 25.331 / 0.14);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font: 13px/1.45 var(--font); -webkit-font-smoothing: antialiased;
}
button, input, textarea, select { font: inherit; color: inherit; }
code, .mono { font-family: var(--mono); font-size: 12px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }

.app { display: grid; grid-template-columns: 232px minmax(0, 1fr); height: 100%; }

/* Sidebar */
.sidebar {
  background: var(--sidebar); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 16px;
  padding: max(14px, env(safe-area-inset-top, 0px)) 10px 14px max(10px, env(safe-area-inset-left, 0px));
}
.brand { display: flex; align-items: center; gap: 10px; padding: 2px 6px; }
.brand-mark {
  width: 26px; height: 26px; border-radius: 7px; flex: none;
  display: grid; place-items: center; font-weight: 700; font-size: 13px;
  background: var(--fg); color: var(--surface);
}
.brand-name { font-weight: 600; }
.brand-sub { color: var(--muted); font-size: 12px; }
.nav { display: flex; flex-direction: column; gap: 1px; }
.nav-label { padding: 12px 8px 4px; color: var(--muted); font-size: 11px; font-weight: 500; letter-spacing: 0.02em; }
.nav-label:first-child { padding-top: 0; }
.nav-item {
  display: flex; align-items: center; gap: 9px; width: 100%;
  padding: 6px 8px; border: 0; border-radius: 6px; background: none;
  text-align: left; cursor: pointer; color: var(--muted);
}
.nav-item:hover { background: var(--hover); color: var(--fg); }
.nav-item.is-active { background: var(--selected); color: var(--fg); font-weight: 500; }
.nav-count { margin-left: auto; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.nav-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.dot-all { background: var(--fg); }
.dot-start { background: var(--muted); }
.dot-team { background: var(--team); }
.dot-recruiter { background: var(--recruiter); }
.dot-group { background: var(--group); }
.dot-text { background: var(--accent); }
.dot-person { background: var(--team); }
.dot-wait { background: var(--warn); }
.dot-danger { background: var(--danger); }
.sidebar-foot {
  margin-top: auto; display: flex; justify-content: space-between; align-items: center;
  gap: 8px; padding: 0 8px; color: var(--muted); font-size: 12px;
}
.link-button { border: 0; background: none; color: var(--muted); cursor: pointer; padding: 0; text-decoration: underline; }
.link-button:hover { color: var(--fg); }

/* Main */
.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--surface); }
.topbar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: max(10px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) 10px 16px;
  border-bottom: 1px solid var(--border);
}
.topbar h1 { font-size: 14px; font-weight: 600; margin: 0; }
.search {
  margin-left: auto; width: min(280px, 100%); padding: 5px 10px;
  border: 1px solid var(--border); border-radius: 6px; background: var(--bg);
}
.warnings {
  display: flex; flex-direction: column; gap: 4px;
  padding: 10px 16px; border-bottom: 1px solid var(--border); background: var(--warn-soft);
}
.warning { display: flex; gap: 8px; align-items: baseline; }
.warning::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--warn); flex: none; transform: translateY(-1px); }
.warning button { border: 0; background: none; padding: 0; text-align: left; cursor: pointer; }
.warning button:hover { text-decoration: underline; }

.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 440px); flex: 1; min-height: 0; }
.list { overflow-y: auto; border-right: 1px solid var(--border); }
.detail { overflow-y: auto; padding: 18px 20px 40px; display: flex; flex-direction: column; gap: 18px; }

/* Rows */
.group-head {
  position: sticky; top: 0; z-index: 1; display: flex; gap: 8px; align-items: center;
  padding: 7px 16px; background: var(--bg); border-bottom: 1px solid var(--border);
  font-size: 12px; font-weight: 500;
}
.group-head .nav-count { margin-left: 0; }
.row {
  display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; gap: 4px 12px; align-items: center;
  width: 100%; padding: 9px 16px; border: 0; border-bottom: 1px solid var(--border);
  background: none; text-align: left; cursor: pointer;
}
.row:hover { background: var(--hover); }
.row.is-selected { background: var(--selected); }
.row-title { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-link { grid-column: 2; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-meta { grid-column: 3; grid-row: 1 / span 2; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; max-width: 340px; }
.chip {
  display: inline-flex; align-items: center; gap: 5px; max-width: 220px;
  padding: 1px 8px; border: 1px solid var(--border); border-radius: 999px;
  font-size: 12px; color: var(--fg); background: var(--surface); white-space: nowrap;
}
.chip > span { overflow: hidden; text-overflow: ellipsis; }
.chip.is-muted { color: var(--muted); }
.chip.is-warn { border-color: var(--warn); color: var(--warn); }
.chip.is-accent { border-color: transparent; background: var(--accent-soft); color: var(--accent); }
.num { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 12px; white-space: nowrap; }
.empty { padding: 40px 16px; color: var(--muted); text-align: center; }

/* Detail */
.detail-head { display: flex; flex-direction: column; gap: 6px; }
.detail-kind { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.detail h2 { margin: 0; font-size: 18px; font-weight: 600; text-wrap: balance; }
.prop-list { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 8px 12px; margin: 0; }
.prop-list dt { color: var(--muted); }
.prop-list dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.section-title { font-size: 12px; font-weight: 500; color: var(--muted); margin: 0 0 8px; }
.copy-line { display: flex; gap: 8px; align-items: center; min-width: 0; }
.copy-line code { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.button {
  border: 1px solid var(--border); background: var(--surface); border-radius: 6px;
  padding: 3px 9px; cursor: pointer; font-size: 12px; white-space: nowrap;
}
.button:hover { background: var(--hover); }
.bubble {
  background: var(--bubble); border-radius: 12px 12px 12px 4px; padding: 10px 12px;
  white-space: pre-wrap; overflow-wrap: anywhere; max-width: 100%;
}
.bubble a { color: var(--accent); }
.bubble-note { color: var(--muted); font-size: 12px; margin-top: 6px; }
.cards { display: flex; flex-direction: column; gap: 8px; }
.card {
  border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px;
  display: flex; flex-direction: column; gap: 4px; min-width: 0;
}
.card-title { font-weight: 500; display: flex; gap: 8px; align-items: center; }
.card-sub { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.stats { display: flex; gap: 20px; }
.stat-value { font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; }
.stat-label { color: var(--muted); font-size: 12px; }

/* One-line rows */
.row.row-one { grid-template-columns: 10px minmax(0, max-content) minmax(0, 1fr) auto; gap: 12px; }
.row.row-one .row-title { display: flex; align-items: center; gap: 6px; }
.row-sub { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-flags { display: flex; gap: 6px; }
.tag { font-size: 11px; font-weight: 500; color: var(--accent); background: var(--accent-soft); border-radius: 4px; padding: 0 5px; margin-left: 6px; vertical-align: middle; }
.muted { color: var(--muted); }
.note { margin: 0; font-size: 12px; }
.note.is-warn { color: var(--warn); }
.edit-box { border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; }
.inline-field { display: inline-flex; gap: 8px; align-items: center; }
.inline-field select { padding: 3px 8px; border: 1px solid var(--border); border-radius: 6px; background: var(--bg); }
.link-button.is-danger { color: var(--danger); }

/* Forms */
.section { display: flex; flex-direction: column; gap: 8px; }
.section .section-title { margin: 0; }
.detail-stack { display: flex; flex-direction: column; gap: 14px; }
.form { display: flex; flex-direction: column; gap: 12px; }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field-label { font-weight: 500; }
.field-hint { color: var(--muted); font-size: 12px; }
.field input, .field textarea, .field select {
  width: 100%; padding: 6px 9px; border: 1px solid var(--border); border-radius: 6px;
  background: var(--bg); min-width: 0;
}
.field textarea { resize: vertical; line-height: 1.45; }
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.form-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.button.is-primary { background: var(--fg); color: var(--surface); border-color: var(--fg); }
.button.is-primary:hover { opacity: 0.88; background: var(--fg); }
.button.is-danger { color: var(--danger); border-color: var(--danger); }
.button.is-danger:hover { background: var(--danger-soft); }
.button:disabled { opacity: 0.5; cursor: default; }
.list-actions { display: flex; justify-content: flex-end; align-items: center; flex-wrap: wrap; gap: 8px; padding: 8px 16px; border-bottom: 1px solid var(--border); }
.list-actions select, .form-actions select { padding: 3px 8px; border: 1px solid var(--border); border-radius: 6px; background: var(--bg); }
.list-note { color: var(--muted); font-size: 12px; padding: 10px 16px; margin: 0; }
body.is-busy { cursor: progress; }
.toast {
  position: fixed; z-index: 20; left: 50%; transform: translateX(-50%);
  bottom: calc(16px + env(safe-area-inset-bottom, 0px)); max-width: min(520px, calc(100% - 32px));
  padding: 8px 14px; border-radius: 8px; background: var(--fg); color: var(--surface);
  box-shadow: 0 6px 24px oklch(0 0 0 / 0.18);
}
.toast.is-bad { background: var(--danger); color: #fff; }

/* Tables */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.table th, .table td { padding: 7px 12px; border-bottom: 1px solid var(--border); text-align: right; white-space: nowrap; }
.table th { color: var(--muted); font-weight: 500; font-size: 12px; position: sticky; top: 0; background: var(--surface); }
.table th:first-child, .table td:first-child { text-align: left; padding-left: 16px; }
.table tr.is-idle td { color: var(--muted); }
.tabs { display: flex; gap: 4px; padding: 8px 16px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.tab { border: 1px solid transparent; background: none; border-radius: 6px; padding: 3px 10px; cursor: pointer; color: var(--muted); }
.tab.is-active { border-color: var(--border); background: var(--surface); color: var(--fg); }
.split.is-wide { grid-template-columns: minmax(0, 1fr); }
.split.is-wide .detail { display: none; }
.split.is-wide .list { border-right: 0; }
.detail.broadcast { overflow: visible; }
.check { display: flex; gap: 8px; align-items: flex-start; }
.check input { margin-top: 3px; }

/* Boxes in a detail (manager card) */
.stat-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--border); border-radius: var(--radius); }
.stat-cell { padding: 10px 12px; min-width: 0; }
.stat-cell + .stat-cell { border-left: 1px solid var(--border); }
.stat-value.is-good { color: var(--team); }
.stat-value.is-warn { color: var(--warn); }
.box { border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.box-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.box-title { margin: 0; font-size: 13px; font-weight: 600; }
.box-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; min-height: 28px; }
.box-row + .box-row { border-top: 1px solid var(--border); padding-top: 10px; }
.logins { display: flex; flex-direction: column; }
.login { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--border); }
.login:first-child { border-top: 0; padding-top: 0; }
.login:last-child { padding-bottom: 0; }
.login-main, .login-side { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.login-side { text-align: right; flex: none; }
.danger-box { width: 100%; border: 1px solid var(--danger); background: var(--danger-soft); border-radius: 8px; padding: 12px; }

/* Login gate */
.gate { position: fixed; inset: 0; display: grid; place-items: center; background: var(--bg); padding: 16px; }
.gate-card {
  max-width: 380px; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 28px 24px;
}
.gate-card h1 { font-size: 16px; margin: 0; }
.gate-card p { margin: 0; color: var(--muted); }

@media (max-width: 900px) {
  .split { grid-template-columns: minmax(0, 1fr); overflow-y: auto; }
  .list, .detail { overflow: visible; border-right: 0; }
  .detail { border-top: 1px solid var(--border); }
}
@media (max-width: 640px) {
  .app { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .sidebar { flex-direction: row; flex-wrap: wrap; align-items: center; border-right: 0; border-bottom: 1px solid var(--border); padding-right: max(10px, env(safe-area-inset-right, 0px)); }
  .nav { flex-direction: row; overflow-x: auto; width: 100%; }
  .nav-item { width: auto; white-space: nowrap; }
  .nav-count { margin-left: 4px; }
  .sidebar-foot { margin-top: 0; margin-left: auto; }
  .row, .row.row-one { grid-template-columns: 10px minmax(0, 1fr); }
  .row-sub, .row-flags { grid-column: 2; }
  .row-meta { grid-column: 2; grid-row: auto; justify-content: flex-start; max-width: none; }
  .prop-list { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .prop-list dd { margin-bottom: 8px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
