:root {
  --bg: #f5f6f8; --card: #fff; --text: #1d2330; --muted: #6b7385; --line: #e3e6ec;
  --accent: #1f6feb; --accent-dark: #1858c4;
  --ok-bg: #e7f6ec; --ok: #1a7f3c; --err-bg: #fdecec; --err: #b42318; --info-bg: #eaf2fe; --info: #1d4ed8;
}
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); }
a { color: var(--accent); }

.topbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px;
  padding: 12px 20px; background: #111827; color: #fff; }
.topbar .brand { color: #fff; font-weight: 700; font-size: 18px; text-decoration: none; }
.topbar nav { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.topbar nav a { color: #cbd5e1; text-decoration: none; }
.topbar nav a:hover { color: #fff; }
.topbar .who { color: #94a3b8; }

.wrap { max-width: 1200px; margin: 24px auto; padding: 0 16px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 20px 24px; margin-bottom: 20px; }
.card.narrow { max-width: 420px; margin: 40px auto; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
h1 { font-size: 22px; margin: 0 0 16px; }
h2 { font-size: 18px; margin: 0 0 12px; }

label { display: block; margin-bottom: 14px; font-weight: 500; }
input[type=text], input[type=email], input[type=password], select {
  display: block; width: 100%; margin-top: 4px; padding: 10px 12px; font: inherit;
  border: 1px solid var(--line); border-radius: 6px; background: #fff; }
input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
button, .btn-secondary { padding: 10px 18px; font: inherit; font-weight: 600; border-radius: 6px; cursor: pointer; text-decoration: none; display: inline-block; }
button { background: var(--accent); color: #fff; border: 0; }
button:hover { background: var(--accent-dark); }
button:disabled { opacity: .6; cursor: wait; }
.btn-secondary { background: #fff; color: var(--text); border: 1px solid var(--line); }

.search-row { display: flex; gap: 8px; flex-wrap: wrap; }
.search-row input { flex: 1 1 260px; margin: 0; }
.search-row select { width: auto; margin: 0; }

.notice { padding: 10px 14px; border-radius: 6px; margin: 12px 0; }
.notice.ok { background: var(--ok-bg); color: var(--ok); }
.notice.err { background: var(--err-bg); color: var(--err); }
.notice.info { background: var(--info-bg); color: var(--info); }
.muted { color: var(--muted); font-weight: normal; }
.small { font-size: 13px; }

.table-scroll { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th, table.data td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data th { font-size: 12px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
table.data tr:hover td { background: #fafbfc; }
td.actions a { margin-right: 10px; }

.tag { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 12px; background: #eef0f4; color: var(--muted); }
.tag.done { background: var(--ok-bg); color: var(--ok); }
.tag.error { background: var(--err-bg); color: var(--err); }
.tag.running { background: var(--info-bg); color: var(--info); }
.tag.none { background: #fff4e5; color: #b45309; }

.add-user { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 14px; align-items: end; }
.add-user button { margin-bottom: 14px; }
label.check { display: flex; gap: 8px; align-items: center; font-weight: normal; }
label.check input { width: auto; margin: 0; }
.temp-pw { margin: 8px 0 4px; }
.temp-pw code { font-size: 18px; background: #fff; padding: 4px 10px; border-radius: 4px; border: 1px solid var(--line); user-select: all; }
form.inline { display: inline; }
button.link { background: none; border: 0; padding: 0; margin-right: 10px; color: var(--accent); font-weight: normal; font-size: 14px; }
button.link:hover { background: none; text-decoration: underline; }
.topbar nav a.who { color: #94a3b8; }

/* Search progress */
.steps { list-style: none; padding: 0; margin: 14px 0 4px; }
.steps li { padding: 4px 0; color: var(--muted); }
.steps .dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--line); margin-right: 6px; }
.steps li.active { color: var(--text); font-weight: 600; }
.steps li.active .dot { background: var(--accent); animation: pulse 1s infinite alternate; }
.steps li.done { color: var(--text); }
.steps li.done .dot { background: var(--ok); }
.steps li.failed .dot { background: var(--err); }
.steps li.failed .step-note { color: var(--err); }
.steps li.skipped .dot { background: #cbd5e1; }
.step-note { font-weight: normal; color: var(--muted); }
@keyframes pulse { from { opacity: .35; } to { opacity: 1; } }

/* Sales point tags */
.tag.hot { background: #fde8e8; color: #b42318; }
.tag.seo { background: #ede9fe; color: #5b21b6; }
.tag.site { background: #fff4e5; color: #b45309; }
.tag.reviews { background: #e0f2fe; color: #075985; }
.tag.info { background: #eef0f4; color: var(--muted); }
td.pitch .tag { margin: 0 2px 4px 0; }

.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-row .btn-secondary { padding: 7px 12px; font-size: 14px; }
.nowrap { white-space: nowrap; }
table.results tr.result-row { cursor: pointer; }
tr.detail td { background: #fafbfc; }
.detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; font-size: 13px; }
.detail-grid ul { margin: 4px 0 0; padding-left: 18px; max-height: 220px; overflow: auto; }

.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.filters input[type=text] { flex: 1 1 220px; width: auto; margin: 0; }
.filters select { width: auto; margin: 0; }
.filters label.check { margin: 0; }

.pager { display: flex; gap: 16px; justify-content: center; align-items: center; margin-top: 16px; }
table.results td:nth-child(2) { min-width: 150px; }
table.results td a { overflow-wrap: anywhere; }
