/* Recruitment Pipeline - hand written CSS, light and dark themes.
   No framework, no build step. */

:root {
  --bg: #f5f7fa;
  --surface: #ffffff;
  --surface-2: #eef2f7;
  --border: #d7dee8;
  --text: #1b2430;
  --muted: #5a6b7d;
  --accent: #1f6feb;
  --accent-ink: #ffffff;
  --accent-soft: #e3edfd;
  --good: #1a7f52;
  --good-soft: #e2f4ec;
  --warn: #9a6300;
  --warn-soft: #fdf1dc;
  --bad: #b32222;
  --bad-soft: #fbe6e6;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.06), 0 6px 18px rgba(16, 24, 40, 0.06);
  --radius: 12px;
}

[data-theme="dark"] {
  --bg: #0f141a;
  --surface: #161d26;
  --surface-2: #1e2733;
  --border: #2c3947;
  --text: #e7edf4;
  --muted: #9fb0c2;
  --accent: #5b9bff;
  --accent-ink: #07121f;
  --accent-soft: #1b2c44;
  --good: #4fd39b;
  --good-soft: #12301f;
  --warn: #e0b25a;
  --warn-soft: #33270f;
  --bad: #ff8080;
  --bad-soft: #35191b;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 22px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  overflow-x: hidden;
}

[hidden] { display: none !important; }

a { color: var(--accent); }

h1, h2, h3 { line-height: 1.25; margin: 0 0 0.4em; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }

/* Header */
.app-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
}
.app-header .wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 12px;
  padding-bottom: 12px;
  flex-wrap: wrap;
}
.brand { display: flex; flex-direction: column; margin-right: auto; }
.brand strong { font-size: 1.15rem; }
.brand span { color: var(--muted); font-size: 0.82rem; }

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--surface-2);
  color: var(--muted);
  border: 1px solid var(--border);
}
.badge.demo { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.badge.good { background: var(--good-soft); color: var(--good); border-color: transparent; }
.badge.bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.badge.accent { background: var(--accent-soft); color: var(--accent); border-color: transparent; }

button, .btn {
  font: inherit;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  padding: 8px 14px;
  cursor: pointer;
}
button:hover, .btn:hover { border-color: var(--accent); }
button:focus-visible, .btn:focus-visible, select:focus-visible,
input:focus-visible, textarea:focus-visible, a:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}
button.primary, .btn.primary {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
  font-weight: 600;
}
button.ghost { background: transparent; }
button.danger { color: var(--bad); border-color: var(--border); }
button.small { padding: 4px 10px; font-size: 0.82rem; }
button:disabled { opacity: 0.5; cursor: not-allowed; }

/* Tabs */
.tabs {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  padding: 8px 0 0;
}
.tabs button {
  border: none;
  background: transparent;
  border-bottom: 3px solid transparent;
  border-radius: 0;
  padding: 10px 12px;
  color: var(--muted);
  font-weight: 600;
}
.tabs button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); }

main { padding: 22px 0 40px; }

.view-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.view-head h2 { margin: 0; }
.view-head .spacer { margin-left: auto; }

/* Cards and stats */
.grid { display: grid; gap: 14px; }
.stats { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}
.stat .label { color: var(--muted); font-size: 0.82rem; }
.stat .value { font-size: 1.7rem; font-weight: 700; margin-top: 4px; }
.stat .sub { color: var(--muted); font-size: 0.78rem; }

/* Forms */
form .field { margin-bottom: 12px; display: flex; flex-direction: column; gap: 4px; }
form label { font-weight: 600; font-size: 0.88rem; }
input, select, textarea {
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 9px 11px;
  width: 100%;
}
textarea { min-height: 90px; resize: vertical; }
.form-row { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
.hint { color: var(--muted); font-size: 0.78rem; }

/* Tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { color: var(--muted); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; }
tbody tr:hover { background: var(--surface-2); }
td.wrap-cell { white-space: normal; min-width: 220px; }

/* Pipeline board */
.kanban { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.col { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px; }
.col h3 { font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); display: flex; justify-content: space-between; }
.col .list { display: flex; flex-direction: column; gap: 8px; min-height: 30px; }
.cand {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
}
.cand .name { font-weight: 600; }
.cand .meta { color: var(--muted); font-size: 0.78rem; margin: 2px 0 8px; }
.cand .actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* Score bars */
.bars { display: grid; gap: 8px; margin: 8px 0; }
.bar-row { display: grid; grid-template-columns: 92px 1fr 40px; align-items: center; gap: 8px; font-size: 0.82rem; }
.bar { background: var(--surface-2); border-radius: 999px; height: 9px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--accent); border-radius: 999px; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  font-size: 0.76rem;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.chip.good { background: var(--good-soft); color: var(--good); border-color: transparent; }
.chip.bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }

/* Timeline */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { padding: 8px 0 8px 14px; border-left: 2px solid var(--border); position: relative; }
.timeline li::before {
  content: ""; position: absolute; left: -6px; top: 14px;
  width: 8px; height: 8px; border-radius: 50%; background: var(--accent);
}
.timeline .when { color: var(--muted); font-size: 0.76rem; }
.timeline .who { color: var(--muted); font-size: 0.76rem; }

/* Modal */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(8, 12, 18, 0.55);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 20px; overflow-y: auto; z-index: 40;
}
.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  max-width: 720px; width: 100%;
  padding: 20px; margin: auto;
  box-shadow: var(--shadow);
}
.modal-head { display: flex; align-items: flex-start; gap: 12px; }
.modal-head h3 { margin: 0; }
.modal-head .spacer { margin-left: auto; }
.modal section { margin-top: 16px; }
.modal h4 { margin: 0 0 6px; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.kv { display: grid; grid-template-columns: 120px 1fr; gap: 4px 12px; font-size: 0.9rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%);
  background: var(--text); color: var(--bg);
  padding: 10px 16px; border-radius: 999px; z-index: 60;
  box-shadow: var(--shadow); font-size: 0.9rem; max-width: 90vw;
}

footer.site {
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.82rem;
  padding: 18px 0 30px;
}
footer.site .wrap { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.empty { color: var(--muted); font-style: italic; padding: 8px 0; }

@media (max-width: 700px) {
  .form-row { grid-template-columns: 1fr; }
  .kanban { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 1fr; }
  .kv dt { margin-top: 6px; }
  .bar-row { grid-template-columns: 76px 1fr 34px; }
}
