:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --text: #1c2330;
  --muted: #5d6778;
  --border: #dde1e8;
  --accent: #1f6f5c;
  --accent-dark: #17564a;
  --accent-soft: #e3f1ec;
  --danger: #b3261e;
  --danger-soft: #fbe9e7;
  --warn-soft: #fff4d6;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(20, 30, 50, .06), 0 2px 8px rgba(20, 30, 50, .04);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); line-height: 1.5; font-size: 15px; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5rem; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 .8rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.pre { white-space: pre-wrap; }

/* Layout */
.topbar { background: var(--surface); border-bottom: 1px solid var(--border); }
.topbar .inner { display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap; padding: .75rem 1rem; max-width: 1280px; margin: 0 auto; }
.brand { font-weight: 700; font-size: 1.1rem; color: var(--text); }
.brand span { color: var(--accent); }
.nav { display: flex; gap: 1rem; flex-wrap: wrap; flex: 1; }
.nav a { color: var(--muted); font-weight: 500; }
.nav a.active, .nav a:hover { color: var(--text); text-decoration: none; }
.user { display: flex; gap: .75rem; align-items: center; }
main { max-width: 1280px; margin: 0 auto; padding: 1.5rem 1rem 3rem; }
main.narrow { max-width: 820px; }
footer { text-align: center; color: var(--muted); font-size: .85rem; padding: 2rem 1rem; }

.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.grid { display: grid; gap: 1.25rem; }
.grid-2 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.grid-halves { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
@media (max-width: 900px) { .grid-2 { grid-template-columns: 1fr; } }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem 1.25rem; box-shadow: var(--shadow); margin-bottom: 1.25rem; }
.card > h2:first-child, .card > h3:first-child { margin-bottom: .75rem; }

