*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #0f1117;
  color: #e2e8f0;
  min-height: 100vh;
  padding: 24px 16px;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

h1 {
  font-size: 1.1rem;
  font-weight: 600;
  color: #94a3b8;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

#meta { font-size: 0.8rem; color: #475569; }

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 5px 14px;
  border-radius: 20px;
  border: 1px solid #2d3748;
  background: transparent;
  color: #94a3b8;
  font-size: 0.78rem;
  cursor: pointer;
  transition: all 0.15s;
}
.filter-btn:hover  { border-color: #4a5568; color: #cbd5e1; }
.filter-btn.active { background: #1e40af; border-color: #1e40af; color: #fff; }

#refresh-btn {
  padding: 5px 14px;
  border-radius: 20px;
  border: 1px solid #2d3748;
  background: transparent;
  color: #64748b;
  font-size: 0.78rem;
  cursor: pointer;
  transition: all 0.15s;
}
#refresh-btn:hover { border-color: #4a5568; color: #94a3b8; }

#grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
}

/* ─── Card ─────────────────────────────────────────────────────────────────── */

.card {
  background: #161b27;
  border: 1px solid #1e2535;
  border-radius: 10px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color 0.15s;
}
.card:hover { border-color: #2d3748; }

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.company {
  font-size: 1.05rem;
  font-weight: 700;
  color: #f1f5f9;
  line-height: 1.3;
  flex: 1;
}

.badges {
  display: flex;
  gap: 5px;
  align-items: center;
  flex-shrink: 0;
}

/* Status badges */
.badge {
  font-size: 0.68rem;
  padding: 3px 9px;
  border-radius: 12px;
  font-weight: 500;
  white-space: nowrap;
}
.badge-active { background: #1e2535; color: #64748b; }
.badge-done   { background: #14532d; color: #4ade80; }
.badge-dead   { background: #3b1a1a; color: #f87171; }
.badge-hot    { background: #7f1d1d; color: #fca5a5; }
.badge-cold   { background: #1e3a5f; color: #60a5fa; }
.badge-nw     { background: #2d1b69; color: #a78bfa; }

/* Score badge */
.score-badge {
  font-size: 0.72rem;
  padding: 3px 8px;
  border-radius: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.score-hi  { background: #7f1d1d; color: #fca5a5; }
.score-mid { background: #78350f; color: #fde68a; }
.score-lo  { background: #1e2535; color: #94a3b8; }

/* Contact */
.contact-row {
  font-size: 0.82rem;
  color: #94a3b8;
}
.role { color: #64748b; font-size: 0.75rem; }

/* ─── Tags ──────────────────────────────────────────────────────────────────── */

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  font-size: 0.76rem;
  padding: 3px 10px;
  border-radius: 12px;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  max-width: 260px;
  text-overflow: ellipsis;
  display: inline-block;
}
.tag-url       { background: #1e3a5f; color: #60a5fa; border: 1px solid #1d4ed8; }
.tag-url:hover { background: #1d4ed8; color: #fff; }
.tag-email       { background: #1a2f1a; color: #4ade80; border: 1px solid #166534; }
.tag-email:hover { background: #166534; color: #fff; }
.tag-no-email  { background: #1e2535; color: #475569; border: 1px solid #334155; }
.tag-dead      { background: #3b1a1a; color: #f87171; border: 1px solid #7f1d1d; }

/* ─── PSI scores ────────────────────────────────────────────────────────────── */

.psi-section {
  display: flex;
  flex-direction: column;
  gap: 5px;
  background: #0e1420;
  border-radius: 6px;
  padding: 8px 10px;
}

.psi-row {
  display: flex;
  align-items: center;
  gap: 3px;
  flex-wrap: wrap;
}

.psi-dev {
  font-size: 0.65rem;
  color: #475569;
  font-weight: 600;
  text-transform: uppercase;
  width: 28px;
  flex-shrink: 0;
}

.psi-key {
  font-size: 0.63rem;
  color: #374151;
  margin-left: 5px;
}

.pn {
  font-size: 0.74rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  min-width: 30px;
  text-align: center;
  display: inline-block;
}
.pn-hi  { background: #14532d; color: #4ade80; }
.pn-mid { background: #78350f; color: #fde68a; }
.pn-lo  { background: #7f1d1d; color: #fca5a5; }
.pn-na  { color: #374151; font-weight: 400; }

/* ─── Notes ─────────────────────────────────────────────────────────────────── */

.notes-box {
  background: #1a2236;
  border-left: 3px solid #3b82f6;
  border-radius: 0 6px 6px 0;
  padding: 10px 12px;
  font-size: 0.82rem;
  color: #cbd5e1;
  line-height: 1.6;
}

.card-footer {
  font-size: 0.7rem;
  color: #374151;
  margin-top: 2px;
}

#empty {
  grid-column: 1 / -1;
  text-align: center;
  color: #374151;
  padding: 60px 0;
  font-size: 0.9rem;
}

/* ─── Responsive ─────────────────────────────────────────────────────────────── */

@media (max-width: 480px) {
  body   { padding: 16px 12px; }
  header { flex-direction: column; align-items: flex-start; }
  #grid  { grid-template-columns: 1fr; }
}
