:root {
  --bg: #f6f7f9; --card: #fff; --text: #1d2330; --muted: #6b7280;
  --line: #e3e6eb; --accent: #2563eb; --accent-soft: #e8efff;
  --in: #ffffff; --bot: #eef6ff; --out: #e7f8ec; --danger: #c62828;
  --st-new: #2563eb; --st-contacted: #b45309; --st-interview: #7c3aed;
  --st-hired: #15803d; --st-rejected: #6b7280;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14171c; --card: #1d2128; --text: #e6e8eb; --muted: #9aa3ad;
    --line: #2d333b; --accent: #5b8def; --accent-soft: #1f2c47;
    --in: #22272e; --bot: #1c2a3d; --out: #1b3326; --danger: #ef5350;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

header {
  background: var(--card); border-bottom: 1px solid var(--line);
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px;
  padding: 10px 16px; position: sticky; top: 0; z-index: 5;
}
header .brand { font-weight: 700; margin-inline-end: 8px; }
header nav { display: flex; flex-wrap: wrap; gap: 2px; }
header nav a { padding: 6px 10px; border-radius: 6px; color: var(--text); }
header nav a.on { background: var(--accent-soft); color: var(--accent); }
header .right { margin-inline-start: auto; display: flex; gap: 10px; align-items: center; }
header .langs a { padding: 2px 6px; border-radius: 4px; color: var(--muted); }
header .langs a.on { color: var(--accent); font-weight: 700; }

main { max-width: 1280px; margin: 0 auto; padding: 16px; }
h1 { font-size: 22px; margin: 4px 0 14px; }
h2 { font-size: 16px; margin: 0 0 10px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: 14px; margin-bottom: 14px;
}
.grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 14px; }
@media (max-width: 900px) { .grid { grid-template-columns: 1fr; } }

input, select, textarea, button {
  font: inherit; color: var(--text); background: var(--card);
  border: 1px solid var(--line); border-radius: 7px; padding: 7px 9px;
}
textarea { width: 100%; min-height: 70px; resize: vertical; }
button, .btn {
  background: var(--accent); color: #fff; border-color: var(--accent);
  cursor: pointer; display: inline-block; padding: 7px 14px;
}
.btn:hover { text-decoration: none; }
button.plain, .btn.plain { background: var(--card); color: var(--text); border-color: var(--line); }
button.danger { background: var(--danger); border-color: var(--danger); }
.btn.wa { background: #25d366; border-color: #25d366; }

.form label { display: block; font-size: 13px; color: var(--muted); margin: 8px 0 3px; }
.form input, .form select { width: 100%; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.row > * { flex: 0 1 auto; }
.row .grow { flex: 1 1 200px; }

.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.tabs a {
  padding: 5px 11px; border: 1px solid var(--line); border-radius: 20px;
  background: var(--card); color: var(--text); font-size: 14px;
}
.tabs a.on { background: var(--accent); border-color: var(--accent); color: #fff; }

.table-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: 10px; }
table { border-collapse: collapse; width: 100%; }
th, td { text-align: start; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 13px; color: var(--muted); font-weight: 600; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--accent-soft); }
td.nowrap { white-space: nowrap; }

.badge {
  display: inline-block; padding: 2px 9px; border-radius: 12px; font-size: 12px;
  color: #fff; white-space: nowrap; background: var(--muted);
}
.badge.new { background: var(--st-new); }
.badge.contacted { background: var(--st-contacted); }
.badge.interview { background: var(--st-interview); }
.badge.hired { background: var(--st-hired); }
.badge.rejected { background: var(--st-rejected); }

.chat { display: flex; flex-direction: column; gap: 8px; max-height: 560px; overflow-y: auto; padding: 4px; }
.msg { max-width: 85%; padding: 7px 11px; border-radius: 10px; border: 1px solid var(--line); white-space: pre-wrap; word-wrap: break-word; }
.msg .meta { font-size: 11px; color: var(--muted); margin-bottom: 2px; }
.msg.in { background: var(--in); align-self: flex-start; }
.msg.bot { background: var(--bot); align-self: flex-end; }
.msg.out { background: var(--out); align-self: flex-end; }

.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.pre { white-space: pre-wrap; }
.overdue { color: var(--danger); font-weight: 600; }
.alert { padding: 9px 12px; border-radius: 8px; background: var(--accent-soft); margin-bottom: 12px; }
.alert.error { background: #fdecea; color: var(--danger); }

.login { max-width: 360px; margin: 10vh auto; }
