/* Prospect Finder styles */

/* Contacts grouped by business type */
.contacts-group-header td {
  background: var(--gray-100, #f3f4f6);
  padding: .45rem .75rem;
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--gray-700);
  border-top: 2px solid var(--gray-200);
  cursor: pointer;
  user-select: none;
}
.contacts-group-header:hover td { background: var(--gray-200); }

.contacts-group-chevron {
  display: inline-block;
  margin-right: .4rem;
  font-size: .7rem;
  transition: transform .2s;
}
.contacts-group-header.collapsed .contacts-group-chevron { transform: rotate(-90deg); }

.contacts-group-row.hidden { display: none; }

.prospect-search-form {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: flex-start;
}

.prospect-search-form .form-group { margin-bottom: 0; }

/* Confirmed designation input */
#desig-input.desig-confirmed {
  border-color: #00b050;
  background: #f0faf4;
}

/* Searchable dropdown */
.prospect-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid var(--gray-200);
  border-top: none;
  border-radius: 0 0 6px 6px;
  max-height: 260px;
  overflow-y: auto;
  z-index: 500;
  box-shadow: 0 4px 12px rgba(0,0,0,.1);
}

.prospect-dropdown-item {
  padding: .5rem .75rem;
  cursor: pointer;
  font-size: .875rem;
}
.prospect-dropdown-item:hover,
.prospect-dropdown-item.active { background: #fff5f5; color: var(--bni-red); }

/* Progress bar */
.progress-bar-wrap {
  background: var(--gray-200);
  border-radius: 999px;
  height: 10px;
  overflow: hidden;
}
.progress-bar-fill {
  height: 10px;
  background: linear-gradient(90deg, var(--bni-red), var(--bni-yellow));
  border-radius: 999px;
  transition: width .4s ease;
}

/* Business result card */
.biz-card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: .75rem;
  overflow: hidden;
}

.biz-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .9rem 1rem;
  cursor: pointer;
  user-select: none;
  gap: .5rem;
}

.biz-card-header:hover { background: #fafafa; }

.biz-name {
  font-weight: 700;
  font-size: .95rem;
}

.biz-meta {
  font-size: .78rem;
  color: var(--gray-700);
  margin-top: .15rem;
}

.biz-meta a { color: var(--bni-red); text-decoration: none; }
.biz-meta a:hover { text-decoration: underline; }

.biz-rating {
  font-size: .8rem;
  color: #f9a800;
  white-space: nowrap;
}

.biz-expand-icon {
  font-size: 1rem;
  color: var(--gray-700);
  transition: transform .2s;
  flex-shrink: 0;
}
.biz-card.open .biz-expand-icon { transform: rotate(180deg); }

.biz-body {
  display: none;
  border-top: 1px solid var(--gray-200);
  padding: .75rem 1rem;
}
.biz-card.open .biz-body { display: block; }

/* Contacts inside business card */
.contact-list { margin-bottom: .75rem; }
.contact-row {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .35rem 0;
  border-bottom: 1px solid var(--gray-200);
  font-size: .85rem;
  flex-wrap: wrap;
}
.contact-row:last-child { border-bottom: none; }

.contact-name  { font-weight: 600; min-width: 140px; }
.contact-title { color: var(--gray-700); font-size: .78rem; }
.contact-email { color: var(--bni-red); }
.contact-email a { color: inherit; text-decoration: none; }
.contact-email a:hover { text-decoration: underline; }

.no-contacts { color: var(--gray-700); font-size: .85rem; font-style: italic; }

/* Visitor edit inline row */
.visitor-editing td { background: #fffbe6; }
.visitor-edit-input {
  width: 100%;
  padding: .25rem .4rem;
  border: 1px solid var(--gray-200);
  border-radius: 4px;
  font-size: .85rem;
}

/* Linked business badge */
.linked-biz {
  font-size: .78rem;
  background: #e3f2fd;
  color: #1565c0;
  padding: .15rem .5rem;
  border-radius: 4px;
  display: inline-block;
}

/* Businesses grouped by designation */
.biz-group { margin-bottom: .25rem; }

.biz-group-header {
  display: flex;
  align-items: center;
  gap: .4rem;
  padding: .45rem .75rem;
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--gray-700);
  background: var(--gray-100, #f3f4f6);
  border-top: 2px solid var(--gray-200);
  cursor: pointer;
  user-select: none;
}
.biz-group-header:hover { background: var(--gray-200); }
.biz-group-header.collapsed .contacts-group-chevron { transform: rotate(-90deg); }

/* Find More Businesses toggle row */
.biz-find-toggle {
  display: flex;
  align-items: center;
  gap: .4rem;
  cursor: pointer;
  user-select: none;
}
.biz-find-toggle:hover { opacity: .8; }

@media (max-width: 640px) {
  .prospect-search-form { flex-direction: column; }
  .prospect-search-form .form-group { width: 100%; }
}

/* ── Crawl cards (per-search progress cards) ─────────────────────────────── */

.crawl-card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-left: 4px solid var(--bni-red);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 1rem;
  overflow: hidden;
}

.crawl-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .85rem 1rem;
  gap: .75rem;
}

