/* BUZZ brand: orange #ED5724, yellow #FFC800, magenta #A62554, cream #FFFDEB, ink #111 */
:root {
  --orange: #ed5724;
  --orange-dark: #d14e1f;
  --yellow: #ffc800;
  --magenta: #a62554;
  --cream: #fffdeb;
  --cream-2: #f8f0d5;
  --ink: #111;
  --ink-2: #4a4538;
  --muted: #7a7262;
  --line: #e9e1c8;
  --card: #fff;
  --green: #1f9d55;
  --red: #c62828;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .05), 0 6px 20px rgba(0, 0, 0, .05);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: 'Bricolage Grotesque', system-ui, sans-serif;
  background: var(--cream);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.45;
}
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
small { color: var(--muted); font-weight: 400; }
h1, h2, h3 { margin: 0; letter-spacing: -.02em; }
h2 { font-size: 30px; font-weight: 800; }
h3 { font-size: 17px; font-weight: 700; margin-bottom: 14px; display: flex; align-items: center; gap: 10px; }
a { color: var(--orange); }

/* Buttons */
.btn {
  font: inherit; font-weight: 600; border: 0; cursor: pointer; border-radius: 999px;
  padding: 10px 18px; display: inline-flex; align-items: center; gap: 8px; text-decoration: none;
  transition: transform .1s ease, background .15s ease; white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--orange); color: #fff; }
