/* SmartBarrel Careers — single stylesheet for public site + admin ATS.
   Brand tokens pulled from smartbarrel.io (Inter, orange #f15922, charcoal ink). */

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/fonts/inter-var.woff2') format('woff2');
}

:root {
  --brand: #f15922;
  --brand-dark: #d84a15;
  --brand-tint: #fef1ec;
  --ink: #292e31;
  --body: #515151;
  --muted: #86898c;
  --bg: #ffffff;
  --bg-soft: #f7f7f7;
  --panel: #ffffff;
  --line: #e8e8e8;
  --footer-bg: #1f2124;
  --green: #23a455;
  --blue: #384e62;
  --red: #cf2e2e;
  --amber: #d97706;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  color: var(--body);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
/* Sticky footer: main grows, footer never floats mid-screen on short pages. */
body.public { min-height: 100vh; display: flex; flex-direction: column; }
body.public > main { flex: 1; }
a { color: var(--brand); }
h1, h2, h3 { color: var(--ink); font-weight: 700; line-height: 1.2; }
h1 { font-size: 1.7rem; margin: 0 0 .5rem; }
h2 { font-size: 1.15rem; margin: 0 0 .75rem; }
h3 { font-size: 1.02rem; margin: 0 0 .4rem; }
code { background: var(--bg-soft); padding: 2px 6px; border-radius: 4px; font-size: .85em; }

.container { max-width: 1080px; margin: 0 auto; padding: 0 1.5rem; }
.container-wide { max-width: 1320px; margin: 0 auto; padding: 0 1.25rem; }

/* ---------- public header ---------- */
.site-header {
  background: #fff;
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: 68px; }
.brand-logo { display: flex; align-items: center; gap: .6rem; text-decoration: none; }
.brand-logo img { display: block; }
.header-nav { display: flex; align-items: center; gap: 1.5rem; }
.header-nav a {
  color: var(--ink); text-decoration: none; font-weight: 600; font-size: .95rem;
}
.header-nav a:hover { color: var(--brand); }
.btn-ghost {
  border: 2px solid var(--brand); border-radius: 999px; padding: .4rem 1.1rem !important;
  color: var(--brand) !important;
}
.btn-ghost:hover { background: var(--brand); color: #fff !important; }

/* ---------- public footer ---------- */
.site-footer { background: var(--footer-bg); color: #b9bcbf; margin-top: 4rem; }
.footer-inner { padding: 3rem 1.5rem 2rem; display: grid; gap: .9rem; text-align: center; justify-items: center; }
.footer-logo { opacity: .95; }
.footer-inner p { margin: 0; font-size: .92rem; }
.footer-inner nav { display: flex; gap: 1.75rem; margin: .5rem 0; }
.footer-inner nav a { color: #fff; text-decoration: none; font-size: .92rem; font-weight: 600; }
.footer-inner nav a:hover { color: var(--brand); }
.copyright { color: #7c8084; font-size: .82rem !important; }

/* ---------- public: hero + values ---------- */
.hero {
  background:
    radial-gradient(1200px 500px at 85% -10%, var(--brand-tint) 0%, transparent 60%),
    var(--bg);
  padding: 5rem 0 4.5rem;
  text-align: center;
}
.hero-kicker {
  color: var(--brand); font-weight: 700; text-transform: uppercase;
  letter-spacing: .12em; font-size: .82rem; margin: 0 0 1rem;
}
.hero h1 { font-size: clamp(2rem, 5vw, 3.1rem); font-weight: 800; margin: 0 0 1.1rem; }
.hero-sub { max-width: 640px; margin: 0 auto 2rem; font-size: 1.08rem; }
.btn-lg { padding: .8rem 1.9rem; font-size: 1rem; border-radius: 999px; }

/* ---------- public: job list & detail ---------- */
.positions { padding: 2.5rem 0 2rem; }
.positions h2 { font-size: 1.6rem; margin-bottom: 1.5rem; }

.job-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .8rem; }
.job-list a {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 12px; padding: 1.15rem 1.5rem; text-decoration: none; color: var(--body);
  transition: border-color .12s, box-shadow .12s;
}
.job-list a:hover { border-color: var(--brand); box-shadow: 0 4px 18px rgba(241, 89, 34, .08); }
.job-list h3 { margin: 0 0 .2rem; font-size: 1.12rem; }
.job-arrow { color: var(--brand); font-size: 1.3rem; font-weight: 700; }
.job-meta { display: flex; gap: .5rem; flex-wrap: wrap; color: var(--muted); font-size: .88rem; margin: 0; }
.job-meta span:not(:last-child)::after { content: "·"; margin-left: .5rem; }

.job-detail { padding-top: 2.5rem; max-width: 800px; }
.job-section-title {
  font-size: 1.3rem; margin: 2.2rem 0 .25rem; padding-top: 1.6rem;
  border-top: 1px solid var(--line);
}
.job-section-title.first { border-top: none; padding-top: .5rem; margin-top: 1.5rem; }
.job-detail h1 { font-size: 2rem; font-weight: 800; }
.job-description { margin: 1.5rem 0 2.5rem; }
.job-description h1, .job-description h2, .job-description h3 { font-size: 1.15rem; margin: 1.6rem 0 .5rem; }
.job-description ul { padding-left: 1.35rem; }

/* ---------- buttons, badges, alerts ---------- */
.btn {
  display: inline-block; padding: .5rem 1.1rem; border: 1px solid var(--line);
  border-radius: 8px; background: #fff; color: var(--ink); text-decoration: none;
  font-size: .92rem; cursor: pointer; font-family: inherit; font-weight: 600;
}
.btn:hover { border-color: #d1d5db; background: var(--bg-soft); }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn-danger { color: var(--red); border-color: #f3c1c1; }
.btn-danger:hover { background: #fdf1f1; }
.btn-small { padding: .25rem .6rem; font-size: .82rem; }

.badge {
  display: inline-block; padding: 1px 8px; border-radius: 999px;
  font-size: .74rem; font-weight: 600; text-transform: capitalize;
}
.badge-internal { background: #e2f6e9; color: var(--green); }
.badge-external { background: #e4ecf3; color: var(--blue); }
.badge-open { background: #e2f6e9; color: var(--green); }
.badge-draft { background: #efefef; color: var(--muted); }
.badge-closed { background: #fdeaea; color: var(--red); }
.badge-warn { background: #fef3c7; color: var(--amber); }
.badge-stage-new { background: #efefef; color: var(--muted); }
.badge-stage-screening { background: #fef3c7; color: var(--amber); }
.badge-stage-interview { background: #e4ecf3; color: var(--blue); }
.badge-stage-offer { background: #ede9fe; color: #7c3aed; }
.badge-stage-hired { background: #e2f6e9; color: var(--green); }
.badge-stage-rejected { background: #fdeaea; color: var(--red); }

.alert { padding: .75rem 1rem; border-radius: 8px; margin-bottom: 1.25rem; }
.alert-error { background: #fdf1f1; color: var(--red); border: 1px solid #f3c1c1; }

.muted { color: var(--muted); font-size: .88rem; }
.empty { color: var(--muted); text-align: center; padding: 2rem 0; }
.back { display: inline-block; margin-bottom: 1rem; text-decoration: none; color: var(--muted); }
.subtitle { color: var(--muted); margin-top: -.25rem; }

/* ---------- forms ---------- */
.apply-section {
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: 14px; padding: 1.75rem;
}
.apply-section h2 { font-size: 1.35rem; }
.apply-form, .form-narrow { display: grid; gap: 1rem; }
.form-narrow { max-width: 720px; }
label { display: grid; gap: .3rem; font-weight: 600; font-size: .92rem; color: var(--ink); }
label.radio { display: flex; gap: .5rem; align-items: center; font-weight: 400; color: var(--body); }
input[type="text"], input[type="email"], input[type="tel"], input[type="url"],
input[type="file"], select, textarea {
  padding: .6rem .75rem; border: 1px solid var(--line); border-radius: 8px;
  font-size: .95rem; font-family: inherit; background: #fff; width: 100%; color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand); outline-offset: 0; border-color: var(--brand); }
fieldset { border: none; padding: 0; margin: 0; display: grid; gap: .35rem; }
legend { font-weight: 600; font-size: .92rem; padding: 0; margin-bottom: .25rem; color: var(--ink); }
#referral-fields { display: grid; gap: 1rem; padding: 1rem; background: var(--brand-tint); border-radius: 8px; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; }
.form-actions { display: flex; gap: .75rem; }
.inline-form { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin-top: .35rem; }
.inline-form input, .inline-form select { width: auto; }

/* Honeypot — visually removed, still in the DOM for bots */
.hp-field { position: absolute; left: -9999px; top: -9999px; height: 1px; overflow: hidden; }

.thanks { text-align: center; padding: 4.5rem 1.5rem; }
.thanks .btn { margin-top: 1rem; }

/* Refer-a-friend */
.refer { padding-top: 3rem; max-width: 640px; }
.hero-sub-left { font-size: 1.05rem; margin: 0 0 1.75rem; }
.refer-form { background: var(--bg-soft); border: 1px solid var(--line); border-radius: 14px; padding: 1.75rem; }
.g-recaptcha { min-height: 78px; }
.referral-link-box {
  background: var(--brand-tint); border: 1px dashed var(--brand); border-radius: 10px;
  padding: 1.1rem 1.25rem; margin: 1.5rem 0 .5rem; overflow-wrap: anywhere;
}
.referral-link-box code { background: none; font-size: 1.02rem; color: var(--brand-dark); font-weight: 600; }
.refer .btn { margin-top: 1.25rem; }

.login-box { max-width: 440px; margin: 4rem auto; text-align: center; background: var(--panel);
  border: 1px solid var(--line); border-radius: 14px; padding: 2.5rem 2rem; }
.login-box .btn { margin-top: 1rem; }

/* Google-branded sign-in button */
.btn-google {
  display: inline-flex; align-items: stretch; margin-top: 1.5rem;
  background: #4285F4; border-radius: 10px; text-decoration: none;
  box-shadow: 0 2px 6px rgba(66, 133, 244, .4);
  transition: background .12s, box-shadow .12s;
}
.btn-google:hover { background: #3367d6; box-shadow: 0 3px 10px rgba(66, 133, 244, .5); }
.btn-google-icon {
  display: flex; align-items: center; justify-content: center;
  background: #fff; border-radius: 8px; margin: 3px; padding: 10px 12px;
}
.btn-google-text {
  display: flex; align-items: center; color: #fff; font-weight: 600;
  font-size: 1.02rem; padding: 0 26px 0 20px; letter-spacing: .01em;
}

/* ---------- admin header ---------- */
.admin-header { background: var(--ink); }
.admin-header .container-wide { display: flex; align-items: center; gap: 1.5rem; min-height: 58px; }
.brand-suffix { color: var(--brand); font-weight: 800; font-size: .95rem; letter-spacing: .05em; }
.admin-header nav { display: flex; gap: .25rem; flex: 1; }
.admin-header nav a {
  color: #cfd2d4; text-decoration: none; padding: .35rem .75rem; border-radius: 6px;
  font-size: .92rem; font-weight: 500;
}
.admin-header nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.admin-header nav a.active { background: rgba(255,255,255,.08); color: var(--brand); }
.user-menu { display: flex; align-items: center; gap: .75rem; color: #cfd2d4; font-size: .88rem; }
.btn-link {
  background: none; border: none; color: #9ca3af; cursor: pointer;
  font-size: .88rem; text-decoration: underline; padding: 0; font-family: inherit;
}

.admin main, body.admin main { padding: 2rem 0 3rem; }
body.admin { background: var(--bg-soft); }

/* ---------- admin: tables & panels ---------- */
.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.section-title { margin-top: 2.5rem; }

.table { width: 100%; border-collapse: collapse; background: var(--panel);
  border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.table th, .table td { text-align: left; padding: .6rem .9rem; border-bottom: 1px solid var(--line); font-size: .92rem; }
.table th { background: var(--bg-soft); font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.table tr:last-child td { border-bottom: none; }
.row-inactive { opacity: .55; }
.row-actions form { display: inline; }
.nowrap { white-space: nowrap; }
.audit-table td { vertical-align: top; }
/* One-bar filter strip (audit log, reusable) */
.filter-bar {
  display: flex; gap: .5rem; align-items: center; flex-wrap: wrap;
  background: var(--panel); border: 1px solid var(--line); border-radius: 999px;
  padding: .45rem .6rem; margin-bottom: 1.1rem;
}
.filter-bar select, .filter-bar input {
  width: auto; border: none; background: transparent; padding: .35rem .5rem;
  font-size: .9rem; border-radius: 999px;
}
.filter-bar select:hover, .filter-bar .date-range:hover { background: var(--bg-soft); }
.filter-bar select:focus, .filter-bar input:focus { outline: 2px solid var(--brand); background: #fff; }
.filter-search { flex: 1; min-width: 160px; }
.date-range {
  display: inline-flex; align-items: center; border-left: 1px solid var(--line);
  padding-left: .35rem; border-radius: 999px;
}
.date-range input { font-size: .85rem; color: var(--body); }
.date-sep { color: var(--muted); }
.filter-bar .btn { border-radius: 999px; }
.pagination { display: flex; gap: 1rem; align-items: center; justify-content: center; margin-top: 1.25rem; }
.audit-job { background: #e4ecf3; color: var(--blue); }
.audit-application { background: #fef3c7; color: var(--amber); }
.audit-user { background: #ede9fe; color: #7c3aed; }
.audit-referral_link { background: #e2f6e9; color: var(--green); }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 1.4rem; margin-bottom: 1.25rem; }
.detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.25rem; align-items: start; }
.help-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 1.25rem; align-items: start; }
.help-grid .panel { margin-bottom: 0; }
.help-grid p { font-size: .95rem; }
dl { margin: 0; display: grid; grid-template-columns: max-content 1fr; gap: .4rem 1rem; }
dt { font-weight: 600; font-size: .88rem; color: var(--muted); }
dd { margin: 0; font-size: .95rem; overflow-wrap: anywhere; }
.cover-note { white-space: pre-wrap; }

.source-edit-form { display: grid; gap: .7rem; margin-top: .5rem; }
.source-edit-form button { justify-self: start; }
.edit-stamp { margin-top: .75rem; font-size: .82rem; }

.comments { max-width: 860px; margin-top: 1.25rem; }
.comment-list { list-style: none; padding: 0; margin: 0 0 1.25rem; display: grid; gap: .9rem; }
.comment { border-bottom: 1px solid var(--line); padding-bottom: .9rem; }
.comment:last-child { border-bottom: none; }
.comment-head { display: flex; gap: .75rem; align-items: baseline; font-size: .9rem; }
.comment-body { margin: .25rem 0 0; white-space: pre-wrap; font-size: .95rem; }
.comment-form { display: grid; gap: .6rem; justify-items: start; }

.timeline { list-style: none; padding-left: 1rem; margin: 0 0 1rem; border-left: 2px solid var(--line); display: grid; gap: .6rem; }
.timeline li { font-size: .92rem; }
.reject-form { display: flex; gap: .5rem; }

/* ---------- dashboard ---------- */
/* Stage palette — CVD-validated (dataviz six-checks, light surface) */
:root {
  --viz-new: #0891b2;
  --viz-screening: #d97706;
  --viz-interview: #2563eb;
  --viz-offer: #db2777;
  --viz-hired: #23a455;
  --viz-rejected: #cf2e2e;
}
.viz-new { background: var(--viz-new); }
.viz-screening { background: var(--viz-screening); }
.viz-interview { background: var(--viz-interview); }
.viz-offer { background: var(--viz-offer); }
.viz-hired { background: var(--viz-hired); }
.viz-rejected { background: var(--viz-rejected); }

.kpi-row {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: .9rem; margin-bottom: 1.25rem;
}
.stat-tile {
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  padding: 1rem 1.1rem; display: grid; gap: .15rem; align-content: start;
}
.stat-label { font-size: .8rem; color: var(--muted); font-weight: 500; }
.stat-value { font-size: 1.9rem; font-weight: 600; color: var(--ink); line-height: 1.15; }
.stat-delta { font-size: .78rem; font-weight: 600; }
.stat-delta.up { color: var(--green); }
.stat-delta.down { color: var(--red); }

.viz-legend { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: .9rem; }
.legend-item { display: inline-flex; align-items: center; gap: .4rem; font-size: .8rem; color: var(--body); }
.swatch { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

.stack-rows { display: grid; gap: .7rem; }
.stack-row { display: grid; grid-template-columns: minmax(140px, 240px) 1fr; gap: .9rem; align-items: center; }
.stack-title { font-size: .9rem; color: var(--ink); text-decoration: none; font-weight: 500; }
.stack-title:hover { color: var(--brand); }
.stack-bar { display: flex; gap: 2px; align-items: center; }
.stack-seg { height: 18px; min-width: 6px; }
.stack-seg:first-child { border-radius: 0 0 0 0; }
.stack-bar .stack-seg:last-of-type { border-radius: 0 4px 4px 0; }
.stack-total { margin-left: .5rem; font-size: .85rem; color: var(--ink); font-weight: 600; }

.dash-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.25rem; }
.hbar-row {
  display: grid; grid-template-columns: minmax(90px, 140px) 1fr 2.5rem;
  gap: .75rem; align-items: center; margin-bottom: .55rem;
}
.hbar-label { font-size: .88rem; color: var(--body); }
.hbar-track { background: var(--bg-soft); border-radius: 0 4px 4px 0; }
.hbar-fill {
  display: block; height: 16px; background: var(--brand);
  border-radius: 0 4px 4px 0; min-width: 3px;
}
.hbar-value { font-size: .85rem; color: var(--ink); font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.mini-stats { grid-template-columns: 1fr max-content; }
.mini-stats dd { font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }

/* ---------- kanban board ---------- */
.board-toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.board-controls { display: flex; gap: .6rem; align-items: center; }
.board-filter select { width: auto; min-width: 200px; }
.view-toggle {
  display: inline-flex; background: var(--panel); border: 1px solid var(--line);
  border-radius: 8px; overflow: hidden;
}
.view-btn {
  display: flex; align-items: center; padding: .45rem .6rem; color: var(--muted);
}
.view-btn:hover { color: var(--ink); background: var(--bg-soft); }
.view-btn.active { color: #fff; background: var(--brand); }
.view-btn + .view-btn { border-left: 1px solid var(--line); }
.candidates-table td { vertical-align: top; }

.board {
  display: grid; grid-template-columns: repeat(6, minmax(210px, 1fr));
  gap: .75rem; overflow-x: auto; align-items: start; padding-bottom: 1rem;
}
.board-col { background: #ececec; border-radius: 10px; padding: .6rem; min-width: 210px; }
.board-col h2 {
  font-size: .78rem; text-transform: uppercase; letter-spacing: .05em;
  color: var(--muted); margin: 0 .25rem .6rem; display: flex; justify-content: space-between;
}
.count { background: #ddd; border-radius: 999px; padding: 0 8px; font-size: .74rem; }
.board-cards { display: grid; gap: .5rem; min-height: 40px; }
.card {
  display: grid; gap: .2rem; background: var(--panel); border: 1px solid var(--line);
  border-radius: 8px; padding: .6rem .7rem; text-decoration: none; color: var(--body);
  font-size: .88rem; cursor: grab;
}
.card strong { color: var(--ink); }
.card:hover { border-color: var(--brand); }
.card-ghost { opacity: .4; }
.card-job { color: var(--muted); font-size: .8rem; }
.card-footer { display: flex; justify-content: space-between; align-items: center; margin-top: .2rem; }
.card-age { color: var(--muted); font-size: .74rem; }

#toast {
  position: fixed; bottom: 1.5rem; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: .6rem 1.1rem; border-radius: 8px; font-size: .9rem;
  box-shadow: 0 4px 16px rgba(0,0,0,.25); z-index: 50;
}

@media (max-width: 900px) {
  .board { grid-template-columns: repeat(6, 240px); }
  .admin-header nav { overflow-x: auto; }
  .header-nav { gap: 1rem; }
}
