:root {
  --bg: #f7f7f8;
  --surface: #ffffff;
  --border: #e5e5e8;
  --text: #1a1a1a;
  --text-muted: #6b6b70;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --high: #16a34a;
  --high-bg: #dcfce7;
  --mid: #b45309;
  --mid-bg: #fef3c7;
  --low: #71717a;
  --low-bg: #f0f0f1;
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  font-family: -apple-system, "Segoe UI", system-ui, sans-serif;
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
  background: var(--bg);
  color: var(--text);
}

header.page { margin-bottom: 1.5rem; display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; }
h1 { margin: 0 0 0.15rem; font-size: 1.5rem; }
.subtitle { color: var(--text-muted); margin: 0; font-size: 0.9rem; }
.logout-link { color: var(--text-muted); font-size: 0.82rem; text-decoration: none; }
.logout-link:hover { text-decoration: underline; }

.banner {
  padding: 0.65rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1.25rem;
  font-size: 0.9rem;
}
.banner.info { background: #dbeafe; color: #1e40af; }
.banner.error { background: #fee2e2; color: #991b1b; }

.toolbar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.9rem 1rem;
  display: flex;
  gap: 1.25rem;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}
.toolbar form { display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; }
.toolbar label { font-size: 0.82rem; color: var(--text-muted); display: flex; gap: 0.35rem; align-items: center; }

button {
  cursor: pointer;
  padding: 0.45rem 0.95rem;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 0.85rem;
  color: var(--text);
  transition: background 0.15s, border-color 0.15s;
}
button:hover { background: var(--bg); }
button.primary { background: var(--accent); color: white; border-color: var(--accent); }
button.primary:hover { background: var(--accent-hover); }

select, input[type=number], input[type=password], input[type=text] {
  padding: 0.35rem 0.5rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 0.85rem;
}

.counts { color: var(--text-muted); font-size: 0.85rem; margin-left: auto; }

.job-list { display: flex; flex-direction: column; gap: 0.6rem; }

.job-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.9rem 1.1rem;
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 1rem;
  align-items: center;
}

.job-main { min-width: 0; }
a.title-link { color: var(--text); text-decoration: none; font-weight: 600; font-size: 0.98rem; }
a.title-link:hover { color: var(--accent); text-decoration: underline; }
.job-meta { color: var(--text-muted); font-size: 0.82rem; margin-top: 0.2rem; }
.job-meta .dot::before { content: "\00b7"; margin: 0 0.35rem; }

.job-score { text-align: center; min-width: 4.5rem; }
.score-pill {
  display: inline-block;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.9rem;
}
.score-high { background: var(--high-bg); color: var(--high); }
.score-mid { background: var(--mid-bg); color: var(--mid); }
.score-low { background: var(--low-bg); color: var(--low); }

.job-status { display: flex; flex-direction: column; align-items: flex-end; gap: 0.35rem; min-width: 8.5rem; }
.tag { display: inline-block; padding: 0.15rem 0.6rem; border-radius: 999px; font-size: 0.72rem; font-weight: 600; }
.status-nova { background: #dbeafe; color: #1e40af; }
.status-relevante { background: #dcfce7; color: #166534; }
.status-descartada { background: #fee2e2; color: #991b1b; }
.status-candidatada { background: #fef9c3; color: #854d0e; }
.status-form select { font-size: 0.78rem; padding: 0.2rem 0.4rem; }

.empty {
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 2.5rem 1rem;
  text-align: center;
  color: var(--text-muted);
}

.login-box {
  max-width: 320px;
  margin: 4rem auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
}
.login-box h1 { font-size: 1.2rem; }
.login-box form { display: flex; flex-direction: column; gap: 0.75rem; margin-top: 1rem; }
.login-box input { width: 100%; padding: 0.5rem 0.6rem; }
.login-box button { width: 100%; }
.login-box .error { color: #991b1b; font-size: 0.85rem; }

@media (max-width: 640px) {
  .job-card { grid-template-columns: 1fr; text-align: left; }
  .job-status { align-items: flex-start; }
  .counts { margin-left: 0; }
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16161a;
    --surface: #1f1f24;
    --border: #2e2e34;
    --text: #ececee;
    --text-muted: #9a9aa2;
    --high-bg: #123422;
    --mid-bg: #3a2a0d;
    --low-bg: #2a2a30;
  }
}
