:root {
  --bg: #f6f7f9;
  --card: #ffffff;
  --text: #1a1d23;
  --muted: #6b7280;
  --line: #e5e7eb;
  --accent: #0f766e;
  --accent-ink: #ffffff;
  --danger: #b91c1c;
  --wa: #16a34a;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 4px 12px rgba(0,0,0,.04);
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0f1115; --card: #171a21; --text: #e6e8ec; --muted: #9aa3b2; --line: #2a2f3a; --accent: #2dd4bf; --accent-ink: #062a27; --shadow: none; }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, Inter, sans-serif;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.5rem; margin: 0 0 .5rem; }
h2 { font-size: 1.1rem; margin: 1.25rem 0 .5rem; }
h3 { font-size: .95rem; margin: 1.25rem 0 .4rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
h2:first-child, h3:first-child { margin-top: 0; }
p { margin: .5rem 0; }
code { font-size: .9em; background: var(--bg); padding: 1px 5px; border-radius: 4px; }
blockquote { margin: .5rem 0; padding: .5rem .9rem; border-left: 3px solid var(--line); color: var(--muted); }
small { color: var(--muted); }
.muted { color: var(--muted); }
.center { text-align: center; }
.big { font-size: 1.25rem; font-weight: 600; }
.back { color: var(--muted); }

.wrap { max-width: 960px; margin: 0 auto; padding: 0 16px 48px; }
.top { background: var(--card); border-bottom: 1px solid var(--line); margin-bottom: 20px; }
.top-inner { display: flex; align-items: center; justify-content: space-between; height: 54px; padding-bottom: 0; }
.brand { font-weight: 700; letter-spacing: .02em; color: var(--text); }
.nav { display: flex; align-items: center; gap: 12px; }
.who { font-size: .9rem; }
.who small { color: var(--muted); text-transform: capitalize; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin: 0 0 16px; box-shadow: var(--shadow); }
.narrow { max-width: 520px; margin: 24px auto; }
.two { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .two { grid-template-columns: 1fr 1fr; align-items: start; } }

/* Forms */
.form { display: flex; flex-direction: column; gap: 14px; }
.form.compact { gap: 8px; margin-top: 6px; }
.form.inline { flex-direction: row; flex-wrap: wrap; align-items: center; }
.form label { display: flex; flex-direction: column; gap: 4px; font-weight: 500; font-size: .9rem; }
.form label small { font-weight: 400; }
.form .check, .form .radio { flex-direction: row; align-items: center; gap: 8px; font-weight: 500; }
.form .row { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
.form .sub { padding: 10px 12px; border-left: 3px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
input, select, textarea {
  font: inherit; color: var(--text); background: var(--card);
  border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; width: 100%;
}
input[type=checkbox], input[type=radio] { width: auto; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
textarea { resize: vertical; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font: inherit; font-weight: 600; cursor: pointer; text-decoration: none !important;
  padding: 9px 16px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); color: var(--text);
}
.btn:hover { filter: brightness(.97); }
.btn-primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.btn-danger { color: var(--danger); border-color: var(--danger); }
.btn-wa { background: var(--wa); color: #fff; border-color: transparent; }
.btn-ghost { background: transparent; }
.btn-sm { padding: 6px 12px; font-size: .9rem; }
.btn-xs { padding: 3px 9px; font-size: .8rem; }
.btn-block { width: 100%; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }
.radios { gap: 14px; }

.alert { background: #fef2f2; color: var(--danger); border: 1px solid #fecaca; padding: 10px 12px; border-radius: 8px; }
.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 16px; border: 1px solid; }
.flash-ok { background: #ecfdf5; color: #065f46; border-color: #a7f3d0; }
.flash-warn { background: #fffbeb; color: #92400e; border-color: #fde68a; }
.flash-error { background: #fef2f2; color: var(--danger); border-color: #fecaca; }
@media (prefers-color-scheme: dark) {
  .alert, .flash-error { background: #2a1416; }
  .flash-ok { background: #0f2a22; color: #a7f3d0; }
  .flash-warn { background: #2a2210; color: #fde68a; }
}

/* Timeline */
.timeline { list-style: none; margin: 8px 0 12px; padding: 0; display: flex; gap: 0; counter-reset: step; overflow-x: auto; }
.timeline li { flex: 1; min-width: 70px; position: relative; text-align: center; font-size: .78rem; color: var(--muted); padding-top: 22px; }
.timeline li::before { content: ""; position: absolute; top: 8px; left: 0; right: 0; height: 2px; background: var(--line); }
.timeline li:first-child::before { left: 50%; }
.timeline li:last-child::before { right: 50%; }
.timeline .dot { position: absolute; top: 2px; left: 50%; transform: translateX(-50%); width: 14px; height: 14px; border-radius: 50%; background: var(--card); border: 2px solid var(--line); z-index: 1; }
.timeline li.done .dot, .timeline li.current .dot { background: var(--accent); border-color: var(--accent); }
.timeline li.done::before { background: var(--accent); }
.timeline li.current { color: var(--text); font-weight: 600; }
.timeline li.current .dot { box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 25%, transparent); }
.timeline.is-rejected li { opacity: .5; }

/* Profile */
.profile-head { display: flex; gap: 16px; align-items: center; margin-bottom: 12px; }
.profile { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 600px) { .profile { grid-template-columns: 120px 1fr; } .profile details { grid-column: 2; } }
.avatar { width: 96px; height: 96px; border-radius: 12px; object-fit: cover; background: var(--bg); flex: none; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; }
.grid dt { font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.grid dd { margin: 0; overflow-wrap: anywhere; }
.grid .span2 { grid-column: 1 / -1; }
.interview { padding: 14px; border-radius: 10px; background: color-mix(in srgb, var(--accent) 8%, transparent); }

/* Lists */
.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.cand { display: flex; gap: 12px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; color: inherit; }
.cand:hover { text-decoration: none; border-color: var(--accent); }
.thumb { width: 52px; height: 52px; border-radius: 10px; object-fit: cover; background: var(--bg); flex: none; }
.cand-main { display: flex; flex-direction: column; min-width: 0; flex: 1; font-size: .9rem; }
.cand-main span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cand-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; text-align: right; flex: none; }
.plain { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.history { list-style: none; margin: 0; padding: 0; }
.history li { display: grid; grid-template-columns: 110px 1fr; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); font-size: .9rem; }
.history li:first-child { border-top: 0; }
.history time { color: var(--muted); font-size: .8rem; }

/* Badges / chips / filters */
.badge { display: inline-block; font-size: .75rem; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: var(--bg); border: 1px solid var(--line); white-space: nowrap; }
.s-approved, .s-sent_to_client { border-color: var(--accent); color: var(--accent); }
.s-interview { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.s-result { border-color: #6366f1; color: #6366f1; }
.s-rejected { border-color: var(--danger); color: var(--danger); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0 12px; }
.chip { font-size: .85rem; padding: 5px 11px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--text); }
.chip b { color: var(--muted); font-weight: 500; margin-left: 4px; }
.chip.on { border-color: var(--accent); color: var(--accent); }
.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; margin-bottom: 16px; }
.filters input, .filters select { padding: 7px 10px; font-size: .9rem; }

.settings { margin-top: 32px; }
details summary { cursor: pointer; color: var(--accent); font-weight: 500; margin: 6px 0; }
.inline { display: inline; }

/* Added: language toggle, choice fieldset, read-only referral */
.lang { font-weight: 700; letter-spacing: .04em; }
.choice { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 14px; }
.choice legend { font-weight: 500; font-size: .9rem; margin-bottom: 6px; }
input.readonly { background: var(--bg); color: var(--muted); letter-spacing: .08em; font-weight: 600; }
code.code { font-size: 1.3rem; letter-spacing: .12em; padding: 4px 10px; }

/* Experience blocks: only the one matching the Online Gaming answer is shown */
#gaming-fields, #fresh-fields { display: none; }
form:has(input[name="gaming"][value="yes"]:checked) #gaming-fields { display: flex; }
form:has(input[name="gaming"][value="no"]:checked) #fresh-fields { display: flex; }

.avatar-box { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.danger { color: var(--danger); }

.notify { border-left: 4px solid var(--accent); }
.notify.sub { padding: 10px 12px; margin-bottom: 12px; background: color-mix(in srgb, var(--accent) 8%, transparent); border-radius: 8px; }

/* Client candidate table */
.table-wrap { overflow-x: auto; padding: 0; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th, .table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; white-space: nowrap; }
.table th { font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: color-mix(in srgb, var(--accent) 5%, transparent); }
.table tr.st-interested { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.table tr.st-removed { opacity: .55; }
.cstatus { padding: 5px 8px; font-size: .85rem; width: auto; min-width: 140px; }
.cstatus.st-interested { border-color: var(--accent); color: var(--accent); font-weight: 600; }
.cstatus-form { margin: 0; display: inline-flex; gap: 6px; align-items: center; }
.table td.center, .table th.center { text-align: center; }
.thumb.sm { width: 40px; height: 40px; border-radius: 8px; display: block; }
.interest { display: inline-flex; align-items: center; gap: 6px; margin: 0; }
.interest-box { width: 22px; height: 22px; accent-color: var(--accent); cursor: pointer; }
.filters .check { grid-column: span 1; font-size: .9rem; white-space: nowrap; }

.slot { display: none; gap: 6px; align-items: center; margin-left: 6px; }
.slot.show, form.cstatus-form:has(option[value="interested"]:checked) .slot { display: inline-flex; }
.slot input { width: auto; padding: 5px 8px; font-size: .85rem; }
.proposed { display: block; margin-top: 4px; }

.table tr.is-mine { background: color-mix(in srgb, var(--accent) 6%, transparent); }
.table tr.st-interview { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.chip-mine { border-style: dashed; }
.slot-form { display: inline-flex; margin-left: 6px; }
