:root {
  --bg: #08111c;
  --bg-2: #0e1a2b;
  --panel: #122033;
  --line: #24384f;
  --text: #eaf1fb;
  --muted: #8ea3bd;
  --mint: #3ee0b3;
  --blue: #6ea8ff;
  --amber: #f0c36a;
  --rose: #ff7a8a;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: Outfit, system-ui, sans-serif;
  background:
    radial-gradient(1000px 480px at 10% -10%, #16324f 0%, transparent 55%),
    radial-gradient(800px 400px at 100% 0%, #123c35 0%, transparent 50%),
    var(--bg);
  color: var(--text);
}

.shell { width: min(1180px, calc(100% - 32px)); margin: 28px auto 64px; }
.login-shell { max-width: 480px; margin-top: 10vh; }
.login-card h1 { margin: 0 0 8px; font-size: 28px; }
.login-form { margin-top: 18px; }
.login-form button { width: 100%; margin-top: 8px; }
.top { display: flex; justify-content: space-between; gap: 24px; align-items: flex-start; margin-bottom: 18px; }
.top-aside { display: grid; gap: 10px; justify-items: end; max-width: 320px; }
.admin-bar {
  display: flex; align-items: center; gap: 12px;
  font-size: 13px; color: var(--muted);
}
.admin-bar a.ghost { text-decoration: none; padding: 6px 10px; }
.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 0;
}
.tab {
  width: auto;
  background: transparent;
  color: var(--muted);
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  padding: 10px 14px;
  margin-bottom: -1px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.tab:hover { color: var(--text); }
.tab.active {
  color: var(--mint);
  border-bottom-color: var(--mint);
}
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.eyebrow { margin: 0 0 6px; color: var(--mint); letter-spacing: 0.12em; text-transform: uppercase; font-size: 11px; font-weight: 600; }
h1 { margin: 0 0 8px; font-size: 34px; letter-spacing: -0.03em; }
.lede { margin: 0; max-width: 62ch; color: var(--muted); line-height: 1.5; }
.seed {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  color: var(--muted);
  font-size: 13px;
  max-width: 280px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.field { display: grid; gap: 6px; margin-bottom: 12px; }
.field span { font-size: 13px; color: var(--muted); }
.field input, .field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #0f1c2d;
  color: var(--text);
  padding: 10px 12px;
  font: inherit;
}
.field textarea { resize: vertical; min-height: 72px; }
code { font-family: "IBM Plex Mono", monospace; font-size: 12px; }
.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 220px;
  max-width: 340px;
}
.btn-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  margin: 0;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #183049;
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.btn-action:hover { border-color: var(--blue); color: #fff; }
.btn-action.primary {
  background: #1a4a3a;
  border-color: #2a6b54;
  color: var(--mint);
}
.btn-action.warn {
  background: #3a2e16;
  border-color: #6b5528;
  color: var(--amber);
}
.btn-action.danger {
  background: #3a1820;
  border-color: #6b2a38;
  color: var(--rose);
}
.btn-action.ok {
  background: #163428;
  border-color: #2a5a44;
  color: var(--mint);
}
.badge.active { color: var(--mint); }
.badge.disabled { color: var(--rose); }
.suite-card { width: min(720px, calc(100vw - 32px)); max-width: 720px; }
.suite-text {
  width: 100%;
  min-height: 280px;
  margin: 10px 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #0a1522;
  color: var(--text);
  padding: 12px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  line-height: 1.45;
  resize: vertical;
}
.mode-toggle { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 4px; }
.mode-card {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 10px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  background: #0f1c2d;
  cursor: pointer;
}
.mode-card:has(input:checked) { border-color: var(--mint); box-shadow: inset 0 0 0 1px var(--mint); }
.mode-card b { display: block; margin-bottom: 3px; }
.mode-card p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.4; }
.stat {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px 18px;
  box-shadow: var(--shadow);
}
.stat b { display: block; font-size: 28px; font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-size: 13px; }
.stat.good {
  background: linear-gradient(160deg, #12382f 0%, #0f2433 70%);
  border-color: color-mix(in srgb, var(--mint) 45%, var(--line));
}
.stat.good b { color: var(--mint); }
.stat.good span { color: color-mix(in srgb, var(--mint) 70%, var(--muted)); }
.stat.bad {
  background: linear-gradient(160deg, #3a1b22 0%, #1a1528 70%);
  border-color: color-mix(in srgb, var(--rose) 45%, var(--line));
}
.stat.bad b { color: var(--rose); }
.stat.bad span { color: color-mix(in srgb, var(--rose) 65%, var(--muted)); }
.stat.warn {
  background: linear-gradient(160deg, #3a2a16 0%, #1a2230 70%);
  border-color: color-mix(in srgb, var(--amber) 45%, var(--line));
}
.stat.warn b { color: var(--amber); }
.stat.warn span { color: color-mix(in srgb, var(--amber) 65%, var(--muted)); }
.stat.neutral {
  background: linear-gradient(160deg, #1a2d45 0%, var(--panel) 75%);
  border-color: color-mix(in srgb, var(--blue) 40%, var(--line));
}
.stat.neutral b { color: var(--blue); }
.stat.neutral span { color: color-mix(in srgb, var(--blue) 55%, var(--muted)); }

.layout { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 16px; margin-bottom: 16px; }
.panel {
  background: color-mix(in srgb, var(--panel) 92%, white 0%);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
  box-shadow: var(--shadow);
}
h2 { margin: 0 0 14px; font-size: 18px; }
.section-label { margin: 16px 0 8px; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; }
.section-hint { text-transform: none; letter-spacing: 0; font-weight: 400; opacity: 0.8; }

.drop {
  display: grid;
  gap: 4px;
  place-items: start;
  border: 1px dashed #35506d;
  background: #0d1b2c;
  border-radius: 14px;
  padding: 18px;
  cursor: pointer;
}
.drop.drag { border-color: var(--mint); background: #123142; }
.drop input { display: none; }
.drop strong { font-size: 15px; }
.drop span { color: var(--muted); font-size: 13px; }

.scrapers { display: grid; gap: 8px; }
.scraper-card {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 10px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  background: #0f1c2d;
  cursor: pointer;
}
.scraper-card:has(input:checked) { border-color: var(--mint); box-shadow: inset 0 0 0 1px var(--mint); }
.scraper-card b { display: block; margin-bottom: 3px; }
.scraper-card p, .scraper-card em { margin: 0; color: var(--muted); font-size: 12px; font-style: normal; line-height: 1.4; }
.scraper-card em { display: block; margin-top: 4px; color: #a9bdd6; }

.check { display: flex; gap: 8px; align-items: center; margin: 14px 0; color: var(--muted); font-size: 13px; }
button {
  width: 100%;
  border: 0;
  border-radius: 12px;
  padding: 12px 14px;
  background: linear-gradient(90deg, var(--mint), #6ee7c5);
  color: #06231b;
  font: 650 15px Outfit, sans-serif;
  cursor: pointer;
}
button:disabled { opacity: 0.55; cursor: not-allowed; }
.hint { min-height: 18px; margin: 10px 0 0; color: var(--amber); font-size: 13px; }

.detail-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.download {
  color: #072017;
  background: var(--mint);
  text-decoration: none;
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 650;
}
.hidden { display: none !important; }
.meta { color: var(--muted); font-size: 13px; margin-bottom: 12px; line-height: 1.45; }
.bar { height: 8px; background: #0c1828; border-radius: 99px; overflow: hidden; margin-bottom: 12px; }
.bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--blue), var(--mint)); transition: width 0.25s ease; }
.log {
  margin: 0;
  height: 320px;
  overflow: auto;
  background: #071018;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  color: #c5d8ee;
  font: 12.5px/1.45 "IBM Plex Mono", ui-monospace, monospace;
  white-space: pre-wrap;
}

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 500; }
.badge { display: inline-block; border-radius: 999px; padding: 2px 8px; font-size: 12px; }
.queued { background: #243044; color: #c9d7ea; }
.running { background: #16324a; color: var(--blue); }
.completed { background: #12382f; color: var(--mint); }
.failed { background: #3a1b22; color: var(--rose); }
.cancelled { background: #3a2a16; color: var(--amber); }
.linkish { color: var(--blue); background: none; border: 0; padding: 0; width: auto; font-weight: 600; cursor: pointer; }
.danger-link { color: var(--rose); }
.detail-actions { display: flex; gap: 8px; align-items: center; }
.ghost {
  width: auto;
  background: #1a2a3d;
  color: var(--text);
  border: 1px solid var(--line);
  padding: 7px 12px;
  font-size: 13px;
}
.ghost.danger { color: var(--rose); border-color: #5a2a33; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.records-panel { margin-top: 16px; }
.records-filters {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}
.records-filters input,
.records-filters select {
  width: 100%;
  border: 1px solid var(--line);
  background: #0f1c2d;
  color: var(--text);
  border-radius: 10px;
  padding: 9px 11px;
  font: inherit;
}
.records-pager {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 12px;
}
.badge.clean { background: #12382f; color: var(--mint); }
.badge.honeypot { background: #3a1b22; color: var(--rose); }
.badge.pending { background: #3a2a16; color: var(--amber); }
.badge.dnc { background: #3a1b22; color: var(--rose); }
.badge.clear { background: #12382f; color: var(--mint); }

.modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal.hidden { display: none; }
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 10, 18, 0.72);
}
.modal-card {
  position: relative;
  width: min(440px, 100%);
  background: #132033;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px 22px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
}
.modal-card h3 { margin: 0 0 8px; font-size: 18px; }
.modal-body { margin: 0 0 14px; color: var(--muted); font-size: 14px; line-height: 1.45; }
.modal-options {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}
.modal-options label {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
}
.modal-confirm-label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 6px;
}
.modal-confirm-input {
  width: 100%;
  border: 1px solid var(--line);
  background: #0f1c2d;
  color: var(--text);
  border-radius: 10px;
  padding: 9px 11px;
  font: inherit;
  margin-bottom: 10px;
}
.modal-error {
  color: var(--rose);
  font-size: 13px;
  margin: 0 0 10px;
}
.modal-error.hidden { display: none; }
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 6px;
}

@media (max-width: 900px) {
  .records-filters { grid-template-columns: 1fr 1fr; }
  .top, .layout, .stats, .mode-toggle { grid-template-columns: 1fr 1fr; display: grid; }
  .stats { grid-template-columns: 1fr 1fr; }
  .top { align-items: stretch; }
  h1 { font-size: 28px; }
}
