/* =========================================================
   CV Analysis: shared styles for the careers page and HR console
   ========================================================= */

/* ---------- Tokens ---------- */
:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-2: #f9fafc;
  --surface-3: #f2f4f8;
  --border: #e6e9f0;
  --border-strong: #d2d7e2;
  --text: #0d1324;
  --text-2: #344054;
  --muted: #667085;
  --subtle: #98a2b3;

  --accent: #4f46e5;
  --accent-hover: #4338ca;
  --accent-soft: #eef0ff;
  --accent-border: #c9ccfb;
  --ring: 0 0 0 4px rgba(79, 70, 229, 0.18);

  --ok: #067647;
  --ok-solid: #12b76a;
  --ok-soft: #ecfdf3;
  --ok-border: #abefc6;
  --bad: #b42318;
  --bad-solid: #f04438;
  --bad-soft: #fef3f2;
  --bad-border: #fecdca;
  --warn: #93370d;
  --warn-soft: #fffaeb;
  --warn-border: #fedf89;
  --info: #3538cd;
  --info-soft: #eef4ff;
  --info-border: #c7d7fe;

  --radius-lg: 18px;
  --radius: 12px;
  --radius-sm: 8px;

  --shadow-xs: 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow-sm: 0 1px 3px rgba(16, 24, 40, 0.07), 0 1px 2px rgba(16, 24, 40, 0.04);
  --shadow-md: 0 6px 16px -4px rgba(16, 24, 40, 0.1), 0 2px 4px -2px rgba(16, 24, 40, 0.05);
  --shadow-lg: 0 24px 48px -12px rgba(16, 24, 40, 0.22);

  --header-h: 64px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 var(--font);
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
::selection { background: rgba(79, 70, 229, 0.18); }
a { color: var(--accent); }
svg { flex: none; }

.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

