/* Ascent Careers : shared stylesheet
   White surfaces, dark text, Inter at 400 with 500 for emphasis. */

:root {
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --ink: #16181d;
  --ink-soft: #5c6270;
  --ink-faint: #8b909c;
  --line: #e7e8ec;
  --line-soft: #f0f1f4;
  --surface: #ffffff;
  --surface-alt: #fafbfc;
  --brand: #005bea;
  --brand-soft: #eef4ff;
  --green: #0a7d4b;
  --green-soft: #e9f6ef;
  --amber: #915c00;
  --amber-soft: #fdf3e2;
  --grey: #5c6270;
  --grey-soft: #f1f2f5;
  --red: #b42318;
  --red-soft: #fdeceb;
  --radius: 6px;
}

*, *::before, *::after { box-sizing: border-box; }

/* Inter everywhere. Form controls and tables do not inherit font by default. */
html, body, input, select, textarea, button, table, th, td,
h1, h2, h3, h4, h5, h6, p, a, li, label, div, span {
  font-family: var(--font);
  font-variant-ligatures: none;
  font-feature-settings: 'tnum' 0;
}

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

body {
  margin: 0;
  font-family: var(--font);
  font-weight: 400;
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--surface);
  -webkit-font-smoothing: antialiased;
}

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

img { max-width: 100%; }

h1, h2, h3, h4 { font-weight: 500; color: var(--ink); margin: 0; letter-spacing: -0.01em; }
h1 { font-size: 24px; line-height: 1.3; }
h2 { font-size: 17px; }
h3 { font-size: 15px; }
p { margin: 0 0 12px; }
p:last-child { margin-bottom: 0; }

.wrap { max-width: 1060px; margin: 0 auto; padding: 0 20px; }
.wrap.admin-shell { padding-left: 20px; padding-right: 20px; }
.wrap-narrow { max-width: 800px; margin: 0 auto; padding: 0 20px; }

