:root {
  --bg: #0f1115;
  --surface: #171a21;
  --surface-2: #1f232c;
  --border: #2a2f3a;
  --text: #e6e8ec;
  --muted: #8a90a0;
  --accent: #5b8def;
  --accent-hover: #4a78d6;
  --success: #3fb968;
  --danger: #e5484d;
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
}

/* Login */
.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
}
.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px;
  width: 320px;
  text-align: center;
}
.login-card h1 { margin: 0 0 4px; font-size: 22px; }
.login-card form { display: flex; flex-direction: column; gap: 10px; margin-top: 20px; }
.muted { color: var(--muted); font-size: 13px; }
.error { color: var(--danger); font-size: 13px; min-height: 18px; }

input, select, button {
  font-family: inherit;
  font-size: 14px;
  padding: 9px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
}
input:focus, select:focus { outline: 1px solid var(--accent); }

button {
  background: var(--accent);
  border: none;
  color: white;
  cursor: pointer;
  font-weight: 600;
}
button:hover { background: var(--accent-hover); }
button.ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  font-weight: 400;
}

/* Dashboard */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 28px;
  border-bottom: 1px solid var(--border);
}
.topbar h1 { font-size: 18px; margin: 0; }

main { padding: 24px 28px; max-width: 1100px; margin: 0 auto; }

section { margin-bottom: 36px; }
h2 { font-size: 15px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 14px; }

.stats { display: flex; gap: 14px; flex-wrap: wrap; }
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  min-width: 130px;
}
.stat-card .value { font-size: 24px; font-weight: 700; }
.stat-card .label { font-size: 12px; color: var(--muted); text-transform: capitalize; }

.agent-controls { display: flex; gap: 14px; flex-wrap: wrap; }
.agent-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  width: 200px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.filters { display: flex; gap: 10px; margin-bottom: 14px; }

table { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: var(--radius); overflow: hidden; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); font-size: 13px; }
th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; }
tr:last-child td { border-bottom: none; }

.badge { padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; }
.badge.new { background: #2a2f3a; }
.badge.scored { background: #3a3350; }
.badge.enriched { background: #2f3a52; }
.badge.outreach_ready { background: #3a5230; }
.badge.contacted { background: #52481f; }
.badge.won { background: #1f5233; color: var(--success); }
.badge.lost { background: #521f24; color: var(--danger); }

td select { padding: 4px 6px; font-size: 12px; }

.schedule-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}
.schedule-form input, .schedule-form select { flex: 1 1 160px; min-width: 140px; }
.days-picker, .steps-picker {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--muted);
  width: 100%;
}
.days-picker label, .steps-picker label { display: flex; align-items: center; gap: 4px; }
.scrape-fields { display: flex; gap: 10px; width: 100%; flex-wrap: wrap; }
.scrape-fields input { flex: 1 1 160px; }

.badge.success { background: #1f5233; color: var(--success); }
.badge.failed { background: #521f24; color: var(--danger); }
.badge.running { background: #3a3350; }
.badge.on { background: #1f5233; color: var(--success); }
.badge.off { background: #2a2f3a; color: var(--muted); }