/* ---------- Header and footer ---------- */
header.top {
  position: sticky;
  top: 0;
  z-index: 20;
  height: var(--header-h);
  background: rgba(255, 255, 255, 0.85);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.top-inner {
  height: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.top-inner.wide { max-width: 1600px; }

.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 700; font-size: 16px; letter-spacing: -0.015em;
  color: var(--text); text-decoration: none;
}
.brand-mark {
  width: 32px; height: 32px; border-radius: 9px;
  display: inline-grid; place-items: center;
  background: linear-gradient(140deg, #6366f1 0%, #4338ca 100%);
  color: #fff;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}
.brand-mark svg { width: 17px; height: 17px; }
.brand-mark.lg { width: 48px; height: 48px; border-radius: 13px; }
.brand-mark.lg svg { width: 22px; height: 22px; }
.brand small {
  font-weight: 600; font-size: 12px; color: var(--accent-hover);
  background: var(--accent-soft); border: 1px solid var(--accent-border);
  padding: 2px 9px; border-radius: 999px; letter-spacing: 0;
}
.top-actions { display: flex; align-items: center; gap: 12px; }
.tag {
  font-size: 12px; font-weight: 600; color: var(--text-2);
  background: var(--surface-3); border: 1px solid var(--border);
  padding: 4px 11px; border-radius: 999px;
}

footer.foot {
  margin-top: auto;
  padding: 28px 16px;
  text-align: center;
  color: var(--subtle);
  font-size: 13px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

/* ---------- Layout and type ---------- */
main { width: 100%; max-width: 1120px; margin: 0 auto; padding: 32px 24px 64px; }
main.wide { max-width: 1600px; }

h1 { font-size: 28px; line-height: 1.2; margin: 0 0 8px; letter-spacing: -0.025em; font-weight: 700; }
h2 { font-size: 17px; line-height: 1.35; margin: 0 0 4px; letter-spacing: -0.015em; font-weight: 650; }
h3 { font-size: 16px; line-height: 1.4; margin: 0 0 4px; font-weight: 600; }
.mt { margin-top: 16px; }
.hint { color: var(--muted); font-size: 14px; margin: 0; }
.sub { color: var(--muted); font-size: 13px; font-weight: 400; }
.strong { font-weight: 600; color: var(--text); }
.req { color: var(--bad-solid); }
.eyebrow { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent); margin-bottom: 6px; }
.reqs { white-space: pre-line; color: var(--text-2); font-size: 14px; line-height: 1.65; margin: 0; overflow-wrap: anywhere; }
.reqs.clamp { display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- Cards ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  padding: 24px;
  margin-bottom: 16px;
}
.card-head { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 18px; }
.card-head > div { min-width: 0; }
.card-head h2 { margin: 0 0 2px; }
.icon-badge {
  flex: none; width: 40px; height: 40px; border-radius: 11px;
  display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent);
  border: 1px solid var(--accent-border);
}
.icon-badge svg { width: 19px; height: 19px; }

.empty { text-align: center; padding: 56px 24px; color: var(--muted); }
.empty svg { width: 44px; height: 44px; color: var(--subtle); margin-bottom: 14px; }
.empty p { margin: 0 auto 4px; max-width: 420px; font-size: 14px; }
.empty .empty-title { font-size: 16px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.empty button { margin-top: 16px; }
.empty-actions { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.empty-actions button { margin-top: 0; }

/* ---------- Buttons ---------- */
/* .btn lets a link look exactly like a button (e.g. "Apply", which is a real link to apply.html). */
button, .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.25;
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  cursor: pointer;
  background: var(--accent);
  color: #fff;
  box-shadow: var(--shadow-xs), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  transition: background-color 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s, transform 0.06s;
  white-space: nowrap;
  text-decoration: none;
}
button svg, .btn svg { width: 16px; height: 16px; }
button:hover, .btn:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
button:active, .btn:active { transform: translateY(1px); }
button:focus-visible, .btn:focus-visible { outline: none; box-shadow: var(--ring); }
button:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
button.ghost { background: var(--surface); color: var(--text-2); border-color: var(--border-strong); box-shadow: var(--shadow-xs); }
button.ghost:hover:not(:disabled) { background: var(--surface-2); color: var(--text); border-color: #b9c0cf; }
button.ghost.danger:hover:not(:disabled) { color: var(--bad); border-color: var(--bad-border); background: var(--bad-soft); }
button.small { padding: 7px 12px; font-size: 13px; }
button.small svg { width: 14px; height: 14px; }
button.large { padding: 12px 22px; font-size: 15px; }
button.block { width: 100%; }
.link-btn, button.link-btn {
  background: none; border: 0; box-shadow: none; padding: 6px 2px; color: var(--muted); font-weight: 500;
}
.link-btn:hover, button.link-btn:hover { background: none; color: var(--accent); }
.link-btn.small { padding: 4px 0; font-size: 13px; color: var(--accent); }
.icon-btn, button.icon-btn {
  width: 36px; height: 36px; padding: 0; border-radius: var(--radius-sm);
  background: transparent; border-color: transparent; color: var(--muted); box-shadow: none;
}
.icon-btn:hover, button.icon-btn:hover { background: var(--surface-3); border-color: transparent; color: var(--text); }
.icon-btn svg { width: 18px; height: 18px; }

/* ---------- Forms ---------- */
label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--text-2); }
input, textarea {
  width: 100%;
  font: inherit;
  font-size: 15px;
  padding: 10px 13px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-xs);
  transition: border-color 0.15s, box-shadow 0.15s;
}
input::placeholder, textarea::placeholder { color: var(--subtle); }
input:hover, textarea:hover { border-color: #b9c0cf; }
input:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
input:user-invalid, textarea:user-invalid { border-color: var(--bad-solid); }
input:user-invalid:focus, textarea:user-invalid:focus { box-shadow: 0 0 0 4px rgba(240, 68, 56, 0.15); }
input:disabled { background: var(--surface-3); cursor: not-allowed; }
textarea { resize: vertical; min-height: 96px; line-height: 1.55; }
input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
input[type="number"]::-webkit-inner-spin-button, input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 18px; }
.grid .full { grid-column: 1 / -1; }

fieldset.group { border: 0; margin: 0; padding: 20px 0 0; border-top: 1px solid var(--border); }
fieldset.group + fieldset.group { margin-top: 22px; }
fieldset.group legend {
  float: left; width: 100%; padding: 0; margin: 0 0 14px;
  font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted);
}
fieldset.group legend + * { clear: both; }

.search { position: relative; display: block; margin: 0; }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--subtle); pointer-events: none; }
.search input { padding-left: 36px; font-size: 14px; height: 40px; }

.password { position: relative; }
.password input { padding-right: 46px; }
.password .icon-btn { position: absolute; right: 3px; top: 50%; transform: translateY(-50%); }
.password .icon-btn:active { transform: translateY(-50%); }

