/* Agentic Recruitment — AI Invention dark premium theme */
:root {
  --bg: #09090b;
  --card: #18181b;
  --card-2: #131316;
  --border: #27272a;
  --border-soft: #1f1f23;
  --text: #fafafa;
  --muted: #a1a1aa;
  --faint: #71717a;
  --cyan: #22d3ee;
  --emerald: #2ef2c3;
  --amber: #fbbf24;
  --rose: #fb7185;
  --radius: 14px;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.55);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  background-image:
    radial-gradient(900px 480px at 12% -8%, rgba(34, 211, 238, 0.10), transparent 62%),
    radial-gradient(760px 420px at 100% 0%, rgba(46, 242, 195, 0.07), transparent 60%);
  background-attachment: fixed;
  color: var(--text);
  font-family: Inter, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: 720px; margin: 0 auto; padding: 28px 20px 72px; }
.wrap.wide { max-width: 1180px; }

/* ---------- top bar ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 40px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 7px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(24, 24, 27, 0.75);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.badge::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--emerald);
  box-shadow: 0 0 12px var(--emerald);
}

.badge:hover { text-decoration: none; }

nav { display: flex; gap: 8px; flex-wrap: wrap; }

nav a {
  padding: 8px 15px;
  border-radius: 9px;
  border: 1px solid transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
}

nav a:hover { color: var(--text); background: var(--card); text-decoration: none; }
nav a.active { color: var(--cyan); border-color: var(--border); background: var(--card); }

/* ---------- hero ---------- */
.hero { margin-bottom: 34px; }

