:root {
  --bg: #f6f7fb;
  --panel: #ffffff;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e6e9f0;
  --brand: #2f5cff;
  --brand-soft: #eef2ff;
  --hot: #16a34a;
  --mid: #f59e0b;
  --danger: #dc2626;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px rgba(15, 23, 42, .05);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
h1, h2, h3 { margin: 0 0 .6rem; line-height: 1.25; }
h1 { font-size: 1.35rem; font-weight: 650; }
h2 { font-size: 1rem; font-weight: 650; }
h3 { font-size: .92rem; font-weight: 650; letter-spacing: .01em; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
.empty { color: var(--muted); font-size: .9rem; margin: .4rem 0; }

/* ---------- layout ---------- */
.shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 232px; flex: 0 0 232px;
  background: #0b1220;
  color: #cbd5e1;
  padding: 22px 16px;
  display: flex; flex-direction: column; gap: 26px;
  position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; align-items: center; gap: 10px; color: #fff; }
.brand small { display: block; color: #8fa0b8; font-size: .72rem; }
.logo {
  display: grid; place-items: center;
  width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(135deg, #2f5cff, #7c3aed);
  color: #fff; font-weight: 700; font-size: .82rem; letter-spacing: .5px;
}
.logo.big { width: 48px; height: 48px; font-size: 1rem; border-radius: 14px; margin: 0 auto 12px; }

.sidebar nav { display: flex; flex-direction: column; gap: 4px; }
.sidebar nav a {
  padding: 9px 12px; border-radius: 10px; color: #b6c2d6; font-size: .92rem;
}
.sidebar nav a:hover { background: #131c30; color: #fff; }
.sidebar nav a.on { background: #1b2740; color: #fff; font-weight: 600; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; font-size: .85rem; }
.side-foot a.muted { color: #8fa0b8; }

main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 18px 28px; background: rgba(255,255,255,.7);
  border-bottom: 1px solid var(--line); backdrop-filter: blur(6px);
  position: sticky; top: 0; z-index: 5;
}
.topbar-actions { display: flex; gap: 8px; }
.content { padding: 24px 28px 56px; }

/* ---------- panels ---------- */
.panel {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow);
}
.grid-2 { display: grid; grid-template-columns: 1.55fr 1fr; gap: 18px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 18px; }
@media (max-width: 1000px) {
  .grid-2 { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; width: 100%; flex-basis: auto; }
  .shell { flex-direction: column; }
}

/* ---------- stats ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; box-shadow: var(--shadow);
}
.stat span { display: block; color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; }
.stat strong { font-size: 1.55rem; font-weight: 680; }

/* ---------- offer rows ---------- */
.list { display: flex; flex-direction: column; gap: 10px; }
.offer-row {
  display: flex; gap: 14px; align-items: flex-start;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 12px; padding: 13px 16px; box-shadow: var(--shadow);
  transition: border-color .15s, transform .15s;
}
.offer-row:hover { border-color: #c7d2fe; transform: translateY(-1px); }
.offer-row.static:hover { transform: none; }
.offer-main { flex: 1; min-width: 0; }
.offer-title { font-weight: 620; font-size: .96rem; }
.offer-sub { color: var(--muted); font-size: .85rem; margin-top: 2px; }
.offer-date { color: var(--muted); font-size: .78rem; white-space: nowrap; padding-top: 2px; }
.row-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }

.score {
  flex: 0 0 auto; width: 42px; height: 42px; border-radius: 12px;
  display: grid; place-items: center; font-weight: 700; font-size: .86rem;
  background: #f1f5f9; color: #475569;
}
.score.mid { background: #fff7ed; color: #b45309; }
.score.hot { background: #ecfdf5; color: #047857; }
.score.big { width: 64px; height: 64px; font-size: 1.15rem; border-radius: 16px; }

/* ---------- chips ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip {
  font-size: .74rem; padding: 3px 8px; border-radius: 999px;
  background: #f1f5f9; color: #475569; white-space: nowrap;
}
.chip.money { background: #ecfdf5; color: #047857; }
.chip.ch { background: var(--brand-soft); color: #3452c9; }
.chip.st-new { background: #f1f5f9; color: #64748b; }
.chip.st-saved { background: #eff6ff; color: #1d4ed8; }
.chip.st-applied { background: #ecfdf5; color: #047857; }
.chip.st-interview { background: #fef3c7; color: #b45309; }
.chip.st-rejected { background: #fef2f2; color: #b91c1c; }
.chip.st-skipped { background: #f8fafc; color: #94a3b8; }

/* ---------- forms ---------- */
input, select, textarea, button { font: inherit; }
input[type=text], input[type=search], input[type=password], input[type=number], select, textarea {
  padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: #fff; color: var(--ink); outline: none; min-width: 0;
}
input:focus, select:focus, textarea:focus { border-color: #a5b4fc; box-shadow: 0 0 0 3px #eef2ff; }
textarea { width: 100%; resize: vertical; margin-bottom: 8px; }
.narrow { width: 96px; }
.check { display: inline-flex; align-items: center; gap: 6px; font-size: .86rem; color: var(--muted); }

.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.filters input[type=search] { flex: 1 1 240px; }
.row-wrap { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.inline { display: inline; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 14px; border-radius: 10px; border: 1px solid transparent;
  background: var(--brand); color: #fff; font-weight: 600; font-size: .88rem;
  cursor: pointer; transition: filter .15s;
}
.btn:hover { filter: brightness(.95); }
.btn.ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { background: #f8fafc; }
.btn.small { padding: 5px 10px; font-size: .8rem; border-radius: 8px; }
.btn.danger { color: var(--danger); }
.btn.on { background: var(--brand-soft); color: #3452c9; border-color: #c7d2fe; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ---------- tables ---------- */
.tbl { width: 100%; border-collapse: collapse; font-size: .87rem; }
.tbl th { text-align: left; color: var(--muted); font-weight: 500; font-size: .76rem; text-transform: uppercase; letter-spacing: .04em; padding: 6px 4px; }
.tbl td { padding: 7px 4px; border-top: 1px solid var(--line); vertical-align: top; }
.tbl.small td { padding: 5px 4px; }
.num { text-align: right; white-space: nowrap; }

/* ---------- bars ---------- */
.bar-row { display: grid; grid-template-columns: 1fr 90px 38px; gap: 10px; align-items: center; font-size: .86rem; margin-bottom: 8px; }
.bar { height: 7px; background: #f1f5f9; border-radius: 999px; overflow: hidden; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, #2f5cff, #7c3aed); }

/* ---------- detail ---------- */
.detail-head { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; margin-bottom: 18px; }
.detail-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 18px; align-items: start; }
@media (max-width: 1000px) { .detail-grid { grid-template-columns: 1fr; } }
.desc { white-space: pre-wrap; font-size: .92rem; color: #1e293b; max-height: 62vh; overflow: auto; }
.loc { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.loc:first-of-type { border-top: 0; }

/* ---------- misc ---------- */
.result-line { color: var(--muted); font-size: .85rem; margin: 0 0 12px; }
.pager { display: flex; gap: 12px; align-items: center; justify-content: center; margin-top: 18px; }
.alert { background: #fef2f2; color: #b91c1c; border-radius: 10px; padding: 10px 12px; font-size: .86rem; margin-bottom: 10px; }
.pill { display: inline-flex; align-items: center; gap: 7px; font-size: .8rem; color: #cbd5e1; }
.pill.run .dot { width: 7px; height: 7px; border-radius: 50%; background: #22c55e; animation: pulse 1.2s infinite; }
@keyframes pulse { 0%,100% { opacity: 1 } 50% { opacity: .35 } }

.joblog {
  margin-top: 12px; background: #0b1220; color: #cbd5e1; border-radius: 10px;
  padding: 12px 14px; font: 12px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace;
  max-height: 260px; overflow: auto;
}
.joblog .muted { color: #7c8aa3; }
.joblog .pill { color: #cbd5e1; margin-bottom: 6px; }

/* ---------- login ---------- */
.login-body { display: grid; place-items: center; min-height: 100vh; background: radial-gradient(1200px 600px at 50% -10%, #e6ecff, var(--bg)); }
.login-card {
  width: min(360px, 92vw); background: #fff; border: 1px solid var(--line);
  border-radius: 18px; padding: 30px 26px; box-shadow: 0 20px 60px rgba(15,23,42,.12);
  text-align: center; display: flex; flex-direction: column; gap: 10px;
}
.login-card h1 { font-size: 1.2rem; margin: 0; }
.login-card input { width: 100%; }
.login-card .btn, .login-card button { width: 100%; margin-top: 6px; }