/* ---------- Notices ---------- */
.notice {
  display: flex; align-items: flex-start; gap: 10px;
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin: 14px 0;
  font-size: 14px;
  line-height: 1.5;
  border: 1px solid transparent;
}
.notice::before {
  content: ""; flex: none; width: 18px; height: 18px; margin-top: 1px;
  background: currentColor;
  -webkit-mask: var(--icon) center / contain no-repeat;
  mask: var(--icon) center / contain no-repeat;
}
.notice:has(> .spinner)::before { display: none; }
.notice .spinner { margin: 2px 0 0; }
.notice.info { background: var(--info-soft); color: var(--info); border-color: var(--info-border);
  --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 11v5M12 8h.01'/%3E%3C/svg%3E"); }
.notice.error { background: var(--bad-soft); color: var(--bad); border-color: var(--bad-border);
  --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7.5v5.5M12 16.5h.01'/%3E%3C/svg%3E"); }
.notice.success { background: var(--ok-soft); color: var(--ok); border-color: var(--ok-border);
  --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M8 12.5l3 3 5-6'/%3E%3C/svg%3E"); }
.notice.warn { background: var(--warn-soft); color: var(--warn); border-color: var(--warn-border);
  --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3.5l9.5 16.5h-19z'/%3E%3Cpath d='M12 10v4M12 17h.01'/%3E%3C/svg%3E"); }

.spinner {
  display: inline-block; flex: none;
  width: 16px; height: 16px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.spinner.lg { width: 28px; height: 28px; border-width: 3px; color: var(--accent); }
@keyframes spin { to { transform: rotate(360deg); } }

/* Loading placeholders */
.skeleton, .skeleton-line {
  background: linear-gradient(90deg, var(--surface-3) 25%, #e9ecf3 50%, var(--surface-3) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.3s ease-in-out infinite;
}
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.skeleton-line { display: block; height: 10px; border-radius: 6px; width: 70%; }
.skeleton-row td { padding-top: 22px; padding-bottom: 22px; }

/* =========================================================
   Careers page
   ========================================================= */

.hero {
  position: relative;
  overflow: hidden;
  border-radius: 24px;
  padding: 56px 48px;
  color: #fff;
  background:
    radial-gradient(600px 300px at 90% -10%, rgba(129, 140, 248, 0.45), transparent 70%),
    radial-gradient(500px 260px at 10% 120%, rgba(56, 189, 248, 0.22), transparent 70%),
    linear-gradient(160deg, #111833 0%, #0b1020 100%);
  box-shadow: var(--shadow-lg);
  isolation: isolate;
}
.hero::before {
  content: "";
  position: absolute; inset: 0; z-index: -1;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 36px 36px;
  -webkit-mask-image: radial-gradient(ellipse at 70% 30%, #000 10%, transparent 70%);
  mask-image: radial-gradient(ellipse at 70% 30%, #000 10%, transparent 70%);
}
.hero-content { max-width: 640px; }
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 600; color: #c7d2fe;
  background: rgba(99, 102, 241, 0.16); border: 1px solid rgba(165, 180, 252, 0.3);
  padding: 5px 12px; border-radius: 999px; margin-bottom: 18px;
}
.hero-eyebrow::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #4ade80; box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.25); }
.hero h1 { font-size: 42px; line-height: 1.1; letter-spacing: -0.035em; margin-bottom: 14px; font-weight: 800; }
.hero p { margin: 0 0 28px; max-width: 560px; font-size: 17px; line-height: 1.6; color: rgba(226, 232, 255, 0.8); }
.hero-features { display: flex; flex-wrap: wrap; gap: 10px 22px; margin: 0; padding: 0; list-style: none; }
.hero-features li { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 500; color: rgba(255, 255, 255, 0.9); }
.hero-features svg { width: 18px; height: 18px; color: #a5b4fc; }

.list-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 44px 0 16px; flex-wrap: wrap; }
.list-title { font-size: 22px; letter-spacing: -0.02em; margin: 0; font-weight: 700; }
.list-sub { margin: 2px 0 0; color: var(--muted); font-size: 14px; min-height: 1.5em; }
.list-head .search { width: 300px; max-width: 100%; }

.job-list { display: grid; gap: 12px; }
.job-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: start;
  gap: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  box-shadow: var(--shadow-xs);
  transition: border-color 0.15s, box-shadow 0.2s, transform 0.2s;
}
.job-card:hover { border-color: var(--accent-border); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.job-card.skeleton { height: 96px; border-color: transparent; box-shadow: none; }
.job-icon {
  width: 48px; height: 48px; border-radius: 13px;
  background: var(--accent-soft) center / 22px no-repeat
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234f46e5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='7' width='18' height='13' rx='2'/%3E%3Cpath d='M9 7V5a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v2M3 13h18'/%3E%3C/svg%3E");
  border: 1px solid var(--accent-border);
}
.job-main { min-width: 0; }
.job-title { font-size: 17px; font-weight: 650; letter-spacing: -0.01em; margin: 0 0 4px; overflow-wrap: anywhere; }
/* Two-line preview that slides open to the full text on hover (or tap). */
.job-reqs {
  margin: 0; color: var(--muted); font-size: 14px; line-height: 1.55;
  white-space: pre-line;
  overflow-wrap: anywhere;
  max-height: 3.1em; /* two lines */
  overflow: hidden;
  transition: max-height 0.35s ease, color 0.2s;
}
.job-card.expandable .job-reqs {
  -webkit-mask-image: linear-gradient(#000 45%, transparent);
  mask-image: linear-gradient(#000 45%, transparent);
}
.job-card.expandable { cursor: pointer; }
.job-card.expandable:is(:hover, :focus-within, .open) .job-reqs {
  max-height: var(--full, 40em);
  color: var(--text-2);
  -webkit-mask-image: none;
  mask-image: none;
}
.job-meta { display: flex; align-items: center; gap: 14px; margin-top: 8px; font-size: 12px; color: var(--subtle); font-weight: 500; }
.job-more { display: none; align-items: center; gap: 4px; color: var(--accent); font-weight: 600; }
.job-more::after {
  content: ""; width: 12px; height: 12px; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") center / contain no-repeat;
}
.job-card.expandable .job-more { display: inline-flex; }
.job-card.expandable:is(:hover, :focus-within, .open) .job-more { opacity: 0; }
.job-apply { margin-top: 4px; }
.job-apply .arrow { transition: transform 0.15s; }
.job-apply:hover .arrow { transform: translateX(3px); }

/* Application */
#back-btn { margin: -6px 0 14px -2px; }
#back-btn svg { width: 18px; height: 18px; }

.apply-layout { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 24px; align-items: start; }
.apply-aside { position: sticky; top: calc(var(--header-h) + 24px); }
.job-summary h1 { font-size: 22px; margin-bottom: 18px; overflow-wrap: anywhere; }
.summary-label { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-bottom: 8px; padding-top: 16px; border-top: 1px solid var(--border); }
.job-summary .reqs { max-height: 40vh; overflow: auto; }

.steps { list-style: none; margin: 0; padding: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-xs); }
.steps li { position: relative; display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: var(--radius); color: var(--muted); }
.steps li + li::before { content: ""; position: absolute; left: 25px; top: -10px; height: 20px; width: 2px; background: var(--border); }
.steps li.done + li::before { background: var(--accent); }
.step-dot {
  position: relative; z-index: 1;
  flex: none; width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 13px; font-weight: 700;
  background: var(--surface); color: var(--subtle);
  border: 2px solid var(--border-strong);
  transition: all 0.2s;
}
.step-text { display: flex; flex-direction: column; line-height: 1.3; }
.step-text strong { font-size: 14px; font-weight: 600; color: var(--text-2); }
.step-text small { font-size: 12px; color: var(--subtle); }
.steps li.current { background: var(--accent-soft); }
.steps li.current .step-dot { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.15); }
.steps li.current .step-text strong { color: var(--accent-hover); }
.steps li.done .step-dot { background: var(--accent); border-color: var(--accent); color: transparent;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 12.5l4 4 8-9'/%3E%3C/svg%3E");
  background-size: 14px; background-position: center; background-repeat: no-repeat; }
.steps li.done .step-text strong { color: var(--text); }

.optional {
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--muted); background: var(--surface-3); border: 1px solid var(--border);
  border-radius: 999px; padding: 2px 8px; vertical-align: 2px; margin-left: 6px;
}
.divider { border: 0; border-top: 1px solid var(--border); margin: 28px 0 24px; }

.dropzone {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius);
  padding: 32px 16px;
  background: var(--surface-2);
  cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s, box-shadow 0.15s;
}
.dropzone:hover, .dropzone.over { border-color: var(--accent); background: var(--accent-soft); }
.dropzone:focus-visible { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
.dropzone.over { border-style: solid; }
.dz-icon {
  width: 46px; height: 46px; border-radius: 50%;
  display: grid; place-items: center; margin-bottom: 12px;
  background: var(--surface); color: var(--accent);
  border: 1px solid var(--border); box-shadow: var(--shadow-xs);
}
.dz-icon svg { width: 22px; height: 22px; }
.dropzone strong { display: block; font-size: 15px; font-weight: 600; margin-bottom: 2px; }
.dropzone > span:last-of-type { color: var(--muted); font-size: 13px; }
.dropzone u { color: var(--accent); text-decoration: none; font-weight: 600; }
.dropzone.compact { padding: 22px 16px; }
.dropzone.compact .dz-icon { width: 38px; height: 38px; margin-bottom: 8px; }
.dropzone.compact .dz-icon svg { width: 18px; height: 18px; }

.file-chip {
  display: flex; align-items: center; gap: 14px;
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px 14px; background: var(--surface-2);
}
.file-icon {
  flex: none; display: grid; place-items: center;
  width: 40px; height: 46px; border-radius: 7px;
  background: var(--bad-soft); color: var(--bad); border: 1px solid var(--bad-border);
  font-size: 10px; font-weight: 800; letter-spacing: 0.04em;
}
.file-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.file-meta strong { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-meta span { color: var(--muted); font-size: 13px; }
.file-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.form-footer {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  margin-top: 24px; padding-top: 22px; border-top: 1px solid var(--border);
}
.fine { margin: 0; font-size: 12.5px; color: var(--subtle); max-width: 420px; }

.done { text-align: center; padding: 64px 24px; max-width: 560px; margin: 24px auto; box-shadow: var(--shadow-md); }
.done-icon {
  width: 72px; height: 72px; margin: 0 auto 22px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--ok-soft); color: var(--ok);
  box-shadow: 0 0 0 10px rgba(18, 183, 106, 0.08);
  animation: pop 0.4s cubic-bezier(0.2, 1.4, 0.4, 1);
}
.done-icon svg { width: 32px; height: 32px; }
.done h1 { font-size: 26px; }
.done p { max-width: 420px; margin: 0 auto 28px; color: var(--muted); }
@keyframes pop { from { transform: scale(0.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* =========================================================
   HR console
   ========================================================= */

.boot { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; min-height: 50vh; color: var(--muted); font-size: 14px; }

.login { max-width: 420px; margin: 8vh auto 0; padding: 36px; box-shadow: var(--shadow-md); }
.login .brand-mark { margin-bottom: 20px; }
.login h1 { font-size: 22px; margin-bottom: 6px; }
.login .hint { margin-bottom: 24px; }
.login .notice { margin-bottom: 0; }
.login button[type="submit"] { margin-top: 20px; }

/* ---------- Positions bar ----------
   A compact bar on top; the applicants dashboard below it gets the full width. */
.layout { display: flex; flex-direction: column; gap: 16px; }

.positions-bar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) 240px;
  align-items: center;
  gap: 10px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  padding: 10px 12px 10px 18px;
}
.positions-head { grid-column: 1; grid-row: 1; display: flex; align-items: center; gap: 14px; padding-right: 16px; border-right: 1px solid var(--border); }
.positions-head .sub { white-space: nowrap; }
.panel-title { font-size: 15px; font-weight: 700; letter-spacing: -0.01em; }
.positions-bar .search { grid-column: 3; grid-row: 1; }
.positions-bar .search input { height: 36px; }
.job-nav {
  grid-column: 2; grid-row: 1;
  display: flex; gap: 6px; align-items: center;
  overflow-x: auto; padding: 3px 2px;
  scrollbar-width: none;
}
.job-nav::-webkit-scrollbar { display: none; }
.nav-message { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; white-space: nowrap; }
.nav-message p { margin: 0; }

.job-item, button.job-item {
  flex: none;
  display: inline-flex; align-items: center;
  white-space: nowrap;
  background: var(--surface); color: var(--text-2);
  border: 1px solid var(--border); border-radius: 999px;
  padding: 7px 14px; box-shadow: none;
  font-size: 13px; font-weight: 600;
}
.job-item:hover, button.job-item:hover { background: var(--surface-3); border-color: var(--border-strong); color: var(--text); }
.job-item.active, button.job-item.active { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 1px 2px rgba(79, 70, 229, 0.3); }
.job-item:active { transform: none; }
.job-item.skeleton { width: 150px; height: 34px; border: 0; }

/* ---------- Selected position ---------- */
.content { min-width: 0; }

.toolbar {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; flex-wrap: wrap;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  padding: 22px 24px;
  margin-bottom: 16px;
}
.toolbar-text { flex: 1; min-width: 260px; }
.toolbar h1 { font-size: 24px; margin-bottom: 8px; overflow-wrap: anywhere; }
.toolbar-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* Result colours: accepted = green, rejected = red, not screened = grey.
   Any element with one of these classes (stat card, filter, badge, table row...)
   picks up its colours from the --tone variables. */
.all                           { --tone: var(--accent);    --tone-text: var(--accent-hover); --tone-soft: var(--accent-soft); --tone-border: var(--accent-border); }
.accepted, .row-accepted       { --tone: var(--ok-solid);  --tone-text: var(--ok);           --tone-soft: var(--ok-soft);     --tone-border: var(--ok-border); }
.rejected, .row-rejected       { --tone: var(--bad-solid); --tone-text: var(--bad);          --tone-soft: var(--bad-soft);    --tone-border: var(--bad-border); }
.pending, .other,
.row-pending, .row-other       { --tone: #98a2b3;          --tone-text: #475467;             --tone-soft: #f2f4f7;            --tone-border: #d0d5dd; }

/* ---------- Stat cards (they double as filters) ---------- */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }

.stat, button.stat {
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px;
  text-align: left; white-space: normal;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-top: 3px solid var(--tone);
  border-radius: var(--radius); box-shadow: var(--shadow-xs);
  padding: 14px 18px 16px;
  cursor: pointer;
}
button.stat:hover { background: var(--tone-soft); border-color: var(--tone-border); border-top-color: var(--tone); }
button.stat.active { background: var(--tone-soft); border-color: var(--tone); box-shadow: 0 0 0 1px var(--tone), var(--shadow-sm); }
button.stat:active { transform: none; }
.stat-label { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; color: var(--tone-text); }
.stat-label::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--tone); }
.stat-value { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; color: var(--tone-text); font-variant-numeric: tabular-nums; }
.stat.all .stat-value { color: var(--text); }

/* ---------- Applicants table ---------- */
.table-card { padding: 0; overflow: hidden; }
.table-tools { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.table-tools .search { width: 280px; max-width: 100%; }

.segmented { display: inline-flex; padding: 3px; gap: 2px; background: var(--surface-3); border: 1px solid var(--border); border-radius: 10px; flex-wrap: wrap; }
.segmented button {
  background: transparent; border-color: transparent; color: var(--muted); box-shadow: none;
  padding: 6px 12px; font-size: 13px; font-weight: 600; border-radius: 7px;
}
.segmented button:hover { background: rgba(255, 255, 255, 0.6); border-color: transparent; color: var(--text); }
.segmented button.active { background: var(--surface); color: var(--tone-text); box-shadow: var(--shadow-sm); border-color: var(--tone-border); }
.segmented button:active { transform: none; }
.seg-count {
  min-width: 22px; padding: 1px 7px; border-radius: 999px;
  font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; text-align: center;
  background: var(--tone-soft); color: var(--tone-text); border: 1px solid var(--tone-border);
}
.segmented button.active .seg-count { background: var(--tone); color: #fff; border-color: var(--tone); }

.table-wrap { overflow-x: auto; }
table { width: 100%; min-width: 800px; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 16px; border-bottom: 1px solid var(--border); vertical-align: top; }
th {
  position: sticky; top: 0;
  font-size: 12px; font-weight: 600; color: var(--muted);
  background: var(--surface-2); white-space: nowrap; padding-top: 11px; padding-bottom: 11px;
}
tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background-color 0.12s; }
tbody tr:hover td { background: #fafbff; }
td .sub { margin-top: 2px; }
.table-message { padding: 48px 16px !important; text-align: center; color: var(--muted); }
tbody tr:hover .table-message { background: transparent; }

/* Column widths */
th.col-num, td.col-num { width: 52px; padding-left: 20px; padding-right: 0; }
td.col-num { font-size: 13px; font-weight: 700; color: var(--subtle); font-variant-numeric: tabular-nums; padding-top: 24px; }
td.profile { width: 17%; }
td.result { width: 130px; }
td.reason { min-width: 220px; color: var(--text-2); font-size: 13px; line-height: 1.6; }
td.cell-action { text-align: right; white-space: nowrap; width: 1%; padding-right: 20px; }

/* Each row shows its result colour on the left edge and on the avatar. */
tbody tr[class^="row-"] td:first-child { box-shadow: inset 4px 0 0 var(--tone); }

.person { display: flex; gap: 12px; align-items: flex-start; min-width: 180px; }
.person-text { min-width: 0; }
.avatar {
  flex: none; width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 13px; font-weight: 700;
  background: var(--tone-soft); color: var(--tone-text); border: 1px solid var(--tone-border);
}
a.link { display: block; color: var(--muted); text-decoration: none; white-space: nowrap; }
a.link:hover { color: var(--accent); text-decoration: underline; }

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px 3px 8px; border-radius: 999px;
  font-size: 12px; font-weight: 600; white-space: nowrap;
  background: var(--tone-soft); color: var(--tone-text); border: 1px solid var(--tone-border);
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.score { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.score-bar { flex: 1; max-width: 90px; height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.score-fill { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.score-fill.accepted { background: var(--ok-solid); }
.score-fill.rejected { background: var(--bad-solid); }
.score-num { font-size: 13px; font-weight: 700; color: var(--text-2); font-variant-numeric: tabular-nums; }

/* ---------- New position dialog ---------- */
dialog {
  width: min(560px, calc(100vw - 32px));
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  color: var(--text);
  background: var(--surface);
}
dialog[open] { animation: rise 0.18s ease-out; }
dialog::backdrop { background: rgba(13, 19, 36, 0.45); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
@keyframes rise { from { opacity: 0; transform: translateY(8px) scale(0.98); } to { opacity: 1; transform: none; } }
.dialog-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 22px 24px 4px; }
.dialog-head h2 { font-size: 18px; }
.dialog-body { padding: 16px 24px 4px; }
.dialog-body .notice { margin-bottom: 0; }
.dialog-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 20px 24px; margin-top: 16px; border-top: 1px solid var(--border); background: var(--surface-2); }

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 1080px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .apply-layout { grid-template-columns: 1fr; }
  .apply-aside { position: static; }
  .positions-bar { grid-template-columns: minmax(0, 1fr) 220px; padding: 12px 14px; }
  .positions-head { border-right: 0; padding-right: 0; }
  .positions-bar .search { grid-column: 2; }
  .job-nav { grid-column: 1 / -1; grid-row: 2; }
  .steps { display: flex; padding: 6px; gap: 4px; }
  .steps li { flex: 1; padding: 10px; }
  .steps li + li::before { display: none; }
  .step-text small { display: none; }
}
@media (max-width: 640px) {
  :root { --header-h: 58px; }
  main { padding: 20px 16px 48px; }
  .top-inner { padding: 0 16px; }
  .card { padding: 20px 18px; }
  .hero { padding: 36px 24px; border-radius: 20px; }
  .hero h1 { font-size: 30px; }
  .hero p { font-size: 15px; }
  .list-head { margin-top: 32px; }
  .list-head .search { width: 100%; }
  .grid { grid-template-columns: 1fr; }
  .job-card { grid-template-columns: auto 1fr; padding: 18px; gap: 14px; }
  .job-icon { width: 42px; height: 42px; }
  .job-apply { grid-column: 1 / -1; width: 100%; }
  .steps li { flex-direction: column; text-align: center; gap: 6px; }
  .step-text strong { font-size: 12px; }
  .file-chip { flex-wrap: wrap; }
  .file-actions { width: 100%; }
  .file-actions button { flex: 1; }
  .form-footer { flex-direction: column-reverse; align-items: stretch; text-align: center; }
  .form-footer .fine { max-width: none; }
  .brand small { display: none; }
  .toolbar { padding: 18px; }
  .toolbar-actions { width: 100%; }
  .toolbar-actions button { flex: 1; }
  .table-tools .search, .segmented { width: 100%; }
  .segmented button { flex: 1; }
  .login { padding: 28px 22px; margin-top: 4vh; }
  .positions-bar { grid-template-columns: 1fr; }
  .positions-head { justify-content: space-between; }
  .positions-bar .search { grid-column: 1; grid-row: 2; }
  .job-nav { grid-row: 3; }
}
