:root {
  --navy: #0e2a4a;
  --navy-light: #16406e;
  --bg: #f4f6f9;
  --border: #e0e4ea;
  --green: #1a7f37;
  --red: #b42318;
  --amber: #a15c00;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Arial, sans-serif;
  background: var(--bg);
  color: #1c1c1c;
}

.topbar {
  background: var(--navy);
  color: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 28px;
  flex-wrap: wrap;
}
.brand { font-weight: 700; font-size: 18px; }
.brand span { font-weight: 400; opacity: .8; font-size: 14px; }
.topbar nav a {
  color: #fff;
  text-decoration: none;
  margin-left: 18px;
  font-size: 14px;
  opacity: .9;
}
.topbar nav a:hover { opacity: 1; text-decoration: underline; }

.container { max-width: 1200px; margin: 0 auto; padding: 24px 20px 60px; }

h1 { color: var(--navy); margin-bottom: 16px; }
h2 { color: var(--navy); margin-top: 34px; font-size: 19px; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 14px;
  margin-top: 10px;
}
.stat-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  text-align: center;
}
.stat-card.highlight { background: #eaf3ea; border-color: #bfe0bf; }
.stat-num { display: block; font-size: 26px; font-weight: 700; color: var(--navy); }
.stat-label { font-size: 12px; color: #666; }

.table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--border); border-radius: 10px; margin-top: 10px; }
table { border-collapse: collapse; width: 100%; font-size: 13px; }
th, td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { background: var(--navy); color: #fff; position: sticky; top: 0; }
tr:hover td { background: #f8fafc; }

.badge { display: inline-block; padding: 2px 8px; border-radius: 12px; font-size: 11px; font-weight: 600; }
.badge-yes { background: #e3f6e6; color: var(--green); }
.badge-no { background: #f4f4f4; color: #777; }

.badge.st-new { background:#eef1f6; color:#333; }
.badge.st-contacted { background:#e6f0fb; color:#1a5fa8; }
.badge.st-callback { background:#fdf1d9; color:var(--amber); }
.badge.st-visit { background:#e6f7ff; color:#0b6e99; }
.badge.st-watertest { background:#e9f7ee; color:#1a7f37; }
.badge.st-quote { background:#f3ecfb; color:#6b3fa0; }
.badge.st-won { background:#dcf5e1; color:#0d6b2f; font-weight:700; }
.badge.st-lost { background:#fbe7e6; color:var(--red); }
.badge.st-amc { background:#fff3d6; color:#8a6100; }

.filter-bar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; align-items: center; }
.filter-bar select, .filter-bar input { padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; }
.btn-link { font-size: 13px; color: var(--navy-light); }

.lead-form { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 24px; margin-top: 10px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px 18px; margin-bottom: 14px; }
.lead-form label { display: block; font-size: 12px; font-weight: 600; color: #444; margin-bottom: 4px; }
.lead-form input, .lead-form select, .lead-form textarea {
  width: 100%; padding: 9px 10px; border: 1px solid var(--border); border-radius: 6px; font-size: 14px;
}
.lead-form textarea { resize: vertical; }
.form-actions { display: flex; gap: 10px; margin-top: 16px; }

button, .btn {
  background: var(--navy);
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  text-decoration: none;
  display: inline-block;
}
button:hover, .btn:hover { background: var(--navy-light); }
.btn-danger { background: var(--red); }
.btn-danger:hover { background: #8f1c12; }

.warning { background: #fdecea; color: var(--red); padding: 10px 14px; border-radius: 6px; font-size: 14px; }
.success { background: #e6f7ea; color: var(--green); padding: 10px 14px; border-radius: 6px; font-size: 14px; }

.footer { text-align: center; padding: 20px; font-size: 12px; color: #888; }

/* Setup checklist */
.checklist-box {
  background: #fff;
  border: 1px solid var(--border);
  border-left: 4px solid var(--navy);
  border-radius: 10px;
  padding: 18px 22px;
  margin-top: 6px;
  margin-bottom: 10px;
}
.checklist-box.checklist-complete { border-left-color: var(--green); font-size: 14px; }
.checklist-head { display: flex; justify-content: space-between; align-items: baseline; }
.checklist-progress { font-size: 13px; font-weight: 600; color: var(--navy-light); background: #eef2f8; padding: 3px 10px; border-radius: 12px; }
.checklist { list-style: none; margin: 10px 0 0; padding: 0; }
.checklist li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid #f0f2f5;
}
.checklist li:last-child { border-bottom: none; }
.checklist-form { margin: 0; }
.check-toggle {
  width: 26px; height: 26px; min-width: 26px;
  border-radius: 50%;
  background: #eef1f6;
  color: var(--navy);
  border: 1px solid var(--border);
  font-size: 12px;
  font-weight: 700;
  padding: 0;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.checklist li.done .check-toggle { background: var(--green); color: #fff; border-color: var(--green); }
.checklist li.done .checklist-label { color: #888; text-decoration: line-through; }
.checklist-label { font-size: 14px; font-weight: 500; }
.checklist-help { font-size: 12px; color: #888; margin-top: 2px; }

/* Auth pages */
.auth-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.auth-box {
  background: #fff; border: 1px solid var(--border); border-radius: 12px;
  padding: 36px 32px; width: 340px; text-align: center;
}
.auth-box h1 { font-size: 18px; margin-bottom: 20px; }
.auth-box h1 span { display: block; font-size: 14px; font-weight: 400; color: #666; margin-top: 4px; }
.auth-box label { display: block; text-align: left; font-size: 12px; font-weight: 600; margin: 12px 0 4px; color: #444; }
.auth-box input { width: 100%; padding: 10px; border: 1px solid var(--border); border-radius: 6px; font-size: 14px; }
.auth-box button { width: 100%; margin-top: 18px; }