/* ---------- Header ---------- */
.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  position: sticky; top: 0; z-index: 40;
}
.site-header .bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; height: 62px;
}
.site-header .logo img, .admin-header .logo img { height: 32px; width: auto; display: block; }
.site-header .logo-text { font-size: 15px; font-weight: 500; letter-spacing: -0.01em; }
.site-header .logo-text span { color: var(--ink-faint); font-weight: 400; }
.header-links { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.header-links a { color: var(--ink-soft); }
.header-links a:hover { color: var(--ink); text-decoration: none; }
.header-links .pill {
  display: inline-flex; align-items: center; height: 32px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: 100px;
  color: var(--ink-soft); background: var(--surface); line-height: 1;
  transition: border-color .12s, color .12s, background .12s;
}
.header-links .pill:hover {
  border-color: #d3d6dd; background: var(--surface-alt); color: var(--ink); text-decoration: none;
}

/* ---------- Page intro ---------- */
.page-intro { padding: 40px 0 26px; border-bottom: 1px solid var(--line-soft); }
.page-intro .eyebrow {
  font-size: 11px; letter-spacing: 0.09em; text-transform: uppercase;
  color: var(--ink-faint); margin-bottom: 10px;
}
.page-intro p.lede { color: var(--ink-soft); max-width: 620px; margin-top: 10px; }

/* ---------- Filters ---------- */
.filter-row {
  display: flex; flex-wrap: wrap; gap: 8px;
  padding: 20px 0; border-bottom: 1px solid var(--line-soft);
}
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 13px; border: 1px solid var(--line); border-radius: 100px;
  font-size: 13px; color: var(--ink-soft); background: var(--surface);
  cursor: pointer; transition: border-color .12s, color .12s, background .12s;
}
.chip:hover { border-color: #d3d6dd; color: var(--ink); text-decoration: none; }
.chip.is-active { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip .count { color: inherit; opacity: .6; font-size: 12px; }

/* ---------- Job list ---------- */
.job-list { border-top: 1px solid var(--line-soft); }
.job-row {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 18px 4px; border-bottom: 1px solid var(--line-soft);
  transition: background .12s;
}
.job-row:hover { background: var(--surface-alt); }
.job-row .title { font-size: 15px; font-weight: 500; color: var(--ink); }
.job-row a.title:hover { color: var(--brand); text-decoration: none; }
.job-row .summary { color: var(--ink-soft); font-size: 13px; margin-top: 4px; max-width: 640px; }
.meta-line {
  display: flex; flex-wrap: wrap; gap: 6px 14px;
  font-size: 12px; color: var(--ink-faint); margin-top: 7px;
}
.meta-line span { display: inline-flex; align-items: center; gap: 5px; }
.job-row .action { flex: none; }

.empty-state {
  padding: 56px 20px; text-align: center; color: var(--ink-soft);
  border: 1px dashed var(--line); border-radius: var(--radius); margin: 28px 0;
}

/* ---------- Role detail ---------- */
.role-head { padding: 34px 0 22px; border-bottom: 1px solid var(--line-soft); }
.role-head .backlink { font-size: 13px; color: var(--ink-soft); display: inline-block; margin-bottom: 16px; }
.role-body { padding: 26px 0 10px; }
.role-section { padding: 0 0 26px; }
.role-section h2 { margin-bottom: 10px; }
.role-section p { color: var(--ink); }
.role-section ul { margin: 0; padding-left: 18px; }
.role-section li { margin-bottom: 7px; color: var(--ink); }
.role-section li::marker { color: var(--ink-faint); }

.apply-bar {
  position: sticky; bottom: 0; background: var(--surface);
  border-top: 1px solid var(--line); padding: 12px 0; z-index: 30;
}
.apply-bar .inner { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.apply-bar .note { font-size: 12.5px; color: var(--ink-soft); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  font-family: inherit; font-size: 13.5px; font-weight: 400; line-height: 1;
  padding: 10px 16px; border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  cursor: pointer; transition: background .12s, border-color .12s, color .12s;
  text-decoration: none; white-space: nowrap;
}
.btn:hover { border-color: #d3d6dd; background: var(--surface-alt); text-decoration: none; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: #0050cf; border-color: #0050cf; color: #fff; }
.btn-dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-dark:hover { background: #000; border-color: #000; color: #fff; }
.btn-sm { padding: 7px 12px; font-size: 12.5px; }
.btn-danger { color: var(--red); border-color: #f0d5d3; }
.btn-danger:hover { background: var(--red-soft); border-color: #e8bcb8; }
.btn[disabled] { opacity: .55; pointer-events: none; }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex; align-items: center;
  padding: 3px 10px; border-radius: 100px; font-size: 11.5px; line-height: 1.6;
  border: 1px solid transparent; white-space: nowrap;
}
.badge-green { background: var(--green-soft); color: var(--green); border-color: #cfe9dc; }
.badge-amber { background: var(--amber-soft); color: var(--amber); border-color: #f2e0bd; }
.badge-grey  { background: var(--grey-soft);  color: var(--grey);  border-color: var(--line); }
.badge-blue  { background: var(--brand-soft); color: var(--brand); border-color: #d5e4ff; }
.badge-line  { background: var(--surface); color: var(--ink-soft); border-color: var(--line); }

/* ---------- Forms ---------- */
.field { margin-bottom: 14px; }
.field label {
  display: block; font-size: 12.5px; color: var(--ink-soft); margin-bottom: 5px;
}
.field label .req { color: var(--red); }
.field .hint { font-size: 11.5px; color: var(--ink-faint); margin-top: 5px; }
input[type=text], input[type=email], input[type=tel], input[type=url],
input[type=password], input[type=date], input[type=number],
select, textarea {
  width: 100%; font-family: inherit; font-size: 13.5px; font-weight: 400; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 9px 11px; transition: border-color .12s, box-shadow .12s;
}
select { appearance: none; background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238b909c' stroke-width='2'%3e%3cpolyline points='6 9 12 15 18 9'/%3e%3c/svg%3e");
  background-repeat: no-repeat; background-position: right 9px center; background-size: 15px; padding-right: 30px; }
textarea { resize: vertical; min-height: 84px; line-height: 1.5; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(0,91,234,.10);
}
input[type=file] {
  width: 100%; font-family: inherit; font-size: 12.5px; color: var(--ink-soft);
  border: 1px dashed var(--line); border-radius: var(--radius); padding: 12px;
  background: var(--surface-alt); cursor: pointer;
}
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 14px; }
.hp-field { position: absolute; left: -9999px; opacity: 0; height: 0; }

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(16,18,22,.45);
  display: none; align-items: flex-start; justify-content: center;
  padding: 24px 14px; z-index: 90; overflow-y: auto;
}
.modal-backdrop.is-open { display: flex; }
.modal {
  background: var(--surface); border-radius: 8px; width: 100%; max-width: 620px;
  border: 1px solid var(--line); box-shadow: 0 18px 48px rgba(16,18,22,.16);
  margin: auto;
}
.modal-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 14px;
  padding: 18px 22px; border-bottom: 1px solid var(--line-soft);
}
.modal-head .sub { font-size: 12.5px; color: var(--ink-soft); margin-top: 3px; }
.modal-close {
  border: none; background: none; font-size: 22px; line-height: 1; color: var(--ink-faint);
  cursor: pointer; padding: 0 2px;
}
.modal-close:hover { color: var(--ink); }
.modal-body { padding: 20px 22px; }
.modal-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 22px; border-top: 1px solid var(--line-soft); background: var(--surface-alt);
  border-radius: 0 0 8px 8px;
}
.modal-foot .privacy { font-size: 11.5px; color: var(--ink-faint); }

/* ---------- Notices ---------- */
.notice {
  padding: 11px 14px; border-radius: var(--radius); font-size: 13px;
  border: 1px solid var(--line); margin-bottom: 16px;
}
.notice-success { background: var(--green-soft); border-color: #cfe9dc; color: var(--green); }
.notice-error   { background: var(--red-soft);   border-color: #f0d5d3; color: var(--red); }
.notice-info    { background: var(--brand-soft); border-color: #d5e4ff; color: var(--brand); }

/* ---------- Tables ---------- */
.table-wrap { border: 1px solid var(--line); border-radius: var(--radius); overflow: auto; background: var(--surface); }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }

/* Every cell shares one padding rhythm and one baseline, so columns line up
   across rows regardless of whether a cell holds one line or two. */
table.data th,
table.data td {
  padding: 11px 14px;
  vertical-align: middle;
  text-align: left;
}
table.data th {
  font-weight: 500; color: var(--ink-soft); font-size: 11.5px;
  letter-spacing: 0.04em; text-transform: uppercase;
  background: var(--surface-alt); border-bottom: 1px solid var(--line);
  white-space: nowrap; vertical-align: middle;
}
table.data td { border-bottom: 1px solid var(--line-soft); }
table.data tr:last-child td { border-bottom: none; }
table.data tbody tr:hover { background: var(--surface-alt); }
table.data td.nowrap, table.data th.nowrap { white-space: nowrap; }
table.data .muted { color: var(--ink-faint); font-size: 12px; }

/* Numeric and action columns align right, and the header follows the cell. */
table.data th.right, table.data td.right { text-align: right; }
table.data th.center, table.data td.center { text-align: center; }

/* Numbers use tabular figures so digits sit in fixed-width columns. */
table.data td.num, table.data td.right { font-variant-numeric: tabular-nums; }

/* Checkbox column: centre the control in the cell. */
table.data th:first-child input[type=checkbox],
table.data td:first-child input[type=checkbox] { display: block; margin: 0 auto; }

/* A two-line cell (name over email) stays vertically centred as a block. */
table.data td > div + div { margin-top: 2px; }

/* Inline controls inside a cell must not add stray height. */
table.data td form { display: inline-flex; align-items: center; margin: 0; }
table.data td select { vertical-align: middle; }


/* ---------- Admin shell ---------- */
.admin-header {
  border-bottom: 1px solid var(--line); background: var(--surface);
  position: sticky; top: 0; z-index: 40;
}
.admin-header .bar { display: flex; align-items: center; justify-content: space-between; height: 58px; gap: 16px; }
/* Admin shell: fixed left rail, fluid content column. */
.admin-shell {
  display: flex; align-items: flex-start; gap: 32px;
  padding: 24px 20px 60px;
}
.admin-side { width: 186px; flex: none; position: sticky; top: 82px; }
.admin-side nav { display: flex; flex-direction: column; gap: 1px; }
.admin-side a {
  display: block; padding: 8px 11px; border-radius: var(--radius);
  font-size: 13px; color: var(--ink-soft); line-height: 1.45;
  border: 1px solid transparent;
  transition: background .12s, color .12s, border-color .12s;
}
.admin-side a:hover { background: var(--surface-alt); color: var(--ink); text-decoration: none; }
.admin-side a.is-active {
  background: var(--surface-alt); border-color: var(--line); color: var(--ink);
}
.admin-main { flex: 1 1 auto; min-width: 0; }
.admin-title-row {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  margin-bottom: 18px; flex-wrap: wrap;
}

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 22px; }
.stat {
  border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; background: var(--surface);
}
.stat .label { font-size: 11.5px; color: var(--ink-faint); text-transform: uppercase; letter-spacing: .05em; }
.stat .value { font-size: 22px; font-weight: 500; margin-top: 5px; letter-spacing: -0.02em; }

.filter-panel {
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
  padding: 14px 16px; margin-bottom: 16px;
}
.filter-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px 12px; align-items: end; }
.filter-grid .field { margin-bottom: 0; }
.filter-actions { display: flex; gap: 8px; }

.panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.panel-head { padding: 14px 18px; border-bottom: 1px solid var(--line-soft); }
.panel-body { padding: 18px; }
.panel + .panel { margin-top: 16px; }

.kv { width: 100%; border-collapse: collapse; font-size: 13px; }
.kv th {
  text-align: left; font-weight: 400; color: var(--ink-soft);
  padding: 8px 18px 8px 0; width: 175px; vertical-align: top; white-space: nowrap;
}
.kv td { padding: 8px 0; vertical-align: top; }

.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; flex-wrap: wrap; }
.pager .links { display: flex; gap: 5px; }
.pager .links a, .pager .links span {
  padding: 6px 11px; border: 1px solid var(--line); border-radius: var(--radius);
  font-size: 12.5px; color: var(--ink-soft);
}
.pager .links a:hover { border-color: #d3d6dd; color: var(--ink); text-decoration: none; }
.pager .links .is-active { background: var(--ink); border-color: var(--ink); color: #fff; }
.pager .summary { font-size: 12.5px; color: var(--ink-faint); }

.login-shell { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; background: var(--surface-alt); }
.login-card { width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 28px; }
.login-card .logo { margin-bottom: 22px; }
.login-card .logo img { height: 32px; display: block; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); margin-top: 48px; padding: 24px 0 34px; }
.site-footer .inner {
  display: flex; align-items: center; justify-content: flex-end; gap: 16px; flex-wrap: wrap;
}
.site-footer .powered { display: inline-flex; align-items: center; line-height: 0; }
.site-footer img { height: 32px; display: block; }
.site-footer .fine { font-size: 12px; color: var(--ink-faint); }
.site-footer a { color: var(--ink-soft); }

/* ---------- Utilities ---------- */
.muted { color: var(--ink-soft); }
.faint { color: var(--ink-faint); }
.small { font-size: 12.5px; }
.mt-0 { margin-top: 0; } .mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; } .mb-8 { margin-bottom: 8px; } .mb-16 { margin-bottom: 16px; }
.flex { display: flex; } .items-center { align-items: center; } .gap-8 { gap: 8px; } .gap-12 { gap: 12px; }
.right { text-align: right; } .center { text-align: center; }
.divider { height: 1px; background: var(--line-soft); margin: 18px 0; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .filter-grid { grid-template-columns: repeat(3, 1fr); }
  .admin-shell { gap: 22px; }
  .admin-side { width: 158px; }
}
@media (max-width: 640px) {
  h1 { font-size: 21px; }
  .wrap, .wrap-narrow { padding: 0 16px; }
  .job-row { flex-direction: column; align-items: flex-start; gap: 12px; }
  .job-row .action { width: 100%; }
  .job-row .action .btn { width: 100%; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .filter-grid { grid-template-columns: repeat(2, 1fr); }
  .apply-bar .inner { flex-direction: column; align-items: stretch; gap: 8px; }
  .apply-bar .btn { width: 100%; }
  .apply-bar .note { text-align: center; }
  .admin-shell { flex-direction: column; gap: 0; padding: 16px 16px 48px; }
  .admin-side {
    width: 100%; position: static; margin-bottom: 18px;
    border-bottom: 1px solid var(--line-soft);
  }
  .admin-side nav {
    flex-direction: row; gap: 4px; overflow-x: auto;
    padding-bottom: 10px; -webkit-overflow-scrolling: touch;
  }
  .admin-side a { white-space: nowrap; }
  .admin-main { width: 100%; }
  .modal-backdrop { padding: 0; }
  .modal { border-radius: 0; min-height: 100%; border: none; }
  .modal-foot { flex-direction: column-reverse; align-items: stretch; border-radius: 0; }
  .modal-foot .btn { width: 100%; }
  .site-footer .inner { justify-content: center; }
  .header-links { gap: 6px; font-size: 12.5px; }
  .header-links .pill { height: 30px; padding: 0 11px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

@media print {
  .site-header, .admin-header, .admin-side, .apply-bar, .site-footer, .btn { display: none !important; }
}