.hero h1 {
  margin: 0 0 12px;
  font-size: clamp(31px, 6vw, 45px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.hero h1 .grad {
  background: linear-gradient(100deg, var(--cyan), var(--emerald));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero p { margin: 0; color: var(--muted); font-size: 16px; max-width: 56ch; }

/* ---------- cards ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
}

.card + .card { margin-top: 20px; }

.card h2 { margin: 0 0 6px; font-size: 19px; font-weight: 700; letter-spacing: -0.01em; }
.card .sub { margin: 0 0 24px; color: var(--faint); font-size: 14px; }

/* ---------- forms ---------- */
.field { margin-bottom: 18px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }

label {
  display: block;
  margin-bottom: 7px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

label .req { color: var(--cyan); }

input[type="text"],
input[type="email"],
input[type="tel"],
select {
  width: 100%;
  padding: 12px 14px;
  background: var(--card-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

input::placeholder { color: #52525b; }

input:focus, select:focus {
  outline: none;
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.16);
}

select {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath fill='%23a1a1aa' d='M6 8 0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
}

/* file input */
.file-drop {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px;
  background: var(--card-2);
  border: 1px dashed var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.file-drop:hover { border-color: var(--cyan); background: #16161a; }
.file-drop input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.file-drop .icon {
  flex: none;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: rgba(34, 211, 238, 0.1);
  color: var(--cyan);
  font-size: 18px;
}

.file-drop .fname { font-size: 14px; font-weight: 600; }
.file-drop .fhint { font-size: 12.5px; color: var(--faint); }
.file-drop.has-file { border-style: solid; border-color: var(--emerald); }
.file-drop.has-file .icon { background: rgba(46, 242, 195, 0.12); color: var(--emerald); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 14px 22px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(100deg, var(--cyan), var(--emerald));
  color: #06202a;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
}

.btn:hover:not(:disabled) { opacity: 0.92; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn.secondary { background: var(--card-2); border: 1px solid var(--border); color: var(--text); }
.btn.inline { width: auto; }

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(6, 32, 42, 0.35);
  border-top-color: #06202a;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- pipeline steps (loading state) ---------- */
.steps { margin: 22px 0 0; padding: 0; list-style: none; }

.steps li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 0;
  color: var(--faint);
  font-size: 14px;
  transition: color 0.2s;
}

.steps li::before {
  content: "";
  flex: none;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--border);
  transition: background 0.2s, box-shadow 0.2s;
}

.steps li.active { color: var(--text); }
.steps li.active::before { background: var(--cyan); box-shadow: 0 0 12px var(--cyan); }
.steps li.done { color: var(--muted); }
.steps li.done::before { background: var(--emerald); box-shadow: none; }

/* ---------- result panel ---------- */
.result { display: none; }
.result.show { display: block; animation: rise 0.3s ease-out; }

@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.result-head { display: flex; align-items: center; gap: 15px; margin-bottom: 18px; }

.result-icon {
  flex: none;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  font-size: 22px;
}

.result-title { margin: 0; font-size: 19px; font-weight: 700; }
.result-sub { margin: 2px 0 0; color: var(--faint); font-size: 13.5px; }

.ok  .result-icon { background: rgba(46, 242, 195, 0.12); color: var(--emerald); }
.no  .result-icon { background: rgba(251, 113, 133, 0.12); color: var(--rose); }
.wait .result-icon { background: rgba(251, 191, 36, 0.12); color: var(--amber); }
.err .result-icon { background: rgba(251, 113, 133, 0.12); color: var(--rose); }

.score-box {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 18px;
  margin: 18px 0;
  background: var(--card-2);
  border: 1px solid var(--border);
  border-radius: 11px;
}

.score-num { font-size: 30px; font-weight: 800; letter-spacing: -0.02em; line-height: 1; }
.score-num small { font-size: 14px; font-weight: 600; color: var(--faint); }
.score-meta { flex: 1; }
.score-label { font-size: 12px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--faint); }

.bar { height: 6px; margin-top: 8px; border-radius: 99px; background: var(--border); overflow: hidden; }
.bar span {
  display: block;
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--cyan), var(--emerald));
  transition: width 0.7s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.note {
  padding: 15px 17px;
  border-radius: 0 10px 10px 0;
  border-left: 3px solid var(--cyan);
  background: var(--card-2);
  color: var(--muted);
  font-size: 14px;
}

.note strong { display: block; margin-bottom: 4px; color: var(--text); font-size: 13px; }

/* ---------- stage pills ---------- */
.pill {
  display: inline-block;
  padding: 4px 11px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card-2);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.pill.applied      { color: var(--cyan);    border-color: rgba(34, 211, 238, 0.35);  background: rgba(34, 211, 238, 0.08); }
.pill.shortlisted  { color: var(--emerald); border-color: rgba(46, 242, 195, 0.35);  background: rgba(46, 242, 195, 0.08); }
.pill.interviewing { color: var(--amber);   border-color: rgba(251, 191, 36, 0.35);  background: rgba(251, 191, 36, 0.08); }
.pill.rejected,
.pill.nohire       { color: var(--rose);    border-color: rgba(251, 113, 133, 0.35); background: rgba(251, 113, 133, 0.08); }
.pill.hire         { color: var(--emerald); border-color: rgba(46, 242, 195, 0.5);   background: rgba(46, 242, 195, 0.14); }

/* ---------- stats ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(158px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.stat {
  padding: 18px 20px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.stat .n { font-size: 27px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; }
.stat .l { margin-top: 3px; font-size: 12px; text-transform: uppercase; letter-spacing: 0.09em; color: var(--faint); }
.stat.cy .n { color: var(--cyan); }
.stat.em .n { color: var(--emerald); }
.stat.am .n { color: var(--amber); }
.stat.ro .n { color: var(--rose); }

/* ---------- table ---------- */
.table-wrap {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow-x: auto;
  box-shadow: var(--shadow);
}

table { width: 100%; border-collapse: collapse; min-width: 860px; }

thead th {
  padding: 14px 18px;
  text-align: left;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
  background: var(--card-2);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

tbody td { padding: 15px 18px; border-bottom: 1px solid var(--border-soft); font-size: 14px; vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: rgba(255, 255, 255, 0.017); }

.cand-name { font-weight: 600; color: var(--text); }
.cand-mail { font-size: 12.5px; color: var(--faint); }
.muted { color: var(--muted); }
.dash { color: #3f3f46; }

.score-cell { display: flex; align-items: center; gap: 10px; min-width: 108px; }
.score-cell .v { font-weight: 700; font-variant-numeric: tabular-nums; min-width: 26px; }
.score-cell .bar { flex: 1; margin: 0; min-width: 52px; }

.skills { display: flex; flex-wrap: wrap; gap: 5px; max-width: 260px; }

.chip {
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--card-2);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 11.5px;
  white-space: nowrap;
}

.empty { padding: 56px 20px; text-align: center; color: var(--faint); }
.empty .big { font-size: 30px; margin-bottom: 10px; }

.foot { margin-top: 30px; text-align: center; color: #52525b; font-size: 12.5px; }

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.toolbar h2 { margin: 0; font-size: 19px; }

.error-banner {
  display: none;
  margin-bottom: 18px;
  padding: 13px 16px;
  border-radius: 10px;
  border: 1px solid rgba(251, 113, 133, 0.35);
  background: rgba(251, 113, 133, 0.08);
  color: var(--rose);
  font-size: 14px;
}

.error-banner.show { display: block; }

@media (max-width: 620px) {
  .row { grid-template-columns: 1fr; gap: 0; }
  .card { padding: 22px 18px; }
  .wrap { padding: 22px 15px 56px; }
}
