/* Leadradar -- Design-Tokens
   Farben:
     --bg        #0E1113  Basis, kuehles Fast-Schwarz
     --surface   #161A1D  Panels
     --surface-2 #1D2226  Panel-Header / Tabellenkopf
     --border    #262B2F  Trennlinien
     --text      #E7E9EA  Haupttext
     --muted     #8B949E  Sekundaertext
     --accent    #FF8A3D  Signalfarbe (Aktionen, Fokus)
     --opp       #4FD18B  "Opportunity" -- Treffer ohne Website
   Typo:
     UI/Fliesstext -> System-Sans (kein CDN-Font, laeuft auch offline auf dem Server)
     Daten/Log      -> System-Mono
*/

* { box-sizing: border-box; }

:root {
  --bg: #0E1113;
  --surface: #161A1D;
  --surface-2: #1D2226;
  --border: #262B2F;
  --text: #E7E9EA;
  --muted: #8B949E;
  --accent: #FF8A3D;
  --opp: #4FD18B;
  --font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
}

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
}

.wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 40px 24px 64px;
}

/* Header */

.head {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 28px;
}

.head__mark {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ping {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--opp);
  box-shadow: 0 0 0 0 rgba(79, 209, 139, 0.6);
  animation: ping 2.2s ease-out infinite;
}

@keyframes ping {
  0%   { box-shadow: 0 0 0 0 rgba(79, 209, 139, 0.55); }
  70%  { box-shadow: 0 0 0 12px rgba(79, 209, 139, 0); }
  100% { box-shadow: 0 0 0 0 rgba(79, 209, 139, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .ping { animation: none; }
}

.head h1 {
  margin: 0;
  font-size: 22px;
  letter-spacing: -0.01em;
}

.head p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 14px;
}

/* Panels */

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.panel__title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
  border-radius: 10px 10px 0 0;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--muted);
}

.count {
  color: var(--text);
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
}

/* Form */

.form {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 16px;
  padding: 18px;
  margin-bottom: 20px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1 1 200px;
}

.field--small {
  flex: 0 1 100px;
}

.field label {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.field input {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 10px 12px;
  color: var(--text);
  font-size: 14px;
  font-family: var(--font-ui);
}

.field input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  padding-bottom: 10px;
  white-space: nowrap;
}

.checkbox input {
  accent-color: var(--accent);
  width: 15px;
  height: 15px;
}

.btn {
  border-radius: 7px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  font-family: var(--font-ui);
}

.btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.btn--primary {
  background: var(--accent);
  color: #1A0F04;
}

.btn--primary:hover { filter: brightness(1.08); }
.btn--primary:disabled { opacity: 0.5; cursor: default; }

.btn--ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}

.btn--ghost:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.btn--ghost:disabled { opacity: 0.4; cursor: default; }

/* Grid: Log + Results */

.grid {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 20px;
  align-items: start;
}

@media (max-width: 900px) {
  .grid { grid-template-columns: 1fr; }
}

.log-panel { min-height: 420px; display: flex; flex-direction: column; }

.log {
  margin: 0;
  padding: 14px 16px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.6;
  color: #A9F5C4;
  overflow-y: auto;
  max-height: 420px;
  white-space: pre-wrap;
  word-break: break-word;
}

.log__hint { color: var(--muted); }

.log__line { display: block; }
.log__line--lead { color: var(--text); }
.log__line--done { color: var(--accent); font-weight: 600; }

.status {
  font-size: 11px;
  padding: 3px 9px;
  border-radius: 999px;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 600;
}

.status--idle { background: rgba(139,148,158,0.15); color: var(--muted); }
.status--running { background: rgba(255,138,61,0.15); color: var(--accent); }
.status--done { background: rgba(79,209,139,0.15); color: var(--opp); }

/* Results table */

.results-panel { min-height: 420px; }

.table-scroll {
  max-height: 420px;
  overflow-y: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

thead th {
  position: sticky;
  top: 0;
  background: var(--surface-2);
  text-align: left;
  padding: 10px 14px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
}

tbody td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

tbody tr:last-child td { border-bottom: none; }

.empty-row td {
  color: var(--muted);
  text-align: center;
  padding: 40px 14px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.pill--opp {
  background: rgba(79,209,139,0.14);
  color: var(--opp);
}

.pill--has {
  background: rgba(139,148,158,0.14);
  color: var(--muted);
}

.pill--has a { color: inherit; text-decoration: underline; }

.pill--check {
  background: rgba(255,138,61,0.14);
  color: var(--accent);
}

.pill--check a { color: inherit; text-decoration: underline; }

tr.row--opp { background: rgba(79,209,139,0.04); }

/* Login page */

.wrap--login {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-box {
  width: 100%;
  max-width: 360px;
  padding: 28px;
}

.head--login { margin-bottom: 22px; }

.login-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.login-error {
  background: rgba(255,138,61,0.12);
  color: var(--accent);
  border: 1px solid rgba(255,138,61,0.3);
  border-radius: 7px;
  padding: 8px 12px;
  font-size: 13px;
  margin: 0 0 16px;
}

.btn--block { width: 100%; text-align: center; }

/* Logout link in Dashboard-Header */

.head__actions {
  margin-left: auto;
}

.head__actions a {
  color: var(--muted);
  font-size: 13px;
  text-decoration: none;
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 8px 14px;
}

.head__actions a:hover {
  border-color: var(--accent);
  color: var(--accent);
}