/* Buttons */
.btn, button { display: inline-flex; align-items: center; gap: .35rem; font: inherit; font-weight: 600; font-size: .9rem; padding: .5rem .9rem; border-radius: 8px; border: 1px solid var(--accent); background: var(--accent); color: #fff; cursor: pointer; text-decoration: none; }
.btn:hover, button:hover { background: var(--accent-dark); text-decoration: none; }
.btn.secondary, button.secondary { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn.secondary:hover, button.secondary:hover { background: var(--bg); }
.btn.danger, button.danger { background: var(--danger); border-color: var(--danger); }
.btn.small, button.small { padding: .2rem .5rem; font-size: .8rem; }
.link-button { background: none; border: none; color: var(--accent); padding: 0; font-weight: 500; }
.link-button:hover { background: none; text-decoration: underline; }

/* Forms */
input[type=text], input[type=email], input[type=tel], input[type=url], input[type=number], input[type=password], input[type=datetime-local], input[type=search], input[type=file], select, textarea {
  width: 100%; font: inherit; padding: .5rem .65rem; border: 1px solid var(--border); border-radius: 8px; background: #fff; color: var(--text);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
label { font-weight: 600; font-size: .9rem; display: block; margin-bottom: .25rem; }
.form > div, .field { margin-bottom: 1rem; }
.helptext, .form .helptext { display: block; color: var(--muted); font-size: .8rem; margin-top: .2rem; }
.errorlist { list-style: none; padding: 0; margin: .25rem 0; color: var(--danger); font-size: .85rem; }
.errorlist.nonfield, .errorlist.nonform { background: var(--danger-soft); padding: .5rem .75rem; border-radius: 8px; }
.form input[type=checkbox] { margin-right: .4rem; }
.form div:has(> input[type=checkbox]) label, .checkbox-row label { display: inline; font-weight: 500; }
.checklist div, .checklist ul { list-style: none; padding: 0; margin: 0; }
.checklist label { font-weight: 500; display: flex; align-items: center; gap: .4rem; }
.rating div { display: flex; gap: .75rem; flex-wrap: wrap; }
.rating label { font-weight: 500; display: inline-flex; align-items: center; gap: .2rem; }
.inline-form { display: flex; gap: .5rem; align-items: end; flex-wrap: wrap; }
.inline-form > * { margin: 0; }
.inline-form select, .inline-form input { width: auto; }
.search { display: flex; gap: .5rem; flex-wrap: wrap; }
.search input, .search select { width: auto; flex: 1 1 180px; }

/* Messages */
.messages { list-style: none; padding: 0; margin: 0 0 1rem; }
.messages li { padding: .65rem .9rem; border-radius: 8px; margin-bottom: .5rem; background: var(--accent-soft); border: 1px solid #c5e3d8; }
.messages li.error { background: var(--danger-soft); border-color: #f2c4bf; }

/* Tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; padding: .55rem .6rem; border-bottom: 1px solid var(--border); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tr:last-child td { border-bottom: none; }

/* Badges & tags */
.badge { display: inline-block; font-size: .75rem; font-weight: 600; padding: .1rem .5rem; border-radius: 999px; background: var(--bg); border: 1px solid var(--border); color: var(--muted); white-space: nowrap; }
.badge.open, .badge.hired { background: var(--accent-soft); color: var(--accent-dark); border-color: #c5e3d8; }
.badge.draft { background: var(--warn-soft); color: #7a5b00; border-color: #f0dfa6; }
.badge.closed, .badge.rejected { background: var(--danger-soft); color: var(--danger); border-color: #f2c4bf; }
.tag { display: inline-block; font-size: .72rem; padding: .05rem .45rem; border-radius: 4px; background: #eef0f6; color: #3d4760; margin: 0 .2rem .2rem 0; }

/* Careers */
.hero { background: linear-gradient(135deg, var(--accent) 0%, #2d8a74 100%); color: #fff; padding: 2.5rem 1rem; }
.hero .inner { max-width: 1280px; margin: 0 auto; }
.hero h1 { font-size: 2rem; }
.job-list { display: grid; gap: .75rem; }
.job-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.25rem; color: var(--text); box-shadow: var(--shadow); }
.job-row:hover { border-color: var(--accent); text-decoration: none; }
.job-row h3 { margin: 0; color: var(--accent); }
.meta { display: flex; gap: .4rem 1rem; flex-wrap: wrap; color: var(--muted); font-size: .88rem; }
.description { white-space: pre-line; }

/* Kanban board */
.board { display: flex; gap: .9rem; overflow-x: auto; padding-bottom: 1rem; align-items: flex-start; }
.column { flex: 0 0 260px; background: #eceff3; border-radius: var(--radius); padding: .6rem; }
.column.kind-rejected { background: #f5eceb; }
.column.kind-hired { background: #e4f0eb; }
.column-head { display: flex; justify-content: space-between; align-items: center; padding: .2rem .3rem .6rem; font-weight: 700; font-size: .9rem; }
.column-empty { color: var(--muted); font-size: .85rem; text-align: center; padding: 1rem 0; }
.kcard { background: var(--surface); border-radius: 8px; border: 1px solid var(--border); padding: .65rem .7rem; margin-bottom: .55rem; box-shadow: var(--shadow); }
.kcard .name { font-weight: 600; display: block; color: var(--text); }
.kcard .kmeta { font-size: .78rem; color: var(--muted); margin: .15rem 0 .35rem; }
.kcard .kactions { display: flex; gap: .3rem; align-items: center; flex-wrap: wrap; border-top: 1px solid var(--border); padding-top: .45rem; margin-top: .35rem; }
.kcard .kactions form { margin: 0; }
.kcard select { width: auto; max-width: 110px; padding: .15rem .3rem; font-size: .78rem; }

/* Timeline */
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { position: relative; padding: 0 0 .9rem 1.2rem; border-left: 2px solid var(--border); margin-left: .3rem; }
.timeline li::before { content: ""; position: absolute; left: -6px; top: .35rem; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.timeline li:last-child { border-left-color: transparent; }

.score { font-weight: 700; color: var(--accent-dark); }
.bar { height: 8px; background: var(--accent-soft); border-radius: 4px; overflow: hidden; min-width: 80px; }
.bar span { display: block; height: 100%; background: var(--accent); }
dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1rem; margin: 0; }
dl.facts dt { color: var(--muted); font-size: .88rem; }
dl.facts dd { margin: 0; }
.stat { font-size: 1.8rem; font-weight: 700; }
details summary { cursor: pointer; font-weight: 600; }
details[open] summary { margin-bottom: .75rem; }
.formset-row { display: grid; grid-template-columns: 2fr 90px 1fr auto; gap: .5rem; align-items: center; margin-bottom: .5rem; }
.formset-row.q { grid-template-columns: 3fr auto 90px auto; }
@media (max-width: 640px) { .formset-row, .formset-row.q { grid-template-columns: 1fr 1fr; } }