.btn-primary:hover { background: var(--orange-dark); }
.btn-ghost { background: #fff; color: var(--ink); border: 1.5px solid var(--line); }
.btn-ghost:hover { border-color: var(--orange); color: var(--orange); }
.btn-link { background: none; color: var(--orange); padding: 6px 8px; }
.btn-lg { padding: 14px 28px; font-size: 17px; }
.btn-block { width: 100%; justify-content: center; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.icon-btn { border: 0; background: none; cursor: pointer; color: var(--ink-2); font-size: 17px; padding: 8px; border-radius: 10px; }
.icon-btn:hover { background: var(--cream-2); }

/* Forms */
label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 14px; }
label small { margin-left: 4px; }
input, select, textarea {
  font: inherit; font-weight: 400; display: block; width: 100%; margin-top: 6px; padding: 10px 12px;
  border: 1.5px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink);
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--orange); box-shadow: 0 0 0 3px rgba(237, 87, 36, .15); }
input[type=range] { padding: 0; border: 0; accent-color: var(--orange); box-shadow: none; }
label.check { display: flex; align-items: center; gap: 8px; font-weight: 500; }
label.check input { width: auto; margin: 0; accent-color: var(--orange); }
.input-row { display: flex; gap: 8px; margin-top: 6px; }
.input-row input { margin: 0; }
.grid-inline { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.error { color: var(--red); min-height: 1em; font-size: 14px; }

/* Login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px;
  background: radial-gradient(circle at 15% 20%, rgba(255, 200, 0, .35), transparent 40%),
              radial-gradient(circle at 85% 80%, rgba(237, 87, 36, .25), transparent 45%), var(--cream); }
.login-card { width: 100%; max-width: 380px; background: #fff; padding: 36px 30px; border-radius: 24px; box-shadow: var(--shadow); text-align: center; }
.login-card label { text-align: left; }
.login-logo { width: 72px; height: 72px; }
.login-card h1 { font-size: 34px; font-weight: 800; margin-top: 4px; }
.login-card h1 span { color: var(--orange); }
.login-card p { margin: 4px 0 22px; }

/* Topbar */
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 18px;
  padding: 10px 24px; background: rgba(255, 253, 235, .92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 8px; color: var(--ink); text-decoration: none; font-size: 20px; font-weight: 600; }
.brand img { width: 38px; height: 38px; }
.brand b { color: var(--orange); font-weight: 800; }
.tabs { display: flex; gap: 4px; margin: 0 auto; background: var(--cream-2); padding: 4px; border-radius: 999px; }
.tabs a { display: flex; align-items: center; gap: 8px; padding: 8px 16px; border-radius: 999px; color: var(--ink-2); text-decoration: none; font-weight: 600; }
.tabs a.active { background: var(--ink); color: #fff; }
.tabs em { font-style: normal; background: var(--yellow); color: var(--ink); font-size: 12px; padding: 0 7px; border-radius: 999px; }
.top-right { display: flex; align-items: center; gap: 10px; }
.who { font-weight: 600; text-transform: capitalize; }
.engine-dot { width: 10px; height: 10px; border-radius: 50%; background: #bbb; }
.engine-dot.up { background: var(--green); box-shadow: 0 0 0 3px rgba(31, 157, 85, .2); }
.engine-dot.down { background: var(--red); box-shadow: 0 0 0 3px rgba(198, 40, 40, .2); }

main { max-width: 1240px; margin: 0 auto; padding: 28px 24px 80px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head p { margin: 6px 0 0; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.step { width: 26px; height: 26px; border-radius: 50%; background: var(--yellow); display: inline-grid; place-items: center; font-size: 14px; font-weight: 800; }

/* Stats */
.stats { display: flex; gap: 10px; flex-wrap: wrap; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 10px 16px; min-width: 110px; }
.stat b { display: block; font-size: 22px; font-weight: 800; }
.stat span { color: var(--muted); font-size: 13px; }

/* Chips */
.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: -4px 0 14px; }
.chip { border: 1px solid var(--line); background: var(--cream); border-radius: 999px; padding: 3px 10px; font-size: 13px; cursor: pointer; font-family: inherit; }
.chip:hover { border-color: var(--orange); color: var(--orange); }

.city-results { display: flex; flex-direction: column; gap: 6px; margin: -6px 0 12px; }
.city-results button { text-align: left; font: inherit; font-size: 13px; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--cream); cursor: pointer; }
.city-results button:hover, .city-results button.sel { border-color: var(--orange); background: #fff3ec; }

/* Toggles */
.toggles { display: flex; flex-direction: column; gap: 4px; }
.toggle { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; padding: 8px 0; margin: 0; }
.toggle input { display: none; }
.toggle > span { flex: none; width: 42px; height: 24px; border-radius: 999px; background: #ddd5bc; position: relative; transition: background .15s; margin-top: 2px; }
.toggle > span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: left .15s; }
.toggle input:checked + span { background: var(--orange); }
.toggle input:checked + span::after { left: 21px; }
.toggle b { display: block; }
.toggle small { margin: 0; display: block; }

.submit-bar { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; gap: 16px; background: var(--ink); color: #fff; padding: 16px 16px 16px 24px; border-radius: 999px; position: sticky; bottom: 16px; flex-wrap: wrap; }
.submit-bar .muted { color: #cfc6ad; }

/* Jobs */
.jobs { display: flex; flex-direction: column; gap: 12px; }
.job { display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: center; }
.job h4 { margin: 0 0 4px; font-size: 17px; }
.job .meta { color: var(--muted); font-size: 13px; display: flex; gap: 14px; flex-wrap: wrap; }
.job .kw { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px; }
.job .kw span { background: var(--cream); border: 1px solid var(--line); padding: 1px 9px; border-radius: 999px; font-size: 12px; }
.job .msg { margin-top: 8px; font-size: 13px; color: var(--ink-2); }
.job-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.job-nums { display: flex; gap: 18px; margin-right: 10px; }
.job-nums div { text-align: center; }
.job-nums b { display: block; font-size: 20px; font-weight: 800; }
.job-nums span { font-size: 12px; color: var(--muted); }
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: 3px 10px; border-radius: 999px; }
.status.queued { background: #eee8d6; color: var(--ink-2); }
.status.scraping, .status.enriching { background: #fff1c2; color: #8a6400; }
.status.done { background: #dff3e6; color: var(--green); }
.status.failed { background: #fbe1e1; color: var(--red); }
.progress { height: 6px; background: var(--cream-2); border-radius: 999px; overflow: hidden; margin-top: 10px; max-width: 420px; }
.progress div { height: 100%; background: linear-gradient(90deg, var(--orange), var(--yellow)); }
.progress.indet div { width: 35%; animation: indet 1.3s ease-in-out infinite; }
@keyframes indet { from { transform: translateX(-100%); } to { transform: translateX(300%); } }

/* Filters */
.filters { padding: 16px; margin-bottom: 14px; display: flex; flex-direction: column; gap: 12px; }
.filter-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.filter-row select { width: auto; margin: 0; min-width: 160px; }
.search-box { position: relative; flex: 1; min-width: 220px; }
.search-box i { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search-box input { margin: 0; padding-left: 36px; }
.pill { margin: 0; display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: 1.5px solid var(--line); border-radius: 999px; font-weight: 500; font-size: 13px; cursor: pointer; background: #fff; user-select: none; }
.pill input { display: none; }
.pill small { margin: 0; }
.pill:has(input:checked) { border-color: var(--orange); background: var(--orange); color: #fff; }
.pill:has(input:checked) small { color: #ffe3d6; }
label.mini { margin: 0; display: flex; align-items: center; gap: 8px; font-size: 13px; }
label.mini select { min-width: 90px; }
.export { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.export .check { margin: 0; }

/* Table */
.table-wrap { padding: 0; overflow-x: auto; }
table.leads { width: 100%; border-collapse: collapse; }
.leads th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 12px 16px; border-bottom: 1px solid var(--line); background: #fffef6; }
.leads td { padding: 12px 16px; border-bottom: 1px solid #f3eddb; vertical-align: top; font-size: 14px; }
.leads tr { cursor: pointer; }
.leads tbody tr:hover { background: #fffaf0; }
.leads .name { font-weight: 700; }
.leads .name .new { font-size: 10px; background: var(--yellow); padding: 1px 6px; border-radius: 6px; margin-left: 6px; vertical-align: middle; }
.leads .name .new.fresh { background: #dff3e6; color: var(--green); }
.leads .sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.leads .contact div { white-space: nowrap; }
.leads .contact i { width: 16px; color: var(--muted); }
.leads .none { color: #c5bca3; }
.socials { display: flex; gap: 8px; font-size: 17px; flex-wrap: wrap; }
.socials a { color: var(--ink-2); }
.socials a:hover { color: var(--orange); }
.site { font-size: 13px; display: block; max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-bottom: 4px; }
.rating { white-space: nowrap; }
.rating i { color: var(--yellow); }
.score { display: inline-block; min-width: 44px; text-align: center; font-weight: 800; padding: 3px 8px; border-radius: 999px; }
.score.hot { background: var(--orange); color: #fff; }
.score.warm { background: var(--yellow); color: var(--ink); }
.score.cold { background: var(--cream-2); color: var(--ink-2); }
.empty { text-align: center; padding: 50px 20px; color: var(--muted); }
.empty i { font-size: 34px; color: var(--line); display: block; margin-bottom: 10px; }
.pager { display: flex; justify-content: center; align-items: center; gap: 12px; margin-top: 16px; }

/* Drawer */
.drawer { position: fixed; inset: 0; z-index: 50; }
.drawer-bg { position: absolute; inset: 0; background: rgba(17, 17, 17, .35); }
.drawer-panel { position: absolute; right: 0; top: 0; bottom: 0; width: min(480px, 100%); background: #fff; padding: 28px; overflow-y: auto; box-shadow: -10px 0 40px rgba(0, 0, 0, .15); }
.drawer-close { position: absolute; right: 16px; top: 16px; }
.drawer h3 { font-size: 22px; margin: 0 30px 4px 0; display: block; }
.drawer dl { display: grid; grid-template-columns: 110px 1fr; gap: 10px 12px; margin: 20px 0; font-size: 14px; }
.drawer dt { color: var(--muted); }
.drawer dd { margin: 0; word-break: break-word; }
.copy { border: 0; background: none; color: var(--muted); cursor: pointer; padding: 0 4px; }
.copy:hover { color: var(--orange); }

.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 999px; z-index: 60; font-weight: 500; }
.toast.err { background: var(--red); }

/* Mobile */
@media (max-width: 860px) {
  .grid-2 { grid-template-columns: 1fr; }
  .topbar { padding: 10px 16px; gap: 10px; }
  .brand span, .tabs span, .who { display: none; }
  .tabs a { padding: 8px 14px; }
  main { padding: 20px 16px 80px; }
  h2 { font-size: 24px; }
  .job { grid-template-columns: 1fr; }
  .job-actions { justify-content: flex-start; }
  .submit-bar { border-radius: 20px; }
  .filter-row select { flex: 1; min-width: 0; }
  .leads th:nth-child(3), .leads td:nth-child(3) { display: none; }
}