.crawl-card-title {
  font-weight: 700;
  font-size: .95rem;
}

.crawl-card-sub {
  font-size: .78rem;
  color: var(--gray-700);
  margin-top: .1rem;
}

.crawl-card-actions {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-shrink: 0;
}

.crawl-card-close {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.2rem;
  line-height: 1;
  color: var(--gray-700);
  padding: 0 .15rem;
  margin-left: .25rem;
}
.crawl-card-close:hover { color: var(--bni-red); }

.biz-crawl-error {
  font-size: .82rem;
  color: #b71c1c;
  background: #fff5f5;
  border: 1px solid #ffcdd2;
  border-radius: 4px;
  padding: .4rem .65rem;
  margin-bottom: .6rem;
}

.crawled-badge {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .2rem .6rem;
  background: #e6f4ea;
  color: #2e7d32;
  border: 1px solid #a5d6a7;
  border-radius: 4px;
  font-size: .78rem;
  font-weight: 600;
  cursor: default;
  user-select: none;
}

.crawl-progress-wrap {
  padding: 0 1rem .85rem;
}

.crawl-status-text {
  font-size: .85rem;
  color: var(--gray-700);
  margin-top: .4rem;
}

.crawl-status-error {
  color: var(--bni-red);
  font-weight: 600;
  font-size: .9rem;
  background: #fde8e8;
  border-radius: 4px;
  padding: .4rem .6rem;
  margin-top: .5rem;
}

.crawl-results {
  border-top: 1px solid var(--gray-200);
  padding: .75rem 1rem;
}

.badge.danger {
  background: #fde8e8;
  color: var(--bni-red);
}

/* ── Template picker ─────────────────────────────────────────────────────── */

.template-picker-item {
  padding: .75rem 1rem;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  margin-bottom: .5rem;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}

.template-picker-item:hover {
  border-color: var(--bni-red);
  background: #fff5f5;
}

.template-picker-name {
  font-weight: 600;
  font-size: .9rem;
}

.template-picker-subject {
  font-size: .8rem;
  color: var(--gray-700);
  margin-top: .15rem;
}

/* ── Template management cards ───────────────────────────────────────────── */

.template-card {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: .9rem 1rem;
  margin-bottom: .75rem;
  box-shadow: var(--shadow);
}

.template-card-info { flex: 1; min-width: 0; }

.template-card-name {
  font-weight: 700;
  font-size: .95rem;
}

.template-card-subject {
  font-size: .82rem;
  color: var(--gray-700);
  margin-top: .15rem;
}

.template-card-preview {
  font-size: .78rem;
  color: var(--gray-500, #9ca3af);
  margin-top: .25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
